add Slice9 type

This commit is contained in:
Omar Mohamed Ali Mudhir
2017-01-16 14:42:22 +00:00
parent 8c217af051
commit d5fed78bf5
7 changed files with 135 additions and 70 deletions

View File

@@ -58,10 +58,23 @@ public:
template<int div>
bool create(float w, float h, float r)
{
static GLushort idx[(10 + div * 4) * 3];
static GLushort idx[(10 + div * 4) * 3 + (4 + div * 4) * 2];
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));
}
};
class Slice9 : public Shape
{
void create_impl(float w, float h, float r, GLushort* idx, vertex_t* vertices);
public:
bool create(float w, float h, float r)
{
static GLushort idx[3 * 3 * 6 + 4 * 2];
static vertex_t vertices[4 * 4];
create_impl(w, h, r, idx, vertices);
return create_buffers(idx, vertices, sizeof(idx), sizeof(vertices));
}
};