Beispiel #1
0
        /// <summary>
        /// Add your game rendering code here.
        /// </summary>
        /// <param name="e">Contains timing information.</param>
        /// <remarks>There is no need to call the base implementation.</remarks>
        protected override void OnRenderFrame(FrameEventArgs e)
        {
            GL.Clear(ClearBufferMask.DepthBufferBit | ClearBufferMask.ColorBufferBit);

            m_Canvas.RenderCanvas();

            SwapBuffers();
        }
Beispiel #2
0
        protected override void OnRenderFrame(FrameEventArgs e)
        {
            // Add Slight Delay to Screen Changes to Give Slower Machines Time to Prepare Everything.
            if (ActiveScreen != LastActiveScreen)
            {
                System.Threading.Thread.Sleep(100);

                LastActiveScreen = ActiveScreen;

                ShowScreen(ActiveScreen);
            }

            base.OnRenderFrame(e);

            GL.Clear(ClearBufferMask.ColorBufferBit | ClearBufferMask.DepthBufferBit);

            if (ActiveScreen == Screen.Game)
            {
                DrawLocalUI();

                if (ActiveSessionType == SessionType.Multiplayer)
                {
                    DrawRemoteUI();
                }

                BaseCanvas.RenderCanvas();

                DrawLocalGame();

                if (ActiveSessionType == SessionType.Multiplayer)
                {
                    DrawRemoteGame();
                }
            }

            else
            {
                BaseCanvas.RenderCanvas();
            }

            GL.Flush();

            SwapBuffers();
        }