Skip to content

Commit 0e21bde

Browse files
committed
Misc shallow merge to reduce diff in other branches.
1 parent 8a9de84 commit 0e21bde

File tree

4 files changed

+25
-5
lines changed

4 files changed

+25
-5
lines changed

backends/imgui_impl_dx10.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@
4747
#pragma comment(lib, "d3dcompiler") // Automatically link with d3dcompiler.lib as we are using D3DCompile() below.
4848
#endif
4949

50-
// DirectX data
50+
// DirectX10 data
5151
struct ImGui_ImplDX10_Data
5252
{
5353
ID3D10Device* pd3dDevice;

backends/imgui_impl_opengl2.cpp

+11-1
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,16 @@
6969
#include <GL/gl.h>
7070
#endif
7171

72+
// [Debugging]
73+
//#define IMGUI_IMPL_OPENGL_DEBUG
74+
#ifdef IMGUI_IMPL_OPENGL_DEBUG
75+
#include <stdio.h>
76+
#define GL_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+
#define GL_CALL(_CALL) _CALL // Call without error check
79+
#endif
80+
81+
// OpenGL data
7282
struct ImGui_ImplOpenGL2_Data
7383
{
7484
GLuint FontTexture;
@@ -155,7 +165,7 @@ static void ImGui_ImplOpenGL2_SetupRenderState(ImDrawData* draw_data, int fb_wid
155165

156166
// Setup viewport, orthographic projection matrix
157167
// 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.
158-
glViewport(0, 0, (GLsizei)fb_width, (GLsizei)fb_height);
168+
GL_CALL(glViewport(0, 0, (GLsizei)fb_width, (GLsizei)fb_height));
159169
glMatrixMode(GL_PROJECTION);
160170
glPushMatrix();
161171
glLoadIdentity();

imgui.h

+5-3
Original file line numberDiff line numberDiff line change
@@ -158,7 +158,7 @@ typedef unsigned int ImU32; // 32-bit unsigned integer (often used to st
158158
typedef signed long long ImS64; // 64-bit signed integer
159159
typedef unsigned long long ImU64; // 64-bit unsigned integer
160160

161-
// Forward declarations
161+
// Forward declarations: ImDrawList, ImFontAtlas layer
162162
struct ImDrawChannel; // Temporary storage to output draw commands out of order, used by ImDrawListSplitter and ImDrawList::ChannelsSplit()
163163
struct ImDrawCmd; // A single draw command within a parent ImDrawList (generally maps to 1 GPU draw call, unless it is a callback)
164164
struct ImDrawData; // All draw command lists required to render the frame + pos/size coordinates to use for the projection matrix.
@@ -173,6 +173,8 @@ struct ImFontConfig; // Configuration data when adding a font or
173173
struct ImFontGlyph; // A single font glyph (code point + coordinates within in ImFontAtlas + offset)
174174
struct ImFontGlyphRangesBuilder; // Helper to build glyph ranges from text/string data
175175
struct ImColor; // Helper functions to create a color that can be converted to either u32 or float4 (*OBSOLETE* please avoid using)
176+
177+
// Forward declarations: ImGui layer
176178
struct ImGuiContext; // Dear ImGui context (opaque structure, unless including imgui_internal.h)
177179
struct ImGuiIO; // Main configuration and I/O between your application and ImGui (also see: ImGuiPlatformIO)
178180
struct ImGuiInputTextCallbackData; // Shared state of InputText() when using custom ImGuiInputTextCallback (rare/advanced use)
@@ -3374,7 +3376,7 @@ struct ImFontAtlas
33743376
IMGUI_API const ImWchar* GetGlyphRangesVietnamese(); // Default + Vietnamese characters
33753377

33763378
//-------------------------------------------
3377-
// [BETA] Custom Rectangles/Glyphs API
3379+
// [ALPHA] Custom Rectangles/Glyphs API
33783380
//-------------------------------------------
33793381

33803382
// You can request arbitrary rectangles to be packed into the atlas, for your own purposes.
@@ -3400,11 +3402,11 @@ struct ImFontAtlas
34003402
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.
34013403
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.
34023404
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.
34043405
void* UserData; // Store your own atlas related user-data (if e.g. you have multiple font atlas).
34053406

34063407
// [Internal]
34073408
// 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.
34083410
bool TexReady; // Set when texture was built matching current font input
34093411
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.
34103412
unsigned char* TexPixelsAlpha8; // 1 component per pixel, each component is unsigned 8-bit. Total size = TexWidth * TexHeight

imgui_internal.h

+8
Original file line numberDiff line numberDiff line change
@@ -130,10 +130,17 @@ Index of this file:
130130
// [SECTION] Forward declarations
131131
//-----------------------------------------------------------------------------
132132

133+
// Utilities
134+
// (other types which are not forwarded declared are: ImBitArray<>, ImSpan<>, ImSpanAllocator<>, ImPool<>, ImChunkStream<>)
133135
struct ImBitVector; // Store 1-bit per value
134136
struct ImRect; // An axis-aligned rectangle (2 points)
137+
struct ImGuiTextIndex; // Maintain a line index for a text buffer.
138+
139+
// ImDrawList/ImFontAtlas
135140
struct ImDrawDataBuilder; // Helper to build a ImDrawData instance
136141
struct ImDrawListSharedData; // Data shared between all ImDrawList instances
142+
143+
// ImGui
137144
struct ImGuiBoxSelectState; // Box-selection state (currently used by multi-selection, could potentially be used by others)
138145
struct ImGuiColorMod; // Stacked color modifier, backup of modified data so we can restore it
139146
struct ImGuiContext; // Main Dear ImGui context
@@ -736,6 +743,7 @@ struct ImGuiTextIndex
736743

737744
// Helper: ImGuiStorage
738745
IMGUI_API ImGuiStoragePair* ImLowerBound(ImGuiStoragePair* in_begin, ImGuiStoragePair* in_end, ImGuiID key);
746+
739747
//-----------------------------------------------------------------------------
740748
// [SECTION] ImDrawList support
741749
//-----------------------------------------------------------------------------

0 commit comments

Comments
 (0)