Commit d3a4092d by Geoff Lang

Port the Stencil_Test sample to the new sample framework.

Rename Stencil_Test to stencil_operations, a more fitting name for a sample. BUG=angle:521 Change-Id: I5412ecef12d80c3dbf54539bc7509678a35c44d5 Reviewed-on: https://chromium-review.googlesource.com/188728Reviewed-by: 's avatarShannon Woods <shannonwoods@chromium.org> Reviewed-by: 's avatarJamie Madill <jmadill@chromium.org> Tested-by: 's avatarGeoff Lang <geofflang@chromium.org>
parent 3b3ad1fe
...@@ -189,8 +189,8 @@ ...@@ -189,8 +189,8 @@
<Project>{459E5678-892C-4EF9-6ED8-0D9E5272B4FF}</Project> <Project>{459E5678-892C-4EF9-6ED8-0D9E5272B4FF}</Project>
<ReferenceOutputAssembly>false</ReferenceOutputAssembly> <ReferenceOutputAssembly>false</ReferenceOutputAssembly>
</ProjectReference> </ProjectReference>
<ProjectReference Include="..\samples\stencil_test.vcxproj"> <ProjectReference Include="..\samples\stencil_operations.vcxproj">
<Project>{14B6D991-023A-E6E2-1D1B-257A7B7C910A}</Project> <Project>{92582B26-5131-8C32-39D9-5768C7FA12B4}</Project>
<ReferenceOutputAssembly>false</ReferenceOutputAssembly> <ReferenceOutputAssembly>false</ReferenceOutputAssembly>
</ProjectReference> </ProjectReference>
<ProjectReference Include="..\samples\texture_wrap.vcxproj"> <ProjectReference Include="..\samples\texture_wrap.vcxproj">
......
...@@ -22,7 +22,7 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "All", "All.vcxproj", "{D048 ...@@ -22,7 +22,7 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "All", "All.vcxproj", "{D048
{0BD6333E-E82C-7665-C386-CDA40096413D} = {0BD6333E-E82C-7665-C386-CDA40096413D} {0BD6333E-E82C-7665-C386-CDA40096413D} = {0BD6333E-E82C-7665-C386-CDA40096413D}
{93B7F18A-947E-69A1-9CD8-D1E5144E792A} = {93B7F18A-947E-69A1-9CD8-D1E5144E792A} {93B7F18A-947E-69A1-9CD8-D1E5144E792A} = {93B7F18A-947E-69A1-9CD8-D1E5144E792A}
{459E5678-892C-4EF9-6ED8-0D9E5272B4FF} = {459E5678-892C-4EF9-6ED8-0D9E5272B4FF} {459E5678-892C-4EF9-6ED8-0D9E5272B4FF} = {459E5678-892C-4EF9-6ED8-0D9E5272B4FF}
{14B6D991-023A-E6E2-1D1B-257A7B7C910A} = {14B6D991-023A-E6E2-1D1B-257A7B7C910A} {92582B26-5131-8C32-39D9-5768C7FA12B4} = {92582B26-5131-8C32-39D9-5768C7FA12B4}
{46160987-0221-9E14-3B88-80F9FCFCFFBF} = {46160987-0221-9E14-3B88-80F9FCFCFFBF} {46160987-0221-9E14-3B88-80F9FCFCFFBF} = {46160987-0221-9E14-3B88-80F9FCFCFFBF}
{CBE3D362-43EA-60FC-D5AC-490039CA449A} = {CBE3D362-43EA-60FC-D5AC-490039CA449A} {CBE3D362-43EA-60FC-D5AC-490039CA449A} = {CBE3D362-43EA-60FC-D5AC-490039CA449A}
EndProjectSection EndProjectSection
...@@ -143,9 +143,9 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "simple_vertex_shader", "..\ ...@@ -143,9 +143,9 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "simple_vertex_shader", "..\
{7FBD6F69-B9A4-69F1-A12B-8DACB3F8CD81} = {7FBD6F69-B9A4-69F1-A12B-8DACB3F8CD81} {7FBD6F69-B9A4-69F1-A12B-8DACB3F8CD81} = {7FBD6F69-B9A4-69F1-A12B-8DACB3F8CD81}
EndProjectSection EndProjectSection
EndProject EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "stencil_test", "..\samples\stencil_test.vcxproj", "{14B6D991-023A-E6E2-1D1B-257A7B7C910A}" Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "stencil_operations", "..\samples\stencil_operations.vcxproj", "{92582B26-5131-8C32-39D9-5768C7FA12B4}"
ProjectSection(ProjectDependencies) = postProject ProjectSection(ProjectDependencies) = postProject
{80E5C3D9-93C2-943E-176F-C9A903E27BC9} = {80E5C3D9-93C2-943E-176F-C9A903E27BC9} {297C46B0-9263-A9EA-82B1-EA221E7D7C7F} = {297C46B0-9263-A9EA-82B1-EA221E7D7C7F}
{FBAEE4F6-562A-588F-01F9-72DCABB3B061} = {FBAEE4F6-562A-588F-01F9-72DCABB3B061} {FBAEE4F6-562A-588F-01F9-72DCABB3B061} = {FBAEE4F6-562A-588F-01F9-72DCABB3B061}
{7FBD6F69-B9A4-69F1-A12B-8DACB3F8CD81} = {7FBD6F69-B9A4-69F1-A12B-8DACB3F8CD81} {7FBD6F69-B9A4-69F1-A12B-8DACB3F8CD81} = {7FBD6F69-B9A4-69F1-A12B-8DACB3F8CD81}
EndProjectSection EndProjectSection
...@@ -173,10 +173,6 @@ Global ...@@ -173,10 +173,6 @@ Global
{130A534E-6BA3-DB9C-B0D2-5ACE5CCB2632}.Debug|Win32.Build.0 = Debug|Win32 {130A534E-6BA3-DB9C-B0D2-5ACE5CCB2632}.Debug|Win32.Build.0 = Debug|Win32
{130A534E-6BA3-DB9C-B0D2-5ACE5CCB2632}.Release|Win32.ActiveCfg = Release|Win32 {130A534E-6BA3-DB9C-B0D2-5ACE5CCB2632}.Release|Win32.ActiveCfg = Release|Win32
{130A534E-6BA3-DB9C-B0D2-5ACE5CCB2632}.Release|Win32.Build.0 = Release|Win32 {130A534E-6BA3-DB9C-B0D2-5ACE5CCB2632}.Release|Win32.Build.0 = Release|Win32
{14B6D991-023A-E6E2-1D1B-257A7B7C910A}.Debug|Win32.ActiveCfg = Debug|Win32
{14B6D991-023A-E6E2-1D1B-257A7B7C910A}.Debug|Win32.Build.0 = Debug|Win32
{14B6D991-023A-E6E2-1D1B-257A7B7C910A}.Release|Win32.ActiveCfg = Release|Win32
{14B6D991-023A-E6E2-1D1B-257A7B7C910A}.Release|Win32.Build.0 = Release|Win32
{22DC02D5-1598-943C-13E1-82185B469F81}.Debug|Win32.ActiveCfg = Debug|Win32 {22DC02D5-1598-943C-13E1-82185B469F81}.Debug|Win32.ActiveCfg = Debug|Win32
{22DC02D5-1598-943C-13E1-82185B469F81}.Debug|Win32.Build.0 = Debug|Win32 {22DC02D5-1598-943C-13E1-82185B469F81}.Debug|Win32.Build.0 = Debug|Win32
{22DC02D5-1598-943C-13E1-82185B469F81}.Release|Win32.ActiveCfg = Release|Win32 {22DC02D5-1598-943C-13E1-82185B469F81}.Release|Win32.ActiveCfg = Release|Win32
...@@ -229,6 +225,10 @@ Global ...@@ -229,6 +225,10 @@ Global
{8C20B90A-FBCB-B63F-435A-3299A1C38B2C}.Debug|Win32.Build.0 = Debug|Win32 {8C20B90A-FBCB-B63F-435A-3299A1C38B2C}.Debug|Win32.Build.0 = Debug|Win32
{8C20B90A-FBCB-B63F-435A-3299A1C38B2C}.Release|Win32.ActiveCfg = Release|Win32 {8C20B90A-FBCB-B63F-435A-3299A1C38B2C}.Release|Win32.ActiveCfg = Release|Win32
{8C20B90A-FBCB-B63F-435A-3299A1C38B2C}.Release|Win32.Build.0 = Release|Win32 {8C20B90A-FBCB-B63F-435A-3299A1C38B2C}.Release|Win32.Build.0 = Release|Win32
{92582B26-5131-8C32-39D9-5768C7FA12B4}.Debug|Win32.ActiveCfg = Debug|Win32
{92582B26-5131-8C32-39D9-5768C7FA12B4}.Debug|Win32.Build.0 = Debug|Win32
{92582B26-5131-8C32-39D9-5768C7FA12B4}.Release|Win32.ActiveCfg = Release|Win32
{92582B26-5131-8C32-39D9-5768C7FA12B4}.Release|Win32.Build.0 = Release|Win32
{93B7F18A-947E-69A1-9CD8-D1E5144E792A}.Debug|Win32.ActiveCfg = Debug|Win32 {93B7F18A-947E-69A1-9CD8-D1E5144E792A}.Debug|Win32.ActiveCfg = Debug|Win32
{93B7F18A-947E-69A1-9CD8-D1E5144E792A}.Debug|Win32.Build.0 = Debug|Win32 {93B7F18A-947E-69A1-9CD8-D1E5144E792A}.Debug|Win32.Build.0 = Debug|Win32
{93B7F18A-947E-69A1-9CD8-D1E5144E792A}.Release|Win32.ActiveCfg = Release|Win32 {93B7F18A-947E-69A1-9CD8-D1E5144E792A}.Release|Win32.ActiveCfg = Release|Win32
......
...@@ -116,9 +116,9 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "simple_vertex_shader", "sim ...@@ -116,9 +116,9 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "simple_vertex_shader", "sim
{7FBD6F69-B9A4-69F1-A12B-8DACB3F8CD81} = {7FBD6F69-B9A4-69F1-A12B-8DACB3F8CD81} {7FBD6F69-B9A4-69F1-A12B-8DACB3F8CD81} = {7FBD6F69-B9A4-69F1-A12B-8DACB3F8CD81}
EndProjectSection EndProjectSection
EndProject EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "stencil_test", "stencil_test.vcxproj", "{14B6D991-023A-E6E2-1D1B-257A7B7C910A}" Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "stencil_operations", "stencil_operations.vcxproj", "{92582B26-5131-8C32-39D9-5768C7FA12B4}"
ProjectSection(ProjectDependencies) = postProject ProjectSection(ProjectDependencies) = postProject
{80E5C3D9-93C2-943E-176F-C9A903E27BC9} = {80E5C3D9-93C2-943E-176F-C9A903E27BC9} {297C46B0-9263-A9EA-82B1-EA221E7D7C7F} = {297C46B0-9263-A9EA-82B1-EA221E7D7C7F}
{FBAEE4F6-562A-588F-01F9-72DCABB3B061} = {FBAEE4F6-562A-588F-01F9-72DCABB3B061} {FBAEE4F6-562A-588F-01F9-72DCABB3B061} = {FBAEE4F6-562A-588F-01F9-72DCABB3B061}
{7FBD6F69-B9A4-69F1-A12B-8DACB3F8CD81} = {7FBD6F69-B9A4-69F1-A12B-8DACB3F8CD81} {7FBD6F69-B9A4-69F1-A12B-8DACB3F8CD81} = {7FBD6F69-B9A4-69F1-A12B-8DACB3F8CD81}
EndProjectSection EndProjectSection
...@@ -146,10 +146,6 @@ Global ...@@ -146,10 +146,6 @@ Global
{130A534E-6BA3-DB9C-B0D2-5ACE5CCB2632}.Debug|Win32.Build.0 = Debug|Win32 {130A534E-6BA3-DB9C-B0D2-5ACE5CCB2632}.Debug|Win32.Build.0 = Debug|Win32
{130A534E-6BA3-DB9C-B0D2-5ACE5CCB2632}.Release|Win32.ActiveCfg = Release|Win32 {130A534E-6BA3-DB9C-B0D2-5ACE5CCB2632}.Release|Win32.ActiveCfg = Release|Win32
{130A534E-6BA3-DB9C-B0D2-5ACE5CCB2632}.Release|Win32.Build.0 = Release|Win32 {130A534E-6BA3-DB9C-B0D2-5ACE5CCB2632}.Release|Win32.Build.0 = Release|Win32
{14B6D991-023A-E6E2-1D1B-257A7B7C910A}.Debug|Win32.ActiveCfg = Debug|Win32
{14B6D991-023A-E6E2-1D1B-257A7B7C910A}.Debug|Win32.Build.0 = Debug|Win32
{14B6D991-023A-E6E2-1D1B-257A7B7C910A}.Release|Win32.ActiveCfg = Release|Win32
{14B6D991-023A-E6E2-1D1B-257A7B7C910A}.Release|Win32.Build.0 = Release|Win32
{22DC02D5-1598-943C-13E1-82185B469F81}.Debug|Win32.ActiveCfg = Debug|Win32 {22DC02D5-1598-943C-13E1-82185B469F81}.Debug|Win32.ActiveCfg = Debug|Win32
{22DC02D5-1598-943C-13E1-82185B469F81}.Debug|Win32.Build.0 = Debug|Win32 {22DC02D5-1598-943C-13E1-82185B469F81}.Debug|Win32.Build.0 = Debug|Win32
{22DC02D5-1598-943C-13E1-82185B469F81}.Release|Win32.ActiveCfg = Release|Win32 {22DC02D5-1598-943C-13E1-82185B469F81}.Release|Win32.ActiveCfg = Release|Win32
...@@ -202,6 +198,10 @@ Global ...@@ -202,6 +198,10 @@ Global
{8C20B90A-FBCB-B63F-435A-3299A1C38B2C}.Debug|Win32.Build.0 = Debug|Win32 {8C20B90A-FBCB-B63F-435A-3299A1C38B2C}.Debug|Win32.Build.0 = Debug|Win32
{8C20B90A-FBCB-B63F-435A-3299A1C38B2C}.Release|Win32.ActiveCfg = Release|Win32 {8C20B90A-FBCB-B63F-435A-3299A1C38B2C}.Release|Win32.ActiveCfg = Release|Win32
{8C20B90A-FBCB-B63F-435A-3299A1C38B2C}.Release|Win32.Build.0 = Release|Win32 {8C20B90A-FBCB-B63F-435A-3299A1C38B2C}.Release|Win32.Build.0 = Release|Win32
{92582B26-5131-8C32-39D9-5768C7FA12B4}.Debug|Win32.ActiveCfg = Debug|Win32
{92582B26-5131-8C32-39D9-5768C7FA12B4}.Debug|Win32.Build.0 = Debug|Win32
{92582B26-5131-8C32-39D9-5768C7FA12B4}.Release|Win32.ActiveCfg = Release|Win32
{92582B26-5131-8C32-39D9-5768C7FA12B4}.Release|Win32.Build.0 = Release|Win32
{93B7F18A-947E-69A1-9CD8-D1E5144E792A}.Debug|Win32.ActiveCfg = Debug|Win32 {93B7F18A-947E-69A1-9CD8-D1E5144E792A}.Debug|Win32.ActiveCfg = Debug|Win32
{93B7F18A-947E-69A1-9CD8-D1E5144E792A}.Debug|Win32.Build.0 = Debug|Win32 {93B7F18A-947E-69A1-9CD8-D1E5144E792A}.Debug|Win32.Build.0 = Debug|Win32
{93B7F18A-947E-69A1-9CD8-D1E5144E792A}.Release|Win32.ActiveCfg = Release|Win32 {93B7F18A-947E-69A1-9CD8-D1E5144E792A}.Release|Win32.ActiveCfg = Release|Win32
......
...@@ -11,9 +11,9 @@ ...@@ -11,9 +11,9 @@
</ProjectConfiguration> </ProjectConfiguration>
</ItemGroup> </ItemGroup>
<PropertyGroup Label="Globals"> <PropertyGroup Label="Globals">
<ProjectGuid>{14B6D991-023A-E6E2-1D1B-257A7B7C910A}</ProjectGuid> <ProjectGuid>{92582B26-5131-8C32-39D9-5768C7FA12B4}</ProjectGuid>
<Keyword>Win32Proj</Keyword> <Keyword>Win32Proj</Keyword>
<RootNamespace>stencil_test</RootNamespace> <RootNamespace>stencil_operations</RootNamespace>
</PropertyGroup> </PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props"/> <Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props"/>
<PropertyGroup Label="Configuration"> <PropertyGroup Label="Configuration">
...@@ -37,12 +37,12 @@ ...@@ -37,12 +37,12 @@
</PropertyGroup> </PropertyGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'"> <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<ClCompile> <ClCompile>
<AdditionalIncludeDirectories>..\..\samples\gles2_book\Common;..\..\include;C:\Program Files (x86)\Windows Kits\8.0\Include\shared;C:\Program Files (x86)\Windows Kits\8.0\Include\um;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories> <AdditionalIncludeDirectories>..\..\include;..\..\samples\angle\sample_util;C:\Program Files (x86)\Windows Kits\8.0\Include\shared;C:\Program Files (x86)\Windows Kits\8.0\Include\um;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<AdditionalOptions>/MP %(AdditionalOptions)</AdditionalOptions> <AdditionalOptions>/MP %(AdditionalOptions)</AdditionalOptions>
<BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks> <BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks>
<BufferSecurityCheck>true</BufferSecurityCheck> <BufferSecurityCheck>true</BufferSecurityCheck>
<DebugInformationFormat>ProgramDatabase</DebugInformationFormat> <DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
<DisableSpecificWarnings>4100;4127;4189;4239;4244;4245;4512;4702;4530;4718;%(DisableSpecificWarnings)</DisableSpecificWarnings> <DisableSpecificWarnings>4201;4100;4127;4189;4239;4244;4245;4512;4702;4530;4718;%(DisableSpecificWarnings)</DisableSpecificWarnings>
<FunctionLevelLinking>true</FunctionLevelLinking> <FunctionLevelLinking>true</FunctionLevelLinking>
<MinimalRebuild>false</MinimalRebuild> <MinimalRebuild>false</MinimalRebuild>
<Optimization>Disabled</Optimization> <Optimization>Disabled</Optimization>
...@@ -67,17 +67,17 @@ ...@@ -67,17 +67,17 @@
<TargetMachine>MachineX86</TargetMachine> <TargetMachine>MachineX86</TargetMachine>
</Link> </Link>
<ResourceCompile> <ResourceCompile>
<AdditionalIncludeDirectories>..\..\samples\gles2_book\Common;..\..\include;C:\Program Files (x86)\Windows Kits\8.0\Include\shared;C:\Program Files (x86)\Windows Kits\8.0\Include\um;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories> <AdditionalIncludeDirectories>..\..\include;..\..\samples\angle\sample_util;C:\Program Files (x86)\Windows Kits\8.0\Include\shared;C:\Program Files (x86)\Windows Kits\8.0\Include\um;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<Culture>0x0409</Culture> <Culture>0x0409</Culture>
</ResourceCompile> </ResourceCompile>
</ItemDefinitionGroup> </ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'"> <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<ClCompile> <ClCompile>
<AdditionalIncludeDirectories>..\..\samples\gles2_book\Common;..\..\include;C:\Program Files (x86)\Windows Kits\8.0\Include\shared;C:\Program Files (x86)\Windows Kits\8.0\Include\um;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories> <AdditionalIncludeDirectories>..\..\include;..\..\samples\angle\sample_util;C:\Program Files (x86)\Windows Kits\8.0\Include\shared;C:\Program Files (x86)\Windows Kits\8.0\Include\um;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<AdditionalOptions>/MP %(AdditionalOptions)</AdditionalOptions> <AdditionalOptions>/MP %(AdditionalOptions)</AdditionalOptions>
<BufferSecurityCheck>true</BufferSecurityCheck> <BufferSecurityCheck>true</BufferSecurityCheck>
<DebugInformationFormat>ProgramDatabase</DebugInformationFormat> <DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
<DisableSpecificWarnings>4100;4127;4189;4239;4244;4245;4512;4702;4530;4718;%(DisableSpecificWarnings)</DisableSpecificWarnings> <DisableSpecificWarnings>4201;4100;4127;4189;4239;4244;4245;4512;4702;4530;4718;%(DisableSpecificWarnings)</DisableSpecificWarnings>
<FunctionLevelLinking>true</FunctionLevelLinking> <FunctionLevelLinking>true</FunctionLevelLinking>
<MinimalRebuild>false</MinimalRebuild> <MinimalRebuild>false</MinimalRebuild>
<Optimization>MaxSpeed</Optimization> <Optimization>MaxSpeed</Optimization>
...@@ -102,7 +102,7 @@ ...@@ -102,7 +102,7 @@
<TargetMachine>MachineX86</TargetMachine> <TargetMachine>MachineX86</TargetMachine>
</Link> </Link>
<ResourceCompile> <ResourceCompile>
<AdditionalIncludeDirectories>..\..\samples\gles2_book\Common;..\..\include;C:\Program Files (x86)\Windows Kits\8.0\Include\shared;C:\Program Files (x86)\Windows Kits\8.0\Include\um;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories> <AdditionalIncludeDirectories>..\..\include;..\..\samples\angle\sample_util;C:\Program Files (x86)\Windows Kits\8.0\Include\shared;C:\Program Files (x86)\Windows Kits\8.0\Include\um;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<Culture>0x0409</Culture> <Culture>0x0409</Culture>
</ResourceCompile> </ResourceCompile>
</ItemDefinitionGroup> </ItemDefinitionGroup>
...@@ -110,11 +110,11 @@ ...@@ -110,11 +110,11 @@
<None Include="..\..\samples\samples.gyp"/> <None Include="..\..\samples\samples.gyp"/>
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<ClCompile Include="..\..\samples\gles2_book\Stencil_Test\Stencil_Test.c"/> <ClCompile Include="..\..\samples\angle\stencil_operations\StencilOperations.cpp"/>
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<ProjectReference Include="es_util.vcxproj"> <ProjectReference Include="sample_util.vcxproj">
<Project>{80E5C3D9-93C2-943E-176F-C9A903E27BC9}</Project> <Project>{297C46B0-9263-A9EA-82B1-EA221E7D7C7F}</Project>
<ReferenceOutputAssembly>false</ReferenceOutputAssembly> <ReferenceOutputAssembly>false</ReferenceOutputAssembly>
</ProjectReference> </ProjectReference>
<ProjectReference Include="..\src\libEGL.vcxproj"> <ProjectReference Include="..\src\libEGL.vcxproj">
......
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> <Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup> <ItemGroup>
<Filter Include="gles2_book"> <Filter Include="angle">
<UniqueIdentifier>{01DCD872-C931-E1FA-4F9F-EBFA79587BB6}</UniqueIdentifier> <UniqueIdentifier>{2039F76D-4C9A-B8A0-444A-4766C6F6104A}</UniqueIdentifier>
</Filter> </Filter>
<Filter Include="gles2_book\Stencil_Test"> <Filter Include="angle\stencil_operations">
<UniqueIdentifier>{2D7B8D12-C3D0-2175-2129-3AE9CF950A5E}</UniqueIdentifier> <UniqueIdentifier>{36BD90E0-1AC2-C244-DD65-86C57C57EA93}</UniqueIdentifier>
</Filter> </Filter>
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<None Include="..\..\samples\samples.gyp"/> <None Include="..\..\samples\samples.gyp"/>
<ClCompile Include="..\..\samples\gles2_book\Stencil_Test\Stencil_Test.c"> <ClCompile Include="..\..\samples\angle\stencil_operations\StencilOperations.cpp">
<Filter>gles2_book\Stencil_Test</Filter> <Filter>angle\stencil_operations</Filter>
</ClCompile> </ClCompile>
</ItemGroup> </ItemGroup>
</Project> </Project>
//
// Copyright (c) 2014 The ANGLE Project Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
//
// Based on Stencil_Test.c from
// Book: OpenGL(R) ES 2.0 Programming Guide
// Authors: Aaftab Munshi, Dan Ginsburg, Dave Shreiner
// ISBN-10: 0321502795
// ISBN-13: 9780321502797
// Publisher: Addison-Wesley Professional
// URLs: http://safari.informit.com/9780321563835
// http://www.opengles-book.com
#include "SampleApplication.h"
#include "shader_utils.h"
class StencilOperationsSample : public SampleApplication
{
public:
StencilOperationsSample::StencilOperationsSample()
: SampleApplication("StencilOperations", 1280, 720)
{
}
virtual bool initialize()
{
const std::string vs = SHADER_SOURCE
(
attribute vec4 a_position;
void main()
{
gl_Position = a_position;
}
);
const std::string fs = SHADER_SOURCE
(
precision mediump float;
uniform vec4 u_color;
void main()
{
gl_FragColor = u_color;
}
);
mProgram = CompileProgram(vs, fs);
if (!mProgram)
{
return false;
}
// Get the attribute locations
mPositionLoc = glGetAttribLocation(mProgram, "a_position");
// Get the sampler location
mColorLoc = glGetUniformLocation(mProgram, "u_color");
// Set the clear color
glClearColor(0.0f, 0.0f, 0.0f, 0.0f);
// Set the stencil clear value
glClearStencil(0x01);
// Set the depth clear value
glClearDepthf(0.75f);
// Enable the depth and stencil tests
glEnable(GL_DEPTH_TEST);
glEnable(GL_STENCIL_TEST);
return true;
}
virtual void destroy()
{
glDeleteProgram(mProgram);
}
virtual void draw()
{
GLfloat vertices[] =
{
-0.75f, 0.25f, 0.50f, // Quad #0
-0.25f, 0.25f, 0.50f,
-0.25f, 0.75f, 0.50f,
-0.75f, 0.75f, 0.50f,
0.25f, 0.25f, 0.90f, // Quad #1
0.75f, 0.25f, 0.90f,
0.75f, 0.75f, 0.90f,
0.25f, 0.75f, 0.90f,
-0.75f, -0.75f, 0.50f, // Quad #2
-0.25f, -0.75f, 0.50f,
-0.25f, -0.25f, 0.50f,
-0.75f, -0.25f, 0.50f,
0.25f, -0.75f, 0.50f, // Quad #3
0.75f, -0.75f, 0.50f,
0.75f, -0.25f, 0.50f,
0.25f, -0.25f, 0.50f,
-1.00f, -1.00f, 0.00f, // Big Quad
1.00f, -1.00f, 0.00f,
1.00f, 1.00f, 0.00f,
-1.00f, 1.00f, 0.00f,
};
GLubyte indices[][6] =
{
{ 0, 1, 2, 0, 2, 3 }, // Quad #0
{ 4, 5, 6, 4, 6, 7 }, // Quad #1
{ 8, 9, 10, 8, 10, 11 }, // Quad #2
{ 12, 13, 14, 12, 14, 15 }, // Quad #3
{ 16, 17, 18, 16, 18, 19 }, // Big Quad
};
static const size_t testCount = 4;
GLfloat colors[testCount][4] =
{
{ 1.0f, 0.0f, 0.0f, 1.0f },
{ 0.0f, 1.0f, 0.0f, 1.0f },
{ 0.0f, 0.0f, 1.0f, 1.0f },
{ 1.0f, 1.0f, 0.0f, 0.0f },
};
GLuint stencilValues[testCount] =
{
0x7, // Result of test 0
0x0, // Result of test 1
0x2, // Result of test 2
0xff // Result of test 3. We need to fill this value in at run-time
};
// Set the viewport
glViewport(0, 0, getWindow()->getWidth(), getWindow()->getHeight());
// Clear the color, depth, and stencil buffers. At this point, the stencil
// buffer will be 0x1 for all pixels
glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT | GL_STENCIL_BUFFER_BIT);
// Use the program object
glUseProgram(mProgram);
// Load the vertex data
glVertexAttribPointer(mPositionLoc, 3, GL_FLOAT, GL_FALSE, 0, vertices);
glEnableVertexAttribArray(mPositionLoc);
// Test 0:
//
// Initialize upper-left region. In this case, the stencil-buffer values will
// be replaced because the stencil test for the rendered pixels will fail the
// stencil test, which is
//
// ref mask stencil mask
// ( 0x7 & 0x3 ) < ( 0x1 & 0x7 )
//
// The value in the stencil buffer for these pixels will be 0x7.
glStencilFunc(GL_LESS, 0x7, 0x3);
glStencilOp(GL_REPLACE, GL_DECR, GL_DECR);
glDrawElements(GL_TRIANGLES, 6, GL_UNSIGNED_BYTE, indices[0]);
// Test 1:
//
// Initialize the upper-right region. Here, we'll decrement the stencil-buffer
// values where the stencil test passes but the depth test fails. The stencil test is
//
// ref mask stencil mask
// ( 0x3 & 0x3 ) > ( 0x1 & 0x3 )
//
// but where the geometry fails the depth test. The stencil values for these pixels
// will be 0x0.
glStencilFunc(GL_GREATER, 0x3, 0x3);
glStencilOp(GL_KEEP, GL_DECR, GL_KEEP);
glDrawElements(GL_TRIANGLES, 6, GL_UNSIGNED_BYTE, indices[1]);
// Test 2:
//
// Initialize the lower-left region. Here we'll increment (with saturation) the
// stencil value where both the stencil and depth tests pass. The stencil test for
// these pixels will be
//
// ref mask stencil mask
// ( 0x1 & 0x3 ) == ( 0x1 & 0x3 )
//
// The stencil values for these pixels will be 0x2.
glStencilFunc(GL_EQUAL, 0x1, 0x3);
glStencilOp(GL_KEEP, GL_INCR, GL_INCR);
glDrawElements(GL_TRIANGLES, 6, GL_UNSIGNED_BYTE, indices[2]);
// Test 3:
//
// Finally, initialize the lower-right region. We'll invert the stencil value
// where the stencil tests fails. The stencil test for these pixels will be
//
// ref mask stencil mask
// ( 0x2 & 0x1 ) == ( 0x1 & 0x1 )
//
// The stencil value here will be set to ~((2^s-1) & 0x1), (with the 0x1 being
// from the stencil clear value), where 's' is the number of bits in the stencil
// buffer
glStencilFunc(GL_EQUAL, 0x2, 0x1);
glStencilOp(GL_INVERT, GL_KEEP, GL_KEEP);
glDrawElements(GL_TRIANGLES, 6, GL_UNSIGNED_BYTE, indices[3]);
// Since we don't know at compile time how many stencil bits are present, we'll
// query, and update the value correct value in the stencilValues arrays for the
// fourth tests. We'll use this value later in rendering.
GLint stencilBitCount;
glGetIntegerv(GL_STENCIL_BITS, &stencilBitCount);
stencilValues[3] = ~(((1 << stencilBitCount) - 1) & 0x1) & 0xff;
// Use the stencil buffer for controlling where rendering will occur. We disable
// writing to the stencil buffer so we can test against them without modifying
// the values we generated.
glStencilMask(0x0);
for (size_t i = 0; i < testCount; ++i)
{
glStencilFunc(GL_EQUAL, stencilValues[i], 0xff);
glUniform4fv(mColorLoc, 1, colors[i]);
glDrawElements(GL_TRIANGLES, 6, GL_UNSIGNED_BYTE, indices[4]);
}
// Reset the stencil mask
glStencilMask(0xFF);
}
private:
// Handle to a program object
GLuint mProgram;
// Attribute locations
GLint mPositionLoc;
// Uniform locations
GLint mColorLoc;
};
int main(int argc, char **argv)
{
StencilOperationsSample app;
return app.run();
}
//
// Book: OpenGL(R) ES 2.0 Programming Guide
// Authors: Aaftab Munshi, Dan Ginsburg, Dave Shreiner
// ISBN-10: 0321502795
// ISBN-13: 9780321502797
// Publisher: Addison-Wesley Professional
// URLs: http://safari.informit.com/9780321563835
// http://www.opengles-book.com
//
// Stencil_Test.c
//
// This example shows various stencil buffer
// operations.
//
#include <stdlib.h>
#include "esUtil.h"
typedef struct
{
// Handle to a program object
GLuint programObject;
// Attribute locations
GLint positionLoc;
// Uniform locations
GLint colorLoc;
} UserData;
///
// Initialize the shader and program object
//
int Init ( ESContext *esContext )
{
UserData *userData = esContext->userData;
GLbyte vShaderStr[] =
"attribute vec4 a_position; \n"
"void main() \n"
"{ \n"
" gl_Position = a_position; \n"
"} \n";
GLbyte fShaderStr[] =
"precision mediump float; \n"
"uniform vec4 u_color; \n"
"void main() \n"
"{ \n"
" gl_FragColor = u_color; \n"
"} \n";
// Load the shaders and get a linked program object
userData->programObject = esLoadProgram ( vShaderStr, fShaderStr );
// Get the attribute locations
userData->positionLoc = glGetAttribLocation ( userData->programObject, "a_position" );
// Get the sampler location
userData->colorLoc = glGetUniformLocation ( userData->programObject, "u_color" );
// Set the clear color
glClearColor ( 0.0f, 0.0f, 0.0f, 0.0f );
// Set the stencil clear value
glClearStencil ( 0x1 );
// Set the depth clear value
glClearDepthf( 0.75f );
// Enable the depth and stencil tests
glEnable( GL_DEPTH_TEST );
glEnable( GL_STENCIL_TEST );
return TRUE;
}
///
// Initialize the stencil buffer values, and then use those
// values to control rendering
//
void Draw ( ESContext *esContext )
{
int i;
UserData *userData = esContext->userData;
GLfloat vVertices[] = {
-0.75f, 0.25f, 0.50f, // Quad #0
-0.25f, 0.25f, 0.50f,
-0.25f, 0.75f, 0.50f,
-0.75f, 0.75f, 0.50f,
0.25f, 0.25f, 0.90f, // Quad #1
0.75f, 0.25f, 0.90f,
0.75f, 0.75f, 0.90f,
0.25f, 0.75f, 0.90f,
-0.75f, -0.75f, 0.50f, // Quad #2
-0.25f, -0.75f, 0.50f,
-0.25f, -0.25f, 0.50f,
-0.75f, -0.25f, 0.50f,
0.25f, -0.75f, 0.50f, // Quad #3
0.75f, -0.75f, 0.50f,
0.75f, -0.25f, 0.50f,
0.25f, -0.25f, 0.50f,
-1.00f, -1.00f, 0.00f, // Big Quad
1.00f, -1.00f, 0.00f,
1.00f, 1.00f, 0.00f,
-1.00f, 1.00f, 0.00f
};
GLubyte indices[][6] = {
{ 0, 1, 2, 0, 2, 3 }, // Quad #0
{ 4, 5, 6, 4, 6, 7 }, // Quad #1
{ 8, 9, 10, 8, 10, 11 }, // Quad #2
{ 12, 13, 14, 12, 14, 15 }, // Quad #3
{ 16, 17, 18, 16, 18, 19 } // Big Quad
};
#define NumTests 4
GLfloat colors[NumTests][4] = {
{ 1.0f, 0.0f, 0.0f, 1.0f },
{ 0.0f, 1.0f, 0.0f, 1.0f },
{ 0.0f, 0.0f, 1.0f, 1.0f },
{ 1.0f, 1.0f, 0.0f, 0.0f }
};
GLint numStencilBits;
GLuint stencilValues[NumTests] = {
0x7, // Result of test 0
0x0, // Result of test 1
0x2, // Result of test 2
0xff // Result of test 3. We need to fill this
// value in a run-time
};
// Set the viewport
glViewport ( 0, 0, esContext->width, esContext->height );
// Clear the color, depth, and stencil buffers. At this
// point, the stencil buffer will be 0x1 for all pixels
glClear ( GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT | GL_STENCIL_BUFFER_BIT );
// Use the program object
glUseProgram ( userData->programObject );
// Load the vertex position
glVertexAttribPointer ( userData->positionLoc, 3, GL_FLOAT,
GL_FALSE, 0, vVertices );
glEnableVertexAttribArray ( userData->positionLoc );
// Test 0:
//
// Initialize upper-left region. In this case, the
// stencil-buffer values will be replaced because the
// stencil test for the rendered pixels will fail the
// stencil test, which is
//
// ref mask stencil mask
// ( 0x7 & 0x3 ) < ( 0x1 & 0x7 )
//
// The value in the stencil buffer for these pixels will
// be 0x7.
//
glStencilFunc( GL_LESS, 0x7, 0x3 );
glStencilOp( GL_REPLACE, GL_DECR, GL_DECR );
glDrawElements( GL_TRIANGLES, 6, GL_UNSIGNED_BYTE, indices[0] );
// Test 1:
//
// Initialize the upper-right region. Here, we'll decrement
// the stencil-buffer values where the stencil test passes
// but the depth test fails. The stencil test is
//
// ref mask stencil mask
// ( 0x3 & 0x3 ) > ( 0x1 & 0x3 )
//
// but where the geometry fails the depth test. The
// stencil values for these pixels will be 0x0.
//
glStencilFunc( GL_GREATER, 0x3, 0x3 );
glStencilOp( GL_KEEP, GL_DECR, GL_KEEP );
glDrawElements( GL_TRIANGLES, 6, GL_UNSIGNED_BYTE, indices[1] );
// Test 2:
//
// Initialize the lower-left region. Here we'll increment
// (with saturation) the stencil value where both the
// stencil and depth tests pass. The stencil test for
// these pixels will be
//
// ref mask stencil mask
// ( 0x1 & 0x3 ) == ( 0x1 & 0x3 )
//
// The stencil values for these pixels will be 0x2.
//
glStencilFunc( GL_EQUAL, 0x1, 0x3 );
glStencilOp( GL_KEEP, GL_INCR, GL_INCR );
glDrawElements( GL_TRIANGLES, 6, GL_UNSIGNED_BYTE, indices[2] );
// Test 3:
//
// Finally, initialize the lower-right region. We'll invert
// the stencil value where the stencil tests fails. The
// stencil test for these pixels will be
//
// ref mask stencil mask
// ( 0x2 & 0x1 ) == ( 0x1 & 0x1 )
//
// The stencil value here will be set to ~((2^s-1) & 0x1),
// (with the 0x1 being from the stencil clear value),
// where 's' is the number of bits in the stencil buffer
//
glStencilFunc( GL_EQUAL, 0x2, 0x1 );
glStencilOp( GL_INVERT, GL_KEEP, GL_KEEP );
glDrawElements( GL_TRIANGLES, 6, GL_UNSIGNED_BYTE, indices[3] );
// Since we don't know at compile time how many stecil bits are present,
// we'll query, and update the value correct value in the
// stencilValues arrays for the fourth tests. We'll use this value
// later in rendering.
glGetIntegerv( GL_STENCIL_BITS, &numStencilBits );
stencilValues[3] = ~(((1 << numStencilBits) - 1) & 0x1) & 0xff;
// Use the stencil buffer for controlling where rendering will
// occur. We diable writing to the stencil buffer so we
// can test against them without modifying the values we
// generated.
glStencilMask( 0x0 );
for ( i = 0; i < NumTests; ++i )
{
glStencilFunc( GL_EQUAL, stencilValues[i], 0xff );
glUniform4fv( userData->colorLoc, 1, colors[i] );
glDrawElements( GL_TRIANGLES, 6, GL_UNSIGNED_BYTE, indices[4] );
}
eglSwapBuffers ( esContext->eglDisplay, esContext->eglSurface );
}
///
// Cleanup
//
void ShutDown ( ESContext *esContext )
{
UserData *userData = esContext->userData;
// Delete program object
glDeleteProgram ( userData->programObject );
}
int main ( int argc, char *argv[] )
{
ESContext esContext;
UserData userData;
esInitContext ( &esContext );
esContext.userData = &userData;
esCreateWindow ( &esContext, TEXT("Stencil Test"), 320, 240,
ES_WINDOW_RGB | ES_WINDOW_DEPTH | ES_WINDOW_STENCIL );
if ( !Init ( &esContext ) )
return 0;
esRegisterDrawFunc ( &esContext, Draw );
esMainLoop ( &esContext );
ShutDown ( &esContext );
}
...@@ -184,10 +184,10 @@ ...@@ -184,10 +184,10 @@
}, },
{ {
'target_name': 'stencil_test', 'target_name': 'stencil_operations',
'type': 'executable', 'type': 'executable',
'dependencies': [ 'es_util' ], 'dependencies': [ 'sample_util' ],
'sources': [ '<!@(python <(angle_path)/enumerate_files.py gles2_book/Stencil_Test -types *.c *.h)' ], 'sources': [ '<!@(python <(angle_path)/enumerate_files.py angle/stencil_operations -types *.cpp *.h)' ],
}, },
{ {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment