mirror of
https://github.com/libsdl-org/SDL.git
synced 2026-01-07 05:43:18 +00:00
Make sure we're actually running on Windows before using D3D renderers
(cherry picked from commit e22c89536a)
This commit is contained in:
@@ -1610,7 +1610,11 @@ SDL_Renderer *D3D_CreateRenderer(SDL_Window *window, Uint32 flags)
|
||||
renderer->driverdata = data;
|
||||
|
||||
SDL_VERSION(&windowinfo.version);
|
||||
SDL_GetWindowWMInfo(window, &windowinfo);
|
||||
if (!SDL_GetWindowWMInfo(window, &windowinfo) ||
|
||||
windowinfo.subsystem != SDL_SYSWM_WINDOWS) {
|
||||
SDL_free(data);
|
||||
return SDL_SetError("Couldn't get window handle");
|
||||
}
|
||||
|
||||
window_flags = SDL_GetWindowFlags(window);
|
||||
SDL_GetWindowSizeInPixels(window, &w, &h);
|
||||
|
||||
@@ -813,7 +813,12 @@ static HRESULT D3D11_CreateSwapChain(SDL_Renderer *renderer, int w, int h)
|
||||
#if defined(__WIN32__) || defined(__WINGDK__)
|
||||
SDL_SysWMinfo windowinfo;
|
||||
SDL_VERSION(&windowinfo.version);
|
||||
SDL_GetWindowWMInfo(renderer->window, &windowinfo);
|
||||
if (!SDL_GetWindowWMInfo(renderer->window, &windowinfo) ||
|
||||
windowinfo.subsystem != SDL_SYSWM_WINDOWS) {
|
||||
SDL_SetError("Couldn't get window handle");
|
||||
result = E_FAIL;
|
||||
goto done;
|
||||
}
|
||||
|
||||
result = IDXGIFactory2_CreateSwapChainForHwnd(data->dxgiFactory,
|
||||
(IUnknown *)data->d3dDevice,
|
||||
|
||||
Reference in New Issue
Block a user