79431829

Date: 2025-02-12 03:11:19
Score: 0.5
Natty:
Report link

CoryU's solution requires the OpenGL bindings because it ends up just using OpenGL directly // pretend we're using GLES in windows, instead use a subset of OpenGL 2.0 as GLES 2.0 (while the linked URL in their post is dead, you can still read it via the Wayback Machine: https://web.archive.org/web/20210224204635/https://bedroomcoders.co.uk/gles2-0-everywhere-thanks-to-lwjgl3/)

And for some use cases, that may what you actually want! However if you want to use OpenGL ES via ANGLE, you need to do things differently instead...

If you are using the LWJGL quick start code as a base, first you'll need to change all GL calls into GLES calls, after doing this, the code will still not work, complaining that There is no OpenGL ES context current in the current thread

To fix that, you need to add the following window hints in the init function

        glfwWindowHint(GLFW_CONTEXT_CREATION_API, GLFW_EGL_CONTEXT_API) // This is what ACTUALLY makes it work
        glfwWindowHint(GLFW_CLIENT_API, GLFW_OPENGL_ES_API)
        glfwWindowHint(GLFW_CONTEXT_VERSION_MAJOR, 3)
        glfwWindowHint(GLFW_CONTEXT_VERSION_MINOR, 0)

And after enabling it and running it using ANGLE... (overlay by RenderDoc)

LWJGL app running in RenderDoc using OpenGLES ANGLE

And here's is running with Mesa

LWJGL app running in RenderDoc using OpenGLES Mesa

For more information, here's a example of using OpenGLES in LWJGL: https://github.com/LWJGL/lwjgl3/blob/e7008a878ca8065db6b5cffb53594659344de300/modules/samples/src/test/java/org/lwjgl/demo/egl/EGLDemo.java#L39

Reasons:
  • Blacklisted phrase (0.5): thanks
  • Probably link only (1):
  • Long answer (-1):
  • Has code block (-0.5):
  • Low reputation (0.5):
Posted by: MrPowerGamerBR