SDL_gfx Question
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!!
Your SDL_MapRGB() call looks right to me so the problem is probably in hlineColor() somewhere. Or perhaps you're in 256 colour mode?
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!
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
Popular Topics
Advertisement