OLD | NEW |
1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #ifndef WIN32 | |
6 | |
7 #include "CCStdC.h" | 5 #include "CCStdC.h" |
8 #include "cocos2d.h" | 6 #include "cocos2d.h" |
9 #include "CCInstance.h" | 7 #include "CCInstance.h" |
10 #include "CCModule.h" | 8 #include "CCModule.h" |
11 | 9 |
12 #include <stdlib.h> | 10 #include <stdlib.h> |
13 #include <stdio.h> | 11 #include <stdio.h> |
14 #include <unistd.h> | 12 #include <unistd.h> |
15 #include <string> | 13 #include <string> |
16 #include <fcntl.h> | 14 #include <fcntl.h> |
(...skipping 22 matching lines...) Expand all Loading... |
39 int rtn = CCApplication::sharedApplication()->run(); | 37 int rtn = CCApplication::sharedApplication()->run(); |
40 fprintf(stderr, "app run returned: %d\n", rtn); | 38 fprintf(stderr, "app run returned: %d\n", rtn); |
41 return NULL; | 39 return NULL; |
42 } | 40 } |
43 | 41 |
44 namespace pp { | 42 namespace pp { |
45 Module* CreateModule() { | 43 Module* CreateModule() { |
46 return new CocosPepperModule(); | 44 return new CocosPepperModule(); |
47 } | 45 } |
48 } | 46 } |
49 | |
50 #else | |
51 | |
52 #define WIN32_LEAN_AND_MEAN // Exclude rarely-used stuff from Window
s headers | |
53 // Windows Header Files: | |
54 #include <windows.h> | |
55 #include <tchar.h> | |
56 | |
57 // C RunTime Header Files | |
58 #include "CCStdC.h" | |
59 | |
60 | |
61 #include "app_delegate.h" | |
62 #include "CCEGLView.h" | |
63 | |
64 USING_NS_CC; | |
65 AppDelegate g_app; | |
66 | |
67 int APIENTRY _tWinMain(HINSTANCE hInstance, | |
68 HINSTANCE hPrevInstance, | |
69 LPTSTR lpCmdLine, | |
70 int nCmdShow) | |
71 { | |
72 UNREFERENCED_PARAMETER(hPrevInstance); | |
73 UNREFERENCED_PARAMETER(lpCmdLine); | |
74 | |
75 // create the application instance | |
76 CCEGLView* eglView = CCEGLView::sharedOpenGLView(); | |
77 eglView->setViewName("HelloCpp"); | |
78 eglView->setFrameSize(2048, 1536); | |
79 // The resolution of ipad3 is very large. In general, PC's resolution is sma
ller than it. | |
80 // So we need to invoke 'setFrameZoomFactor'(only valid on desktop(win32, ma
c, linux)) to make the window smaller. | |
81 eglView->setFrameZoomFactor(0.4f); | |
82 return CCApplication::sharedApplication()->run(); | |
83 } | |
84 | |
85 #endif | |
OLD | NEW |