diff --git a/gfx/drivers_context/wgl_ctx.cpp b/gfx/drivers_context/wgl_ctx.c similarity index 98% rename from gfx/drivers_context/wgl_ctx.cpp rename to gfx/drivers_context/wgl_ctx.c index eb7545b548..5c0d7b4e49 100644 --- a/gfx/drivers_context/wgl_ctx.cpp +++ b/gfx/drivers_context/wgl_ctx.c @@ -270,14 +270,21 @@ void create_graphics_context(HWND hwnd, bool *quit) { #ifdef HAVE_VULKAN RECT rect; - unsigned width = rect.right - rect.left; - unsigned height = rect.bottom - rect.top; + HINSTANCE instance; + unsigned width = 0; + unsigned height = 0; + GetClientRect(hwnd, &rect); - HINSTANCE instance = GetModuleHandle(NULL); + + instance = GetModuleHandle(NULL); + width = rect.right - rect.left; + height = rect.bottom - rect.top; + if (!vulkan_surface_create(&win32_vk, VULKAN_WSI_WIN32, &instance, &hwnd, width, height, win32_interval)) *quit = true; + g_inited = true; #endif } diff --git a/griffin/griffin.c b/griffin/griffin.c index 23d9421dd9..5f84ebff04 100644 --- a/griffin/griffin.c +++ b/griffin/griffin.c @@ -165,6 +165,12 @@ VIDEO CONTEXT ============================================================ */ #include "../gfx/drivers_context/gfx_null_ctx.c" +#if defined(_WIN32) && !defined(_XBOX) +#if defined(HAVE_OPENGL) || defined(HAVE_VULKAN) +#include "../gfx/drivers_context/wgl_ctx.c" +#endif +#endif + #if defined(__CELLOS_LV2__) #include "../gfx/drivers_context/ps3_ctx.c" #elif defined(ANDROID) diff --git a/griffin/griffin_cpp.cpp b/griffin/griffin_cpp.cpp index d77594cf55..bfef83a896 100644 --- a/griffin/griffin_cpp.cpp +++ b/griffin/griffin_cpp.cpp @@ -101,9 +101,6 @@ AUDIO UI COMMON CONTEXT ============================================================ */ #if defined(_WIN32) && !defined(_XBOX) -#if defined(HAVE_OPENGL) || defined(HAVE_VULKAN) -#include "../gfx/drivers_context/wgl_ctx.cpp" -#endif #if defined(_WIN32) && !defined(_XBOX) #include "../gfx/drivers_context/gdi_ctx.cpp"