2024-05-09 19:42:12 +00:00
|
|
|
#ifndef GLERMINAL_H
|
|
|
|
#define GLERMINAL_H
|
|
|
|
|
|
|
|
#ifdef __cplusplus
|
|
|
|
extern "C"
|
|
|
|
{
|
|
|
|
#endif
|
|
|
|
|
2024-05-14 21:11:32 +00:00
|
|
|
enum
|
|
|
|
{
|
|
|
|
GLERMINAL_CELL_SIZE = 8,
|
|
|
|
GLERMINAL_CELL_AREA = GLERMINAL_CELL_SIZE * GLERMINAL_CELL_SIZE
|
|
|
|
};
|
|
|
|
|
2024-05-09 19:42:12 +00:00
|
|
|
typedef void (*glerminal_main_cb)();
|
|
|
|
|
2024-05-14 21:11:32 +00:00
|
|
|
typedef struct glerminal_sprite
|
|
|
|
{
|
|
|
|
unsigned char data[GLERMINAL_CELL_AREA];
|
|
|
|
} glerminal_sprite;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @brief Run the application's mainloop
|
|
|
|
* @param main main calllback
|
|
|
|
*/
|
2024-05-09 19:42:12 +00:00
|
|
|
void glerminal_run(glerminal_main_cb main);
|
|
|
|
|
2024-05-14 21:11:32 +00:00
|
|
|
/**
|
|
|
|
* @brief Update the displayed screen contents to the current state of the library
|
|
|
|
*/
|
2024-05-09 19:42:12 +00:00
|
|
|
void glerminal_flush();
|
|
|
|
|
2024-05-14 21:11:32 +00:00
|
|
|
/**
|
|
|
|
* @brief Set a cell's sprite
|
|
|
|
* @param x position of the cell in the range [0, 32)
|
|
|
|
* @param y position of the cell in the range [0, 20)
|
|
|
|
* @param layer layer of the cell in the range [0, 16)
|
|
|
|
* @param sprite sprite's index in the range [0, 256)
|
|
|
|
*/
|
|
|
|
void glerminal_set(unsigned char x, unsigned char y, unsigned char layer, unsigned char sprite);
|
|
|
|
/**
|
|
|
|
* @brief Get a cell's sprite
|
|
|
|
* @param x position of the cell in the range [0, 32)
|
|
|
|
* @param y position of the cell in the range [0, 20)
|
|
|
|
* @param layer layer of the cell in the range [0, 16)
|
|
|
|
* @return sprite index currently assigned to the cell
|
|
|
|
*/
|
|
|
|
unsigned char glerminal_get(unsigned char x, unsigned char y, unsigned char layer);
|
|
|
|
|
2024-05-09 19:42:12 +00:00
|
|
|
#ifdef __cplusplus
|
|
|
|
}
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#endif//GLERMINAL_H
|