bzr branch
http://gegoxaren.bato24.eu/bzr/%2Bjunk/c_sdl_joypad_ducktape
1
by Gustav Hartvigsson
Initial code. |
1 |
#ifndef __H_GAME__
|
2 |
#define __H_GAME__
|
|
3 |
||
4 |
#include <SDL2/SDL.h> |
|
5 |
#include <stdbool.h> |
|
6 |
||
7 |
#include "MousePointer.h" |
|
8 |
#include "GameButton.h" |
|
9 |
||
10 |
||
11 |
#define J_SCALE_FACTOR 5000
|
|
12 |
||
13 |
||
14 |
||
15 |
void quit (int rc); |
|
16 |
||
17 |
typedef struct _Game Game; |
|
18 |
||
19 |
struct _Game { |
|
20 |
SDL_Event event; |
|
21 |
SDL_Point mouse_delta; |
|
22 |
bool mouse_pressed; |
|
23 |
bool bg_colour_toggle; |
|
24 |
int done; |
|
25 |
SDL_Color background_colour; |
|
26 |
SDL_Window * window; |
|
27 |
SDL_Renderer * renderer; |
|
28 |
SDL_GameController * game_controller; |
|
29 |
MousePointer * mouse; |
|
30 |
GameButton * button; |
|
31 |
};
|
|
32 |
||
33 |
Game * game_new (); |
|
34 |
void game_process_events (Game * self); |
|
35 |
void game_main_loop (Game * self); |
|
36 |
void game_free (Game * self); |
|
37 |
void game_draw (Game * self); |
|
38 |
||
39 |
#endif
|