public MDX1_Surface(Size size) { mSrcRect = new Rectangle(new Point(0, 0), size); mDisplay = Display.Impl as MDX1_Display; mDevice = mDisplay.D3D_Device; /* * Bitmap bitmap = new Bitmap(size.Width, size.Height); * Graphics g = Graphics.FromImage(bitmap); * g.Clear(Color.FromArgb(0, 0, 0, 0)); * g.Dispose(); */ //mTexture = Texture.FromBitmap(mDevice, bitmap, Usage.None, Pool.Managed); mTexture = new Ref <Texture>(new Texture(mDevice.Device, size.Width, size.Height, 1, Usage.None, Format.A8R8G8B8, Pool.Managed)); mRenderToSurface = new RenderToSurface(mDevice.Device, size.Width, size.Height, Format.A8R8G8B8, true, DepthFormat.D16); mRenderToSurface.BeginScene(mTexture.Value.GetSurfaceLevel(0)); mDevice.Clear(ClearFlags.Target, Color.FromArgb(0, 0, 0, 0).ToArgb(), 1.0f, 0); mRenderToSurface.EndScene(Filter.None); mRenderToSurface.Dispose(); mRenderToSurface = null; mTextureSize = mSrcRect.Size; InitVerts(); }
public override void Clear(Color color) { mDevice.DrawBuffer.Flush(); mDevice.Clear(ClearFlags.Target, color.ToArgb(), 1.0f, 0); }