/// <summary> /// /// </summary> /// <returns></returns> public ZeroIndexBuffer GetIndexBuffer() { if (this.buffer == null) { this.buffer = ZeroIndexBuffer.Create(this.Mode, this.FirstVertex, this.VertexCount, this.PrimCount); } return(this.buffer); }
public IndexBuffer GetIndexBuffer() { if (this.indexBuffer == null) { this.indexBuffer = ZeroIndexBuffer.Create(DrawMode.TriangleStrip, 0, positions.Length); } return(this.indexBuffer); }
public IndexBuffer GetIndexBuffer() { if (this.indexBuffer == null) { this.indexBuffer = ZeroIndexBuffer.Create(DrawMode.Quads, 0, 4); } return(this.indexBuffer); }
public CSharpGL.IndexBuffer GetIndexBuffer() { if (this.indexBuffer == null) { int vertexCount = this.pointCount; ZeroIndexBuffer buffer = ZeroIndexBuffer.Create(DrawMode.Points, 0, vertexCount); this.indexBuffer = buffer; } return(this.indexBuffer); }
/// <summary> /// /// </summary> /// <returns></returns> public CSharpGL.IndexBuffer GetIndexBuffer() { if ((indexBuffer == null)) { int vertexCount = this.pointPositions.Length; ZeroIndexBuffer buffer = ZeroIndexBuffer.Create(DrawMode.Points, 0, vertexCount); this.indexBuffer = buffer; } return(indexBuffer); }
public IndexBuffer GetIndexBuffer() { if (this.indexBuffer == null) { int uCount = GetUCount(interval); ZeroIndexBuffer buffer = ZeroIndexBuffer.Create(DrawMode.Points, 0, uCount); this.indexBuffer = buffer; } return(this.indexBuffer); }
/// <summary> /// /// </summary> /// <returns></returns> public IndexBuffer GetIndexBuffer() { if (this.indexBuffer == null) { int vertexCount = maxCharCount * 4; ZeroIndexBuffer buffer = ZeroIndexBuffer.Create(DrawMode.Quads, 0, vertexCount); this.indexBuffer = buffer; } return(this.indexBuffer); }
/// <summary> /// /// </summary> /// <returns></returns> public IndexBuffer GetIndexBuffer() { if (this.indexBuffer == null) { int vertexCount = positions.Length; ZeroIndexBuffer buffer = ZeroIndexBuffer.Create(DrawMode.Lines, 0, vertexCount); this.indexBuffer = buffer; } return(this.indexBuffer); }
/// <summary> /// /// </summary> /// <returns></returns> public IndexBuffer GetIndexBuffer() { if (indexBuffer == null) { ZeroIndexBuffer buffer = ZeroIndexBuffer.Create(DrawMode.LineStrip, 0, BigDipperModel.positions.Length); this.indexBuffer = buffer; } return(indexBuffer); }
/// <summary> /// /// </summary> /// <returns></returns> public IndexBuffer GetIndexBuffer() { if (this.indexBuffer == null) { int vertexCount = this.model.positions.Length; ZeroIndexBuffer buffer = ZeroIndexBuffer.Create(this.model.GetDrawModel(), 0, vertexCount); this.indexBuffer = buffer; } return(this.indexBuffer); }
/// <summary> /// /// </summary> /// <returns></returns> public IndexBuffer GetIndexBuffer() { if (this.indexBuffer == null) { int primCount = 1; int frameCount = 2; this.indexBuffer = ZeroIndexBuffer.Create(DrawMode.Quads, 0, positions.Length, primCount, frameCount); } return(this.indexBuffer); }
/// <summary> /// /// </summary> /// <returns></returns> public IndexBuffer GetIndexBuffer() { if (this.indexBuffer == null) { int vertexCount = this.model.Positions.Length; ZeroIndexBuffer buffer = ZeroIndexBuffer.Create(DrawMode.LineStrip, 0, vertexCount); this.indexBuffer = buffer; } return this.indexBuffer; }
/// <summary> /// /// </summary> /// <returns></returns> public IndexBuffer GetIndexBuffer() { if (this.indexBuffer == null) { int primCount = 1; int frameCount = 1; var indexBuffer = ZeroIndexBuffer.Create(DrawMode.Quads, 0, this.Capacity * 4, primCount, frameCount); // note: use ZeroIndexBuffer.Draw(ControlMode.Random) to enable this property. indexBuffer.RenderingVertexCount = 0; this.indexBuffer = indexBuffer; } return(this.indexBuffer); }
/// <summary> /// /// </summary> /// <param name="arg"></param> /// <param name="lastVertexId"></param> /// <param name="picker"></param> /// <returns></returns> internal override uint Search(PickingEventArgs arg, uint lastVertexId, ZeroIndexPicker picker) { var zeroIndexBuffer = picker.Node.PickingRenderUnit.VertexArrayObject.IndexBuffer as ZeroIndexBuffer; // when the temp index buffer could be long, it's no longer needed. // what a great OpenGL API design! ZeroIndexBuffer indexBuffer = ZeroIndexBuffer.Create(DrawMode.Points, zeroIndexBuffer.FirstVertex, zeroIndexBuffer.RenderingVertexCount, zeroIndexBuffer.InstanceCount); picker.Node.Render4InnerPicking(arg, indexBuffer); uint id = ColorCodedPicking.ReadStageVertexId(arg.X, arg.Y); indexBuffer.Dispose(); if (zeroIndexBuffer.FirstVertex <= id && id < zeroIndexBuffer.FirstVertex + zeroIndexBuffer.RenderingVertexCount) { return(id); } else { throw new Exception("This should not happen!"); } }
/// <summary> /// /// </summary> /// <param name="arg"></param> /// <param name="x">mouse position(Left Down is (0, 0)).</param> /// <param name="y">mouse position(Left Down is (0, 0)).</param> /// <param name="lastVertexId"></param> /// <param name="modernRenderer"></param> /// <returns></returns> internal override uint Search(RenderEventArgs arg, int x, int y, uint lastVertexId, ZeroIndexRenderer modernRenderer) { ZeroIndexBuffer zeroIndexBuffer = modernRenderer.IndexBuffer; // when the temp index buffer could be long, it's no longer needed. // what a great OpenGL API design! ZeroIndexBuffer indexBuffer = ZeroIndexBuffer.Create(DrawMode.Points, zeroIndexBuffer.FirstVertex, zeroIndexBuffer.RenderingVertexCount, zeroIndexBuffer.PrimCount); modernRenderer.Render4InnerPicking(arg, indexBuffer); uint id = ColorCodedPicking.ReadStageVertexId(x, y); indexBuffer.Dispose(); if (zeroIndexBuffer.FirstVertex <= id && id < zeroIndexBuffer.FirstVertex + zeroIndexBuffer.RenderingVertexCount) { return(id); } else { throw new Exception("This should not happen!"); } }