Jump to content
  • Advertisement
Sign in to follow this  
Joshnathan

SDL drawing prob

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

hi all, this is my function:
while(running)
  {
      SDL_Event event;
      while(SDL_PollEvent(&event))
      {
          switch(event.type)
          {
              case SDL_QUIT:
                  running = false;
                  break;
              case SDL_KEYDOWN:
                  if(event.key.keysym.sym == SDLK_ESCAPE)
                  {
                      running = false;
                  }  
                  if(event.key.keysym.sym == SDLK_UP)   
                  {
                      CreateImage(newgame2, 250, 50);
                      CreateImage(highscores1, 250, 110);  
                  }
                  if(event.key.keysym.sym == SDLK_DOWN)  
                  {
                      CreateImage(newgame1, 250, 50);
                      CreateImage(highscores2, 250, 110);
                  }     
                  break;
          }
      }       
  }         

normally it should change the images hishscores and newgame when you push up or down, but it won't change :( any ideas? here is my draw function btw:
void CreateImage(SDL_Surface *image, int x, int y)
{
    SDL_Rect field;
    field.x = x;
    field.y = y;
    
    
    SDL_BlitSurface(image, NULL, screen, &field);
}    

Share this post


Link to post
Share on other sites
Advertisement
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

Participate in the game development conversation and more when you create an account on GameDev.net!

Sign me up!