• Advertisement
Sign in to follow this  

DirectDraw and RGB macro

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