Convert wgl_ctx into C - also take care of serious warning

This commit is contained in:
twinaphex 2017-08-09 13:51:33 +02:00
parent c3851d42e6
commit a4a027be67
3 changed files with 16 additions and 6 deletions

View File

@ -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
}

View File

@ -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)

View File

@ -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"