vulkan_test2

view src/main.c @ 7:20eb42197ab8

clear color ...
author John Tsiombikas <nuclear@member.fsf.org>
date Wed, 20 Jun 2018 05:57:34 +0300
parents c31c4115d44a
children d34f84bede17
line source
1 #include <stdio.h>
2 #include "wsys.h"
3 #include "vku.h"
4 #include "vkgl.h"
6 static void display(void);
7 static void reshape(int x, int y);
8 static void keyboard(int key, int pressed);
10 int main(void)
11 {
12 if(vku_create_dev() == -1) {
13 return 1;
14 }
16 if(wsys_create_window(800, 600) == -1) {
17 return 1;
18 }
19 wsys_set_window_title("Vulkan test 2");
21 wsys_display_callback(display);
22 wsys_reshape_callback(reshape);
23 wsys_keyboard_callback(keyboard);
25 while(wsys_process_events(WSYS_BLOCKING) != -1);
27 wsys_destroy_window();
28 vku_cleanup();
29 return 0;
30 }
32 static void display(void)
33 {
34 vkgl_clear_color(1, 0, 0, 1);
35 vkgl_clear(VKGL_COLOR_BUFFER_BIT);
37 wsys_swap_buffers();
38 }
40 static void reshape(int x, int y)
41 {
42 }
44 static void keyboard(int key, int pressed)
45 {
46 if(key == 27) {
47 wsys_quit();
48 }
49 }