Implement clipping
This commit is contained in:
@@ -56,6 +56,8 @@ void Command::Reset() {
|
||||
VertexCount = 0;
|
||||
VertexCountMax = 0;
|
||||
IndexCountMax = 0;
|
||||
ClipRect = 0.f;
|
||||
ClipRectUsed = false;
|
||||
}
|
||||
|
||||
Command& Command::Add(const Vertex& vtx) {
|
||||
|
||||
@@ -43,6 +43,7 @@ PD_API void Drawlist::Clear() {
|
||||
pPath.ResetFast();
|
||||
pCommands.NoReset();
|
||||
pCurrentLayer = 0;
|
||||
pClipRects.clear();
|
||||
}
|
||||
|
||||
/** Command Allocation */
|
||||
@@ -51,6 +52,10 @@ PD_API Command& Drawlist::NewCommand() {
|
||||
cmd->Reset();
|
||||
cmd->Layer = pCurrentLayer;
|
||||
cmd->Tex = pCurrentTexture.GetID();
|
||||
if (HasClipRect()) {
|
||||
cmd->ClipRectUsed = HasClipRect();
|
||||
cmd->ClipRect = pClipRects.back();
|
||||
}
|
||||
return *cmd;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user