DX9: Surface to backbuffer, with transparency

Started by
3 comments, last by George Duckett 19 years, 7 months ago
Hi all, I'm working on the GUI aspect of my DX9 un-managed C++ project. I've rendered my GUI to a surface, created like this: g_pD3DDevice->CreateRenderTarget(RESX,RESY,D3DFMT_X8R8G8B8, D3DMULTISAMPLE_NONE,0,FALSE,&g_GUISurface,NULL); I'm trying to copy it to the backbuffer with transparency (so the 3D stuff underneath is visible), but no matter what i try it doesn't work. I've tried using UpdateSurface (with the GUISurface, and backbuffer) and creating a texture from my render target, then drawing a textured quad but nothing i try works. I've tried searching but i keep getting threads suggesting the above, but i just can't get it to work. :( Any help would be much appreciated. Edited by Coder: Wide line break [Edited by - Coder on September 12, 2004 11:25:41 PM]
Advertisement
Your render target is D3DFMT_X8R8G8B8 so it has no alpha. Where were you trying to get this alpha value from?

Rather than creating a render target, try creating a texture and setting the render target usage flag.
Stay Casual,KenDrunken Hyena
Thanks for your very quick response.

I've now changed my format from x8r8g8b8 to A2R10G10G10, but now my app crashes when trying to create a device.
I also tried changing the backbuffer's AutoDepthStencilFormat to D3DFMT_D16, but that didn't work either. :(

I am running in 32bit display mode now, so i know my graphics card (geforce3) can handle that.
Leave your backbuffer the way it was, but create your render target as A8R8G8B8.

You should also set up your debug information since it'll often tell you what's wrong (like A2R10G10G10 not being supported). See the Forum FAQ (linked at the top of the page) for more information.
Stay Casual,KenDrunken Hyena
Thanks a lot for your help, i've got it working now. I'll take a look at debugging now. Cheers!

This topic is closed to new replies.

Advertisement