6df460b9501f888533906f5d011d095952cb44f9
[vrlugburz] / src / game.c
1 #include <assert.h>
2 #include "game.h"
3 #include "opengl.h"
4
5 int game_init(void)
6 {
7         if(init_opengl() == -1) {
8                 return -1;
9         }
10         return 0;
11 }
12
13 void game_shutdown(void)
14 {
15 }
16
17 void game_display(void)
18 {
19         glClearColor(1, 0, 0, 1);
20         glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
21
22         game_swap_buffers();
23         assert(glGetError() == GL_NO_ERROR);
24 }
25
26 void game_reshape(int x, int y)
27 {
28         glViewport(0, 0, x, y);
29 }
30
31 void game_keyboard(int key, int press)
32 {
33         if(press && key == 27) {
34                 game_quit();
35                 return;
36         }
37 }
38
39 void game_mbutton(int bn, int press, int x, int y)
40 {
41 }
42
43 void game_mmotion(int x, int y)
44 {
45 }