/// <summary> /// Runs the window loop, which in turn calls the registered event handlers /// </summary> public void Run() { //register a callback for updating the game logic gameWindow.UpdateFrame += (sender, e) => Update?.Invoke((float)gameWindow.TargetUpdatePeriod); //registers a callback for drawing a frame gameWindow.RenderFrame += (sender, e) => GameWindowRender(); //run the update loop, which calls our registered callbacks gameWindow.Run(); screenShots?.ForEach((bmp) => bmp.RotateFlip()); //delayed rotate flip screenShots?.Save(PathTools.GetCurrentProcessOutputDir()); }
private void ProcessCommandLineArguments(ref double updateRenderRate) { var args = Environment.GetCommandLineArgs().Skip(1).Select(element => element.ToLowerInvariant()); if (args.Contains("capture")) { afterRenderingCallbacks.Add(new FrameGrabber(PathTools.GetCurrentProcessOutputDir())); updateRenderRate = 30; } if (args.Contains("fullscreen")) { gameWindow.WindowState = WindowState.Fullscreen; } }