# 0.2.6-2
- Add Scissor (CLIP RECT) to lithium commands and UI7 Drawlist API - Enable ClipRect to UI7::Menu (probably create a enable/disable flag)
This commit is contained in:
@ -167,6 +167,24 @@ class Command : public SmartCtor<Command> {
|
||||
*/
|
||||
RenderMode Rendermode() const { return mode; }
|
||||
|
||||
/** Setter for Scissor Mode */
|
||||
Command& SetScissorMode(ScissorMode mode) {
|
||||
scissor = mode;
|
||||
return *this;
|
||||
}
|
||||
|
||||
/** Getter for Scissor Mode */
|
||||
ScissorMode GetScissorMode() const { return scissor; }
|
||||
|
||||
/** Setter for Scissor Area */
|
||||
Command& ScissorRect(const vec4& v) {
|
||||
scissor_area = v;
|
||||
return *this;
|
||||
}
|
||||
|
||||
/** Getter for Scissor Area */
|
||||
vec4 ScissorRect() const { return scissor_area; }
|
||||
|
||||
private:
|
||||
/**
|
||||
* Vertex Buffer
|
||||
@ -188,6 +206,10 @@ class Command : public SmartCtor<Command> {
|
||||
int index;
|
||||
/** RenderMode (Default to RenderMode_RGBA) */
|
||||
RenderMode mode = RenderMode_RGBA;
|
||||
/** Scissor Mode (for defined area to render) */
|
||||
ScissorMode scissor = ScissorMode_None;
|
||||
/** scissor box (top left and bottom right) */
|
||||
vec4 scissor_area;
|
||||
};
|
||||
} // namespace LI
|
||||
} // namespace PD
|
@ -61,5 +61,11 @@ enum RenderMode {
|
||||
RenderMode_RGBA, ///< RGBA [for textures or solid colors]
|
||||
RenderMode_Font, ///< A8 [for textures only crated by 1 color channel]
|
||||
};
|
||||
/** Scissor Mode (for ClipRect related rendering) */
|
||||
enum ScissorMode {
|
||||
ScissorMode_None = 0, ///< No Scissor
|
||||
ScissorMode_Inverted = 1, ///< Render Pixels outside the box
|
||||
ScissorMode_Normal = 3, ///< Only render pixels inside the box
|
||||
};
|
||||
} // namespace LI
|
||||
} // namespace PD
|
@ -118,6 +118,26 @@ class StaticObject : public SmartCtor<StaticObject> {
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Set a Custom Scissor Mode for Object Copy List
|
||||
* @param m New Mode to Set
|
||||
*/
|
||||
void ReSetScissorMode(ScissorMode m) {
|
||||
for (auto& i : cpy) {
|
||||
i->SetScissorMode(m);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Set Custom Scissor Rect to All Objects
|
||||
* @param v Scissor Rect to set
|
||||
*/
|
||||
void ReScissorRect(const vec4& v) {
|
||||
for (auto& i : cpy) {
|
||||
i->ScissorRect(v);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Get a Reference to the Copy Commands List
|
||||
* @return command list reference
|
||||
@ -296,6 +316,18 @@ class StaticText : public SmartCtor<StaticText> {
|
||||
*/
|
||||
Font::Ref Font() { return font; }
|
||||
|
||||
/**
|
||||
* Set a Custom Scissor Mode Static Text
|
||||
* @param m New Mode to Set
|
||||
*/
|
||||
void SetScissorMode(ScissorMode m) { text->ReSetScissorMode(m); }
|
||||
|
||||
/**
|
||||
* Set Custom Scissor Rect to Static Text
|
||||
* @param v Scissor Rect to set
|
||||
*/
|
||||
void ScissorRect(const vec4& v) { text->ReScissorRect(v); }
|
||||
|
||||
private:
|
||||
/** Font */
|
||||
Font::Ref font;
|
||||
|
Reference in New Issue
Block a user