|
@@ -35,6 +35,10 @@ |
|
|
|
|
|
#ifdef __WINRT__ |
|
|
|
|
|
#if NTDDI_VERSION > NTDDI_WIN8 |
|
|
#include <DXGI1_3.h> |
|
|
#endif |
|
|
|
|
|
#include "SDL_render_winrt.h" |
|
|
|
|
|
#if WINAPI_FAMILY == WINAPI_FAMILY_APP |
|
@@ -134,6 +138,7 @@ typedef struct |
|
|
/* Defined here so we don't have to include uuid.lib */ |
|
|
static const GUID IID_IDXGIFactory2 = { 0x50c83a1c, 0xe072, 0x4c48, { 0x87, 0xb0, 0x36, 0x30, 0xfa, 0x36, 0xa6, 0xd0 } }; |
|
|
static const GUID IID_IDXGIDevice1 = { 0x77db970f, 0x6276, 0x48ba, { 0xba, 0x28, 0x07, 0x01, 0x43, 0xb4, 0x39, 0x2c } }; |
|
|
static const GUID IID_IDXGIDevice3 = { 0x6007896c, 0x3244, 0x4afd, { 0xbf, 0x18, 0xa6, 0xd3, 0xbe, 0xda, 0x50, 0x23 } }; |
|
|
static const GUID IID_ID3D11Texture2D = { 0x6f15aaf2, 0xd208, 0x4e89, { 0x9a, 0xb4, 0x48, 0x95, 0x35, 0xd3, 0x4f, 0x9c } }; |
|
|
static const GUID IID_ID3D11Device1 = { 0xa04bfb29, 0x08ef, 0x43d6, { 0xa4, 0x9c, 0xa9, 0xbd, 0xbd, 0xcb, 0xe6, 0x86 } }; |
|
|
static const GUID IID_ID3D11DeviceContext1 = { 0xbb2c6faa, 0xb5fb, 0x4082, { 0x8e, 0x6b, 0x38, 0x8b, 0x8c, 0xfa, 0x90, 0xe1 } }; |
|
@@ -1601,6 +1606,27 @@ D3D11_HandleDeviceLost(SDL_Renderer * renderer) |
|
|
return S_OK; |
|
|
} |
|
|
|
|
|
void |
|
|
D3D11_Trim(SDL_Renderer * renderer) |
|
|
{ |
|
|
#ifdef __WINRT__ |
|
|
#if NTDDI_VERSION > NTDDI_WIN8 |
|
|
D3D11_RenderData *data = (D3D11_RenderData *)renderer->driverdata; |
|
|
HRESULT result = S_OK; |
|
|
IDXGIDevice3 *dxgiDevice = NULL; |
|
|
|
|
|
result = ID3D11Device_QueryInterface(data->d3dDevice, &IID_IDXGIDevice3, &dxgiDevice); |
|
|
if (FAILED(result)) { |
|
|
//WIN_SetErrorFromHRESULT(__FUNCTION__ ", ID3D11Device to IDXGIDevice3", result); |
|
|
return; |
|
|
} |
|
|
|
|
|
IDXGIDevice3_Trim(dxgiDevice); |
|
|
SAFE_RELEASE(dxgiDevice); |
|
|
#endif |
|
|
#endif |
|
|
} |
|
|
|
|
|
static void |
|
|
D3D11_WindowEvent(SDL_Renderer * renderer, const SDL_WindowEvent *event) |
|
|
{ |
|
|