Browse Source

Merge branch 'next' of https://github.com/blackberry/GamePlay into next

Conflicts:
	gameplay/src/TextBox.cpp
sgrenier 12 years ago
parent
commit
f3eefead60
72 changed files with 1236 additions and 107 deletions
  1. 1 1
      CMakeLists.txt
  2. 3 3
      README.md
  3. 2 2
      gameplay.sln
  4. 4 0
      gameplay/CMakeLists.txt
  5. 3 1
      gameplay/android/jni/Android.mk
  6. 11 1
      gameplay/gameplay.vcxproj
  7. 12 0
      gameplay/gameplay.vcxproj.filters
  8. 24 0
      gameplay/gameplay.xcodeproj/project.pbxproj
  9. 2 2
      gameplay/src/Button.cpp
  10. 3 6
      gameplay/src/CheckBox.cpp
  11. 3 0
      gameplay/src/Container.cpp
  12. 8 0
      gameplay/src/Control.cpp
  13. 24 0
      gameplay/src/FrameBuffer.cpp
  14. 18 0
      gameplay/src/FrameBuffer.h
  15. 30 0
      gameplay/src/Image.cpp
  16. 12 0
      gameplay/src/Image.h
  17. 5 1
      gameplay/src/PlatformAndroid.cpp
  18. 262 1
      gameplay/src/RenderState.cpp
  19. 87 0
      gameplay/src/RenderState.h
  20. 1 0
      gameplay/src/ScriptController.cpp
  21. 1 0
      gameplay/src/ScriptController.inl
  22. 3 0
      gameplay/src/Slider.cpp
  23. 8 4
      gameplay/src/SpriteBatch.cpp
  24. 20 11
      gameplay/src/TextBox.cpp
  25. 1 1
      gameplay/src/Texture.cpp
  26. 1 1
      gameplay/src/Texture.h
  27. 79 0
      gameplay/src/lua/lua_FrameBuffer.cpp
  28. 2 0
      gameplay/src/lua/lua_FrameBuffer.h
  29. 32 0
      gameplay/src/lua/lua_Global.cpp
  30. 2 0
      gameplay/src/lua/lua_Global.h
  31. 101 16
      gameplay/src/lua/lua_Image.cpp
  32. 2 0
      gameplay/src/lua/lua_Material.cpp
  33. 2 0
      gameplay/src/lua/lua_Pass.cpp
  34. 2 0
      gameplay/src/lua/lua_RenderState.cpp
  35. 166 0
      gameplay/src/lua/lua_RenderStateStateBlock.cpp
  36. 4 0
      gameplay/src/lua/lua_RenderStateStateBlock.h
  37. 61 0
      gameplay/src/lua/lua_RenderStateStencilFunction.cpp
  38. 15 0
      gameplay/src/lua/lua_RenderStateStencilFunction.h
  39. 61 0
      gameplay/src/lua/lua_RenderStateStencilOperation.cpp
  40. 15 0
      gameplay/src/lua/lua_RenderStateStencilOperation.h
  41. 2 0
      gameplay/src/lua/lua_Technique.cpp
  42. 1 1
      samples/browser/android/jni/Android.mk
  43. 2 1
      samples/browser/android/jni/Application.mk
  44. 6 0
      samples/browser/sample-browser.vcxproj
  45. 1 1
      samples/character/android/jni/Android.mk
  46. 3 1
      samples/character/android/jni/Application.mk
  47. 6 0
      samples/character/sample-character.vcxproj
  48. 1 1
      samples/longboard/android/jni/Android.mk
  49. 3 1
      samples/longboard/android/jni/Application.mk
  50. 6 0
      samples/longboard/sample-longboard.vcxproj
  51. 1 1
      samples/lua/android/jni/Android.mk
  52. 3 1
      samples/lua/android/jni/Application.mk
  53. 6 0
      samples/lua/sample-lua.vcxproj
  54. 1 1
      samples/mesh/android/jni/Android.mk
  55. 3 1
      samples/mesh/android/jni/Application.mk
  56. 6 0
      samples/mesh/sample-mesh.vcxproj
  57. 1 3
      samples/mesh/sample-mesh.vcxproj.filters
  58. 1 1
      samples/particles/android/jni/Android.mk
  59. 3 1
      samples/particles/android/jni/Application.mk
  60. 6 0
      samples/particles/sample-particles.vcxproj
  61. 1 1
      samples/racer/android/jni/Android.mk
  62. 3 1
      samples/racer/android/jni/Application.mk
  63. 6 0
      samples/racer/sample-racer.vcxproj
  64. 1 1
      samples/spaceship/android/jni/Android.mk
  65. 3 1
      samples/spaceship/android/jni/Application.mk
  66. 6 0
      samples/spaceship/sample-spaceship.vcxproj
  67. 7 0
      template/template.vcxproj
  68. 3 3
      tools/encoder/CMakeLists.txt
  69. 9 7
      tools/encoder/gameplay-encoder.vcxproj
  70. 39 26
      tools/encoder/gameplay-encoder.xcodeproj/project.pbxproj
  71. 1 1
      tools/encoder/src/FBXSceneEncoder.cpp
  72. 2 0
      tools/luagen/gameplay-luagen.vcxproj

+ 1 - 1
CMakeLists.txt

@@ -2,7 +2,7 @@ cmake_minimum_required(VERSION 2.6)
 
 project(GamePlay)
 
-set(GAMEPLAY_VERSION 1.6.0)
+set(GAMEPLAY_VERSION 1.7.0)
 set(CMAKE_C_COMPILER_INIT g++)
 
 # debug

+ 3 - 3
README.md

@@ -1,4 +1,4 @@
-## gameplay v1.7.0
+## gameplay v1.8.0
 
 GamePlay3D is an open-source, cross-platform 3D native C++ game framework making it easy to learn and write mobile and desktop games. 
 
