From 2ce59d54aa110a2c1fc1105855f628c5512f8dac Mon Sep 17 00:00:00 2001 From: 3gg <3gg@shellblade.net> Date: Thu, 12 Feb 2026 17:43:39 -0800 Subject: Introduce the texture register. Step towards the deferred pipeline --- include/swgfx.h | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'include') diff --git a/include/swgfx.h b/include/swgfx.h index 72164b1..a1ce872 100644 --- a/include/swgfx.h +++ b/include/swgfx.h @@ -24,6 +24,8 @@ Multi-threading: #define SWGFX_PROFILING 1 // TODO: Move this to client project cmake. +constexpr size_t SWGFX_MAX_TEXTURES = 255; + typedef float R; typedef struct sgVec2i { int x, y; } sgVec2i; @@ -55,6 +57,8 @@ typedef sgRgba sgPixel; // TODO: Expose a macro to control the desired surface format. typedef sgBgra sgScreenPixel; +typedef uint16_t sgTextureId; + typedef enum sgTextureFilter { sgNearest, sgBilinear @@ -93,7 +97,8 @@ void sgOrtho (swgfx*, R left, R right, R top, R bottom, R near, R far); void sgPerspective(swgfx*, R fovy, R aspect, R near, R far); void sgViewport (swgfx*, int x0, int y0, int width, int height); -void sgTexture(swgfx*, const sgImage*, sgTextureFilter); +void sgTextureRegister(swgfx*, sgTextureId, const sgImage*, sgTextureFilter); +void sgTextureActivate(swgfx*, sgTextureId); void sgClear(swgfx*); void sgPixels(swgfx*, size_t count, const sgVec2i* positions, sgPixel colour); -- cgit v1.2.3