Make sure we're actually running on Windows before using D3D renderers
This commit is contained in:
1 parent
849c905d8c
commit
e22c89536a
2 files changed
+11
-2
No files matched your search
@@ -1598,7 +1598,11 @@ int D3D_CreateRenderer(SDL_Renderer *renderer, SDL_Window *window, Uint32 flags)
|
|||||||
renderer->driverdata = data;
|
renderer->driverdata = data;
|
||||||
|
|
||||||
SDL_VERSION(&windowinfo.version);
|
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);
|
window_flags = SDL_GetWindowFlags(window);
|
||||||
SDL_GetWindowSizeInPixels(window, &w, &h);
|
SDL_GetWindowSizeInPixels(window, &w, &h);
|
||||||
|
|||||||
@@ -812,7 +812,12 @@ static HRESULT D3D11_CreateSwapChain(SDL_Renderer *renderer, int w, int h)
|
|||||||
#if defined(__WIN32__) || defined(__WINGDK__)
|
#if defined(__WIN32__) || defined(__WINGDK__)
|
||||||
SDL_SysWMinfo windowinfo;
|
SDL_SysWMinfo windowinfo;
|
||||||
SDL_VERSION(&windowinfo.version);
|
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,
|
result = IDXGIFactory2_CreateSwapChainForHwnd(data->dxgiFactory,
|
||||||
(IUnknown *)data->d3dDevice,
|
(IUnknown *)data->d3dDevice,
|
||||||
|
|||||||
Reference in new issue
Block a user