mirror of
https://github.com/libsdl-org/SDL.git
synced 2026-08-28 01:21:35 +00:00
Check the SDL_VIDEO_RENDER_??? macros with #if instead of #ifdef
Allows users to disable them by defining them as 0. Closes https://github.com/libsdl-org/SDL/issues/8996 (manual port of https://github.com/libsdl-org/SDL/pull/9063 to SDL3.0)
This commit is contained in:
@@ -20,7 +20,7 @@
|
||||
*/
|
||||
#include "SDL_internal.h"
|
||||
|
||||
#if defined(SDL_VIDEO_RENDER_D3D12) && !defined(SDL_RENDER_DISABLED)
|
||||
#if SDL_VIDEO_RENDER_D3D12
|
||||
|
||||
#define SDL_D3D12_NUM_BUFFERS 2
|
||||
#define SDL_D3D12_NUM_VERTEX_BUFFERS 256
|
||||
|
||||
@@ -20,7 +20,7 @@
|
||||
*/
|
||||
|
||||
#include "../../SDL_internal.h"
|
||||
#if SDL_VIDEO_RENDER_D3D12 && !SDL_RENDER_DISABLED && (defined(SDL_PLATFORM_XBOXONE) || defined(SDL_PLATFORM_XBOXSERIES))
|
||||
#if SDL_VIDEO_RENDER_D3D12 && (defined(SDL_PLATFORM_XBOXONE) || defined(SDL_PLATFORM_XBOXSERIES))
|
||||
#include "SDL_render_d3d12_xbox.h"
|
||||
#include "../../core/windows/SDL_windows.h"
|
||||
#include <XGameRuntime.h>
|
||||
|
||||
@@ -20,7 +20,7 @@
|
||||
*/
|
||||
#include "SDL_internal.h"
|
||||
|
||||
#if defined(SDL_VIDEO_RENDER_D3D12) && !defined(SDL_RENDER_DISABLED) && !defined(SDL_PLATFORM_XBOXONE) && !defined(SDL_PLATFORM_XBOXSERIES)
|
||||
#if SDL_VIDEO_RENDER_D3D12 && !defined(SDL_PLATFORM_XBOXONE) && !defined(SDL_PLATFORM_XBOXSERIES)
|
||||
|
||||
#include "../../core/windows/SDL_windows.h"
|
||||
#include <d3d12.h>
|
||||
@@ -156,4 +156,4 @@ void D3D12_GetRootSignatureData(D3D12_RootSignature rootSig, D3D12_SHADER_BYTECO
|
||||
outBytecode->BytecodeLength = D3D12_rootsigs[rootSig].rs_shader_size;
|
||||
}
|
||||
|
||||
#endif /* SDL_VIDEO_RENDER_D3D12 && !SDL_RENDER_DISABLED && !defined(SDL_PLATFORM_XBOXONE) && !defined(SDL_PLATFORM_XBOXSERIES) */
|
||||
#endif /* SDL_VIDEO_RENDER_D3D12 && !defined(SDL_PLATFORM_XBOXONE) && !defined(SDL_PLATFORM_XBOXSERIES) */
|
||||
|
||||
@@ -20,7 +20,7 @@
|
||||
*/
|
||||
#include "../../SDL_internal.h"
|
||||
|
||||
#if SDL_VIDEO_RENDER_D3D12 && !SDL_RENDER_DISABLED && defined(SDL_PLATFORM_XBOXONE)
|
||||
#if SDL_VIDEO_RENDER_D3D12 && defined(SDL_PLATFORM_XBOXONE)
|
||||
|
||||
#include <SDL3/SDL_stdinc.h>
|
||||
|
||||
@@ -139,6 +139,6 @@ D3D12_GetRootSignatureData(D3D12_RootSignature rootSig, D3D12_SHADER_BYTECODE *o
|
||||
outBytecode->BytecodeLength = D3D12_rootsigs[rootSig].rs_shader_size;
|
||||
}
|
||||
|
||||
#endif /* SDL_VIDEO_RENDER_D3D12 && !SDL_RENDER_DISABLED && defined(SDL_PLATFORM_XBOXONE) */
|
||||
#endif /* SDL_VIDEO_RENDER_D3D12 && defined(SDL_PLATFORM_XBOXONE) */
|
||||
|
||||
/* vi: set ts=4 sw=4 expandtab: */
|
||||
|
||||
@@ -20,7 +20,7 @@
|
||||
*/
|
||||
#include "../../SDL_internal.h"
|
||||
|
||||
#if SDL_VIDEO_RENDER_D3D12 && !SDL_RENDER_DISABLED && defined(SDL_PLATFORM_XBOXSERIES)
|
||||
#if SDL_VIDEO_RENDER_D3D12 && defined(SDL_PLATFORM_XBOXSERIES)
|
||||
|
||||
#include <SDL3/SDL_stdinc.h>
|
||||
|
||||
@@ -139,6 +139,6 @@ D3D12_GetRootSignatureData(D3D12_RootSignature rootSig, D3D12_SHADER_BYTECODE *o
|
||||
outBytecode->BytecodeLength = D3D12_rootsigs[rootSig].rs_shader_size;
|
||||
}
|
||||
|
||||
#endif /* SDL_VIDEO_RENDER_D3D12 && !SDL_RENDER_DISABLED && defined(SDL_PLATFORM_XBOXSERIES) */
|
||||
#endif /* SDL_VIDEO_RENDER_D3D12 && defined(SDL_PLATFORM_XBOXSERIES) */
|
||||
|
||||
/* vi: set ts=4 sw=4 expandtab: */
|
||||
|
||||
Reference in New Issue
Block a user