test/testgesture.c
changeset 6790 475f0a544157
parent 5535 96594ac5fd1a
child 6951 7833f01322b3
     1.1 --- a/test/testgesture.c	Mon Dec 31 13:49:06 2012 -0800
     1.2 +++ b/test/testgesture.c	Mon Dec 31 14:08:43 2012 -0800
     1.3 @@ -94,8 +94,8 @@
     1.4    int y = (int)_y;
     1.5    float a;
     1.6    
     1.7 -  if(x < 0 || x > screen->w) return;
     1.8 -  if(y < 0 || y > screen->h) return;
     1.9 +  if(x < 0 || x >= screen->w) return;
    1.10 +  if(y < 0 || y >= screen->h) return;
    1.11  
    1.12    pixmem32 = (Uint32*) screen->pixels  + y*screen->pitch/BPP + x;
    1.13    
    1.14 @@ -195,7 +195,7 @@
    1.15    if (!window) {
    1.16      window = SDL_CreateWindow("Gesture Test",
    1.17                                SDL_WINDOWPOS_CENTERED, SDL_WINDOWPOS_CENTERED,
    1.18 -                              WIDTH, HEIGHT, SDL_WINDOW_RESIZABLE);
    1.19 +                              width, height, SDL_WINDOW_RESIZABLE);
    1.20    }
    1.21    if (!window) {
    1.22      return NULL;
    1.23 @@ -257,7 +257,7 @@
    1.24  	    break;
    1.25  	  case SDL_WINDOWEVENT:
    1.26              if (event.window.event == SDL_WINDOWEVENT_RESIZED) {
    1.27 -	      if (!(screen = initScreen(0, 0)))
    1.28 +	      if (!(screen = initScreen(event.window.data1, event.window.data2)))
    1.29  	      {
    1.30  		SDL_Quit();
    1.31  		return 1;