Skip to content

Commit 4957c72

Browse files
author
yangws
committed
issue #176 add test_win32 project.
1 parent 5b878a7 commit 4957c72

File tree

11 files changed

+252
-63
lines changed

11 files changed

+252
-63
lines changed

Helloworld-win32/Helloworld-win32.cpp

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ using namespace cocos2d;
99

1010
#define IMG_PATH "HelloWorld.png"
1111

12-
static HINSTANCE g_hInstance;
12+
static HINSTANCE s_hInstance;
1313

1414
//////////////////////////////////////////////////////////////////////////
1515
// implement MyLayer
@@ -83,12 +83,13 @@ int APIENTRY _tWinMain(HINSTANCE hInstance,
8383
UNREFERENCED_PARAMETER(hPrevInstance);
8484
UNREFERENCED_PARAMETER(lpCmdLine);
8585

86-
g_hInstance = hInstance;
86+
s_hInstance = hInstance;
8787

88+
int nRet = 0;
8889
HelloWorldApplication app;
8990
if (app.InitInstance() && app.initCocos2d())
9091
{
91-
app.Run();
92+
nRet = app.Run();
9293
}
93-
return 0;
94+
return nRet;
9495
}

Helloworld-win32/Helloworld-win32.vcproj

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -219,10 +219,6 @@
219219
>
220220
</File>
221221
</Filter>
222-
<File
223-
RelativePath=".\ReadMe.txt"
224-
>
225-
</File>
226222
</Files>
227223
<Globals>
228224
</Globals>

Helloworld-win32/ReadMe.txt

Lines changed: 0 additions & 55 deletions
This file was deleted.

cocos2dx-win32.sln

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,8 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "chipmunk-win32", "chipmunk\
1212
EndProject
1313
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Box2D-win32", "Box2D\Box2D-win32.vcproj", "{929480E7-23C0-4DF6-8456-096D71547116}"
1414
EndProject
15+
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "test-win32", "test_win32\test-win32.vcproj", "{76A39BB2-9B84-4C65-98A5-654D86B86F2A}"
16+
EndProject
1517
Global
1618
GlobalSection(SolutionConfigurationPlatforms) = preSolution
1719
Debug|Win32 = Debug|Win32
@@ -34,6 +36,10 @@ Global
3436
{929480E7-23C0-4DF6-8456-096D71547116}.Debug|Win32.Build.0 = Debug|Win32
3537
{929480E7-23C0-4DF6-8456-096D71547116}.Release|Win32.ActiveCfg = Release|Win32
3638
{929480E7-23C0-4DF6-8456-096D71547116}.Release|Win32.Build.0 = Release|Win32
39+
{76A39BB2-9B84-4C65-98A5-654D86B86F2A}.Debug|Win32.ActiveCfg = Debug|Win32
40+
{76A39BB2-9B84-4C65-98A5-654D86B86F2A}.Debug|Win32.Build.0 = Debug|Win32
41+
{76A39BB2-9B84-4C65-98A5-654D86B86F2A}.Release|Win32.ActiveCfg = Release|Win32
42+
{76A39BB2-9B84-4C65-98A5-654D86B86F2A}.Release|Win32.Build.0 = Release|Win32
3743
EndGlobalSection
3844
GlobalSection(SolutionProperties) = preSolution
3945
HideSolutionNode = FALSE

test_win32/application.cpp

Whitespace-only changes.

test_win32/application.h

Whitespace-only changes.

test_win32/mainform.cpp

Whitespace-only changes.

test_win32/mainform.h

Whitespace-only changes.

test_win32/test-win32.vcproj

