annotate src/video/uikit/SDL_uikitview.m @ 2403:e9a1eed243c9 gsoc2008_iphone

Added standard SDL header comments
author Holmes Futrell <hfutrell@umail.ucsb.edu>
date Tue, 22 Jul 2008 23:05:40 +0000
parents 07acabba25d9
children 3d0b3a7d3bea
rev   line source
2403
e9a1eed243c9 Added standard SDL header comments
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents: 2353
diff changeset
1 /*
e9a1eed243c9 Added standard SDL header comments
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents: 2353
diff changeset
2 SDL - Simple DirectMedia Layer
e9a1eed243c9 Added standard SDL header comments
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents: 2353
diff changeset
3 Copyright (C) 1997-2006 Sam Lantinga
e9a1eed243c9 Added standard SDL header comments
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents: 2353
diff changeset
4
e9a1eed243c9 Added standard SDL header comments
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents: 2353
diff changeset
5 This library is free software; you can redistribute it and/or
e9a1eed243c9 Added standard SDL header comments
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents: 2353
diff changeset
6 modify it under the terms of the GNU Lesser General Public
e9a1eed243c9 Added standard SDL header comments
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents: 2353
diff changeset
7 License as published by the Free Software Foundation; either
e9a1eed243c9 Added standard SDL header comments
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents: 2353
diff changeset
8 version 2.1 of the License, or (at your option) any later version.
e9a1eed243c9 Added standard SDL header comments
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents: 2353
diff changeset
9
e9a1eed243c9 Added standard SDL header comments
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents: 2353
diff changeset
10 This library is distributed in the hope that it will be useful,
e9a1eed243c9 Added standard SDL header comments
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents: 2353
diff changeset
11 but WITHOUT ANY WARRANTY; without even the implied warranty of
e9a1eed243c9 Added standard SDL header comments
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents: 2353
diff changeset
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
e9a1eed243c9 Added standard SDL header comments
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents: 2353
diff changeset
13 Lesser General Public License for more details.
e9a1eed243c9 Added standard SDL header comments
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents: 2353
diff changeset
14
e9a1eed243c9 Added standard SDL header comments
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents: 2353
diff changeset
15 You should have received a copy of the GNU Lesser General Public
e9a1eed243c9 Added standard SDL header comments
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents: 2353
diff changeset
16 License along with this library; if not, write to the Free Software
e9a1eed243c9 Added standard SDL header comments
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents: 2353
diff changeset
17 Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
e9a1eed243c9 Added standard SDL header comments
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents: 2353
diff changeset
18
e9a1eed243c9 Added standard SDL header comments
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents: 2353
diff changeset
19 Sam Lantinga
e9a1eed243c9 Added standard SDL header comments
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents: 2353
diff changeset
20 slouken@libsdl.org
e9a1eed243c9 Added standard SDL header comments
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents: 2353
diff changeset
21 */
2353
07acabba25d9 SDL_uikitview is just a generic view class which SDL_uikitopenglview inherits from. The functionality found in this class relates to (right now) mouse/touch input support. The reason for putting it here is that if someone wanted to write a render driver for iPhone based around CoreGraphics rather than OpenGL ES, they could make their Core Graphics view inherit from this class as well.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
22 #import "SDL_uikitview.h"
07acabba25d9 SDL_uikitview is just a generic view class which SDL_uikitopenglview inherits from. The functionality found in this class relates to (right now) mouse/touch input support. The reason for putting it here is that if someone wanted to write a render driver for iPhone based around CoreGraphics rather than OpenGL ES, they could make their Core Graphics view inherit from this class as well.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
23
07acabba25d9 SDL_uikitview is just a generic view class which SDL_uikitopenglview inherits from. The functionality found in this class relates to (right now) mouse/touch input support. The reason for putting it here is that if someone wanted to write a render driver for iPhone based around CoreGraphics rather than OpenGL ES, they could make their Core Graphics view inherit from this class as well.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
24 @implementation SDL_uikitview
07acabba25d9 SDL_uikitview is just a generic view class which SDL_uikitopenglview inherits from. The functionality found in this class relates to (right now) mouse/touch input support. The reason for putting it here is that if someone wanted to write a render driver for iPhone based around CoreGraphics rather than OpenGL ES, they could make their Core Graphics view inherit from this class as well.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
25
07acabba25d9 SDL_uikitview is just a generic view class which SDL_uikitopenglview inherits from. The functionality found in this class relates to (right now) mouse/touch input support. The reason for putting it here is that if someone wanted to write a render driver for iPhone based around CoreGraphics rather than OpenGL ES, they could make their Core Graphics view inherit from this class as well.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
26 - (void)dealloc {
07acabba25d9 SDL_uikitview is just a generic view class which SDL_uikitopenglview inherits from. The functionality found in this class relates to (right now) mouse/touch input support. The reason for putting it here is that if someone wanted to write a render driver for iPhone based around CoreGraphics rather than OpenGL ES, they could make their Core Graphics view inherit from this class as well.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
27 [super dealloc];
07acabba25d9 SDL_uikitview is just a generic view class which SDL_uikitopenglview inherits from. The functionality found in this class relates to (right now) mouse/touch input support. The reason for putting it here is that if someone wanted to write a render driver for iPhone based around CoreGraphics rather than OpenGL ES, they could make their Core Graphics view inherit from this class as well.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
28 }
07acabba25d9 SDL_uikitview is just a generic view class which SDL_uikitopenglview inherits from. The functionality found in this class relates to (right now) mouse/touch input support. The reason for putting it here is that if someone wanted to write a render driver for iPhone based around CoreGraphics rather than OpenGL ES, they could make their Core Graphics view inherit from this class as well.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
29
07acabba25d9 SDL_uikitview is just a generic view class which SDL_uikitopenglview inherits from. The functionality found in this class relates to (right now) mouse/touch input support. The reason for putting it here is that if someone wanted to write a render driver for iPhone based around CoreGraphics rather than OpenGL ES, they could make their Core Graphics view inherit from this class as well.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
30 - (id)initWithFrame:(CGRect)frame {
07acabba25d9 SDL_uikitview is just a generic view class which SDL_uikitopenglview inherits from. The functionality found in this class relates to (right now) mouse/touch input support. The reason for putting it here is that if someone wanted to write a render driver for iPhone based around CoreGraphics rather than OpenGL ES, they could make their Core Graphics view inherit from this class as well.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
31
07acabba25d9 SDL_uikitview is just a generic view class which SDL_uikitopenglview inherits from. The functionality found in this class relates to (right now) mouse/touch input support. The reason for putting it here is that if someone wanted to write a render driver for iPhone based around CoreGraphics rather than OpenGL ES, they could make their Core Graphics view inherit from this class as well.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
32 self = [super initWithFrame: frame];
07acabba25d9 SDL_uikitview is just a generic view class which SDL_uikitopenglview inherits from. The functionality found in this class relates to (right now) mouse/touch input support. The reason for putting it here is that if someone wanted to write a render driver for iPhone based around CoreGraphics rather than OpenGL ES, they could make their Core Graphics view inherit from this class as well.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
33
07acabba25d9 SDL_uikitview is just a generic view class which SDL_uikitopenglview inherits from. The functionality found in this class relates to (right now) mouse/touch input support. The reason for putting it here is that if someone wanted to write a render driver for iPhone based around CoreGraphics rather than OpenGL ES, they could make their Core Graphics view inherit from this class as well.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
34 int i;
07acabba25d9 SDL_uikitview is just a generic view class which SDL_uikitopenglview inherits from. The functionality found in this class relates to (right now) mouse/touch input support. The reason for putting it here is that if someone wanted to write a render driver for iPhone based around CoreGraphics rather than OpenGL ES, they could make their Core Graphics view inherit from this class as well.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
35 for (i=0; i<MAX_SIMULTANEOUS_TOUCHES; i++) {
07acabba25d9 SDL_uikitview is just a generic view class which SDL_uikitopenglview inherits from. The functionality found in this class relates to (right now) mouse/touch input support. The reason for putting it here is that if someone wanted to write a render driver for iPhone based around CoreGraphics rather than OpenGL ES, they could make their Core Graphics view inherit from this class as well.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
36 mice[i].driverdata = NULL;
07acabba25d9 SDL_uikitview is just a generic view class which SDL_uikitopenglview inherits from. The functionality found in this class relates to (right now) mouse/touch input support. The reason for putting it here is that if someone wanted to write a render driver for iPhone based around CoreGraphics rather than OpenGL ES, they could make their Core Graphics view inherit from this class as well.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
37 SDL_AddMouse(&(mice[i]), i);
07acabba25d9 SDL_uikitview is just a generic view class which SDL_uikitopenglview inherits from. The functionality found in this class relates to (right now) mouse/touch input support. The reason for putting it here is that if someone wanted to write a render driver for iPhone based around CoreGraphics rather than OpenGL ES, they could make their Core Graphics view inherit from this class as well.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
38 }
07acabba25d9 SDL_uikitview is just a generic view class which SDL_uikitopenglview inherits from. The functionality found in this class relates to (right now) mouse/touch input support. The reason for putting it here is that if someone wanted to write a render driver for iPhone based around CoreGraphics rather than OpenGL ES, they could make their Core Graphics view inherit from this class as well.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
39 self.multipleTouchEnabled = YES;
07acabba25d9 SDL_uikitview is just a generic view class which SDL_uikitopenglview inherits from. The functionality found in this class relates to (right now) mouse/touch input support. The reason for putting it here is that if someone wanted to write a render driver for iPhone based around CoreGraphics rather than OpenGL ES, they could make their Core Graphics view inherit from this class as well.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
40
07acabba25d9 SDL_uikitview is just a generic view class which SDL_uikitopenglview inherits from. The functionality found in this class relates to (right now) mouse/touch input support. The reason for putting it here is that if someone wanted to write a render driver for iPhone based around CoreGraphics rather than OpenGL ES, they could make their Core Graphics view inherit from this class as well.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
41 return self;
07acabba25d9 SDL_uikitview is just a generic view class which SDL_uikitopenglview inherits from. The functionality found in this class relates to (right now) mouse/touch input support. The reason for putting it here is that if someone wanted to write a render driver for iPhone based around CoreGraphics rather than OpenGL ES, they could make their Core Graphics view inherit from this class as well.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
42
07acabba25d9 SDL_uikitview is just a generic view class which SDL_uikitopenglview inherits from. The functionality found in this class relates to (right now) mouse/touch input support. The reason for putting it here is that if someone wanted to write a render driver for iPhone based around CoreGraphics rather than OpenGL ES, they could make their Core Graphics view inherit from this class as well.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
43 }
07acabba25d9 SDL_uikitview is just a generic view class which SDL_uikitopenglview inherits from. The functionality found in this class relates to (right now) mouse/touch input support. The reason for putting it here is that if someone wanted to write a render driver for iPhone based around CoreGraphics rather than OpenGL ES, they could make their Core Graphics view inherit from this class as well.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
44
07acabba25d9 SDL_uikitview is just a generic view class which SDL_uikitopenglview inherits from. The functionality found in this class relates to (right now) mouse/touch input support. The reason for putting it here is that if someone wanted to write a render driver for iPhone based around CoreGraphics rather than OpenGL ES, they could make their Core Graphics view inherit from this class as well.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
45 - (void)touchesBegan:(NSSet *)touches withEvent:(UIEvent *)event {
07acabba25d9 SDL_uikitview is just a generic view class which SDL_uikitopenglview inherits from. The functionality found in this class relates to (right now) mouse/touch input support. The reason for putting it here is that if someone wanted to write a render driver for iPhone based around CoreGraphics rather than OpenGL ES, they could make their Core Graphics view inherit from this class as well.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
46
07acabba25d9 SDL_uikitview is just a generic view class which SDL_uikitopenglview inherits from. The functionality found in this class relates to (right now) mouse/touch input support. The reason for putting it here is that if someone wanted to write a render driver for iPhone based around CoreGraphics rather than OpenGL ES, they could make their Core Graphics view inherit from this class as well.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
47 NSEnumerator *enumerator = [touches objectEnumerator];
07acabba25d9 SDL_uikitview is just a generic view class which SDL_uikitopenglview inherits from. The functionality found in this class relates to (right now) mouse/touch input support. The reason for putting it here is that if someone wanted to write a render driver for iPhone based around CoreGraphics rather than OpenGL ES, they could make their Core Graphics view inherit from this class as well.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
48 UITouch *touch=(UITouch*)[enumerator nextObject];
07acabba25d9 SDL_uikitview is just a generic view class which SDL_uikitopenglview inherits from. The functionality found in this class relates to (right now) mouse/touch input support. The reason for putting it here is that if someone wanted to write a render driver for iPhone based around CoreGraphics rather than OpenGL ES, they could make their Core Graphics view inherit from this class as well.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
49
07acabba25d9 SDL_uikitview is just a generic view class which SDL_uikitopenglview inherits from. The functionality found in this class relates to (right now) mouse/touch input support. The reason for putting it here is that if someone wanted to write a render driver for iPhone based around CoreGraphics rather than OpenGL ES, they could make their Core Graphics view inherit from this class as well.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
50 // associate touches with mice, so long as we have slots
07acabba25d9 SDL_uikitview is just a generic view class which SDL_uikitopenglview inherits from. The functionality found in this class relates to (right now) mouse/touch input support. The reason for putting it here is that if someone wanted to write a render driver for iPhone based around CoreGraphics rather than OpenGL ES, they could make their Core Graphics view inherit from this class as well.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
51 int i;
07acabba25d9 SDL_uikitview is just a generic view class which SDL_uikitopenglview inherits from. The functionality found in this class relates to (right now) mouse/touch input support. The reason for putting it here is that if someone wanted to write a render driver for iPhone based around CoreGraphics rather than OpenGL ES, they could make their Core Graphics view inherit from this class as well.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
52 int found = 0;
07acabba25d9 SDL_uikitview is just a generic view class which SDL_uikitopenglview inherits from. The functionality found in this class relates to (right now) mouse/touch input support. The reason for putting it here is that if someone wanted to write a render driver for iPhone based around CoreGraphics rather than OpenGL ES, they could make their Core Graphics view inherit from this class as well.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
53 for(i=0; touch && i < MAX_SIMULTANEOUS_TOUCHES; i++) {
07acabba25d9 SDL_uikitview is just a generic view class which SDL_uikitopenglview inherits from. The functionality found in this class relates to (right now) mouse/touch input support. The reason for putting it here is that if someone wanted to write a render driver for iPhone based around CoreGraphics rather than OpenGL ES, they could make their Core Graphics view inherit from this class as well.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
54
07acabba25d9 SDL_uikitview is just a generic view class which SDL_uikitopenglview inherits from. The functionality found in this class relates to (right now) mouse/touch input support. The reason for putting it here is that if someone wanted to write a render driver for iPhone based around CoreGraphics rather than OpenGL ES, they could make their Core Graphics view inherit from this class as well.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
55 // check if this mouse is already tracking a touch
07acabba25d9 SDL_uikitview is just a generic view class which SDL_uikitopenglview inherits from. The functionality found in this class relates to (right now) mouse/touch input support. The reason for putting it here is that if someone wanted to write a render driver for iPhone based around CoreGraphics rather than OpenGL ES, they could make their Core Graphics view inherit from this class as well.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
56 if (mice[i].driverdata != NULL) {
07acabba25d9 SDL_uikitview is just a generic view class which SDL_uikitopenglview inherits from. The functionality found in this class relates to (right now) mouse/touch input support. The reason for putting it here is that if someone wanted to write a render driver for iPhone based around CoreGraphics rather than OpenGL ES, they could make their Core Graphics view inherit from this class as well.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
57 continue;
07acabba25d9 SDL_uikitview is just a generic view class which SDL_uikitopenglview inherits from. The functionality found in this class relates to (right now) mouse/touch input support. The reason for putting it here is that if someone wanted to write a render driver for iPhone based around CoreGraphics rather than OpenGL ES, they could make their Core Graphics view inherit from this class as well.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
58 }
07acabba25d9 SDL_uikitview is just a generic view class which SDL_uikitopenglview inherits from. The functionality found in this class relates to (right now) mouse/touch input support. The reason for putting it here is that if someone wanted to write a render driver for iPhone based around CoreGraphics rather than OpenGL ES, they could make their Core Graphics view inherit from this class as well.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
59
07acabba25d9 SDL_uikitview is just a generic view class which SDL_uikitopenglview inherits from. The functionality found in this class relates to (right now) mouse/touch input support. The reason for putting it here is that if someone wanted to write a render driver for iPhone based around CoreGraphics rather than OpenGL ES, they could make their Core Graphics view inherit from this class as well.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
60 found = 1;
07acabba25d9 SDL_uikitview is just a generic view class which SDL_uikitopenglview inherits from. The functionality found in this class relates to (right now) mouse/touch input support. The reason for putting it here is that if someone wanted to write a render driver for iPhone based around CoreGraphics rather than OpenGL ES, they could make their Core Graphics view inherit from this class as well.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
61
07acabba25d9 SDL_uikitview is just a generic view class which SDL_uikitopenglview inherits from. The functionality found in this class relates to (right now) mouse/touch input support. The reason for putting it here is that if someone wanted to write a render driver for iPhone based around CoreGraphics rather than OpenGL ES, they could make their Core Graphics view inherit from this class as well.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
62 int oldMouse = SDL_SelectMouse(-1);
07acabba25d9 SDL_uikitview is just a generic view class which SDL_uikitopenglview inherits from. The functionality found in this class relates to (right now) mouse/touch input support. The reason for putting it here is that if someone wanted to write a render driver for iPhone based around CoreGraphics rather than OpenGL ES, they could make their Core Graphics view inherit from this class as well.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
63 SDL_SelectMouse(i);
07acabba25d9 SDL_uikitview is just a generic view class which SDL_uikitopenglview inherits from. The functionality found in this class relates to (right now) mouse/touch input support. The reason for putting it here is that if someone wanted to write a render driver for iPhone based around CoreGraphics rather than OpenGL ES, they could make their Core Graphics view inherit from this class as well.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
64 CGPoint locationInView = [touch locationInView: self];
07acabba25d9 SDL_uikitview is just a generic view class which SDL_uikitopenglview inherits from. The functionality found in this class relates to (right now) mouse/touch input support. The reason for putting it here is that if someone wanted to write a render driver for iPhone based around CoreGraphics rather than OpenGL ES, they could make their Core Graphics view inherit from this class as well.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
65 mice[i].driverdata = [touch retain];
07acabba25d9 SDL_uikitview is just a generic view class which SDL_uikitopenglview inherits from. The functionality found in this class relates to (right now) mouse/touch input support. The reason for putting it here is that if someone wanted to write a render driver for iPhone based around CoreGraphics rather than OpenGL ES, they could make their Core Graphics view inherit from this class as well.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
66 SDL_SendMouseMotion(i, 0, locationInView.x, locationInView.y);
07acabba25d9 SDL_uikitview is just a generic view class which SDL_uikitopenglview inherits from. The functionality found in this class relates to (right now) mouse/touch input support. The reason for putting it here is that if someone wanted to write a render driver for iPhone based around CoreGraphics rather than OpenGL ES, they could make their Core Graphics view inherit from this class as well.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
67 SDL_SendMouseButton(i, SDL_PRESSED, SDL_BUTTON_LEFT);
07acabba25d9 SDL_uikitview is just a generic view class which SDL_uikitopenglview inherits from. The functionality found in this class relates to (right now) mouse/touch input support. The reason for putting it here is that if someone wanted to write a render driver for iPhone based around CoreGraphics rather than OpenGL ES, they could make their Core Graphics view inherit from this class as well.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
68 SDL_GetRelativeMouseState(NULL, NULL);
07acabba25d9 SDL_uikitview is just a generic view class which SDL_uikitopenglview inherits from. The functionality found in this class relates to (right now) mouse/touch input support. The reason for putting it here is that if someone wanted to write a render driver for iPhone based around CoreGraphics rather than OpenGL ES, they could make their Core Graphics view inherit from this class as well.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
69 touch = (UITouch*)[enumerator nextObject];
07acabba25d9 SDL_uikitview is just a generic view class which SDL_uikitopenglview inherits from. The functionality found in this class relates to (right now) mouse/touch input support. The reason for putting it here is that if someone wanted to write a render driver for iPhone based around CoreGraphics rather than OpenGL ES, they could make their Core Graphics view inherit from this class as well.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
70
07acabba25d9 SDL_uikitview is just a generic view class which SDL_uikitopenglview inherits from. The functionality found in this class relates to (right now) mouse/touch input support. The reason for putting it here is that if someone wanted to write a render driver for iPhone based around CoreGraphics rather than OpenGL ES, they could make their Core Graphics view inherit from this class as well.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
71 SDL_SelectMouse(oldMouse);
07acabba25d9 SDL_uikitview is just a generic view class which SDL_uikitopenglview inherits from. The functionality found in this class relates to (right now) mouse/touch input support. The reason for putting it here is that if someone wanted to write a render driver for iPhone based around CoreGraphics rather than OpenGL ES, they could make their Core Graphics view inherit from this class as well.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
72
07acabba25d9 SDL_uikitview is just a generic view class which SDL_uikitopenglview inherits from. The functionality found in this class relates to (right now) mouse/touch input support. The reason for putting it here is that if someone wanted to write a render driver for iPhone based around CoreGraphics rather than OpenGL ES, they could make their Core Graphics view inherit from this class as well.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
73 }
07acabba25d9 SDL_uikitview is just a generic view class which SDL_uikitopenglview inherits from. The functionality found in this class relates to (right now) mouse/touch input support. The reason for putting it here is that if someone wanted to write a render driver for iPhone based around CoreGraphics rather than OpenGL ES, they could make their Core Graphics view inherit from this class as well.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
74 }
07acabba25d9 SDL_uikitview is just a generic view class which SDL_uikitopenglview inherits from. The functionality found in this class relates to (right now) mouse/touch input support. The reason for putting it here is that if someone wanted to write a render driver for iPhone based around CoreGraphics rather than OpenGL ES, they could make their Core Graphics view inherit from this class as well.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
75
07acabba25d9 SDL_uikitview is just a generic view class which SDL_uikitopenglview inherits from. The functionality found in this class relates to (right now) mouse/touch input support. The reason for putting it here is that if someone wanted to write a render driver for iPhone based around CoreGraphics rather than OpenGL ES, they could make their Core Graphics view inherit from this class as well.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
76 - (void)touchesEnded:(NSSet *)touches withEvent:(UIEvent *)event {
07acabba25d9 SDL_uikitview is just a generic view class which SDL_uikitopenglview inherits from. The functionality found in this class relates to (right now) mouse/touch input support. The reason for putting it here is that if someone wanted to write a render driver for iPhone based around CoreGraphics rather than OpenGL ES, they could make their Core Graphics view inherit from this class as well.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
77
07acabba25d9 SDL_uikitview is just a generic view class which SDL_uikitopenglview inherits from. The functionality found in this class relates to (right now) mouse/touch input support. The reason for putting it here is that if someone wanted to write a render driver for iPhone based around CoreGraphics rather than OpenGL ES, they could make their Core Graphics view inherit from this class as well.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
78 NSEnumerator *enumerator = [touches objectEnumerator];
07acabba25d9 SDL_uikitview is just a generic view class which SDL_uikitopenglview inherits from. The functionality found in this class relates to (right now) mouse/touch input support. The reason for putting it here is that if someone wanted to write a render driver for iPhone based around CoreGraphics rather than OpenGL ES, they could make their Core Graphics view inherit from this class as well.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
79 UITouch *touch=nil;
07acabba25d9 SDL_uikitview is just a generic view class which SDL_uikitopenglview inherits from. The functionality found in this class relates to (right now) mouse/touch input support. The reason for putting it here is that if someone wanted to write a render driver for iPhone based around CoreGraphics rather than OpenGL ES, they could make their Core Graphics view inherit from this class as well.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
80
07acabba25d9 SDL_uikitview is just a generic view class which SDL_uikitopenglview inherits from. The functionality found in this class relates to (right now) mouse/touch input support. The reason for putting it here is that if someone wanted to write a render driver for iPhone based around CoreGraphics rather than OpenGL ES, they could make their Core Graphics view inherit from this class as well.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
81 while(touch = (UITouch *)[enumerator nextObject]) {
07acabba25d9 SDL_uikitview is just a generic view class which SDL_uikitopenglview inherits from. The functionality found in this class relates to (right now) mouse/touch input support. The reason for putting it here is that if someone wanted to write a render driver for iPhone based around CoreGraphics rather than OpenGL ES, they could make their Core Graphics view inherit from this class as well.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
82 int i, found = NO;
07acabba25d9 SDL_uikitview is just a generic view class which SDL_uikitopenglview inherits from. The functionality found in this class relates to (right now) mouse/touch input support. The reason for putting it here is that if someone wanted to write a render driver for iPhone based around CoreGraphics rather than OpenGL ES, they could make their Core Graphics view inherit from this class as well.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
83 for (i=0; i<MAX_SIMULTANEOUS_TOUCHES && !found; i++) {
07acabba25d9 SDL_uikitview is just a generic view class which SDL_uikitopenglview inherits from. The functionality found in this class relates to (right now) mouse/touch input support. The reason for putting it here is that if someone wanted to write a render driver for iPhone based around CoreGraphics rather than OpenGL ES, they could make their Core Graphics view inherit from this class as well.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
84 if (mice[i].driverdata == touch) {
07acabba25d9 SDL_uikitview is just a generic view class which SDL_uikitopenglview inherits from. The functionality found in this class relates to (right now) mouse/touch input support. The reason for putting it here is that if someone wanted to write a render driver for iPhone based around CoreGraphics rather than OpenGL ES, they could make their Core Graphics view inherit from this class as well.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
85 [(UITouch*)(mice[i].driverdata) release];
07acabba25d9 SDL_uikitview is just a generic view class which SDL_uikitopenglview inherits from. The functionality found in this class relates to (right now) mouse/touch input support. The reason for putting it here is that if someone wanted to write a render driver for iPhone based around CoreGraphics rather than OpenGL ES, they could make their Core Graphics view inherit from this class as well.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
86 mice[i].driverdata = NULL;
07acabba25d9 SDL_uikitview is just a generic view class which SDL_uikitopenglview inherits from. The functionality found in this class relates to (right now) mouse/touch input support. The reason for putting it here is that if someone wanted to write a render driver for iPhone based around CoreGraphics rather than OpenGL ES, they could make their Core Graphics view inherit from this class as well.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
87 SDL_SendMouseButton(i, SDL_RELEASED, SDL_BUTTON_LEFT);
07acabba25d9 SDL_uikitview is just a generic view class which SDL_uikitopenglview inherits from. The functionality found in this class relates to (right now) mouse/touch input support. The reason for putting it here is that if someone wanted to write a render driver for iPhone based around CoreGraphics rather than OpenGL ES, they could make their Core Graphics view inherit from this class as well.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
88
07acabba25d9 SDL_uikitview is just a generic view class which SDL_uikitopenglview inherits from. The functionality found in this class relates to (right now) mouse/touch input support. The reason for putting it here is that if someone wanted to write a render driver for iPhone based around CoreGraphics rather than OpenGL ES, they could make their Core Graphics view inherit from this class as well.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
89 found = YES;
07acabba25d9 SDL_uikitview is just a generic view class which SDL_uikitopenglview inherits from. The functionality found in this class relates to (right now) mouse/touch input support. The reason for putting it here is that if someone wanted to write a render driver for iPhone based around CoreGraphics rather than OpenGL ES, they could make their Core Graphics view inherit from this class as well.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
90 }
07acabba25d9 SDL_uikitview is just a generic view class which SDL_uikitopenglview inherits from. The functionality found in this class relates to (right now) mouse/touch input support. The reason for putting it here is that if someone wanted to write a render driver for iPhone based around CoreGraphics rather than OpenGL ES, they could make their Core Graphics view inherit from this class as well.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
91 }
07acabba25d9 SDL_uikitview is just a generic view class which SDL_uikitopenglview inherits from. The functionality found in this class relates to (right now) mouse/touch input support. The reason for putting it here is that if someone wanted to write a render driver for iPhone based around CoreGraphics rather than OpenGL ES, they could make their Core Graphics view inherit from this class as well.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
92 }
07acabba25d9 SDL_uikitview is just a generic view class which SDL_uikitopenglview inherits from. The functionality found in this class relates to (right now) mouse/touch input support. The reason for putting it here is that if someone wanted to write a render driver for iPhone based around CoreGraphics rather than OpenGL ES, they could make their Core Graphics view inherit from this class as well.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
93 }
07acabba25d9 SDL_uikitview is just a generic view class which SDL_uikitopenglview inherits from. The functionality found in this class relates to (right now) mouse/touch input support. The reason for putting it here is that if someone wanted to write a render driver for iPhone based around CoreGraphics rather than OpenGL ES, they could make their Core Graphics view inherit from this class as well.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
94
07acabba25d9 SDL_uikitview is just a generic view class which SDL_uikitopenglview inherits from. The functionality found in this class relates to (right now) mouse/touch input support. The reason for putting it here is that if someone wanted to write a render driver for iPhone based around CoreGraphics rather than OpenGL ES, they could make their Core Graphics view inherit from this class as well.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
95 - (void)touchesCancelled:(NSSet *)touches withEvent:(UIEvent *)event {
07acabba25d9 SDL_uikitview is just a generic view class which SDL_uikitopenglview inherits from. The functionality found in this class relates to (right now) mouse/touch input support. The reason for putting it here is that if someone wanted to write a render driver for iPhone based around CoreGraphics rather than OpenGL ES, they could make their Core Graphics view inherit from this class as well.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
96 /*
07acabba25d9 SDL_uikitview is just a generic view class which SDL_uikitopenglview inherits from. The functionality found in this class relates to (right now) mouse/touch input support. The reason for putting it here is that if someone wanted to write a render driver for iPhone based around CoreGraphics rather than OpenGL ES, they could make their Core Graphics view inherit from this class as well.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
97 this can happen if the user puts more than 5 touches on the screen
07acabba25d9 SDL_uikitview is just a generic view class which SDL_uikitopenglview inherits from. The functionality found in this class relates to (right now) mouse/touch input support. The reason for putting it here is that if someone wanted to write a render driver for iPhone based around CoreGraphics rather than OpenGL ES, they could make their Core Graphics view inherit from this class as well.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
98 at once, or perhaps in other circumstances. Usually all active
07acabba25d9 SDL_uikitview is just a generic view class which SDL_uikitopenglview inherits from. The functionality found in this class relates to (right now) mouse/touch input support. The reason for putting it here is that if someone wanted to write a render driver for iPhone based around CoreGraphics rather than OpenGL ES, they could make their Core Graphics view inherit from this class as well.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
99 touches are canceled.
07acabba25d9 SDL_uikitview is just a generic view class which SDL_uikitopenglview inherits from. The functionality found in this class relates to (right now) mouse/touch input support. The reason for putting it here is that if someone wanted to write a render driver for iPhone based around CoreGraphics rather than OpenGL ES, they could make their Core Graphics view inherit from this class as well.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
100 */
07acabba25d9 SDL_uikitview is just a generic view class which SDL_uikitopenglview inherits from. The functionality found in this class relates to (right now) mouse/touch input support. The reason for putting it here is that if someone wanted to write a render driver for iPhone based around CoreGraphics rather than OpenGL ES, they could make their Core Graphics view inherit from this class as well.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
101 [self touchesEnded: touches withEvent: event];
07acabba25d9 SDL_uikitview is just a generic view class which SDL_uikitopenglview inherits from. The functionality found in this class relates to (right now) mouse/touch input support. The reason for putting it here is that if someone wanted to write a render driver for iPhone based around CoreGraphics rather than OpenGL ES, they could make their Core Graphics view inherit from this class as well.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
102 }
07acabba25d9 SDL_uikitview is just a generic view class which SDL_uikitopenglview inherits from. The functionality found in this class relates to (right now) mouse/touch input support. The reason for putting it here is that if someone wanted to write a render driver for iPhone based around CoreGraphics rather than OpenGL ES, they could make their Core Graphics view inherit from this class as well.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
103
07acabba25d9 SDL_uikitview is just a generic view class which SDL_uikitopenglview inherits from. The functionality found in this class relates to (right now) mouse/touch input support. The reason for putting it here is that if someone wanted to write a render driver for iPhone based around CoreGraphics rather than OpenGL ES, they could make their Core Graphics view inherit from this class as well.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
104 - (void)touchesMoved:(NSSet *)touches withEvent:(UIEvent *)event {
07acabba25d9 SDL_uikitview is just a generic view class which SDL_uikitopenglview inherits from. The functionality found in this class relates to (right now) mouse/touch input support. The reason for putting it here is that if someone wanted to write a render driver for iPhone based around CoreGraphics rather than OpenGL ES, they could make their Core Graphics view inherit from this class as well.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
105
07acabba25d9 SDL_uikitview is just a generic view class which SDL_uikitopenglview inherits from. The functionality found in this class relates to (right now) mouse/touch input support. The reason for putting it here is that if someone wanted to write a render driver for iPhone based around CoreGraphics rather than OpenGL ES, they could make their Core Graphics view inherit from this class as well.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
106 NSEnumerator *enumerator = [touches objectEnumerator];
07acabba25d9 SDL_uikitview is just a generic view class which SDL_uikitopenglview inherits from. The functionality found in this class relates to (right now) mouse/touch input support. The reason for putting it here is that if someone wanted to write a render driver for iPhone based around CoreGraphics rather than OpenGL ES, they could make their Core Graphics view inherit from this class as well.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
107 UITouch *touch=nil;
07acabba25d9 SDL_uikitview is just a generic view class which SDL_uikitopenglview inherits from. The functionality found in this class relates to (right now) mouse/touch input support. The reason for putting it here is that if someone wanted to write a render driver for iPhone based around CoreGraphics rather than OpenGL ES, they could make their Core Graphics view inherit from this class as well.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
108
07acabba25d9 SDL_uikitview is just a generic view class which SDL_uikitopenglview inherits from. The functionality found in this class relates to (right now) mouse/touch input support. The reason for putting it here is that if someone wanted to write a render driver for iPhone based around CoreGraphics rather than OpenGL ES, they could make their Core Graphics view inherit from this class as well.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
109 while(touch = (UITouch *)[enumerator nextObject]) {
07acabba25d9 SDL_uikitview is just a generic view class which SDL_uikitopenglview inherits from. The functionality found in this class relates to (right now) mouse/touch input support. The reason for putting it here is that if someone wanted to write a render driver for iPhone based around CoreGraphics rather than OpenGL ES, they could make their Core Graphics view inherit from this class as well.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
110 int i, found = NO;
07acabba25d9 SDL_uikitview is just a generic view class which SDL_uikitopenglview inherits from. The functionality found in this class relates to (right now) mouse/touch input support. The reason for putting it here is that if someone wanted to write a render driver for iPhone based around CoreGraphics rather than OpenGL ES, they could make their Core Graphics view inherit from this class as well.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
111 for (i=0; i<MAX_SIMULTANEOUS_TOUCHES && !found; i++) {
07acabba25d9 SDL_uikitview is just a generic view class which SDL_uikitopenglview inherits from. The functionality found in this class relates to (right now) mouse/touch input support. The reason for putting it here is that if someone wanted to write a render driver for iPhone based around CoreGraphics rather than OpenGL ES, they could make their Core Graphics view inherit from this class as well.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
112 if (mice[i].driverdata == touch) {
07acabba25d9 SDL_uikitview is just a generic view class which SDL_uikitopenglview inherits from. The functionality found in this class relates to (right now) mouse/touch input support. The reason for putting it here is that if someone wanted to write a render driver for iPhone based around CoreGraphics rather than OpenGL ES, they could make their Core Graphics view inherit from this class as well.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
113 CGPoint locationInView = [touch locationInView: self];
07acabba25d9 SDL_uikitview is just a generic view class which SDL_uikitopenglview inherits from. The functionality found in this class relates to (right now) mouse/touch input support. The reason for putting it here is that if someone wanted to write a render driver for iPhone based around CoreGraphics rather than OpenGL ES, they could make their Core Graphics view inherit from this class as well.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
114 SDL_SendMouseMotion(i, 0, locationInView.x, locationInView.y);
07acabba25d9 SDL_uikitview is just a generic view class which SDL_uikitopenglview inherits from. The functionality found in this class relates to (right now) mouse/touch input support. The reason for putting it here is that if someone wanted to write a render driver for iPhone based around CoreGraphics rather than OpenGL ES, they could make their Core Graphics view inherit from this class as well.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
115 found = YES;
07acabba25d9 SDL_uikitview is just a generic view class which SDL_uikitopenglview inherits from. The functionality found in this class relates to (right now) mouse/touch input support. The reason for putting it here is that if someone wanted to write a render driver for iPhone based around CoreGraphics rather than OpenGL ES, they could make their Core Graphics view inherit from this class as well.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
116 }
07acabba25d9 SDL_uikitview is just a generic view class which SDL_uikitopenglview inherits from. The functionality found in this class relates to (right now) mouse/touch input support. The reason for putting it here is that if someone wanted to write a render driver for iPhone based around CoreGraphics rather than OpenGL ES, they could make their Core Graphics view inherit from this class as well.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
117 }
07acabba25d9 SDL_uikitview is just a generic view class which SDL_uikitopenglview inherits from. The functionality found in this class relates to (right now) mouse/touch input support. The reason for putting it here is that if someone wanted to write a render driver for iPhone based around CoreGraphics rather than OpenGL ES, they could make their Core Graphics view inherit from this class as well.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
118 }
07acabba25d9 SDL_uikitview is just a generic view class which SDL_uikitopenglview inherits from. The functionality found in this class relates to (right now) mouse/touch input support. The reason for putting it here is that if someone wanted to write a render driver for iPhone based around CoreGraphics rather than OpenGL ES, they could make their Core Graphics view inherit from this class as well.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
119 }
07acabba25d9 SDL_uikitview is just a generic view class which SDL_uikitopenglview inherits from. The functionality found in this class relates to (right now) mouse/touch input support. The reason for putting it here is that if someone wanted to write a render driver for iPhone based around CoreGraphics rather than OpenGL ES, they could make their Core Graphics view inherit from this class as well.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
120
07acabba25d9 SDL_uikitview is just a generic view class which SDL_uikitopenglview inherits from. The functionality found in this class relates to (right now) mouse/touch input support. The reason for putting it here is that if someone wanted to write a render driver for iPhone based around CoreGraphics rather than OpenGL ES, they could make their Core Graphics view inherit from this class as well.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
121 @end