111 lines
965 B
C
111 lines
965 B
C
|
|
#ifndef _event
|
||
|
|
|
||
|
|
#define _event
|
||
|
|
|
||
|
|
|
||
|
|
// Macros
|
||
|
|
|
||
|
|
|
||
|
|
|
||
|
|
#include "stdlib.h"
|
||
|
|
|
||
|
|
extern char * __ClassNames[];
|
||
|
|
|
||
|
|
|
||
|
|
// Includes
|
||
|
|
|
||
|
|
#include "stdbool.h"
|
||
|
|
|
||
|
|
#include "../vector2.h"
|
||
|
|
|
||
|
|
#include "vector.h"
|
||
|
|
|
||
|
|
|
||
|
|
typedef struct event{
|
||
|
|
|
||
|
|
struct mouse * mouse;
|
||
|
|
|
||
|
|
struct screen * screen;
|
||
|
|
|
||
|
|
struct keyboard * keyboard;
|
||
|
|
|
||
|
|
|
||
|
|
} event;
|
||
|
|
|
||
|
|
typedef struct keyboard{
|
||
|
|
|
||
|
|
int keyCode;
|
||
|
|
|
||
|
|
bool shiftKey;
|
||
|
|
|
||
|
|
bool ctrlKey;
|
||
|
|
|
||
|
|
bool altKey;
|
||
|
|
|
||
|
|
bool metaKey;
|
||
|
|
|
||
|
|
|
||
|
|
} keyboard;
|
||
|
|
|
||
|
|
typedef struct screen{
|
||
|
|
|
||
|
|
vector2 size;
|
||
|
|
|
||
|
|
vector2 position;
|
||
|
|
|
||
|
|
|
||
|
|
} screen;
|
||
|
|
|
||
|
|
typedef struct mouse{
|
||
|
|
|
||
|
|
vector2 position;
|
||
|
|
|
||
|
|
int button;
|
||
|
|
|
||
|
|
vector_char_pointer * eventTypes;
|
||
|
|
|
||
|
|
|
||
|
|
} mouse;
|
||
|
|
|
||
|
|
event event_new( );
|
||
|
|
|
||
|
|
event * event_newPointer( );
|
||
|
|
|
||
|
|
keyboard keyboard_new( );
|
||
|
|
|
||
|
|
keyboard * keyboard_newPointer( );
|
||
|
|
|
||
|
|
screen screen_new( );
|
||
|
|
|
||
|
|
screen * screen_newPointer( );
|
||
|
|
|
||
|
|
mouse mouse_new( );
|
||
|
|
|
||
|
|
mouse * mouse_newPointer( );
|
||
|
|
|
||
|
|
#endif
|
||
|
|
|
||
|
|
|
||
|
|
typedef struct event event;
|
||
|
|
|
||
|
|
|
||
|
|
|
||
|
|
|
||
|
|
|
||
|
|
typedef struct keyboard keyboard;
|
||
|
|
|
||
|
|
|
||
|
|
|
||
|
|
|
||
|
|
|
||
|
|
typedef struct screen screen;
|
||
|
|
|
||
|
|
|
||
|
|
|
||
|
|
|
||
|
|
|
||
|
|
typedef struct mouse mouse;
|
||
|
|
|
||
|
|
|
||
|
|
|