Lines changed: 203 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,203 @@
1+
<?xml version="1.0" encoding="gb2312"?>
2+
<VisualStudioProject
3+
ProjectType="Visual C++"
4+
Version="9.00"
5+
Name="test-win32"
6+
ProjectGUID="{76A39BB2-9B84-4C65-98A5-654D86B86F2A}"
7+
RootNamespace="test_win32"
8+
Keyword="Win32Proj"
9+
TargetFrameworkVersion="196613"
10+
>
11+
<Platforms>
12+
<Platform
13+
Name="Win32"
14+
/>
15+
</Platforms>
16+
<ToolFiles>
17+
</ToolFiles>
18+
<Configurations>
19+
<Configuration
20+
Name="Debug|Win32"
21+
OutputDirectory="$(SolutionDir)$(ConfigurationName)"
22+
IntermediateDirectory="$(ConfigurationName)"
23+
ConfigurationType="1"
24+
CharacterSet="1"
25+
>
26+
<Tool
27+
Name="VCPreBuildEventTool"
28+
/>
29+
<Tool
30+
Name="VCCustomBuildTool"
31+
/>
32+
<Tool
33+
Name="VCXMLDataGeneratorTool"
34+
/>
35+
<Tool
36+
Name="VCWebServiceProxyGeneratorTool"
37+
/>
38+
<Tool
39+
Name="VCMIDLTool"
40+
/>
41+
<Tool
42+
Name="VCCLCompilerTool"
43+
Optimization="0"
44+
PreprocessorDefinitions="WIN32;_DEBUG;_WINDOWS"
45+
MinimalRebuild="true"
46+
BasicRuntimeChecks="3"
47+
RuntimeLibrary="3"
48+
UsePrecompiledHeader="0"
49+
WarningLevel="3"
50+
DebugInformationFormat="4"
51+
/>
52+
<Tool
53+
Name="VCManagedResourceCompilerTool"
54+
/>
55+
<Tool
56+
Name="VCResourceCompilerTool"
57+
/>
58+
<Tool
59+
Name="VCPreLinkEventTool"
60+
/>
61+
<Tool
62+
Name="VCLinkerTool"
63+
LinkIncremental="2"
64+
GenerateDebugInformation="true"
65+
SubSystem="2"
66+
TargetMachine="1"
67+
/>
68+
<Tool
69+
Name="VCALinkTool"
70+
/>
71+
<Tool
72+
Name="VCManifestTool"
73+
/>
74+
<Tool
75+
Name="VCXDCMakeTool"
76+
/>
77+
<Tool
78+
Name="VCBscMakeTool"
79+
/>
80+
<Tool
81+
Name="VCFxCopTool"
82+
/>
83+
<Tool
84+
Name="VCAppVerifierTool"
85+
/>
86+
<Tool
87+
Name="VCPostBuildEventTool"
88+
/>
89+
</Configuration>
90+
<Configuration
91+
Name="Release|Win32"
92+
OutputDirectory="$(SolutionDir)$(ConfigurationName)"
93+
IntermediateDirectory="$(ConfigurationName)"
94+
ConfigurationType="1"
95+
CharacterSet="1"
96+
WholeProgramOptimization="1"
97+
>
98+
<Tool
99+
Name="VCPreBuildEventTool"
100+
/>
101+
<Tool
102+
Name="VCCustomBuildTool"
103+
/>
104+
<Tool
105+
Name="VCXMLDataGeneratorTool"
106+
/>
107+
<Tool
108+
Name="VCWebServiceProxyGeneratorTool"
109+
/>
110+
<Tool
111+
Name="VCMIDLTool"
112+
/>
113+
<Tool
114+
Name="VCCLCompilerTool"
115+
Optimization="2"
116+
EnableIntrinsicFunctions="true"
117+
PreprocessorDefinitions="WIN32;NDEBUG;_WINDOWS"
118+
RuntimeLibrary="2"
119+
EnableFunctionLevelLinking="true"
120+
UsePrecompiledHeader="0"
121+
WarningLevel="3"
122+
DebugInformationFormat="3"
123+
/>
124+
<Tool
125+
Name="VCManagedResourceCompilerTool"
126+
/>
127+
<Tool
128+
Name="VCResourceCompilerTool"
129+
/>
130+
<Tool
131+
Name="VCPreLinkEventTool"
132+
/>
133+
<Tool
134+
Name="VCLinkerTool"
135+
LinkIncremental="1"
136+
GenerateDebugInformation="true"
137+
SubSystem="2"
138+
OptimizeReferences="2"
139+
EnableCOMDATFolding="2"
140+
TargetMachine="1"
141+
/>
142+
<Tool
143+
Name="VCALinkTool"
144+
/>
145+
<Tool
146+
Name="VCManifestTool"
147+
/>
148+
<Tool
149+
Name="VCXDCMakeTool"
150+
/>
151+
<Tool
152+
Name="VCBscMakeTool"
153+
/>
154+
<Tool
155+
Name="VCFxCopTool"
156+
/>
157+
<Tool
158+
Name="VCAppVerifierTool"
159+
/>
160+
<Tool
161+
Name="VCPostBuildEventTool"
162+
/>
163+
</Configuration>
164+
</Configurations>
165+
<References>
166+
</References>
167+
<Files>
168+
<Filter
169+
Name="include"
170+
>
171+
<File
172+
RelativePath=".\application.h"
173+
>
174+
</File>
175+
<File
176+
RelativePath=".\mainform.h"
177+
>
178+
</File>
179+
<File
180+
RelativePath=".\winmain.h"
181+
>
182+
</File>
183+
</Filter>
184+
<Filter
185+
Name="src"
186+
>
187+
<File
188+
RelativePath=".\application.cpp"
189+
>
190+
</File>
191+
<File
192+
RelativePath=".\mainform.cpp"
193+
>
194+
</File>
195+
<File
196+
RelativePath=".\winmain.cpp"
197+
>
198+
</File>
199+
</Filter>
200+
</Files>
201+
<Globals>
202+
</Globals>
203+
</VisualStudioProject>

test_win32/winmain.cpp

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
#include "winmain.h"
2+
3+
HINSTANCE g_hInstance;
4+
5+
int APIENTRY _tWinMain(HINSTANCE hInstance,
6+
HINSTANCE hPrevInstance,
7+
LPTSTR lpCmdLine,
8+
int nCmdShow)
9+
{
10+
UNREFERENCED_PARAMETER(hPrevInstance);
11+
UNREFERENCED_PARAMETER(lpCmdLine);
12+
13+
g_hInstance = hInstance;
14+
15+
int nRet = 0;
16+
// HelloWorldApplication app;
17+
// if (app.InitInstance() && app.initCocos2d())
18+
// {
19+
// nRet = app.Run();
20+
// }
21+
return nRet;
22+
}

0 commit comments

Comments
 (0)