コード例 #1
0
ファイル: Form1.cs プロジェクト: timdetering/AirplaneWar
        static void Main()
        {
            Form1 app = new Form1();

            app.InitializeGraphics();
            app.Show();
            timer measure = new timer();

            measure.Start();
            while (app.Created)
            {
                measure.Stop();

                /* If you can generate more than 50 frames per second (1/50 = 0.02)
                 * your hardware is pretty cool but we don't really need to
                 * consume so much cpu so let it wait a little */
                while (measure.Time() < 0.02d)
                {
                    Application.DoEvents();
                    measure.Stop();
                }
                measure.Start();
                app.Render();
                Application.DoEvents();
                //	Thread.Sleep(40);
            }
            // should clean up 3d and exit
        }