@@ -16,12 +16,12 @@ GamePlay3D is an open-source, cross-platform 3D native C++ game framework making
 - [Google Android 2.3+](https://github.com/blackberry/GamePlay/wiki/Android-NDK-Setup) (using Google Android NDK)
 
 ## Supported Desktop Platforms
-- [Microsoft Windows 7](https://github.com/blackberry/GamePlay/wiki/Visual-Studio-Setup) (using Microsoft Visual Studio 2010)
+- [Microsoft Windows 7](https://github.com/blackberry/GamePlay/wiki/Visual-Studio-Setup) (using Microsoft Visual Studio 2012)
 - [Apple MacOS X](https://github.com/blackberry/GamePlay/wiki/Apple-Xcode-Setup) (using Apple XCode 4)
 - [Linux](https://github.com/blackberry/GamePlay/wiki/Linux-Setup) (using CMake)
 
 ## Roadmap for 'next' branch
-- [Version 2.0.0 Milestone](https://github.com/blackberry/GamePlay/issues?milestone=6)
+- [backlog](https://github.com/blackberry/GamePlay/issues?milestone=7)
 
 ## License
 The project is open sourced under the [Apache 2.0 license](http://www.tldrlegal.com/license/apache-license-2.0-%28apache-2.0%29).

+ 2 - 2
gameplay.sln

@@ -1,6 +1,6 @@
 
-Microsoft Visual Studio Solution File, Format Version 11.00
-# Visual Studio 2010
+Microsoft Visual Studio Solution File, Format Version 12.00
+# Visual Studio 2012
 Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "gameplay", "gameplay\gameplay.vcxproj", "{1032BA4B-57EB-4348-9E03-29DD63E80E4A}"
 EndProject
 Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "sample-browser", "samples\browser\sample-browser.vcxproj", "{0F27C8C4-58B2-E367-8D1F-01B714FDBF1B}"

+ 4 - 0
gameplay/CMakeLists.txt

@@ -497,6 +497,10 @@ set(GAMEPLAY_LUA
     src/lua/lua_RenderStateDepthFunction.h
     src/lua/lua_RenderStateStateBlock.cpp
     src/lua/lua_RenderStateStateBlock.h
+    src/lua/lua_RenderStateStencilFunction.cpp
+    src/lua/lua_RenderStateStencilFunction.h
+    src/lua/lua_RenderStateStencilOperation.cpp
+    src/lua/lua_RenderStateStencilOperation.h
     src/lua/lua_RenderTarget.cpp
     src/lua/lua_RenderTarget.h
     src/lua/lua_Scene.cpp

+ 3 - 1
gameplay/android/jni/Android.mk

@@ -41,7 +41,7 @@ LOCAL_SRC_FILES := \
     Gamepad.cpp \
     HeightField.cpp \
     Image.cpp \
-	ImageControl.cpp \
+    ImageControl.cpp \
     Joint.cpp \
     Joystick.cpp \
     Label.cpp \
@@ -240,6 +240,8 @@ LOCAL_SRC_FILES := \
     lua/lua_RenderStateCullFaceSide.cpp \
     lua/lua_RenderStateDepthFunction.cpp \
     lua/lua_RenderStateStateBlock.cpp \
+    lua/lua_RenderStateStencilFunction.cpp \
+    lua/lua_RenderStateStencilOperation.cpp \
     lua/lua_RenderTarget.cpp \
     lua/lua_Scene.cpp \
     lua/lua_SceneDebugFlags.cpp \

+ 11 - 1
gameplay/gameplay.vcxproj

@@ -232,6 +232,8 @@
     <ClCompile Include="src\lua\lua_RenderStateCullFaceSide.cpp" />
     <ClCompile Include="src\lua\lua_RenderStateDepthFunction.cpp" />
     <ClCompile Include="src\lua\lua_RenderStateStateBlock.cpp" />
+    <ClCompile Include="src\lua\lua_RenderStateStencilFunction.cpp" />
+    <ClCompile Include="src\lua\lua_RenderStateStencilOperation.cpp" />
     <ClCompile Include="src\lua\lua_RenderTarget.cpp" />
     <ClCompile Include="src\lua\lua_Scene.cpp" />
     <ClCompile Include="src\lua\lua_SceneDebugFlags.cpp" />
@@ -514,6 +516,8 @@
     <ClInclude Include="src\lua\lua_RenderStateCullFaceSide.h" />
     <ClInclude Include="src\lua\lua_RenderStateDepthFunction.h" />
     <ClInclude Include="src\lua\lua_RenderStateStateBlock.h" />
+    <ClInclude Include="src\lua\lua_RenderStateStencilFunction.h" />
+    <ClInclude Include="src\lua\lua_RenderStateStencilOperation.h" />
     <ClInclude Include="src\lua\lua_RenderTarget.h" />
     <ClInclude Include="src\lua\lua_Scene.h" />
     <ClInclude Include="src\lua\lua_SceneDebugFlags.h" />
@@ -680,11 +684,13 @@
     <ConfigurationType>StaticLibrary</ConfigurationType>
     <UseDebugLibraries>true</UseDebugLibraries>
     <CharacterSet>Unicode</CharacterSet>
+    <PlatformToolset>v110</PlatformToolset>
   </PropertyGroup>
   <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
     <ConfigurationType>StaticLibrary</ConfigurationType>
     <UseDebugLibraries>true</UseDebugLibraries>
     <CharacterSet>Unicode</CharacterSet>
+    <PlatformToolset>v110</PlatformToolset>
   </PropertyGroup>
   <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|BlackBerry'" Label="Configuration">
     <ConfigurationType>StaticLibrary</ConfigurationType>
@@ -700,11 +706,13 @@
     <ConfigurationType>StaticLibrary</ConfigurationType>
     <UseDebugLibraries>true</UseDebugLibraries>
     <CharacterSet>Unicode</CharacterSet>
+    <PlatformToolset>v110</PlatformToolset>
   </PropertyGroup>
   <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='DebugMem|x64'" Label="Configuration">
     <ConfigurationType>StaticLibrary</ConfigurationType>
     <UseDebugLibraries>true</UseDebugLibraries>
     <CharacterSet>Unicode</CharacterSet>
+    <PlatformToolset>v110</PlatformToolset>
   </PropertyGroup>
   <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='DebugMem|BlackBerry'" Label="Configuration">
     <ConfigurationType>StaticLibrary</ConfigurationType>
@@ -721,12 +729,14 @@
     <UseDebugLibraries>false</UseDebugLibraries>
     <WholeProgramOptimization>true</WholeProgramOptimization>
     <CharacterSet>Unicode</CharacterSet>
+    <PlatformToolset>v110</PlatformToolset>
   </PropertyGroup>
   <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
     <ConfigurationType>StaticLibrary</ConfigurationType>
     <UseDebugLibraries>false</UseDebugLibraries>
     <WholeProgramOptimization>true</WholeProgramOptimization>
     <CharacterSet>Unicode</CharacterSet>
+    <PlatformToolset>v110</PlatformToolset>
   </PropertyGroup>
   <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|BlackBerry'" Label="Configuration">
     <ConfigurationType>StaticLibrary</ConfigurationType>
@@ -1098,4 +1108,4 @@
   <Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
   <ImportGroup Label="ExtensionTargets">
   </ImportGroup>
-</Project>
+</Project>

+ 12 - 0
gameplay/gameplay.vcxproj.filters

@@ -855,6 +855,12 @@
     <ClCompile Include="src\lua\lua_TextBoxInputMode.cpp">
       <Filter>src\lua</Filter>
     </ClCompile>
+    <ClCompile Include="src\lua\lua_RenderStateStencilFunction.cpp">
+      <Filter>src\lua</Filter>
+    </ClCompile>
+    <ClCompile Include="src\lua\lua_RenderStateStencilOperation.cpp">
+      <Filter>src\lua</Filter>
+    </ClCompile>
   </ItemGroup>
   <ItemGroup>
     <ClInclude Include="src\Animation.h">
@@ -1697,6 +1703,12 @@
     <ClInclude Include="src\lua\lua_TextBoxInputMode.h">
       <Filter>src\lua</Filter>
     </ClInclude>
+    <ClInclude Include="src\lua\lua_RenderStateStencilFunction.h">
+      <Filter>src\lua</Filter>
+    </ClInclude>
+    <ClInclude Include="src\lua\lua_RenderStateStencilOperation.h">
+      <Filter>src\lua</Filter>
+    </ClInclude>
   </ItemGroup>
   <ItemGroup>
     <None Include="src\Game.inl">

+ 24 - 0
gameplay/gameplay.xcodeproj/project.pbxproj

@@ -1155,6 +1155,14 @@
 		BD26373616CF865B00CFE15F /* Vector2.inl in Headers */ = {isa = PBXBuildFile; fileRef = 42CD0E39147D8FF50000361E /* Vector2.inl */; settings = {ATTRIBUTES = (Public, ); }; };
 		BD26373716CF865B00CFE15F /* Vector3.inl in Headers */ = {isa = PBXBuildFile; fileRef = 42CD0E3C147D8FF50000361E /* Vector3.inl */; settings = {ATTRIBUTES = (Public, ); }; };
 		BD26373816CF865B00CFE15F /* Vector4.inl in Headers */ = {isa = PBXBuildFile; fileRef = 42CD0E3F147D8FF50000361E /* Vector4.inl */; settings = {ATTRIBUTES = (Public, ); }; };
+		C01405151765345800B9FFB1 /* lua_RenderStateStencilFunction.cpp in Sources */ = {isa = PBXBuildFile; fileRef = C01405111765345800B9FFB1 /* lua_RenderStateStencilFunction.cpp */; };
+		C01405161765345800B9FFB1 /* lua_RenderStateStencilFunction.cpp in Sources */ = {isa = PBXBuildFile; fileRef = C01405111765345800B9FFB1 /* lua_RenderStateStencilFunction.cpp */; };
+		C01405171765345800B9FFB1 /* lua_RenderStateStencilFunction.h in Headers */ = {isa = PBXBuildFile; fileRef = C01405121765345800B9FFB1 /* lua_RenderStateStencilFunction.h */; };
+		C01405181765345800B9FFB1 /* lua_RenderStateStencilFunction.h in Headers */ = {isa = PBXBuildFile; fileRef = C01405121765345800B9FFB1 /* lua_RenderStateStencilFunction.h */; };
+		C01405191765345800B9FFB1 /* lua_RenderStateStencilOperation.cpp in Sources */ = {isa = PBXBuildFile; fileRef = C01405131765345800B9FFB1 /* lua_RenderStateStencilOperation.cpp */; };
+		C014051A1765345800B9FFB1 /* lua_RenderStateStencilOperation.cpp in Sources */ = {isa = PBXBuildFile; fileRef = C01405131765345800B9FFB1 /* lua_RenderStateStencilOperation.cpp */; };
+		C014051B1765345800B9FFB1 /* lua_RenderStateStencilOperation.h in Headers */ = {isa = PBXBuildFile; fileRef = C01405141765345800B9FFB1 /* lua_RenderStateStencilOperation.h */; };
+		C014051C1765345800B9FFB1 /* lua_RenderStateStencilOperation.h in Headers */ = {isa = PBXBuildFile; fileRef = C01405141765345800B9FFB1 /* lua_RenderStateStencilOperation.h */; };
 		C054CBE5172EF541000B7DC3 /* lua_RenderStateCullFaceSide.cpp in Sources */ = {isa = PBXBuildFile; fileRef = C054CBE3172EF541000B7DC3 /* lua_RenderStateCullFaceSide.cpp */; };
 		C054CBE6172EF541000B7DC3 /* lua_RenderStateCullFaceSide.cpp in Sources */ = {isa = PBXBuildFile; fileRef = C054CBE3172EF541000B7DC3 /* lua_RenderStateCullFaceSide.cpp */; };
 		C054CBE7172EF541000B7DC3 /* lua_RenderStateCullFaceSide.h in Headers */ = {isa = PBXBuildFile; fileRef = C054CBE4172EF541000B7DC3 /* lua_RenderStateCullFaceSide.h */; };
@@ -1774,6 +1782,10 @@
 		BD2636E216CF5B7400CFE15F /* OpenGLES.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = OpenGLES.framework; path = Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS6.1.sdk/System/Library/Frameworks/OpenGLES.framework; sourceTree = DEVELOPER_DIR; };
 		BD2636E316CF5B7400CFE15F /* QuartzCore.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = QuartzCore.framework; path = Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS6.1.sdk/System/Library/Frameworks/QuartzCore.framework; sourceTree = DEVELOPER_DIR; };
 		BD2636E416CF5B7400CFE15F /* UIKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = UIKit.framework; path = Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS6.1.sdk/System/Library/Frameworks/UIKit.framework; sourceTree = DEVELOPER_DIR; };
+		C01405111765345800B9FFB1 /* lua_RenderStateStencilFunction.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = lua_RenderStateStencilFunction.cpp; sourceTree = "<group>"; };
+		C01405121765345800B9FFB1 /* lua_RenderStateStencilFunction.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = lua_RenderStateStencilFunction.h; sourceTree = "<group>"; };
+		C01405131765345800B9FFB1 /* lua_RenderStateStencilOperation.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = lua_RenderStateStencilOperation.cpp; sourceTree = "<group>"; };
+		C01405141765345800B9FFB1 /* lua_RenderStateStencilOperation.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = lua_RenderStateStencilOperation.h; sourceTree = "<group>"; };
 		C054CBE3172EF541000B7DC3 /* lua_RenderStateCullFaceSide.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = lua_RenderStateCullFaceSide.cpp; sourceTree = "<group>"; };
 		C054CBE4172EF541000B7DC3 /* lua_RenderStateCullFaceSide.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = lua_RenderStateCullFaceSide.h; sourceTree = "<group>"; };
 		C07A67471742988E00D65C04 /* lua_TextBoxInputMode.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = lua_TextBoxInputMode.cpp; sourceTree = "<group>"; };
@@ -2359,6 +2371,10 @@
 				B661732E16A61A4B0083A307 /* lua_RenderStateDepthFunction.h */,
 				42BCD41515EFD0F300C0E076 /* lua_RenderStateStateBlock.cpp */,
 				42BCD41615EFD0F300C0E076 /* lua_RenderStateStateBlock.h */,
+				C01405111765345800B9FFB1 /* lua_RenderStateStencilFunction.cpp */,
+				C01405121765345800B9FFB1 /* lua_RenderStateStencilFunction.h */,
+				C01405131765345800B9FFB1 /* lua_RenderStateStencilOperation.cpp */,
+				C01405141765345800B9FFB1 /* lua_RenderStateStencilOperation.h */,
 				42BCD41715EFD0F300C0E076 /* lua_RenderTarget.cpp */,
 				42BCD41815EFD0F300C0E076 /* lua_RenderTarget.h */,
 				42BCD41915EFD0F300C0E076 /* lua_Scene.cpp */,
@@ -2810,6 +2826,8 @@
 				42A5031F16E8F0B800F0246C /* lua_TerrainListener.h in Headers */,
 				C054CBE7172EF541000B7DC3 /* lua_RenderStateCullFaceSide.h in Headers */,
 				C07A674B1742988E00D65C04 /* lua_TextBoxInputMode.h in Headers */,
+				C01405171765345800B9FFB1 /* lua_RenderStateStencilFunction.h in Headers */,
+				C014051B1765345800B9FFB1 /* lua_RenderStateStencilOperation.h in Headers */,
 			);
 			runOnlyForDeploymentPostprocessing = 0;
 		};
@@ -3118,6 +3136,8 @@
 				42A5032016E8F0B800F0246C /* lua_TerrainListener.h in Headers */,
 				C054CBE8172EF541000B7DC3 /* lua_RenderStateCullFaceSide.h in Headers */,
 				C07A674C1742988E00D65C04 /* lua_TextBoxInputMode.h in Headers */,
+				C01405181765345800B9FFB1 /* lua_RenderStateStencilFunction.h in Headers */,
+				C014051C1765345800B9FFB1 /* lua_RenderStateStencilOperation.h in Headers */,
 			);
 			runOnlyForDeploymentPostprocessing = 0;
 		};
@@ -3495,6 +3515,8 @@
 				42A5031D16E8F0B800F0246C /* lua_TerrainListener.cpp in Sources */,
 				C054CBE5172EF541000B7DC3 /* lua_RenderStateCullFaceSide.cpp in Sources */,
 				C07A67491742988E00D65C04 /* lua_TextBoxInputMode.cpp in Sources */,
+				C01405151765345800B9FFB1 /* lua_RenderStateStencilFunction.cpp in Sources */,
+				C01405191765345800B9FFB1 /* lua_RenderStateStencilOperation.cpp in Sources */,
 			);
 			runOnlyForDeploymentPostprocessing = 0;
 		};
@@ -3777,6 +3799,8 @@
 				42A5031E16E8F0B800F0246C /* lua_TerrainListener.cpp in Sources */,
 				C054CBE6172EF541000B7DC3 /* lua_RenderStateCullFaceSide.cpp in Sources */,
 				C07A674A1742988E00D65C04 /* lua_TextBoxInputMode.cpp in Sources */,
+				C01405161765345800B9FFB1 /* lua_RenderStateStencilFunction.cpp in Sources */,
+				C014051A1765345800B9FFB1 /* lua_RenderStateStencilOperation.cpp in Sources */,
 			);
 			runOnlyForDeploymentPostprocessing = 0;
 		};

+ 2 - 2
gameplay/src/Button.cpp

@@ -50,8 +50,8 @@ bool Button::touchEvent(Touch::TouchEvent evt, int x, int y, unsigned int contac
                 y > _clipBounds.y && y <= _clipBounds.y + _clipBounds.height)
             {
                 _contactIndex = (int) contactIndex;
-                notifyListeners(Control::Listener::PRESS);
                 setState(Control::ACTIVE);
+                notifyListeners(Control::Listener::PRESS);
                 return _consumeInputEvents;
             }
             else
@@ -70,8 +70,8 @@ bool Button::touchEvent(Touch::TouchEvent evt, int x, int y, unsigned int contac
                 x > _clipBounds.x && x <= _clipBounds.x + _clipBounds.width &&
                 y > _clipBounds.y && y <= _clipBounds.y + _clipBounds.height)
             {
-                notifyListeners(Control::Listener::CLICK);
                 setState(Control::FOCUS);
+                notifyListeners(Control::Listener::CLICK);
             }
             else
             {

+ 3 - 6
gameplay/src/CheckBox.cpp

@@ -85,8 +85,7 @@ bool CheckBox::touchEvent(Touch::TouchEvent evt, int x, int y, unsigned int cont
                 x > _clipBounds.x && x <= _clipBounds.x + _clipBounds.width &&
                 y > _clipBounds.y && y <= _clipBounds.y + _clipBounds.height)
             {
-                _checked = !_checked;
-                notifyListeners(Control::Listener::VALUE_CHANGED);
+                setChecked( !_checked );
             }
         }
         break;
@@ -104,8 +103,7 @@ bool CheckBox::gamepadEvent(Gamepad::GamepadEvent evt, Gamepad* gamepad, unsigne
             if (!gamepad->isButtonDown(Gamepad::BUTTON_A) &&
                 !gamepad->isButtonDown(Gamepad::BUTTON_X))
             {
-                _checked = !_checked;
-                notifyListeners(Control::Listener::VALUE_CHANGED);   
+                setChecked( !_checked );
             }
         }
         break;
@@ -118,8 +116,7 @@ bool CheckBox::keyEvent(Keyboard::KeyEvent evt, int key)
 {
     if (_state == ACTIVE && evt == Keyboard::KEY_RELEASE && key == Keyboard::KEY_RETURN)
     {
-        _checked = !_checked;
-        notifyListeners(Control::Listener::VALUE_CHANGED);
+        setChecked( !_checked );
     }
 
     return Button::keyEvent(evt, key);

+ 3 - 0
gameplay/src/Container.cpp

@@ -502,7 +502,10 @@ void Container::draw(SpriteBatch* spriteBatch, const Rectangle& clip, bool needs
     }
 
     if (!_visible)
+    {
+        _dirty = false;
         return;
+    }
 
     spriteBatch->start();
     Control::drawBorder(spriteBatch, clip);

+ 8 - 0
gameplay/src/Control.cpp

@@ -90,6 +90,11 @@ void Control::initialize(Theme::Style* style, Properties* properties)
     if (id)
         _id = id;
 
+    if (properties->exists("enabled"))
+    {
+        setEnabled(properties->getBool("enabled"));
+    }
+
     // Potentially override themed properties for all states.
     overrideThemedProperties(properties, STATE_ALL);
 
@@ -1132,7 +1137,10 @@ void Control::draw(SpriteBatch* spriteBatch, const Rectangle& clip, bool needsCl
     }
 
     if (!_visible)
+    {
+        _dirty = false;
         return;
+    }
 
     spriteBatch->start();
     drawBorder(spriteBatch, clip);

+ 24 - 0
gameplay/src/FrameBuffer.cpp

@@ -269,6 +269,30 @@ FrameBuffer* FrameBuffer::bind()
     return previousFrameBuffer;
 }
 
+void FrameBuffer::getScreenshot(Image* image)
+{
+	//While possible to have a non-static getScreenshot function, it would require the expensive operation 
+	//of binding the FrameBuffer, reading the pixels, then rebinding the original FrameBuffer. This is faster.(
+
+	GP_ASSERT(image);
+	GP_ASSERT(image->getFormat() == Image::RGBA);
+
+	unsigned int width = _currentFrameBuffer->getWidth();
+	unsigned int height = _currentFrameBuffer->getHeight();
+
+	if (image->getWidth() == width && image->getHeight() == height)
+		GL_ASSERT( glReadPixels(0, 0, width, height, GL_RGBA, GL_UNSIGNED_BYTE, image->getData()) );
+}
+
+Image* FrameBuffer::createScreenshot()
+{
+	Image* screenshot = Image::create(_currentFrameBuffer->getWidth(), _currentFrameBuffer->getHeight(), Image::RGBA, NULL);
+
+	getScreenshot(screenshot);
+
+	return screenshot;
+}
+
 FrameBuffer* FrameBuffer::bindDefault()
 {
     GL_ASSERT( glBindFramebuffer(GL_FRAMEBUFFER, _defaultFrameBuffer->_handle) );

+ 18 - 0
gameplay/src/FrameBuffer.h

@@ -4,6 +4,7 @@
 #include "Base.h"
 #include "RenderTarget.h"
 #include "DepthStencilTarget.h"
+#include "Image.h"
 
 namespace gameplay
 {
@@ -151,6 +152,23 @@ public:
      */
     FrameBuffer* bind();
 
+	/**
+	 * Records a screenshot of what is stored on the current FrameBuffer.
+	 * 
+	 * @return A screenshot of the current framebuffer's content.
+	 */
+	static Image* createScreenshot();
+
+	/**
+	 * Records a screenshot of what is stored on the current FrameBuffer to an Image.
+	 * 
+	 * The Image must be the same size as the FrameBuffer, otherwise the operation will fail.
+	 * The Image must be format RGBA.
+	 * 
+	 * @param image The Image to write the current framebuffer's content to.
+	 */
+	static void getScreenshot(Image* image);
+
     /**
      * Binds the default FrameBuffer for rendering to the display.
      *

+ 30 - 0
gameplay/src/Image.cpp

@@ -107,6 +107,36 @@ Image* Image::create(const char* path)
     return image;
 }
 
+Image* Image::create(unsigned int width, unsigned int height, Image::Format format, unsigned char* data)
+{
+	GP_ASSERT(width > 0 && height > 0);
+	GP_ASSERT(format >= RGB && format <= RGBA);
+
+	unsigned int pixelSize = 0;
+	switch(format)
+	{
+	case Image::RGB:
+		pixelSize = 3;
+		break;
+	case Image::RGBA:
+		pixelSize = 4;
+		break;
+	}
+
+	Image* image = new Image();
+
+	unsigned int dataSize = width * height * pixelSize;
+
+	image->_width = width;
+	image->_height = height;
+	image->_format = format;
+	image->_data = new unsigned char[dataSize];
+	if (data)
+		memcpy(image->_data, data, dataSize);
+
+	return image;
+}
+
 Image::Image()
 {
     // Unused

+ 12 - 0
gameplay/src/Image.h

@@ -31,6 +31,18 @@ public:
      */
     static Image* create(const char* path);
 
+	/**
+     * Creates an image from the data provided
+     * 
+     * @param width The width of the image data.
+	 * @param height The height of the image data.
+	 * @param format The format of the image data.
+	 * @param data The image data. If NULL, the data will be allocated.
+     * @return The newly created image.
+     * @script{create}
+     */
+	static Image* create(unsigned int width, unsigned int height, Format format, unsigned char* data = NULL);
+
     /**
      * Gets the image's raw pixel data.
      * 

+ 5 - 1
gameplay/src/PlatformAndroid.cpp

@@ -555,6 +555,8 @@ static Keyboard::Key getKey(int keycode, int metastate)
             return Keyboard::KEY_MENU;
         case AKEYCODE_SEARCH:
             return Keyboard::KEY_SEARCH;
+        case AKEYCODE_BACK:
+            return Keyboard::KEY_ESCAPE;
         default:
             return Keyboard::KEY_NONE;
     }
@@ -872,7 +874,7 @@ static int32_t engine_handle_input(struct android_app* app, AInputEvent* event)
         int32_t action = AKeyEvent_getAction(event);
         int32_t keycode = AKeyEvent_getKeyCode(event);
         int32_t metastate = AKeyEvent_getMetaState(event); 
-        
+
         switch(action)
         {
             case AKEY_EVENT_ACTION_DOWN:
@@ -885,6 +887,8 @@ static int32_t engine_handle_input(struct android_app* app, AInputEvent* event)
                 gameplay::Platform::keyEventInternal(Keyboard::KEY_RELEASE, getKey(keycode, metastate));
                 break;
         }
+
+        return 1;
     }
     return 0;
 }

+ 262 - 1
gameplay/src/RenderState.cpp

@@ -14,6 +14,12 @@
 #define RS_DEPTH_WRITE 16
 #define RS_DEPTH_FUNC 32
 #define RS_CULL_FACE_SIDE 64
+#define RS_STENCIL_TEST 128
+#define RS_STENCIL_WRITE 256
+#define RS_STENCIL_FUNC 512
+#define RS_STENCIL_OP 1024
+
+#define RS_ALL_ONES 0xFFFFFFFF
 
 namespace gameplay
 {
@@ -400,7 +406,13 @@ const Vector3& RenderState::autoBindingGetLightDirection() const
 {
     static Vector3 down(0, -1, 0);
     Scene* scene = _nodeBinding ? _nodeBinding->getScene() : NULL;
-    return scene ? scene->getLightDirection() : down;
+    if (scene) {
+        static Vector3 lightDirection;
+        lightDirection.set(scene->getLightDirection());
+        _nodeBinding->getViewMatrix().transformVector(&lightDirection);
+        return lightDirection;
+    }
+    return down;
 }
 
 void RenderState::bind(Pass* pass)
@@ -501,6 +513,9 @@ void RenderState::cloneInto(RenderState* renderState, NodeCloneContext& context)
 RenderState::StateBlock::StateBlock()
     : _cullFaceEnabled(false), _depthTestEnabled(false), _depthWriteEnabled(true), _depthFunction(RenderState::DEPTH_LESS),
       _blendEnabled(false), _blendSrc(RenderState::BLEND_ONE), _blendDst(RenderState::BLEND_ZERO),
+	  _stencilTestEnabled(false), _stencilWrite(RS_ALL_ONES), 
+	  _stencilFunction(RenderState::STENCIL_ALWAYS), _stencilFunctionRef(0), _stencilFunctionMask(RS_ALL_ONES), 
+	  _stencilOpSfail(RenderState::STENCIL_OP_KEEP), _stencilOpDpfail(RenderState::STENCIL_OP_KEEP), _stencilOpDppass(RenderState::STENCIL_OP_KEEP),
       _bits(0L)
 {
 }
@@ -581,6 +596,37 @@ void RenderState::StateBlock::bindNoRestore()
         GL_ASSERT( glDepthFunc((GLenum)_depthFunction) );
         _defaultState->_depthFunction = _depthFunction;
     }
+	if ((_bits & RS_STENCIL_TEST) && (_stencilTestEnabled != _defaultState->_stencilTestEnabled))
+    {
+        if (_stencilTestEnabled) 
+			GL_ASSERT( glEnable(GL_STENCIL_TEST) );
+        else 
+            GL_ASSERT( glDisable(GL_STENCIL_TEST) );
+        _defaultState->_stencilTestEnabled = _stencilTestEnabled;
+    }
+	if ((_bits & RS_STENCIL_WRITE) && (_stencilWrite != _defaultState->_stencilWrite))
+    {
+		GL_ASSERT( glStencilMask(_stencilWrite) );
+        _defaultState->_stencilWrite = _stencilWrite;
+    }
+	if ((_bits & RS_STENCIL_FUNC) && (_stencilFunction != _defaultState->_stencilFunction || 
+										_stencilFunctionRef != _defaultState->_stencilFunctionRef ||
+										_stencilFunctionMask != _defaultState->_stencilFunctionMask))
+    {
+		GL_ASSERT( glStencilFunc((GLenum)_stencilFunction, _stencilFunctionRef, _stencilFunctionMask) );
+        _defaultState->_stencilFunction = _stencilFunction;
+		_defaultState->_stencilFunctionRef = _stencilFunctionRef;
+		_defaultState->_stencilFunctionMask = _stencilFunctionMask;
+    }
+	if ((_bits & RS_STENCIL_OP) && (_stencilOpSfail != _defaultState->_stencilOpSfail || 
+									_stencilOpDpfail != _defaultState->_stencilOpDpfail ||
+									_stencilOpDppass != _defaultState->_stencilOpDppass))
+    {
+		GL_ASSERT( glStencilOp((GLenum)_stencilOpSfail, (GLenum)_stencilOpDpfail, (GLenum)_stencilOpDppass) );
+        _defaultState->_stencilOpSfail = _stencilOpSfail;
+		_defaultState->_stencilOpDpfail = _stencilOpDpfail;
+		_defaultState->_stencilOpDppass = _stencilOpDppass;
+    }
 
     _defaultState->_bits |= _bits;
 }
@@ -639,6 +685,34 @@ void RenderState::StateBlock::restore(long stateOverrideBits)
         _defaultState->_bits &= ~RS_DEPTH_FUNC;
         _defaultState->_depthFunction = RenderState::DEPTH_LESS;
     }
+	if (!(stateOverrideBits & RS_STENCIL_TEST) && (_defaultState->_bits & RS_STENCIL_TEST))
+    {
+        GL_ASSERT( glDisable(GL_STENCIL_TEST) );
+        _defaultState->_bits &= ~RS_STENCIL_TEST;
+        _defaultState->_stencilTestEnabled = false;
+    }
+	if (!(stateOverrideBits & RS_STENCIL_WRITE) && (_defaultState->_bits & RS_STENCIL_WRITE))
+    {
+		GL_ASSERT( glStencilMask(RS_ALL_ONES) );
+        _defaultState->_bits &= ~RS_STENCIL_WRITE;
+		_defaultState->_stencilWrite = RS_ALL_ONES;
+    }
+	if (!(stateOverrideBits & RS_STENCIL_FUNC) && (_defaultState->_bits & RS_STENCIL_FUNC))
+    {
+		GL_ASSERT( glStencilFunc((GLenum)RenderState::STENCIL_ALWAYS, 0, RS_ALL_ONES) );
+        _defaultState->_bits &= ~RS_STENCIL_FUNC;
+        _defaultState->_stencilFunction = RenderState::STENCIL_ALWAYS;
+		_defaultState->_stencilFunctionRef = 0;
+		_defaultState->_stencilFunctionMask = RS_ALL_ONES;
+    }
+	if (!(stateOverrideBits & RS_STENCIL_OP) && (_defaultState->_bits & RS_STENCIL_OP))
+    {
+		GL_ASSERT( glStencilOp((GLenum)RenderState::STENCIL_OP_KEEP, (GLenum)RenderState::STENCIL_OP_KEEP, (GLenum)RenderState::STENCIL_OP_KEEP) );
+        _defaultState->_bits &= ~RS_STENCIL_OP;
+        _defaultState->_stencilOpSfail = RenderState::STENCIL_OP_KEEP;
+		_defaultState->_stencilOpDpfail = RenderState::STENCIL_OP_KEEP;
+		_defaultState->_stencilOpDppass = RenderState::STENCIL_OP_KEEP;
+    }
 }
 
 void RenderState::StateBlock::enableDepthWrite()
@@ -668,6 +742,14 @@ void RenderState::StateBlock::cloneInto(StateBlock* state)
     state->_blendSrc = _blendSrc;
     state->_blendDst = _blendDst;
     state->_cullFaceSide = _cullFaceSide;
+	state->_stencilTestEnabled = _stencilTestEnabled;
+	state->_stencilWrite = _stencilWrite;
+	state->_stencilFunction = _stencilFunction;
+	state->_stencilFunctionRef = _stencilFunctionRef;
+	state->_stencilFunctionMask = _stencilFunctionMask;
+	state->_stencilOpSfail = _stencilOpSfail;
+	state->_stencilOpDpfail = _stencilOpDpfail;
+	state->_stencilOpDppass = _stencilOpDppass;
     state->_bits = _bits;
 }
 
@@ -687,6 +769,34 @@ static bool parseBoolean(const char* value)
     return false;
 }
 
+static int parseInt(const char* value)
+{
+	GP_ASSERT(value);
+
+	int rValue;
+    int scanned = sscanf(value, "%d", &rValue);
+    if (scanned != 1)
+    {
+        GP_ERROR("Error attempting to parse int '%s'. (Will default to 0 if errors are treated as warnings)", value);
+        return 0;
+    }
+    return rValue;
+}
+
+static unsigned int parseUInt(const char* value)
+{
+	GP_ASSERT(value);
+
+	unsigned int rValue;
+    int scanned = sscanf(value, "%u", &rValue);
+    if (scanned != 1)
+    {
+        GP_ERROR("Error attempting to parse unsigned int '%s'. (Will default to 0 if errors are treated as warnings)", value);
+        return 0;
+    }
+    return rValue;
+}
+
 static RenderState::Blend parseBlend(const char* value)
 {
     GP_ASSERT(value);
@@ -777,6 +887,66 @@ static RenderState::CullFaceSide parseCullFaceSide(const char* value)
     }
 }
 
+static RenderState::StencilFunction parseStencilFunc(const char* value)
+{
+    GP_ASSERT(value);
+
+    // Convert string to uppercase for comparison
+    std::string upper(value);
+    std::transform(upper.begin(), upper.end(), upper.begin(), (int(*)(int))toupper);
+    if (upper == "NEVER")
+        return RenderState::STENCIL_NEVER;
+    else if (upper == "LESS")
+        return RenderState::STENCIL_LESS;
+    else if (upper == "EQUAL")
+        return RenderState::STENCIL_EQUAL;
+    else if (upper == "LEQUAL")
+        return RenderState::STENCIL_LEQUAL;
+    else if (upper == "GREATER")
+        return RenderState::STENCIL_GREATER;
+    else if (upper == "NOTEQUAL")
+        return RenderState::STENCIL_NOTEQUAL;
+    else if (upper == "GEQUAL")
+        return RenderState::STENCIL_GEQUAL;
+    else if (upper == "ALWAYS")
+        return RenderState::STENCIL_ALWAYS;
+    else
+    {
+        GP_ERROR("Unsupported stencil function value (%s). Will default to STENCIL_ALWAYS if errors are treated as warnings)", value);
+        return RenderState::STENCIL_ALWAYS;
+    }
+}
+
+static RenderState::StencilOperation parseStencilOp(const char* value)
+{
+    GP_ASSERT(value);
+
+    // Convert string to uppercase for comparison
+    std::string upper(value);
+    std::transform(upper.begin(), upper.end(), upper.begin(), (int(*)(int))toupper);
+    if (upper == "KEEP")
+        return RenderState::STENCIL_OP_KEEP;
+    else if (upper == "ZERO")
+        return RenderState::STENCIL_OP_ZERO;
+	else if (upper == "REPLACE")
+        return RenderState::STENCIL_OP_REPLACE;
+	else if (upper == "INCR")
+        return RenderState::STENCIL_OP_INCR;
+	else if (upper == "DECR")
+        return RenderState::STENCIL_OP_DECR;
+	else if (upper == "INVERT")
+        return RenderState::STENCIL_OP_INVERT;
+	else if (upper == "INCR_WRAP")
+        return RenderState::STENCIL_OP_INCR_WRAP;
+	else if (upper == "DECR_WRAP")
+        return RenderState::STENCIL_OP_DECR_WRAP;
+    else
+    {
+        GP_ERROR("Unsupported stencil operation value (%s). Will default to STENCIL_OP_KEEP if errors are treated as warnings)", value);
+		return RenderState::STENCIL_OP_KEEP;
+    }
+}
+
 void RenderState::StateBlock::setState(const char* name, const char* value)
 {
     GP_ASSERT(name);
@@ -812,6 +982,38 @@ void RenderState::StateBlock::setState(const char* name, const char* value)
     else if (strcmp(name, "depthFunc") == 0)
     {
         setDepthFunction(parseDepthFunc(value));
+    }
+	else if (strcmp(name, "stencilTest") == 0)
+    {
+		setStencilTest(parseBoolean(value));
+    }
+	else if (strcmp(name, "stencilWrite") == 0)
+    {
+		setStencilWrite(parseUInt(value));
+    }
+	else if (strcmp(name, "stencilFunc") == 0)
+    {
+		setStencilFunction(parseStencilFunc(value), _stencilFunctionRef, _stencilFunctionMask);
+    }
+	else if (strcmp(name, "stencilFuncRef") == 0)
+    {
+		setStencilFunction(_stencilFunction, parseInt(value), _stencilFunctionMask);
+    }
+	else if (strcmp(name, "stencilFuncMask") == 0)
+    {
+		setStencilFunction(_stencilFunction, _stencilFunctionRef, parseUInt(value));
+    }
+	else if (strcmp(name, "stencilOpSfail") == 0)
+    {
+		setStencilOperation(parseStencilOp(value), _stencilOpDpfail, _stencilOpDppass);
+    }
+	else if (strcmp(name, "stencilOpDpfail") == 0)
+    {
+		setStencilOperation(_stencilOpSfail, parseStencilOp(value), _stencilOpDppass);
+    }
+	else if (strcmp(name, "stencilOpDppass") == 0)
+    {
+		setStencilOperation(_stencilOpSfail, _stencilOpDpfail, parseStencilOp(value));
     }
     else
     {
@@ -927,4 +1129,63 @@ void RenderState::StateBlock::setDepthFunction(DepthFunction func)
     }
 }
 
+void RenderState::StateBlock::setStencilTest(bool enabled)
+{
+	_stencilTestEnabled = enabled;
+	if (!enabled)
+	{
+		_bits &= ~RS_STENCIL_TEST;
+	}
+	else
+	{
+		_bits |= RS_STENCIL_TEST;
+	}
+}
+
+void RenderState::StateBlock::setStencilWrite(unsigned int mask)
+{
+	_stencilWrite = mask;
+	if (mask == RS_ALL_ONES)
+	{
+		// Default stencil write
+		_bits &= ~RS_STENCIL_WRITE;
+	}
+	else
+	{
+		_bits |= RS_STENCIL_WRITE;
+	}
+}
+
+void RenderState::StateBlock::setStencilFunction(StencilFunction func, int ref, unsigned int mask)
+{
+	_stencilFunction = func;
+	_stencilFunctionRef = ref;
+	_stencilFunctionMask = mask;
+	if (func == STENCIL_ALWAYS && ref == 0 && mask == RS_ALL_ONES)
+	{
+		// Default stencil function
+		_bits &= ~RS_STENCIL_FUNC;
+	}
+	else
+	{
+		_bits |= RS_STENCIL_FUNC;
+	}
+}
+
+void RenderState::StateBlock::setStencilOperation(StencilOperation sfail, StencilOperation dpfail, StencilOperation dppass)
+{
+	_stencilOpSfail = sfail;
+	_stencilOpDpfail = dpfail;
+	_stencilOpDppass = dppass;
+	if (sfail == STENCIL_OP_KEEP && dpfail == STENCIL_OP_KEEP && dppass == STENCIL_OP_KEEP)
+	{
+		// Default stencil operation
+		_bits &= ~RS_STENCIL_OP;
+	}
+	else
+	{
+		_bits |= RS_STENCIL_OP;
+	}
+}
+
 }

+ 87 - 0
gameplay/src/RenderState.h

@@ -180,6 +180,45 @@ public:
         CULL_FACE_SIDE_FRONT_AND_BACK = GL_FRONT_AND_BACK
     };
 
+	/**
+     * Defines the supported stencil compare functions.
+	 * 
+	 * Stencil compare functions determine if a new pixel will be drawn.
+	 * 
+	 * The initial stencil compare function is STENCIL_ALWAYS.
+     */
+    enum StencilFunction
+    {
+		STENCIL_NEVER = GL_NEVER,
+		STENCIL_ALWAYS = GL_ALWAYS,
+		STENCIL_LESS = GL_LESS,
+		STENCIL_LEQUAL = GL_LEQUAL,
+		STENCIL_EQUAL = GL_EQUAL,
+		STENCIL_GREATER = GL_GREATER,
+		STENCIL_GEQUAL = GL_GEQUAL,
+		STENCIL_NOTEQUAL = GL_NOTEQUAL
+    };
+
+	/**
+     * Defines the supported stencil operations to perform.
+	 * 
+	 * Stencil operations determine what should happen to the pixel if the 
+	 * stencil test fails, passes, or passes but fails the depth test.
+	 * 
+	 * The initial stencil operation is STENCIL_OP_KEEP.
+     */
+    enum StencilOperation
+    {
+		STENCIL_OP_KEEP = GL_KEEP,
+		STENCIL_OP_ZERO = GL_ZERO,
+		STENCIL_OP_REPLACE = GL_REPLACE,
+		STENCIL_OP_INCR = GL_INCR,
+		STENCIL_OP_DECR = GL_DECR,
+		STENCIL_OP_INVERT = GL_INVERT,
+		STENCIL_OP_INCR_WRAP = GL_INCR_WRAP,
+		STENCIL_OP_DECR_WRAP = GL_DECR_WRAP
+    };
+
     /**
      * Defines a block of fixed-function render states that can be applied to a
      * RenderState object.
@@ -271,6 +310,46 @@ public:
          */
         void setDepthFunction(DepthFunction func);
 
+		/**
+         * Toggles stencil testing.
+         *
+         * By default, stencil testing is disabled.
+         *
+         * @param enabled true to enable, false to disable.
+         */
+		void setStencilTest(bool enabled);
+
+		/** 
+         * Sets the stencil writing mask.
+         *
+         * By default, the stencil writing mask is all 1's.
+         *
+         * @param mask Bit mask controlling writing to individual stencil planes.
+         */
+		void setStencilWrite(unsigned int mask);
+
+		/** 
+         * Sets the stencil function.
+         *
+         * By default, the function is set to STENCIL_ALWAYS, the reference value is 0, and the mask is all 1's.
+         *
+         * @param func The stencil function.
+		 * @param ref The stencil reference value.
+		 * @param mask The stencil mask.
+         */
+		void setStencilFunction(StencilFunction func, int ref, unsigned int mask);
+
+		/** 
+         * Sets the stencil operation.
+         *
+         * By default, stencil fail, stencil pass/depth fail, and stencil and depth pass are set to STENCIL_OP_KEEP.
+         *
+         * @param sfail The stencil operation if the stencil test fails.
+		 * @param dpfail The stencil operation if the stencil test passes, but the depth test fails.
+		 * @param dppass The stencil operation if both the stencil test and depth test pass.
+         */
+		void setStencilOperation(StencilOperation sfail, StencilOperation dpfail, StencilOperation dppass);
+
         /**
          * Sets a render state from the given name and value strings.
          *
@@ -317,6 +396,14 @@ public:
         Blend _blendSrc;
         Blend _blendDst;
         CullFaceSide _cullFaceSide;
+		bool _stencilTestEnabled;
+		unsigned int _stencilWrite;
+		StencilFunction _stencilFunction;
+		int _stencilFunctionRef;
+		unsigned int _stencilFunctionMask;
+		StencilOperation _stencilOpSfail;
+		StencilOperation _stencilOpDpfail;
+		StencilOperation _stencilOpDppass;
         long _bits;
 
         static StateBlock* _defaultState;

+ 1 - 0
gameplay/src/ScriptController.cpp

@@ -22,6 +22,7 @@
     /* Get the size of the array. */ \
     lua_len(sc->_lua, index); \
     int size = luaL_checkint(sc->_lua, -1); \
+    lua_pop(sc->_lua, 1); \
     if (size <= 0) \
         return LuaArray<type>((type*)NULL); \
     \

+ 1 - 0
gameplay/src/ScriptController.inl

@@ -121,6 +121,7 @@ ScriptUtil::LuaArray<T> ScriptUtil::getObjectPointer(int index, const char* type
         // Get the size of the array.
         lua_len(sc->_lua, index);
         int size = luaL_checkint(sc->_lua, -1);
+        lua_pop(sc->_lua, 1);
 
         if (size <= 0)
         {

+ 3 - 0
gameplay/src/Slider.cpp

@@ -494,7 +494,10 @@ void Slider::draw(SpriteBatch* spriteBatch, const Rectangle& clip, bool needsCle
     }
 
     if (!_visible)
+    {
+        _dirty = false;
         return;
+    }
 
     spriteBatch->start();
     drawBorder(spriteBatch, clip);

+ 8 - 4
gameplay/src/SpriteBatch.cpp

@@ -406,17 +406,19 @@ bool SpriteBatch::clipSprite(const Rectangle& clip, float& x, float& y, float& w
         return false;
     }
 
-    const float uvWidth = u2 - u1;
-    const float uvHeight = v2 - v1;
+    float uvWidth = u2 - u1;
+    float uvHeight = v2 - v1;
 
     // Moving x to the right.
     if (x < clip.x)
     {
         const float percent = (clip.x - x) / width;
         const float dx = clip.x - x;
+        const float du = uvWidth * percent;
         x = clip.x;
         width -= dx;
-        u1 += uvWidth * percent;
+        u1 += du;
+        uvWidth -= du;
     }
 
     // Moving y down.
@@ -424,9 +426,11 @@ bool SpriteBatch::clipSprite(const Rectangle& clip, float& x, float& y, float& w
     {
         const float percent = (clip.y - y) / height;
         const float dy = clip.y - y;
+        const float dv = uvHeight * percent;
         y = clip.y;
         height -= dy;
-        v1 += uvHeight * percent;
+        v1 += dv;
+        uvHeight -= dv;
     }
 
     // Moving width to the left.

+ 20 - 11
gameplay/src/TextBox.cpp

@@ -4,10 +4,7 @@
 namespace gameplay
 {
 
-/**
- * @script{ignore}
- */
-bool space(char c) {
+static bool space(char c) {
     return isspace(c);
 }
 
@@ -133,16 +130,27 @@ bool TextBox::keyEvent(Keyboard::KeyEvent evt, int key)
                 }
                 case Keyboard::KEY_HOME:
                 {
-                    // TODO: Move cursor to beginning of line.
-                    // This only works for left alignment...
-                        
-                    //_caretLocation.x = _viewportClipBounds.x;
-                    //_dirty = true;
+                    Font* font = getFont(_state);
+                    GP_ASSERT(font);
+                    unsigned int fontSize = getFontSize(_state);
+                    Font::Justify textAlignment = getTextAlignment(_state);
+                    bool rightToLeft = getTextRightToLeft(_state);
+                    font->getLocationAtIndex(getDisplayedText().c_str(), _textBounds, fontSize, &_caretLocation, 0,
+                        textAlignment, true, rightToLeft);
+                    _dirty = true;
                     break;
                 }
                 case Keyboard::KEY_END:
                 {
-                    // TODO: Move cursor to end of line.
+                    Font* font = getFont(_state);
+                    GP_ASSERT(font);
+                    unsigned int fontSize = getFontSize(_state);
+                    Font::Justify textAlignment = getTextAlignment(_state);
+                    bool rightToLeft = getTextRightToLeft(_state);
+                    const std::string displayedText = getDisplayedText();
+                    font->getLocationAtIndex(displayedText.c_str(), _textBounds, fontSize, &_caretLocation, displayedText.size(),
+                        textAlignment, true, rightToLeft);
+                    _dirty = true;
                     break;
                 }
                 case Keyboard::KEY_DELETE:
@@ -389,7 +397,8 @@ void TextBox::drawImages(SpriteBatch* spriteBatch, const Rectangle& clip)
             Vector4 color = _caretImage->getColor();
             color.w *= _opacity;
 
-            spriteBatch->draw(_caretLocation.x - (region.width / 2.0f), _caretLocation.y, region.width, _fontSize, uvs.u1, uvs.v1, uvs.u2, uvs.v2, color, _viewportClipBounds);
+            float caretWidth = region.width * _fontSize / region.height;
+            spriteBatch->draw(_caretLocation.x - caretWidth * 0.5f, _caretLocation.y, caretWidth, _fontSize, uvs.u1, uvs.v1, uvs.u2, uvs.v2, color, _viewportClipBounds);
         }
     }
 

+ 1 - 1
gameplay/src/Texture.cpp

@@ -155,7 +155,7 @@ Texture* Texture::create(Image* image, bool generateMipmaps)
     }
 }
 
-Texture* Texture::create(Format format, unsigned int width, unsigned int height, unsigned char* data, bool generateMipmaps)
+Texture* Texture::create(Format format, unsigned int width, unsigned int height, const unsigned char* data, bool generateMipmaps)
 {
     // Create and load the texture.
     GLuint textureId;

+ 1 - 1
gameplay/src/Texture.h

@@ -177,7 +177,7 @@ public:
      * @return The new texture.
      * @script{create}
      */
-    static Texture* create(Format format, unsigned int width, unsigned int height, unsigned char* data, bool generateMipmaps = false);
+    static Texture* create(Format format, unsigned int width, unsigned int height, const unsigned char* data, bool generateMipmaps = false);
 
     /**
      * Creates a texture object to wrap the specified pre-created native texture handle.

+ 79 - 0
gameplay/src/lua/lua_FrameBuffer.cpp

@@ -32,9 +32,11 @@ void luaRegister_FrameBuffer()
     {
         {"bindDefault", lua_FrameBuffer_static_bindDefault},
         {"create", lua_FrameBuffer_static_create},
+        {"createScreenshot", lua_FrameBuffer_static_createScreenshot},
         {"getCurrent", lua_FrameBuffer_static_getCurrent},
         {"getFrameBuffer", lua_FrameBuffer_static_getFrameBuffer},
         {"getMaxRenderTargets", lua_FrameBuffer_static_getMaxRenderTargets},
+        {"getScreenshot", lua_FrameBuffer_static_getScreenshot},
         {NULL, NULL}
     };
     std::vector<std::string> scopePath;
@@ -760,6 +762,43 @@ int lua_FrameBuffer_static_create(lua_State* state)
     return 0;
 }
 
+int lua_FrameBuffer_static_createScreenshot(lua_State* state)
+{
+    // Get the number of parameters.
+    int paramCount = lua_gettop(state);
+
+    // Attempt to match the parameters to a valid binding.
+    switch (paramCount)
+    {
+        case 0:
+        {
+            void* returnPtr = (void*)FrameBuffer::createScreenshot();
+            if (returnPtr)
+            {
+                gameplay::ScriptUtil::LuaObject* object = (gameplay::ScriptUtil::LuaObject*)lua_newuserdata(state, sizeof(gameplay::ScriptUtil::LuaObject));
+                object->instance = returnPtr;
+                object->owns = false;
+                luaL_getmetatable(state, "Image");
+                lua_setmetatable(state, -2);
+            }
+            else
+            {
+                lua_pushnil(state);
+            }
+
+            return 1;
+            break;
+        }
+        default:
+        {
+            lua_pushstring(state, "Invalid number of parameters (expected 0).");
+            lua_error(state);
+            break;
+        }
+    }
+    return 0;
+}
+
 int lua_FrameBuffer_static_getCurrent(lua_State* state)
 {
     // Get the number of parameters.
@@ -871,4 +910,44 @@ int lua_FrameBuffer_static_getMaxRenderTargets(lua_State* state)
     return 0;
 }
 
+int lua_FrameBuffer_static_getScreenshot(lua_State* state)
+{
+    // Get the number of parameters.
+    int paramCount = lua_gettop(state);
+
+    // Attempt to match the parameters to a valid binding.
+    switch (paramCount)
+    {
+        case 1:
+        {
+            if ((lua_type(state, 1) == LUA_TUSERDATA || lua_type(state, 1) == LUA_TTABLE || lua_type(state, 1) == LUA_TNIL))
+            {
+                // Get parameter 1 off the stack.
+                bool param1Valid;
+                gameplay::ScriptUtil::LuaArray<Image> param1 = gameplay::ScriptUtil::getObjectPointer<Image>(1, "Image", false, &param1Valid);
+                if (!param1Valid)
+                {
+                    lua_pushstring(state, "Failed to convert parameter 1 to type 'Image'.");
+                    lua_error(state);
+                }
+
+                FrameBuffer::getScreenshot(param1);
+                
+                return 0;
+            }
+
+            lua_pushstring(state, "lua_FrameBuffer_static_getScreenshot - Failed to match the given parameters to a valid function signature.");
+            lua_error(state);
+            break;
+        }
+        default:
+        {
+            lua_pushstring(state, "Invalid number of parameters (expected 1).");
+            lua_error(state);
+            break;
+        }
+    }
+    return 0;
+}
+
 }

+ 2 - 0
gameplay/src/lua/lua_FrameBuffer.h

@@ -21,9 +21,11 @@ int lua_FrameBuffer_setDepthStencilTarget(lua_State* state);
 int lua_FrameBuffer_setRenderTarget(lua_State* state);
 int lua_FrameBuffer_static_bindDefault(lua_State* state);
 int lua_FrameBuffer_static_create(lua_State* state);
+int lua_FrameBuffer_static_createScreenshot(lua_State* state);
 int lua_FrameBuffer_static_getCurrent(lua_State* state);
 int lua_FrameBuffer_static_getFrameBuffer(lua_State* state);
 int lua_FrameBuffer_static_getMaxRenderTargets(lua_State* state);
+int lua_FrameBuffer_static_getScreenshot(lua_State* state);
 
 void luaRegister_FrameBuffer();
 

+ 32 - 0
gameplay/src/lua/lua_Global.cpp

@@ -777,6 +777,34 @@ void luaRegister_lua_Global()
         gameplay::ScriptUtil::registerConstantString("DEPTH_ALWAYS", "DEPTH_ALWAYS", scopePath);
     }
 
+    // Register enumeration RenderState::StencilFunction.
+    {
+        std::vector<std::string> scopePath;
+        scopePath.push_back("RenderState");
+        gameplay::ScriptUtil::registerConstantString("STENCIL_NEVER", "STENCIL_NEVER", scopePath);
+        gameplay::ScriptUtil::registerConstantString("STENCIL_ALWAYS", "STENCIL_ALWAYS", scopePath);
+        gameplay::ScriptUtil::registerConstantString("STENCIL_LESS", "STENCIL_LESS", scopePath);
+        gameplay::ScriptUtil::registerConstantString("STENCIL_LEQUAL", "STENCIL_LEQUAL", scopePath);
+        gameplay::ScriptUtil::registerConstantString("STENCIL_EQUAL", "STENCIL_EQUAL", scopePath);
+        gameplay::ScriptUtil::registerConstantString("STENCIL_GREATER", "STENCIL_GREATER", scopePath);
+        gameplay::ScriptUtil::registerConstantString("STENCIL_GEQUAL", "STENCIL_GEQUAL", scopePath);
+        gameplay::ScriptUtil::registerConstantString("STENCIL_NOTEQUAL", "STENCIL_NOTEQUAL", scopePath);
+    }
+
+    // Register enumeration RenderState::StencilOperation.
+    {
+        std::vector<std::string> scopePath;
+        scopePath.push_back("RenderState");
+        gameplay::ScriptUtil::registerConstantString("STENCIL_OP_KEEP", "STENCIL_OP_KEEP", scopePath);
+        gameplay::ScriptUtil::registerConstantString("STENCIL_OP_ZERO", "STENCIL_OP_ZERO", scopePath);
+        gameplay::ScriptUtil::registerConstantString("STENCIL_OP_REPLACE", "STENCIL_OP_REPLACE", scopePath);
+        gameplay::ScriptUtil::registerConstantString("STENCIL_OP_INCR", "STENCIL_OP_INCR", scopePath);
+        gameplay::ScriptUtil::registerConstantString("STENCIL_OP_DECR", "STENCIL_OP_DECR", scopePath);
+        gameplay::ScriptUtil::registerConstantString("STENCIL_OP_INVERT", "STENCIL_OP_INVERT", scopePath);
+        gameplay::ScriptUtil::registerConstantString("STENCIL_OP_INCR_WRAP", "STENCIL_OP_INCR_WRAP", scopePath);
+        gameplay::ScriptUtil::registerConstantString("STENCIL_OP_DECR_WRAP", "STENCIL_OP_DECR_WRAP", scopePath);
+    }
+
     // Register enumeration Scene::DebugFlags.
     {
         std::vector<std::string> scopePath;
@@ -941,6 +969,10 @@ const char* lua_stringFromEnumGlobal(std::string& enumname, unsigned int value)
         return lua_stringFromEnum_RenderStateCullFaceSide((RenderState::CullFaceSide)value);
     if (enumname == "RenderState::DepthFunction")
         return lua_stringFromEnum_RenderStateDepthFunction((RenderState::DepthFunction)value);
+    if (enumname == "RenderState::StencilFunction")
+        return lua_stringFromEnum_RenderStateStencilFunction((RenderState::StencilFunction)value);
+    if (enumname == "RenderState::StencilOperation")
+        return lua_stringFromEnum_RenderStateStencilOperation((RenderState::StencilOperation)value);
     if (enumname == "Scene::DebugFlags")
         return lua_stringFromEnum_SceneDebugFlags((Scene::DebugFlags)value);
     if (enumname == "Terrain::Flags")

+ 2 - 0
gameplay/src/lua/lua_Global.h

@@ -38,6 +38,8 @@
 #include "lua_RenderStateBlend.h"
 #include "lua_RenderStateCullFaceSide.h"
 #include "lua_RenderStateDepthFunction.h"
+#include "lua_RenderStateStencilFunction.h"
+#include "lua_RenderStateStencilOperation.h"
 #include "lua_SceneDebugFlags.h"
 #include "lua_TerrainFlags.h"
 #include "lua_TextBoxInputMode.h"

+ 101 - 16
gameplay/src/lua/lua_Image.cpp

@@ -292,27 +292,112 @@ int lua_Image_static_create(lua_State* state)
     {
         case 1:
         {
-            if ((lua_type(state, 1) == LUA_TSTRING || lua_type(state, 1) == LUA_TNIL))
+            do
             {
-                // Get parameter 1 off the stack.
-                const char* param1 = gameplay::ScriptUtil::getString(1, false);
-
-                void* returnPtr = (void*)Image::create(param1);
-                if (returnPtr)
+                if ((lua_type(state, 1) == LUA_TSTRING || lua_type(state, 1) == LUA_TNIL))
                 {
-                    gameplay::ScriptUtil::LuaObject* object = (gameplay::ScriptUtil::LuaObject*)lua_newuserdata(state, sizeof(gameplay::ScriptUtil::LuaObject));
-                    object->instance = returnPtr;
-                    object->owns = true;
-                    luaL_getmetatable(state, "Image");
-                    lua_setmetatable(state, -2);
+                    // Get parameter 1 off the stack.
+                    const char* param1 = gameplay::ScriptUtil::getString(1, false);
+
+                    void* returnPtr = (void*)Image::create(param1);
+                    if (returnPtr)
+                    {
+                        gameplay::ScriptUtil::LuaObject* object = (gameplay::ScriptUtil::LuaObject*)lua_newuserdata(state, sizeof(gameplay::ScriptUtil::LuaObject));
+                        object->instance = returnPtr;
+                        object->owns = true;
+                        luaL_getmetatable(state, "Image");
+                        lua_setmetatable(state, -2);
+                    }
+                    else
+                    {
+                        lua_pushnil(state);
+                    }
+
+                    return 1;
                 }
-                else
+            } while (0);
+
+            lua_pushstring(state, "lua_Image_static_create - Failed to match the given parameters to a valid function signature.");
+            lua_error(state);
+            break;
+        }
+        case 3:
+        {
+            do
+            {
+                if (lua_type(state, 1) == LUA_TNUMBER &&
+                    lua_type(state, 2) == LUA_TNUMBER &&
+                    (lua_type(state, 3) == LUA_TSTRING || lua_type(state, 3) == LUA_TNIL))
                 {
-                    lua_pushnil(state);
+                    // Get parameter 1 off the stack.
+                    unsigned int param1 = (unsigned int)luaL_checkunsigned(state, 1);
+
+                    // Get parameter 2 off the stack.
+                    unsigned int param2 = (unsigned int)luaL_checkunsigned(state, 2);
+
+                    // Get parameter 3 off the stack.
+                    Image::Format param3 = (Image::Format)lua_enumFromString_ImageFormat(luaL_checkstring(state, 3));
+
+                    void* returnPtr = (void*)Image::create(param1, param2, param3);
+                    if (returnPtr)
+                    {
+                        gameplay::ScriptUtil::LuaObject* object = (gameplay::ScriptUtil::LuaObject*)lua_newuserdata(state, sizeof(gameplay::ScriptUtil::LuaObject));
+                        object->instance = returnPtr;
+                        object->owns = true;
+                        luaL_getmetatable(state, "Image");
+                        lua_setmetatable(state, -2);
+                    }
+                    else
+                    {
+                        lua_pushnil(state);
+                    }
+
+                    return 1;
                 }
+            } while (0);
 
-                return 1;
-            }
+            lua_pushstring(state, "lua_Image_static_create - Failed to match the given parameters to a valid function signature.");
+            lua_error(state);
+            break;
+        }
+        case 4:
+        {
+            do
+            {
+                if (lua_type(state, 1) == LUA_TNUMBER &&
+                    lua_type(state, 2) == LUA_TNUMBER &&
+                    (lua_type(state, 3) == LUA_TSTRING || lua_type(state, 3) == LUA_TNIL) &&
+                    (lua_type(state, 4) == LUA_TTABLE || lua_type(state, 4) == LUA_TLIGHTUSERDATA))
+                {
+                    // Get parameter 1 off the stack.
+                    unsigned int param1 = (unsigned int)luaL_checkunsigned(state, 1);
+
+                    // Get parameter 2 off the stack.
+                    unsigned int param2 = (unsigned int)luaL_checkunsigned(state, 2);
+
+                    // Get parameter 3 off the stack.
+                    Image::Format param3 = (Image::Format)lua_enumFromString_ImageFormat(luaL_checkstring(state, 3));
+
+                    // Get parameter 4 off the stack.
+                    gameplay::ScriptUtil::LuaArray<unsigned char> param4 = gameplay::ScriptUtil::getUnsignedCharPointer(4);
+
+                    void* returnPtr = (void*)Image::create(param1, param2, param3, param4);
+                    if (returnPtr)
+                    {
+                        gameplay::ScriptUtil::LuaObject* object = (gameplay::ScriptUtil::LuaObject*)lua_newuserdata(state, sizeof(gameplay::ScriptUtil::LuaObject));
+                        object->instance = returnPtr;
+                        object->owns = true;
+                        luaL_getmetatable(state, "Image");
+                        lua_setmetatable(state, -2);
+                    }
+                    else
+                    {
+                        lua_pushnil(state);
+                    }
+
+                    return 1;
+                }
+            } while (0);
 
             lua_pushstring(state, "lua_Image_static_create - Failed to match the given parameters to a valid function signature.");
             lua_error(state);
@@ -320,7 +405,7 @@ int lua_Image_static_create(lua_State* state)
         }
         default:
         {
-            lua_pushstring(state, "Invalid number of parameters (expected 1).");
+            lua_pushstring(state, "Invalid number of parameters (expected 1, 3 or 4).");
             lua_error(state);
             break;
         }

+ 2 - 0
gameplay/src/lua/lua_Material.cpp

@@ -17,6 +17,8 @@
 #include "lua_RenderStateBlend.h"
 #include "lua_RenderStateCullFaceSide.h"
 #include "lua_RenderStateDepthFunction.h"
+#include "lua_RenderStateStencilFunction.h"
+#include "lua_RenderStateStencilOperation.h"
 
 namespace gameplay
 {

+ 2 - 0
gameplay/src/lua/lua_Pass.cpp

@@ -14,6 +14,8 @@
 #include "lua_RenderStateBlend.h"
 #include "lua_RenderStateCullFaceSide.h"
 #include "lua_RenderStateDepthFunction.h"
+#include "lua_RenderStateStencilFunction.h"
+#include "lua_RenderStateStencilOperation.h"
 
 namespace gameplay
 {

+ 2 - 0
gameplay/src/lua/lua_RenderState.cpp

@@ -13,6 +13,8 @@
 #include "lua_RenderStateBlend.h"
 #include "lua_RenderStateCullFaceSide.h"
 #include "lua_RenderStateDepthFunction.h"
+#include "lua_RenderStateStencilFunction.h"
+#include "lua_RenderStateStencilOperation.h"
 
 namespace gameplay
 {

+ 166 - 0
gameplay/src/lua/lua_RenderStateStateBlock.cpp

@@ -13,6 +13,8 @@
 #include "lua_RenderStateBlend.h"
 #include "lua_RenderStateCullFaceSide.h"
 #include "lua_RenderStateDepthFunction.h"
+#include "lua_RenderStateStencilFunction.h"
+#include "lua_RenderStateStencilOperation.h"
 
 namespace gameplay
 {
@@ -34,6 +36,10 @@ void luaRegister_RenderStateStateBlock()
         {"setDepthTest", lua_RenderStateStateBlock_setDepthTest},
         {"setDepthWrite", lua_RenderStateStateBlock_setDepthWrite},
         {"setState", lua_RenderStateStateBlock_setState},
+        {"setStencilFunction", lua_RenderStateStateBlock_setStencilFunction},
+        {"setStencilOperation", lua_RenderStateStateBlock_setStencilOperation},
+        {"setStencilTest", lua_RenderStateStateBlock_setStencilTest},
+        {"setStencilWrite", lua_RenderStateStateBlock_setStencilWrite},
         {NULL, NULL}
     };
     const luaL_Reg lua_statics[] = 
@@ -551,6 +557,166 @@ int lua_RenderStateStateBlock_setState(lua_State* state)
     return 0;
 }
 
+int lua_RenderStateStateBlock_setStencilFunction(lua_State* state)
+{
+    // Get the number of parameters.
+    int paramCount = lua_gettop(state);
+
+    // Attempt to match the parameters to a valid binding.
+    switch (paramCount)
+    {
+        case 4:
+        {
+            if ((lua_type(state, 1) == LUA_TUSERDATA) &&
+                (lua_type(state, 2) == LUA_TSTRING || lua_type(state, 2) == LUA_TNIL) &&
+                lua_type(state, 3) == LUA_TNUMBER &&
+                lua_type(state, 4) == LUA_TNUMBER)
+            {
+                // Get parameter 1 off the stack.
+                RenderState::StencilFunction param1 = (RenderState::StencilFunction)lua_enumFromString_RenderStateStencilFunction(luaL_checkstring(state, 2));
+
+                // Get parameter 2 off the stack.
+                int param2 = (int)luaL_checkint(state, 3);
+
+                // Get parameter 3 off the stack.
+                unsigned int param3 = (unsigned int)luaL_checkunsigned(state, 4);
+
+                RenderState::StateBlock* instance = getInstance(state);
+                instance->setStencilFunction(param1, param2, param3);
+                
+                return 0;
+            }
+
+            lua_pushstring(state, "lua_RenderStateStateBlock_setStencilFunction - Failed to match the given parameters to a valid function signature.");
+            lua_error(state);
+            break;
+        }
+        default:
+        {
+            lua_pushstring(state, "Invalid number of parameters (expected 4).");
+            lua_error(state);
+            break;
+        }
+    }
+    return 0;
+}
+
+int lua_RenderStateStateBlock_setStencilOperation(lua_State* state)
+{
+    // Get the number of parameters.
+    int paramCount = lua_gettop(state);
+
+    // Attempt to match the parameters to a valid binding.
+    switch (paramCount)
+    {
+        case 4:
+        {
+            if ((lua_type(state, 1) == LUA_TUSERDATA) &&
+                (lua_type(state, 2) == LUA_TSTRING || lua_type(state, 2) == LUA_TNIL) &&
+                (lua_type(state, 3) == LUA_TSTRING || lua_type(state, 3) == LUA_TNIL) &&
+                (lua_type(state, 4) == LUA_TSTRING || lua_type(state, 4) == LUA_TNIL))
+            {
+                // Get parameter 1 off the stack.
+                RenderState::StencilOperation param1 = (RenderState::StencilOperation)lua_enumFromString_RenderStateStencilOperation(luaL_checkstring(state, 2));
+
+                // Get parameter 2 off the stack.
+                RenderState::StencilOperation param2 = (RenderState::StencilOperation)lua_enumFromString_RenderStateStencilOperation(luaL_checkstring(state, 3));
+
+                // Get parameter 3 off the stack.
+                RenderState::StencilOperation param3 = (RenderState::StencilOperation)lua_enumFromString_RenderStateStencilOperation(luaL_checkstring(state, 4));
+
+                RenderState::StateBlock* instance = getInstance(state);
+                instance->setStencilOperation(param1, param2, param3);
+                
+                return 0;
+            }
+
+            lua_pushstring(state, "lua_RenderStateStateBlock_setStencilOperation - Failed to match the given parameters to a valid function signature.");
+            lua_error(state);
+            break;
+        }
+        default:
+        {
+            lua_pushstring(state, "Invalid number of parameters (expected 4).");
+            lua_error(state);
+            break;
+        }
+    }
+    return 0;
+}
+
+int lua_RenderStateStateBlock_setStencilTest(lua_State* state)
+{
+    // Get the number of parameters.
+    int paramCount = lua_gettop(state);
+
+    // Attempt to match the parameters to a valid binding.
+    switch (paramCount)
+    {
+        case 2:
+        {
+            if ((lua_type(state, 1) == LUA_TUSERDATA) &&
+                lua_type(state, 2) == LUA_TBOOLEAN)
+            {
+                // Get parameter 1 off the stack.
+                bool param1 = gameplay::ScriptUtil::luaCheckBool(state, 2);
+
+                RenderState::StateBlock* instance = getInstance(state);
+                instance->setStencilTest(param1);
+                
+                return 0;
+            }
+
+            lua_pushstring(state, "lua_RenderStateStateBlock_setStencilTest - Failed to match the given parameters to a valid function signature.");
+            lua_error(state);
+            break;
+        }
+        default:
+        {
+            lua_pushstring(state, "Invalid number of parameters (expected 2).");
+            lua_error(state);
+            break;
+        }
+    }
+    return 0;
+}
+
+int lua_RenderStateStateBlock_setStencilWrite(lua_State* state)
+{
+    // Get the number of parameters.
+    int paramCount = lua_gettop(state);
+
+    // Attempt to match the parameters to a valid binding.
+    switch (paramCount)
+    {
+        case 2:
+        {
+            if ((lua_type(state, 1) == LUA_TUSERDATA) &&
+                lua_type(state, 2) == LUA_TNUMBER)
+            {
+                // Get parameter 1 off the stack.
+                unsigned int param1 = (unsigned int)luaL_checkunsigned(state, 2);
+
+                RenderState::StateBlock* instance = getInstance(state);
+                instance->setStencilWrite(param1);
+                
+                return 0;
+            }
+
+            lua_pushstring(state, "lua_RenderStateStateBlock_setStencilWrite - Failed to match the given parameters to a valid function signature.");
+            lua_error(state);
+            break;
+        }
+        default:
+        {
+            lua_pushstring(state, "Invalid number of parameters (expected 2).");
+            lua_error(state);
+            break;
+        }
+    }
+    return 0;
+}
+
 int lua_RenderStateStateBlock_static_create(lua_State* state)
 {
     // Get the number of parameters.

+ 4 - 0
gameplay/src/lua/lua_RenderStateStateBlock.h

@@ -19,6 +19,10 @@ int lua_RenderStateStateBlock_setDepthFunction(lua_State* state);
 int lua_RenderStateStateBlock_setDepthTest(lua_State* state);
 int lua_RenderStateStateBlock_setDepthWrite(lua_State* state);
 int lua_RenderStateStateBlock_setState(lua_State* state);
+int lua_RenderStateStateBlock_setStencilFunction(lua_State* state);
+int lua_RenderStateStateBlock_setStencilOperation(lua_State* state);
+int lua_RenderStateStateBlock_setStencilTest(lua_State* state);
+int lua_RenderStateStateBlock_setStencilWrite(lua_State* state);
 int lua_RenderStateStateBlock_static_create(lua_State* state);
 
 void luaRegister_RenderStateStateBlock();

+ 61 - 0
gameplay/src/lua/lua_RenderStateStencilFunction.cpp

@@ -0,0 +1,61 @@
+#include "Base.h"
+#include "lua_RenderStateStencilFunction.h"
+
+namespace gameplay
+{
+
+static const char* enumStringEmpty = "";
+
+static const char* luaEnumString_RenderStateStencilFunction_STENCIL_NEVER = "STENCIL_NEVER";
+static const char* luaEnumString_RenderStateStencilFunction_STENCIL_ALWAYS = "STENCIL_ALWAYS";
+static const char* luaEnumString_RenderStateStencilFunction_STENCIL_LESS = "STENCIL_LESS";
+static const char* luaEnumString_RenderStateStencilFunction_STENCIL_LEQUAL = "STENCIL_LEQUAL";
+static const char* luaEnumString_RenderStateStencilFunction_STENCIL_EQUAL = "STENCIL_EQUAL";
+static const char* luaEnumString_RenderStateStencilFunction_STENCIL_GREATER = "STENCIL_GREATER";
+static const char* luaEnumString_RenderStateStencilFunction_STENCIL_GEQUAL = "STENCIL_GEQUAL";
+static const char* luaEnumString_RenderStateStencilFunction_STENCIL_NOTEQUAL = "STENCIL_NOTEQUAL";
+
+RenderState::StencilFunction lua_enumFromString_RenderStateStencilFunction(const char* s)
+{
+    if (strcmp(s, luaEnumString_RenderStateStencilFunction_STENCIL_NEVER) == 0)
+        return RenderState::STENCIL_NEVER;
+    if (strcmp(s, luaEnumString_RenderStateStencilFunction_STENCIL_ALWAYS) == 0)
+        return RenderState::STENCIL_ALWAYS;
+    if (strcmp(s, luaEnumString_RenderStateStencilFunction_STENCIL_LESS) == 0)
+        return RenderState::STENCIL_LESS;
+    if (strcmp(s, luaEnumString_RenderStateStencilFunction_STENCIL_LEQUAL) == 0)
+        return RenderState::STENCIL_LEQUAL;
+    if (strcmp(s, luaEnumString_RenderStateStencilFunction_STENCIL_EQUAL) == 0)
+        return RenderState::STENCIL_EQUAL;
+    if (strcmp(s, luaEnumString_RenderStateStencilFunction_STENCIL_GREATER) == 0)
+        return RenderState::STENCIL_GREATER;
+    if (strcmp(s, luaEnumString_RenderStateStencilFunction_STENCIL_GEQUAL) == 0)
+        return RenderState::STENCIL_GEQUAL;
+    if (strcmp(s, luaEnumString_RenderStateStencilFunction_STENCIL_NOTEQUAL) == 0)
+        return RenderState::STENCIL_NOTEQUAL;
+    return RenderState::STENCIL_NEVER;
+}
+
+const char* lua_stringFromEnum_RenderStateStencilFunction(RenderState::StencilFunction e)
+{
+    if (e == RenderState::STENCIL_NEVER)
+        return luaEnumString_RenderStateStencilFunction_STENCIL_NEVER;
+    if (e == RenderState::STENCIL_ALWAYS)
+        return luaEnumString_RenderStateStencilFunction_STENCIL_ALWAYS;
+    if (e == RenderState::STENCIL_LESS)
+        return luaEnumString_RenderStateStencilFunction_STENCIL_LESS;
+    if (e == RenderState::STENCIL_LEQUAL)
+        return luaEnumString_RenderStateStencilFunction_STENCIL_LEQUAL;
+    if (e == RenderState::STENCIL_EQUAL)
+        return luaEnumString_RenderStateStencilFunction_STENCIL_EQUAL;
+    if (e == RenderState::STENCIL_GREATER)
+        return luaEnumString_RenderStateStencilFunction_STENCIL_GREATER;
+    if (e == RenderState::STENCIL_GEQUAL)
+        return luaEnumString_RenderStateStencilFunction_STENCIL_GEQUAL;
+    if (e == RenderState::STENCIL_NOTEQUAL)
+        return luaEnumString_RenderStateStencilFunction_STENCIL_NOTEQUAL;
+    return enumStringEmpty;
+}
+
+}
+

+ 15 - 0
gameplay/src/lua/lua_RenderStateStencilFunction.h

@@ -0,0 +1,15 @@
+#ifndef LUA_RENDERSTATESTENCILFUNCTION_H_
+#define LUA_RENDERSTATESTENCILFUNCTION_H_
+
+#include "RenderState.h"
+
+namespace gameplay
+{
+
+// Lua bindings for enum conversion functions for RenderState::StencilFunction.
+RenderState::StencilFunction lua_enumFromString_RenderStateStencilFunction(const char* s);
+const char* lua_stringFromEnum_RenderStateStencilFunction(RenderState::StencilFunction e);
+
+}
+
+#endif

+ 61 - 0
gameplay/src/lua/lua_RenderStateStencilOperation.cpp

@@ -0,0 +1,61 @@
+#include "Base.h"
+#include "lua_RenderStateStencilOperation.h"
+
+namespace gameplay
+{
+
+static const char* enumStringEmpty = "";
+
+static const char* luaEnumString_RenderStateStencilOperation_STENCIL_OP_KEEP = "STENCIL_OP_KEEP";
+static const char* luaEnumString_RenderStateStencilOperation_STENCIL_OP_ZERO = "STENCIL_OP_ZERO";
+static const char* luaEnumString_RenderStateStencilOperation_STENCIL_OP_REPLACE = "STENCIL_OP_REPLACE";
+static const char* luaEnumString_RenderStateStencilOperation_STENCIL_OP_INCR = "STENCIL_OP_INCR";
+static const char* luaEnumString_RenderStateStencilOperation_STENCIL_OP_DECR = "STENCIL_OP_DECR";
+static const char* luaEnumString_RenderStateStencilOperation_STENCIL_OP_INVERT = "STENCIL_OP_INVERT";
+static const char* luaEnumString_RenderStateStencilOperation_STENCIL_OP_INCR_WRAP = "STENCIL_OP_INCR_WRAP";
+static const char* luaEnumString_RenderStateStencilOperation_STENCIL_OP_DECR_WRAP = "STENCIL_OP_DECR_WRAP";
+
+RenderState::StencilOperation lua_enumFromString_RenderStateStencilOperation(const char* s)
+{
+    if (strcmp(s, luaEnumString_RenderStateStencilOperation_STENCIL_OP_KEEP) == 0)
+        return RenderState::STENCIL_OP_KEEP;
+    if (strcmp(s, luaEnumString_RenderStateStencilOperation_STENCIL_OP_ZERO) == 0)
+        return RenderState::STENCIL_OP_ZERO;
+    if (strcmp(s, luaEnumString_RenderStateStencilOperation_STENCIL_OP_REPLACE) == 0)
+        return RenderState::STENCIL_OP_REPLACE;
+    if (strcmp(s, luaEnumString_RenderStateStencilOperation_STENCIL_OP_INCR) == 0)
+        return RenderState::STENCIL_OP_INCR;
+    if (strcmp(s, luaEnumString_RenderStateStencilOperation_STENCIL_OP_DECR) == 0)
+        return RenderState::STENCIL_OP_DECR;
+    if (strcmp(s, luaEnumString_RenderStateStencilOperation_STENCIL_OP_INVERT) == 0)
+        return RenderState::STENCIL_OP_INVERT;
+    if (strcmp(s, luaEnumString_RenderStateStencilOperation_STENCIL_OP_INCR_WRAP) == 0)
+        return RenderState::STENCIL_OP_INCR_WRAP;
+    if (strcmp(s, luaEnumString_RenderStateStencilOperation_STENCIL_OP_DECR_WRAP) == 0)
+        return RenderState::STENCIL_OP_DECR_WRAP;
+    return RenderState::STENCIL_OP_KEEP;
+}
+
+const char* lua_stringFromEnum_RenderStateStencilOperation(RenderState::StencilOperation e)
+{
+    if (e == RenderState::STENCIL_OP_KEEP)
+        return luaEnumString_RenderStateStencilOperation_STENCIL_OP_KEEP;
+    if (e == RenderState::STENCIL_OP_ZERO)
+        return luaEnumString_RenderStateStencilOperation_STENCIL_OP_ZERO;
+    if (e == RenderState::STENCIL_OP_REPLACE)
+        return luaEnumString_RenderStateStencilOperation_STENCIL_OP_REPLACE;
+    if (e == RenderState::STENCIL_OP_INCR)
+        return luaEnumString_RenderStateStencilOperation_STENCIL_OP_INCR;
+    if (e == RenderState::STENCIL_OP_DECR)
+        return luaEnumString_RenderStateStencilOperation_STENCIL_OP_DECR;
+    if (e == RenderState::STENCIL_OP_INVERT)
+        return luaEnumString_RenderStateStencilOperation_STENCIL_OP_INVERT;
+    if (e == RenderState::STENCIL_OP_INCR_WRAP)
+        return luaEnumString_RenderStateStencilOperation_STENCIL_OP_INCR_WRAP;
+    if (e == RenderState::STENCIL_OP_DECR_WRAP)
+        return luaEnumString_RenderStateStencilOperation_STENCIL_OP_DECR_WRAP;
+    return enumStringEmpty;
+}
+
+}
+

+ 15 - 0
gameplay/src/lua/lua_RenderStateStencilOperation.h

@@ -0,0 +1,15 @@
+#ifndef LUA_RENDERSTATESTENCILOPERATION_H_
+#define LUA_RENDERSTATESTENCILOPERATION_H_
+
+#include "RenderState.h"
+
+namespace gameplay
+{
+
+// Lua bindings for enum conversion functions for RenderState::StencilOperation.
+RenderState::StencilOperation lua_enumFromString_RenderStateStencilOperation(const char* s);
+const char* lua_stringFromEnum_RenderStateStencilOperation(RenderState::StencilOperation e);
+
+}
+
+#endif

+ 2 - 0
gameplay/src/lua/lua_Technique.cpp

@@ -14,6 +14,8 @@
 #include "lua_RenderStateBlend.h"
 #include "lua_RenderStateCullFaceSide.h"
 #include "lua_RenderStateDepthFunction.h"
+#include "lua_RenderStateStencilFunction.h"
+#include "lua_RenderStateStencilOperation.h"
 
 namespace gameplay
 {

+ 1 - 1
samples/browser/android/jni/Android.mk

@@ -9,7 +9,7 @@ VORBIS_PATH := $(call my-dir)/../../../../external-deps/oggvorbis/lib/android/ar
 OPENAL_PATH := $(call my-dir)/../../../../external-deps/openal/lib/android/arm
 
 # gameplay
-LOCAL_PATH := $(call my-dir)/../../../../gameplay/android/obj/local/armeabi
+LOCAL_PATH := $(call my-dir)/../../../../gameplay/android/obj/local/armeabi-v7a
 include $(CLEAR_VARS)
 LOCAL_MODULE    := libgameplay
 LOCAL_SRC_FILES := libgameplay.a

+ 2 - 1
samples/browser/android/jni/Application.mk

@@ -1 +1,2 @@
-APP_STL     := stlport_static
+APP_STL     := stlport_static
+APP_ABI     := armeabi-v7a

+ 6 - 0
samples/browser/sample-browser.vcxproj

@@ -60,11 +60,13 @@
     <ConfigurationType>Application</ConfigurationType>
     <UseDebugLibraries>true</UseDebugLibraries>
     <CharacterSet>Unicode</CharacterSet>
+    <PlatformToolset>v110</PlatformToolset>
   </PropertyGroup>
   <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
     <ConfigurationType>Application</ConfigurationType>
     <UseDebugLibraries>true</UseDebugLibraries>
     <CharacterSet>Unicode</CharacterSet>
+    <PlatformToolset>v110</PlatformToolset>
   </PropertyGroup>
   <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|BlackBerry'" Label="Configuration">
     <ConfigurationType>Application</ConfigurationType>
@@ -80,11 +82,13 @@
     <ConfigurationType>Application</ConfigurationType>
     <UseDebugLibraries>true</UseDebugLibraries>
     <CharacterSet>Unicode</CharacterSet>
+    <PlatformToolset>v110</PlatformToolset>
   </PropertyGroup>
   <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='DebugMem|x64'" Label="Configuration">
     <ConfigurationType>Application</ConfigurationType>
     <UseDebugLibraries>true</UseDebugLibraries>
     <CharacterSet>Unicode</CharacterSet>
+    <PlatformToolset>v110</PlatformToolset>
   </PropertyGroup>
   <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='DebugMem|BlackBerry'" Label="Configuration">
     <ConfigurationType>Application</ConfigurationType>
@@ -101,12 +105,14 @@
     <UseDebugLibraries>false</UseDebugLibraries>
     <WholeProgramOptimization>true</WholeProgramOptimization>
     <CharacterSet>Unicode</CharacterSet>
+    <PlatformToolset>v110</PlatformToolset>
   </PropertyGroup>
   <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
     <ConfigurationType>Application</ConfigurationType>
     <UseDebugLibraries>false</UseDebugLibraries>
     <WholeProgramOptimization>true</WholeProgramOptimization>
     <CharacterSet>Unicode</CharacterSet>
+    <PlatformToolset>v110</PlatformToolset>
   </PropertyGroup>
   <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|BlackBerry'" Label="Configuration">
     <ConfigurationType>Application</ConfigurationType>

+ 1 - 1
samples/character/android/jni/Android.mk

@@ -9,7 +9,7 @@ VORBIS_PATH := $(call my-dir)/../../../../external-deps/oggvorbis/lib/android/ar
 OPENAL_PATH := $(call my-dir)/../../../../external-deps/openal/lib/android/arm
 
 # gameplay
-LOCAL_PATH := $(call my-dir)/../../../../gameplay/android/obj/local/armeabi
+LOCAL_PATH := $(call my-dir)/../../../../gameplay/android/obj/local/armeabi-v7a
 include $(CLEAR_VARS)
 LOCAL_MODULE    := libgameplay
 LOCAL_SRC_FILES := libgameplay.a

+ 3 - 1
samples/character/android/jni/Application.mk

@@ -1 +1,3 @@
-APP_STL     := stlport_static
+APP_STL     := stlport_static
+APP_ABI     := armeabi-v7a
+

+ 6 - 0
samples/character/sample-character.vcxproj

@@ -60,11 +60,13 @@
     <ConfigurationType>Application</ConfigurationType>
     <UseDebugLibraries>true</UseDebugLibraries>
     <CharacterSet>Unicode</CharacterSet>
+    <PlatformToolset>v110</PlatformToolset>
   </PropertyGroup>
   <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
     <ConfigurationType>Application</ConfigurationType>
     <UseDebugLibraries>true</UseDebugLibraries>
     <CharacterSet>Unicode</CharacterSet>
+    <PlatformToolset>v110</PlatformToolset>
   </PropertyGroup>
   <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|BlackBerry'" Label="Configuration">
     <ConfigurationType>Application</ConfigurationType>
@@ -80,11 +82,13 @@
     <ConfigurationType>Application</ConfigurationType>
     <UseDebugLibraries>true</UseDebugLibraries>
     <CharacterSet>Unicode</CharacterSet>
+    <PlatformToolset>v110</PlatformToolset>
   </PropertyGroup>
   <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='DebugMem|x64'" Label="Configuration">
     <ConfigurationType>Application</ConfigurationType>
     <UseDebugLibraries>true</UseDebugLibraries>
     <CharacterSet>Unicode</CharacterSet>
+    <PlatformToolset>v110</PlatformToolset>
   </PropertyGroup>
   <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='DebugMem|BlackBerry'" Label="Configuration">
     <ConfigurationType>Application</ConfigurationType>
@@ -101,12 +105,14 @@
     <UseDebugLibraries>false</UseDebugLibraries>
     <WholeProgramOptimization>true</WholeProgramOptimization>
     <CharacterSet>Unicode</CharacterSet>
+    <PlatformToolset>v110</PlatformToolset>
   </PropertyGroup>
   <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
     <ConfigurationType>Application</ConfigurationType>
     <UseDebugLibraries>false</UseDebugLibraries>
     <WholeProgramOptimization>true</WholeProgramOptimization>
     <CharacterSet>Unicode</CharacterSet>
+    <PlatformToolset>v110</PlatformToolset>
   </PropertyGroup>
   <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|BlackBerry'" Label="Configuration">
     <ConfigurationType>Application</ConfigurationType>

+ 1 - 1
samples/longboard/android/jni/Android.mk

@@ -9,7 +9,7 @@ VORBIS_PATH := $(call my-dir)/../../../../external-deps/oggvorbis/lib/android/ar
 OPENAL_PATH := $(call my-dir)/../../../../external-deps/openal/lib/android/arm
 
 # gameplay
-LOCAL_PATH := $(call my-dir)/../../../../gameplay/android/obj/local/armeabi
+LOCAL_PATH := $(call my-dir)/../../../../gameplay/android/obj/local/armeabi-v7a
 include $(CLEAR_VARS)
 LOCAL_MODULE    := libgameplay
 LOCAL_SRC_FILES := libgameplay.a

+ 3 - 1
samples/longboard/android/jni/Application.mk

@@ -1 +1,3 @@
-APP_STL     := stlport_static
+APP_STL     := stlport_static
+APP_ABI     := armeabi-v7a
+

+ 6 - 0
samples/longboard/sample-longboard.vcxproj

@@ -60,11 +60,13 @@
     <ConfigurationType>Application</ConfigurationType>
     <UseDebugLibraries>true</UseDebugLibraries>
     <CharacterSet>Unicode</CharacterSet>
+    <PlatformToolset>v110</PlatformToolset>
   </PropertyGroup>
   <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
     <ConfigurationType>Application</ConfigurationType>
     <UseDebugLibraries>true</UseDebugLibraries>
     <CharacterSet>Unicode</CharacterSet>
+    <PlatformToolset>v110</PlatformToolset>
   </PropertyGroup>
   <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|BlackBerry'" Label="Configuration">
     <ConfigurationType>Application</ConfigurationType>
@@ -80,11 +82,13 @@
     <ConfigurationType>Application</ConfigurationType>
     <UseDebugLibraries>true</UseDebugLibraries>
     <CharacterSet>Unicode</CharacterSet>
+    <PlatformToolset>v110</PlatformToolset>
   </PropertyGroup>
   <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='DebugMem|x64'" Label="Configuration">
     <ConfigurationType>Application</ConfigurationType>
     <UseDebugLibraries>true</UseDebugLibraries>
     <CharacterSet>Unicode</CharacterSet>
+    <PlatformToolset>v110</PlatformToolset>
   </PropertyGroup>
   <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='DebugMem|BlackBerry'" Label="Configuration">
     <ConfigurationType>Application</ConfigurationType>
@@ -101,12 +105,14 @@
     <UseDebugLibraries>false</UseDebugLibraries>
     <WholeProgramOptimization>true</WholeProgramOptimization>
     <CharacterSet>Unicode</CharacterSet>
+    <PlatformToolset>v110</PlatformToolset>
   </PropertyGroup>
   <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
     <ConfigurationType>Application</ConfigurationType>
     <UseDebugLibraries>false</UseDebugLibraries>
     <WholeProgramOptimization>true</WholeProgramOptimization>
     <CharacterSet>Unicode</CharacterSet>
+    <PlatformToolset>v110</PlatformToolset>
   </PropertyGroup>
   <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|BlackBerry'" Label="Configuration">
     <ConfigurationType>Application</ConfigurationType>

+ 1 - 1
samples/lua/android/jni/Android.mk

@@ -9,7 +9,7 @@ VORBIS_PATH := $(call my-dir)/../../../../external-deps/oggvorbis/lib/android/ar
 OPENAL_PATH := $(call my-dir)/../../../../external-deps/openal/lib/android/arm
 
 # gameplay
-LOCAL_PATH := $(call my-dir)/../../../../gameplay/android/obj/local/armeabi
+LOCAL_PATH := $(call my-dir)/../../../../gameplay/android/obj/local/armeabi-v7a
 include $(CLEAR_VARS)
 LOCAL_MODULE    := libgameplay
 LOCAL_SRC_FILES := libgameplay.a

+ 3 - 1
samples/lua/android/jni/Application.mk

@@ -1 +1,3 @@
-APP_STL     := stlport_static
+APP_STL     := stlport_static
+APP_ABI     := armeabi-v7a
+

+ 6 - 0
samples/lua/sample-lua.vcxproj

@@ -60,11 +60,13 @@
     <ConfigurationType>Application</ConfigurationType>
     <UseDebugLibraries>true</UseDebugLibraries>
     <CharacterSet>Unicode</CharacterSet>
+    <PlatformToolset>v110</PlatformToolset>
   </PropertyGroup>
   <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
     <ConfigurationType>Application</ConfigurationType>
     <UseDebugLibraries>true</UseDebugLibraries>
     <CharacterSet>Unicode</CharacterSet>
+    <PlatformToolset>v110</PlatformToolset>
   </PropertyGroup>
   <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|BlackBerry'" Label="Configuration">
     <ConfigurationType>Application</ConfigurationType>
@@ -80,11 +82,13 @@
     <ConfigurationType>Application</ConfigurationType>
     <UseDebugLibraries>true</UseDebugLibraries>
     <CharacterSet>Unicode</CharacterSet>
+    <PlatformToolset>v110</PlatformToolset>
   </PropertyGroup>
   <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='DebugMem|x64'" Label="Configuration">
     <ConfigurationType>Application</ConfigurationType>
     <UseDebugLibraries>true</UseDebugLibraries>
     <CharacterSet>Unicode</CharacterSet>
+    <PlatformToolset>v110</PlatformToolset>
   </PropertyGroup>
   <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='DebugMem|BlackBerry'" Label="Configuration">
     <ConfigurationType>Application</ConfigurationType>
@@ -101,12 +105,14 @@
     <UseDebugLibraries>false</UseDebugLibraries>
     <WholeProgramOptimization>true</WholeProgramOptimization>
     <CharacterSet>Unicode</CharacterSet>
+    <PlatformToolset>v110</PlatformToolset>
   </PropertyGroup>
   <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
     <ConfigurationType>Application</ConfigurationType>
     <UseDebugLibraries>false</UseDebugLibraries>
     <WholeProgramOptimization>true</WholeProgramOptimization>
     <CharacterSet>Unicode</CharacterSet>
+    <PlatformToolset>v110</PlatformToolset>
   </PropertyGroup>
   <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|BlackBerry'" Label="Configuration">
     <ConfigurationType>Application</ConfigurationType>

+ 1 - 1
samples/mesh/android/jni/Android.mk

@@ -9,7 +9,7 @@ VORBIS_PATH := $(call my-dir)/../../../../external-deps/oggvorbis/lib/android/ar
 OPENAL_PATH := $(call my-dir)/../../../../external-deps/openal/lib/android/arm
 
 # gameplay
-LOCAL_PATH := $(call my-dir)/../../../../gameplay/android/obj/local/armeabi
+LOCAL_PATH := $(call my-dir)/../../../../gameplay/android/obj/local/armeabi-v7a
 include $(CLEAR_VARS)
 LOCAL_MODULE    := libgameplay
 LOCAL_SRC_FILES := libgameplay.a

+ 3 - 1
samples/mesh/android/jni/Application.mk

@@ -1 +1,3 @@
-APP_STL     := stlport_static
+APP_STL     := stlport_static
+APP_ABI     := armeabi-v7a
+

+ 6 - 0
samples/mesh/sample-mesh.vcxproj

@@ -60,11 +60,13 @@
     <ConfigurationType>Application</ConfigurationType>
     <UseDebugLibraries>true</UseDebugLibraries>
     <CharacterSet>Unicode</CharacterSet>
+    <PlatformToolset>v110</PlatformToolset>
   </PropertyGroup>
   <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
     <ConfigurationType>Application</ConfigurationType>
     <UseDebugLibraries>true</UseDebugLibraries>
     <CharacterSet>Unicode</CharacterSet>
+    <PlatformToolset>v110</PlatformToolset>
   </PropertyGroup>
   <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|BlackBerry'" Label="Configuration">
     <ConfigurationType>Application</ConfigurationType>
@@ -80,11 +82,13 @@
     <ConfigurationType>Application</ConfigurationType>
     <UseDebugLibraries>true</UseDebugLibraries>
     <CharacterSet>Unicode</CharacterSet>
+    <PlatformToolset>v110</PlatformToolset>
   </PropertyGroup>
   <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='DebugMem|x64'" Label="Configuration">
     <ConfigurationType>Application</ConfigurationType>
     <UseDebugLibraries>true</UseDebugLibraries>
     <CharacterSet>Unicode</CharacterSet>
+    <PlatformToolset>v110</PlatformToolset>
   </PropertyGroup>
   <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='DebugMem|BlackBerry'" Label="Configuration">
     <ConfigurationType>Application</ConfigurationType>
@@ -101,12 +105,14 @@
     <UseDebugLibraries>false</UseDebugLibraries>
     <WholeProgramOptimization>true</WholeProgramOptimization>
     <CharacterSet>Unicode</CharacterSet>
+    <PlatformToolset>v110</PlatformToolset>
   </PropertyGroup>
   <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
     <ConfigurationType>Application</ConfigurationType>
     <UseDebugLibraries>false</UseDebugLibraries>
     <WholeProgramOptimization>true</WholeProgramOptimization>
     <CharacterSet>Unicode</CharacterSet>
+    <PlatformToolset>v110</PlatformToolset>
   </PropertyGroup>
   <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|BlackBerry'" Label="Configuration">
     <ConfigurationType>Application</ConfigurationType>

+ 1 - 3
samples/mesh/sample-mesh.vcxproj.filters

@@ -29,13 +29,11 @@
     <None Include="res\duck-diffuse.png">
       <Filter>res</Filter>
     </None>
-    <None Include="..\..\..\gameplay\res\logo_powered_white.png">
-      <Filter>res</Filter>
-    </None>
     <None Include="res\grid.material">
       <Filter>res</Filter>
     </None>
     <None Include="game.config" />
+    <None Include="../../gameplay\res\logo_powered_white.png" />
   </ItemGroup>
   <ItemGroup>
     <ClCompile Include="src\MeshGame.cpp">

+ 1 - 1
samples/particles/android/jni/Android.mk

@@ -9,7 +9,7 @@ VORBIS_PATH := $(call my-dir)/../../../../external-deps/oggvorbis/lib/android/ar
 OPENAL_PATH := $(call my-dir)/../../../../external-deps/openal/lib/android/arm
 
 # gameplay
-LOCAL_PATH := $(call my-dir)/../../../../gameplay/android/obj/local/armeabi
+LOCAL_PATH := $(call my-dir)/../../../../gameplay/android/obj/local/armeabi-v7a
 include $(CLEAR_VARS)
 LOCAL_MODULE    := libgameplay
 LOCAL_SRC_FILES := libgameplay.a

+ 3 - 1
samples/particles/android/jni/Application.mk

@@ -1 +1,3 @@
-APP_STL     := stlport_static
+APP_STL     := stlport_static
+APP_ABI     := armeabi-v7a
+

+ 6 - 0
samples/particles/sample-particles.vcxproj

@@ -91,11 +91,13 @@
     <ConfigurationType>Application</ConfigurationType>
     <UseDebugLibraries>true</UseDebugLibraries>
     <CharacterSet>Unicode</CharacterSet>
+    <PlatformToolset>v110</PlatformToolset>
   </PropertyGroup>
   <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
     <ConfigurationType>Application</ConfigurationType>
     <UseDebugLibraries>true</UseDebugLibraries>
     <CharacterSet>Unicode</CharacterSet>
+    <PlatformToolset>v110</PlatformToolset>
   </PropertyGroup>
   <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|BlackBerry'" Label="Configuration">
     <ConfigurationType>Application</ConfigurationType>
@@ -111,11 +113,13 @@
     <ConfigurationType>Application</ConfigurationType>
     <UseDebugLibraries>true</UseDebugLibraries>
     <CharacterSet>Unicode</CharacterSet>
+    <PlatformToolset>v110</PlatformToolset>
   </PropertyGroup>
   <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='DebugMem|x64'" Label="Configuration">
     <ConfigurationType>Application</ConfigurationType>
     <UseDebugLibraries>true</UseDebugLibraries>
     <CharacterSet>Unicode</CharacterSet>
+    <PlatformToolset>v110</PlatformToolset>
   </PropertyGroup>
   <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='DebugMem|BlackBerry'" Label="Configuration">
     <ConfigurationType>Application</ConfigurationType>
@@ -132,12 +136,14 @@
     <UseDebugLibraries>false</UseDebugLibraries>
     <WholeProgramOptimization>true</WholeProgramOptimization>
     <CharacterSet>Unicode</CharacterSet>
+    <PlatformToolset>v110</PlatformToolset>
   </PropertyGroup>
   <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
     <ConfigurationType>Application</ConfigurationType>
     <UseDebugLibraries>false</UseDebugLibraries>
     <WholeProgramOptimization>true</WholeProgramOptimization>
     <CharacterSet>Unicode</CharacterSet>
+    <PlatformToolset>v110</PlatformToolset>
   </PropertyGroup>
   <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|BlackBerry'" Label="Configuration">
     <ConfigurationType>Application</ConfigurationType>

+ 1 - 1
samples/racer/android/jni/Android.mk

@@ -9,7 +9,7 @@ VORBIS_PATH := $(call my-dir)/../../../../external-deps/oggvorbis/lib/android/ar
 OPENAL_PATH := $(call my-dir)/../../../../external-deps/openal/lib/android/arm
 
 # gameplay
-LOCAL_PATH := $(call my-dir)/../../../../gameplay/android/obj/local/armeabi
+LOCAL_PATH := $(call my-dir)/../../../../gameplay/android/obj/local/armeabi-v7a
 include $(CLEAR_VARS)
 LOCAL_MODULE    := libgameplay
 LOCAL_SRC_FILES := libgameplay.a

+ 3 - 1
samples/racer/android/jni/Application.mk

@@ -1 +1,3 @@
-APP_STL     := stlport_static
+APP_STL     := stlport_static
+APP_ABI     := armeabi-v7a
+

+ 6 - 0
samples/racer/sample-racer.vcxproj

@@ -60,11 +60,13 @@
     <ConfigurationType>Application</ConfigurationType>
     <UseDebugLibraries>true</UseDebugLibraries>
     <CharacterSet>Unicode</CharacterSet>
+    <PlatformToolset>v110</PlatformToolset>
   </PropertyGroup>
   <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
     <ConfigurationType>Application</ConfigurationType>
     <UseDebugLibraries>true</UseDebugLibraries>
     <CharacterSet>Unicode</CharacterSet>
+    <PlatformToolset>v110</PlatformToolset>
   </PropertyGroup>
   <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|BlackBerry'" Label="Configuration">
     <ConfigurationType>Application</ConfigurationType>
@@ -80,11 +82,13 @@
     <ConfigurationType>Application</ConfigurationType>
     <UseDebugLibraries>true</UseDebugLibraries>
     <CharacterSet>Unicode</CharacterSet>
+    <PlatformToolset>v110</PlatformToolset>
   </PropertyGroup>
   <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='DebugMem|x64'" Label="Configuration">
     <ConfigurationType>Application</ConfigurationType>
     <UseDebugLibraries>true</UseDebugLibraries>
     <CharacterSet>Unicode</CharacterSet>
+    <PlatformToolset>v110</PlatformToolset>
   </PropertyGroup>
   <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='DebugMem|BlackBerry'" Label="Configuration">
     <ConfigurationType>Application</ConfigurationType>
@@ -101,12 +105,14 @@
     <UseDebugLibraries>false</UseDebugLibraries>
     <WholeProgramOptimization>true</WholeProgramOptimization>
     <CharacterSet>Unicode</CharacterSet>
+    <PlatformToolset>v110</PlatformToolset>
   </PropertyGroup>
   <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
     <ConfigurationType>Application</ConfigurationType>
     <UseDebugLibraries>false</UseDebugLibraries>
     <WholeProgramOptimization>true</WholeProgramOptimization>
     <CharacterSet>Unicode</CharacterSet>
+    <PlatformToolset>v110</PlatformToolset>
   </PropertyGroup>
   <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|BlackBerry'" Label="Configuration">
     <ConfigurationType>Application</ConfigurationType>

+ 1 - 1
samples/spaceship/android/jni/Android.mk

@@ -9,7 +9,7 @@ VORBIS_PATH := $(call my-dir)/../../../../external-deps/oggvorbis/lib/android/ar
 OPENAL_PATH := $(call my-dir)/../../../../external-deps/openal/lib/android/arm
 
 # gameplay
-LOCAL_PATH := $(call my-dir)/../../../../gameplay/android/obj/local/armeabi
+LOCAL_PATH := $(call my-dir)/../../../../gameplay/android/obj/local/armeabi-v7a
 include $(CLEAR_VARS)
 LOCAL_MODULE    := libgameplay
 LOCAL_SRC_FILES := libgameplay.a

+ 3 - 1
samples/spaceship/android/jni/Application.mk

@@ -1 +1,3 @@
-APP_STL     := stlport_static
+APP_STL     := stlport_static
+APP_ABI     := armeabi-v7a
+

+ 6 - 0
samples/spaceship/sample-spaceship.vcxproj

@@ -60,11 +60,13 @@
     <ConfigurationType>Application</ConfigurationType>
     <UseDebugLibraries>true</UseDebugLibraries>
     <CharacterSet>Unicode</CharacterSet>
+    <PlatformToolset>v110</PlatformToolset>
   </PropertyGroup>
   <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
     <ConfigurationType>Application</ConfigurationType>
     <UseDebugLibraries>true</UseDebugLibraries>
     <CharacterSet>Unicode</CharacterSet>
+    <PlatformToolset>v110</PlatformToolset>
   </PropertyGroup>
   <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|BlackBerry'" Label="Configuration">
     <ConfigurationType>Application</ConfigurationType>
@@ -80,11 +82,13 @@
     <ConfigurationType>Application</ConfigurationType>
     <UseDebugLibraries>true</UseDebugLibraries>
     <CharacterSet>Unicode</CharacterSet>
+    <PlatformToolset>v110</PlatformToolset>
   </PropertyGroup>
   <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='DebugMem|x64'" Label="Configuration">
     <ConfigurationType>Application</ConfigurationType>
     <UseDebugLibraries>true</UseDebugLibraries>
     <CharacterSet>Unicode</CharacterSet>
+    <PlatformToolset>v110</PlatformToolset>
   </PropertyGroup>
   <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='DebugMem|BlackBerry'" Label="Configuration">
     <ConfigurationType>Application</ConfigurationType>
@@ -101,12 +105,14 @@
     <UseDebugLibraries>false</UseDebugLibraries>
     <WholeProgramOptimization>true</WholeProgramOptimization>
     <CharacterSet>Unicode</CharacterSet>
+    <PlatformToolset>v110</PlatformToolset>
   </PropertyGroup>
   <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
     <ConfigurationType>Application</ConfigurationType>
     <UseDebugLibraries>false</UseDebugLibraries>
     <WholeProgramOptimization>true</WholeProgramOptimization>
     <CharacterSet>Unicode</CharacterSet>
+    <PlatformToolset>v110</PlatformToolset>
   </PropertyGroup>
   <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|BlackBerry'" Label="Configuration">
     <ConfigurationType>Application</ConfigurationType>

+ 7 - 0
template/template.vcxproj

@@ -29,39 +29,46 @@
   <PropertyGroup Label="Globals">
     <Keyword>Win32Proj</Keyword>
     <RootNamespace>TEMPLATE_PROJECT</RootNamespace>
+    <ProjectGuid>{30BEE126-8B04-4F96-84A1-30CBF8B3E491}</ProjectGuid>
   </PropertyGroup>
   <Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
   <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
     <ConfigurationType>Application</ConfigurationType>
     <UseDebugLibraries>true</UseDebugLibraries>
     <CharacterSet>Unicode</CharacterSet>
+    <PlatformToolset>v110</PlatformToolset>
   </PropertyGroup>
   <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
     <ConfigurationType>Application</ConfigurationType>
     <UseDebugLibraries>true</UseDebugLibraries>
     <CharacterSet>Unicode</CharacterSet>
+    <PlatformToolset>v110</PlatformToolset>
   </PropertyGroup>
   <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='DebugMem|Win32'" Label="Configuration">
     <ConfigurationType>Application</ConfigurationType>
     <UseDebugLibraries>true</UseDebugLibraries>
     <CharacterSet>Unicode</CharacterSet>
+    <PlatformToolset>v110</PlatformToolset>
   </PropertyGroup>
   <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='DebugMem|x64'" Label="Configuration">
     <ConfigurationType>Application</ConfigurationType>
     <UseDebugLibraries>true</UseDebugLibraries>
     <CharacterSet>Unicode</CharacterSet>
+    <PlatformToolset>v110</PlatformToolset>
   </PropertyGroup>
   <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
     <ConfigurationType>Application</ConfigurationType>
     <UseDebugLibraries>false</UseDebugLibraries>
     <WholeProgramOptimization>true</WholeProgramOptimization>
     <CharacterSet>Unicode</CharacterSet>
+    <PlatformToolset>v110</PlatformToolset>
   </PropertyGroup>
   <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
     <ConfigurationType>Application</ConfigurationType>
     <UseDebugLibraries>false</UseDebugLibraries>
     <WholeProgramOptimization>true</WholeProgramOptimization>
     <CharacterSet>Unicode</CharacterSet>
+    <PlatformToolset>v110</PlatformToolset>
   </PropertyGroup>
   <Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
   <ImportGroup Label="ExtensionSettings">

+ 3 - 3
tools/encoder/CMakeLists.txt

@@ -14,20 +14,20 @@ link_directories(
     ${CMAKE_SOURCE_DIR}/external-deps/zlib/lib/linux/${ARCH_DIR}
     ${CMAKE_SOURCE_DIR}/external-deps/libpng/lib/linux/${ARCH_DIR}
     ${CMAKE_SOURCE_DIR}/external-deps/freetype2/lib/linux/${ARCH_DIR}
-    /usr/lib/gcc4/${ARCH_DIR}
+    /usr/lib/gcc4/${ARCH_DIR}/release
     /usr/lib
 )
 
 set(APP_LIBRARIES
     dl
-    fbxsdk-2013.3-static
+    fbxsdk
     png
     z   
     freetype
     pthread
 ) 
 
-add_definitions(-lstdc++ -ldl -lfbxsdk-2013.3-static -lpng -lz -lfreetype -lpthread)
+add_definitions(-lstdc++ -ldl -lfbxsdk -lpng -lz -lfreetype -lpthread)
 
 set( APP_NAME gameplay-encoder )
 

+ 9 - 7
tools/encoder/gameplay-encoder.vcxproj

@@ -122,12 +122,14 @@
     <ConfigurationType>Application</ConfigurationType>
     <UseDebugLibraries>true</UseDebugLibraries>
     <CharacterSet>Unicode</CharacterSet>
+    <PlatformToolset>v110</PlatformToolset>
   </PropertyGroup>
   <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
     <ConfigurationType>Application</ConfigurationType>
     <UseDebugLibraries>false</UseDebugLibraries>
     <WholeProgramOptimization>true</WholeProgramOptimization>
     <CharacterSet>Unicode</CharacterSet>
+    <PlatformToolset>v110</PlatformToolset>
   </PropertyGroup>
   <Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
   <ImportGroup Label="ExtensionSettings">
@@ -155,16 +157,16 @@
       </PrecompiledHeader>
       <WarningLevel>Level4</WarningLevel>
       <Optimization>Disabled</Optimization>
-      <PreprocessorDefinitions>_ITERATOR_DEBUG_LEVEL=0;USE_FBX;WIN32;_DEBUG;_CONSOLE;_CRT_SECURE_NO_WARNINGS;NO_BOOST;NO_ZAE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <AdditionalIncludeDirectories>C:/Program Files/Autodesk/FBX/FBX SDK/2013.3/include;../../external-deps/freetype2/include;../../external-deps/libpng/include;../../external-deps/zlib/include</AdditionalIncludeDirectories>
+      <PreprocessorDefinitions>_ITERATOR_DEBUG_LEVEL=2;USE_FBX;WIN32;_DEBUG;_CONSOLE;_CRT_SECURE_NO_WARNINGS;NO_BOOST;NO_ZAE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+      <AdditionalIncludeDirectories>C:/Program Files/Autodesk/FBX/FBX SDK/2014.1/include;../../external-deps/freetype2/include;../../external-deps/libpng/include;../../external-deps/zlib/include</AdditionalIncludeDirectories>
       <DisableLanguageExtensions>
       </DisableLanguageExtensions>
     </ClCompile>
     <Link>
       <SubSystem>Console</SubSystem>
       <GenerateDebugInformation>true</GenerateDebugInformation>
-      <AdditionalLibraryDirectories>C:/Program Files/Autodesk/FBX/FBX SDK/2013.3/lib/vs2010/x86;../../external-deps/freetype2/lib/windows/x86;../../external-deps/libpng/lib/windows/x86;../../external-deps/zlib/lib/windows/x86</AdditionalLibraryDirectories>
-      <AdditionalDependencies>fbxsdk-2013.3-md.lib;freetype245.lib;libpng14.lib;zlib.lib;%(AdditionalDependencies)</AdditionalDependencies>
+      <AdditionalLibraryDirectories>C:/Program Files/Autodesk/FBX/FBX SDK/2014.1/lib/vs2012/x86/debug;../../external-deps/freetype2/lib/windows/x86;../../external-deps/libpng/lib/windows/x86;../../external-deps/zlib/lib/windows/x86</AdditionalLibraryDirectories>
+      <AdditionalDependencies>libfbxsdk-md.lib;freetype245.lib;libpng14.lib;zlib.lib;%(AdditionalDependencies)</AdditionalDependencies>
       <IgnoreSpecificDefaultLibraries>MSVCRT</IgnoreSpecificDefaultLibraries>
     </Link>
     <PostBuildEvent>
@@ -181,15 +183,15 @@
       <FunctionLevelLinking>true</FunctionLevelLinking>
       <IntrinsicFunctions>true</IntrinsicFunctions>
       <PreprocessorDefinitions>_ITERATOR_DEBUG_LEVEL=0;USE_FBX;WIN32;NDEBUG;_CONSOLE;_CRT_SECURE_NO_WARNINGS;NO_BOOST;NO_ZAE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <AdditionalIncludeDirectories>C:/Program Files/Autodesk/FBX/FBX SDK/2013.3/include;../../external-deps/freetype2/include;../../external-deps/libpng/include;../../external-deps/zlib/include</AdditionalIncludeDirectories>
+      <AdditionalIncludeDirectories>C:/Program Files/Autodesk/FBX/FBX SDK/2014.1/include;../../external-deps/freetype2/include;../../external-deps/libpng/include;../../external-deps/zlib/include</AdditionalIncludeDirectories>
     </ClCompile>
     <Link>
       <SubSystem>Console</SubSystem>
       <GenerateDebugInformation>true</GenerateDebugInformation>
       <EnableCOMDATFolding>true</EnableCOMDATFolding>
       <OptimizeReferences>true</OptimizeReferences>
-      <AdditionalDependencies>fbxsdk-2013.3-md.lib;freetype245.lib;libpng14.lib;zlib.lib;%(AdditionalDependencies)</AdditionalDependencies>
-      <AdditionalLibraryDirectories>C:/Program Files/Autodesk/FBX/FBX SDK/2013.3/lib/vs2010/x86;../../external-deps/freetype2/lib/windows/x86;../../external-deps/libpng/lib/windows/x86;../../external-deps/zlib/lib/windows/x86</AdditionalLibraryDirectories>
+      <AdditionalDependencies>libfbxsdk-md.lib;freetype245.lib;libpng14.lib;zlib.lib;%(AdditionalDependencies)</AdditionalDependencies>
+      <AdditionalLibraryDirectories>C:/Program Files/Autodesk/FBX/FBX SDK/2014.1/lib/vs2012/x86/release;../../external-deps/freetype2/lib/windows/x86;../../external-deps/libpng/lib/windows/x86;../../external-deps/zlib/lib/windows/x86</AdditionalLibraryDirectories>
       <IgnoreSpecificDefaultLibraries>
       </IgnoreSpecificDefaultLibraries>
     </Link>

+ 39 - 26
tools/encoder/gameplay-encoder.xcodeproj/project.pbxproj

@@ -56,9 +56,12 @@
 		42D277591472EFA700D867A4 /* libpcre.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 42D277571472EFA700D867A4 /* libpcre.a */; };
 		42D2775A1472EFA700D867A4 /* libpcrecpp.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 42D277581472EFA700D867A4 /* libpcrecpp.a */; };
 		5BCD0643152CFC3C0071FAB5 /* libpng.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 5BCD0642152CFC3C0071FAB5 /* libpng.a */; };
-		9F92DB1016CB0F29003B2974 /* libfbxsdk-2013.3-static.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 9F92DB0F16CB0F29003B2974 /* libfbxsdk-2013.3-static.a */; };
 		B661733F16A61CE40083A307 /* Image.cpp in Sources */ = {isa = PBXBuildFile; fileRef = B661733D16A61CE40083A307 /* Image.cpp */; };
 		B661734316A61CFA0083A307 /* NormalMapGenerator.cpp in Sources */ = {isa = PBXBuildFile; fileRef = B661734116A61CFA0083A307 /* NormalMapGenerator.cpp */; };
