more logging on program startup

cosmonaut 2023-12-15 10:37:34 -08:00
parent 1bd1560560
commit 67e01d764c
2 changed files with 6 additions and 1 deletions

View File

@ -123,7 +123,6 @@ namespace MoonWorks.Audio
AudioTweenManager = new AudioTweenManager(); AudioTweenManager = new AudioTweenManager();
VoicePool = new SourceVoicePool(this); VoicePool = new SourceVoicePool(this);
Logger.LogInfo("Setting up audio thread...");
WakeSignal = new AutoResetEvent(true); WakeSignal = new AutoResetEvent(true);
Thread = new Thread(ThreadMain); Thread = new Thread(ThreadMain);

View File

@ -57,6 +57,7 @@ namespace MoonWorks
bool debugMode = false bool debugMode = false
) )
{ {
Logger.LogInfo("Initializing frame limiter...");
Timestep = TimeSpan.FromTicks(TimeSpan.TicksPerSecond / targetTimestep); Timestep = TimeSpan.FromTicks(TimeSpan.TicksPerSecond / targetTimestep);
gameTimer = Stopwatch.StartNew(); gameTimer = Stopwatch.StartNew();
@ -67,6 +68,7 @@ namespace MoonWorks
previousSleepTimes[i] = TimeSpan.FromMilliseconds(1); previousSleepTimes[i] = TimeSpan.FromMilliseconds(1);
} }
Logger.LogInfo("Initializing SDL...");
if (SDL.SDL_Init(SDL.SDL_INIT_VIDEO | SDL.SDL_INIT_TIMER | SDL.SDL_INIT_GAMECONTROLLER) < 0) if (SDL.SDL_Init(SDL.SDL_INIT_VIDEO | SDL.SDL_INIT_TIMER | SDL.SDL_INIT_GAMECONTROLLER) < 0)
{ {
Logger.LogError("Failed to initialize SDL!"); Logger.LogError("Failed to initialize SDL!");
@ -75,13 +77,16 @@ namespace MoonWorks
Logger.Initialize(); Logger.Initialize();
Logger.LogInfo("Initializing input...");
Inputs = new Inputs(); Inputs = new Inputs();
Logger.LogInfo("Initializing graphics device...");
GraphicsDevice = new GraphicsDevice( GraphicsDevice = new GraphicsDevice(
Backend.Vulkan, Backend.Vulkan,
debugMode debugMode
); );
Logger.LogInfo("Initializing main window...");
MainWindow = new Window(windowCreateInfo, GraphicsDevice.WindowFlags | SDL.SDL_WindowFlags.SDL_WINDOW_HIDDEN); MainWindow = new Window(windowCreateInfo, GraphicsDevice.WindowFlags | SDL.SDL_WindowFlags.SDL_WINDOW_HIDDEN);
if (!GraphicsDevice.ClaimWindow(MainWindow, windowCreateInfo.PresentMode)) if (!GraphicsDevice.ClaimWindow(MainWindow, windowCreateInfo.PresentMode))
@ -89,6 +94,7 @@ namespace MoonWorks
throw new System.SystemException("Could not claim window!"); throw new System.SystemException("Could not claim window!");
} }
Logger.LogInfo("Initializing audio thread...");
AudioDevice = new AudioDevice(); AudioDevice = new AudioDevice();
} }