src/video/windows/SDL_windowsevents.c
changeset 6951 7833f01322b3
parent 6950 1ddb72193079
child 6973 ae30ec97694a
     1.1 --- a/src/video/windows/SDL_windowsevents.c	Sat Mar 02 20:44:16 2013 -0800
     1.2 +++ b/src/video/windows/SDL_windowsevents.c	Sun Mar 03 01:01:33 2013 -0800
     1.3 @@ -691,23 +691,9 @@
     1.4  				for (i = 0; i < num_inputs; ++i) {
     1.5  					PTOUCHINPUT input = &inputs[i];
     1.6  
     1.7 -					const SDL_TouchID touchId = (SDL_TouchID)
     1.8 -												((size_t)input->hSource);
     1.9 +					const SDL_TouchID touchId = (SDL_TouchID)input->hSource;
    1.10  					if (!SDL_GetTouch(touchId)) {
    1.11 -						SDL_Touch touch;
    1.12 -
    1.13 -						touch.id = touchId;
    1.14 -						touch.x_min = 0;
    1.15 -						touch.x_max = 1;
    1.16 -						touch.native_xres = touch.x_max - touch.x_min;
    1.17 -						touch.y_min = 0;
    1.18 -						touch.y_max = 1;
    1.19 -						touch.native_yres = touch.y_max - touch.y_min;
    1.20 -						touch.pressure_min = 0;
    1.21 -						touch.pressure_max = 1;
    1.22 -						touch.native_pressureres = touch.pressure_max - touch.pressure_min;
    1.23 -
    1.24 -						if (SDL_AddTouch(&touch, "") < 0) {
    1.25 +						if (SDL_AddTouch(touchId, "") < 0) {
    1.26  							continue;
    1.27  						}
    1.28  					}
    1.29 @@ -717,13 +703,13 @@
    1.30  					y = (float)(input->y - rect.top)/(rect.bottom - rect.top);
    1.31  
    1.32  					if (input->dwFlags & TOUCHEVENTF_DOWN) {
    1.33 -						SDL_SendFingerDown(touchId, input->dwID, SDL_TRUE, x, y, 1);
    1.34 +						SDL_SendTouch(touchId, input->dwID, SDL_TRUE, x, y, 1.0f);
    1.35  					}
    1.36  					if (input->dwFlags & TOUCHEVENTF_MOVE) {
    1.37 -						SDL_SendTouchMotion(touchId, input->dwID, SDL_FALSE, x, y, 1);
    1.38 +						SDL_SendTouchMotion(touchId, input->dwID, x, y, 1.0f);
    1.39  					}
    1.40  					if (input->dwFlags & TOUCHEVENTF_UP) {
    1.41 -						SDL_SendFingerDown(touchId, input->dwID, SDL_FALSE, x, y, 1);
    1.42 +						SDL_SendTouch(touchId, input->dwID, SDL_FALSE, x, y, 1.0f);
    1.43  					}
    1.44  				}
    1.45  			}