mirror of https://github.com/axmolengine/axmol.git
issue #2460: change other sample projects to glfw version
This commit is contained in:
parent
ef7f51d875
commit
bc5ae78423
|
@ -7,7 +7,7 @@
|
|||
</PropertyGroup>
|
||||
<ItemDefinitionGroup>
|
||||
<Link>
|
||||
<AdditionalDependencies>opengl32.lib;glew32.lib;libzlib.lib;libpng.lib;libjpeg.lib;libtiff.lib;libwebp.lib;libiconv.lib;freetype250.lib;winmm.lib;%(AdditionalDependencies)</AdditionalDependencies>
|
||||
<AdditionalDependencies>opengl32.lib;glew32.lib;libzlib.lib;libpng.lib;libjpeg.lib;libtiff.lib;libwebp.lib;libiconv.lib;glfw3.lib;freetype250.lib;winmm.lib;%(AdditionalDependencies)</AdditionalDependencies>
|
||||
<AdditionalLibraryDirectories>$(OutDir);%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
|
||||
<IgnoreAllDefaultLibraries>false</IgnoreAllDefaultLibraries>
|
||||
</Link>
|
||||
|
|
|
@ -24,9 +24,8 @@ int APIENTRY _tWinMain(HINSTANCE hInstance,
|
|||
|
||||
// create the application instance
|
||||
AppDelegate app;
|
||||
auto eglView = EGLView::getInstance();
|
||||
eglView->setViewName("AssetsManagerTest");
|
||||
eglView->setFrameSize(800, 450);
|
||||
EGLView* eglView = new EGLView();
|
||||
eglView->init("TestCPP",900,640);
|
||||
|
||||
int ret = Application::getInstance()->run();
|
||||
|
||||
|
|
|
@ -12,9 +12,7 @@ int main(int argc, char **argv)
|
|||
{
|
||||
// create the application instance
|
||||
AppDelegate app;
|
||||
|
||||
auto eglView = EGLView::getInstance();
|
||||
eglView->setFrameSize(800, 480);
|
||||
|
||||
EGLView* eglView = new EGLView();
|
||||
eglView->init("TestCPP",900,640);
|
||||
return Application::getInstance()->run();
|
||||
}
|
||||
|
|
|
@ -1,42 +0,0 @@
|
|||
/****************************************************************************
|
||||
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 <NSApplicationDelegate>
|
||||
{
|
||||
NSWindow *window;
|
||||
CCEAGLView *glView;
|
||||
}
|
||||
|
||||
@property (nonatomic, assign) IBOutlet NSWindow* window;
|
||||
@property (nonatomic, assign) IBOutlet CCEAGLView* glView;
|
||||
|
||||
-(IBAction) toggleFullScreen:(id)sender;
|
||||
-(IBAction) exitFullScreen:(id)sender;
|
||||
|
||||
@end
|
|
@ -1,86 +0,0 @@
|
|||
/****************************************************************************
|
||||
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"
|
||||
|
||||
static AppDelegate s_sharedApplication;
|
||||
|
||||
@implementation AppController
|
||||
|
||||
@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(0, 0, 2048, 1536);
|
||||
window = [[NSWindow alloc] initWithContentRect:rect
|
||||
styleMask:( NSClosableWindowMask | NSTitledWindowMask )
|
||||
backing:NSBackingStoreBuffered
|
||||
defer:YES];
|
||||
|
||||
// allocate our GL view
|
||||
// (isn't there already a shared CCEAGLView?)
|
||||
glView = [[CCEAGLView alloc] initWithFrame:rect];
|
||||
|
||||
// set window parameters
|
||||
[window becomeFirstResponder];
|
||||
[window setContentView:glView];
|
||||
[window setTitle:@"HelloCpp"];
|
||||
[window makeKeyAndOrderFront:self];
|
||||
[window setAcceptsMouseMovedEvents:NO];
|
||||
|
||||
[glView setFrameZoomFactor:0.4];
|
||||
|
||||
cocos2d::Application::getInstance()->run();
|
||||
}
|
||||
|
||||
-(BOOL) applicationShouldTerminateAfterLastWindowClosed:(NSApplication*)theApplication
|
||||
{
|
||||
return YES;
|
||||
}
|
||||
|
||||
-(void) dealloc
|
||||
{
|
||||
cocos2d::Director::getInstance()->end();
|
||||
[super dealloc];
|
||||
}
|
||||
|
||||
#pragma mark -
|
||||
#pragma mark IB Actions
|
||||
|
||||
-(IBAction) toggleFullScreen:(id)sender
|
||||
{
|
||||
CCEAGLView* pView = [CCEAGLView sharedEGLView];
|
||||
[pView setFullScreen:!pView.isFullScreen];
|
||||
}
|
||||
|
||||
-(IBAction) exitFullScreen:(id)sender
|
||||
{
|
||||
[[CCEAGLView sharedEGLView] setFullScreen:NO];
|
||||
}
|
||||
|
||||
@end
|
|
@ -0,0 +1,37 @@
|
|||
/****************************************************************************
|
||||
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 "AppDelegate.h"
|
||||
#include "CCEGLView.h"
|
||||
|
||||
USING_NS_CC;
|
||||
|
||||
int main(int argc, char *argv[])
|
||||
{
|
||||
AppDelegate app;
|
||||
EGLView* eglView = new EGLView();
|
||||
eglView->init("TestCPP",900,640);
|
||||
return Application::getInstance()->run();
|
||||
}
|
||||
|
|
@ -14,11 +14,7 @@ int APIENTRY _tWinMain(HINSTANCE hInstance,
|
|||
|
||||
// create the application instance
|
||||
AppDelegate app;
|
||||
auto eglView = EGLView::getInstance();
|
||||
eglView->setViewName("HelloCpp");
|
||||
eglView->setFrameSize(2048, 1536);
|
||||
// The resolution of ipad3 is very large. In general, PC's resolution is smaller than it.
|
||||
// So we need to invoke 'setFrameZoomFactor'(only valid on desktop(win32, mac, linux)) to make the window smaller.
|
||||
eglView->setFrameZoomFactor(0.4f);
|
||||
EGLView* eglView = new EGLView();
|
||||
eglView->init("TestCPP",900,640);
|
||||
return Application::getInstance()->run();
|
||||
}
|
||||
|
|
|
@ -12,9 +12,7 @@ int main(int argc, char **argv)
|
|||
{
|
||||
// create the application instance
|
||||
AppDelegate app;
|
||||
|
||||
auto eglView = EGLView::getInstance();
|
||||
eglView->setFrameSize(800, 480);
|
||||
|
||||
EGLView* eglView = new EGLView();
|
||||
eglView->init("TestCPP",900,640);
|
||||
return Application::getInstance()->run();
|
||||
}
|
||||
|
|
|
@ -1,42 +0,0 @@
|
|||
/****************************************************************************
|
||||
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 <NSApplicationDelegate>
|
||||
{
|
||||
NSWindow *window;
|
||||
CCEAGLView *glView;
|
||||
}
|
||||
|
||||
@property (nonatomic, assign) IBOutlet NSWindow* window;
|
||||
@property (nonatomic, assign) IBOutlet CCEAGLView* glView;
|
||||
|
||||
-(IBAction) toggleFullScreen:(id)sender;
|
||||
-(IBAction) exitFullScreen:(id)sender;
|
||||
|
||||
@end
|
|
@ -1,86 +0,0 @@
|
|||
/****************************************************************************
|
||||
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"
|
||||
|
||||
static AppDelegate s_sharedApplication;
|
||||
|
||||
@implementation AppController
|
||||
|
||||
@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(0, 0, 2048, 1536);
|
||||
window = [[NSWindow alloc] initWithContentRect:rect
|
||||
styleMask:( NSClosableWindowMask | NSTitledWindowMask )
|
||||
backing:NSBackingStoreBuffered
|
||||
defer:YES];
|
||||
|
||||
// allocate our GL view
|
||||
// (isn't there already a shared CCEAGLView?)
|
||||
glView = [[CCEAGLView alloc] initWithFrame:rect];
|
||||
|
||||
// set window parameters
|
||||
[window becomeFirstResponder];
|
||||
[window setContentView:glView];
|
||||
[window setTitle:@"SampleGame"];
|
||||
[window makeKeyAndOrderFront:self];
|
||||
[window setAcceptsMouseMovedEvents:NO];
|
||||
|
||||
[glView setFrameZoomFactor:0.4];
|
||||
|
||||
cocos2d::Application::getInstance()->run();
|
||||
}
|
||||
|
||||
-(BOOL) applicationShouldTerminateAfterLastWindowClosed:(NSApplication*)theApplication
|
||||
{
|
||||
return YES;
|
||||
}
|
||||
|
||||
-(void) dealloc
|
||||
{
|
||||
cocos2d::Director::getInstance()->end();
|
||||
[super dealloc];
|
||||
}
|
||||
|
||||
#pragma mark -
|
||||
#pragma mark IB Actions
|
||||
|
||||
-(IBAction) toggleFullScreen:(id)sender
|
||||
{
|
||||
CCEAGLView* pView = [CCEAGLView sharedEGLView];
|
||||
[pView setFullScreen:!pView.isFullScreen];
|
||||
}
|
||||
|
||||
-(IBAction) exitFullScreen:(id)sender
|
||||
{
|
||||
[[CCEAGLView sharedEGLView] setFullScreen:NO];
|
||||
}
|
||||
|
||||
@end
|
|
@ -0,0 +1,37 @@
|
|||
/****************************************************************************
|
||||
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 "AppDelegate.h"
|
||||
#include "CCEGLView.h"
|
||||
|
||||
USING_NS_CC;
|
||||
|
||||
int main(int argc, char *argv[])
|
||||
{
|
||||
AppDelegate app;
|
||||
EGLView* eglView = new EGLView();
|
||||
eglView->init("TestCPP",900,640);
|
||||
return Application::getInstance()->run();
|
||||
}
|
||||
|
|
@ -84,7 +84,7 @@
|
|||
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||
<SubSystem>Windows</SubSystem>
|
||||
<TargetMachine>MachineX86</TargetMachine>
|
||||
<AdditionalDependencies>libExtensions.lib;libcocos2d.lib;libCocosDenshion.lib;libBox2d.lib;libchipmunk.lib;libcurl_imp.lib;websockets.lib;glfw3.lib;%(AdditionalDependencies)</AdditionalDependencies>
|
||||
<AdditionalDependencies>libExtensions.lib;libcocos2d.lib;libCocosDenshion.lib;libBox2d.lib;libchipmunk.lib;libcurl_imp.lib;websockets.lib;%(AdditionalDependencies)</AdditionalDependencies>
|
||||
</Link>
|
||||
<PostBuildEvent>
|
||||
<Command>
|
||||
|
|
|
@ -1,42 +0,0 @@
|
|||
/****************************************************************************
|
||||
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 <NSApplicationDelegate>
|
||||
{
|
||||
NSWindow *window;
|
||||
CCEAGLView *glView;
|
||||
}
|
||||
|
||||
@property (nonatomic, assign) IBOutlet NSWindow* window;
|
||||
@property (nonatomic, assign) IBOutlet CCEAGLView* glView;
|
||||
|
||||
-(IBAction) toggleFullScreen:(id)sender;
|
||||
-(IBAction) exitFullScreen:(id)sender;
|
||||
|
||||
@end
|
|
@ -1,93 +0,0 @@
|
|||
/****************************************************************************
|
||||
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(100, 100, 480, 720);
|
||||
window = [[NSWindow alloc] initWithContentRect:rect
|
||||
styleMask:( NSClosableWindowMask | NSTitledWindowMask )
|
||||
backing:NSBackingStoreBuffered
|
||||
defer:YES];
|
||||
|
||||
NSOpenGLPixelFormatAttribute attributes[] = {
|
||||
NSOpenGLPFADoubleBuffer,
|
||||
NSOpenGLPFADepthSize, 24,
|
||||
NSOpenGLPFAStencilSize, 8,
|
||||
0
|
||||
};
|
||||
|
||||
NSOpenGLPixelFormat *pixelFormat = [[[NSOpenGLPixelFormat alloc] initWithAttributes:attributes] autorelease];
|
||||
|
||||
// allocate our GL view
|
||||
// (isn't there already a shared CCEAGLView?)
|
||||
glView = [[CCEAGLView alloc] initWithFrame:rect pixelFormat:pixelFormat];
|
||||
|
||||
// set window parameters
|
||||
[window becomeFirstResponder];
|
||||
[window setContentView:glView];
|
||||
[window setTitle:@"JS CocosDragon"];
|
||||
[window makeKeyAndOrderFront:self];
|
||||
[window setAcceptsMouseMovedEvents:NO];
|
||||
|
||||
cocos2d::Application::getInstance()->run();
|
||||
}
|
||||
|
||||
-(BOOL) applicationShouldTerminateAfterLastWindowClosed:(NSApplication*)theApplication
|
||||
{
|
||||
return YES;
|
||||
}
|
||||
|
||||
-(void) dealloc
|
||||
{
|
||||
cocos2d::Director::getInstance()->end();
|
||||
[super dealloc];
|
||||
}
|
||||
|
||||
#pragma mark -
|
||||
#pragma mark IB Actions
|
||||
|
||||
-(IBAction) toggleFullScreen:(id)sender
|
||||
{
|
||||
CCEAGLView* pView = [CCEAGLView sharedEGLView];
|
||||
[pView setFullScreen:!pView.isFullScreen];
|
||||
}
|
||||
|
||||
-(IBAction) exitFullScreen:(id)sender
|
||||
{
|
||||
[[CCEAGLView sharedEGLView] setFullScreen:NO];
|
||||
}
|
||||
|
||||
@end
|
|
@ -22,9 +22,15 @@
|
|||
THE SOFTWARE.
|
||||
****************************************************************************/
|
||||
|
||||
#import <Cocoa/Cocoa.h>
|
||||
#include "AppDelegate.h"
|
||||
#include "CCEGLView.h"
|
||||
|
||||
USING_NS_CC;
|
||||
|
||||
int main(int argc, char *argv[])
|
||||
{
|
||||
return NSApplicationMain(argc, (const char **)argv);
|
||||
AppDelegate app;
|
||||
EGLView* eglView = new EGLView();
|
||||
eglView->init("TestCPP",900,640);
|
||||
return Application::getInstance()->run();
|
||||
}
|
|
@ -24,9 +24,8 @@ int APIENTRY _tWinMain(HINSTANCE hInstance,
|
|||
|
||||
// create the application instance
|
||||
AppDelegate app;
|
||||
auto eglView = EGLView::getInstance();
|
||||
eglView->setViewName("CocosDragonJS");
|
||||
eglView->setFrameSize(320, 480);
|
||||
EGLView* eglView = new EGLView();
|
||||
eglView->init("TestCPP",900,640);
|
||||
|
||||
int ret = Application::getInstance()->run();
|
||||
|
||||
|
|
|
@ -1,42 +0,0 @@
|
|||
/****************************************************************************
|
||||
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 <NSApplicationDelegate>
|
||||
{
|
||||
NSWindow *window;
|
||||
CCEAGLView *glView;
|
||||
}
|
||||
|
||||
@property (nonatomic, assign) IBOutlet NSWindow* window;
|
||||
@property (nonatomic, assign) IBOutlet CCEAGLView* glView;
|
||||
|
||||
-(IBAction) toggleFullScreen:(id)sender;
|
||||
-(IBAction) exitFullScreen:(id)sender;
|
||||
|
||||
@end
|
|
@ -1,93 +0,0 @@
|
|||
/****************************************************************************
|
||||
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(100, 100, 480, 720);
|
||||
window = [[NSWindow alloc] initWithContentRect:rect
|
||||
styleMask:( NSClosableWindowMask | NSTitledWindowMask )
|
||||
backing:NSBackingStoreBuffered
|
||||
defer:YES];
|
||||
|
||||
NSOpenGLPixelFormatAttribute attributes[] = {
|
||||
NSOpenGLPFADoubleBuffer,
|
||||
NSOpenGLPFADepthSize, 24,
|
||||
NSOpenGLPFAStencilSize, 8,
|
||||
0
|
||||
};
|
||||
|
||||
NSOpenGLPixelFormat *pixelFormat = [[[NSOpenGLPixelFormat alloc] initWithAttributes:attributes] autorelease];
|
||||
|
||||
// allocate our GL view
|
||||
// (isn't there already a shared CCEAGLView?)
|
||||
glView = [[CCEAGLView alloc] initWithFrame:rect pixelFormat:pixelFormat];
|
||||
|
||||
// set window parameters
|
||||
[window becomeFirstResponder];
|
||||
[window setContentView:glView];
|
||||
[window setTitle:@"JS CrystalCraze"];
|
||||
[window makeKeyAndOrderFront:self];
|
||||
[window setAcceptsMouseMovedEvents:NO];
|
||||
|
||||
cocos2d::Application::getInstance()->run();
|
||||
}
|
||||
|
||||
-(BOOL) applicationShouldTerminateAfterLastWindowClosed:(NSApplication*)theApplication
|
||||
{
|
||||
return YES;
|
||||
}
|
||||
|
||||
-(void) dealloc
|
||||
{
|
||||
cocos2d::Director::getInstance()->end();
|
||||
[super dealloc];
|
||||
}
|
||||
|
||||
#pragma mark -
|
||||
#pragma mark IB Actions
|
||||
|
||||
-(IBAction) toggleFullScreen:(id)sender
|
||||
{
|
||||
CCEAGLView* pView = [CCEAGLView sharedEGLView];
|
||||
[pView setFullScreen:!pView.isFullScreen];
|
||||
}
|
||||
|
||||
-(IBAction) exitFullScreen:(id)sender
|
||||
{
|
||||
[[CCEAGLView sharedEGLView] setFullScreen:NO];
|
||||
}
|
||||
|
||||
@end
|
|
@ -22,9 +22,15 @@
|
|||
THE SOFTWARE.
|
||||
****************************************************************************/
|
||||
|
||||
#import <Cocoa/Cocoa.h>
|
||||
#include "AppDelegate.h"
|
||||
#include "CCEGLView.h"
|
||||
|
||||
USING_NS_CC;
|
||||
|
||||
int main(int argc, char *argv[])
|
||||
{
|
||||
return NSApplicationMain(argc, (const char **)argv);
|
||||
AppDelegate app;
|
||||
EGLView* eglView = new EGLView();
|
||||
eglView->init("TestCPP",900,640);
|
||||
return Application::getInstance()->run();
|
||||
}
|
|
@ -24,9 +24,8 @@ int APIENTRY _tWinMain(HINSTANCE hInstance,
|
|||
|
||||
// create the application instance
|
||||
AppDelegate app;
|
||||
auto eglView = EGLView::getInstance();
|
||||
eglView->setViewName("CrystalCraze");
|
||||
eglView->setFrameSize(320, 480);
|
||||
EGLView* eglView = new EGLView();
|
||||
eglView->init("TestCPP",900,640);
|
||||
|
||||
int ret = Application::getInstance()->run();
|
||||
|
||||
|
|
|
@ -1,42 +0,0 @@
|
|||
/****************************************************************************
|
||||
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 <NSApplicationDelegate>
|
||||
{
|
||||
NSWindow *window;
|
||||
CCEAGLView *glView;
|
||||
}
|
||||
|
||||
@property (nonatomic, assign) IBOutlet NSWindow* window;
|
||||
@property (nonatomic, assign) IBOutlet CCEAGLView* glView;
|
||||
|
||||
-(IBAction) toggleFullScreen:(id)sender;
|
||||
-(IBAction) exitFullScreen:(id)sender;
|
||||
|
||||
@end
|
|
@ -1,93 +0,0 @@
|
|||
/****************************************************************************
|
||||
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(100, 100, 320, 480);
|
||||
window = [[NSWindow alloc] initWithContentRect:rect
|
||||
styleMask:( NSClosableWindowMask | NSTitledWindowMask )
|
||||
backing:NSBackingStoreBuffered
|
||||
defer:YES];
|
||||
|
||||
NSOpenGLPixelFormatAttribute attributes[] = {
|
||||
NSOpenGLPFADoubleBuffer,
|
||||
NSOpenGLPFADepthSize, 24,
|
||||
NSOpenGLPFAStencilSize, 8,
|
||||
0
|
||||
};
|
||||
|
||||
NSOpenGLPixelFormat *pixelFormat = [[[NSOpenGLPixelFormat alloc] initWithAttributes:attributes] autorelease];
|
||||
|
||||
// allocate our GL view
|
||||
// (isn't there already a shared CCEAGLView?)
|
||||
glView = [[CCEAGLView alloc] initWithFrame:rect pixelFormat:pixelFormat];
|
||||
|
||||
// set window parameters
|
||||
[window becomeFirstResponder];
|
||||
[window setContentView:glView];
|
||||
[window setTitle:@"JS MoonWarriors"];
|
||||
[window makeKeyAndOrderFront:self];
|
||||
[window setAcceptsMouseMovedEvents:NO];
|
||||
|
||||
cocos2d::Application::getInstance()->run();
|
||||
}
|
||||
|
||||
-(BOOL) applicationShouldTerminateAfterLastWindowClosed:(NSApplication*)theApplication
|
||||
{
|
||||
return YES;
|
||||
}
|
||||
|
||||
-(void) dealloc
|
||||
{
|
||||
cocos2d::Director::getInstance()->end();
|
||||
[super dealloc];
|
||||
}
|
||||
|
||||
#pragma mark -
|
||||
#pragma mark IB Actions
|
||||
|
||||
-(IBAction) toggleFullScreen:(id)sender
|
||||
{
|
||||
CCEAGLView* pView = [CCEAGLView sharedEGLView];
|
||||
[pView setFullScreen:!pView.isFullScreen];
|
||||
}
|
||||
|
||||
-(IBAction) exitFullScreen:(id)sender
|
||||
{
|
||||
[[CCEAGLView sharedEGLView] setFullScreen:NO];
|
||||
}
|
||||
|
||||
@end
|
|
@ -0,0 +1,37 @@
|
|||
/****************************************************************************
|
||||
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 "AppDelegate.h"
|
||||
#include "CCEGLView.h"
|
||||
|
||||
USING_NS_CC;
|
||||
|
||||
int main(int argc, char *argv[])
|
||||
{
|
||||
AppDelegate app;
|
||||
EGLView* eglView = new EGLView();
|
||||
eglView->init("TestCPP",900,640);
|
||||
return Application::getInstance()->run();
|
||||
}
|
||||
|
|
@ -1,30 +0,0 @@
|
|||
/****************************************************************************
|
||||
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 <Cocoa/Cocoa.h>
|
||||
|
||||
int main(int argc, char *argv[])
|
||||
{
|
||||
return NSApplicationMain(argc, (const char **)argv);
|
||||
}
|
|
@ -24,9 +24,8 @@ int APIENTRY _tWinMain(HINSTANCE hInstance,
|
|||
|
||||
// create the application instance
|
||||
AppDelegate app;
|
||||
auto eglView = EGLView::getInstance();
|
||||
eglView->setViewName("MoonWarriors");
|
||||
eglView->setFrameSize(320, 480);
|
||||
EGLView* eglView = new EGLView();
|
||||
eglView->init("TestCPP",900,640);
|
||||
|
||||
int ret = Application::getInstance()->run();
|
||||
|
||||
|
|
|
@ -1,42 +0,0 @@
|
|||
/****************************************************************************
|
||||
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 <NSApplicationDelegate>
|
||||
{
|
||||
NSWindow *window;
|
||||
CCEAGLView *glView;
|
||||
}
|
||||
|
||||
@property (nonatomic, assign) IBOutlet NSWindow* window;
|
||||
@property (nonatomic, assign) IBOutlet CCEAGLView* glView;
|
||||
|
||||
-(IBAction) toggleFullScreen:(id)sender;
|
||||
-(IBAction) exitFullScreen:(id)sender;
|
||||
|
||||
@end
|
|
@ -1,93 +0,0 @@
|
|||
/****************************************************************************
|
||||
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(100, 100, 800, 450);
|
||||
window = [[NSWindow alloc] initWithContentRect:rect
|
||||
styleMask:( NSClosableWindowMask | NSTitledWindowMask )
|
||||
backing:NSBackingStoreBuffered
|
||||
defer:YES];
|
||||
|
||||
NSOpenGLPixelFormatAttribute attributes[] = {
|
||||
NSOpenGLPFADoubleBuffer,
|
||||
NSOpenGLPFADepthSize, 24,
|
||||
NSOpenGLPFAStencilSize, 8,
|
||||
0
|
||||
};
|
||||
|
||||
NSOpenGLPixelFormat *pixelFormat = [[[NSOpenGLPixelFormat alloc] initWithAttributes:attributes] autorelease];
|
||||
|
||||
// allocate our GL view
|
||||
// (isn't there already a shared CCEAGLView?)
|
||||
glView = [[CCEAGLView alloc] initWithFrame:rect pixelFormat:pixelFormat];
|
||||
|
||||
// set window parameters
|
||||
[window becomeFirstResponder];
|
||||
[window setContentView:glView];
|
||||
[window setTitle:@"JS Test"];
|
||||
[window makeKeyAndOrderFront:self];
|
||||
[window setAcceptsMouseMovedEvents:NO];
|
||||
|
||||
cocos2d::Application::getInstance()->run();
|
||||
}
|
||||
|
||||
-(BOOL) applicationShouldTerminateAfterLastWindowClosed:(NSApplication*)theApplication
|
||||
{
|
||||
return YES;
|
||||
}
|
||||
|
||||
-(void) dealloc
|
||||
{
|
||||
cocos2d::Director::getInstance()->end();
|
||||
[super dealloc];
|
||||
}
|
||||
|
||||
#pragma mark -
|
||||
#pragma mark IB Actions
|
||||
|
||||
-(IBAction) toggleFullScreen:(id)sender
|
||||
{
|
||||
CCEAGLView* pView = [CCEAGLView sharedEGLView];
|
||||
[pView setFullScreen:!pView.isFullScreen];
|
||||
}
|
||||
|
||||
-(IBAction) exitFullScreen:(id)sender
|
||||
{
|
||||
[[CCEAGLView sharedEGLView] setFullScreen:NO];
|
||||
}
|
||||
|
||||
@end
|
|
@ -0,0 +1,37 @@
|
|||
/****************************************************************************
|
||||
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 "AppDelegate.h"
|
||||
#include "CCEGLView.h"
|
||||
|
||||
USING_NS_CC;
|
||||
|
||||
int main(int argc, char *argv[])
|
||||
{
|
||||
AppDelegate app;
|
||||
EGLView* eglView = new EGLView();
|
||||
eglView->init("TestCPP",900,640);
|
||||
return Application::getInstance()->run();
|
||||
}
|
||||
|
|
@ -1,30 +0,0 @@
|
|||
/****************************************************************************
|
||||
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 <Cocoa/Cocoa.h>
|
||||
|
||||
int main(int argc, char *argv[])
|
||||
{
|
||||
return NSApplicationMain(argc, (const char **)argv);
|
||||
}
|
|
@ -24,9 +24,8 @@ int APIENTRY _tWinMain(HINSTANCE hInstance,
|
|||
|
||||
// create the application instance
|
||||
AppDelegate app;
|
||||
auto eglView = EGLView::getInstance();
|
||||
eglView->setViewName("TestJavascript");
|
||||
eglView->setFrameSize(800, 450);
|
||||
EGLView* eglView = new EGLView();
|
||||
eglView->init("TestCPP",900,640);
|
||||
|
||||
int ret = Application::getInstance()->run();
|
||||
|
||||
|
|
|
@ -1,42 +0,0 @@
|
|||
/****************************************************************************
|
||||
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 <NSApplicationDelegate>
|
||||
{
|
||||
NSWindow *window;
|
||||
CCEAGLView *glView;
|
||||
}
|
||||
|
||||
@property (nonatomic, assign) IBOutlet NSWindow* window;
|
||||
@property (nonatomic, assign) IBOutlet CCEAGLView* glView;
|
||||
|
||||
-(IBAction) toggleFullScreen:(id)sender;
|
||||
-(IBAction) exitFullScreen:(id)sender;
|
||||
|
||||
@end
|
|
@ -1,93 +0,0 @@
|
|||
/****************************************************************************
|
||||
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(100, 100, 800, 450);
|
||||
window = [[NSWindow alloc] initWithContentRect:rect
|
||||
styleMask:( NSClosableWindowMask | NSTitledWindowMask )
|
||||
backing:NSBackingStoreBuffered
|
||||
defer:YES];
|
||||
|
||||
NSOpenGLPixelFormatAttribute attributes[] = {
|
||||
NSOpenGLPFADoubleBuffer,
|
||||
NSOpenGLPFADepthSize, 24,
|
||||
NSOpenGLPFAStencilSize, 8,
|
||||
0
|
||||
};
|
||||
|
||||
NSOpenGLPixelFormat *pixelFormat = [[[NSOpenGLPixelFormat alloc] initWithAttributes:attributes] autorelease];
|
||||
|
||||
// allocate our GL view
|
||||
// (isn't there already a shared CCEAGLView?)
|
||||
glView = [[CCEAGLView alloc] initWithFrame:rect pixelFormat:pixelFormat];
|
||||
|
||||
// set window parameters
|
||||
[window becomeFirstResponder];
|
||||
[window setContentView:glView];
|
||||
[window setTitle:@"JS WatermelonWithMe"];
|
||||
[window makeKeyAndOrderFront:self];
|
||||
[window setAcceptsMouseMovedEvents:NO];
|
||||
|
||||
cocos2d::Application::getInstance()->run();
|
||||
}
|
||||
|
||||
-(BOOL) applicationShouldTerminateAfterLastWindowClosed:(NSApplication*)theApplication
|
||||
{
|
||||
return YES;
|
||||
}
|
||||
|
||||
-(void) dealloc
|
||||
{
|
||||
cocos2d::Director::getInstance()->end();
|
||||
[super dealloc];
|
||||
}
|
||||
|
||||
#pragma mark -
|
||||
#pragma mark IB Actions
|
||||
|
||||
-(IBAction) toggleFullScreen:(id)sender
|
||||
{
|
||||
CCEAGLView* pView = [CCEAGLView sharedEGLView];
|
||||
[pView setFullScreen:!pView.isFullScreen];
|
||||
}
|
||||
|
||||
-(IBAction) exitFullScreen:(id)sender
|
||||
{
|
||||
[[CCEAGLView sharedEGLView] setFullScreen:NO];
|
||||
}
|
||||
|
||||
@end
|
|
@ -0,0 +1,37 @@
|
|||
/****************************************************************************
|
||||
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 "AppDelegate.h"
|
||||
#include "CCEGLView.h"
|
||||
|
||||
USING_NS_CC;
|
||||
|
||||
int main(int argc, char *argv[])
|
||||
{
|
||||
AppDelegate app;
|
||||
EGLView* eglView = new EGLView();
|
||||
eglView->init("TestCPP",900,640);
|
||||
return Application::getInstance()->run();
|
||||
}
|
||||
|
|
@ -1,30 +0,0 @@
|
|||
/****************************************************************************
|
||||
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 <Cocoa/Cocoa.h>
|
||||
|
||||
int main(int argc, char *argv[])
|
||||
{
|
||||
return NSApplicationMain(argc, (const char **)argv);
|
||||
}
|
|
@ -24,9 +24,8 @@ int APIENTRY _tWinMain(HINSTANCE hInstance,
|
|||
|
||||
// create the application instance
|
||||
AppDelegate app;
|
||||
auto eglView = EGLView::getInstance();
|
||||
eglView->setViewName("WatermelonWithMe");
|
||||
eglView->setFrameSize(800, 450);
|
||||
EGLView* eglView = new EGLView();
|
||||
eglView->init("TestCPP",900,640);
|
||||
|
||||
int ret = Application::getInstance()->run();
|
||||
|
||||
|
|
|
@ -12,7 +12,7 @@ int main(int argc, char **argv)
|
|||
{
|
||||
// create the application instance
|
||||
AppDelegate app;
|
||||
auto eglView = EGLView::getInstance();
|
||||
eglView->setFrameSize(960, 640);
|
||||
EGLView* eglView = new EGLView();
|
||||
eglView->init("TestCPP",900,640);
|
||||
return Application::getInstance()->run();
|
||||
}
|
||||
|
|
|
@ -1,42 +0,0 @@
|
|||
/****************************************************************************
|
||||
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 <NSApplicationDelegate>
|
||||
{
|
||||
NSWindow *window;
|
||||
CCEAGLView *glView;
|
||||
}
|
||||
|
||||
@property (nonatomic, assign) IBOutlet NSWindow* window;
|
||||
@property (nonatomic, assign) IBOutlet CCEAGLView* glView;
|
||||
|
||||
-(IBAction) toggleFullScreen:(id)sender;
|
||||
-(IBAction) exitFullScreen:(id)sender;
|
||||
|
||||
@end
|
|
@ -1,84 +0,0 @@
|
|||
/****************************************************************************
|
||||
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"
|
||||
|
||||
static AppDelegate s_sharedApplication;
|
||||
|
||||
@implementation AppController
|
||||
|
||||
@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(100, 100, 480, 320);
|
||||
window = [[NSWindow alloc] initWithContentRect:rect
|
||||
styleMask:( NSClosableWindowMask | NSTitledWindowMask )
|
||||
backing:NSBackingStoreBuffered
|
||||
defer:YES];
|
||||
|
||||
// allocate our GL view
|
||||
// (isn't there already a shared CCEAGLView?)
|
||||
glView = [[CCEAGLView alloc] initWithFrame:rect];
|
||||
|
||||
// set window parameters
|
||||
[window becomeFirstResponder];
|
||||
[window setContentView:glView];
|
||||
[window setTitle:@"HelloLua"];
|
||||
[window makeKeyAndOrderFront:self];
|
||||
[window setAcceptsMouseMovedEvents:NO];
|
||||
|
||||
cocos2d::Application::getInstance()->run();
|
||||
}
|
||||
|
||||
-(BOOL) applicationShouldTerminateAfterLastWindowClosed:(NSApplication*)theApplication
|
||||
{
|
||||
return YES;
|
||||
}
|
||||
|
||||
-(void) dealloc
|
||||
{
|
||||
cocos2d::Director::getInstance()->end();
|
||||
[super dealloc];
|
||||
}
|
||||
|
||||
#pragma mark -
|
||||
#pragma mark IB Actions
|
||||
|
||||
-(IBAction) toggleFullScreen:(id)sender
|
||||
{
|
||||
CCEAGLView* pView = [CCEAGLView sharedEGLView];
|
||||
[pView setFullScreen:!pView.isFullScreen];
|
||||
}
|
||||
|
||||
-(IBAction) exitFullScreen:(id)sender
|
||||
{
|
||||
[[CCEAGLView sharedEGLView] setFullScreen:NO];
|
||||
}
|
||||
|
||||
@end
|
|
@ -22,9 +22,15 @@
|
|||
THE SOFTWARE.
|
||||
****************************************************************************/
|
||||
|
||||
#import <Cocoa/Cocoa.h>
|
||||
#include "AppDelegate.h"
|
||||
#include "CCEGLView.h"
|
||||
|
||||
USING_NS_CC;
|
||||
|
||||
int main(int argc, char *argv[])
|
||||
{
|
||||
return NSApplicationMain(argc, (const char **)argv);
|
||||
AppDelegate app;
|
||||
EGLView* eglView = new EGLView();
|
||||
eglView->init("TestCPP",900,640);
|
||||
return Application::getInstance()->run();
|
||||
}
|
|
@ -1,30 +0,0 @@
|
|||
/****************************************************************************
|
||||
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 <Cocoa/Cocoa.h>
|
||||
|
||||
int main(int argc, char *argv[])
|
||||
{
|
||||
return NSApplicationMain(argc, (const char **)argv);
|
||||
}
|
|
@ -24,9 +24,9 @@ int APIENTRY _tWinMain(HINSTANCE hInstance,
|
|||
|
||||
// create the application instance
|
||||
AppDelegate app;
|
||||
auto eglView = EGLView::getInstance();
|
||||
eglView->setViewName("HelloLua");
|
||||
eglView->setFrameSize(480, 320);
|
||||
EGLView* eglView = new EGLView();
|
||||
eglView->init("TestCPP",900,640);
|
||||
|
||||
int ret = Application::getInstance()->run();
|
||||
|
||||
#ifdef USE_WIN32_CONSOLE
|
||||
|
|
|
@ -13,7 +13,7 @@ int main(int argc, char **argv)
|
|||
{
|
||||
// create the application instance
|
||||
AppDelegate app;
|
||||
auto eglView = EGLView::getInstance();
|
||||
eglView->setFrameSize(800, 480);
|
||||
EGLView* eglView = new EGLView();
|
||||
eglView->init("TestCPP",900,640);
|
||||
return Application::getInstance()->run();
|
||||
}
|
||||
|
|
|
@ -1,42 +0,0 @@
|
|||
/****************************************************************************
|
||||
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 <NSApplicationDelegate>
|
||||
{
|
||||
NSWindow *window;
|
||||
CCEAGLView *glView;
|
||||
}
|
||||
|
||||
@property (nonatomic, assign) IBOutlet NSWindow* window;
|
||||
@property (nonatomic, assign) IBOutlet CCEAGLView* glView;
|
||||
|
||||
-(IBAction) toggleFullScreen:(id)sender;
|
||||
-(IBAction) exitFullScreen:(id)sender;
|
||||
|
||||
@end
|
|
@ -1,84 +0,0 @@
|
|||
/****************************************************************************
|
||||
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"
|
||||
|
||||
static AppDelegate s_sharedApplication;
|
||||
|
||||
@implementation AppController
|
||||
|
||||
@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(100, 100, 720, 480);
|
||||
window = [[NSWindow alloc] initWithContentRect:rect
|
||||
styleMask:( NSClosableWindowMask | NSTitledWindowMask )
|
||||
backing:NSBackingStoreBuffered
|
||||
defer:YES];
|
||||
|
||||
// allocate our GL view
|
||||
// (isn't there already a shared CCEAGLView?)
|
||||
glView = [[CCEAGLView alloc] initWithFrame:rect];
|
||||
|
||||
// set window parameters
|
||||
[window becomeFirstResponder];
|
||||
[window setContentView:glView];
|
||||
[window setTitle:@"TestLua"];
|
||||
[window makeKeyAndOrderFront:self];
|
||||
[window setAcceptsMouseMovedEvents:NO];
|
||||
|
||||
cocos2d::Application::getInstance()->run();
|
||||
}
|
||||
|
||||
-(BOOL) applicationShouldTerminateAfterLastWindowClosed:(NSApplication*)theApplication
|
||||
{
|
||||
return YES;
|
||||
}
|
||||
|
||||
-(void) dealloc
|
||||
{
|
||||
cocos2d::Director::getInstance()->end();
|
||||
[super dealloc];
|
||||
}
|
||||
|
||||
#pragma mark -
|
||||
#pragma mark IB Actions
|
||||
|
||||
-(IBAction) toggleFullScreen:(id)sender
|
||||
{
|
||||
CCEAGLView* pView = [CCEAGLView sharedEGLView];
|
||||
[pView setFullScreen:!pView.isFullScreen];
|
||||
}
|
||||
|
||||
-(IBAction) exitFullScreen:(id)sender
|
||||
{
|
||||
[[CCEAGLView sharedEGLView] setFullScreen:NO];
|
||||
}
|
||||
|
||||
@end
|
|
@ -22,9 +22,15 @@
|
|||
THE SOFTWARE.
|
||||
****************************************************************************/
|
||||
|
||||
#import <Cocoa/Cocoa.h>
|
||||
#include "AppDelegate.h"
|
||||
#include "CCEGLView.h"
|
||||
|
||||
USING_NS_CC;
|
||||
|
||||
int main(int argc, char *argv[])
|
||||
{
|
||||
return NSApplicationMain(argc, (const char **)argv);
|
||||
AppDelegate app;
|
||||
EGLView* eglView = new EGLView();
|
||||
eglView->init("TestCPP",900,640);
|
||||
return Application::getInstance()->run();
|
||||
}
|
|
@ -1,30 +0,0 @@
|
|||
/****************************************************************************
|
||||
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 <Cocoa/Cocoa.h>
|
||||
|
||||
int main(int argc, char *argv[])
|
||||
{
|
||||
return NSApplicationMain(argc, (const char **)argv);
|
||||
}
|
|
@ -24,9 +24,8 @@ int APIENTRY _tWinMain(HINSTANCE hInstance,
|
|||
|
||||
// create the application instance
|
||||
AppDelegate app;
|
||||
auto eglView = EGLView::getInstance();
|
||||
eglView->setViewName("TestLua");
|
||||
eglView->setFrameSize(480, 320);
|
||||
EGLView* eglView = new EGLView();
|
||||
eglView->init("TestCPP",900,640);
|
||||
|
||||
int ret = Application::getInstance()->run();
|
||||
|
||||
|
|
|
@ -1 +1 @@
|
|||
a4b4e22fa9c7b5faa973bb5189ea8db27307df37
|
||||
4e8c32f47e58d52eeb06cbf388d23efacb69a2da
|
Loading…
Reference in New Issue