소스 검색

Backends: OpenGL3: Added runtime flags for ES2/ES3 to simplify coding-style. (#6375)

ocornut 2 년 전
부모
커밋
dd9db5e889
1개의 변경된 파일7개의 추가작업 그리고 1개의 파일을 삭제
  1. 7 1
      backends/imgui_impl_opengl3.cpp

+ 7 - 1
backends/imgui_impl_opengl3.cpp

@@ -205,6 +205,8 @@ struct ImGui_ImplOpenGL3_Data
 {
 {
     GLuint          GlVersion;               // Extracted at runtime using GL_MAJOR_VERSION, GL_MINOR_VERSION queries (e.g. 320 for GL 3.2)
     GLuint          GlVersion;               // Extracted at runtime using GL_MAJOR_VERSION, GL_MINOR_VERSION queries (e.g. 320 for GL 3.2)
     char            GlslVersionString[32];   // Specified by user or detected based on compile time GL settings.
     char            GlslVersionString[32];   // Specified by user or detected based on compile time GL settings.
+    bool            GlProfileIsES2;
+    bool            GlProfileIsES3;
     bool            GlProfileIsCompat;
     bool            GlProfileIsCompat;
     GLint           GlProfileMask;
     GLint           GlProfileMask;
     GLuint          FontTexture;
     GLuint          FontTexture;
@@ -301,8 +303,12 @@ bool    ImGui_ImplOpenGL3_Init(const char* glsl_version)
             bd->UseBufferSubData = true;
             bd->UseBufferSubData = true;
 #endif
 #endif
     */
     */
-#else
+#elif defined(IMGUI_IMPL_OPENGL_ES2)
     bd->GlVersion = 200; // GLES 2
     bd->GlVersion = 200; // GLES 2
+    bd->GlProfileIsES2 = true;
+#elif defined(IMGUI_IMPL_OPENGL_ES3)
+    bd->GlVersion = 200; // Don't raise version as it is intended as a desktop version check for now.
+    bd->GlProfileIsES3 = true;
 #endif
 #endif
 
 
 #ifdef IMGUI_IMPL_OPENGL_DEBUG
 #ifdef IMGUI_IMPL_OPENGL_DEBUG