44 lines
850 B
C
44 lines
850 B
C
#ifndef SDL2_H
|
|
#define SDL2_H
|
|
|
|
|
|
#include <stdint.h>
|
|
|
|
#include <SDL2/SDL.h>
|
|
#include "../gui/surface.h"
|
|
|
|
|
|
typedef struct EventS {
|
|
int32_t flags;
|
|
int32_t x;
|
|
int32_t y;
|
|
int32_t buttons;
|
|
int32_t key;
|
|
int32_t kbstat;
|
|
int32_t dtime;
|
|
} EventT;
|
|
|
|
|
|
#define EVENT_FLAG_KEYPRESS 1
|
|
#define EVENT_FLAG_LEFT_DOWN 2
|
|
#define EVENT_FLAG_LEFT_UP 4
|
|
#define EVENT_FLAG_RIGHT_DOWN 8
|
|
#define EVENT_FLAG_RIGHT_UP 16
|
|
|
|
#define BUTTON_LEFT 1
|
|
#define BUTTON_RIGHT 2
|
|
|
|
#define META_ALT 1
|
|
#define META_CTRL 2
|
|
#define META_SHIFT 4
|
|
|
|
#define KEY_ESC 27
|
|
|
|
|
|
void platformEventGet(EventT *event);
|
|
void videoBlit(int16_t targetX, int16_t targetY, SurfaceT *source);
|
|
uint16_t videoDisplayHeightGet(void);
|
|
uint16_t videoDisplayWidthGet(void);
|
|
|
|
|
|
#endif // SDL2_H
|