Rework sprite API

This commit is contained in:
Shylie
2024-05-19 21:46:56 -05:00
parent e3a65072d8
commit c89563338a
12 changed files with 8151 additions and 95 deletions

View File

@@ -6,20 +6,9 @@ extern "C"
{
#endif
enum
{
GLERMINAL_CELL_SIZE = 8,
GLERMINAL_CELL_AREA = GLERMINAL_CELL_SIZE * GLERMINAL_CELL_SIZE
};
typedef void (*glerminal_init_cb)();
typedef void (*glerminal_main_cb)(float dt);
typedef struct glerminal_sprite
{
unsigned int data[GLERMINAL_CELL_AREA];
} glerminal_sprite;
/**
* @brief Call init once, then run the application's mainloop
* @param init initialization callback
@@ -71,12 +60,9 @@ void glerminal_layer_color(unsigned char layer, unsigned int color);
*/
void glerminal_layer_scale(unsigned char layer, float scale);
/**
* @brief Upload sprite to the given sprite ID
* @param id The ID of the sprite to change
* @param sprite The new sprite
*/
void glerminal_update_sprite(unsigned char id, glerminal_sprite sprite);
void glerminal_load_sprites_file(const char* filename);
void glerminal_load_sprites_buffer(unsigned char width, unsigned char height, const unsigned int* buffer);
#ifdef __cplusplus
}