+		C076C905174F6D2E00645678 /* Constants.cpp in Sources */ = {isa = PBXBuildFile; fileRef = C076C8FF174F6D2E00645678 /* Constants.cpp */; };
+		C076C906174F6D2E00645678 /* FBXUtil.cpp in Sources */ = {isa = PBXBuildFile; fileRef = C076C901174F6D2E00645678 /* FBXUtil.cpp */; };
+		C076C907174F6D2E00645678 /* Sampler.cpp in Sources */ = {isa = PBXBuildFile; fileRef = C076C903174F6D2E00645678 /* Sampler.cpp */; };
+		C076C90B174F71DF00645678 /* libfbxsdk-2014.1-static.a in Frameworks */ = {isa = PBXBuildFile; fileRef = C076C90A174F71DF00645678 /* libfbxsdk-2014.1-static.a */; };
 		F18DCD0615D554B800DB35DB /* Heightmap.cpp in Sources */ = {isa = PBXBuildFile; fileRef = F18DCD0315D554B800DB35DB /* Heightmap.cpp */; };
 /* End PBXBuildFile section */
 
@@ -169,11 +172,17 @@
 		42D277571472EFA700D867A4 /* libpcre.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; name = libpcre.a; path = "../external-deps/pcre/lib/macosx/libpcre.a"; sourceTree = "<group>"; };
 		42D277581472EFA700D867A4 /* libpcrecpp.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; name = libpcrecpp.a; path = "../external-deps/pcre/lib/macosx/libpcrecpp.a"; sourceTree = "<group>"; };
 		5BCD0642152CFC3C0071FAB5 /* libpng.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; name = libpng.a; path = "../external-deps/libpng/lib/macosx/libpng.a"; sourceTree = "<group>"; };
-		9F92DB0F16CB0F29003B2974 /* libfbxsdk-2013.3-static.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; name = "libfbxsdk-2013.3-static.a"; path = "../../../../../Applications/Autodesk/FBX SDK/2013.3/lib/gcc4/ub/libfbxsdk-2013.3-static.a"; sourceTree = "<group>"; };
 		B661733D16A61CE40083A307 /* Image.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = Image.cpp; path = src/Image.cpp; sourceTree = SOURCE_ROOT; };
 		B661733E16A61CE40083A307 /* Image.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = Image.h; path = src/Image.h; sourceTree = SOURCE_ROOT; };
 		B661734116A61CFA0083A307 /* NormalMapGenerator.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = NormalMapGenerator.cpp; path = src/NormalMapGenerator.cpp; sourceTree = SOURCE_ROOT; };
 		B661734216A61CFA0083A307 /* NormalMapGenerator.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = NormalMapGenerator.h; path = src/NormalMapGenerator.h; sourceTree = SOURCE_ROOT; };
+		C076C8FF174F6D2E00645678 /* Constants.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = Constants.cpp; path = src/Constants.cpp; sourceTree = SOURCE_ROOT; };
+		C076C900174F6D2E00645678 /* Constants.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = Constants.h; path = src/Constants.h; sourceTree = SOURCE_ROOT; };
+		C076C901174F6D2E00645678 /* FBXUtil.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = FBXUtil.cpp; path = src/FBXUtil.cpp; sourceTree = SOURCE_ROOT; };
+		C076C902174F6D2E00645678 /* FBXUtil.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = FBXUtil.h; path = src/FBXUtil.h; sourceTree = SOURCE_ROOT; };
+		C076C903174F6D2E00645678 /* Sampler.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = Sampler.cpp; path = src/Sampler.cpp; sourceTree = SOURCE_ROOT; };
+		C076C904174F6D2E00645678 /* Sampler.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = Sampler.h; path = src/Sampler.h; sourceTree = SOURCE_ROOT; };
+		C076C90A174F71DF00645678 /* libfbxsdk-2014.1-static.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; name = "libfbxsdk-2014.1-static.a"; path = "../../../../../../Applications/Autodesk/FBX SDK/2014.1/lib/gcc4/ub/debug/libfbxsdk-2014.1-static.a"; sourceTree = "<group>"; };
 		F18DCD0315D554B800DB35DB /* Heightmap.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = Heightmap.cpp; path = src/Heightmap.cpp; sourceTree = SOURCE_ROOT; };
 		F18DCD0415D554B800DB35DB /* Heightmap.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = Heightmap.h; path = src/Heightmap.h; sourceTree = SOURCE_ROOT; };
 		F18DCD0515D554B800DB35DB /* Thread.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = Thread.h; path = src/Thread.h; sourceTree = SOURCE_ROOT; };
@@ -184,7 +193,7 @@
 			isa = PBXFrameworksBuildPhase;
 			buildActionMask = 2147483647;
 			files = (
-				9F92DB1016CB0F29003B2974 /* libfbxsdk-2013.3-static.a in Frameworks */,
+				C076C90B174F71DF00645678 /* libfbxsdk-2014.1-static.a in Frameworks */,
 				42D277591472EFA700D867A4 /* libpcre.a in Frameworks */,
 				42D2775A1472EFA700D867A4 /* libpcrecpp.a in Frameworks */,
 				42C8EE351472B60100E43619 /* libfreetype.a in Frameworks */,
