From ff2497dc2c67d2b7df29b729c763b6e09c876d76 Mon Sep 17 00:00:00 2001 From: kartofen Date: Sat, 21 Oct 2023 12:56:07 +0300 Subject: minor changes and more error checks --- src/window.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'src/window.c') diff --git a/src/window.c b/src/window.c index 4a498e6..9810a42 100644 --- a/src/window.c +++ b/src/window.c @@ -3,11 +3,15 @@ window_t window_create(struct window_info *info) { - info->flags |= SDL_WINDOW_SHOWN | SDL_WINDOW_VULKAN; + info->flags |= SDL_WINDOW_VULKAN; SDL_Vulkan_LoadLibrary(NULL); window_t window = SDL_CreateWindow(info->title, info->x, info->y, info->w, info->h, info->flags); + if(window == NULL) { + err("SDL_CreateWindow: failed"); + } + return window; } @@ -20,6 +24,7 @@ void window_destroy(window_t window) int window_extension_info(window_t window, unsigned int *ext_count, const char **extensions) { if(SDL_Vulkan_GetInstanceExtensions((SDL_Window *)window, ext_count, extensions) == SDL_FALSE) { + err("SDL_Vulkan_GetInstanceExtensions: failed"); return 1; } @@ -29,6 +34,7 @@ int window_extension_info(window_t window, unsigned int *ext_count, const char * int window_create_surface(window_t window, VkInstance instance, VkSurfaceKHR *surface) { if(SDL_Vulkan_CreateSurface((SDL_Window *)window, instance, surface) == SDL_FALSE) { + err("SDL_Vulkan_CreateSurface: failed"); return 1; } -- cgit v1.2.3