예제 #1
0
        private static TextureCube LoadOriginalCubemap(FearGraphicsDevice device)
        {
            TextureLoader loader = new TextureLoader(device);

            ResourceInformation cubeInfo = new TextureResourceInformation();

            cubeInfo.UpdateInformation("Filepath", "C:\\Users\\Andy\\Documents\\Coding\\Visual Studio 2012\\Projects\\FearEngine\\Resources\\Textures\\Cubemaps\\LancellottiChapel\\LancellottiChapelCube.dds");
            cubeInfo.UpdateInformation("IsCubemap", "true");

            return((TextureCube)loader.Load(cubeInfo));
        }
        public void LoadCubemap()
        {
            //Given
            SharpDX.Toolkit.Graphics.GraphicsDevice device = SharpDX.Toolkit.Graphics.GraphicsDevice.New(DeviceCreationFlags.Debug);
            TextureLoader loader = new TextureLoader(new SharpDXGraphicsDevice(device));

            ResourceInformation cubeInfo = new TextureResourceInformation();

            cubeInfo.UpdateInformation("Filepath", "C:\\Users\\Andy\\Documents\\Coding\\Visual Studio 2012\\Projects\\FearEngine\\Resources\\Textures\\Cubemaps\\LancellottiChapel\\LancellottiChapelCube.dds");
            cubeInfo.UpdateInformation("IsCubemap", "true");

            //When
            TextureCube texture = (TextureCube)loader.Load(cubeInfo);

            device.Dispose();
        }
        public void LoadSRGBTexture()
        {
            //Given
            SharpDX.Toolkit.Graphics.GraphicsDevice device = SharpDX.Toolkit.Graphics.GraphicsDevice.New(DeviceCreationFlags.Debug);
            TextureLoader       loader = new TextureLoader(new SharpDXGraphicsDevice(device));
            ResourceInformation info   = new TextureResourceInformation();

            info.UpdateInformation("Filepath", "C:\\Users\\Andy\\Documents\\Coding\\Visual Studio 2012\\Projects\\FearEngine\\Resources\\Textures\\GammaGradient.png");
            info.UpdateInformation("IsLinear", "false");

            //When
            Texture texture = (Texture)loader.Load(info);

            //Then
            Assert.IsTrue(texture.Width == 512);
            Assert.IsTrue(texture.Height == 512);

            device.Dispose();
        }