@@ -213,7 +222,7 @@
 		42475CDB147208A000610A6A = {
 			isa = PBXGroup;
 			children = (
-				9F92DB0F16CB0F29003B2974 /* libfbxsdk-2013.3-static.a */,
+				C076C90A174F71DF00645678 /* libfbxsdk-2014.1-static.a */,
 				42475CE9147208A000610A6A /* src */,
 				427D4F44147DC9080076760E /* Libraries */,
 				4228A3FD1620A58000955433 /* Frameworks */,
@@ -247,6 +256,8 @@
 				4283905814896E6C00E2B2F5 /* BoundingVolume.h */,
 				42C8EDBF14724CD700E43619 /* Camera.cpp */,
 				42C8EDC014724CD700E43619 /* Camera.h */,
+				C076C8FF174F6D2E00645678 /* Constants.cpp */,
+				C076C900174F6D2E00645678 /* Constants.h */,
 				4251B128152D044B002F6199 /* Curve.cpp */,
 				4251B129152D044B002F6199 /* Curve.h */,
 				4251B12A152D044B002F6199 /* Curve.inl */,
@@ -256,6 +267,8 @@
 				42C8EDCE14724CD700E43619 /* EncoderArguments.h */,
 				4278341E148D6F7500A6E27F /* FBXSceneEncoder.cpp */,
 				4278341F148D6F7500A6E27F /* FBXSceneEncoder.h */,
+				C076C901174F6D2E00645678 /* FBXUtil.cpp */,
+				C076C902174F6D2E00645678 /* FBXUtil.h */,
 				42C8EDCF14724CD700E43619 /* FileIO.cpp */,
 				42C8EDD014724CD700E43619 /* FileIO.h */,
 				42C8EDD114724CD700E43619 /* Font.cpp */,
@@ -300,6 +313,8 @@
 				42C8EDF514724CD700E43619 /* Reference.h */,
 				42C8EDF614724CD700E43619 /* ReferenceTable.cpp */,
 				42C8EDF714724CD700E43619 /* ReferenceTable.h */,
+				C076C903174F6D2E00645678 /* Sampler.cpp */,
+				C076C904174F6D2E00645678 /* Sampler.h */,
 				42C8EDF814724CD700E43619 /* Scene.cpp */,
 				42C8EDF914724CD700E43619 /* Scene.h */,
 				42C8EDFA14724CD700E43619 /* StringUtil.cpp */,
@@ -434,6 +449,9 @@
 				F18DCD0615D554B800DB35DB /* Heightmap.cpp in Sources */,
 				B661733F16A61CE40083A307 /* Image.cpp in Sources */,
 				B661734316A61CFA0083A307 /* NormalMapGenerator.cpp in Sources */,
+				C076C905174F6D2E00645678 /* Constants.cpp in Sources */,
+				C076C906174F6D2E00645678 /* FBXUtil.cpp in Sources */,
+				C076C907174F6D2E00645678 /* Sampler.cpp in Sources */,
 			);
 			runOnlyForDeploymentPostprocessing = 0;
 		};
