diff options
author | quou <quou@disroot.org> | 2024-07-22 20:21:34 +1000 |
---|---|---|
committer | quou <quou@disroot.org> | 2024-07-22 20:21:34 +1000 |
commit | d2c76fd62fa735f3d4fc3ceb55a75d6f0b2dc758 (patch) | |
tree | 92351ab512c5ec914ec5cbd918a5d72ed60bc0b6 /render.h | |
parent | cf193ce71bd1f13cebcafac718c124640c912060 (diff) |
sampling textures in game.
Diffstat (limited to 'render.h')
-rw-r--r-- | render.h | 12 |
1 files changed, 9 insertions, 3 deletions
@@ -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 |