Ejemplo n.º 1
0
 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);
 }
Ejemplo n.º 2
0
Archivo: Game1.cs Proyecto: hvp/Gemgine
        /// <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);
        }
Ejemplo n.º 3
0
 public RenderModule(GraphicsDevice device)
 {
     renderer = new Render.Renderer(device);
 }
Ejemplo n.º 4
0
 public virtual void Draw(Renderer renderer)
 {
     foreach (var child in this)
         child.Draw(renderer);
 }