comparison Xcode-iPhoneOS/Demos/src/touch.c @ 4755:436183eb30c8

Merge with main repo (mainly for non-printable character fix)
author dewyatt
date Sun, 18 Jul 2010 13:48:23 -0400
parents 06c7423f8c60
children 78db79f5a4e2
comparison
equal deleted inserted replaced
4754:2072fed2f583 4755:436183eb30c8
104 switch (event.type) { 104 switch (event.type) {
105 case SDL_QUIT: 105 case SDL_QUIT:
106 done = 1; 106 done = 1;
107 break; 107 break;
108 case SDL_MOUSEMOTION: 108 case SDL_MOUSEMOTION:
109 SDL_SelectMouse(event.motion.which); /* select 'mouse' (touch) that moved */
110 state = SDL_GetMouseState(&x, &y); /* get its location */ 109 state = SDL_GetMouseState(&x, &y); /* get its location */
111 SDL_GetRelativeMouseState(&dx, &dy); /* find how much the mouse moved */ 110 SDL_GetRelativeMouseState(&dx, &dy); /* find how much the mouse moved */
112 if (state & SDL_BUTTON_LMASK) { /* is the mouse (touch) down? */ 111 if (state & SDL_BUTTON_LMASK) { /* is the mouse (touch) down? */
113 drawLine(x - dx, y - dy, dx, dy); /* draw line segment */ 112 drawLine(x - dx, y - dy, dx, dy); /* draw line segment */
114 SDL_RenderPresent(); 113 SDL_RenderPresent();