From e09551bc80b09054ba9d90fa42029d9580b25ccb Mon Sep 17 00:00:00 2001 From: Eric Wasylishen Date: Thu, 9 Jun 2022 02:22:21 -0600 Subject: [PATCH] Fix WinRT build --- src/render/direct3d11/SDL_render_d3d11.c | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/render/direct3d11/SDL_render_d3d11.c b/src/render/direct3d11/SDL_render_d3d11.c index 72b9ee3a1..30c44ce48 100644 --- a/src/render/direct3d11/SDL_render_d3d11.c +++ b/src/render/direct3d11/SDL_render_d3d11.c @@ -27,7 +27,9 @@ #define COBJMACROS #include "../../core/windows/SDL_windows.h" +#if !defined(__WINRT__) #include "../../video/windows/SDL_windowswindow.h" +#endif #include "SDL_hints.h" #include "SDL_loadso.h" #include "SDL_syswm.h" @@ -911,7 +913,11 @@ D3D11_CreateWindowSizeDependentResources(SDL_Renderer * renderer) /* The width and height of the swap chain must be based on the display's * non-rotated size. */ +#if defined(__WINRT__) + SDL_GetWindowSize(renderer->window, &w, &h); +#else WIN_GetDrawableSize(renderer->window, &w, &h); +#endif data->rotation = D3D11_GetCurrentRotation(); /* SDL_Log("%s: windowSize={%d,%d}, orientation=%d\n", __FUNCTION__, w, h, (int)data->rotation); */ if (D3D11_IsDisplayRotated90Degrees(data->rotation)) { @@ -1052,12 +1058,14 @@ D3D11_WindowEvent(SDL_Renderer * renderer, const SDL_WindowEvent *event) } } +#if !defined(__WINRT__) static int D3D11_GetOutputSize(SDL_Renderer * renderer, int *w, int *h) { WIN_GetDrawableSize(renderer->window, w, h); return 0; } +#endif static SDL_bool D3D11_SupportsBlendMode(SDL_Renderer * renderer, SDL_BlendMode blendMode) @@ -2374,7 +2382,9 @@ D3D11_CreateRenderer(SDL_Window * window, Uint32 flags) data->identity = MatrixIdentity(); renderer->WindowEvent = D3D11_WindowEvent; +#if !defined(__WINRT__) renderer->GetOutputSize = D3D11_GetOutputSize; +#endif renderer->SupportsBlendMode = D3D11_SupportsBlendMode; renderer->CreateTexture = D3D11_CreateTexture; renderer->UpdateTexture = D3D11_UpdateTexture;