@@ -464,8 +482,9 @@
 				GCC_WARN_ABOUT_RETURN_TYPE = YES;
 				GCC_WARN_UNUSED_VARIABLE = YES;
 				HEADER_SEARCH_PATHS = (
-					"../external-deps/freetype/include",
-					"../external-deps/libpng/include",
+					"\"$(SRCROOT)/../../external-deps/freetype2/include\"",
+					"\"$(SRCROOT)/../../external-deps/libpng/include\"",
+					"\"/Applications/Autodesk/FBX SDK/2014.1/include\"",
 				);
 				INFOPLIST_PREPROCESSOR_DEFINITIONS = "";
 				MACOSX_DEPLOYMENT_TARGET = 10.7;
@@ -499,8 +518,9 @@
 				GCC_WARN_ABOUT_RETURN_TYPE = YES;
 				GCC_WARN_UNUSED_VARIABLE = YES;
 				HEADER_SEARCH_PATHS = (
-					"../external-deps/freetype/include",
-					"../external-deps/libpng/include",
+					"\"$(SRCROOT)/../../external-deps/freetype2/include\"",
+					"\"$(SRCROOT)/../../external-deps/libpng/include\"",
+					"\"/Applications/Autodesk/FBX SDK/2014.1/include\"",
 				);
 				INFOPLIST_PREPROCESSOR_DEFINITIONS = "";
 				MACOSX_DEPLOYMENT_TARGET = 10.7;
