Beispiel #1
0
        /// <summary>
        /// Acquires a new or used alpha texture from the ADTAlphaHandler and then loads the surface with AlphaData
        /// </summary>
        private void LoadAlphaTexture()
        {
            mAlphaTexture = ADTAlphaHandler.FreeTexture();
            if (mAlphaTexture == null)
            {
                mAlphaTexture = new SlimDX.Direct3D9.Texture(Game.GameManager.GraphicsThread.GraphicsManager.Device, 64, 64, 1, Usage.None, Format.A8R8G8B8, Pool.Managed);
            }
            Surface baseSurf = mAlphaTexture.GetSurfaceLevel(0);

            System.Drawing.Rectangle rec = System.Drawing.Rectangle.FromLTRB(0, 0, 64, 64);
            Surface.FromMemory(baseSurf, AlphaData, Filter.Box, 0, Format.A8R8G8B8, 4 * 64, rec);
            baseSurf.Dispose();
        }