mirror of
				https://github.com/Drezil/imgui.git
				synced 2025-10-31 13:11:05 +01:00 
			
		
		
		
	ImDrawList: Added Clone() helper function.
This commit is contained in:
		
							
								
								
									
										18
									
								
								imgui.h
									
									
									
									
									
								
							
							
						
						
									
										18
									
								
								imgui.h
									
									
									
									
									
								
							| @@ -1579,6 +1579,7 @@ struct ImDrawList | ||||
|     // Advanced | ||||
|     IMGUI_API void  AddCallback(ImDrawCallback callback, void* callback_data);  // Your rendering function must check for 'UserCallback' in ImDrawCmd and call the function instead of rendering triangles. | ||||
|     IMGUI_API void  AddDrawCmd();                                               // This is useful if you need to forcefully create a new draw call (to allow for dependent rendering / blending). Otherwise primitives are merged into the same draw-call as much as possible | ||||
|     IMGUI_API ImDrawList* CloneOutput() const;                                  // Create a clone of the CmdBuffer/IdxBuffer/VtxBuffer. | ||||
|  | ||||
|     // Internal helpers | ||||
|     // NB: all primitives needs to be reserved via PrimReserve() beforehand! | ||||
| @@ -1600,16 +1601,17 @@ struct ImDrawList | ||||
| 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 | ||||
|     ImDrawList**    CmdLists;               // Array of ImDrawList* to render. The ImDrawList are owned by ImGuiContext and only pointed to from here. | ||||
|     int             CmdListsCount;          // Number of ImDrawList* to render | ||||
|     int             TotalIdxCount;          // For convenience, sum of all ImDrawList's IdxBuffer.Size | ||||
|     int             TotalVtxCount;          // For convenience, sum of all ImDrawList's VtxBuffer.Size | ||||
|  | ||||
|     // Functions | ||||
|     ImDrawData() { Clear(); } | ||||
|     void Clear() { Valid = false; CmdLists = NULL; CmdListsCount = TotalVtxCount = TotalIdxCount = 0; } // Draw lists are owned by the ImGuiContext and only pointed to here. | ||||
|     IMGUI_API void DeIndexAllBuffers();               // For backward compatibility or convenience: 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. | ||||
|     ImDrawData()    { Valid = false; Clear(); } | ||||
|     ~ImDrawData()   { Clear(); } | ||||
|     void Clear()    { Valid = false; CmdLists = NULL; CmdListsCount = TotalVtxCount = TotalIdxCount = 0; } // The ImDrawList are owned by ImGuiContext! | ||||
|     IMGUI_API void  DeIndexAllBuffers();                // Helper to convert all buffers from indexed to non-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