| 1214 | } |
| 1215 | |
| 1216 | static void WindowCreate(WindowContext* ctx) |
| 1217 | { |
| 1218 | EXIT_IF(ctx == nullptr); |
| 1219 | EXIT_IF(ctx->window != nullptr); |
| 1220 | EXIT_IF(ctx->graphic_ctx.screen_width == 0); |
| 1221 | EXIT_IF(ctx->graphic_ctx.screen_height == 0); |
| 1222 | |
| 1223 | int width = static_cast<int>(ctx->graphic_ctx.screen_width); |
| 1224 | int height = static_cast<int>(ctx->graphic_ctx.screen_height); |
| 1225 | |
| 1226 | if (SDL_InitSubSystem(SDL_INIT_VIDEO | SDL_INIT_GAMECONTROLLER) < 0) |
| 1227 | { |
| 1228 | EXIT("%s\n", SDL_GetError()); |
| 1229 | } |
| 1230 | |
| 1231 | // SDL_JoystickEventState(SDL_ENABLE); |
| 1232 | // SDL_JoystickOpen(device_index) |
| 1233 | |
| 1234 | printf("WindowCreate(): width = %d, height = %d\n", width, height); |
| 1235 | |
| 1236 | ctx->window = SDL_CreateWindow(KYTY_SDL_WINDOW_CAPTION, KYTY_SDL_WINDOWPOS_CENTERED, KYTY_SDL_WINDOWPOS_CENTERED, width, height, |
| 1237 | KYTY_SDL_WINDOW_FLAGS); |
| 1238 | |
| 1239 | ctx->window_hidden = true; |
| 1240 | |
| 1241 | if (ctx->window == nullptr) |
| 1242 | { |
| 1243 | EXIT("%s\n", SDL_GetError()); |
| 1244 | } |
| 1245 | |
| 1246 | SDL_SetWindowResizable(ctx->window, SDL_FALSE); |
| 1247 | } |
| 1248 | |
| 1249 | static void VulkanGetSurfaceCapabilities(VkPhysicalDevice physical_device, VkSurfaceKHR surface, SurfaceCapabilities* r) |
| 1250 | { |
no test coverage detected