Fix WinRT build

This commit is contained in:
Eric Wasylishen 2022-06-09 02:22:21 -06:00 committed by Sam Lantinga
parent 2830895740
commit e09551bc80
1 changed files with 10 additions and 0 deletions

View File

@ -27,7 +27,9 @@
#define COBJMACROS #define COBJMACROS
#include "../../core/windows/SDL_windows.h" #include "../../core/windows/SDL_windows.h"
#if !defined(__WINRT__)
#include "../../video/windows/SDL_windowswindow.h" #include "../../video/windows/SDL_windowswindow.h"
#endif
#include "SDL_hints.h" #include "SDL_hints.h"
#include "SDL_loadso.h" #include "SDL_loadso.h"
#include "SDL_syswm.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 /* The width and height of the swap chain must be based on the display's
* non-rotated size. * non-rotated size.
*/ */
#if defined(__WINRT__)
SDL_GetWindowSize(renderer->window, &w, &h);
#else
WIN_GetDrawableSize(renderer->window, &w, &h); WIN_GetDrawableSize(renderer->window, &w, &h);
#endif
data->rotation = D3D11_GetCurrentRotation(); data->rotation = D3D11_GetCurrentRotation();
/* SDL_Log("%s: windowSize={%d,%d}, orientation=%d\n", __FUNCTION__, w, h, (int)data->rotation); */ /* SDL_Log("%s: windowSize={%d,%d}, orientation=%d\n", __FUNCTION__, w, h, (int)data->rotation); */
if (D3D11_IsDisplayRotated90Degrees(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 static int
D3D11_GetOutputSize(SDL_Renderer * renderer, int *w, int *h) D3D11_GetOutputSize(SDL_Renderer * renderer, int *w, int *h)
{ {
WIN_GetDrawableSize(renderer->window, w, h); WIN_GetDrawableSize(renderer->window, w, h);
return 0; return 0;
} }
#endif
static SDL_bool static SDL_bool
D3D11_SupportsBlendMode(SDL_Renderer * renderer, SDL_BlendMode blendMode) D3D11_SupportsBlendMode(SDL_Renderer * renderer, SDL_BlendMode blendMode)
@ -2374,7 +2382,9 @@ D3D11_CreateRenderer(SDL_Window * window, Uint32 flags)
data->identity = MatrixIdentity(); data->identity = MatrixIdentity();
renderer->WindowEvent = D3D11_WindowEvent; renderer->WindowEvent = D3D11_WindowEvent;
#if !defined(__WINRT__)
renderer->GetOutputSize = D3D11_GetOutputSize; renderer->GetOutputSize = D3D11_GetOutputSize;
#endif
renderer->SupportsBlendMode = D3D11_SupportsBlendMode; renderer->SupportsBlendMode = D3D11_SupportsBlendMode;
renderer->CreateTexture = D3D11_CreateTexture; renderer->CreateTexture = D3D11_CreateTexture;
renderer->UpdateTexture = D3D11_UpdateTexture; renderer->UpdateTexture = D3D11_UpdateTexture;