mirror of
https://github.com/libretro/RetroArch
synced 2025-02-04 03:40:03 +00:00
Vulkan: Implement get_context_data callback in Win32.
Also fix some potential crashes with dinput handling.
This commit is contained in:
parent
8ade7fb274
commit
02736963bc
@ -228,7 +228,7 @@ LRESULT CALLBACK WndProcD3D(HWND hwnd, UINT message,
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (dinput_handle_message(dinput, message, wparam, lparam))
|
if (dinput && dinput_handle_message(dinput, message, wparam, lparam))
|
||||||
return 0;
|
return 0;
|
||||||
return DefWindowProc(hwnd, message, wparam, lparam);
|
return DefWindowProc(hwnd, message, wparam, lparam);
|
||||||
}
|
}
|
||||||
@ -262,7 +262,7 @@ LRESULT CALLBACK WndProcGL(HWND hwnd, UINT message,
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (dinput_handle_message(dinput_wgl, message, wparam, lparam))
|
if (dinput_wgl && dinput_handle_message(dinput_wgl, message, wparam, lparam))
|
||||||
return 0;
|
return 0;
|
||||||
return DefWindowProc(hwnd, message, wparam, lparam);
|
return DefWindowProc(hwnd, message, wparam, lparam);
|
||||||
}
|
}
|
||||||
|
@ -519,12 +519,15 @@ static bool gfx_ctx_wgl_set_video_mode(void *data,
|
|||||||
#ifdef HAVE_OPENGL
|
#ifdef HAVE_OPENGL
|
||||||
p_swap_interval = (BOOL (APIENTRY *)(int))
|
p_swap_interval = (BOOL (APIENTRY *)(int))
|
||||||
wglGetProcAddress("wglSwapIntervalEXT");
|
wglGetProcAddress("wglSwapIntervalEXT");
|
||||||
|
|
||||||
gfx_ctx_wgl_swap_interval(data, g_interval);
|
|
||||||
#endif
|
#endif
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
case GFX_CTX_NONE:
|
||||||
|
default:
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
gfx_ctx_wgl_swap_interval(data, g_interval);
|
||||||
return true;
|
return true;
|
||||||
|
|
||||||
error:
|
error:
|
||||||
@ -612,6 +615,14 @@ static void gfx_ctx_wgl_bind_hw_render(void *data, bool enable)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#ifdef HAVE_VULKAN
|
||||||
|
static void *gfx_ctx_wgl_get_context_data(void *data)
|
||||||
|
{
|
||||||
|
(void)data;
|
||||||
|
return &g_vk.context;
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
const gfx_ctx_driver_t gfx_ctx_wgl = {
|
const gfx_ctx_driver_t gfx_ctx_wgl = {
|
||||||
gfx_ctx_wgl_init,
|
gfx_ctx_wgl_init,
|
||||||
gfx_ctx_wgl_destroy,
|
gfx_ctx_wgl_destroy,
|
||||||
@ -638,5 +649,10 @@ const gfx_ctx_driver_t gfx_ctx_wgl = {
|
|||||||
gfx_ctx_wgl_show_mouse,
|
gfx_ctx_wgl_show_mouse,
|
||||||
"wgl",
|
"wgl",
|
||||||
gfx_ctx_wgl_bind_hw_render,
|
gfx_ctx_wgl_bind_hw_render,
|
||||||
|
#ifdef HAVE_VULKAN
|
||||||
|
gfx_ctx_wgl_get_context_data,
|
||||||
|
#else
|
||||||
|
NULL,
|
||||||
|
#endif
|
||||||
};
|
};
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user