init flags mechanism
[vkray] / src / app.c
1 #include <stdio.h>
2 #include <stdlib.h>
3 #include "app.h"
4 #include "vk.h"
5
6 int app_init(void)
7 {
8         unsigned int flags;
9
10         if(vk_init(VKINIT_DEPTH | VKINIT_RAY, &flags) == -1) {
11                 return -1;
12         }
13         if(!(flags & VKINIT_RAY)) {
14                 fprintf(stderr, "Vulkan raytracing extensions not available\n");
15                 /*vk_cleanup();
16                 return -1;*/
17         }
18         return 0;
19 }
20
21 void app_cleanup(void)
22 {
23         vk_cleanup();
24 }
25
26
27 void app_display(void)
28 {
29 }
30
31 void app_reshape(int x, int y)
32 {
33         if(vk_reshape(x, y) == -1) {
34                 abort();
35         }
36 }
37
38 void app_keyboard(int key, int press)
39 {
40         if(!press) return;
41
42         switch(key) {
43         case 27:
44                 app_quit();
45                 break;
46         }
47 }
48
49 void app_mouse(int bn, int press, int x, int y)
50 {
51 }
52
53 void app_motion(int x, int y)
54 {
55 }