瀏覽代碼

build: allow to use OpenGL instead of Direct3D in Visual Studio by simply

changing a configuration variable in a file.
legacy
Sam Hocevar sam 12 年之前
父節點
當前提交
6cc678f6f9
共有 6 個文件被更改,包括 27 次插入18 次删除
  1. +13
    -0
      win32/Lol.Core.Build.props
  2. +1
    -0
      win32/Lol.Core.Config.props
  3. +7
    -15
      win32/Lol.Core.Rules.props
  4. +2
    -1
      win32/Lol.Core.Vars.props
  5. +1
    -2
      win32/lolcore.vcxproj
  6. +3
    -0
      win32/lolengine.sln

+ 13
- 0
win32/Lol.Core.Build.props 查看文件

@@ -0,0 +1,13 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup Label="Configuration">

<!-- ======================================== -->
<!-- Global Lol Engine Configuration Settings -->
<!-- ======================================== -->

<!-- Use OpenGL instead of Direct3D? -->
<UseOpenGL>false</UseOpenGL>

</PropertyGroup>
</Project>

+ 1
- 0
win32/Lol.Core.Config.props 查看文件

@@ -1,5 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Import Project="Lol.Core.Build.props" />
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
<PropertyGroup Condition="'$(Configuration)'=='Debug'" Label="Configuration">
<UseDebugLibraries>true</UseDebugLibraries>


+ 7
- 15
win32/Lol.Core.Rules.props 查看文件

@@ -35,10 +35,12 @@
<Link>
<GenerateDebugInformation>true</GenerateDebugInformation>
<!-- FIXME: not for the static library! -->
<AdditionalDependencies Condition="'$(Platform)'=='Win32'">kernel32.lib;user32.lib;gdi32.lib;winspool.lib;comdlg32.lib;advapi32.lib;shell32.lib;ole32.lib;oleaut32.lib;uuid.lib;odbc32.lib;odbccp32.lib;$(SdlDeps);$(GdiDeps);$(GlDeps);$(D3d9Deps);%(AdditionalDependencies)</AdditionalDependencies>
<AdditionalLibraryDirectories Condition="'$(Platform)'=='Win32'">$(SdlLibs);$(GlLibs);$(D3d9Libs);%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
<AdditionalDependencies Condition="'$(Platform)'=='x64'">kernel32.lib;user32.lib;gdi32.lib;winspool.lib;comdlg32.lib;advapi32.lib;shell32.lib;ole32.lib;oleaut32.lib;uuid.lib;odbc32.lib;odbccp32.lib;$(SdlDeps);$(GdiDeps);$(GlDeps);$(D3d9Deps);%(AdditionalDependencies)</AdditionalDependencies>
<AdditionalLibraryDirectories Condition="'$(Platform)'=='x64'">$(SdlLibs);$(GlLibs);$(D3d9Libs);%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
<AdditionalDependencies Condition="'$(Platform)'=='Win32' Or '$(Platform)'=='x64'">kernel32.lib;user32.lib;gdi32.lib;winspool.lib;comdlg32.lib;advapi32.lib;shell32.lib;ole32.lib;oleaut32.lib;uuid.lib;odbc32.lib;odbccp32.lib;$(SdlDeps);$(GdiDeps);%(AdditionalDependencies)</AdditionalDependencies>
<AdditionalDependencies Condition="'$(UseOpenGL)'=='true' And ('$(Platform)'=='Win32' Or '$(Platform)'=='x64')">$(GlDeps);%(AdditionalDependencies)</AdditionalDependencies>
<AdditionalDependencies Condition="'$(UseOpenGL)'=='false' And ('$(Platform)'=='Win32' Or '$(Platform)'=='x64')">$(D3d9Deps);%(AdditionalDependencies)</AdditionalDependencies>
<AdditionalLibraryDirectories Condition="'$(Platform)'=='Win32' Or '$(Platform)'=='x64'">$(SdlLibs);%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
<AdditionalLibraryDirectories Condition="'$(UseOpenGL)'=='true' And ('$(Platform)'=='Win32' Or '$(Platform)'=='x64')">$(GlLibs);%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
<AdditionalLibraryDirectories Condition="'$(UseOpenGL)'=='false' And ('$(Platform)'=='Win32' Or '$(Platform)'=='x64')">$(D3d9Libs);%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
<AdditionalDependencies Condition="'$(Configuration)|$(Platform)'=='Debug|Xbox 360'">xapilibd.lib;d3d9d.lib;d3dx9d.lib;xgraphicsd.lib;xboxkrnl.lib;xnetd.lib;xaudiod2.lib;xactd3.lib;x3daudiod.lib;xmcored.lib;xbdm.lib;vcompd.lib;%(AdditionalDependencies)</AdditionalDependencies>
<AdditionalDependencies Condition="'$(Configuration)|$(Platform)'=='Release|Xbox 360'">xapilib.lib;d3d9.lib;d3dx9.lib;xgraphics.lib;xboxkrnl.lib;xnet.lib;xaudio2.lib;xact3.lib;x3daudio.lib;xmcore.lib;vcomp.lib;%(AdditionalDependencies)</AdditionalDependencies>
</Link>
@@ -48,17 +50,7 @@
</Link>