@@ -524,18 +544,14 @@
 				GCC_WARN_ABOUT_DEPRECATED_FUNCTIONS = YES;
 				GCC_WARN_ABOUT_MISSING_PROTOTYPES = NO;
 				GCC_WARN_UNUSED_VARIABLE = NO;
-				HEADER_SEARCH_PATHS = (
-					"../external-deps/freetype2/include",
-					"../external-deps/libpng/include",
-					"\"/Applications/Autodesk/FBX SDK/2013.3/include\"",
-				);
+				HEADER_SEARCH_PATHS = "$(inherited)";
 				LIBRARY_SEARCH_PATHS = (
 					"$(inherited)",
-					"\"$(SRCROOT)/../external-deps/freetype2/lib/macosx\"",
-					"\"$(SRCROOT)/../external-deps/pcre/lib/macosx\"",
-					"\"$(SRCROOT)/../external-deps/libpng/lib/macosx\"",
+					"\"$(SRCROOT)/../../external-deps/freetype2/lib/macosx\"",
+					"\"$(SRCROOT)/../../external-deps/pcre/lib/macosx\"",
+					"\"$(SRCROOT)/../../external-deps/libpng/lib/macosx\"",
 					"\"$(SRCROOT)\"",
-					"\"$(SYSTEM_APPS_DIR)/Autodesk/FBX SDK/2013.3/lib/gcc4/ub\"",
+					"\"$(SYSTEM_APPS_DIR)/Autodesk/FBX SDK/2014.1/lib/gcc4/ub/debug\"",
 				);
 				MACH_O_TYPE = mh_execute;
 				PRODUCT_NAME = "$(TARGET_NAME)";
