vulkan_test2
view src/main.c @ 5:cec4b0e7fce8
created swapchain
author | John Tsiombikas <nuclear@member.fsf.org> |
---|---|
date | Fri, 22 Sep 2017 17:48:18 +0300 |
parents | 68e1c437343f |
children | 20eb42197ab8 |
line source
1 #include <stdio.h>
2 #include "wsys.h"
3 #include "vku.h"
5 static void display(void);
6 static void reshape(int x, int y);
7 static void keyboard(int key, int pressed);
9 int main(void)
10 {
11 if(vku_create_dev() == -1) {
12 return 1;
13 }
15 if(wsys_create_window(800, 600) == -1) {
16 return 1;
17 }
18 wsys_set_window_title("Vulkan test 2");
20 wsys_display_callback(display);
21 wsys_reshape_callback(reshape);
22 wsys_keyboard_callback(keyboard);
24 while(wsys_process_events(WSYS_BLOCKING) != -1);
26 wsys_destroy_window();
27 vku_cleanup();
28 return 0;
29 }
31 static void display(void)
32 {
33 wsys_swap_buffers();
34 }
36 static void reshape(int x, int y)
37 {
38 }
40 static void keyboard(int key, int pressed)
41 {
42 if(key == 27) {
43 wsys_quit();
44 }
45 }