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

View File

@ -22,12 +22,16 @@ namespace MoonWorks.Graphics
get => name;
set
{
if (Device.DebugMode)
{
Refresh.Refresh_SetGpuBufferName(
Device.Handle,
Handle,
value
);
}
name = value;
}
}

View File

@ -26,12 +26,16 @@ namespace MoonWorks.Graphics
get => name;
set
{
if (Device.DebugMode)
{
Refresh.Refresh_SetTextureName(
Device.Handle,
Handle,
value
);
}
name = value;
}
}