added rounded rectangle, first iteration works but still needs improved corners
This commit is contained in:
@@ -50,3 +50,18 @@ public:
|
||||
return create_buffers(idx, vertices, sizeof(idx), sizeof(vertices));
|
||||
}
|
||||
};
|
||||
|
||||
class Rounded : public Shape
|
||||
{
|
||||
void create_impl(float w, float h, float r, int div, GLushort* idx, GLushort* idx_tmp, vertex_t* vertices);
|
||||
public:
|
||||
template<int div>
|
||||
bool create(float w, float h, float r)
|
||||
{
|
||||
static GLushort idx[(10 + div * 4) * 3];
|
||||
static GLushort idx_tmp[div+1];
|
||||
static vertex_t vertices[12 + (div-1) * 4];
|
||||
create_impl(w, h, r, div, idx, idx_tmp, vertices);
|
||||
return create_buffers(idx, vertices, sizeof(idx), sizeof(vertices));
|
||||
}
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user