textures working on web, separation of vertex and index buffers (actually matters)
This commit is contained in:
@ -39,12 +39,18 @@ enum {
|
||||
|
||||
|
||||
typedef uint32_t VertexBuffer;
|
||||
typedef uint32_t IndexBuffer;
|
||||
|
||||
typedef struct VertexBufferBuilder {
|
||||
size_t size;
|
||||
void *base;
|
||||
} VertexBufferBuilder;
|
||||
|
||||
typedef struct IndexBufferBuilder {
|
||||
size_t size;
|
||||
void *base;
|
||||
} IndexBufferBuilder;
|
||||
|
||||
|
||||
typedef struct SpritePrimitive {
|
||||
Rect rect;
|
||||
@ -268,19 +274,19 @@ void text_cache_reset_arena(TextCache *cache);
|
||||
/* vertex buffer */
|
||||
|
||||
VertexBuffer create_vertex_buffer(void);
|
||||
|
||||
void restart_scratch_vertex_arrays(void);
|
||||
|
||||
VertexBuffer get_scratch_vertex_array(void);
|
||||
|
||||
void delete_vertex_buffer(VertexBuffer buffer);
|
||||
|
||||
void specify_vertex_buffer(VertexBuffer buffer, void const *data, size_t bytes);
|
||||
|
||||
VertexBufferBuilder build_vertex_buffer(VertexBuffer buffer, size_t bytes);
|
||||
|
||||
void finish_vertex_builder(VertexBufferBuilder *builder);
|
||||
|
||||
IndexBuffer create_index_buffer(void);
|
||||
void delete_index_buffer(IndexBuffer buffer);
|
||||
void specify_index_buffer(IndexBuffer buffer, void const *data, size_t bytes);
|
||||
IndexBufferBuilder build_index_buffer(IndexBuffer buffer, size_t bytes);
|
||||
void finish_index_builder(IndexBufferBuilder *builder);
|
||||
|
||||
/* 2d */
|
||||
|
||||
/* fills two existing arrays with the geometry data of a circle */
|
||||
@ -304,9 +310,8 @@ struct QuadBatch collect_rect_batch(const Primitive2D primitives[], size_t len);
|
||||
void render_sprite_batch(const Primitive2D primitives[], struct QuadBatch batch);
|
||||
void render_rect_batch(const Primitive2D primitives[], struct QuadBatch batch);
|
||||
|
||||
VertexBuffer get_quad_element_buffer(void);
|
||||
|
||||
VertexBuffer get_circle_element_buffer(void);
|
||||
IndexBuffer get_quad_element_buffer(void);
|
||||
IndexBuffer get_circle_element_buffer(void);
|
||||
|
||||
void render_circle(const CirclePrimitive *circle);
|
||||
|
||||
|
Reference in New Issue
Block a user