protected override void OnRenderFrame(FrameEventArgs e) { PerformFixedUpdates(); UpdateOncePerFrame(); renderer.Requested.Camera = sceneManager.Camera; renderer.Requested.Viewport = windowViewport; renderer.PartialGLStateResetToDefaults(); renderer.RenderCurrentClear(); GL.Viewport( renderer.Requested.Viewport.X, renderer.Requested.Viewport.Y, renderer.Requested.Viewport.Width, renderer.Requested.Viewport.Height ); GL.Enable(EnableCap.CullFace); GL.FrontFace(FrontFaceDirection.Ccw); renderer.CurrentGroup = sceneManager.RenderGroup; renderer.RenderGroup(); Render2D(); SwapBuffers(); GhostManager.Process(); RenderStack.Graphics.Debug.FrameTerminator(); }
void Application_Unload(object sender, EventArgs e) { #if false GhostManager.Process(); #if DEBUG GhostManager.CheckAllDeleted(); #endif #endif }
protected void Render() { var updateManager = RenderStack.Services.BaseServices.Get <UpdateManager>(); GhostManager.Process(); updateManager.UpdateOncePerFrame(); GhostManager.Process(); #if false var statistics = Services.Get <Statistics>(); if (statistics != null) { statistics.Update(); } #endif GhostManager.Process(); var highLevelRenderer = RenderStack.Services.BaseServices.Get <HighLevelRenderer>(); #if CATCH try #endif { highLevelRenderer.Render(); } #if CATCH catch (OpenTK.GraphicsException e) { Trace.TraceError("Caught GraphicsException"); Trace.TraceError("OpenGL error:\n" + e.ToString()); StopMessage( "OpenGL error has occured.\n" + "Please report this to [email protected]\n" + "You can press CTRL-C to copy text from this window.\n" + "Thank you.\n\n" + e.ToString(), "RenderStack - OpenGL Error" ); Close(); } catch (System.Exception e) { Trace.TraceError("Caught Exception"); Trace.TraceError("OpenGL error:\n" + e.ToString()); StopMessage( "Error has occured.\n" + "Please report this to [email protected]\n" + "You can press CTRL-C to copy text from this window.\n" + "Thank you.\n\n" + e.ToString(), "RenderStack - Generic Error" ); Close(); } #endif GhostManager.Process(); }
private void Application_Unload(object sender, EventArgs e) { render = false; if (Configuration.threadedRendering && renderThread != null) { renderThread.Join(); renderThread = null; } Context.MakeCurrent(WindowInfo); IRenderer renderer = RenderStack.Services.BaseServices.Get <IRenderer>(); if (renderer != null) { renderer.Unload(); } GC.Collect(); GhostManager.Process(); }