Hello. I am using SDL. I'm here because asking about SDL related
stuff because responses on the SDL forum seem to take weeks and
I am sure there are some here that have used SDL.
I am using an if/else statement to blit two different pictures. It goes like so,
void startupLoop()
{
int x;
int y;
if(event.type == SDL_MOUSEMOTION)
{
x = event.motion.x;
y = event.motion.y;
//First Pictureif((x > 100 & x < 180) && (y > 200 && y < 260))
{
SDL_BlitSurface(homeScreenPlay, NULL, screen, NULL);
}
//this is the original that will be blitted if the mouse rolls out of bounds
else
SDL_BlitSurface(homeScreen, NULL, screen, NULL);
//Second Picture
//If I take out this if/else statement below, the first picture will blit
if((x > 400 && x < 480) && (y > 200 && y < 260))
{
SDL_BlitSurface(homeScreenExit, NULL, screen, NULL);
}
//this is the original that will be blitted if the mouse rolls out of bounds
else
SDL_BlitSurface(homeScreen, NULL, screen, NULL);
}
}
My problem is the second picture will blit, but not the first. And if
delete the second if else statement with the second picture in it then
the first picture will blit??? Is my problem SDL or c++ related? Thanks
for any response.
Thanks for your response. When I get back in the bounds that triggers my first picture, shouldn't the first picture blit back over the second picture. If the second is blitting over the first picture, is there a way I can get the first picture back on top of the second. Thanks again.