diff options
author | 3gg <3gg@shellblade.net> | 2025-06-27 10:18:39 -0700 |
---|---|---|
committer | 3gg <3gg@shellblade.net> | 2025-06-27 10:18:39 -0700 |
commit | bd57f345ed9dbed1d81683e48199626de2ea9044 (patch) | |
tree | 4221f2f2a7ad2244d2e93052bd68187ec91b8ea9 /src/core/texture.h | |
parent | 9a82ce0083437a4f9f58108b2c23b957d2249ad8 (diff) |
Diffstat (limited to 'src/core/texture.h')
-rw-r--r-- | src/core/texture.h | 35 |
1 files changed, 35 insertions, 0 deletions
diff --git a/src/core/texture.h b/src/core/texture.h new file mode 100644 index 0000000..4af41e9 --- /dev/null +++ b/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); | ||