implemented basic renderer
This commit is contained in:
parent
be1abc3762
commit
5ba261c72c
11 changed files with 295 additions and 2 deletions
33
src/renderer/buffer.h
Normal file
33
src/renderer/buffer.h
Normal file
|
@ -0,0 +1,33 @@
|
|||
#ifndef BUFFER_H
|
||||
#define BUFFER_H
|
||||
|
||||
#include <stdint.h>
|
||||
|
||||
typedef struct VertexArrayObject
|
||||
{
|
||||
int vao;
|
||||
|
||||
int vbo;
|
||||
int ebo;
|
||||
|
||||
size_t elements;
|
||||
} VertexArrayObject;
|
||||
|
||||
typedef struct VertexAttribute
|
||||
{
|
||||
int type;
|
||||
int count;
|
||||
size_t size;
|
||||
} VertexAttribute;
|
||||
|
||||
void create_vao(VertexArrayObject* vao);
|
||||
void destroy_vao(VertexArrayObject vao);
|
||||
|
||||
void attach_vertex_buffer(VertexArrayObject* vao, const float* data, size_t size);
|
||||
void attach_element_buffer(VertexArrayObject* vao, const unsigned* data, size_t size);
|
||||
|
||||
void set_vertex_layout(VertexArrayObject* vao, VertexAttribute* attributes, size_t count);
|
||||
|
||||
void bind_vao(VertexArrayObject vao);
|
||||
|
||||
#endif // BUFFER_H
|
Loading…
Add table
Add a link
Reference in a new issue