mirror of
https://github.com/Drezil/imgui.git
synced 2025-07-07 21:39:54 +02:00
Added GetDrawData() alternative to setting a Render function.
This commit is contained in:
12
imgui.h
12
imgui.h
@ -105,6 +105,7 @@ namespace ImGui
|
||||
// Main
|
||||
IMGUI_API ImGuiIO& GetIO();
|
||||
IMGUI_API ImGuiStyle& GetStyle();
|
||||
IMGUI_API ImDrawData* GetDrawData(); // same value as passed to your RenderDrawListsFn() function. valid after Render() and until the next call to NewFrame()
|
||||
IMGUI_API void NewFrame();
|
||||
IMGUI_API void Render();
|
||||
IMGUI_API void Shutdown();
|
||||
@ -694,8 +695,9 @@ struct ImGuiIO
|
||||
// User Functions
|
||||
//------------------------------------------------------------------
|
||||
|
||||
// REQUIRED: rendering function.
|
||||
// See example code if you are unsure of how to implement this.
|
||||
// Rendering function, will be called in Render().
|
||||
// Alternatively you can keep this to NULL and call GetDrawData() after Render() to get the same pointer.
|
||||
// See example applications if you are unsure of how to implement this.
|
||||
void (*RenderDrawListsFn)(ImDrawData* data);
|
||||
|
||||
// Optional: access OS clipboard
|
||||
@ -1149,14 +1151,16 @@ struct ImDrawList
|
||||
// All draw data to render an ImGui frame
|
||||
struct ImDrawData
|
||||
{
|
||||
bool Valid; // Only valid after Render() is called and before the next NewFrame() is called.
|
||||
ImDrawList** CmdLists;
|
||||
int CmdListsCount;
|
||||
int TotalVtxCount; // For convenience, sum of all cmd_lists vtx_buffer.Size
|
||||
int TotalIdxCount; // For convenience, sum of all cmd_lists idx_buffer.Size
|
||||
|
||||
// Functions
|
||||
void DeIndexAllBuffers(); // For backward compatibility: convert all buffers from indexed to de-indexed, in case you cannot render indexed. Note: this is slow and most likely a waste of resources. Always prefer indexed rendering!
|
||||
void ScaleClipRects(const ImVec2& sc); // Helper to scale the ClipRect field of each ImDrawCmd. Use if your final output buffer is at a different scale than ImGui expects, or if there is a difference between your window resolution and framebuffer resolution.
|
||||
IMGUI_API ImDrawData() { Valid = false; CmdLists = NULL; CmdListsCount = TotalVtxCount = TotalIdxCount = 0; }
|
||||
IMGUI_API void DeIndexAllBuffers(); // For backward compatibility: convert all buffers from indexed to de-indexed, in case you cannot render indexed. Note: this is slow and most likely a waste of resources. Always prefer indexed rendering!
|
||||
IMGUI_API void ScaleClipRects(const ImVec2& sc); // Helper to scale the ClipRect field of each ImDrawCmd. Use if your final output buffer is at a different scale than ImGui expects, or if there is a difference between your window resolution and framebuffer resolution.
|
||||
};
|
||||
|
||||
struct ImFontConfig
|
||||
|
Reference in New Issue
Block a user