diff options
| author | onelin <oscar@nelin.dk> | 2025-12-03 22:01:19 +0000 |
|---|---|---|
| committer | onelin <oscar@nelin.dk> | 2025-12-18 21:14:20 +0000 |
| commit | 3a9964b094ec10e8f47b53a57448081342134df3 (patch) | |
| tree | 83f317651a24c4afa1fc14b8c66d73687c084719 /src | |
| parent | 4c6c70a1d9eecee94001b271f949673aee4f9c92 (diff) | |
Set target texture fmt to rgb
Diffstat (limited to 'src')
| -rw-r--r-- | src/daw.c | 2 | ||||
| -rw-r--r-- | src/include/daw/rendering.h | 19 | ||||
| -rw-r--r-- | src/rendering.c | 1 |
3 files changed, 12 insertions, 10 deletions
@@ -248,7 +248,7 @@ i32 engine_run(Instance* p, StateType initial_state, void* state_arg) { ivec2 wsz; window_get_size(&wsz); u32 t[] = { - BUFFERPARAMETER_SET_PARAMETER(BUFFERPARAMETER_SET_TYPE(0, BufferType_texture), BUFFERPARAMETER_TEXTURE_2D | BUFFERPARAMETER_FMT_RGBA8), + BUFFERPARAMETER_SET_PARAMETER(BUFFERPARAMETER_SET_TYPE(0, BufferType_texture), BUFFERPARAMETER_TEXTURE_2D | BUFFERPARAMETER_FMT_RGB8), // The depth buffer could also be a texture like so: BUFFERPARAMETER_SET_PARAMETER( diff --git a/src/include/daw/rendering.h b/src/include/daw/rendering.h index 9f8ba7c..42881a7 100644 --- a/src/include/daw/rendering.h +++ b/src/include/daw/rendering.h @@ -228,16 +228,17 @@ typedef enum { // mutually exclusive and shared between texture and renderbuffer buffers. //TODO: More formats -#define BUFFERPARAMETER_FMT_RGBA8 (1 << 8) -#define BUFFERPARAMETER_FMT_SRGB8 (2 << 8) -#define BUFFERPARAMETER_FMT_SRGBA8 (3 << 8) +#define BUFFERPARAMETER_FMT_RGBA8 ( 1 << 8) +#define BUFFERPARAMETER_FMT_RGB8 ( 2 << 8) +#define BUFFERPARAMETER_FMT_SRGB8 ( 3 << 8) +#define BUFFERPARAMETER_FMT_SRGBA8 ( 4 << 8) -#define BUFFERPARAMETER_FMT_DEPTH24_STENCIL8 (4 << 8) -#define BUFFERPARAMETER_FMT_DEPTH16 (5 << 8) -#define BUFFERPARAMETER_FMT_DEPTH24 (6 << 8) -#define BUFFERPARAMETER_FMT_DEPTH32 (7 << 8) -#define BUFFERPARAMETER_FMT_DEPTH32F (8 << 8) -#define BUFFERPARAMETER_FMT_STENCIL8 (9 << 8) +#define BUFFERPARAMETER_FMT_DEPTH24_STENCIL8 ( 5 << 8) +#define BUFFERPARAMETER_FMT_DEPTH16 ( 6 << 8) +#define BUFFERPARAMETER_FMT_DEPTH24 ( 7 << 8) +#define BUFFERPARAMETER_FMT_DEPTH32 ( 8 << 8) +#define BUFFERPARAMETER_FMT_DEPTH32F ( 9 << 8) +#define BUFFERPARAMETER_FMT_STENCIL8 (10 << 8) // "Easy default" values #define BUFFERPARAMETER_FMT_DEPTH_STENCIL BUFFERPARAMETER_FMT_DEPTH24_STENCIL8 diff --git a/src/rendering.c b/src/rendering.c index 3faf91c..d570606 100644 --- a/src/rendering.c +++ b/src/rendering.c @@ -722,6 +722,7 @@ void r_destroy_framebuffers(void* restrict ctx, u32* restrict framebuffer_array, static u32 gl_texture_format(u32 texture_format) { switch (texture_format) { case BUFFERPARAMETER_FMT_RGBA8: return GL_RGBA8; + case BUFFERPARAMETER_FMT_RGB8: return GL_RGB8; case BUFFERPARAMETER_FMT_SRGB8: return GL_SRGB; case BUFFERPARAMETER_FMT_SRGBA8: return GL_SRGB8_ALPHA8; |
