Sign in to follow this  
mleeber

SDL_gfx Question

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
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

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