mirror of
https://github.com/MihailRis/voxelcore.git
synced 2026-10-06 19:41:51 +00:00
feat: selectbox options context menu
This commit is contained in:
parent
3571d0c902
commit
e648703f7c
4 changed files with 59 additions and 0 deletions
|
|
@ -333,6 +333,15 @@ void Batch2D::rect(
|
|||
vertex(v1, glm::vec2(0, 0), r2,g2,b2,1.0f);
|
||||
}
|
||||
|
||||
void Batch2D::triangle(float x1, float y1, float x2, float y2, float x3, float y3) {
|
||||
if (index + 3 >= capacity) {
|
||||
flush();
|
||||
}
|
||||
vertex({x1, y1}, {x1, y1}, color.r, color.g, color.b, color.a);
|
||||
vertex({x2, y2}, {x2, y2}, color.r, color.g, color.b, color.a);
|
||||
vertex({x3, y3}, {x3, y3}, color.r, color.g, color.b, color.a);
|
||||
}
|
||||
|
||||
void Batch2D::sprite(float x, float y, float w, float h, const UVRegion& region, glm::vec4 tint){
|
||||
rect(x, y, w, h, region.u1, region.v1, region.u2-region.u1, region.v2-region.v1, tint.r, tint.g, tint.b, tint.a);
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue