зеркало из https://github.com/microsoft/DirectXTK.git
Normalize line endings
This commit is contained in:
Родитель
e2d2af78ea
Коммит
a503a1cd35
|
@ -1,197 +1,197 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project DefaultTargets="Build" ToolsVersion="12.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<ItemGroup Label="ProjectConfigurations">
|
||||
<ProjectConfiguration Include="Debug|Win32">
|
||||
<Configuration>Debug</Configuration>
|
||||
<Platform>Win32</Platform>
|
||||
</ProjectConfiguration>
|
||||
<ProjectConfiguration Include="Debug|x64">
|
||||
<Configuration>Debug</Configuration>
|
||||
<Platform>x64</Platform>
|
||||
</ProjectConfiguration>
|
||||
<ProjectConfiguration Include="Release|Win32">
|
||||
<Configuration>Release</Configuration>
|
||||
<Platform>Win32</Platform>
|
||||
</ProjectConfiguration>
|
||||
<ProjectConfiguration Include="Release|x64">
|
||||
<Configuration>Release</Configuration>
|
||||
<Platform>x64</Platform>
|
||||
</ProjectConfiguration>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ClInclude Include="..\Inc\Audio.h" />
|
||||
<ClInclude Include="SoundCommon.h" />
|
||||
<ClInclude Include="WaveBankReader.h" />
|
||||
<ClInclude Include="WAVFileReader.h" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ClCompile Include="AudioEngine.cpp">
|
||||
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">Create</PrecompiledHeader>
|
||||
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">Create</PrecompiledHeader>
|
||||
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">Create</PrecompiledHeader>
|
||||
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Release|x64'">Create</PrecompiledHeader>
|
||||
</ClCompile>
|
||||
<ClCompile Include="DynamicSoundEffectInstance.cpp" />
|
||||
<ClCompile Include="SoundCommon.cpp" />
|
||||
<ClCompile Include="SoundEffect.cpp" />
|
||||
<ClCompile Include="SoundEffectInstance.cpp" />
|
||||
<ClCompile Include="WaveBank.cpp" />
|
||||
<ClCompile Include="WaveBankReader.cpp" />
|
||||
<ClCompile Include="WAVFileReader.cpp" />
|
||||
</ItemGroup>
|
||||
<PropertyGroup Label="Globals">
|
||||
<ProjectGuid>{4F150A30-CECB-49D1-8283-6A3F57438CF5}</ProjectGuid>
|
||||
<Keyword>Win32Proj</Keyword>
|
||||
<RootNamespace>DirectXTKAudioDX</RootNamespace>
|
||||
</PropertyGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
|
||||
<ConfigurationType>StaticLibrary</ConfigurationType>
|
||||
<UseDebugLibraries>true</UseDebugLibraries>
|
||||
<PlatformToolset>v120</PlatformToolset>
|
||||
<CharacterSet>Unicode</CharacterSet>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
|
||||
<ConfigurationType>StaticLibrary</ConfigurationType>
|
||||
<UseDebugLibraries>true</UseDebugLibraries>
|
||||
<PlatformToolset>v120</PlatformToolset>
|
||||
<CharacterSet>Unicode</CharacterSet>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
|
||||
<ConfigurationType>StaticLibrary</ConfigurationType>
|
||||
<UseDebugLibraries>false</UseDebugLibraries>
|
||||
<PlatformToolset>v120</PlatformToolset>
|
||||
<CharacterSet>Unicode</CharacterSet>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
|
||||
<ConfigurationType>StaticLibrary</ConfigurationType>
|
||||
<UseDebugLibraries>false</UseDebugLibraries>
|
||||
<PlatformToolset>v120</PlatformToolset>
|
||||
<CharacterSet>Unicode</CharacterSet>
|
||||
</PropertyGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
|
||||
<ImportGroup Label="ExtensionSettings">
|
||||
</ImportGroup>
|
||||
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
|
||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||
</ImportGroup>
|
||||
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="PropertySheets">
|
||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||
</ImportGroup>
|
||||
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
|
||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||
</ImportGroup>
|
||||
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="PropertySheets">
|
||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||
</ImportGroup>
|
||||
<PropertyGroup Label="UserMacros" />
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
|
||||
<OutDir>Bin\Desktop_2013_DXSDK\$(Platform)\$(Configuration)\</OutDir>
|
||||
<IntDir>Bin\Desktop_2013_DXSDK\$(Platform)\$(Configuration)\</IntDir>
|
||||
<TargetName>DirectXTKAudioDX</TargetName>
|
||||
<ExecutablePath>$(ExecutablePath);$(DXSDK_DIR)Utilities\bin\x86</ExecutablePath>
|
||||
<IncludePath>$(IncludePath);$(DXSDK_DIR)Include</IncludePath>
|
||||
<LibraryPath>$(LibraryPath);$(DXSDK_DIR)Lib\x86</LibraryPath>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
|
||||
<OutDir>Bin\Desktop_2013_DXSDK\$(Platform)\$(Configuration)\</OutDir>
|
||||
<IntDir>Bin\Desktop_2013_DXSDK\$(Platform)\$(Configuration)\</IntDir>
|
||||
<TargetName>DirectXTKAudioDX</TargetName>
|
||||
<ExecutablePath>$(ExecutablePath);$(DXSDK_DIR)Utilities\bin\x64;$(DXSDK_DIR)Utilities\bin\x86</ExecutablePath>
|
||||
<IncludePath>$(IncludePath);$(DXSDK_DIR)Include</IncludePath>
|
||||
<LibraryPath>$(LibraryPath);$(DXSDK_DIR)Lib\x64;</LibraryPath>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
|
||||
<OutDir>Bin\Desktop_2013_DXSDK\$(Platform)\$(Configuration)\</OutDir>
|
||||
<IntDir>Bin\Desktop_2013_DXSDK\$(Platform)\$(Configuration)\</IntDir>
|
||||
<TargetName>DirectXTKAudioDX</TargetName>
|
||||
<ExecutablePath>$(ExecutablePath);$(DXSDK_DIR)Utilities\bin\x86</ExecutablePath>
|
||||
<IncludePath>$(IncludePath);$(DXSDK_DIR)Include</IncludePath>
|
||||
<LibraryPath>$(LibraryPath);$(DXSDK_DIR)Lib\x86</LibraryPath>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
|
||||
<OutDir>Bin\Desktop_2013_DXSDK\$(Platform)\$(Configuration)\</OutDir>
|
||||
<IntDir>Bin\Desktop_2013_DXSDK\$(Platform)\$(Configuration)\</IntDir>
|
||||
<TargetName>DirectXTKAudioDX</TargetName>
|
||||
<ExecutablePath>$(ExecutablePath);$(DXSDK_DIR)Utilities\bin\x64;$(DXSDK_DIR)Utilities\bin\x86</ExecutablePath>
|
||||
<IncludePath>$(IncludePath);$(DXSDK_DIR)Include</IncludePath>
|
||||
<LibraryPath>$(LibraryPath);$(DXSDK_DIR)Lib\x64;</LibraryPath>
|
||||
</PropertyGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
|
||||
<ClCompile>
|
||||
<PrecompiledHeader>Use</PrecompiledHeader>
|
||||
<WarningLevel>Level4</WarningLevel>
|
||||
<Optimization>Disabled</Optimization>
|
||||
<PreprocessorDefinitions>_WIN32_WINNT=0x0600;WIN32;_DEBUG;_LIB;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<AdditionalIncludeDirectories>..\Inc;..\Src;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
<EnableEnhancedInstructionSet>StreamingSIMDExtensions2</EnableEnhancedInstructionSet>
|
||||
<FloatingPointModel>Fast</FloatingPointModel>
|
||||
<ProgramDataBaseFileName>$(IntDir)$(TargetName).pdb</ProgramDataBaseFileName>
|
||||
<PrecompiledHeaderFile>pch.h</PrecompiledHeaderFile>
|
||||
</ClCompile>
|
||||
<Link>
|
||||
<SubSystem>Windows</SubSystem>
|
||||
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||
</Link>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
|
||||
<ClCompile>
|
||||
<PrecompiledHeader>Use</PrecompiledHeader>
|
||||
<WarningLevel>Level4</WarningLevel>
|
||||
<Optimization>Disabled</Optimization>
|
||||
<PreprocessorDefinitions>_WIN32_WINNT=0x0600;WIN32;_DEBUG;_LIB;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<AdditionalIncludeDirectories>..\Inc;..\Src;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
<FloatingPointModel>Fast</FloatingPointModel>
|
||||
<ProgramDataBaseFileName>$(IntDir)$(TargetName).pdb</ProgramDataBaseFileName>
|
||||
<PrecompiledHeaderFile>pch.h</PrecompiledHeaderFile>
|
||||
</ClCompile>
|
||||
<Link>
|
||||
<SubSystem>Windows</SubSystem>
|
||||
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||
</Link>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
|
||||
<ClCompile>
|
||||
<WarningLevel>Level4</WarningLevel>
|
||||
<PrecompiledHeader>Use</PrecompiledHeader>
|
||||
<Optimization>MaxSpeed</Optimization>
|
||||
<FunctionLevelLinking>true</FunctionLevelLinking>
|
||||
<IntrinsicFunctions>true</IntrinsicFunctions>
|
||||
<PreprocessorDefinitions>_WIN32_WINNT=0x0600;WIN32;NDEBUG;_LIB;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<AdditionalIncludeDirectories>..\Inc;..\Src;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
<EnableEnhancedInstructionSet>StreamingSIMDExtensions2</EnableEnhancedInstructionSet>
|
||||
<FloatingPointModel>Fast</FloatingPointModel>
|
||||
<ProgramDataBaseFileName>$(IntDir)$(TargetName).pdb</ProgramDataBaseFileName>
|
||||
<PrecompiledHeaderFile>pch.h</PrecompiledHeaderFile>
|
||||
</ClCompile>
|
||||
<Link>
|
||||
<SubSystem>Windows</SubSystem>
|
||||
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||
<EnableCOMDATFolding>true</EnableCOMDATFolding>
|
||||
<OptimizeReferences>true</OptimizeReferences>
|
||||
</Link>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
|
||||
<ClCompile>
|
||||
<WarningLevel>Level4</WarningLevel>
|
||||
<PrecompiledHeader>Use</PrecompiledHeader>
|
||||
<Optimization>MaxSpeed</Optimization>
|
||||
<FunctionLevelLinking>true</FunctionLevelLinking>
|
||||
<IntrinsicFunctions>true</IntrinsicFunctions>
|
||||
<PreprocessorDefinitions>_WIN32_WINNT=0x0600;WIN32;NDEBUG;_LIB;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<AdditionalIncludeDirectories>..\Inc;..\Src;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
<FloatingPointModel>Fast</FloatingPointModel>
|
||||
<ProgramDataBaseFileName>$(IntDir)$(TargetName).pdb</ProgramDataBaseFileName>
|
||||
<PrecompiledHeaderFile>pch.h</PrecompiledHeaderFile>
|
||||
</ClCompile>
|
||||
<Link>
|
||||
<SubSystem>Windows</SubSystem>
|
||||
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||
<EnableCOMDATFolding>true</EnableCOMDATFolding>
|
||||
<OptimizeReferences>true</OptimizeReferences>
|
||||
</Link>
|
||||
</ItemDefinitionGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
|
||||
<ImportGroup Label="ExtensionTargets">
|
||||
</ImportGroup>
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project DefaultTargets="Build" ToolsVersion="12.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<ItemGroup Label="ProjectConfigurations">
|
||||
<ProjectConfiguration Include="Debug|Win32">
|
||||
<Configuration>Debug</Configuration>
|
||||
<Platform>Win32</Platform>
|
||||
</ProjectConfiguration>
|
||||
<ProjectConfiguration Include="Debug|x64">
|
||||
<Configuration>Debug</Configuration>
|
||||
<Platform>x64</Platform>
|
||||
</ProjectConfiguration>
|
||||
<ProjectConfiguration Include="Release|Win32">
|
||||
<Configuration>Release</Configuration>
|
||||
<Platform>Win32</Platform>
|
||||
</ProjectConfiguration>
|
||||
<ProjectConfiguration Include="Release|x64">
|
||||
<Configuration>Release</Configuration>
|
||||
<Platform>x64</Platform>
|
||||
</ProjectConfiguration>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ClInclude Include="..\Inc\Audio.h" />
|
||||
<ClInclude Include="SoundCommon.h" />
|
||||
<ClInclude Include="WaveBankReader.h" />
|
||||
<ClInclude Include="WAVFileReader.h" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ClCompile Include="AudioEngine.cpp">
|
||||
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">Create</PrecompiledHeader>
|
||||
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">Create</PrecompiledHeader>
|
||||
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">Create</PrecompiledHeader>
|
||||
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Release|x64'">Create</PrecompiledHeader>
|
||||
</ClCompile>
|
||||
<ClCompile Include="DynamicSoundEffectInstance.cpp" />
|
||||
<ClCompile Include="SoundCommon.cpp" />
|
||||
<ClCompile Include="SoundEffect.cpp" />
|
||||
<ClCompile Include="SoundEffectInstance.cpp" />
|
||||
<ClCompile Include="WaveBank.cpp" />
|
||||
<ClCompile Include="WaveBankReader.cpp" />
|
||||
<ClCompile Include="WAVFileReader.cpp" />
|
||||
</ItemGroup>
|
||||
<PropertyGroup Label="Globals">
|
||||
<ProjectGuid>{4F150A30-CECB-49D1-8283-6A3F57438CF5}</ProjectGuid>
|
||||
<Keyword>Win32Proj</Keyword>
|
||||
<RootNamespace>DirectXTKAudioDX</RootNamespace>
|
||||
</PropertyGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
|
||||
<ConfigurationType>StaticLibrary</ConfigurationType>
|
||||
<UseDebugLibraries>true</UseDebugLibraries>
|
||||
<PlatformToolset>v120</PlatformToolset>
|
||||
<CharacterSet>Unicode</CharacterSet>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
|
||||
<ConfigurationType>StaticLibrary</ConfigurationType>
|
||||
<UseDebugLibraries>true</UseDebugLibraries>
|
||||
<PlatformToolset>v120</PlatformToolset>
|
||||
<CharacterSet>Unicode</CharacterSet>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
|
||||
<ConfigurationType>StaticLibrary</ConfigurationType>
|
||||
<UseDebugLibraries>false</UseDebugLibraries>
|
||||
<PlatformToolset>v120</PlatformToolset>
|
||||
<CharacterSet>Unicode</CharacterSet>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
|
||||
<ConfigurationType>StaticLibrary</ConfigurationType>
|
||||
<UseDebugLibraries>false</UseDebugLibraries>
|
||||
<PlatformToolset>v120</PlatformToolset>
|
||||
<CharacterSet>Unicode</CharacterSet>
|
||||
</PropertyGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
|
||||
<ImportGroup Label="ExtensionSettings">
|
||||
</ImportGroup>
|
||||
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
|
||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||
</ImportGroup>
|
||||
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="PropertySheets">
|
||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||
</ImportGroup>
|
||||
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
|
||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||
</ImportGroup>
|
||||
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="PropertySheets">
|
||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||
</ImportGroup>
|
||||
<PropertyGroup Label="UserMacros" />
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
|
||||
<OutDir>Bin\Desktop_2013_DXSDK\$(Platform)\$(Configuration)\</OutDir>
|
||||
<IntDir>Bin\Desktop_2013_DXSDK\$(Platform)\$(Configuration)\</IntDir>
|
||||
<TargetName>DirectXTKAudioDX</TargetName>
|
||||
<ExecutablePath>$(ExecutablePath);$(DXSDK_DIR)Utilities\bin\x86</ExecutablePath>
|
||||
<IncludePath>$(IncludePath);$(DXSDK_DIR)Include</IncludePath>
|
||||
<LibraryPath>$(LibraryPath);$(DXSDK_DIR)Lib\x86</LibraryPath>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
|
||||
<OutDir>Bin\Desktop_2013_DXSDK\$(Platform)\$(Configuration)\</OutDir>
|
||||
<IntDir>Bin\Desktop_2013_DXSDK\$(Platform)\$(Configuration)\</IntDir>
|
||||
<TargetName>DirectXTKAudioDX</TargetName>
|
||||
<ExecutablePath>$(ExecutablePath);$(DXSDK_DIR)Utilities\bin\x64;$(DXSDK_DIR)Utilities\bin\x86</ExecutablePath>
|
||||
<IncludePath>$(IncludePath);$(DXSDK_DIR)Include</IncludePath>
|
||||
<LibraryPath>$(LibraryPath);$(DXSDK_DIR)Lib\x64;</LibraryPath>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
|
||||
<OutDir>Bin\Desktop_2013_DXSDK\$(Platform)\$(Configuration)\</OutDir>
|
||||
<IntDir>Bin\Desktop_2013_DXSDK\$(Platform)\$(Configuration)\</IntDir>
|
||||
<TargetName>DirectXTKAudioDX</TargetName>
|
||||
<ExecutablePath>$(ExecutablePath);$(DXSDK_DIR)Utilities\bin\x86</ExecutablePath>
|
||||
<IncludePath>$(IncludePath);$(DXSDK_DIR)Include</IncludePath>
|
||||
<LibraryPath>$(LibraryPath);$(DXSDK_DIR)Lib\x86</LibraryPath>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
|
||||
<OutDir>Bin\Desktop_2013_DXSDK\$(Platform)\$(Configuration)\</OutDir>
|
||||
<IntDir>Bin\Desktop_2013_DXSDK\$(Platform)\$(Configuration)\</IntDir>
|
||||
<TargetName>DirectXTKAudioDX</TargetName>
|
||||
<ExecutablePath>$(ExecutablePath);$(DXSDK_DIR)Utilities\bin\x64;$(DXSDK_DIR)Utilities\bin\x86</ExecutablePath>
|
||||
<IncludePath>$(IncludePath);$(DXSDK_DIR)Include</IncludePath>
|
||||
<LibraryPath>$(LibraryPath);$(DXSDK_DIR)Lib\x64;</LibraryPath>
|
||||
</PropertyGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
|
||||
<ClCompile>
|
||||
<PrecompiledHeader>Use</PrecompiledHeader>
|
||||
<WarningLevel>Level4</WarningLevel>
|
||||
<Optimization>Disabled</Optimization>
|
||||
<PreprocessorDefinitions>_WIN32_WINNT=0x0600;WIN32;_DEBUG;_LIB;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<AdditionalIncludeDirectories>..\Inc;..\Src;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
<EnableEnhancedInstructionSet>StreamingSIMDExtensions2</EnableEnhancedInstructionSet>
|
||||
<FloatingPointModel>Fast</FloatingPointModel>
|
||||
<ProgramDataBaseFileName>$(IntDir)$(TargetName).pdb</ProgramDataBaseFileName>
|
||||
<PrecompiledHeaderFile>pch.h</PrecompiledHeaderFile>
|
||||
</ClCompile>
|
||||
<Link>
|
||||
<SubSystem>Windows</SubSystem>
|
||||
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||
</Link>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
|
||||
<ClCompile>
|
||||
<PrecompiledHeader>Use</PrecompiledHeader>
|
||||
<WarningLevel>Level4</WarningLevel>
|
||||
<Optimization>Disabled</Optimization>
|
||||
<PreprocessorDefinitions>_WIN32_WINNT=0x0600;WIN32;_DEBUG;_LIB;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<AdditionalIncludeDirectories>..\Inc;..\Src;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
<FloatingPointModel>Fast</FloatingPointModel>
|
||||
<ProgramDataBaseFileName>$(IntDir)$(TargetName).pdb</ProgramDataBaseFileName>
|
||||
<PrecompiledHeaderFile>pch.h</PrecompiledHeaderFile>
|
||||
</ClCompile>
|
||||
<Link>
|
||||
<SubSystem>Windows</SubSystem>
|
||||
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||
</Link>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
|
||||
<ClCompile>
|
||||
<WarningLevel>Level4</WarningLevel>
|
||||
<PrecompiledHeader>Use</PrecompiledHeader>
|
||||
<Optimization>MaxSpeed</Optimization>
|
||||
<FunctionLevelLinking>true</FunctionLevelLinking>
|
||||
<IntrinsicFunctions>true</IntrinsicFunctions>
|
||||
<PreprocessorDefinitions>_WIN32_WINNT=0x0600;WIN32;NDEBUG;_LIB;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<AdditionalIncludeDirectories>..\Inc;..\Src;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
<EnableEnhancedInstructionSet>StreamingSIMDExtensions2</EnableEnhancedInstructionSet>
|
||||
<FloatingPointModel>Fast</FloatingPointModel>
|
||||
<ProgramDataBaseFileName>$(IntDir)$(TargetName).pdb</ProgramDataBaseFileName>
|
||||
<PrecompiledHeaderFile>pch.h</PrecompiledHeaderFile>
|
||||
</ClCompile>
|
||||
<Link>
|
||||
<SubSystem>Windows</SubSystem>
|
||||
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||
<EnableCOMDATFolding>true</EnableCOMDATFolding>
|
||||
<OptimizeReferences>true</OptimizeReferences>
|
||||
</Link>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
|
||||
<ClCompile>
|
||||
<WarningLevel>Level4</WarningLevel>
|
||||
<PrecompiledHeader>Use</PrecompiledHeader>
|
||||
<Optimization>MaxSpeed</Optimization>
|
||||
<FunctionLevelLinking>true</FunctionLevelLinking>
|
||||
<IntrinsicFunctions>true</IntrinsicFunctions>
|
||||
<PreprocessorDefinitions>_WIN32_WINNT=0x0600;WIN32;NDEBUG;_LIB;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<AdditionalIncludeDirectories>..\Inc;..\Src;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
<FloatingPointModel>Fast</FloatingPointModel>
|
||||
<ProgramDataBaseFileName>$(IntDir)$(TargetName).pdb</ProgramDataBaseFileName>
|
||||
<PrecompiledHeaderFile>pch.h</PrecompiledHeaderFile>
|
||||
</ClCompile>
|
||||
<Link>
|
||||
<SubSystem>Windows</SubSystem>
|
||||
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||
<EnableCOMDATFolding>true</EnableCOMDATFolding>
|
||||
<OptimizeReferences>true</OptimizeReferences>
|
||||
</Link>
|
||||
</ItemDefinitionGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
|
||||
<ImportGroup Label="ExtensionTargets">
|
||||
</ImportGroup>
|
||||
</Project>
|
|
@ -1,53 +1,53 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<ItemGroup>
|
||||
<Filter Include="Inc">
|
||||
<UniqueIdentifier>{93995380-89BD-4b04-88EB-625FBE52EBFB}</UniqueIdentifier>
|
||||
<Extensions>h;hpp;hxx;hm;inl;inc;xsd</Extensions>
|
||||
</Filter>
|
||||
<Filter Include="Src">
|
||||
<UniqueIdentifier>{4FC737F1-C7A5-4376-A066-2A32D752A2FF}</UniqueIdentifier>
|
||||
<Extensions>cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx</Extensions>
|
||||
</Filter>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ClInclude Include="WaveBankReader.h">
|
||||
<Filter>Inc</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="WAVFileReader.h">
|
||||
<Filter>Inc</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\Inc\Audio.h">
|
||||
<Filter>Inc</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="SoundCommon.h">
|
||||
<Filter>Inc</Filter>
|
||||
</ClInclude>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ClCompile Include="AudioEngine.cpp">
|
||||
<Filter>Src</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="WaveBankReader.cpp">
|
||||
<Filter>Src</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="WAVFileReader.cpp">
|
||||
<Filter>Src</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="SoundEffect.cpp">
|
||||
<Filter>Src</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="WaveBank.cpp">
|
||||
<Filter>Src</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="SoundEffectInstance.cpp">
|
||||
<Filter>Src</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="SoundCommon.cpp">
|
||||
<Filter>Src</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="DynamicSoundEffectInstance.cpp">
|
||||
<Filter>Src</Filter>
|
||||
</ClCompile>
|
||||
</ItemGroup>
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<ItemGroup>
|
||||
<Filter Include="Inc">
|
||||
<UniqueIdentifier>{93995380-89BD-4b04-88EB-625FBE52EBFB}</UniqueIdentifier>
|
||||
<Extensions>h;hpp;hxx;hm;inl;inc;xsd</Extensions>
|
||||
</Filter>
|
||||
<Filter Include="Src">
|
||||
<UniqueIdentifier>{4FC737F1-C7A5-4376-A066-2A32D752A2FF}</UniqueIdentifier>
|
||||
<Extensions>cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx</Extensions>
|
||||
</Filter>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ClInclude Include="WaveBankReader.h">
|
||||
<Filter>Inc</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="WAVFileReader.h">
|
||||
<Filter>Inc</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\Inc\Audio.h">
|
||||
<Filter>Inc</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="SoundCommon.h">
|
||||
<Filter>Inc</Filter>
|
||||
</ClInclude>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ClCompile Include="AudioEngine.cpp">
|
||||
<Filter>Src</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="WaveBankReader.cpp">
|
||||
<Filter>Src</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="WAVFileReader.cpp">
|
||||
<Filter>Src</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="SoundEffect.cpp">
|
||||
<Filter>Src</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="WaveBank.cpp">
|
||||
<Filter>Src</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="SoundEffectInstance.cpp">
|
||||
<Filter>Src</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="SoundCommon.cpp">
|
||||
<Filter>Src</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="DynamicSoundEffectInstance.cpp">
|
||||
<Filter>Src</Filter>
|
||||
</ClCompile>
|
||||
</ItemGroup>
|
||||
</Project>
|
|
@ -1,185 +1,185 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project DefaultTargets="Build" ToolsVersion="12.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<ItemGroup Label="ProjectConfigurations">
|
||||
<ProjectConfiguration Include="Debug|Win32">
|
||||
<Configuration>Debug</Configuration>
|
||||
<Platform>Win32</Platform>
|
||||
</ProjectConfiguration>
|
||||
<ProjectConfiguration Include="Debug|x64">
|
||||
<Configuration>Debug</Configuration>
|
||||
<Platform>x64</Platform>
|
||||
</ProjectConfiguration>
|
||||
<ProjectConfiguration Include="Release|Win32">
|
||||
<Configuration>Release</Configuration>
|
||||
<Platform>Win32</Platform>
|
||||
</ProjectConfiguration>
|
||||
<ProjectConfiguration Include="Release|x64">
|
||||
<Configuration>Release</Configuration>
|
||||
<Platform>x64</Platform>
|
||||
</ProjectConfiguration>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ClInclude Include="..\Inc\Audio.h" />
|
||||
<ClInclude Include="SoundCommon.h" />
|
||||
<ClInclude Include="WaveBankReader.h" />
|
||||
<ClInclude Include="WAVFileReader.h" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ClCompile Include="AudioEngine.cpp">
|
||||
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">Create</PrecompiledHeader>
|
||||
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">Create</PrecompiledHeader>
|
||||
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">Create</PrecompiledHeader>
|
||||
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Release|x64'">Create</PrecompiledHeader>
|
||||
</ClCompile>
|
||||
<ClCompile Include="DynamicSoundEffectInstance.cpp" />
|
||||
<ClCompile Include="SoundCommon.cpp" />
|
||||
<ClCompile Include="SoundEffect.cpp" />
|
||||
<ClCompile Include="SoundEffectInstance.cpp" />
|
||||
<ClCompile Include="WaveBank.cpp" />
|
||||
<ClCompile Include="WaveBankReader.cpp" />
|
||||
<ClCompile Include="WAVFileReader.cpp" />
|
||||
</ItemGroup>
|
||||
<PropertyGroup Label="Globals">
|
||||
<ProjectGuid>{4F150A30-CECB-49D1-8283-6A3F57438CF5}</ProjectGuid>
|
||||
<Keyword>Win32Proj</Keyword>
|
||||
<RootNamespace>DirectXTKAudio</RootNamespace>
|
||||
</PropertyGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
|
||||
<ConfigurationType>StaticLibrary</ConfigurationType>
|
||||
<UseDebugLibraries>true</UseDebugLibraries>
|
||||
<PlatformToolset>v120</PlatformToolset>
|
||||
<CharacterSet>Unicode</CharacterSet>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
|
||||
<ConfigurationType>StaticLibrary</ConfigurationType>
|
||||
<UseDebugLibraries>true</UseDebugLibraries>
|
||||
<PlatformToolset>v120</PlatformToolset>
|
||||
<CharacterSet>Unicode</CharacterSet>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
|
||||
<ConfigurationType>StaticLibrary</ConfigurationType>
|
||||
<UseDebugLibraries>false</UseDebugLibraries>
|
||||
<PlatformToolset>v120</PlatformToolset>
|
||||
<CharacterSet>Unicode</CharacterSet>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
|
||||
<ConfigurationType>StaticLibrary</ConfigurationType>
|
||||
<UseDebugLibraries>false</UseDebugLibraries>
|
||||
<PlatformToolset>v120</PlatformToolset>
|
||||
<CharacterSet>Unicode</CharacterSet>
|
||||
</PropertyGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
|
||||
<ImportGroup Label="ExtensionSettings">
|
||||
</ImportGroup>
|
||||
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
|
||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||
</ImportGroup>
|
||||
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="PropertySheets">
|
||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||
</ImportGroup>
|
||||
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
|
||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||
</ImportGroup>
|
||||
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="PropertySheets">
|
||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||
</ImportGroup>
|
||||
<PropertyGroup Label="UserMacros" />
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
|
||||
<OutDir>Bin\Desktop_2013\$(Platform)\$(Configuration)\</OutDir>
|
||||
<IntDir>Bin\Desktop_2013\$(Platform)\$(Configuration)\</IntDir>
|
||||
<TargetName>DirectXTKAudioWin8</TargetName>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
|
||||
<OutDir>Bin\Desktop_2013\$(Platform)\$(Configuration)\</OutDir>
|
||||
<IntDir>Bin\Desktop_2013\$(Platform)\$(Configuration)\</IntDir>
|
||||
<TargetName>DirectXTKAudioWin8</TargetName>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
|
||||
<OutDir>Bin\Desktop_2013\$(Platform)\$(Configuration)\</OutDir>
|
||||
<IntDir>Bin\Desktop_2013\$(Platform)\$(Configuration)\</IntDir>
|
||||
<TargetName>DirectXTKAudioWin8</TargetName>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
|
||||
<OutDir>Bin\Desktop_2013\$(Platform)\$(Configuration)\</OutDir>
|
||||
<IntDir>Bin\Desktop_2013\$(Platform)\$(Configuration)\</IntDir>
|
||||
<TargetName>DirectXTKAudioWin8</TargetName>
|
||||
</PropertyGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
|
||||
<ClCompile>
|
||||
<PrecompiledHeader>Use</PrecompiledHeader>
|
||||
<WarningLevel>Level4</WarningLevel>
|
||||
<Optimization>Disabled</Optimization>
|
||||
<PreprocessorDefinitions>_WIN32_WINNT=0x0602;WIN32;_DEBUG;_LIB;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<AdditionalIncludeDirectories>..\Inc;..\Src;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
<EnableEnhancedInstructionSet>StreamingSIMDExtensions2</EnableEnhancedInstructionSet>
|
||||
<FloatingPointModel>Fast</FloatingPointModel>
|
||||
<ProgramDataBaseFileName>$(IntDir)$(TargetName).pdb</ProgramDataBaseFileName>
|
||||
<PrecompiledHeaderFile>pch.h</PrecompiledHeaderFile>
|
||||
</ClCompile>
|
||||
<Link>
|
||||
<SubSystem>Windows</SubSystem>
|
||||
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||
</Link>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
|
||||
<ClCompile>
|
||||
<PrecompiledHeader>Use</PrecompiledHeader>
|
||||
<WarningLevel>Level4</WarningLevel>
|
||||
<Optimization>Disabled</Optimization>
|
||||
<PreprocessorDefinitions>_WIN32_WINNT=0x0602;WIN32;_DEBUG;_LIB;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<AdditionalIncludeDirectories>..\Inc;..\Src;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
<FloatingPointModel>Fast</FloatingPointModel>
|
||||
<ProgramDataBaseFileName>$(IntDir)$(TargetName).pdb</ProgramDataBaseFileName>
|
||||
<PrecompiledHeaderFile>pch.h</PrecompiledHeaderFile>
|
||||
</ClCompile>
|
||||
<Link>
|
||||
<SubSystem>Windows</SubSystem>
|
||||
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||
</Link>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
|
||||
<ClCompile>
|
||||
<WarningLevel>Level4</WarningLevel>
|
||||
<PrecompiledHeader>Use</PrecompiledHeader>
|
||||
<Optimization>MaxSpeed</Optimization>
|
||||
<FunctionLevelLinking>true</FunctionLevelLinking>
|
||||
<IntrinsicFunctions>true</IntrinsicFunctions>
|
||||
<PreprocessorDefinitions>_WIN32_WINNT=0x0602;WIN32;NDEBUG;_LIB;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<AdditionalIncludeDirectories>..\Inc;..\Src;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
<EnableEnhancedInstructionSet>StreamingSIMDExtensions2</EnableEnhancedInstructionSet>
|
||||
<FloatingPointModel>Fast</FloatingPointModel>
|
||||
<ProgramDataBaseFileName>$(IntDir)$(TargetName).pdb</ProgramDataBaseFileName>
|
||||
<PrecompiledHeaderFile>pch.h</PrecompiledHeaderFile>
|
||||
</ClCompile>
|
||||
<Link>
|
||||
<SubSystem>Windows</SubSystem>
|
||||
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||
<EnableCOMDATFolding>true</EnableCOMDATFolding>
|
||||
<OptimizeReferences>true</OptimizeReferences>
|
||||
</Link>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
|
||||
<ClCompile>
|
||||
<WarningLevel>Level4</WarningLevel>
|
||||
<PrecompiledHeader>Use</PrecompiledHeader>
|
||||
<Optimization>MaxSpeed</Optimization>
|
||||
<FunctionLevelLinking>true</FunctionLevelLinking>
|
||||
<IntrinsicFunctions>true</IntrinsicFunctions>
|
||||
<PreprocessorDefinitions>_WIN32_WINNT=0x0602;WIN32;NDEBUG;_LIB;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<AdditionalIncludeDirectories>..\Inc;..\Src;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
<FloatingPointModel>Fast</FloatingPointModel>
|
||||
<ProgramDataBaseFileName>$(IntDir)$(TargetName).pdb</ProgramDataBaseFileName>
|
||||
<PrecompiledHeaderFile>pch.h</PrecompiledHeaderFile>
|
||||
</ClCompile>
|
||||
<Link>
|
||||
<SubSystem>Windows</SubSystem>
|
||||
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||
<EnableCOMDATFolding>true</EnableCOMDATFolding>
|
||||
<OptimizeReferences>true</OptimizeReferences>
|
||||
</Link>
|
||||
</ItemDefinitionGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
|
||||
<ImportGroup Label="ExtensionTargets">
|
||||
</ImportGroup>
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project DefaultTargets="Build" ToolsVersion="12.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<ItemGroup Label="ProjectConfigurations">
|
||||
<ProjectConfiguration Include="Debug|Win32">
|
||||
<Configuration>Debug</Configuration>
|
||||
<Platform>Win32</Platform>
|
||||
</ProjectConfiguration>
|
||||
<ProjectConfiguration Include="Debug|x64">
|
||||
<Configuration>Debug</Configuration>
|
||||
<Platform>x64</Platform>
|
||||
</ProjectConfiguration>
|
||||
<ProjectConfiguration Include="Release|Win32">
|
||||
<Configuration>Release</Configuration>
|
||||
<Platform>Win32</Platform>
|
||||
</ProjectConfiguration>
|
||||
<ProjectConfiguration Include="Release|x64">
|
||||
<Configuration>Release</Configuration>
|
||||
<Platform>x64</Platform>
|
||||
</ProjectConfiguration>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ClInclude Include="..\Inc\Audio.h" />
|
||||
<ClInclude Include="SoundCommon.h" />
|
||||
<ClInclude Include="WaveBankReader.h" />
|
||||
<ClInclude Include="WAVFileReader.h" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ClCompile Include="AudioEngine.cpp">
|
||||
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">Create</PrecompiledHeader>
|
||||
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">Create</PrecompiledHeader>
|
||||
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">Create</PrecompiledHeader>
|
||||
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Release|x64'">Create</PrecompiledHeader>
|
||||
</ClCompile>
|
||||
<ClCompile Include="DynamicSoundEffectInstance.cpp" />
|
||||
<ClCompile Include="SoundCommon.cpp" />
|
||||
<ClCompile Include="SoundEffect.cpp" />
|
||||
<ClCompile Include="SoundEffectInstance.cpp" />
|
||||
<ClCompile Include="WaveBank.cpp" />
|
||||
<ClCompile Include="WaveBankReader.cpp" />
|
||||
<ClCompile Include="WAVFileReader.cpp" />
|
||||
</ItemGroup>
|
||||
<PropertyGroup Label="Globals">
|
||||
<ProjectGuid>{4F150A30-CECB-49D1-8283-6A3F57438CF5}</ProjectGuid>
|
||||
<Keyword>Win32Proj</Keyword>
|
||||
<RootNamespace>DirectXTKAudio</RootNamespace>
|
||||
</PropertyGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
|
||||
<ConfigurationType>StaticLibrary</ConfigurationType>
|
||||
<UseDebugLibraries>true</UseDebugLibraries>
|
||||
<PlatformToolset>v120</PlatformToolset>
|
||||
<CharacterSet>Unicode</CharacterSet>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
|
||||
<ConfigurationType>StaticLibrary</ConfigurationType>
|
||||
<UseDebugLibraries>true</UseDebugLibraries>
|
||||
<PlatformToolset>v120</PlatformToolset>
|
||||
<CharacterSet>Unicode</CharacterSet>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
|
||||
<ConfigurationType>StaticLibrary</ConfigurationType>
|
||||
<UseDebugLibraries>false</UseDebugLibraries>
|
||||
<PlatformToolset>v120</PlatformToolset>
|
||||
<CharacterSet>Unicode</CharacterSet>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
|
||||
<ConfigurationType>StaticLibrary</ConfigurationType>
|
||||
<UseDebugLibraries>false</UseDebugLibraries>
|
||||
<PlatformToolset>v120</PlatformToolset>
|
||||
<CharacterSet>Unicode</CharacterSet>
|
||||
</PropertyGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
|
||||
<ImportGroup Label="ExtensionSettings">
|
||||
</ImportGroup>
|
||||
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
|
||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||
</ImportGroup>
|
||||
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="PropertySheets">
|
||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||
</ImportGroup>
|
||||
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
|
||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||
</ImportGroup>
|
||||
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="PropertySheets">
|
||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||
</ImportGroup>
|
||||
<PropertyGroup Label="UserMacros" />
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
|
||||
<OutDir>Bin\Desktop_2013\$(Platform)\$(Configuration)\</OutDir>
|
||||
<IntDir>Bin\Desktop_2013\$(Platform)\$(Configuration)\</IntDir>
|
||||
<TargetName>DirectXTKAudioWin8</TargetName>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
|
||||
<OutDir>Bin\Desktop_2013\$(Platform)\$(Configuration)\</OutDir>
|
||||
<IntDir>Bin\Desktop_2013\$(Platform)\$(Configuration)\</IntDir>
|
||||
<TargetName>DirectXTKAudioWin8</TargetName>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
|
||||
<OutDir>Bin\Desktop_2013\$(Platform)\$(Configuration)\</OutDir>
|
||||
<IntDir>Bin\Desktop_2013\$(Platform)\$(Configuration)\</IntDir>
|
||||
<TargetName>DirectXTKAudioWin8</TargetName>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
|
||||
<OutDir>Bin\Desktop_2013\$(Platform)\$(Configuration)\</OutDir>
|
||||
<IntDir>Bin\Desktop_2013\$(Platform)\$(Configuration)\</IntDir>
|
||||
<TargetName>DirectXTKAudioWin8</TargetName>
|
||||
</PropertyGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
|
||||
<ClCompile>
|
||||
<PrecompiledHeader>Use</PrecompiledHeader>
|
||||
<WarningLevel>Level4</WarningLevel>
|
||||
<Optimization>Disabled</Optimization>
|
||||
<PreprocessorDefinitions>_WIN32_WINNT=0x0602;WIN32;_DEBUG;_LIB;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<AdditionalIncludeDirectories>..\Inc;..\Src;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
<EnableEnhancedInstructionSet>StreamingSIMDExtensions2</EnableEnhancedInstructionSet>
|
||||
<FloatingPointModel>Fast</FloatingPointModel>
|
||||
<ProgramDataBaseFileName>$(IntDir)$(TargetName).pdb</ProgramDataBaseFileName>
|
||||
<PrecompiledHeaderFile>pch.h</PrecompiledHeaderFile>
|
||||
</ClCompile>
|
||||
<Link>
|
||||
<SubSystem>Windows</SubSystem>
|
||||
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||
</Link>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
|
||||
<ClCompile>
|
||||
<PrecompiledHeader>Use</PrecompiledHeader>
|
||||
<WarningLevel>Level4</WarningLevel>
|
||||
<Optimization>Disabled</Optimization>
|
||||
<PreprocessorDefinitions>_WIN32_WINNT=0x0602;WIN32;_DEBUG;_LIB;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<AdditionalIncludeDirectories>..\Inc;..\Src;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
<FloatingPointModel>Fast</FloatingPointModel>
|
||||
<ProgramDataBaseFileName>$(IntDir)$(TargetName).pdb</ProgramDataBaseFileName>
|
||||
<PrecompiledHeaderFile>pch.h</PrecompiledHeaderFile>
|
||||
</ClCompile>
|
||||
<Link>
|
||||
<SubSystem>Windows</SubSystem>
|
||||
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||
</Link>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
|
||||
<ClCompile>
|
||||
<WarningLevel>Level4</WarningLevel>
|
||||
<PrecompiledHeader>Use</PrecompiledHeader>
|
||||
<Optimization>MaxSpeed</Optimization>
|
||||
<FunctionLevelLinking>true</FunctionLevelLinking>
|
||||
<IntrinsicFunctions>true</IntrinsicFunctions>
|
||||
<PreprocessorDefinitions>_WIN32_WINNT=0x0602;WIN32;NDEBUG;_LIB;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<AdditionalIncludeDirectories>..\Inc;..\Src;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
<EnableEnhancedInstructionSet>StreamingSIMDExtensions2</EnableEnhancedInstructionSet>
|
||||
<FloatingPointModel>Fast</FloatingPointModel>
|
||||
<ProgramDataBaseFileName>$(IntDir)$(TargetName).pdb</ProgramDataBaseFileName>
|
||||
<PrecompiledHeaderFile>pch.h</PrecompiledHeaderFile>
|
||||
</ClCompile>
|
||||
<Link>
|
||||
<SubSystem>Windows</SubSystem>
|
||||
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||
<EnableCOMDATFolding>true</EnableCOMDATFolding>
|
||||
<OptimizeReferences>true</OptimizeReferences>
|
||||
</Link>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
|
||||
<ClCompile>
|
||||
<WarningLevel>Level4</WarningLevel>
|
||||
<PrecompiledHeader>Use</PrecompiledHeader>
|
||||
<Optimization>MaxSpeed</Optimization>
|
||||
<FunctionLevelLinking>true</FunctionLevelLinking>
|
||||
<IntrinsicFunctions>true</IntrinsicFunctions>
|
||||
<PreprocessorDefinitions>_WIN32_WINNT=0x0602;WIN32;NDEBUG;_LIB;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<AdditionalIncludeDirectories>..\Inc;..\Src;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
<FloatingPointModel>Fast</FloatingPointModel>
|
||||
<ProgramDataBaseFileName>$(IntDir)$(TargetName).pdb</ProgramDataBaseFileName>
|
||||
<PrecompiledHeaderFile>pch.h</PrecompiledHeaderFile>
|
||||
</ClCompile>
|
||||
<Link>
|
||||
<SubSystem>Windows</SubSystem>
|
||||
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||
<EnableCOMDATFolding>true</EnableCOMDATFolding>
|
||||
<OptimizeReferences>true</OptimizeReferences>
|
||||
</Link>
|
||||
</ItemDefinitionGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
|
||||
<ImportGroup Label="ExtensionTargets">
|
||||
</ImportGroup>
|
||||
</Project>
|
|
@ -1,53 +1,53 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<ItemGroup>
|
||||
<Filter Include="Inc">
|
||||
<UniqueIdentifier>{93995380-89BD-4b04-88EB-625FBE52EBFB}</UniqueIdentifier>
|
||||
<Extensions>h;hpp;hxx;hm;inl;inc;xsd</Extensions>
|
||||
</Filter>
|
||||
<Filter Include="Src">
|
||||
<UniqueIdentifier>{4FC737F1-C7A5-4376-A066-2A32D752A2FF}</UniqueIdentifier>
|
||||
<Extensions>cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx</Extensions>
|
||||
</Filter>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ClInclude Include="WaveBankReader.h">
|
||||
<Filter>Inc</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="WAVFileReader.h">
|
||||
<Filter>Inc</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\Inc\Audio.h">
|
||||
<Filter>Inc</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="SoundCommon.h">
|
||||
<Filter>Inc</Filter>
|
||||
</ClInclude>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ClCompile Include="AudioEngine.cpp">
|
||||
<Filter>Src</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="WaveBankReader.cpp">
|
||||
<Filter>Src</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="WAVFileReader.cpp">
|
||||
<Filter>Src</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="SoundEffect.cpp">
|
||||
<Filter>Src</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="WaveBank.cpp">
|
||||
<Filter>Src</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="SoundEffectInstance.cpp">
|
||||
<Filter>Src</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="SoundCommon.cpp">
|
||||
<Filter>Src</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="DynamicSoundEffectInstance.cpp">
|
||||
<Filter>Src</Filter>
|
||||
</ClCompile>
|
||||
</ItemGroup>
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<ItemGroup>
|
||||
<Filter Include="Inc">
|
||||
<UniqueIdentifier>{93995380-89BD-4b04-88EB-625FBE52EBFB}</UniqueIdentifier>
|
||||
<Extensions>h;hpp;hxx;hm;inl;inc;xsd</Extensions>
|
||||
</Filter>
|
||||
<Filter Include="Src">
|
||||
<UniqueIdentifier>{4FC737F1-C7A5-4376-A066-2A32D752A2FF}</UniqueIdentifier>
|
||||
<Extensions>cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx</Extensions>
|
||||
</Filter>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ClInclude Include="WaveBankReader.h">
|
||||
<Filter>Inc</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="WAVFileReader.h">
|
||||
<Filter>Inc</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\Inc\Audio.h">
|
||||
<Filter>Inc</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="SoundCommon.h">
|
||||
<Filter>Inc</Filter>
|
||||
</ClInclude>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ClCompile Include="AudioEngine.cpp">
|
||||
<Filter>Src</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="WaveBankReader.cpp">
|
||||
<Filter>Src</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="WAVFileReader.cpp">
|
||||
<Filter>Src</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="SoundEffect.cpp">
|
||||
<Filter>Src</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="WaveBank.cpp">
|
||||
<Filter>Src</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="SoundEffectInstance.cpp">
|
||||
<Filter>Src</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="SoundCommon.cpp">
|
||||
<Filter>Src</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="DynamicSoundEffectInstance.cpp">
|
||||
<Filter>Src</Filter>
|
||||
</ClCompile>
|
||||
</ItemGroup>
|
||||
</Project>
|
|
@ -1,197 +1,197 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project DefaultTargets="Build" ToolsVersion="14.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<ItemGroup Label="ProjectConfigurations">
|
||||
<ProjectConfiguration Include="Debug|Win32">
|
||||
<Configuration>Debug</Configuration>
|
||||
<Platform>Win32</Platform>
|
||||
</ProjectConfiguration>
|
||||
<ProjectConfiguration Include="Debug|x64">
|
||||
<Configuration>Debug</Configuration>
|
||||
<Platform>x64</Platform>
|
||||
</ProjectConfiguration>
|
||||
<ProjectConfiguration Include="Release|Win32">
|
||||
<Configuration>Release</Configuration>
|
||||
<Platform>Win32</Platform>
|
||||
</ProjectConfiguration>
|
||||
<ProjectConfiguration Include="Release|x64">
|
||||
<Configuration>Release</Configuration>
|
||||
<Platform>x64</Platform>
|
||||
</ProjectConfiguration>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ClInclude Include="..\Inc\Audio.h" />
|
||||
<ClInclude Include="SoundCommon.h" />
|
||||
<ClInclude Include="WaveBankReader.h" />
|
||||
<ClInclude Include="WAVFileReader.h" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ClCompile Include="AudioEngine.cpp">
|
||||
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">Create</PrecompiledHeader>
|
||||
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">Create</PrecompiledHeader>
|
||||
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">Create</PrecompiledHeader>
|
||||
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Release|x64'">Create</PrecompiledHeader>
|
||||
</ClCompile>
|
||||
<ClCompile Include="DynamicSoundEffectInstance.cpp" />
|
||||
<ClCompile Include="SoundCommon.cpp" />
|
||||
<ClCompile Include="SoundEffect.cpp" />
|
||||
<ClCompile Include="SoundEffectInstance.cpp" />
|
||||
<ClCompile Include="WaveBank.cpp" />
|
||||
<ClCompile Include="WaveBankReader.cpp" />
|
||||
<ClCompile Include="WAVFileReader.cpp" />
|
||||
</ItemGroup>
|
||||
<PropertyGroup Label="Globals">
|
||||
<ProjectGuid>{4F150A30-CECB-49D1-8283-6A3F57438CF5}</ProjectGuid>
|
||||
<Keyword>Win32Proj</Keyword>
|
||||
<RootNamespace>DirectXTKAudioDX</RootNamespace>
|
||||
</PropertyGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
|
||||
<ConfigurationType>StaticLibrary</ConfigurationType>
|
||||
<UseDebugLibraries>true</UseDebugLibraries>
|
||||
<PlatformToolset>v140</PlatformToolset>
|
||||
<CharacterSet>Unicode</CharacterSet>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
|
||||
<ConfigurationType>StaticLibrary</ConfigurationType>
|
||||
<UseDebugLibraries>true</UseDebugLibraries>
|
||||
<PlatformToolset>v140</PlatformToolset>
|
||||
<CharacterSet>Unicode</CharacterSet>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
|
||||
<ConfigurationType>StaticLibrary</ConfigurationType>
|
||||
<UseDebugLibraries>false</UseDebugLibraries>
|
||||
<PlatformToolset>v140</PlatformToolset>
|
||||
<CharacterSet>Unicode</CharacterSet>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
|
||||
<ConfigurationType>StaticLibrary</ConfigurationType>
|
||||
<UseDebugLibraries>false</UseDebugLibraries>
|
||||
<PlatformToolset>v140</PlatformToolset>
|
||||
<CharacterSet>Unicode</CharacterSet>
|
||||
</PropertyGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
|
||||
<ImportGroup Label="ExtensionSettings">
|
||||
</ImportGroup>
|
||||
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
|
||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||
</ImportGroup>
|
||||
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="PropertySheets">
|
||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||
</ImportGroup>
|
||||
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
|
||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||
</ImportGroup>
|
||||
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="PropertySheets">
|
||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||
</ImportGroup>
|
||||
<PropertyGroup Label="UserMacros" />
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
|
||||
<OutDir>Bin\Desktop_2015_DXSDK\$(Platform)\$(Configuration)\</OutDir>
|
||||
<IntDir>Bin\Desktop_2015_DXSDK\$(Platform)\$(Configuration)\</IntDir>
|
||||
<TargetName>DirectXTKAudioDX</TargetName>
|
||||
<ExecutablePath>$(ExecutablePath);$(DXSDK_DIR)Utilities\bin\x86</ExecutablePath>
|
||||
<IncludePath>$(IncludePath);$(DXSDK_DIR)Include</IncludePath>
|
||||
<LibraryPath>$(LibraryPath);$(DXSDK_DIR)Lib\x86</LibraryPath>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
|
||||
<OutDir>Bin\Desktop_2015_DXSDK\$(Platform)\$(Configuration)\</OutDir>
|
||||
<IntDir>Bin\Desktop_2015_DXSDK\$(Platform)\$(Configuration)\</IntDir>
|
||||
<TargetName>DirectXTKAudioDX</TargetName>
|
||||
<ExecutablePath>$(ExecutablePath);$(DXSDK_DIR)Utilities\bin\x64;$(DXSDK_DIR)Utilities\bin\x86</ExecutablePath>
|
||||
<IncludePath>$(IncludePath);$(DXSDK_DIR)Include</IncludePath>
|
||||
<LibraryPath>$(LibraryPath);$(DXSDK_DIR)Lib\x64;</LibraryPath>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
|
||||
<OutDir>Bin\Desktop_2015_DXSDK\$(Platform)\$(Configuration)\</OutDir>
|
||||
<IntDir>Bin\Desktop_2015_DXSDK\$(Platform)\$(Configuration)\</IntDir>
|
||||
<TargetName>DirectXTKAudioDX</TargetName>
|
||||
<ExecutablePath>$(ExecutablePath);$(DXSDK_DIR)Utilities\bin\x86</ExecutablePath>
|
||||
<IncludePath>$(IncludePath);$(DXSDK_DIR)Include</IncludePath>
|
||||
<LibraryPath>$(LibraryPath);$(DXSDK_DIR)Lib\x86</LibraryPath>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
|
||||
<OutDir>Bin\Desktop_2015_DXSDK\$(Platform)\$(Configuration)\</OutDir>
|
||||
<IntDir>Bin\Desktop_2015_DXSDK\$(Platform)\$(Configuration)\</IntDir>
|
||||
<TargetName>DirectXTKAudioDX</TargetName>
|
||||
<ExecutablePath>$(ExecutablePath);$(DXSDK_DIR)Utilities\bin\x64;$(DXSDK_DIR)Utilities\bin\x86</ExecutablePath>
|
||||
<IncludePath>$(IncludePath);$(DXSDK_DIR)Include</IncludePath>
|
||||
<LibraryPath>$(LibraryPath);$(DXSDK_DIR)Lib\x64;</LibraryPath>
|
||||
</PropertyGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
|
||||
<ClCompile>
|
||||
<PrecompiledHeader>Use</PrecompiledHeader>
|
||||
<WarningLevel>Level4</WarningLevel>
|
||||
<Optimization>Disabled</Optimization>
|
||||
<PreprocessorDefinitions>_WIN32_WINNT=0x0600;WIN32;_DEBUG;_LIB;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<AdditionalIncludeDirectories>..\Inc;..\Src;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
<EnableEnhancedInstructionSet>StreamingSIMDExtensions2</EnableEnhancedInstructionSet>
|
||||
<FloatingPointModel>Fast</FloatingPointModel>
|
||||
<ProgramDataBaseFileName>$(IntDir)$(TargetName).pdb</ProgramDataBaseFileName>
|
||||
<PrecompiledHeaderFile>pch.h</PrecompiledHeaderFile>
|
||||
</ClCompile>
|
||||
<Link>
|
||||
<SubSystem>Windows</SubSystem>
|
||||
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||
</Link>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
|
||||
<ClCompile>
|
||||
<PrecompiledHeader>Use</PrecompiledHeader>
|
||||
<WarningLevel>Level4</WarningLevel>
|
||||
<Optimization>Disabled</Optimization>
|
||||
<PreprocessorDefinitions>_WIN32_WINNT=0x0600;WIN32;_DEBUG;_LIB;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<AdditionalIncludeDirectories>..\Inc;..\Src;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
<FloatingPointModel>Fast</FloatingPointModel>
|
||||
<ProgramDataBaseFileName>$(IntDir)$(TargetName).pdb</ProgramDataBaseFileName>
|
||||
<PrecompiledHeaderFile>pch.h</PrecompiledHeaderFile>
|
||||
</ClCompile>
|
||||
<Link>
|
||||
<SubSystem>Windows</SubSystem>
|
||||
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||
</Link>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
|
||||
<ClCompile>
|
||||
<WarningLevel>Level4</WarningLevel>
|
||||
<PrecompiledHeader>Use</PrecompiledHeader>
|
||||
<Optimization>MaxSpeed</Optimization>
|
||||
<FunctionLevelLinking>true</FunctionLevelLinking>
|
||||
<IntrinsicFunctions>true</IntrinsicFunctions>
|
||||
<PreprocessorDefinitions>_WIN32_WINNT=0x0600;WIN32;NDEBUG;_LIB;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<AdditionalIncludeDirectories>..\Inc;..\Src;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
<EnableEnhancedInstructionSet>StreamingSIMDExtensions2</EnableEnhancedInstructionSet>
|
||||
<FloatingPointModel>Fast</FloatingPointModel>
|
||||
<ProgramDataBaseFileName>$(IntDir)$(TargetName).pdb</ProgramDataBaseFileName>
|
||||
<PrecompiledHeaderFile>pch.h</PrecompiledHeaderFile>
|
||||
</ClCompile>
|
||||
<Link>
|
||||
<SubSystem>Windows</SubSystem>
|
||||
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||
<EnableCOMDATFolding>true</EnableCOMDATFolding>
|
||||
<OptimizeReferences>true</OptimizeReferences>
|
||||
</Link>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
|
||||
<ClCompile>
|
||||
<WarningLevel>Level4</WarningLevel>
|
||||
<PrecompiledHeader>Use</PrecompiledHeader>
|
||||
<Optimization>MaxSpeed</Optimization>
|
||||
<FunctionLevelLinking>true</FunctionLevelLinking>
|
||||
<IntrinsicFunctions>true</IntrinsicFunctions>
|
||||
<PreprocessorDefinitions>_WIN32_WINNT=0x0600;WIN32;NDEBUG;_LIB;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<AdditionalIncludeDirectories>..\Inc;..\Src;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
<FloatingPointModel>Fast</FloatingPointModel>
|
||||
<ProgramDataBaseFileName>$(IntDir)$(TargetName).pdb</ProgramDataBaseFileName>
|
||||
<PrecompiledHeaderFile>pch.h</PrecompiledHeaderFile>
|
||||
</ClCompile>
|
||||
<Link>
|
||||
<SubSystem>Windows</SubSystem>
|
||||
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||
<EnableCOMDATFolding>true</EnableCOMDATFolding>
|
||||
<OptimizeReferences>true</OptimizeReferences>
|
||||
</Link>
|
||||
</ItemDefinitionGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
|
||||
<ImportGroup Label="ExtensionTargets">
|
||||
</ImportGroup>
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project DefaultTargets="Build" ToolsVersion="14.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<ItemGroup Label="ProjectConfigurations">
|
||||
<ProjectConfiguration Include="Debug|Win32">
|
||||
<Configuration>Debug</Configuration>
|
||||
<Platform>Win32</Platform>
|
||||
</ProjectConfiguration>
|
||||
<ProjectConfiguration Include="Debug|x64">
|
||||
<Configuration>Debug</Configuration>
|
||||
<Platform>x64</Platform>
|
||||
</ProjectConfiguration>
|
||||
<ProjectConfiguration Include="Release|Win32">
|
||||
<Configuration>Release</Configuration>
|
||||
<Platform>Win32</Platform>
|
||||
</ProjectConfiguration>
|
||||
<ProjectConfiguration Include="Release|x64">
|
||||
<Configuration>Release</Configuration>
|
||||
<Platform>x64</Platform>
|
||||
</ProjectConfiguration>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ClInclude Include="..\Inc\Audio.h" />
|
||||
<ClInclude Include="SoundCommon.h" />
|
||||
<ClInclude Include="WaveBankReader.h" />
|
||||
<ClInclude Include="WAVFileReader.h" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ClCompile Include="AudioEngine.cpp">
|
||||
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">Create</PrecompiledHeader>
|
||||
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">Create</PrecompiledHeader>
|
||||
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">Create</PrecompiledHeader>
|
||||
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Release|x64'">Create</PrecompiledHeader>
|
||||
</ClCompile>
|
||||
<ClCompile Include="DynamicSoundEffectInstance.cpp" />
|
||||
<ClCompile Include="SoundCommon.cpp" />
|
||||
<ClCompile Include="SoundEffect.cpp" />
|
||||
<ClCompile Include="SoundEffectInstance.cpp" />
|
||||
<ClCompile Include="WaveBank.cpp" />
|
||||
<ClCompile Include="WaveBankReader.cpp" />
|
||||
<ClCompile Include="WAVFileReader.cpp" />
|
||||
</ItemGroup>
|
||||
<PropertyGroup Label="Globals">
|
||||
<ProjectGuid>{4F150A30-CECB-49D1-8283-6A3F57438CF5}</ProjectGuid>
|
||||
<Keyword>Win32Proj</Keyword>
|
||||
<RootNamespace>DirectXTKAudioDX</RootNamespace>
|
||||
</PropertyGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
|
||||
<ConfigurationType>StaticLibrary</ConfigurationType>
|
||||
<UseDebugLibraries>true</UseDebugLibraries>
|
||||
<PlatformToolset>v140</PlatformToolset>
|
||||
<CharacterSet>Unicode</CharacterSet>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
|
||||
<ConfigurationType>StaticLibrary</ConfigurationType>
|
||||
<UseDebugLibraries>true</UseDebugLibraries>
|
||||
<PlatformToolset>v140</PlatformToolset>
|
||||
<CharacterSet>Unicode</CharacterSet>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
|
||||
<ConfigurationType>StaticLibrary</ConfigurationType>
|
||||
<UseDebugLibraries>false</UseDebugLibraries>
|
||||
<PlatformToolset>v140</PlatformToolset>
|
||||
<CharacterSet>Unicode</CharacterSet>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
|
||||
<ConfigurationType>StaticLibrary</ConfigurationType>
|
||||
<UseDebugLibraries>false</UseDebugLibraries>
|
||||
<PlatformToolset>v140</PlatformToolset>
|
||||
<CharacterSet>Unicode</CharacterSet>
|
||||
</PropertyGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
|
||||
<ImportGroup Label="ExtensionSettings">
|
||||
</ImportGroup>
|
||||
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
|
||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||
</ImportGroup>
|
||||
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="PropertySheets">
|
||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||
</ImportGroup>
|
||||
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
|
||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||
</ImportGroup>
|
||||
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="PropertySheets">
|
||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||
</ImportGroup>
|
||||
<PropertyGroup Label="UserMacros" />
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
|
||||
<OutDir>Bin\Desktop_2015_DXSDK\$(Platform)\$(Configuration)\</OutDir>
|
||||
<IntDir>Bin\Desktop_2015_DXSDK\$(Platform)\$(Configuration)\</IntDir>
|
||||
<TargetName>DirectXTKAudioDX</TargetName>
|
||||
<ExecutablePath>$(ExecutablePath);$(DXSDK_DIR)Utilities\bin\x86</ExecutablePath>
|
||||
<IncludePath>$(IncludePath);$(DXSDK_DIR)Include</IncludePath>
|
||||
<LibraryPath>$(LibraryPath);$(DXSDK_DIR)Lib\x86</LibraryPath>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
|
||||
<OutDir>Bin\Desktop_2015_DXSDK\$(Platform)\$(Configuration)\</OutDir>
|
||||
<IntDir>Bin\Desktop_2015_DXSDK\$(Platform)\$(Configuration)\</IntDir>
|
||||
<TargetName>DirectXTKAudioDX</TargetName>
|
||||
<ExecutablePath>$(ExecutablePath);$(DXSDK_DIR)Utilities\bin\x64;$(DXSDK_DIR)Utilities\bin\x86</ExecutablePath>
|
||||
<IncludePath>$(IncludePath);$(DXSDK_DIR)Include</IncludePath>
|
||||
<LibraryPath>$(LibraryPath);$(DXSDK_DIR)Lib\x64;</LibraryPath>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
|
||||
<OutDir>Bin\Desktop_2015_DXSDK\$(Platform)\$(Configuration)\</OutDir>
|
||||
<IntDir>Bin\Desktop_2015_DXSDK\$(Platform)\$(Configuration)\</IntDir>
|
||||
<TargetName>DirectXTKAudioDX</TargetName>
|
||||
<ExecutablePath>$(ExecutablePath);$(DXSDK_DIR)Utilities\bin\x86</ExecutablePath>
|
||||
<IncludePath>$(IncludePath);$(DXSDK_DIR)Include</IncludePath>
|
||||
<LibraryPath>$(LibraryPath);$(DXSDK_DIR)Lib\x86</LibraryPath>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
|
||||
<OutDir>Bin\Desktop_2015_DXSDK\$(Platform)\$(Configuration)\</OutDir>
|
||||
<IntDir>Bin\Desktop_2015_DXSDK\$(Platform)\$(Configuration)\</IntDir>
|
||||
<TargetName>DirectXTKAudioDX</TargetName>
|
||||
<ExecutablePath>$(ExecutablePath);$(DXSDK_DIR)Utilities\bin\x64;$(DXSDK_DIR)Utilities\bin\x86</ExecutablePath>
|
||||
<IncludePath>$(IncludePath);$(DXSDK_DIR)Include</IncludePath>
|
||||
<LibraryPath>$(LibraryPath);$(DXSDK_DIR)Lib\x64;</LibraryPath>
|
||||
</PropertyGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
|
||||
<ClCompile>
|
||||
<PrecompiledHeader>Use</PrecompiledHeader>
|
||||
<WarningLevel>Level4</WarningLevel>
|
||||
<Optimization>Disabled</Optimization>
|
||||
<PreprocessorDefinitions>_WIN32_WINNT=0x0600;WIN32;_DEBUG;_LIB;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<AdditionalIncludeDirectories>..\Inc;..\Src;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
<EnableEnhancedInstructionSet>StreamingSIMDExtensions2</EnableEnhancedInstructionSet>
|
||||
<FloatingPointModel>Fast</FloatingPointModel>
|
||||
<ProgramDataBaseFileName>$(IntDir)$(TargetName).pdb</ProgramDataBaseFileName>
|
||||
<PrecompiledHeaderFile>pch.h</PrecompiledHeaderFile>
|
||||
</ClCompile>
|
||||
<Link>
|
||||
<SubSystem>Windows</SubSystem>
|
||||
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||
</Link>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
|
||||
<ClCompile>
|
||||
<PrecompiledHeader>Use</PrecompiledHeader>
|
||||
<WarningLevel>Level4</WarningLevel>
|
||||
<Optimization>Disabled</Optimization>
|
||||
<PreprocessorDefinitions>_WIN32_WINNT=0x0600;WIN32;_DEBUG;_LIB;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<AdditionalIncludeDirectories>..\Inc;..\Src;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
<FloatingPointModel>Fast</FloatingPointModel>
|
||||
<ProgramDataBaseFileName>$(IntDir)$(TargetName).pdb</ProgramDataBaseFileName>
|
||||
<PrecompiledHeaderFile>pch.h</PrecompiledHeaderFile>
|
||||
</ClCompile>
|
||||
<Link>
|
||||
<SubSystem>Windows</SubSystem>
|
||||
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||
</Link>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
|
||||
<ClCompile>
|
||||
<WarningLevel>Level4</WarningLevel>
|
||||
<PrecompiledHeader>Use</PrecompiledHeader>
|
||||
<Optimization>MaxSpeed</Optimization>
|
||||
<FunctionLevelLinking>true</FunctionLevelLinking>
|
||||
<IntrinsicFunctions>true</IntrinsicFunctions>
|
||||
<PreprocessorDefinitions>_WIN32_WINNT=0x0600;WIN32;NDEBUG;_LIB;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<AdditionalIncludeDirectories>..\Inc;..\Src;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
<EnableEnhancedInstructionSet>StreamingSIMDExtensions2</EnableEnhancedInstructionSet>
|
||||
<FloatingPointModel>Fast</FloatingPointModel>
|
||||
<ProgramDataBaseFileName>$(IntDir)$(TargetName).pdb</ProgramDataBaseFileName>
|
||||
<PrecompiledHeaderFile>pch.h</PrecompiledHeaderFile>
|
||||
</ClCompile>
|
||||
<Link>
|
||||
<SubSystem>Windows</SubSystem>
|
||||
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||
<EnableCOMDATFolding>true</EnableCOMDATFolding>
|
||||
<OptimizeReferences>true</OptimizeReferences>
|
||||
</Link>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
|
||||
<ClCompile>
|
||||
<WarningLevel>Level4</WarningLevel>
|
||||
<PrecompiledHeader>Use</PrecompiledHeader>
|
||||
<Optimization>MaxSpeed</Optimization>
|
||||
<FunctionLevelLinking>true</FunctionLevelLinking>
|
||||
<IntrinsicFunctions>true</IntrinsicFunctions>
|
||||
<PreprocessorDefinitions>_WIN32_WINNT=0x0600;WIN32;NDEBUG;_LIB;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<AdditionalIncludeDirectories>..\Inc;..\Src;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
<FloatingPointModel>Fast</FloatingPointModel>
|
||||
<ProgramDataBaseFileName>$(IntDir)$(TargetName).pdb</ProgramDataBaseFileName>
|
||||
<PrecompiledHeaderFile>pch.h</PrecompiledHeaderFile>
|
||||
</ClCompile>
|
||||
<Link>
|
||||
<SubSystem>Windows</SubSystem>
|
||||
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||
<EnableCOMDATFolding>true</EnableCOMDATFolding>
|
||||
<OptimizeReferences>true</OptimizeReferences>
|
||||
</Link>
|
||||
</ItemDefinitionGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
|
||||
<ImportGroup Label="ExtensionTargets">
|
||||
</ImportGroup>
|
||||
</Project>
|
|
@ -1,53 +1,53 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<ItemGroup>
|
||||
<Filter Include="Inc">
|
||||
<UniqueIdentifier>{93995380-89BD-4b04-88EB-625FBE52EBFB}</UniqueIdentifier>
|
||||
<Extensions>h;hpp;hxx;hm;inl;inc;xsd</Extensions>
|
||||
</Filter>
|
||||
<Filter Include="Src">
|
||||
<UniqueIdentifier>{4FC737F1-C7A5-4376-A066-2A32D752A2FF}</UniqueIdentifier>
|
||||
<Extensions>cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx</Extensions>
|
||||
</Filter>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ClInclude Include="WaveBankReader.h">
|
||||
<Filter>Inc</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="WAVFileReader.h">
|
||||
<Filter>Inc</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\Inc\Audio.h">
|
||||
<Filter>Inc</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="SoundCommon.h">
|
||||
<Filter>Inc</Filter>
|
||||
</ClInclude>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ClCompile Include="AudioEngine.cpp">
|
||||
<Filter>Src</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="WaveBankReader.cpp">
|
||||
<Filter>Src</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="WAVFileReader.cpp">
|
||||
<Filter>Src</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="SoundEffect.cpp">
|
||||
<Filter>Src</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="WaveBank.cpp">
|
||||
<Filter>Src</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="SoundEffectInstance.cpp">
|
||||
<Filter>Src</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="SoundCommon.cpp">
|
||||
<Filter>Src</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="DynamicSoundEffectInstance.cpp">
|
||||
<Filter>Src</Filter>
|
||||
</ClCompile>
|
||||
</ItemGroup>
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<ItemGroup>
|
||||
<Filter Include="Inc">
|
||||
<UniqueIdentifier>{93995380-89BD-4b04-88EB-625FBE52EBFB}</UniqueIdentifier>
|
||||
<Extensions>h;hpp;hxx;hm;inl;inc;xsd</Extensions>
|
||||
</Filter>
|
||||
<Filter Include="Src">
|
||||
<UniqueIdentifier>{4FC737F1-C7A5-4376-A066-2A32D752A2FF}</UniqueIdentifier>
|
||||
<Extensions>cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx</Extensions>
|
||||
</Filter>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ClInclude Include="WaveBankReader.h">
|
||||
<Filter>Inc</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="WAVFileReader.h">
|
||||
<Filter>Inc</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\Inc\Audio.h">
|
||||
<Filter>Inc</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="SoundCommon.h">
|
||||
<Filter>Inc</Filter>
|
||||
</ClInclude>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ClCompile Include="AudioEngine.cpp">
|
||||
<Filter>Src</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="WaveBankReader.cpp">
|
||||
<Filter>Src</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="WAVFileReader.cpp">
|
||||
<Filter>Src</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="SoundEffect.cpp">
|
||||
<Filter>Src</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="WaveBank.cpp">
|
||||
<Filter>Src</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="SoundEffectInstance.cpp">
|
||||
<Filter>Src</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="SoundCommon.cpp">
|
||||
<Filter>Src</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="DynamicSoundEffectInstance.cpp">
|
||||
<Filter>Src</Filter>
|
||||
</ClCompile>
|
||||
</ItemGroup>
|
||||
</Project>
|
|
@ -1,185 +1,185 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project DefaultTargets="Build" ToolsVersion="14.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<ItemGroup Label="ProjectConfigurations">
|
||||
<ProjectConfiguration Include="Debug|Win32">
|
||||
<Configuration>Debug</Configuration>
|
||||
<Platform>Win32</Platform>
|
||||
</ProjectConfiguration>
|
||||
<ProjectConfiguration Include="Debug|x64">
|
||||
<Configuration>Debug</Configuration>
|
||||
<Platform>x64</Platform>
|
||||
</ProjectConfiguration>
|
||||
<ProjectConfiguration Include="Release|Win32">
|
||||
<Configuration>Release</Configuration>
|
||||
<Platform>Win32</Platform>
|
||||
</ProjectConfiguration>
|
||||
<ProjectConfiguration Include="Release|x64">
|
||||
<Configuration>Release</Configuration>
|
||||
<Platform>x64</Platform>
|
||||
</ProjectConfiguration>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ClInclude Include="..\Inc\Audio.h" />
|
||||
<ClInclude Include="SoundCommon.h" />
|
||||
<ClInclude Include="WaveBankReader.h" />
|
||||
<ClInclude Include="WAVFileReader.h" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ClCompile Include="AudioEngine.cpp">
|
||||
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">Create</PrecompiledHeader>
|
||||
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">Create</PrecompiledHeader>
|
||||
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">Create</PrecompiledHeader>
|
||||
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Release|x64'">Create</PrecompiledHeader>
|
||||
</ClCompile>
|
||||
<ClCompile Include="DynamicSoundEffectInstance.cpp" />
|
||||
<ClCompile Include="SoundCommon.cpp" />
|
||||
<ClCompile Include="SoundEffect.cpp" />
|
||||
<ClCompile Include="SoundEffectInstance.cpp" />
|
||||
<ClCompile Include="WaveBank.cpp" />
|
||||
<ClCompile Include="WaveBankReader.cpp" />
|
||||
<ClCompile Include="WAVFileReader.cpp" />
|
||||
</ItemGroup>
|
||||
<PropertyGroup Label="Globals">
|
||||
<ProjectGuid>{4F150A30-CECB-49D1-8283-6A3F57438CF5}</ProjectGuid>
|
||||
<Keyword>Win32Proj</Keyword>
|
||||
<RootNamespace>DirectXTKAudio</RootNamespace>
|
||||
</PropertyGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
|
||||
<ConfigurationType>StaticLibrary</ConfigurationType>
|
||||
<UseDebugLibraries>true</UseDebugLibraries>
|
||||
<PlatformToolset>v140</PlatformToolset>
|
||||
<CharacterSet>Unicode</CharacterSet>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
|
||||
<ConfigurationType>StaticLibrary</ConfigurationType>
|
||||
<UseDebugLibraries>true</UseDebugLibraries>
|
||||
<PlatformToolset>v140</PlatformToolset>
|
||||
<CharacterSet>Unicode</CharacterSet>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
|
||||
<ConfigurationType>StaticLibrary</ConfigurationType>
|
||||
<UseDebugLibraries>false</UseDebugLibraries>
|
||||
<PlatformToolset>v140</PlatformToolset>
|
||||
<CharacterSet>Unicode</CharacterSet>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
|
||||
<ConfigurationType>StaticLibrary</ConfigurationType>
|
||||
<UseDebugLibraries>false</UseDebugLibraries>
|
||||
<PlatformToolset>v140</PlatformToolset>
|
||||
<CharacterSet>Unicode</CharacterSet>
|
||||
</PropertyGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
|
||||
<ImportGroup Label="ExtensionSettings">
|
||||
</ImportGroup>
|
||||
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
|
||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||
</ImportGroup>
|
||||
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="PropertySheets">
|
||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||
</ImportGroup>
|
||||
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
|
||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||
</ImportGroup>
|
||||
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="PropertySheets">
|
||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||
</ImportGroup>
|
||||
<PropertyGroup Label="UserMacros" />
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
|
||||
<OutDir>Bin\Desktop_2015\$(Platform)\$(Configuration)\</OutDir>
|
||||
<IntDir>Bin\Desktop_2015\$(Platform)\$(Configuration)\</IntDir>
|
||||
<TargetName>DirectXTKAudioWin8</TargetName>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
|
||||
<OutDir>Bin\Desktop_2015\$(Platform)\$(Configuration)\</OutDir>
|
||||
<IntDir>Bin\Desktop_2015\$(Platform)\$(Configuration)\</IntDir>
|
||||
<TargetName>DirectXTKAudioWin8</TargetName>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
|
||||
<OutDir>Bin\Desktop_2015\$(Platform)\$(Configuration)\</OutDir>
|
||||
<IntDir>Bin\Desktop_2015\$(Platform)\$(Configuration)\</IntDir>
|
||||
<TargetName>DirectXTKAudioWin8</TargetName>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
|
||||
<OutDir>Bin\Desktop_2015\$(Platform)\$(Configuration)\</OutDir>
|
||||
<IntDir>Bin\Desktop_2015\$(Platform)\$(Configuration)\</IntDir>
|
||||
<TargetName>DirectXTKAudioWin8</TargetName>
|
||||
</PropertyGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
|
||||
<ClCompile>
|
||||
<PrecompiledHeader>Use</PrecompiledHeader>
|
||||
<WarningLevel>Level4</WarningLevel>
|
||||
<Optimization>Disabled</Optimization>
|
||||
<PreprocessorDefinitions>_WIN32_WINNT=0x0602;WIN32;_DEBUG;_LIB;_CRT_STDIO_ARBITRARY_WIDE_SPECIFIERS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<AdditionalIncludeDirectories>..\Inc;..\Src;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
<EnableEnhancedInstructionSet>StreamingSIMDExtensions2</EnableEnhancedInstructionSet>
|
||||
<FloatingPointModel>Fast</FloatingPointModel>
|
||||
<ProgramDataBaseFileName>$(IntDir)$(TargetName).pdb</ProgramDataBaseFileName>
|
||||
<PrecompiledHeaderFile>pch.h</PrecompiledHeaderFile>
|
||||
</ClCompile>
|
||||
<Link>
|
||||
<SubSystem>Windows</SubSystem>
|
||||
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||
</Link>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
|
||||
<ClCompile>
|
||||
<PrecompiledHeader>Use</PrecompiledHeader>
|
||||
<WarningLevel>Level4</WarningLevel>
|
||||
<Optimization>Disabled</Optimization>
|
||||
<PreprocessorDefinitions>_WIN32_WINNT=0x0602;WIN32;_DEBUG;_LIB;_CRT_STDIO_ARBITRARY_WIDE_SPECIFIERS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<AdditionalIncludeDirectories>..\Inc;..\Src;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
<FloatingPointModel>Fast</FloatingPointModel>
|
||||
<ProgramDataBaseFileName>$(IntDir)$(TargetName).pdb</ProgramDataBaseFileName>
|
||||
<PrecompiledHeaderFile>pch.h</PrecompiledHeaderFile>
|
||||
</ClCompile>
|
||||
<Link>
|
||||
<SubSystem>Windows</SubSystem>
|
||||
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||
</Link>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
|
||||
<ClCompile>
|
||||
<WarningLevel>Level4</WarningLevel>
|
||||
<PrecompiledHeader>Use</PrecompiledHeader>
|
||||
<Optimization>MaxSpeed</Optimization>
|
||||
<FunctionLevelLinking>true</FunctionLevelLinking>
|
||||
<IntrinsicFunctions>true</IntrinsicFunctions>
|
||||
<PreprocessorDefinitions>_WIN32_WINNT=0x0602;WIN32;NDEBUG;_LIB;_CRT_STDIO_ARBITRARY_WIDE_SPECIFIERS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<AdditionalIncludeDirectories>..\Inc;..\Src;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
<EnableEnhancedInstructionSet>StreamingSIMDExtensions2</EnableEnhancedInstructionSet>
|
||||
<FloatingPointModel>Fast</FloatingPointModel>
|
||||
<ProgramDataBaseFileName>$(IntDir)$(TargetName).pdb</ProgramDataBaseFileName>
|
||||
<PrecompiledHeaderFile>pch.h</PrecompiledHeaderFile>
|
||||
</ClCompile>
|
||||
<Link>
|
||||
<SubSystem>Windows</SubSystem>
|
||||
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||
<EnableCOMDATFolding>true</EnableCOMDATFolding>
|
||||
<OptimizeReferences>true</OptimizeReferences>
|
||||
</Link>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
|
||||
<ClCompile>
|
||||
<WarningLevel>Level4</WarningLevel>
|
||||
<PrecompiledHeader>Use</PrecompiledHeader>
|
||||
<Optimization>MaxSpeed</Optimization>
|
||||
<FunctionLevelLinking>true</FunctionLevelLinking>
|
||||
<IntrinsicFunctions>true</IntrinsicFunctions>
|
||||
<PreprocessorDefinitions>_WIN32_WINNT=0x0602;WIN32;NDEBUG;_LIB;_CRT_STDIO_ARBITRARY_WIDE_SPECIFIERS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<AdditionalIncludeDirectories>..\Inc;..\Src;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
<FloatingPointModel>Fast</FloatingPointModel>
|
||||
<ProgramDataBaseFileName>$(IntDir)$(TargetName).pdb</ProgramDataBaseFileName>
|
||||
<PrecompiledHeaderFile>pch.h</PrecompiledHeaderFile>
|
||||
</ClCompile>
|
||||
<Link>
|
||||
<SubSystem>Windows</SubSystem>
|
||||
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||
<EnableCOMDATFolding>true</EnableCOMDATFolding>
|
||||
<OptimizeReferences>true</OptimizeReferences>
|
||||
</Link>
|
||||
</ItemDefinitionGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
|
||||
<ImportGroup Label="ExtensionTargets">
|
||||
</ImportGroup>
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project DefaultTargets="Build" ToolsVersion="14.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<ItemGroup Label="ProjectConfigurations">
|
||||
<ProjectConfiguration Include="Debug|Win32">
|
||||
<Configuration>Debug</Configuration>
|
||||
<Platform>Win32</Platform>
|
||||
</ProjectConfiguration>
|
||||
<ProjectConfiguration Include="Debug|x64">
|
||||
<Configuration>Debug</Configuration>
|
||||
<Platform>x64</Platform>
|
||||
</ProjectConfiguration>
|
||||
<ProjectConfiguration Include="Release|Win32">
|
||||
<Configuration>Release</Configuration>
|
||||
<Platform>Win32</Platform>
|
||||
</ProjectConfiguration>
|
||||
<ProjectConfiguration Include="Release|x64">
|
||||
<Configuration>Release</Configuration>
|
||||
<Platform>x64</Platform>
|
||||
</ProjectConfiguration>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ClInclude Include="..\Inc\Audio.h" />
|
||||
<ClInclude Include="SoundCommon.h" />
|
||||
<ClInclude Include="WaveBankReader.h" />
|
||||
<ClInclude Include="WAVFileReader.h" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ClCompile Include="AudioEngine.cpp">
|
||||
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">Create</PrecompiledHeader>
|
||||
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">Create</PrecompiledHeader>
|
||||
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">Create</PrecompiledHeader>
|
||||
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Release|x64'">Create</PrecompiledHeader>
|
||||
</ClCompile>
|
||||
<ClCompile Include="DynamicSoundEffectInstance.cpp" />
|
||||
<ClCompile Include="SoundCommon.cpp" />
|
||||
<ClCompile Include="SoundEffect.cpp" />
|
||||
<ClCompile Include="SoundEffectInstance.cpp" />
|
||||
<ClCompile Include="WaveBank.cpp" />
|
||||
<ClCompile Include="WaveBankReader.cpp" />
|
||||
<ClCompile Include="WAVFileReader.cpp" />
|
||||
</ItemGroup>
|
||||
<PropertyGroup Label="Globals">
|
||||
<ProjectGuid>{4F150A30-CECB-49D1-8283-6A3F57438CF5}</ProjectGuid>
|
||||
<Keyword>Win32Proj</Keyword>
|
||||
<RootNamespace>DirectXTKAudio</RootNamespace>
|
||||
</PropertyGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
|
||||
<ConfigurationType>StaticLibrary</ConfigurationType>
|
||||
<UseDebugLibraries>true</UseDebugLibraries>
|
||||
<PlatformToolset>v140</PlatformToolset>
|
||||
<CharacterSet>Unicode</CharacterSet>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
|
||||
<ConfigurationType>StaticLibrary</ConfigurationType>
|
||||
<UseDebugLibraries>true</UseDebugLibraries>
|
||||
<PlatformToolset>v140</PlatformToolset>
|
||||
<CharacterSet>Unicode</CharacterSet>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
|
||||
<ConfigurationType>StaticLibrary</ConfigurationType>
|
||||
<UseDebugLibraries>false</UseDebugLibraries>
|
||||
<PlatformToolset>v140</PlatformToolset>
|
||||
<CharacterSet>Unicode</CharacterSet>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
|
||||
<ConfigurationType>StaticLibrary</ConfigurationType>
|
||||
<UseDebugLibraries>false</UseDebugLibraries>
|
||||
<PlatformToolset>v140</PlatformToolset>
|
||||
<CharacterSet>Unicode</CharacterSet>
|
||||
</PropertyGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
|
||||
<ImportGroup Label="ExtensionSettings">
|
||||
</ImportGroup>
|
||||
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
|
||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||
</ImportGroup>
|
||||
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="PropertySheets">
|
||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||
</ImportGroup>
|
||||
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
|
||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||
</ImportGroup>
|
||||
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="PropertySheets">
|
||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||
</ImportGroup>
|
||||
<PropertyGroup Label="UserMacros" />
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
|
||||
<OutDir>Bin\Desktop_2015\$(Platform)\$(Configuration)\</OutDir>
|
||||
<IntDir>Bin\Desktop_2015\$(Platform)\$(Configuration)\</IntDir>
|
||||
<TargetName>DirectXTKAudioWin8</TargetName>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
|
||||
<OutDir>Bin\Desktop_2015\$(Platform)\$(Configuration)\</OutDir>
|
||||
<IntDir>Bin\Desktop_2015\$(Platform)\$(Configuration)\</IntDir>
|
||||
<TargetName>DirectXTKAudioWin8</TargetName>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
|
||||
<OutDir>Bin\Desktop_2015\$(Platform)\$(Configuration)\</OutDir>
|
||||
<IntDir>Bin\Desktop_2015\$(Platform)\$(Configuration)\</IntDir>
|
||||
<TargetName>DirectXTKAudioWin8</TargetName>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
|
||||
<OutDir>Bin\Desktop_2015\$(Platform)\$(Configuration)\</OutDir>
|
||||
<IntDir>Bin\Desktop_2015\$(Platform)\$(Configuration)\</IntDir>
|
||||
<TargetName>DirectXTKAudioWin8</TargetName>
|
||||
</PropertyGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
|
||||
<ClCompile>
|
||||
<PrecompiledHeader>Use</PrecompiledHeader>
|
||||
<WarningLevel>Level4</WarningLevel>
|
||||
<Optimization>Disabled</Optimization>
|
||||
<PreprocessorDefinitions>_WIN32_WINNT=0x0602;WIN32;_DEBUG;_LIB;_CRT_STDIO_ARBITRARY_WIDE_SPECIFIERS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<AdditionalIncludeDirectories>..\Inc;..\Src;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
<EnableEnhancedInstructionSet>StreamingSIMDExtensions2</EnableEnhancedInstructionSet>
|
||||
<FloatingPointModel>Fast</FloatingPointModel>
|
||||
<ProgramDataBaseFileName>$(IntDir)$(TargetName).pdb</ProgramDataBaseFileName>
|
||||
<PrecompiledHeaderFile>pch.h</PrecompiledHeaderFile>
|
||||
</ClCompile>
|
||||
<Link>
|
||||
<SubSystem>Windows</SubSystem>
|
||||
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||
</Link>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
|
||||
<ClCompile>
|
||||
<PrecompiledHeader>Use</PrecompiledHeader>
|
||||
<WarningLevel>Level4</WarningLevel>
|
||||
<Optimization>Disabled</Optimization>
|
||||
<PreprocessorDefinitions>_WIN32_WINNT=0x0602;WIN32;_DEBUG;_LIB;_CRT_STDIO_ARBITRARY_WIDE_SPECIFIERS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<AdditionalIncludeDirectories>..\Inc;..\Src;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
<FloatingPointModel>Fast</FloatingPointModel>
|
||||
<ProgramDataBaseFileName>$(IntDir)$(TargetName).pdb</ProgramDataBaseFileName>
|
||||
<PrecompiledHeaderFile>pch.h</PrecompiledHeaderFile>
|
||||
</ClCompile>
|
||||
<Link>
|
||||
<SubSystem>Windows</SubSystem>
|
||||
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||
</Link>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
|
||||
<ClCompile>
|
||||
<WarningLevel>Level4</WarningLevel>
|
||||
<PrecompiledHeader>Use</PrecompiledHeader>
|
||||
<Optimization>MaxSpeed</Optimization>
|
||||
<FunctionLevelLinking>true</FunctionLevelLinking>
|
||||
<IntrinsicFunctions>true</IntrinsicFunctions>
|
||||
<PreprocessorDefinitions>_WIN32_WINNT=0x0602;WIN32;NDEBUG;_LIB;_CRT_STDIO_ARBITRARY_WIDE_SPECIFIERS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<AdditionalIncludeDirectories>..\Inc;..\Src;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
<EnableEnhancedInstructionSet>StreamingSIMDExtensions2</EnableEnhancedInstructionSet>
|
||||
<FloatingPointModel>Fast</FloatingPointModel>
|
||||
<ProgramDataBaseFileName>$(IntDir)$(TargetName).pdb</ProgramDataBaseFileName>
|
||||
<PrecompiledHeaderFile>pch.h</PrecompiledHeaderFile>
|
||||
</ClCompile>
|
||||
<Link>
|
||||
<SubSystem>Windows</SubSystem>
|
||||
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||
<EnableCOMDATFolding>true</EnableCOMDATFolding>
|
||||
<OptimizeReferences>true</OptimizeReferences>
|
||||
</Link>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
|
||||
<ClCompile>
|
||||
<WarningLevel>Level4</WarningLevel>
|
||||
<PrecompiledHeader>Use</PrecompiledHeader>
|
||||
<Optimization>MaxSpeed</Optimization>
|
||||
<FunctionLevelLinking>true</FunctionLevelLinking>
|
||||
<IntrinsicFunctions>true</IntrinsicFunctions>
|
||||
<PreprocessorDefinitions>_WIN32_WINNT=0x0602;WIN32;NDEBUG;_LIB;_CRT_STDIO_ARBITRARY_WIDE_SPECIFIERS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<AdditionalIncludeDirectories>..\Inc;..\Src;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
<FloatingPointModel>Fast</FloatingPointModel>
|
||||
<ProgramDataBaseFileName>$(IntDir)$(TargetName).pdb</ProgramDataBaseFileName>
|
||||
<PrecompiledHeaderFile>pch.h</PrecompiledHeaderFile>
|
||||
</ClCompile>
|
||||
<Link>
|
||||
<SubSystem>Windows</SubSystem>
|
||||
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||
<EnableCOMDATFolding>true</EnableCOMDATFolding>
|
||||
<OptimizeReferences>true</OptimizeReferences>
|
||||
</Link>
|
||||
</ItemDefinitionGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
|
||||
<ImportGroup Label="ExtensionTargets">
|
||||
</ImportGroup>
|
||||
</Project>
|
|
@ -1,53 +1,53 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<ItemGroup>
|
||||
<Filter Include="Inc">
|
||||
<UniqueIdentifier>{93995380-89BD-4b04-88EB-625FBE52EBFB}</UniqueIdentifier>
|
||||
<Extensions>h;hpp;hxx;hm;inl;inc;xsd</Extensions>
|
||||
</Filter>
|
||||
<Filter Include="Src">
|
||||
<UniqueIdentifier>{4FC737F1-C7A5-4376-A066-2A32D752A2FF}</UniqueIdentifier>
|
||||
<Extensions>cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx</Extensions>
|
||||
</Filter>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ClInclude Include="WaveBankReader.h">
|
||||
<Filter>Inc</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="WAVFileReader.h">
|
||||
<Filter>Inc</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\Inc\Audio.h">
|
||||
<Filter>Inc</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="SoundCommon.h">
|
||||
<Filter>Inc</Filter>
|
||||
</ClInclude>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ClCompile Include="AudioEngine.cpp">
|
||||
<Filter>Src</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="WaveBankReader.cpp">
|
||||
<Filter>Src</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="WAVFileReader.cpp">
|
||||
<Filter>Src</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="SoundEffect.cpp">
|
||||
<Filter>Src</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="WaveBank.cpp">
|
||||
<Filter>Src</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="SoundEffectInstance.cpp">
|
||||
<Filter>Src</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="SoundCommon.cpp">
|
||||
<Filter>Src</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="DynamicSoundEffectInstance.cpp">
|
||||
<Filter>Src</Filter>
|
||||
</ClCompile>
|
||||
</ItemGroup>
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<ItemGroup>
|
||||
<Filter Include="Inc">
|
||||
<UniqueIdentifier>{93995380-89BD-4b04-88EB-625FBE52EBFB}</UniqueIdentifier>
|
||||
<Extensions>h;hpp;hxx;hm;inl;inc;xsd</Extensions>
|
||||
</Filter>
|
||||
<Filter Include="Src">
|
||||
<UniqueIdentifier>{4FC737F1-C7A5-4376-A066-2A32D752A2FF}</UniqueIdentifier>
|
||||
<Extensions>cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx</Extensions>
|
||||
</Filter>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ClInclude Include="WaveBankReader.h">
|
||||
<Filter>Inc</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="WAVFileReader.h">
|
||||
<Filter>Inc</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\Inc\Audio.h">
|
||||
<Filter>Inc</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="SoundCommon.h">
|
||||
<Filter>Inc</Filter>
|
||||
</ClInclude>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ClCompile Include="AudioEngine.cpp">
|
||||
<Filter>Src</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="WaveBankReader.cpp">
|
||||
<Filter>Src</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="WAVFileReader.cpp">
|
||||
<Filter>Src</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="SoundEffect.cpp">
|
||||
<Filter>Src</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="WaveBank.cpp">
|
||||
<Filter>Src</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="SoundEffectInstance.cpp">
|
||||
<Filter>Src</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="SoundCommon.cpp">
|
||||
<Filter>Src</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="DynamicSoundEffectInstance.cpp">
|
||||
<Filter>Src</Filter>
|
||||
</ClCompile>
|
||||
</ItemGroup>
|
||||
</Project>
|
|
@ -1,334 +1,334 @@
|
|||
//--------------------------------------------------------------------------------------
|
||||
// File: SoundEffectInstance.cpp
|
||||
//
|
||||
// THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF
|
||||
// ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO
|
||||
// THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A
|
||||
// PARTICULAR PURPOSE.
|
||||
//
|
||||
// Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
//
|
||||
// http://go.microsoft.com/fwlink/?LinkId=248929
|
||||
//--------------------------------------------------------------------------------------
|
||||
|
||||
#include "pch.h"
|
||||
#include "SoundCommon.h"
|
||||
|
||||
using namespace DirectX;
|
||||
|
||||
|
||||
//======================================================================================
|
||||
// SoundEffectInstance
|
||||
//======================================================================================
|
||||
|
||||
// Internal object implementation class.
|
||||
class SoundEffectInstance::Impl : public IVoiceNotify
|
||||
{
|
||||
public:
|
||||
Impl( _In_ AudioEngine* engine, _In_ SoundEffect* effect, SOUND_EFFECT_INSTANCE_FLAGS flags ) :
|
||||
mBase(),
|
||||
mEffect( effect ),
|
||||
mWaveBank( nullptr ),
|
||||
mIndex( 0 ),
|
||||
mLooped( false )
|
||||
{
|
||||
assert( engine != 0 );
|
||||
engine->RegisterNotify( this, false );
|
||||
|
||||
assert( mEffect != 0 );
|
||||
mBase.Initialize( engine, effect->GetFormat(), flags );
|
||||
}
|
||||
|
||||
Impl( _In_ AudioEngine* engine, _In_ WaveBank* waveBank, uint32_t index, SOUND_EFFECT_INSTANCE_FLAGS flags ) :
|
||||
mBase(),
|
||||
mEffect( nullptr ),
|
||||
mWaveBank( waveBank ),
|
||||
mIndex( index ),
|
||||
mLooped( false )
|
||||
{
|
||||
assert( engine != 0 );
|
||||
engine->RegisterNotify( this, false );
|
||||
|
||||
char buff[64];
|
||||
auto wfx = reinterpret_cast<WAVEFORMATEX*>( buff );
|
||||
assert( mWaveBank != 0 );
|
||||
mBase.Initialize( engine, mWaveBank->GetFormat( index, wfx, 64 ), flags );
|
||||
}
|
||||
|
||||
virtual ~Impl()
|
||||
{
|
||||
mBase.DestroyVoice();
|
||||
|
||||
if ( mBase.engine )
|
||||
{
|
||||
mBase.engine->UnregisterNotify( this, false, false );
|
||||
mBase.engine = nullptr;
|
||||
}
|
||||
}
|
||||
|
||||
void Play( bool loop );
|
||||
|
||||
// IVoiceNotify
|
||||
virtual void __cdecl OnBufferEnd() override
|
||||
{
|
||||
// We don't register for this notification for SoundEffectInstances, so this should not be invoked
|
||||
assert( false );
|
||||
}
|
||||
|
||||
virtual void __cdecl OnCriticalError() override
|
||||
{
|
||||
mBase.OnCriticalError();
|
||||
}
|
||||
|
||||
virtual void __cdecl OnReset() override
|
||||
{
|
||||
mBase.OnReset();
|
||||
}
|
||||
|
||||
virtual void __cdecl OnUpdate() override
|
||||
{
|
||||
// We do not register for update notification
|
||||
assert(false);
|
||||
}
|
||||
|
||||
virtual void __cdecl OnDestroyEngine() override
|
||||
{
|
||||
mBase.OnDestroy();
|
||||
}
|
||||
|
||||
virtual void __cdecl OnTrim() override
|
||||
{
|
||||
mBase.OnTrim();
|
||||
}
|
||||
|
||||
virtual void __cdecl GatherStatistics( AudioStatistics& stats ) const override
|
||||
{
|
||||
mBase.GatherStatistics(stats);
|
||||
}
|
||||
|
||||
SoundEffectInstanceBase mBase;
|
||||
SoundEffect* mEffect;
|
||||
WaveBank* mWaveBank;
|
||||
uint32_t mIndex;
|
||||
bool mLooped;
|
||||
};
|
||||
|
||||
|
||||
void SoundEffectInstance::Impl::Play( bool loop )
|
||||
{
|
||||
if ( !mBase.voice )
|
||||
{
|
||||
if ( mWaveBank )
|
||||
{
|
||||
char buff[64];
|
||||
auto wfx = reinterpret_cast<WAVEFORMATEX*>( buff );
|
||||
mBase.AllocateVoice( mWaveBank->GetFormat( mIndex, wfx, 64) );
|
||||
}
|
||||
else
|
||||
{
|
||||
assert( mEffect != 0 );
|
||||
mBase.AllocateVoice( mEffect->GetFormat() );
|
||||
}
|
||||
}
|
||||
|
||||
if ( !mBase.Play() )
|
||||
return;
|
||||
|
||||
// Submit audio data for STOPPED -> PLAYING state transition
|
||||
XAUDIO2_BUFFER buffer;
|
||||
|
||||
#if defined(_XBOX_ONE) || (_WIN32_WINNT < _WIN32_WINNT_WIN8) || (_WIN32_WINNT >= _WIN32_WINNT_WIN10)
|
||||
|
||||
bool iswma = false;
|
||||
XAUDIO2_BUFFER_WMA wmaBuffer;
|
||||
if ( mWaveBank )
|
||||
{
|
||||
iswma = mWaveBank->FillSubmitBuffer( mIndex, buffer, wmaBuffer );
|
||||
}
|
||||
else
|
||||
{
|
||||
assert( mEffect != 0 );
|
||||
iswma = mEffect->FillSubmitBuffer( buffer, wmaBuffer );
|
||||
}
|
||||
|
||||
#else
|
||||
|
||||
if ( mWaveBank )
|
||||
{
|
||||
mWaveBank->FillSubmitBuffer( mIndex, buffer );
|
||||
}
|
||||
else
|
||||
{
|
||||
assert( mEffect != 0 );
|
||||
mEffect->FillSubmitBuffer( buffer );
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
buffer.Flags = XAUDIO2_END_OF_STREAM;
|
||||
if ( loop )
|
||||
{
|
||||
mLooped = true;
|
||||
buffer.LoopCount = XAUDIO2_LOOP_INFINITE;
|
||||
}
|
||||
else
|
||||
{
|
||||
mLooped = false;
|
||||
buffer.LoopCount = buffer.LoopBegin = buffer.LoopLength = 0;
|
||||
}
|
||||
buffer.pContext = nullptr;
|
||||
|
||||
HRESULT hr;
|
||||
#if defined(_XBOX_ONE) || (_WIN32_WINNT < _WIN32_WINNT_WIN8) || (_WIN32_WINNT >= _WIN32_WINNT_WIN10)
|
||||
if ( iswma )
|
||||
{
|
||||
hr = mBase.voice->SubmitSourceBuffer( &buffer, &wmaBuffer );
|
||||
}
|
||||
else
|
||||
#endif
|
||||
{
|
||||
hr = mBase.voice->SubmitSourceBuffer( &buffer, nullptr );
|
||||
}
|
||||
|
||||
if ( FAILED(hr) )
|
||||
{
|
||||
#ifdef _DEBUG
|
||||
DebugTrace( "ERROR: SoundEffectInstance failed (%08X) when submitting buffer:\n", hr );
|
||||
|
||||
char buff[64];
|
||||
auto wfx = ( mWaveBank ) ? mWaveBank->GetFormat( mIndex, reinterpret_cast<WAVEFORMATEX*>( buff ), 64 )
|
||||
: mEffect->GetFormat();
|
||||
|
||||
size_t length = ( mWaveBank ) ? mWaveBank->GetSampleSizeInBytes( mIndex ) : mEffect->GetSampleSizeInBytes();
|
||||
|
||||
DebugTrace( "\tFormat Tag %u, %u channels, %u-bit, %u Hz, %Iu bytes\n", wfx->wFormatTag,
|
||||
wfx->nChannels, wfx->wBitsPerSample, wfx->nSamplesPerSec, length );
|
||||
#endif
|
||||
mBase.Stop( true, mLooped );
|
||||
throw std::exception( "SubmitSourceBuffer" );
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
//--------------------------------------------------------------------------------------
|
||||
// SoundEffectInstance
|
||||
//--------------------------------------------------------------------------------------
|
||||
|
||||
// Private constructors
|
||||
_Use_decl_annotations_
|
||||
SoundEffectInstance::SoundEffectInstance( AudioEngine* engine, SoundEffect* effect, SOUND_EFFECT_INSTANCE_FLAGS flags ) :
|
||||
pImpl( new Impl( engine, effect, flags ) )
|
||||
{
|
||||
}
|
||||
|
||||
_Use_decl_annotations_
|
||||
SoundEffectInstance::SoundEffectInstance( AudioEngine* engine, WaveBank* waveBank, int index, SOUND_EFFECT_INSTANCE_FLAGS flags ) :
|
||||
pImpl( new Impl( engine, waveBank, index, flags ) )
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
// Move constructor.
|
||||
SoundEffectInstance::SoundEffectInstance(SoundEffectInstance&& moveFrom)
|
||||
: pImpl(std::move(moveFrom.pImpl))
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
// Move assignment.
|
||||
SoundEffectInstance& SoundEffectInstance::operator= (SoundEffectInstance&& moveFrom)
|
||||
{
|
||||
pImpl = std::move(moveFrom.pImpl);
|
||||
return *this;
|
||||
}
|
||||
|
||||
|
||||
// Public destructor.
|
||||
SoundEffectInstance::~SoundEffectInstance()
|
||||
{
|
||||
if( pImpl )
|
||||
{
|
||||
if ( pImpl->mWaveBank )
|
||||
{
|
||||
pImpl->mWaveBank->UnregisterInstance( this );
|
||||
pImpl->mWaveBank = nullptr;
|
||||
}
|
||||
|
||||
if ( pImpl->mEffect )
|
||||
{
|
||||
pImpl->mEffect->UnregisterInstance( this );
|
||||
pImpl->mEffect = nullptr;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// Public methods.
|
||||
void SoundEffectInstance::Play( bool loop )
|
||||
{
|
||||
pImpl->Play( loop );
|
||||
}
|
||||
|
||||
|
||||
void SoundEffectInstance::Stop( bool immediate )
|
||||
{
|
||||
pImpl->mBase.Stop( immediate, pImpl->mLooped );
|
||||
}
|
||||
|
||||
|
||||
void SoundEffectInstance::Pause()
|
||||
{
|
||||
pImpl->mBase.Pause();
|
||||
}
|
||||
|
||||
|
||||
void SoundEffectInstance::Resume()
|
||||
{
|
||||
pImpl->mBase.Resume();
|
||||
}
|
||||
|
||||
|
||||
void SoundEffectInstance::SetVolume( float volume )
|
||||
{
|
||||
pImpl->mBase.SetVolume( volume );
|
||||
}
|
||||
|
||||
|
||||
void SoundEffectInstance::SetPitch( float pitch )
|
||||
{
|
||||
pImpl->mBase.SetPitch( pitch );
|
||||
}
|
||||
|
||||
|
||||
void SoundEffectInstance::SetPan( float pan )
|
||||
{
|
||||
pImpl->mBase.SetPan( pan );
|
||||
}
|
||||
|
||||
|
||||
void SoundEffectInstance::Apply3D( const AudioListener& listener, const AudioEmitter& emitter, bool rhcoords )
|
||||
{
|
||||
pImpl->mBase.Apply3D( listener, emitter, rhcoords );
|
||||
}
|
||||
|
||||
|
||||
// Public accessors.
|
||||
bool SoundEffectInstance::IsLooped() const
|
||||
{
|
||||
return pImpl->mLooped;
|
||||
}
|
||||
|
||||
|
||||
SoundState SoundEffectInstance::GetState()
|
||||
{
|
||||
return pImpl->mBase.GetState( true );
|
||||
}
|
||||
|
||||
|
||||
// Notifications.
|
||||
void SoundEffectInstance::OnDestroyParent()
|
||||
{
|
||||
pImpl->mBase.OnDestroy();
|
||||
pImpl->mWaveBank = nullptr;
|
||||
pImpl->mEffect = nullptr;
|
||||
//--------------------------------------------------------------------------------------
|
||||
// File: SoundEffectInstance.cpp
|
||||
//
|
||||
// THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF
|
||||
// ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO
|
||||
// THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A
|
||||
// PARTICULAR PURPOSE.
|
||||
//
|
||||
// Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
//
|
||||
// http://go.microsoft.com/fwlink/?LinkId=248929
|
||||
//--------------------------------------------------------------------------------------
|
||||
|
||||
#include "pch.h"
|
||||
#include "SoundCommon.h"
|
||||
|
||||
using namespace DirectX;
|
||||
|
||||
|
||||
//======================================================================================
|
||||
// SoundEffectInstance
|
||||
//======================================================================================
|
||||
|
||||
// Internal object implementation class.
|
||||
class SoundEffectInstance::Impl : public IVoiceNotify
|
||||
{
|
||||
public:
|
||||
Impl( _In_ AudioEngine* engine, _In_ SoundEffect* effect, SOUND_EFFECT_INSTANCE_FLAGS flags ) :
|
||||
mBase(),
|
||||
mEffect( effect ),
|
||||
mWaveBank( nullptr ),
|
||||
mIndex( 0 ),
|
||||
mLooped( false )
|
||||
{
|
||||
assert( engine != 0 );
|
||||
engine->RegisterNotify( this, false );
|
||||
|
||||
assert( mEffect != 0 );
|
||||
mBase.Initialize( engine, effect->GetFormat(), flags );
|
||||
}
|
||||
|
||||
Impl( _In_ AudioEngine* engine, _In_ WaveBank* waveBank, uint32_t index, SOUND_EFFECT_INSTANCE_FLAGS flags ) :
|
||||
mBase(),
|
||||
mEffect( nullptr ),
|
||||
mWaveBank( waveBank ),
|
||||
mIndex( index ),
|
||||
mLooped( false )
|
||||
{
|
||||
assert( engine != 0 );
|
||||
engine->RegisterNotify( this, false );
|
||||
|
||||
char buff[64];
|
||||
auto wfx = reinterpret_cast<WAVEFORMATEX*>( buff );
|
||||
assert( mWaveBank != 0 );
|
||||
mBase.Initialize( engine, mWaveBank->GetFormat( index, wfx, 64 ), flags );
|
||||
}
|
||||
|
||||
virtual ~Impl()
|
||||
{
|
||||
mBase.DestroyVoice();
|
||||
|
||||
if ( mBase.engine )
|
||||
{
|
||||
mBase.engine->UnregisterNotify( this, false, false );
|
||||
mBase.engine = nullptr;
|
||||
}
|
||||
}
|
||||
|
||||
void Play( bool loop );
|
||||
|
||||
// IVoiceNotify
|
||||
virtual void __cdecl OnBufferEnd() override
|
||||
{
|
||||
// We don't register for this notification for SoundEffectInstances, so this should not be invoked
|
||||
assert( false );
|
||||
}
|
||||
|
||||
virtual void __cdecl OnCriticalError() override
|
||||
{
|
||||
mBase.OnCriticalError();
|
||||
}
|
||||
|
||||
virtual void __cdecl OnReset() override
|
||||
{
|
||||
mBase.OnReset();
|
||||
}
|
||||
|
||||
virtual void __cdecl OnUpdate() override
|
||||
{
|
||||
// We do not register for update notification
|
||||
assert(false);
|
||||
}
|
||||
|
||||
virtual void __cdecl OnDestroyEngine() override
|
||||
{
|
||||
mBase.OnDestroy();
|
||||
}
|
||||
|
||||
virtual void __cdecl OnTrim() override
|
||||
{
|
||||
mBase.OnTrim();
|
||||
}
|
||||
|
||||
virtual void __cdecl GatherStatistics( AudioStatistics& stats ) const override
|
||||
{
|
||||
mBase.GatherStatistics(stats);
|
||||
}
|
||||
|
||||
SoundEffectInstanceBase mBase;
|
||||
SoundEffect* mEffect;
|
||||
WaveBank* mWaveBank;
|
||||
uint32_t mIndex;
|
||||
bool mLooped;
|
||||
};
|
||||
|
||||
|
||||
void SoundEffectInstance::Impl::Play( bool loop )
|
||||
{
|
||||
if ( !mBase.voice )
|
||||
{
|
||||
if ( mWaveBank )
|
||||
{
|
||||
char buff[64];
|
||||
auto wfx = reinterpret_cast<WAVEFORMATEX*>( buff );
|
||||
mBase.AllocateVoice( mWaveBank->GetFormat( mIndex, wfx, 64) );
|
||||
}
|
||||
else
|
||||
{
|
||||
assert( mEffect != 0 );
|
||||
mBase.AllocateVoice( mEffect->GetFormat() );
|
||||
}
|
||||
}
|
||||
|
||||
if ( !mBase.Play() )
|
||||
return;
|
||||
|
||||
// Submit audio data for STOPPED -> PLAYING state transition
|
||||
XAUDIO2_BUFFER buffer;
|
||||
|
||||
#if defined(_XBOX_ONE) || (_WIN32_WINNT < _WIN32_WINNT_WIN8) || (_WIN32_WINNT >= _WIN32_WINNT_WIN10)
|
||||
|
||||
bool iswma = false;
|
||||
XAUDIO2_BUFFER_WMA wmaBuffer;
|
||||
if ( mWaveBank )
|
||||
{
|
||||
iswma = mWaveBank->FillSubmitBuffer( mIndex, buffer, wmaBuffer );
|
||||
}
|
||||
else
|
||||
{
|
||||
assert( mEffect != 0 );
|
||||
iswma = mEffect->FillSubmitBuffer( buffer, wmaBuffer );
|
||||
}
|
||||
|
||||
#else
|
||||
|
||||
if ( mWaveBank )
|
||||
{
|
||||
mWaveBank->FillSubmitBuffer( mIndex, buffer );
|
||||
}
|
||||
else
|
||||
{
|
||||
assert( mEffect != 0 );
|
||||
mEffect->FillSubmitBuffer( buffer );
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
buffer.Flags = XAUDIO2_END_OF_STREAM;
|
||||
if ( loop )
|
||||
{
|
||||
mLooped = true;
|
||||
buffer.LoopCount = XAUDIO2_LOOP_INFINITE;
|
||||
}
|
||||
else
|
||||
{
|
||||
mLooped = false;
|
||||
buffer.LoopCount = buffer.LoopBegin = buffer.LoopLength = 0;
|
||||
}
|
||||
buffer.pContext = nullptr;
|
||||
|
||||
HRESULT hr;
|
||||
#if defined(_XBOX_ONE) || (_WIN32_WINNT < _WIN32_WINNT_WIN8) || (_WIN32_WINNT >= _WIN32_WINNT_WIN10)
|
||||
if ( iswma )
|
||||
{
|
||||
hr = mBase.voice->SubmitSourceBuffer( &buffer, &wmaBuffer );
|
||||
}
|
||||
else
|
||||
#endif
|
||||
{
|
||||
hr = mBase.voice->SubmitSourceBuffer( &buffer, nullptr );
|
||||
}
|
||||
|
||||
if ( FAILED(hr) )
|
||||
{
|
||||
#ifdef _DEBUG
|
||||
DebugTrace( "ERROR: SoundEffectInstance failed (%08X) when submitting buffer:\n", hr );
|
||||
|
||||
char buff[64];
|
||||
auto wfx = ( mWaveBank ) ? mWaveBank->GetFormat( mIndex, reinterpret_cast<WAVEFORMATEX*>( buff ), 64 )
|
||||
: mEffect->GetFormat();
|
||||
|
||||
size_t length = ( mWaveBank ) ? mWaveBank->GetSampleSizeInBytes( mIndex ) : mEffect->GetSampleSizeInBytes();
|
||||
|
||||
DebugTrace( "\tFormat Tag %u, %u channels, %u-bit, %u Hz, %Iu bytes\n", wfx->wFormatTag,
|
||||
wfx->nChannels, wfx->wBitsPerSample, wfx->nSamplesPerSec, length );
|
||||
#endif
|
||||
mBase.Stop( true, mLooped );
|
||||
throw std::exception( "SubmitSourceBuffer" );
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
//--------------------------------------------------------------------------------------
|
||||
// SoundEffectInstance
|
||||
//--------------------------------------------------------------------------------------
|
||||
|
||||
// Private constructors
|
||||
_Use_decl_annotations_
|
||||
SoundEffectInstance::SoundEffectInstance( AudioEngine* engine, SoundEffect* effect, SOUND_EFFECT_INSTANCE_FLAGS flags ) :
|
||||
pImpl( new Impl( engine, effect, flags ) )
|
||||
{
|
||||
}
|
||||
|
||||
_Use_decl_annotations_
|
||||
SoundEffectInstance::SoundEffectInstance( AudioEngine* engine, WaveBank* waveBank, int index, SOUND_EFFECT_INSTANCE_FLAGS flags ) :
|
||||
pImpl( new Impl( engine, waveBank, index, flags ) )
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
// Move constructor.
|
||||
SoundEffectInstance::SoundEffectInstance(SoundEffectInstance&& moveFrom)
|
||||
: pImpl(std::move(moveFrom.pImpl))
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
// Move assignment.
|
||||
SoundEffectInstance& SoundEffectInstance::operator= (SoundEffectInstance&& moveFrom)
|
||||
{
|
||||
pImpl = std::move(moveFrom.pImpl);
|
||||
return *this;
|
||||
}
|
||||
|
||||
|
||||
// Public destructor.
|
||||
SoundEffectInstance::~SoundEffectInstance()
|
||||
{
|
||||
if( pImpl )
|
||||
{
|
||||
if ( pImpl->mWaveBank )
|
||||
{
|
||||
pImpl->mWaveBank->UnregisterInstance( this );
|
||||
pImpl->mWaveBank = nullptr;
|
||||
}
|
||||
|
||||
if ( pImpl->mEffect )
|
||||
{
|
||||
pImpl->mEffect->UnregisterInstance( this );
|
||||
pImpl->mEffect = nullptr;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// Public methods.
|
||||
void SoundEffectInstance::Play( bool loop )
|
||||
{
|
||||
pImpl->Play( loop );
|
||||
}
|
||||
|
||||
|
||||
void SoundEffectInstance::Stop( bool immediate )
|
||||
{
|
||||
pImpl->mBase.Stop( immediate, pImpl->mLooped );
|
||||
}
|
||||
|
||||
|
||||
void SoundEffectInstance::Pause()
|
||||
{
|
||||
pImpl->mBase.Pause();
|
||||
}
|
||||
|
||||
|
||||
void SoundEffectInstance::Resume()
|
||||
{
|
||||
pImpl->mBase.Resume();
|
||||
}
|
||||
|
||||
|
||||
void SoundEffectInstance::SetVolume( float volume )
|
||||
{
|
||||
pImpl->mBase.SetVolume( volume );
|
||||
}
|
||||
|
||||
|
||||
void SoundEffectInstance::SetPitch( float pitch )
|
||||
{
|
||||
pImpl->mBase.SetPitch( pitch );
|
||||
}
|
||||
|
||||
|
||||
void SoundEffectInstance::SetPan( float pan )
|
||||
{
|
||||
pImpl->mBase.SetPan( pan );
|
||||
}
|
||||
|
||||
|
||||
void SoundEffectInstance::Apply3D( const AudioListener& listener, const AudioEmitter& emitter, bool rhcoords )
|
||||
{
|
||||
pImpl->mBase.Apply3D( listener, emitter, rhcoords );
|
||||
}
|
||||
|
||||
|
||||
// Public accessors.
|
||||
bool SoundEffectInstance::IsLooped() const
|
||||
{
|
||||
return pImpl->mLooped;
|
||||
}
|
||||
|
||||
|
||||
SoundState SoundEffectInstance::GetState()
|
||||
{
|
||||
return pImpl->mBase.GetState( true );
|
||||
}
|
||||
|
||||
|
||||
// Notifications.
|
||||
void SoundEffectInstance::OnDestroyParent()
|
||||
{
|
||||
pImpl->mBase.OnDestroy();
|
||||
pImpl->mWaveBank = nullptr;
|
||||
pImpl->mEffect = nullptr;
|
||||
}
|
Разница между файлами не показана из-за своего большого размера
Загрузить разницу
|
@ -1,55 +1,55 @@
|
|||
//--------------------------------------------------------------------------------------
|
||||
// File: WAVFileReader.h
|
||||
//
|
||||
// Functions for loading WAV audio files
|
||||
//
|
||||
// THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF
|
||||
// ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO
|
||||
// THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A
|
||||
// PARTICULAR PURPOSE.
|
||||
//
|
||||
// Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
//
|
||||
// http://go.microsoft.com/fwlink/?LinkId=248929
|
||||
//-------------------------------------------------------------------------------------
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <stdint.h>
|
||||
#include <objbase.h>
|
||||
#include <memory>
|
||||
#include <mmreg.h>
|
||||
|
||||
|
||||
namespace DirectX
|
||||
{
|
||||
HRESULT LoadWAVAudioInMemory( _In_reads_bytes_(wavDataSize) const uint8_t* wavData,
|
||||
_In_ size_t wavDataSize,
|
||||
_Outptr_ const WAVEFORMATEX** wfx,
|
||||
_Outptr_ const uint8_t** startAudio,
|
||||
_Out_ uint32_t* audioBytes );
|
||||
|
||||
HRESULT LoadWAVAudioFromFile( _In_z_ const wchar_t* szFileName,
|
||||
_Inout_ std::unique_ptr<uint8_t[]>& wavData,
|
||||
_Outptr_ const WAVEFORMATEX** wfx,
|
||||
_Outptr_ const uint8_t** startAudio,
|
||||
_Out_ uint32_t* audioBytes );
|
||||
|
||||
struct WAVData
|
||||
{
|
||||
const WAVEFORMATEX* wfx;
|
||||
const uint8_t* startAudio;
|
||||
uint32_t audioBytes;
|
||||
uint32_t loopStart;
|
||||
uint32_t loopLength;
|
||||
const uint32_t* seek; // Note: XMA Seek data is Big-Endian
|
||||
uint32_t seekCount;
|
||||
};
|
||||
|
||||
HRESULT LoadWAVAudioInMemoryEx( _In_reads_bytes_(wavDataSize) const uint8_t* wavData,
|
||||
_In_ size_t wavDataSize, _Out_ WAVData& result );
|
||||
|
||||
HRESULT LoadWAVAudioFromFileEx( _In_z_ const wchar_t* szFileName,
|
||||
_Inout_ std::unique_ptr<uint8_t[]>& wavData,
|
||||
_Out_ WAVData& result );
|
||||
//--------------------------------------------------------------------------------------
|
||||
// File: WAVFileReader.h
|
||||
//
|
||||
// Functions for loading WAV audio files
|
||||
//
|
||||
// THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF
|
||||
// ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO
|
||||
// THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A
|
||||
// PARTICULAR PURPOSE.
|
||||
//
|
||||
// Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
//
|
||||
// http://go.microsoft.com/fwlink/?LinkId=248929
|
||||
//-------------------------------------------------------------------------------------
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <stdint.h>
|
||||
#include <objbase.h>
|
||||
#include <memory>
|
||||
#include <mmreg.h>
|
||||
|
||||
|
||||
namespace DirectX
|
||||
{
|
||||
HRESULT LoadWAVAudioInMemory( _In_reads_bytes_(wavDataSize) const uint8_t* wavData,
|
||||
_In_ size_t wavDataSize,
|
||||
_Outptr_ const WAVEFORMATEX** wfx,
|
||||
_Outptr_ const uint8_t** startAudio,
|
||||
_Out_ uint32_t* audioBytes );
|
||||
|
||||
HRESULT LoadWAVAudioFromFile( _In_z_ const wchar_t* szFileName,
|
||||
_Inout_ std::unique_ptr<uint8_t[]>& wavData,
|
||||
_Outptr_ const WAVEFORMATEX** wfx,
|
||||
_Outptr_ const uint8_t** startAudio,
|
||||
_Out_ uint32_t* audioBytes );
|
||||
|
||||
struct WAVData
|
||||
{
|
||||
const WAVEFORMATEX* wfx;
|
||||
const uint8_t* startAudio;
|
||||
uint32_t audioBytes;
|
||||
uint32_t loopStart;
|
||||
uint32_t loopLength;
|
||||
const uint32_t* seek; // Note: XMA Seek data is Big-Endian
|
||||
uint32_t seekCount;
|
||||
};
|
||||
|
||||
HRESULT LoadWAVAudioInMemoryEx( _In_reads_bytes_(wavDataSize) const uint8_t* wavData,
|
||||
_In_ size_t wavDataSize, _Out_ WAVData& result );
|
||||
|
||||
HRESULT LoadWAVAudioFromFileEx( _In_z_ const wchar_t* szFileName,
|
||||
_Inout_ std::unique_ptr<uint8_t[]>& wavData,
|
||||
_Out_ WAVData& result );
|
||||
}
|
1022
Audio/WaveBank.cpp
1022
Audio/WaveBank.cpp
Разница между файлами не показана из-за своего большого размера
Загрузить разницу
|
@ -1,76 +1,76 @@
|
|||
|
||||
Microsoft Visual Studio Solution File, Format Version 12.00
|
||||
# Visual Studio 2013
|
||||
VisualStudioVersion = 12.0.21005.1
|
||||
MinimumVisualStudioVersion = 10.0.40219.1
|
||||
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "DirectXTK_Desktop_2013", "DirectXTK_Desktop_2013.vcxproj", "{E0B52AE7-E160-4D32-BF3F-910B785E5A8E}"
|
||||
EndProject
|
||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "MakeSpriteFont", "MakeSpriteFont\MakeSpriteFont.csproj", "{7329B02D-C504-482A-A156-181D48CE493C}"
|
||||
EndProject
|
||||
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "DirectXTKAudio_Desktop_2013_Win8", "Audio\DirectXTKAudio_Desktop_2013_Win8.vcxproj", "{4F150A30-CECB-49D1-8283-6A3F57438CF5}"
|
||||
EndProject
|
||||
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "XWBTool_Desktop_2013", "XWBTool\XWBTool_Desktop_2013.vcxproj", "{C7AB4186-54B2-4244-A533-77494763EA1D}"
|
||||
EndProject
|
||||
Global
|
||||
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
||||
Debug|Mixed Platforms = Debug|Mixed Platforms
|
||||
Debug|Win32 = Debug|Win32
|
||||
Debug|x64 = Debug|x64
|
||||
Release|Mixed Platforms = Release|Mixed Platforms
|
||||
Release|Win32 = Release|Win32
|
||||
Release|x64 = Release|x64
|
||||
EndGlobalSection
|
||||
GlobalSection(ProjectConfigurationPlatforms) = postSolution
|
||||
{E0B52AE7-E160-4D32-BF3F-910B785E5A8E}.Debug|Mixed Platforms.ActiveCfg = Debug|Win32
|
||||
{E0B52AE7-E160-4D32-BF3F-910B785E5A8E}.Debug|Mixed Platforms.Build.0 = Debug|Win32
|
||||
{E0B52AE7-E160-4D32-BF3F-910B785E5A8E}.Debug|Win32.ActiveCfg = Debug|Win32
|
||||
{E0B52AE7-E160-4D32-BF3F-910B785E5A8E}.Debug|Win32.Build.0 = Debug|Win32
|
||||
{E0B52AE7-E160-4D32-BF3F-910B785E5A8E}.Debug|x64.ActiveCfg = Debug|x64
|
||||
{E0B52AE7-E160-4D32-BF3F-910B785E5A8E}.Debug|x64.Build.0 = Debug|x64
|
||||
{E0B52AE7-E160-4D32-BF3F-910B785E5A8E}.Release|Mixed Platforms.ActiveCfg = Release|Win32
|
||||
{E0B52AE7-E160-4D32-BF3F-910B785E5A8E}.Release|Mixed Platforms.Build.0 = Release|Win32
|
||||
{E0B52AE7-E160-4D32-BF3F-910B785E5A8E}.Release|Win32.ActiveCfg = Release|Win32
|
||||
{E0B52AE7-E160-4D32-BF3F-910B785E5A8E}.Release|Win32.Build.0 = Release|Win32
|
||||
{E0B52AE7-E160-4D32-BF3F-910B785E5A8E}.Release|x64.ActiveCfg = Release|x64
|
||||
{E0B52AE7-E160-4D32-BF3F-910B785E5A8E}.Release|x64.Build.0 = Release|x64
|
||||
{7329B02D-C504-482A-A156-181D48CE493C}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU
|
||||
{7329B02D-C504-482A-A156-181D48CE493C}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU
|
||||
{7329B02D-C504-482A-A156-181D48CE493C}.Debug|Win32.ActiveCfg = Debug|Any CPU
|
||||
{7329B02D-C504-482A-A156-181D48CE493C}.Debug|Win32.Build.0 = Debug|Any CPU
|
||||
{7329B02D-C504-482A-A156-181D48CE493C}.Debug|x64.ActiveCfg = Debug|Any CPU
|
||||
{7329B02D-C504-482A-A156-181D48CE493C}.Debug|x64.Build.0 = Debug|Any CPU
|
||||
{7329B02D-C504-482A-A156-181D48CE493C}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU
|
||||
{7329B02D-C504-482A-A156-181D48CE493C}.Release|Mixed Platforms.Build.0 = Release|Any CPU
|
||||
{7329B02D-C504-482A-A156-181D48CE493C}.Release|Win32.ActiveCfg = Release|Any CPU
|
||||
{7329B02D-C504-482A-A156-181D48CE493C}.Release|Win32.Build.0 = Release|Any CPU
|
||||
{7329B02D-C504-482A-A156-181D48CE493C}.Release|x64.ActiveCfg = Release|Any CPU
|
||||
{7329B02D-C504-482A-A156-181D48CE493C}.Release|x64.Build.0 = Release|Any CPU
|
||||
{4F150A30-CECB-49D1-8283-6A3F57438CF5}.Debug|Mixed Platforms.ActiveCfg = Debug|Win32
|
||||
{4F150A30-CECB-49D1-8283-6A3F57438CF5}.Debug|Mixed Platforms.Build.0 = Debug|Win32
|
||||
{4F150A30-CECB-49D1-8283-6A3F57438CF5}.Debug|Win32.ActiveCfg = Debug|Win32
|
||||
{4F150A30-CECB-49D1-8283-6A3F57438CF5}.Debug|Win32.Build.0 = Debug|Win32
|
||||
{4F150A30-CECB-49D1-8283-6A3F57438CF5}.Debug|x64.ActiveCfg = Debug|x64
|
||||
{4F150A30-CECB-49D1-8283-6A3F57438CF5}.Debug|x64.Build.0 = Debug|x64
|
||||
{4F150A30-CECB-49D1-8283-6A3F57438CF5}.Release|Mixed Platforms.ActiveCfg = Release|Win32
|
||||
{4F150A30-CECB-49D1-8283-6A3F57438CF5}.Release|Mixed Platforms.Build.0 = Release|Win32
|
||||
{4F150A30-CECB-49D1-8283-6A3F57438CF5}.Release|Win32.ActiveCfg = Release|Win32
|
||||
{4F150A30-CECB-49D1-8283-6A3F57438CF5}.Release|Win32.Build.0 = Release|Win32
|
||||
{4F150A30-CECB-49D1-8283-6A3F57438CF5}.Release|x64.ActiveCfg = Release|x64
|
||||
{4F150A30-CECB-49D1-8283-6A3F57438CF5}.Release|x64.Build.0 = Release|x64
|
||||
{C7AB4186-54B2-4244-A533-77494763EA1D}.Debug|Mixed Platforms.ActiveCfg = Debug|Win32
|
||||
{C7AB4186-54B2-4244-A533-77494763EA1D}.Debug|Mixed Platforms.Build.0 = Debug|Win32
|
||||
{C7AB4186-54B2-4244-A533-77494763EA1D}.Debug|Win32.ActiveCfg = Debug|Win32
|
||||
{C7AB4186-54B2-4244-A533-77494763EA1D}.Debug|Win32.Build.0 = Debug|Win32
|
||||
{C7AB4186-54B2-4244-A533-77494763EA1D}.Debug|x64.ActiveCfg = Debug|x64
|
||||
{C7AB4186-54B2-4244-A533-77494763EA1D}.Debug|x64.Build.0 = Debug|x64
|
||||
{C7AB4186-54B2-4244-A533-77494763EA1D}.Release|Mixed Platforms.ActiveCfg = Release|Win32
|
||||
{C7AB4186-54B2-4244-A533-77494763EA1D}.Release|Mixed Platforms.Build.0 = Release|Win32
|
||||
{C7AB4186-54B2-4244-A533-77494763EA1D}.Release|Win32.ActiveCfg = Release|Win32
|
||||
{C7AB4186-54B2-4244-A533-77494763EA1D}.Release|Win32.Build.0 = Release|Win32
|
||||
{C7AB4186-54B2-4244-A533-77494763EA1D}.Release|x64.ActiveCfg = Release|x64
|
||||
{C7AB4186-54B2-4244-A533-77494763EA1D}.Release|x64.Build.0 = Release|x64
|
||||
EndGlobalSection
|
||||
GlobalSection(SolutionProperties) = preSolution
|
||||
HideSolutionNode = FALSE
|
||||
EndGlobalSection
|
||||
EndGlobal
|
||||
|
||||
Microsoft Visual Studio Solution File, Format Version 12.00
|
||||
# Visual Studio 2013
|
||||
VisualStudioVersion = 12.0.21005.1
|
||||
MinimumVisualStudioVersion = 10.0.40219.1
|
||||
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "DirectXTK_Desktop_2013", "DirectXTK_Desktop_2013.vcxproj", "{E0B52AE7-E160-4D32-BF3F-910B785E5A8E}"
|
||||
EndProject
|
||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "MakeSpriteFont", "MakeSpriteFont\MakeSpriteFont.csproj", "{7329B02D-C504-482A-A156-181D48CE493C}"
|
||||
EndProject
|
||||
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "DirectXTKAudio_Desktop_2013_Win8", "Audio\DirectXTKAudio_Desktop_2013_Win8.vcxproj", "{4F150A30-CECB-49D1-8283-6A3F57438CF5}"
|
||||
EndProject
|
||||
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "XWBTool_Desktop_2013", "XWBTool\XWBTool_Desktop_2013.vcxproj", "{C7AB4186-54B2-4244-A533-77494763EA1D}"
|
||||
EndProject
|
||||
Global
|
||||
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
||||
Debug|Mixed Platforms = Debug|Mixed Platforms
|
||||
Debug|Win32 = Debug|Win32
|
||||
Debug|x64 = Debug|x64
|
||||
Release|Mixed Platforms = Release|Mixed Platforms
|
||||
Release|Win32 = Release|Win32
|
||||
Release|x64 = Release|x64
|
||||
EndGlobalSection
|
||||
GlobalSection(ProjectConfigurationPlatforms) = postSolution
|
||||
{E0B52AE7-E160-4D32-BF3F-910B785E5A8E}.Debug|Mixed Platforms.ActiveCfg = Debug|Win32
|
||||
{E0B52AE7-E160-4D32-BF3F-910B785E5A8E}.Debug|Mixed Platforms.Build.0 = Debug|Win32
|
||||
{E0B52AE7-E160-4D32-BF3F-910B785E5A8E}.Debug|Win32.ActiveCfg = Debug|Win32
|
||||
{E0B52AE7-E160-4D32-BF3F-910B785E5A8E}.Debug|Win32.Build.0 = Debug|Win32
|
||||
{E0B52AE7-E160-4D32-BF3F-910B785E5A8E}.Debug|x64.ActiveCfg = Debug|x64
|
||||
{E0B52AE7-E160-4D32-BF3F-910B785E5A8E}.Debug|x64.Build.0 = Debug|x64
|
||||
{E0B52AE7-E160-4D32-BF3F-910B785E5A8E}.Release|Mixed Platforms.ActiveCfg = Release|Win32
|
||||
{E0B52AE7-E160-4D32-BF3F-910B785E5A8E}.Release|Mixed Platforms.Build.0 = Release|Win32
|
||||
{E0B52AE7-E160-4D32-BF3F-910B785E5A8E}.Release|Win32.ActiveCfg = Release|Win32
|
||||
{E0B52AE7-E160-4D32-BF3F-910B785E5A8E}.Release|Win32.Build.0 = Release|Win32
|
||||
{E0B52AE7-E160-4D32-BF3F-910B785E5A8E}.Release|x64.ActiveCfg = Release|x64
|
||||
{E0B52AE7-E160-4D32-BF3F-910B785E5A8E}.Release|x64.Build.0 = Release|x64
|
||||
{7329B02D-C504-482A-A156-181D48CE493C}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU
|
||||
{7329B02D-C504-482A-A156-181D48CE493C}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU
|
||||
{7329B02D-C504-482A-A156-181D48CE493C}.Debug|Win32.ActiveCfg = Debug|Any CPU
|
||||
{7329B02D-C504-482A-A156-181D48CE493C}.Debug|Win32.Build.0 = Debug|Any CPU
|
||||
{7329B02D-C504-482A-A156-181D48CE493C}.Debug|x64.ActiveCfg = Debug|Any CPU
|
||||
{7329B02D-C504-482A-A156-181D48CE493C}.Debug|x64.Build.0 = Debug|Any CPU
|
||||
{7329B02D-C504-482A-A156-181D48CE493C}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU
|
||||
{7329B02D-C504-482A-A156-181D48CE493C}.Release|Mixed Platforms.Build.0 = Release|Any CPU
|
||||
{7329B02D-C504-482A-A156-181D48CE493C}.Release|Win32.ActiveCfg = Release|Any CPU
|
||||
{7329B02D-C504-482A-A156-181D48CE493C}.Release|Win32.Build.0 = Release|Any CPU
|
||||
{7329B02D-C504-482A-A156-181D48CE493C}.Release|x64.ActiveCfg = Release|Any CPU
|
||||
{7329B02D-C504-482A-A156-181D48CE493C}.Release|x64.Build.0 = Release|Any CPU
|
||||
{4F150A30-CECB-49D1-8283-6A3F57438CF5}.Debug|Mixed Platforms.ActiveCfg = Debug|Win32
|
||||
{4F150A30-CECB-49D1-8283-6A3F57438CF5}.Debug|Mixed Platforms.Build.0 = Debug|Win32
|
||||
{4F150A30-CECB-49D1-8283-6A3F57438CF5}.Debug|Win32.ActiveCfg = Debug|Win32
|
||||
{4F150A30-CECB-49D1-8283-6A3F57438CF5}.Debug|Win32.Build.0 = Debug|Win32
|
||||
{4F150A30-CECB-49D1-8283-6A3F57438CF5}.Debug|x64.ActiveCfg = Debug|x64
|
||||
{4F150A30-CECB-49D1-8283-6A3F57438CF5}.Debug|x64.Build.0 = Debug|x64
|
||||
{4F150A30-CECB-49D1-8283-6A3F57438CF5}.Release|Mixed Platforms.ActiveCfg = Release|Win32
|
||||
{4F150A30-CECB-49D1-8283-6A3F57438CF5}.Release|Mixed Platforms.Build.0 = Release|Win32
|
||||
{4F150A30-CECB-49D1-8283-6A3F57438CF5}.Release|Win32.ActiveCfg = Release|Win32
|
||||
{4F150A30-CECB-49D1-8283-6A3F57438CF5}.Release|Win32.Build.0 = Release|Win32
|
||||
{4F150A30-CECB-49D1-8283-6A3F57438CF5}.Release|x64.ActiveCfg = Release|x64
|
||||
{4F150A30-CECB-49D1-8283-6A3F57438CF5}.Release|x64.Build.0 = Release|x64
|
||||
{C7AB4186-54B2-4244-A533-77494763EA1D}.Debug|Mixed Platforms.ActiveCfg = Debug|Win32
|
||||
{C7AB4186-54B2-4244-A533-77494763EA1D}.Debug|Mixed Platforms.Build.0 = Debug|Win32
|
||||
{C7AB4186-54B2-4244-A533-77494763EA1D}.Debug|Win32.ActiveCfg = Debug|Win32
|
||||
{C7AB4186-54B2-4244-A533-77494763EA1D}.Debug|Win32.Build.0 = Debug|Win32
|
||||
{C7AB4186-54B2-4244-A533-77494763EA1D}.Debug|x64.ActiveCfg = Debug|x64
|
||||
{C7AB4186-54B2-4244-A533-77494763EA1D}.Debug|x64.Build.0 = Debug|x64
|
||||
{C7AB4186-54B2-4244-A533-77494763EA1D}.Release|Mixed Platforms.ActiveCfg = Release|Win32
|
||||
{C7AB4186-54B2-4244-A533-77494763EA1D}.Release|Mixed Platforms.Build.0 = Release|Win32
|
||||
{C7AB4186-54B2-4244-A533-77494763EA1D}.Release|Win32.ActiveCfg = Release|Win32
|
||||
{C7AB4186-54B2-4244-A533-77494763EA1D}.Release|Win32.Build.0 = Release|Win32
|
||||
{C7AB4186-54B2-4244-A533-77494763EA1D}.Release|x64.ActiveCfg = Release|x64
|
||||
{C7AB4186-54B2-4244-A533-77494763EA1D}.Release|x64.Build.0 = Release|x64
|
||||
EndGlobalSection
|
||||
GlobalSection(SolutionProperties) = preSolution
|
||||
HideSolutionNode = FALSE
|
||||
EndGlobalSection
|
||||
EndGlobal
|
||||
|
|
|
@ -1,76 +1,76 @@
|
|||
|
||||
Microsoft Visual Studio Solution File, Format Version 12.00
|
||||
# Visual Studio 2013
|
||||
VisualStudioVersion = 12.0.21005.1
|
||||
MinimumVisualStudioVersion = 10.0.40219.1
|
||||
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "DirectXTK_Desktop_2013", "DirectXTK_Desktop_2013.vcxproj", "{E0B52AE7-E160-4D32-BF3F-910B785E5A8E}"
|
||||
EndProject
|
||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "MakeSpriteFont", "MakeSpriteFont\MakeSpriteFont.csproj", "{7329B02D-C504-482A-A156-181D48CE493C}"
|
||||
EndProject
|
||||
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "DirectXTKAudio_Desktop_2013_DXSDK", "Audio\DirectXTKAudio_Desktop_2013_DXSDK.vcxproj", "{4F150A30-CECB-49D1-8283-6A3F57438CF5}"
|
||||
EndProject
|
||||
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "xwbtool_Desktop_2013", "XWBTool\xwbtool_Desktop_2013.vcxproj", "{C7AB4186-54B2-4244-A533-77494763EA1D}"
|
||||
EndProject
|
||||
Global
|
||||
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
||||
Debug|Mixed Platforms = Debug|Mixed Platforms
|
||||
Debug|Win32 = Debug|Win32
|
||||
Debug|x64 = Debug|x64
|
||||
Release|Mixed Platforms = Release|Mixed Platforms
|
||||
Release|Win32 = Release|Win32
|
||||
Release|x64 = Release|x64
|
||||
EndGlobalSection
|
||||
GlobalSection(ProjectConfigurationPlatforms) = postSolution
|
||||
{E0B52AE7-E160-4D32-BF3F-910B785E5A8E}.Debug|Mixed Platforms.ActiveCfg = Debug|Win32
|
||||
{E0B52AE7-E160-4D32-BF3F-910B785E5A8E}.Debug|Mixed Platforms.Build.0 = Debug|Win32
|
||||
{E0B52AE7-E160-4D32-BF3F-910B785E5A8E}.Debug|Win32.ActiveCfg = Debug|Win32
|
||||
{E0B52AE7-E160-4D32-BF3F-910B785E5A8E}.Debug|Win32.Build.0 = Debug|Win32
|
||||
{E0B52AE7-E160-4D32-BF3F-910B785E5A8E}.Debug|x64.ActiveCfg = Debug|x64
|
||||
{E0B52AE7-E160-4D32-BF3F-910B785E5A8E}.Debug|x64.Build.0 = Debug|x64
|
||||
{E0B52AE7-E160-4D32-BF3F-910B785E5A8E}.Release|Mixed Platforms.ActiveCfg = Release|Win32
|
||||
{E0B52AE7-E160-4D32-BF3F-910B785E5A8E}.Release|Mixed Platforms.Build.0 = Release|Win32
|
||||
{E0B52AE7-E160-4D32-BF3F-910B785E5A8E}.Release|Win32.ActiveCfg = Release|Win32
|
||||
{E0B52AE7-E160-4D32-BF3F-910B785E5A8E}.Release|Win32.Build.0 = Release|Win32
|
||||
{E0B52AE7-E160-4D32-BF3F-910B785E5A8E}.Release|x64.ActiveCfg = Release|x64
|
||||
{E0B52AE7-E160-4D32-BF3F-910B785E5A8E}.Release|x64.Build.0 = Release|x64
|
||||
{7329B02D-C504-482A-A156-181D48CE493C}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU
|
||||
{7329B02D-C504-482A-A156-181D48CE493C}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU
|
||||
{7329B02D-C504-482A-A156-181D48CE493C}.Debug|Win32.ActiveCfg = Debug|Any CPU
|
||||
{7329B02D-C504-482A-A156-181D48CE493C}.Debug|Win32.Build.0 = Debug|Any CPU
|
||||
{7329B02D-C504-482A-A156-181D48CE493C}.Debug|x64.ActiveCfg = Debug|Any CPU
|
||||
{7329B02D-C504-482A-A156-181D48CE493C}.Debug|x64.Build.0 = Debug|Any CPU
|
||||
{7329B02D-C504-482A-A156-181D48CE493C}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU
|
||||
{7329B02D-C504-482A-A156-181D48CE493C}.Release|Mixed Platforms.Build.0 = Release|Any CPU
|
||||
{7329B02D-C504-482A-A156-181D48CE493C}.Release|Win32.ActiveCfg = Release|Any CPU
|
||||
{7329B02D-C504-482A-A156-181D48CE493C}.Release|Win32.Build.0 = Release|Any CPU
|
||||
{7329B02D-C504-482A-A156-181D48CE493C}.Release|x64.ActiveCfg = Release|Any CPU
|
||||
{7329B02D-C504-482A-A156-181D48CE493C}.Release|x64.Build.0 = Release|Any CPU
|
||||
{4F150A30-CECB-49D1-8283-6A3F57438CF5}.Debug|Mixed Platforms.ActiveCfg = Debug|Win32
|
||||
{4F150A30-CECB-49D1-8283-6A3F57438CF5}.Debug|Mixed Platforms.Build.0 = Debug|Win32
|
||||
{4F150A30-CECB-49D1-8283-6A3F57438CF5}.Debug|Win32.ActiveCfg = Debug|Win32
|
||||
{4F150A30-CECB-49D1-8283-6A3F57438CF5}.Debug|Win32.Build.0 = Debug|Win32
|
||||
{4F150A30-CECB-49D1-8283-6A3F57438CF5}.Debug|x64.ActiveCfg = Debug|x64
|
||||
{4F150A30-CECB-49D1-8283-6A3F57438CF5}.Debug|x64.Build.0 = Debug|x64
|
||||
{4F150A30-CECB-49D1-8283-6A3F57438CF5}.Release|Mixed Platforms.ActiveCfg = Release|Win32
|
||||
{4F150A30-CECB-49D1-8283-6A3F57438CF5}.Release|Mixed Platforms.Build.0 = Release|Win32
|
||||
{4F150A30-CECB-49D1-8283-6A3F57438CF5}.Release|Win32.ActiveCfg = Release|Win32
|
||||
{4F150A30-CECB-49D1-8283-6A3F57438CF5}.Release|Win32.Build.0 = Release|Win32
|
||||
{4F150A30-CECB-49D1-8283-6A3F57438CF5}.Release|x64.ActiveCfg = Release|x64
|
||||
{4F150A30-CECB-49D1-8283-6A3F57438CF5}.Release|x64.Build.0 = Release|x64
|
||||
{C7AB4186-54B2-4244-A533-77494763EA1D}.Debug|Mixed Platforms.ActiveCfg = Debug|Win32
|
||||
{C7AB4186-54B2-4244-A533-77494763EA1D}.Debug|Mixed Platforms.Build.0 = Debug|Win32
|
||||
{C7AB4186-54B2-4244-A533-77494763EA1D}.Debug|Win32.ActiveCfg = Debug|Win32
|
||||
{C7AB4186-54B2-4244-A533-77494763EA1D}.Debug|Win32.Build.0 = Debug|Win32
|
||||
{C7AB4186-54B2-4244-A533-77494763EA1D}.Debug|x64.ActiveCfg = Debug|x64
|
||||
{C7AB4186-54B2-4244-A533-77494763EA1D}.Debug|x64.Build.0 = Debug|x64
|
||||
{C7AB4186-54B2-4244-A533-77494763EA1D}.Release|Mixed Platforms.ActiveCfg = Release|Win32
|
||||
{C7AB4186-54B2-4244-A533-77494763EA1D}.Release|Mixed Platforms.Build.0 = Release|Win32
|
||||
{C7AB4186-54B2-4244-A533-77494763EA1D}.Release|Win32.ActiveCfg = Release|Win32
|
||||
{C7AB4186-54B2-4244-A533-77494763EA1D}.Release|Win32.Build.0 = Release|Win32
|
||||
{C7AB4186-54B2-4244-A533-77494763EA1D}.Release|x64.ActiveCfg = Release|x64
|
||||
{C7AB4186-54B2-4244-A533-77494763EA1D}.Release|x64.Build.0 = Release|x64
|
||||
EndGlobalSection
|
||||
GlobalSection(SolutionProperties) = preSolution
|
||||
HideSolutionNode = FALSE
|
||||
EndGlobalSection
|
||||
EndGlobal
|
||||
|
||||
Microsoft Visual Studio Solution File, Format Version 12.00
|
||||
# Visual Studio 2013
|
||||
VisualStudioVersion = 12.0.21005.1
|
||||
MinimumVisualStudioVersion = 10.0.40219.1
|
||||
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "DirectXTK_Desktop_2013", "DirectXTK_Desktop_2013.vcxproj", "{E0B52AE7-E160-4D32-BF3F-910B785E5A8E}"
|
||||
EndProject
|
||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "MakeSpriteFont", "MakeSpriteFont\MakeSpriteFont.csproj", "{7329B02D-C504-482A-A156-181D48CE493C}"
|
||||
EndProject
|
||||
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "DirectXTKAudio_Desktop_2013_DXSDK", "Audio\DirectXTKAudio_Desktop_2013_DXSDK.vcxproj", "{4F150A30-CECB-49D1-8283-6A3F57438CF5}"
|
||||
EndProject
|
||||
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "xwbtool_Desktop_2013", "XWBTool\xwbtool_Desktop_2013.vcxproj", "{C7AB4186-54B2-4244-A533-77494763EA1D}"
|
||||
EndProject
|
||||
Global
|
||||
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
||||
Debug|Mixed Platforms = Debug|Mixed Platforms
|
||||
Debug|Win32 = Debug|Win32
|
||||
Debug|x64 = Debug|x64
|
||||
Release|Mixed Platforms = Release|Mixed Platforms
|
||||
Release|Win32 = Release|Win32
|
||||
Release|x64 = Release|x64
|
||||
EndGlobalSection
|
||||
GlobalSection(ProjectConfigurationPlatforms) = postSolution
|
||||
{E0B52AE7-E160-4D32-BF3F-910B785E5A8E}.Debug|Mixed Platforms.ActiveCfg = Debug|Win32
|
||||
{E0B52AE7-E160-4D32-BF3F-910B785E5A8E}.Debug|Mixed Platforms.Build.0 = Debug|Win32
|
||||
{E0B52AE7-E160-4D32-BF3F-910B785E5A8E}.Debug|Win32.ActiveCfg = Debug|Win32
|
||||
{E0B52AE7-E160-4D32-BF3F-910B785E5A8E}.Debug|Win32.Build.0 = Debug|Win32
|
||||
{E0B52AE7-E160-4D32-BF3F-910B785E5A8E}.Debug|x64.ActiveCfg = Debug|x64
|
||||
{E0B52AE7-E160-4D32-BF3F-910B785E5A8E}.Debug|x64.Build.0 = Debug|x64
|
||||
{E0B52AE7-E160-4D32-BF3F-910B785E5A8E}.Release|Mixed Platforms.ActiveCfg = Release|Win32
|
||||
{E0B52AE7-E160-4D32-BF3F-910B785E5A8E}.Release|Mixed Platforms.Build.0 = Release|Win32
|
||||
{E0B52AE7-E160-4D32-BF3F-910B785E5A8E}.Release|Win32.ActiveCfg = Release|Win32
|
||||
{E0B52AE7-E160-4D32-BF3F-910B785E5A8E}.Release|Win32.Build.0 = Release|Win32
|
||||
{E0B52AE7-E160-4D32-BF3F-910B785E5A8E}.Release|x64.ActiveCfg = Release|x64
|
||||
{E0B52AE7-E160-4D32-BF3F-910B785E5A8E}.Release|x64.Build.0 = Release|x64
|
||||
{7329B02D-C504-482A-A156-181D48CE493C}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU
|
||||
{7329B02D-C504-482A-A156-181D48CE493C}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU
|
||||
{7329B02D-C504-482A-A156-181D48CE493C}.Debug|Win32.ActiveCfg = Debug|Any CPU
|
||||
{7329B02D-C504-482A-A156-181D48CE493C}.Debug|Win32.Build.0 = Debug|Any CPU
|
||||
{7329B02D-C504-482A-A156-181D48CE493C}.Debug|x64.ActiveCfg = Debug|Any CPU
|
||||
{7329B02D-C504-482A-A156-181D48CE493C}.Debug|x64.Build.0 = Debug|Any CPU
|
||||
{7329B02D-C504-482A-A156-181D48CE493C}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU
|
||||
{7329B02D-C504-482A-A156-181D48CE493C}.Release|Mixed Platforms.Build.0 = Release|Any CPU
|
||||
{7329B02D-C504-482A-A156-181D48CE493C}.Release|Win32.ActiveCfg = Release|Any CPU
|
||||
{7329B02D-C504-482A-A156-181D48CE493C}.Release|Win32.Build.0 = Release|Any CPU
|
||||
{7329B02D-C504-482A-A156-181D48CE493C}.Release|x64.ActiveCfg = Release|Any CPU
|
||||
{7329B02D-C504-482A-A156-181D48CE493C}.Release|x64.Build.0 = Release|Any CPU
|
||||
{4F150A30-CECB-49D1-8283-6A3F57438CF5}.Debug|Mixed Platforms.ActiveCfg = Debug|Win32
|
||||
{4F150A30-CECB-49D1-8283-6A3F57438CF5}.Debug|Mixed Platforms.Build.0 = Debug|Win32
|
||||
{4F150A30-CECB-49D1-8283-6A3F57438CF5}.Debug|Win32.ActiveCfg = Debug|Win32
|
||||
{4F150A30-CECB-49D1-8283-6A3F57438CF5}.Debug|Win32.Build.0 = Debug|Win32
|
||||
{4F150A30-CECB-49D1-8283-6A3F57438CF5}.Debug|x64.ActiveCfg = Debug|x64
|
||||
{4F150A30-CECB-49D1-8283-6A3F57438CF5}.Debug|x64.Build.0 = Debug|x64
|
||||
{4F150A30-CECB-49D1-8283-6A3F57438CF5}.Release|Mixed Platforms.ActiveCfg = Release|Win32
|
||||
{4F150A30-CECB-49D1-8283-6A3F57438CF5}.Release|Mixed Platforms.Build.0 = Release|Win32
|
||||
{4F150A30-CECB-49D1-8283-6A3F57438CF5}.Release|Win32.ActiveCfg = Release|Win32
|
||||
{4F150A30-CECB-49D1-8283-6A3F57438CF5}.Release|Win32.Build.0 = Release|Win32
|
||||
{4F150A30-CECB-49D1-8283-6A3F57438CF5}.Release|x64.ActiveCfg = Release|x64
|
||||
{4F150A30-CECB-49D1-8283-6A3F57438CF5}.Release|x64.Build.0 = Release|x64
|
||||
{C7AB4186-54B2-4244-A533-77494763EA1D}.Debug|Mixed Platforms.ActiveCfg = Debug|Win32
|
||||
{C7AB4186-54B2-4244-A533-77494763EA1D}.Debug|Mixed Platforms.Build.0 = Debug|Win32
|
||||
{C7AB4186-54B2-4244-A533-77494763EA1D}.Debug|Win32.ActiveCfg = Debug|Win32
|
||||
{C7AB4186-54B2-4244-A533-77494763EA1D}.Debug|Win32.Build.0 = Debug|Win32
|
||||
{C7AB4186-54B2-4244-A533-77494763EA1D}.Debug|x64.ActiveCfg = Debug|x64
|
||||
{C7AB4186-54B2-4244-A533-77494763EA1D}.Debug|x64.Build.0 = Debug|x64
|
||||
{C7AB4186-54B2-4244-A533-77494763EA1D}.Release|Mixed Platforms.ActiveCfg = Release|Win32
|
||||
{C7AB4186-54B2-4244-A533-77494763EA1D}.Release|Mixed Platforms.Build.0 = Release|Win32
|
||||
{C7AB4186-54B2-4244-A533-77494763EA1D}.Release|Win32.ActiveCfg = Release|Win32
|
||||
{C7AB4186-54B2-4244-A533-77494763EA1D}.Release|Win32.Build.0 = Release|Win32
|
||||
{C7AB4186-54B2-4244-A533-77494763EA1D}.Release|x64.ActiveCfg = Release|x64
|
||||
{C7AB4186-54B2-4244-A533-77494763EA1D}.Release|x64.Build.0 = Release|x64
|
||||
EndGlobalSection
|
||||
GlobalSection(SolutionProperties) = preSolution
|
||||
HideSolutionNode = FALSE
|
||||
EndGlobalSection
|
||||
EndGlobal
|
||||
|
|
|
@ -1,76 +1,76 @@
|
|||
|
||||
Microsoft Visual Studio Solution File, Format Version 12.00
|
||||
# Visual Studio 2015
|
||||
VisualStudioVersion = 12.0.21005.1
|
||||
MinimumVisualStudioVersion = 10.0.40219.1
|
||||
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "DirectXTK_Desktop_2015", "DirectXTK_Desktop_2015.vcxproj", "{E0B52AE7-E160-4D32-BF3F-910B785E5A8E}"
|
||||
EndProject
|
||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "MakeSpriteFont", "MakeSpriteFont\MakeSpriteFont.csproj", "{7329B02D-C504-482A-A156-181D48CE493C}"
|
||||
EndProject
|
||||
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "DirectXTKAudio_Desktop_2015_Win8", "Audio\DirectXTKAudio_Desktop_2015_Win8.vcxproj", "{4F150A30-CECB-49D1-8283-6A3F57438CF5}"
|
||||
EndProject
|
||||
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "XWBTool_Desktop_2015", "XWBTool\XWBTool_Desktop_2015.vcxproj", "{C7AB4186-54B2-4244-A533-77494763EA1D}"
|
||||
EndProject
|
||||
Global
|
||||
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
||||
Debug|Mixed Platforms = Debug|Mixed Platforms
|
||||
Debug|Win32 = Debug|Win32
|
||||
Debug|x64 = Debug|x64
|
||||
Release|Mixed Platforms = Release|Mixed Platforms
|
||||
Release|Win32 = Release|Win32
|
||||
Release|x64 = Release|x64
|
||||
EndGlobalSection
|
||||
GlobalSection(ProjectConfigurationPlatforms) = postSolution
|
||||
{E0B52AE7-E160-4D32-BF3F-910B785E5A8E}.Debug|Mixed Platforms.ActiveCfg = Debug|Win32
|
||||
{E0B52AE7-E160-4D32-BF3F-910B785E5A8E}.Debug|Mixed Platforms.Build.0 = Debug|Win32
|
||||
{E0B52AE7-E160-4D32-BF3F-910B785E5A8E}.Debug|Win32.ActiveCfg = Debug|Win32
|
||||
{E0B52AE7-E160-4D32-BF3F-910B785E5A8E}.Debug|Win32.Build.0 = Debug|Win32
|
||||
{E0B52AE7-E160-4D32-BF3F-910B785E5A8E}.Debug|x64.ActiveCfg = Debug|x64
|
||||
{E0B52AE7-E160-4D32-BF3F-910B785E5A8E}.Debug|x64.Build.0 = Debug|x64
|
||||
{E0B52AE7-E160-4D32-BF3F-910B785E5A8E}.Release|Mixed Platforms.ActiveCfg = Release|Win32
|
||||
{E0B52AE7-E160-4D32-BF3F-910B785E5A8E}.Release|Mixed Platforms.Build.0 = Release|Win32
|
||||
{E0B52AE7-E160-4D32-BF3F-910B785E5A8E}.Release|Win32.ActiveCfg = Release|Win32
|
||||
{E0B52AE7-E160-4D32-BF3F-910B785E5A8E}.Release|Win32.Build.0 = Release|Win32
|
||||
{E0B52AE7-E160-4D32-BF3F-910B785E5A8E}.Release|x64.ActiveCfg = Release|x64
|
||||
{E0B52AE7-E160-4D32-BF3F-910B785E5A8E}.Release|x64.Build.0 = Release|x64
|
||||
{7329B02D-C504-482A-A156-181D48CE493C}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU
|
||||
{7329B02D-C504-482A-A156-181D48CE493C}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU
|
||||
{7329B02D-C504-482A-A156-181D48CE493C}.Debug|Win32.ActiveCfg = Debug|Any CPU
|
||||
{7329B02D-C504-482A-A156-181D48CE493C}.Debug|Win32.Build.0 = Debug|Any CPU
|
||||
{7329B02D-C504-482A-A156-181D48CE493C}.Debug|x64.ActiveCfg = Debug|Any CPU
|
||||
{7329B02D-C504-482A-A156-181D48CE493C}.Debug|x64.Build.0 = Debug|Any CPU
|
||||
{7329B02D-C504-482A-A156-181D48CE493C}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU
|
||||
{7329B02D-C504-482A-A156-181D48CE493C}.Release|Mixed Platforms.Build.0 = Release|Any CPU
|
||||
{7329B02D-C504-482A-A156-181D48CE493C}.Release|Win32.ActiveCfg = Release|Any CPU
|
||||
{7329B02D-C504-482A-A156-181D48CE493C}.Release|Win32.Build.0 = Release|Any CPU
|
||||
{7329B02D-C504-482A-A156-181D48CE493C}.Release|x64.ActiveCfg = Release|Any CPU
|
||||
{7329B02D-C504-482A-A156-181D48CE493C}.Release|x64.Build.0 = Release|Any CPU
|
||||
{4F150A30-CECB-49D1-8283-6A3F57438CF5}.Debug|Mixed Platforms.ActiveCfg = Debug|Win32
|
||||
{4F150A30-CECB-49D1-8283-6A3F57438CF5}.Debug|Mixed Platforms.Build.0 = Debug|Win32
|
||||
{4F150A30-CECB-49D1-8283-6A3F57438CF5}.Debug|Win32.ActiveCfg = Debug|Win32
|
||||
{4F150A30-CECB-49D1-8283-6A3F57438CF5}.Debug|Win32.Build.0 = Debug|Win32
|
||||
{4F150A30-CECB-49D1-8283-6A3F57438CF5}.Debug|x64.ActiveCfg = Debug|x64
|
||||
{4F150A30-CECB-49D1-8283-6A3F57438CF5}.Debug|x64.Build.0 = Debug|x64
|
||||
{4F150A30-CECB-49D1-8283-6A3F57438CF5}.Release|Mixed Platforms.ActiveCfg = Release|Win32
|
||||
{4F150A30-CECB-49D1-8283-6A3F57438CF5}.Release|Mixed Platforms.Build.0 = Release|Win32
|
||||
{4F150A30-CECB-49D1-8283-6A3F57438CF5}.Release|Win32.ActiveCfg = Release|Win32
|
||||
{4F150A30-CECB-49D1-8283-6A3F57438CF5}.Release|Win32.Build.0 = Release|Win32
|
||||
{4F150A30-CECB-49D1-8283-6A3F57438CF5}.Release|x64.ActiveCfg = Release|x64
|
||||
{4F150A30-CECB-49D1-8283-6A3F57438CF5}.Release|x64.Build.0 = Release|x64
|
||||
{C7AB4186-54B2-4244-A533-77494763EA1D}.Debug|Mixed Platforms.ActiveCfg = Debug|Win32
|
||||
{C7AB4186-54B2-4244-A533-77494763EA1D}.Debug|Mixed Platforms.Build.0 = Debug|Win32
|
||||
{C7AB4186-54B2-4244-A533-77494763EA1D}.Debug|Win32.ActiveCfg = Debug|Win32
|
||||
{C7AB4186-54B2-4244-A533-77494763EA1D}.Debug|Win32.Build.0 = Debug|Win32
|
||||
{C7AB4186-54B2-4244-A533-77494763EA1D}.Debug|x64.ActiveCfg = Debug|x64
|
||||
{C7AB4186-54B2-4244-A533-77494763EA1D}.Debug|x64.Build.0 = Debug|x64
|
||||
{C7AB4186-54B2-4244-A533-77494763EA1D}.Release|Mixed Platforms.ActiveCfg = Release|Win32
|
||||
{C7AB4186-54B2-4244-A533-77494763EA1D}.Release|Mixed Platforms.Build.0 = Release|Win32
|
||||
{C7AB4186-54B2-4244-A533-77494763EA1D}.Release|Win32.ActiveCfg = Release|Win32
|
||||
{C7AB4186-54B2-4244-A533-77494763EA1D}.Release|Win32.Build.0 = Release|Win32
|
||||
{C7AB4186-54B2-4244-A533-77494763EA1D}.Release|x64.ActiveCfg = Release|x64
|
||||
{C7AB4186-54B2-4244-A533-77494763EA1D}.Release|x64.Build.0 = Release|x64
|
||||
EndGlobalSection
|
||||
GlobalSection(SolutionProperties) = preSolution
|
||||
HideSolutionNode = FALSE
|
||||
EndGlobalSection
|
||||
EndGlobal
|
||||
|
||||
Microsoft Visual Studio Solution File, Format Version 12.00
|
||||
# Visual Studio 2015
|
||||
VisualStudioVersion = 12.0.21005.1
|
||||
MinimumVisualStudioVersion = 10.0.40219.1
|
||||
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "DirectXTK_Desktop_2015", "DirectXTK_Desktop_2015.vcxproj", "{E0B52AE7-E160-4D32-BF3F-910B785E5A8E}"
|
||||
EndProject
|
||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "MakeSpriteFont", "MakeSpriteFont\MakeSpriteFont.csproj", "{7329B02D-C504-482A-A156-181D48CE493C}"
|
||||
EndProject
|
||||
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "DirectXTKAudio_Desktop_2015_Win8", "Audio\DirectXTKAudio_Desktop_2015_Win8.vcxproj", "{4F150A30-CECB-49D1-8283-6A3F57438CF5}"
|
||||
EndProject
|
||||
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "XWBTool_Desktop_2015", "XWBTool\XWBTool_Desktop_2015.vcxproj", "{C7AB4186-54B2-4244-A533-77494763EA1D}"
|
||||
EndProject
|
||||
Global
|
||||
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
||||
Debug|Mixed Platforms = Debug|Mixed Platforms
|
||||
Debug|Win32 = Debug|Win32
|
||||
Debug|x64 = Debug|x64
|
||||
Release|Mixed Platforms = Release|Mixed Platforms
|
||||
Release|Win32 = Release|Win32
|
||||
Release|x64 = Release|x64
|
||||
EndGlobalSection
|
||||
GlobalSection(ProjectConfigurationPlatforms) = postSolution
|
||||
{E0B52AE7-E160-4D32-BF3F-910B785E5A8E}.Debug|Mixed Platforms.ActiveCfg = Debug|Win32
|
||||
{E0B52AE7-E160-4D32-BF3F-910B785E5A8E}.Debug|Mixed Platforms.Build.0 = Debug|Win32
|
||||
{E0B52AE7-E160-4D32-BF3F-910B785E5A8E}.Debug|Win32.ActiveCfg = Debug|Win32
|
||||
{E0B52AE7-E160-4D32-BF3F-910B785E5A8E}.Debug|Win32.Build.0 = Debug|Win32
|
||||
{E0B52AE7-E160-4D32-BF3F-910B785E5A8E}.Debug|x64.ActiveCfg = Debug|x64
|
||||
{E0B52AE7-E160-4D32-BF3F-910B785E5A8E}.Debug|x64.Build.0 = Debug|x64
|
||||
{E0B52AE7-E160-4D32-BF3F-910B785E5A8E}.Release|Mixed Platforms.ActiveCfg = Release|Win32
|
||||
{E0B52AE7-E160-4D32-BF3F-910B785E5A8E}.Release|Mixed Platforms.Build.0 = Release|Win32
|
||||
{E0B52AE7-E160-4D32-BF3F-910B785E5A8E}.Release|Win32.ActiveCfg = Release|Win32
|
||||
{E0B52AE7-E160-4D32-BF3F-910B785E5A8E}.Release|Win32.Build.0 = Release|Win32
|
||||
{E0B52AE7-E160-4D32-BF3F-910B785E5A8E}.Release|x64.ActiveCfg = Release|x64
|
||||
{E0B52AE7-E160-4D32-BF3F-910B785E5A8E}.Release|x64.Build.0 = Release|x64
|
||||
{7329B02D-C504-482A-A156-181D48CE493C}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU
|
||||
{7329B02D-C504-482A-A156-181D48CE493C}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU
|
||||
{7329B02D-C504-482A-A156-181D48CE493C}.Debug|Win32.ActiveCfg = Debug|Any CPU
|
||||
{7329B02D-C504-482A-A156-181D48CE493C}.Debug|Win32.Build.0 = Debug|Any CPU
|
||||
{7329B02D-C504-482A-A156-181D48CE493C}.Debug|x64.ActiveCfg = Debug|Any CPU
|
||||
{7329B02D-C504-482A-A156-181D48CE493C}.Debug|x64.Build.0 = Debug|Any CPU
|
||||
{7329B02D-C504-482A-A156-181D48CE493C}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU
|
||||
{7329B02D-C504-482A-A156-181D48CE493C}.Release|Mixed Platforms.Build.0 = Release|Any CPU
|
||||
{7329B02D-C504-482A-A156-181D48CE493C}.Release|Win32.ActiveCfg = Release|Any CPU
|
||||
{7329B02D-C504-482A-A156-181D48CE493C}.Release|Win32.Build.0 = Release|Any CPU
|
||||
{7329B02D-C504-482A-A156-181D48CE493C}.Release|x64.ActiveCfg = Release|Any CPU
|
||||
{7329B02D-C504-482A-A156-181D48CE493C}.Release|x64.Build.0 = Release|Any CPU
|
||||
{4F150A30-CECB-49D1-8283-6A3F57438CF5}.Debug|Mixed Platforms.ActiveCfg = Debug|Win32
|
||||
{4F150A30-CECB-49D1-8283-6A3F57438CF5}.Debug|Mixed Platforms.Build.0 = Debug|Win32
|
||||
{4F150A30-CECB-49D1-8283-6A3F57438CF5}.Debug|Win32.ActiveCfg = Debug|Win32
|
||||
{4F150A30-CECB-49D1-8283-6A3F57438CF5}.Debug|Win32.Build.0 = Debug|Win32
|
||||
{4F150A30-CECB-49D1-8283-6A3F57438CF5}.Debug|x64.ActiveCfg = Debug|x64
|
||||
{4F150A30-CECB-49D1-8283-6A3F57438CF5}.Debug|x64.Build.0 = Debug|x64
|
||||
{4F150A30-CECB-49D1-8283-6A3F57438CF5}.Release|Mixed Platforms.ActiveCfg = Release|Win32
|
||||
{4F150A30-CECB-49D1-8283-6A3F57438CF5}.Release|Mixed Platforms.Build.0 = Release|Win32
|
||||
{4F150A30-CECB-49D1-8283-6A3F57438CF5}.Release|Win32.ActiveCfg = Release|Win32
|
||||
{4F150A30-CECB-49D1-8283-6A3F57438CF5}.Release|Win32.Build.0 = Release|Win32
|
||||
{4F150A30-CECB-49D1-8283-6A3F57438CF5}.Release|x64.ActiveCfg = Release|x64
|
||||
{4F150A30-CECB-49D1-8283-6A3F57438CF5}.Release|x64.Build.0 = Release|x64
|
||||
{C7AB4186-54B2-4244-A533-77494763EA1D}.Debug|Mixed Platforms.ActiveCfg = Debug|Win32
|
||||
{C7AB4186-54B2-4244-A533-77494763EA1D}.Debug|Mixed Platforms.Build.0 = Debug|Win32
|
||||
{C7AB4186-54B2-4244-A533-77494763EA1D}.Debug|Win32.ActiveCfg = Debug|Win32
|
||||
{C7AB4186-54B2-4244-A533-77494763EA1D}.Debug|Win32.Build.0 = Debug|Win32
|
||||
{C7AB4186-54B2-4244-A533-77494763EA1D}.Debug|x64.ActiveCfg = Debug|x64
|
||||
{C7AB4186-54B2-4244-A533-77494763EA1D}.Debug|x64.Build.0 = Debug|x64
|
||||
{C7AB4186-54B2-4244-A533-77494763EA1D}.Release|Mixed Platforms.ActiveCfg = Release|Win32
|
||||
{C7AB4186-54B2-4244-A533-77494763EA1D}.Release|Mixed Platforms.Build.0 = Release|Win32
|
||||
{C7AB4186-54B2-4244-A533-77494763EA1D}.Release|Win32.ActiveCfg = Release|Win32
|
||||
{C7AB4186-54B2-4244-A533-77494763EA1D}.Release|Win32.Build.0 = Release|Win32
|
||||
{C7AB4186-54B2-4244-A533-77494763EA1D}.Release|x64.ActiveCfg = Release|x64
|
||||
{C7AB4186-54B2-4244-A533-77494763EA1D}.Release|x64.Build.0 = Release|x64
|
||||
EndGlobalSection
|
||||
GlobalSection(SolutionProperties) = preSolution
|
||||
HideSolutionNode = FALSE
|
||||
EndGlobalSection
|
||||
EndGlobal
|
||||
|
|
|
@ -1,76 +1,76 @@
|
|||
|
||||
Microsoft Visual Studio Solution File, Format Version 12.00
|
||||
# Visual Studio 2015
|
||||
VisualStudioVersion = 12.0.21005.1
|
||||
MinimumVisualStudioVersion = 10.0.40219.1
|
||||
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "DirectXTK_Desktop_2015", "DirectXTK_Desktop_2015.vcxproj", "{E0B52AE7-E160-4D32-BF3F-910B785E5A8E}"
|
||||
EndProject
|
||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "MakeSpriteFont", "MakeSpriteFont\MakeSpriteFont.csproj", "{7329B02D-C504-482A-A156-181D48CE493C}"
|
||||
EndProject
|
||||
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "DirectXTKAudio_Desktop_2015_DXSDK", "Audio\DirectXTKAudio_Desktop_2015_DXSDK.vcxproj", "{4F150A30-CECB-49D1-8283-6A3F57438CF5}"
|
||||
EndProject
|
||||
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "xwbtool_Desktop_2015", "XWBTool\xwbtool_Desktop_2015.vcxproj", "{C7AB4186-54B2-4244-A533-77494763EA1D}"
|
||||
EndProject
|
||||
Global
|
||||
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
||||
Debug|Mixed Platforms = Debug|Mixed Platforms
|
||||
Debug|Win32 = Debug|Win32
|
||||
Debug|x64 = Debug|x64
|
||||
Release|Mixed Platforms = Release|Mixed Platforms
|
||||
Release|Win32 = Release|Win32
|
||||
Release|x64 = Release|x64
|
||||
EndGlobalSection
|
||||
GlobalSection(ProjectConfigurationPlatforms) = postSolution
|
||||
{E0B52AE7-E160-4D32-BF3F-910B785E5A8E}.Debug|Mixed Platforms.ActiveCfg = Debug|Win32
|
||||
{E0B52AE7-E160-4D32-BF3F-910B785E5A8E}.Debug|Mixed Platforms.Build.0 = Debug|Win32
|
||||
{E0B52AE7-E160-4D32-BF3F-910B785E5A8E}.Debug|Win32.ActiveCfg = Debug|Win32
|
||||
{E0B52AE7-E160-4D32-BF3F-910B785E5A8E}.Debug|Win32.Build.0 = Debug|Win32
|
||||
{E0B52AE7-E160-4D32-BF3F-910B785E5A8E}.Debug|x64.ActiveCfg = Debug|x64
|
||||
{E0B52AE7-E160-4D32-BF3F-910B785E5A8E}.Debug|x64.Build.0 = Debug|x64
|
||||
{E0B52AE7-E160-4D32-BF3F-910B785E5A8E}.Release|Mixed Platforms.ActiveCfg = Release|Win32
|
||||
{E0B52AE7-E160-4D32-BF3F-910B785E5A8E}.Release|Mixed Platforms.Build.0 = Release|Win32
|
||||
{E0B52AE7-E160-4D32-BF3F-910B785E5A8E}.Release|Win32.ActiveCfg = Release|Win32
|
||||
{E0B52AE7-E160-4D32-BF3F-910B785E5A8E}.Release|Win32.Build.0 = Release|Win32
|
||||
{E0B52AE7-E160-4D32-BF3F-910B785E5A8E}.Release|x64.ActiveCfg = Release|x64
|
||||
{E0B52AE7-E160-4D32-BF3F-910B785E5A8E}.Release|x64.Build.0 = Release|x64
|
||||
{7329B02D-C504-482A-A156-181D48CE493C}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU
|
||||
{7329B02D-C504-482A-A156-181D48CE493C}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU
|
||||
{7329B02D-C504-482A-A156-181D48CE493C}.Debug|Win32.ActiveCfg = Debug|Any CPU
|
||||
{7329B02D-C504-482A-A156-181D48CE493C}.Debug|Win32.Build.0 = Debug|Any CPU
|
||||
{7329B02D-C504-482A-A156-181D48CE493C}.Debug|x64.ActiveCfg = Debug|Any CPU
|
||||
{7329B02D-C504-482A-A156-181D48CE493C}.Debug|x64.Build.0 = Debug|Any CPU
|
||||
{7329B02D-C504-482A-A156-181D48CE493C}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU
|
||||
{7329B02D-C504-482A-A156-181D48CE493C}.Release|Mixed Platforms.Build.0 = Release|Any CPU
|
||||
{7329B02D-C504-482A-A156-181D48CE493C}.Release|Win32.ActiveCfg = Release|Any CPU
|
||||
{7329B02D-C504-482A-A156-181D48CE493C}.Release|Win32.Build.0 = Release|Any CPU
|
||||
{7329B02D-C504-482A-A156-181D48CE493C}.Release|x64.ActiveCfg = Release|Any CPU
|
||||
{7329B02D-C504-482A-A156-181D48CE493C}.Release|x64.Build.0 = Release|Any CPU
|
||||
{4F150A30-CECB-49D1-8283-6A3F57438CF5}.Debug|Mixed Platforms.ActiveCfg = Debug|Win32
|
||||
{4F150A30-CECB-49D1-8283-6A3F57438CF5}.Debug|Mixed Platforms.Build.0 = Debug|Win32
|
||||
{4F150A30-CECB-49D1-8283-6A3F57438CF5}.Debug|Win32.ActiveCfg = Debug|Win32
|
||||
{4F150A30-CECB-49D1-8283-6A3F57438CF5}.Debug|Win32.Build.0 = Debug|Win32
|
||||
{4F150A30-CECB-49D1-8283-6A3F57438CF5}.Debug|x64.ActiveCfg = Debug|x64
|
||||
{4F150A30-CECB-49D1-8283-6A3F57438CF5}.Debug|x64.Build.0 = Debug|x64
|
||||
{4F150A30-CECB-49D1-8283-6A3F57438CF5}.Release|Mixed Platforms.ActiveCfg = Release|Win32
|
||||
{4F150A30-CECB-49D1-8283-6A3F57438CF5}.Release|Mixed Platforms.Build.0 = Release|Win32
|
||||
{4F150A30-CECB-49D1-8283-6A3F57438CF5}.Release|Win32.ActiveCfg = Release|Win32
|
||||
{4F150A30-CECB-49D1-8283-6A3F57438CF5}.Release|Win32.Build.0 = Release|Win32
|
||||
{4F150A30-CECB-49D1-8283-6A3F57438CF5}.Release|x64.ActiveCfg = Release|x64
|
||||
{4F150A30-CECB-49D1-8283-6A3F57438CF5}.Release|x64.Build.0 = Release|x64
|
||||
{C7AB4186-54B2-4244-A533-77494763EA1D}.Debug|Mixed Platforms.ActiveCfg = Debug|Win32
|
||||
{C7AB4186-54B2-4244-A533-77494763EA1D}.Debug|Mixed Platforms.Build.0 = Debug|Win32
|
||||
{C7AB4186-54B2-4244-A533-77494763EA1D}.Debug|Win32.ActiveCfg = Debug|Win32
|
||||
{C7AB4186-54B2-4244-A533-77494763EA1D}.Debug|Win32.Build.0 = Debug|Win32
|
||||
{C7AB4186-54B2-4244-A533-77494763EA1D}.Debug|x64.ActiveCfg = Debug|x64
|
||||
{C7AB4186-54B2-4244-A533-77494763EA1D}.Debug|x64.Build.0 = Debug|x64
|
||||
{C7AB4186-54B2-4244-A533-77494763EA1D}.Release|Mixed Platforms.ActiveCfg = Release|Win32
|
||||
{C7AB4186-54B2-4244-A533-77494763EA1D}.Release|Mixed Platforms.Build.0 = Release|Win32
|
||||
{C7AB4186-54B2-4244-A533-77494763EA1D}.Release|Win32.ActiveCfg = Release|Win32
|
||||
{C7AB4186-54B2-4244-A533-77494763EA1D}.Release|Win32.Build.0 = Release|Win32
|
||||
{C7AB4186-54B2-4244-A533-77494763EA1D}.Release|x64.ActiveCfg = Release|x64
|
||||
{C7AB4186-54B2-4244-A533-77494763EA1D}.Release|x64.Build.0 = Release|x64
|
||||
EndGlobalSection
|
||||
GlobalSection(SolutionProperties) = preSolution
|
||||
HideSolutionNode = FALSE
|
||||
EndGlobalSection
|
||||
EndGlobal
|
||||
|
||||
Microsoft Visual Studio Solution File, Format Version 12.00
|
||||
# Visual Studio 2015
|
||||
VisualStudioVersion = 12.0.21005.1
|
||||
MinimumVisualStudioVersion = 10.0.40219.1
|
||||
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "DirectXTK_Desktop_2015", "DirectXTK_Desktop_2015.vcxproj", "{E0B52AE7-E160-4D32-BF3F-910B785E5A8E}"
|
||||
EndProject
|
||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "MakeSpriteFont", "MakeSpriteFont\MakeSpriteFont.csproj", "{7329B02D-C504-482A-A156-181D48CE493C}"
|
||||
EndProject
|
||||
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "DirectXTKAudio_Desktop_2015_DXSDK", "Audio\DirectXTKAudio_Desktop_2015_DXSDK.vcxproj", "{4F150A30-CECB-49D1-8283-6A3F57438CF5}"
|
||||
EndProject
|
||||
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "xwbtool_Desktop_2015", "XWBTool\xwbtool_Desktop_2015.vcxproj", "{C7AB4186-54B2-4244-A533-77494763EA1D}"
|
||||
EndProject
|
||||
Global
|
||||
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
||||
Debug|Mixed Platforms = Debug|Mixed Platforms
|
||||
Debug|Win32 = Debug|Win32
|
||||
Debug|x64 = Debug|x64
|
||||
Release|Mixed Platforms = Release|Mixed Platforms
|
||||
Release|Win32 = Release|Win32
|
||||
Release|x64 = Release|x64
|
||||
EndGlobalSection
|
||||
GlobalSection(ProjectConfigurationPlatforms) = postSolution
|
||||
{E0B52AE7-E160-4D32-BF3F-910B785E5A8E}.Debug|Mixed Platforms.ActiveCfg = Debug|Win32
|
||||
{E0B52AE7-E160-4D32-BF3F-910B785E5A8E}.Debug|Mixed Platforms.Build.0 = Debug|Win32
|
||||
{E0B52AE7-E160-4D32-BF3F-910B785E5A8E}.Debug|Win32.ActiveCfg = Debug|Win32
|
||||
{E0B52AE7-E160-4D32-BF3F-910B785E5A8E}.Debug|Win32.Build.0 = Debug|Win32
|
||||
{E0B52AE7-E160-4D32-BF3F-910B785E5A8E}.Debug|x64.ActiveCfg = Debug|x64
|
||||
{E0B52AE7-E160-4D32-BF3F-910B785E5A8E}.Debug|x64.Build.0 = Debug|x64
|
||||
{E0B52AE7-E160-4D32-BF3F-910B785E5A8E}.Release|Mixed Platforms.ActiveCfg = Release|Win32
|
||||
{E0B52AE7-E160-4D32-BF3F-910B785E5A8E}.Release|Mixed Platforms.Build.0 = Release|Win32
|
||||
{E0B52AE7-E160-4D32-BF3F-910B785E5A8E}.Release|Win32.ActiveCfg = Release|Win32
|
||||
{E0B52AE7-E160-4D32-BF3F-910B785E5A8E}.Release|Win32.Build.0 = Release|Win32
|
||||
{E0B52AE7-E160-4D32-BF3F-910B785E5A8E}.Release|x64.ActiveCfg = Release|x64
|
||||
{E0B52AE7-E160-4D32-BF3F-910B785E5A8E}.Release|x64.Build.0 = Release|x64
|
||||
{7329B02D-C504-482A-A156-181D48CE493C}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU
|
||||
{7329B02D-C504-482A-A156-181D48CE493C}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU
|
||||
{7329B02D-C504-482A-A156-181D48CE493C}.Debug|Win32.ActiveCfg = Debug|Any CPU
|
||||
{7329B02D-C504-482A-A156-181D48CE493C}.Debug|Win32.Build.0 = Debug|Any CPU
|
||||
{7329B02D-C504-482A-A156-181D48CE493C}.Debug|x64.ActiveCfg = Debug|Any CPU
|
||||
{7329B02D-C504-482A-A156-181D48CE493C}.Debug|x64.Build.0 = Debug|Any CPU
|
||||
{7329B02D-C504-482A-A156-181D48CE493C}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU
|
||||
{7329B02D-C504-482A-A156-181D48CE493C}.Release|Mixed Platforms.Build.0 = Release|Any CPU
|
||||
{7329B02D-C504-482A-A156-181D48CE493C}.Release|Win32.ActiveCfg = Release|Any CPU
|
||||
{7329B02D-C504-482A-A156-181D48CE493C}.Release|Win32.Build.0 = Release|Any CPU
|
||||
{7329B02D-C504-482A-A156-181D48CE493C}.Release|x64.ActiveCfg = Release|Any CPU
|
||||
{7329B02D-C504-482A-A156-181D48CE493C}.Release|x64.Build.0 = Release|Any CPU
|
||||
{4F150A30-CECB-49D1-8283-6A3F57438CF5}.Debug|Mixed Platforms.ActiveCfg = Debug|Win32
|
||||
{4F150A30-CECB-49D1-8283-6A3F57438CF5}.Debug|Mixed Platforms.Build.0 = Debug|Win32
|
||||
{4F150A30-CECB-49D1-8283-6A3F57438CF5}.Debug|Win32.ActiveCfg = Debug|Win32
|
||||
{4F150A30-CECB-49D1-8283-6A3F57438CF5}.Debug|Win32.Build.0 = Debug|Win32
|
||||
{4F150A30-CECB-49D1-8283-6A3F57438CF5}.Debug|x64.ActiveCfg = Debug|x64
|
||||
{4F150A30-CECB-49D1-8283-6A3F57438CF5}.Debug|x64.Build.0 = Debug|x64
|
||||
{4F150A30-CECB-49D1-8283-6A3F57438CF5}.Release|Mixed Platforms.ActiveCfg = Release|Win32
|
||||
{4F150A30-CECB-49D1-8283-6A3F57438CF5}.Release|Mixed Platforms.Build.0 = Release|Win32
|
||||
{4F150A30-CECB-49D1-8283-6A3F57438CF5}.Release|Win32.ActiveCfg = Release|Win32
|
||||
{4F150A30-CECB-49D1-8283-6A3F57438CF5}.Release|Win32.Build.0 = Release|Win32
|
||||
{4F150A30-CECB-49D1-8283-6A3F57438CF5}.Release|x64.ActiveCfg = Release|x64
|
||||
{4F150A30-CECB-49D1-8283-6A3F57438CF5}.Release|x64.Build.0 = Release|x64
|
||||
{C7AB4186-54B2-4244-A533-77494763EA1D}.Debug|Mixed Platforms.ActiveCfg = Debug|Win32
|
||||
{C7AB4186-54B2-4244-A533-77494763EA1D}.Debug|Mixed Platforms.Build.0 = Debug|Win32
|
||||
{C7AB4186-54B2-4244-A533-77494763EA1D}.Debug|Win32.ActiveCfg = Debug|Win32
|
||||
{C7AB4186-54B2-4244-A533-77494763EA1D}.Debug|Win32.Build.0 = Debug|Win32
|
||||
{C7AB4186-54B2-4244-A533-77494763EA1D}.Debug|x64.ActiveCfg = Debug|x64
|
||||
{C7AB4186-54B2-4244-A533-77494763EA1D}.Debug|x64.Build.0 = Debug|x64
|
||||
{C7AB4186-54B2-4244-A533-77494763EA1D}.Release|Mixed Platforms.ActiveCfg = Release|Win32
|
||||
{C7AB4186-54B2-4244-A533-77494763EA1D}.Release|Mixed Platforms.Build.0 = Release|Win32
|
||||
{C7AB4186-54B2-4244-A533-77494763EA1D}.Release|Win32.ActiveCfg = Release|Win32
|
||||
{C7AB4186-54B2-4244-A533-77494763EA1D}.Release|Win32.Build.0 = Release|Win32
|
||||
{C7AB4186-54B2-4244-A533-77494763EA1D}.Release|x64.ActiveCfg = Release|x64
|
||||
{C7AB4186-54B2-4244-A533-77494763EA1D}.Release|x64.Build.0 = Release|x64
|
||||
EndGlobalSection
|
||||
GlobalSection(SolutionProperties) = preSolution
|
||||
HideSolutionNode = FALSE
|
||||
EndGlobalSection
|
||||
EndGlobal
|
||||
|
|
|
@ -1,74 +1,74 @@
|
|||
|
||||
Microsoft Visual Studio Solution File, Format Version 12.00
|
||||
# Visual Studio 2015
|
||||
VisualStudioVersion = 12.0.21005.1
|
||||
MinimumVisualStudioVersion = 10.0.40219.1
|
||||
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "DirectXTK_Desktop_2015_Win10", "DirectXTK_Desktop_2015_Win10.vcxproj", "{E0B52AE7-E160-4D32-BF3F-910B785E5A8E}"
|
||||
EndProject
|
||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "MakeSpriteFont", "MakeSpriteFont\MakeSpriteFont.csproj", "{7329B02D-C504-482A-A156-181D48CE493C}"
|
||||
EndProject
|
||||
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "XWBTool_Desktop_2015", "XWBTool\XWBTool_Desktop_2015.vcxproj", "{C7AB4186-54B2-4244-A533-77494763EA1D}"
|
||||
EndProject
|
||||
Global
|
||||
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
||||
Debug|Mixed Platforms = Debug|Mixed Platforms
|
||||
Debug|Win32 = Debug|Win32
|
||||
Debug|x64 = Debug|x64
|
||||
Release|Mixed Platforms = Release|Mixed Platforms
|
||||
Release|Win32 = Release|Win32
|
||||
Release|x64 = Release|x64
|
||||
EndGlobalSection
|
||||
GlobalSection(ProjectConfigurationPlatforms) = postSolution
|
||||
{E0B52AE7-E160-4D32-BF3F-910B785E5A8E}.Debug|Mixed Platforms.ActiveCfg = Debug|Win32
|
||||
{E0B52AE7-E160-4D32-BF3F-910B785E5A8E}.Debug|Mixed Platforms.Build.0 = Debug|Win32
|
||||
{E0B52AE7-E160-4D32-BF3F-910B785E5A8E}.Debug|Win32.ActiveCfg = Debug|Win32
|
||||
{E0B52AE7-E160-4D32-BF3F-910B785E5A8E}.Debug|Win32.Build.0 = Debug|Win32
|
||||
{E0B52AE7-E160-4D32-BF3F-910B785E5A8E}.Debug|x64.ActiveCfg = Debug|x64
|
||||
{E0B52AE7-E160-4D32-BF3F-910B785E5A8E}.Debug|x64.Build.0 = Debug|x64
|
||||
{E0B52AE7-E160-4D32-BF3F-910B785E5A8E}.Release|Mixed Platforms.ActiveCfg = Release|Win32
|
||||
{E0B52AE7-E160-4D32-BF3F-910B785E5A8E}.Release|Mixed Platforms.Build.0 = Release|Win32
|
||||
{E0B52AE7-E160-4D32-BF3F-910B785E5A8E}.Release|Win32.ActiveCfg = Release|Win32
|
||||
{E0B52AE7-E160-4D32-BF3F-910B785E5A8E}.Release|Win32.Build.0 = Release|Win32
|
||||
{E0B52AE7-E160-4D32-BF3F-910B785E5A8E}.Release|x64.ActiveCfg = Release|x64
|
||||
{E0B52AE7-E160-4D32-BF3F-910B785E5A8E}.Release|x64.Build.0 = Release|x64
|
||||
{7329B02D-C504-482A-A156-181D48CE493C}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU
|
||||
{7329B02D-C504-482A-A156-181D48CE493C}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU
|
||||
{7329B02D-C504-482A-A156-181D48CE493C}.Debug|Win32.ActiveCfg = Debug|Any CPU
|
||||
{7329B02D-C504-482A-A156-181D48CE493C}.Debug|Win32.Build.0 = Debug|Any CPU
|
||||
{7329B02D-C504-482A-A156-181D48CE493C}.Debug|x64.ActiveCfg = Debug|Any CPU
|
||||
{7329B02D-C504-482A-A156-181D48CE493C}.Debug|x64.Build.0 = Debug|Any CPU
|
||||
{7329B02D-C504-482A-A156-181D48CE493C}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU
|
||||
{7329B02D-C504-482A-A156-181D48CE493C}.Release|Mixed Platforms.Build.0 = Release|Any CPU
|
||||
{7329B02D-C504-482A-A156-181D48CE493C}.Release|Win32.ActiveCfg = Release|Any CPU
|
||||
{7329B02D-C504-482A-A156-181D48CE493C}.Release|Win32.Build.0 = Release|Any CPU
|
||||
{7329B02D-C504-482A-A156-181D48CE493C}.Release|x64.ActiveCfg = Release|Any CPU
|
||||
{7329B02D-C504-482A-A156-181D48CE493C}.Release|x64.Build.0 = Release|Any CPU
|
||||
{4F150A30-CECB-49D1-8283-6A3F57438CF5}.Debug|Mixed Platforms.ActiveCfg = Debug|Win32
|
||||
{4F150A30-CECB-49D1-8283-6A3F57438CF5}.Debug|Mixed Platforms.Build.0 = Debug|Win32
|
||||
{4F150A30-CECB-49D1-8283-6A3F57438CF5}.Debug|Win32.ActiveCfg = Debug|Win32
|
||||
{4F150A30-CECB-49D1-8283-6A3F57438CF5}.Debug|Win32.Build.0 = Debug|Win32
|
||||
{4F150A30-CECB-49D1-8283-6A3F57438CF5}.Debug|x64.ActiveCfg = Debug|x64
|
||||
{4F150A30-CECB-49D1-8283-6A3F57438CF5}.Debug|x64.Build.0 = Debug|x64
|
||||
{4F150A30-CECB-49D1-8283-6A3F57438CF5}.Release|Mixed Platforms.ActiveCfg = Release|Win32
|
||||
{4F150A30-CECB-49D1-8283-6A3F57438CF5}.Release|Mixed Platforms.Build.0 = Release|Win32
|
||||
{4F150A30-CECB-49D1-8283-6A3F57438CF5}.Release|Win32.ActiveCfg = Release|Win32
|
||||
{4F150A30-CECB-49D1-8283-6A3F57438CF5}.Release|Win32.Build.0 = Release|Win32
|
||||
{4F150A30-CECB-49D1-8283-6A3F57438CF5}.Release|x64.ActiveCfg = Release|x64
|
||||
{4F150A30-CECB-49D1-8283-6A3F57438CF5}.Release|x64.Build.0 = Release|x64
|
||||
{C7AB4186-54B2-4244-A533-77494763EA1D}.Debug|Mixed Platforms.ActiveCfg = Debug|Win32
|
||||
{C7AB4186-54B2-4244-A533-77494763EA1D}.Debug|Mixed Platforms.Build.0 = Debug|Win32
|
||||
{C7AB4186-54B2-4244-A533-77494763EA1D}.Debug|Win32.ActiveCfg = Debug|Win32
|
||||
{C7AB4186-54B2-4244-A533-77494763EA1D}.Debug|Win32.Build.0 = Debug|Win32
|
||||
{C7AB4186-54B2-4244-A533-77494763EA1D}.Debug|x64.ActiveCfg = Debug|x64
|
||||
{C7AB4186-54B2-4244-A533-77494763EA1D}.Debug|x64.Build.0 = Debug|x64
|
||||
{C7AB4186-54B2-4244-A533-77494763EA1D}.Release|Mixed Platforms.ActiveCfg = Release|Win32
|
||||
{C7AB4186-54B2-4244-A533-77494763EA1D}.Release|Mixed Platforms.Build.0 = Release|Win32
|
||||
{C7AB4186-54B2-4244-A533-77494763EA1D}.Release|Win32.ActiveCfg = Release|Win32
|
||||
{C7AB4186-54B2-4244-A533-77494763EA1D}.Release|Win32.Build.0 = Release|Win32
|
||||
{C7AB4186-54B2-4244-A533-77494763EA1D}.Release|x64.ActiveCfg = Release|x64
|
||||
{C7AB4186-54B2-4244-A533-77494763EA1D}.Release|x64.Build.0 = Release|x64
|
||||
EndGlobalSection
|
||||
GlobalSection(SolutionProperties) = preSolution
|
||||
HideSolutionNode = FALSE
|
||||
EndGlobalSection
|
||||
EndGlobal
|
||||
|
||||
Microsoft Visual Studio Solution File, Format Version 12.00
|
||||
# Visual Studio 2015
|
||||
VisualStudioVersion = 12.0.21005.1
|
||||
MinimumVisualStudioVersion = 10.0.40219.1
|
||||
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "DirectXTK_Desktop_2015_Win10", "DirectXTK_Desktop_2015_Win10.vcxproj", "{E0B52AE7-E160-4D32-BF3F-910B785E5A8E}"
|
||||
EndProject
|
||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "MakeSpriteFont", "MakeSpriteFont\MakeSpriteFont.csproj", "{7329B02D-C504-482A-A156-181D48CE493C}"
|
||||
EndProject
|
||||
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "XWBTool_Desktop_2015", "XWBTool\XWBTool_Desktop_2015.vcxproj", "{C7AB4186-54B2-4244-A533-77494763EA1D}"
|
||||
EndProject
|
||||
Global
|
||||
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
||||
Debug|Mixed Platforms = Debug|Mixed Platforms
|
||||
Debug|Win32 = Debug|Win32
|
||||
Debug|x64 = Debug|x64
|
||||
Release|Mixed Platforms = Release|Mixed Platforms
|
||||
Release|Win32 = Release|Win32
|
||||
Release|x64 = Release|x64
|
||||
EndGlobalSection
|
||||
GlobalSection(ProjectConfigurationPlatforms) = postSolution
|
||||
{E0B52AE7-E160-4D32-BF3F-910B785E5A8E}.Debug|Mixed Platforms.ActiveCfg = Debug|Win32
|
||||
{E0B52AE7-E160-4D32-BF3F-910B785E5A8E}.Debug|Mixed Platforms.Build.0 = Debug|Win32
|
||||
{E0B52AE7-E160-4D32-BF3F-910B785E5A8E}.Debug|Win32.ActiveCfg = Debug|Win32
|
||||
{E0B52AE7-E160-4D32-BF3F-910B785E5A8E}.Debug|Win32.Build.0 = Debug|Win32
|
||||
{E0B52AE7-E160-4D32-BF3F-910B785E5A8E}.Debug|x64.ActiveCfg = Debug|x64
|
||||
{E0B52AE7-E160-4D32-BF3F-910B785E5A8E}.Debug|x64.Build.0 = Debug|x64
|
||||
{E0B52AE7-E160-4D32-BF3F-910B785E5A8E}.Release|Mixed Platforms.ActiveCfg = Release|Win32
|
||||
{E0B52AE7-E160-4D32-BF3F-910B785E5A8E}.Release|Mixed Platforms.Build.0 = Release|Win32
|
||||
{E0B52AE7-E160-4D32-BF3F-910B785E5A8E}.Release|Win32.ActiveCfg = Release|Win32
|
||||
{E0B52AE7-E160-4D32-BF3F-910B785E5A8E}.Release|Win32.Build.0 = Release|Win32
|
||||
{E0B52AE7-E160-4D32-BF3F-910B785E5A8E}.Release|x64.ActiveCfg = Release|x64
|
||||
{E0B52AE7-E160-4D32-BF3F-910B785E5A8E}.Release|x64.Build.0 = Release|x64
|
||||
{7329B02D-C504-482A-A156-181D48CE493C}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU
|
||||
{7329B02D-C504-482A-A156-181D48CE493C}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU
|
||||
{7329B02D-C504-482A-A156-181D48CE493C}.Debug|Win32.ActiveCfg = Debug|Any CPU
|
||||
{7329B02D-C504-482A-A156-181D48CE493C}.Debug|Win32.Build.0 = Debug|Any CPU
|
||||
{7329B02D-C504-482A-A156-181D48CE493C}.Debug|x64.ActiveCfg = Debug|Any CPU
|
||||
{7329B02D-C504-482A-A156-181D48CE493C}.Debug|x64.Build.0 = Debug|Any CPU
|
||||
{7329B02D-C504-482A-A156-181D48CE493C}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU
|
||||
{7329B02D-C504-482A-A156-181D48CE493C}.Release|Mixed Platforms.Build.0 = Release|Any CPU
|
||||
{7329B02D-C504-482A-A156-181D48CE493C}.Release|Win32.ActiveCfg = Release|Any CPU
|
||||
{7329B02D-C504-482A-A156-181D48CE493C}.Release|Win32.Build.0 = Release|Any CPU
|
||||
{7329B02D-C504-482A-A156-181D48CE493C}.Release|x64.ActiveCfg = Release|Any CPU
|
||||
{7329B02D-C504-482A-A156-181D48CE493C}.Release|x64.Build.0 = Release|Any CPU
|
||||
{4F150A30-CECB-49D1-8283-6A3F57438CF5}.Debug|Mixed Platforms.ActiveCfg = Debug|Win32
|
||||
{4F150A30-CECB-49D1-8283-6A3F57438CF5}.Debug|Mixed Platforms.Build.0 = Debug|Win32
|
||||
{4F150A30-CECB-49D1-8283-6A3F57438CF5}.Debug|Win32.ActiveCfg = Debug|Win32
|
||||
{4F150A30-CECB-49D1-8283-6A3F57438CF5}.Debug|Win32.Build.0 = Debug|Win32
|
||||
{4F150A30-CECB-49D1-8283-6A3F57438CF5}.Debug|x64.ActiveCfg = Debug|x64
|
||||
{4F150A30-CECB-49D1-8283-6A3F57438CF5}.Debug|x64.Build.0 = Debug|x64
|
||||
{4F150A30-CECB-49D1-8283-6A3F57438CF5}.Release|Mixed Platforms.ActiveCfg = Release|Win32
|
||||
{4F150A30-CECB-49D1-8283-6A3F57438CF5}.Release|Mixed Platforms.Build.0 = Release|Win32
|
||||
{4F150A30-CECB-49D1-8283-6A3F57438CF5}.Release|Win32.ActiveCfg = Release|Win32
|
||||
{4F150A30-CECB-49D1-8283-6A3F57438CF5}.Release|Win32.Build.0 = Release|Win32
|
||||
{4F150A30-CECB-49D1-8283-6A3F57438CF5}.Release|x64.ActiveCfg = Release|x64
|
||||
{4F150A30-CECB-49D1-8283-6A3F57438CF5}.Release|x64.Build.0 = Release|x64
|
||||
{C7AB4186-54B2-4244-A533-77494763EA1D}.Debug|Mixed Platforms.ActiveCfg = Debug|Win32
|
||||
{C7AB4186-54B2-4244-A533-77494763EA1D}.Debug|Mixed Platforms.Build.0 = Debug|Win32
|
||||
{C7AB4186-54B2-4244-A533-77494763EA1D}.Debug|Win32.ActiveCfg = Debug|Win32
|
||||
{C7AB4186-54B2-4244-A533-77494763EA1D}.Debug|Win32.Build.0 = Debug|Win32
|
||||
{C7AB4186-54B2-4244-A533-77494763EA1D}.Debug|x64.ActiveCfg = Debug|x64
|
||||
{C7AB4186-54B2-4244-A533-77494763EA1D}.Debug|x64.Build.0 = Debug|x64
|
||||
{C7AB4186-54B2-4244-A533-77494763EA1D}.Release|Mixed Platforms.ActiveCfg = Release|Win32
|
||||
{C7AB4186-54B2-4244-A533-77494763EA1D}.Release|Mixed Platforms.Build.0 = Release|Win32
|
||||
{C7AB4186-54B2-4244-A533-77494763EA1D}.Release|Win32.ActiveCfg = Release|Win32
|
||||
{C7AB4186-54B2-4244-A533-77494763EA1D}.Release|Win32.Build.0 = Release|Win32
|
||||
{C7AB4186-54B2-4244-A533-77494763EA1D}.Release|x64.ActiveCfg = Release|x64
|
||||
{C7AB4186-54B2-4244-A533-77494763EA1D}.Release|x64.Build.0 = Release|x64
|
||||
EndGlobalSection
|
||||
GlobalSection(SolutionProperties) = preSolution
|
||||
HideSolutionNode = FALSE
|
||||
EndGlobalSection
|
||||
EndGlobal
|
||||
|
|
|
@ -1,34 +1,34 @@
|
|||
|
||||
Microsoft Visual Studio Solution File, Format Version 12.00
|
||||
# Visual Studio 2013
|
||||
VisualStudioVersion = 12.0.21005.1
|
||||
MinimumVisualStudioVersion = 10.0.40219.1
|
||||
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "DirectXTK_Windows81", "DirectXTK_Windows81.vcxproj", "{E0B52AE7-E160-4D32-BF3F-910B785E5A8E}"
|
||||
EndProject
|
||||
Global
|
||||
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
||||
Debug|ARM = Debug|ARM
|
||||
Debug|Win32 = Debug|Win32
|
||||
Debug|x64 = Debug|x64
|
||||
Release|ARM = Release|ARM
|
||||
Release|Win32 = Release|Win32
|
||||
Release|x64 = Release|x64
|
||||
EndGlobalSection
|
||||
GlobalSection(ProjectConfigurationPlatforms) = postSolution
|
||||
{E0B52AE7-E160-4D32-BF3F-910B785E5A8E}.Debug|ARM.ActiveCfg = Debug|ARM
|
||||
{E0B52AE7-E160-4D32-BF3F-910B785E5A8E}.Debug|ARM.Build.0 = Debug|ARM
|
||||
{E0B52AE7-E160-4D32-BF3F-910B785E5A8E}.Debug|Win32.ActiveCfg = Debug|Win32
|
||||
{E0B52AE7-E160-4D32-BF3F-910B785E5A8E}.Debug|Win32.Build.0 = Debug|Win32
|
||||
{E0B52AE7-E160-4D32-BF3F-910B785E5A8E}.Debug|x64.ActiveCfg = Debug|x64
|
||||
{E0B52AE7-E160-4D32-BF3F-910B785E5A8E}.Debug|x64.Build.0 = Debug|x64
|
||||
{E0B52AE7-E160-4D32-BF3F-910B785E5A8E}.Release|ARM.ActiveCfg = Release|ARM
|
||||
{E0B52AE7-E160-4D32-BF3F-910B785E5A8E}.Release|ARM.Build.0 = Release|ARM
|
||||
{E0B52AE7-E160-4D32-BF3F-910B785E5A8E}.Release|Win32.ActiveCfg = Release|Win32
|
||||
{E0B52AE7-E160-4D32-BF3F-910B785E5A8E}.Release|Win32.Build.0 = Release|Win32
|
||||
{E0B52AE7-E160-4D32-BF3F-910B785E5A8E}.Release|x64.ActiveCfg = Release|x64
|
||||
{E0B52AE7-E160-4D32-BF3F-910B785E5A8E}.Release|x64.Build.0 = Release|x64
|
||||
EndGlobalSection
|
||||
GlobalSection(SolutionProperties) = preSolution
|
||||
HideSolutionNode = FALSE
|
||||
EndGlobalSection
|
||||
EndGlobal
|
||||
|
||||
Microsoft Visual Studio Solution File, Format Version 12.00
|
||||
# Visual Studio 2013
|
||||
VisualStudioVersion = 12.0.21005.1
|
||||
MinimumVisualStudioVersion = 10.0.40219.1
|
||||
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "DirectXTK_Windows81", "DirectXTK_Windows81.vcxproj", "{E0B52AE7-E160-4D32-BF3F-910B785E5A8E}"
|
||||
EndProject
|
||||
Global
|
||||
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
||||
Debug|ARM = Debug|ARM
|
||||
Debug|Win32 = Debug|Win32
|
||||
Debug|x64 = Debug|x64
|
||||
Release|ARM = Release|ARM
|
||||
Release|Win32 = Release|Win32
|
||||
Release|x64 = Release|x64
|
||||
EndGlobalSection
|
||||
GlobalSection(ProjectConfigurationPlatforms) = postSolution
|
||||
{E0B52AE7-E160-4D32-BF3F-910B785E5A8E}.Debug|ARM.ActiveCfg = Debug|ARM
|
||||
{E0B52AE7-E160-4D32-BF3F-910B785E5A8E}.Debug|ARM.Build.0 = Debug|ARM
|
||||
{E0B52AE7-E160-4D32-BF3F-910B785E5A8E}.Debug|Win32.ActiveCfg = Debug|Win32
|
||||
{E0B52AE7-E160-4D32-BF3F-910B785E5A8E}.Debug|Win32.Build.0 = Debug|Win32
|
||||
{E0B52AE7-E160-4D32-BF3F-910B785E5A8E}.Debug|x64.ActiveCfg = Debug|x64
|
||||
{E0B52AE7-E160-4D32-BF3F-910B785E5A8E}.Debug|x64.Build.0 = Debug|x64
|
||||
{E0B52AE7-E160-4D32-BF3F-910B785E5A8E}.Release|ARM.ActiveCfg = Release|ARM
|
||||
{E0B52AE7-E160-4D32-BF3F-910B785E5A8E}.Release|ARM.Build.0 = Release|ARM
|
||||
{E0B52AE7-E160-4D32-BF3F-910B785E5A8E}.Release|Win32.ActiveCfg = Release|Win32
|
||||
{E0B52AE7-E160-4D32-BF3F-910B785E5A8E}.Release|Win32.Build.0 = Release|Win32
|
||||
{E0B52AE7-E160-4D32-BF3F-910B785E5A8E}.Release|x64.ActiveCfg = Release|x64
|
||||
{E0B52AE7-E160-4D32-BF3F-910B785E5A8E}.Release|x64.Build.0 = Release|x64
|
||||
EndGlobalSection
|
||||
GlobalSection(SolutionProperties) = preSolution
|
||||
HideSolutionNode = FALSE
|
||||
EndGlobalSection
|
||||
EndGlobal
|
||||
|
|
|
@ -1,28 +1,28 @@
|
|||
|
||||
Microsoft Visual Studio Solution File, Format Version 12.00
|
||||
# Visual Studio 2013
|
||||
VisualStudioVersion = 12.0.30303.0
|
||||
MinimumVisualStudioVersion = 10.0.40219.1
|
||||
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "DirectXTK_WindowsPhone81", "DirectXTK_WindowsPhone81.vcxproj", "{E0B52AE7-E160-4D32-BF3F-910B785E5A8E}"
|
||||
EndProject
|
||||
Global
|
||||
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
||||
Debug|ARM = Debug|ARM
|
||||
Debug|Win32 = Debug|Win32
|
||||
Release|ARM = Release|ARM
|
||||
Release|Win32 = Release|Win32
|
||||
EndGlobalSection
|
||||
GlobalSection(ProjectConfigurationPlatforms) = postSolution
|
||||
{E0B52AE7-E160-4D32-BF3F-910B785E5A8E}.Debug|ARM.ActiveCfg = Debug|ARM
|
||||
{E0B52AE7-E160-4D32-BF3F-910B785E5A8E}.Debug|ARM.Build.0 = Debug|ARM
|
||||
{E0B52AE7-E160-4D32-BF3F-910B785E5A8E}.Debug|Win32.ActiveCfg = Debug|Win32
|
||||
{E0B52AE7-E160-4D32-BF3F-910B785E5A8E}.Debug|Win32.Build.0 = Debug|Win32
|
||||
{E0B52AE7-E160-4D32-BF3F-910B785E5A8E}.Release|ARM.ActiveCfg = Release|ARM
|
||||
{E0B52AE7-E160-4D32-BF3F-910B785E5A8E}.Release|ARM.Build.0 = Release|ARM
|
||||
{E0B52AE7-E160-4D32-BF3F-910B785E5A8E}.Release|Win32.ActiveCfg = Release|Win32
|
||||
{E0B52AE7-E160-4D32-BF3F-910B785E5A8E}.Release|Win32.Build.0 = Release|Win32
|
||||
EndGlobalSection
|
||||
GlobalSection(SolutionProperties) = preSolution
|
||||
HideSolutionNode = FALSE
|
||||
EndGlobalSection
|
||||
EndGlobal
|
||||
|
||||
Microsoft Visual Studio Solution File, Format Version 12.00
|
||||
# Visual Studio 2013
|
||||
VisualStudioVersion = 12.0.30303.0
|
||||
MinimumVisualStudioVersion = 10.0.40219.1
|
||||
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "DirectXTK_WindowsPhone81", "DirectXTK_WindowsPhone81.vcxproj", "{E0B52AE7-E160-4D32-BF3F-910B785E5A8E}"
|
||||
EndProject
|
||||
Global
|
||||
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
||||
Debug|ARM = Debug|ARM
|
||||
Debug|Win32 = Debug|Win32
|
||||
Release|ARM = Release|ARM
|
||||
Release|Win32 = Release|Win32
|
||||
EndGlobalSection
|
||||
GlobalSection(ProjectConfigurationPlatforms) = postSolution
|
||||
{E0B52AE7-E160-4D32-BF3F-910B785E5A8E}.Debug|ARM.ActiveCfg = Debug|ARM
|
||||
{E0B52AE7-E160-4D32-BF3F-910B785E5A8E}.Debug|ARM.Build.0 = Debug|ARM
|
||||
{E0B52AE7-E160-4D32-BF3F-910B785E5A8E}.Debug|Win32.ActiveCfg = Debug|Win32
|
||||
{E0B52AE7-E160-4D32-BF3F-910B785E5A8E}.Debug|Win32.Build.0 = Debug|Win32
|
||||
{E0B52AE7-E160-4D32-BF3F-910B785E5A8E}.Release|ARM.ActiveCfg = Release|ARM
|
||||
{E0B52AE7-E160-4D32-BF3F-910B785E5A8E}.Release|ARM.Build.0 = Release|ARM
|
||||
{E0B52AE7-E160-4D32-BF3F-910B785E5A8E}.Release|Win32.ActiveCfg = Release|Win32
|
||||
{E0B52AE7-E160-4D32-BF3F-910B785E5A8E}.Release|Win32.Build.0 = Release|Win32
|
||||
EndGlobalSection
|
||||
GlobalSection(SolutionProperties) = preSolution
|
||||
HideSolutionNode = FALSE
|
||||
EndGlobalSection
|
||||
EndGlobal
|
||||
|
|
|
@ -1,28 +1,28 @@
|
|||
|
||||
Microsoft Visual Studio Solution File, Format Version 12.00
|
||||
# Visual Studio 2013
|
||||
VisualStudioVersion = 12.0.30626.0
|
||||
MinimumVisualStudioVersion = 10.0.40219.1
|
||||
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "DirectXTK_XAMLSilverlight_WindowsPhone81", "DirectXTK_XAMLSilverlight_WindowsPhone81.vcxproj", "{E6360FF2-827F-44C1-87C6-3E1F98F5DA2E}"
|
||||
EndProject
|
||||
Global
|
||||
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
||||
Debug|ARM = Debug|ARM
|
||||
Debug|Win32 = Debug|Win32
|
||||
Release|ARM = Release|ARM
|
||||
Release|Win32 = Release|Win32
|
||||
EndGlobalSection
|
||||
GlobalSection(ProjectConfigurationPlatforms) = postSolution
|
||||
{E6360FF2-827F-44C1-87C6-3E1F98F5DA2E}.Debug|ARM.ActiveCfg = Debug|ARM
|
||||
{E6360FF2-827F-44C1-87C6-3E1F98F5DA2E}.Debug|ARM.Build.0 = Debug|ARM
|
||||
{E6360FF2-827F-44C1-87C6-3E1F98F5DA2E}.Debug|Win32.ActiveCfg = Debug|Win32
|
||||
{E6360FF2-827F-44C1-87C6-3E1F98F5DA2E}.Debug|Win32.Build.0 = Debug|Win32
|
||||
{E6360FF2-827F-44C1-87C6-3E1F98F5DA2E}.Release|ARM.ActiveCfg = Release|ARM
|
||||
{E6360FF2-827F-44C1-87C6-3E1F98F5DA2E}.Release|ARM.Build.0 = Release|ARM
|
||||
{E6360FF2-827F-44C1-87C6-3E1F98F5DA2E}.Release|Win32.ActiveCfg = Release|Win32
|
||||
{E6360FF2-827F-44C1-87C6-3E1F98F5DA2E}.Release|Win32.Build.0 = Release|Win32
|
||||
EndGlobalSection
|
||||
GlobalSection(SolutionProperties) = preSolution
|
||||
HideSolutionNode = FALSE
|
||||
EndGlobalSection
|
||||
EndGlobal
|
||||
|
||||
Microsoft Visual Studio Solution File, Format Version 12.00
|
||||
# Visual Studio 2013
|
||||
VisualStudioVersion = 12.0.30626.0
|
||||
MinimumVisualStudioVersion = 10.0.40219.1
|
||||
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "DirectXTK_XAMLSilverlight_WindowsPhone81", "DirectXTK_XAMLSilverlight_WindowsPhone81.vcxproj", "{E6360FF2-827F-44C1-87C6-3E1F98F5DA2E}"
|
||||
EndProject
|
||||
Global
|
||||
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
||||
Debug|ARM = Debug|ARM
|
||||
Debug|Win32 = Debug|Win32
|
||||
Release|ARM = Release|ARM
|
||||
Release|Win32 = Release|Win32
|
||||
EndGlobalSection
|
||||
GlobalSection(ProjectConfigurationPlatforms) = postSolution
|
||||
{E6360FF2-827F-44C1-87C6-3E1F98F5DA2E}.Debug|ARM.ActiveCfg = Debug|ARM
|
||||
{E6360FF2-827F-44C1-87C6-3E1F98F5DA2E}.Debug|ARM.Build.0 = Debug|ARM
|
||||
{E6360FF2-827F-44C1-87C6-3E1F98F5DA2E}.Debug|Win32.ActiveCfg = Debug|Win32
|
||||
{E6360FF2-827F-44C1-87C6-3E1F98F5DA2E}.Debug|Win32.Build.0 = Debug|Win32
|
||||
{E6360FF2-827F-44C1-87C6-3E1F98F5DA2E}.Release|ARM.ActiveCfg = Release|ARM
|
||||
{E6360FF2-827F-44C1-87C6-3E1F98F5DA2E}.Release|ARM.Build.0 = Release|ARM
|
||||
{E6360FF2-827F-44C1-87C6-3E1F98F5DA2E}.Release|Win32.ActiveCfg = Release|Win32
|
||||
{E6360FF2-827F-44C1-87C6-3E1F98F5DA2E}.Release|Win32.Build.0 = Release|Win32
|
||||
EndGlobalSection
|
||||
GlobalSection(SolutionProperties) = preSolution
|
||||
HideSolutionNode = FALSE
|
||||
EndGlobalSection
|
||||
EndGlobal
|
||||
|
|
|
@ -1,25 +1,25 @@
|
|||
|
||||
Microsoft Visual Studio Solution File, Format Version 12.00
|
||||
# Visual Studio 14
|
||||
VisualStudioVersion = 14.0.23107.0
|
||||
MinimumVisualStudioVersion = 10.0.40219.1
|
||||
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "DirectXTK_XboxOneXDK_2015", "DirectXTK_XboxOneXDK_2015.vcxproj", "{4FDFDCCD-EE2E-415C-B458-1E8FDB0D85F2}"
|
||||
EndProject
|
||||
Global
|
||||
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
||||
Debug|Durango = Debug|Durango
|
||||
Profile|Durango = Profile|Durango
|
||||
Release|Durango = Release|Durango
|
||||
EndGlobalSection
|
||||
GlobalSection(ProjectConfigurationPlatforms) = postSolution
|
||||
{4FDFDCCD-EE2E-415C-B458-1E8FDB0D85F2}.Debug|Durango.ActiveCfg = Debug|Durango
|
||||
{4FDFDCCD-EE2E-415C-B458-1E8FDB0D85F2}.Debug|Durango.Build.0 = Debug|Durango
|
||||
{4FDFDCCD-EE2E-415C-B458-1E8FDB0D85F2}.Profile|Durango.ActiveCfg = Profile|Durango
|
||||
{4FDFDCCD-EE2E-415C-B458-1E8FDB0D85F2}.Profile|Durango.Build.0 = Profile|Durango
|
||||
{4FDFDCCD-EE2E-415C-B458-1E8FDB0D85F2}.Release|Durango.ActiveCfg = Release|Durango
|
||||
{4FDFDCCD-EE2E-415C-B458-1E8FDB0D85F2}.Release|Durango.Build.0 = Release|Durango
|
||||
EndGlobalSection
|
||||
GlobalSection(SolutionProperties) = preSolution
|
||||
HideSolutionNode = FALSE
|
||||
EndGlobalSection
|
||||
EndGlobal
|
||||
|
||||
Microsoft Visual Studio Solution File, Format Version 12.00
|
||||
# Visual Studio 14
|
||||
VisualStudioVersion = 14.0.23107.0
|
||||
MinimumVisualStudioVersion = 10.0.40219.1
|
||||
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "DirectXTK_XboxOneXDK_2015", "DirectXTK_XboxOneXDK_2015.vcxproj", "{4FDFDCCD-EE2E-415C-B458-1E8FDB0D85F2}"
|
||||
EndProject
|
||||
Global
|
||||
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
||||
Debug|Durango = Debug|Durango
|
||||
Profile|Durango = Profile|Durango
|
||||
Release|Durango = Release|Durango
|
||||
EndGlobalSection
|
||||
GlobalSection(ProjectConfigurationPlatforms) = postSolution
|
||||
{4FDFDCCD-EE2E-415C-B458-1E8FDB0D85F2}.Debug|Durango.ActiveCfg = Debug|Durango
|
||||
{4FDFDCCD-EE2E-415C-B458-1E8FDB0D85F2}.Debug|Durango.Build.0 = Debug|Durango
|
||||
{4FDFDCCD-EE2E-415C-B458-1E8FDB0D85F2}.Profile|Durango.ActiveCfg = Profile|Durango
|
||||
{4FDFDCCD-EE2E-415C-B458-1E8FDB0D85F2}.Profile|Durango.Build.0 = Profile|Durango
|
||||
{4FDFDCCD-EE2E-415C-B458-1E8FDB0D85F2}.Release|Durango.ActiveCfg = Release|Durango
|
||||
{4FDFDCCD-EE2E-415C-B458-1E8FDB0D85F2}.Release|Durango.Build.0 = Release|Durango
|
||||
EndGlobalSection
|
||||
GlobalSection(SolutionProperties) = preSolution
|
||||
HideSolutionNode = FALSE
|
||||
EndGlobalSection
|
||||
EndGlobal
|
||||
|
|
1364
Inc/Audio.h
1364
Inc/Audio.h
Разница между файлами не показана из-за своего большого размера
Загрузить разницу
|
@ -1,70 +1,70 @@
|
|||
//--------------------------------------------------------------------------------------
|
||||
// File: CommonStates.h
|
||||
//
|
||||
// THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF
|
||||
// ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO
|
||||
// THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A
|
||||
// PARTICULAR PURPOSE.
|
||||
//
|
||||
// Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
//
|
||||
// http://go.microsoft.com/fwlink/?LinkId=248929
|
||||
//--------------------------------------------------------------------------------------
|
||||
|
||||
#pragma once
|
||||
|
||||
#if defined(_XBOX_ONE) && defined(_TITLE)
|
||||
#include <d3d11_x.h>
|
||||
#else
|
||||
#include <d3d11_1.h>
|
||||
#endif
|
||||
|
||||
#include <memory>
|
||||
|
||||
|
||||
namespace DirectX
|
||||
{
|
||||
class CommonStates
|
||||
{
|
||||
public:
|
||||
explicit CommonStates(_In_ ID3D11Device* device);
|
||||
CommonStates(CommonStates&& moveFrom);
|
||||
CommonStates& operator= (CommonStates&& moveFrom);
|
||||
|
||||
CommonStates(CommonStates const&) = delete;
|
||||
CommonStates& operator= (CommonStates const&) = delete;
|
||||
|
||||
virtual ~CommonStates();
|
||||
|
||||
// Blend states.
|
||||
ID3D11BlendState* __cdecl Opaque() const;
|
||||
ID3D11BlendState* __cdecl AlphaBlend() const;
|
||||
ID3D11BlendState* __cdecl Additive() const;
|
||||
ID3D11BlendState* __cdecl NonPremultiplied() const;
|
||||
|
||||
// Depth stencil states.
|
||||
ID3D11DepthStencilState* __cdecl DepthNone() const;
|
||||
ID3D11DepthStencilState* __cdecl DepthDefault() const;
|
||||
ID3D11DepthStencilState* __cdecl DepthRead() const;
|
||||
|
||||
// Rasterizer states.
|
||||
ID3D11RasterizerState* __cdecl CullNone() const;
|
||||
ID3D11RasterizerState* __cdecl CullClockwise() const;
|
||||
ID3D11RasterizerState* __cdecl CullCounterClockwise() const;
|
||||
ID3D11RasterizerState* __cdecl Wireframe() const;
|
||||
|
||||
// Sampler states.
|
||||
ID3D11SamplerState* __cdecl PointWrap() const;
|
||||
ID3D11SamplerState* __cdecl PointClamp() const;
|
||||
ID3D11SamplerState* __cdecl LinearWrap() const;
|
||||
ID3D11SamplerState* __cdecl LinearClamp() const;
|
||||
ID3D11SamplerState* __cdecl AnisotropicWrap() const;
|
||||
ID3D11SamplerState* __cdecl AnisotropicClamp() const;
|
||||
|
||||
private:
|
||||
// Private implementation.
|
||||
class Impl;
|
||||
|
||||
std::shared_ptr<Impl> pImpl;
|
||||
};
|
||||
}
|
||||
//--------------------------------------------------------------------------------------
|
||||
// File: CommonStates.h
|
||||
//
|
||||
// THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF
|
||||
// ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO
|
||||
// THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A
|
||||
// PARTICULAR PURPOSE.
|
||||
//
|
||||
// Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
//
|
||||
// http://go.microsoft.com/fwlink/?LinkId=248929
|
||||
//--------------------------------------------------------------------------------------
|
||||
|
||||
#pragma once
|
||||
|
||||
#if defined(_XBOX_ONE) && defined(_TITLE)
|
||||
#include <d3d11_x.h>
|
||||
#else
|
||||
#include <d3d11_1.h>
|
||||
#endif
|
||||
|
||||
#include <memory>
|
||||
|
||||
|
||||
namespace DirectX
|
||||
{
|
||||
class CommonStates
|
||||
{
|
||||
public:
|
||||
explicit CommonStates(_In_ ID3D11Device* device);
|
||||
CommonStates(CommonStates&& moveFrom);
|
||||
CommonStates& operator= (CommonStates&& moveFrom);
|
||||
|
||||
CommonStates(CommonStates const&) = delete;
|
||||
CommonStates& operator= (CommonStates const&) = delete;
|
||||
|
||||
virtual ~CommonStates();
|
||||
|
||||
// Blend states.
|
||||
ID3D11BlendState* __cdecl Opaque() const;
|
||||
ID3D11BlendState* __cdecl AlphaBlend() const;
|
||||
ID3D11BlendState* __cdecl Additive() const;
|
||||
ID3D11BlendState* __cdecl NonPremultiplied() const;
|
||||
|
||||
// Depth stencil states.
|
||||
ID3D11DepthStencilState* __cdecl DepthNone() const;
|
||||
ID3D11DepthStencilState* __cdecl DepthDefault() const;
|
||||
ID3D11DepthStencilState* __cdecl DepthRead() const;
|
||||
|
||||
// Rasterizer states.
|
||||
ID3D11RasterizerState* __cdecl CullNone() const;
|
||||
ID3D11RasterizerState* __cdecl CullClockwise() const;
|
||||
ID3D11RasterizerState* __cdecl CullCounterClockwise() const;
|
||||
ID3D11RasterizerState* __cdecl Wireframe() const;
|
||||
|
||||
// Sampler states.
|
||||
ID3D11SamplerState* __cdecl PointWrap() const;
|
||||
ID3D11SamplerState* __cdecl PointClamp() const;
|
||||
ID3D11SamplerState* __cdecl LinearWrap() const;
|
||||
ID3D11SamplerState* __cdecl LinearClamp() const;
|
||||
ID3D11SamplerState* __cdecl AnisotropicWrap() const;
|
||||
ID3D11SamplerState* __cdecl AnisotropicClamp() const;
|
||||
|
||||
private:
|
||||
// Private implementation.
|
||||
class Impl;
|
||||
|
||||
std::shared_ptr<Impl> pImpl;
|
||||
};
|
||||
}
|
||||
|
|
|
@ -1,158 +1,158 @@
|
|||
//--------------------------------------------------------------------------------------
|
||||
// File: DDSTextureLoader.h
|
||||
//
|
||||
// Functions for loading a DDS texture and creating a Direct3D runtime resource for it
|
||||
//
|
||||
// Note these functions are useful as a light-weight runtime loader for DDS files. For
|
||||
// a full-featured DDS file reader, writer, and texture processing pipeline see
|
||||
// the 'Texconv' sample and the 'DirectXTex' library.
|
||||
//
|
||||
// THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF
|
||||
// ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO
|
||||
// THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A
|
||||
// PARTICULAR PURPOSE.
|
||||
//
|
||||
// Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
//
|
||||
// http://go.microsoft.com/fwlink/?LinkId=248926
|
||||
// http://go.microsoft.com/fwlink/?LinkId=248929
|
||||
//--------------------------------------------------------------------------------------
|
||||
|
||||
#pragma once
|
||||
|
||||
#if defined(_XBOX_ONE) && defined(_TITLE)
|
||||
#include <d3d11_x.h>
|
||||
#else
|
||||
#include <d3d11_1.h>
|
||||
#endif
|
||||
|
||||
#include <stdint.h>
|
||||
|
||||
|
||||
namespace DirectX
|
||||
{
|
||||
enum DDS_ALPHA_MODE
|
||||
{
|
||||
DDS_ALPHA_MODE_UNKNOWN = 0,
|
||||
DDS_ALPHA_MODE_STRAIGHT = 1,
|
||||
DDS_ALPHA_MODE_PREMULTIPLIED = 2,
|
||||
DDS_ALPHA_MODE_OPAQUE = 3,
|
||||
DDS_ALPHA_MODE_CUSTOM = 4,
|
||||
};
|
||||
|
||||
// Standard version
|
||||
HRESULT __cdecl CreateDDSTextureFromMemory(
|
||||
_In_ ID3D11Device* d3dDevice,
|
||||
_In_reads_bytes_(ddsDataSize) const uint8_t* ddsData,
|
||||
_In_ size_t ddsDataSize,
|
||||
_Outptr_opt_ ID3D11Resource** texture,
|
||||
_Outptr_opt_ ID3D11ShaderResourceView** textureView,
|
||||
_In_ size_t maxsize = 0,
|
||||
_Out_opt_ DDS_ALPHA_MODE* alphaMode = nullptr);
|
||||
|
||||
HRESULT __cdecl CreateDDSTextureFromFile(
|
||||
_In_ ID3D11Device* d3dDevice,
|
||||
_In_z_ const wchar_t* szFileName,
|
||||
_Outptr_opt_ ID3D11Resource** texture,
|
||||
_Outptr_opt_ ID3D11ShaderResourceView** textureView,
|
||||
_In_ size_t maxsize = 0,
|
||||
_Out_opt_ DDS_ALPHA_MODE* alphaMode = nullptr);
|
||||
|
||||
// Standard version with optional auto-gen mipmap support
|
||||
HRESULT __cdecl CreateDDSTextureFromMemory(
|
||||
#if defined(_XBOX_ONE) && defined(_TITLE)
|
||||
_In_ ID3D11DeviceX* d3dDevice,
|
||||
_In_opt_ ID3D11DeviceContextX* d3dContext,
|
||||
#else
|
||||
_In_ ID3D11Device* d3dDevice,
|
||||
_In_opt_ ID3D11DeviceContext* d3dContext,
|
||||
#endif
|
||||
_In_reads_bytes_(ddsDataSize) const uint8_t* ddsData,
|
||||
_In_ size_t ddsDataSize,
|
||||
_Outptr_opt_ ID3D11Resource** texture,
|
||||
_Outptr_opt_ ID3D11ShaderResourceView** textureView,
|
||||
_In_ size_t maxsize = 0,
|
||||
_Out_opt_ DDS_ALPHA_MODE* alphaMode = nullptr);
|
||||
|
||||
HRESULT __cdecl CreateDDSTextureFromFile(
|
||||
#if defined(_XBOX_ONE) && defined(_TITLE)
|
||||
_In_ ID3D11DeviceX* d3dDevice,
|
||||
_In_opt_ ID3D11DeviceContextX* d3dContext,
|
||||
#else
|
||||
_In_ ID3D11Device* d3dDevice,
|
||||
_In_opt_ ID3D11DeviceContext* d3dContext,
|
||||
#endif
|
||||
_In_z_ const wchar_t* szFileName,
|
||||
_Outptr_opt_ ID3D11Resource** texture,
|
||||
_Outptr_opt_ ID3D11ShaderResourceView** textureView,
|
||||
_In_ size_t maxsize = 0,
|
||||
_Out_opt_ DDS_ALPHA_MODE* alphaMode = nullptr);
|
||||
|
||||
// Extended version
|
||||
HRESULT __cdecl CreateDDSTextureFromMemoryEx(
|
||||
_In_ ID3D11Device* d3dDevice,
|
||||
_In_reads_bytes_(ddsDataSize) const uint8_t* ddsData,
|
||||
_In_ size_t ddsDataSize,
|
||||
_In_ size_t maxsize,
|
||||
_In_ D3D11_USAGE usage,
|
||||
_In_ unsigned int bindFlags,
|
||||
_In_ unsigned int cpuAccessFlags,
|
||||
_In_ unsigned int miscFlags,
|
||||
_In_ bool forceSRGB,
|
||||
_Outptr_opt_ ID3D11Resource** texture,
|
||||
_Outptr_opt_ ID3D11ShaderResourceView** textureView,
|
||||
_Out_opt_ DDS_ALPHA_MODE* alphaMode = nullptr);
|
||||
|
||||
HRESULT __cdecl CreateDDSTextureFromFileEx(
|
||||
_In_ ID3D11Device* d3dDevice,
|
||||
_In_z_ const wchar_t* szFileName,
|
||||
_In_ size_t maxsize,
|
||||
_In_ D3D11_USAGE usage,
|
||||
_In_ unsigned int bindFlags,
|
||||
_In_ unsigned int cpuAccessFlags,
|
||||
_In_ unsigned int miscFlags,
|
||||
_In_ bool forceSRGB,
|
||||
_Outptr_opt_ ID3D11Resource** texture,
|
||||
_Outptr_opt_ ID3D11ShaderResourceView** textureView,
|
||||
_Out_opt_ DDS_ALPHA_MODE* alphaMode = nullptr);
|
||||
|
||||
// Extended version with optional auto-gen mipmap support
|
||||
HRESULT __cdecl CreateDDSTextureFromMemoryEx(
|
||||
#if defined(_XBOX_ONE) && defined(_TITLE)
|
||||
_In_ ID3D11DeviceX* d3dDevice,
|
||||
_In_opt_ ID3D11DeviceContextX* d3dContext,
|
||||
#else
|
||||
_In_ ID3D11Device* d3dDevice,
|
||||
_In_opt_ ID3D11DeviceContext* d3dContext,
|
||||
#endif
|
||||
_In_reads_bytes_(ddsDataSize) const uint8_t* ddsData,
|
||||
_In_ size_t ddsDataSize,
|
||||
_In_ size_t maxsize,
|
||||
_In_ D3D11_USAGE usage,
|
||||
_In_ unsigned int bindFlags,
|
||||
_In_ unsigned int cpuAccessFlags,
|
||||
_In_ unsigned int miscFlags,
|
||||
_In_ bool forceSRGB,
|
||||
_Outptr_opt_ ID3D11Resource** texture,
|
||||
_Outptr_opt_ ID3D11ShaderResourceView** textureView,
|
||||
_Out_opt_ DDS_ALPHA_MODE* alphaMode = nullptr);
|
||||
|
||||
HRESULT __cdecl CreateDDSTextureFromFileEx(
|
||||
#if defined(_XBOX_ONE) && defined(_TITLE)
|
||||
_In_ ID3D11DeviceX* d3dDevice,
|
||||
_In_opt_ ID3D11DeviceContextX* d3dContext,
|
||||
#else
|
||||
_In_ ID3D11Device* d3dDevice,
|
||||
_In_opt_ ID3D11DeviceContext* d3dContext,
|
||||
#endif
|
||||
_In_z_ const wchar_t* szFileName,
|
||||
_In_ size_t maxsize,
|
||||
_In_ D3D11_USAGE usage,
|
||||
_In_ unsigned int bindFlags,
|
||||
_In_ unsigned int cpuAccessFlags,
|
||||
_In_ unsigned int miscFlags,
|
||||
_In_ bool forceSRGB,
|
||||
_Outptr_opt_ ID3D11Resource** texture,
|
||||
_Outptr_opt_ ID3D11ShaderResourceView** textureView,
|
||||
_Out_opt_ DDS_ALPHA_MODE* alphaMode = nullptr);
|
||||
//--------------------------------------------------------------------------------------
|
||||
// File: DDSTextureLoader.h
|
||||
//
|
||||
// Functions for loading a DDS texture and creating a Direct3D runtime resource for it
|
||||
//
|
||||
// Note these functions are useful as a light-weight runtime loader for DDS files. For
|
||||
// a full-featured DDS file reader, writer, and texture processing pipeline see
|
||||
// the 'Texconv' sample and the 'DirectXTex' library.
|
||||
//
|
||||
// THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF
|
||||
// ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO
|
||||
// THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A
|
||||
// PARTICULAR PURPOSE.
|
||||
//
|
||||
// Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
//
|
||||
// http://go.microsoft.com/fwlink/?LinkId=248926
|
||||
// http://go.microsoft.com/fwlink/?LinkId=248929
|
||||
//--------------------------------------------------------------------------------------
|
||||
|
||||
#pragma once
|
||||
|
||||
#if defined(_XBOX_ONE) && defined(_TITLE)
|
||||
#include <d3d11_x.h>
|
||||
#else
|
||||
#include <d3d11_1.h>
|
||||
#endif
|
||||
|
||||
#include <stdint.h>
|
||||
|
||||
|
||||
namespace DirectX
|
||||
{
|
||||
enum DDS_ALPHA_MODE
|
||||
{
|
||||
DDS_ALPHA_MODE_UNKNOWN = 0,
|
||||
DDS_ALPHA_MODE_STRAIGHT = 1,
|
||||
DDS_ALPHA_MODE_PREMULTIPLIED = 2,
|
||||
DDS_ALPHA_MODE_OPAQUE = 3,
|
||||
DDS_ALPHA_MODE_CUSTOM = 4,
|
||||
};
|
||||
|
||||
// Standard version
|
||||
HRESULT __cdecl CreateDDSTextureFromMemory(
|
||||
_In_ ID3D11Device* d3dDevice,
|
||||
_In_reads_bytes_(ddsDataSize) const uint8_t* ddsData,
|
||||
_In_ size_t ddsDataSize,
|
||||
_Outptr_opt_ ID3D11Resource** texture,
|
||||
_Outptr_opt_ ID3D11ShaderResourceView** textureView,
|
||||
_In_ size_t maxsize = 0,
|
||||
_Out_opt_ DDS_ALPHA_MODE* alphaMode = nullptr);
|
||||
|
||||
HRESULT __cdecl CreateDDSTextureFromFile(
|
||||
_In_ ID3D11Device* d3dDevice,
|
||||
_In_z_ const wchar_t* szFileName,
|
||||
_Outptr_opt_ ID3D11Resource** texture,
|
||||
_Outptr_opt_ ID3D11ShaderResourceView** textureView,
|
||||
_In_ size_t maxsize = 0,
|
||||
_Out_opt_ DDS_ALPHA_MODE* alphaMode = nullptr);
|
||||
|
||||
// Standard version with optional auto-gen mipmap support
|
||||
HRESULT __cdecl CreateDDSTextureFromMemory(
|
||||
#if defined(_XBOX_ONE) && defined(_TITLE)
|
||||
_In_ ID3D11DeviceX* d3dDevice,
|
||||
_In_opt_ ID3D11DeviceContextX* d3dContext,
|
||||
#else
|
||||
_In_ ID3D11Device* d3dDevice,
|
||||
_In_opt_ ID3D11DeviceContext* d3dContext,
|
||||
#endif
|
||||
_In_reads_bytes_(ddsDataSize) const uint8_t* ddsData,
|
||||
_In_ size_t ddsDataSize,
|
||||
_Outptr_opt_ ID3D11Resource** texture,
|
||||
_Outptr_opt_ ID3D11ShaderResourceView** textureView,
|
||||
_In_ size_t maxsize = 0,
|
||||
_Out_opt_ DDS_ALPHA_MODE* alphaMode = nullptr);
|
||||
|
||||
HRESULT __cdecl CreateDDSTextureFromFile(
|
||||
#if defined(_XBOX_ONE) && defined(_TITLE)
|
||||
_In_ ID3D11DeviceX* d3dDevice,
|
||||
_In_opt_ ID3D11DeviceContextX* d3dContext,
|
||||
#else
|
||||
_In_ ID3D11Device* d3dDevice,
|
||||
_In_opt_ ID3D11DeviceContext* d3dContext,
|
||||
#endif
|
||||
_In_z_ const wchar_t* szFileName,
|
||||
_Outptr_opt_ ID3D11Resource** texture,
|
||||
_Outptr_opt_ ID3D11ShaderResourceView** textureView,
|
||||
_In_ size_t maxsize = 0,
|
||||
_Out_opt_ DDS_ALPHA_MODE* alphaMode = nullptr);
|
||||
|
||||
// Extended version
|
||||
HRESULT __cdecl CreateDDSTextureFromMemoryEx(
|
||||
_In_ ID3D11Device* d3dDevice,
|
||||
_In_reads_bytes_(ddsDataSize) const uint8_t* ddsData,
|
||||
_In_ size_t ddsDataSize,
|
||||
_In_ size_t maxsize,
|
||||
_In_ D3D11_USAGE usage,
|
||||
_In_ unsigned int bindFlags,
|
||||
_In_ unsigned int cpuAccessFlags,
|
||||
_In_ unsigned int miscFlags,
|
||||
_In_ bool forceSRGB,
|
||||
_Outptr_opt_ ID3D11Resource** texture,
|
||||
_Outptr_opt_ ID3D11ShaderResourceView** textureView,
|
||||
_Out_opt_ DDS_ALPHA_MODE* alphaMode = nullptr);
|
||||
|
||||
HRESULT __cdecl CreateDDSTextureFromFileEx(
|
||||
_In_ ID3D11Device* d3dDevice,
|
||||
_In_z_ const wchar_t* szFileName,
|
||||
_In_ size_t maxsize,
|
||||
_In_ D3D11_USAGE usage,
|
||||
_In_ unsigned int bindFlags,
|
||||
_In_ unsigned int cpuAccessFlags,
|
||||
_In_ unsigned int miscFlags,
|
||||
_In_ bool forceSRGB,
|
||||
_Outptr_opt_ ID3D11Resource** texture,
|
||||
_Outptr_opt_ ID3D11ShaderResourceView** textureView,
|
||||
_Out_opt_ DDS_ALPHA_MODE* alphaMode = nullptr);
|
||||
|
||||
// Extended version with optional auto-gen mipmap support
|
||||
HRESULT __cdecl CreateDDSTextureFromMemoryEx(
|
||||
#if defined(_XBOX_ONE) && defined(_TITLE)
|
||||
_In_ ID3D11DeviceX* d3dDevice,
|
||||
_In_opt_ ID3D11DeviceContextX* d3dContext,
|
||||
#else
|
||||
_In_ ID3D11Device* d3dDevice,
|
||||
_In_opt_ ID3D11DeviceContext* d3dContext,
|
||||
#endif
|
||||
_In_reads_bytes_(ddsDataSize) const uint8_t* ddsData,
|
||||
_In_ size_t ddsDataSize,
|
||||
_In_ size_t maxsize,
|
||||
_In_ D3D11_USAGE usage,
|
||||
_In_ unsigned int bindFlags,
|
||||
_In_ unsigned int cpuAccessFlags,
|
||||
_In_ unsigned int miscFlags,
|
||||
_In_ bool forceSRGB,
|
||||
_Outptr_opt_ ID3D11Resource** texture,
|
||||
_Outptr_opt_ ID3D11ShaderResourceView** textureView,
|
||||
_Out_opt_ DDS_ALPHA_MODE* alphaMode = nullptr);
|
||||
|
||||
HRESULT __cdecl CreateDDSTextureFromFileEx(
|
||||
#if defined(_XBOX_ONE) && defined(_TITLE)
|
||||
_In_ ID3D11DeviceX* d3dDevice,
|
||||
_In_opt_ ID3D11DeviceContextX* d3dContext,
|
||||
#else
|
||||
_In_ ID3D11Device* d3dDevice,
|
||||
_In_opt_ ID3D11DeviceContext* d3dContext,
|
||||
#endif
|
||||
_In_z_ const wchar_t* szFileName,
|
||||
_In_ size_t maxsize,
|
||||
_In_ D3D11_USAGE usage,
|
||||
_In_ unsigned int bindFlags,
|
||||
_In_ unsigned int cpuAccessFlags,
|
||||
_In_ unsigned int miscFlags,
|
||||
_In_ bool forceSRGB,
|
||||
_Outptr_opt_ ID3D11Resource** texture,
|
||||
_Outptr_opt_ ID3D11ShaderResourceView** textureView,
|
||||
_Out_opt_ DDS_ALPHA_MODE* alphaMode = nullptr);
|
||||
}
|
|
@ -1,150 +1,150 @@
|
|||
//--------------------------------------------------------------------------------------
|
||||
// File: DirectXHelpers.h
|
||||
//
|
||||
// THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF
|
||||
// ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO
|
||||
// THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A
|
||||
// PARTICULAR PURPOSE.
|
||||
//
|
||||
// Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
//
|
||||
// http://go.microsoft.com/fwlink/?LinkId=248929
|
||||
//--------------------------------------------------------------------------------------
|
||||
|
||||
#pragma once
|
||||
|
||||
#if defined(_XBOX_ONE) && defined(_TITLE)
|
||||
#include <d3d11_x.h>
|
||||
#else
|
||||
#include <d3d11_1.h>
|
||||
#endif
|
||||
|
||||
#if !defined(NO_D3D11_DEBUG_NAME) && ( defined(_DEBUG) || defined(PROFILE) )
|
||||
#if !defined(_XBOX_ONE) || !defined(_TITLE)
|
||||
#pragma comment(lib,"dxguid.lib")
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#ifndef IID_GRAPHICS_PPV_ARGS
|
||||
#define IID_GRAPHICS_PPV_ARGS(x) IID_PPV_ARGS(x)
|
||||
#endif
|
||||
|
||||
#include <exception>
|
||||
#include <stdint.h>
|
||||
|
||||
//
|
||||
// The core Direct3D headers provide the following helper C++ classes
|
||||
// CD3D11_RECT
|
||||
// CD3D11_BOX
|
||||
// CD3D11_DEPTH_STENCIL_DESC
|
||||
// CD3D11_BLEND_DESC, CD3D11_BLEND_DESC1
|
||||
// CD3D11_RASTERIZER_DESC, CD3D11_RASTERIZER_DESC1
|
||||
// CD3D11_BUFFER_DESC
|
||||
// CD3D11_TEXTURE1D_DESC
|
||||
// CD3D11_TEXTURE2D_DESC
|
||||
// CD3D11_TEXTURE3D_DESC
|
||||
// CD3D11_SHADER_RESOURCE_VIEW_DESC
|
||||
// CD3D11_RENDER_TARGET_VIEW_DESC
|
||||
// CD3D11_VIEWPORT
|
||||
// CD3D11_DEPTH_STENCIL_VIEW_DESC
|
||||
// CD3D11_UNORDERED_ACCESS_VIEW_DESC
|
||||
// CD3D11_SAMPLER_DESC
|
||||
// CD3D11_QUERY_DESC
|
||||
// CD3D11_COUNTER_DESC
|
||||
//
|
||||
|
||||
|
||||
namespace DirectX
|
||||
{
|
||||
// simliar to std::lock_guard for exception-safe Direct3D resource locking
|
||||
class MapGuard : public D3D11_MAPPED_SUBRESOURCE
|
||||
{
|
||||
public:
|
||||
MapGuard( _In_ ID3D11DeviceContext* context,
|
||||
_In_ ID3D11Resource *resource,
|
||||
_In_ UINT subresource,
|
||||
_In_ D3D11_MAP mapType,
|
||||
_In_ UINT mapFlags )
|
||||
: mContext(context), mResource(resource), mSubresource(subresource)
|
||||
{
|
||||
HRESULT hr = mContext->Map( resource, subresource, mapType, mapFlags, this );
|
||||
if (FAILED(hr))
|
||||
{
|
||||
throw std::exception();
|
||||
}
|
||||
}
|
||||
|
||||
~MapGuard()
|
||||
{
|
||||
mContext->Unmap( mResource, mSubresource );
|
||||
}
|
||||
|
||||
uint8_t* get() const
|
||||
{
|
||||
return reinterpret_cast<uint8_t*>( pData );
|
||||
}
|
||||
uint8_t* get(size_t slice) const
|
||||
{
|
||||
return reinterpret_cast<uint8_t*>( pData ) + ( slice * DepthPitch );
|
||||
}
|
||||
|
||||
uint8_t* scanline(size_t row) const
|
||||
{
|
||||
return reinterpret_cast<uint8_t*>( pData ) + ( row * RowPitch );
|
||||
}
|
||||
uint8_t* scanline(size_t slice, size_t row) const
|
||||
{
|
||||
return reinterpret_cast<uint8_t*>( pData ) + ( slice * DepthPitch ) + ( row * RowPitch );
|
||||
}
|
||||
|
||||
private:
|
||||
ID3D11DeviceContext* mContext;
|
||||
ID3D11Resource* mResource;
|
||||
UINT mSubresource;
|
||||
|
||||
MapGuard(MapGuard const&);
|
||||
MapGuard& operator= (MapGuard const&);
|
||||
};
|
||||
|
||||
|
||||
// Helper sets a D3D resource name string (used by PIX and debug layer leak reporting).
|
||||
template<UINT TNameLength>
|
||||
inline void SetDebugObjectName(_In_ ID3D11DeviceChild* resource, _In_z_ const char (&name)[TNameLength])
|
||||
{
|
||||
#if !defined(NO_D3D11_DEBUG_NAME) && ( defined(_DEBUG) || defined(PROFILE) )
|
||||
#if defined(_XBOX_ONE) && defined(_TITLE)
|
||||
wchar_t wname[MAX_PATH];
|
||||
int result = MultiByteToWideChar( CP_ACP, MB_PRECOMPOSED, name, TNameLength, wname, MAX_PATH );
|
||||
if ( result > 0 )
|
||||
{
|
||||
resource->SetName( wname );
|
||||
}
|
||||
#else
|
||||
resource->SetPrivateData(WKPDID_D3DDebugObjectName, TNameLength - 1, name);
|
||||
#endif
|
||||
#else
|
||||
UNREFERENCED_PARAMETER(resource);
|
||||
UNREFERENCED_PARAMETER(name);
|
||||
#endif
|
||||
}
|
||||
|
||||
template<UINT TNameLength>
|
||||
inline void SetDebugObjectName(_In_ ID3D11DeviceChild* resource, _In_z_ const wchar_t (&name)[TNameLength])
|
||||
{
|
||||
#if !defined(NO_D3D11_DEBUG_NAME) && ( defined(_DEBUG) || defined(PROFILE) )
|
||||
#if defined(_XBOX_ONE) && defined(_TITLE)
|
||||
resource->SetName( name );
|
||||
#else
|
||||
char aname[MAX_PATH];
|
||||
int result = WideCharToMultiByte( CP_ACP, 0, name, TNameLength, aname, MAX_PATH, nullptr, nullptr );
|
||||
if ( result > 0 )
|
||||
{
|
||||
resource->SetPrivateData(WKPDID_D3DDebugObjectName, TNameLength - 1, aname);
|
||||
}
|
||||
#endif
|
||||
#else
|
||||
UNREFERENCED_PARAMETER(resource);
|
||||
UNREFERENCED_PARAMETER(name);
|
||||
#endif
|
||||
}
|
||||
//--------------------------------------------------------------------------------------
|
||||
// File: DirectXHelpers.h
|
||||
//
|
||||
// THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF
|
||||
// ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO
|
||||
// THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A
|
||||
// PARTICULAR PURPOSE.
|
||||
//
|
||||
// Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
//
|
||||
// http://go.microsoft.com/fwlink/?LinkId=248929
|
||||
//--------------------------------------------------------------------------------------
|
||||
|
||||
#pragma once
|
||||
|
||||
#if defined(_XBOX_ONE) && defined(_TITLE)
|
||||
#include <d3d11_x.h>
|
||||
#else
|
||||
#include <d3d11_1.h>
|
||||
#endif
|
||||
|
||||
#if !defined(NO_D3D11_DEBUG_NAME) && ( defined(_DEBUG) || defined(PROFILE) )
|
||||
#if !defined(_XBOX_ONE) || !defined(_TITLE)
|
||||
#pragma comment(lib,"dxguid.lib")
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#ifndef IID_GRAPHICS_PPV_ARGS
|
||||
#define IID_GRAPHICS_PPV_ARGS(x) IID_PPV_ARGS(x)
|
||||
#endif
|
||||
|
||||
#include <exception>
|
||||
#include <stdint.h>
|
||||
|
||||
//
|
||||
// The core Direct3D headers provide the following helper C++ classes
|
||||
// CD3D11_RECT
|
||||
// CD3D11_BOX
|
||||
// CD3D11_DEPTH_STENCIL_DESC
|
||||
// CD3D11_BLEND_DESC, CD3D11_BLEND_DESC1
|
||||
// CD3D11_RASTERIZER_DESC, CD3D11_RASTERIZER_DESC1
|
||||
// CD3D11_BUFFER_DESC
|
||||
// CD3D11_TEXTURE1D_DESC
|
||||
// CD3D11_TEXTURE2D_DESC
|
||||
// CD3D11_TEXTURE3D_DESC
|
||||
// CD3D11_SHADER_RESOURCE_VIEW_DESC
|
||||
// CD3D11_RENDER_TARGET_VIEW_DESC
|
||||
// CD3D11_VIEWPORT
|
||||
// CD3D11_DEPTH_STENCIL_VIEW_DESC
|
||||
// CD3D11_UNORDERED_ACCESS_VIEW_DESC
|
||||
// CD3D11_SAMPLER_DESC
|
||||
// CD3D11_QUERY_DESC
|
||||
// CD3D11_COUNTER_DESC
|
||||
//
|
||||
|
||||
|
||||
namespace DirectX
|
||||
{
|
||||
// simliar to std::lock_guard for exception-safe Direct3D resource locking
|
||||
class MapGuard : public D3D11_MAPPED_SUBRESOURCE
|
||||
{
|
||||
public:
|
||||
MapGuard( _In_ ID3D11DeviceContext* context,
|
||||
_In_ ID3D11Resource *resource,
|
||||
_In_ UINT subresource,
|
||||
_In_ D3D11_MAP mapType,
|
||||
_In_ UINT mapFlags )
|
||||
: mContext(context), mResource(resource), mSubresource(subresource)
|
||||
{
|
||||
HRESULT hr = mContext->Map( resource, subresource, mapType, mapFlags, this );
|
||||
if (FAILED(hr))
|
||||
{
|
||||
throw std::exception();
|
||||
}
|
||||
}
|
||||
|
||||
~MapGuard()
|
||||
{
|
||||
mContext->Unmap( mResource, mSubresource );
|
||||
}
|
||||
|
||||
uint8_t* get() const
|
||||
{
|
||||
return reinterpret_cast<uint8_t*>( pData );
|
||||
}
|
||||
uint8_t* get(size_t slice) const
|
||||
{
|
||||
return reinterpret_cast<uint8_t*>( pData ) + ( slice * DepthPitch );
|
||||
}
|
||||
|
||||
uint8_t* scanline(size_t row) const
|
||||
{
|
||||
return reinterpret_cast<uint8_t*>( pData ) + ( row * RowPitch );
|
||||
}
|
||||
uint8_t* scanline(size_t slice, size_t row) const
|
||||
{
|
||||
return reinterpret_cast<uint8_t*>( pData ) + ( slice * DepthPitch ) + ( row * RowPitch );
|
||||
}
|
||||
|
||||
private:
|
||||
ID3D11DeviceContext* mContext;
|
||||
ID3D11Resource* mResource;
|
||||
UINT mSubresource;
|
||||
|
||||
MapGuard(MapGuard const&);
|
||||
MapGuard& operator= (MapGuard const&);
|
||||
};
|
||||
|
||||
|
||||
// Helper sets a D3D resource name string (used by PIX and debug layer leak reporting).
|
||||
template<UINT TNameLength>
|
||||
inline void SetDebugObjectName(_In_ ID3D11DeviceChild* resource, _In_z_ const char (&name)[TNameLength])
|
||||
{
|
||||
#if !defined(NO_D3D11_DEBUG_NAME) && ( defined(_DEBUG) || defined(PROFILE) )
|
||||
#if defined(_XBOX_ONE) && defined(_TITLE)
|
||||
wchar_t wname[MAX_PATH];
|
||||
int result = MultiByteToWideChar( CP_ACP, MB_PRECOMPOSED, name, TNameLength, wname, MAX_PATH );
|
||||
if ( result > 0 )
|
||||
{
|
||||
resource->SetName( wname );
|
||||
}
|
||||
#else
|
||||
resource->SetPrivateData(WKPDID_D3DDebugObjectName, TNameLength - 1, name);
|
||||
#endif
|
||||
#else
|
||||
UNREFERENCED_PARAMETER(resource);
|
||||
UNREFERENCED_PARAMETER(name);
|
||||
#endif
|
||||
}
|
||||
|
||||
template<UINT TNameLength>
|
||||
inline void SetDebugObjectName(_In_ ID3D11DeviceChild* resource, _In_z_ const wchar_t (&name)[TNameLength])
|
||||
{
|
||||
#if !defined(NO_D3D11_DEBUG_NAME) && ( defined(_DEBUG) || defined(PROFILE) )
|
||||
#if defined(_XBOX_ONE) && defined(_TITLE)
|
||||
resource->SetName( name );
|
||||
#else
|
||||
char aname[MAX_PATH];
|
||||
int result = WideCharToMultiByte( CP_ACP, 0, name, TNameLength, aname, MAX_PATH, nullptr, nullptr );
|
||||
if ( result > 0 )
|
||||
{
|
||||
resource->SetPrivateData(WKPDID_D3DDebugObjectName, TNameLength - 1, aname);
|
||||
}
|
||||
#endif
|
||||
#else
|
||||
UNREFERENCED_PARAMETER(resource);
|
||||
UNREFERENCED_PARAMETER(name);
|
||||
#endif
|
||||
}
|
||||
}
|
544
Inc/GamePad.h
544
Inc/GamePad.h
|
@ -1,272 +1,272 @@
|
|||
//--------------------------------------------------------------------------------------
|
||||
// File: GamePad.h
|
||||
//
|
||||
// THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF
|
||||
// ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO
|
||||
// THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A
|
||||
// PARTICULAR PURPOSE.
|
||||
//
|
||||
// Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
//
|
||||
// http://go.microsoft.com/fwlink/?LinkId=248929
|
||||
//--------------------------------------------------------------------------------------
|
||||
|
||||
#pragma once
|
||||
|
||||
#if (_WIN32_WINNT < 0x0A00 /*_WIN32_WINNT_WIN10*/)
|
||||
#ifndef _XBOX_ONE
|
||||
#if !defined(WINAPI_FAMILY) || (WINAPI_FAMILY != WINAPI_FAMILY_PHONE_APP)
|
||||
#if (_WIN32_WINNT >= 0x0602 /*_WIN32_WINNT_WIN8*/ )
|
||||
#pragma comment(lib,"xinput.lib")
|
||||
#else
|
||||
#pragma comment(lib,"xinput9_1_0.lib")
|
||||
#endif
|
||||
#endif
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#include <memory>
|
||||
#include <stdint.h>
|
||||
|
||||
#if (_WIN32_WINNT >= _WIN32_WINNT_WIN10)
|
||||
#include <string>
|
||||
#endif
|
||||
|
||||
|
||||
namespace DirectX
|
||||
{
|
||||
class GamePad
|
||||
{
|
||||
public:
|
||||
GamePad();
|
||||
GamePad(GamePad&& moveFrom);
|
||||
GamePad& operator= (GamePad&& moveFrom);
|
||||
|
||||
GamePad(GamePad const&) = delete;
|
||||
GamePad& operator=(GamePad const&) = delete;
|
||||
|
||||
virtual ~GamePad();
|
||||
|
||||
#if (_WIN32_WINNT >= 0x0A00 /*_WIN32_WINNT_WIN10*/ ) || defined(_XBOX_ONE)
|
||||
static const int MAX_PLAYER_COUNT = 8;
|
||||
#else
|
||||
static const int MAX_PLAYER_COUNT = 4;
|
||||
#endif
|
||||
|
||||
enum DeadZone
|
||||
{
|
||||
DEAD_ZONE_INDEPENDENT_AXES = 0,
|
||||
DEAD_ZONE_CIRCULAR,
|
||||
DEAD_ZONE_NONE,
|
||||
};
|
||||
|
||||
struct Buttons
|
||||
{
|
||||
bool a;
|
||||
bool b;
|
||||
bool x;
|
||||
bool y;
|
||||
bool leftStick;
|
||||
bool rightStick;
|
||||
bool leftShoulder;
|
||||
bool rightShoulder;
|
||||
union
|
||||
{
|
||||
bool back;
|
||||
bool view;
|
||||
};
|
||||
union
|
||||
{
|
||||
bool start;
|
||||
bool menu;
|
||||
};
|
||||
};
|
||||
|
||||
struct DPad
|
||||
{
|
||||
bool up;
|
||||
bool down;
|
||||
bool right;
|
||||
bool left;
|
||||
};
|
||||
|
||||
struct ThumbSticks
|
||||
{
|
||||
float leftX;
|
||||
float leftY;
|
||||
float rightX;
|
||||
float rightY;
|
||||
};
|
||||
|
||||
struct Triggers
|
||||
{
|
||||
float left;
|
||||
float right;
|
||||
};
|
||||
|
||||
struct State
|
||||
{
|
||||
bool connected;
|
||||
uint64_t packet;
|
||||
Buttons buttons;
|
||||
DPad dpad;
|
||||
ThumbSticks thumbSticks;
|
||||
Triggers triggers;
|
||||
|
||||
bool __cdecl IsConnected() const { return connected; }
|
||||
|
||||
// Is the button pressed currently?
|
||||
bool __cdecl IsAPressed() const { return buttons.a; }
|
||||
bool __cdecl IsBPressed() const { return buttons.b; }
|
||||
bool __cdecl IsXPressed() const { return buttons.x; }
|
||||
bool __cdecl IsYPressed() const { return buttons.y; }
|
||||
|
||||
bool __cdecl IsLeftStickPressed() const { return buttons.leftStick; }
|
||||
bool __cdecl IsRightStickPressed() const { return buttons.rightStick; }
|
||||
|
||||
bool __cdecl IsLeftShoulderPressed() const { return buttons.leftShoulder; }
|
||||
bool __cdecl IsRightShoulderPressed() const { return buttons.rightShoulder; }
|
||||
|
||||
bool __cdecl IsBackPressed() const { return buttons.back; }
|
||||
bool __cdecl IsViewPressed() const { return buttons.view; }
|
||||
bool __cdecl IsStartPressed() const { return buttons.start; }
|
||||
bool __cdecl IsMenuPressed() const { return buttons.menu; }
|
||||
|
||||
bool __cdecl IsDPadDownPressed() const { return dpad.down; };
|
||||
bool __cdecl IsDPadUpPressed() const { return dpad.up; };
|
||||
bool __cdecl IsDPadLeftPressed() const { return dpad.left; };
|
||||
bool __cdecl IsDPadRightPressed() const { return dpad.right; };
|
||||
|
||||
bool __cdecl IsLeftThumbStickUp() const { return (thumbSticks.leftY > 0.5f) != 0; }
|
||||
bool __cdecl IsLeftThumbStickDown() const { return (thumbSticks.leftY < -0.5f) != 0; }
|
||||
bool __cdecl IsLeftThumbStickLeft() const { return (thumbSticks.leftX < -0.5f) != 0; }
|
||||
bool __cdecl IsLeftThumbStickRight() const { return (thumbSticks.leftX > 0.5f) != 0; }
|
||||
|
||||
bool __cdecl IsRightThumbStickUp() const { return (thumbSticks.rightY > 0.5f ) != 0; }
|
||||
bool __cdecl IsRightThumbStickDown() const { return (thumbSticks.rightY < -0.5f) != 0; }
|
||||
bool __cdecl IsRightThumbStickLeft() const { return (thumbSticks.rightX < -0.5f) != 0; }
|
||||
bool __cdecl IsRightThumbStickRight() const { return (thumbSticks.rightX > 0.5f) != 0; }
|
||||
|
||||
bool __cdecl IsLeftTriggerPressed() const { return (triggers.left > 0.5f) != 0; }
|
||||
bool __cdecl IsRightTriggerPressed() const { return (triggers.right > 0.5f) != 0; }
|
||||
};
|
||||
|
||||
struct Capabilities
|
||||
{
|
||||
enum Type
|
||||
{
|
||||
UNKNOWN = 0,
|
||||
GAMEPAD,
|
||||
WHEEL,
|
||||
ARCADE_STICK,
|
||||
FLIGHT_STICK,
|
||||
DANCE_PAD,
|
||||
GUITAR,
|
||||
GUITAR_ALTERNATE,
|
||||
DRUM_KIT,
|
||||
GUITAR_BASS = 11,
|
||||
ARCADE_PAD = 19,
|
||||
};
|
||||
|
||||
bool connected;
|
||||
Type gamepadType;
|
||||
#if (_WIN32_WINNT >= 0x0A00 /*_WIN32_WINNT_WIN10*/)
|
||||
std::wstring id;
|
||||
#else
|
||||
uint64_t id;
|
||||
#endif
|
||||
|
||||
bool __cdecl IsConnected() const { return connected; }
|
||||
};
|
||||
|
||||
class ButtonStateTracker
|
||||
{
|
||||
public:
|
||||
enum ButtonState
|
||||
{
|
||||
UP = 0, // Button is up
|
||||
HELD = 1, // Button is held down
|
||||
RELEASED = 2, // Button was just released
|
||||
PRESSED = 3, // Buton was just pressed
|
||||
};
|
||||
|
||||
ButtonState a;
|
||||
ButtonState b;
|
||||
ButtonState x;
|
||||
ButtonState y;
|
||||
|
||||
ButtonState leftStick;
|
||||
ButtonState rightStick;
|
||||
|
||||
ButtonState leftShoulder;
|
||||
ButtonState rightShoulder;
|
||||
|
||||
union
|
||||
{
|
||||
ButtonState back;
|
||||
ButtonState view;
|
||||
};
|
||||
|
||||
union
|
||||
{
|
||||
ButtonState start;
|
||||
ButtonState menu;
|
||||
};
|
||||
|
||||
ButtonState dpadUp;
|
||||
ButtonState dpadDown;
|
||||
ButtonState dpadLeft;
|
||||
ButtonState dpadRight;
|
||||
|
||||
ButtonState leftStickUp;
|
||||
ButtonState leftStickDown;
|
||||
ButtonState leftStickLeft;
|
||||
ButtonState leftStickRight;
|
||||
|
||||
ButtonState rightStickUp;
|
||||
ButtonState rightStickDown;
|
||||
ButtonState rightStickLeft;
|
||||
ButtonState rightStickRight;
|
||||
|
||||
ButtonState leftTrigger;
|
||||
ButtonState rightTrigger;
|
||||
|
||||
ButtonStateTracker() { Reset(); }
|
||||
|
||||
void __cdecl Update( const State& state );
|
||||
|
||||
void __cdecl Reset();
|
||||
|
||||
State __cdecl GetLastState() const { return lastState; }
|
||||
|
||||
private:
|
||||
State lastState;
|
||||
};
|
||||
|
||||
// Retrieve the current state of the gamepad of the associated player index
|
||||
State __cdecl GetState(int player, DeadZone deadZoneMode = DEAD_ZONE_INDEPENDENT_AXES);
|
||||
|
||||
// Retrieve the current capabilities of the gamepad of the associated player index
|
||||
Capabilities __cdecl GetCapabilities(int player);
|
||||
|
||||
// Set the vibration motor speeds of the gamepad
|
||||
bool __cdecl SetVibration( int player, float leftMotor, float rightMotor, float leftTrigger = 0.f, float rightTrigger = 0.f );
|
||||
|
||||
// Handle suspending/resuming
|
||||
void __cdecl Suspend();
|
||||
void __cdecl Resume();
|
||||
|
||||
#if (_WIN32_WINNT >= 0x0A00 /*_WIN32_WINNT_WIN10*/ ) || defined(_XBOX_ONE)
|
||||
void __cdecl RegisterEvents(void* ctrlChanged, void* userChanged);
|
||||
#endif
|
||||
|
||||
// Singleton
|
||||
static GamePad& __cdecl Get();
|
||||
|
||||
private:
|
||||
// Private implementation.
|
||||
class Impl;
|
||||
|
||||
std::unique_ptr<Impl> pImpl;
|
||||
};
|
||||
}
|
||||
//--------------------------------------------------------------------------------------
|
||||
// File: GamePad.h
|
||||
//
|
||||
// THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF
|
||||
// ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO
|
||||
// THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A
|
||||
// PARTICULAR PURPOSE.
|
||||
//
|
||||
// Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
//
|
||||
// http://go.microsoft.com/fwlink/?LinkId=248929
|
||||
//--------------------------------------------------------------------------------------
|
||||
|
||||
#pragma once
|
||||
|
||||
#if (_WIN32_WINNT < 0x0A00 /*_WIN32_WINNT_WIN10*/)
|
||||
#ifndef _XBOX_ONE
|
||||
#if !defined(WINAPI_FAMILY) || (WINAPI_FAMILY != WINAPI_FAMILY_PHONE_APP)
|
||||
#if (_WIN32_WINNT >= 0x0602 /*_WIN32_WINNT_WIN8*/ )
|
||||
#pragma comment(lib,"xinput.lib")
|
||||
#else
|
||||
#pragma comment(lib,"xinput9_1_0.lib")
|
||||
#endif
|
||||
#endif
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#include <memory>
|
||||
#include <stdint.h>
|
||||
|
||||
#if (_WIN32_WINNT >= _WIN32_WINNT_WIN10)
|
||||
#include <string>
|
||||
#endif
|
||||
|
||||
|
||||
namespace DirectX
|
||||
{
|
||||
class GamePad
|
||||
{
|
||||
public:
|
||||
GamePad();
|
||||
GamePad(GamePad&& moveFrom);
|
||||
GamePad& operator= (GamePad&& moveFrom);
|
||||
|
||||
GamePad(GamePad const&) = delete;
|
||||
GamePad& operator=(GamePad const&) = delete;
|
||||
|
||||
virtual ~GamePad();
|
||||
|
||||
#if (_WIN32_WINNT >= 0x0A00 /*_WIN32_WINNT_WIN10*/ ) || defined(_XBOX_ONE)
|
||||
static const int MAX_PLAYER_COUNT = 8;
|
||||
#else
|
||||
static const int MAX_PLAYER_COUNT = 4;
|
||||
#endif
|
||||
|
||||
enum DeadZone
|
||||
{
|
||||
DEAD_ZONE_INDEPENDENT_AXES = 0,
|
||||
DEAD_ZONE_CIRCULAR,
|
||||
DEAD_ZONE_NONE,
|
||||
};
|
||||
|
||||
struct Buttons
|
||||
{
|
||||
bool a;
|
||||
bool b;
|
||||
bool x;
|
||||
bool y;
|
||||
bool leftStick;
|
||||
bool rightStick;
|
||||
bool leftShoulder;
|
||||
bool rightShoulder;
|
||||
union
|
||||
{
|
||||
bool back;
|
||||
bool view;
|
||||
};
|
||||
union
|
||||
{
|
||||
bool start;
|
||||
bool menu;
|
||||
};
|
||||
};
|
||||
|
||||
struct DPad
|
||||
{
|
||||
bool up;
|
||||
bool down;
|
||||
bool right;
|
||||
bool left;
|
||||
};
|
||||
|
||||
struct ThumbSticks
|
||||
{
|
||||
float leftX;
|
||||
float leftY;
|
||||
float rightX;
|
||||
float rightY;
|
||||
};
|
||||
|
||||
struct Triggers
|
||||
{
|
||||
float left;
|
||||
float right;
|
||||
};
|
||||
|
||||
struct State
|
||||
{
|
||||
bool connected;
|
||||
uint64_t packet;
|
||||
Buttons buttons;
|
||||
DPad dpad;
|
||||
ThumbSticks thumbSticks;
|
||||
Triggers triggers;
|
||||
|
||||
bool __cdecl IsConnected() const { return connected; }
|
||||
|
||||
// Is the button pressed currently?
|
||||
bool __cdecl IsAPressed() const { return buttons.a; }
|
||||
bool __cdecl IsBPressed() const { return buttons.b; }
|
||||
bool __cdecl IsXPressed() const { return buttons.x; }
|
||||
bool __cdecl IsYPressed() const { return buttons.y; }
|
||||
|
||||
bool __cdecl IsLeftStickPressed() const { return buttons.leftStick; }
|
||||
bool __cdecl IsRightStickPressed() const { return buttons.rightStick; }
|
||||
|
||||
bool __cdecl IsLeftShoulderPressed() const { return buttons.leftShoulder; }
|
||||
bool __cdecl IsRightShoulderPressed() const { return buttons.rightShoulder; }
|
||||
|
||||
bool __cdecl IsBackPressed() const { return buttons.back; }
|
||||
bool __cdecl IsViewPressed() const { return buttons.view; }
|
||||
bool __cdecl IsStartPressed() const { return buttons.start; }
|
||||
bool __cdecl IsMenuPressed() const { return buttons.menu; }
|
||||
|
||||
bool __cdecl IsDPadDownPressed() const { return dpad.down; };
|
||||
bool __cdecl IsDPadUpPressed() const { return dpad.up; };
|
||||
bool __cdecl IsDPadLeftPressed() const { return dpad.left; };
|
||||
bool __cdecl IsDPadRightPressed() const { return dpad.right; };
|
||||
|
||||
bool __cdecl IsLeftThumbStickUp() const { return (thumbSticks.leftY > 0.5f) != 0; }
|
||||
bool __cdecl IsLeftThumbStickDown() const { return (thumbSticks.leftY < -0.5f) != 0; }
|
||||
bool __cdecl IsLeftThumbStickLeft() const { return (thumbSticks.leftX < -0.5f) != 0; }
|
||||
bool __cdecl IsLeftThumbStickRight() const { return (thumbSticks.leftX > 0.5f) != 0; }
|
||||
|
||||
bool __cdecl IsRightThumbStickUp() const { return (thumbSticks.rightY > 0.5f ) != 0; }
|
||||
bool __cdecl IsRightThumbStickDown() const { return (thumbSticks.rightY < -0.5f) != 0; }
|
||||
bool __cdecl IsRightThumbStickLeft() const { return (thumbSticks.rightX < -0.5f) != 0; }
|
||||
bool __cdecl IsRightThumbStickRight() const { return (thumbSticks.rightX > 0.5f) != 0; }
|
||||
|
||||
bool __cdecl IsLeftTriggerPressed() const { return (triggers.left > 0.5f) != 0; }
|
||||
bool __cdecl IsRightTriggerPressed() const { return (triggers.right > 0.5f) != 0; }
|
||||
};
|
||||
|
||||
struct Capabilities
|
||||
{
|
||||
enum Type
|
||||
{
|
||||
UNKNOWN = 0,
|
||||
GAMEPAD,
|
||||
WHEEL,
|
||||
ARCADE_STICK,
|
||||
FLIGHT_STICK,
|
||||
DANCE_PAD,
|
||||
GUITAR,
|
||||
GUITAR_ALTERNATE,
|
||||
DRUM_KIT,
|
||||
GUITAR_BASS = 11,
|
||||
ARCADE_PAD = 19,
|
||||
};
|
||||
|
||||
bool connected;
|
||||
Type gamepadType;
|
||||
#if (_WIN32_WINNT >= 0x0A00 /*_WIN32_WINNT_WIN10*/)
|
||||
std::wstring id;
|
||||
#else
|
||||
uint64_t id;
|
||||
#endif
|
||||
|
||||
bool __cdecl IsConnected() const { return connected; }
|
||||
};
|
||||
|
||||
class ButtonStateTracker
|
||||
{
|
||||
public:
|
||||
enum ButtonState
|
||||
{
|
||||
UP = 0, // Button is up
|
||||
HELD = 1, // Button is held down
|
||||
RELEASED = 2, // Button was just released
|
||||
PRESSED = 3, // Buton was just pressed
|
||||
};
|
||||
|
||||
ButtonState a;
|
||||
ButtonState b;
|
||||
ButtonState x;
|
||||
ButtonState y;
|
||||
|
||||
ButtonState leftStick;
|
||||
ButtonState rightStick;
|
||||
|
||||
ButtonState leftShoulder;
|
||||
ButtonState rightShoulder;
|
||||
|
||||
union
|
||||
{
|
||||
ButtonState back;
|
||||
ButtonState view;
|
||||
};
|
||||
|
||||
union
|
||||
{
|
||||
ButtonState start;
|
||||
ButtonState menu;
|
||||
};
|
||||
|
||||
ButtonState dpadUp;
|
||||
ButtonState dpadDown;
|
||||
ButtonState dpadLeft;
|
||||
ButtonState dpadRight;
|
||||
|
||||
ButtonState leftStickUp;
|
||||
ButtonState leftStickDown;
|
||||
ButtonState leftStickLeft;
|
||||
ButtonState leftStickRight;
|
||||
|
||||
ButtonState rightStickUp;
|
||||
ButtonState rightStickDown;
|
||||
ButtonState rightStickLeft;
|
||||
ButtonState rightStickRight;
|
||||
|
||||
ButtonState leftTrigger;
|
||||
ButtonState rightTrigger;
|
||||
|
||||
ButtonStateTracker() { Reset(); }
|
||||
|
||||
void __cdecl Update( const State& state );
|
||||
|
||||
void __cdecl Reset();
|
||||
|
||||
State __cdecl GetLastState() const { return lastState; }
|
||||
|
||||
private:
|
||||
State lastState;
|
||||
};
|
||||
|
||||
// Retrieve the current state of the gamepad of the associated player index
|
||||
State __cdecl GetState(int player, DeadZone deadZoneMode = DEAD_ZONE_INDEPENDENT_AXES);
|
||||
|
||||
// Retrieve the current capabilities of the gamepad of the associated player index
|
||||
Capabilities __cdecl GetCapabilities(int player);
|
||||
|
||||
// Set the vibration motor speeds of the gamepad
|
||||
bool __cdecl SetVibration( int player, float leftMotor, float rightMotor, float leftTrigger = 0.f, float rightTrigger = 0.f );
|
||||
|
||||
// Handle suspending/resuming
|
||||
void __cdecl Suspend();
|
||||
void __cdecl Resume();
|
||||
|
||||
#if (_WIN32_WINNT >= 0x0A00 /*_WIN32_WINNT_WIN10*/ ) || defined(_XBOX_ONE)
|
||||
void __cdecl RegisterEvents(void* ctrlChanged, void* userChanged);
|
||||
#endif
|
||||
|
||||
// Singleton
|
||||
static GamePad& __cdecl Get();
|
||||
|
||||
private:
|
||||
// Private implementation.
|
||||
class Impl;
|
||||
|
||||
std::unique_ptr<Impl> pImpl;
|
||||
};
|
||||
}
|
||||
|
|
|
@ -1,56 +1,56 @@
|
|||
//--------------------------------------------------------------------------------------
|
||||
// File: GraphicsMemory.h
|
||||
//
|
||||
// THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF
|
||||
// ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO
|
||||
// THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A
|
||||
// PARTICULAR PURPOSE.
|
||||
//
|
||||
// Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
//
|
||||
// http://go.microsoft.com/fwlink/?LinkId=248929
|
||||
//--------------------------------------------------------------------------------------
|
||||
|
||||
#pragma once
|
||||
|
||||
#if defined(_XBOX_ONE) && defined(_TITLE)
|
||||
#include <d3d11_x.h>
|
||||
#else
|
||||
#include <d3d11_1.h>
|
||||
#endif
|
||||
|
||||
#include <memory>
|
||||
|
||||
|
||||
namespace DirectX
|
||||
{
|
||||
class GraphicsMemory
|
||||
{
|
||||
public:
|
||||
#if defined(_XBOX_ONE) && defined(_TITLE)
|
||||
GraphicsMemory(_In_ ID3D11DeviceX* device, UINT backBufferCount = 2);
|
||||
#else
|
||||
GraphicsMemory(_In_ ID3D11Device* device, UINT backBufferCount = 2);
|
||||
#endif
|
||||
GraphicsMemory(GraphicsMemory&& moveFrom);
|
||||
GraphicsMemory& operator= (GraphicsMemory&& moveFrom);
|
||||
|
||||
GraphicsMemory(GraphicsMemory const&) = delete;
|
||||
GraphicsMemory& operator=(GraphicsMemory const&) = delete;
|
||||
|
||||
virtual ~GraphicsMemory();
|
||||
|
||||
void* __cdecl Allocate(_In_opt_ ID3D11DeviceContext* context, size_t size, int alignment);
|
||||
|
||||
void __cdecl Commit();
|
||||
|
||||
// Singleton
|
||||
static GraphicsMemory& __cdecl Get();
|
||||
|
||||
private:
|
||||
// Private implementation.
|
||||
class Impl;
|
||||
|
||||
std::unique_ptr<Impl> pImpl;
|
||||
};
|
||||
}
|
||||
//--------------------------------------------------------------------------------------
|
||||
// File: GraphicsMemory.h
|
||||
//
|
||||
// THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF
|
||||
// ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO
|
||||
// THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A
|
||||
// PARTICULAR PURPOSE.
|
||||
//
|
||||
// Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
//
|
||||
// http://go.microsoft.com/fwlink/?LinkId=248929
|
||||
//--------------------------------------------------------------------------------------
|
||||
|
||||
#pragma once
|
||||
|
||||
#if defined(_XBOX_ONE) && defined(_TITLE)
|
||||
#include <d3d11_x.h>
|
||||
#else
|
||||
#include <d3d11_1.h>
|
||||
#endif
|
||||
|
||||
#include <memory>
|
||||
|
||||
|
||||
namespace DirectX
|
||||
{
|
||||
class GraphicsMemory
|
||||
{
|
||||
public:
|
||||
#if defined(_XBOX_ONE) && defined(_TITLE)
|
||||
GraphicsMemory(_In_ ID3D11DeviceX* device, UINT backBufferCount = 2);
|
||||
#else
|
||||
GraphicsMemory(_In_ ID3D11Device* device, UINT backBufferCount = 2);
|
||||
#endif
|
||||
GraphicsMemory(GraphicsMemory&& moveFrom);
|
||||
GraphicsMemory& operator= (GraphicsMemory&& moveFrom);
|
||||
|
||||
GraphicsMemory(GraphicsMemory const&) = delete;
|
||||
GraphicsMemory& operator=(GraphicsMemory const&) = delete;
|
||||
|
||||
virtual ~GraphicsMemory();
|
||||
|
||||
void* __cdecl Allocate(_In_opt_ ID3D11DeviceContext* context, size_t size, int alignment);
|
||||
|
||||
void __cdecl Commit();
|
||||
|
||||
// Singleton
|
||||
static GraphicsMemory& __cdecl Get();
|
||||
|
||||
private:
|
||||
// Private implementation.
|
||||
class Impl;
|
||||
|
||||
std::unique_ptr<Impl> pImpl;
|
||||
};
|
||||
}
|
||||
|
|
|
@ -1,143 +1,143 @@
|
|||
//--------------------------------------------------------------------------------------
|
||||
// File: PrimitiveBatch.h
|
||||
//
|
||||
// THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF
|
||||
// ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO
|
||||
// THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A
|
||||
// PARTICULAR PURPOSE.
|
||||
//
|
||||
// Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
//
|
||||
// http://go.microsoft.com/fwlink/?LinkId=248929
|
||||
//--------------------------------------------------------------------------------------
|
||||
|
||||
#pragma once
|
||||
|
||||
#if defined(_XBOX_ONE) && defined(_TITLE)
|
||||
#include <d3d11_x.h>
|
||||
#else
|
||||
#include <d3d11_1.h>
|
||||
#endif
|
||||
|
||||
#include <memory>
|
||||
#include <utility>
|
||||
#include <stdint.h>
|
||||
|
||||
|
||||
namespace DirectX
|
||||
{
|
||||
namespace Internal
|
||||
{
|
||||
// Base class, not to be used directly: clients should access this via the derived PrimitiveBatch<T>.
|
||||
class PrimitiveBatchBase
|
||||
{
|
||||
protected:
|
||||
PrimitiveBatchBase(_In_ ID3D11DeviceContext* deviceContext, size_t maxIndices, size_t maxVertices, size_t vertexSize);
|
||||
PrimitiveBatchBase(PrimitiveBatchBase&& moveFrom);
|
||||
PrimitiveBatchBase& operator= (PrimitiveBatchBase&& moveFrom);
|
||||
|
||||
PrimitiveBatchBase(PrimitiveBatchBase const&) = delete;
|
||||
PrimitiveBatchBase& operator= (PrimitiveBatchBase const&) = delete;
|
||||
|
||||
virtual ~PrimitiveBatchBase();
|
||||
|
||||
public:
|
||||
// Begin/End a batch of primitive drawing operations.
|
||||
void __cdecl Begin();
|
||||
void __cdecl End();
|
||||
|
||||
protected:
|
||||
// Internal, untyped drawing method.
|
||||
void __cdecl Draw(D3D11_PRIMITIVE_TOPOLOGY topology, bool isIndexed, _In_opt_count_(indexCount) uint16_t const* indices, size_t indexCount, size_t vertexCount, _Out_ void** pMappedVertices);
|
||||
|
||||
private:
|
||||
// Private implementation.
|
||||
class Impl;
|
||||
|
||||
std::unique_ptr<Impl> pImpl;
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
// Template makes the API typesafe, eg. PrimitiveBatch<VertexPositionColor>.
|
||||
template<typename TVertex>
|
||||
class PrimitiveBatch : public Internal::PrimitiveBatchBase
|
||||
{
|
||||
static const size_t DefaultBatchSize = 2048;
|
||||
|
||||
public:
|
||||
explicit PrimitiveBatch(_In_ ID3D11DeviceContext* deviceContext, size_t maxIndices = DefaultBatchSize * 3, size_t maxVertices = DefaultBatchSize)
|
||||
: PrimitiveBatchBase(deviceContext, maxIndices, maxVertices, sizeof(TVertex))
|
||||
{ }
|
||||
|
||||
PrimitiveBatch(PrimitiveBatch&& moveFrom)
|
||||
: PrimitiveBatchBase(std::move(moveFrom))
|
||||
{ }
|
||||
|
||||
PrimitiveBatch& operator= (PrimitiveBatch&& moveFrom)
|
||||
{
|
||||
PrimitiveBatchBase::operator=(std::move(moveFrom));
|
||||
return *this;
|
||||
}
|
||||
|
||||
|
||||
// Similar to the D3D9 API DrawPrimitiveUP.
|
||||
void Draw(D3D11_PRIMITIVE_TOPOLOGY topology, _In_reads_(vertexCount) TVertex const* vertices, size_t vertexCount)
|
||||
{
|
||||
void* mappedVertices;
|
||||
|
||||
PrimitiveBatchBase::Draw(topology, false, nullptr, 0, vertexCount, &mappedVertices);
|
||||
|
||||
memcpy(mappedVertices, vertices, vertexCount * sizeof(TVertex));
|
||||
}
|
||||
|
||||
|
||||
// Similar to the D3D9 API DrawIndexedPrimitiveUP.
|
||||
void DrawIndexed(D3D11_PRIMITIVE_TOPOLOGY topology, _In_reads_(indexCount) uint16_t const* indices, size_t indexCount, _In_reads_(vertexCount) TVertex const* vertices, size_t vertexCount)
|
||||
{
|
||||
void* mappedVertices;
|
||||
|
||||
PrimitiveBatchBase::Draw(topology, true, indices, indexCount, vertexCount, &mappedVertices);
|
||||
|
||||
memcpy(mappedVertices, vertices, vertexCount * sizeof(TVertex));
|
||||
}
|
||||
|
||||
|
||||
void DrawLine(TVertex const& v1, TVertex const& v2)
|
||||
{
|
||||
TVertex* mappedVertices;
|
||||
|
||||
PrimitiveBatchBase::Draw(D3D11_PRIMITIVE_TOPOLOGY_LINELIST, false, nullptr, 0, 2, reinterpret_cast<void**>(&mappedVertices));
|
||||
|
||||
mappedVertices[0] = v1;
|
||||
mappedVertices[1] = v2;
|
||||
}
|
||||
|
||||
|
||||
void DrawTriangle(TVertex const& v1, TVertex const& v2, TVertex const& v3)
|
||||
{
|
||||
TVertex* mappedVertices;
|
||||
|
||||
PrimitiveBatchBase::Draw(D3D11_PRIMITIVE_TOPOLOGY_TRIANGLELIST, false, nullptr, 0, 3, reinterpret_cast<void**>(&mappedVertices));
|
||||
|
||||
mappedVertices[0] = v1;
|
||||
mappedVertices[1] = v2;
|
||||
mappedVertices[2] = v3;
|
||||
}
|
||||
|
||||
|
||||
void DrawQuad(TVertex const& v1, TVertex const& v2, TVertex const& v3, TVertex const& v4)
|
||||
{
|
||||
static const uint16_t quadIndices[] = { 0, 1, 2, 0, 2, 3 };
|
||||
|
||||
TVertex* mappedVertices;
|
||||
|
||||
PrimitiveBatchBase::Draw(D3D11_PRIMITIVE_TOPOLOGY_TRIANGLELIST, true, quadIndices, 6, 4, reinterpret_cast<void**>(&mappedVertices));
|
||||
|
||||
mappedVertices[0] = v1;
|
||||
mappedVertices[1] = v2;
|
||||
mappedVertices[2] = v3;
|
||||
mappedVertices[3] = v4;
|
||||
}
|
||||
};
|
||||
}
|
||||
//--------------------------------------------------------------------------------------
|
||||
// File: PrimitiveBatch.h
|
||||
//
|
||||
// THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF
|
||||
// ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO
|
||||
// THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A
|
||||
// PARTICULAR PURPOSE.
|
||||
//
|
||||
// Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
//
|
||||
// http://go.microsoft.com/fwlink/?LinkId=248929
|
||||
//--------------------------------------------------------------------------------------
|
||||
|
||||
#pragma once
|
||||
|
||||
#if defined(_XBOX_ONE) && defined(_TITLE)
|
||||
#include <d3d11_x.h>
|
||||
#else
|
||||
#include <d3d11_1.h>
|
||||
#endif
|
||||
|
||||
#include <memory>
|
||||
#include <utility>
|
||||
#include <stdint.h>
|
||||
|
||||
|
||||
namespace DirectX
|
||||
{
|
||||
namespace Internal
|
||||
{
|
||||
// Base class, not to be used directly: clients should access this via the derived PrimitiveBatch<T>.
|
||||
class PrimitiveBatchBase
|
||||
{
|
||||
protected:
|
||||
PrimitiveBatchBase(_In_ ID3D11DeviceContext* deviceContext, size_t maxIndices, size_t maxVertices, size_t vertexSize);
|
||||
PrimitiveBatchBase(PrimitiveBatchBase&& moveFrom);
|
||||
PrimitiveBatchBase& operator= (PrimitiveBatchBase&& moveFrom);
|
||||
|
||||
PrimitiveBatchBase(PrimitiveBatchBase const&) = delete;
|
||||
PrimitiveBatchBase& operator= (PrimitiveBatchBase const&) = delete;
|
||||
|
||||
virtual ~PrimitiveBatchBase();
|
||||
|
||||
public:
|
||||
// Begin/End a batch of primitive drawing operations.
|
||||
void __cdecl Begin();
|
||||
void __cdecl End();
|
||||
|
||||
protected:
|
||||
// Internal, untyped drawing method.
|
||||
void __cdecl Draw(D3D11_PRIMITIVE_TOPOLOGY topology, bool isIndexed, _In_opt_count_(indexCount) uint16_t const* indices, size_t indexCount, size_t vertexCount, _Out_ void** pMappedVertices);
|
||||
|
||||
private:
|
||||
// Private implementation.
|
||||
class Impl;
|
||||
|
||||
std::unique_ptr<Impl> pImpl;
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
// Template makes the API typesafe, eg. PrimitiveBatch<VertexPositionColor>.
|
||||
template<typename TVertex>
|
||||
class PrimitiveBatch : public Internal::PrimitiveBatchBase
|
||||
{
|
||||
static const size_t DefaultBatchSize = 2048;
|
||||
|
||||
public:
|
||||
explicit PrimitiveBatch(_In_ ID3D11DeviceContext* deviceContext, size_t maxIndices = DefaultBatchSize * 3, size_t maxVertices = DefaultBatchSize)
|
||||
: PrimitiveBatchBase(deviceContext, maxIndices, maxVertices, sizeof(TVertex))
|
||||
{ }
|
||||
|
||||
PrimitiveBatch(PrimitiveBatch&& moveFrom)
|
||||
: PrimitiveBatchBase(std::move(moveFrom))
|
||||
{ }
|
||||
|
||||
PrimitiveBatch& operator= (PrimitiveBatch&& moveFrom)
|
||||
{
|
||||
PrimitiveBatchBase::operator=(std::move(moveFrom));
|
||||
return *this;
|
||||
}
|
||||
|
||||
|
||||
// Similar to the D3D9 API DrawPrimitiveUP.
|
||||
void Draw(D3D11_PRIMITIVE_TOPOLOGY topology, _In_reads_(vertexCount) TVertex const* vertices, size_t vertexCount)
|
||||
{
|
||||
void* mappedVertices;
|
||||
|
||||
PrimitiveBatchBase::Draw(topology, false, nullptr, 0, vertexCount, &mappedVertices);
|
||||
|
||||
memcpy(mappedVertices, vertices, vertexCount * sizeof(TVertex));
|
||||
}
|
||||
|
||||
|
||||
// Similar to the D3D9 API DrawIndexedPrimitiveUP.
|
||||
void DrawIndexed(D3D11_PRIMITIVE_TOPOLOGY topology, _In_reads_(indexCount) uint16_t const* indices, size_t indexCount, _In_reads_(vertexCount) TVertex const* vertices, size_t vertexCount)
|
||||
{
|
||||
void* mappedVertices;
|
||||
|
||||
PrimitiveBatchBase::Draw(topology, true, indices, indexCount, vertexCount, &mappedVertices);
|
||||
|
||||
memcpy(mappedVertices, vertices, vertexCount * sizeof(TVertex));
|
||||
}
|
||||
|
||||
|
||||
void DrawLine(TVertex const& v1, TVertex const& v2)
|
||||
{
|
||||
TVertex* mappedVertices;
|
||||
|
||||
PrimitiveBatchBase::Draw(D3D11_PRIMITIVE_TOPOLOGY_LINELIST, false, nullptr, 0, 2, reinterpret_cast<void**>(&mappedVertices));
|
||||
|
||||
mappedVertices[0] = v1;
|
||||
mappedVertices[1] = v2;
|
||||
}
|
||||
|
||||
|
||||
void DrawTriangle(TVertex const& v1, TVertex const& v2, TVertex const& v3)
|
||||
{
|
||||
TVertex* mappedVertices;
|
||||
|
||||
PrimitiveBatchBase::Draw(D3D11_PRIMITIVE_TOPOLOGY_TRIANGLELIST, false, nullptr, 0, 3, reinterpret_cast<void**>(&mappedVertices));
|
||||
|
||||
mappedVertices[0] = v1;
|
||||
mappedVertices[1] = v2;
|
||||
mappedVertices[2] = v3;
|
||||
}
|
||||
|
||||
|
||||
void DrawQuad(TVertex const& v1, TVertex const& v2, TVertex const& v3, TVertex const& v4)
|
||||
{
|
||||
static const uint16_t quadIndices[] = { 0, 1, 2, 0, 2, 3 };
|
||||
|
||||
TVertex* mappedVertices;
|
||||
|
||||
PrimitiveBatchBase::Draw(D3D11_PRIMITIVE_TOPOLOGY_TRIANGLELIST, true, quadIndices, 6, 4, reinterpret_cast<void**>(&mappedVertices));
|
||||
|
||||
mappedVertices[0] = v1;
|
||||
mappedVertices[1] = v2;
|
||||
mappedVertices[2] = v3;
|
||||
mappedVertices[3] = v4;
|
||||
}
|
||||
};
|
||||
}
|
||||
|
|
|
@ -1,50 +1,50 @@
|
|||
//--------------------------------------------------------------------------------------
|
||||
// File: ScreenGrab.h
|
||||
//
|
||||
// Function for capturing a 2D texture and saving it to a file (aka a 'screenshot'
|
||||
// when used on a Direct3D Render Target).
|
||||
//
|
||||
// Note these functions are useful as a light-weight runtime screen grabber. For
|
||||
// full-featured texture capture, DDS writer, and texture processing pipeline,
|
||||
// see the 'Texconv' sample and the 'DirectXTex' library.
|
||||
//
|
||||
// THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF
|
||||
// ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO
|
||||
// THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A
|
||||
// PARTICULAR PURPOSE.
|
||||
//
|
||||
// Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
//
|
||||
// http://go.microsoft.com/fwlink/?LinkId=248926
|
||||
// http://go.microsoft.com/fwlink/?LinkId=248929
|
||||
//--------------------------------------------------------------------------------------
|
||||
|
||||
#pragma once
|
||||
|
||||
#if defined(_XBOX_ONE) && defined(_TITLE)
|
||||
#include <d3d11_x.h>
|
||||
#else
|
||||
#include <d3d11_1.h>
|
||||
#endif
|
||||
|
||||
#include <ocidl.h>
|
||||
|
||||
#include <functional>
|
||||
#include <stdint.h>
|
||||
|
||||
|
||||
namespace DirectX
|
||||
{
|
||||
HRESULT __cdecl SaveDDSTextureToFile(
|
||||
_In_ ID3D11DeviceContext* pContext,
|
||||
_In_ ID3D11Resource* pSource,
|
||||
_In_z_ const wchar_t* fileName);
|
||||
|
||||
HRESULT __cdecl SaveWICTextureToFile(
|
||||
_In_ ID3D11DeviceContext* pContext,
|
||||
_In_ ID3D11Resource* pSource,
|
||||
_In_ REFGUID guidContainerFormat,
|
||||
_In_z_ const wchar_t* fileName,
|
||||
_In_opt_ const GUID* targetFormat = nullptr,
|
||||
_In_opt_ std::function<void __cdecl(IPropertyBag2*)> setCustomProps = nullptr);
|
||||
//--------------------------------------------------------------------------------------
|
||||
// File: ScreenGrab.h
|
||||
//
|
||||
// Function for capturing a 2D texture and saving it to a file (aka a 'screenshot'
|
||||
// when used on a Direct3D Render Target).
|
||||
//
|
||||
// Note these functions are useful as a light-weight runtime screen grabber. For
|
||||
// full-featured texture capture, DDS writer, and texture processing pipeline,
|
||||
// see the 'Texconv' sample and the 'DirectXTex' library.
|
||||
//
|
||||
// THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF
|
||||
// ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO
|
||||
// THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A
|
||||
// PARTICULAR PURPOSE.
|
||||
//
|
||||
// Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
//
|
||||
// http://go.microsoft.com/fwlink/?LinkId=248926
|
||||
// http://go.microsoft.com/fwlink/?LinkId=248929
|
||||
//--------------------------------------------------------------------------------------
|
||||
|
||||
#pragma once
|
||||
|
||||
#if defined(_XBOX_ONE) && defined(_TITLE)
|
||||
#include <d3d11_x.h>
|
||||
#else
|
||||
#include <d3d11_1.h>
|
||||
#endif
|
||||
|
||||
#include <ocidl.h>
|
||||
|
||||
#include <functional>
|
||||
#include <stdint.h>
|
||||
|
||||
|
||||
namespace DirectX
|
||||
{
|
||||
HRESULT __cdecl SaveDDSTextureToFile(
|
||||
_In_ ID3D11DeviceContext* pContext,
|
||||
_In_ ID3D11Resource* pSource,
|
||||
_In_z_ const wchar_t* fileName);
|
||||
|
||||
HRESULT __cdecl SaveWICTextureToFile(
|
||||
_In_ ID3D11DeviceContext* pContext,
|
||||
_In_ ID3D11Resource* pSource,
|
||||
_In_ REFGUID guidContainerFormat,
|
||||
_In_z_ const wchar_t* fileName,
|
||||
_In_opt_ const GUID* targetFormat = nullptr,
|
||||
_In_opt_ std::function<void __cdecl(IPropertyBag2*)> setCustomProps = nullptr);
|
||||
}
|
|
@ -1,96 +1,96 @@
|
|||
//--------------------------------------------------------------------------------------
|
||||
// File: SpriteBatch.h
|
||||
//
|
||||
// THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF
|
||||
// ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO
|
||||
// THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A
|
||||
// PARTICULAR PURPOSE.
|
||||
//
|
||||
// Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
//
|
||||
// http://go.microsoft.com/fwlink/?LinkId=248929
|
||||
//--------------------------------------------------------------------------------------
|
||||
|
||||
#pragma once
|
||||
|
||||
#if defined(_XBOX_ONE) && defined(_TITLE)
|
||||
#include <d3d11_x.h>
|
||||
#else
|
||||
#include <d3d11_1.h>
|
||||
#endif
|
||||
|
||||
#include <DirectXMath.h>
|
||||
#include <DirectXColors.h>
|
||||
#include <functional>
|
||||
#include <memory>
|
||||
|
||||
|
||||
namespace DirectX
|
||||
{
|
||||
enum SpriteSortMode
|
||||
{
|
||||
SpriteSortMode_Deferred,
|
||||
SpriteSortMode_Immediate,
|
||||
SpriteSortMode_Texture,
|
||||
SpriteSortMode_BackToFront,
|
||||
SpriteSortMode_FrontToBack,
|
||||
};
|
||||
|
||||
|
||||
enum SpriteEffects
|
||||
{
|
||||
SpriteEffects_None = 0,
|
||||
SpriteEffects_FlipHorizontally = 1,
|
||||
SpriteEffects_FlipVertically = 2,
|
||||
SpriteEffects_FlipBoth = SpriteEffects_FlipHorizontally | SpriteEffects_FlipVertically,
|
||||
};
|
||||
|
||||
|
||||
class SpriteBatch
|
||||
{
|
||||
public:
|
||||
explicit SpriteBatch(_In_ ID3D11DeviceContext* deviceContext);
|
||||
SpriteBatch(SpriteBatch&& moveFrom);
|
||||
SpriteBatch& operator= (SpriteBatch&& moveFrom);
|
||||
|
||||
SpriteBatch(SpriteBatch const&) = delete;
|
||||
SpriteBatch& operator= (SpriteBatch const&) = delete;
|
||||
|
||||
virtual ~SpriteBatch();
|
||||
|
||||
// Begin/End a batch of sprite drawing operations.
|
||||
void XM_CALLCONV Begin(SpriteSortMode sortMode = SpriteSortMode_Deferred, _In_opt_ ID3D11BlendState* blendState = nullptr, _In_opt_ ID3D11SamplerState* samplerState = nullptr, _In_opt_ ID3D11DepthStencilState* depthStencilState = nullptr, _In_opt_ ID3D11RasterizerState* rasterizerState = nullptr,
|
||||
_In_opt_ std::function<void __cdecl()> setCustomShaders = nullptr, FXMMATRIX transformMatrix = MatrixIdentity);
|
||||
void __cdecl End();
|
||||
|
||||
// Draw overloads specifying position, origin and scale as XMFLOAT2.
|
||||
void XM_CALLCONV Draw(_In_ ID3D11ShaderResourceView* texture, XMFLOAT2 const& position, FXMVECTOR color = Colors::White);
|
||||
void XM_CALLCONV Draw(_In_ ID3D11ShaderResourceView* texture, XMFLOAT2 const& position, _In_opt_ RECT const* sourceRectangle, FXMVECTOR color = Colors::White, float rotation = 0, XMFLOAT2 const& origin = Float2Zero, float scale = 1, SpriteEffects effects = SpriteEffects_None, float layerDepth = 0);
|
||||
void XM_CALLCONV Draw(_In_ ID3D11ShaderResourceView* texture, XMFLOAT2 const& position, _In_opt_ RECT const* sourceRectangle, FXMVECTOR color, float rotation, XMFLOAT2 const& origin, XMFLOAT2 const& scale, SpriteEffects effects = SpriteEffects_None, float layerDepth = 0);
|
||||
|
||||
// Draw overloads specifying position, origin and scale via the first two components of an XMVECTOR.
|
||||
void XM_CALLCONV Draw(_In_ ID3D11ShaderResourceView* texture, FXMVECTOR position, FXMVECTOR color = Colors::White);
|
||||
void XM_CALLCONV Draw(_In_ ID3D11ShaderResourceView* texture, FXMVECTOR position, _In_opt_ RECT const* sourceRectangle, FXMVECTOR color = Colors::White, float rotation = 0, FXMVECTOR origin = g_XMZero, float scale = 1, SpriteEffects effects = SpriteEffects_None, float layerDepth = 0);
|
||||
void XM_CALLCONV Draw(_In_ ID3D11ShaderResourceView* texture, FXMVECTOR position, _In_opt_ RECT const* sourceRectangle, FXMVECTOR color, float rotation, FXMVECTOR origin, GXMVECTOR scale, SpriteEffects effects = SpriteEffects_None, float layerDepth = 0);
|
||||
|
||||
// Draw overloads specifying position as a RECT.
|
||||
void XM_CALLCONV Draw(_In_ ID3D11ShaderResourceView* texture, RECT const& destinationRectangle, FXMVECTOR color = Colors::White);
|
||||
void XM_CALLCONV Draw(_In_ ID3D11ShaderResourceView* texture, RECT const& destinationRectangle, _In_opt_ RECT const* sourceRectangle, FXMVECTOR color = Colors::White, float rotation = 0, XMFLOAT2 const& origin = Float2Zero, SpriteEffects effects = SpriteEffects_None, float layerDepth = 0);
|
||||
|
||||
// Rotation mode to be applied to the sprite transformation
|
||||
void __cdecl SetRotation( DXGI_MODE_ROTATION mode );
|
||||
DXGI_MODE_ROTATION __cdecl GetRotation() const;
|
||||
|
||||
// Set viewport for sprite transformation
|
||||
void __cdecl SetViewport( const D3D11_VIEWPORT& viewPort );
|
||||
|
||||
private:
|
||||
// Private implementation.
|
||||
class Impl;
|
||||
|
||||
std::unique_ptr<Impl> pImpl;
|
||||
|
||||
static const XMMATRIX MatrixIdentity;
|
||||
static const XMFLOAT2 Float2Zero;
|
||||
};
|
||||
}
|
||||
//--------------------------------------------------------------------------------------
|
||||
// File: SpriteBatch.h
|
||||
//
|
||||
// THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF
|
||||
// ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO
|
||||
// THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A
|
||||
// PARTICULAR PURPOSE.
|
||||
//
|
||||
// Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
//
|
||||
// http://go.microsoft.com/fwlink/?LinkId=248929
|
||||
//--------------------------------------------------------------------------------------
|
||||
|
||||
#pragma once
|
||||
|
||||
#if defined(_XBOX_ONE) && defined(_TITLE)
|
||||
#include <d3d11_x.h>
|
||||
#else
|
||||
#include <d3d11_1.h>
|
||||
#endif
|
||||
|
||||
#include <DirectXMath.h>
|
||||
#include <DirectXColors.h>
|
||||
#include <functional>
|
||||
#include <memory>
|
||||
|
||||
|
||||
namespace DirectX
|
||||
{
|
||||
enum SpriteSortMode
|
||||
{
|
||||
SpriteSortMode_Deferred,
|
||||
SpriteSortMode_Immediate,
|
||||
SpriteSortMode_Texture,
|
||||
SpriteSortMode_BackToFront,
|
||||
SpriteSortMode_FrontToBack,
|
||||
};
|
||||
|
||||
|
||||
enum SpriteEffects
|
||||
{
|
||||
SpriteEffects_None = 0,
|
||||
SpriteEffects_FlipHorizontally = 1,
|
||||
SpriteEffects_FlipVertically = 2,
|
||||
SpriteEffects_FlipBoth = SpriteEffects_FlipHorizontally | SpriteEffects_FlipVertically,
|
||||
};
|
||||
|
||||
|
||||
class SpriteBatch
|
||||
{
|
||||
public:
|
||||
explicit SpriteBatch(_In_ ID3D11DeviceContext* deviceContext);
|
||||
SpriteBatch(SpriteBatch&& moveFrom);
|
||||
SpriteBatch& operator= (SpriteBatch&& moveFrom);
|
||||
|
||||
SpriteBatch(SpriteBatch const&) = delete;
|
||||
SpriteBatch& operator= (SpriteBatch const&) = delete;
|
||||
|
||||
virtual ~SpriteBatch();
|
||||
|
||||
// Begin/End a batch of sprite drawing operations.
|
||||
void XM_CALLCONV Begin(SpriteSortMode sortMode = SpriteSortMode_Deferred, _In_opt_ ID3D11BlendState* blendState = nullptr, _In_opt_ ID3D11SamplerState* samplerState = nullptr, _In_opt_ ID3D11DepthStencilState* depthStencilState = nullptr, _In_opt_ ID3D11RasterizerState* rasterizerState = nullptr,
|
||||
_In_opt_ std::function<void __cdecl()> setCustomShaders = nullptr, FXMMATRIX transformMatrix = MatrixIdentity);
|
||||
void __cdecl End();
|
||||
|
||||
// Draw overloads specifying position, origin and scale as XMFLOAT2.
|
||||
void XM_CALLCONV Draw(_In_ ID3D11ShaderResourceView* texture, XMFLOAT2 const& position, FXMVECTOR color = Colors::White);
|
||||
void XM_CALLCONV Draw(_In_ ID3D11ShaderResourceView* texture, XMFLOAT2 const& position, _In_opt_ RECT const* sourceRectangle, FXMVECTOR color = Colors::White, float rotation = 0, XMFLOAT2 const& origin = Float2Zero, float scale = 1, SpriteEffects effects = SpriteEffects_None, float layerDepth = 0);
|
||||
void XM_CALLCONV Draw(_In_ ID3D11ShaderResourceView* texture, XMFLOAT2 const& position, _In_opt_ RECT const* sourceRectangle, FXMVECTOR color, float rotation, XMFLOAT2 const& origin, XMFLOAT2 const& scale, SpriteEffects effects = SpriteEffects_None, float layerDepth = 0);
|
||||
|
||||
// Draw overloads specifying position, origin and scale via the first two components of an XMVECTOR.
|
||||
void XM_CALLCONV Draw(_In_ ID3D11ShaderResourceView* texture, FXMVECTOR position, FXMVECTOR color = Colors::White);
|
||||
void XM_CALLCONV Draw(_In_ ID3D11ShaderResourceView* texture, FXMVECTOR position, _In_opt_ RECT const* sourceRectangle, FXMVECTOR color = Colors::White, float rotation = 0, FXMVECTOR origin = g_XMZero, float scale = 1, SpriteEffects effects = SpriteEffects_None, float layerDepth = 0);
|
||||
void XM_CALLCONV Draw(_In_ ID3D11ShaderResourceView* texture, FXMVECTOR position, _In_opt_ RECT const* sourceRectangle, FXMVECTOR color, float rotation, FXMVECTOR origin, GXMVECTOR scale, SpriteEffects effects = SpriteEffects_None, float layerDepth = 0);
|
||||
|
||||
// Draw overloads specifying position as a RECT.
|
||||
void XM_CALLCONV Draw(_In_ ID3D11ShaderResourceView* texture, RECT const& destinationRectangle, FXMVECTOR color = Colors::White);
|
||||
void XM_CALLCONV Draw(_In_ ID3D11ShaderResourceView* texture, RECT const& destinationRectangle, _In_opt_ RECT const* sourceRectangle, FXMVECTOR color = Colors::White, float rotation = 0, XMFLOAT2 const& origin = Float2Zero, SpriteEffects effects = SpriteEffects_None, float layerDepth = 0);
|
||||
|
||||
// Rotation mode to be applied to the sprite transformation
|
||||
void __cdecl SetRotation( DXGI_MODE_ROTATION mode );
|
||||
DXGI_MODE_ROTATION __cdecl GetRotation() const;
|
||||
|
||||
// Set viewport for sprite transformation
|
||||
void __cdecl SetViewport( const D3D11_VIEWPORT& viewPort );
|
||||
|
||||
private:
|
||||
// Private implementation.
|
||||
class Impl;
|
||||
|
||||
std::unique_ptr<Impl> pImpl;
|
||||
|
||||
static const XMMATRIX MatrixIdentity;
|
||||
static const XMFLOAT2 Float2Zero;
|
||||
};
|
||||
}
|
||||
|
|
|
@ -1,366 +1,366 @@
|
|||
//--------------------------------------------------------------------------------------
|
||||
// File: VertexTypes.h
|
||||
//
|
||||
// THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF
|
||||
// ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO
|
||||
// THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A
|
||||
// PARTICULAR PURPOSE.
|
||||
//
|
||||
// Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
//
|
||||
// http://go.microsoft.com/fwlink/?LinkId=248929
|
||||
//--------------------------------------------------------------------------------------
|
||||
|
||||
#pragma once
|
||||
|
||||
#if defined(_XBOX_ONE) && defined(_TITLE)
|
||||
#include <d3d11_x.h>
|
||||
#else
|
||||
#include <d3d11_1.h>
|
||||
#endif
|
||||
|
||||
#include <DirectXMath.h>
|
||||
|
||||
|
||||
namespace DirectX
|
||||
{
|
||||
// Vertex struct holding position information.
|
||||
struct VertexPosition
|
||||
{
|
||||
VertexPosition() = default;
|
||||
|
||||
VertexPosition(XMFLOAT3 const& position)
|
||||
: position(position)
|
||||
{ }
|
||||
|
||||
VertexPosition(FXMVECTOR position)
|
||||
{
|
||||
XMStoreFloat3(&this->position, position);
|
||||
}
|
||||
|
||||
XMFLOAT3 position;
|
||||
|
||||
static const int InputElementCount = 1;
|
||||
static const D3D11_INPUT_ELEMENT_DESC InputElements[InputElementCount];
|
||||
};
|
||||
|
||||
|
||||
// Vertex struct holding position and color information.
|
||||
struct VertexPositionColor
|
||||
{
|
||||
VertexPositionColor() = default;
|
||||
|
||||
VertexPositionColor(XMFLOAT3 const& position, XMFLOAT4 const& color)
|
||||
: position(position),
|
||||
color(color)
|
||||
{ }
|
||||
|
||||
VertexPositionColor(FXMVECTOR position, FXMVECTOR color)
|
||||
{
|
||||
XMStoreFloat3(&this->position, position);
|
||||
XMStoreFloat4(&this->color, color);
|
||||
}
|
||||
|
||||
XMFLOAT3 position;
|
||||
XMFLOAT4 color;
|
||||
|
||||
static const int InputElementCount = 2;
|
||||
static const D3D11_INPUT_ELEMENT_DESC InputElements[InputElementCount];
|
||||
};
|
||||
|
||||
|
||||
// Vertex struct holding position and texture mapping information.
|
||||
struct VertexPositionTexture
|
||||
{
|
||||
VertexPositionTexture() = default;
|
||||
|
||||
VertexPositionTexture(XMFLOAT3 const& position, XMFLOAT2 const& textureCoordinate)
|
||||
: position(position),
|
||||
textureCoordinate(textureCoordinate)
|
||||
{ }
|
||||
|
||||
VertexPositionTexture(FXMVECTOR position, FXMVECTOR textureCoordinate)
|
||||
{
|
||||
XMStoreFloat3(&this->position, position);
|
||||
XMStoreFloat2(&this->textureCoordinate, textureCoordinate);
|
||||
}
|
||||
|
||||
XMFLOAT3 position;
|
||||
XMFLOAT2 textureCoordinate;
|
||||
|
||||
static const int InputElementCount = 2;
|
||||
static const D3D11_INPUT_ELEMENT_DESC InputElements[InputElementCount];
|
||||
};
|
||||
|
||||
|
||||
// Vertex struct holding position and dual texture mapping information.
|
||||
struct VertexPositionDualTexture
|
||||
{
|
||||
VertexPositionDualTexture() = default;
|
||||
|
||||
VertexPositionDualTexture(XMFLOAT3 const& position, XMFLOAT2 const& textureCoordinate0, XMFLOAT2 const& textureCoordinate1)
|
||||
: position(position),
|
||||
textureCoordinate0(textureCoordinate0),
|
||||
textureCoordinate1(textureCoordinate1)
|
||||
{ }
|
||||
|
||||
VertexPositionDualTexture(FXMVECTOR position,
|
||||
FXMVECTOR textureCoordinate0,
|
||||
FXMVECTOR textureCoordinate1)
|
||||
{
|
||||
XMStoreFloat3(&this->position, position);
|
||||
XMStoreFloat2(&this->textureCoordinate0, textureCoordinate0);
|
||||
XMStoreFloat2(&this->textureCoordinate1, textureCoordinate1);
|
||||
}
|
||||
|
||||
XMFLOAT3 position;
|
||||
XMFLOAT2 textureCoordinate0;
|
||||
XMFLOAT2 textureCoordinate1;
|
||||
|
||||
static const int InputElementCount = 3;
|
||||
static const D3D11_INPUT_ELEMENT_DESC InputElements[InputElementCount];
|
||||
};
|
||||
|
||||
|
||||
// Vertex struct holding position and normal vector.
|
||||
struct VertexPositionNormal
|
||||
{
|
||||
VertexPositionNormal() = default;
|
||||
|
||||
VertexPositionNormal(XMFLOAT3 const& position, XMFLOAT3 const& normal)
|
||||
: position(position),
|
||||
normal(normal)
|
||||
{ }
|
||||
|
||||
VertexPositionNormal(FXMVECTOR position, FXMVECTOR normal)
|
||||
{
|
||||
XMStoreFloat3(&this->position, position);
|
||||
XMStoreFloat3(&this->normal, normal);
|
||||
}
|
||||
|
||||
XMFLOAT3 position;
|
||||
XMFLOAT3 normal;
|
||||
|
||||
static const int InputElementCount = 2;
|
||||
static const D3D11_INPUT_ELEMENT_DESC InputElements[InputElementCount];
|
||||
};
|
||||
|
||||
|
||||
// Vertex struct holding position, color, and texture mapping information.
|
||||
struct VertexPositionColorTexture
|
||||
{
|
||||
VertexPositionColorTexture() = default;
|
||||
|
||||
VertexPositionColorTexture(XMFLOAT3 const& position, XMFLOAT4 const& color, XMFLOAT2 const& textureCoordinate)
|
||||
: position(position),
|
||||
color(color),
|
||||
textureCoordinate(textureCoordinate)
|
||||
{ }
|
||||
|
||||
VertexPositionColorTexture(FXMVECTOR position, FXMVECTOR color, FXMVECTOR textureCoordinate)
|
||||
{
|
||||
XMStoreFloat3(&this->position, position);
|
||||
XMStoreFloat4(&this->color, color);
|
||||
XMStoreFloat2(&this->textureCoordinate, textureCoordinate);
|
||||
}
|
||||
|
||||
XMFLOAT3 position;
|
||||
XMFLOAT4 color;
|
||||
XMFLOAT2 textureCoordinate;
|
||||
|
||||
static const int InputElementCount = 3;
|
||||
static const D3D11_INPUT_ELEMENT_DESC InputElements[InputElementCount];
|
||||
};
|
||||
|
||||
|
||||
// Vertex struct holding position, normal vector, and color information.
|
||||
struct VertexPositionNormalColor
|
||||
{
|
||||
VertexPositionNormalColor() = default;
|
||||
|
||||
VertexPositionNormalColor(XMFLOAT3 const& position, XMFLOAT3 const& normal, XMFLOAT4 const& color)
|
||||
: position(position),
|
||||
normal(normal),
|
||||
color(color)
|
||||
{ }
|
||||
|
||||
VertexPositionNormalColor(FXMVECTOR position, FXMVECTOR normal, FXMVECTOR color)
|
||||
{
|
||||
XMStoreFloat3(&this->position, position);
|
||||
XMStoreFloat3(&this->normal, normal);
|
||||
XMStoreFloat4(&this->color, color);
|
||||
}
|
||||
|
||||
XMFLOAT3 position;
|
||||
XMFLOAT3 normal;
|
||||
XMFLOAT4 color;
|
||||
|
||||
static const int InputElementCount = 3;
|
||||
static const D3D11_INPUT_ELEMENT_DESC InputElements[InputElementCount];
|
||||
};
|
||||
|
||||
|
||||
// Vertex struct holding position, normal vector, and texture mapping information.
|
||||
struct VertexPositionNormalTexture
|
||||
{
|
||||
VertexPositionNormalTexture() = default;
|
||||
|
||||
VertexPositionNormalTexture(XMFLOAT3 const& position, XMFLOAT3 const& normal, XMFLOAT2 const& textureCoordinate)
|
||||
: position(position),
|
||||
normal(normal),
|
||||
textureCoordinate(textureCoordinate)
|
||||
{ }
|
||||
|
||||
VertexPositionNormalTexture(FXMVECTOR position, FXMVECTOR normal, FXMVECTOR textureCoordinate)
|
||||
{
|
||||
XMStoreFloat3(&this->position, position);
|
||||
XMStoreFloat3(&this->normal, normal);
|
||||
XMStoreFloat2(&this->textureCoordinate, textureCoordinate);
|
||||
}
|
||||
|
||||
XMFLOAT3 position;
|
||||
XMFLOAT3 normal;
|
||||
XMFLOAT2 textureCoordinate;
|
||||
|
||||
static const int InputElementCount = 3;
|
||||
static const D3D11_INPUT_ELEMENT_DESC InputElements[InputElementCount];
|
||||
};
|
||||
|
||||
|
||||
// Vertex struct holding position, normal vector, color, and texture mapping information.
|
||||
struct VertexPositionNormalColorTexture
|
||||
{
|
||||
VertexPositionNormalColorTexture() = default;
|
||||
|
||||
VertexPositionNormalColorTexture(XMFLOAT3 const& position, XMFLOAT3 const& normal, XMFLOAT4 const& color, XMFLOAT2 const& textureCoordinate)
|
||||
: position(position),
|
||||
normal(normal),
|
||||
color(color),
|
||||
textureCoordinate(textureCoordinate)
|
||||
{ }
|
||||
|
||||
VertexPositionNormalColorTexture(FXMVECTOR position, FXMVECTOR normal, FXMVECTOR color, CXMVECTOR textureCoordinate)
|
||||
{
|
||||
XMStoreFloat3(&this->position, position);
|
||||
XMStoreFloat3(&this->normal, normal);
|
||||
XMStoreFloat4(&this->color, color);
|
||||
XMStoreFloat2(&this->textureCoordinate, textureCoordinate);
|
||||
}
|
||||
|
||||
XMFLOAT3 position;
|
||||
XMFLOAT3 normal;
|
||||
XMFLOAT4 color;
|
||||
XMFLOAT2 textureCoordinate;
|
||||
|
||||
static const int InputElementCount = 4;
|
||||
static const D3D11_INPUT_ELEMENT_DESC InputElements[InputElementCount];
|
||||
};
|
||||
|
||||
|
||||
// Vertex struct for Visual Studio Shader Designer (DGSL) holding position, normal,
|
||||
// tangent, color (RGBA), and texture mapping information
|
||||
struct VertexPositionNormalTangentColorTexture
|
||||
{
|
||||
VertexPositionNormalTangentColorTexture() = default;
|
||||
|
||||
XMFLOAT3 position;
|
||||
XMFLOAT3 normal;
|
||||
XMFLOAT4 tangent;
|
||||
uint32_t color;
|
||||
XMFLOAT2 textureCoordinate;
|
||||
|
||||
VertexPositionNormalTangentColorTexture(XMFLOAT3 const& position, XMFLOAT3 const& normal, XMFLOAT4 const& tangent, uint32_t rgba, XMFLOAT2 const& textureCoordinate)
|
||||
: position(position),
|
||||
normal(normal),
|
||||
tangent(tangent),
|
||||
color(rgba),
|
||||
textureCoordinate(textureCoordinate)
|
||||
{
|
||||
}
|
||||
|
||||
VertexPositionNormalTangentColorTexture(FXMVECTOR position, FXMVECTOR normal, FXMVECTOR tangent, uint32_t rgba, CXMVECTOR textureCoordinate)
|
||||
: color(rgba)
|
||||
{
|
||||
XMStoreFloat3(&this->position, position);
|
||||
XMStoreFloat3(&this->normal, normal);
|
||||
XMStoreFloat4(&this->tangent, tangent);
|
||||
XMStoreFloat2(&this->textureCoordinate, textureCoordinate);
|
||||
}
|
||||
|
||||
VertexPositionNormalTangentColorTexture(XMFLOAT3 const& position, XMFLOAT3 const& normal, XMFLOAT4 const& tangent, XMFLOAT4 const& color, XMFLOAT2 const& textureCoordinate)
|
||||
: position(position),
|
||||
normal(normal),
|
||||
tangent(tangent),
|
||||
textureCoordinate(textureCoordinate)
|
||||
{
|
||||
SetColor( color );
|
||||
}
|
||||
|
||||
VertexPositionNormalTangentColorTexture(FXMVECTOR position, FXMVECTOR normal, FXMVECTOR tangent, CXMVECTOR color, CXMVECTOR textureCoordinate)
|
||||
{
|
||||
XMStoreFloat3(&this->position, position);
|
||||
XMStoreFloat3(&this->normal, normal);
|
||||
XMStoreFloat4(&this->tangent, tangent);
|
||||
XMStoreFloat2(&this->textureCoordinate, textureCoordinate);
|
||||
|
||||
SetColor( color );
|
||||
}
|
||||
|
||||
void __cdecl SetColor( XMFLOAT4 const& icolor ) { SetColor( XMLoadFloat4( &icolor ) ); }
|
||||
void XM_CALLCONV SetColor( FXMVECTOR icolor );
|
||||
|
||||
static const int InputElementCount = 5;
|
||||
static const D3D11_INPUT_ELEMENT_DESC InputElements[InputElementCount];
|
||||
};
|
||||
|
||||
|
||||
// Vertex struct for Visual Studio Shader Designer (DGSL) holding position, normal,
|
||||
// tangent, color (RGBA), texture mapping information, and skinning weights
|
||||
struct VertexPositionNormalTangentColorTextureSkinning : public VertexPositionNormalTangentColorTexture
|
||||
{
|
||||
VertexPositionNormalTangentColorTextureSkinning() = default;
|
||||
|
||||
uint32_t indices;
|
||||
uint32_t weights;
|
||||
|
||||
VertexPositionNormalTangentColorTextureSkinning(XMFLOAT3 const& position, XMFLOAT3 const& normal, XMFLOAT4 const& tangent, uint32_t rgba,
|
||||
XMFLOAT2 const& textureCoordinate, XMUINT4 const& indices, XMFLOAT4 const& weights)
|
||||
: VertexPositionNormalTangentColorTexture(position,normal,tangent,rgba,textureCoordinate)
|
||||
{
|
||||
SetBlendIndices( indices );
|
||||
SetBlendWeights( weights );
|
||||
}
|
||||
|
||||
VertexPositionNormalTangentColorTextureSkinning(FXMVECTOR position, FXMVECTOR normal, FXMVECTOR tangent, uint32_t rgba, CXMVECTOR textureCoordinate,
|
||||
XMUINT4 const& indices, CXMVECTOR weights)
|
||||
: VertexPositionNormalTangentColorTexture(position,normal,tangent,rgba,textureCoordinate)
|
||||
{
|
||||
SetBlendIndices( indices );
|
||||
SetBlendWeights( weights );
|
||||
}
|
||||
|
||||
VertexPositionNormalTangentColorTextureSkinning(XMFLOAT3 const& position, XMFLOAT3 const& normal, XMFLOAT4 const& tangent, XMFLOAT4 const& color,
|
||||
XMFLOAT2 const& textureCoordinate, XMUINT4 const& indices, XMFLOAT4 const& weights)
|
||||
: VertexPositionNormalTangentColorTexture(position,normal,tangent,color,textureCoordinate)
|
||||
{
|
||||
SetBlendIndices( indices );
|
||||
SetBlendWeights( weights );
|
||||
}
|
||||
|
||||
VertexPositionNormalTangentColorTextureSkinning(FXMVECTOR position, FXMVECTOR normal, FXMVECTOR tangent, CXMVECTOR color, CXMVECTOR textureCoordinate,
|
||||
XMUINT4 const& indices, CXMVECTOR weights)
|
||||
: VertexPositionNormalTangentColorTexture(position,normal,tangent,color,textureCoordinate)
|
||||
{
|
||||
SetBlendIndices( indices );
|
||||
SetBlendWeights( weights );
|
||||
}
|
||||
|
||||
void __cdecl SetBlendIndices( XMUINT4 const& iindices );
|
||||
|
||||
void __cdecl SetBlendWeights( XMFLOAT4 const& iweights ) { SetBlendWeights( XMLoadFloat4( &iweights ) ); }
|
||||
void XM_CALLCONV SetBlendWeights( FXMVECTOR iweights );
|
||||
|
||||
static const int InputElementCount = 7;
|
||||
static const D3D11_INPUT_ELEMENT_DESC InputElements[InputElementCount];
|
||||
};
|
||||
}
|
||||
//--------------------------------------------------------------------------------------
|
||||
// File: VertexTypes.h
|
||||
//
|
||||
// THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF
|
||||
// ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO
|
||||
// THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A
|
||||
// PARTICULAR PURPOSE.
|
||||
//
|
||||
// Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
//
|
||||
// http://go.microsoft.com/fwlink/?LinkId=248929
|
||||
//--------------------------------------------------------------------------------------
|
||||
|
||||
#pragma once
|
||||
|
||||
#if defined(_XBOX_ONE) && defined(_TITLE)
|
||||
#include <d3d11_x.h>
|
||||
#else
|
||||
#include <d3d11_1.h>
|
||||
#endif
|
||||
|
||||
#include <DirectXMath.h>
|
||||
|
||||
|
||||
namespace DirectX
|
||||
{
|
||||
// Vertex struct holding position information.
|
||||
struct VertexPosition
|
||||
{
|
||||
VertexPosition() = default;
|
||||
|
||||
VertexPosition(XMFLOAT3 const& position)
|
||||
: position(position)
|
||||
{ }
|
||||
|
||||
VertexPosition(FXMVECTOR position)
|
||||
{
|
||||
XMStoreFloat3(&this->position, position);
|
||||
}
|
||||
|
||||
XMFLOAT3 position;
|
||||
|
||||
static const int InputElementCount = 1;
|
||||
static const D3D11_INPUT_ELEMENT_DESC InputElements[InputElementCount];
|
||||
};
|
||||
|
||||
|
||||
// Vertex struct holding position and color information.
|
||||
struct VertexPositionColor
|
||||
{
|
||||
VertexPositionColor() = default;
|
||||
|
||||
VertexPositionColor(XMFLOAT3 const& position, XMFLOAT4 const& color)
|
||||
: position(position),
|
||||
color(color)
|
||||
{ }
|
||||
|
||||
VertexPositionColor(FXMVECTOR position, FXMVECTOR color)
|
||||
{
|
||||
XMStoreFloat3(&this->position, position);
|
||||
XMStoreFloat4(&this->color, color);
|
||||
}
|
||||
|
||||
XMFLOAT3 position;
|
||||
XMFLOAT4 color;
|
||||
|
||||
static const int InputElementCount = 2;
|
||||
static const D3D11_INPUT_ELEMENT_DESC InputElements[InputElementCount];
|
||||
};
|
||||
|
||||
|
||||
// Vertex struct holding position and texture mapping information.
|
||||
struct VertexPositionTexture
|
||||
{
|
||||
VertexPositionTexture() = default;
|
||||
|
||||
VertexPositionTexture(XMFLOAT3 const& position, XMFLOAT2 const& textureCoordinate)
|
||||
: position(position),
|
||||
textureCoordinate(textureCoordinate)
|
||||
{ }
|
||||
|
||||
VertexPositionTexture(FXMVECTOR position, FXMVECTOR textureCoordinate)
|
||||
{
|
||||
XMStoreFloat3(&this->position, position);
|
||||
XMStoreFloat2(&this->textureCoordinate, textureCoordinate);
|
||||
}
|
||||
|
||||
XMFLOAT3 position;
|
||||
XMFLOAT2 textureCoordinate;
|
||||
|
||||
static const int InputElementCount = 2;
|
||||
static const D3D11_INPUT_ELEMENT_DESC InputElements[InputElementCount];
|
||||
};
|
||||
|
||||
|
||||
// Vertex struct holding position and dual texture mapping information.
|
||||
struct VertexPositionDualTexture
|
||||
{
|
||||
VertexPositionDualTexture() = default;
|
||||
|
||||
VertexPositionDualTexture(XMFLOAT3 const& position, XMFLOAT2 const& textureCoordinate0, XMFLOAT2 const& textureCoordinate1)
|
||||
: position(position),
|
||||
textureCoordinate0(textureCoordinate0),
|
||||
textureCoordinate1(textureCoordinate1)
|
||||
{ }
|
||||
|
||||
VertexPositionDualTexture(FXMVECTOR position,
|
||||
FXMVECTOR textureCoordinate0,
|
||||
FXMVECTOR textureCoordinate1)
|
||||
{
|
||||
XMStoreFloat3(&this->position, position);
|
||||
XMStoreFloat2(&this->textureCoordinate0, textureCoordinate0);
|
||||
XMStoreFloat2(&this->textureCoordinate1, textureCoordinate1);
|
||||
}
|
||||
|
||||
XMFLOAT3 position;
|
||||
XMFLOAT2 textureCoordinate0;
|
||||
XMFLOAT2 textureCoordinate1;
|
||||
|
||||
static const int InputElementCount = 3;
|
||||
static const D3D11_INPUT_ELEMENT_DESC InputElements[InputElementCount];
|
||||
};
|
||||
|
||||
|
||||
// Vertex struct holding position and normal vector.
|
||||
struct VertexPositionNormal
|
||||
{
|
||||
VertexPositionNormal() = default;
|
||||
|
||||
VertexPositionNormal(XMFLOAT3 const& position, XMFLOAT3 const& normal)
|
||||
: position(position),
|
||||
normal(normal)
|
||||
{ }
|
||||
|
||||
VertexPositionNormal(FXMVECTOR position, FXMVECTOR normal)
|
||||
{
|
||||
XMStoreFloat3(&this->position, position);
|
||||
XMStoreFloat3(&this->normal, normal);
|
||||
}
|
||||
|
||||
XMFLOAT3 position;
|
||||
XMFLOAT3 normal;
|
||||
|
||||
static const int InputElementCount = 2;
|
||||
static const D3D11_INPUT_ELEMENT_DESC InputElements[InputElementCount];
|
||||
};
|
||||
|
||||
|
||||
// Vertex struct holding position, color, and texture mapping information.
|
||||
struct VertexPositionColorTexture
|
||||
{
|
||||
VertexPositionColorTexture() = default;
|
||||
|
||||
VertexPositionColorTexture(XMFLOAT3 const& position, XMFLOAT4 const& color, XMFLOAT2 const& textureCoordinate)
|
||||
: position(position),
|
||||
color(color),
|
||||
textureCoordinate(textureCoordinate)
|
||||
{ }
|
||||
|
||||
VertexPositionColorTexture(FXMVECTOR position, FXMVECTOR color, FXMVECTOR textureCoordinate)
|
||||
{
|
||||
XMStoreFloat3(&this->position, position);
|
||||
XMStoreFloat4(&this->color, color);
|
||||
XMStoreFloat2(&this->textureCoordinate, textureCoordinate);
|
||||
}
|
||||
|
||||
XMFLOAT3 position;
|
||||
XMFLOAT4 color;
|
||||
XMFLOAT2 textureCoordinate;
|
||||
|
||||
static const int InputElementCount = 3;
|
||||
static const D3D11_INPUT_ELEMENT_DESC InputElements[InputElementCount];
|
||||
};
|
||||
|
||||
|
||||
// Vertex struct holding position, normal vector, and color information.
|
||||
struct VertexPositionNormalColor
|
||||
{
|
||||
VertexPositionNormalColor() = default;
|
||||
|
||||
VertexPositionNormalColor(XMFLOAT3 const& position, XMFLOAT3 const& normal, XMFLOAT4 const& color)
|
||||
: position(position),
|
||||
normal(normal),
|
||||
color(color)
|
||||
{ }
|
||||
|
||||
VertexPositionNormalColor(FXMVECTOR position, FXMVECTOR normal, FXMVECTOR color)
|
||||
{
|
||||
XMStoreFloat3(&this->position, position);
|
||||
XMStoreFloat3(&this->normal, normal);
|
||||
XMStoreFloat4(&this->color, color);
|
||||
}
|
||||
|
||||
XMFLOAT3 position;
|
||||
XMFLOAT3 normal;
|
||||
XMFLOAT4 color;
|
||||
|
||||
static const int InputElementCount = 3;
|
||||
static const D3D11_INPUT_ELEMENT_DESC InputElements[InputElementCount];
|
||||
};
|
||||
|
||||
|
||||
// Vertex struct holding position, normal vector, and texture mapping information.
|
||||
struct VertexPositionNormalTexture
|
||||
{
|
||||
VertexPositionNormalTexture() = default;
|
||||
|
||||
VertexPositionNormalTexture(XMFLOAT3 const& position, XMFLOAT3 const& normal, XMFLOAT2 const& textureCoordinate)
|
||||
: position(position),
|
||||
normal(normal),
|
||||
textureCoordinate(textureCoordinate)
|
||||
{ }
|
||||
|
||||
VertexPositionNormalTexture(FXMVECTOR position, FXMVECTOR normal, FXMVECTOR textureCoordinate)
|
||||
{
|
||||
XMStoreFloat3(&this->position, position);
|
||||
XMStoreFloat3(&this->normal, normal);
|
||||
XMStoreFloat2(&this->textureCoordinate, textureCoordinate);
|
||||
}
|
||||
|
||||
XMFLOAT3 position;
|
||||
XMFLOAT3 normal;
|
||||
XMFLOAT2 textureCoordinate;
|
||||
|
||||
static const int InputElementCount = 3;
|
||||
static const D3D11_INPUT_ELEMENT_DESC InputElements[InputElementCount];
|
||||
};
|
||||
|
||||
|
||||
// Vertex struct holding position, normal vector, color, and texture mapping information.
|
||||
struct VertexPositionNormalColorTexture
|
||||
{
|
||||
VertexPositionNormalColorTexture() = default;
|
||||
|
||||
VertexPositionNormalColorTexture(XMFLOAT3 const& position, XMFLOAT3 const& normal, XMFLOAT4 const& color, XMFLOAT2 const& textureCoordinate)
|
||||
: position(position),
|
||||
normal(normal),
|
||||
color(color),
|
||||
textureCoordinate(textureCoordinate)
|
||||
{ }
|
||||
|
||||
VertexPositionNormalColorTexture(FXMVECTOR position, FXMVECTOR normal, FXMVECTOR color, CXMVECTOR textureCoordinate)
|
||||
{
|
||||
XMStoreFloat3(&this->position, position);
|
||||
XMStoreFloat3(&this->normal, normal);
|
||||
XMStoreFloat4(&this->color, color);
|
||||
XMStoreFloat2(&this->textureCoordinate, textureCoordinate);
|
||||
}
|
||||
|
||||
XMFLOAT3 position;
|
||||
XMFLOAT3 normal;
|
||||
XMFLOAT4 color;
|
||||
XMFLOAT2 textureCoordinate;
|
||||
|
||||
static const int InputElementCount = 4;
|
||||
static const D3D11_INPUT_ELEMENT_DESC InputElements[InputElementCount];
|
||||
};
|
||||
|
||||
|
||||
// Vertex struct for Visual Studio Shader Designer (DGSL) holding position, normal,
|
||||
// tangent, color (RGBA), and texture mapping information
|
||||
struct VertexPositionNormalTangentColorTexture
|
||||
{
|
||||
VertexPositionNormalTangentColorTexture() = default;
|
||||
|
||||
XMFLOAT3 position;
|
||||
XMFLOAT3 normal;
|
||||
XMFLOAT4 tangent;
|
||||
uint32_t color;
|
||||
XMFLOAT2 textureCoordinate;
|
||||
|
||||
VertexPositionNormalTangentColorTexture(XMFLOAT3 const& position, XMFLOAT3 const& normal, XMFLOAT4 const& tangent, uint32_t rgba, XMFLOAT2 const& textureCoordinate)
|
||||
: position(position),
|
||||
normal(normal),
|
||||
tangent(tangent),
|
||||
color(rgba),
|
||||
textureCoordinate(textureCoordinate)
|
||||
{
|
||||
}
|
||||
|
||||
VertexPositionNormalTangentColorTexture(FXMVECTOR position, FXMVECTOR normal, FXMVECTOR tangent, uint32_t rgba, CXMVECTOR textureCoordinate)
|
||||
: color(rgba)
|
||||
{
|
||||
XMStoreFloat3(&this->position, position);
|
||||
XMStoreFloat3(&this->normal, normal);
|
||||
XMStoreFloat4(&this->tangent, tangent);
|
||||
XMStoreFloat2(&this->textureCoordinate, textureCoordinate);
|
||||
}
|
||||
|
||||
VertexPositionNormalTangentColorTexture(XMFLOAT3 const& position, XMFLOAT3 const& normal, XMFLOAT4 const& tangent, XMFLOAT4 const& color, XMFLOAT2 const& textureCoordinate)
|
||||
: position(position),
|
||||
normal(normal),
|
||||
tangent(tangent),
|
||||
textureCoordinate(textureCoordinate)
|
||||
{
|
||||
SetColor( color );
|
||||
}
|
||||
|
||||
VertexPositionNormalTangentColorTexture(FXMVECTOR position, FXMVECTOR normal, FXMVECTOR tangent, CXMVECTOR color, CXMVECTOR textureCoordinate)
|
||||
{
|
||||
XMStoreFloat3(&this->position, position);
|
||||
XMStoreFloat3(&this->normal, normal);
|
||||
XMStoreFloat4(&this->tangent, tangent);
|
||||
XMStoreFloat2(&this->textureCoordinate, textureCoordinate);
|
||||
|
||||
SetColor( color );
|
||||
}
|
||||
|
||||
void __cdecl SetColor( XMFLOAT4 const& icolor ) { SetColor( XMLoadFloat4( &icolor ) ); }
|
||||
void XM_CALLCONV SetColor( FXMVECTOR icolor );
|
||||
|
||||
static const int InputElementCount = 5;
|
||||
static const D3D11_INPUT_ELEMENT_DESC InputElements[InputElementCount];
|
||||
};
|
||||
|
||||
|
||||
// Vertex struct for Visual Studio Shader Designer (DGSL) holding position, normal,
|
||||
// tangent, color (RGBA), texture mapping information, and skinning weights
|
||||
struct VertexPositionNormalTangentColorTextureSkinning : public VertexPositionNormalTangentColorTexture
|
||||
{
|
||||
VertexPositionNormalTangentColorTextureSkinning() = default;
|
||||
|
||||
uint32_t indices;
|
||||
uint32_t weights;
|
||||
|
||||
VertexPositionNormalTangentColorTextureSkinning(XMFLOAT3 const& position, XMFLOAT3 const& normal, XMFLOAT4 const& tangent, uint32_t rgba,
|
||||
XMFLOAT2 const& textureCoordinate, XMUINT4 const& indices, XMFLOAT4 const& weights)
|
||||
: VertexPositionNormalTangentColorTexture(position,normal,tangent,rgba,textureCoordinate)
|
||||
{
|
||||
SetBlendIndices( indices );
|
||||
SetBlendWeights( weights );
|
||||
}
|
||||
|
||||
VertexPositionNormalTangentColorTextureSkinning(FXMVECTOR position, FXMVECTOR normal, FXMVECTOR tangent, uint32_t rgba, CXMVECTOR textureCoordinate,
|
||||
XMUINT4 const& indices, CXMVECTOR weights)
|
||||
: VertexPositionNormalTangentColorTexture(position,normal,tangent,rgba,textureCoordinate)
|
||||
{
|
||||
SetBlendIndices( indices );
|
||||
SetBlendWeights( weights );
|
||||
}
|
||||
|
||||
VertexPositionNormalTangentColorTextureSkinning(XMFLOAT3 const& position, XMFLOAT3 const& normal, XMFLOAT4 const& tangent, XMFLOAT4 const& color,
|
||||
XMFLOAT2 const& textureCoordinate, XMUINT4 const& indices, XMFLOAT4 const& weights)
|
||||
: VertexPositionNormalTangentColorTexture(position,normal,tangent,color,textureCoordinate)
|
||||
{
|
||||
SetBlendIndices( indices );
|
||||
SetBlendWeights( weights );
|
||||
}
|
||||
|
||||
VertexPositionNormalTangentColorTextureSkinning(FXMVECTOR position, FXMVECTOR normal, FXMVECTOR tangent, CXMVECTOR color, CXMVECTOR textureCoordinate,
|
||||
XMUINT4 const& indices, CXMVECTOR weights)
|
||||
: VertexPositionNormalTangentColorTexture(position,normal,tangent,color,textureCoordinate)
|
||||
{
|
||||
SetBlendIndices( indices );
|
||||
SetBlendWeights( weights );
|
||||
}
|
||||
|
||||
void __cdecl SetBlendIndices( XMUINT4 const& iindices );
|
||||
|
||||
void __cdecl SetBlendWeights( XMFLOAT4 const& iweights ) { SetBlendWeights( XMLoadFloat4( &iweights ) ); }
|
||||
void XM_CALLCONV SetBlendWeights( FXMVECTOR iweights );
|
||||
|
||||
static const int InputElementCount = 7;
|
||||
static const D3D11_INPUT_ELEMENT_DESC InputElements[InputElementCount];
|
||||
};
|
||||
}
|
||||
|
|
|
@ -1,125 +1,125 @@
|
|||
// DirectXTK MakeSpriteFont tool
|
||||
//
|
||||
// THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF
|
||||
// ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO
|
||||
// THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A
|
||||
// PARTICULAR PURPOSE.
|
||||
//
|
||||
// Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
//
|
||||
// http://go.microsoft.com/fwlink/?LinkId=248929
|
||||
|
||||
using System;
|
||||
using System.Linq;
|
||||
using System.Collections.Generic;
|
||||
using System.Drawing;
|
||||
using System.Drawing.Imaging;
|
||||
|
||||
namespace MakeSpriteFont
|
||||
{
|
||||
// Extracts font glyphs from a specially marked 2D bitmap. Characters should be
|
||||
// arranged in a grid ordered from top left to bottom right. Monochrome characters
|
||||
// should use white for solid areas and black for transparent areas. To include
|
||||
// multicolored characters, add an alpha channel to the bitmap and use that to
|
||||
// control which parts of the character are solid. The spaces between characters
|
||||
// and around the edges of the grid should be filled with bright pink (red=255,
|
||||
// green=0, blue=255). It doesn't matter if your grid includes lots of wasted space,
|
||||
// because the converter will rearrange characters, packing as tightly as possible.
|
||||
public class BitmapImporter : IFontImporter
|
||||
{
|
||||
// Properties hold the imported font data.
|
||||
public IEnumerable<Glyph> Glyphs { get; private set; }
|
||||
|
||||
public float LineSpacing { get; private set; }
|
||||
|
||||
|
||||
public void Import(CommandLineOptions options)
|
||||
{
|
||||
// Load the source bitmap.
|
||||
Bitmap bitmap;
|
||||
|
||||
try
|
||||
{
|
||||
bitmap = new Bitmap(options.SourceFont);
|
||||
}
|
||||
catch
|
||||
{
|
||||
throw new Exception(string.Format("Unable to load '{0}'.", options.SourceFont));
|
||||
}
|
||||
|
||||
// Convert to our desired pixel format.
|
||||
bitmap = BitmapUtils.ChangePixelFormat(bitmap, PixelFormat.Format32bppArgb);
|
||||
|
||||
// What characters are included in this font?
|
||||
var characters = CharacterRegion.Flatten(options.CharacterRegions).ToArray();
|
||||
int characterIndex = 0;
|
||||
char currentCharacter = '\0';
|
||||
|
||||
// Split the source image into a list of individual glyphs.
|
||||
var glyphList = new List<Glyph>();
|
||||
|
||||
Glyphs = glyphList;
|
||||
LineSpacing = 0;
|
||||
|
||||
foreach (Rectangle rectangle in FindGlyphs(bitmap))
|
||||
{
|
||||
if (characterIndex < characters.Length)
|
||||
currentCharacter = characters[characterIndex++];
|
||||
else
|
||||
currentCharacter++;
|
||||
|
||||
glyphList.Add(new Glyph(currentCharacter, bitmap, rectangle));
|
||||
|
||||
LineSpacing = Math.Max(LineSpacing, rectangle.Height);
|
||||
}
|
||||
|
||||
// If the bitmap doesn't already have an alpha channel, create one now.
|
||||
if (BitmapUtils.IsAlphaEntirely(255, bitmap))
|
||||
{
|
||||
BitmapUtils.ConvertGreyToAlpha(bitmap);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// Searches a 2D bitmap for characters that are surrounded by a marker pink color.
|
||||
static IEnumerable<Rectangle> FindGlyphs(Bitmap bitmap)
|
||||
{
|
||||
using (var bitmapData = new BitmapUtils.PixelAccessor(bitmap, ImageLockMode.ReadOnly))
|
||||
{
|
||||
for (int y = 1; y < bitmap.Height; y++)
|
||||
{
|
||||
for (int x = 1; x < bitmap.Width; x++)
|
||||
{
|
||||
// Look for the top left corner of a character (a pixel that is not pink, but was pink immediately to the left and above it)
|
||||
if (!IsMarkerColor(bitmapData[x, y]) &&
|
||||
IsMarkerColor(bitmapData[x - 1, y]) &&
|
||||
IsMarkerColor(bitmapData[x, y - 1]))
|
||||
{
|
||||
// Measure the size of this character.
|
||||
int w = 1, h = 1;
|
||||
|
||||
while ((x + w < bitmap.Width) && !IsMarkerColor(bitmapData[x + w, y]))
|
||||
{
|
||||
w++;
|
||||
}
|
||||
|
||||
while ((y + h < bitmap.Height) && !IsMarkerColor(bitmapData[x, y + h]))
|
||||
{
|
||||
h++;
|
||||
}
|
||||
|
||||
yield return new Rectangle(x, y, w, h);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// Checks whether a color is the magic magenta marker value.
|
||||
static bool IsMarkerColor(Color color)
|
||||
{
|
||||
return color.ToArgb() == Color.Magenta.ToArgb();
|
||||
}
|
||||
}
|
||||
}
|
||||
// DirectXTK MakeSpriteFont tool
|
||||
//
|
||||
// THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF
|
||||
// ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO
|
||||
// THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A
|
||||
// PARTICULAR PURPOSE.
|
||||
//
|
||||
// Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
//
|
||||
// http://go.microsoft.com/fwlink/?LinkId=248929
|
||||
|
||||
using System;
|
||||
using System.Linq;
|
||||
using System.Collections.Generic;
|
||||
using System.Drawing;
|
||||
using System.Drawing.Imaging;
|
||||
|
||||
namespace MakeSpriteFont
|
||||
{
|
||||
// Extracts font glyphs from a specially marked 2D bitmap. Characters should be
|
||||
// arranged in a grid ordered from top left to bottom right. Monochrome characters
|
||||
// should use white for solid areas and black for transparent areas. To include
|
||||
// multicolored characters, add an alpha channel to the bitmap and use that to
|
||||
// control which parts of the character are solid. The spaces between characters
|
||||
// and around the edges of the grid should be filled with bright pink (red=255,
|
||||
// green=0, blue=255). It doesn't matter if your grid includes lots of wasted space,
|
||||
// because the converter will rearrange characters, packing as tightly as possible.
|
||||
public class BitmapImporter : IFontImporter
|
||||
{
|
||||
// Properties hold the imported font data.
|
||||
public IEnumerable<Glyph> Glyphs { get; private set; }
|
||||
|
||||
public float LineSpacing { get; private set; }
|
||||
|
||||
|
||||
public void Import(CommandLineOptions options)
|
||||
{
|
||||
// Load the source bitmap.
|
||||
Bitmap bitmap;
|
||||
|
||||
try
|
||||
{
|
||||
bitmap = new Bitmap(options.SourceFont);
|
||||
}
|
||||
catch
|
||||
{
|
||||
throw new Exception(string.Format("Unable to load '{0}'.", options.SourceFont));
|
||||
}
|
||||
|
||||
// Convert to our desired pixel format.
|
||||
bitmap = BitmapUtils.ChangePixelFormat(bitmap, PixelFormat.Format32bppArgb);
|
||||
|
||||
// What characters are included in this font?
|
||||
var characters = CharacterRegion.Flatten(options.CharacterRegions).ToArray();
|
||||
int characterIndex = 0;
|
||||
char currentCharacter = '\0';
|
||||
|
||||
// Split the source image into a list of individual glyphs.
|
||||
var glyphList = new List<Glyph>();
|
||||
|
||||
Glyphs = glyphList;
|
||||
LineSpacing = 0;
|
||||
|
||||
foreach (Rectangle rectangle in FindGlyphs(bitmap))
|
||||
{
|
||||
if (characterIndex < characters.Length)
|
||||
currentCharacter = characters[characterIndex++];
|
||||
else
|
||||
currentCharacter++;
|
||||
|
||||
glyphList.Add(new Glyph(currentCharacter, bitmap, rectangle));
|
||||
|
||||
LineSpacing = Math.Max(LineSpacing, rectangle.Height);
|
||||
}
|
||||
|
||||
// If the bitmap doesn't already have an alpha channel, create one now.
|
||||
if (BitmapUtils.IsAlphaEntirely(255, bitmap))
|
||||
{
|
||||
BitmapUtils.ConvertGreyToAlpha(bitmap);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// Searches a 2D bitmap for characters that are surrounded by a marker pink color.
|
||||
static IEnumerable<Rectangle> FindGlyphs(Bitmap bitmap)
|
||||
{
|
||||
using (var bitmapData = new BitmapUtils.PixelAccessor(bitmap, ImageLockMode.ReadOnly))
|
||||
{
|
||||
for (int y = 1; y < bitmap.Height; y++)
|
||||
{
|
||||
for (int x = 1; x < bitmap.Width; x++)
|
||||
{
|
||||
// Look for the top left corner of a character (a pixel that is not pink, but was pink immediately to the left and above it)
|
||||
if (!IsMarkerColor(bitmapData[x, y]) &&
|
||||
IsMarkerColor(bitmapData[x - 1, y]) &&
|
||||
IsMarkerColor(bitmapData[x, y - 1]))
|
||||
{
|
||||
// Measure the size of this character.
|
||||
int w = 1, h = 1;
|
||||
|
||||
while ((x + w < bitmap.Width) && !IsMarkerColor(bitmapData[x + w, y]))
|
||||
{
|
||||
w++;
|
||||
}
|
||||
|
||||
while ((y + h < bitmap.Height) && !IsMarkerColor(bitmapData[x, y + h]))
|
||||
{
|
||||
h++;
|
||||
}
|
||||
|
||||
yield return new Rectangle(x, y, w, h);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// Checks whether a color is the magic magenta marker value.
|
||||
static bool IsMarkerColor(Color color)
|
||||
{
|
||||
return color.ToArgb() == Color.Magenta.ToArgb();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,244 +1,244 @@
|
|||
// DirectXTK MakeSpriteFont tool
|
||||
//
|
||||
// THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF
|
||||
// ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO
|
||||
// THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A
|
||||
// PARTICULAR PURPOSE.
|
||||
//
|
||||
// Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
//
|
||||
// http://go.microsoft.com/fwlink/?LinkId=248929
|
||||
|
||||
using System;
|
||||
using System.Drawing;
|
||||
using System.Drawing.Imaging;
|
||||
using System.Runtime.InteropServices;
|
||||
|
||||
namespace MakeSpriteFont
|
||||
{
|
||||
// Assorted helpers for doing useful things with bitmaps.
|
||||
public static class BitmapUtils
|
||||
{
|
||||
// Copies a rectangular area from one bitmap to another.
|
||||
public static void CopyRect(Bitmap source, Rectangle sourceRegion, Bitmap output, Rectangle outputRegion)
|
||||
{
|
||||
if (sourceRegion.Width != outputRegion.Width ||
|
||||
sourceRegion.Height != outputRegion.Height)
|
||||
{
|
||||
throw new ArgumentException();
|
||||
}
|
||||
|
||||
using (var sourceData = new PixelAccessor(source, ImageLockMode.ReadOnly, sourceRegion))
|
||||
using (var outputData = new PixelAccessor(output, ImageLockMode.WriteOnly, outputRegion))
|
||||
{
|
||||
for (int y = 0; y < sourceRegion.Height; y++)
|
||||
{
|
||||
for (int x = 0; x < sourceRegion.Width; x++)
|
||||
{
|
||||
outputData[x, y] = sourceData[x, y];
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// Checks whether an area of a bitmap contains entirely the specified alpha value.
|
||||
public static bool IsAlphaEntirely(byte expectedAlpha, Bitmap bitmap, Rectangle? region = null)
|
||||
{
|
||||
using (var bitmapData = new PixelAccessor(bitmap, ImageLockMode.ReadOnly, region))
|
||||
{
|
||||
for (int y = 0; y < bitmapData.Region.Height; y++)
|
||||
{
|
||||
for (int x = 0; x < bitmapData.Region.Width; x++)
|
||||
{
|
||||
byte alpha = bitmapData[x, y].A;
|
||||
|
||||
if (alpha != expectedAlpha)
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
// Checks whether a bitmap contains entirely the specified RGB value.
|
||||
public static bool IsRgbEntirely(Color expectedRgb, Bitmap bitmap)
|
||||
{
|
||||
using (var bitmapData = new PixelAccessor(bitmap, ImageLockMode.ReadOnly))
|
||||
{
|
||||
for (int y = 0; y < bitmap.Height; y++)
|
||||
{
|
||||
for (int x = 0; x < bitmap.Width; x++)
|
||||
{
|
||||
Color color = bitmapData[x, y];
|
||||
|
||||
if (color.A == 0)
|
||||
continue;
|
||||
|
||||
if ((color.R != expectedRgb.R) ||
|
||||
(color.G != expectedRgb.G) ||
|
||||
(color.B != expectedRgb.B))
|
||||
{
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
// Converts greyscale luminosity to alpha data.
|
||||
public static void ConvertGreyToAlpha(Bitmap bitmap)
|
||||
{
|
||||
using (var bitmapData = new PixelAccessor(bitmap, ImageLockMode.ReadWrite))
|
||||
{
|
||||
for (int y = 0; y < bitmap.Height; y++)
|
||||
{
|
||||
for (int x = 0; x < bitmap.Width; x++)
|
||||
{
|
||||
Color color = bitmapData[x, y];
|
||||
|
||||
// Average the red, green and blue values to compute brightness.
|
||||
int alpha = (color.R + color.G + color.B) / 3;
|
||||
|
||||
bitmapData[x, y] = Color.FromArgb(alpha, 255, 255, 255);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// Converts a bitmap to premultiplied alpha format.
|
||||
public static void PremultiplyAlpha(Bitmap bitmap)
|
||||
{
|
||||
using (var bitmapData = new PixelAccessor(bitmap, ImageLockMode.ReadWrite))
|
||||
{
|
||||
for (int y = 0; y < bitmap.Height; y++)
|
||||
{
|
||||
for (int x = 0; x < bitmap.Width; x++)
|
||||
{
|
||||
Color color = bitmapData[x, y];
|
||||
|
||||
int a = color.A;
|
||||
int r = color.R * a / 255;
|
||||
int g = color.G * a / 255;
|
||||
int b = color.B * a / 255;
|
||||
|
||||
bitmapData[x, y] = Color.FromArgb(a, r, g, b);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// To avoid filtering artifacts when scaling or rotating fonts that do not use premultiplied alpha,
|
||||
// make sure the one pixel border around each glyph contains the same RGB values as the edge of the
|
||||
// glyph itself, but with zero alpha. This processing is an elaborate no-op when using premultiplied
|
||||
// alpha, because the premultiply conversion will change the RGB of all such zero alpha pixels to black.
|
||||
public static void PadBorderPixels(Bitmap bitmap, Rectangle region)
|
||||
{
|
||||
using (var bitmapData = new PixelAccessor(bitmap, ImageLockMode.ReadWrite))
|
||||
{
|
||||
// Pad the top and bottom.
|
||||
for (int x = region.Left; x < region.Right; x++)
|
||||
{
|
||||
CopyBorderPixel(bitmapData, x, region.Top, x, region.Top - 1);
|
||||
CopyBorderPixel(bitmapData, x, region.Bottom - 1, x, region.Bottom);
|
||||
}
|
||||
|
||||
// Pad the left and right.
|
||||
for (int y = region.Top; y < region.Bottom; y++)
|
||||
{
|
||||
CopyBorderPixel(bitmapData, region.Left, y, region.Left - 1, y);
|
||||
CopyBorderPixel(bitmapData, region.Right - 1, y, region.Right, y);
|
||||
}
|
||||
|
||||
// Pad the four corners.
|
||||
CopyBorderPixel(bitmapData, region.Left, region.Top, region.Left - 1, region.Top - 1);
|
||||
CopyBorderPixel(bitmapData, region.Right - 1, region.Top, region.Right, region.Top - 1);
|
||||
CopyBorderPixel(bitmapData, region.Left, region.Bottom - 1, region.Left - 1, region.Bottom);
|
||||
CopyBorderPixel(bitmapData, region.Right - 1, region.Bottom - 1, region.Right, region.Bottom);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// Copies a single pixel within a bitmap, preserving RGB but forcing alpha to zero.
|
||||
static void CopyBorderPixel(PixelAccessor bitmapData, int sourceX, int sourceY, int destX, int destY)
|
||||
{
|
||||
Color color = bitmapData[sourceX, sourceY];
|
||||
|
||||
bitmapData[destX, destY] = Color.FromArgb(0, color);
|
||||
}
|
||||
|
||||
|
||||
// Converts a bitmap to the specified pixel format.
|
||||
public static Bitmap ChangePixelFormat(Bitmap bitmap, PixelFormat format)
|
||||
{
|
||||
Rectangle bounds = new Rectangle(0, 0, bitmap.Width, bitmap.Height);
|
||||
|
||||
return bitmap.Clone(bounds, format);
|
||||
}
|
||||
|
||||
|
||||
// Helper for locking a bitmap and efficiently reading or writing its pixels.
|
||||
public sealed class PixelAccessor : IDisposable
|
||||
{
|
||||
// Constructor locks the bitmap.
|
||||
public PixelAccessor(Bitmap bitmap, ImageLockMode mode, Rectangle? region = null)
|
||||
{
|
||||
this.bitmap = bitmap;
|
||||
|
||||
this.Region = region.GetValueOrDefault(new Rectangle(0, 0, bitmap.Width, bitmap.Height));
|
||||
|
||||
this.data = bitmap.LockBits(Region, mode, PixelFormat.Format32bppArgb);
|
||||
}
|
||||
|
||||
|
||||
// Dispose unlocks the bitmap.
|
||||
public void Dispose()
|
||||
{
|
||||
if (data != null)
|
||||
{
|
||||
bitmap.UnlockBits(data);
|
||||
|
||||
data = null;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// Query what part of the bitmap is locked.
|
||||
public Rectangle Region { get; private set; }
|
||||
|
||||
|
||||
// Get or set a pixel value.
|
||||
public Color this[int x, int y]
|
||||
{
|
||||
get
|
||||
{
|
||||
return Color.FromArgb(Marshal.ReadInt32(PixelAddress(x, y)));
|
||||
}
|
||||
|
||||
set
|
||||
{
|
||||
Marshal.WriteInt32(PixelAddress(x, y), value.ToArgb());
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// Helper computes the address of the specified pixel.
|
||||
IntPtr PixelAddress(int x, int y)
|
||||
{
|
||||
return data.Scan0 + (y * data.Stride) + (x * sizeof(int));
|
||||
}
|
||||
|
||||
|
||||
// Fields.
|
||||
Bitmap bitmap;
|
||||
BitmapData data;
|
||||
}
|
||||
}
|
||||
}
|
||||
// DirectXTK MakeSpriteFont tool
|
||||
//
|
||||
// THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF
|
||||
// ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO
|
||||
// THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A
|
||||
// PARTICULAR PURPOSE.
|
||||
//
|
||||
// Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
//
|
||||
// http://go.microsoft.com/fwlink/?LinkId=248929
|
||||
|
||||
using System;
|
||||
using System.Drawing;
|
||||
using System.Drawing.Imaging;
|
||||
using System.Runtime.InteropServices;
|
||||
|
||||
namespace MakeSpriteFont
|
||||
{
|
||||
// Assorted helpers for doing useful things with bitmaps.
|
||||
public static class BitmapUtils
|
||||
{
|
||||
// Copies a rectangular area from one bitmap to another.
|
||||
public static void CopyRect(Bitmap source, Rectangle sourceRegion, Bitmap output, Rectangle outputRegion)
|
||||
{
|
||||
if (sourceRegion.Width != outputRegion.Width ||
|
||||
sourceRegion.Height != outputRegion.Height)
|
||||
{
|
||||
throw new ArgumentException();
|
||||
}
|
||||
|
||||
using (var sourceData = new PixelAccessor(source, ImageLockMode.ReadOnly, sourceRegion))
|
||||
using (var outputData = new PixelAccessor(output, ImageLockMode.WriteOnly, outputRegion))
|
||||
{
|
||||
for (int y = 0; y < sourceRegion.Height; y++)
|
||||
{
|
||||
for (int x = 0; x < sourceRegion.Width; x++)
|
||||
{
|
||||
outputData[x, y] = sourceData[x, y];
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// Checks whether an area of a bitmap contains entirely the specified alpha value.
|
||||
public static bool IsAlphaEntirely(byte expectedAlpha, Bitmap bitmap, Rectangle? region = null)
|
||||
{
|
||||
using (var bitmapData = new PixelAccessor(bitmap, ImageLockMode.ReadOnly, region))
|
||||
{
|
||||
for (int y = 0; y < bitmapData.Region.Height; y++)
|
||||
{
|
||||
for (int x = 0; x < bitmapData.Region.Width; x++)
|
||||
{
|
||||
byte alpha = bitmapData[x, y].A;
|
||||
|
||||
if (alpha != expectedAlpha)
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
// Checks whether a bitmap contains entirely the specified RGB value.
|
||||
public static bool IsRgbEntirely(Color expectedRgb, Bitmap bitmap)
|
||||
{
|
||||
using (var bitmapData = new PixelAccessor(bitmap, ImageLockMode.ReadOnly))
|
||||
{
|
||||
for (int y = 0; y < bitmap.Height; y++)
|
||||
{
|
||||
for (int x = 0; x < bitmap.Width; x++)
|
||||
{
|
||||
Color color = bitmapData[x, y];
|
||||
|
||||
if (color.A == 0)
|
||||
continue;
|
||||
|
||||
if ((color.R != expectedRgb.R) ||
|
||||
(color.G != expectedRgb.G) ||
|
||||
(color.B != expectedRgb.B))
|
||||
{
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
// Converts greyscale luminosity to alpha data.
|
||||
public static void ConvertGreyToAlpha(Bitmap bitmap)
|
||||
{
|
||||
using (var bitmapData = new PixelAccessor(bitmap, ImageLockMode.ReadWrite))
|
||||
{
|
||||
for (int y = 0; y < bitmap.Height; y++)
|
||||
{
|
||||
for (int x = 0; x < bitmap.Width; x++)
|
||||
{
|
||||
Color color = bitmapData[x, y];
|
||||
|
||||
// Average the red, green and blue values to compute brightness.
|
||||
int alpha = (color.R + color.G + color.B) / 3;
|
||||
|
||||
bitmapData[x, y] = Color.FromArgb(alpha, 255, 255, 255);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// Converts a bitmap to premultiplied alpha format.
|
||||
public static void PremultiplyAlpha(Bitmap bitmap)
|
||||
{
|
||||
using (var bitmapData = new PixelAccessor(bitmap, ImageLockMode.ReadWrite))
|
||||
{
|
||||
for (int y = 0; y < bitmap.Height; y++)
|
||||
{
|
||||
for (int x = 0; x < bitmap.Width; x++)
|
||||
{
|
||||
Color color = bitmapData[x, y];
|
||||
|
||||
int a = color.A;
|
||||
int r = color.R * a / 255;
|
||||
int g = color.G * a / 255;
|
||||
int b = color.B * a / 255;
|
||||
|
||||
bitmapData[x, y] = Color.FromArgb(a, r, g, b);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// To avoid filtering artifacts when scaling or rotating fonts that do not use premultiplied alpha,
|
||||
// make sure the one pixel border around each glyph contains the same RGB values as the edge of the
|
||||
// glyph itself, but with zero alpha. This processing is an elaborate no-op when using premultiplied
|
||||
// alpha, because the premultiply conversion will change the RGB of all such zero alpha pixels to black.
|
||||
public static void PadBorderPixels(Bitmap bitmap, Rectangle region)
|
||||
{
|
||||
using (var bitmapData = new PixelAccessor(bitmap, ImageLockMode.ReadWrite))
|
||||
{
|
||||
// Pad the top and bottom.
|
||||
for (int x = region.Left; x < region.Right; x++)
|
||||
{
|
||||
CopyBorderPixel(bitmapData, x, region.Top, x, region.Top - 1);
|
||||
CopyBorderPixel(bitmapData, x, region.Bottom - 1, x, region.Bottom);
|
||||
}
|
||||
|
||||
// Pad the left and right.
|
||||
for (int y = region.Top; y < region.Bottom; y++)
|
||||
{
|
||||
CopyBorderPixel(bitmapData, region.Left, y, region.Left - 1, y);
|
||||
CopyBorderPixel(bitmapData, region.Right - 1, y, region.Right, y);
|
||||
}
|
||||
|
||||
// Pad the four corners.
|
||||
CopyBorderPixel(bitmapData, region.Left, region.Top, region.Left - 1, region.Top - 1);
|
||||
CopyBorderPixel(bitmapData, region.Right - 1, region.Top, region.Right, region.Top - 1);
|
||||
CopyBorderPixel(bitmapData, region.Left, region.Bottom - 1, region.Left - 1, region.Bottom);
|
||||
CopyBorderPixel(bitmapData, region.Right - 1, region.Bottom - 1, region.Right, region.Bottom);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// Copies a single pixel within a bitmap, preserving RGB but forcing alpha to zero.
|
||||
static void CopyBorderPixel(PixelAccessor bitmapData, int sourceX, int sourceY, int destX, int destY)
|
||||
{
|
||||
Color color = bitmapData[sourceX, sourceY];
|
||||
|
||||
bitmapData[destX, destY] = Color.FromArgb(0, color);
|
||||
}
|
||||
|
||||
|
||||
// Converts a bitmap to the specified pixel format.
|
||||
public static Bitmap ChangePixelFormat(Bitmap bitmap, PixelFormat format)
|
||||
{
|
||||
Rectangle bounds = new Rectangle(0, 0, bitmap.Width, bitmap.Height);
|
||||
|
||||
return bitmap.Clone(bounds, format);
|
||||
}
|
||||
|
||||
|
||||
// Helper for locking a bitmap and efficiently reading or writing its pixels.
|
||||
public sealed class PixelAccessor : IDisposable
|
||||
{
|
||||
// Constructor locks the bitmap.
|
||||
public PixelAccessor(Bitmap bitmap, ImageLockMode mode, Rectangle? region = null)
|
||||
{
|
||||
this.bitmap = bitmap;
|
||||
|
||||
this.Region = region.GetValueOrDefault(new Rectangle(0, 0, bitmap.Width, bitmap.Height));
|
||||
|
||||
this.data = bitmap.LockBits(Region, mode, PixelFormat.Format32bppArgb);
|
||||
}
|
||||
|
||||
|
||||
// Dispose unlocks the bitmap.
|
||||
public void Dispose()
|
||||
{
|
||||
if (data != null)
|
||||
{
|
||||
bitmap.UnlockBits(data);
|
||||
|
||||
data = null;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// Query what part of the bitmap is locked.
|
||||
public Rectangle Region { get; private set; }
|
||||
|
||||
|
||||
// Get or set a pixel value.
|
||||
public Color this[int x, int y]
|
||||
{
|
||||
get
|
||||
{
|
||||
return Color.FromArgb(Marshal.ReadInt32(PixelAddress(x, y)));
|
||||
}
|
||||
|
||||
set
|
||||
{
|
||||
Marshal.WriteInt32(PixelAddress(x, y), value.ToArgb());
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// Helper computes the address of the specified pixel.
|
||||
IntPtr PixelAddress(int x, int y)
|
||||
{
|
||||
return data.Scan0 + (y * data.Stride) + (x * sizeof(int));
|
||||
}
|
||||
|
||||
|
||||
// Fields.
|
||||
Bitmap bitmap;
|
||||
BitmapData data;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,137 +1,137 @@
|
|||
// DirectXTK MakeSpriteFont tool
|
||||
//
|
||||
// THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF
|
||||
// ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO
|
||||
// THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A
|
||||
// PARTICULAR PURPOSE.
|
||||
//
|
||||
// Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
//
|
||||
// http://go.microsoft.com/fwlink/?LinkId=248929
|
||||
|
||||
using System;
|
||||
using System.Linq;
|
||||
using System.ComponentModel;
|
||||
using System.Globalization;
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace MakeSpriteFont
|
||||
{
|
||||
// Describes a range of consecutive characters that should be included in the font.
|
||||
[TypeConverter(typeof(CharacterRegionTypeConverter))]
|
||||
public class CharacterRegion
|
||||
{
|
||||
// Constructor.
|
||||
public CharacterRegion(char start, char end)
|
||||
{
|
||||
if (start > end)
|
||||
throw new ArgumentException();
|
||||
|
||||
this.Start = start;
|
||||
this.End = end;
|
||||
}
|
||||
|
||||
|
||||
// Fields.
|
||||
public char Start;
|
||||
public char End;
|
||||
|
||||
|
||||
// Enumerates all characters within the region.
|
||||
public IEnumerable<Char> Characters
|
||||
{
|
||||
get
|
||||
{
|
||||
for (char c = Start; c <= End; c++)
|
||||
{
|
||||
yield return c;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// Flattens a list of character regions into a combined list of individual characters.
|
||||
public static IEnumerable<Char> Flatten(IEnumerable<CharacterRegion> regions)
|
||||
{
|
||||
if (regions.Any())
|
||||
{
|
||||
// If we have any regions, flatten them and remove duplicates.
|
||||
return regions.SelectMany(region => region.Characters).Distinct();
|
||||
}
|
||||
else
|
||||
{
|
||||
// If no regions were specified, use the default.
|
||||
return defaultRegion.Characters;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// Default to just the base ASCII character set.
|
||||
static CharacterRegion defaultRegion = new CharacterRegion(' ', '~');
|
||||
}
|
||||
|
||||
|
||||
|
||||
// Custom type converter enables CommandLineParser to parse CharacterRegion command line options.
|
||||
public class CharacterRegionTypeConverter : TypeConverter
|
||||
{
|
||||
public override bool CanConvertFrom(ITypeDescriptorContext context, Type sourceType)
|
||||
{
|
||||
return sourceType == typeof(string);
|
||||
}
|
||||
|
||||
|
||||
public override object ConvertFrom(ITypeDescriptorContext context, CultureInfo culture, object value)
|
||||
{
|
||||
// Input must be a string.
|
||||
string source = value as string;
|
||||
|
||||
if (string.IsNullOrEmpty(source))
|
||||
{
|
||||
throw new ArgumentException();
|
||||
}
|
||||
|
||||
// Supported input formats:
|
||||
// A
|
||||
// A-Z
|
||||
// 32-127
|
||||
// 0x20-0x7F
|
||||
|
||||
char[] split = source.Split('-')
|
||||
.Select(ConvertCharacter)
|
||||
.ToArray();
|
||||
|
||||
switch (split.Length)
|
||||
{
|
||||
case 1:
|
||||
// Only a single character (eg. "a").
|
||||
return new CharacterRegion(split[0], split[0]);
|
||||
|
||||
case 2:
|
||||
// Range of characters (eg. "a-z").
|
||||
return new CharacterRegion(split[0], split[1]);
|
||||
|
||||
default:
|
||||
throw new ArgumentException();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
static char ConvertCharacter(string value)
|
||||
{
|
||||
if (value.Length == 1)
|
||||
{
|
||||
// Single character directly specifies a codepoint.
|
||||
return value[0];
|
||||
}
|
||||
else
|
||||
{
|
||||
// Otherwise it must be an integer (eg. "32" or "0x20").
|
||||
return (char)(int)intConverter.ConvertFromInvariantString(value);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
static TypeConverter intConverter = TypeDescriptor.GetConverter(typeof(int));
|
||||
}
|
||||
}
|
||||
// DirectXTK MakeSpriteFont tool
|
||||
//
|
||||
// THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF
|
||||
// ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO
|
||||
// THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A
|
||||
// PARTICULAR PURPOSE.
|
||||
//
|
||||
// Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
//
|
||||
// http://go.microsoft.com/fwlink/?LinkId=248929
|
||||
|
||||
using System;
|
||||
using System.Linq;
|
||||
using System.ComponentModel;
|
||||
using System.Globalization;
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace MakeSpriteFont
|
||||
{
|
||||
// Describes a range of consecutive characters that should be included in the font.
|
||||
[TypeConverter(typeof(CharacterRegionTypeConverter))]
|
||||
public class CharacterRegion
|
||||
{
|
||||
// Constructor.
|
||||
public CharacterRegion(char start, char end)
|
||||
{
|
||||
if (start > end)
|
||||
throw new ArgumentException();
|
||||
|
||||
this.Start = start;
|
||||
this.End = end;
|
||||
}
|
||||
|
||||
|
||||
// Fields.
|
||||
public char Start;
|
||||
public char End;
|
||||
|
||||
|
||||
// Enumerates all characters within the region.
|
||||
public IEnumerable<Char> Characters
|
||||
{
|
||||
get
|
||||
{
|
||||
for (char c = Start; c <= End; c++)
|
||||
{
|
||||
yield return c;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// Flattens a list of character regions into a combined list of individual characters.
|
||||
public static IEnumerable<Char> Flatten(IEnumerable<CharacterRegion> regions)
|
||||
{
|
||||
if (regions.Any())
|
||||
{
|
||||
// If we have any regions, flatten them and remove duplicates.
|
||||
return regions.SelectMany(region => region.Characters).Distinct();
|
||||
}
|
||||
else
|
||||
{
|
||||
// If no regions were specified, use the default.
|
||||
return defaultRegion.Characters;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// Default to just the base ASCII character set.
|
||||
static CharacterRegion defaultRegion = new CharacterRegion(' ', '~');
|
||||
}
|
||||
|
||||
|
||||
|
||||
// Custom type converter enables CommandLineParser to parse CharacterRegion command line options.
|
||||
public class CharacterRegionTypeConverter : TypeConverter
|
||||
{
|
||||
public override bool CanConvertFrom(ITypeDescriptorContext context, Type sourceType)
|
||||
{
|
||||
return sourceType == typeof(string);
|
||||
}
|
||||
|
||||
|
||||
public override object ConvertFrom(ITypeDescriptorContext context, CultureInfo culture, object value)
|
||||
{
|
||||
// Input must be a string.
|
||||
string source = value as string;
|
||||
|
||||
if (string.IsNullOrEmpty(source))
|
||||
{
|
||||
throw new ArgumentException();
|
||||
}
|
||||
|
||||
// Supported input formats:
|
||||
// A
|
||||
// A-Z
|
||||
// 32-127
|
||||
// 0x20-0x7F
|
||||
|
||||
char[] split = source.Split('-')
|
||||
.Select(ConvertCharacter)
|
||||
.ToArray();
|
||||
|
||||
switch (split.Length)
|
||||
{
|
||||
case 1:
|
||||
// Only a single character (eg. "a").
|
||||
return new CharacterRegion(split[0], split[0]);
|
||||
|
||||
case 2:
|
||||
// Range of characters (eg. "a-z").
|
||||
return new CharacterRegion(split[0], split[1]);
|
||||
|
||||
default:
|
||||
throw new ArgumentException();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
static char ConvertCharacter(string value)
|
||||
{
|
||||
if (value.Length == 1)
|
||||
{
|
||||
// Single character directly specifies a codepoint.
|
||||
return value[0];
|
||||
}
|
||||
else
|
||||
{
|
||||
// Otherwise it must be an integer (eg. "32" or "0x20").
|
||||
return (char)(int)intConverter.ConvertFromInvariantString(value);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
static TypeConverter intConverter = TypeDescriptor.GetConverter(typeof(int));
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,99 +1,99 @@
|
|||
// DirectXTK MakeSpriteFont tool
|
||||
//
|
||||
// THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF
|
||||
// ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO
|
||||
// THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A
|
||||
// PARTICULAR PURPOSE.
|
||||
//
|
||||
// Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
//
|
||||
// http://go.microsoft.com/fwlink/?LinkId=248929
|
||||
|
||||
using System.Collections.Generic;
|
||||
using System.Drawing;
|
||||
|
||||
namespace MakeSpriteFont
|
||||
{
|
||||
// Available output texture formats.
|
||||
public enum TextureFormat
|
||||
{
|
||||
Auto,
|
||||
Rgba32,
|
||||
Bgra4444,
|
||||
CompressedMono,
|
||||
}
|
||||
|
||||
|
||||
// Feature levels
|
||||
public enum FeatureLevel
|
||||
{
|
||||
FL9_1,
|
||||
FL9_2,
|
||||
FL9_3,
|
||||
FL10_0,
|
||||
FL10_1,
|
||||
FL11_0,
|
||||
FL11_1,
|
||||
FL12_0,
|
||||
FL12_1,
|
||||
}
|
||||
|
||||
|
||||
// Options telling the tool what to do.
|
||||
public class CommandLineOptions
|
||||
{
|
||||
// Input can be either a system (TrueType) font or a specially marked bitmap file.
|
||||
[CommandLineParser.Required]
|
||||
public string SourceFont;
|
||||
|
||||
|
||||
// Output spritefont binary.
|
||||
[CommandLineParser.Required]
|
||||
public string OutputFile;
|
||||
|
||||
|
||||
// Which characters to include in the font (eg. "/CharacterRegion:0x20-0x7F /CharacterRegion:0x123")
|
||||
[CommandLineParser.Name("CharacterRegion")]
|
||||
public readonly List<CharacterRegion> CharacterRegions = new List<CharacterRegion>();
|
||||
|
||||
|
||||
// Fallback character used when asked to render a codepoint that is not
|
||||
// included in the font. If zero, missing characters throw exceptions.
|
||||
public readonly int DefaultCharacter = 0;
|
||||
|
||||
|
||||
// Size and style for TrueType fonts (ignored when converting a bitmap font).
|
||||
public float FontSize = 23;
|
||||
|
||||
public FontStyle FontStyle = FontStyle.Regular;
|
||||
|
||||
|
||||
// Spacing overrides. Zero is default spacing, negative closer together, positive further apart.
|
||||
public float LineSpacing = 0;
|
||||
public float CharacterSpacing = 0;
|
||||
|
||||
|
||||
// Use smooth or sharp antialiasing mode for TrueType rasterization?
|
||||
public bool Sharp = false;
|
||||
|
||||
|
||||
// What format should the output texture be?
|
||||
public TextureFormat TextureFormat = TextureFormat.Auto;
|
||||
|
||||
|
||||
// By default, font textures use premultiplied alpha format. Set this if you want interpolative alpha instead.
|
||||
public bool NoPremultiply = false;
|
||||
|
||||
|
||||
// Dumps the generated sprite texture to a bitmap file (useful for debugging).
|
||||
public string DebugOutputSpriteSheet = null;
|
||||
|
||||
|
||||
// Controls texture-size based warnings
|
||||
public FeatureLevel FeatureLevel = FeatureLevel.FL9_1;
|
||||
|
||||
|
||||
// For large fonts, the default tightest pack is too slow
|
||||
public bool FastPack = false;
|
||||
}
|
||||
}
|
||||
// DirectXTK MakeSpriteFont tool
|
||||
//
|
||||
// THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF
|
||||
// ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO
|
||||
// THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A
|
||||
// PARTICULAR PURPOSE.
|
||||
//
|
||||
// Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
//
|
||||
// http://go.microsoft.com/fwlink/?LinkId=248929
|
||||
|
||||
using System.Collections.Generic;
|
||||
using System.Drawing;
|
||||
|
||||
namespace MakeSpriteFont
|
||||
{
|
||||
// Available output texture formats.
|
||||
public enum TextureFormat
|
||||
{
|
||||
Auto,
|
||||
Rgba32,
|
||||
Bgra4444,
|
||||
CompressedMono,
|
||||
}
|
||||
|
||||
|
||||
// Feature levels
|
||||
public enum FeatureLevel
|
||||
{
|
||||
FL9_1,
|
||||
FL9_2,
|
||||
FL9_3,
|
||||
FL10_0,
|
||||
FL10_1,
|
||||
FL11_0,
|
||||
FL11_1,
|
||||
FL12_0,
|
||||
FL12_1,
|
||||
}
|
||||
|
||||
|
||||
// Options telling the tool what to do.
|
||||
public class CommandLineOptions
|
||||
{
|
||||
// Input can be either a system (TrueType) font or a specially marked bitmap file.
|
||||
[CommandLineParser.Required]
|
||||
public string SourceFont;
|
||||
|
||||
|
||||
// Output spritefont binary.
|
||||
[CommandLineParser.Required]
|
||||
public string OutputFile;
|
||||
|
||||
|
||||
// Which characters to include in the font (eg. "/CharacterRegion:0x20-0x7F /CharacterRegion:0x123")
|
||||
[CommandLineParser.Name("CharacterRegion")]
|
||||
public readonly List<CharacterRegion> CharacterRegions = new List<CharacterRegion>();
|
||||
|
||||
|
||||
// Fallback character used when asked to render a codepoint that is not
|
||||
// included in the font. If zero, missing characters throw exceptions.
|
||||
public readonly int DefaultCharacter = 0;
|
||||
|
||||
|
||||
// Size and style for TrueType fonts (ignored when converting a bitmap font).
|
||||
public float FontSize = 23;
|
||||
|
||||
public FontStyle FontStyle = FontStyle.Regular;
|
||||
|
||||
|
||||
// Spacing overrides. Zero is default spacing, negative closer together, positive further apart.
|
||||
public float LineSpacing = 0;
|
||||
public float CharacterSpacing = 0;
|
||||
|
||||
|
||||
// Use smooth or sharp antialiasing mode for TrueType rasterization?
|
||||
public bool Sharp = false;
|
||||
|
||||
|
||||
// What format should the output texture be?
|
||||
public TextureFormat TextureFormat = TextureFormat.Auto;
|
||||
|
||||
|
||||
// By default, font textures use premultiplied alpha format. Set this if you want interpolative alpha instead.
|
||||
public bool NoPremultiply = false;
|
||||
|
||||
|
||||
// Dumps the generated sprite texture to a bitmap file (useful for debugging).
|
||||
public string DebugOutputSpriteSheet = null;
|
||||
|
||||
|
||||
// Controls texture-size based warnings
|
||||
public FeatureLevel FeatureLevel = FeatureLevel.FL9_1;
|
||||
|
||||
|
||||
// For large fonts, the default tightest pack is too slow
|
||||
public bool FastPack = false;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,253 +1,253 @@
|
|||
// DirectXTK MakeSpriteFont tool
|
||||
//
|
||||
// THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF
|
||||
// ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO
|
||||
// THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A
|
||||
// PARTICULAR PURPOSE.
|
||||
//
|
||||
// Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
//
|
||||
// http://go.microsoft.com/fwlink/?LinkId=248929
|
||||
|
||||
using System;
|
||||
using System.IO;
|
||||
using System.Linq;
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using System.Diagnostics;
|
||||
using System.Reflection;
|
||||
using System.ComponentModel;
|
||||
|
||||
namespace MakeSpriteFont
|
||||
{
|
||||
// Reusable, reflection based helper for parsing commandline options.
|
||||
public class CommandLineParser
|
||||
{
|
||||
object optionsObject;
|
||||
|
||||
Queue<FieldInfo> requiredOptions = new Queue<FieldInfo>();
|
||||
Dictionary<string, FieldInfo> optionalOptions = new Dictionary<string, FieldInfo>();
|
||||
|
||||
List<string> requiredUsageHelp = new List<string>();
|
||||
List<string> optionalUsageHelp = new List<string>();
|
||||
|
||||
|
||||
// Constructor.
|
||||
public CommandLineParser(object optionsObject)
|
||||
{
|
||||
this.optionsObject = optionsObject;
|
||||
|
||||
// Reflect to find what commandline options are available.
|
||||
foreach (FieldInfo field in optionsObject.GetType().GetFields())
|
||||
{
|
||||
string fieldName = GetOptionName(field);
|
||||
|
||||
if (GetAttribute<RequiredAttribute>(field) != null)
|
||||
{
|
||||
// Record a required option.
|
||||
requiredOptions.Enqueue(field);
|
||||
|
||||
requiredUsageHelp.Add(string.Format("<{0}>", fieldName));
|
||||
}
|
||||
else
|
||||
{
|
||||
// Record an optional option.
|
||||
optionalOptions.Add(fieldName.ToLowerInvariant(), field);
|
||||
|
||||
if (field.FieldType == typeof(bool))
|
||||
{
|
||||
optionalUsageHelp.Add(string.Format("/{0}", fieldName));
|
||||
}
|
||||
else
|
||||
{
|
||||
optionalUsageHelp.Add(string.Format("/{0}:value", fieldName));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public bool ParseCommandLine(string[] args)
|
||||
{
|
||||
// Parse each argument in turn.
|
||||
foreach (string arg in args)
|
||||
{
|
||||
if (!ParseArgument(arg.Trim()))
|
||||
{
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
// Make sure we got all the required options.
|
||||
FieldInfo missingRequiredOption = requiredOptions.FirstOrDefault(field => !IsList(field) || GetList(field).Count == 0);
|
||||
|
||||
if (missingRequiredOption != null)
|
||||
{
|
||||
ShowError("Missing argument '{0}'", GetOptionName(missingRequiredOption));
|
||||
return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
bool ParseArgument(string arg)
|
||||
{
|
||||
if (arg.StartsWith("/"))
|
||||
{
|
||||
// Parse an optional argument.
|
||||
char[] separators = { ':' };
|
||||
|
||||
string[] split = arg.Substring(1).Split(separators, 2, StringSplitOptions.None);
|
||||
|
||||
string name = split[0];
|
||||
string value = (split.Length > 1) ? split[1] : "true";
|
||||
|
||||
FieldInfo field;
|
||||
|
||||
if (!optionalOptions.TryGetValue(name.ToLowerInvariant(), out field))
|
||||
{
|
||||
ShowError("Unknown option '{0}'", name);
|
||||
return false;
|
||||
}
|
||||
|
||||
return SetOption(field, value);
|
||||
}
|
||||
else
|
||||
{
|
||||
// Parse a required argument.
|
||||
if (requiredOptions.Count == 0)
|
||||
{
|
||||
ShowError("Too many arguments");
|
||||
return false;
|
||||
}
|
||||
|
||||
FieldInfo field = requiredOptions.Peek();
|
||||
|
||||
if (!IsList(field))
|
||||
{
|
||||
requiredOptions.Dequeue();
|
||||
}
|
||||
|
||||
return SetOption(field, arg);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
bool SetOption(FieldInfo field, string value)
|
||||
{
|
||||
try
|
||||
{
|
||||
if (IsList(field))
|
||||
{
|
||||
// Append this value to a list of options.
|
||||
GetList(field).Add(ChangeType(value, ListElementType(field)));
|
||||
}
|
||||
else
|
||||
{
|
||||
// Set the value of a single option.
|
||||
field.SetValue(optionsObject, ChangeType(value, field.FieldType));
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
catch
|
||||
{
|
||||
ShowError("Invalid value '{0}' for option '{1}'", value, GetOptionName(field));
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
static object ChangeType(string value, Type type)
|
||||
{
|
||||
TypeConverter converter = TypeDescriptor.GetConverter(type);
|
||||
|
||||
return converter.ConvertFromInvariantString(value);
|
||||
}
|
||||
|
||||
|
||||
static bool IsList(FieldInfo field)
|
||||
{
|
||||
return typeof(IList).IsAssignableFrom(field.FieldType);
|
||||
}
|
||||
|
||||
|
||||
IList GetList(FieldInfo field)
|
||||
{
|
||||
return (IList)field.GetValue(optionsObject);
|
||||
}
|
||||
|
||||
|
||||
static Type ListElementType(FieldInfo field)
|
||||
{
|
||||
var interfaces = from i in field.FieldType.GetInterfaces()
|
||||
where i.IsGenericType && i.GetGenericTypeDefinition() == typeof(IEnumerable<>)
|
||||
select i;
|
||||
|
||||
return interfaces.First().GetGenericArguments()[0];
|
||||
}
|
||||
|
||||
|
||||
static string GetOptionName(FieldInfo field)
|
||||
{
|
||||
var nameAttribute = GetAttribute<NameAttribute>(field);
|
||||
|
||||
if (nameAttribute != null)
|
||||
{
|
||||
return nameAttribute.Name;
|
||||
}
|
||||
else
|
||||
{
|
||||
return field.Name;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void ShowError(string message, params object[] args)
|
||||
{
|
||||
string name = Path.GetFileNameWithoutExtension(Process.GetCurrentProcess().ProcessName);
|
||||
|
||||
Console.Error.WriteLine(message, args);
|
||||
Console.Error.WriteLine();
|
||||
Console.Error.WriteLine("Usage: {0} {1}", name, string.Join(" ", requiredUsageHelp));
|
||||
|
||||
if (optionalUsageHelp.Count > 0)
|
||||
{
|
||||
Console.Error.WriteLine();
|
||||
Console.Error.WriteLine("Options:");
|
||||
|
||||
foreach (string optional in optionalUsageHelp)
|
||||
{
|
||||
Console.Error.WriteLine(" {0}", optional);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
static T GetAttribute<T>(ICustomAttributeProvider provider) where T : Attribute
|
||||
{
|
||||
return provider.GetCustomAttributes(typeof(T), false).OfType<T>().FirstOrDefault();
|
||||
}
|
||||
|
||||
|
||||
// Used on optionsObject fields to indicate which options are required.
|
||||
[AttributeUsage(AttributeTargets.Field)]
|
||||
public sealed class RequiredAttribute : Attribute
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
// Used on an optionsObject field to rename the corresponding commandline option.
|
||||
[AttributeUsage(AttributeTargets.Field)]
|
||||
public sealed class NameAttribute : Attribute
|
||||
{
|
||||
public NameAttribute(string name)
|
||||
{
|
||||
this.Name = name;
|
||||
}
|
||||
|
||||
public string Name { get; private set; }
|
||||
}
|
||||
}
|
||||
}
|
||||
// DirectXTK MakeSpriteFont tool
|
||||
//
|
||||
// THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF
|
||||
// ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO
|
||||
// THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A
|
||||
// PARTICULAR PURPOSE.
|
||||
//
|
||||
// Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
//
|
||||
// http://go.microsoft.com/fwlink/?LinkId=248929
|
||||
|
||||
using System;
|
||||
using System.IO;
|
||||
using System.Linq;
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using System.Diagnostics;
|
||||
using System.Reflection;
|
||||
using System.ComponentModel;
|
||||
|
||||
namespace MakeSpriteFont
|
||||
{
|
||||
// Reusable, reflection based helper for parsing commandline options.
|
||||
public class CommandLineParser
|
||||
{
|
||||
object optionsObject;
|
||||
|
||||
Queue<FieldInfo> requiredOptions = new Queue<FieldInfo>();
|
||||
Dictionary<string, FieldInfo> optionalOptions = new Dictionary<string, FieldInfo>();
|
||||
|
||||
List<string> requiredUsageHelp = new List<string>();
|
||||
List<string> optionalUsageHelp = new List<string>();
|
||||
|
||||
|
||||
// Constructor.
|
||||
public CommandLineParser(object optionsObject)
|
||||
{
|
||||
this.optionsObject = optionsObject;
|
||||
|
||||
// Reflect to find what commandline options are available.
|
||||
foreach (FieldInfo field in optionsObject.GetType().GetFields())
|
||||
{
|
||||
string fieldName = GetOptionName(field);
|
||||
|
||||
if (GetAttribute<RequiredAttribute>(field) != null)
|
||||
{
|
||||
// Record a required option.
|
||||
requiredOptions.Enqueue(field);
|
||||
|
||||
requiredUsageHelp.Add(string.Format("<{0}>", fieldName));
|
||||
}
|
||||
else
|
||||
{
|
||||
// Record an optional option.
|
||||
optionalOptions.Add(fieldName.ToLowerInvariant(), field);
|
||||
|
||||
if (field.FieldType == typeof(bool))
|
||||
{
|
||||
optionalUsageHelp.Add(string.Format("/{0}", fieldName));
|
||||
}
|
||||
else
|
||||
{
|
||||
optionalUsageHelp.Add(string.Format("/{0}:value", fieldName));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public bool ParseCommandLine(string[] args)
|
||||
{
|
||||
// Parse each argument in turn.
|
||||
foreach (string arg in args)
|
||||
{
|
||||
if (!ParseArgument(arg.Trim()))
|
||||
{
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
// Make sure we got all the required options.
|
||||
FieldInfo missingRequiredOption = requiredOptions.FirstOrDefault(field => !IsList(field) || GetList(field).Count == 0);
|
||||
|
||||
if (missingRequiredOption != null)
|
||||
{
|
||||
ShowError("Missing argument '{0}'", GetOptionName(missingRequiredOption));
|
||||
return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
bool ParseArgument(string arg)
|
||||
{
|
||||
if (arg.StartsWith("/"))
|
||||
{
|
||||
// Parse an optional argument.
|
||||
char[] separators = { ':' };
|
||||
|
||||
string[] split = arg.Substring(1).Split(separators, 2, StringSplitOptions.None);
|
||||
|
||||
string name = split[0];
|
||||
string value = (split.Length > 1) ? split[1] : "true";
|
||||
|
||||
FieldInfo field;
|
||||
|
||||
if (!optionalOptions.TryGetValue(name.ToLowerInvariant(), out field))
|
||||
{
|
||||
ShowError("Unknown option '{0}'", name);
|
||||
return false;
|
||||
}
|
||||
|
||||
return SetOption(field, value);
|
||||
}
|
||||
else
|
||||
{
|
||||
// Parse a required argument.
|
||||
if (requiredOptions.Count == 0)
|
||||
{
|
||||
ShowError("Too many arguments");
|
||||
return false;
|
||||
}
|
||||
|
||||
FieldInfo field = requiredOptions.Peek();
|
||||
|
||||
if (!IsList(field))
|
||||
{
|
||||
requiredOptions.Dequeue();
|
||||
}
|
||||
|
||||
return SetOption(field, arg);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
bool SetOption(FieldInfo field, string value)
|
||||
{
|
||||
try
|
||||
{
|
||||
if (IsList(field))
|
||||
{
|
||||
// Append this value to a list of options.
|
||||
GetList(field).Add(ChangeType(value, ListElementType(field)));
|
||||
}
|
||||
else
|
||||
{
|
||||
// Set the value of a single option.
|
||||
field.SetValue(optionsObject, ChangeType(value, field.FieldType));
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
catch
|
||||
{
|
||||
ShowError("Invalid value '{0}' for option '{1}'", value, GetOptionName(field));
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
static object ChangeType(string value, Type type)
|
||||
{
|
||||
TypeConverter converter = TypeDescriptor.GetConverter(type);
|
||||
|
||||
return converter.ConvertFromInvariantString(value);
|
||||
}
|
||||
|
||||
|
||||
static bool IsList(FieldInfo field)
|
||||
{
|
||||
return typeof(IList).IsAssignableFrom(field.FieldType);
|
||||
}
|
||||
|
||||
|
||||
IList GetList(FieldInfo field)
|
||||
{
|
||||
return (IList)field.GetValue(optionsObject);
|
||||
}
|
||||
|
||||
|
||||
static Type ListElementType(FieldInfo field)
|
||||
{
|
||||
var interfaces = from i in field.FieldType.GetInterfaces()
|
||||
where i.IsGenericType && i.GetGenericTypeDefinition() == typeof(IEnumerable<>)
|
||||
select i;
|
||||
|
||||
return interfaces.First().GetGenericArguments()[0];
|
||||
}
|
||||
|
||||
|
||||
static string GetOptionName(FieldInfo field)
|
||||
{
|
||||
var nameAttribute = GetAttribute<NameAttribute>(field);
|
||||
|
||||
if (nameAttribute != null)
|
||||
{
|
||||
return nameAttribute.Name;
|
||||
}
|
||||
else
|
||||
{
|
||||
return field.Name;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void ShowError(string message, params object[] args)
|
||||
{
|
||||
string name = Path.GetFileNameWithoutExtension(Process.GetCurrentProcess().ProcessName);
|
||||
|
||||
Console.Error.WriteLine(message, args);
|
||||
Console.Error.WriteLine();
|
||||
Console.Error.WriteLine("Usage: {0} {1}", name, string.Join(" ", requiredUsageHelp));
|
||||
|
||||
if (optionalUsageHelp.Count > 0)
|
||||
{
|
||||
Console.Error.WriteLine();
|
||||
Console.Error.WriteLine("Options:");
|
||||
|
||||
foreach (string optional in optionalUsageHelp)
|
||||
{
|
||||
Console.Error.WriteLine(" {0}", optional);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
static T GetAttribute<T>(ICustomAttributeProvider provider) where T : Attribute
|
||||
{
|
||||
return provider.GetCustomAttributes(typeof(T), false).OfType<T>().FirstOrDefault();
|
||||
}
|
||||
|
||||
|
||||
// Used on optionsObject fields to indicate which options are required.
|
||||
[AttributeUsage(AttributeTargets.Field)]
|
||||
public sealed class RequiredAttribute : Attribute
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
// Used on an optionsObject field to rename the corresponding commandline option.
|
||||
[AttributeUsage(AttributeTargets.Field)]
|
||||
public sealed class NameAttribute : Attribute
|
||||
{
|
||||
public NameAttribute(string name)
|
||||
{
|
||||
this.Name = name;
|
||||
}
|
||||
|
||||
public string Name { get; private set; }
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,43 +1,43 @@
|
|||
// DirectXTK MakeSpriteFont tool
|
||||
//
|
||||
// THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF
|
||||
// ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO
|
||||
// THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A
|
||||
// PARTICULAR PURPOSE.
|
||||
//
|
||||
// Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
//
|
||||
// http://go.microsoft.com/fwlink/?LinkId=248929
|
||||
|
||||
using System.Drawing;
|
||||
|
||||
namespace MakeSpriteFont
|
||||
{
|
||||
// Represents a single character within a font.
|
||||
public class Glyph
|
||||
{
|
||||
// Constructor.
|
||||
public Glyph(char character, Bitmap bitmap, Rectangle? subrect = null)
|
||||
{
|
||||
this.Character = character;
|
||||
this.Bitmap = bitmap;
|
||||
this.Subrect = subrect.GetValueOrDefault(new Rectangle(0, 0, bitmap.Width, bitmap.Height));
|
||||
}
|
||||
|
||||
|
||||
// Unicode codepoint.
|
||||
public char Character;
|
||||
|
||||
|
||||
// Glyph image data (may only use a portion of a larger bitmap).
|
||||
public Bitmap Bitmap;
|
||||
public Rectangle Subrect;
|
||||
|
||||
|
||||
// Layout information.
|
||||
public float XOffset;
|
||||
public float YOffset;
|
||||
|
||||
public float XAdvance;
|
||||
}
|
||||
}
|
||||
// DirectXTK MakeSpriteFont tool
|
||||
//
|
||||
// THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF
|
||||
// ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO
|
||||
// THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A
|
||||
// PARTICULAR PURPOSE.
|
||||
//
|
||||
// Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
//
|
||||
// http://go.microsoft.com/fwlink/?LinkId=248929
|
||||
|
||||
using System.Drawing;
|
||||
|
||||
namespace MakeSpriteFont
|
||||
{
|
||||
// Represents a single character within a font.
|
||||
public class Glyph
|
||||
{
|
||||
// Constructor.
|
||||
public Glyph(char character, Bitmap bitmap, Rectangle? subrect = null)
|
||||
{
|
||||
this.Character = character;
|
||||
this.Bitmap = bitmap;
|
||||
this.Subrect = subrect.GetValueOrDefault(new Rectangle(0, 0, bitmap.Width, bitmap.Height));
|
||||
}
|
||||
|
||||
|
||||
// Unicode codepoint.
|
||||
public char Character;
|
||||
|
||||
|
||||
// Glyph image data (may only use a portion of a larger bitmap).
|
||||
public Bitmap Bitmap;
|
||||
public Rectangle Subrect;
|
||||
|
||||
|
||||
// Layout information.
|
||||
public float XOffset;
|
||||
public float YOffset;
|
||||
|
||||
public float XAdvance;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,54 +1,54 @@
|
|||
// DirectXTK MakeSpriteFont tool
|
||||
//
|
||||
// THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF
|
||||
// ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO
|
||||
// THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A
|
||||
// PARTICULAR PURPOSE.
|
||||
//
|
||||
// Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
//
|
||||
// http://go.microsoft.com/fwlink/?LinkId=248929
|
||||
|
||||
using System.Drawing;
|
||||
|
||||
namespace MakeSpriteFont
|
||||
{
|
||||
// Crops unused space from around the edge of a glyph bitmap.
|
||||
public static class GlyphCropper
|
||||
{
|
||||
public static void Crop(Glyph glyph)
|
||||
{
|
||||
// Crop the top.
|
||||
while ((glyph.Subrect.Height > 1) && BitmapUtils.IsAlphaEntirely(0, glyph.Bitmap, new Rectangle(glyph.Subrect.X, glyph.Subrect.Y, glyph.Subrect.Width, 1)))
|
||||
{
|
||||
glyph.Subrect.Y++;
|
||||
glyph.Subrect.Height--;
|
||||
|
||||
glyph.YOffset++;
|
||||
}
|
||||
|
||||
// Crop the bottom.
|
||||
while ((glyph.Subrect.Height > 1) && BitmapUtils.IsAlphaEntirely(0, glyph.Bitmap, new Rectangle(glyph.Subrect.X, glyph.Subrect.Bottom - 1, glyph.Subrect.Width, 1)))
|
||||
{
|
||||
glyph.Subrect.Height--;
|
||||
}
|
||||
|
||||
// Crop the left.
|
||||
while ((glyph.Subrect.Width > 1) && BitmapUtils.IsAlphaEntirely(0, glyph.Bitmap, new Rectangle(glyph.Subrect.X, glyph.Subrect.Y, 1, glyph.Subrect.Height)))
|
||||
{
|
||||
glyph.Subrect.X++;
|
||||
glyph.Subrect.Width--;
|
||||
|
||||
glyph.XOffset++;
|
||||
}
|
||||
|
||||
// Crop the right.
|
||||
while ((glyph.Subrect.Width > 1) && BitmapUtils.IsAlphaEntirely(0, glyph.Bitmap, new Rectangle(glyph.Subrect.Right - 1, glyph.Subrect.Y, 1, glyph.Subrect.Height)))
|
||||
{
|
||||
glyph.Subrect.Width--;
|
||||
|
||||
glyph.XAdvance++;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
// DirectXTK MakeSpriteFont tool
|
||||
//
|
||||
// THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF
|
||||
// ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO
|
||||
// THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A
|
||||
// PARTICULAR PURPOSE.
|
||||
//
|
||||
// Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
//
|
||||
// http://go.microsoft.com/fwlink/?LinkId=248929
|
||||
|
||||
using System.Drawing;
|
||||
|
||||
namespace MakeSpriteFont
|
||||
{
|
||||
// Crops unused space from around the edge of a glyph bitmap.
|
||||
public static class GlyphCropper
|
||||
{
|
||||
public static void Crop(Glyph glyph)
|
||||
{
|
||||
// Crop the top.
|
||||
while ((glyph.Subrect.Height > 1) && BitmapUtils.IsAlphaEntirely(0, glyph.Bitmap, new Rectangle(glyph.Subrect.X, glyph.Subrect.Y, glyph.Subrect.Width, 1)))
|
||||
{
|
||||
glyph.Subrect.Y++;
|
||||
glyph.Subrect.Height--;
|
||||
|
||||
glyph.YOffset++;
|
||||
}
|
||||
|
||||
// Crop the bottom.
|
||||
while ((glyph.Subrect.Height > 1) && BitmapUtils.IsAlphaEntirely(0, glyph.Bitmap, new Rectangle(glyph.Subrect.X, glyph.Subrect.Bottom - 1, glyph.Subrect.Width, 1)))
|
||||
{
|
||||
glyph.Subrect.Height--;
|
||||
}
|
||||
|
||||
// Crop the left.
|
||||
while ((glyph.Subrect.Width > 1) && BitmapUtils.IsAlphaEntirely(0, glyph.Bitmap, new Rectangle(glyph.Subrect.X, glyph.Subrect.Y, 1, glyph.Subrect.Height)))
|
||||
{
|
||||
glyph.Subrect.X++;
|
||||
glyph.Subrect.Width--;
|
||||
|
||||
glyph.XOffset++;
|
||||
}
|
||||
|
||||
// Crop the right.
|
||||
while ((glyph.Subrect.Width > 1) && BitmapUtils.IsAlphaEntirely(0, glyph.Bitmap, new Rectangle(glyph.Subrect.Right - 1, glyph.Subrect.Y, 1, glyph.Subrect.Height)))
|
||||
{
|
||||
glyph.Subrect.Width--;
|
||||
|
||||
glyph.XAdvance++;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,285 +1,285 @@
|
|||
// DirectXTK MakeSpriteFont tool
|
||||
//
|
||||
// THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF
|
||||
// ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO
|
||||
// THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A
|
||||
// PARTICULAR PURPOSE.
|
||||
//
|
||||
// Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
//
|
||||
// http://go.microsoft.com/fwlink/?LinkId=248929
|
||||
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Drawing;
|
||||
using System.Drawing.Imaging;
|
||||
|
||||
namespace MakeSpriteFont
|
||||
{
|
||||
// Helper for arranging many small bitmaps onto a single larger surface.
|
||||
public static class GlyphPacker
|
||||
{
|
||||
public static Bitmap ArrangeGlyphsFast(Glyph[] sourceGlyphs)
|
||||
{
|
||||
// Build up a list of all the glyphs needing to be arranged.
|
||||
List<ArrangedGlyph> glyphs = new List<ArrangedGlyph>();
|
||||
|
||||
int largestWidth = 1;
|
||||
int largestHeight = 1;
|
||||
|
||||
for (int i = 0; i < sourceGlyphs.Length; i++)
|
||||
{
|
||||
ArrangedGlyph glyph = new ArrangedGlyph();
|
||||
|
||||
glyph.Source = sourceGlyphs[i];
|
||||
|
||||
// Leave a one pixel border around every glyph in the output bitmap.
|
||||
glyph.Width = sourceGlyphs[i].Subrect.Width + 2;
|
||||
glyph.Height = sourceGlyphs[i].Subrect.Height + 2;
|
||||
|
||||
if (glyph.Width > largestWidth)
|
||||
largestWidth = glyph.Width;
|
||||
|
||||
if (glyph.Height > largestHeight)
|
||||
largestHeight = glyph.Height;
|
||||
|
||||
glyphs.Add(glyph);
|
||||
}
|
||||
|
||||
// Work out how big the output bitmap should be.
|
||||
int outputWidth = GuessOutputWidth(sourceGlyphs);
|
||||
|
||||
// Place each glyph in a grid based on the largest glyph size
|
||||
int curx = 0;
|
||||
int cury = 0;
|
||||
|
||||
for (int i = 0; i < glyphs.Count; i++)
|
||||
{
|
||||
glyphs[i].X = curx;
|
||||
glyphs[i].Y = cury;
|
||||
|
||||
curx += largestWidth;
|
||||
|
||||
if (curx + largestWidth > outputWidth)
|
||||
{
|
||||
curx = 0;
|
||||
cury += largestHeight;
|
||||
}
|
||||
}
|
||||
|
||||
// Create the merged output bitmap.
|
||||
int outputHeight = MakeValidTextureSize(cury + largestHeight, false);
|
||||
|
||||
return CopyGlyphsToOutput(glyphs, outputWidth, outputHeight);
|
||||
}
|
||||
|
||||
public static Bitmap ArrangeGlyphs(Glyph[] sourceGlyphs)
|
||||
{
|
||||
// Build up a list of all the glyphs needing to be arranged.
|
||||
List<ArrangedGlyph> glyphs = new List<ArrangedGlyph>();
|
||||
|
||||
for (int i = 0; i < sourceGlyphs.Length; i++)
|
||||
{
|
||||
ArrangedGlyph glyph = new ArrangedGlyph();
|
||||
|
||||
glyph.Source = sourceGlyphs[i];
|
||||
|
||||
// Leave a one pixel border around every glyph in the output bitmap.
|
||||
glyph.Width = sourceGlyphs[i].Subrect.Width + 2;
|
||||
glyph.Height = sourceGlyphs[i].Subrect.Height + 2;
|
||||
|
||||
glyphs.Add(glyph);
|
||||
}
|
||||
|
||||
// Sort so the largest glyphs get arranged first.
|
||||
glyphs.Sort(CompareGlyphSizes);
|
||||
|
||||
// Work out how big the output bitmap should be.
|
||||
int outputWidth = GuessOutputWidth(sourceGlyphs);
|
||||
int outputHeight = 0;
|
||||
|
||||
// Choose positions for each glyph, one at a time.
|
||||
for (int i = 0; i < glyphs.Count; i++)
|
||||
{
|
||||
if (i > 0 && (i % 500) == 0)
|
||||
{
|
||||
Console.Write(".");
|
||||
}
|
||||
|
||||
PositionGlyph(glyphs, i, outputWidth);
|
||||
|
||||
outputHeight = Math.Max(outputHeight, glyphs[i].Y + glyphs[i].Height);
|
||||
}
|
||||
|
||||
if (glyphs.Count >= 500)
|
||||
{
|
||||
Console.WriteLine();
|
||||
}
|
||||
|
||||
// Create the merged output bitmap.
|
||||
outputHeight = MakeValidTextureSize(outputHeight, false);
|
||||
|
||||
return CopyGlyphsToOutput(glyphs, outputWidth, outputHeight);
|
||||
}
|
||||
|
||||
|
||||
// Once arranging is complete, copies each glyph to its chosen position in the single larger output bitmap.
|
||||
static Bitmap CopyGlyphsToOutput(List<ArrangedGlyph> glyphs, int width, int height)
|
||||
{
|
||||
Bitmap output = new Bitmap(width, height, PixelFormat.Format32bppArgb);
|
||||
|
||||
int usedPixels = 0;
|
||||
|
||||
foreach (ArrangedGlyph glyph in glyphs)
|
||||
{
|
||||
Glyph sourceGlyph = glyph.Source;
|
||||
Rectangle sourceRegion = sourceGlyph.Subrect;
|
||||
Rectangle destinationRegion = new Rectangle(glyph.X + 1, glyph.Y + 1, sourceRegion.Width, sourceRegion.Height);
|
||||
|
||||
BitmapUtils.CopyRect(sourceGlyph.Bitmap, sourceRegion, output, destinationRegion);
|
||||
|
||||
BitmapUtils.PadBorderPixels(output, destinationRegion);
|
||||
|
||||
sourceGlyph.Bitmap = output;
|
||||
sourceGlyph.Subrect = destinationRegion;
|
||||
|
||||
usedPixels += (glyph.Width * glyph.Height);
|
||||
}
|
||||
|
||||
float utilization = ( (float)usedPixels / (float)(width * height) ) * 100;
|
||||
|
||||
Console.WriteLine("Packing efficiency {0}%", utilization );
|
||||
|
||||
return output;
|
||||
}
|
||||
|
||||
|
||||
// Internal helper class keeps track of a glyph while it is being arranged.
|
||||
class ArrangedGlyph
|
||||
{
|
||||
public Glyph Source;
|
||||
|
||||
public int X;
|
||||
public int Y;
|
||||
|
||||
public int Width;
|
||||
public int Height;
|
||||
}
|
||||
|
||||
|
||||
// Works out where to position a single glyph.
|
||||
static void PositionGlyph(List<ArrangedGlyph> glyphs, int index, int outputWidth)
|
||||
{
|
||||
int x = 0;
|
||||
int y = 0;
|
||||
|
||||
while (true)
|
||||
{
|
||||
// Is this position free for us to use?
|
||||
int intersects = FindIntersectingGlyph(glyphs, index, x, y);
|
||||
|
||||
if (intersects < 0)
|
||||
{
|
||||
glyphs[index].X = x;
|
||||
glyphs[index].Y = y;
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
// Skip past the existing glyph that we collided with.
|
||||
x = glyphs[intersects].X + glyphs[intersects].Width;
|
||||
|
||||
// If we ran out of room to move to the right, try the next line down instead.
|
||||
if (x + glyphs[index].Width > outputWidth)
|
||||
{
|
||||
x = 0;
|
||||
y++;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// Checks if a proposed glyph position collides with anything that we already arranged.
|
||||
static int FindIntersectingGlyph(List<ArrangedGlyph> glyphs, int index, int x, int y)
|
||||
{
|
||||
int w = glyphs[index].Width;
|
||||
int h = glyphs[index].Height;
|
||||
|
||||
for (int i = 0; i < index; i++)
|
||||
{
|
||||
if (glyphs[i].X >= x + w)
|
||||
continue;
|
||||
|
||||
if (glyphs[i].X + glyphs[i].Width <= x)
|
||||
continue;
|
||||
|
||||
if (glyphs[i].Y >= y + h)
|
||||
continue;
|
||||
|
||||
if (glyphs[i].Y + glyphs[i].Height <= y)
|
||||
continue;
|
||||
|
||||
return i;
|
||||
}
|
||||
|
||||
return -1;
|
||||
}
|
||||
|
||||
|
||||
// Comparison function for sorting glyphs by size.
|
||||
static int CompareGlyphSizes(ArrangedGlyph a, ArrangedGlyph b)
|
||||
{
|
||||
const int heightWeight = 1024;
|
||||
|
||||
int aSize = a.Height * heightWeight + a.Width;
|
||||
int bSize = b.Height * heightWeight + b.Width;
|
||||
|
||||
if (aSize != bSize)
|
||||
return bSize.CompareTo(aSize);
|
||||
else
|
||||
return a.Source.Character.CompareTo(b.Source.Character);
|
||||
}
|
||||
|
||||
|
||||
// Heuristic guesses what might be a good output width for a list of glyphs.
|
||||
static int GuessOutputWidth(Glyph[] sourceGlyphs)
|
||||
{
|
||||
int maxWidth = 0;
|
||||
int totalSize = 0;
|
||||
|
||||
foreach (Glyph glyph in sourceGlyphs)
|
||||
{
|
||||
maxWidth = Math.Max(maxWidth, glyph.Subrect.Width);
|
||||
totalSize += glyph.Subrect.Width * glyph.Subrect.Height;
|
||||
}
|
||||
|
||||
int width = Math.Max((int)Math.Sqrt(totalSize), maxWidth);
|
||||
|
||||
return MakeValidTextureSize(width, true);
|
||||
}
|
||||
|
||||
|
||||
// Rounds a value up to the next larger valid texture size.
|
||||
static int MakeValidTextureSize(int value, bool requirePowerOfTwo)
|
||||
{
|
||||
// In case we want to DXT compress, make sure the size is a multiple of 4.
|
||||
const int blockSize = 4;
|
||||
|
||||
if (requirePowerOfTwo)
|
||||
{
|
||||
// Round up to a power of two.
|
||||
int powerOfTwo = blockSize;
|
||||
|
||||
while (powerOfTwo < value)
|
||||
powerOfTwo <<= 1;
|
||||
|
||||
return powerOfTwo;
|
||||
}
|
||||
else
|
||||
{
|
||||
// Round up to the specified block size.
|
||||
return (value + blockSize - 1) & ~(blockSize - 1);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
// DirectXTK MakeSpriteFont tool
|
||||
//
|
||||
// THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF
|
||||
// ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO
|
||||
// THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A
|
||||
// PARTICULAR PURPOSE.
|
||||
//
|
||||
// Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
//
|
||||
// http://go.microsoft.com/fwlink/?LinkId=248929
|
||||
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Drawing;
|
||||
using System.Drawing.Imaging;
|
||||
|
||||
namespace MakeSpriteFont
|
||||
{
|
||||
// Helper for arranging many small bitmaps onto a single larger surface.
|
||||
public static class GlyphPacker
|
||||
{
|
||||
public static Bitmap ArrangeGlyphsFast(Glyph[] sourceGlyphs)
|
||||
{
|
||||
// Build up a list of all the glyphs needing to be arranged.
|
||||
List<ArrangedGlyph> glyphs = new List<ArrangedGlyph>();
|
||||
|
||||
int largestWidth = 1;
|
||||
int largestHeight = 1;
|
||||
|
||||
for (int i = 0; i < sourceGlyphs.Length; i++)
|
||||
{
|
||||
ArrangedGlyph glyph = new ArrangedGlyph();
|
||||
|
||||
glyph.Source = sourceGlyphs[i];
|
||||
|
||||
// Leave a one pixel border around every glyph in the output bitmap.
|
||||
glyph.Width = sourceGlyphs[i].Subrect.Width + 2;
|
||||
glyph.Height = sourceGlyphs[i].Subrect.Height + 2;
|
||||
|
||||
if (glyph.Width > largestWidth)
|
||||
largestWidth = glyph.Width;
|
||||
|
||||
if (glyph.Height > largestHeight)
|
||||
largestHeight = glyph.Height;
|
||||
|
||||
glyphs.Add(glyph);
|
||||
}
|
||||
|
||||
// Work out how big the output bitmap should be.
|
||||
int outputWidth = GuessOutputWidth(sourceGlyphs);
|
||||
|
||||
// Place each glyph in a grid based on the largest glyph size
|
||||
int curx = 0;
|
||||
int cury = 0;
|
||||
|
||||
for (int i = 0; i < glyphs.Count; i++)
|
||||
{
|
||||
glyphs[i].X = curx;
|
||||
glyphs[i].Y = cury;
|
||||
|
||||
curx += largestWidth;
|
||||
|
||||
if (curx + largestWidth > outputWidth)
|
||||
{
|
||||
curx = 0;
|
||||
cury += largestHeight;
|
||||
}
|
||||
}
|
||||
|
||||
// Create the merged output bitmap.
|
||||
int outputHeight = MakeValidTextureSize(cury + largestHeight, false);
|
||||
|
||||
return CopyGlyphsToOutput(glyphs, outputWidth, outputHeight);
|
||||
}
|
||||
|
||||
public static Bitmap ArrangeGlyphs(Glyph[] sourceGlyphs)
|
||||
{
|
||||
// Build up a list of all the glyphs needing to be arranged.
|
||||
List<ArrangedGlyph> glyphs = new List<ArrangedGlyph>();
|
||||
|
||||
for (int i = 0; i < sourceGlyphs.Length; i++)
|
||||
{
|
||||
ArrangedGlyph glyph = new ArrangedGlyph();
|
||||
|
||||
glyph.Source = sourceGlyphs[i];
|
||||
|
||||
// Leave a one pixel border around every glyph in the output bitmap.
|
||||
glyph.Width = sourceGlyphs[i].Subrect.Width + 2;
|
||||
glyph.Height = sourceGlyphs[i].Subrect.Height + 2;
|
||||
|
||||
glyphs.Add(glyph);
|
||||
}
|
||||
|
||||
// Sort so the largest glyphs get arranged first.
|
||||
glyphs.Sort(CompareGlyphSizes);
|
||||
|
||||
// Work out how big the output bitmap should be.
|
||||
int outputWidth = GuessOutputWidth(sourceGlyphs);
|
||||
int outputHeight = 0;
|
||||
|
||||
// Choose positions for each glyph, one at a time.
|
||||
for (int i = 0; i < glyphs.Count; i++)
|
||||
{
|
||||
if (i > 0 && (i % 500) == 0)
|
||||
{
|
||||
Console.Write(".");
|
||||
}
|
||||
|
||||
PositionGlyph(glyphs, i, outputWidth);
|
||||
|
||||
outputHeight = Math.Max(outputHeight, glyphs[i].Y + glyphs[i].Height);
|
||||
}
|
||||
|
||||
if (glyphs.Count >= 500)
|
||||
{
|
||||
Console.WriteLine();
|
||||
}
|
||||
|
||||
// Create the merged output bitmap.
|
||||
outputHeight = MakeValidTextureSize(outputHeight, false);
|
||||
|
||||
return CopyGlyphsToOutput(glyphs, outputWidth, outputHeight);
|
||||
}
|
||||
|
||||
|
||||
// Once arranging is complete, copies each glyph to its chosen position in the single larger output bitmap.
|
||||
static Bitmap CopyGlyphsToOutput(List<ArrangedGlyph> glyphs, int width, int height)
|
||||
{
|
||||
Bitmap output = new Bitmap(width, height, PixelFormat.Format32bppArgb);
|
||||
|
||||
int usedPixels = 0;
|
||||
|
||||
foreach (ArrangedGlyph glyph in glyphs)
|
||||
{
|
||||
Glyph sourceGlyph = glyph.Source;
|
||||
Rectangle sourceRegion = sourceGlyph.Subrect;
|
||||
Rectangle destinationRegion = new Rectangle(glyph.X + 1, glyph.Y + 1, sourceRegion.Width, sourceRegion.Height);
|
||||
|
||||
BitmapUtils.CopyRect(sourceGlyph.Bitmap, sourceRegion, output, destinationRegion);
|
||||
|
||||
BitmapUtils.PadBorderPixels(output, destinationRegion);
|
||||
|
||||
sourceGlyph.Bitmap = output;
|
||||
sourceGlyph.Subrect = destinationRegion;
|
||||
|
||||
usedPixels += (glyph.Width * glyph.Height);
|
||||
}
|
||||
|
||||
float utilization = ( (float)usedPixels / (float)(width * height) ) * 100;
|
||||
|
||||
Console.WriteLine("Packing efficiency {0}%", utilization );
|
||||
|
||||
return output;
|
||||
}
|
||||
|
||||
|
||||
// Internal helper class keeps track of a glyph while it is being arranged.
|
||||
class ArrangedGlyph
|
||||
{
|
||||
public Glyph Source;
|
||||
|
||||
public int X;
|
||||
public int Y;
|
||||
|
||||
public int Width;
|
||||
public int Height;
|
||||
}
|
||||
|
||||
|
||||
// Works out where to position a single glyph.
|
||||
static void PositionGlyph(List<ArrangedGlyph> glyphs, int index, int outputWidth)
|
||||
{
|
||||
int x = 0;
|
||||
int y = 0;
|
||||
|
||||
while (true)
|
||||
{
|
||||
// Is this position free for us to use?
|
||||
int intersects = FindIntersectingGlyph(glyphs, index, x, y);
|
||||
|
||||
if (intersects < 0)
|
||||
{
|
||||
glyphs[index].X = x;
|
||||
glyphs[index].Y = y;
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
// Skip past the existing glyph that we collided with.
|
||||
x = glyphs[intersects].X + glyphs[intersects].Width;
|
||||
|
||||
// If we ran out of room to move to the right, try the next line down instead.
|
||||
if (x + glyphs[index].Width > outputWidth)
|
||||
{
|
||||
x = 0;
|
||||
y++;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// Checks if a proposed glyph position collides with anything that we already arranged.
|
||||
static int FindIntersectingGlyph(List<ArrangedGlyph> glyphs, int index, int x, int y)
|
||||
{
|
||||
int w = glyphs[index].Width;
|
||||
int h = glyphs[index].Height;
|
||||
|
||||
for (int i = 0; i < index; i++)
|
||||
{
|
||||
if (glyphs[i].X >= x + w)
|
||||
continue;
|
||||
|
||||
if (glyphs[i].X + glyphs[i].Width <= x)
|
||||
continue;
|
||||
|
||||
if (glyphs[i].Y >= y + h)
|
||||
continue;
|
||||
|
||||
if (glyphs[i].Y + glyphs[i].Height <= y)
|
||||
continue;
|
||||
|
||||
return i;
|
||||
}
|
||||
|
||||
return -1;
|
||||
}
|
||||
|
||||
|
||||
// Comparison function for sorting glyphs by size.
|
||||
static int CompareGlyphSizes(ArrangedGlyph a, ArrangedGlyph b)
|
||||
{
|
||||
const int heightWeight = 1024;
|
||||
|
||||
int aSize = a.Height * heightWeight + a.Width;
|
||||
int bSize = b.Height * heightWeight + b.Width;
|
||||
|
||||
if (aSize != bSize)
|
||||
return bSize.CompareTo(aSize);
|
||||
else
|
||||
return a.Source.Character.CompareTo(b.Source.Character);
|
||||
}
|
||||
|
||||
|
||||
// Heuristic guesses what might be a good output width for a list of glyphs.
|
||||
static int GuessOutputWidth(Glyph[] sourceGlyphs)
|
||||
{
|
||||
int maxWidth = 0;
|
||||
int totalSize = 0;
|
||||
|
||||
foreach (Glyph glyph in sourceGlyphs)
|
||||
{
|
||||
maxWidth = Math.Max(maxWidth, glyph.Subrect.Width);
|
||||
totalSize += glyph.Subrect.Width * glyph.Subrect.Height;
|
||||
}
|
||||
|
||||
int width = Math.Max((int)Math.Sqrt(totalSize), maxWidth);
|
||||
|
||||
return MakeValidTextureSize(width, true);
|
||||
}
|
||||
|
||||
|
||||
// Rounds a value up to the next larger valid texture size.
|
||||
static int MakeValidTextureSize(int value, bool requirePowerOfTwo)
|
||||
{
|
||||
// In case we want to DXT compress, make sure the size is a multiple of 4.
|
||||
const int blockSize = 4;
|
||||
|
||||
if (requirePowerOfTwo)
|
||||
{
|
||||
// Round up to a power of two.
|
||||
int powerOfTwo = blockSize;
|
||||
|
||||
while (powerOfTwo < value)
|
||||
powerOfTwo <<= 1;
|
||||
|
||||
return powerOfTwo;
|
||||
}
|
||||
else
|
||||
{
|
||||
// Round up to the specified block size.
|
||||
return (value + blockSize - 1) & ~(blockSize - 1);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,25 +1,25 @@
|
|||
// DirectXTK MakeSpriteFont tool
|
||||
//
|
||||
// THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF
|
||||
// ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO
|
||||
// THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A
|
||||
// PARTICULAR PURPOSE.
|
||||
//
|
||||
// Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
//
|
||||
// http://go.microsoft.com/fwlink/?LinkId=248929
|
||||
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace MakeSpriteFont
|
||||
{
|
||||
// Importer interface allows the conversion tool to support multiple source font formats.
|
||||
public interface IFontImporter
|
||||
{
|
||||
void Import(CommandLineOptions options);
|
||||
|
||||
IEnumerable<Glyph> Glyphs { get; }
|
||||
|
||||
float LineSpacing { get; }
|
||||
}
|
||||
}
|
||||
// DirectXTK MakeSpriteFont tool
|
||||
//
|
||||
// THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF
|
||||
// ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO
|
||||
// THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A
|
||||
// PARTICULAR PURPOSE.
|
||||
//
|
||||
// Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
//
|
||||
// http://go.microsoft.com/fwlink/?LinkId=248929
|
||||
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace MakeSpriteFont
|
||||
{
|
||||
// Importer interface allows the conversion tool to support multiple source font formats.
|
||||
public interface IFontImporter
|
||||
{
|
||||
void Import(CommandLineOptions options);
|
||||
|
||||
IEnumerable<Glyph> Glyphs { get; }
|
||||
|
||||
float LineSpacing { get; }
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,60 +1,60 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<PropertyGroup>
|
||||
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
|
||||
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
|
||||
<ProductVersion>8.0.30703</ProductVersion>
|
||||
<SchemaVersion>2.0</SchemaVersion>
|
||||
<ProjectGuid>{7329B02D-C504-482A-A156-181D48CE493C}</ProjectGuid>
|
||||
<OutputType>Exe</OutputType>
|
||||
<AppDesignerFolder>Properties</AppDesignerFolder>
|
||||
<RootNamespace>MakeSpriteFont</RootNamespace>
|
||||
<AssemblyName>MakeSpriteFont</AssemblyName>
|
||||
<TargetFrameworkVersion>v4.0</TargetFrameworkVersion>
|
||||
<TargetFrameworkProfile>Client</TargetFrameworkProfile>
|
||||
<FileAlignment>512</FileAlignment>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug|AnyCPU'">
|
||||
<DebugSymbols>true</DebugSymbols>
|
||||
<OutputPath>bin\Debug\</OutputPath>
|
||||
<DefineConstants>DEBUG;TRACE</DefineConstants>
|
||||
<DebugType>full</DebugType>
|
||||
<PlatformTarget>AnyCPU</PlatformTarget>
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Release|AnyCPU'">
|
||||
<OutputPath>bin\Release\</OutputPath>
|
||||
<DefineConstants>TRACE</DefineConstants>
|
||||
<Optimize>true</Optimize>
|
||||
<DebugType>pdbonly</DebugType>
|
||||
<PlatformTarget>AnyCPU</PlatformTarget>
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
</PropertyGroup>
|
||||
<ItemGroup>
|
||||
<Compile Include="BitmapUtils.cs" />
|
||||
<Compile Include="CharacterRegion.cs" />
|
||||
<Compile Include="CommandLineParser.cs" />
|
||||
<Compile Include="GlyphCropper.cs" />
|
||||
<Compile Include="IFontImporter.cs" />
|
||||
<Compile Include="SpriteFontWriter.cs" />
|
||||
<Compile Include="TrueTypeImporter.cs" />
|
||||
<Compile Include="BitmapImporter.cs" />
|
||||
<Compile Include="GlyphPacker.cs" />
|
||||
<Compile Include="CommandLineOptions.cs" />
|
||||
<Compile Include="Program.cs" />
|
||||
<Compile Include="Properties\AssemblyInfo.cs" />
|
||||
<Compile Include="Glyph.cs" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Reference Include="System" />
|
||||
<Reference Include="System.Drawing" />
|
||||
</ItemGroup>
|
||||
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
|
||||
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
|
||||
Other similar extension points exist, see Microsoft.Common.targets.
|
||||
<Target Name="BeforeBuild">
|
||||
</Target>
|
||||
<Target Name="AfterBuild">
|
||||
</Target>
|
||||
-->
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<PropertyGroup>
|
||||
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
|
||||
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
|
||||
<ProductVersion>8.0.30703</ProductVersion>
|
||||
<SchemaVersion>2.0</SchemaVersion>
|
||||
<ProjectGuid>{7329B02D-C504-482A-A156-181D48CE493C}</ProjectGuid>
|
||||
<OutputType>Exe</OutputType>
|
||||
<AppDesignerFolder>Properties</AppDesignerFolder>
|
||||
<RootNamespace>MakeSpriteFont</RootNamespace>
|
||||
<AssemblyName>MakeSpriteFont</AssemblyName>
|
||||
<TargetFrameworkVersion>v4.0</TargetFrameworkVersion>
|
||||
<TargetFrameworkProfile>Client</TargetFrameworkProfile>
|
||||
<FileAlignment>512</FileAlignment>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug|AnyCPU'">
|
||||
<DebugSymbols>true</DebugSymbols>
|
||||
<OutputPath>bin\Debug\</OutputPath>
|
||||
<DefineConstants>DEBUG;TRACE</DefineConstants>
|
||||
<DebugType>full</DebugType>
|
||||
<PlatformTarget>AnyCPU</PlatformTarget>
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Release|AnyCPU'">
|
||||
<OutputPath>bin\Release\</OutputPath>
|
||||
<DefineConstants>TRACE</DefineConstants>
|
||||
<Optimize>true</Optimize>
|
||||
<DebugType>pdbonly</DebugType>
|
||||
<PlatformTarget>AnyCPU</PlatformTarget>
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
</PropertyGroup>
|
||||
<ItemGroup>
|
||||
<Compile Include="BitmapUtils.cs" />
|
||||
<Compile Include="CharacterRegion.cs" />
|
||||
<Compile Include="CommandLineParser.cs" />
|
||||
<Compile Include="GlyphCropper.cs" />
|
||||
<Compile Include="IFontImporter.cs" />
|
||||
<Compile Include="SpriteFontWriter.cs" />
|
||||
<Compile Include="TrueTypeImporter.cs" />
|
||||
<Compile Include="BitmapImporter.cs" />
|
||||
<Compile Include="GlyphPacker.cs" />
|
||||
<Compile Include="CommandLineOptions.cs" />
|
||||
<Compile Include="Program.cs" />
|
||||
<Compile Include="Properties\AssemblyInfo.cs" />
|
||||
<Compile Include="Glyph.cs" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Reference Include="System" />
|
||||
<Reference Include="System.Drawing" />
|
||||
</ItemGroup>
|
||||
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
|
||||
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
|
||||
Other similar extension points exist, see Microsoft.Common.targets.
|
||||
<Target Name="BeforeBuild">
|
||||
</Target>
|
||||
<Target Name="AfterBuild">
|
||||
</Target>
|
||||
-->
|
||||
</Project>
|
|
@ -1,187 +1,187 @@
|
|||
// DirectXTK MakeSpriteFont tool
|
||||
//
|
||||
// THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF
|
||||
// ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO
|
||||
// THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A
|
||||
// PARTICULAR PURPOSE.
|
||||
//
|
||||
// Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
//
|
||||
// http://go.microsoft.com/fwlink/?LinkId=248929
|
||||
|
||||
using System;
|
||||
using System.IO;
|
||||
using System.Linq;
|
||||
using System.Drawing;
|
||||
|
||||
namespace MakeSpriteFont
|
||||
{
|
||||
public class Program
|
||||
{
|
||||
public static int Main(string[] args)
|
||||
{
|
||||
// Parse the commandline options.
|
||||
var options = new CommandLineOptions();
|
||||
var parser = new CommandLineParser(options);
|
||||
|
||||
if (!parser.ParseCommandLine(args))
|
||||
return 1;
|
||||
|
||||
try
|
||||
{
|
||||
// Convert the font.
|
||||
MakeSpriteFont(options);
|
||||
|
||||
return 0;
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
// Print an error message if conversion failed.
|
||||
Console.WriteLine();
|
||||
Console.Error.WriteLine("Error: {0}", e.Message);
|
||||
|
||||
return 1;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
static void MakeSpriteFont(CommandLineOptions options)
|
||||
{
|
||||
// Import.
|
||||
Console.WriteLine("Importing {0}", options.SourceFont);
|
||||
|
||||
float lineSpacing;
|
||||
|
||||
Glyph[] glyphs = ImportFont(options, out lineSpacing);
|
||||
|
||||
Console.WriteLine("Captured {0} glyphs", glyphs.Length);
|
||||
|
||||
// Optimize.
|
||||
Console.WriteLine("Cropping glyph borders");
|
||||
|
||||
foreach (Glyph glyph in glyphs)
|
||||
{
|
||||
GlyphCropper.Crop(glyph);
|
||||
}
|
||||
|
||||
Console.WriteLine("Packing glyphs into sprite sheet");
|
||||
|
||||
Bitmap bitmap;
|
||||
|
||||
if (options.FastPack)
|
||||
{
|
||||
bitmap = GlyphPacker.ArrangeGlyphsFast(glyphs);
|
||||
}
|
||||
else
|
||||
{
|
||||
bitmap = GlyphPacker.ArrangeGlyphs(glyphs);
|
||||
}
|
||||
|
||||
// Emit texture size warning based on known Feature Level limits.
|
||||
if (bitmap.Width > 16384 || bitmap.Height > 16384)
|
||||
{
|
||||
Console.WriteLine("WARNING: Resulting texture is too large for all known Feature Levels (9.1 - 12.1)");
|
||||
}
|
||||
else if (bitmap.Width > 8192 || bitmap.Height > 8192)
|
||||
{
|
||||
if (options.FeatureLevel < FeatureLevel.FL11_0)
|
||||
{
|
||||
Console.WriteLine("WARNING: Resulting texture requires a Feature Level 11.0 or later device.");
|
||||
}
|
||||
}
|
||||
else if (bitmap.Width > 4096 || bitmap.Height > 4096)
|
||||
{
|
||||
if (options.FeatureLevel < FeatureLevel.FL10_0)
|
||||
{
|
||||
Console.WriteLine("WARNING: Resulting texture requires a Feature Level 10.0 or later device.");
|
||||
}
|
||||
}
|
||||
else if (bitmap.Width > 2048 || bitmap.Height > 2048)
|
||||
{
|
||||
if (options.FeatureLevel < FeatureLevel.FL9_3)
|
||||
{
|
||||
Console.WriteLine("WARNING: Resulting texture requires a Feature Level 9.3 or later device.");
|
||||
}
|
||||
}
|
||||
|
||||
// Adjust line and character spacing.
|
||||
lineSpacing += options.LineSpacing;
|
||||
|
||||
foreach (Glyph glyph in glyphs)
|
||||
{
|
||||
glyph.XAdvance += options.CharacterSpacing;
|
||||
}
|
||||
|
||||
// Automatically detect whether this is a monochromatic or color font?
|
||||
if (options.TextureFormat == TextureFormat.Auto)
|
||||
{
|
||||
bool isMono = BitmapUtils.IsRgbEntirely(Color.White, bitmap);
|
||||
|
||||
options.TextureFormat = isMono ? TextureFormat.CompressedMono :
|
||||
TextureFormat.Rgba32;
|
||||
}
|
||||
|
||||
// Convert to premultiplied alpha format.
|
||||
if (!options.NoPremultiply)
|
||||
{
|
||||
Console.WriteLine("Premultiplying alpha");
|
||||
|
||||
BitmapUtils.PremultiplyAlpha(bitmap);
|
||||
}
|
||||
|
||||
// Save output files.
|
||||
if (!string.IsNullOrEmpty(options.DebugOutputSpriteSheet))
|
||||
{
|
||||
Console.WriteLine("Saving debug output spritesheet {0}", options.DebugOutputSpriteSheet);
|
||||
|
||||
bitmap.Save(options.DebugOutputSpriteSheet);
|
||||
}
|
||||
|
||||
Console.WriteLine("Writing {0} ({1} format)", options.OutputFile, options.TextureFormat);
|
||||
|
||||
SpriteFontWriter.WriteSpriteFont(options, glyphs, lineSpacing, bitmap);
|
||||
}
|
||||
|
||||
|
||||
static Glyph[] ImportFont(CommandLineOptions options, out float lineSpacing)
|
||||
{
|
||||
// Which importer knows how to read this source font?
|
||||
IFontImporter importer;
|
||||
|
||||
string fileExtension = Path.GetExtension(options.SourceFont).ToLowerInvariant();
|
||||
|
||||
string[] BitmapFileExtensions = { ".bmp", ".png", ".gif" };
|
||||
|
||||
if (BitmapFileExtensions.Contains(fileExtension))
|
||||
{
|
||||
importer = new BitmapImporter();
|
||||
}
|
||||
else
|
||||
{
|
||||
importer = new TrueTypeImporter();
|
||||
}
|
||||
|
||||
// Import the source font data.
|
||||
importer.Import(options);
|
||||
|
||||
lineSpacing = importer.LineSpacing;
|
||||
|
||||
var glyphs = importer.Glyphs
|
||||
.OrderBy(glyph => glyph.Character)
|
||||
.ToArray();
|
||||
|
||||
// Validate.
|
||||
if (glyphs.Length == 0)
|
||||
{
|
||||
throw new Exception("Font does not contain any glyphs.");
|
||||
}
|
||||
|
||||
if ((options.DefaultCharacter != 0) && !glyphs.Any(glyph => glyph.Character == options.DefaultCharacter))
|
||||
{
|
||||
throw new Exception("The specified DefaultCharacter is not part of this font.");
|
||||
}
|
||||
|
||||
return glyphs;
|
||||
}
|
||||
}
|
||||
}
|
||||
// DirectXTK MakeSpriteFont tool
|
||||
//
|
||||
// THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF
|
||||
// ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO
|
||||
// THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A
|
||||
// PARTICULAR PURPOSE.
|
||||
//
|
||||
// Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
//
|
||||
// http://go.microsoft.com/fwlink/?LinkId=248929
|
||||
|
||||
using System;
|
||||
using System.IO;
|
||||
using System.Linq;
|
||||
using System.Drawing;
|
||||
|
||||
namespace MakeSpriteFont
|
||||
{
|
||||
public class Program
|
||||
{
|
||||
public static int Main(string[] args)
|
||||
{
|
||||
// Parse the commandline options.
|
||||
var options = new CommandLineOptions();
|
||||
var parser = new CommandLineParser(options);
|
||||
|
||||
if (!parser.ParseCommandLine(args))
|
||||
return 1;
|
||||
|
||||
try
|
||||
{
|
||||
// Convert the font.
|
||||
MakeSpriteFont(options);
|
||||
|
||||
return 0;
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
// Print an error message if conversion failed.
|
||||
Console.WriteLine();
|
||||
Console.Error.WriteLine("Error: {0}", e.Message);
|
||||
|
||||
return 1;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
static void MakeSpriteFont(CommandLineOptions options)
|
||||
{
|
||||
// Import.
|
||||
Console.WriteLine("Importing {0}", options.SourceFont);
|
||||
|
||||
float lineSpacing;
|
||||
|
||||
Glyph[] glyphs = ImportFont(options, out lineSpacing);
|
||||
|
||||
Console.WriteLine("Captured {0} glyphs", glyphs.Length);
|
||||
|
||||
// Optimize.
|
||||
Console.WriteLine("Cropping glyph borders");
|
||||
|
||||
foreach (Glyph glyph in glyphs)
|
||||
{
|
||||
GlyphCropper.Crop(glyph);
|
||||
}
|
||||
|
||||
Console.WriteLine("Packing glyphs into sprite sheet");
|
||||
|
||||
Bitmap bitmap;
|
||||
|
||||
if (options.FastPack)
|
||||
{
|
||||
bitmap = GlyphPacker.ArrangeGlyphsFast(glyphs);
|
||||
}
|
||||
else
|
||||
{
|
||||
bitmap = GlyphPacker.ArrangeGlyphs(glyphs);
|
||||
}
|
||||
|
||||
// Emit texture size warning based on known Feature Level limits.
|
||||
if (bitmap.Width > 16384 || bitmap.Height > 16384)
|
||||
{
|
||||
Console.WriteLine("WARNING: Resulting texture is too large for all known Feature Levels (9.1 - 12.1)");
|
||||
}
|
||||
else if (bitmap.Width > 8192 || bitmap.Height > 8192)
|
||||
{
|
||||
if (options.FeatureLevel < FeatureLevel.FL11_0)
|
||||
{
|
||||
Console.WriteLine("WARNING: Resulting texture requires a Feature Level 11.0 or later device.");
|
||||
}
|
||||
}
|
||||
else if (bitmap.Width > 4096 || bitmap.Height > 4096)
|
||||
{
|
||||
if (options.FeatureLevel < FeatureLevel.FL10_0)
|
||||
{
|
||||
Console.WriteLine("WARNING: Resulting texture requires a Feature Level 10.0 or later device.");
|
||||
}
|
||||
}
|
||||
else if (bitmap.Width > 2048 || bitmap.Height > 2048)
|
||||
{
|
||||
if (options.FeatureLevel < FeatureLevel.FL9_3)
|
||||
{
|
||||
Console.WriteLine("WARNING: Resulting texture requires a Feature Level 9.3 or later device.");
|
||||
}
|
||||
}
|
||||
|
||||
// Adjust line and character spacing.
|
||||
lineSpacing += options.LineSpacing;
|
||||
|
||||
foreach (Glyph glyph in glyphs)
|
||||
{
|
||||
glyph.XAdvance += options.CharacterSpacing;
|
||||
}
|
||||
|
||||
// Automatically detect whether this is a monochromatic or color font?
|
||||
if (options.TextureFormat == TextureFormat.Auto)
|
||||
{
|
||||
bool isMono = BitmapUtils.IsRgbEntirely(Color.White, bitmap);
|
||||
|
||||
options.TextureFormat = isMono ? TextureFormat.CompressedMono :
|
||||
TextureFormat.Rgba32;
|
||||
}
|
||||
|
||||
// Convert to premultiplied alpha format.
|
||||
if (!options.NoPremultiply)
|
||||
{
|
||||
Console.WriteLine("Premultiplying alpha");
|
||||
|
||||
BitmapUtils.PremultiplyAlpha(bitmap);
|
||||
}
|
||||
|
||||
// Save output files.
|
||||
if (!string.IsNullOrEmpty(options.DebugOutputSpriteSheet))
|
||||
{
|
||||
Console.WriteLine("Saving debug output spritesheet {0}", options.DebugOutputSpriteSheet);
|
||||
|
||||
bitmap.Save(options.DebugOutputSpriteSheet);
|
||||
}
|
||||
|
||||
Console.WriteLine("Writing {0} ({1} format)", options.OutputFile, options.TextureFormat);
|
||||
|
||||
SpriteFontWriter.WriteSpriteFont(options, glyphs, lineSpacing, bitmap);
|
||||
}
|
||||
|
||||
|
||||
static Glyph[] ImportFont(CommandLineOptions options, out float lineSpacing)
|
||||
{
|
||||
// Which importer knows how to read this source font?
|
||||
IFontImporter importer;
|
||||
|
||||
string fileExtension = Path.GetExtension(options.SourceFont).ToLowerInvariant();
|
||||
|
||||
string[] BitmapFileExtensions = { ".bmp", ".png", ".gif" };
|
||||
|
||||
if (BitmapFileExtensions.Contains(fileExtension))
|
||||
{
|
||||
importer = new BitmapImporter();
|
||||
}
|
||||
else
|
||||
{
|
||||
importer = new TrueTypeImporter();
|
||||
}
|
||||
|
||||
// Import the source font data.
|
||||
importer.Import(options);
|
||||
|
||||
lineSpacing = importer.LineSpacing;
|
||||
|
||||
var glyphs = importer.Glyphs
|
||||
.OrderBy(glyph => glyph.Character)
|
||||
.ToArray();
|
||||
|
||||
// Validate.
|
||||
if (glyphs.Length == 0)
|
||||
{
|
||||
throw new Exception("Font does not contain any glyphs.");
|
||||
}
|
||||
|
||||
if ((options.DefaultCharacter != 0) && !glyphs.Any(glyph => glyph.Character == options.DefaultCharacter))
|
||||
{
|
||||
throw new Exception("The specified DefaultCharacter is not part of this font.");
|
||||
}
|
||||
|
||||
return glyphs;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,45 +1,45 @@
|
|||
// THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF
|
||||
// ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO
|
||||
// THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A
|
||||
// PARTICULAR PURPOSE.
|
||||
//
|
||||
// Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
//
|
||||
// http://go.microsoft.com/fwlink/?LinkId=248929
|
||||
|
||||
using System.Reflection;
|
||||
using System.Runtime.CompilerServices;
|
||||
using System.Runtime.InteropServices;
|
||||
|
||||
// General Information about an assembly is controlled through the following
|
||||
// set of attributes. Change these attribute values to modify the information
|
||||
// associated with an assembly.
|
||||
[assembly: AssemblyTitle("MakeSpriteFont")]
|
||||
[assembly: AssemblyDescription("")]
|
||||
[assembly: AssemblyConfiguration("")]
|
||||
[assembly: AssemblyCompany("Microsoft Corporation")]
|
||||
[assembly: AssemblyProduct("MakeSpriteFont")]
|
||||
[assembly: AssemblyCopyright("Copyright (c) Microsoft Corporation. All rights reserved")]
|
||||
[assembly: AssemblyTrademark("")]
|
||||
[assembly: AssemblyCulture("")]
|
||||
|
||||
// Setting ComVisible to false makes the types in this assembly not visible
|
||||
// to COM components. If you need to access a type in this assembly from
|
||||
// COM, set the ComVisible attribute to true on that type.
|
||||
[assembly: ComVisible(false)]
|
||||
|
||||
// The following GUID is for the ID of the typelib if this project is exposed to COM
|
||||
[assembly: Guid("12c0da00-f622-41f2-ab8f-1b4e19aa2a6f")]
|
||||
|
||||
// Version information for an assembly consists of the following four values:
|
||||
//
|
||||
// Major Version
|
||||
// Minor Version
|
||||
// Build Number
|
||||
// Revision
|
||||
//
|
||||
// You can specify all the values or you can default the Build and Revision Numbers
|
||||
// by using the '*' as shown below:
|
||||
// [assembly: AssemblyVersion("1.0.*")]
|
||||
[assembly: AssemblyVersion("1.0.0.0")]
|
||||
[assembly: AssemblyFileVersion("1.0.0.0")]
|
||||
// THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF
|
||||
// ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO
|
||||
// THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A
|
||||
// PARTICULAR PURPOSE.
|
||||
//
|
||||
// Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
//
|
||||
// http://go.microsoft.com/fwlink/?LinkId=248929
|
||||
|
||||
using System.Reflection;
|
||||
using System.Runtime.CompilerServices;
|
||||
using System.Runtime.InteropServices;
|
||||
|
||||
// General Information about an assembly is controlled through the following
|
||||
// set of attributes. Change these attribute values to modify the information
|
||||
// associated with an assembly.
|
||||
[assembly: AssemblyTitle("MakeSpriteFont")]
|
||||
[assembly: AssemblyDescription("")]
|
||||
[assembly: AssemblyConfiguration("")]
|
||||
[assembly: AssemblyCompany("Microsoft Corporation")]
|
||||
[assembly: AssemblyProduct("MakeSpriteFont")]
|
||||
[assembly: AssemblyCopyright("Copyright (c) Microsoft Corporation. All rights reserved")]
|
||||
[assembly: AssemblyTrademark("")]
|
||||
[assembly: AssemblyCulture("")]
|
||||
|
||||
// Setting ComVisible to false makes the types in this assembly not visible
|
||||
// to COM components. If you need to access a type in this assembly from
|
||||
// COM, set the ComVisible attribute to true on that type.
|
||||
[assembly: ComVisible(false)]
|
||||
|
||||
// The following GUID is for the ID of the typelib if this project is exposed to COM
|
||||
[assembly: Guid("12c0da00-f622-41f2-ab8f-1b4e19aa2a6f")]
|
||||
|
||||
// Version information for an assembly consists of the following four values:
|
||||
//
|
||||
// Major Version
|
||||
// Minor Version
|
||||
// Build Number
|
||||
// Revision
|
||||
//
|
||||
// You can specify all the values or you can default the Build and Revision Numbers
|
||||
// by using the '*' as shown below:
|
||||
// [assembly: AssemblyVersion("1.0.*")]
|
||||
[assembly: AssemblyVersion("1.0.0.0")]
|
||||
[assembly: AssemblyFileVersion("1.0.0.0")]
|
||||
|
|
|
@ -1,272 +1,272 @@
|
|||
// DirectXTK MakeSpriteFont tool
|
||||
//
|
||||
// THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF
|
||||
// ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO
|
||||
// THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A
|
||||
// PARTICULAR PURPOSE.
|
||||
//
|
||||
// Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
//
|
||||
// http://go.microsoft.com/fwlink/?LinkId=248929
|
||||
|
||||
using System;
|
||||
using System.IO;
|
||||
using System.Drawing;
|
||||
using System.Drawing.Imaging;
|
||||
|
||||
namespace MakeSpriteFont
|
||||
{
|
||||
// Writes the output spritefont binary file.
|
||||
public static class SpriteFontWriter
|
||||
{
|
||||
const string spriteFontMagic = "DXTKfont";
|
||||
|
||||
const int DXGI_FORMAT_R8G8B8A8_UNORM = 28;
|
||||
const int DXGI_FORMAT_B4G4R4A4_UNORM = 115;
|
||||
const int DXGI_FORMAT_BC2_UNORM = 74;
|
||||
|
||||
|
||||
[System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Usage", "CA2202:Do not dispose objects multiple times")]
|
||||
public static void WriteSpriteFont(CommandLineOptions options, Glyph[] glyphs, float lineSpacing, Bitmap bitmap)
|
||||
{
|
||||
using (FileStream file = File.OpenWrite(options.OutputFile))
|
||||
using (BinaryWriter writer = new BinaryWriter(file))
|
||||
{
|
||||
WriteMagic(writer);
|
||||
WriteGlyphs(writer, glyphs);
|
||||
|
||||
writer.Write(lineSpacing);
|
||||
writer.Write(options.DefaultCharacter);
|
||||
|
||||
WriteBitmap(writer, options, bitmap);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
static void WriteMagic(BinaryWriter writer)
|
||||
{
|
||||
foreach (char magic in spriteFontMagic)
|
||||
{
|
||||
writer.Write((byte)magic);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
static void WriteGlyphs(BinaryWriter writer, Glyph[] glyphs)
|
||||
{
|
||||
writer.Write(glyphs.Length);
|
||||
|
||||
foreach (Glyph glyph in glyphs)
|
||||
{
|
||||
writer.Write((int)glyph.Character);
|
||||
|
||||
writer.Write(glyph.Subrect.Left);
|
||||
writer.Write(glyph.Subrect.Top);
|
||||
writer.Write(glyph.Subrect.Right);
|
||||
writer.Write(glyph.Subrect.Bottom);
|
||||
|
||||
writer.Write(glyph.XOffset);
|
||||
writer.Write(glyph.YOffset);
|
||||
writer.Write(glyph.XAdvance);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
static void WriteBitmap(BinaryWriter writer, CommandLineOptions options, Bitmap bitmap)
|
||||
{
|
||||
writer.Write(bitmap.Width);
|
||||
writer.Write(bitmap.Height);
|
||||
|
||||
switch (options.TextureFormat)
|
||||
{
|
||||
case TextureFormat.Rgba32:
|
||||
WriteRgba32(writer, bitmap);
|
||||
break;
|
||||
|
||||
case TextureFormat.Bgra4444:
|
||||
WriteBgra4444(writer, bitmap);
|
||||
break;
|
||||
|
||||
case TextureFormat.CompressedMono:
|
||||
WriteCompressedMono(writer, bitmap, options);
|
||||
break;
|
||||
|
||||
default:
|
||||
throw new NotSupportedException();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// Writes an uncompressed 32 bit font texture.
|
||||
static void WriteRgba32(BinaryWriter writer, Bitmap bitmap)
|
||||
{
|
||||
writer.Write(DXGI_FORMAT_R8G8B8A8_UNORM);
|
||||
|
||||
writer.Write(bitmap.Width * 4);
|
||||
writer.Write(bitmap.Height);
|
||||
|
||||
using (var bitmapData = new BitmapUtils.PixelAccessor(bitmap, ImageLockMode.ReadOnly))
|
||||
{
|
||||
for (int y = 0; y < bitmap.Height; y++)
|
||||
{
|
||||
for (int x = 0; x < bitmap.Width; x++)
|
||||
{
|
||||
Color color = bitmapData[x, y];
|
||||
|
||||
writer.Write(color.R);
|
||||
writer.Write(color.G);
|
||||
writer.Write(color.B);
|
||||
writer.Write(color.A);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// Writes a 16 bit font texture.
|
||||
static void WriteBgra4444(BinaryWriter writer, Bitmap bitmap)
|
||||
{
|
||||
writer.Write(DXGI_FORMAT_B4G4R4A4_UNORM);
|
||||
|
||||
writer.Write(bitmap.Width * sizeof(ushort));
|
||||
writer.Write(bitmap.Height);
|
||||
|
||||
using (var bitmapData = new BitmapUtils.PixelAccessor(bitmap, ImageLockMode.ReadOnly))
|
||||
{
|
||||
for (int y = 0; y < bitmap.Height; y++)
|
||||
{
|
||||
for (int x = 0; x < bitmap.Width; x++)
|
||||
{
|
||||
Color color = bitmapData[x, y];
|
||||
|
||||
int r = color.R >> 4;
|
||||
int g = color.G >> 4;
|
||||
int b = color.B >> 4;
|
||||
int a = color.A >> 4;
|
||||
|
||||
int packed = b | (g << 4) | (r << 8) | (a << 12);
|
||||
|
||||
writer.Write((ushort)packed);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// Writes a block compressed monochromatic font texture.
|
||||
static void WriteCompressedMono(BinaryWriter writer, Bitmap bitmap, CommandLineOptions options)
|
||||
{
|
||||
if ((bitmap.Width & 3) != 0 ||
|
||||
(bitmap.Height & 3) != 0)
|
||||
{
|
||||
throw new ArgumentException("Block compression requires texture size to be a multiple of 4.");
|
||||
}
|
||||
|
||||
writer.Write(DXGI_FORMAT_BC2_UNORM);
|
||||
|
||||
writer.Write(bitmap.Width * 4);
|
||||
writer.Write(bitmap.Height / 4);
|
||||
|
||||
using (var bitmapData = new BitmapUtils.PixelAccessor(bitmap, ImageLockMode.ReadOnly))
|
||||
{
|
||||
for (int y = 0; y < bitmap.Height; y += 4)
|
||||
{
|
||||
for (int x = 0; x < bitmap.Width; x += 4)
|
||||
{
|
||||
CompressBlock(writer, bitmapData, x, y, options);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// We want to compress our font textures, because, like, smaller is better,
|
||||
// right? But a standard DXT compressor doesn't do a great job with fonts that
|
||||
// are in premultiplied alpha format. Our font data is greyscale, so all of the
|
||||
// RGBA channels have the same value. If one channel is compressed differently
|
||||
// to another, this causes an ugly variation in brightness of the rendered text.
|
||||
// Also, fonts are mostly either black or white, with grey values only used for
|
||||
// antialiasing along their edges. It is very important that the black and white
|
||||
// areas be accurately represented, while the precise value of grey is less
|
||||
// important.
|
||||
//
|
||||
// Trouble is, your average DXT compressor knows nothing about these
|
||||
// requirements. It will optimize to minimize a generic error metric such as
|
||||
// RMS, but this will often sacrifice crisp black and white in exchange for
|
||||
// needless accuracy of the antialiasing pixels, or encode RGB differently to
|
||||
// alpha. UGLY!
|
||||
//
|
||||
// Fortunately, encoding monochrome fonts turns out to be trivial. Using DXT3,
|
||||
// we can fix the end colors as black and white, which gives guaranteed exact
|
||||
// encoding of the font inside and outside, plus two fractional values for edge
|
||||
// antialiasing. Also, these RGB values (0, 1/3, 2/3, 1) map exactly to four of
|
||||
// the possible 16 alpha values available in DXT3, so we can ensure the RGB and
|
||||
// alpha channels always exactly match.
|
||||
|
||||
static void CompressBlock(BinaryWriter writer, BitmapUtils.PixelAccessor bitmapData, int blockX, int blockY, CommandLineOptions options)
|
||||
{
|
||||
long alphaBits = 0;
|
||||
int rgbBits = 0;
|
||||
|
||||
int pixelCount = 0;
|
||||
|
||||
for (int y = 0; y < 4; y++)
|
||||
{
|
||||
for (int x = 0; x < 4; x++)
|
||||
{
|
||||
long alpha;
|
||||
int rgb;
|
||||
|
||||
int value = bitmapData[blockX + x, blockY + y].A;
|
||||
|
||||
if (options.NoPremultiply)
|
||||
{
|
||||
// If we are not premultiplied, RGB is always white and we have 4 bit alpha.
|
||||
alpha = value >> 4;
|
||||
rgb = 0;
|
||||
}
|
||||
else
|
||||
{
|
||||
// For premultiplied encoding, quantize the source value to 2 bit precision.
|
||||
if (value < 256 / 6)
|
||||
{
|
||||
alpha = 0;
|
||||
rgb = 1;
|
||||
}
|
||||
else if (value < 256 / 2)
|
||||
{
|
||||
alpha = 5;
|
||||
rgb = 3;
|
||||
}
|
||||
else if (value < 256 * 5 / 6)
|
||||
{
|
||||
alpha = 10;
|
||||
rgb = 2;
|
||||
}
|
||||
else
|
||||
{
|
||||
alpha = 15;
|
||||
rgb = 0;
|
||||
}
|
||||
}
|
||||
|
||||
// Add this pixel to the alpha and RGB bit masks.
|
||||
alphaBits |= alpha << (pixelCount * 4);
|
||||
rgbBits |= rgb << (pixelCount * 2);
|
||||
|
||||
pixelCount++;
|
||||
}
|
||||
}
|
||||
|
||||
// Output the alpha bit mask.
|
||||
writer.Write(alphaBits);
|
||||
|
||||
// Output the two endpoint colors (black and white in 5.6.5 format).
|
||||
writer.Write((ushort)0xFFFF);
|
||||
writer.Write((ushort)0);
|
||||
|
||||
// Output the RGB bit mask.
|
||||
writer.Write(rgbBits);
|
||||
}
|
||||
}
|
||||
}
|
||||
// DirectXTK MakeSpriteFont tool
|
||||
//
|
||||
// THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF
|
||||
// ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO
|
||||
// THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A
|
||||
// PARTICULAR PURPOSE.
|
||||
//
|
||||
// Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
//
|
||||
// http://go.microsoft.com/fwlink/?LinkId=248929
|
||||
|
||||
using System;
|
||||
using System.IO;
|
||||
using System.Drawing;
|
||||
using System.Drawing.Imaging;
|
||||
|
||||
namespace MakeSpriteFont
|
||||
{
|
||||
// Writes the output spritefont binary file.
|
||||
public static class SpriteFontWriter
|
||||
{
|
||||
const string spriteFontMagic = "DXTKfont";
|
||||
|
||||
const int DXGI_FORMAT_R8G8B8A8_UNORM = 28;
|
||||
const int DXGI_FORMAT_B4G4R4A4_UNORM = 115;
|
||||
const int DXGI_FORMAT_BC2_UNORM = 74;
|
||||
|
||||
|
||||
[System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Usage", "CA2202:Do not dispose objects multiple times")]
|
||||
public static void WriteSpriteFont(CommandLineOptions options, Glyph[] glyphs, float lineSpacing, Bitmap bitmap)
|
||||
{
|
||||
using (FileStream file = File.OpenWrite(options.OutputFile))
|
||||
using (BinaryWriter writer = new BinaryWriter(file))
|
||||
{
|
||||
WriteMagic(writer);
|
||||
WriteGlyphs(writer, glyphs);
|
||||
|
||||
writer.Write(lineSpacing);
|
||||
writer.Write(options.DefaultCharacter);
|
||||
|
||||
WriteBitmap(writer, options, bitmap);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
static void WriteMagic(BinaryWriter writer)
|
||||
{
|
||||
foreach (char magic in spriteFontMagic)
|
||||
{
|
||||
writer.Write((byte)magic);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
static void WriteGlyphs(BinaryWriter writer, Glyph[] glyphs)
|
||||
{
|
||||
writer.Write(glyphs.Length);
|
||||
|
||||
foreach (Glyph glyph in glyphs)
|
||||
{
|
||||
writer.Write((int)glyph.Character);
|
||||
|
||||
writer.Write(glyph.Subrect.Left);
|
||||
writer.Write(glyph.Subrect.Top);
|
||||
writer.Write(glyph.Subrect.Right);
|
||||
writer.Write(glyph.Subrect.Bottom);
|
||||
|
||||
writer.Write(glyph.XOffset);
|
||||
writer.Write(glyph.YOffset);
|
||||
writer.Write(glyph.XAdvance);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
static void WriteBitmap(BinaryWriter writer, CommandLineOptions options, Bitmap bitmap)
|
||||
{
|
||||
writer.Write(bitmap.Width);
|
||||
writer.Write(bitmap.Height);
|
||||
|
||||
switch (options.TextureFormat)
|
||||
{
|
||||
case TextureFormat.Rgba32:
|
||||
WriteRgba32(writer, bitmap);
|
||||
break;
|
||||
|
||||
case TextureFormat.Bgra4444:
|
||||
WriteBgra4444(writer, bitmap);
|
||||
break;
|
||||
|
||||
case TextureFormat.CompressedMono:
|
||||
WriteCompressedMono(writer, bitmap, options);
|
||||
break;
|
||||
|
||||
default:
|
||||
throw new NotSupportedException();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// Writes an uncompressed 32 bit font texture.
|
||||
static void WriteRgba32(BinaryWriter writer, Bitmap bitmap)
|
||||
{
|
||||
writer.Write(DXGI_FORMAT_R8G8B8A8_UNORM);
|
||||
|
||||
writer.Write(bitmap.Width * 4);
|
||||
writer.Write(bitmap.Height);
|
||||
|
||||
using (var bitmapData = new BitmapUtils.PixelAccessor(bitmap, ImageLockMode.ReadOnly))
|
||||
{
|
||||
for (int y = 0; y < bitmap.Height; y++)
|
||||
{
|
||||
for (int x = 0; x < bitmap.Width; x++)
|
||||
{
|
||||
Color color = bitmapData[x, y];
|
||||
|
||||
writer.Write(color.R);
|
||||
writer.Write(color.G);
|
||||
writer.Write(color.B);
|
||||
writer.Write(color.A);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// Writes a 16 bit font texture.
|
||||
static void WriteBgra4444(BinaryWriter writer, Bitmap bitmap)
|
||||
{
|
||||
writer.Write(DXGI_FORMAT_B4G4R4A4_UNORM);
|
||||
|
||||
writer.Write(bitmap.Width * sizeof(ushort));
|
||||
writer.Write(bitmap.Height);
|
||||
|
||||
using (var bitmapData = new BitmapUtils.PixelAccessor(bitmap, ImageLockMode.ReadOnly))
|
||||
{
|
||||
for (int y = 0; y < bitmap.Height; y++)
|
||||
{
|
||||
for (int x = 0; x < bitmap.Width; x++)
|
||||
{
|
||||
Color color = bitmapData[x, y];
|
||||
|
||||
int r = color.R >> 4;
|
||||
int g = color.G >> 4;
|
||||
int b = color.B >> 4;
|
||||
int a = color.A >> 4;
|
||||
|
||||
int packed = b | (g << 4) | (r << 8) | (a << 12);
|
||||
|
||||
writer.Write((ushort)packed);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// Writes a block compressed monochromatic font texture.
|
||||
static void WriteCompressedMono(BinaryWriter writer, Bitmap bitmap, CommandLineOptions options)
|
||||
{
|
||||
if ((bitmap.Width & 3) != 0 ||
|
||||
(bitmap.Height & 3) != 0)
|
||||
{
|
||||
throw new ArgumentException("Block compression requires texture size to be a multiple of 4.");
|
||||
}
|
||||
|
||||
writer.Write(DXGI_FORMAT_BC2_UNORM);
|
||||
|
||||
writer.Write(bitmap.Width * 4);
|
||||
writer.Write(bitmap.Height / 4);
|
||||
|
||||
using (var bitmapData = new BitmapUtils.PixelAccessor(bitmap, ImageLockMode.ReadOnly))
|
||||
{
|
||||
for (int y = 0; y < bitmap.Height; y += 4)
|
||||
{
|
||||
for (int x = 0; x < bitmap.Width; x += 4)
|
||||
{
|
||||
CompressBlock(writer, bitmapData, x, y, options);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// We want to compress our font textures, because, like, smaller is better,
|
||||
// right? But a standard DXT compressor doesn't do a great job with fonts that
|
||||
// are in premultiplied alpha format. Our font data is greyscale, so all of the
|
||||
// RGBA channels have the same value. If one channel is compressed differently
|
||||
// to another, this causes an ugly variation in brightness of the rendered text.
|
||||
// Also, fonts are mostly either black or white, with grey values only used for
|
||||
// antialiasing along their edges. It is very important that the black and white
|
||||
// areas be accurately represented, while the precise value of grey is less
|
||||
// important.
|
||||
//
|
||||
// Trouble is, your average DXT compressor knows nothing about these
|
||||
// requirements. It will optimize to minimize a generic error metric such as
|
||||
// RMS, but this will often sacrifice crisp black and white in exchange for
|
||||
// needless accuracy of the antialiasing pixels, or encode RGB differently to
|
||||
// alpha. UGLY!
|
||||
//
|
||||
// Fortunately, encoding monochrome fonts turns out to be trivial. Using DXT3,
|
||||
// we can fix the end colors as black and white, which gives guaranteed exact
|
||||
// encoding of the font inside and outside, plus two fractional values for edge
|
||||
// antialiasing. Also, these RGB values (0, 1/3, 2/3, 1) map exactly to four of
|
||||
// the possible 16 alpha values available in DXT3, so we can ensure the RGB and
|
||||
// alpha channels always exactly match.
|
||||
|
||||
static void CompressBlock(BinaryWriter writer, BitmapUtils.PixelAccessor bitmapData, int blockX, int blockY, CommandLineOptions options)
|
||||
{
|
||||
long alphaBits = 0;
|
||||
int rgbBits = 0;
|
||||
|
||||
int pixelCount = 0;
|
||||
|
||||
for (int y = 0; y < 4; y++)
|
||||
{
|
||||
for (int x = 0; x < 4; x++)
|
||||
{
|
||||
long alpha;
|
||||
int rgb;
|
||||
|
||||
int value = bitmapData[blockX + x, blockY + y].A;
|
||||
|
||||
if (options.NoPremultiply)
|
||||
{
|
||||
// If we are not premultiplied, RGB is always white and we have 4 bit alpha.
|
||||
alpha = value >> 4;
|
||||
rgb = 0;
|
||||
}
|
||||
else
|
||||
{
|
||||
// For premultiplied encoding, quantize the source value to 2 bit precision.
|
||||
if (value < 256 / 6)
|
||||
{
|
||||
alpha = 0;
|
||||
rgb = 1;
|
||||
}
|
||||
else if (value < 256 / 2)
|
||||
{
|
||||
alpha = 5;
|
||||
rgb = 3;
|
||||
}
|
||||
else if (value < 256 * 5 / 6)
|
||||
{
|
||||
alpha = 10;
|
||||
rgb = 2;
|
||||
}
|
||||
else
|
||||
{
|
||||
alpha = 15;
|
||||
rgb = 0;
|
||||
}
|
||||
}
|
||||
|
||||
// Add this pixel to the alpha and RGB bit masks.
|
||||
alphaBits |= alpha << (pixelCount * 4);
|
||||
rgbBits |= rgb << (pixelCount * 2);
|
||||
|
||||
pixelCount++;
|
||||
}
|
||||
}
|
||||
|
||||
// Output the alpha bit mask.
|
||||
writer.Write(alphaBits);
|
||||
|
||||
// Output the two endpoint colors (black and white in 5.6.5 format).
|
||||
writer.Write((ushort)0xFFFF);
|
||||
writer.Write((ushort)0);
|
||||
|
||||
// Output the RGB bit mask.
|
||||
writer.Write(rgbBits);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,252 +1,252 @@
|
|||
// DirectXTK MakeSpriteFont tool
|
||||
//
|
||||
// THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF
|
||||
// ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO
|
||||
// THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A
|
||||
// PARTICULAR PURPOSE.
|
||||
//
|
||||
// Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
//
|
||||
// http://go.microsoft.com/fwlink/?LinkId=248929
|
||||
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Globalization;
|
||||
using System.Drawing;
|
||||
using System.Drawing.Drawing2D;
|
||||
using System.Drawing.Imaging;
|
||||
using System.Drawing.Text;
|
||||
using System.Runtime.InteropServices;
|
||||
|
||||
namespace MakeSpriteFont
|
||||
{
|
||||
// Uses System.Drawing (aka GDI+) to rasterize TrueType fonts into a series of glyph bitmaps.
|
||||
public class TrueTypeImporter : IFontImporter
|
||||
{
|
||||
// Properties hold the imported font data.
|
||||
public IEnumerable<Glyph> Glyphs { get; private set; }
|
||||
|
||||
public float LineSpacing { get; private set; }
|
||||
|
||||
|
||||
// Size of the temp surface used for GDI+ rasterization.
|
||||
const int MaxGlyphSize = 1024;
|
||||
|
||||
|
||||
public void Import(CommandLineOptions options)
|
||||
{
|
||||
// Create a bunch of GDI+ objects.
|
||||
using (Font font = CreateFont(options))
|
||||
using (Brush brush = new SolidBrush(Color.White))
|
||||
using (StringFormat stringFormat = new StringFormat(StringFormatFlags.NoFontFallback))
|
||||
using (Bitmap bitmap = new Bitmap(MaxGlyphSize, MaxGlyphSize, PixelFormat.Format32bppArgb))
|
||||
using (Graphics graphics = Graphics.FromImage(bitmap))
|
||||
{
|
||||
graphics.PixelOffsetMode = options.Sharp ? PixelOffsetMode.None : PixelOffsetMode.HighQuality;
|
||||
graphics.InterpolationMode = InterpolationMode.HighQualityBicubic;
|
||||
graphics.TextRenderingHint = TextRenderingHint.AntiAliasGridFit;
|
||||
|
||||
// Which characters do we want to include?
|
||||
var characters = CharacterRegion.Flatten(options.CharacterRegions);
|
||||
|
||||
var glyphList = new List<Glyph>();
|
||||
|
||||
// Rasterize each character in turn.
|
||||
int count = 0;
|
||||
|
||||
foreach (char character in characters)
|
||||
{
|
||||
++count;
|
||||
|
||||
if (count == 500)
|
||||
{
|
||||
if (!options.FastPack)
|
||||
{
|
||||
Console.WriteLine("WARNING: capturing a large font. This may take a long time to complete and could result in too large a texture. Consider using /FastPack.");
|
||||
}
|
||||
Console.Write(".");
|
||||
}
|
||||
else if ((count % 500) == 0)
|
||||
{
|
||||
Console.Write(".");
|
||||
}
|
||||
|
||||
Glyph glyph = ImportGlyph(character, font, brush, stringFormat, bitmap, graphics);
|
||||
|
||||
glyphList.Add(glyph);
|
||||
}
|
||||
|
||||
if (count > 500)
|
||||
{
|
||||
Console.WriteLine();
|
||||
}
|
||||
|
||||
Glyphs = glyphList;
|
||||
|
||||
// Store the font height.
|
||||
LineSpacing = font.GetHeight();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// Attempts to instantiate the requested GDI+ font object.
|
||||
static Font CreateFont(CommandLineOptions options)
|
||||
{
|
||||
Font font = new Font(options.SourceFont, PointsToPixels(options.FontSize), options.FontStyle, GraphicsUnit.Pixel);
|
||||
|
||||
try
|
||||
{
|
||||
// The font constructor automatically substitutes fonts if it can't find the one requested.
|
||||
// But we prefer the caller to know if anything is wrong with their data. A simple string compare
|
||||
// isn't sufficient because some fonts (eg. MS Mincho) change names depending on the locale.
|
||||
|
||||
// Early out: in most cases the name will match the current or invariant culture.
|
||||
if (options.SourceFont.Equals(font.FontFamily.GetName(CultureInfo.CurrentCulture.LCID), StringComparison.OrdinalIgnoreCase) ||
|
||||
options.SourceFont.Equals(font.FontFamily.GetName(CultureInfo.InvariantCulture.LCID), StringComparison.OrdinalIgnoreCase))
|
||||
{
|
||||
return font;
|
||||
}
|
||||
|
||||
// Check the font name in every culture.
|
||||
foreach (CultureInfo culture in CultureInfo.GetCultures(CultureTypes.SpecificCultures))
|
||||
{
|
||||
if (options.SourceFont.Equals(font.FontFamily.GetName(culture.LCID), StringComparison.OrdinalIgnoreCase))
|
||||
{
|
||||
return font;
|
||||
}
|
||||
}
|
||||
|
||||
// A font substitution must have occurred.
|
||||
throw new Exception(string.Format("Can't find font '{0}'.", options.SourceFont));
|
||||
}
|
||||
catch
|
||||
{
|
||||
font.Dispose();
|
||||
throw;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// Converts a font size from points to pixels. Can't just let GDI+ do this for us,
|
||||
// because we want identical results on every machine regardless of system DPI settings.
|
||||
static float PointsToPixels(float points)
|
||||
{
|
||||
return points * 96 / 72;
|
||||
}
|
||||
|
||||
|
||||
// Rasterizes a single character glyph.
|
||||
static Glyph ImportGlyph(char character, Font font, Brush brush, StringFormat stringFormat, Bitmap bitmap, Graphics graphics)
|
||||
{
|
||||
string characterString = character.ToString();
|
||||
|
||||
// Measure the size of this character.
|
||||
SizeF size = graphics.MeasureString(characterString, font, Point.Empty, stringFormat);
|
||||
|
||||
int characterWidth = (int)Math.Ceiling(size.Width);
|
||||
int characterHeight = (int)Math.Ceiling(size.Height);
|
||||
|
||||
// Pad to make sure we capture any overhangs (negative ABC spacing, etc.)
|
||||
int padWidth = characterWidth;
|
||||
int padHeight = characterHeight / 2;
|
||||
|
||||
int bitmapWidth = characterWidth + padWidth * 2;
|
||||
int bitmapHeight = characterHeight + padHeight * 2;
|
||||
|
||||
if (bitmapWidth > MaxGlyphSize || bitmapHeight > MaxGlyphSize)
|
||||
throw new Exception("Excessively large glyph won't fit in my lazily implemented fixed size temp surface.");
|
||||
|
||||
// Render the character.
|
||||
graphics.Clear(Color.Black);
|
||||
graphics.DrawString(characterString, font, brush, padWidth, padHeight, stringFormat);
|
||||
graphics.Flush();
|
||||
|
||||
// Clone the newly rendered image.
|
||||
Bitmap glyphBitmap = bitmap.Clone(new Rectangle(0, 0, bitmapWidth, bitmapHeight), PixelFormat.Format32bppArgb);
|
||||
|
||||
BitmapUtils.ConvertGreyToAlpha(glyphBitmap);
|
||||
|
||||
// Query its ABC spacing.
|
||||
float? abc = GetCharacterWidth(character, font, graphics);
|
||||
|
||||
// Construct the output Glyph object.
|
||||
return new Glyph(character, glyphBitmap)
|
||||
{
|
||||
XOffset = -padWidth,
|
||||
XAdvance = abc.HasValue ? padWidth - bitmapWidth + abc.Value : -padWidth,
|
||||
YOffset = -padHeight,
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
// Queries APC spacing for the specified character.
|
||||
static float? GetCharacterWidth(char character, Font font, Graphics graphics)
|
||||
{
|
||||
// Look up the native device context and font handles.
|
||||
IntPtr hdc = graphics.GetHdc();
|
||||
|
||||
try
|
||||
{
|
||||
IntPtr hFont = font.ToHfont();
|
||||
|
||||
try
|
||||
{
|
||||
// Select our font into the DC.
|
||||
IntPtr oldFont = NativeMethods.SelectObject(hdc, hFont);
|
||||
|
||||
try
|
||||
{
|
||||
// Query the character spacing.
|
||||
var result = new NativeMethods.ABCFloat[1];
|
||||
|
||||
if (NativeMethods.GetCharABCWidthsFloat(hdc, character, character, result))
|
||||
{
|
||||
return result[0].A +
|
||||
result[0].B +
|
||||
result[0].C;
|
||||
}
|
||||
else
|
||||
{
|
||||
return null;
|
||||
}
|
||||
}
|
||||
finally
|
||||
{
|
||||
NativeMethods.SelectObject(hdc, oldFont);
|
||||
}
|
||||
}
|
||||
finally
|
||||
{
|
||||
NativeMethods.DeleteObject(hFont);
|
||||
}
|
||||
}
|
||||
finally
|
||||
{
|
||||
graphics.ReleaseHdc(hdc);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// Interop to the native GDI GetCharABCWidthsFloat method.
|
||||
static class NativeMethods
|
||||
{
|
||||
[DllImport("gdi32.dll")]
|
||||
public static extern IntPtr SelectObject(IntPtr hdc, IntPtr hObject);
|
||||
|
||||
[DllImport("gdi32.dll")]
|
||||
public static extern bool DeleteObject(IntPtr hObject);
|
||||
|
||||
[DllImport("gdi32.dll", CharSet = CharSet.Unicode)]
|
||||
public static extern bool GetCharABCWidthsFloat(IntPtr hdc, uint iFirstChar, uint iLastChar, [Out] ABCFloat[] lpABCF);
|
||||
|
||||
|
||||
[StructLayout(LayoutKind.Sequential)]
|
||||
public struct ABCFloat
|
||||
{
|
||||
public float A;
|
||||
public float B;
|
||||
public float C;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
// DirectXTK MakeSpriteFont tool
|
||||
//
|
||||
// THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF
|
||||
// ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO
|
||||
// THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A
|
||||
// PARTICULAR PURPOSE.
|
||||
//
|
||||
// Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
//
|
||||
// http://go.microsoft.com/fwlink/?LinkId=248929
|
||||
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Globalization;
|
||||
using System.Drawing;
|
||||
using System.Drawing.Drawing2D;
|
||||
using System.Drawing.Imaging;
|
||||
using System.Drawing.Text;
|
||||
using System.Runtime.InteropServices;
|
||||
|
||||
namespace MakeSpriteFont
|
||||
{
|
||||
// Uses System.Drawing (aka GDI+) to rasterize TrueType fonts into a series of glyph bitmaps.
|
||||
public class TrueTypeImporter : IFontImporter
|
||||
{
|
||||
// Properties hold the imported font data.
|
||||
public IEnumerable<Glyph> Glyphs { get; private set; }
|
||||
|
||||
public float LineSpacing { get; private set; }
|
||||
|
||||
|
||||
// Size of the temp surface used for GDI+ rasterization.
|
||||
const int MaxGlyphSize = 1024;
|
||||
|
||||
|
||||
public void Import(CommandLineOptions options)
|
||||
{
|
||||
// Create a bunch of GDI+ objects.
|
||||
using (Font font = CreateFont(options))
|
||||
using (Brush brush = new SolidBrush(Color.White))
|
||||
using (StringFormat stringFormat = new StringFormat(StringFormatFlags.NoFontFallback))
|
||||
using (Bitmap bitmap = new Bitmap(MaxGlyphSize, MaxGlyphSize, PixelFormat.Format32bppArgb))
|
||||
using (Graphics graphics = Graphics.FromImage(bitmap))
|
||||
{
|
||||
graphics.PixelOffsetMode = options.Sharp ? PixelOffsetMode.None : PixelOffsetMode.HighQuality;
|
||||
graphics.InterpolationMode = InterpolationMode.HighQualityBicubic;
|
||||
graphics.TextRenderingHint = TextRenderingHint.AntiAliasGridFit;
|
||||
|
||||
// Which characters do we want to include?
|
||||
var characters = CharacterRegion.Flatten(options.CharacterRegions);
|
||||
|
||||
var glyphList = new List<Glyph>();
|
||||
|
||||
// Rasterize each character in turn.
|
||||
int count = 0;
|
||||
|
||||
foreach (char character in characters)
|
||||
{
|
||||
++count;
|
||||
|
||||
if (count == 500)
|
||||
{
|
||||
if (!options.FastPack)
|
||||
{
|
||||
Console.WriteLine("WARNING: capturing a large font. This may take a long time to complete and could result in too large a texture. Consider using /FastPack.");
|
||||
}
|
||||
Console.Write(".");
|
||||
}
|
||||
else if ((count % 500) == 0)
|
||||
{
|
||||
Console.Write(".");
|
||||
}
|
||||
|
||||
Glyph glyph = ImportGlyph(character, font, brush, stringFormat, bitmap, graphics);
|
||||
|
||||
glyphList.Add(glyph);
|
||||
}
|
||||
|
||||
if (count > 500)
|
||||
{
|
||||
Console.WriteLine();
|
||||
}
|
||||
|
||||
Glyphs = glyphList;
|
||||
|
||||
// Store the font height.
|
||||
LineSpacing = font.GetHeight();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// Attempts to instantiate the requested GDI+ font object.
|
||||
static Font CreateFont(CommandLineOptions options)
|
||||
{
|
||||
Font font = new Font(options.SourceFont, PointsToPixels(options.FontSize), options.FontStyle, GraphicsUnit.Pixel);
|
||||
|
||||
try
|
||||
{
|
||||
// The font constructor automatically substitutes fonts if it can't find the one requested.
|
||||
// But we prefer the caller to know if anything is wrong with their data. A simple string compare
|
||||
// isn't sufficient because some fonts (eg. MS Mincho) change names depending on the locale.
|
||||
|
||||
// Early out: in most cases the name will match the current or invariant culture.
|
||||
if (options.SourceFont.Equals(font.FontFamily.GetName(CultureInfo.CurrentCulture.LCID), StringComparison.OrdinalIgnoreCase) ||
|
||||
options.SourceFont.Equals(font.FontFamily.GetName(CultureInfo.InvariantCulture.LCID), StringComparison.OrdinalIgnoreCase))
|
||||
{
|
||||
return font;
|
||||
}
|
||||
|
||||
// Check the font name in every culture.
|
||||
foreach (CultureInfo culture in CultureInfo.GetCultures(CultureTypes.SpecificCultures))
|
||||
{
|
||||
if (options.SourceFont.Equals(font.FontFamily.GetName(culture.LCID), StringComparison.OrdinalIgnoreCase))
|
||||
{
|
||||
return font;
|
||||
}
|
||||
}
|
||||
|
||||
// A font substitution must have occurred.
|
||||
throw new Exception(string.Format("Can't find font '{0}'.", options.SourceFont));
|
||||
}
|
||||
catch
|
||||
{
|
||||
font.Dispose();
|
||||
throw;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// Converts a font size from points to pixels. Can't just let GDI+ do this for us,
|
||||
// because we want identical results on every machine regardless of system DPI settings.
|
||||
static float PointsToPixels(float points)
|
||||
{
|
||||
return points * 96 / 72;
|
||||
}
|
||||
|
||||
|
||||
// Rasterizes a single character glyph.
|
||||
static Glyph ImportGlyph(char character, Font font, Brush brush, StringFormat stringFormat, Bitmap bitmap, Graphics graphics)
|
||||
{
|
||||
string characterString = character.ToString();
|
||||
|
||||
// Measure the size of this character.
|
||||
SizeF size = graphics.MeasureString(characterString, font, Point.Empty, stringFormat);
|
||||
|
||||
int characterWidth = (int)Math.Ceiling(size.Width);
|
||||
int characterHeight = (int)Math.Ceiling(size.Height);
|
||||
|
||||
// Pad to make sure we capture any overhangs (negative ABC spacing, etc.)
|
||||
int padWidth = characterWidth;
|
||||
int padHeight = characterHeight / 2;
|
||||
|
||||
int bitmapWidth = characterWidth + padWidth * 2;
|
||||
int bitmapHeight = characterHeight + padHeight * 2;
|
||||
|
||||
if (bitmapWidth > MaxGlyphSize || bitmapHeight > MaxGlyphSize)
|
||||
throw new Exception("Excessively large glyph won't fit in my lazily implemented fixed size temp surface.");
|
||||
|
||||
// Render the character.
|
||||
graphics.Clear(Color.Black);
|
||||
graphics.DrawString(characterString, font, brush, padWidth, padHeight, stringFormat);
|
||||
graphics.Flush();
|
||||
|
||||
// Clone the newly rendered image.
|
||||
Bitmap glyphBitmap = bitmap.Clone(new Rectangle(0, 0, bitmapWidth, bitmapHeight), PixelFormat.Format32bppArgb);
|
||||
|
||||
BitmapUtils.ConvertGreyToAlpha(glyphBitmap);
|
||||
|
||||
// Query its ABC spacing.
|
||||
float? abc = GetCharacterWidth(character, font, graphics);
|
||||
|
||||
// Construct the output Glyph object.
|
||||
return new Glyph(character, glyphBitmap)
|
||||
{
|
||||
XOffset = -padWidth,
|
||||
XAdvance = abc.HasValue ? padWidth - bitmapWidth + abc.Value : -padWidth,
|
||||
YOffset = -padHeight,
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
// Queries APC spacing for the specified character.
|
||||
static float? GetCharacterWidth(char character, Font font, Graphics graphics)
|
||||
{
|
||||
// Look up the native device context and font handles.
|
||||
IntPtr hdc = graphics.GetHdc();
|
||||
|
||||
try
|
||||
{
|
||||
IntPtr hFont = font.ToHfont();
|
||||
|
||||
try
|
||||
{
|
||||
// Select our font into the DC.
|
||||
IntPtr oldFont = NativeMethods.SelectObject(hdc, hFont);
|
||||
|
||||
try
|
||||
{
|
||||
// Query the character spacing.
|
||||
var result = new NativeMethods.ABCFloat[1];
|
||||
|
||||
if (NativeMethods.GetCharABCWidthsFloat(hdc, character, character, result))
|
||||
{
|
||||
return result[0].A +
|
||||
result[0].B +
|
||||
result[0].C;
|
||||
}
|
||||
else
|
||||
{
|
||||
return null;
|
||||
}
|
||||
}
|
||||
finally
|
||||
{
|
||||
NativeMethods.SelectObject(hdc, oldFont);
|
||||
}
|
||||
}
|
||||
finally
|
||||
{
|
||||
NativeMethods.DeleteObject(hFont);
|
||||
}
|
||||
}
|
||||
finally
|
||||
{
|
||||
graphics.ReleaseHdc(hdc);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// Interop to the native GDI GetCharABCWidthsFloat method.
|
||||
static class NativeMethods
|
||||
{
|
||||
[DllImport("gdi32.dll")]
|
||||
public static extern IntPtr SelectObject(IntPtr hdc, IntPtr hObject);
|
||||
|
||||
[DllImport("gdi32.dll")]
|
||||
public static extern bool DeleteObject(IntPtr hObject);
|
||||
|
||||
[DllImport("gdi32.dll", CharSet = CharSet.Unicode)]
|
||||
public static extern bool GetCharABCWidthsFloat(IntPtr hdc, uint iFirstChar, uint iLastChar, [Out] ABCFloat[] lpABCF);
|
||||
|
||||
|
||||
[StructLayout(LayoutKind.Sequential)]
|
||||
public struct ABCFloat
|
||||
{
|
||||
public float A;
|
||||
public float B;
|
||||
public float C;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
134
Src/AlignedNew.h
134
Src/AlignedNew.h
|
@ -1,67 +1,67 @@
|
|||
//--------------------------------------------------------------------------------------
|
||||
// File: AlignedNew.h
|
||||
//
|
||||
// THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF
|
||||
// ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO
|
||||
// THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A
|
||||
// PARTICULAR PURPOSE.
|
||||
//
|
||||
// Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
//
|
||||
// http://go.microsoft.com/fwlink/?LinkId=248929
|
||||
//--------------------------------------------------------------------------------------
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <malloc.h>
|
||||
#include <exception>
|
||||
|
||||
|
||||
namespace DirectX
|
||||
{
|
||||
// Derive from this to customize operator new and delete for
|
||||
// types that have special heap alignment requirements.
|
||||
//
|
||||
// Example usage:
|
||||
//
|
||||
// __declspec(align(16)) struct MyAlignedType : public AlignedNew<MyAlignedType>
|
||||
|
||||
template<typename TDerived>
|
||||
struct AlignedNew
|
||||
{
|
||||
// Allocate aligned memory.
|
||||
static void* operator new (size_t size)
|
||||
{
|
||||
const size_t alignment = __alignof(TDerived);
|
||||
|
||||
static_assert(alignment > 8, "AlignedNew is only useful for types with > 8 byte alignment. Did you forget a __declspec(align) on TDerived?");
|
||||
|
||||
void* ptr = _aligned_malloc(size, alignment);
|
||||
|
||||
if (!ptr)
|
||||
throw std::bad_alloc();
|
||||
|
||||
return ptr;
|
||||
}
|
||||
|
||||
|
||||
// Free aligned memory.
|
||||
static void operator delete (void* ptr)
|
||||
{
|
||||
_aligned_free(ptr);
|
||||
}
|
||||
|
||||
|
||||
// Array overloads.
|
||||
static void* operator new[] (size_t size)
|
||||
{
|
||||
return operator new(size);
|
||||
}
|
||||
|
||||
|
||||
static void operator delete[] (void* ptr)
|
||||
{
|
||||
operator delete(ptr);
|
||||
}
|
||||
};
|
||||
}
|
||||
//--------------------------------------------------------------------------------------
|
||||
// File: AlignedNew.h
|
||||
//
|
||||
// THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF
|
||||
// ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO
|
||||
// THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A
|
||||
// PARTICULAR PURPOSE.
|
||||
//
|
||||
// Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
//
|
||||
// http://go.microsoft.com/fwlink/?LinkId=248929
|
||||
//--------------------------------------------------------------------------------------
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <malloc.h>
|
||||
#include <exception>
|
||||
|
||||
|
||||
namespace DirectX
|
||||
{
|
||||
// Derive from this to customize operator new and delete for
|
||||
// types that have special heap alignment requirements.
|
||||
//
|
||||
// Example usage:
|
||||
//
|
||||
// __declspec(align(16)) struct MyAlignedType : public AlignedNew<MyAlignedType>
|
||||
|
||||
template<typename TDerived>
|
||||
struct AlignedNew
|
||||
{
|
||||
// Allocate aligned memory.
|
||||
static void* operator new (size_t size)
|
||||
{
|
||||
const size_t alignment = __alignof(TDerived);
|
||||
|
||||
static_assert(alignment > 8, "AlignedNew is only useful for types with > 8 byte alignment. Did you forget a __declspec(align) on TDerived?");
|
||||
|
||||
void* ptr = _aligned_malloc(size, alignment);
|
||||
|
||||
if (!ptr)
|
||||
throw std::bad_alloc();
|
||||
|
||||
return ptr;
|
||||
}
|
||||
|
||||
|
||||
// Free aligned memory.
|
||||
static void operator delete (void* ptr)
|
||||
{
|
||||
_aligned_free(ptr);
|
||||
}
|
||||
|
||||
|
||||
// Array overloads.
|
||||
static void* operator new[] (size_t size)
|
||||
{
|
||||
return operator new(size);
|
||||
}
|
||||
|
||||
|
||||
static void operator delete[] (void* ptr)
|
||||
{
|
||||
operator delete(ptr);
|
||||
}
|
||||
};
|
||||
}
|
||||
|
|
338
Src/Bezier.h
338
Src/Bezier.h
|
@ -1,169 +1,169 @@
|
|||
//--------------------------------------------------------------------------------------
|
||||
// File: Bezier.h
|
||||
//
|
||||
// THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF
|
||||
// ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO
|
||||
// THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A
|
||||
// PARTICULAR PURPOSE.
|
||||
//
|
||||
// Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
//
|
||||
// http://go.microsoft.com/fwlink/?LinkId=248929
|
||||
//--------------------------------------------------------------------------------------
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <array>
|
||||
#include <algorithm>
|
||||
#include <DirectXMath.h>
|
||||
|
||||
|
||||
namespace Bezier
|
||||
{
|
||||
// Performs a cubic bezier interpolation between four control points,
|
||||
// returning the value at the specified time (t ranges 0 to 1).
|
||||
// This template implementation can be used to interpolate XMVECTOR,
|
||||
// float, or any other types that define suitable * and + operators.
|
||||
template<typename T>
|
||||
T CubicInterpolate(T const& p1, T const& p2, T const& p3, T const& p4, float t)
|
||||
{
|
||||
using DirectX::operator*;
|
||||
using DirectX::operator+;
|
||||
|
||||
return p1 * (1 - t) * (1 - t) * (1 - t) +
|
||||
p2 * 3 * t * (1 - t) * (1 - t) +
|
||||
p3 * 3 * t * t * (1 - t) +
|
||||
p4 * t * t * t;
|
||||
}
|
||||
|
||||
|
||||
// Computes the tangent of a cubic bezier curve at the specified time.
|
||||
// Template supports XMVECTOR, float, or any other types with * and + operators.
|
||||
template<typename T>
|
||||
T CubicTangent(T const& p1, T const& p2, T const& p3, T const& p4, float t)
|
||||
{
|
||||
using DirectX::operator*;
|
||||
using DirectX::operator+;
|
||||
|
||||
return p1 * (-1 + 2 * t - t * t) +
|
||||
p2 * (1 - 4 * t + 3 * t * t) +
|
||||
p3 * (2 * t - 3 * t * t) +
|
||||
p4 * (t * t);
|
||||
}
|
||||
|
||||
|
||||
// Creates vertices for a patch that is tessellated at the specified level.
|
||||
// Calls the specified outputVertex function for each generated vertex,
|
||||
// passing the position, normal, and texture coordinate as parameters.
|
||||
template<typename TOutputFunc>
|
||||
void CreatePatchVertices(_In_reads_(16) DirectX::XMVECTOR patch[16], size_t tessellation, bool isMirrored, TOutputFunc outputVertex)
|
||||
{
|
||||
using namespace DirectX;
|
||||
|
||||
for (size_t i = 0; i <= tessellation; i++)
|
||||
{
|
||||
float u = (float)i / tessellation;
|
||||
|
||||
for (size_t j = 0; j <= tessellation; j++)
|
||||
{
|
||||
float v = (float)j / tessellation;
|
||||
|
||||
// Perform four horizontal bezier interpolations
|
||||
// between the control points of this patch.
|
||||
XMVECTOR p1 = CubicInterpolate(patch[0], patch[1], patch[2], patch[3], u);
|
||||
XMVECTOR p2 = CubicInterpolate(patch[4], patch[5], patch[6], patch[7], u);
|
||||
XMVECTOR p3 = CubicInterpolate(patch[8], patch[9], patch[10], patch[11], u);
|
||||
XMVECTOR p4 = CubicInterpolate(patch[12], patch[13], patch[14], patch[15], u);
|
||||
|
||||
// Perform a vertical interpolation between the results of the
|
||||
// previous horizontal interpolations, to compute the position.
|
||||
XMVECTOR position = CubicInterpolate(p1, p2, p3, p4, v);
|
||||
|
||||
// Perform another four bezier interpolations between the control
|
||||
// points, but this time vertically rather than horizontally.
|
||||
XMVECTOR q1 = CubicInterpolate(patch[0], patch[4], patch[8], patch[12], v);
|
||||
XMVECTOR q2 = CubicInterpolate(patch[1], patch[5], patch[9], patch[13], v);
|
||||
XMVECTOR q3 = CubicInterpolate(patch[2], patch[6], patch[10], patch[14], v);
|
||||
XMVECTOR q4 = CubicInterpolate(patch[3], patch[7], patch[11], patch[15], v);
|
||||
|
||||
// Compute vertical and horizontal tangent vectors.
|
||||
XMVECTOR tangent1 = CubicTangent(p1, p2, p3, p4, v);
|
||||
XMVECTOR tangent2 = CubicTangent(q1, q2, q3, q4, u);
|
||||
|
||||
// Cross the two tangent vectors to compute the normal.
|
||||
XMVECTOR normal = XMVector3Cross(tangent1, tangent2);
|
||||
|
||||
if (!XMVector3NearEqual(normal, XMVectorZero(), g_XMEpsilon))
|
||||
{
|
||||
normal = XMVector3Normalize(normal);
|
||||
|
||||
// If this patch is mirrored, we must invert the normal.
|
||||
if (isMirrored)
|
||||
{
|
||||
normal = -normal;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
// In a tidy and well constructed bezier patch, the preceding
|
||||
// normal computation will always work. But the classic teapot
|
||||
// model is not tidy or well constructed! At the top and bottom
|
||||
// of the teapot, it contains degenerate geometry where a patch
|
||||
// has several control points in the same place, which causes
|
||||
// the tangent computation to fail and produce a zero normal.
|
||||
// We 'fix' these cases by just hard-coding a normal that points
|
||||
// either straight up or straight down, depending on whether we
|
||||
// are on the top or bottom of the teapot. This is not a robust
|
||||
// solution for all possible degenerate bezier patches, but hey,
|
||||
// it's good enough to make the teapot work correctly!
|
||||
|
||||
normal = XMVectorSelect(g_XMIdentityR1, g_XMNegIdentityR1, XMVectorLess(position, XMVectorZero()));
|
||||
}
|
||||
|
||||
// Compute the texture coordinate.
|
||||
float mirroredU = isMirrored ? 1 - u : u;
|
||||
|
||||
XMVECTOR textureCoordinate = XMVectorSet(mirroredU, v, 0, 0);
|
||||
|
||||
// Output this vertex.
|
||||
outputVertex(position, normal, textureCoordinate);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// Creates indices for a patch that is tessellated at the specified level.
|
||||
// Calls the specified outputIndex function for each generated index value.
|
||||
template<typename TOutputFunc>
|
||||
void CreatePatchIndices(size_t tessellation, bool isMirrored, TOutputFunc outputIndex)
|
||||
{
|
||||
size_t stride = tessellation + 1;
|
||||
|
||||
for (size_t i = 0; i < tessellation; i++)
|
||||
{
|
||||
for (size_t j = 0; j < tessellation; j++)
|
||||
{
|
||||
// Make a list of six index values (two triangles).
|
||||
std::array<size_t, 6> indices =
|
||||
{
|
||||
i * stride + j,
|
||||
(i + 1) * stride + j,
|
||||
(i + 1) * stride + j + 1,
|
||||
|
||||
i * stride + j,
|
||||
(i + 1) * stride + j + 1,
|
||||
i * stride + j + 1,
|
||||
};
|
||||
|
||||
// If this patch is mirrored, reverse indices to fix the winding order.
|
||||
if (isMirrored)
|
||||
{
|
||||
std::reverse(indices.begin(), indices.end());
|
||||
}
|
||||
|
||||
// Output these index values.
|
||||
std::for_each(indices.begin(), indices.end(), outputIndex);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
//--------------------------------------------------------------------------------------
|
||||
// File: Bezier.h
|
||||
//
|
||||
// THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF
|
||||
// ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO
|
||||
// THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A
|
||||
// PARTICULAR PURPOSE.
|
||||
//
|
||||
// Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
//
|
||||
// http://go.microsoft.com/fwlink/?LinkId=248929
|
||||
//--------------------------------------------------------------------------------------
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <array>
|
||||
#include <algorithm>
|
||||
#include <DirectXMath.h>
|
||||
|
||||
|
||||
namespace Bezier
|
||||
{
|
||||
// Performs a cubic bezier interpolation between four control points,
|
||||
// returning the value at the specified time (t ranges 0 to 1).
|
||||
// This template implementation can be used to interpolate XMVECTOR,
|
||||
// float, or any other types that define suitable * and + operators.
|
||||
template<typename T>
|
||||
T CubicInterpolate(T const& p1, T const& p2, T const& p3, T const& p4, float t)
|
||||
{
|
||||
using DirectX::operator*;
|
||||
using DirectX::operator+;
|
||||
|
||||
return p1 * (1 - t) * (1 - t) * (1 - t) +
|
||||
p2 * 3 * t * (1 - t) * (1 - t) +
|
||||
p3 * 3 * t * t * (1 - t) +
|
||||
p4 * t * t * t;
|
||||
}
|
||||
|
||||
|
||||
// Computes the tangent of a cubic bezier curve at the specified time.
|
||||
// Template supports XMVECTOR, float, or any other types with * and + operators.
|
||||
template<typename T>
|
||||
T CubicTangent(T const& p1, T const& p2, T const& p3, T const& p4, float t)
|
||||
{
|
||||
using DirectX::operator*;
|
||||
using DirectX::operator+;
|
||||
|
||||
return p1 * (-1 + 2 * t - t * t) +
|
||||
p2 * (1 - 4 * t + 3 * t * t) +
|
||||
p3 * (2 * t - 3 * t * t) +
|
||||
p4 * (t * t);
|
||||
}
|
||||
|
||||
|
||||
// Creates vertices for a patch that is tessellated at the specified level.
|
||||
// Calls the specified outputVertex function for each generated vertex,
|
||||
// passing the position, normal, and texture coordinate as parameters.
|
||||
template<typename TOutputFunc>
|
||||
void CreatePatchVertices(_In_reads_(16) DirectX::XMVECTOR patch[16], size_t tessellation, bool isMirrored, TOutputFunc outputVertex)
|
||||
{
|
||||
using namespace DirectX;
|
||||
|
||||
for (size_t i = 0; i <= tessellation; i++)
|
||||
{
|
||||
float u = (float)i / tessellation;
|
||||
|
||||
for (size_t j = 0; j <= tessellation; j++)
|
||||
{
|
||||
float v = (float)j / tessellation;
|
||||
|
||||
// Perform four horizontal bezier interpolations
|
||||
// between the control points of this patch.
|
||||
XMVECTOR p1 = CubicInterpolate(patch[0], patch[1], patch[2], patch[3], u);
|
||||
XMVECTOR p2 = CubicInterpolate(patch[4], patch[5], patch[6], patch[7], u);
|
||||
XMVECTOR p3 = CubicInterpolate(patch[8], patch[9], patch[10], patch[11], u);
|
||||
XMVECTOR p4 = CubicInterpolate(patch[12], patch[13], patch[14], patch[15], u);
|
||||
|
||||
// Perform a vertical interpolation between the results of the
|
||||
// previous horizontal interpolations, to compute the position.
|
||||
XMVECTOR position = CubicInterpolate(p1, p2, p3, p4, v);
|
||||
|
||||
// Perform another four bezier interpolations between the control
|
||||
// points, but this time vertically rather than horizontally.
|
||||
XMVECTOR q1 = CubicInterpolate(patch[0], patch[4], patch[8], patch[12], v);
|
||||
XMVECTOR q2 = CubicInterpolate(patch[1], patch[5], patch[9], patch[13], v);
|
||||
XMVECTOR q3 = CubicInterpolate(patch[2], patch[6], patch[10], patch[14], v);
|
||||
XMVECTOR q4 = CubicInterpolate(patch[3], patch[7], patch[11], patch[15], v);
|
||||
|
||||
// Compute vertical and horizontal tangent vectors.
|
||||
XMVECTOR tangent1 = CubicTangent(p1, p2, p3, p4, v);
|
||||
XMVECTOR tangent2 = CubicTangent(q1, q2, q3, q4, u);
|
||||
|
||||
// Cross the two tangent vectors to compute the normal.
|
||||
XMVECTOR normal = XMVector3Cross(tangent1, tangent2);
|
||||
|
||||
if (!XMVector3NearEqual(normal, XMVectorZero(), g_XMEpsilon))
|
||||
{
|
||||
normal = XMVector3Normalize(normal);
|
||||
|
||||
// If this patch is mirrored, we must invert the normal.
|
||||
if (isMirrored)
|
||||
{
|
||||
normal = -normal;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
// In a tidy and well constructed bezier patch, the preceding
|
||||
// normal computation will always work. But the classic teapot
|
||||
// model is not tidy or well constructed! At the top and bottom
|
||||
// of the teapot, it contains degenerate geometry where a patch
|
||||
// has several control points in the same place, which causes
|
||||
// the tangent computation to fail and produce a zero normal.
|
||||
// We 'fix' these cases by just hard-coding a normal that points
|
||||
// either straight up or straight down, depending on whether we
|
||||
// are on the top or bottom of the teapot. This is not a robust
|
||||
// solution for all possible degenerate bezier patches, but hey,
|
||||
// it's good enough to make the teapot work correctly!
|
||||
|
||||
normal = XMVectorSelect(g_XMIdentityR1, g_XMNegIdentityR1, XMVectorLess(position, XMVectorZero()));
|
||||
}
|
||||
|
||||
// Compute the texture coordinate.
|
||||
float mirroredU = isMirrored ? 1 - u : u;
|
||||
|
||||
XMVECTOR textureCoordinate = XMVectorSet(mirroredU, v, 0, 0);
|
||||
|
||||
// Output this vertex.
|
||||
outputVertex(position, normal, textureCoordinate);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// Creates indices for a patch that is tessellated at the specified level.
|
||||
// Calls the specified outputIndex function for each generated index value.
|
||||
template<typename TOutputFunc>
|
||||
void CreatePatchIndices(size_t tessellation, bool isMirrored, TOutputFunc outputIndex)
|
||||
{
|
||||
size_t stride = tessellation + 1;
|
||||
|
||||
for (size_t i = 0; i < tessellation; i++)
|
||||
{
|
||||
for (size_t j = 0; j < tessellation; j++)
|
||||
{
|
||||
// Make a list of six index values (two triangles).
|
||||
std::array<size_t, 6> indices =
|
||||
{
|
||||
i * stride + j,
|
||||
(i + 1) * stride + j,
|
||||
(i + 1) * stride + j + 1,
|
||||
|
||||
i * stride + j,
|
||||
(i + 1) * stride + j + 1,
|
||||
i * stride + j + 1,
|
||||
};
|
||||
|
||||
// If this patch is mirrored, reverse indices to fix the winding order.
|
||||
if (isMirrored)
|
||||
{
|
||||
std::reverse(indices.begin(), indices.end());
|
||||
}
|
||||
|
||||
// Output these index values.
|
||||
std::for_each(indices.begin(), indices.end(), outputIndex);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,75 +1,75 @@
|
|||
//--------------------------------------------------------------------------------------
|
||||
// File: BinaryReader.h
|
||||
//
|
||||
// THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF
|
||||
// ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO
|
||||
// THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A
|
||||
// PARTICULAR PURPOSE.
|
||||
//
|
||||
// Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
//
|
||||
// http://go.microsoft.com/fwlink/?LinkId=248929
|
||||
//--------------------------------------------------------------------------------------
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <memory>
|
||||
#include <exception>
|
||||
#include <stdexcept>
|
||||
#include <type_traits>
|
||||
|
||||
#include "PlatformHelpers.h"
|
||||
|
||||
|
||||
namespace DirectX
|
||||
{
|
||||
// Helper for reading binary data, either from the filesystem a memory buffer.
|
||||
class BinaryReader
|
||||
{
|
||||
public:
|
||||
explicit BinaryReader(_In_z_ wchar_t const* fileName);
|
||||
BinaryReader(_In_reads_bytes_(dataSize) uint8_t const* dataBlob, size_t dataSize);
|
||||
|
||||
BinaryReader(BinaryReader const&) = delete;
|
||||
BinaryReader& operator= (BinaryReader const&) = delete;
|
||||
|
||||
// Reads a single value.
|
||||
template<typename T> T const& Read()
|
||||
{
|
||||
return *ReadArray<T>(1);
|
||||
}
|
||||
|
||||
|
||||
// Reads an array of values.
|
||||
template<typename T> T const* ReadArray(size_t elementCount)
|
||||
{
|
||||
static_assert(std::is_pod<T>::value, "Can only read plain-old-data types");
|
||||
|
||||
uint8_t const* newPos = mPos + sizeof(T) * elementCount;
|
||||
|
||||
if (newPos < mPos)
|
||||
throw std::overflow_error("ReadArray");
|
||||
|
||||
if (newPos > mEnd)
|
||||
throw std::exception("End of file");
|
||||
|
||||
auto result = reinterpret_cast<T const*>(mPos);
|
||||
|
||||
mPos = newPos;
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
|
||||
// Lower level helper reads directly from the filesystem into memory.
|
||||
static HRESULT ReadEntireFile(_In_z_ wchar_t const* fileName, _Inout_ std::unique_ptr<uint8_t[]>& data, _Out_ size_t* dataSize);
|
||||
|
||||
|
||||
private:
|
||||
// The data currently being read.
|
||||
uint8_t const* mPos;
|
||||
uint8_t const* mEnd;
|
||||
|
||||
std::unique_ptr<uint8_t[]> mOwnedData;
|
||||
};
|
||||
}
|
||||
//--------------------------------------------------------------------------------------
|
||||
// File: BinaryReader.h
|
||||
//
|
||||
// THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF
|
||||
// ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO
|
||||
// THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A
|
||||
// PARTICULAR PURPOSE.
|
||||
//
|
||||
// Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
//
|
||||
// http://go.microsoft.com/fwlink/?LinkId=248929
|
||||
//--------------------------------------------------------------------------------------
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <memory>
|
||||
#include <exception>
|
||||
#include <stdexcept>
|
||||
#include <type_traits>
|
||||
|
||||
#include "PlatformHelpers.h"
|
||||
|
||||
|
||||
namespace DirectX
|
||||
{
|
||||
// Helper for reading binary data, either from the filesystem a memory buffer.
|
||||
class BinaryReader
|
||||
{
|
||||
public:
|
||||
explicit BinaryReader(_In_z_ wchar_t const* fileName);
|
||||
BinaryReader(_In_reads_bytes_(dataSize) uint8_t const* dataBlob, size_t dataSize);
|
||||
|
||||
BinaryReader(BinaryReader const&) = delete;
|
||||
BinaryReader& operator= (BinaryReader const&) = delete;
|
||||
|
||||
// Reads a single value.
|
||||
template<typename T> T const& Read()
|
||||
{
|
||||
return *ReadArray<T>(1);
|
||||
}
|
||||
|
||||
|
||||
// Reads an array of values.
|
||||
template<typename T> T const* ReadArray(size_t elementCount)
|
||||
{
|
||||
static_assert(std::is_pod<T>::value, "Can only read plain-old-data types");
|
||||
|
||||
uint8_t const* newPos = mPos + sizeof(T) * elementCount;
|
||||
|
||||
if (newPos < mPos)
|
||||
throw std::overflow_error("ReadArray");
|
||||
|
||||
if (newPos > mEnd)
|
||||
throw std::exception("End of file");
|
||||
|
||||
auto result = reinterpret_cast<T const*>(mPos);
|
||||
|
||||
mPos = newPos;
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
|
||||
// Lower level helper reads directly from the filesystem into memory.
|
||||
static HRESULT ReadEntireFile(_In_z_ wchar_t const* fileName, _Inout_ std::unique_ptr<uint8_t[]>& data, _Out_ size_t* dataSize);
|
||||
|
||||
|
||||
private:
|
||||
// The data currently being read.
|
||||
uint8_t const* mPos;
|
||||
uint8_t const* mEnd;
|
||||
|
||||
std::unique_ptr<uint8_t[]> mOwnedData;
|
||||
};
|
||||
}
|
||||
|
|
|
@ -1,115 +1,115 @@
|
|||
//--------------------------------------------------------------------------------------
|
||||
// File: ConstantBuffer.h
|
||||
//
|
||||
// THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF
|
||||
// ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO
|
||||
// THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A
|
||||
// PARTICULAR PURPOSE.
|
||||
//
|
||||
// Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
//
|
||||
// http://go.microsoft.com/fwlink/?LinkId=248929
|
||||
//--------------------------------------------------------------------------------------
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "DirectXHelpers.h"
|
||||
#include "GraphicsMemory.h"
|
||||
#include "PlatformHelpers.h"
|
||||
|
||||
|
||||
namespace DirectX
|
||||
{
|
||||
// Strongly typed wrapper around a D3D constant buffer.
|
||||
template<typename T>
|
||||
class ConstantBuffer
|
||||
{
|
||||
public:
|
||||
// Constructor.
|
||||
ConstantBuffer() = default;
|
||||
explicit ConstantBuffer(_In_ ID3D11Device* device)
|
||||
{
|
||||
Create( device );
|
||||
}
|
||||
|
||||
ConstantBuffer(ConstantBuffer const&) = delete;
|
||||
ConstantBuffer& operator= (ConstantBuffer const&) = delete;
|
||||
|
||||
#if defined(_XBOX_ONE) && defined(_TITLE)
|
||||
void Create(_In_ ID3D11Device* device)
|
||||
{
|
||||
D3D11_BUFFER_DESC desc = {};
|
||||
|
||||
desc.ByteWidth = sizeof(T);
|
||||
desc.Usage = D3D11_USAGE_DEFAULT;
|
||||
desc.BindFlags = D3D11_BIND_CONSTANT_BUFFER;
|
||||
desc.CPUAccessFlags = D3D11_CPU_ACCESS_WRITE;
|
||||
|
||||
Microsoft::WRL::ComPtr<ID3D11DeviceX> deviceX;
|
||||
ThrowIfFailed(device->QueryInterface(IID_GRAPHICS_PPV_ARGS(deviceX.GetAddressOf())));
|
||||
|
||||
ThrowIfFailed(deviceX->CreatePlacementBuffer(&desc, nullptr, mConstantBuffer.ReleaseAndGetAddressOf()));
|
||||
|
||||
SetDebugObjectName(mConstantBuffer.Get(), L"DirectXTK");
|
||||
}
|
||||
|
||||
|
||||
// Writes new data into the constant buffer.
|
||||
void SetData(_In_ ID3D11DeviceContext* deviceContext, T const& value, void** grfxMemory)
|
||||
{
|
||||
assert( grfxMemory != 0 );
|
||||
|
||||
void* ptr = GraphicsMemory::Get().Allocate( deviceContext, sizeof(T), 64 );
|
||||
assert( ptr != 0 );
|
||||
|
||||
*(T*)ptr = value;
|
||||
|
||||
*grfxMemory = ptr;
|
||||
}
|
||||
#else
|
||||
void Create(_In_ ID3D11Device* device)
|
||||
{
|
||||
D3D11_BUFFER_DESC desc = {};
|
||||
|
||||
desc.ByteWidth = sizeof(T);
|
||||
desc.Usage = D3D11_USAGE_DYNAMIC;
|
||||
desc.BindFlags = D3D11_BIND_CONSTANT_BUFFER;
|
||||
desc.CPUAccessFlags = D3D11_CPU_ACCESS_WRITE;
|
||||
|
||||
ThrowIfFailed(
|
||||
device->CreateBuffer(&desc, nullptr, mConstantBuffer.ReleaseAndGetAddressOf() )
|
||||
);
|
||||
|
||||
SetDebugObjectName(mConstantBuffer.Get(), "DirectXTK");
|
||||
}
|
||||
|
||||
|
||||
// Writes new data into the constant buffer.
|
||||
void SetData(_In_ ID3D11DeviceContext* deviceContext, T const& value)
|
||||
{
|
||||
assert( mConstantBuffer.Get() != 0 );
|
||||
|
||||
D3D11_MAPPED_SUBRESOURCE mappedResource;
|
||||
|
||||
ThrowIfFailed(
|
||||
deviceContext->Map(mConstantBuffer.Get(), 0, D3D11_MAP_WRITE_DISCARD, 0, &mappedResource)
|
||||
);
|
||||
|
||||
*(T*)mappedResource.pData = value;
|
||||
|
||||
deviceContext->Unmap(mConstantBuffer.Get(), 0);
|
||||
}
|
||||
#endif
|
||||
|
||||
// Looks up the underlying D3D constant buffer.
|
||||
ID3D11Buffer* GetBuffer()
|
||||
{
|
||||
return mConstantBuffer.Get();
|
||||
}
|
||||
|
||||
|
||||
private:
|
||||
// The underlying D3D object.
|
||||
Microsoft::WRL::ComPtr<ID3D11Buffer> mConstantBuffer;
|
||||
};
|
||||
}
|
||||
//--------------------------------------------------------------------------------------
|
||||
// File: ConstantBuffer.h
|
||||
//
|
||||
// THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF
|
||||
// ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO
|
||||
// THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A
|
||||
// PARTICULAR PURPOSE.
|
||||
//
|
||||
// Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
//
|
||||
// http://go.microsoft.com/fwlink/?LinkId=248929
|
||||
//--------------------------------------------------------------------------------------
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "DirectXHelpers.h"
|
||||
#include "GraphicsMemory.h"
|
||||
#include "PlatformHelpers.h"
|
||||
|
||||
|
||||
namespace DirectX
|
||||
{
|
||||
// Strongly typed wrapper around a D3D constant buffer.
|
||||
template<typename T>
|
||||
class ConstantBuffer
|
||||
{
|
||||
public:
|
||||
// Constructor.
|
||||
ConstantBuffer() = default;
|
||||
explicit ConstantBuffer(_In_ ID3D11Device* device)
|
||||
{
|
||||
Create( device );
|
||||
}
|
||||
|
||||
ConstantBuffer(ConstantBuffer const&) = delete;
|
||||
ConstantBuffer& operator= (ConstantBuffer const&) = delete;
|
||||
|
||||
#if defined(_XBOX_ONE) && defined(_TITLE)
|
||||
void Create(_In_ ID3D11Device* device)
|
||||
{
|
||||
D3D11_BUFFER_DESC desc = {};
|
||||
|
||||
desc.ByteWidth = sizeof(T);
|
||||
desc.Usage = D3D11_USAGE_DEFAULT;
|
||||
desc.BindFlags = D3D11_BIND_CONSTANT_BUFFER;
|
||||
desc.CPUAccessFlags = D3D11_CPU_ACCESS_WRITE;
|
||||
|
||||
Microsoft::WRL::ComPtr<ID3D11DeviceX> deviceX;
|
||||
ThrowIfFailed(device->QueryInterface(IID_GRAPHICS_PPV_ARGS(deviceX.GetAddressOf())));
|
||||
|
||||
ThrowIfFailed(deviceX->CreatePlacementBuffer(&desc, nullptr, mConstantBuffer.ReleaseAndGetAddressOf()));
|
||||
|
||||
SetDebugObjectName(mConstantBuffer.Get(), L"DirectXTK");
|
||||
}
|
||||
|
||||
|
||||
// Writes new data into the constant buffer.
|
||||
void SetData(_In_ ID3D11DeviceContext* deviceContext, T const& value, void** grfxMemory)
|
||||
{
|
||||
assert( grfxMemory != 0 );
|
||||
|
||||
void* ptr = GraphicsMemory::Get().Allocate( deviceContext, sizeof(T), 64 );
|
||||
assert( ptr != 0 );
|
||||
|
||||
*(T*)ptr = value;
|
||||
|
||||
*grfxMemory = ptr;
|
||||
}
|
||||
#else
|
||||
void Create(_In_ ID3D11Device* device)
|
||||
{
|
||||
D3D11_BUFFER_DESC desc = {};
|
||||
|
||||
desc.ByteWidth = sizeof(T);
|
||||
desc.Usage = D3D11_USAGE_DYNAMIC;
|
||||
desc.BindFlags = D3D11_BIND_CONSTANT_BUFFER;
|
||||
desc.CPUAccessFlags = D3D11_CPU_ACCESS_WRITE;
|
||||
|
||||
ThrowIfFailed(
|
||||
device->CreateBuffer(&desc, nullptr, mConstantBuffer.ReleaseAndGetAddressOf() )
|
||||
);
|
||||
|
||||
SetDebugObjectName(mConstantBuffer.Get(), "DirectXTK");
|
||||
}
|
||||
|
||||
|
||||
// Writes new data into the constant buffer.
|
||||
void SetData(_In_ ID3D11DeviceContext* deviceContext, T const& value)
|
||||
{
|
||||
assert( mConstantBuffer.Get() != 0 );
|
||||
|
||||
D3D11_MAPPED_SUBRESOURCE mappedResource;
|
||||
|
||||
ThrowIfFailed(
|
||||
deviceContext->Map(mConstantBuffer.Get(), 0, D3D11_MAP_WRITE_DISCARD, 0, &mappedResource)
|
||||
);
|
||||
|
||||
*(T*)mappedResource.pData = value;
|
||||
|
||||
deviceContext->Unmap(mConstantBuffer.Get(), 0);
|
||||
}
|
||||
#endif
|
||||
|
||||
// Looks up the underlying D3D constant buffer.
|
||||
ID3D11Buffer* GetBuffer()
|
||||
{
|
||||
return mConstantBuffer.Get();
|
||||
}
|
||||
|
||||
|
||||
private:
|
||||
// The underlying D3D object.
|
||||
Microsoft::WRL::ComPtr<ID3D11Buffer> mConstantBuffer;
|
||||
};
|
||||
}
|
||||
|
|
|
@ -1,51 +1,51 @@
|
|||
//--------------------------------------------------------------------------------------
|
||||
// File: DemandCreate.h
|
||||
//
|
||||
// THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF
|
||||
// ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO
|
||||
// THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A
|
||||
// PARTICULAR PURPOSE.
|
||||
//
|
||||
// Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
//
|
||||
// http://go.microsoft.com/fwlink/?LinkId=248929
|
||||
//--------------------------------------------------------------------------------------
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "PlatformHelpers.h"
|
||||
|
||||
|
||||
namespace DirectX
|
||||
{
|
||||
// Helper for lazily creating a D3D resource.
|
||||
template<typename T, typename TCreateFunc>
|
||||
static T* DemandCreate(Microsoft::WRL::ComPtr<T>& comPtr, std::mutex& mutex, TCreateFunc createFunc)
|
||||
{
|
||||
T* result = comPtr.Get();
|
||||
|
||||
// Double-checked lock pattern.
|
||||
MemoryBarrier();
|
||||
|
||||
if (!result)
|
||||
{
|
||||
std::lock_guard<std::mutex> lock(mutex);
|
||||
|
||||
result = comPtr.Get();
|
||||
|
||||
if (!result)
|
||||
{
|
||||
// Create the new object.
|
||||
ThrowIfFailed(
|
||||
createFunc(&result)
|
||||
);
|
||||
|
||||
MemoryBarrier();
|
||||
|
||||
comPtr.Attach(result);
|
||||
}
|
||||
}
|
||||
|
||||
return result;
|
||||
}
|
||||
}
|
||||
//--------------------------------------------------------------------------------------
|
||||
// File: DemandCreate.h
|
||||
//
|
||||
// THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF
|
||||
// ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO
|
||||
// THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A
|
||||
// PARTICULAR PURPOSE.
|
||||
//
|
||||
// Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
//
|
||||
// http://go.microsoft.com/fwlink/?LinkId=248929
|
||||
//--------------------------------------------------------------------------------------
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "PlatformHelpers.h"
|
||||
|
||||
|
||||
namespace DirectX
|
||||
{
|
||||
// Helper for lazily creating a D3D resource.
|
||||
template<typename T, typename TCreateFunc>
|
||||
static T* DemandCreate(Microsoft::WRL::ComPtr<T>& comPtr, std::mutex& mutex, TCreateFunc createFunc)
|
||||
{
|
||||
T* result = comPtr.Get();
|
||||
|
||||
// Double-checked lock pattern.
|
||||
MemoryBarrier();
|
||||
|
||||
if (!result)
|
||||
{
|
||||
std::lock_guard<std::mutex> lock(mutex);
|
||||
|
||||
result = comPtr.Get();
|
||||
|
||||
if (!result)
|
||||
{
|
||||
// Create the new object.
|
||||
ThrowIfFailed(
|
||||
createFunc(&result)
|
||||
);
|
||||
|
||||
MemoryBarrier();
|
||||
|
||||
comPtr.Attach(result);
|
||||
}
|
||||
}
|
||||
|
||||
return result;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,32 +1,32 @@
|
|||
//--------------------------------------------------------------------------------------
|
||||
// File: Geometry.h
|
||||
//
|
||||
// THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF
|
||||
// ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO
|
||||
// THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A
|
||||
// PARTICULAR PURPOSE.
|
||||
//
|
||||
// Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
//
|
||||
// http://go.microsoft.com/fwlink/?LinkId=248929
|
||||
//--------------------------------------------------------------------------------------
|
||||
|
||||
#include "VertexTypes.h"
|
||||
|
||||
namespace DirectX
|
||||
{
|
||||
typedef std::vector<DirectX::VertexPositionNormalTexture> VertexCollection;
|
||||
typedef std::vector<uint16_t> IndexCollection;
|
||||
|
||||
void ComputeBox(VertexCollection& vertices, IndexCollection& indices, const XMFLOAT3& size, bool rhcoords, bool invertn);
|
||||
void ComputeSphere(VertexCollection& vertices, IndexCollection& indices, float diameter, size_t tessellation, bool rhcoords, bool invertn);
|
||||
void ComputeGeoSphere(VertexCollection& vertices, IndexCollection& indices, float diameter, size_t tessellation, bool rhcoords);
|
||||
void ComputeCylinder(VertexCollection& vertices, IndexCollection& indices, float height, float diameter, size_t tessellation, bool rhcoords);
|
||||
void ComputeCone(VertexCollection& vertices, IndexCollection& indices, float diameter, float height, size_t tessellation, bool rhcoords);
|
||||
void ComputeTorus(VertexCollection& vertices, IndexCollection& indices, float diameter, float thickness, size_t tessellation, bool rhcoords);
|
||||
void ComputeTetrahedron(VertexCollection& vertices, IndexCollection& indices, float size, bool rhcoords);
|
||||
void ComputeOctahedron(VertexCollection& vertices, IndexCollection& indices, float size, bool rhcoords);
|
||||
void ComputeDodecahedron(VertexCollection& vertices, IndexCollection& indices, float size, bool rhcoords);
|
||||
void ComputeIcosahedron(VertexCollection& vertices, IndexCollection& indices, float size, bool rhcoords);
|
||||
void ComputeTeapot(VertexCollection& vertices, IndexCollection& indices, float size, size_t tessellation, bool rhcoords);
|
||||
//--------------------------------------------------------------------------------------
|
||||
// File: Geometry.h
|
||||
//
|
||||
// THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF
|
||||
// ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO
|
||||
// THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A
|
||||
// PARTICULAR PURPOSE.
|
||||
//
|
||||
// Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
//
|
||||
// http://go.microsoft.com/fwlink/?LinkId=248929
|
||||
//--------------------------------------------------------------------------------------
|
||||
|
||||
#include "VertexTypes.h"
|
||||
|
||||
namespace DirectX
|
||||
{
|
||||
typedef std::vector<DirectX::VertexPositionNormalTexture> VertexCollection;
|
||||
typedef std::vector<uint16_t> IndexCollection;
|
||||
|
||||
void ComputeBox(VertexCollection& vertices, IndexCollection& indices, const XMFLOAT3& size, bool rhcoords, bool invertn);
|
||||
void ComputeSphere(VertexCollection& vertices, IndexCollection& indices, float diameter, size_t tessellation, bool rhcoords, bool invertn);
|
||||
void ComputeGeoSphere(VertexCollection& vertices, IndexCollection& indices, float diameter, size_t tessellation, bool rhcoords);
|
||||
void ComputeCylinder(VertexCollection& vertices, IndexCollection& indices, float height, float diameter, size_t tessellation, bool rhcoords);
|
||||
void ComputeCone(VertexCollection& vertices, IndexCollection& indices, float diameter, float height, size_t tessellation, bool rhcoords);
|
||||
void ComputeTorus(VertexCollection& vertices, IndexCollection& indices, float diameter, float thickness, size_t tessellation, bool rhcoords);
|
||||
void ComputeTetrahedron(VertexCollection& vertices, IndexCollection& indices, float size, bool rhcoords);
|
||||
void ComputeOctahedron(VertexCollection& vertices, IndexCollection& indices, float size, bool rhcoords);
|
||||
void ComputeDodecahedron(VertexCollection& vertices, IndexCollection& indices, float size, bool rhcoords);
|
||||
void ComputeIcosahedron(VertexCollection& vertices, IndexCollection& indices, float size, bool rhcoords);
|
||||
void ComputeTeapot(VertexCollection& vertices, IndexCollection& indices, float size, size_t tessellation, bool rhcoords);
|
||||
}
|
|
@ -1,334 +1,334 @@
|
|||
//--------------------------------------------------------------------------------------
|
||||
// File: GraphicsMemory.cpp
|
||||
//
|
||||
// THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF
|
||||
// ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO
|
||||
// THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A
|
||||
// PARTICULAR PURPOSE.
|
||||
//
|
||||
// Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
//
|
||||
// http://go.microsoft.com/fwlink/?LinkId=248929
|
||||
//--------------------------------------------------------------------------------------
|
||||
|
||||
#include "pch.h"
|
||||
|
||||
#include "GraphicsMemory.h"
|
||||
#include "PlatformHelpers.h"
|
||||
|
||||
using namespace DirectX;
|
||||
using Microsoft::WRL::ComPtr;
|
||||
|
||||
|
||||
namespace
|
||||
{
|
||||
template <typename T> __forceinline T AlignUp(T value, size_t alignment)
|
||||
{
|
||||
assert(((alignment - 1) & alignment) == 0);
|
||||
return static_cast<T>( (static_cast<size_t>(value) + alignment - 1) & ~(alignment - 1) );
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
#if defined(_XBOX_ONE) && defined(_TITLE)
|
||||
|
||||
//======================================================================================
|
||||
// Xbox One Direct3D 11.x
|
||||
//======================================================================================
|
||||
|
||||
class GraphicsMemory::Impl
|
||||
{
|
||||
public:
|
||||
Impl(GraphicsMemory* owner) :
|
||||
mOwner(owner),
|
||||
mCurrentFrame(0)
|
||||
{
|
||||
if (s_graphicsMemory)
|
||||
{
|
||||
throw std::exception("GraphicsMemory is a singleton");
|
||||
}
|
||||
|
||||
s_graphicsMemory = this;
|
||||
}
|
||||
|
||||
~Impl()
|
||||
{
|
||||
if (mDevice && mDeviceContext)
|
||||
{
|
||||
UINT64 finalFence = mDeviceContext->InsertFence(0);
|
||||
|
||||
while (mDevice->IsFencePending(finalFence))
|
||||
{
|
||||
SwitchToThread();
|
||||
}
|
||||
|
||||
mDeviceContext.Reset();
|
||||
mDevice.Reset();
|
||||
}
|
||||
|
||||
s_graphicsMemory = nullptr;
|
||||
}
|
||||
|
||||
void Initialize(_In_ ID3D11DeviceX* device, UINT backBufferCount)
|
||||
{
|
||||
assert( device != 0 );
|
||||
mDevice = device;
|
||||
|
||||
device->GetImmediateContextX( mDeviceContext.GetAddressOf() );
|
||||
|
||||
mFrames.resize( backBufferCount );
|
||||
}
|
||||
|
||||
void* Allocate(_In_opt_ ID3D11DeviceContext* deviceContext, size_t size, int alignment)
|
||||
{
|
||||
// Currently use a single global allocator instead of a per-context allocator
|
||||
UNREFERENCED_PARAMETER(deviceContext);
|
||||
|
||||
std::lock_guard<std::mutex> lock(mGuard);
|
||||
|
||||
return mFrames[mCurrentFrame].Allocate(size, alignment);
|
||||
}
|
||||
|
||||
void Commit()
|
||||
{
|
||||
std::lock_guard<std::mutex> lock(mGuard);
|
||||
|
||||
mFrames[mCurrentFrame].mFence = mDeviceContext->InsertFence(D3D11_INSERT_FENCE_NO_KICKOFF);
|
||||
|
||||
++mCurrentFrame;
|
||||
if (mCurrentFrame >= mFrames.size())
|
||||
{
|
||||
mCurrentFrame = 0;
|
||||
}
|
||||
|
||||
mFrames[mCurrentFrame].WaitOnFence(mDevice.Get());
|
||||
|
||||
mFrames[mCurrentFrame].Clear();
|
||||
}
|
||||
|
||||
GraphicsMemory* mOwner;
|
||||
|
||||
std::mutex mGuard;
|
||||
|
||||
struct MemoryPage
|
||||
{
|
||||
MemoryPage() : mPageSize(0), mGrfxMemory(nullptr) {}
|
||||
|
||||
void Initialize(size_t reqSize)
|
||||
{
|
||||
mPageSize = 0x100000; // 1 MB general pages for Xbox One
|
||||
if (mPageSize < reqSize)
|
||||
{
|
||||
mPageSize = AlignUp(reqSize, 65536);
|
||||
}
|
||||
|
||||
mGrfxMemory = VirtualAlloc(nullptr, mPageSize,
|
||||
MEM_LARGE_PAGES | MEM_GRAPHICS | MEM_RESERVE | MEM_COMMIT,
|
||||
PAGE_WRITECOMBINE | PAGE_READWRITE | PAGE_GPU_READONLY);
|
||||
if (!mGrfxMemory)
|
||||
throw std::bad_alloc();
|
||||
}
|
||||
|
||||
size_t mPageSize;
|
||||
void* mGrfxMemory;
|
||||
};
|
||||
|
||||
struct MemoryFrame
|
||||
{
|
||||
MemoryFrame() : mCurOffset(0), mFence(0) {}
|
||||
|
||||
~MemoryFrame() { Clear(); }
|
||||
|
||||
UINT mCurOffset;
|
||||
|
||||
UINT64 mFence;
|
||||
|
||||
void* Allocate(size_t size, size_t alignment)
|
||||
{
|
||||
size_t alignedSize = AlignUp(size, alignment);
|
||||
|
||||
if (mPages.empty())
|
||||
{
|
||||
MemoryPage newPage;
|
||||
newPage.Initialize(alignedSize);
|
||||
|
||||
mCurOffset = 0;
|
||||
|
||||
mPages.emplace_back(newPage);
|
||||
}
|
||||
else
|
||||
{
|
||||
mCurOffset = AlignUp(mCurOffset, alignment);
|
||||
|
||||
if (mCurOffset + alignedSize > mPages.front().mPageSize)
|
||||
{
|
||||
MemoryPage newPage;
|
||||
newPage.Initialize(alignedSize);
|
||||
|
||||
mCurOffset = 0;
|
||||
|
||||
mPages.emplace_front(newPage);
|
||||
}
|
||||
}
|
||||
|
||||
void* ptr = static_cast<uint8_t*>(mPages.front().mGrfxMemory) + mCurOffset;
|
||||
|
||||
mCurOffset += static_cast<UINT>( alignedSize );
|
||||
|
||||
return ptr;
|
||||
}
|
||||
|
||||
void WaitOnFence(ID3D11DeviceX* device)
|
||||
{
|
||||
if (mFence)
|
||||
{
|
||||
while (device->IsFencePending(mFence))
|
||||
{
|
||||
SwitchToThread();
|
||||
}
|
||||
|
||||
mFence = 0;
|
||||
}
|
||||
}
|
||||
|
||||
void Clear()
|
||||
{
|
||||
for (auto it = mPages.begin(); it != mPages.end(); ++it)
|
||||
{
|
||||
if (it->mGrfxMemory)
|
||||
{
|
||||
VirtualFree(it->mGrfxMemory, 0, MEM_RELEASE);
|
||||
it->mGrfxMemory = nullptr;
|
||||
}
|
||||
}
|
||||
|
||||
mPages.clear();
|
||||
|
||||
mCurOffset = 0;
|
||||
}
|
||||
|
||||
std::list<MemoryPage> mPages;
|
||||
};
|
||||
|
||||
UINT mCurrentFrame;
|
||||
std::vector<MemoryFrame> mFrames;
|
||||
|
||||
ComPtr<ID3D11DeviceX> mDevice;
|
||||
ComPtr<ID3D11DeviceContextX> mDeviceContext;
|
||||
|
||||
static GraphicsMemory::Impl* s_graphicsMemory;
|
||||
};
|
||||
|
||||
GraphicsMemory::Impl* GraphicsMemory::Impl::s_graphicsMemory = nullptr;
|
||||
|
||||
#else
|
||||
|
||||
//======================================================================================
|
||||
// Null allocator for standard Direct3D
|
||||
//======================================================================================
|
||||
|
||||
class GraphicsMemory::Impl
|
||||
{
|
||||
public:
|
||||
Impl(GraphicsMemory* owner) :
|
||||
mOwner(owner)
|
||||
{
|
||||
if (s_graphicsMemory)
|
||||
{
|
||||
throw std::exception("GraphicsMemory is a singleton");
|
||||
}
|
||||
|
||||
s_graphicsMemory = this;
|
||||
}
|
||||
|
||||
~Impl()
|
||||
{
|
||||
s_graphicsMemory = nullptr;
|
||||
}
|
||||
|
||||
void Initialize(_In_ ID3D11Device* device, UINT backBufferCount)
|
||||
{
|
||||
UNREFERENCED_PARAMETER(device);
|
||||
UNREFERENCED_PARAMETER(backBufferCount);
|
||||
}
|
||||
|
||||
void* Allocate(_In_opt_ ID3D11DeviceContext* context, size_t size, int alignment)
|
||||
{
|
||||
UNREFERENCED_PARAMETER(context);
|
||||
UNREFERENCED_PARAMETER(size);
|
||||
UNREFERENCED_PARAMETER(alignment);
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
void Commit()
|
||||
{
|
||||
}
|
||||
|
||||
GraphicsMemory* mOwner;
|
||||
|
||||
static GraphicsMemory::Impl* s_graphicsMemory;
|
||||
};
|
||||
|
||||
GraphicsMemory::Impl* GraphicsMemory::Impl::s_graphicsMemory = nullptr;
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
//--------------------------------------------------------------------------------------
|
||||
|
||||
#pragma warning( disable : 4355 )
|
||||
|
||||
// Public constructor.
|
||||
#if defined(_XBOX_ONE) && defined(_TITLE)
|
||||
GraphicsMemory::GraphicsMemory(_In_ ID3D11DeviceX* device, UINT backBufferCount)
|
||||
#else
|
||||
GraphicsMemory::GraphicsMemory(_In_ ID3D11Device* device, UINT backBufferCount)
|
||||
#endif
|
||||
: pImpl(new Impl(this))
|
||||
{
|
||||
pImpl->Initialize(device, backBufferCount);
|
||||
}
|
||||
|
||||
|
||||
// Move constructor.
|
||||
GraphicsMemory::GraphicsMemory(GraphicsMemory&& moveFrom)
|
||||
: pImpl(std::move(moveFrom.pImpl))
|
||||
{
|
||||
pImpl->mOwner = this;
|
||||
}
|
||||
|
||||
|
||||
// Move assignment.
|
||||
GraphicsMemory& GraphicsMemory::operator= (GraphicsMemory&& moveFrom)
|
||||
{
|
||||
pImpl = std::move(moveFrom.pImpl);
|
||||
pImpl->mOwner = this;
|
||||
return *this;
|
||||
}
|
||||
|
||||
|
||||
// Public destructor.
|
||||
GraphicsMemory::~GraphicsMemory()
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
void* GraphicsMemory::Allocate(_In_opt_ ID3D11DeviceContext* context, size_t size, int alignment)
|
||||
{
|
||||
return pImpl->Allocate(context, size, alignment);
|
||||
}
|
||||
|
||||
|
||||
void GraphicsMemory::Commit()
|
||||
{
|
||||
pImpl->Commit();
|
||||
}
|
||||
|
||||
|
||||
GraphicsMemory& GraphicsMemory::Get()
|
||||
{
|
||||
if (!Impl::s_graphicsMemory || !Impl::s_graphicsMemory->mOwner)
|
||||
throw std::exception("GraphicsMemory singleton not created");
|
||||
|
||||
return *Impl::s_graphicsMemory->mOwner;
|
||||
}
|
||||
//--------------------------------------------------------------------------------------
|
||||
// File: GraphicsMemory.cpp
|
||||
//
|
||||
// THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF
|
||||
// ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO
|
||||
// THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A
|
||||
// PARTICULAR PURPOSE.
|
||||
//
|
||||
// Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
//
|
||||
// http://go.microsoft.com/fwlink/?LinkId=248929
|
||||
//--------------------------------------------------------------------------------------
|
||||
|
||||
#include "pch.h"
|
||||
|
||||
#include "GraphicsMemory.h"
|
||||
#include "PlatformHelpers.h"
|
||||
|
||||
using namespace DirectX;
|
||||
using Microsoft::WRL::ComPtr;
|
||||
|
||||
|
||||
namespace
|
||||
{
|
||||
template <typename T> __forceinline T AlignUp(T value, size_t alignment)
|
||||
{
|
||||
assert(((alignment - 1) & alignment) == 0);
|
||||
return static_cast<T>( (static_cast<size_t>(value) + alignment - 1) & ~(alignment - 1) );
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
#if defined(_XBOX_ONE) && defined(_TITLE)
|
||||
|
||||
//======================================================================================
|
||||
// Xbox One Direct3D 11.x
|
||||
//======================================================================================
|
||||
|
||||
class GraphicsMemory::Impl
|
||||
{
|
||||
public:
|
||||
Impl(GraphicsMemory* owner) :
|
||||
mOwner(owner),
|
||||
mCurrentFrame(0)
|
||||
{
|
||||
if (s_graphicsMemory)
|
||||
{
|
||||
throw std::exception("GraphicsMemory is a singleton");
|
||||
}
|
||||
|
||||
s_graphicsMemory = this;
|
||||
}
|
||||
|
||||
~Impl()
|
||||
{
|
||||
if (mDevice && mDeviceContext)
|
||||
{
|
||||
UINT64 finalFence = mDeviceContext->InsertFence(0);
|
||||
|
||||
while (mDevice->IsFencePending(finalFence))
|
||||
{
|
||||
SwitchToThread();
|
||||
}
|
||||
|
||||
mDeviceContext.Reset();
|
||||
mDevice.Reset();
|
||||
}
|
||||
|
||||
s_graphicsMemory = nullptr;
|
||||
}
|
||||
|
||||
void Initialize(_In_ ID3D11DeviceX* device, UINT backBufferCount)
|
||||
{
|
||||
assert( device != 0 );
|
||||
mDevice = device;
|
||||
|
||||
device->GetImmediateContextX( mDeviceContext.GetAddressOf() );
|
||||
|
||||
mFrames.resize( backBufferCount );
|
||||
}
|
||||
|
||||
void* Allocate(_In_opt_ ID3D11DeviceContext* deviceContext, size_t size, int alignment)
|
||||
{
|
||||
// Currently use a single global allocator instead of a per-context allocator
|
||||
UNREFERENCED_PARAMETER(deviceContext);
|
||||
|
||||
std::lock_guard<std::mutex> lock(mGuard);
|
||||
|
||||
return mFrames[mCurrentFrame].Allocate(size, alignment);
|
||||
}
|
||||
|
||||
void Commit()
|
||||
{
|
||||
std::lock_guard<std::mutex> lock(mGuard);
|
||||
|
||||
mFrames[mCurrentFrame].mFence = mDeviceContext->InsertFence(D3D11_INSERT_FENCE_NO_KICKOFF);
|
||||
|
||||
++mCurrentFrame;
|
||||
if (mCurrentFrame >= mFrames.size())
|
||||
{
|
||||
mCurrentFrame = 0;
|
||||
}
|
||||
|
||||
mFrames[mCurrentFrame].WaitOnFence(mDevice.Get());
|
||||
|
||||
mFrames[mCurrentFrame].Clear();
|
||||
}
|
||||
|
||||
GraphicsMemory* mOwner;
|
||||
|
||||
std::mutex mGuard;
|
||||
|
||||
struct MemoryPage
|
||||
{
|
||||
MemoryPage() : mPageSize(0), mGrfxMemory(nullptr) {}
|
||||
|
||||
void Initialize(size_t reqSize)
|
||||
{
|
||||
mPageSize = 0x100000; // 1 MB general pages for Xbox One
|
||||
if (mPageSize < reqSize)
|
||||
{
|
||||
mPageSize = AlignUp(reqSize, 65536);
|
||||
}
|
||||
|
||||
mGrfxMemory = VirtualAlloc(nullptr, mPageSize,
|
||||
MEM_LARGE_PAGES | MEM_GRAPHICS | MEM_RESERVE | MEM_COMMIT,
|
||||
PAGE_WRITECOMBINE | PAGE_READWRITE | PAGE_GPU_READONLY);
|
||||
if (!mGrfxMemory)
|
||||
throw std::bad_alloc();
|
||||
}
|
||||
|
||||
size_t mPageSize;
|
||||
void* mGrfxMemory;
|
||||
};
|
||||
|
||||
struct MemoryFrame
|
||||
{
|
||||
MemoryFrame() : mCurOffset(0), mFence(0) {}
|
||||
|
||||
~MemoryFrame() { Clear(); }
|
||||
|
||||
UINT mCurOffset;
|
||||
|
||||
UINT64 mFence;
|
||||
|
||||
void* Allocate(size_t size, size_t alignment)
|
||||
{
|
||||
size_t alignedSize = AlignUp(size, alignment);
|
||||
|
||||
if (mPages.empty())
|
||||
{
|
||||
MemoryPage newPage;
|
||||
newPage.Initialize(alignedSize);
|
||||
|
||||
mCurOffset = 0;
|
||||
|
||||
mPages.emplace_back(newPage);
|
||||
}
|
||||
else
|
||||
{
|
||||
mCurOffset = AlignUp(mCurOffset, alignment);
|
||||
|
||||
if (mCurOffset + alignedSize > mPages.front().mPageSize)
|
||||
{
|
||||
MemoryPage newPage;
|
||||
newPage.Initialize(alignedSize);
|
||||
|
||||
mCurOffset = 0;
|
||||
|
||||
mPages.emplace_front(newPage);
|
||||
}
|
||||
}
|
||||
|
||||
void* ptr = static_cast<uint8_t*>(mPages.front().mGrfxMemory) + mCurOffset;
|
||||
|
||||
mCurOffset += static_cast<UINT>( alignedSize );
|
||||
|
||||
return ptr;
|
||||
}
|
||||
|
||||
void WaitOnFence(ID3D11DeviceX* device)
|
||||
{
|
||||
if (mFence)
|
||||
{
|
||||
while (device->IsFencePending(mFence))
|
||||
{
|
||||
SwitchToThread();
|
||||
}
|
||||
|
||||
mFence = 0;
|
||||
}
|
||||
}
|
||||
|
||||
void Clear()
|
||||
{
|
||||
for (auto it = mPages.begin(); it != mPages.end(); ++it)
|
||||
{
|
||||
if (it->mGrfxMemory)
|
||||
{
|
||||
VirtualFree(it->mGrfxMemory, 0, MEM_RELEASE);
|
||||
it->mGrfxMemory = nullptr;
|
||||
}
|
||||
}
|
||||
|
||||
mPages.clear();
|
||||
|
||||
mCurOffset = 0;
|
||||
}
|
||||
|
||||
std::list<MemoryPage> mPages;
|
||||
};
|
||||
|
||||
UINT mCurrentFrame;
|
||||
std::vector<MemoryFrame> mFrames;
|
||||
|
||||
ComPtr<ID3D11DeviceX> mDevice;
|
||||
ComPtr<ID3D11DeviceContextX> mDeviceContext;
|
||||
|
||||
static GraphicsMemory::Impl* s_graphicsMemory;
|
||||
};
|
||||
|
||||
GraphicsMemory::Impl* GraphicsMemory::Impl::s_graphicsMemory = nullptr;
|
||||
|
||||
#else
|
||||
|
||||
//======================================================================================
|
||||
// Null allocator for standard Direct3D
|
||||
//======================================================================================
|
||||
|
||||
class GraphicsMemory::Impl
|
||||
{
|
||||
public:
|
||||
Impl(GraphicsMemory* owner) :
|
||||
mOwner(owner)
|
||||
{
|
||||
if (s_graphicsMemory)
|
||||
{
|
||||
throw std::exception("GraphicsMemory is a singleton");
|
||||
}
|
||||
|
||||
s_graphicsMemory = this;
|
||||
}
|
||||
|
||||
~Impl()
|
||||
{
|
||||
s_graphicsMemory = nullptr;
|
||||
}
|
||||
|
||||
void Initialize(_In_ ID3D11Device* device, UINT backBufferCount)
|
||||
{
|
||||
UNREFERENCED_PARAMETER(device);
|
||||
UNREFERENCED_PARAMETER(backBufferCount);
|
||||
}
|
||||
|
||||
void* Allocate(_In_opt_ ID3D11DeviceContext* context, size_t size, int alignment)
|
||||
{
|
||||
UNREFERENCED_PARAMETER(context);
|
||||
UNREFERENCED_PARAMETER(size);
|
||||
UNREFERENCED_PARAMETER(alignment);
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
void Commit()
|
||||
{
|
||||
}
|
||||
|
||||
GraphicsMemory* mOwner;
|
||||
|
||||
static GraphicsMemory::Impl* s_graphicsMemory;
|
||||
};
|
||||
|
||||
GraphicsMemory::Impl* GraphicsMemory::Impl::s_graphicsMemory = nullptr;
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
//--------------------------------------------------------------------------------------
|
||||
|
||||
#pragma warning( disable : 4355 )
|
||||
|
||||
// Public constructor.
|
||||
#if defined(_XBOX_ONE) && defined(_TITLE)
|
||||
GraphicsMemory::GraphicsMemory(_In_ ID3D11DeviceX* device, UINT backBufferCount)
|
||||
#else
|
||||
GraphicsMemory::GraphicsMemory(_In_ ID3D11Device* device, UINT backBufferCount)
|
||||
#endif
|
||||
: pImpl(new Impl(this))
|
||||
{
|
||||
pImpl->Initialize(device, backBufferCount);
|
||||
}
|
||||
|
||||
|
||||
// Move constructor.
|
||||
GraphicsMemory::GraphicsMemory(GraphicsMemory&& moveFrom)
|
||||
: pImpl(std::move(moveFrom.pImpl))
|
||||
{
|
||||
pImpl->mOwner = this;
|
||||
}
|
||||
|
||||
|
||||
// Move assignment.
|
||||
GraphicsMemory& GraphicsMemory::operator= (GraphicsMemory&& moveFrom)
|
||||
{
|
||||
pImpl = std::move(moveFrom.pImpl);
|
||||
pImpl->mOwner = this;
|
||||
return *this;
|
||||
}
|
||||
|
||||
|
||||
// Public destructor.
|
||||
GraphicsMemory::~GraphicsMemory()
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
void* GraphicsMemory::Allocate(_In_opt_ ID3D11DeviceContext* context, size_t size, int alignment)
|
||||
{
|
||||
return pImpl->Allocate(context, size, alignment);
|
||||
}
|
||||
|
||||
|
||||
void GraphicsMemory::Commit()
|
||||
{
|
||||
pImpl->Commit();
|
||||
}
|
||||
|
||||
|
||||
GraphicsMemory& GraphicsMemory::Get()
|
||||
{
|
||||
if (!Impl::s_graphicsMemory || !Impl::s_graphicsMemory->mOwner)
|
||||
throw std::exception("GraphicsMemory singleton not created");
|
||||
|
||||
return *Impl::s_graphicsMemory->mOwner;
|
||||
}
|
||||
|
|
1706
Src/ModelLoadCMO.cpp
1706
Src/ModelLoadCMO.cpp
Разница между файлами не показана из-за своего большого размера
Загрузить разницу
|
@ -1,188 +1,188 @@
|
|||
//--------------------------------------------------------------------------------------
|
||||
// File: ModelLoadVBO.cpp
|
||||
//
|
||||
// THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF
|
||||
// ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO
|
||||
// THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A
|
||||
// PARTICULAR PURPOSE.
|
||||
//
|
||||
// Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
//
|
||||
// http://go.microsoft.com/fwlink/?LinkId=248929
|
||||
//--------------------------------------------------------------------------------------
|
||||
|
||||
#include "pch.h"
|
||||
#include "Model.h"
|
||||
|
||||
#include "Effects.h"
|
||||
#include "VertexTypes.h"
|
||||
|
||||
#include "DirectXHelpers.h"
|
||||
#include "PlatformHelpers.h"
|
||||
#include "BinaryReader.h"
|
||||
|
||||
#include "vbo.h"
|
||||
|
||||
using namespace DirectX;
|
||||
using Microsoft::WRL::ComPtr;
|
||||
|
||||
static_assert(sizeof(VertexPositionNormalTexture) == 32, "VBO vertex size mismatch");
|
||||
|
||||
namespace
|
||||
{
|
||||
//--------------------------------------------------------------------------------------
|
||||
// Shared VB input element description
|
||||
INIT_ONCE g_InitOnce = INIT_ONCE_STATIC_INIT;
|
||||
std::shared_ptr<std::vector<D3D11_INPUT_ELEMENT_DESC>> g_vbdecl;
|
||||
|
||||
BOOL CALLBACK InitializeDecl(PINIT_ONCE initOnce, PVOID Parameter, PVOID *lpContext)
|
||||
{
|
||||
UNREFERENCED_PARAMETER(initOnce);
|
||||
UNREFERENCED_PARAMETER(Parameter);
|
||||
UNREFERENCED_PARAMETER(lpContext);
|
||||
|
||||
g_vbdecl = std::make_shared<std::vector<D3D11_INPUT_ELEMENT_DESC>>(VertexPositionNormalTexture::InputElements,
|
||||
VertexPositionNormalTexture::InputElements + VertexPositionNormalTexture::InputElementCount);
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
//--------------------------------------------------------------------------------------
|
||||
_Use_decl_annotations_
|
||||
std::unique_ptr<Model> DirectX::Model::CreateFromVBO(ID3D11Device* d3dDevice, const uint8_t* meshData, size_t dataSize,
|
||||
std::shared_ptr<IEffect> ieffect, bool ccw, bool pmalpha)
|
||||
{
|
||||
if (!InitOnceExecuteOnce(&g_InitOnce, InitializeDecl, nullptr, nullptr))
|
||||
throw std::exception("One-time initialization failed");
|
||||
|
||||
if ( !d3dDevice || !meshData )
|
||||
throw std::exception("Device and meshData cannot be null");
|
||||
|
||||
// File Header
|
||||
if ( dataSize < sizeof(VBO::header_t) )
|
||||
throw std::exception("End of file");
|
||||
auto header = reinterpret_cast<const VBO::header_t*>( meshData );
|
||||
|
||||
if ( !header->numVertices || !header->numIndices )
|
||||
throw std::exception("No vertices or indices found");
|
||||
|
||||
size_t vertSize = sizeof(VertexPositionNormalTexture) * header->numVertices;
|
||||
|
||||
if (dataSize < (vertSize + sizeof(VBO::header_t)))
|
||||
throw std::exception("End of file");
|
||||
auto verts = reinterpret_cast<const VertexPositionNormalTexture*>( meshData + sizeof(VBO::header_t) );
|
||||
|
||||
size_t indexSize = sizeof(uint16_t) * header->numIndices;
|
||||
|
||||
if (dataSize < (sizeof(VBO::header_t) + vertSize + indexSize))
|
||||
throw std::exception("End of file");
|
||||
auto indices = reinterpret_cast<const uint16_t*>( meshData + sizeof(VBO::header_t) + vertSize );
|
||||
|
||||
// Create vertex buffer
|
||||
ComPtr<ID3D11Buffer> vb;
|
||||
{
|
||||
D3D11_BUFFER_DESC desc = {};
|
||||
desc.Usage = D3D11_USAGE_DEFAULT;
|
||||
desc.ByteWidth = static_cast<UINT>(vertSize);
|
||||
desc.BindFlags = D3D11_BIND_VERTEX_BUFFER;
|
||||
|
||||
D3D11_SUBRESOURCE_DATA initData = {};
|
||||
initData.pSysMem = verts;
|
||||
|
||||
ThrowIfFailed(
|
||||
d3dDevice->CreateBuffer(&desc, &initData, vb.GetAddressOf())
|
||||
);
|
||||
|
||||
SetDebugObjectName(vb.Get(), "ModelVBO");
|
||||
}
|
||||
|
||||
// Create index buffer
|
||||
ComPtr<ID3D11Buffer> ib;
|
||||
{
|
||||
D3D11_BUFFER_DESC desc = {};
|
||||
desc.Usage = D3D11_USAGE_DEFAULT;
|
||||
desc.ByteWidth = static_cast<UINT>(indexSize);
|
||||
desc.BindFlags = D3D11_BIND_INDEX_BUFFER;
|
||||
|
||||
D3D11_SUBRESOURCE_DATA initData = {};
|
||||
initData.pSysMem = indices;
|
||||
|
||||
ThrowIfFailed(
|
||||
d3dDevice->CreateBuffer(&desc, &initData, ib.GetAddressOf())
|
||||
);
|
||||
|
||||
SetDebugObjectName(ib.Get(), "ModelVBO");
|
||||
}
|
||||
|
||||
// Create input layout and effect
|
||||
if (!ieffect)
|
||||
{
|
||||
auto effect = std::make_shared<BasicEffect>(d3dDevice);
|
||||
effect->EnableDefaultLighting();
|
||||
effect->SetLightingEnabled(true);
|
||||
|
||||
ieffect = effect;
|
||||
}
|
||||
|
||||
ComPtr<ID3D11InputLayout> il;
|
||||
{
|
||||
void const* shaderByteCode;
|
||||
size_t byteCodeLength;
|
||||
|
||||
ieffect->GetVertexShaderBytecode(&shaderByteCode, &byteCodeLength);
|
||||
|
||||
ThrowIfFailed(
|
||||
d3dDevice->CreateInputLayout(VertexPositionNormalTexture::InputElements,
|
||||
VertexPositionNormalTexture::InputElementCount,
|
||||
shaderByteCode, byteCodeLength,
|
||||
il.GetAddressOf()));
|
||||
|
||||
SetDebugObjectName(il.Get(), "ModelVBO");
|
||||
}
|
||||
|
||||
auto part = new ModelMeshPart();
|
||||
part->indexCount = header->numIndices;
|
||||
part->startIndex = 0;
|
||||
part->vertexStride = static_cast<UINT>( sizeof(VertexPositionNormalTexture) );
|
||||
part->inputLayout = il;
|
||||
part->indexBuffer = ib;
|
||||
part->vertexBuffer = vb;
|
||||
part->effect = ieffect;
|
||||
part->vbDecl = g_vbdecl;
|
||||
|
||||
auto mesh = std::make_shared<ModelMesh>();
|
||||
mesh->ccw = ccw;
|
||||
mesh->pmalpha = pmalpha;
|
||||
BoundingSphere::CreateFromPoints(mesh->boundingSphere, header->numVertices, &verts->position, sizeof(VertexPositionNormalTexture));
|
||||
BoundingBox::CreateFromPoints(mesh->boundingBox, header->numVertices, &verts->position, sizeof(VertexPositionNormalTexture));
|
||||
mesh->meshParts.emplace_back(part);
|
||||
|
||||
std::unique_ptr<Model> model(new Model());
|
||||
model->meshes.emplace_back(mesh);
|
||||
|
||||
return model;
|
||||
}
|
||||
|
||||
|
||||
//--------------------------------------------------------------------------------------
|
||||
_Use_decl_annotations_
|
||||
std::unique_ptr<Model> DirectX::Model::CreateFromVBO(ID3D11Device* d3dDevice, const wchar_t* szFileName,
|
||||
std::shared_ptr<IEffect> ieffect, bool ccw, bool pmalpha)
|
||||
{
|
||||
size_t dataSize = 0;
|
||||
std::unique_ptr<uint8_t[]> data;
|
||||
HRESULT hr = BinaryReader::ReadEntireFile( szFileName, data, &dataSize );
|
||||
if ( FAILED(hr) )
|
||||
{
|
||||
DebugTrace( "CreateFromVBO failed (%08X) loading '%ls'\n", hr, szFileName );
|
||||
throw std::exception( "CreateFromVBO" );
|
||||
}
|
||||
|
||||
auto model = CreateFromVBO( d3dDevice, data.get(), dataSize, ieffect, ccw, pmalpha );
|
||||
|
||||
model->name = szFileName;
|
||||
|
||||
return model;
|
||||
}
|
||||
//--------------------------------------------------------------------------------------
|
||||
// File: ModelLoadVBO.cpp
|
||||
//
|
||||
// THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF
|
||||
// ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO
|
||||
// THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A
|
||||
// PARTICULAR PURPOSE.
|
||||
//
|
||||
// Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
//
|
||||
// http://go.microsoft.com/fwlink/?LinkId=248929
|
||||
//--------------------------------------------------------------------------------------
|
||||
|
||||
#include "pch.h"
|
||||
#include "Model.h"
|
||||
|
||||
#include "Effects.h"
|
||||
#include "VertexTypes.h"
|
||||
|
||||
#include "DirectXHelpers.h"
|
||||
#include "PlatformHelpers.h"
|
||||
#include "BinaryReader.h"
|
||||
|
||||
#include "vbo.h"
|
||||
|
||||
using namespace DirectX;
|
||||
using Microsoft::WRL::ComPtr;
|
||||
|
||||
static_assert(sizeof(VertexPositionNormalTexture) == 32, "VBO vertex size mismatch");
|
||||
|
||||
namespace
|
||||
{
|
||||
//--------------------------------------------------------------------------------------
|
||||
// Shared VB input element description
|
||||
INIT_ONCE g_InitOnce = INIT_ONCE_STATIC_INIT;
|
||||
std::shared_ptr<std::vector<D3D11_INPUT_ELEMENT_DESC>> g_vbdecl;
|
||||
|
||||
BOOL CALLBACK InitializeDecl(PINIT_ONCE initOnce, PVOID Parameter, PVOID *lpContext)
|
||||
{
|
||||
UNREFERENCED_PARAMETER(initOnce);
|
||||
UNREFERENCED_PARAMETER(Parameter);
|
||||
UNREFERENCED_PARAMETER(lpContext);
|
||||
|
||||
g_vbdecl = std::make_shared<std::vector<D3D11_INPUT_ELEMENT_DESC>>(VertexPositionNormalTexture::InputElements,
|
||||
VertexPositionNormalTexture::InputElements + VertexPositionNormalTexture::InputElementCount);
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
//--------------------------------------------------------------------------------------
|
||||
_Use_decl_annotations_
|
||||
std::unique_ptr<Model> DirectX::Model::CreateFromVBO(ID3D11Device* d3dDevice, const uint8_t* meshData, size_t dataSize,
|
||||
std::shared_ptr<IEffect> ieffect, bool ccw, bool pmalpha)
|
||||
{
|
||||
if (!InitOnceExecuteOnce(&g_InitOnce, InitializeDecl, nullptr, nullptr))
|
||||
throw std::exception("One-time initialization failed");
|
||||
|
||||
if ( !d3dDevice || !meshData )
|
||||
throw std::exception("Device and meshData cannot be null");
|
||||
|
||||
// File Header
|
||||
if ( dataSize < sizeof(VBO::header_t) )
|
||||
throw std::exception("End of file");
|
||||
auto header = reinterpret_cast<const VBO::header_t*>( meshData );
|
||||
|
||||
if ( !header->numVertices || !header->numIndices )
|
||||
throw std::exception("No vertices or indices found");
|
||||
|
||||
size_t vertSize = sizeof(VertexPositionNormalTexture) * header->numVertices;
|
||||
|
||||
if (dataSize < (vertSize + sizeof(VBO::header_t)))
|
||||
throw std::exception("End of file");
|
||||
auto verts = reinterpret_cast<const VertexPositionNormalTexture*>( meshData + sizeof(VBO::header_t) );
|
||||
|
||||
size_t indexSize = sizeof(uint16_t) * header->numIndices;
|
||||
|
||||
if (dataSize < (sizeof(VBO::header_t) + vertSize + indexSize))
|
||||
throw std::exception("End of file");
|
||||
auto indices = reinterpret_cast<const uint16_t*>( meshData + sizeof(VBO::header_t) + vertSize );
|
||||
|
||||
// Create vertex buffer
|
||||
ComPtr<ID3D11Buffer> vb;
|
||||
{
|
||||
D3D11_BUFFER_DESC desc = {};
|
||||
desc.Usage = D3D11_USAGE_DEFAULT;
|
||||
desc.ByteWidth = static_cast<UINT>(vertSize);
|
||||
desc.BindFlags = D3D11_BIND_VERTEX_BUFFER;
|
||||
|
||||
D3D11_SUBRESOURCE_DATA initData = {};
|
||||
initData.pSysMem = verts;
|
||||
|
||||
ThrowIfFailed(
|
||||
d3dDevice->CreateBuffer(&desc, &initData, vb.GetAddressOf())
|
||||
);
|
||||
|
||||
SetDebugObjectName(vb.Get(), "ModelVBO");
|
||||
}
|
||||
|
||||
// Create index buffer
|
||||
ComPtr<ID3D11Buffer> ib;
|
||||
{
|
||||
D3D11_BUFFER_DESC desc = {};
|
||||
desc.Usage = D3D11_USAGE_DEFAULT;
|
||||
desc.ByteWidth = static_cast<UINT>(indexSize);
|
||||
desc.BindFlags = D3D11_BIND_INDEX_BUFFER;
|
||||
|
||||
D3D11_SUBRESOURCE_DATA initData = {};
|
||||
initData.pSysMem = indices;
|
||||
|
||||
ThrowIfFailed(
|
||||
d3dDevice->CreateBuffer(&desc, &initData, ib.GetAddressOf())
|
||||
);
|
||||
|
||||
SetDebugObjectName(ib.Get(), "ModelVBO");
|
||||
}
|
||||
|
||||
// Create input layout and effect
|
||||
if (!ieffect)
|
||||
{
|
||||
auto effect = std::make_shared<BasicEffect>(d3dDevice);
|
||||
effect->EnableDefaultLighting();
|
||||
effect->SetLightingEnabled(true);
|
||||
|
||||
ieffect = effect;
|
||||
}
|
||||
|
||||
ComPtr<ID3D11InputLayout> il;
|
||||
{
|
||||
void const* shaderByteCode;
|
||||
size_t byteCodeLength;
|
||||
|
||||
ieffect->GetVertexShaderBytecode(&shaderByteCode, &byteCodeLength);
|
||||
|
||||
ThrowIfFailed(
|
||||
d3dDevice->CreateInputLayout(VertexPositionNormalTexture::InputElements,
|
||||
VertexPositionNormalTexture::InputElementCount,
|
||||
shaderByteCode, byteCodeLength,
|
||||
il.GetAddressOf()));
|
||||
|
||||
SetDebugObjectName(il.Get(), "ModelVBO");
|
||||
}
|
||||
|
||||
auto part = new ModelMeshPart();
|
||||
part->indexCount = header->numIndices;
|
||||
part->startIndex = 0;
|
||||
part->vertexStride = static_cast<UINT>( sizeof(VertexPositionNormalTexture) );
|
||||
part->inputLayout = il;
|
||||
part->indexBuffer = ib;
|
||||
part->vertexBuffer = vb;
|
||||
part->effect = ieffect;
|
||||
part->vbDecl = g_vbdecl;
|
||||
|
||||
auto mesh = std::make_shared<ModelMesh>();
|
||||
mesh->ccw = ccw;
|
||||
mesh->pmalpha = pmalpha;
|
||||
BoundingSphere::CreateFromPoints(mesh->boundingSphere, header->numVertices, &verts->position, sizeof(VertexPositionNormalTexture));
|
||||
BoundingBox::CreateFromPoints(mesh->boundingBox, header->numVertices, &verts->position, sizeof(VertexPositionNormalTexture));
|
||||
mesh->meshParts.emplace_back(part);
|
||||
|
||||
std::unique_ptr<Model> model(new Model());
|
||||
model->meshes.emplace_back(mesh);
|
||||
|
||||
return model;
|
||||
}
|
||||
|
||||
|
||||
//--------------------------------------------------------------------------------------
|
||||
_Use_decl_annotations_
|
||||
std::unique_ptr<Model> DirectX::Model::CreateFromVBO(ID3D11Device* d3dDevice, const wchar_t* szFileName,
|
||||
std::shared_ptr<IEffect> ieffect, bool ccw, bool pmalpha)
|
||||
{
|
||||
size_t dataSize = 0;
|
||||
std::unique_ptr<uint8_t[]> data;
|
||||
HRESULT hr = BinaryReader::ReadEntireFile( szFileName, data, &dataSize );
|
||||
if ( FAILED(hr) )
|
||||
{
|
||||
DebugTrace( "CreateFromVBO failed (%08X) loading '%ls'\n", hr, szFileName );
|
||||
throw std::exception( "CreateFromVBO" );
|
||||
}
|
||||
|
||||
auto model = CreateFromVBO( d3dDevice, data.get(), dataSize, ieffect, ccw, pmalpha );
|
||||
|
||||
model->name = szFileName;
|
||||
|
||||
return model;
|
||||
}
|
||||
|
|
Загрузка…
Ссылка в новой задаче