-
-
Notifications
You must be signed in to change notification settings - Fork 10.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Examples: Add OpenGL ES 2.0 support to SDL2 and GLFW examples #3951
Examples: Add OpenGL ES 2.0 support to SDL2 and GLFW examples #3951
Conversation
Thank for the PR and explanation! |
Ah yeah good point, that example is very similar. So keeping it in sync sounds reasonable. I don't have much experience with glfw and don't know if it supports the Raspberry Pi either, but it seems to support GL ES from a quick glance at the documentation so that makes sense to do the same modifications there. |
Thank you. I also suggest using
Preprocessor block to avoid adding an extra level of #endif Thank you! |
Will do! 👍🏻 |
6fedaa1
to
e979ddc
Compare
@ocornut I adapted the GLFW example, and also changed the preprocessor bits as you suggested. I successfully ran the GLFW example in GL ES mode on my Raspberry Pi 3 using the KMS driver, and on my Linux Desktop using the MESA OpenGL ES library (by installing However, it doesn't seem possible to use GLFW without an X server. That means it's not possible to run with the Raspberry Pi legacy driver, unlike SDL. Therefore, I didn't include the corresponding build flags in the GLFW Makefile, only in the SDL Makefile. I also wasn't able to test on my other GL ES based devices (Odroid Go Advance/Super) since these don't have X installed at all. |
Merged, thank you! |
Looks like I missed the train for a little amendment to the PR. For the record. I was testing the cross compilation of the ImGui and managed to get is done using this little patch:
So, a user cross compiling would uncomment the last |
The modern OpenGL backend (
imgui_impl_opengl3
) already supports OpenGL ES via theIMGUI_IMPL_OPENGL_ES2
define. But the SDL + OpenGL example (example_sdl_opengl3
) only supports Desktop GL so far.This PR adds support for OpenGL ES 2.0 to the SDL + OpenGL example on Linux. To keep things simple in the Makefile, I followed how the different GL loaders are configured, by adding commented out lines that can be enabled (instead of the default gl3w loader config) to build for GL ES.
The motivation for this PR is supporting the Raspberry Pi and other Linux-based SBC devices, therefore I limited the changes to Linux and OpenGL ES 2.0 as that seems like a good start.
See #2837 for more background and discussion.