@@ -555,18 +571,15 @@
 				GCC_WARN_ABOUT_DEPRECATED_FUNCTIONS = YES;
 				GCC_WARN_ABOUT_MISSING_PROTOTYPES = NO;
 				GCC_WARN_UNUSED_VARIABLE = NO;
-				HEADER_SEARCH_PATHS = (
-					"../external-deps/freetype2/include",
-					"../external-deps/libpng/include",
-					"\"/Applications/Autodesk/FBX SDK/2013.3/include\"",
-				);
+				HEADER_SEARCH_PATHS = "$(inherited)";
 				LIBRARY_SEARCH_PATHS = (
 					"$(inherited)",
-					"\"$(SRCROOT)/../external-deps/freetype2/lib/macosx\"",
-					"\"$(SRCROOT)/../external-deps/pcre/lib/macosx\"",
-					"\"$(SRCROOT)/../external-deps/libpng/lib/macosx\"",
+					"\"$(SRCROOT)/../../external-deps/freetype2/lib/macosx\"",
+					"\"$(SRCROOT)/../../external-deps/pcre/lib/macosx\"",
+					"\"$(SRCROOT)/../../external-deps/libpng/lib/macosx\"",
 					"\"$(SRCROOT)\"",
-					"\"$(SYSTEM_APPS_DIR)/Autodesk/FBX SDK/2013.3/lib/gcc4/ub\"",
+					"\"$(SYSTEM_APPS_DIR)/Autodesk/FBX SDK/2014.1/lib/gcc4/ub/release\"",
+					"\"$(SYSTEM_APPS_DIR)/Autodesk/FBX SDK/2014.1/lib/gcc4/ub/debug\"",
 				);
 				MACH_O_TYPE = mh_execute;
 				PRODUCT_NAME = "$(TARGET_NAME)";

