summaryrefslogtreecommitdiff
path: root/include/swgfx.h
diff options
context:
space:
mode:
author3gg <3gg@shellblade.net>2026-02-12 17:43:39 -0800
committer3gg <3gg@shellblade.net>2026-02-12 17:43:39 -0800
commit2ce59d54aa110a2c1fc1105855f628c5512f8dac (patch)
tree6b8401422154744757dbbc5026c9bd660690f703 /include/swgfx.h
parent27378f3537e9dbe0bfeb1ebb8a653e6050f2ea4a (diff)
Introduce the texture register. Step towards the deferred pipeline
Diffstat (limited to 'include/swgfx.h')
-rw-r--r--include/swgfx.h7
1 files changed, 6 insertions, 1 deletions
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:
24 24
25#define SWGFX_PROFILING 1 // TODO: Move this to client project cmake. 25#define SWGFX_PROFILING 1 // TODO: Move this to client project cmake.
26 26
27constexpr size_t SWGFX_MAX_TEXTURES = 255;
28
27typedef float R; 29typedef float R;
28 30
29typedef struct sgVec2i { int x, y; } sgVec2i; 31typedef struct sgVec2i { int x, y; } sgVec2i;
@@ -55,6 +57,8 @@ typedef sgRgba sgPixel;
55// TODO: Expose a macro to control the desired surface format. 57// TODO: Expose a macro to control the desired surface format.
56typedef sgBgra sgScreenPixel; 58typedef sgBgra sgScreenPixel;
57 59
60typedef uint16_t sgTextureId;
61
58typedef enum sgTextureFilter { 62typedef enum sgTextureFilter {
59 sgNearest, 63 sgNearest,
60 sgBilinear 64 sgBilinear
@@ -93,7 +97,8 @@ void sgOrtho (swgfx*, R left, R right, R top, R bottom, R near, R far);
93void sgPerspective(swgfx*, R fovy, R aspect, R near, R far); 97void sgPerspective(swgfx*, R fovy, R aspect, R near, R far);
94void sgViewport (swgfx*, int x0, int y0, int width, int height); 98void sgViewport (swgfx*, int x0, int y0, int width, int height);
95 99
96void sgTexture(swgfx*, const sgImage*, sgTextureFilter); 100void sgTextureRegister(swgfx*, sgTextureId, const sgImage*, sgTextureFilter);
101void sgTextureActivate(swgfx*, sgTextureId);
97 102
98void sgClear(swgfx*); 103void sgClear(swgfx*);
99void sgPixels(swgfx*, size_t count, const sgVec2i* positions, sgPixel colour); 104void sgPixels(swgfx*, size_t count, const sgVec2i* positions, sgPixel colour);