Skip to content
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

Will OpenGL ES 2.0 work from under OpenGL ES 3.0? #6423

Closed
VadimBoev opened this issue May 11, 2023 · 5 comments
Closed

Will OpenGL ES 2.0 work from under OpenGL ES 3.0? #6423

VadimBoev opened this issue May 11, 2023 · 5 comments

Comments

@VadimBoev
Copy link

Version: 1.89.5
Branch: release

Good afternoon dear ImGui. I need to create an Android application that will be based on OpenGL ES 2.0. I found an example for OpenGL ES 3.0, but I also saw in it that you can use ES 2.0. Thus, questions arise:
1.) Will it really work for ES 2.0?
2) Does it guarantee 100% performance on all devices? (because ES 3.0 is not available, as I know, on all phones).
3) Let's say the application is running on OpenGL ES 2.0, but from under OpenGL ES 3.0 (imgui_impl_opengl3.cpp )/ And if the phone does not have OpenGL ES 3, the application will not start?

@ocornut ocornut added the opengl label May 11, 2023
@VadimBoev
Copy link
Author

at the moment I have built an application for OpenGL ES 2.0. Using 'ImGui_ImplOpenGL3_Init("#version 100");' and it works, I will check and test, I will write after a while, can someone share their experience?

@ocornut
Copy link
Owner

ocornut commented May 15, 2023

  1. 3)imgui_impl_opengl3.cpp supports ES2 you need to #define IMGUI_IMPL_OPENGL_ES2 globally or in your imconfig.h file for it to work, and use GLSL "#version 100" string during init.

Performances should be good, but ES2 doesn't support glDrawElementsBaseVertex() so it may be preferable to also use #define ImDrawIdx unsigned int to use 32-bit indices for large mesh support.

@huguang6
Copy link

Hi, there is a question for me, on the arm paltform OpenGL ES 2.0, 32-bit indices is not support and also glDrawElementsBaseVertex(), so how to use "pcmd->VtxOffset" when set flag "ImGuiBackendFlags_RendererHasVtxOffset"

@ocornut
Copy link
Owner

ocornut commented May 30, 2024

If it cannot support it then the backend shouldn’t set ImGuiBackendFlags_RendererHasVtxOffset.

@huguang6
Copy link

If it cannot support it then the backend shouldn’t set ImGuiBackendFlags_RendererHasVtxOffset.
Thanks! I found the soultion int #3163

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants