Package imgui
Class ImDrawData
java.lang.Object
imgui.binding.ImGuiStruct
imgui.ImDrawData
All draw data to render Dear ImGui frame
(NB: the style and the naming convention here is a little inconsistent, we currently preserve them for backward compatibility purpose,
as this is one of the oldest structure exposed by the library! Basically, ImDrawList == CmdList)
BINDING NOTICE: Since it's impossible to do a 1:1 mapping with JNI, current class provides "getCmdList*()" methods. Those are used to get the data needed to do a rendering.
-
Field Summary
Fields inherited from class imgui.binding.ImGuiStruct
ptr -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidaddDrawList(ImDrawList drawList) Helper to add an external draw list into an existing ImDrawData.voidclear()voidHelper to convert all buffers from indexed to non-indexed, in case you cannot render indexed.getCmdListCmdBufferClipRect(int cmdListIdx, int cmdBufferIdx) Clipping rectangle (x1, y1, x2, y2).voidgetCmdListCmdBufferClipRect(ImVec4 dst, int cmdListIdx, int cmdBufferIdx) Clipping rectangle (x1, y1, x2, y2).intgetCmdListCmdBufferElemCount(int cmdListIdx, int cmdBufferIdx) Number of indices (multiple of 3) to be rendered as triangles.intgetCmdListCmdBufferIdxOffset(int cmdListIdx, int cmdBufferIdx) Start offset in index buffer.intgetCmdListCmdBufferSize(int cmdListIdx) Draw commands.longgetCmdListCmdBufferTextureId(int cmdListIdx, int cmdBufferIdx) User-provided texture ID.intgetCmdListCmdBufferVtxOffset(int cmdListIdx, int cmdBufferIdx) Start offset in vertex buffer.getCmdListIdxBufferData(int cmdListIdx) intgetCmdListIdxBufferSize(int cmdListIdx) Index buffer.intNumber of ImDrawList* to rendergetCmdListVtxBufferData(int cmdListIdx) intgetCmdListVtxBufferSize(int cmdListIdx) Vertex buffer.Upper-left position of the viewport to render (== upper-left of the orthogonal projection matrix to use)voidgetDisplayPos(ImVec2 dst) Upper-left position of the viewport to render (== upper-left of the orthogonal projection matrix to use)floatUpper-left position of the viewport to render (== upper-left of the orthogonal projection matrix to use)floatUpper-left position of the viewport to render (== upper-left of the orthogonal projection matrix to use)Size of the viewport to render (== io.DisplaySize for the main viewport) (DisplayPos + DisplaySize == lower-right of the orthogonal projection matrix to use)voidgetDisplaySize(ImVec2 dst) Size of the viewport to render (== io.DisplaySize for the main viewport) (DisplayPos + DisplaySize == lower-right of the orthogonal projection matrix to use)floatSize of the viewport to render (== io.DisplaySize for the main viewport) (DisplayPos + DisplaySize == lower-right of the orthogonal projection matrix to use)floatSize of the viewport to render (== io.DisplaySize for the main viewport) (DisplayPos + DisplaySize == lower-right of the orthogonal projection matrix to use)Amount of pixels for each unit of DisplaySize.voidAmount of pixels for each unit of DisplaySize.floatAmount of pixels for each unit of DisplaySize.floatAmount of pixels for each unit of DisplaySize.Viewport carrying the ImDrawData instance, might be of use to the renderer (generally not).intFor convenience, sum of all ImDrawList's IdxBuffer.SizeintFor convenience, sum of all ImDrawList's VtxBuffer.SizebooleangetValid()Only valid after Render() is called and before the next NewFrame() is called.voidscaleClipRects(float fbScaleX, float fbScaleY) Helper to scale the ClipRect field of each ImDrawCmd.voidscaleClipRects(ImVec2 fbScale) Helper to scale the ClipRect field of each ImDrawCmd.static intstatic intMethods inherited from class imgui.binding.ImGuiStruct
isNotValidPtr, isValidPtr
-
Constructor Details
-
ImDrawData
public ImDrawData(long ptr)
-
-
Method Details
-
getCmdListCmdBufferSize
public int getCmdListCmdBufferSize(int cmdListIdx) Draw commands. Typically 1 command = 1 GPU draw call, unless the command is a callback. -
getCmdListCmdBufferElemCount
public int getCmdListCmdBufferElemCount(int cmdListIdx, int cmdBufferIdx) Number of indices (multiple of 3) to be rendered as triangles. Vertices are stored in the callee ImDrawList's vtx_buffer[] array, indices in idx_buffer[]. -
getCmdListCmdBufferClipRect
Clipping rectangle (x1, y1, x2, y2). Subtract ImDrawData.DisplayPos to get clipping rectangle in "viewport" coordinates -
getCmdListCmdBufferClipRect
Clipping rectangle (x1, y1, x2, y2). Subtract ImDrawData.DisplayPos to get clipping rectangle in "viewport" coordinates -
getCmdListCmdBufferTextureId
public long getCmdListCmdBufferTextureId(int cmdListIdx, int cmdBufferIdx) User-provided texture ID. Set by user in ImfontAtlas::SetTexID() for fonts or passed to Image*() functions. Ignore if never using images or multiple fonts atlas. -
getCmdListCmdBufferVtxOffset
public int getCmdListCmdBufferVtxOffset(int cmdListIdx, int cmdBufferIdx) Start offset in vertex buffer. Pre-1.71 or without ImGuiBackendFlags_RendererHasVtxOffset: always 0. With ImGuiBackendFlags_RendererHasVtxOffset: may be>0 to support meshes larger than 64K vertices with 16-bit indices. -
getCmdListCmdBufferIdxOffset
public int getCmdListCmdBufferIdxOffset(int cmdListIdx, int cmdBufferIdx) Start offset in index buffer. Always equal to sum of ElemCount drawn so far. -
getCmdListIdxBufferSize
public int getCmdListIdxBufferSize(int cmdListIdx) Index buffer. Each command consume ImDrawCmd::ElemCount of those -
getCmdListIdxBufferData
-
getCmdListVtxBufferSize
public int getCmdListVtxBufferSize(int cmdListIdx) Vertex buffer. -
getCmdListVtxBufferData
-
sizeOfImDrawVert
public static int sizeOfImDrawVert() -
sizeOfImDrawIdx
public static int sizeOfImDrawIdx() -
getValid
public boolean getValid()Only valid after Render() is called and before the next NewFrame() is called. -
getCmdListsCount
public int getCmdListsCount()Number of ImDrawList* to render -
getTotalIdxCount
public int getTotalIdxCount()For convenience, sum of all ImDrawList's IdxBuffer.Size -
getTotalVtxCount
public int getTotalVtxCount()For convenience, sum of all ImDrawList's VtxBuffer.Size -
getDisplayPos
Upper-left position of the viewport to render (== upper-left of the orthogonal projection matrix to use) -
getDisplayPosX
public float getDisplayPosX()Upper-left position of the viewport to render (== upper-left of the orthogonal projection matrix to use) -
getDisplayPosY
public float getDisplayPosY()Upper-left position of the viewport to render (== upper-left of the orthogonal projection matrix to use) -
getDisplayPos
Upper-left position of the viewport to render (== upper-left of the orthogonal projection matrix to use) -
getDisplaySize
Size of the viewport to render (== io.DisplaySize for the main viewport) (DisplayPos + DisplaySize == lower-right of the orthogonal projection matrix to use) -
getDisplaySizeX
public float getDisplaySizeX()Size of the viewport to render (== io.DisplaySize for the main viewport) (DisplayPos + DisplaySize == lower-right of the orthogonal projection matrix to use) -
getDisplaySizeY
public float getDisplaySizeY()Size of the viewport to render (== io.DisplaySize for the main viewport) (DisplayPos + DisplaySize == lower-right of the orthogonal projection matrix to use) -
getDisplaySize
Size of the viewport to render (== io.DisplaySize for the main viewport) (DisplayPos + DisplaySize == lower-right of the orthogonal projection matrix to use) -
getFramebufferScale
Amount of pixels for each unit of DisplaySize. Based on io.DisplayFramebufferScale. Generally (1,1) on normal display, (2,2) on OSX with Retina display. -
getFramebufferScaleX
public float getFramebufferScaleX()Amount of pixels for each unit of DisplaySize. Based on io.DisplayFramebufferScale. Generally (1,1) on normal display, (2,2) on OSX with Retina display. -
getFramebufferScaleY
public float getFramebufferScaleY()Amount of pixels for each unit of DisplaySize. Based on io.DisplayFramebufferScale. Generally (1,1) on normal display, (2,2) on OSX with Retina display. -
getFramebufferScale
Amount of pixels for each unit of DisplaySize. Based on io.DisplayFramebufferScale. Generally (1,1) on normal display, (2,2) on OSX with Retina display. -
getOwnerViewport
Viewport carrying the ImDrawData instance, might be of use to the renderer (generally not). -
clear
public void clear() -
addDrawList
Helper to add an external draw list into an existing ImDrawData. -
deIndexAllBuffers
public 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! -
scaleClipRects
Helper to scale the ClipRect field of each ImDrawCmd. Use if your final output buffer is at a different scale than Dear ImGui expects, or if there is a difference between your window resolution and framebuffer resolution. -
scaleClipRects
public void scaleClipRects(float fbScaleX, float fbScaleY) Helper to scale the ClipRect field of each ImDrawCmd. Use if your final output buffer is at a different scale than Dear ImGui expects, or if there is a difference between your window resolution and framebuffer resolution.
-