From 09e8c4ec1154cb277eebbe09d0702541dbfbaf55 Mon Sep 17 00:00:00 2001 From: ocornut Date: Wed, 8 Jul 2015 14:03:27 -0600 Subject: [PATCH] AA branch: Re-added PrimVtx() + PrimWriteVtx, PrimWriteIdx for finer control (#133) --- imgui.h | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/imgui.h b/imgui.h index 9af8bf598ecb..dc558dc6806c 100644 --- a/imgui.h +++ b/imgui.h @@ -1088,9 +1088,13 @@ struct ImDrawList IMGUI_API void ChannelsSetCurrent(int idx); // Internal helpers + // NB: all primitives needs to be reserved via PrimReserve() beforehand! IMGUI_API void PrimReserve(int idx_count, int vtx_count); IMGUI_API void PrimRect(const ImVec2& a, const ImVec2& b, ImU32 col); IMGUI_API void PrimRectUV(const ImVec2& a, const ImVec2& b, const ImVec2& uv_a, const ImVec2& uv_b, ImU32 col); + inline void PrimVtx(const ImVec2& pos, const ImVec2& uv, ImU32 col) { PrimWriteIdx((ImDrawIdx)_VtxCurrentIdx); PrimWriteVtx(pos, uv, col); } + inline void PrimWriteVtx(const ImVec2& pos, const ImVec2& uv, ImU32 col){ _VtxWritePtr->pos = pos; _VtxWritePtr->uv = uv; _VtxWritePtr->col = col; _VtxWritePtr++; _VtxCurrentIdx++; } + inline void PrimWriteIdx(ImDrawIdx idx) { *_IdxWritePtr = idx; _IdxWritePtr++; } IMGUI_API void UpdateClipRect(); IMGUI_API void UpdateTextureID(); };