コード例 #1
0
        private bool LoadTextures(SharpDX.Direct3D11.Device device, string grassTextureFilename, string slopeTextureFilename, string rockTextureFilename)
        {
            grassTextureFilename = DSystemConfiguration.DataFilePath + grassTextureFilename;
            slopeTextureFilename = DSystemConfiguration.DataFilePath + slopeTextureFilename;
            rockTextureFilename  = DSystemConfiguration.DataFilePath + rockTextureFilename;

            // Create the texture object.
            GrassTexture = new DTexture();

            // Initialize the texture object.
            if (!GrassTexture.Initialize(device, grassTextureFilename))
            {
                return(false);
            }

            // Create the slope texture object.
            SlopeTexture = new DTexture();

            // Initialize the slope texture object.
            if (!SlopeTexture.Initialize(device, slopeTextureFilename))
            {
                return(false);
            }

            // Create the rock texture object.
            RockTexture = new DTexture();

            // Initialize the slope texture object.
            if (!RockTexture.Initialize(device, rockTextureFilename))
            {
                return(false);
            }

            return(true);
        }
コード例 #2
0
 private void ReleaseTexture()
 {
     // Release the texture objects.
     GrassTexture?.ShutDown();
     GrassTexture = null;
     SlopeTexture?.ShutDown();
     SlopeTexture = null;
     RockTexture?.ShutDown();
     RockTexture = null;
 }