protected override void OnRenderFrame(FrameEventArgs e) { base.OnRenderFrame(e); GL.EnableClientState(ArrayCap.VertexArray); GL.Clear(ClearBufferMask.ColorBufferBit | ClearBufferMask.DepthBufferBit); GL.ClearColor(Color.Black); OnFrameRender?.Invoke(this, e); SwapBuffers(); }
private void EngineWindow_RenderFrame(object sender, FrameEventArgs e) { if (Constants.CALC_FPS) { _timer += e.Time; _fps++; if (_timer > 1.0d) { Console.WriteLine(_fps); _fps = 0; _timer = 0.0d; } } OnFrameRender?.Invoke(this, new Events.EventArgs.RenderFrameEventArgs(_renderer)); _renderer.BeforeDraw(); _renderer.DrawFrame(); _renderer.AfterDraw(); (sender as GameWindow).SwapBuffers(); }