diff --git a/.github/workflows/build-publish.yml b/.github/workflows/build-publish.yml index 48e39a51404..ffed74f7bbd 100644 --- a/.github/workflows/build-publish.yml +++ b/.github/workflows/build-publish.yml @@ -138,10 +138,11 @@ jobs: sudo apt install -y --force-yes gcc g++ sudo apt install -y --force-yes gcc-aarch64-linux-gnu g++-aarch64-linux-gnu libc6-dev-arm64-cross sudo apt install -y --force-yes gcc-arm-linux-gnueabihf g++-arm-linux-gnueabihf libc6-dev-armhf-cross + sudo apt install -y --force-yes gcc-riscv64-linux-gnu g++-riscv64-linux-gnu libc6-dev-riscv64-cross - name: Build Linux natives run: | - ./gradlew jniGen jnigenBuildLinux64 jnigenBuildLinuxARM jnigenBuildLinuxARM64 + ./gradlew jniGen jnigenBuildLinux64 jnigenBuildLinuxARM jnigenBuildLinuxARM64 jnigenBuildLinuxRISCV64 - name: Pack artifacts run: | diff --git a/backends/gdx-backend-lwjgl/src/com/badlogic/gdx/backends/lwjgl/LwjglCanvas.java b/backends/gdx-backend-lwjgl/src/com/badlogic/gdx/backends/lwjgl/LwjglCanvas.java index 7a9219d0ecf..078ffb8281e 100644 --- a/backends/gdx-backend-lwjgl/src/com/badlogic/gdx/backends/lwjgl/LwjglCanvas.java +++ b/backends/gdx-backend-lwjgl/src/com/badlogic/gdx/backends/lwjgl/LwjglCanvas.java @@ -22,6 +22,7 @@ import java.util.Map; import com.badlogic.gdx.backends.lwjgl.audio.LwjglAudio; +import com.badlogic.gdx.utils.*; import org.lwjgl.opengl.AWTGLCanvas; import org.lwjgl.opengl.Display; @@ -36,10 +37,6 @@ import com.badlogic.gdx.Net; import com.badlogic.gdx.Preferences; import com.badlogic.gdx.backends.lwjgl.audio.OpenALLwjglAudio; -import com.badlogic.gdx.utils.Array; -import com.badlogic.gdx.utils.Clipboard; -import com.badlogic.gdx.utils.Null; -import com.badlogic.gdx.utils.SharedLibraryLoader; import java.awt.Canvas; import java.awt.Container; @@ -96,7 +93,7 @@ public final void addNotify () { scaleX = (float)transform.getScaleX(); scaleY = (float)transform.getScaleY(); - if (SharedLibraryLoader.isMac) { + if (SharedLibraryLoader.os == Os.MacOsX) { EventQueue.invokeLater(new Runnable() { public void run () { create(); diff --git a/backends/gdx-backend-lwjgl/src/com/badlogic/gdx/backends/lwjgl/LwjglCursor.java b/backends/gdx-backend-lwjgl/src/com/badlogic/gdx/backends/lwjgl/LwjglCursor.java index a56a39e37c9..39494879c25 100644 --- a/backends/gdx-backend-lwjgl/src/com/badlogic/gdx/backends/lwjgl/LwjglCursor.java +++ b/backends/gdx-backend-lwjgl/src/com/badlogic/gdx/backends/lwjgl/LwjglCursor.java @@ -4,6 +4,7 @@ import java.nio.ByteOrder; import java.nio.IntBuffer; +import com.badlogic.gdx.utils.Os; import org.lwjgl.LWJGLException; import com.badlogic.gdx.Gdx; @@ -16,7 +17,7 @@ public class LwjglCursor implements Cursor { org.lwjgl.input.Cursor lwjglCursor = null; public LwjglCursor (Pixmap pixmap, int xHotspot, int yHotspot) { - if (((LwjglGraphics)Gdx.graphics).canvas != null && SharedLibraryLoader.isMac) { + if (((LwjglGraphics)Gdx.graphics).canvas != null && SharedLibraryLoader.os == Os.MacOsX) { return; } try { diff --git a/backends/gdx-backend-lwjgl/src/com/badlogic/gdx/backends/lwjgl/LwjglGraphics.java b/backends/gdx-backend-lwjgl/src/com/badlogic/gdx/backends/lwjgl/LwjglGraphics.java index ebb0b1cdbce..987b7009187 100644 --- a/backends/gdx-backend-lwjgl/src/com/badlogic/gdx/backends/lwjgl/LwjglGraphics.java +++ b/backends/gdx-backend-lwjgl/src/com/badlogic/gdx/backends/lwjgl/LwjglGraphics.java @@ -24,6 +24,7 @@ import com.badlogic.gdx.AbstractGraphics; import com.badlogic.gdx.Application; import com.badlogic.gdx.graphics.glutils.GLVersion; +import com.badlogic.gdx.utils.Os; import org.lwjgl.LWJGLException; import org.lwjgl.input.Mouse; import org.lwjgl.opengl.ContextAttribs; @@ -736,7 +737,7 @@ public com.badlogic.gdx.graphics.Cursor newCursor (Pixmap pixmap, int xHotspot, @Override public void setCursor (com.badlogic.gdx.graphics.Cursor cursor) { - if (canvas != null && SharedLibraryLoader.isMac) { + if (canvas != null && SharedLibraryLoader.os == Os.MacOsX) { return; } try { @@ -748,7 +749,7 @@ public void setCursor (com.badlogic.gdx.graphics.Cursor cursor) { @Override public void setSystemCursor (SystemCursor systemCursor) { - if (canvas != null && SharedLibraryLoader.isMac) { + if (canvas != null && SharedLibraryLoader.os == Os.MacOsX) { return; } try { diff --git a/backends/gdx-backend-lwjgl/src/com/badlogic/gdx/backends/lwjgl/LwjglNativesLoader.java b/backends/gdx-backend-lwjgl/src/com/badlogic/gdx/backends/lwjgl/LwjglNativesLoader.java index 3bad8b1a3d9..2e8fb2c067a 100644 --- a/backends/gdx-backend-lwjgl/src/com/badlogic/gdx/backends/lwjgl/LwjglNativesLoader.java +++ b/backends/gdx-backend-lwjgl/src/com/badlogic/gdx/backends/lwjgl/LwjglNativesLoader.java @@ -18,9 +18,7 @@ import static com.badlogic.gdx.utils.SharedLibraryLoader.*; -import com.badlogic.gdx.utils.GdxNativesLoader; -import com.badlogic.gdx.utils.GdxRuntimeException; -import com.badlogic.gdx.utils.SharedLibraryLoader; +import com.badlogic.gdx.utils.*; import java.io.File; import java.lang.reflect.Method; @@ -50,18 +48,41 @@ static public void load () { SharedLibraryLoader loader = new SharedLibraryLoader(); File nativesDir = null; try { - if (isWindows) { - nativesDir = loader.extractFile(is64Bit ? "lwjgl64.dll" : "lwjgl.dll", null).getParentFile(); - if (!LwjglApplicationConfiguration.disableAudio) - loader.extractFileTo(is64Bit ? "OpenAL64.dll" : "OpenAL32.dll", nativesDir); - } else if (isMac) { - nativesDir = loader.extractFile("liblwjgl.dylib", null).getParentFile(); - if (!LwjglApplicationConfiguration.disableAudio) loader.extractFileTo("openal.dylib", nativesDir); - } else if (isLinux) { - nativesDir = loader.extractFile(is64Bit ? "liblwjgl64.so" : "liblwjgl.so", null).getParentFile(); - if (!LwjglApplicationConfiguration.disableAudio) - loader.extractFileTo(is64Bit ? "libopenal64.so" : "libopenal.so", nativesDir); + String lwjglLib = null; + String openalLib = null; + switch (os) { + case Windows: + switch (bitness) { + case _32: + lwjglLib = "lwjgl.dll"; + openalLib = "OpenAL32.dll"; + break; + case _64: + lwjglLib = "lwjgl64.dll"; + openalLib = "OpenAL64.dll"; + break; + } + break; + case MacOsX: + lwjglLib = "liblwjgl.dylib"; + openalLib = "openal.dylib"; + break; + case Linux: + switch (bitness) { + case _32: + lwjglLib = "liblwjgl.so"; + openalLib = "libopenal.so"; + break; + case _64: + lwjglLib = "liblwjgl64.so"; + openalLib = "libopenal64.so"; + break; + } + break; } + if (lwjglLib == null) throw new GdxRuntimeException("Unknown LWJGL platform: " + os + ", " + bitness); + nativesDir = loader.extractFile(lwjglLib, null).getParentFile(); + if (!LwjglApplicationConfiguration.disableAudio) loader.extractFileTo(openalLib, nativesDir); } catch (Throwable ex) { throw new GdxRuntimeException("Unable to extract LWJGL natives.", ex); } diff --git a/backends/gdx-backend-lwjgl3/src/com/badlogic/gdx/backends/lwjgl3/Lwjgl3Application.java b/backends/gdx-backend-lwjgl3/src/com/badlogic/gdx/backends/lwjgl3/Lwjgl3Application.java index de905913f12..016e8684067 100644 --- a/backends/gdx-backend-lwjgl3/src/com/badlogic/gdx/backends/lwjgl3/Lwjgl3Application.java +++ b/backends/gdx-backend-lwjgl3/src/com/badlogic/gdx/backends/lwjgl3/Lwjgl3Application.java @@ -26,6 +26,7 @@ import com.badlogic.gdx.backends.lwjgl3.audio.OpenALLwjgl3Audio; import com.badlogic.gdx.graphics.glutils.GLVersion; +import com.badlogic.gdx.utils.*; import org.lwjgl.glfw.GLFW; import org.lwjgl.glfw.GLFWErrorCallback; import org.lwjgl.opengl.AMDDebugOutput; @@ -50,11 +51,6 @@ import com.badlogic.gdx.Preferences; import com.badlogic.gdx.backends.lwjgl3.audio.mock.MockAudio; import com.badlogic.gdx.math.GridPoint2; -import com.badlogic.gdx.utils.Array; -import com.badlogic.gdx.utils.Clipboard; -import com.badlogic.gdx.utils.GdxRuntimeException; -import com.badlogic.gdx.utils.ObjectMap; -import com.badlogic.gdx.utils.SharedLibraryLoader; import org.lwjgl.system.Configuration; import org.lwjgl.system.ThreadLocalUtil; @@ -80,11 +76,12 @@ public class Lwjgl3Application implements Lwjgl3ApplicationBase { static void initializeGlfw () { if (errorCallback == null) { - if (SharedLibraryLoader.isMac) loadGlfwAwtMacos(); + if (SharedLibraryLoader.os == Os.MacOsX) loadGlfwAwtMacos(); Lwjgl3NativesLoader.load(); errorCallback = GLFWErrorCallback.createPrint(Lwjgl3ApplicationConfiguration.errorStream); GLFW.glfwSetErrorCallback(errorCallback); - if (SharedLibraryLoader.isMac) GLFW.glfwInitHint(GLFW.GLFW_ANGLE_PLATFORM_TYPE, GLFW.GLFW_ANGLE_PLATFORM_TYPE_METAL); + if (SharedLibraryLoader.os == Os.MacOsX) + GLFW.glfwInitHint(GLFW.GLFW_ANGLE_PLATFORM_TYPE, GLFW.GLFW_ANGLE_PLATFORM_TYPE_METAL); GLFW.glfwInitHint(GLFW.GLFW_JOYSTICK_HAT_BUTTONS, GLFW.GLFW_FALSE); if (!GLFW.glfwInit()) { throw new GdxRuntimeException("Unable to initialize GLFW"); @@ -492,7 +489,7 @@ static long createGlfwWindow (Lwjgl3ApplicationConfiguration config, long shared || config.glEmulation == Lwjgl3ApplicationConfiguration.GLEmulation.GL32) { GLFW.glfwWindowHint(GLFW.GLFW_CONTEXT_VERSION_MAJOR, config.gles30ContextMajorVersion); GLFW.glfwWindowHint(GLFW.GLFW_CONTEXT_VERSION_MINOR, config.gles30ContextMinorVersion); - if (SharedLibraryLoader.isMac) { + if (SharedLibraryLoader.os == Os.MacOsX) { // hints mandatory on OS X for GL 3.2+ context creation, but fail on Windows if the // WGL_ARB_create_context extension is not available // see: http://www.glfw.org/docs/latest/compat.html diff --git a/backends/gdx-backend-lwjgl3/src/com/badlogic/gdx/backends/lwjgl3/Lwjgl3Net.java b/backends/gdx-backend-lwjgl3/src/com/badlogic/gdx/backends/lwjgl3/Lwjgl3Net.java index 60960c666bc..21bc535bc30 100644 --- a/backends/gdx-backend-lwjgl3/src/com/badlogic/gdx/backends/lwjgl3/Lwjgl3Net.java +++ b/backends/gdx-backend-lwjgl3/src/com/badlogic/gdx/backends/lwjgl3/Lwjgl3Net.java @@ -27,6 +27,7 @@ import com.badlogic.gdx.net.ServerSocketHints; import com.badlogic.gdx.net.Socket; import com.badlogic.gdx.net.SocketHints; +import com.badlogic.gdx.utils.Os; import com.badlogic.gdx.utils.SharedLibraryLoader; /** LWJGL implementation of the {@link Net} API, it could be reused in other Desktop backends since it doesn't depend on LWJGL. @@ -66,7 +67,7 @@ public Socket newClientSocket (Protocol protocol, String host, int port, SocketH @Override public boolean openURI (String uri) { - if (SharedLibraryLoader.isMac) { + if (SharedLibraryLoader.os == Os.MacOsX) { try { (new ProcessBuilder("open", (new URI(uri).toString()))).start(); return true; @@ -80,7 +81,7 @@ public boolean openURI (String uri) { } catch (Throwable t) { return false; } - } else if (SharedLibraryLoader.isLinux) { + } else if (SharedLibraryLoader.os == Os.Linux) { try { (new ProcessBuilder("xdg-open", (new URI(uri).toString()))).start(); return true; diff --git a/backends/gdx-backend-lwjgl3/src/com/badlogic/gdx/backends/lwjgl3/Lwjgl3Window.java b/backends/gdx-backend-lwjgl3/src/com/badlogic/gdx/backends/lwjgl3/Lwjgl3Window.java index 28b57abfd22..8241168a5dd 100644 --- a/backends/gdx-backend-lwjgl3/src/com/badlogic/gdx/backends/lwjgl3/Lwjgl3Window.java +++ b/backends/gdx-backend-lwjgl3/src/com/badlogic/gdx/backends/lwjgl3/Lwjgl3Window.java @@ -18,6 +18,7 @@ import java.nio.IntBuffer; +import com.badlogic.gdx.utils.Os; import org.lwjgl.BufferUtils; import org.lwjgl.glfw.GLFW; import org.lwjgl.glfw.GLFWDropCallback; @@ -278,7 +279,7 @@ public void setIcon (Pixmap... image) { } static void setIcon (long windowHandle, String[] imagePaths, Files.FileType imageFileType) { - if (SharedLibraryLoader.isMac) return; + if (SharedLibraryLoader.os == Os.MacOsX) return; Pixmap[] pixmaps = new Pixmap[imagePaths.length]; for (int i = 0; i < imagePaths.length; i++) { @@ -293,7 +294,7 @@ static void setIcon (long windowHandle, String[] imagePaths, Files.FileType imag } static void setIcon (long windowHandle, Pixmap[] images) { - if (SharedLibraryLoader.isMac) return; + if (SharedLibraryLoader.os == Os.MacOsX) return; GLFWImage.Buffer buffer = GLFWImage.malloc(images.length); Pixmap[] tmpPixmaps = new Pixmap[images.length]; diff --git a/build.gradle b/build.gradle index d7cd137f988..61948b2f5cb 100644 --- a/build.gradle +++ b/build.gradle @@ -22,7 +22,7 @@ buildscript { } dependencies { classpath "com.diffplug.spotless:spotless-plugin-gradle:${versions.spotless}" - classpath "com.badlogicgames.gdx:gdx-jnigen-gradle:2.4.1" + classpath "com.badlogicgames.gdx:gdx-jnigen-gradle:2.5.1" } } diff --git a/extensions/gdx-box2d/gdx-box2d/build.gradle b/extensions/gdx-box2d/gdx-box2d/build.gradle index 40bf55e1c7d..6d37e454794 100644 --- a/extensions/gdx-box2d/gdx-box2d/build.gradle +++ b/extensions/gdx-box2d/gdx-box2d/build.gradle @@ -22,6 +22,7 @@ jnigen { add(Linux, x64) add(Linux, x32, ARM) add(Linux, x64, ARM) + add(Linux, x64, RISCV) add(MacOsX, x64) add(MacOsX, x64, ARM) add(Android) diff --git a/extensions/gdx-bullet/build.gradle b/extensions/gdx-bullet/build.gradle index a44a4b6c335..c98e68f8b0a 100644 --- a/extensions/gdx-bullet/build.gradle +++ b/extensions/gdx-bullet/build.gradle @@ -72,6 +72,7 @@ jnigen { add(Linux, x64) add(Linux, x32, ARM) add(Linux, x64, ARM) + add(Linux, x64, RISCV) add(MacOsX, x64) add(MacOsX, x64, ARM) add(Android) { diff --git a/extensions/gdx-freetype/build.gradle b/extensions/gdx-freetype/build.gradle index 745a7dbcb14..07abf6d7983 100644 --- a/extensions/gdx-freetype/build.gradle +++ b/extensions/gdx-freetype/build.gradle @@ -88,6 +88,7 @@ jnigen { add(Linux, x64) add(Linux, x32, ARM) add(Linux, x64, ARM) + add(Linux, x64, RISCV) add(MacOsX, x64) { linkerFlags += " -framework CoreServices -framework Carbon" } diff --git a/extensions/gdx-lwjgl3-glfw-awt-macos/src/com/badlogic/gdx/backends/lwjgl3/awt/GlfwAWTLoader.java b/extensions/gdx-lwjgl3-glfw-awt-macos/src/com/badlogic/gdx/backends/lwjgl3/awt/GlfwAWTLoader.java index 61f1de053bd..72b54c47590 100644 --- a/extensions/gdx-lwjgl3-glfw-awt-macos/src/com/badlogic/gdx/backends/lwjgl3/awt/GlfwAWTLoader.java +++ b/extensions/gdx-lwjgl3-glfw-awt-macos/src/com/badlogic/gdx/backends/lwjgl3/awt/GlfwAWTLoader.java @@ -27,6 +27,7 @@ import java.util.UUID; import java.util.zip.CRC32; +import com.badlogic.gdx.utils.Architecture; import com.badlogic.gdx.utils.GdxRuntimeException; import com.badlogic.gdx.utils.SharedLibraryLoader; @@ -176,7 +177,8 @@ public void run () { } } - String source = SharedLibraryLoader.isARM ? "macosarm64/libglfwarm64.dylib" : "macosx64/libglfw.dylib"; + String source = SharedLibraryLoader.architecture == Architecture.ARM ? "macosarm64/libglfwarm64.dylib" + : "macosx64/libglfw.dylib"; String crc = crc(GlfwAWTLoader.class.getResourceAsStream("/" + source)); File sharedLib = getExtractedFile(crc, new File(source).getName()); diff --git a/gdx/build.gradle b/gdx/build.gradle index f5d20d4a877..de55d0414a9 100644 --- a/gdx/build.gradle +++ b/gdx/build.gradle @@ -39,7 +39,7 @@ jar { dependencies { testImplementation libraries.junit - api "com.badlogicgames.gdx:gdx-jnigen-loader:2.3.1" + api "com.badlogicgames.gdx:gdx-jnigen-loader:2.5.1" } test { @@ -62,6 +62,7 @@ jnigen { add(Linux, x64) add(Linux, x32, ARM) add(Linux, x64, ARM) + add(Linux, x64, RISCV) add(Android) { linkerFlags += " -llog" } diff --git a/gdx/src/com/badlogic/gdx/scenes/scene2d/utils/UIUtils.java b/gdx/src/com/badlogic/gdx/scenes/scene2d/utils/UIUtils.java index b786ff631c1..4b92f64acb4 100644 --- a/gdx/src/com/badlogic/gdx/scenes/scene2d/utils/UIUtils.java +++ b/gdx/src/com/badlogic/gdx/scenes/scene2d/utils/UIUtils.java @@ -4,17 +4,18 @@ import com.badlogic.gdx.Gdx; import com.badlogic.gdx.Input.Buttons; import com.badlogic.gdx.Input.Keys; +import com.badlogic.gdx.utils.Os; import com.badlogic.gdx.utils.SharedLibraryLoader; public final class UIUtils { private UIUtils () { } - static public boolean isAndroid = SharedLibraryLoader.isAndroid; - static public boolean isMac = SharedLibraryLoader.isMac; - static public boolean isWindows = SharedLibraryLoader.isWindows; - static public boolean isLinux = SharedLibraryLoader.isLinux; - static public boolean isIos = SharedLibraryLoader.isIos; + static public boolean isAndroid = SharedLibraryLoader.os == Os.Android; + static public boolean isMac = SharedLibraryLoader.os == Os.MacOsX; + static public boolean isWindows = SharedLibraryLoader.os == Os.Windows; + static public boolean isLinux = SharedLibraryLoader.os == Os.Linux; + static public boolean isIos = SharedLibraryLoader.os == Os.IOS; static public boolean left () { return Gdx.input.isButtonPressed(Buttons.LEFT); diff --git a/gradle/dependencies.gradle b/gradle/dependencies.gradle index 9767e11edf5..e9e86e45370 100644 --- a/gradle/dependencies.gradle +++ b/gradle/dependencies.gradle @@ -29,7 +29,7 @@ versions.gwtPlugin = "1.1.16" versions.gretty = "3.0.7" versions.jglwf = "1.1" versions.lwjgl = "2.9.3" -versions.lwjgl3 = "3.3.3" +versions.lwjgl3 = "3.3.4-SNAPSHOT" versions.jlayer = "1.0.1-gdx" versions.jorbis = "0.0.17" versions.junit = "4.13.2" @@ -56,6 +56,7 @@ libraries.lwjgl3 = [ "org.lwjgl:lwjgl:${versions.lwjgl3}:natives-linux", "org.lwjgl:lwjgl:${versions.lwjgl3}:natives-linux-arm32", "org.lwjgl:lwjgl:${versions.lwjgl3}:natives-linux-arm64", + "org.lwjgl:lwjgl:${versions.lwjgl3}:natives-linux-riscv64", "org.lwjgl:lwjgl:${versions.lwjgl3}:natives-macos", "org.lwjgl:lwjgl:${versions.lwjgl3}:natives-macos-arm64", "org.lwjgl:lwjgl:${versions.lwjgl3}:natives-windows", @@ -64,6 +65,7 @@ libraries.lwjgl3 = [ "org.lwjgl:lwjgl-glfw:${versions.lwjgl3}:natives-linux", "org.lwjgl:lwjgl-glfw:${versions.lwjgl3}:natives-linux-arm32", "org.lwjgl:lwjgl-glfw:${versions.lwjgl3}:natives-linux-arm64", + "org.lwjgl:lwjgl-glfw:${versions.lwjgl3}:natives-linux-riscv64", "org.lwjgl:lwjgl-glfw:${versions.lwjgl3}:natives-macos", "org.lwjgl:lwjgl-glfw:${versions.lwjgl3}:natives-macos-arm64", "org.lwjgl:lwjgl-glfw:${versions.lwjgl3}:natives-windows", @@ -72,6 +74,7 @@ libraries.lwjgl3 = [ "org.lwjgl:lwjgl-jemalloc:${versions.lwjgl3}:natives-linux", "org.lwjgl:lwjgl-jemalloc:${versions.lwjgl3}:natives-linux-arm32", "org.lwjgl:lwjgl-jemalloc:${versions.lwjgl3}:natives-linux-arm64", + "org.lwjgl:lwjgl-jemalloc:${versions.lwjgl3}:natives-linux-riscv64", "org.lwjgl:lwjgl-jemalloc:${versions.lwjgl3}:natives-macos", "org.lwjgl:lwjgl-jemalloc:${versions.lwjgl3}:natives-macos-arm64", "org.lwjgl:lwjgl-jemalloc:${versions.lwjgl3}:natives-windows", @@ -80,6 +83,7 @@ libraries.lwjgl3 = [ "org.lwjgl:lwjgl-openal:${versions.lwjgl3}:natives-linux", "org.lwjgl:lwjgl-openal:${versions.lwjgl3}:natives-linux-arm32", "org.lwjgl:lwjgl-openal:${versions.lwjgl3}:natives-linux-arm64", + "org.lwjgl:lwjgl-openal:${versions.lwjgl3}:natives-linux-riscv64", "org.lwjgl:lwjgl-openal:${versions.lwjgl3}:natives-macos", "org.lwjgl:lwjgl-openal:${versions.lwjgl3}:natives-macos-arm64", "org.lwjgl:lwjgl-openal:${versions.lwjgl3}:natives-windows", @@ -88,6 +92,7 @@ libraries.lwjgl3 = [ "org.lwjgl:lwjgl-opengl:${versions.lwjgl3}:natives-linux", "org.lwjgl:lwjgl-opengl:${versions.lwjgl3}:natives-linux-arm32", "org.lwjgl:lwjgl-opengl:${versions.lwjgl3}:natives-linux-arm64", + "org.lwjgl:lwjgl-opengl:${versions.lwjgl3}:natives-linux-riscv64", "org.lwjgl:lwjgl-opengl:${versions.lwjgl3}:natives-macos", "org.lwjgl:lwjgl-opengl:${versions.lwjgl3}:natives-macos-arm64", "org.lwjgl:lwjgl-opengl:${versions.lwjgl3}:natives-windows", @@ -96,6 +101,7 @@ libraries.lwjgl3 = [ "org.lwjgl:lwjgl-stb:${versions.lwjgl3}:natives-linux", "org.lwjgl:lwjgl-stb:${versions.lwjgl3}:natives-linux-arm32", "org.lwjgl:lwjgl-stb:${versions.lwjgl3}:natives-linux-arm64", + "org.lwjgl:lwjgl-stb:${versions.lwjgl3}:natives-linux-riscv64", "org.lwjgl:lwjgl-stb:${versions.lwjgl3}:natives-macos", "org.lwjgl:lwjgl-stb:${versions.lwjgl3}:natives-macos-arm64", "org.lwjgl:lwjgl-stb:${versions.lwjgl3}:natives-windows", @@ -109,6 +115,7 @@ libraries.lwjgl3GLES = [ "org.lwjgl:lwjgl-opengles:${versions.lwjgl3}:natives-linux", "org.lwjgl:lwjgl-opengles:${versions.lwjgl3}:natives-linux-arm32", "org.lwjgl:lwjgl-opengles:${versions.lwjgl3}:natives-linux-arm64", + "org.lwjgl:lwjgl-opengles:${versions.lwjgl3}:natives-linux-riscv64", "org.lwjgl:lwjgl-opengles:${versions.lwjgl3}:natives-macos", "org.lwjgl:lwjgl-opengles:${versions.lwjgl3}:natives-macos-arm64", "org.lwjgl:lwjgl-opengles:${versions.lwjgl3}:natives-windows", diff --git a/tests/gdx-tests-lwjgl/src/com/badlogic/gdx/tests/lwjgl/LwjglTestStarter.java b/tests/gdx-tests-lwjgl/src/com/badlogic/gdx/tests/lwjgl/LwjglTestStarter.java index 39e039d67f9..c50f4a82614 100644 --- a/tests/gdx-tests-lwjgl/src/com/badlogic/gdx/tests/lwjgl/LwjglTestStarter.java +++ b/tests/gdx-tests-lwjgl/src/com/badlogic/gdx/tests/lwjgl/LwjglTestStarter.java @@ -45,6 +45,7 @@ import com.badlogic.gdx.tests.utils.GdxTest; import com.badlogic.gdx.tests.utils.GdxTestWrapper; import com.badlogic.gdx.tests.utils.GdxTests; +import com.badlogic.gdx.utils.Os; import com.badlogic.gdx.utils.SharedLibraryLoader; public class LwjglTestStarter extends JFrame { @@ -77,7 +78,7 @@ public static boolean runTest (String testName) { config.forceExit = false; if (useGL30) { config.useGL30 = true; - if (!SharedLibraryLoader.isMac) { + if (SharedLibraryLoader.os != Os.MacOsX) { config.gles30ContextMajorVersion = 4; config.gles30ContextMinorVersion = 3; } diff --git a/tests/gdx-tests-lwjgl3/src/com/badlogic/gdx/tests/lwjgl3/AwtTestLWJGL.java b/tests/gdx-tests-lwjgl3/src/com/badlogic/gdx/tests/lwjgl3/AwtTestLWJGL.java index a0f55eef97f..e9de85a5370 100644 --- a/tests/gdx-tests-lwjgl3/src/com/badlogic/gdx/tests/lwjgl3/AwtTestLWJGL.java +++ b/tests/gdx-tests-lwjgl3/src/com/badlogic/gdx/tests/lwjgl3/AwtTestLWJGL.java @@ -10,6 +10,7 @@ import javax.swing.*; import com.badlogic.gdx.backends.lwjgl3.awt.GlfwAWTLoader; +import com.badlogic.gdx.utils.Os; import com.badlogic.gdx.utils.SharedLibraryLoader; import org.lwjgl.glfw.GLFWMouseButtonCallback; import org.lwjgl.opengl.GL; @@ -52,7 +53,7 @@ public void run () { }; public static void main (String[] args) throws Exception { - if (SharedLibraryLoader.isMac) { + if (SharedLibraryLoader.os == Os.MacOsX) { Configuration.GLFW_CHECK_THREAD0.set(false); Configuration.GLFW_LIBRARY_NAME.set(GlfwAWTLoader.load().getAbsolutePath()); } diff --git a/tests/gdx-tests-lwjgl3/src/com/badlogic/gdx/tests/lwjgl3/Lwjgl3TestStarter.java b/tests/gdx-tests-lwjgl3/src/com/badlogic/gdx/tests/lwjgl3/Lwjgl3TestStarter.java index fece32e7193..08c677639eb 100644 --- a/tests/gdx-tests-lwjgl3/src/com/badlogic/gdx/tests/lwjgl3/Lwjgl3TestStarter.java +++ b/tests/gdx-tests-lwjgl3/src/com/badlogic/gdx/tests/lwjgl3/Lwjgl3TestStarter.java @@ -36,6 +36,7 @@ import com.badlogic.gdx.tests.utils.CommandLineOptions; import com.badlogic.gdx.tests.utils.GdxTestWrapper; import com.badlogic.gdx.tests.utils.GdxTests; +import com.badlogic.gdx.utils.Os; import com.badlogic.gdx.utils.ScreenUtils; import com.badlogic.gdx.utils.SharedLibraryLoader; import com.badlogic.gdx.utils.viewport.ScreenViewport; @@ -65,7 +66,7 @@ public static void main (String[] argv) { } else if (options.gl31) { config.setOpenGLEmulation(Lwjgl3ApplicationConfiguration.GLEmulation.GL31, 4, 5); } else if (options.gl30) { - if (SharedLibraryLoader.isMac) { + if (SharedLibraryLoader.os == Os.MacOsX) { config.setOpenGLEmulation(Lwjgl3ApplicationConfiguration.GLEmulation.GL30, 3, 2); } else { config.setOpenGLEmulation(Lwjgl3ApplicationConfiguration.GLEmulation.GL30, 4, 3); @@ -74,7 +75,7 @@ public static void main (String[] argv) { config.setOpenGLEmulation(Lwjgl3ApplicationConfiguration.GLEmulation.ANGLE_GLES20, 0, 0); // Use CPU sync if ANGLE is enabled on macOS, otherwise the framerate gets halfed // by each new open window. - if (SharedLibraryLoader.isMac) { + if (SharedLibraryLoader.os == Os.MacOsX) { config.useVsync(false); config.setForegroundFPS(60); }