Пример #1
0
        public void Load(IAssetManager assetManager)
        {
            _texture = new CubeMap();
            _texture.Bind();

            _texture.Param(TextureParameterName.TextureWrapS, TextureWrapMode.ClampToEdge);
            _texture.Param(TextureParameterName.TextureWrapT, TextureWrapMode.ClampToEdge);
            _texture.Param(TextureParameterName.TextureMagFilter, TextureMagFilter.Linear);
            _texture.Param(TextureParameterName.TextureMinFilter, TextureMinFilter.Linear);

            for (var i = 0; i < 6; i++)
            {
                var textureName = new Identifier(_name.Namespace, _name.Key + '_' + i + ".png");
                if (!assetManager.TryLoad <Bitmap>(textureName, out var image))
                {
                    throw new FileNotFoundException("Texture not found");
                }

                _texture.SetIndex((CubeMap.TextureIndex)i);
                _texture.Data(image);
            }
        }
Пример #2
0
 public void Render(ICamera camera, IGraphicsContext context, double deltaTime)
 {
     _texture.Bind();
     _mesh.Render();
 }