AA branch: Re-added PrimVtx() + PrimWriteVtx, PrimWriteIdx for finer control (#133)

This commit is contained in:
ocornut 2015-07-08 14:03:27 -06:00
parent 2f574ef952
commit 09e8c4ec11

View File

@ -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();
};