Exemple #1
0
        public void Draw(IndexBuffer indexbuffer, IAttributeBuffer vertexbuffer, IAttributeBuffer texturebuffer, float darkness, Texture2D texture, int count, int offset, bool alphablending = true)
        {
            Apply(texture.ID, indexbuffer, vertexbuffer, texturebuffer, alphablending);
            brightnessHandle.Set(darkness);

            GL.DrawElements(BeginMode.Triangles, count, DrawElementsType.UnsignedShort, new IntPtr(offset));
        }
Exemple #2
0
 protected void Apply(int texture, IndexBuffer indexbuffer, IAttributeBuffer vertexbuffer, IAttributeBuffer texturebuffer, bool alphaBlending)
 {
     Apply(vertexbuffer, alphaBlending);
     texturebuffer.Bind(textureCoordsHandle);
     textureHandle.Set(texture);
     indexbuffer.Bind( );
 }
Exemple #3
0
 public BufferBatch(IndexBuffer indexbuffer, IAttributeBuffer vertexbuffer, IAttributeBuffer colorbuffer, IAttributeBuffer texturebuffer)
 {
     IndexBuffer   = indexbuffer;
     VertexBuffer  = vertexbuffer;
     ColorBuffer   = colorbuffer;
     TextureBuffer = texturebuffer;
 }
Exemple #4
0
        public void Draw(IndexBuffer indexbuffer, IAttributeBuffer vertexbuffer, IAttributeBuffer texturebuffer, Texture2D texture, Matrix matrix, int count, bool alphablending = true)
        {
            Apply(texture.ID, indexbuffer, vertexbuffer, texturebuffer, alphablending);
            mvpMatrixHandle.Set(matrix.MVP);

            GL.DrawElements(BeginMode.Triangles, count, DrawElementsType.UnsignedShort, IntPtr.Zero);
        }
Exemple #5
0
 protected void Apply(IAttributeBuffer vertexbuffer, bool alphaBlending)
 {
     if (alphaBlending)
     {
         EnableAlphaBlending( );
     }
     vertexbuffer.Bind(positionHandle);
 }
Exemple #6
0
 public void Draw(IAttributeBuffer vertexBuffer, Color color, Matrix matrix, float width, int count, bool alphaBlending = true)
 {
     Apply(vertexBuffer, alphaBlending);
     colorHandle.Set(color.ToArray());
     mvpmatrixHandle.Set(matrix.MVP);
     GL.LineWidth(width);
     GL.DrawArrays(BeginMode.LineStrip, 0, count);
 }
Exemple #7
0
        public void Draw(IAttributeBuffer vertexbuffer, IAttributeBuffer sizebuffer, IAttributeBuffer colorbuffer, int count, bool alphablending = true)
        {
            Apply(vertexbuffer, alphablending);
            sizebuffer.Bind(sizeHandle);
            colorbuffer.Bind(colorHandle);
            // matrixHandle.Set(Emitter.Matrix.MVP);

            GL.DrawArrays(BeginMode.Points, 0, count);
        }
Exemple #8
0
        public void Draw(IndexBuffer indexbuffer, IAttributeBuffer vertexbuffer, IAttributeBuffer texturebuffer, IAttributeBuffer colorbuffer, Texture2D texture, Matrix matrix, int count, int offset, bool alphablending = true)
        {
            Debug.CheckGL(this);
            Apply(texture.ID, indexbuffer, vertexbuffer, texturebuffer, alphablending);
            Debug.CheckGL(this);
            colorbuffer.Bind(colorHandle);
            Debug.CheckGL(this);
            mvpMatrixHandle.Set(matrix.MVP);
            Debug.CheckGL(this);

            GL.DrawElements(BeginMode.Triangles, count, DrawElementsType.UnsignedShort, new IntPtr(offset));
            Debug.CheckGL(this);
        }
        public void Draw(IndexBuffer indexBuffer, IAttributeBuffer vertexBuffer, IAttributeBuffer baseTextureBuffer, IAttributeBuffer ampTextureBuffer, Texture2D baseTexture, Texture2D ampTexture, Matrix matrix, int count, int offset, bool alphaBlending = true)
        {
            indexBuffer.Bind( );
            Apply(vertexBuffer, alphaBlending);

            baseTextureHandle.Set(baseTexture.ID, 0);
            ampTextureHandle.Set(ampTexture.ID, 1);
            baseTextureBuffer.Bind(baseTextureCoordsHandle);
            ampTextureBuffer.Bind(ampTextureCoordsHandle);
            mvpMatrixHandle.Set(matrix.MVP);

            GL.DrawElements(BeginMode.Triangles, count, DrawElementsType.UnsignedShort, new IntPtr(offset));
        }
Exemple #10
0
 public BufferBatch(IAttributeBuffer vertexbuffer, IAttributeBuffer sizebuffer, IAttributeBuffer colorbuffer)
 {
     VertexBuffer = vertexbuffer;
     SizeBuffer   = sizebuffer;
     ColorBuffer  = colorbuffer;
 }