Sign in to follow this  

DX9: Surface to backbuffer, with transparency

This topic is 4841 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

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]

Share this post


Link to post
Share on other sites
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.

Share this post


Link to post
Share on other sites
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.

Share this post


Link to post
Share on other sites
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.

Share this post


Link to post
Share on other sites

This topic is 4841 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this