Skip to content

Instantly share code, notes, and snippets.

@crykn
crykn / clipboard.js
Last active March 11, 2022 17:25
A simple copy to clipboard button; is used at https://github.com/libgdx/libgdx.github.io
/* Simple copy to clipboard action
* ---
* This script adds a simple "copy to clipboard" button to code elements located within <pre> elements.
* Requires jQuery. Can be used with the Jekyll Minimal Mistakes theme by adding it to the 'after_footer_scripts'.
*/
function sleep(ms) {
return new Promise(resolve => setTimeout(resolve, ms));
}
async function onClickEffect(btn, style) {
@crykn
crykn / SeaShaderExample.java
Last active February 17, 2021 20:01
This is a simple example of how to render this sea shader (http://glslsandbox.com/e#69872.0) in libGDX.
package issue.test;
import com.badlogic.gdx.ApplicationAdapter;
import com.badlogic.gdx.Gdx;
import com.badlogic.gdx.backends.lwjgl3.Lwjgl3Application;
import com.badlogic.gdx.backends.lwjgl3.Lwjgl3ApplicationConfiguration;
import com.badlogic.gdx.graphics.Color;
import com.badlogic.gdx.graphics.GL20;
import com.badlogic.gdx.graphics.Mesh;
import com.badlogic.gdx.graphics.glutils.ShaderProgram;
@crykn
crykn / switch_to_lwjgl3.md
Last active October 17, 2022 06:06
How to switch to libGDX's LWJGL3 backend

How to switch your libGDX project to LWJGL 3


--- This guide is now available on libgdx.com. Check it out here. If you have any questions, join us on Discord! ---


  1. To switch to libGDX's LWJGL 3 backend, open your root build.gradle file and replace the LWJGL backend dependency:
/*
* Copyright 2020 eskalon
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at:
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
@crykn
crykn / build.gradle
Last active March 11, 2022 17:31
A proof of concept for automatically fetching the versions of libGDX's Gradle dependencies from an API endpoint.
buildscript {
apply from: 'gradle/libgdx-versions.gradle'
repositories {
mavenLocal()
mavenCentral()
maven { url "https://plugins.gradle.org/m2/" }
maven { url "https://oss.sonatype.org/content/repositories/snapshots/" }
jcenter()
google()