Exemple #1
0
        public SimpleBuildings(Game game, List<SimpleBuilding> buildings, LayerServiceConfig config)
            : base(game, config)
        {
            var rs = game.GraphicsDevice;
            var ml = Game.GetService<LayerService>().MapLayer;

            constBuffer = rs.CreateConstBuffer<ConstData>();
            drawShader	= rs.CreateUberShader("SimpleBuildings.hlsl", typeof(BuildingsFlags));

            vertexBuffer = rs.CreateVertexBuffer(typeof(SimpleBuilding), buildings.Count);
            vertexBuffer.SetData(buildings.ToArray(), 0, buildings.Count);

            //MeshInstance mi = new MeshInstance(rs, GenerateMesh(buildings), Matrix.Scaling(ml.Zoom)*Matrix.Translation(ml.Offset.X, 0.0f, ml.Offset.Y), "Ololo");
            //rs.Instances.Add(mi);
        }
 public LayerService(Game game) : base(game)
 {
     Config = new LayerServiceConfig();
 }