Пример #1
0
        public SkyBox(IBitmap neg_x, IBitmap pos_x, IBitmap neg_y, IBitmap pos_y, IBitmap neg_z, IBitmap pos_z)
        {
            _config = Constants.Kernel.Get<RenderConfig>();
			
            ITextureAtlasFactory atlasFactory = Constants.Kernel.Get<ITextureAtlasFactory>();
            _atlas = atlasFactory.CreateTextureAtlas(new Size(_config.MaxTextureSize,_config.MaxTextureSize/2), new Size(_config.MaxTextureSize / 4, _config.MaxTextureSize / 4), 1);
            _neg_x = _atlas.AddSubImage(neg_x);
            _pos_x = _atlas.AddSubImage(pos_x);
            _pos_y = _atlas.AddSubImage(pos_y);
            _neg_y = _atlas.AddSubImage(neg_y);
            _pos_z = _atlas.AddSubImage(pos_z);
            _neg_z = _atlas.AddSubImage(neg_z);
        }
Пример #2
0
        public MapRenderer(IMap map, IKernel kernel, ITextureAtlasFactory textureAtlasFactory)
        {
            _config = Constants.Kernel.Get<RenderConfig>();
			
            Map = map;
            _textureAtlas = textureAtlasFactory.CreateTextureAtlas(new Size(_config.MaxTextureSize,_config.MaxTextureSize), new Size(_config.MaxTextureSize/16,_config.MaxTextureSize/16), 4);
            Map.ChunkChanged += new EventHandler<ChangedEventArgs<IChunk>>(Map_ChunkChanged);
            //Create renderers for all chunks that already exist
            foreach (IChunk chunk in Map.Chunks)
            {
                Map_ChunkChanged(this, new ChangedEventArgs<IChunk>(null, chunk));
            }
        }
Пример #3
0
 public Camera() {
     _config = Constants.Kernel.Get<RenderConfig>();
 }