From d2c76fd62fa735f3d4fc3ceb55a75d6f0b2dc758 Mon Sep 17 00:00:00 2001 From: quou Date: Mon, 22 Jul 2024 20:21:34 +1000 Subject: sampling textures in game. --- render.h | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) (limited to 'render.h') diff --git a/render.h b/render.h index e51478f..996ba37 100644 --- a/render.h +++ b/render.h @@ -24,6 +24,10 @@ typedef struct { int w, h; } Bitmap; +typedef struct Texture { + int w, h; +} Texture; + typedef struct { unsigned short p, n, t; } Mesh_Vert; @@ -54,6 +58,8 @@ int point_os( int y ); +Colour sample_tex(const Texture* t, int u, int v); + void ren_begin(Renderer* r, Colour* t, int* d, int w, int h); void ren_end(Renderer* r); void ren_clear(Renderer* r); @@ -98,19 +104,19 @@ void ren_tri( const int* v0, const int* v1, const int* v2, - const Bitmap* tex + const Texture* tex ); /* Unsafe for 3D. Clips against the r->clip */ void ren_tri3( Renderer* r, const int* v0, const int* v1, const int* v2, - const Bitmap* tex + const Texture* tex ); /* Does perspective calculation and clips against the near. */ void ren_mesh( Renderer* r, const Mesh* mesh, - const Bitmap* tex + const Texture* tex ); #endif -- cgit v1.2.3-54-g00ecf