diff options
Diffstat (limited to 'gfx/src/core/buffer.h')
-rw-r--r-- | gfx/src/core/buffer.h | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/gfx/src/core/buffer.h b/gfx/src/core/buffer.h new file mode 100644 index 0000000..b9080f0 --- /dev/null +++ b/gfx/src/core/buffer.h | |||
@@ -0,0 +1,26 @@ | |||
1 | #pragma once | ||
2 | |||
3 | #include <gfx/core.h> | ||
4 | |||
5 | #include "gl_util.h" | ||
6 | |||
7 | #include <math/fwd.h> | ||
8 | |||
9 | #include <stdbool.h> | ||
10 | #include <stddef.h> | ||
11 | |||
12 | typedef struct Buffer { | ||
13 | GLuint vbo; | ||
14 | BufferType type; | ||
15 | BufferUsage usage; | ||
16 | size_t size_bytes; | ||
17 | } Buffer; | ||
18 | |||
19 | /// Return the buffer type size in bytes. | ||
20 | size_t gfx_get_buffer_type_size_bytes(BufferType); | ||
21 | |||
22 | /// Create a buffer from raw data. | ||
23 | bool gfx_init_buffer(Buffer*, const BufferDesc*); | ||
24 | |||
25 | /// Destroy the buffer. | ||
26 | void gfx_del_buffer(Buffer*); | ||