writing a mesh abstraction
[vrtris] / src / screen.h
1 #ifndef SCREEN_H_
2 #define SCREEN_H_
3
4 struct game_screen {
5         const char *name;
6         int opaque;     /* if 0, the next screen is visible, so keep update/drawing it */
7
8         struct game_screen *next;
9
10         int (*init)(void);
11         void (*cleanup)(void);
12
13         void (*start)(void);
14         void (*stop)(void);
15
16         void (*update)(float dt);
17         void (*draw)(void);
18
19         void (*reshape)(int, int);
20         void (*keyboard)(int, int);
21         void (*mouse)(int, int, int, int);
22         void (*motion)(int, int);
23         void (*wheel)(int dir);
24 };
25
26 /* this always points to the top screen on the stack
27  * there's always at least one screen, this will never be null
28  */
29 struct game_screen *screen;
30
31 int init_screens(void);
32 void cleanup_screens(void);
33 void reshape_screens(int x, int y);
34
35 void push_screen(struct game_screen *s);
36 int pop_screen(void);
37
38 #endif  /* SCREEN_H_ */