public void ClearFiles() { animationBar.Model = null; animationBar.Skeleton = null; RenderableNode = null; GC.WaitForPendingFinalizers(); GLObjectManager.DeleteUnusedGLObjects(); }
private void glControl1_Paint(object sender, PaintEventArgs e) { if (OpenTKSharedResources.SetupStatus != OpenTKSharedResources.SharedResourceStatus.Initialized) { return; } RenderUvs(); GLObjectManager.DeleteUnusedGLObjects(); }
private void RenderNode(object sender, EventArgs e) { SetUpViewport(); if (renderableNode != null) { renderableNode.Render(camera); } // Clean up any unused resources. GLObjectManager.DeleteUnusedGLObjects(); }
private void RenderNodes(object sender, EventArgs e) { SetUpViewport(); foreach (var node in renderableNodes) { node.Render(camera); } renderTexture?.Render(camera); // Clean up any unused resources. GLObjectManager.DeleteUnusedGLObjects(); }
private void RenderFrame(object sender, EventArgs e) { // Context creation and resource creation failed, so we can't render anything. if (graphicsResources == null) { return; } // Draw a test pattern image to the screen. DrawScreenTexture(textureToRender); // Clean up any unused resources. GLObjectManager.DeleteUnusedGLObjects(); }
/// <summary> /// /// </summary> protected void Render(object sender, EventArgs args) { GL.Clear(ClearBufferMask.ColorBufferBit | ClearBufferMask.DepthBufferBit); // push and pop attributes so no cleanup is needed GL.PushAttrib(AttribMask.AllAttribBits); if (ApplicationSettings.RenderBackgroundGradient) { GL.Disable(EnableCap.DepthTest); RenderBackground(); } GL.Enable(EnableCap.DepthTest); GL.MatrixMode(MatrixMode.Modelview); Matrix4 modelViewMatrix = camera.MvpMatrix; GL.LoadMatrix(ref modelViewMatrix); if (ApplicationSettings.EnableGridDisplay) { Rendering.Shapes.GridFloor3D.Draw(ApplicationSettings.GridSize, 25, ApplicationSettings.GridLineColor); } if (Scene != null) { Scene.Render(camera); } if (ApplicationSettings.RenderSceneInformation) { TextRenderer.DrawOrtho(camera, "Polygon Count: " + PolyCount.ToString(), new Vector2(0, 30)); TextRenderer.DrawOrtho(camera, "Vertex Count: " + VertexCount.ToString(), new Vector2(0, 46)); } GL.PopAttrib(); if (ScreenTexture != null) { StudioSB.Rendering.Shapes.ScreenTriangle.RenderTexture(ScreenTexture, false); } // Cleanup unused gl objects GLObjectManager.DeleteUnusedGLObjects(); }
private void glControl1_Paint(object sender, PaintEventArgs e) { RenderTexture(); GLObjectManager.DeleteUnusedGLObjects(); }
private void texAlphaGlControl_Paint(object sender, PaintEventArgs e) { RenderTexture(true); GLObjectManager.DeleteUnusedGLObjects(); }
/// <summary> /// Increments the reference count and initializes <see cref="Id"/>. /// </summary> /// <param name="id">The integer ID generated by OpenGL when creating the object</param> protected GLObject(int id) { Id = id; GLObjectManager.AddReference(ObjectType, Id); }