Beispiel #1
0
 void RestartButton_Click(object sender, EventArgs e)
 {
     if (entry.createFcn != null)
     {
         test = entry.createFcn();
     }
 }
Beispiel #2
0
            protected override void OnPaint(GUI.PaintEventArgs e)
            {
                base.OnPaint(e);

                if (testSelection != testIndex)
                {
                    testIndex = testSelection;
                    entry     = TestEntries.g_testEntries[testIndex];
                    test      = entry.createFcn();

                    viewZoom  = 1.0;
                    m_OffsetX = 0;
                    m_OffsetY = 0;

                    m_ExampleNumberLabel.Text = "Ex " + (testIndex + 1).ToString("0") + "/" + testCount.ToString("0");
                }


                Graphics graphics = e.Graphics;

                if (!DoubleBuffered)
                {
                    graphics.FillRectangle(Color.FromArgb((graphics is SoftwareGraphics) ? 96 : 192, Color.Black), ClientRectangle);
                }
                else
                {
                    graphics.Clear(Color.FromArgb((graphics is SoftwareGraphics) ? 96 : 192, Color.Black));
                }

                graphics.SmoothingMode     = entry.solidDraw ? SmoothingMode.None : SmoothingMode.AntiAlias;
                test._debugDraw.m_Graphics = graphics;
                test._debugDraw.m_Font     = m_InfoFont;

                m_Scale   = viewZoom * System.Math.Min(ClientWidth, ClientHeight) / 39;
                m_CenterX = ClientWidth / 2 + m_OffsetX;
                m_CenterY = ClientHeight * 0.85 + m_OffsetY;
                test._debugDraw.SetViewTransform(m_CenterX, m_CenterY, m_Scale);


                m_TPSCounter.Tick();

                test.SetTextLine(30);
                settings.hz = m_TPSCounter.TPS;// settingsHz;

                test.Step(settings);

                test.DrawTitle(50, 15, entry.name);
            }
Beispiel #3
0
 void Restart()
 {
     entry = TestEntries.g_testEntries[testIndex];
     test  = entry.createFcn();
 }