Jump to content
  • Advertisement
Sign in to follow this  
Aardvajk

DirectDraw and RGB macro

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

I know I should be using Direct3D by now BUT... I was messing about with DirectDrawSurface Blit last night using the colorfill option to fill surfaces with a single colour and I noticed that if I set the COLORREF member of the Blitfx structure with the RGB macro, I have to swap the red and blue components to get the correct colour. I was wondering if this was a peculiarity of my graphics card and whether the same code would produce different colours on different hardware? If so, is there a better way to generate the correct COLORREF? Thanks. Paul

Share this post


Link to post
Share on other sites
Advertisement
Guest Anonymous Poster
The RGB macro is old and is not intended for use with D3D.

The RGB macro returns colors like 0x00BBGGRR (or in memory bytes RGB) while D3D wants 0xAARRGGBB (or BGRA in memory)

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!