Exemplo n.º 1
0
        public void Dispose()
        {
            FoliageShader?.Dispose();
            FoliageShader = null;

            FontShader?.Dispose();
            FontShader = null;

            TextureShader?.Dispose();
            TextureShader = null;

            TerrainShader?.Dispose();
            TerrainShader = null;

            SkyDomeShader?.ShutDown();
            SkyDomeShader = null;

            SkyPlaneShader?.ShutDown();
            SkyPlaneShader = null;
        }
Exemplo n.º 2
0
        public bool Initialise(DirectX directXDevice, IntPtr windowHandle)
        {
            TextureShader = new TextureShader();
            var result = TextureShader.Initialise(directXDevice.Device, windowHandle);

            FontShader = new FontShader();
            result    &= FontShader.Initialise(directXDevice.Device, windowHandle);

            FoliageShader = new FoliageShader();
            result       &= FoliageShader.Initialise(directXDevice.Device, windowHandle);

            TerrainShader = new TerrainShader();
            result       &= TerrainShader.Initialise(directXDevice.Device, windowHandle);

            SkyDomeShader = new SkyDomeShader();
            result       &= SkyDomeShader.Initialize(directXDevice.Device, windowHandle);

            SkyPlaneShader = new SkyPlaneShader();
            result        &= SkyPlaneShader.Initialize(directXDevice.Device, windowHandle);

            return(result);
        }
Exemplo n.º 3
0
        public bool RenderTerrainShader(DeviceContext deviceContext, int indexCount, Matrix worldMatrix, Matrix viewMatrix, Matrix projectionMatrix, Color4 ambientColour, Color4 diffuseColour, Vector3 lightDirection, ShaderResourceView texture)
        {
            var result = TerrainShader.Render(deviceContext, indexCount, worldMatrix, viewMatrix, projectionMatrix, ambientColour, diffuseColour, lightDirection, texture);

            return(result);
        }