+ 1 - 1
tools/encoder/src/FBXSceneEncoder.cpp

@@ -34,7 +34,7 @@ void FBXSceneEncoder::write(const string& filepath, const EncoderArguments& argu
     if (!importer->Initialize(filepath.c_str(), -1, sdkManager->GetIOSettings()))
     {
         LOG(1, "Call to FbxImporter::Initialize() failed.\n");
-        LOG(1, "Error returned: %s\n\n", importer->GetLastErrorString());
+        LOG(1, "Error returned: %s\n\n", importer->GetStatus().GetErrorString());
         exit(-1);
     }
     

+ 2 - 0
tools/luagen/gameplay-luagen.vcxproj

@@ -36,12 +36,14 @@
     <ConfigurationType>Application</ConfigurationType>
     <UseDebugLibraries>true</UseDebugLibraries>
     <CharacterSet>Unicode</CharacterSet>
+    <PlatformToolset>v110</PlatformToolset>
   </PropertyGroup>
   <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
     <ConfigurationType>Application</ConfigurationType>
     <UseDebugLibraries>false</UseDebugLibraries>
     <WholeProgramOptimization>true</WholeProgramOptimization>
     <CharacterSet>Unicode</CharacterSet>
+    <PlatformToolset>v110</PlatformToolset>
   </PropertyGroup>
   <Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
   <ImportGroup Label="ExtensionSettings">