-
Notifications
You must be signed in to change notification settings - Fork 4
/
game.h
31 lines (21 loc) · 913 Bytes
/
game.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
#ifndef GAME_H_INCLUDED
#define GAME_H_INCLUDED
#include <gtk/gtk.h>
/* simulation/game framework
*/
extern double delta; /* simulation time delta in seconds */
#define DEFAULT_DELTA 0.01
extern unsigned int width; /* game canvas width */
extern unsigned int height; /* game canvas height */
#define DEFAULT_WIDTH 800
#define DEFAULT_HEIGHT 800
extern GtkWidget * canvas; /* game canvas object */
#if 0
extern void game_init (); /* implemented by the application */
/* game frame function to be provided by the game application */
extern gboolean game_draw_frame (GtkWidget * widget, cairo_t * cr, gpointer data);
extern void set_game_resize_callback (gboolean (*game_resize) ());
extern void set_game_keyboard_input_callback (gint (*keyboard_input)(GtkWidget *, GdkEventKey *));
extern void set_game_mouse_scroll_callback (gboolean (*mouse_scroll)(GtkWidget *, GdkEvent *, gpointer));
#endif
#endif