Working through primitive buffering
This commit is contained in:
33
src/engine/display/primitive.h
Normal file
33
src/engine/display/primitive.h
Normal file
@ -0,0 +1,33 @@
|
||||
#pragma once
|
||||
#include <stdint.h>
|
||||
#include <glad/glad.h>
|
||||
|
||||
#define PRIMITIVE_POSITIONS_PER_VERTICE 3
|
||||
#define PRIMITIVE_COORDINATES_PER_VERTICE 2
|
||||
|
||||
typedef struct {
|
||||
int32_t verticeCount;
|
||||
|
||||
GLuint vertexArray;
|
||||
GLuint vertexBuffer;
|
||||
GLuint indexBuffer;
|
||||
} primitive_t;
|
||||
|
||||
typedef struct {
|
||||
float x, y, z;
|
||||
float u, v;
|
||||
} vertice_t;
|
||||
|
||||
primitive_t * primitiveCreate(int32_t verticeCount);
|
||||
|
||||
void primitiveBufferVertices(primitive_t *primitive,
|
||||
int32_t position, int32_t count, vertice_t *vertices
|
||||
);
|
||||
|
||||
void primitiveBufferIndices(primitive_t *primitive,
|
||||
int32_t position, int32_t count, int32_t *indices
|
||||
);
|
||||
|
||||
void primitiveDraw(primitive_t *primitive, int32_t start, int32_t count);
|
||||
|
||||
void primitiveDispose(primitive_t *primitive);
|
Reference in New Issue
Block a user