lzy/inc/lzy.h

116 lines
1.7 KiB
C

#ifndef LZY_H_
#define LZY_H_
#ifdef __cplusplus
extern "C" {
#endif
#include <stdint.h>
int LZY_Init(void);
int LZY_Deinit(void);
int LZY_DrawBegin(void);
int LZY_DrawEnd(void);
void LZY_DrawSetColor(uint8_t r, uint8_t g, uint8_t b);
int LZY_DrawClear(void);
void LZY_CycleEvents(void);
int LZY_KeyDown(unsigned int scancode);
const char *LZY_GetError(void);
#ifdef FXCG50
#include <gint/keycodes.h>
enum LZY_ScanCode {
LZY_SC_ESCAPE = KEY_EXIT,
};
#else /* end FXCG50, begin SDL2 */
#include <SDL.h>
enum LZY_ScanCode {
LZY_SC_ESCAPE = SDLK_ESCAPE,
};
#endif /* SDL2 */
#ifdef __cplusplus
}
#endif
#endif /* LZY_H_ */
/* implementation */
#ifdef LZY_IMPLEMENTATION
#ifndef LZY_TILE_SIZE
#define LZY_TILE_SIZE 16
#endif
#ifdef FXCG50
#include <gint/display.h>
#include <stdint.h>
static color_t draw_color;
int LZY_Init(void) {
return 0;
}
int LZY_Deinit(void) {
return 0;
}
int LZY_DrawBegin(void) {
return 0;
}
int LZY_DrawEnd(void) {
return 0;
}
void LZY_DrawSetColor(uint8_t r, uint8_t g, uint8_t b) {
draw_color = C_RGB(r << 3, g << 3, b << 3);
}
int LZY_DrawClear(void) {
return 0;
}
void LZY_CycleEvents(void) {}
int LZY_KeyDown(unsigned int scancode) {
return 0;
}
const char *LZY_GetError(void) {
return NULL;
}
#else /* end FXCG50, begin SDL2 */
#include <SDL.h>
#include <stdint.h>
int LZY_Init(void) {
return 0;
}
int LZY_Deinit(void) {
return 0;
}
int LZY_DrawBegin(void) {
return 0;
}
int LZY_DrawEnd(void) {
return 0;
}
void LZY_DrawSetColor(uint8_t r, uint8_t g, uint8_t b) {}
int LZY_DrawClear(void) {
return 0;
}
void LZY_CycleEvents(void) {}
int LZY_KeyDown(unsigned int scancode) {
return 0;
}
const char *LZY_GetError(void) {
return NULL;
}
#endif /* SDL2 */
#endif /* LZY_IMPLEMENTATION */