2024-04-30 23:02:19 +12:00
|
|
|
#ifndef __TEXTURES_H__
|
|
|
|
#define __TEXTURES_H__
|
|
|
|
|
2024-05-03 11:18:50 +12:00
|
|
|
#include <gearlib.h>
|
2024-04-30 23:02:19 +12:00
|
|
|
#include <stdint.h>
|
|
|
|
|
2024-05-03 22:52:53 +12:00
|
|
|
typedef uint32_t Texture;
|
|
|
|
|
2024-05-03 11:18:50 +12:00
|
|
|
void setup_textures();
|
2024-05-03 22:52:53 +12:00
|
|
|
Texture load_texture(const char* path);
|
|
|
|
void draw_texture(Texture id, vec2 pos, vec2 size, vec4 tint);
|
|
|
|
void draw_texture_trans(Texture id, mat4 transform, vec4 tint);
|
|
|
|
void batch_draw_texture(RenderBatch* batch, Texture id, mat4 transform, vec4 tint);
|
2024-05-03 11:18:50 +12:00
|
|
|
RenderBatch* create_texture_quad_batch();
|
|
|
|
|
|
|
|
extern RenderBatch* texture_quad_batch;
|
|
|
|
extern int max_textures;
|
|
|
|
|
|
|
|
typedef struct {
|
|
|
|
vec3 Position;
|
|
|
|
vec4 Tint;
|
|
|
|
vec2 TexCoord;
|
|
|
|
float TexID;
|
|
|
|
} TextureQuadVertex;
|
|
|
|
|
|
|
|
typedef struct {
|
|
|
|
float texture_index;
|
|
|
|
} TextureQuadBatchData;
|
2024-04-30 23:02:19 +12:00
|
|
|
|
|
|
|
#endif
|