Jump to content
  • Advertisement
Sign in to follow this  
Omroth

Gdi+ and Direct3D

This topic is 3266 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

Hey guys. I'm moving a surface made with GDI+ onto the graphics card to be rendered with DirectX. Unfortunately, I have a problem. I am writing with GDI+ in "PixelFormat32bppARGB", but DX only seems to be happy with RGBA in 32 bit. Speed is quite important in this application - is there a fast solution to this that doesn't requre just swapping a load of bits? I'm using D3DXLoadVolumeFromMemory for the copy. Any help would be much appreciated. Thanks, Ian

Share this post


Link to post
Share on other sites
Advertisement
Quote:
Original post by Omroth
Unfortunately, I have a problem. I am writing with GDI+ in "PixelFormat32bppARGB", but DX only seems to be happy with RGBA in 32 bit.
Yep - DX9 requires that it be in that order. There's no real solution other than not using GDI+ or doing some sort of trick to get around it. I believe DX10 doesn't have this restriction, but it's also only Vista+.

Share this post


Link to post
Share on other sites
Thanks Steve - guess I just have to do it the slow way...

Would you still use D3DXLoadVolumeFromMemory then swap the bits, or would you do it during the copy from main memory to gfx memory?

Thanks,
Ian

Share this post


Link to post
Share on other sites
mhn...as far as I know and remember...DX9 can use the same as the GDI+ ARGB format. (its DX10 that have a different format with DXGI 1.0 (1.1 added the format to be used to cooperate))
Have you tried to simply copy it?

Share this post


Link to post
Share on other sites
You might be faster re-implementing D3DXLoadVolumeFromMemory(), to avoid parsing the data twice.

Actually - looking at the DX9 docs, the format is D3DFMT_A8R8G8B8, which is ARGB order?

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!