SDL_gfx Question

Started by
3 comments, last by mleeber 17 years, 4 months ago
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!!
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?
I'm not sure if I'm in 256 color mode. How can I tell?
Do you have a call to SDL_SetVideoMode, and if so, what does it look like?
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!

This topic is closed to new replies.

Advertisement