/// <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(); }
protected override void WriteDataXML(XElement ele, ElderScrollsPlugin master) { XElement subEle; ele.TryPathTo("Cell", true, out subEle); Cell.WriteXML(subEle, master); ele.TryPathTo("VertexCount", true, out subEle); subEle.Value = VertexCount.ToString(); ele.TryPathTo("TriangleCount", true, out subEle); subEle.Value = TriangleCount.ToString(); ele.TryPathTo("ExternalConnectionsCount", true, out subEle); subEle.Value = ExternalConnectionsCount.ToString(); ele.TryPathTo("NVCACount", true, out subEle); subEle.Value = NVCACount.ToString(); ele.TryPathTo("DoorsCount", true, out subEle); subEle.Value = DoorsCount.ToString(); }
public void WriteFile() { // StreamWriter writer = new StreamWriter(PFileStream); string line = Time.time.ToString() + ","; string fps = (m_frameCounter / m_timer).ToString(); line = line + "," + fps + "," + GameObjectCount.ToString() + "," + DrawcallCount.ToString() + "," + TriangleCount.ToString() + "," + VertexCount.ToString(); Writer.WriteLine(line); Writer.Flush(); }