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); }
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)); } }
public Camera() { _config = Constants.Kernel.Get<RenderConfig>(); }