Mercurial > sdl-ios-xcode
comparison Xcode-iPhoneOS/Demos/src/touch.c @ 4490:06c7423f8c60
Updated iPhone keyboard code (which builds and runs on the iPad and iPhone simulator now)
Updated iPhone demos (which build and run again)
author | Sam Lantinga <slouken@libsdl.org> |
---|---|
date | Wed, 07 Jul 2010 18:58:51 -0700 |
parents | 64ce267332c6 |
children | 78db79f5a4e2 |
comparison
equal
deleted
inserted
replaced
4489:2bb1bfeee9e2 | 4490:06c7423f8c60 |
---|---|
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(); |