add Slice9 type
This commit is contained in:
@@ -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));
|
||||
}
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user