Example #1
0
        public void Render(Vector3 color)
        {
            graphicsDevice.SetTopology(PrimitiveTopology.TriangleList);

            graphicsDevice.SetVertexBuffer(vertexBuffer);
            graphicsDevice.SetIndexBuffer(indexBuffer, 0);

            effect.SetVariable("ViewProj", "TestX", viewProj, ShaderType.VertexShader);
            effect.Apply();

            graphicsDevice.DrawIndexed(indices.Length, 0, 0);
        }
Example #2
0
        private void DrawBatches()
        {
            foreach (var rb in renderBatches)
            {
                if (rb.texture != currentTexture)
                {
                    effect.SetTexture(rb.texture, 0, ShaderType.PixelShader);
                    currentTexture = rb.texture;
                }

                effect.Apply();
                graphicsDevice.Draw(rb.numVertices, rb.offset);
            }
        }