Пример #1
0
        public FrameBufferSurface(Size size)
        {
            mDisplay = Display.Impl as SDX_Display;
            mDevice  = mDisplay.D3D_Device;
            mSize    = size;

            try
            {
                mTexture = new Texture(mDevice.Device, mSize.Width, mSize.Height,
                                       0, Usage.RenderTarget, Format.A8R8G8B8, Pool.Default);
            }
            catch
            {
                Size newSize = SDX_Surface.NextPowerOfTwo(mSize);

                mTexture = new Texture(mDevice.Device, newSize.Width, newSize.Height,
                                       0, Usage.RenderTarget, Format.A8R8G8B8, Pool.Default);
            }

            mRenderTarget = mTexture.GetSurfaceLevel(0);

            mAgateSurface = new SDX_Surface(new AgateLib.Utility.Ref <Texture>(mTexture),
                                            new Rectangle(Point.Empty, Size));

            //SetHasDepthStencil(
        }
Пример #2
0
        private void SetTextures()
        {
            for (int i = 0; i < Textures.Count; i++)
            {
                if (Textures[i] == null)
                {
                    mDisplay.D3D_Device.SetDeviceStateTexture(null, i);
                }
                else
                {
                    SDX_Surface surf = (SDX_Surface)Textures[i].Impl;

                    mDisplay.D3D_Device.SetDeviceStateTexture(surf.D3dTexture, i);
                }
            }
        }