public void Render(float time, Graphics.GraphicsDevice dev) { dev.SetActiveMaterial(mat); dev.SetVertexBuffer(vb); dev.SetIndexBuffer(ib); dev.Draw(DrawMode.Lines); dev.SetActiveMaterial(null); dev.SetVertexBuffer(null); dev.SetIndexBuffer(null); }
public virtual void Render(float time, Graphics.GraphicsDevice dev) { if (model != null && mat != null) { if (mat != null) { dev.SetActiveMaterial(mat); } dev.SetVertexBuffer(model.VertexBuffer); foreach (var part in model.Parts) { dev.SetIndexBuffer(part.IndexBuffer); dev.Draw(Graphics.DrawMode.Triangles); } dev.SetIndexBuffer(null); dev.SetVertexBuffer(null); dev.SetActiveMaterial(null); } }
public void Render(float time, Graphics.GraphicsDevice dev) { if (mat != null) { dev.SetActiveMaterial(mat); } dev.SetVertexBuffer(vb); foreach (var block in blocks) { RenderBlock(block, dev); } dev.SetVertexBuffer(null); dev.SetIndexBuffer(null); }