public virtual void Draw(Renderer renderer) { renderer.Effect.DiffuseColor = Color; if (Texture != null) renderer.Effect.Texture = Texture; else renderer.Effect.Texture = renderer.White; renderer.ApplyEffect(worldTransformation); renderer.GraphicsDevice.DrawUserIndexedPrimitives(PrimitiveType.TriangleList, Mesh.verticies, 0, Mesh.verticies.Length, Mesh.indicies, 0, Mesh.indicies.Length / 3); }
/// <summary> /// LoadContent will be called once per game and is the place to load /// all of your content. /// </summary> protected override void LoadContent() { // Create a new SpriteBatch, which can be used to draw textures. spriteBatch = new SpriteBatch(GraphicsDevice); renderer = new Renderer(GraphicsDevice); scene = new BranchNode(); quad = new LeafNode(Generator.CreateQuad()); quad.Orientation.Scale = new Vector3(100, 100, 1); quad.Texture = Content.Load<Texture2D>("metalWall"); quad.Color = Vector3.UnitX; //Flatland.Generator.ProjectTextureFit(quad.Mesh); scene.Add(quad); }
public RenderModule(GraphicsDevice device) { renderer = new Render.Renderer(device); }
public virtual void Draw(Renderer renderer) { foreach (var child in this) child.Draw(renderer); }