expose GraphicsDevice.DebugMode

what_if_no_video_threads
cosmonaut 2024-03-11 16:28:00 -07:00
parent 217ae96888
commit 8813a0139d
3 changed files with 20 additions and 10 deletions

View File

@ -15,6 +15,7 @@ namespace MoonWorks.Graphics
{ {
public IntPtr Handle { get; } public IntPtr Handle { get; }
public Backend Backend { get; } public Backend Backend { get; }
public bool DebugMode { get; }
private uint windowFlags; private uint windowFlags;
public SDL2.SDL.SDL_WindowFlags WindowFlags => (SDL2.SDL.SDL_WindowFlags) windowFlags; public SDL2.SDL.SDL_WindowFlags WindowFlags => (SDL2.SDL.SDL_WindowFlags) windowFlags;
@ -61,6 +62,7 @@ namespace MoonWorks.Graphics
Conversions.BoolToByte(debugMode) Conversions.BoolToByte(debugMode)
); );
DebugMode = debugMode;
// TODO: check for CreateDevice fail // TODO: check for CreateDevice fail
// Check for replacement stock shaders // Check for replacement stock shaders

View File

@ -23,11 +23,15 @@ namespace MoonWorks.Graphics
set set
{ {
Refresh.Refresh_SetGpuBufferName( if (Device.DebugMode)
Device.Handle, {
Handle, Refresh.Refresh_SetGpuBufferName(
value Device.Handle,
); Handle,
value
);
}
name = value; name = value;
} }
} }

View File

@ -27,11 +27,15 @@ namespace MoonWorks.Graphics
set set
{ {
Refresh.Refresh_SetTextureName( if (Device.DebugMode)
Device.Handle, {
Handle, Refresh.Refresh_SetTextureName(
value Device.Handle,
); Handle,
value
);
}
name = value; name = value;
} }
} }