Beispiel #1
0
        private void dispose(bool disposing)
        {
            if (!_isDisposed)
            {
                Window.Dispose();

                Audio.AudioEngine.Shutdown();

                Glfw.Terminate();

                NativeLoader.UnloadLibraries();
                _isDisposed = true;
            }
        }
Beispiel #2
0
        public void MainLoop()
        {
            Window.ShowWindow();

            while (true)
            {
                // Update the time
                Time.Frame();

                // If needed, limit the framerate
                if (Application.TargetFPS.HasValue)
                {
                    //TimestepUtils.WaitFor(1000f / Application.TargetFPS.Value, (float)Time.RealDeltaTime.TotalMilliseconds);
                }

                // Input events
                Keyboard.NewFrame();
                Mouse.NewFrame();
                Glfw.PollEvents();                 // Raises input and window events
                Keyboard.FireEvents();
                Mouse.FireEvents();

                // Update the subsystems
                Audio.AudioEngine.Update();

                // Perform the update and render portions of the game loop
                Application.DoFrame();

                // Check for exit conditions
                if (Glfw.WindowShouldClose(Window.Handle))
                {
                    break;
                }
                if (Application.IsExiting)
                {
                    break;
                }
            }
        }