Updated iPhone keyboard code (which builds and runs on the iPad and iPhone simulator now)

Updated iPhone demos (which build and run again)
This commit is contained in:
Sam Lantinga 2010-07-07 18:58:51 -07:00
parent 2c5a878c4e
commit 99b869fe2e
10 changed files with 55 additions and 39 deletions

View file

@ -105,6 +105,13 @@
/* End PBXBuildFile section */
/* Begin PBXContainerItemProxy section */
04AB757011E563D200BE9753 /* PBXContainerItemProxy */ = {
isa = PBXContainerItemProxy;
containerPortal = FD1B48920E313154007AB34E /* SDLiPhoneOS.xcodeproj */;
proxyType = 2;
remoteGlobalIDString = 006E982211955059001DE610 /* testsdl.app */;
remoteInfo = testsdl;
};
FD1B489D0E313154007AB34E /* PBXContainerItemProxy */ = {
isa = PBXContainerItemProxy;
containerPortal = FD1B48920E313154007AB34E /* SDLiPhoneOS.xcodeproj */;
@ -318,6 +325,7 @@
isa = PBXGroup;
children = (
FD1B489E0E313154007AB34E /* libSDLiPhoneOS.a */,
04AB757111E563D200BE9753 /* testsdl.app */,
);
name = Products;
sourceTree = "<group>";
@ -523,6 +531,13 @@
/* End PBXProject section */
/* Begin PBXReferenceProxy section */
04AB757111E563D200BE9753 /* testsdl.app */ = {
isa = PBXReferenceProxy;
fileType = wrapper.application;
path = testsdl.app;
remoteRef = 04AB757011E563D200BE9753 /* PBXContainerItemProxy */;
sourceTree = BUILT_PRODUCTS_DIR;
};
FD1B489E0E313154007AB34E /* libSDLiPhoneOS.a */ = {
isa = PBXReferenceProxy;
fileType = archive.ar;
@ -731,7 +746,7 @@
OTHER_CFLAGS = "";
PREBINDING = NO;
PRELINK_LIBS = "";
SDKROOT = iphoneos2.0;
SDKROOT = iphoneos3.2;
};
name = Debug;
};
@ -749,7 +764,7 @@
OTHER_CFLAGS = "";
PREBINDING = NO;
PRELINK_LIBS = "";
SDKROOT = iphoneos2.0;
SDKROOT = iphoneos3.2;
};
name = Release;
};

View file

@ -430,9 +430,7 @@ main(int argc, char *argv[])
done = 1;
}
if (event.type == SDL_MOUSEBUTTONDOWN) {
int which = event.button.which;
int x, y;
SDL_SelectMouse(which);
SDL_GetMouseState(&x, &y);
spawnEmitterParticle(x, y);
}

View file

