OpenTK.GameWindow.Run C# (CSharp) Method

Run() public method

Enters the game loop of the GameWindow using the maximum update rate.
public Run ( ) : void
return void
        public void Run()
        {
            Run(0.0, 0.0);
        }

Same methods

GameWindow::Run ( double updateRate ) : void
GameWindow::Run ( double updates_per_second, double frames_per_second ) : void

Usage Example

Esempio n. 1
3
        public static void Main()
        {
            // Create static (global) window instance
            Window = new OpenTK.GameWindow();

            // Hook up the initialize callback
            Window.Load += new EventHandler<EventArgs>(Initialize);
            // Hook up the update callback
            Window.UpdateFrame += new EventHandler<FrameEventArgs>(Update);
            // Hook up the render callback
            Window.RenderFrame += new EventHandler<FrameEventArgs>(Render);
            // Hook up the shutdown callback
            Window.Unload += new EventHandler<EventArgs>(Shutdown);

            // Set window title and size
            Window.Title = "Game Name";
            Window.ClientSize = new Size(30*8, 30*6);
            Window.VSync = VSyncMode.On;
            // Run the game at 60 frames per second. This method will NOT return
            // until the window is closed.
            Window.Run(60.0f);

            // If we made it down here the window was closed. Call the windows
            // Dispose method to free any resources that the window might hold
            Window.Dispose();

            #if DEBUG
            Console.WriteLine("\nFinished executing, press any key to exit...");
            Console.ReadKey();
            #endif
        }
All Usage Examples Of OpenTK.GameWindow::Run