#include "window.h" #include "common.h" window_t window_create(struct window_info *info) { 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; } void window_destroy(window_t window) { SDL_DestroyWindow((SDL_Window *)window); SDL_Vulkan_UnloadLibrary(); } 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; } return 0; } 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; } return 0; }