Jump to content
  • Advertisement
Sign in to follow this  
mleeber

SDL_gfx Question

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

Hello all, I'm having a problem with SDL_gfx. I'm trying to draw white lines to the screen but instead I'm getting a cyan color. Here is my line of code that draws the lines: hlineColor(screen,x,x+BOARD_WIDTH,y,SDL_MapRGB(screen->format,0xFF,0xFF,0xFF)); I thought that SDL_MapRGB(screen->format,0xFF,0xFF,0xFF) would give me the Uint32 for the color white but I'm new to SDL and could be wrong. Any help would be appreciated. Thanks in advance!!

Share this post


Link to post
Share on other sites
Advertisement
Your SDL_MapRGB() call looks right to me so the problem is probably in hlineColor() somewhere. Or perhaps you're in 256 colour mode?

Share this post


Link to post
Share on other sites
Hi Kylotan,

I ended up figuring out what the problem was. I went back to re-read the documentation and I found at the top that the color must be in the format: 0xRRGGBBAA. So I changed the line to this and it worked:

hlineColor(screen,x,x+BOARD_WIDTH,y,0xFFFFFFFF);

Thanks for taking the time to look at this issue!

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!