[Patch] iPhoneOS svn rev 5478; fix touch demo

Patch for API change.

Index: Xcode-iPhoneOS/Demos/src/touch.c===================================================================
— Xcode-iPhoneOS/Demos/src/touch.c (revision 5478)
+++ Xcode-iPhoneOS/Demos/src/touch.c (working copy)
@@ -79,6 +79,7 @@
SDL_Event event;
SDL_WindowID windowID; /* main window /
int done; /
does user want to quit? */

  • int mouse;

    /* initialize SDL */
    if (SDL_Init(SDL_INIT_VIDEO) < 0) {
    @@ -106,9 +107,9 @@
    done = 1;
    break;
    case SDL_MOUSEMOTION:

  •        SDL_SelectMouse(event.motion.which);        /* select 'mouse' (touch) that moved */
    
  •        mouse = SDL_SelectMouse(event.motion.which);        /* select 'mouse' (touch) that moved */
           state = SDL_GetMouseState(&x, &y);  /* get its location */
    
  •        SDL_GetRelativeMouseState(&dx, &dy);        /* find how much the mouse moved */
    
  •        SDL_GetRelativeMouseState(mouse, &dx, &dy);        /* find how much the mouse moved */
           if (state & SDL_BUTTON_LMASK) {     /* is the mouse (touch) down? */
               drawLine(x - dx, y - dy, dx, dy);       /* draw line segment */
               SDL_RenderPresent();
    


df

We’re actually going to revert the API change, so you won’t need this patch.

Thanks!On Tue, Jan 12, 2010 at 8:43 PM, Dean Fogarty wrote:

Patch for API change.

Index: Xcode-iPhoneOS/Demos/src/touch.c

— Xcode-iPhoneOS/Demos/src/touch.c ? ?(revision 5478)
+++ Xcode-iPhoneOS/Demos/src/touch.c ? ?(working copy)
@@ -79,6 +79,7 @@
? ? SDL_Event event;
? ? SDL_WindowID windowID; ? ? ?/* main window /
? ? int done; ? ? ? ? ? ? ? ? ? /
does user want to quit? */

  • ? ?int mouse;

? ? /* initialize SDL */
? ? if (SDL_Init(SDL_INIT_VIDEO) < 0) {
@@ -106,9 +107,9 @@
? ? ? ? ? ? done = 1;
? ? ? ? ? ? break;
? ? ? ? case SDL_MOUSEMOTION:

  • ? ? ? ? ? ?SDL_SelectMouse(event.motion.which); ? ? ? ?/* select ‘mouse’ (touch) that moved */
  • ? ? ? ? ? ?mouse = SDL_SelectMouse(event.motion.which); ? ? ? ?/* select ‘mouse’ (touch) that moved /
    ? ? ? ? ? ? state = SDL_GetMouseState(&x, &y); ?/
    get its location */
  • ? ? ? ? ? ?SDL_GetRelativeMouseState(&dx, &dy); ? ? ? ?/* find how much the mouse moved */
  • ? ? ? ? ? ?SDL_GetRelativeMouseState(mouse, &dx, &dy); ? ? ? ?/* find how much the mouse moved /
    ? ? ? ? ? ? if (state & SDL_BUTTON_LMASK) { ? ? /
    is the mouse (touch) down? /
    ? ? ? ? ? ? ? ? drawLine(x - dx, y - dy, dx, dy); ? ? ? /
    draw line segment */
    ? ? ? ? ? ? ? ? SDL_RenderPresent();


df


SDL mailing list
SDL at lists.libsdl.org
http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org


-Sam Lantinga, Founder and President, Galaxy Gameworks LLC