Replace desktop backend with SDL3 GL and ANGLE-GLES#2585
Replace desktop backend with SDL3 GL and ANGLE-GLES#2585riccardobl wants to merge 39 commits intojMonkeyEngine:masterfrom
Conversation
|
🖼️ Screenshot tests have failed. The purpose of these tests is to ensure that changes introduced in this PR don't break visual features. They are visual unit tests. 📄 Where to find the report:
✅ If you did mean to change things: ✨ If you are creating entirely new tests: Note; it is very important that the committed reference images are created on the build pipeline, locally created images are not reliable. Similarly tests will fail locally but you can look at the report to check they are "visually similar". See https://github.com/jMonkeyEngine/jmonkeyengine/blob/master/jme3-screenshot-tests/README.md for more information Contact @richardTingle (aka richtea) for guidance if required |
There was a problem hiding this comment.
Pull request overview
This PR is a work-in-progress refactor of the LWJGL3 backend to replace GLFW with SDL3, introduce an ANGLE/GLES3 rendering path, and simplify/remodel related rendering + native loading behavior (including removal of LWJGL OpenCL support).
Changes:
- Replaces GLFW-based input/windowing with SDL3 implementations (mouse/keyboard/joysticks) and updates LWJGL context initialization to support ANGLE/GLES3.
- Adds auxiliary framebuffer shader/material resources and updates multisample/sRGB handling logic.
- Removes LWJGL OpenCL integration code and updates defaults (renderer + window defaults) and native-library loading behavior.
Reviewed changes
Copilot reviewed 49 out of 50 changed files in this pull request and generated 5 comments.
Show a summary per file
| File | Description |
|---|---|
| jme3-lwjgl3/src/main/resources/Common/MatDefs/Post/AuxFramebuffer.vert | Adds vertex shader for auxiliary framebuffer pass-through. |
| jme3-lwjgl3/src/main/resources/Common/MatDefs/Post/AuxFramebuffer.j3md | Adds material definition for auxiliary framebuffer blit/resolve. |
| jme3-lwjgl3/src/main/resources/Common/MatDefs/Post/AuxFramebuffer.frag | Adds fragment shader to resolve MSAA (via MultiSample) and linear→sRGB encode. |
| jme3-lwjgl3/src/main/java/com/jme3/system/lwjgl/WindowSizeListener.java | Removes GLFW-specific javadoc wording. |
| jme3-lwjgl3/src/main/java/com/jme3/system/lwjgl/LwjglDisplay.java | Removes unused import. |
| jme3-lwjgl3/src/main/java/com/jme3/system/lwjgl/LwjglContext.java | Adds ANGLE/GLES init path, removes OpenCL, updates sRGB detection/flags. |
| jme3-lwjgl3/src/main/java/com/jme3/system/lwjgl/LwjglCanvas.java | Drops GL < 3.2 configs; forces core profile defaults and forward-compat. |
| jme3-lwjgl3/src/main/java/com/jme3/renderer/lwjgl/LwjglGLES.java | Introduces GLES wrapper for LWJGL+ANGLE backend. |
| jme3-lwjgl3/src/main/java/com/jme3/opencl/lwjgl/info/InfoQueryObject.java | Removes LWJGL OpenCL info querying helper. |
| jme3-lwjgl3/src/main/java/com/jme3/opencl/lwjgl/info/InfoQueryInt.java | Removes LWJGL OpenCL info querying helper. |
| jme3-lwjgl3/src/main/java/com/jme3/opencl/lwjgl/info/InfoQuery.java | Removes LWJGL OpenCL info querying helper. |
| jme3-lwjgl3/src/main/java/com/jme3/opencl/lwjgl/info/Info.java | Removes generated LWJGL OpenCL info query facade. |
| jme3-lwjgl3/src/main/java/com/jme3/opencl/lwjgl/info/CLUtil.java | Removes LWJGL OpenCL error token utilities. |
| jme3-lwjgl3/src/main/java/com/jme3/opencl/lwjgl/Utils.java | Removes LWJGL OpenCL buffer/util helpers. |
| jme3-lwjgl3/src/main/java/com/jme3/opencl/lwjgl/LwjglProgram.java | Removes LWJGL OpenCL program wrapper. |
| jme3-lwjgl3/src/main/java/com/jme3/opencl/lwjgl/LwjglPlatform.java | Removes LWJGL OpenCL platform wrapper. |
| jme3-lwjgl3/src/main/java/com/jme3/opencl/lwjgl/LwjglKernel.java | Removes LWJGL OpenCL kernel wrapper. |
| jme3-lwjgl3/src/main/java/com/jme3/opencl/lwjgl/LwjglImage.java | Removes LWJGL OpenCL image wrapper. |
| jme3-lwjgl3/src/main/java/com/jme3/opencl/lwjgl/LwjglEvent.java | Removes LWJGL OpenCL event wrapper. |
| jme3-lwjgl3/src/main/java/com/jme3/opencl/lwjgl/LwjglDevice.java | Removes LWJGL OpenCL device wrapper. |
| jme3-lwjgl3/src/main/java/com/jme3/opencl/lwjgl/LwjglContext.java | Removes LWJGL OpenCL context wrapper. |
| jme3-lwjgl3/src/main/java/com/jme3/opencl/lwjgl/LwjglCommandQueue.java | Removes LWJGL OpenCL command queue wrapper. |
| jme3-lwjgl3/src/main/java/com/jme3/opencl/lwjgl/LwjglBuffer.java | Removes LWJGL OpenCL buffer wrapper. |
| jme3-lwjgl3/src/main/java/com/jme3/input/lwjgl/SdlMouseInput.java | Adds SDL mouse input implementation. |
| jme3-lwjgl3/src/main/java/com/jme3/input/lwjgl/SdlKeyMap.java | Adds SDL scancode↔jME keycode mapping. |
| jme3-lwjgl3/src/main/java/com/jme3/input/lwjgl/SdlKeyInput.java | Replaces GLFW key input with SDL key/text input handling. |
| jme3-lwjgl3/src/main/java/com/jme3/input/lwjgl/SdlJoystickInput.java | Routes device add/remove via external SDL event dispatch method. |
| jme3-lwjgl3/src/main/java/com/jme3/input/lwjgl/GlfwMouseInput.java | Removes GLFW mouse input implementation. |
| jme3-lwjgl3/src/main/java/com/jme3/input/lwjgl/GlfwKeyMap.java | Removes GLFW key mapping. |
| jme3-lwjgl3/src/main/java/com/jme3/input/lwjgl/GlfwJoystickInput.java | Removes GLFW joystick input implementation. |
| jme3-lwjgl3/src/main/java/com/jme3/system/lwjgl/LwjglWindow.java | SDL window/context creation + ANGLE configuration hooks (and ANGLE native loading). |
| jme3-lwjgl3/build.gradle | Drops GLFW/OpenCL deps; adds SDL/EGL/OpenGLES + ANGLE natives. |
| jme3-ios/src/main/java/com/jme3/renderer/ios/JmeIosGLES.java | Adds glGetStringi native declaration. |
| jme3-ios/src/main/java/com/jme3/renderer/ios/IosGL.java | Wires glGetString(name,index) to iOS native glGetStringi. |
| jme3-examples/src/main/java/jme3test/material/TestUnshadedModel.java | Forces ANGLE/GLES3 settings for a sample test. |
| jme3-examples/src/main/java/jme3test/light/pbr/TestPBRSimple.java | Adjusts example startup to use explicit AppSettings. |
| jme3-effects/src/main/resources/Common/MatDefs/Post/ToneMap.frag | Switches multisample support to MultiSample.glsllib import. |
| jme3-effects/src/main/resources/Common/MatDefs/Post/KHRToneMap.frag | Switches multisample support to MultiSample.glsllib import. |
| jme3-desktop/src/main/java/jme3tools/converters/ImageToAwt.java | Converts some formats to GLES-friendly equivalents before encode. |
| jme3-desktop/src/main/java/com/jme3/texture/plugins/AWTLoader.java | Converts BGR/ABGR sources to RGB/RGBA output formats. |
| jme3-desktop/src/main/java/com/jme3/system/NativeLibraryLoader.java | Adds LibraryInfo registration overload; returns absolute path from loadNativeLibrary. |
| jme3-desktop/src/main/java/com/jme3/system/JmeDesktopSystem.java | Accepts ANGLE renderer prefix for LWJGL context creation. |
| jme3-core/src/plugins/java/com/jme3/texture/plugins/TGALoader.java | Converts 24-bit BGR TGA data to RGB and updates format. |
| jme3-core/src/main/resources/Common/ShaderLib/MultiSample.glsllib | Adds EXT multisampled render-to-texture extension support and broadens GLES condition. |
| jme3-core/src/main/java/com/jme3/system/AppSettings.java | Deprecates old LWJGL renderer strings; adds ANGLE_GLES3 and updates defaults. |
| jme3-core/src/main/java/com/jme3/renderer/opengl/GLRenderer.java | Adds GLES extension enumeration via glGetStringi; updates multisample capability detection. |
| jme3-core/src/main/java/com/jme3/renderer/opengl/GLES_30.java | Adds GL_NUM_EXTENSIONS and glGetString(name,index) API. |
| gradle/libs.versions.toml | Adds LWJGL OpenGLES + EGL modules to the version catalog. |
| common.gradle | Adds maven repo for ANGLE native artifacts. |
| .gitignore | Formatting-only change to an ignore entry. |
Comments suppressed due to low confidence (1)
jme3-lwjgl3/src/main/java/com/jme3/input/lwjgl/SdlKeyInput.java:144
update()returns early whenlistener == null, but queued events are never drained/cleared. If SDL events are still being forwarded viaonSDLEvent(...), this can cause unbounded queue growth and stale key events once a listener is attached later. Consider clearingkeyInputEventswhenlistener == null(similar toSdlMouseInput.update()) or avoiding enqueuing events when there's no listener.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
|
@riccardobl Could you split this out into multiple PRs? Opencl removal, gles 2 removal, could be very independent and land before the main changes here are ready. |
The goal of this PR is to implement ANGLE in jme, everything else is just a side effect of that.
So, this is actually a single feature, there is no point in implementing any of these changes on their own in the current jme , and splitting this would make it much harder to test. The blocker here is just that I need to test it on a real project and implement ios support |
This reverts commit 79734e7.
This reverts commit f0a76dc740a9cd370cf76891d5edc8f8f2e103b6.
… bug that causes lwjgl apps to break
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 58 out of 59 changed files in this pull request and generated 6 comments.
Comments suppressed due to low confidence (1)
jme3-lwjgl3/src/main/java/com/jme3/input/lwjgl/SdlKeyInput.java:145
- When
listeneris null,update()returns without drainingkeyInputEvents. If SDL events keep arriving (e.g., whenUseInputis false or the listener is set later), this queue can grow unbounded. Consider clearing the queue whenlistener == null(similar toSdlMouseInput).
| #extension GL_ARB_texture_multisample : enable | ||
| #extension GL_EXT_multisampled_render_to_texture : enable |
| if (settings.getBoolean("GraphicsTrace")) { | ||
| gles = (LwjglGLES) GLTracer.createGlesTracer(gles, GL.class, GLES_30.class, GLFbo.class, | ||
| GLExt.class); |
There was a problem hiding this comment.
@copilot apply changes based on this feedback
| maven { | ||
| url = uri("https://central.sonatype.com/repository/maven-snapshots") |
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 58 out of 59 changed files in this pull request and generated 2 comments.
Comments suppressed due to low confidence (1)
jme3-lwjgl3/src/main/java/com/jme3/input/lwjgl/SdlKeyInput.java:145
update()returns early whenlistener == nullbut does not drain/clearkeyInputEvents. If the listener is temporarily unset (or input is disabled), the queue can grow without bound and then replay stale events later. Consider mirroringSdlMouseInput.update()by clearing the queue when there is no listener (and/or when the context isn’t renderable).
This started with the intention of adapting the current glfw+lwjgl3 backend to use angle, but it turned out that glfw has some major limitations that break angle in wayland.
After trying to workaround these limitations, with no success, I decided to rewrite (with the help of gpt 5.3) the entire lwjgl3 backend to use SDL3, that is now available in lwjgl 3.4 and that we are already using for controllers (due to, again, more glfw limitations).
That said, this is a summary of what this PR does:
This is still a work in progress, but it is a step forward in making GLES 3.0 the jME baseline across every platform.