Mercurial > sdl-ios-xcode
comparison src/video/cocoa/SDL_cocoawindow.m @ 4675:641c13b0ce5f
Added better logging
author | Jim Grandpre <jim.tla@gmail.com> |
---|---|
date | Thu, 29 Jul 2010 12:26:59 -0400 |
parents | 89d5e2201b00 |
children | 99b4560b7aa1 |
comparison
equal
deleted
inserted
replaced
4674:89d5e2201b00 | 4675:641c13b0ce5f |
---|---|
297 NSEnumerator *enumerator = [touches objectEnumerator]; | 297 NSEnumerator *enumerator = [touches objectEnumerator]; |
298 NSTouch *touch = (NSTouch*)[enumerator nextObject]; | 298 NSTouch *touch = (NSTouch*)[enumerator nextObject]; |
299 while (touch) { | 299 while (touch) { |
300 long touchId = (long)[touch device]; | 300 long touchId = (long)[touch device]; |
301 if (!SDL_GetTouch(touchId)) { | 301 if (!SDL_GetTouch(touchId)) { |
302 printf("Adding touch: %i\n",touchId) | |
302 SDL_Touch touch; | 303 SDL_Touch touch; |
303 | 304 |
304 touch.id = touchId; | 305 touch.id = touchId; |
305 touch.x_min = 0; | 306 touch.x_min = 0; |
306 touch.x_max = 1; | 307 touch.x_max = 1; |
313 touch.pressureres = touch.pressure_max - touch.pressure_min; | 314 touch.pressureres = touch.pressure_max - touch.pressure_min; |
314 | 315 |
315 if (SDL_AddTouch(&touch, "") < 0) { | 316 if (SDL_AddTouch(&touch, "") < 0) { |
316 continue; | 317 continue; |
317 } | 318 } |
319 printf("Success, added touch: %i\n",touchId) | |
318 } | 320 } |
319 float x = [touch normalizedPosition].x; | 321 float x = [touch normalizedPosition].x; |
320 float y = [touch normalizedPosition].y; | 322 float y = [touch normalizedPosition].y; |
321 long fingerId = (long)[touch identity]; | 323 long fingerId = (long)[touch identity]; |
322 switch (type) { | 324 switch (type) { |