Sign in to follow this  
Joshnathan

SDL drawing prob

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

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