@ -124,10 +124,9 @@ handleMouseButtonDown(SDL_Event * event)
int x, y, mouseIndex, i, drumIndex;
mouseIndex = event->button.which;
mouseIndex = 0;
drumIndex = -1;
SDL_SelectMouse(mouseIndex);
SDL_GetMouseState(&x, &y);
/* check if we hit any of the drum buttons */
for (i = 0; i < NUM_DRUMS; i++) {
@ -153,7 +152,7 @@ void
handleMouseButtonUp(SDL_Event * event)
{
int i;
int mouseIndex = event->button.which;
int mouseIndex = 0;
/* check if this should cause any of the buttons to become unpressed */
for (i = 0; i < NUM_DRUMS; i++) {
if (buttons[i].touchIndex == mouseIndex) {

View file

@ -106,7 +106,6 @@ main(int argc, char *argv[])
done = 1;
break;
case SDL_MOUSEMOTION:
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 */
if (state & SDL_BUTTON_LMASK) { /* is the mouse (touch) down? */

View file

@ -287,6 +287,13 @@
/* End PBXBuildFile section */
/* Begin PBXContainerItemProxy section */
0466EE6F11E565E4000198A4 /* PBXContainerItemProxy */ = {
isa = PBXContainerItemProxy;
containerPortal = FD1B48AC0E3131CA007AB34E /* SDLiPhoneOS.xcodeproj */;
proxyType = 2;
remoteGlobalIDString = 006E982211955059001DE610 /* testsdl.app */;
remoteInfo = testsdl;
};
FD1B48B70E3131CA007AB34E /* PBXContainerItemProxy */ = {
isa = PBXContainerItemProxy;
containerPortal = FD1B48AC0E3131CA007AB34E /* SDLiPhoneOS.xcodeproj */;
@ -298,9 +305,7 @@
/* Begin PBXFileReference section */
1D6058910D05DD3D006BFB54 /* testwm2.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = testwm2.app; sourceTree = BUILT_PRODUCTS_DIR; };
56ED04F7118A8FCC00A56AA6 /* testpower-Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = "testpower-Info.plist"; sourceTree = "<group>"; };
56ED050D118A8FE400A56AA6 /* testpower.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = testpower.app; sourceTree = BUILT_PRODUCTS_DIR; };
56ED050F118A8FE400A56AA6 /* Info copy.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = "Info copy.plist"; sourceTree = "<group>"; };
56ED0510118A904200A56AA6 /* testpower.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = testpower.c; path = ../../test/testpower.c; sourceTree = SOURCE_ROOT; };
FD1B48AC0E3131CA007AB34E /* SDLiPhoneOS.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = SDLiPhoneOS.xcodeproj; path = ../SDL/SDLiPhoneOS.xcodeproj; sourceTree = SOURCE_ROOT; };
FDA8A7400E2D0F1600EA573E /* testalpha.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = testalpha.c; path = ../../test/testalpha.c; sourceTree = SOURCE_ROOT; };
@ -861,14 +866,11 @@
29B97314FDCFA39411CA2CEA /* CustomTemplate */ = {
isa = PBXGroup;
children = (
56ED0510118A904200A56AA6 /* testpower.c */,
FD1B48AC0E3131CA007AB34E /* SDLiPhoneOS.xcodeproj */,
FDA8AAD60E2D339A00EA573E /* Resources */,
FDA8A7C30E2D10FA00EA573E /* Linked Frameworks */,
FDA8A73B0E2D0F0400EA573E /* src */,
19C28FACFE9D520D11CA2CBB /* Products */,
56ED04F7118A8FCC00A56AA6 /* testpower-Info.plist */,
56ED050F118A8FE400A56AA6 /* Info copy.plist */,
);
name = CustomTemplate;
sourceTree = "<group>";
@ -877,6 +879,7 @@
isa = PBXGroup;
children = (
FD1B48B80E3131CA007AB34E /* libSDLiPhoneOS.a */,
0466EE7011E565E4000198A4 /* testsdl.app */,
);
name = Products;
sourceTree = "<group>";
@ -910,6 +913,7 @@
FDA8A7540E2D0F1600EA573E /* testoverlay2.c */,
FDA8A7550E2D0F1600EA573E /* testpalette.c */,
FDA8A7560E2D0F1600EA573E /* testplatform.c */,
56ED0510118A904200A56AA6 /* testpower.c */,
FDA8A7570E2D0F1600EA573E /* testsem.c */,
FDA8A7580E2D0F1600EA573E /* testsprite.c */,
FDA8A7590E2D0F1600EA573E /* testsprite2.c */,
@ -1502,6 +1506,13 @@
/* End PBXProject section */
/* Begin PBXReferenceProxy section */
0466EE7011E565E4000198A4 /* testsdl.app */ = {
isa = PBXReferenceProxy;
fileType = wrapper.application;
path = testsdl.app;
remoteRef = 0466EE6F11E565E4000198A4 /* PBXContainerItemProxy */;
sourceTree = BUILT_PRODUCTS_DIR;
};
FD1B48B80E3131CA007AB34E /* libSDLiPhoneOS.a */ = {
isa = PBXReferenceProxy;
fileType = archive.ar;
@ -2034,7 +2045,7 @@
ONLY_ACTIVE_ARCH = YES;
PREBINDING = NO;
"PROVISIONING_PROFILE[sdk=iphoneos*]" = "";
SDKROOT = iphoneos2.2.1;
SDKROOT = iphoneos3.2;
};
name = Debug;
};
@ -2049,7 +2060,7 @@
HEADER_SEARCH_PATHS = ../../include;
PREBINDING = NO;
"PROVISIONING_PROFILE[sdk=iphoneos*]" = "";
SDKROOT = iphoneos2.2.1;
SDKROOT = iphoneos3.2;
};
name = Release;
};