Backends: OpenGL3: fixed build for WebGL, ES2/ES3. (#2186, #3998, #3146, #3143, #8640)

Amend fe33b77
This commit is contained in:
ocornut 2026-10-01 19:20:39 +02:00
parent a3f3e4944a
commit ed73ef4e84

View File

@ -192,6 +192,10 @@
#define IMGUI_IMPL_OPENGL_LOADER_IMGL3W #define IMGUI_IMPL_OPENGL_LOADER_IMGL3W
#include "imgui_impl_opengl3_loader.h" #include "imgui_impl_opengl3_loader.h"
#endif #endif
#ifndef GL_LOWER_LEFT
#define GL_LOWER_LEFT 0x8CA1
#define GL_UPPER_LEFT 0x8CA2
#endif
// Vertex arrays are not supported on ES2/WebGL1 unless Emscripten which uses an extension // Vertex arrays are not supported on ES2/WebGL1 unless Emscripten which uses an extension
#ifndef IMGUI_IMPL_OPENGL_ES2 #ifndef IMGUI_IMPL_OPENGL_ES2
@ -529,7 +533,7 @@ void ImGui_ImplOpenGL3_RenderDrawData(ImDrawData* draw_data)
if (bd->ClipOriginCurrent == 0) if (bd->ClipOriginCurrent == 0)
{ {
bd->ClipOriginCurrent = GL_LOWER_LEFT; bd->ClipOriginCurrent = GL_LOWER_LEFT;
#if defined(GL_CLIP_ORIGIN) #ifdef GL_CLIP_ORIGIN
if (bd->HasClipOrigin) if (bd->HasClipOrigin)
glGetIntegerv(GL_CLIP_ORIGIN, (GLint*)&bd->ClipOriginCurrent); glGetIntegerv(GL_CLIP_ORIGIN, (GLint*)&bd->ClipOriginCurrent);
#endif #endif