diff options
Diffstat (limited to 'gfx/src/core/texture.h')
-rw-r--r-- | gfx/src/core/texture.h | 35 |
1 files changed, 35 insertions, 0 deletions
diff --git a/gfx/src/core/texture.h b/gfx/src/core/texture.h new file mode 100644 index 0000000..4af41e9 --- /dev/null +++ b/gfx/src/core/texture.h | |||
@@ -0,0 +1,35 @@ | |||
1 | #pragma once | ||
2 | |||
3 | #include <gfx/core.h> | ||
4 | |||
5 | #include "gl_util.h" | ||
6 | |||
7 | typedef struct Texture { | ||
8 | GLuint id; | ||
9 | GLenum target; | ||
10 | GLenum format; | ||
11 | GLenum type; | ||
12 | int width; | ||
13 | int height; | ||
14 | } Texture; | ||
15 | |||
16 | /// Create a new texture. | ||
17 | bool gfx_init_texture(Texture*, const TextureDesc*); | ||
18 | |||
19 | /// Destroy the texture. | ||
20 | void gfx_del_texture(Texture*); | ||
21 | |||
22 | /// Converts a TextureDimension into the OpenGL enum equivalent. | ||
23 | GLenum to_GL_dimension(TextureDimension dim); | ||
24 | |||
25 | /// Converts a texture format into an OpenGL internal format. | ||
26 | GLenum to_GL_internal_format(TextureFormat format); | ||
27 | |||
28 | /// Converts a texture format into an OpenGL format. | ||
29 | GLenum to_GL_format(TextureFormat format); | ||
30 | |||
31 | /// Converts a texture format into an OpenGL type. | ||
32 | GLenum to_GL_type(TextureFormat format); | ||
33 | |||
34 | /// Converts a cubemap face into the OpenGL enum equivalent. | ||
35 | GLenum to_GL_cubemap_face(CubemapFace face); | ||