public ParticleBatch(IGraphicsContext context, int maxCapacity) { this.elementCount = 0; this.maxSize = maxCapacity; GL.GenVertexArrays(1, out this.vba); this.context = context; this.vertecies = new Vertex[maxCapacity * 4]; this.vertexBuffer = new VertexBuffer <Vertex>(context, OpenTK.Graphics.OpenGL.BufferUsageHint.StreamDraw); this.indexBuffer = new IntIndexBuffer(context, OpenTK.Graphics.OpenGL.BufferUsageHint.StaticDraw); this.SetIndexBufferSize(maxCapacity); this.context.BindVertexBuffer(this.vertexBuffer); this.vertexBuffer.SetData(this.vertecies); }
public ParticleBatch(IGraphicsContext context, int maxCapacity) { this.elementCount = 0; this.maxSize = maxCapacity; GL.GenVertexArrays(1, out this.vba); this.context = context; this.vertecies = new Vertex[maxCapacity * 4]; this.vertexBuffer = new VertexBuffer<Vertex>(context, OpenTK.Graphics.OpenGL.BufferUsageHint.StreamDraw); this.indexBuffer = new IntIndexBuffer(context, OpenTK.Graphics.OpenGL.BufferUsageHint.StaticDraw); this.SetIndexBufferSize(maxCapacity); this.context.BindVertexBuffer(this.vertexBuffer); this.vertexBuffer.SetData(this.vertecies); }
public void BindIndexBuffer(IntIndexBuffer buffer) { forwarding.BindIndexBuffer(buffer); CheckGLError(); GLCALLS++; }
public void BindIndexBuffer(IntIndexBuffer buffer) { GL.BindBuffer(BufferTarget.ElementArrayBuffer, buffer != null ? buffer.Handle : 0); }
private void InitIndices() { this.indexBuffer = new IntIndexBuffer(this.GraphicsContext, BufferUsageHint.StaticDraw); this.SetupIndices(Max_Sprites); }