|
|
@ -346,11 +346,10 @@ void ImDrawList::PrimReserve(int idx_count, int vtx_count) |
|
|
|
|
|
|
|
void ImDrawList::PrimRect(const ImVec2& a, const ImVec2& c, ImU32 col) |
|
|
|
{ |
|
|
|
const ImVec2 uv = GImGui->FontTexUvWhitePixel; |
|
|
|
const ImVec2 b(c.x, a.y); |
|
|
|
const ImVec2 d(a.x, c.y); |
|
|
|
_IdxWritePtr[0] = (ImDrawIdx)(_VtxCurrentIdx); _IdxWritePtr[1] = (ImDrawIdx)(_VtxCurrentIdx+1); _IdxWritePtr[2] = (ImDrawIdx)(_VtxCurrentIdx+2); |
|
|
|
_IdxWritePtr[3] = (ImDrawIdx)(_VtxCurrentIdx); _IdxWritePtr[4] = (ImDrawIdx)(_VtxCurrentIdx+2); _IdxWritePtr[5] = (ImDrawIdx)(_VtxCurrentIdx+3); |
|
|
|
ImVec2 b(c.x, a.y), d(a.x, c.y), uv(GImGui->FontTexUvWhitePixel); |
|
|
|
ImDrawIdx idx = (ImDrawIdx)_VtxCurrentIdx; |
|
|
|
_IdxWritePtr[0] = idx; _IdxWritePtr[1] = (ImDrawIdx)(idx+1); _IdxWritePtr[2] = (ImDrawIdx)(idx+2); |
|
|
|
_IdxWritePtr[3] = idx; _IdxWritePtr[4] = (ImDrawIdx)(idx+2); _IdxWritePtr[5] = (ImDrawIdx)(idx+3); |
|
|
|
_VtxWritePtr[0].pos = a; _VtxWritePtr[0].uv = uv; _VtxWritePtr[0].col = col; |
|
|
|
_VtxWritePtr[1].pos = b; _VtxWritePtr[1].uv = uv; _VtxWritePtr[1].col = col; |
|
|
|
_VtxWritePtr[2].pos = c; _VtxWritePtr[2].uv = uv; _VtxWritePtr[2].col = col; |
|
|
@ -362,12 +361,24 @@ void ImDrawList::PrimRect(const ImVec2& a, const ImVec2& c, ImU32 col) |
|
|
|
|
|
|
|
void ImDrawList::PrimRectUV(const ImVec2& a, const ImVec2& c, const ImVec2& uv_a, const ImVec2& uv_c, ImU32 col) |
|
|
|
{ |
|
|
|
const ImVec2 b(c.x, a.y); |
|
|
|
const ImVec2 d(a.x, c.y); |
|
|
|
const ImVec2 uv_b(uv_c.x, uv_a.y); |
|
|
|
const ImVec2 uv_d(uv_a.x, uv_c.y); |
|
|
|
_IdxWritePtr[0] = (ImDrawIdx)(_VtxCurrentIdx); _IdxWritePtr[1] = (ImDrawIdx)(_VtxCurrentIdx+1); _IdxWritePtr[2] = (ImDrawIdx)(_VtxCurrentIdx+2); |
|
|
|
_IdxWritePtr[3] = (ImDrawIdx)(_VtxCurrentIdx); _IdxWritePtr[4] = (ImDrawIdx)(_VtxCurrentIdx+2); _IdxWritePtr[5] = (ImDrawIdx)(_VtxCurrentIdx+3); |
|
|
|
ImVec2 b(c.x, a.y), d(a.x, c.y), uv_b(uv_c.x, uv_a.y), uv_d(uv_a.x, uv_c.y); |
|
|
|
ImDrawIdx idx = (ImDrawIdx)_VtxCurrentIdx; |
|
|
|
_IdxWritePtr[0] = idx; _IdxWritePtr[1] = (ImDrawIdx)(idx+1); _IdxWritePtr[2] = (ImDrawIdx)(idx+2); |
|
|
|
_IdxWritePtr[3] = idx; _IdxWritePtr[4] = (ImDrawIdx)(idx+2); _IdxWritePtr[5] = (ImDrawIdx)(idx+3); |
|
|
|
_VtxWritePtr[0].pos = a; _VtxWritePtr[0].uv = uv_a; _VtxWritePtr[0].col = col; |
|
|
|
_VtxWritePtr[1].pos = b; _VtxWritePtr[1].uv = uv_b; _VtxWritePtr[1].col = col; |
|
|
|
_VtxWritePtr[2].pos = c; _VtxWritePtr[2].uv = uv_c; _VtxWritePtr[2].col = col; |
|
|
|
_VtxWritePtr[3].pos = d; _VtxWritePtr[3].uv = uv_d; _VtxWritePtr[3].col = col; |
|
|
|
_VtxWritePtr += 4; |
|
|
|
_VtxCurrentIdx += 4; |
|
|
|
_IdxWritePtr += 6; |
|
|
|
} |
|
|
|
|
|
|
|
void ImDrawList::PrimQuadUV(const ImVec2& a, const ImVec2& b, const ImVec2& c, const ImVec2& d, const ImVec2& uv_a, const ImVec2& uv_b, const ImVec2& uv_c, const ImVec2& uv_d, ImU32 col) |
|
|
|
{ |
|
|
|
ImDrawIdx idx = (ImDrawIdx)_VtxCurrentIdx; |
|
|
|
_IdxWritePtr[0] = idx; _IdxWritePtr[1] = (ImDrawIdx)(idx+1); _IdxWritePtr[2] = (ImDrawIdx)(idx+2); |
|
|
|
_IdxWritePtr[3] = idx; _IdxWritePtr[4] = (ImDrawIdx)(idx+2); _IdxWritePtr[5] = (ImDrawIdx)(idx+3); |
|
|
|
_VtxWritePtr[0].pos = a; _VtxWritePtr[0].uv = uv_a; _VtxWritePtr[0].col = col; |
|
|
|
_VtxWritePtr[1].pos = b; _VtxWritePtr[1].uv = uv_b; _VtxWritePtr[1].col = col; |
|
|
|
_VtxWritePtr[2].pos = c; _VtxWritePtr[2].uv = uv_c; _VtxWritePtr[2].col = col; |
|
|
|