<!-- FIXME: not for the static library! -->
<PostBuildEvent Condition="'$(Platform)'=='Win32'">
<Command>
set A=$(SdlLibs)
:again
for /f "tokens=1* delims=;" %%I in ("%A%") do (
if not "%%I" == "" xcopy /y /c /d "%%I"\*.dll "$(TargetDir)" &amp;&amp; set A=%%J
if not "%%I" == "" goto again
)
</Command>
</PostBuildEvent>
<PostBuildEvent Condition="'$(Platform)'=='x64'">
<PostBuildEvent Condition="'$(Platform)'=='Win32' Or '$(Platform)'=='x64'">
<Command>
set A=$(SdlLibs)
:again


+ 2
- 1
win32/Lol.Core.Vars.props 查看文件

@@ -42,7 +42,8 @@
<D3d9Deps Condition="'$(Configuration)'=='Release'">d3d9.lib;d3dx9.lib;xinput.lib</D3d9Deps>
<D3d9Deps Condition="'$(Configuration)'=='Debug'">d3d9.lib;d3dx9d.lib;xinput.lib</D3d9Deps>

<Win32Defines>HAVE_SDL_H;USE_SDL;USE_GDIPLUS;USE_D3D9</Win32Defines>
<Win32Defines Condition="'$(UseOpenGL)'=='true'">HAVE_SDL_H;USE_SDL;USE_GDIPLUS;HAVE_GL_2X;USE_GLEW;GLEW_STATIC</Win32Defines>
<Win32Defines Condition="'$(UseOpenGL)'=='false'">HAVE_SDL_H;USE_SDL;USE_GDIPLUS;USE_D3D9</Win32Defines>
<XboxDefines></XboxDefines>
</PropertyGroup>
<PropertyGroup />


+ 1
- 2
win32/lolcore.vcxproj 查看文件

@@ -31,7 +31,7 @@
<ConfigurationType>StaticLibrary</ConfigurationType>
<Keyword>Win32Proj</Keyword>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
<Import Project="Lol.Core.Config.props" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
<UseDebugLibraries>true</UseDebugLibraries>
<CharacterSet>MultiByte</CharacterSet>
@@ -57,7 +57,6 @@
<WholeProgramOptimization>true</WholeProgramOptimization>
<CharacterSet>MultiByte</CharacterSet>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
<ImportGroup Label="ExtensionSettings">
<Import Project="Lol.Fx.props" />
</ImportGroup>


+ 3
- 0
win32/lolengine.sln 查看文件

@@ -70,6 +70,9 @@ EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "orbital", "orbital.vcxproj", "{EE203B88-44CF-4859-9D42-7A5F40FECB52}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Engine", "Engine", "{1AFD580B-98B8-4689-B661-38C41132C60E}"
ProjectSection(SolutionItems) = preProject
Lol.Core.Build.props = Lol.Core.Build.props
EndProjectSection
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Tools", "Tools", "{3D341D8A-E400-4B1D-BC05-B5C35487D9B5}"
EndProject


Loading…
取消
儲存