Mercurial > sdl-ios-xcode
annotate VisualC/tests/testdraw2/testdraw2.vcproj @ 3100:7dc982143c06
Date: Sun, 22 Mar 2009 12:52:29 +0000
From: Luke Benstead
Subject: OpenGL 3.0 Context Creation
I've attached a patch which implements OpenGL 3.x context creation on
the latest SVN. I've added two options to SDL_GL_SetAttribute, these
are SDL_GL_CONTEXT_MAJOR_VERSION and SDL_GL_CONTEXT_MINOR_VERSION.
These default to 2 and 1 respectively. If the major version is less
than 3 then the current context creation method is used, otherwise the
appropriate new context creation function is called (depending on the
platform).
Sample code:
if (SDL_Init(SDL_INIT_VIDEO) != 0) {
printf("Unable to initialize SDL: %s\n", SDL_GetError());
return 1;
}
SDL_GL_SetAttribute(SDL_GL_CONTEXT_MAJOR_VERSION, 3); //Without these 2 lines, SDL will create a GL 2.x context
SDL_GL_SetAttribute(SDL_GL_CONTEXT_MINOR_VERSION, 0);
SDL_GL_SetAttribute(SDL_GL_DOUBLEBUFFER, 1);
SDL_Surface* screen = SDL_SetVideoMode( 640, 480, 16, SDL_OPENGL | SDL_FULLSCREEN );
I've implemented context creation on both Win32 and X and run basic
tests on both. This patch doesn't provide access to all the options
allowed by the new context creation (e.g. shared contexts, forward
compatible contexts) but they can be added pretty easily.
author | Sam Lantinga <slouken@libsdl.org> |
---|---|
date | Tue, 24 Mar 2009 10:43:53 +0000 |
parents | 59e3e0aaa725 |
children |
rev | line source |
---|---|
2924 | 1 <?xml version="1.0" encoding="Windows-1252"?> |
2 <VisualStudioProject | |
3 ProjectType="Visual C++" | |
4 Version="8.00" | |
5 Name="testdraw2" | |
2935
59e3e0aaa725
Added testdraw2 to Visual C++ tests
Sam Lantinga <slouken@libsdl.org>
parents:
2924
diff
changeset
|
6 ProjectGUID="{8682FE1E-0CF6-4EDD-9BB5-1733D8C8B4DF}" |
2924 | 7 > |
8 <Platforms> | |
9 <Platform | |
10 Name="Win32" | |
11 /> | |
12 </Platforms> | |
13 <ToolFiles> | |
14 </ToolFiles> | |
15 <Configurations> | |
16 <Configuration | |
17 Name="Release|Win32" | |
18 OutputDirectory=".\Release" | |
19 IntermediateDirectory=".\Release" | |
20 ConfigurationType="1" | |
21 InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC70.vsprops" | |
22 UseOfMFC="0" | |
23 ATLMinimizesCRunTimeLibraryUsage="false" | |
24 > | |
25 <Tool | |
26 Name="VCPreBuildEventTool" | |
27 /> | |
28 <Tool | |
29 Name="VCCustomBuildTool" | |
30 /> | |
31 <Tool | |
32 Name="VCXMLDataGeneratorTool" | |
33 /> | |
34 <Tool | |
35 Name="VCWebServiceProxyGeneratorTool" | |
36 /> | |
37 <Tool | |
38 Name="VCMIDLTool" | |
39 PreprocessorDefinitions="NDEBUG" | |
40 MkTypLibCompatible="true" | |
41 SuppressStartupBanner="true" | |
42 TargetEnvironment="1" | |
43 TypeLibraryName=".\Release/testdraw2.tlb" | |
44 /> | |
45 <Tool | |
46 Name="VCCLCompilerTool" | |
47 InlineFunctionExpansion="1" | |
48 AdditionalIncludeDirectories="..\..\..\include" | |
49 PreprocessorDefinitions="WIN32,NDEBUG,_WINDOWS" | |
50 StringPooling="true" | |
51 RuntimeLibrary="2" | |
52 EnableFunctionLevelLinking="true" | |
53 UsePrecompiledHeader="0" | |
54 PrecompiledHeaderFile=".\Release/testdraw2.pch" | |
55 AssemblerListingLocation=".\Release/" | |
56 ObjectFile=".\Release/" | |
57 ProgramDataBaseFileName=".\Release/" | |
58 WarningLevel="3" | |
59 SuppressStartupBanner="true" | |
60 CompileAs="0" | |
61 /> | |
62 <Tool | |
63 Name="VCManagedResourceCompilerTool" | |
64 /> | |
65 <Tool | |
66 Name="VCResourceCompilerTool" | |
67 PreprocessorDefinitions="NDEBUG" | |
68 Culture="1033" | |
69 /> | |
70 <Tool | |
71 Name="VCPreLinkEventTool" | |
72 /> | |
73 <Tool | |
74 Name="VCLinkerTool" | |
75 AdditionalOptions="/MACHINE:I386" | |
76 OutputFile=".\Release/testdraw2.exe" | |
77 LinkIncremental="1" | |
78 SuppressStartupBanner="true" | |
79 ProgramDatabaseFile=".\Release/testdraw2.pdb" | |
80 SubSystem="2" | |
81 /> | |
82 <Tool | |
83 Name="VCALinkTool" | |
84 /> | |
85 <Tool | |
86 Name="VCManifestTool" | |
87 /> | |
88 <Tool | |
89 Name="VCXDCMakeTool" | |
90 /> | |
91 <Tool | |
92 Name="VCBscMakeTool" | |
93 /> | |
94 <Tool | |
95 Name="VCFxCopTool" | |
96 /> | |
97 <Tool | |
98 Name="VCAppVerifierTool" | |
99 /> | |
100 <Tool | |
101 Name="VCWebDeploymentTool" | |
102 /> | |
103 <Tool | |
104 Name="VCPostBuildEventTool" | |
105 /> | |
106 </Configuration> | |
107 <Configuration | |
108 Name="Debug|Win32" | |
109 OutputDirectory=".\Debug" | |
110 IntermediateDirectory=".\Debug" | |
111 ConfigurationType="1" | |
112 InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC70.vsprops" | |
113 UseOfMFC="0" | |
114 ATLMinimizesCRunTimeLibraryUsage="false" | |
115 > | |
116 <Tool | |
117 Name="VCPreBuildEventTool" | |
118 /> | |
119 <Tool | |
120 Name="VCCustomBuildTool" | |
121 /> | |
122 <Tool | |
123 Name="VCXMLDataGeneratorTool" | |
124 /> | |
125 <Tool | |
126 Name="VCWebServiceProxyGeneratorTool" | |
127 /> | |
128 <Tool | |
129 Name="VCMIDLTool" | |
130 PreprocessorDefinitions="_DEBUG" | |
131 MkTypLibCompatible="true" | |
132 SuppressStartupBanner="true" | |
133 TargetEnvironment="1" | |
134 TypeLibraryName=".\Debug/testdraw2.tlb" | |
135 /> | |
136 <Tool | |
137 Name="VCCLCompilerTool" | |
138 Optimization="0" | |
139 AdditionalIncludeDirectories="..\..\..\include" | |
140 PreprocessorDefinitions="WIN32,_DEBUG,_WINDOWS" | |
141 RuntimeLibrary="2" | |
142 UsePrecompiledHeader="0" | |
143 PrecompiledHeaderFile=".\Debug/testdraw2.pch" | |
144 AssemblerListingLocation=".\Debug/" | |
145 ObjectFile=".\Debug/" | |
146 ProgramDataBaseFileName=".\Debug/" | |
147 WarningLevel="3" | |
148 SuppressStartupBanner="true" | |
149 DebugInformationFormat="4" | |
150 CompileAs="0" | |
151 /> | |
152 <Tool | |
153 Name="VCManagedResourceCompilerTool" | |
154 /> | |
155 <Tool | |
156 Name="VCResourceCompilerTool" | |
157 PreprocessorDefinitions="_DEBUG" | |
158 Culture="1033" | |
159 /> | |
160 <Tool | |
161 Name="VCPreLinkEventTool" | |
162 /> | |
163 <Tool | |
164 Name="VCLinkerTool" | |
165 AdditionalOptions="/MACHINE:I386" | |
166 OutputFile=".\Debug/testdraw2.exe" | |
167 LinkIncremental="2" | |
168 SuppressStartupBanner="true" | |
169 GenerateDebugInformation="true" | |
170 ProgramDatabaseFile=".\Debug/testdraw2.pdb" | |
171 SubSystem="2" | |
172 /> | |
173 <Tool | |
174 Name="VCALinkTool" | |
175 /> | |
176 <Tool | |
177 Name="VCManifestTool" | |
178 /> | |
179 <Tool | |
180 Name="VCXDCMakeTool" | |
181 /> | |
182 <Tool | |
183 Name="VCBscMakeTool" | |
184 /> | |
185 <Tool | |
186 Name="VCFxCopTool" | |
187 /> | |
188 <Tool | |
189 Name="VCAppVerifierTool" | |
190 /> | |
191 <Tool | |
192 Name="VCWebDeploymentTool" | |
193 /> | |
194 <Tool | |
195 Name="VCPostBuildEventTool" | |
196 /> | |
197 </Configuration> | |
198 </Configurations> | |
199 <References> | |
200 </References> | |
201 <Files> | |
202 <File | |
203 RelativePath="..\..\..\test\common.c" | |
204 > | |
205 </File> | |
206 <File | |
207 RelativePath="..\..\Sdl\Debug\SDL.lib" | |
208 > | |
209 </File> | |
210 <File | |
211 RelativePath="..\..\SDLmain\Debug\SDLmain.lib" | |
212 > | |
213 </File> | |
214 <File | |
215 RelativePath="..\..\..\test\testdraw2.c" | |
216 > | |
217 </File> | |
218 </Files> | |
219 <Globals> | |
220 </Globals> | |
221 </VisualStudioProject> |