diff --git a/cocos2dx/platform/mac/CCAccelerometer.h b/cocos2dx/platform/mac/CCAccelerometer.h index 79e2e8ad61..0603a98a1e 100755 --- a/cocos2dx/platform/mac/CCAccelerometer.h +++ b/cocos2dx/platform/mac/CCAccelerometer.h @@ -25,7 +25,7 @@ THE SOFTWARE. #ifndef __PLATFORM_MAC_CCACCELEROMETER_H__ #define __PLATFORM_MAC_CCACCELEROMETER_H__ -#include "CCAccelerometerDelegate.h" +#include "platform/CCAccelerometerDelegate.h" namespace cocos2d { diff --git a/cocos2dx/platform/mac/CCThread.mm b/cocos2dx/platform/mac/CCThread.mm new file mode 100644 index 0000000000..76073c1d54 --- /dev/null +++ b/cocos2dx/platform/mac/CCThread.mm @@ -0,0 +1,39 @@ +/**************************************************************************** +Copyright (c) 2010 cocos2d-x.org + +http://www.cocos2d-x.org + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. +****************************************************************************/ + +#include "CCThread.h" + +NS_CC_BEGIN + +CCThread::~CCThread() +{ + [(id)m_pAutoreasePool release]; +} + +void CCThread::createAutoreleasePool() +{ + m_pAutoreasePool = [[NSAutoreleasePool alloc] init]; +} + +NS_CC_END diff --git a/cocos2dx/proj.mac/cocos2dx-Prefix.pch b/cocos2dx/proj.mac/cocos2dx-Prefix.pch new file mode 100644 index 0000000000..fec5647078 --- /dev/null +++ b/cocos2dx/proj.mac/cocos2dx-Prefix.pch @@ -0,0 +1,7 @@ +// +// Prefix header for all source files of the 'cocos2dx' target in the 'cocos2dx' project +// + +#ifdef __OBJC__ + #import +#endif diff --git a/cocos2dx/proj.mac/cocos2dx.xcodeproj/project.pbxproj.REMOVED.git-id b/cocos2dx/proj.mac/cocos2dx.xcodeproj/project.pbxproj.REMOVED.git-id new file mode 100644 index 0000000000..26b4abbb07 --- /dev/null +++ b/cocos2dx/proj.mac/cocos2dx.xcodeproj/project.pbxproj.REMOVED.git-id @@ -0,0 +1 @@ +54b6c3a43a3d5777e1aeb75489ad3d86eacf489a \ No newline at end of file diff --git a/samples/HelloCpp/proj.mac/AppController.h b/samples/HelloCpp/proj.mac/AppController.h new file mode 100644 index 0000000000..d671ffdc23 --- /dev/null +++ b/samples/HelloCpp/proj.mac/AppController.h @@ -0,0 +1,42 @@ +/**************************************************************************** + Copyright (c) 2010 cocos2d-x.org + + http://www.cocos2d-x.org + + Permission is hereby granted, free of charge, to any person obtaining a copy + of this software and associated documentation files (the "Software"), to deal + in the Software without restriction, including without limitation the rights + to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + copies of the Software, and to permit persons to whom the Software is + furnished to do so, subject to the following conditions: + + The above copyright notice and this permission notice shall be included in + all copies or substantial portions of the Software. + + THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + THE SOFTWARE. + ****************************************************************************/ + +#pragma once + +#import "cocos2d.h" +#import "EAGLView.h" + +@interface AppController : NSObject + { + NSWindow *window; + EAGLView *glView; + } + + @property (nonatomic, assign) IBOutlet NSWindow* window; + @property (nonatomic, assign) IBOutlet EAGLView* glView; + + -(IBAction) toggleFullScreen:(id)sender; + -(IBAction) exitFullScreen:(id)sender; + +@end diff --git a/samples/HelloCpp/proj.mac/AppController.mm b/samples/HelloCpp/proj.mac/AppController.mm new file mode 100644 index 0000000000..b087c46c9c --- /dev/null +++ b/samples/HelloCpp/proj.mac/AppController.mm @@ -0,0 +1,86 @@ +/**************************************************************************** + Copyright (c) 2010 cocos2d-x.org + + http://www.cocos2d-x.org + + Permission is hereby granted, free of charge, to any person obtaining a copy + of this software and associated documentation files (the "Software"), to deal + in the Software without restriction, including without limitation the rights + to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + copies of the Software, and to permit persons to whom the Software is + furnished to do so, subject to the following conditions: + + The above copyright notice and this permission notice shall be included in + all copies or substantial portions of the Software. + + THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + THE SOFTWARE. + ****************************************************************************/ + +#import "AppController.h" +#import "AppDelegate.h" + +@implementation AppController + + static AppDelegate s_sharedApplication; + + @synthesize window, glView; + + -(void) applicationDidFinishLaunching:(NSNotification *)aNotification + { + // create the window + // note that using NSResizableWindowMask causes the window to be a little + // smaller and therefore ipad graphics are not loaded + NSRect rect = NSMakeRect(200, 200, 480, 320); + window = [[NSWindow alloc] initWithContentRect:rect + styleMask:( NSClosableWindowMask | NSTitledWindowMask ) + backing:NSBackingStoreBuffered + defer:YES]; + + // allocate our GL view + // (isn't there already a shared EAGLView?) + glView = [[EAGLView alloc] initWithFrame:rect]; + [glView initWithFrame:rect]; + + // set window parameters + [window becomeFirstResponder]; + [window setContentView:glView]; + [window setTitle:@"HelloCpp"]; + [window makeKeyAndOrderFront:self]; + [window setAcceptsMouseMovedEvents:NO]; + + // set cocos2d-x's opengl view + cocos2d::CCApplication::sharedApplication().run(); + } + + -(BOOL) applicationShouldTerminateAfterLastWindowClosed:(NSApplication*)theApplication + { + return YES; + } + + -(void) dealloc + { + cocos2d::CCDirector::sharedDirector()->end(); + [super dealloc]; + } + +#pragma mark - +#pragma mark IB Actions + + -(IBAction) toggleFullScreen:(id)sender + { + EAGLView* pView = [EAGLView sharedEGLView]; + [pView setFullScreen:!pView.isFullScreen]; + } + + -(IBAction) exitFullScreen:(id)sender + { + [[EAGLView sharedEGLView] setFullScreen:NO]; + } + +@end diff --git a/samples/HelloCpp/proj.mac/HelloCpp.xcodeproj/project.pbxproj b/samples/HelloCpp/proj.mac/HelloCpp.xcodeproj/project.pbxproj new file mode 100644 index 0000000000..a96ea9c02b --- /dev/null +++ b/samples/HelloCpp/proj.mac/HelloCpp.xcodeproj/project.pbxproj @@ -0,0 +1,462 @@ +// !$*UTF8*$! +{ + archiveVersion = 1; + classes = { + }; + objectVersion = 46; + objects = { + +/* Begin PBXBuildFile section */ + 41BC70AD15BF7CCE006A0A6C /* Icon.icns in Resources */ = {isa = PBXBuildFile; fileRef = 41BC70AC15BF7CCE006A0A6C /* Icon.icns */; }; + 41BC70B715BF7E14006A0A6C /* libcocos2dx.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 41CD6C5C15BF74E5005E6F29 /* libcocos2dx.a */; }; + 41CD6C6515BF7574005E6F29 /* AppController.mm in Sources */ = {isa = PBXBuildFile; fileRef = 41CD6C6315BF7574005E6F29 /* AppController.mm */; }; + 41CD6C6615BF7574005E6F29 /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 41CD6C6415BF7574005E6F29 /* main.m */; }; + 41CD6C6E15BF7673005E6F29 /* InfoPlist.strings in Resources */ = {isa = PBXBuildFile; fileRef = 41CD6C6815BF7673005E6F29 /* InfoPlist.strings */; }; + 41CD6C6F15BF7673005E6F29 /* MainMenu.xib in Resources */ = {isa = PBXBuildFile; fileRef = 41CD6C6A15BF7673005E6F29 /* MainMenu.xib */; }; + 41CD6C7515BF76FB005E6F29 /* AppDelegate.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 41CD6C7115BF76FB005E6F29 /* AppDelegate.cpp */; }; + 41CD6C7615BF76FB005E6F29 /* HelloWorldScene.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 41CD6C7315BF76FB005E6F29 /* HelloWorldScene.cpp */; }; + 41CD6C7D15BF7708005E6F29 /* CloseNormal.png in Resources */ = {isa = PBXBuildFile; fileRef = 41CD6C7715BF7708005E6F29 /* CloseNormal.png */; }; + 41CD6C7E15BF7708005E6F29 /* CloseSelected.png in Resources */ = {isa = PBXBuildFile; fileRef = 41CD6C7815BF7708005E6F29 /* CloseSelected.png */; }; + 41CD6C7F15BF7708005E6F29 /* fps_images-hd.png in Resources */ = {isa = PBXBuildFile; fileRef = 41CD6C7915BF7708005E6F29 /* fps_images-hd.png */; }; + 41CD6C8015BF7708005E6F29 /* fps_images-ipadhd.png in Resources */ = {isa = PBXBuildFile; fileRef = 41CD6C7A15BF7708005E6F29 /* fps_images-ipadhd.png */; }; + 41CD6C8115BF7708005E6F29 /* fps_images.png in Resources */ = {isa = PBXBuildFile; fileRef = 41CD6C7B15BF7708005E6F29 /* fps_images.png */; }; + 41CD6C8215BF7708005E6F29 /* HelloWorld.png in Resources */ = {isa = PBXBuildFile; fileRef = 41CD6C7C15BF7708005E6F29 /* HelloWorld.png */; }; + 41CD6C8F15BF7793005E6F29 /* AppKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 41CD6C8715BF7793005E6F29 /* AppKit.framework */; }; + 41CD6C9015BF7793005E6F29 /* AudioToolbox.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 41CD6C8815BF7793005E6F29 /* AudioToolbox.framework */; }; + 41CD6C9115BF7793005E6F29 /* Cocoa.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 41CD6C8915BF7793005E6F29 /* Cocoa.framework */; }; + 41CD6C9215BF7793005E6F29 /* CoreFoundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 41CD6C8A15BF7793005E6F29 /* CoreFoundation.framework */; }; + 41CD6C9315BF7793005E6F29 /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 41CD6C8B15BF7793005E6F29 /* Foundation.framework */; }; + 41CD6C9415BF7793005E6F29 /* OpenAL.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 41CD6C8C15BF7793005E6F29 /* OpenAL.framework */; }; + 41CD6C9515BF7793005E6F29 /* OpenGL.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 41CD6C8D15BF7793005E6F29 /* OpenGL.framework */; }; + 41CD6C9615BF7793005E6F29 /* QuartzCore.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 41CD6C8E15BF7793005E6F29 /* QuartzCore.framework */; }; + 41CD6C9915BF77CE005E6F29 /* libxml2.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = 41CD6C9715BF77CE005E6F29 /* libxml2.dylib */; }; + 41CD6C9A15BF77CE005E6F29 /* libz.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = 41CD6C9815BF77CE005E6F29 /* libz.dylib */; }; +/* End PBXBuildFile section */ + +/* Begin PBXContainerItemProxy section */ + 41CD6C5B15BF74E5005E6F29 /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = 41CD6C5415BF74E5005E6F29 /* cocos2dx.xcodeproj */; + proxyType = 2; + remoteGlobalIDString = 1551A33F158F2AB200E66CFE; + remoteInfo = cocos2dx; + }; + 41EFC1B915BF79BD0083EA95 /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = 41CD6C5415BF74E5005E6F29 /* cocos2dx.xcodeproj */; + proxyType = 1; + remoteGlobalIDString = 1551A33E158F2AB200E66CFE; + remoteInfo = cocos2dx; + }; +/* End PBXContainerItemProxy section */ + +/* Begin PBXFileReference section */ + 41BC70AC15BF7CCE006A0A6C /* Icon.icns */ = {isa = PBXFileReference; lastKnownFileType = image.icns; path = Icon.icns; sourceTree = ""; }; + 41CD6C5115BF748C005E6F29 /* HelloCpp.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = HelloCpp.app; sourceTree = BUILT_PRODUCTS_DIR; }; + 41CD6C5415BF74E5005E6F29 /* cocos2dx.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = cocos2dx.xcodeproj; path = ../../../cocos2dx/proj.mac/cocos2dx.xcodeproj; sourceTree = ""; }; + 41CD6C6215BF7574005E6F29 /* AppController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = AppController.h; sourceTree = ""; }; + 41CD6C6315BF7574005E6F29 /* AppController.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = AppController.mm; sourceTree = ""; }; + 41CD6C6415BF7574005E6F29 /* main.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = ""; }; + 41CD6C6915BF7673005E6F29 /* en */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = en; path = InfoPlist.strings; sourceTree = ""; }; + 41CD6C6B15BF7673005E6F29 /* en */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = en; path = MainMenu.xib; sourceTree = ""; }; + 41CD6C6C15BF7673005E6F29 /* HelloCpp_Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; path = HelloCpp_Info.plist; sourceTree = ""; }; + 41CD6C6D15BF7673005E6F29 /* HelloCpp_Prefix.pch */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = HelloCpp_Prefix.pch; sourceTree = ""; }; + 41CD6C7115BF76FB005E6F29 /* AppDelegate.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = AppDelegate.cpp; path = ../Classes/AppDelegate.cpp; sourceTree = ""; }; + 41CD6C7215BF76FB005E6F29 /* AppDelegate.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = AppDelegate.h; path = ../Classes/AppDelegate.h; sourceTree = ""; }; + 41CD6C7315BF76FB005E6F29 /* HelloWorldScene.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = HelloWorldScene.cpp; path = ../Classes/HelloWorldScene.cpp; sourceTree = ""; }; + 41CD6C7415BF76FB005E6F29 /* HelloWorldScene.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = HelloWorldScene.h; path = ../Classes/HelloWorldScene.h; sourceTree = ""; }; + 41CD6C7715BF7708005E6F29 /* CloseNormal.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = CloseNormal.png; path = ../Resources/CloseNormal.png; sourceTree = ""; }; + 41CD6C7815BF7708005E6F29 /* CloseSelected.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = CloseSelected.png; path = ../Resources/CloseSelected.png; sourceTree = ""; }; + 41CD6C7915BF7708005E6F29 /* fps_images-hd.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = "fps_images-hd.png"; path = "../Resources/fps_images-hd.png"; sourceTree = ""; }; + 41CD6C7A15BF7708005E6F29 /* fps_images-ipadhd.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = "fps_images-ipadhd.png"; path = "../Resources/fps_images-ipadhd.png"; sourceTree = ""; }; + 41CD6C7B15BF7708005E6F29 /* fps_images.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = fps_images.png; path = ../Resources/fps_images.png; sourceTree = ""; }; + 41CD6C7C15BF7708005E6F29 /* HelloWorld.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = HelloWorld.png; path = ../Resources/HelloWorld.png; sourceTree = ""; }; + 41CD6C8715BF7793005E6F29 /* AppKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = AppKit.framework; path = System/Library/Frameworks/AppKit.framework; sourceTree = SDKROOT; }; + 41CD6C8815BF7793005E6F29 /* AudioToolbox.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = AudioToolbox.framework; path = System/Library/Frameworks/AudioToolbox.framework; sourceTree = SDKROOT; }; + 41CD6C8915BF7793005E6F29 /* Cocoa.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Cocoa.framework; path = System/Library/Frameworks/Cocoa.framework; sourceTree = SDKROOT; }; + 41CD6C8A15BF7793005E6F29 /* CoreFoundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreFoundation.framework; path = System/Library/Frameworks/CoreFoundation.framework; sourceTree = SDKROOT; }; + 41CD6C8B15BF7793005E6F29 /* Foundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Foundation.framework; path = System/Library/Frameworks/Foundation.framework; sourceTree = SDKROOT; }; + 41CD6C8C15BF7793005E6F29 /* OpenAL.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = OpenAL.framework; path = System/Library/Frameworks/OpenAL.framework; sourceTree = SDKROOT; }; + 41CD6C8D15BF7793005E6F29 /* OpenGL.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = OpenGL.framework; path = System/Library/Frameworks/OpenGL.framework; sourceTree = SDKROOT; }; + 41CD6C8E15BF7793005E6F29 /* QuartzCore.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = QuartzCore.framework; path = System/Library/Frameworks/QuartzCore.framework; sourceTree = SDKROOT; }; + 41CD6C9715BF77CE005E6F29 /* libxml2.dylib */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.dylib"; name = libxml2.dylib; path = usr/lib/libxml2.dylib; sourceTree = SDKROOT; }; + 41CD6C9815BF77CE005E6F29 /* libz.dylib */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.dylib"; name = libz.dylib; path = usr/lib/libz.dylib; sourceTree = SDKROOT; }; +/* End PBXFileReference section */ + +/* Begin PBXFrameworksBuildPhase section */ + 41851B8F15B93C32004083E9 /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + 41CD6C8F15BF7793005E6F29 /* AppKit.framework in Frameworks */, + 41CD6C9015BF7793005E6F29 /* AudioToolbox.framework in Frameworks */, + 41CD6C9115BF7793005E6F29 /* Cocoa.framework in Frameworks */, + 41CD6C9215BF7793005E6F29 /* CoreFoundation.framework in Frameworks */, + 41CD6C9315BF7793005E6F29 /* Foundation.framework in Frameworks */, + 41CD6C9415BF7793005E6F29 /* OpenAL.framework in Frameworks */, + 41CD6C9515BF7793005E6F29 /* OpenGL.framework in Frameworks */, + 41CD6C9615BF7793005E6F29 /* QuartzCore.framework in Frameworks */, + 41CD6C9915BF77CE005E6F29 /* libxml2.dylib in Frameworks */, + 41CD6C9A15BF77CE005E6F29 /* libz.dylib in Frameworks */, + 41BC70B715BF7E14006A0A6C /* libcocos2dx.a in Frameworks */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXFrameworksBuildPhase section */ + +/* Begin PBXGroup section */ + 41851B8715B93C32004083E9 = { + isa = PBXGroup; + children = ( + 41CD6C5415BF74E5005E6F29 /* cocos2dx.xcodeproj */, + 41CD6C5D15BF750B005E6F29 /* Classes */, + 41CD6C5E15BF7514005E6F29 /* Frameworks */, + 41CD6C5F15BF7522005E6F29 /* mac */, + 41EFC1BB15BF7AC30083EA95 /* Products */, + 41CD6C6115BF7556005E6F29 /* Resources */, + ); + sourceTree = ""; + }; + 41CD6C5515BF74E5005E6F29 /* Products */ = { + isa = PBXGroup; + children = ( + 41CD6C5C15BF74E5005E6F29 /* libcocos2dx.a */, + ); + name = Products; + sourceTree = ""; + }; + 41CD6C5D15BF750B005E6F29 /* Classes */ = { + isa = PBXGroup; + children = ( + 41CD6C7115BF76FB005E6F29 /* AppDelegate.cpp */, + 41CD6C7215BF76FB005E6F29 /* AppDelegate.h */, + 41CD6C7315BF76FB005E6F29 /* HelloWorldScene.cpp */, + 41CD6C7415BF76FB005E6F29 /* HelloWorldScene.h */, + ); + name = Classes; + sourceTree = ""; + }; + 41CD6C5E15BF7514005E6F29 /* Frameworks */ = { + isa = PBXGroup; + children = ( + 41CD6C8715BF7793005E6F29 /* AppKit.framework */, + 41CD6C8815BF7793005E6F29 /* AudioToolbox.framework */, + 41CD6C8915BF7793005E6F29 /* Cocoa.framework */, + 41CD6C8A15BF7793005E6F29 /* CoreFoundation.framework */, + 41CD6C8B15BF7793005E6F29 /* Foundation.framework */, + 41CD6C8C15BF7793005E6F29 /* OpenAL.framework */, + 41CD6C8D15BF7793005E6F29 /* OpenGL.framework */, + 41CD6C8E15BF7793005E6F29 /* QuartzCore.framework */, + 41CD6C9715BF77CE005E6F29 /* libxml2.dylib */, + 41CD6C9815BF77CE005E6F29 /* libz.dylib */, + ); + name = Frameworks; + sourceTree = ""; + }; + 41CD6C5F15BF7522005E6F29 /* mac */ = { + isa = PBXGroup; + children = ( + 41CD6C6215BF7574005E6F29 /* AppController.h */, + 41CD6C6315BF7574005E6F29 /* AppController.mm */, + 41CD6C6415BF7574005E6F29 /* main.m */, + 41BC70AC15BF7CCE006A0A6C /* Icon.icns */, + 41CD6C6715BF7673005E6F29 /* en.lproj */, + 41CD6C6C15BF7673005E6F29 /* HelloCpp_Info.plist */, + 41CD6C6D15BF7673005E6F29 /* HelloCpp_Prefix.pch */, + ); + name = mac; + sourceTree = ""; + }; + 41CD6C6115BF7556005E6F29 /* Resources */ = { + isa = PBXGroup; + children = ( + 41CD6C7715BF7708005E6F29 /* CloseNormal.png */, + 41CD6C7815BF7708005E6F29 /* CloseSelected.png */, + 41CD6C7915BF7708005E6F29 /* fps_images-hd.png */, + 41CD6C7A15BF7708005E6F29 /* fps_images-ipadhd.png */, + 41CD6C7B15BF7708005E6F29 /* fps_images.png */, + 41CD6C7C15BF7708005E6F29 /* HelloWorld.png */, + ); + name = Resources; + sourceTree = ""; + }; + 41CD6C6715BF7673005E6F29 /* en.lproj */ = { + isa = PBXGroup; + children = ( + 41CD6C6815BF7673005E6F29 /* InfoPlist.strings */, + 41CD6C6A15BF7673005E6F29 /* MainMenu.xib */, + ); + path = en.lproj; + sourceTree = ""; + }; + 41EFC1BB15BF7AC30083EA95 /* Products */ = { + isa = PBXGroup; + children = ( + 41CD6C5115BF748C005E6F29 /* HelloCpp.app */, + ); + name = Products; + sourceTree = ""; + }; +/* End PBXGroup section */ + +/* Begin PBXNativeTarget section */ + 41851B9115B93C32004083E9 /* HelloCpp */ = { + isa = PBXNativeTarget; + buildConfigurationList = 41851BB015B93C33004083E9 /* Build configuration list for PBXNativeTarget "HelloCpp" */; + buildPhases = ( + 41851B8E15B93C32004083E9 /* Sources */, + 41851B8F15B93C32004083E9 /* Frameworks */, + 41851B9015B93C32004083E9 /* Resources */, + ); + buildRules = ( + ); + dependencies = ( + 41EFC1BA15BF79BD0083EA95 /* PBXTargetDependency */, + ); + name = HelloCpp; + productName = Paralaxer; + productReference = 41CD6C5115BF748C005E6F29 /* HelloCpp.app */; + productType = "com.apple.product-type.application"; + }; +/* End PBXNativeTarget section */ + +/* Begin PBXProject section */ + 41851B8915B93C32004083E9 /* Project object */ = { + isa = PBXProject; + attributes = { + LastUpgradeCheck = 0420; + ORGANIZATIONNAME = "Bullets in a Burning Box, Inc."; + }; + buildConfigurationList = 41851B8C15B93C32004083E9 /* Build configuration list for PBXProject "HelloCpp" */; + compatibilityVersion = "Xcode 3.2"; + developmentRegion = English; + hasScannedForEncodings = 0; + knownRegions = ( + en, + ); + mainGroup = 41851B8715B93C32004083E9; + productRefGroup = 41851B8715B93C32004083E9; + projectDirPath = ""; + projectReferences = ( + { + ProductGroup = 41CD6C5515BF74E5005E6F29 /* Products */; + ProjectRef = 41CD6C5415BF74E5005E6F29 /* cocos2dx.xcodeproj */; + }, + ); + projectRoot = ""; + targets = ( + 41851B9115B93C32004083E9 /* HelloCpp */, + ); + }; +/* End PBXProject section */ + +/* Begin PBXReferenceProxy section */ + 41CD6C5C15BF74E5005E6F29 /* libcocos2dx.a */ = { + isa = PBXReferenceProxy; + fileType = archive.ar; + path = libcocos2dx.a; + remoteRef = 41CD6C5B15BF74E5005E6F29 /* PBXContainerItemProxy */; + sourceTree = BUILT_PRODUCTS_DIR; + }; +/* End PBXReferenceProxy section */ + +/* Begin PBXResourcesBuildPhase section */ + 41851B9015B93C32004083E9 /* Resources */ = { + isa = PBXResourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 41CD6C6E15BF7673005E6F29 /* InfoPlist.strings in Resources */, + 41CD6C6F15BF7673005E6F29 /* MainMenu.xib in Resources */, + 41CD6C7D15BF7708005E6F29 /* CloseNormal.png in Resources */, + 41CD6C7E15BF7708005E6F29 /* CloseSelected.png in Resources */, + 41CD6C7F15BF7708005E6F29 /* fps_images-hd.png in Resources */, + 41CD6C8015BF7708005E6F29 /* fps_images-ipadhd.png in Resources */, + 41CD6C8115BF7708005E6F29 /* fps_images.png in Resources */, + 41CD6C8215BF7708005E6F29 /* HelloWorld.png in Resources */, + 41BC70AD15BF7CCE006A0A6C /* Icon.icns in Resources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXResourcesBuildPhase section */ + +/* Begin PBXSourcesBuildPhase section */ + 41851B8E15B93C32004083E9 /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 41CD6C6515BF7574005E6F29 /* AppController.mm in Sources */, + 41CD6C6615BF7574005E6F29 /* main.m in Sources */, + 41CD6C7515BF76FB005E6F29 /* AppDelegate.cpp in Sources */, + 41CD6C7615BF76FB005E6F29 /* HelloWorldScene.cpp in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXSourcesBuildPhase section */ + +/* Begin PBXTargetDependency section */ + 41EFC1BA15BF79BD0083EA95 /* PBXTargetDependency */ = { + isa = PBXTargetDependency; + name = cocos2dx; + targetProxy = 41EFC1B915BF79BD0083EA95 /* PBXContainerItemProxy */; + }; +/* End PBXTargetDependency section */ + +/* Begin PBXVariantGroup section */ + 41CD6C6815BF7673005E6F29 /* InfoPlist.strings */ = { + isa = PBXVariantGroup; + children = ( + 41CD6C6915BF7673005E6F29 /* en */, + ); + name = InfoPlist.strings; + sourceTree = ""; + }; + 41CD6C6A15BF7673005E6F29 /* MainMenu.xib */ = { + isa = PBXVariantGroup; + children = ( + 41CD6C6B15BF7673005E6F29 /* en */, + ); + name = MainMenu.xib; + sourceTree = ""; + }; +/* End PBXVariantGroup section */ + +/* Begin XCBuildConfiguration section */ + 41851BAE15B93C33004083E9 /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + ALWAYS_SEARCH_USER_PATHS = NO; + ARCHS = "$(ARCHS_STANDARD_32_BIT)"; + COPY_PHASE_STRIP = NO; + GCC_C_LANGUAGE_STANDARD = "compiler-default"; + GCC_DYNAMIC_NO_PIC = NO; + GCC_ENABLE_OBJC_EXCEPTIONS = YES; + GCC_OPTIMIZATION_LEVEL = 0; + GCC_PREPROCESSOR_DEFINITIONS = ( + "DEBUG=1", + "$(inherited)", + ); + GCC_SYMBOLS_PRIVATE_EXTERN = NO; + GCC_VERSION = com.apple.compilers.llvm.clang.1_0; + GCC_WARN_64_TO_32_BIT_CONVERSION = YES; + GCC_WARN_ABOUT_MISSING_PROTOTYPES = YES; + GCC_WARN_ABOUT_RETURN_TYPE = YES; + GCC_WARN_UNUSED_VARIABLE = YES; + MACOSX_DEPLOYMENT_TARGET = 10.6; + ONLY_ACTIVE_ARCH = YES; + SDKROOT = macosx; + }; + name = Debug; + }; + 41851BAF15B93C33004083E9 /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + ALWAYS_SEARCH_USER_PATHS = NO; + ARCHS = "$(ARCHS_STANDARD_32_BIT)"; + COPY_PHASE_STRIP = YES; + DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; + GCC_C_LANGUAGE_STANDARD = "compiler-default"; + GCC_ENABLE_OBJC_EXCEPTIONS = YES; + GCC_VERSION = com.apple.compilers.llvm.clang.1_0; + GCC_WARN_64_TO_32_BIT_CONVERSION = YES; + GCC_WARN_ABOUT_MISSING_PROTOTYPES = YES; + GCC_WARN_ABOUT_RETURN_TYPE = YES; + GCC_WARN_UNUSED_VARIABLE = YES; + MACOSX_DEPLOYMENT_TARGET = 10.6; + SDKROOT = macosx; + }; + name = Release; + }; + 41851BB115B93C33004083E9 /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + ARCHS = "$(ARCHS_STANDARD_32_BIT)"; + CLANG_CXX_LANGUAGE_STANDARD = "compiler-default"; + GCC_C_LANGUAGE_STANDARD = "compiler-default"; + GCC_INLINES_ARE_PRIVATE_EXTERN = NO; + GCC_PRECOMPILE_PREFIX_HEADER = YES; + GCC_PREFIX_HEADER = HelloCpp_Prefix.pch; + GCC_PREPROCESSOR_DEFINITIONS = ( + TARGET_OS_MAC, + "DEBUG=1", + USE_FILE32API, + "$(inherited)", + ); + GCC_VERSION = ""; + GCC_WARN_64_TO_32_BIT_CONVERSION = NO; + GCC_WARN_ABOUT_MISSING_PROTOTYPES = NO; + HEADER_SEARCH_PATHS = ( + "\"$(SDKROOT)/usr/include/libxml2/\"", + "\"$(SRCROOT)/../../../cocos2dx/include\"", + "\"$(SRCROOT)/../../../cocos2dx\"", + "\"$(SRCROOT)/../../../cocos2dx/platform/mac\"", + "\"$(SRCROOT)/../../../cocos2dx/kazmath/include\"", + ); + INFOPLIST_FILE = HelloCpp_Info.plist; + LIBRARY_SEARCH_PATHS = "$(inherited)"; + MACOSX_DEPLOYMENT_TARGET = 10.6; + OTHER_CPLUSPLUSFLAGS = "$(OTHER_CFLAGS)"; + OTHER_LDFLAGS = ""; + PRODUCT_NAME = HelloCpp; + WRAPPER_EXTENSION = app; + }; + name = Debug; + }; + 41851BB215B93C33004083E9 /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + ARCHS = "$(ARCHS_STANDARD_32_BIT)"; + CLANG_CXX_LANGUAGE_STANDARD = "compiler-default"; + GCC_C_LANGUAGE_STANDARD = "compiler-default"; + GCC_INLINES_ARE_PRIVATE_EXTERN = NO; + GCC_PRECOMPILE_PREFIX_HEADER = YES; + GCC_PREFIX_HEADER = HelloCpp_Prefix.pch; + GCC_PREPROCESSOR_DEFINITIONS = ( + USE_FILE32API, + TARGET_OS_MAC, + ); + GCC_SYMBOLS_PRIVATE_EXTERN = NO; + GCC_VERSION = ""; + GCC_WARN_64_TO_32_BIT_CONVERSION = NO; + GCC_WARN_ABOUT_MISSING_PROTOTYPES = NO; + HEADER_SEARCH_PATHS = ( + "\"$(SDKROOT)/usr/include/libxml2/\"", + "\"$(SRCROOT)/../../../cocos2dx/include\"", + "\"$(SRCROOT)/../../../cocos2dx\"", + "\"$(SRCROOT)/../../../cocos2dx/platform/mac\"", + "\"$(SRCROOT)/../../../cocos2dx/kazmath/include\"", + ); + INFOPLIST_FILE = HelloCpp_Info.plist; + LIBRARY_SEARCH_PATHS = "$(inherited)"; + MACOSX_DEPLOYMENT_TARGET = 10.6; + OTHER_CPLUSPLUSFLAGS = "$(OTHER_CFLAGS)"; + OTHER_LDFLAGS = ""; + PRODUCT_NAME = HelloCpp; + WRAPPER_EXTENSION = app; + }; + name = Release; + }; +/* End XCBuildConfiguration section */ + +/* Begin XCConfigurationList section */ + 41851B8C15B93C32004083E9 /* Build configuration list for PBXProject "HelloCpp" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 41851BAE15B93C33004083E9 /* Debug */, + 41851BAF15B93C33004083E9 /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; + 41851BB015B93C33004083E9 /* Build configuration list for PBXNativeTarget "HelloCpp" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 41851BB115B93C33004083E9 /* Debug */, + 41851BB215B93C33004083E9 /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; +/* End XCConfigurationList section */ + }; + rootObject = 41851B8915B93C32004083E9 /* Project object */; +} diff --git a/samples/HelloCpp/proj.mac/HelloCpp_Prefix.pch b/samples/HelloCpp/proj.mac/HelloCpp_Prefix.pch new file mode 100644 index 0000000000..46c36a7e99 --- /dev/null +++ b/samples/HelloCpp/proj.mac/HelloCpp_Prefix.pch @@ -0,0 +1,7 @@ +// +// Prefix header for all source files of the 'Paralaxer' target in the 'Paralaxer' project +// + +#ifdef __OBJC__ + #import +#endif diff --git a/samples/HelloCpp/proj.mac/Icon.icns b/samples/HelloCpp/proj.mac/Icon.icns new file mode 100644 index 0000000000..285dee82b3 Binary files /dev/null and b/samples/HelloCpp/proj.mac/Icon.icns differ diff --git a/samples/HelloCpp/proj.mac/en.lproj/InfoPlist.strings b/samples/HelloCpp/proj.mac/en.lproj/InfoPlist.strings new file mode 100644 index 0000000000..477b28ff8f --- /dev/null +++ b/samples/HelloCpp/proj.mac/en.lproj/InfoPlist.strings @@ -0,0 +1,2 @@ +/* Localized versions of Info.plist keys */ + diff --git a/samples/HelloCpp/proj.mac/en.lproj/MainMenu.xib b/samples/HelloCpp/proj.mac/en.lproj/MainMenu.xib new file mode 100644 index 0000000000..9f99439250 --- /dev/null +++ b/samples/HelloCpp/proj.mac/en.lproj/MainMenu.xib @@ -0,0 +1,812 @@ + + + + 1060 + 10K549 + 1938 + 1038.36 + 461.00 + + com.apple.InterfaceBuilder.CocoaPlugin + 1938 + + + YES + NSMenuItem + NSCustomObject + NSMenu + + + YES + com.apple.InterfaceBuilder.CocoaPlugin + + + PluginDependencyRecalculationVersion + + + + YES + + NSApplication + + + FirstResponder + + + NSApplication + + + AMainMenu + + YES + + + HelloCpp + + 1048576 + 2147483647 + + NSImage + NSMenuCheckmark + + + NSImage + NSMenuMixedState + + submenuAction: + + HelloCpp + + YES + + + About HelloCpp + + 2147483647 + + + + + + YES + YES + + + 1048576 + 2147483647 + + + + + + Preferences… + , + 1048576 + 2147483647 + + + + + + YES + YES + + + 1048576 + 2147483647 + + + + + + Services + + 1048576 + 2147483647 + + + submenuAction: + + Services + + YES + + _NSServicesMenu + + + + + YES + YES + + + 1048576 + 2147483647 + + + + + + Hide HelloCpp + h + 1048576 + 2147483647 + + + + + + Hide Others + h + 1572864 + 2147483647 + + + + + + Show All + + 1048576 + 2147483647 + + + + + + YES + YES + + + 1048576 + 2147483647 + + + + + + Quit HelloCpp + q + 1048576 + 2147483647 + + + + + _NSAppleMenu + + + + + View + + 1048576 + 2147483647 + + + submenuAction: + + View + + YES + + + Toggle Fullscreen + f + 1048576 + 2147483647 + + + + + + + + + Window + + 1048576 + 2147483647 + + + submenuAction: + + Window + + YES + + + Minimize + m + 1048576 + 2147483647 + + + + + + Zoom + + 1048576 + 2147483647 + + + + + + YES + YES + + + 1048576 + 2147483647 + + + + + + Bring All to Front + + 1048576 + 2147483647 + + + + + _NSWindowsMenu + + + + + Help + + 2147483647 + + + submenuAction: + + Help + + YES + + + HelloCpp Help + ? + 1048576 + 2147483647 + + + + + _NSHelpMenu + + + + _NSMainMenu + + + AppController + + + NSFontManager + + + + + YES + + + terminate: + + + + 449 + + + + orderFrontStandardAboutPanel: + + + + 142 + + + + delegate + + + + 495 + + + + performMiniaturize: + + + + 37 + + + + arrangeInFront: + + + + 39 + + + + performZoom: + + + + 240 + + + + hide: + + + + 367 + + + + hideOtherApplications: + + + + 368 + + + + unhideAllApplications: + + + + 370 + + + + showHelp: + + + + 493 + + + + toggleFullScreen: + + + + 537 + + + + + YES + + 0 + + YES + + + + + + -2 + + + File's Owner + + + -1 + + + First Responder + + + -3 + + + Application + + + 29 + + + YES + + + + + + + + + 19 + + + YES + + + + + + 56 + + + YES + + + + + + 57 + + + YES + + + + + + + + + + + + + + + + 58 + + + + + 134 + + + + + 150 + + + + + 136 + + + + + 144 + + + + + 129 + + + + + 143 + + + + + 236 + + + + + 131 + + + YES + + + + + + 149 + + + + + 145 + + + + + 130 + + + + + 24 + + + YES + + + + + + + + + 92 + + + + + 5 + + + + + 239 + + + + + 23 + + + + + 295 + + + YES + + + + + + 296 + + + YES + + + + + + 420 + + + + + 490 + + + YES + + + + + + 491 + + + YES + + + + + + 492 + + + + + 494 + + + + + 536 + + + + + + + YES + + YES + -1.IBPluginDependency + -2.IBPluginDependency + -3.IBPluginDependency + 129.IBPluginDependency + 130.IBPluginDependency + 131.IBPluginDependency + 134.IBPluginDependency + 136.IBPluginDependency + 143.IBPluginDependency + 144.IBPluginDependency + 145.IBPluginDependency + 149.IBPluginDependency + 150.IBPluginDependency + 19.IBPluginDependency + 23.IBPluginDependency + 236.IBPluginDependency + 239.IBPluginDependency + 24.IBPluginDependency + 29.IBPluginDependency + 295.IBPluginDependency + 296.IBPluginDependency + 420.IBPluginDependency + 490.IBPluginDependency + 491.IBPluginDependency + 492.IBPluginDependency + 494.IBPluginDependency + 5.IBPluginDependency + 536.IBPluginDependency + 56.IBPluginDependency + 57.IBPluginDependency + 58.IBPluginDependency + 92.IBPluginDependency + + + YES + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + + + + YES + + + + + + YES + + + + + 541 + + + + YES + + AppController + NSObject + + YES + + YES + exitFullScreen: + toggleFullScreen: + + + YES + id + id + + + + YES + + YES + exitFullScreen: + toggleFullScreen: + + + YES + + exitFullScreen: + id + + + toggleFullScreen: + id + + + + + YES + + YES + glView + window + + + YES + EAGLView + Window + + + + YES + + YES + glView + window + + + YES + + glView + EAGLView + + + window + Window + + + + + IBProjectSource + ./Classes/AppController.h + + + + EAGLView + NSOpenGLView + + IBProjectSource + ./Classes/EAGLView.h + + + + + 0 + IBCocoaFramework + + com.apple.InterfaceBuilder.CocoaPlugin.InterfaceBuilder3 + + + YES + 3 + + YES + + YES + NSMenuCheckmark + NSMenuMixedState + + + YES + {9, 8} + {7, 2} + + + + diff --git a/samples/HelloCpp/proj.mac/main.m b/samples/HelloCpp/proj.mac/main.m new file mode 100644 index 0000000000..97d9b73282 --- /dev/null +++ b/samples/HelloCpp/proj.mac/main.m @@ -0,0 +1,30 @@ +/**************************************************************************** + Copyright (c) 2010 cocos2d-x.org + + http://www.cocos2d-x.org + + Permission is hereby granted, free of charge, to any person obtaining a copy + of this software and associated documentation files (the "Software"), to deal + in the Software without restriction, including without limitation the rights + to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + copies of the Software, and to permit persons to whom the Software is + furnished to do so, subject to the following conditions: + + The above copyright notice and this permission notice shall be included in + all copies or substantial portions of the Software. + + THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + THE SOFTWARE. + ****************************************************************************/ + +#import + +int main(int argc, char *argv[]) +{ + return NSApplicationMain(argc, (const char **)argv); +} diff --git a/samples/TestCpp/proj.mac/AppController.h b/samples/TestCpp/proj.mac/AppController.h new file mode 100644 index 0000000000..d671ffdc23 --- /dev/null +++ b/samples/TestCpp/proj.mac/AppController.h @@ -0,0 +1,42 @@ +/**************************************************************************** + Copyright (c) 2010 cocos2d-x.org + + http://www.cocos2d-x.org + + Permission is hereby granted, free of charge, to any person obtaining a copy + of this software and associated documentation files (the "Software"), to deal + in the Software without restriction, including without limitation the rights + to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + copies of the Software, and to permit persons to whom the Software is + furnished to do so, subject to the following conditions: + + The above copyright notice and this permission notice shall be included in + all copies or substantial portions of the Software. + + THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + THE SOFTWARE. + ****************************************************************************/ + +#pragma once + +#import "cocos2d.h" +#import "EAGLView.h" + +@interface AppController : NSObject + { + NSWindow *window; + EAGLView *glView; + } + + @property (nonatomic, assign) IBOutlet NSWindow* window; + @property (nonatomic, assign) IBOutlet EAGLView* glView; + + -(IBAction) toggleFullScreen:(id)sender; + -(IBAction) exitFullScreen:(id)sender; + +@end diff --git a/samples/TestCpp/proj.mac/AppController.mm b/samples/TestCpp/proj.mac/AppController.mm new file mode 100644 index 0000000000..3552af2e6a --- /dev/null +++ b/samples/TestCpp/proj.mac/AppController.mm @@ -0,0 +1,86 @@ +/**************************************************************************** + Copyright (c) 2010 cocos2d-x.org + + http://www.cocos2d-x.org + + Permission is hereby granted, free of charge, to any person obtaining a copy + of this software and associated documentation files (the "Software"), to deal + in the Software without restriction, including without limitation the rights + to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + copies of the Software, and to permit persons to whom the Software is + furnished to do so, subject to the following conditions: + + The above copyright notice and this permission notice shall be included in + all copies or substantial portions of the Software. + + THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + THE SOFTWARE. + ****************************************************************************/ + +#import "AppController.h" +#import "AppDelegate.h" + +@implementation AppController + + static AppDelegate s_sharedApplication; + + @synthesize window, glView; + + -(void) applicationDidFinishLaunching:(NSNotification *)aNotification + { + // create the window + // note that using NSResizableWindowMask causes the window to be a little + // smaller and therefore ipad graphics are not loaded + NSRect rect = NSMakeRect(200, 200, 480, 320); + window = [[NSWindow alloc] initWithContentRect:rect + styleMask:( NSClosableWindowMask | NSTitledWindowMask ) + backing:NSBackingStoreBuffered + defer:YES]; + + // allocate our GL view + // (isn't there already a shared EAGLView?) + glView = [[EAGLView alloc] initWithFrame:rect]; + [glView initWithFrame:rect]; + + // set window parameters + [window becomeFirstResponder]; + [window setContentView:glView]; + [window setTitle:@"TestCpp"]; + [window makeKeyAndOrderFront:self]; + [window setAcceptsMouseMovedEvents:NO]; + + // set cocos2d-x's opengl view + cocos2d::CCApplication::sharedApplication().run(); + } + + -(BOOL) applicationShouldTerminateAfterLastWindowClosed:(NSApplication*)theApplication + { + return YES; + } + + -(void) dealloc + { + cocos2d::CCDirector::sharedDirector()->end(); + [super dealloc]; + } + +#pragma mark - +#pragma mark IB Actions + + -(IBAction) toggleFullScreen:(id)sender + { + EAGLView* pView = [EAGLView sharedEGLView]; + [pView setFullScreen:!pView.isFullScreen]; + } + + -(IBAction) exitFullScreen:(id)sender + { + [[EAGLView sharedEGLView] setFullScreen:NO]; + } + +@end diff --git a/samples/TestCpp/proj.mac/Icon.icns b/samples/TestCpp/proj.mac/Icon.icns new file mode 100644 index 0000000000..285dee82b3 Binary files /dev/null and b/samples/TestCpp/proj.mac/Icon.icns differ diff --git a/samples/TestCpp/proj.mac/TestCpp.xcodeproj/project.pbxproj.REMOVED.git-id b/samples/TestCpp/proj.mac/TestCpp.xcodeproj/project.pbxproj.REMOVED.git-id new file mode 100644 index 0000000000..08a23bc302 --- /dev/null +++ b/samples/TestCpp/proj.mac/TestCpp.xcodeproj/project.pbxproj.REMOVED.git-id @@ -0,0 +1 @@ +a1f5db702a5ea17ba27ce7c12c5e4873be9c09e5 \ No newline at end of file diff --git a/samples/TestCpp/proj.mac/Test_Prefix.pch b/samples/TestCpp/proj.mac/Test_Prefix.pch new file mode 100644 index 0000000000..46c36a7e99 --- /dev/null +++ b/samples/TestCpp/proj.mac/Test_Prefix.pch @@ -0,0 +1,7 @@ +// +// Prefix header for all source files of the 'Paralaxer' target in the 'Paralaxer' project +// + +#ifdef __OBJC__ + #import +#endif diff --git a/samples/TestCpp/proj.mac/en.lproj/InfoPlist.strings b/samples/TestCpp/proj.mac/en.lproj/InfoPlist.strings new file mode 100644 index 0000000000..477b28ff8f --- /dev/null +++ b/samples/TestCpp/proj.mac/en.lproj/InfoPlist.strings @@ -0,0 +1,2 @@ +/* Localized versions of Info.plist keys */ + diff --git a/samples/TestCpp/proj.mac/en.lproj/MainMenu.xib b/samples/TestCpp/proj.mac/en.lproj/MainMenu.xib new file mode 100644 index 0000000000..3dacdedbd0 --- /dev/null +++ b/samples/TestCpp/proj.mac/en.lproj/MainMenu.xib @@ -0,0 +1,812 @@ + + + + 1060 + 10K549 + 1938 + 1038.36 + 461.00 + + com.apple.InterfaceBuilder.CocoaPlugin + 1938 + + + YES + NSMenuItem + NSCustomObject + NSMenu + + + YES + com.apple.InterfaceBuilder.CocoaPlugin + + + PluginDependencyRecalculationVersion + + + + YES + + NSApplication + + + FirstResponder + + + NSApplication + + + AMainMenu + + YES + + + TestCpp + + 1048576 + 2147483647 + + NSImage + NSMenuCheckmark + + + NSImage + NSMenuMixedState + + submenuAction: + + TestCpp + + YES + + + About TestCpp + + 2147483647 + + + + + + YES + YES + + + 1048576 + 2147483647 + + + + + + Preferences… + , + 1048576 + 2147483647 + + + + + + YES + YES + + + 1048576 + 2147483647 + + + + + + Services + + 1048576 + 2147483647 + + + submenuAction: + + Services + + YES + + _NSServicesMenu + + + + + YES + YES + + + 1048576 + 2147483647 + + + + + + Hide TestCpp + h + 1048576 + 2147483647 + + + + + + Hide Others + h + 1572864 + 2147483647 + + + + + + Show All + + 1048576 + 2147483647 + + + + + + YES + YES + + + 1048576 + 2147483647 + + + + + + Quit TestCpp + q + 1048576 + 2147483647 + + + + + _NSAppleMenu + + + + + View + + 1048576 + 2147483647 + + + submenuAction: + + View + + YES + + + Toggle Fullscreen + f + 1048576 + 2147483647 + + + + + + + + + Window + + 1048576 + 2147483647 + + + submenuAction: + + Window + + YES + + + Minimize + m + 1048576 + 2147483647 + + + + + + Zoom + + 1048576 + 2147483647 + + + + + + YES + YES + + + 1048576 + 2147483647 + + + + + + Bring All to Front + + 1048576 + 2147483647 + + + + + _NSWindowsMenu + + + + + Help + + 2147483647 + + + submenuAction: + + Help + + YES + + + TestCpp Help + ? + 1048576 + 2147483647 + + + + + _NSHelpMenu + + + + _NSMainMenu + + + AppController + + + NSFontManager + + + + + YES + + + terminate: + + + + 449 + + + + orderFrontStandardAboutPanel: + + + + 142 + + + + delegate + + + + 495 + + + + performMiniaturize: + + + + 37 + + + + arrangeInFront: + + + + 39 + + + + performZoom: + + + + 240 + + + + hide: + + + + 367 + + + + hideOtherApplications: + + + + 368 + + + + unhideAllApplications: + + + + 370 + + + + showHelp: + + + + 493 + + + + toggleFullScreen: + + + + 537 + + + + + YES + + 0 + + YES + + + + + + -2 + + + File's Owner + + + -1 + + + First Responder + + + -3 + + + Application + + + 29 + + + YES + + + + + + + + + 19 + + + YES + + + + + + 56 + + + YES + + + + + + 57 + + + YES + + + + + + + + + + + + + + + + 58 + + + + + 134 + + + + + 150 + + + + + 136 + + + + + 144 + + + + + 129 + + + + + 143 + + + + + 236 + + + + + 131 + + + YES + + + + + + 149 + + + + + 145 + + + + + 130 + + + + + 24 + + + YES + + + + + + + + + 92 + + + + + 5 + + + + + 239 + + + + + 23 + + + + + 295 + + + YES + + + + + + 296 + + + YES + + + + + + 420 + + + + + 490 + + + YES + + + + + + 491 + + + YES + + + + + + 492 + + + + + 494 + + + + + 536 + + + + + + + YES + + YES + -1.IBPluginDependency + -2.IBPluginDependency + -3.IBPluginDependency + 129.IBPluginDependency + 130.IBPluginDependency + 131.IBPluginDependency + 134.IBPluginDependency + 136.IBPluginDependency + 143.IBPluginDependency + 144.IBPluginDependency + 145.IBPluginDependency + 149.IBPluginDependency + 150.IBPluginDependency + 19.IBPluginDependency + 23.IBPluginDependency + 236.IBPluginDependency + 239.IBPluginDependency + 24.IBPluginDependency + 29.IBPluginDependency + 295.IBPluginDependency + 296.IBPluginDependency + 420.IBPluginDependency + 490.IBPluginDependency + 491.IBPluginDependency + 492.IBPluginDependency + 494.IBPluginDependency + 5.IBPluginDependency + 536.IBPluginDependency + 56.IBPluginDependency + 57.IBPluginDependency + 58.IBPluginDependency + 92.IBPluginDependency + + + YES + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + + + + YES + + + + + + YES + + + + + 541 + + + + YES + + AppController + NSObject + + YES + + YES + exitFullScreen: + toggleFullScreen: + + + YES + id + id + + + + YES + + YES + exitFullScreen: + toggleFullScreen: + + + YES + + exitFullScreen: + id + + + toggleFullScreen: + id + + + + + YES + + YES + glView + window + + + YES + EAGLView + NSWindow + + + + YES + + YES + glView + window + + + YES + + glView + EAGLView + + + window + NSWindow + + + + + IBProjectSource + ./Classes/AppController.h + + + + EAGLView + NSOpenGLView + + IBProjectSource + ./Classes/EAGLView.h + + + + + 0 + IBCocoaFramework + + com.apple.InterfaceBuilder.CocoaPlugin.InterfaceBuilder3 + + + YES + 3 + + YES + + YES + NSMenuCheckmark + NSMenuMixedState + + + YES + {9, 8} + {7, 2} + + + + diff --git a/samples/TestCpp/proj.mac/main.m b/samples/TestCpp/proj.mac/main.m new file mode 100644 index 0000000000..97d9b73282 --- /dev/null +++ b/samples/TestCpp/proj.mac/main.m @@ -0,0 +1,30 @@ +/**************************************************************************** + Copyright (c) 2010 cocos2d-x.org + + http://www.cocos2d-x.org + + Permission is hereby granted, free of charge, to any person obtaining a copy + of this software and associated documentation files (the "Software"), to deal + in the Software without restriction, including without limitation the rights + to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + copies of the Software, and to permit persons to whom the Software is + furnished to do so, subject to the following conditions: + + The above copyright notice and this permission notice shall be included in + all copies or substantial portions of the Software. + + THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + THE SOFTWARE. + ****************************************************************************/ + +#import + +int main(int argc, char *argv[]) +{ + return NSApplicationMain(argc, (const char **)argv); +}