|
@@ -35,7 +35,7 @@
|
|
|
|
|
|
extern "C" {
|
|
|
#include "../../core/windows/SDL_windows.h"
|
|
|
-//#include "SDL_hints.h"
|
|
|
+#include "SDL_hints.h"
|
|
|
//#include "SDL_loadso.h"
|
|
|
#include "SDL_system.h"
|
|
|
#include "SDL_syswm.h"
|
|
@@ -326,10 +326,13 @@ D3D11_CreateDeviceResources(SDL_Renderer * renderer)
|
|
|
// than the API default. It is required for compatibility with Direct2D.
|
|
|
UINT creationFlags = D3D11_CREATE_DEVICE_BGRA_SUPPORT;
|
|
|
|
|
|
-#if defined(_DEBUG)
|
|
|
- // If the project is in a debug build, enable debugging via SDK Layers with this flag.
|
|
|
- creationFlags |= D3D11_CREATE_DEVICE_DEBUG;
|
|
|
-#endif
|
|
|
+ // Make sure Direct3D's debugging feature gets used, if the app requests it.
|
|
|
+ const char *hint = SDL_GetHint(SDL_HINT_RENDER_DIRECT3D11_DEBUG);
|
|
|
+ if (hint) {
|
|
|
+ if (*hint == '1') {
|
|
|
+ creationFlags |= D3D11_CREATE_DEVICE_DEBUG;
|
|
|
+ }
|
|
|
+ }
|
|
|
|
|
|
// This array defines the set of DirectX hardware feature levels this app will support.
|
|
|
// Note the ordering should be preserved.
|