summaryrefslogtreecommitdiff
path: root/gfx/src/render/buffer.h
blob: b9080f05ed4b37f26f6fe7f3a204a2691adb8a91 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
#pragma once

#include <gfx/core.h>

#include "gl_util.h"

#include <math/fwd.h>

#include <stdbool.h>
#include <stddef.h>

typedef struct Buffer {
  GLuint      vbo;
  BufferType  type;
  BufferUsage usage;
  size_t      size_bytes;
} Buffer;

/// Return the buffer type size in bytes.
size_t gfx_get_buffer_type_size_bytes(BufferType);

/// Create a buffer from raw data.
bool gfx_init_buffer(Buffer*, const BufferDesc*);

/// Destroy the buffer.
void gfx_del_buffer(Buffer*);