mirror of
https://github.com/Drezil/imgui.git
synced 2024-11-26 05:27:01 +00:00
Comments
This commit is contained in:
parent
a5e0210902
commit
1e981f00e5
20
imgui.h
20
imgui.h
@ -959,10 +959,10 @@ struct ImGuiTextBuffer
|
||||
// Helper: Simple Key->value storage
|
||||
// Typically you don't have to worry about this since a storage is held within each Window.
|
||||
// We use it to e.g. store collapse state for a tree (Int 0/1), store color edit options.
|
||||
// You can use it as custom user storage for temporary values.
|
||||
// Declare your own storage if:
|
||||
// This is optimized for efficient reading (dichotomy into a contiguous buffer), rare writing (typically tied to user interactions)
|
||||
// You can use it as custom user storage for temporary values. Declare your own storage if, for example:
|
||||
// - You want to manipulate the open/close state of a particular sub-tree in your interface (tree node uses Int 0/1 to store their state).
|
||||
// - You want to store custom debug data easily without adding or editing structures in your code.
|
||||
// - You want to store custom debug data easily without adding or editing structures in your code (probably not efficient, but convenient)
|
||||
// Types are NOT stored, so it is up to you to make sure your Key don't collide with different types.
|
||||
struct ImGuiStorage
|
||||
{
|
||||
@ -1166,11 +1166,12 @@ struct ImDrawChannel
|
||||
// At the moment, each ImGui window contains its own ImDrawList but they could potentially be merged in the future.
|
||||
// If you want to add custom rendering within a window, you can use ImGui::GetWindowDrawList() to access the current draw list and add your own primitives.
|
||||
// You can interleave normal ImGui:: calls and adding primitives to the current draw list.
|
||||
// All positions are in screen coordinates (0,0=top-left, 1 pixel per unit). Primitives are always added to the list and not culled (culling is done at render time and at a higher-level by ImGui:: functions).
|
||||
// All positions are generally in pixel coordinates (top-left at (0,0), bottom-right at io.DisplaySize), however you are totally free to apply whatever transformation matrix to want to the data (if you apply such transformation you'll want to apply it to ClipRect as well)
|
||||
// Primitives are always added to the list and not culled (culling is done at higher-level by ImGui:: functions).
|
||||
struct ImDrawList
|
||||
{
|
||||
// This is what you have to render
|
||||
ImVector<ImDrawCmd> CmdBuffer; // Commands. Typically 1 command = 1 gpu draw call.
|
||||
ImVector<ImDrawCmd> CmdBuffer; // Commands. Typically 1 command = 1 GPU draw call.
|
||||
ImVector<ImDrawIdx> IdxBuffer; // Index buffer. Each command consume ImDrawCmd::ElemCount of those
|
||||
ImVector<ImDrawVert> VtxBuffer; // Vertex buffer.
|
||||
|
||||
@ -1261,7 +1262,7 @@ struct ImDrawData
|
||||
|
||||
// Functions
|
||||
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 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.
|
||||
};
|
||||
|
||||
@ -1280,7 +1281,7 @@ struct ImFontConfig
|
||||
bool MergeMode; // false // Merge into previous ImFont, so you can combine multiple inputs font into one ImFont (e.g. ASCII font + icons + Japanese glyphs). You may want to use GlyphOffset.y when merge font of different heights.
|
||||
|
||||
// [Internal]
|
||||
char Name[32]; // Name (strictly for debugging)
|
||||
char Name[32]; // Name (strictly to ease debugging)
|
||||
ImFont* DstFont;
|
||||
|
||||
IMGUI_API ImFontConfig();
|
||||
@ -1293,8 +1294,7 @@ struct ImFontConfig
|
||||
// 2. Call GetTexDataAsAlpha8() or GetTexDataAsRGBA32() to build and retrieve pixels data.
|
||||
// 3. Upload the pixels data into a texture within your graphics system.
|
||||
// 4. Call SetTexID(my_tex_id); and pass the pointer/identifier to your texture. This value will be passed back to you during rendering to identify the texture.
|
||||
// 5. Call ClearTexData() to free textures memory on the heap.
|
||||
// NB: If you use a 'glyph_ranges' array you need to make sure that your array persist up until the ImFont is cleared. We only copy the pointer, not the data.
|
||||
// IMPORTANT: If you pass a 'glyph_ranges' array to AddFont*** functions, you need to make sure that your array persist up until the ImFont is build (when calling GetTextData*** or Build()). We only copy the pointer, not the data.
|
||||
struct ImFontAtlas
|
||||
{
|
||||
IMGUI_API ImFontAtlas();
|
||||
@ -1320,7 +1320,7 @@ struct ImFontAtlas
|
||||
void SetTexID(ImTextureID id) { TexID = id; }
|
||||
|
||||
// Helpers to retrieve list of common Unicode ranges (2 value per range, values are inclusive, zero-terminated list)
|
||||
// NB: Make sure that your string are UTF-8 and NOT in your local code page. See FAQ for details.
|
||||
// NB: Make sure that your string are UTF-8 and NOT in your local code page. In C++11, you can create a UTF-8 string literally using the u8"Hello world" syntax. See FAQ for details.
|
||||
IMGUI_API const ImWchar* GetGlyphRangesDefault(); // Basic Latin, Extended Latin
|
||||
IMGUI_API const ImWchar* GetGlyphRangesKorean(); // Default + Korean characters
|
||||
IMGUI_API const ImWchar* GetGlyphRangesJapanese(); // Default + Hiragana, Katakana, Half-Width, Selection of 1946 Ideographs
|
||||
|
Loading…
Reference in New Issue
Block a user