mirror of
https://github.com/Drezil/imgui.git
synced 2025-07-04 12:08:47 +02:00
AA branch: io.RenderDrawListsFn signature changed to take ImDrawData, neater and future proof breaking of the render API (#133 #254)
This commit is contained in:
14
imgui.h
14
imgui.h
@ -31,6 +31,7 @@
|
||||
// Forward declarations
|
||||
struct ImDrawCmd;
|
||||
struct ImDrawList;
|
||||
struct ImDrawData;
|
||||
struct ImFont;
|
||||
struct ImFontAtlas;
|
||||
struct ImGuiIO;
|
||||
@ -670,7 +671,7 @@ struct ImGuiIO
|
||||
|
||||
// REQUIRED: rendering function.
|
||||
// See example code if you are unsure of how to implement this.
|
||||
void (*RenderDrawListsFn)(ImDrawList** const draw_lists, int count);
|
||||
void (*RenderDrawListsFn)(ImDrawData* data);
|
||||
|
||||
// Optional: access OS clipboard
|
||||
// (default to use native Win32 clipboard on Windows, otherwise uses a private clipboard. Override to access OS clipboard on other architectures)
|
||||
@ -981,7 +982,7 @@ struct ImGuiListClipper
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// Draw List
|
||||
// Hold a series of drawing commands. The user provides a renderer for ImDrawList.
|
||||
// Hold a series of drawing commands. The user provides a renderer for ImDrawData which essentially contains an array of ImDrawList.
|
||||
//-----------------------------------------------------------------------------
|
||||
|
||||
// Draw callbacks for advanced uses.
|
||||
@ -1087,6 +1088,15 @@ struct ImDrawList
|
||||
IMGUI_API void UpdateTextureID();
|
||||
};
|
||||
|
||||
// All draw data to render an ImGui frame
|
||||
struct ImDrawData
|
||||
{
|
||||
ImDrawList** cmd_lists;
|
||||
int cmd_lists_count;
|
||||
int total_vtx_count; // For convenience, sum of all cmd_lists vtx_buffer.size()
|
||||
int total_idx_count; // For convenience, sum of all cmd_lists idx_buffer.size()
|
||||
};
|
||||
|
||||
// Load and rasterize multiple TTF fonts into a same texture.
|
||||
// Sharing a texture for multiple fonts allows us to reduce the number of draw calls during rendering.
|
||||
// We also add custom graphic data into the texture that serves for ImGui.
|
||||
|
Reference in New Issue
Block a user