Add the BasicTnL PowerVR sample.
BUG=18110152
Change-Id: I83792f8235663a6f59c08ad874f743a8b59ac337
Reviewed-on: https://swiftshader-review.googlesource.com/1256
Reviewed-by: Nicolas Capens <nicolascapens@google.com>
Tested-by: Nicolas Capens <nicolascapens@google.com>
diff --git a/src/SwiftShader.sln b/src/SwiftShader.sln
index 050096a..9984441 100644
--- a/src/SwiftShader.sln
+++ b/src/SwiftShader.sln
@@ -227,6 +227,12 @@
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libGLES_CM", "GLES2\libGLES_CM\libGLES_CM.vcxproj", "{235B1D85-E6B6-45E2-BA5D-5C60396428FF}"
EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "OGLESBasicTnL", "..\tests\third_party\PowerVR\Examples\Beginner\04_BasicTnL\OGLES\Build\WindowsVC2010\OGLESBasicTnL.vcxproj", "{AB1EB229-D86C-41B3-8E20-7A7E1FF5DDF5}"
+ ProjectSection(ProjectDependencies) = postProject
+ {235B1D85-E6B6-45E2-BA5D-5C60396428FF} = {235B1D85-E6B6-45E2-BA5D-5C60396428FF}
+ {E746FCA9-64C3-433E-85E8-9A5A67AB7ED6} = {E746FCA9-64C3-433E-85E8-9A5A67AB7ED6}
+ EndProjectSection
+EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Win32 = Debug|Win32
@@ -606,6 +612,18 @@
{235B1D85-E6B6-45E2-BA5D-5C60396428FF}.Release|Win32.ActiveCfg = Release|Win32
{235B1D85-E6B6-45E2-BA5D-5C60396428FF}.Release|Win32.Build.0 = Release|Win32
{235B1D85-E6B6-45E2-BA5D-5C60396428FF}.Release|x64.ActiveCfg = Release|Win32
+ {AB1EB229-D86C-41B3-8E20-7A7E1FF5DDF5}.Debug|Win32.ActiveCfg = Debug|Win32
+ {AB1EB229-D86C-41B3-8E20-7A7E1FF5DDF5}.Debug|Win32.Build.0 = Debug|Win32
+ {AB1EB229-D86C-41B3-8E20-7A7E1FF5DDF5}.Debug|x64.ActiveCfg = Debug|x64
+ {AB1EB229-D86C-41B3-8E20-7A7E1FF5DDF5}.Debug|x64.Build.0 = Debug|x64
+ {AB1EB229-D86C-41B3-8E20-7A7E1FF5DDF5}.Profile|Win32.ActiveCfg = Release|Win32
+ {AB1EB229-D86C-41B3-8E20-7A7E1FF5DDF5}.Profile|Win32.Build.0 = Release|Win32
+ {AB1EB229-D86C-41B3-8E20-7A7E1FF5DDF5}.Profile|x64.ActiveCfg = Release|x64
+ {AB1EB229-D86C-41B3-8E20-7A7E1FF5DDF5}.Profile|x64.Build.0 = Release|x64
+ {AB1EB229-D86C-41B3-8E20-7A7E1FF5DDF5}.Release|Win32.ActiveCfg = Release|Win32
+ {AB1EB229-D86C-41B3-8E20-7A7E1FF5DDF5}.Release|Win32.Build.0 = Release|Win32
+ {AB1EB229-D86C-41B3-8E20-7A7E1FF5DDF5}.Release|x64.ActiveCfg = Release|x64
+ {AB1EB229-D86C-41B3-8E20-7A7E1FF5DDF5}.Release|x64.Build.0 = Release|x64
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
@@ -641,5 +659,6 @@
{9CF4408B-9B08-481F-95DA-3DF0846DABE4} = {ED25C308-5BDB-43A7-BED6-C2C059FC2D7D}
{09ABE661-9BC0-4152-A820-1FB0522CAC01} = {ED25C308-5BDB-43A7-BED6-C2C059FC2D7D}
{04FC5430-3F1B-42A2-A18A-D8BB7E5B2733} = {ED25C308-5BDB-43A7-BED6-C2C059FC2D7D}
+ {AB1EB229-D86C-41B3-8E20-7A7E1FF5DDF5} = {ED25C308-5BDB-43A7-BED6-C2C059FC2D7D}
EndGlobalSection
EndGlobal
diff --git a/tests/third_party/PowerVR/Builds/Windows/x86_32/Lib/libGLES_CM.lib b/tests/third_party/PowerVR/Builds/Windows/x86_32/Lib/libGLES_CM.lib
new file mode 100644
index 0000000..2f34077
--- /dev/null
+++ b/tests/third_party/PowerVR/Builds/Windows/x86_32/Lib/libGLES_CM.lib
Binary files differ
diff --git a/tests/third_party/PowerVR/Examples/Beginner/04_BasicTnL/BasicTnL.png b/tests/third_party/PowerVR/Examples/Beginner/04_BasicTnL/BasicTnL.png
new file mode 100644
index 0000000..307b1aa
--- /dev/null
+++ b/tests/third_party/PowerVR/Examples/Beginner/04_BasicTnL/BasicTnL.png
Binary files differ
diff --git a/tests/third_party/PowerVR/Examples/Beginner/04_BasicTnL/BasicTnL.txt b/tests/third_party/PowerVR/Examples/Beginner/04_BasicTnL/BasicTnL.txt
new file mode 100644
index 0000000..467314c
--- /dev/null
+++ b/tests/third_party/PowerVR/Examples/Beginner/04_BasicTnL/BasicTnL.txt
@@ -0,0 +1,20 @@
+:Title:
+BasicTnL
+
+:ShortDescription:
+This training course consists of a demonstration of basic transformation and lighting.
+
+:FullDescription:
+This training course consists of a demonstration of basic transformation and lighting, growing on the basic drawing techniques learnt in HelloTriangle.
+
+Controls:
+ - Esc - Close the application
+
+:VGP:
+Not Required
+
+:PolyCount:
+1
+
+:VertexCount:
+3
diff --git a/tests/third_party/PowerVR/Examples/Beginner/04_BasicTnL/OGLES/Build/WindowsVC2010/OGLESBasicTnL.vcxproj b/tests/third_party/PowerVR/Examples/Beginner/04_BasicTnL/OGLES/Build/WindowsVC2010/OGLESBasicTnL.vcxproj
new file mode 100644
index 0000000..c57474e
--- /dev/null
+++ b/tests/third_party/PowerVR/Examples/Beginner/04_BasicTnL/OGLES/Build/WindowsVC2010/OGLESBasicTnL.vcxproj
@@ -0,0 +1,171 @@
+<?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>
+ <PropertyGroup Label="Globals">
+ <ProjectGuid>{AB1EB229-D86C-41B3-8E20-7A7E1FF5DDF5}</ProjectGuid>
+ <RootNamespace>OGLESBasicTnL</RootNamespace>
+ </PropertyGroup>
+ <Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
+ <ConfigurationType>Application</ConfigurationType>
+ <UseDebugLibraries>true</UseDebugLibraries>
+ <CharacterSet>MultiByte</CharacterSet>
+ <PlatformToolset>v120</PlatformToolset>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
+ <ConfigurationType>Application</ConfigurationType>
+ <UseDebugLibraries>true</UseDebugLibraries>
+ <CharacterSet>MultiByte</CharacterSet>
+ <PlatformToolset>v120</PlatformToolset>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
+ <ConfigurationType>Application</ConfigurationType>
+ <UseDebugLibraries>false</UseDebugLibraries>
+ <WholeProgramOptimization>true</WholeProgramOptimization>
+ <CharacterSet>MultiByte</CharacterSet>
+ <PlatformToolset>v120</PlatformToolset>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
+ <ConfigurationType>Application</ConfigurationType>
+ <UseDebugLibraries>false</UseDebugLibraries>
+ <WholeProgramOptimization>true</WholeProgramOptimization>
+ <CharacterSet>MultiByte</CharacterSet>
+ <PlatformToolset>v120</PlatformToolset>
+ </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)'=='Release|Win32'">
+ <OutDir>$(SolutionDir)$(Configuration)\</OutDir>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
+ <OutDir>$(SolutionDir)$(Platform)\$(Configuration)\</OutDir>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
+ <OutDir>$(SolutionDir)$(Configuration)\</OutDir>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
+ <OutDir>$(SolutionDir)$(Platform)\$(Configuration)\</OutDir>
+ </PropertyGroup>
+ <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
+ <ClCompile>
+ <WarningLevel>Level3</WarningLevel>
+ <Optimization>Disabled</Optimization>
+ <PreprocessorDefinitions>BUILD_OGLES;_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ <AdditionalIncludeDirectories>..\..\..\..\..\..\Shell;..\..\..\..\..\..\Shell\API\KEGL;..\..\..\..\..\..\Shell\OS\Windows;..\..\..\..\..\..\Builds\Include;</AdditionalIncludeDirectories>
+ <RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>
+ <MultiProcessorCompilation>true</MultiProcessorCompilation>
+ <MinimalRebuild>false</MinimalRebuild>
+ </ClCompile>
+ <Link>
+ <GenerateDebugInformation>true</GenerateDebugInformation>
+ <AdditionalLibraryDirectories>..\..\..\..\..\..\Builds\Windows\x86_32\Lib;</AdditionalLibraryDirectories>
+ <AdditionalDependencies>libGLES_CM.lib;%(AdditionalDependencies)</AdditionalDependencies>
+ </Link>
+ </ItemDefinitionGroup>
+ <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
+ <ClCompile>
+ <WarningLevel>Level3</WarningLevel>
+ <Optimization>Disabled</Optimization>
+ <PreprocessorDefinitions>BUILD_OGLES;_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ <AdditionalIncludeDirectories>..\..\..\..\..\..\Shell;..\..\..\..\..\..\Shell\API\KEGL;..\..\..\..\..\..\Shell\OS\Windows;..\..\..\..\..\..\Builds\Include;</AdditionalIncludeDirectories>
+ <RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>
+ <MultiProcessorCompilation>true</MultiProcessorCompilation>
+ <MinimalRebuild>false</MinimalRebuild>
+ </ClCompile>
+ <Link>
+ <GenerateDebugInformation>true</GenerateDebugInformation>
+ <AdditionalLibraryDirectories>..\..\..\..\..\..\Builds\Windows\x86_64\Lib;</AdditionalLibraryDirectories>
+ <AdditionalDependencies>libGLES_CM.lib;%(AdditionalDependencies)</AdditionalDependencies>
+ </Link>
+ </ItemDefinitionGroup>
+ <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
+ <ClCompile>
+ <WarningLevel>Level3</WarningLevel>
+ <Optimization>MaxSpeed</Optimization>
+ <FunctionLevelLinking>true</FunctionLevelLinking>
+ <IntrinsicFunctions>true</IntrinsicFunctions>
+ <PreprocessorDefinitions>BUILD_OGLES;_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ <AdditionalIncludeDirectories>..\..\..\..\..\..\Shell;..\..\..\..\..\..\Shell\API\KEGL;..\..\..\..\..\..\Shell\OS\Windows;..\..\..\..\..\..\Builds\Include;</AdditionalIncludeDirectories>
+ <RuntimeLibrary>MultiThreaded</RuntimeLibrary>
+ <MultiProcessorCompilation>true</MultiProcessorCompilation>
+ <MinimalRebuild>false</MinimalRebuild>
+ </ClCompile>
+ <Link>
+ <GenerateDebugInformation>true</GenerateDebugInformation>
+ <EnableCOMDATFolding>true</EnableCOMDATFolding>
+ <OptimizeReferences>true</OptimizeReferences>
+ <AdditionalLibraryDirectories>..\..\..\..\..\..\Builds\Windows\x86_32\Lib;</AdditionalLibraryDirectories>
+ <AdditionalDependencies>libGLES_CM.lib;%(AdditionalDependencies)</AdditionalDependencies>
+ </Link>
+ </ItemDefinitionGroup>
+ <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
+ <ClCompile>
+ <WarningLevel>Level3</WarningLevel>
+ <Optimization>MaxSpeed</Optimization>
+ <FunctionLevelLinking>true</FunctionLevelLinking>
+ <IntrinsicFunctions>true</IntrinsicFunctions>
+ <PreprocessorDefinitions>BUILD_OGLES;_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ <AdditionalIncludeDirectories>..\..\..\..\..\..\Shell;..\..\..\..\..\..\Shell\API\KEGL;..\..\..\..\..\..\Shell\OS\Windows;..\..\..\..\..\..\Builds\Include;</AdditionalIncludeDirectories>
+ <RuntimeLibrary>MultiThreaded</RuntimeLibrary>
+ <MultiProcessorCompilation>true</MultiProcessorCompilation>
+ <MinimalRebuild>false</MinimalRebuild>
+ </ClCompile>
+ <Link>
+ <GenerateDebugInformation>true</GenerateDebugInformation>
+ <EnableCOMDATFolding>true</EnableCOMDATFolding>
+ <OptimizeReferences>true</OptimizeReferences>
+ <AdditionalLibraryDirectories>..\..\..\..\..\..\Builds\Windows\x86_64\Lib;</AdditionalLibraryDirectories>
+ <AdditionalDependencies>libGLES_CM.lib;%(AdditionalDependencies)</AdditionalDependencies>
+ </Link>
+ </ItemDefinitionGroup>
+ <ItemGroup>
+ <ClCompile Include="..\..\OGLESBasicTnL.cpp" />
+ <ClCompile Include="..\..\..\..\..\..\Shell\PVRShell.cpp" />
+ <ClCompile Include="..\..\..\..\..\..\Shell\API\KEGL\PVRShellAPI.cpp" />
+ <ClCompile Include="..\..\..\..\..\..\Shell\OS\Windows\PVRShellOS.cpp" />
+ </ItemGroup>
+ <ItemGroup>
+ <ClInclude Include="..\..\..\..\..\..\Shell\PVRShell.h" />
+ <ClInclude Include="..\..\..\..\..\..\Shell\PVRShellImpl.h" />
+ <ClInclude Include="..\..\..\..\..\..\Shell\API\KEGL\PVRShellAPI.h" />
+ <ClInclude Include="..\..\..\..\..\..\Shell\OS\Windows\PVRShellOS.h" />
+ <ClInclude Include="..\..\..\..\..\..\Builds\Windows\Resources\resource.h" />
+ </ItemGroup>
+ <ItemGroup>
+ <ResourceCompile Include="..\..\..\..\..\..\Builds\Windows\Resources\shared.rc" />
+ </ItemGroup>
+ <Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
+ <ImportGroup Label="ExtensionTargets">
+ </ImportGroup>
+</Project>
\ No newline at end of file
diff --git a/tests/third_party/PowerVR/Examples/Beginner/04_BasicTnL/OGLES/Build/WindowsVC2010/OGLESBasicTnL.vcxproj.filters b/tests/third_party/PowerVR/Examples/Beginner/04_BasicTnL/OGLES/Build/WindowsVC2010/OGLESBasicTnL.vcxproj.filters
new file mode 100644
index 0000000..0642f5d
--- /dev/null
+++ b/tests/third_party/PowerVR/Examples/Beginner/04_BasicTnL/OGLES/Build/WindowsVC2010/OGLESBasicTnL.vcxproj.filters
@@ -0,0 +1,58 @@
+<?xml version="1.0" encoding="utf-8"?>
+<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+ <ItemGroup>
+ <Filter Include="Source Files">
+ <UniqueIdentifier>{4FC737F1-C7A5-4376-A066-2A32D752A2FF}</UniqueIdentifier>
+ <Extensions>cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx</Extensions>
+ </Filter>
+ <Filter Include="Header Files">
+ <UniqueIdentifier>{93995380-89BD-4b04-88EB-625FBE52EBFB}</UniqueIdentifier>
+ <Extensions>h;hpp;hxx;hm;inl;inc;xsd</Extensions>
+ </Filter>
+ <Filter Include="Resource Files">
+ <UniqueIdentifier>{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}</UniqueIdentifier>
+ <Extensions>rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms</Extensions>
+ </Filter>
+ <Filter Include="Content Files">
+ <UniqueIdentifier>{900022e4-757a-46fb-bd53-6dfc20b3d893}</UniqueIdentifier>
+ </Filter>
+ </ItemGroup>
+ <ItemGroup>
+ <ClInclude Include="..\..\..\..\..\..\Shell\PVRShell.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ <ClInclude Include="..\..\..\..\..\..\Shell\PVRShellImpl.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ <ClInclude Include="..\..\..\..\..\..\Shell\API\KEGL\PVRShellAPI.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ <ClInclude Include="..\..\..\..\..\..\Shell\OS\Windows\PVRShellOS.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ <ClInclude Include="..\..\..\..\..\..\Builds\Windows\Resources\resource.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ </ItemGroup>
+ <ItemGroup>
+ <ResourceCompile Include="..\..\..\..\..\..\Builds\Windows\Resources\shared.rc">
+ <Filter>Resource Files</Filter>
+ </ResourceCompile>
+ </ItemGroup>
+ <ItemGroup>
+ <ClCompile Include="..\..\OGLESBasicTnL.cpp">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="..\..\..\..\..\..\Shell\PVRShell.cpp">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="..\..\..\..\..\..\Shell\API\KEGL\PVRShellAPI.cpp">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="..\..\..\..\..\..\Shell\OS\Windows\PVRShellOS.cpp">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ </ItemGroup>
+<ItemGroup>
+ </ItemGroup>
+</Project>
\ No newline at end of file
diff --git a/tests/third_party/PowerVR/Examples/Beginner/04_BasicTnL/OGLES/Build/WindowsVC2010/OGLESBasicTnL.vcxproj.user b/tests/third_party/PowerVR/Examples/Beginner/04_BasicTnL/OGLES/Build/WindowsVC2010/OGLESBasicTnL.vcxproj.user
new file mode 100644
index 0000000..2177463
--- /dev/null
+++ b/tests/third_party/PowerVR/Examples/Beginner/04_BasicTnL/OGLES/Build/WindowsVC2010/OGLESBasicTnL.vcxproj.user
@@ -0,0 +1,19 @@
+<?xml version="1.0" encoding="utf-8"?>
+<Project ToolsVersion="12.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
+ <LocalDebuggerEnvironment>PATH=$(SolutionDir)..\lib\$(Configuration)</LocalDebuggerEnvironment>
+ <DebuggerFlavor>WindowsLocalDebugger</DebuggerFlavor>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
+ <LocalDebuggerEnvironment>PATH=$(SolutionDir)..\lib\$(Configuration)</LocalDebuggerEnvironment>
+ <DebuggerFlavor>WindowsLocalDebugger</DebuggerFlavor>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
+ <LocalDebuggerEnvironment>PATH=$(SolutionDir)..\lib\$(Configuration)</LocalDebuggerEnvironment>
+ <DebuggerFlavor>WindowsLocalDebugger</DebuggerFlavor>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
+ <LocalDebuggerEnvironment>PATH=$(SolutionDir)..\lib\$(Configuration)</LocalDebuggerEnvironment>
+ <DebuggerFlavor>WindowsLocalDebugger</DebuggerFlavor>
+ </PropertyGroup>
+</Project>
\ No newline at end of file
diff --git a/tests/third_party/PowerVR/Examples/Beginner/04_BasicTnL/OGLES/OGLESBasicTnL.cpp b/tests/third_party/PowerVR/Examples/Beginner/04_BasicTnL/OGLES/OGLESBasicTnL.cpp
new file mode 100644
index 0000000..26ffd98
--- /dev/null
+++ b/tests/third_party/PowerVR/Examples/Beginner/04_BasicTnL/OGLES/OGLESBasicTnL.cpp
@@ -0,0 +1,265 @@
+/******************************************************************************
+
+ @File OGLESBasicTnL.cpp
+
+ @Title Shows basic transformations and lighting
+
+ @Version
+
+ @Copyright Copyright (c) Imagination Technologies Limited.
+
+ @Platform Independant
+
+ @Description Shows basic transformations and lighting
+
+******************************************************************************/
+#include "PVRShell.h"
+#include <math.h>
+
+#if defined(__APPLE__) && defined (TARGET_OS_IPHONE)
+#import <OpenGLES/ES1/gl.h>
+#import <OpenGLES/ES1/glext.h>
+#else
+#include <GLES/gl.h>
+#endif
+
+/******************************************************************************
+ Defines
+******************************************************************************/
+// Size of the texture we create
+const int g_i32TexSize = 128;
+
+/*!****************************************************************************
+ Class implementing the PVRShell functions.
+******************************************************************************/
+class OGLESBasicTnL : public PVRShell
+{
+ // Texture handle
+ GLuint m_ui32Texture;
+
+ // Angle to rotate the triangle
+ float m_fAngle;
+
+ // Vertex Buffer Object (VBO) handle
+ GLuint m_ui32Vbo;
+
+public:
+ virtual bool InitApplication();
+ virtual bool InitView();
+ virtual bool ReleaseView();
+ virtual bool QuitApplication();
+ virtual bool RenderScene();
+};
+
+
+/*!****************************************************************************
+ @Function InitApplication
+ @Return bool true if no error occured
+ @Description Code in InitApplication() will be called by PVRShell once per
+ run, before the rendering context is created.
+ Used to initialize variables that are not dependant on it
+ (e.g. external modules, loading meshes, etc.)
+ If the rendering context is lost, InitApplication() will
+ not be called again.
+******************************************************************************/
+bool OGLESBasicTnL::InitApplication()
+{
+ m_fAngle = 0;
+ return true;
+}
+
+/*!****************************************************************************
+ @Function QuitApplication
+ @Return bool true if no error occured
+ @Description Code in QuitApplication() will be called by PVRShell once per
+ run, just before exiting the program.
+ If the rendering context is lost, QuitApplication() will
+ not be called.
+******************************************************************************/
+bool OGLESBasicTnL::QuitApplication()
+{
+ return true;
+}
+
+/*!****************************************************************************
+ @Function InitView
+ @Return bool true if no error occured
+ @Description Code in InitView() will be called by PVRShell upon
+ initialization or after a change in the rendering context.
+ Used to initialize variables that are dependant on the rendering
+ context (e.g. textures, vertex buffers, etc.)
+******************************************************************************/
+bool OGLESBasicTnL::InitView()
+{
+ // Sets the clear color
+ glClearColor(0.6f, 0.8f, 1.0f, 1.0f);
+
+ // Enables texturing
+ glEnable(GL_TEXTURE_2D);
+
+ /*
+ Creates the texture.
+ Please refer to the training course "Texturing" for a detailed explanation.
+ */
+ glGenTextures(1, &m_ui32Texture);
+ glBindTexture(GL_TEXTURE_2D, m_ui32Texture);
+ GLuint* pTexData = new GLuint[g_i32TexSize*g_i32TexSize];
+
+ for(int i = 0; i < g_i32TexSize; ++i)
+ {
+ for(int j = 0; j < g_i32TexSize; ++j)
+ {
+ GLuint col = (255<<24) + ((255-j*2)<<16) + ((255-i)<<8) + (255-i*2);
+
+ if ( ((i*j)/8) % 2 )
+ col = 0xffff00ff;
+
+ pTexData[j*g_i32TexSize+i] = col;
+ }
+ }
+
+ glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA, g_i32TexSize, g_i32TexSize, 0, GL_RGBA, GL_UNSIGNED_BYTE, pTexData);
+ glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR );
+ glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR );
+
+ delete[] pTexData;
+
+ // Enables lighting and light 0
+ glEnable(GL_LIGHTING);
+ glEnable(GL_LIGHT0);
+
+ /*
+ Specifies the light direction.
+ If the 4th component is 0, it's a parallel light (the case here).
+ If the 4th component is not 0, it's a point light.
+ */
+ float aLightPosition[] = {0.0f,0.0f,1.0f,0.0f};
+
+ /*
+ Assigns the light direction to the light number 0.
+ This function allows you to set also the ambiant, diffuse,
+ specular, emission colors of the light as well as attenuation parameters.
+ We keep the other parameters to their default value in this demo.
+ */
+ glLightfv(GL_LIGHT0, GL_SPOT_DIRECTION, aLightPosition);
+
+ // Create VBO for the triangle from our data
+
+ // Interleaved vertex data
+ float afVertices[] = { -0.4f,-0.4f,0.0f, // Position
+ 0.0f,0.0f, // UV
+ 0,0,1, // Normal
+ 0.4f,-0.4f,0.0f,
+ 1.0f,0.0f,
+ 0,0,1,
+ 0.0f,0.4f,0.0f,
+ 0.5f,1.0f,
+ 0,0,1};
+
+ glGenBuffers(1, &m_ui32Vbo);
+
+ unsigned int uiSize = 3 * (sizeof(float) * 8); // 3 vertices * stride (8 verttypes per vertex)
+
+ // Bind the VBO
+ glBindBuffer(GL_ARRAY_BUFFER, m_ui32Vbo);
+
+ // Set the buffer's data
+ glBufferData(GL_ARRAY_BUFFER, uiSize, afVertices, GL_STATIC_DRAW);
+
+ // Unbind the VBO
+ glBindBuffer(GL_ARRAY_BUFFER, 0);
+
+ return true;
+}
+
+/*!****************************************************************************
+ @Function ReleaseView
+ @Return bool true if no error occured
+ @Description Code in ReleaseView() will be called by PVRShell when the
+ application quits or before a change in the rendering context.
+******************************************************************************/
+bool OGLESBasicTnL::ReleaseView()
+{
+ // Frees the texture
+ glDeleteTextures(1, &m_ui32Texture);
+
+ return true;
+}
+
+/*!****************************************************************************
+ @Function RenderScene
+ @Return bool true if no error occured
+ @Description Main rendering loop function of the program. The shell will
+ call this function every frame.
+ eglSwapBuffers() will be performed by PVRShell automatically.
+ PVRShell will also manage important OS events.
+ Will also manage relevent OS events. The user has access to
+ these events through an abstraction layer provided by PVRShell.
+******************************************************************************/
+bool OGLESBasicTnL::RenderScene()
+{
+ // Clears the color and depth buffer
+ glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
+
+ // Model view matrix
+ float aModelView[] =
+ {
+ (float)cos(m_fAngle), 0, (float)sin(m_fAngle), 0,
+ 0, 1, 0, 0,
+ -(float)sin(m_fAngle), 0, (float)cos(m_fAngle), 0,
+ 0, 0, 0, 1
+ };
+
+ // Sets the matrix mode to modify the Model View matrix
+ glMatrixMode(GL_MODELVIEW);
+
+ // Loads our matrix into OpenGL Model View matrix
+ glLoadMatrixf(aModelView);
+
+ // Increments the angle of the view
+ m_fAngle += .02f;
+
+ /*
+ Draw a triangle.
+ Please refer to the training course IntroducingPVRShell for a detailed explanation.
+ */
+
+ // bind the VBO for the triangle
+ glBindBuffer(GL_ARRAY_BUFFER, m_ui32Vbo);
+
+ glEnableClientState(GL_VERTEX_ARRAY);
+ glVertexPointer(3,GL_FLOAT,sizeof(float) * 8, 0);
+
+ // Pass the texture coordinates data
+ glEnableClientState(GL_TEXTURE_COORD_ARRAY);
+ glTexCoordPointer(2,GL_FLOAT,sizeof(float) * 8, (unsigned char*) (sizeof(float) * 3));
+
+ // Pass the normals data
+ glEnableClientState(GL_NORMAL_ARRAY);
+ glNormalPointer(GL_FLOAT,sizeof(float) * 8, (unsigned char*) (sizeof(float) * 5));
+
+ // Draws a non-indexed triangle array
+ glDrawArrays(GL_TRIANGLES, 0, 3);
+
+ // unbind the vertex buffer as we don't need it bound anymore
+ glBindBuffer(GL_ARRAY_BUFFER, 0);
+
+ return true;
+}
+
+/*!****************************************************************************
+ @Function NewDemo
+ @Return PVRShell* The demo supplied by the user
+ @Description This function must be implemented by the user of the shell.
+ The user should return its PVRShell object defining the
+ behaviour of the application.
+******************************************************************************/
+PVRShell* NewDemo()
+{
+ return new OGLESBasicTnL();
+}
+
+/******************************************************************************
+ End of file (OGLESBasicTnL.cpp)
+******************************************************************************/
+