render: Reduce scope of D3D12 GDK event watcher to Xbox
This commit is contained in:
@@ -562,7 +562,7 @@ static HRESULT D3D12_IssueBatch(D3D12_RenderData *data)
|
|||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef SDL_PLATFORM_GDK
|
#if defined(SDL_PLATFORM_XBOXONE) || defined(SDL_PLATFORM_XBOXSERIES)
|
||||||
static bool SDLCALL D3D12_GDKEventFilter(void* userdata, SDL_Event* event)
|
static bool SDLCALL D3D12_GDKEventFilter(void* userdata, SDL_Event* event)
|
||||||
{
|
{
|
||||||
D3D12_RenderData *data = (D3D12_RenderData *)userdata;
|
D3D12_RenderData *data = (D3D12_RenderData *)userdata;
|
||||||
@@ -579,7 +579,7 @@ static void D3D12_DestroyRenderer(SDL_Renderer *renderer)
|
|||||||
{
|
{
|
||||||
D3D12_RenderData *data = (D3D12_RenderData *)renderer->internal;
|
D3D12_RenderData *data = (D3D12_RenderData *)renderer->internal;
|
||||||
if (data) {
|
if (data) {
|
||||||
#ifdef SDL_PLATFORM_GDK
|
#if defined(SDL_PLATFORM_XBOXONE) || defined(SDL_PLATFORM_XBOXSERIES)
|
||||||
SDL_RemoveEventWatch(D3D12_GDKEventFilter, data);
|
SDL_RemoveEventWatch(D3D12_GDKEventFilter, data);
|
||||||
#endif
|
#endif
|
||||||
D3D12_WaitForGPU(data);
|
D3D12_WaitForGPU(data);
|
||||||
@@ -1128,7 +1128,7 @@ static HRESULT D3D12_CreateDeviceResources(SDL_Renderer *renderer)
|
|||||||
SDL_SetPointerProperty(props, SDL_PROP_RENDERER_D3D12_DEVICE_POINTER, data->d3dDevice);
|
SDL_SetPointerProperty(props, SDL_PROP_RENDERER_D3D12_DEVICE_POINTER, data->d3dDevice);
|
||||||
SDL_SetPointerProperty(props, SDL_PROP_RENDERER_D3D12_COMMAND_QUEUE_POINTER, data->commandQueue);
|
SDL_SetPointerProperty(props, SDL_PROP_RENDERER_D3D12_COMMAND_QUEUE_POINTER, data->commandQueue);
|
||||||
|
|
||||||
#ifdef SDL_PLATFORM_GDK
|
#if defined(SDL_PLATFORM_XBOXONE) || defined(SDL_PLATFORM_XBOXSERIES)
|
||||||
SDL_AddEventWatch(D3D12_GDKEventFilter, data);
|
SDL_AddEventWatch(D3D12_GDKEventFilter, data);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user