You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardexpand all lines: backends/imgui_impl_opengl2.cpp
+11-1
Original file line number
Diff line number
Diff line change
@@ -69,6 +69,16 @@
69
69
#include<GL/gl.h>
70
70
#endif
71
71
72
+
// [Debugging]
73
+
//#define IMGUI_IMPL_OPENGL_DEBUG
74
+
#ifdef IMGUI_IMPL_OPENGL_DEBUG
75
+
#include<stdio.h>
76
+
#defineGL_CALL(_CALL) do { _CALL; GLenum gl_err = glGetError(); if (gl_err != 0) fprintf(stderr, "GL error 0x%x returned from '%s'.\n", gl_err, #_CALL); } while (0) // Call with error check
77
+
#else
78
+
#defineGL_CALL(_CALL) _CALL // Call without error check
79
+
#endif
80
+
81
+
// OpenGL data
72
82
structImGui_ImplOpenGL2_Data
73
83
{
74
84
GLuint FontTexture;
@@ -155,7 +165,7 @@ static void ImGui_ImplOpenGL2_SetupRenderState(ImDrawData* draw_data, int fb_wid
155
165
156
166
// Setup viewport, orthographic projection matrix
157
167
// Our visible imgui space lies from draw_data->DisplayPos (top left) to draw_data->DisplayPos+data_data->DisplaySize (bottom right). DisplayPos is (0,0) for single viewport apps.
// You can request arbitrary rectangles to be packed into the atlas, for your own purposes.
@@ -3400,11 +3402,11 @@ struct ImFontAtlas
3400
3402
ImTextureID TexID; // User data to refer to the texture once it has been uploaded to user's graphic systems. It is passed back to you during rendering via the ImDrawCmd structure.
3401
3403
int TexDesiredWidth; // Texture width desired by user before Build(). Must be a power-of-two. If have many glyphs your graphics API have texture size restrictions you may want to increase texture width to decrease height.
3402
3404
int TexGlyphPadding; // FIXME: Should be called "TexPackPadding". Padding between glyphs within texture in pixels. Defaults to 1. If your rendering method doesn't rely on bilinear filtering you may set this to 0 (will also need to set AntiAliasedLinesUseTex = false).
3403
-
bool Locked; // Marked as Locked by ImGui::NewFrame() so attempt to modify the atlas will assert.
3404
3405
void* UserData; // Store your own atlas related user-data (if e.g. you have multiple font atlas).
3405
3406
3406
3407
// [Internal]
3407
3408
// NB: Access texture data via GetTexData*() calls! Which will setup a default font for you.
3409
+
bool Locked; // Marked as Locked by ImGui::NewFrame() so attempt to modify the atlas will assert.
3408
3410
bool TexReady; // Set when texture was built matching current font input
3409
3411
bool TexPixelsUseColors; // Tell whether our texture data is known to use colors (rather than just alpha channel), in order to help backend select a format.
3410
3412
unsignedchar* TexPixelsAlpha8; // 1 component per pixel, each component is unsigned 8-bit. Total size = TexWidth * TexHeight
0 commit comments