public int CompareTo(Primitive other) { int aPrio = GetPrimitiveTypePriority(Type); int bPrio = GetPrimitiveTypePriority(other.Type); if (aPrio != bPrio) { return(aPrio.CompareTo(bPrio)); } return(VertexCount.CompareTo(other.VertexCount)); }
/// <summary> /// Compares the current instance with another Object of the same type. /// </summary> /// <param name="obj"> An Object to compare with this instance. </param> /// <returns> A 32-bit signed integer that indicates the relative order of the objects being compared. The return value has these meanings: Value Meaning Less than zero This instance is less than obj. Zero This instance is equal to obj. Greater than zero This instance is greater than obj. </returns> /// <exception cref="T:System.ArgumentException">obj is not the same type as this instance.</exception> public int CompareTo(Object obj) { if (null == obj) { throw new ArgumentNullException("obj"); } if (obj.GetType() == GetType()) { var graph = obj as Graph <T>; return(VertexCount.CompareTo(graph.VertexCount)); } return(String.Compare(GetType().FullName, obj.GetType().FullName, StringComparison.Ordinal)); }
/// <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 Update(EvaluationContext context) { var resourceManager = ResourceManager.Instance(); var device = resourceManager.Device; var deviceContext = device.ImmediateContext; var setVs = deviceContext.VertexShader.Get(); var setPs = deviceContext.PixelShader.Get(); if (setVs == null || setPs == null) { Log.Warning("Trying to issue draw call, but pixel and/or vertex shader are null."); return; } deviceContext.Draw(VertexCount.GetValue(context), VertexStartLocation.GetValue(context)); }
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(); }