فهرست منبع

Lua bindings, lua bindings generator, build tool, player tweaks and icon files

Ivan Safrin 15 سال پیش
والد
کامیت
fac55d76f7
100فایلهای تغییر یافته به همراه10927 افزوده شده و 1051 حذف شده
  1. BIN
      Assets/Icon_base.psd
  2. BIN
      Assets/main_icon.icns
  3. BIN
      Assets/main_icon.png
  4. BIN
      Assets/player_icon.icns
  5. BIN
      Assets/player_icon.png
  6. 4 4
      Bindings/Build/Mac OS X/Bindings.xcodeproj/project.pbxproj
  7. 77 0
      Bindings/Contents/LUA/API/Polycode.lua
  8. 52 0
      Bindings/Contents/LUA/API/Polycode/BezierCurve.lua
  9. 14 0
      Bindings/Contents/LUA/API/Polycode/BezierPathTween.lua
  10. 82 0
      Bindings/Contents/LUA/API/Polycode/Bone.lua
  11. 24 0
      Bindings/Contents/LUA/API/Polycode/BoneTrack.lua
  12. 74 0
      Bindings/Contents/LUA/API/Polycode/Camera.lua
  13. 44 0
      Bindings/Contents/LUA/API/Polycode/Color.lua
  14. 36 0
      Bindings/Contents/LUA/API/Polycode/Config.lua
  15. 54 0
      Bindings/Contents/LUA/API/Polycode/CoreInput.lua
  16. 76 0
      Bindings/Contents/LUA/API/Polycode/CoreServices.lua
  17. 10 0
      Bindings/Contents/LUA/API/Polycode/Cubemap.lua
  18. 28 0
      Bindings/Contents/LUA/API/Polycode/Data.lua
  19. 276 0
      Bindings/Contents/LUA/API/Polycode/Entity.lua
  20. 28 0
      Bindings/Contents/LUA/API/Polycode/Event.lua
  21. 38 0
      Bindings/Contents/LUA/API/Polycode/EventDispatcher.lua
  22. 16 0
      Bindings/Contents/LUA/API/Polycode/EventHandler.lua
  23. 12 0
      Bindings/Contents/LUA/API/Polycode/FixedShader.lua
  24. 24 0
      Bindings/Contents/LUA/API/Polycode/FixedShaderBinding.lua
  25. 16 0
      Bindings/Contents/LUA/API/Polycode/Font.lua
  26. 16 0
      Bindings/Contents/LUA/API/Polycode/FontManager.lua
  27. 76 0
      Bindings/Contents/LUA/API/Polycode/GenericScene.lua
  28. 120 0
      Bindings/Contents/LUA/API/Polycode/Image.lua
  29. 14 0
      Bindings/Contents/LUA/API/Polycode/InputEvent.lua
  30. 30 0
      Bindings/Contents/LUA/API/Polycode/Label.lua
  31. 16 0
      Bindings/Contents/LUA/API/Polycode/Logger.lua
  32. 46 0
      Bindings/Contents/LUA/API/Polycode/Material.lua
  33. 76 0
      Bindings/Contents/LUA/API/Polycode/MaterialManager.lua
  34. 44 0
      Bindings/Contents/LUA/API/Polycode/Matrix4.lua
  35. 104 0
      Bindings/Contents/LUA/API/Polycode/Mesh.lua
  36. 42 0
      Bindings/Contents/LUA/API/Polycode/OSBasics.lua
  37. 12 0
      Bindings/Contents/LUA/API/Polycode/OSFILE.lua
  38. 8 0
      Bindings/Contents/LUA/API/Polycode/OSFileEntry.lua
  39. 12 0
      Bindings/Contents/LUA/API/Polycode/ObjectEntry.lua
  40. 14 0
      Bindings/Contents/LUA/API/Polycode/OpenGLCubemap.lua
  41. 20 0
      Bindings/Contents/LUA/API/Polycode/Particle.lua
  42. 12 0
      Bindings/Contents/LUA/API/Polycode/Perlin.lua
  43. 12 0
      Bindings/Contents/LUA/API/Polycode/PolycodeModule.lua
  44. 68 0
      Bindings/Contents/LUA/API/Polycode/Polygon.lua
  45. 84 0
      Bindings/Contents/LUA/API/Polycode/Quaternion.lua
  46. 20 0
      Bindings/Contents/LUA/API/Polycode/QuaternionCurve.lua
  47. 14 0
      Bindings/Contents/LUA/API/Polycode/QuaternionTween.lua
  48. 12 0
      Bindings/Contents/LUA/API/Polycode/Rectangle.lua
  49. 28 0
      Bindings/Contents/LUA/API/Polycode/Resource.lua
  50. 52 0
      Bindings/Contents/LUA/API/Polycode/ResourceManager.lua
  51. 14 0
      Bindings/Contents/LUA/API/Polycode/SceneEntity.lua
  52. 26 0
      Bindings/Contents/LUA/API/Polycode/SceneLabel.lua
  53. 58 0
      Bindings/Contents/LUA/API/Polycode/SceneLight.lua
  54. 14 0
      Bindings/Contents/LUA/API/Polycode/SceneLine.lua
  55. 28 0
      Bindings/Contents/LUA/API/Polycode/SceneManager.lua
  56. 66 0
      Bindings/Contents/LUA/API/Polycode/SceneMesh.lua
  57. 22 0
      Bindings/Contents/LUA/API/Polycode/SceneParticleEmitter.lua
  58. 10 0
      Bindings/Contents/LUA/API/Polycode/ScenePrimitive.lua
  59. 24 0
      Bindings/Contents/LUA/API/Polycode/SceneRenderTexture.lua
  60. 89 5
      Bindings/Contents/LUA/API/Polycode/Screen.lua
  61. 10 0
      Bindings/Contents/LUA/API/Polycode/ScreenCurve.lua
  62. 158 0
      Bindings/Contents/LUA/API/Polycode/ScreenEntity.lua
  63. 10 0
      Bindings/Contents/LUA/API/Polycode/ScreenEvent.lua
  64. 22 0
      Bindings/Contents/LUA/API/Polycode/ScreenImage.lua
  65. 26 0
      Bindings/Contents/LUA/API/Polycode/ScreenLabel.lua
  66. 22 0
      Bindings/Contents/LUA/API/Polycode/ScreenLine.lua
  67. 26 0
      Bindings/Contents/LUA/API/Polycode/ScreenManager.lua
  68. 30 0
      Bindings/Contents/LUA/API/Polycode/ScreenMesh.lua
  69. 22 0
      Bindings/Contents/LUA/API/Polycode/ScreenParticleEmitter.lua
  70. 38 0
      Bindings/Contents/LUA/API/Polycode/ScreenShape.lua
  71. 22 0
      Bindings/Contents/LUA/API/Polycode/ScreenSprite.lua
  72. 58 0
      Bindings/Contents/LUA/API/Polycode/Skeleton.lua
  73. 32 0
      Bindings/Contents/LUA/API/Polycode/SkeletonAnimation.lua
  74. 40 0
      Bindings/Contents/LUA/API/Polycode/Sound.lua
  75. 12 0
      Bindings/Contents/LUA/API/Polycode/SoundManager.lua
  76. 76 0
      Bindings/Contents/LUA/API/Polycode/String.lua
  77. 38 0
      Bindings/Contents/LUA/API/Polycode/Timer.lua
  78. 20 0
      Bindings/Contents/LUA/API/Polycode/TimerManager.lua
  79. 42 0
      Bindings/Contents/LUA/API/Polycode/Tween.lua
  80. 16 0
      Bindings/Contents/LUA/API/Polycode/TweenManager.lua
  81. 8 0
      Bindings/Contents/LUA/API/Polycode/Vector2.lua
  82. 32 0
      Bindings/Contents/LUA/API/Polycode/Vector3.lua
  83. 38 0
      Bindings/Contents/LUA/API/Polycode/Vertex.lua
  84. 12 0
      Bindings/Contents/LUA/API/Polycode/VertexBuffer.lua
  85. 1 1
      Bindings/Contents/LUA/Include/PolycodeLUA.h
  86. 6209 0
      Bindings/Contents/LUA/Include/PolycodeLUAWrappers.h
  87. 655 10
      Bindings/Contents/LUA/Source/PolycodeLUA.cpp
  88. 669 0
      Bindings/Scripts/create_lua_library/CppHeaderParser.py
  89. BIN
      Bindings/Scripts/create_lua_library/CppHeaderParser.pyc
  90. 200 0
      Bindings/Scripts/create_lua_library/create_lua_library.py
  91. 1 3
      Core/Contents/Include/PolyScreen.h
  92. 1 1
      Core/Contents/Source/OSBasics.cpp
  93. 1 1
      IDE/Build/Mac OS X/Polycode-Info.plist
  94. 4 0
      IDE/Build/Mac OS X/Polycode.xcodeproj/project.pbxproj
  95. 5 5
      IDE/Contents/Source/NewProjectWindow.cpp
  96. 40 1012
      Player/Build/Mac OS X/English.lproj/MainMenu.xib
  97. 24 0
      Player/Build/Mac OS X/Polycode Player.xcodeproj/project.pbxproj
  98. 1 1
      Player/Build/Mac OS X/Polycode_Player-Info.plist
  99. 9 4
      Player/Contents/Source/PolycodePlayer.cpp
  100. 9 4
      Tools/Build/Linux/Makefile

BIN
Assets/Icon_base.psd


BIN
Assets/main_icon.icns


BIN
Assets/main_icon.png


BIN
Assets/player_icon.icns


BIN
Assets/player_icon.png


+ 4 - 4
Bindings/Build/Mac OS X/Bindings.xcodeproj/project.pbxproj

@@ -9,14 +9,14 @@
 /* Begin PBXBuildFile section */
 /* Begin PBXBuildFile section */
 		6D3415FA12B837080034FA9B /* PolycodeLUA.h in Headers */ = {isa = PBXBuildFile; fileRef = 6D3415F712B837080034FA9B /* PolycodeLUA.h */; };
 		6D3415FA12B837080034FA9B /* PolycodeLUA.h in Headers */ = {isa = PBXBuildFile; fileRef = 6D3415F712B837080034FA9B /* PolycodeLUA.h */; };
 		6D3415FB12B837080034FA9B /* PolycodeLUA.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 6D3415F912B837080034FA9B /* PolycodeLUA.cpp */; };
 		6D3415FB12B837080034FA9B /* PolycodeLUA.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 6D3415F912B837080034FA9B /* PolycodeLUA.cpp */; };
-		6D3418F712B91DBF0034FA9B /* PolycodeLUA2D.h in Headers */ = {isa = PBXBuildFile; fileRef = 6D3418F612B91DBF0034FA9B /* PolycodeLUA2D.h */; };
+		6D67482E133FE26D00218B97 /* PolycodeLUAWrappers.h in Headers */ = {isa = PBXBuildFile; fileRef = 6D67482D133FE26D00218B97 /* PolycodeLUAWrappers.h */; };
 /* End PBXBuildFile section */
 /* End PBXBuildFile section */
 
 
 /* Begin PBXFileReference section */
 /* Begin PBXFileReference section */
 		6D3415EF12B836CE0034FA9B /* libPolycodeLUA.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = libPolycodeLUA.a; sourceTree = BUILT_PRODUCTS_DIR; };
 		6D3415EF12B836CE0034FA9B /* libPolycodeLUA.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = libPolycodeLUA.a; sourceTree = BUILT_PRODUCTS_DIR; };
 		6D3415F712B837080034FA9B /* PolycodeLUA.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PolycodeLUA.h; sourceTree = "<group>"; };
 		6D3415F712B837080034FA9B /* PolycodeLUA.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PolycodeLUA.h; sourceTree = "<group>"; };
 		6D3415F912B837080034FA9B /* PolycodeLUA.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = PolycodeLUA.cpp; sourceTree = "<group>"; };
 		6D3415F912B837080034FA9B /* PolycodeLUA.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = PolycodeLUA.cpp; sourceTree = "<group>"; };
-		6D3418F612B91DBF0034FA9B /* PolycodeLUA2D.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PolycodeLUA2D.h; sourceTree = "<group>"; };
+		6D67482D133FE26D00218B97 /* PolycodeLUAWrappers.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PolycodeLUAWrappers.h; sourceTree = "<group>"; };
 /* End PBXFileReference section */
 /* End PBXFileReference section */
 
 
 /* Begin PBXFrameworksBuildPhase section */
 /* Begin PBXFrameworksBuildPhase section */
@@ -59,7 +59,7 @@
 		6D3415F612B837080034FA9B /* Include */ = {
 		6D3415F612B837080034FA9B /* Include */ = {
 			isa = PBXGroup;
 			isa = PBXGroup;
 			children = (
 			children = (
-				6D3418F612B91DBF0034FA9B /* PolycodeLUA2D.h */,
+				6D67482D133FE26D00218B97 /* PolycodeLUAWrappers.h */,
 				6D3415F712B837080034FA9B /* PolycodeLUA.h */,
 				6D3415F712B837080034FA9B /* PolycodeLUA.h */,
 			);
 			);
 			path = Include;
 			path = Include;
@@ -81,7 +81,7 @@
 			buildActionMask = 2147483647;
 			buildActionMask = 2147483647;
 			files = (
 			files = (
 				6D3415FA12B837080034FA9B /* PolycodeLUA.h in Headers */,
 				6D3415FA12B837080034FA9B /* PolycodeLUA.h in Headers */,
-				6D3418F712B91DBF0034FA9B /* PolycodeLUA2D.h in Headers */,
+				6D67482E133FE26D00218B97 /* PolycodeLUAWrappers.h in Headers */,
 			);
 			);
 			runOnlyForDeploymentPostprocessing = 0;
 			runOnlyForDeploymentPostprocessing = 0;
 		};
 		};

+ 77 - 0
Bindings/Contents/LUA/API/Polycode.lua

@@ -0,0 +1,77 @@
+require "Polycode/OSFILE"
+require "Polycode/OSFileEntry"
+require "Polycode/OSBasics"
+require "Polycode/BezierCurve"
+require "Polycode/Bone"
+require "Polycode/Camera"
+require "Polycode/Color"
+require "Polycode/Config"
+require "Polycode/CoreInput"
+require "Polycode/CoreServices"
+require "Polycode/Cubemap"
+require "Polycode/Data"
+require "Polycode/Entity"
+require "Polycode/Event"
+require "Polycode/EventDispatcher"
+require "Polycode/EventHandler"
+require "Polycode/FixedShader"
+require "Polycode/FixedShaderBinding"
+require "Polycode/Font"
+require "Polycode/FontManager"
+require "Polycode/GenericScene"
+require "Polycode/OpenGLCubemap"
+require "Polycode/Image"
+require "Polycode/InputEvent"
+require "Polycode/Label"
+require "Polycode/Logger"
+require "Polycode/Material"
+require "Polycode/MaterialManager"
+require "Polycode/Matrix4"
+require "Polycode/Mesh"
+require "Polycode/VertexBuffer"
+require "Polycode/PolycodeModule"
+require "Polycode/ObjectEntry"
+require "Polycode/Particle"
+require "Polycode/ScreenParticleEmitter"
+require "Polycode/SceneParticleEmitter"
+require "Polycode/Perlin"
+require "Polycode/Polygon"
+require "Polycode/Quaternion"
+require "Polycode/QuaternionCurve"
+require "Polycode/Rectangle"
+require "Polycode/Resource"
+require "Polycode/ResourceManager"
+require "Polycode/SceneEntity"
+require "Polycode/SceneLabel"
+require "Polycode/SceneLight"
+require "Polycode/SceneLine"
+require "Polycode/SceneManager"
+require "Polycode/SceneMesh"
+require "Polycode/ScenePrimitive"
+require "Polycode/SceneRenderTexture"
+require "Polycode/Screen"
+require "Polycode/ScreenCurve"
+require "Polycode/ScreenEntity"
+require "Polycode/ScreenEvent"
+require "Polycode/ScreenImage"
+require "Polycode/ScreenLabel"
+require "Polycode/ScreenLine"
+require "Polycode/ScreenManager"
+require "Polycode/ScreenMesh"
+require "Polycode/ScreenShape"
+require "Polycode/ScreenSprite"
+require "Polycode/SkeletonAnimation"
+require "Polycode/Skeleton"
+require "Polycode/BoneTrack"
+require "Polycode/Sound"
+require "Polycode/SoundManager"
+require "Polycode/String"
+require "Polycode/Timer"
+require "Polycode/TimerManager"
+require "Polycode/Tween"
+require "Polycode/BezierPathTween"
+require "Polycode/QuaternionTween"
+require "Polycode/TweenManager"
+require "Polycode/Vector2"
+require "Polycode/Vector3"
+require "Polycode/Vertex"

+ 52 - 0
Bindings/Contents/LUA/API/Polycode/BezierCurve.lua

@@ -0,0 +1,52 @@
+class "BezierCurve"
+
+function BezierCurve:BezierCurve()
+	if self.__ptr == nil then
+		self.__ptr = Polycore.BezierCurve()
+	end
+end
+
+function BezierCurve:getControlPoint(index)
+	return Polycore.BezierCurve_getControlPoint(self.__ptr, index)
+end
+
+function BezierCurve:getNumControlPoints()
+	return Polycore.BezierCurve_getNumControlPoints(self.__ptr)
+end
+
+function BezierCurve:addControlPoint(p1x, p1y, p1z, p2x, p2y, p2z, p3x, p3y, p3z)
+	return Polycore.BezierCurve_addControlPoint(self.__ptr, p1x, p1y, p1z, p2x, p2y, p2z, p3x, p3y, p3z)
+end
+
+function BezierCurve:addControlPoint3dWithHandles(p1x, p1y, p1z, p2x, p2y, p2z, p3x, p3y, p3z)
+	return Polycore.BezierCurve_addControlPoint3dWithHandles(self.__ptr, p1x, p1y, p1z, p2x, p2y, p2z, p3x, p3y, p3z)
+end
+
+function BezierCurve:addControlPoint3d(x, y, z)
+	return Polycore.BezierCurve_addControlPoint3d(self.__ptr, x, y, z)
+end
+
+function BezierCurve:addControlPoint2dWithHandles(p1x, p1y, p2x, p2y, p3x, p3y)
+	return Polycore.BezierCurve_addControlPoint2dWithHandles(self.__ptr, p1x, p1y, p2x, p2y, p3x, p3y)
+end
+
+function BezierCurve:addControlPoint2d(x, y)
+	return Polycore.BezierCurve_addControlPoint2d(self.__ptr, x, y)
+end
+
+function BezierCurve:getHeightAt(a)
+	return Polycore.BezierCurve_getHeightAt(self.__ptr, a)
+end
+
+function BezierCurve:getPointAt(a)
+	return Polycore.BezierCurve_getPointAt(self.__ptr, a)
+end
+
+function BezierCurve:getPointBetween(a, bp1, bp2)
+	return Polycore.BezierCurve_getPointBetween(self.__ptr, a, bp1.__ptr, bp2.__ptr)
+end
+
+function BezierCurve:rebuildBuffers()
+	return Polycore.BezierCurve_rebuildBuffers(self.__ptr)
+end
+

+ 14 - 0
Bindings/Contents/LUA/API/Polycode/BezierPathTween.lua

@@ -0,0 +1,14 @@
+require "Polycode/Tween"
+
+class "BezierPathTween" (Tween)
+
+function BezierPathTween:BezierPathTween(target, curve, easeType, time, _repeat)
+	if self.__ptr == nil then
+		self.__ptr = Polycore.BezierPathTween(target, curve, easeType, time, _repeat)
+	end
+end
+
+function BezierPathTween:updateCustomTween()
+	return Polycore.BezierPathTween_updateCustomTween(self.__ptr)
+end
+

+ 82 - 0
Bindings/Contents/LUA/API/Polycode/Bone.lua

@@ -0,0 +1,82 @@
+require "Polycode/SceneEntity"
+
+class "Bone" (SceneEntity)
+
+function Bone:Bone(boneName)
+	if self.__ptr == nil then
+		self.__ptr = Polycore.Bone(boneName)
+	end
+end
+
+function Bone:enableBoneLabel(labelFont, size, scale, labelColor)
+	return Polycore.Bone_enableBoneLabel(self.__ptr, labelFont, size, scale, labelColor.__ptr)
+end
+
+function Bone:getName()
+	return Polycore.Bone_getName(self.__ptr)
+end
+
+function Bone:Render()
+	return Polycore.Bone_Render(self.__ptr)
+end
+
+function Bone:setParentBone(bone)
+	return Polycore.Bone_setParentBone(self.__ptr, bone.__ptr)
+end
+
+function Bone:addChildBone(bone)
+	return Polycore.Bone_addChildBone(self.__ptr, bone.__ptr)
+end
+
+function Bone:getParentBone()
+	return Polycore.Bone_getParentBone(self.__ptr)
+end
+
+function Bone:getNumChildBones()
+	return Polycore.Bone_getNumChildBones(self.__ptr)
+end
+
+function Bone:getChildBone(index)
+	return Polycore.Bone_getChildBone(self.__ptr, index)
+end
+
+function Bone:getBoneMatrix()
+	return Polycore.Bone_getBoneMatrix(self.__ptr)
+end
+
+function Bone:setBoneMatrix(matrix)
+	return Polycore.Bone_setBoneMatrix(self.__ptr, matrix.__ptr)
+end
+
+function Bone:getRestMatrix()
+	return Polycore.Bone_getRestMatrix(self.__ptr)
+end
+
+function Bone:getFullRestMatrix()
+	return Polycore.Bone_getFullRestMatrix(self.__ptr)
+end
+
+function Bone:getParentRestMatrix()
+	return Polycore.Bone_getParentRestMatrix(self.__ptr)
+end
+
+function Bone:getFinalMatrix()
+	return Polycore.Bone_getFinalMatrix(self.__ptr)
+end
+
+function Bone:setRestMatrix(matrix)
+	return Polycore.Bone_setRestMatrix(self.__ptr, matrix.__ptr)
+end
+
+function Bone:setBaseMatrix(matrix)
+	return Polycore.Bone_setBaseMatrix(self.__ptr, matrix.__ptr)
+end
+
+function Bone:getBaseMatrix()
+	return Polycore.Bone_getBaseMatrix(self.__ptr)
+end
+
+function Bone:getFullBaseMatrix()
+	return Polycore.Bone_getFullBaseMatrix(self.__ptr)
+end
+

+ 24 - 0
Bindings/Contents/LUA/API/Polycode/BoneTrack.lua

@@ -0,0 +1,24 @@
+class "BoneTrack"
+
+function BoneTrack:BoneTrack(bone, length)
+	if self.__ptr == nil then
+		self.__ptr = Polycore.BoneTrack(bone, length)
+	end
+end
+
+function BoneTrack:Play()
+	return Polycore.BoneTrack_Play(self.__ptr)
+end
+
+function BoneTrack:Stop()
+	return Polycore.BoneTrack_Stop(self.__ptr)
+end
+
+function BoneTrack:Update()
+	return Polycore.BoneTrack_Update(self.__ptr)
+end
+
+function BoneTrack:setSpeed(speed)
+	return Polycore.BoneTrack_setSpeed(self.__ptr, speed)
+end
+

+ 74 - 0
Bindings/Contents/LUA/API/Polycode/Camera.lua

@@ -0,0 +1,74 @@
+require "Polycode/SceneEntity"
+
+class "Camera" (SceneEntity)
+
+function Camera:Camera(parentScene)
+	if self.__ptr == nil then
+		self.__ptr = Polycore.Camera(parentScene)
+	end
+end
+
+function Camera:buildFrustrumPlanes()
+	return Polycore.Camera_buildFrustrumPlanes(self.__ptr)
+end
+
+function Camera:isSphereInFrustrum(pos, fRadius)
+	return Polycore.Camera_isSphereInFrustrum(self.__ptr, pos.__ptr, fRadius)
+end
+
+function Camera:canSee(entity)
+	return Polycore.Camera_canSee(self.__ptr, entity.__ptr)
+end
+
+function Camera:setOrthoMode(mode)
+	return Polycore.Camera_setOrthoMode(self.__ptr, mode)
+end
+
+function Camera:getOrthoMode()
+	return Polycore.Camera_getOrthoMode(self.__ptr)
+end
+
+function Camera:setFOV(fov)
+	return Polycore.Camera_setFOV(self.__ptr, fov)
+end
+
+function Camera:getFOV()
+	return Polycore.Camera_getFOV(self.__ptr)
+end
+
+function Camera:doCameraTransform()
+	return Polycore.Camera_doCameraTransform(self.__ptr)
+end
+
+function Camera:setLightDepthTexture(texture)
+	return Polycore.Camera_setLightDepthTexture(self.__ptr, texture.__ptr)
+end
+
+function Camera:setParentScene(parentScene)
+	return Polycore.Camera_setParentScene(self.__ptr, parentScene.__ptr)
+end
+
+function Camera:hasFilterShader()
+	return Polycore.Camera_hasFilterShader(self.__ptr)
+end
+
+function Camera:drawFilter()
+	return Polycore.Camera_drawFilter(self.__ptr)
+end
+
+function Camera:setExposureLevel(level)
+	return Polycore.Camera_setExposureLevel(self.__ptr, level)
+end
+
+function Camera:getExposureLevel()
+	return Polycore.Camera_getExposureLevel(self.__ptr)
+end
+
+function Camera:createPostFilter(shaderMaterial)
+	return Polycore.Camera_createPostFilter(self.__ptr, shaderMaterial.__ptr)
+end
+
+function Camera:setPostFilter(shaderName)
+	return Polycore.Camera_setPostFilter(self.__ptr, shaderName)
+end
+

+ 44 - 0
Bindings/Contents/LUA/API/Polycode/Color.lua

@@ -0,0 +1,44 @@
+class "Color"
+
+function Color:Color()
+	if self.__ptr == nil then
+		self.__ptr = Polycore.Color()
+	end
+end
+
+function Color:setColorHex(hex)
+	return Polycore.Color_setColorHex(self.__ptr, hex)
+end
+
+function Color:setColorHexRGB(hex)
+	return Polycore.Color_setColorHexRGB(self.__ptr, hex)
+end
+
+function Color:setColorHSV(h, s, v)
+	return Polycore.Color_setColorHSV(self.__ptr, h, s, v)
+end
+
+function Color:setColorRGBA(r, g, b, a)
+	return Polycore.Color_setColorRGBA(self.__ptr, r, g, b, a)
+end
+
+function Color:setColorRGB(r, g, b)
+	return Polycore.Color_setColorRGB(self.__ptr, r, g, b)
+end
+
+function Color:setColor(r, g, b, a)
+	return Polycore.Color_setColor(self.__ptr, r, g, b, a)
+end
+
+function Color:Random()
+	return Polycore.Color_Random(self.__ptr)
+end
+
+function Color:getBrightness()
+	return Polycore.Color_getBrightness(self.__ptr)
+end
+
+function Color:getUint()
+	return Polycore.Color_getUint(self.__ptr)
+end
+

+ 36 - 0
Bindings/Contents/LUA/API/Polycode/Config.lua

@@ -0,0 +1,36 @@
+class "Config"
+
+function Config:Config()
+	if self.__ptr == nil then
+		self.__ptr = Polycore.Config()
+	end
+end
+
+function Config:loadConfig(configNamespace, fileName)
+	return Polycore.Config_loadConfig(self.__ptr, configNamespace, fileName)
+end
+
+function Config:saveConfig(configNamespace, fileName)
+	return Polycore.Config_saveConfig(self.__ptr, configNamespace, fileName)
+end
+
+function Config:getEntry(configNamespace, key)
+	return Polycore.Config_getEntry(self.__ptr, configNamespace, key)
+end
+
+function Config:setStringValue(configNamespace, key, value)
+	return Polycore.Config_setStringValue(self.__ptr, configNamespace, key, value)
+end
+
+function Config:setNumericValue(configNamespace, key, value)
+	return Polycore.Config_setNumericValue(self.__ptr, configNamespace, key, value)
+end
+
+function Config:getNumericValue(configNamespace, key)
+	return Polycore.Config_getNumericValue(self.__ptr, configNamespace, key)
+end
+
+function Config:getStringValue(configNamespace, key)
+	return Polycore.Config_getStringValue(self.__ptr, configNamespace, key)
+end
+

+ 54 - 0
Bindings/Contents/LUA/API/Polycode/CoreInput.lua

@@ -0,0 +1,54 @@
+require "Polycode/EventDispatcher"
+
+class "CoreInput" (EventDispatcher)
+
+function CoreInput:CoreInput()
+	if self.__ptr == nil then
+		self.__ptr = Polycore.CoreInput()
+	end
+end
+
+function CoreInput:mouseWheelUp(ticks)
+	return Polycore.CoreInput_mouseWheelUp(self.__ptr, ticks)
+end
+
+function CoreInput:mouseWheelDown(ticks)
+	return Polycore.CoreInput_mouseWheelDown(self.__ptr, ticks)
+end
+
+function CoreInput:getMouseButtonState(mouseButton)
+	return Polycore.CoreInput_getMouseButtonState(self.__ptr, mouseButton)
+end
+
+function CoreInput:setMouseButtonState(mouseButton, state, ticks)
+	return Polycore.CoreInput_setMouseButtonState(self.__ptr, mouseButton, state, ticks)
+end
+
+function CoreInput:setMousePosition(x, y, ticks)
+	return Polycore.CoreInput_setMousePosition(self.__ptr, x, y, ticks)
+end
+
+function CoreInput:getMousePosition()
+	return Polycore.CoreInput_getMousePosition(self.__ptr)
+end
+
+function CoreInput:setKeyState(keyCode, code, newState, ticks)
+	return Polycore.CoreInput_setKeyState(self.__ptr, keyCode.__ptr, code.__ptr, newState, ticks)
+end
+
+function CoreInput:getKeyState(keyCode)
+	return Polycore.CoreInput_getKeyState(self.__ptr, keyCode.__ptr)
+end
+
+function CoreInput:getMouseDelta()
+	return Polycore.CoreInput_getMouseDelta(self.__ptr)
+end
+
+function CoreInput:setDeltaPosition(x, y)
+	return Polycore.CoreInput_setDeltaPosition(self.__ptr, x, y)
+end
+
+function CoreInput:createEvent(event)
+	return Polycore.CoreInput_createEvent(self.__ptr, event.__ptr)
+end
+

+ 76 - 0
Bindings/Contents/LUA/API/Polycode/CoreServices.lua

@@ -0,0 +1,76 @@
+require "Polycode/EventDispatcher"
+
+class "CoreServices" (EventDispatcher)
+
+function CoreServices:getInstance()
+	return Polycore.CoreServices_getInstance(self.__ptr)
+end
+
+function CoreServices:getRenderMutex()
+	return Polycore.CoreServices_getRenderMutex(self.__ptr)
+end
+
+function CoreServices:setRenderer(r_enderer)
+	return Polycore.CoreServices_setRenderer(self.__ptr, r_enderer.__ptr)
+end
+
+function CoreServices:getRenderer()
+	return Polycore.CoreServices_getRenderer(self.__ptr)
+end
+
+function CoreServices:Update(elapsed)
+	return Polycore.CoreServices_Update(self.__ptr, elapsed)
+end
+
+function CoreServices:setCore(core)
+	return Polycore.CoreServices_setCore(self.__ptr, core.__ptr)
+end
+
+function CoreServices:getCore()
+	return Polycore.CoreServices_getCore(self.__ptr)
+end
+
+function CoreServices:handleEvent(event)
+	return Polycore.CoreServices_handleEvent(self.__ptr, event.__ptr)
+end
+
+function CoreServices:installModule(module)
+	return Polycore.CoreServices_installModule(self.__ptr, module.__ptr)
+end
+
+function CoreServices:getMaterialManager()
+	return Polycore.CoreServices_getMaterialManager(self.__ptr)
+end
+
+function CoreServices:getScreenManager()
+	return Polycore.CoreServices_getScreenManager(self.__ptr)
+end
+
+function CoreServices:getSceneManager()
+	return Polycore.CoreServices_getSceneManager(self.__ptr)
+end
+
+function CoreServices:getTimerManager()
+	return Polycore.CoreServices_getTimerManager(self.__ptr)
+end
+
+function CoreServices:getTweenManager()
+	return Polycore.CoreServices_getTweenManager(self.__ptr)
+end
+
+function CoreServices:getResourceManager()
+	return Polycore.CoreServices_getResourceManager(self.__ptr)
+end
+
+function CoreServices:getSoundManager()
+	return Polycore.CoreServices_getSoundManager(self.__ptr)
+end
+
+function CoreServices:getFontManager()
+	return Polycore.CoreServices_getFontManager(self.__ptr)
+end
+
+function CoreServices:getConfig()
+	return Polycore.CoreServices_getConfig(self.__ptr)
+end
+

+ 10 - 0
Bindings/Contents/LUA/API/Polycode/Cubemap.lua

@@ -0,0 +1,10 @@
+require "Polycode/Resource"
+
+class "Cubemap" (Resource)
+
+function Cubemap:Cubemap(t0, t1, t2, t3, t4, t5)
+	if self.__ptr == nil then
+		self.__ptr = Polycore.Cubemap(t0, t1, t2, t3, t4, t5)
+	end
+end
+

+ 28 - 0
Bindings/Contents/LUA/API/Polycode/Data.lua

@@ -0,0 +1,28 @@
+class "Data"
+
+function Data:Data()
+	if self.__ptr == nil then
+		self.__ptr = Polycore.Data()
+	end
+end
+
+function Data:loadFromFile(fileName)
+	return Polycore.Data_loadFromFile(self.__ptr, fileName)
+end
+
+function Data:getAsString(encoding)
+	return Polycore.Data_getAsString(self.__ptr, encoding)
+end
+
+function Data:setFromString(str, encoding)
+	return Polycore.Data_setFromString(self.__ptr, str, encoding)
+end
+
+function Data:saveToFile(fileName)
+	return Polycore.Data_saveToFile(self.__ptr, fileName)
+end
+
+function Data:getData()
+	return Polycore.Data_getData(self.__ptr)
+end
+

+ 276 - 0
Bindings/Contents/LUA/API/Polycode/Entity.lua

@@ -0,0 +1,276 @@
+class "Entity"
+
+function Entity:Entity()
+	if self.__ptr == nil then
+		self.__ptr = Polycore.Entity()
+	end
+end
+
+function Entity:Render()
+	return Polycore.Entity_Render(self.__ptr)
+end
+
+function Entity:Update()
+	return Polycore.Entity_Update(self.__ptr)
+end
+
+function Entity:transformAndRender()
+	return Polycore.Entity_transformAndRender(self.__ptr)
+end
+
+function Entity:setMatrix(matrix)
+	return Polycore.Entity_setMatrix(self.__ptr, matrix.__ptr)
+end
+
+function Entity:rebuildTransformMatrix()
+	return Polycore.Entity_rebuildTransformMatrix(self.__ptr)
+end
+
+function Entity:addEntity(newChild)
+	return Polycore.Entity_addEntity(self.__ptr, newChild.__ptr)
+end
+
+function Entity:addChild(newChild)
+	return Polycore.Entity_addChild(self.__ptr, newChild.__ptr)
+end
+
+function Entity:removeChild(entityToRemove)
+	return Polycore.Entity_removeChild(self.__ptr, entityToRemove.__ptr)
+end
+
+function Entity:updateEntityMatrix()
+	return Polycore.Entity_updateEntityMatrix(self.__ptr)
+end
+
+function Entity:renderChildren()
+	return Polycore.Entity_renderChildren(self.__ptr)
+end
+
+function Entity:getPosition()
+	return Polycore.Entity_getPosition(self.__ptr)
+end
+
+function Entity:setPosition(x, y, z)
+	return Polycore.Entity_setPosition(self.__ptr, x, y, z)
+end
+
+function Entity:setPositionX(x)
+	return Polycore.Entity_setPositionX(self.__ptr, x)
+end
+
+function Entity:setPositionY(y)
+	return Polycore.Entity_setPositionY(self.__ptr, y)
+end
+
+function Entity:setPositionZ(z)
+	return Polycore.Entity_setPositionZ(self.__ptr, z)
+end
+
+function Entity:setScaleX(x)
+	return Polycore.Entity_setScaleX(self.__ptr, x)
+end
+
+function Entity:setScaleY(y)
+	return Polycore.Entity_setScaleY(self.__ptr, y)
+end
+
+function Entity:setScaleZ(z)
+	return Polycore.Entity_setScaleZ(self.__ptr, z)
+end
+
+function Entity:Translate(x, y, z)
+	return Polycore.Entity_Translate(self.__ptr, x, y, z)
+end
+
+function Entity:Scale(x, y, z)
+	return Polycore.Entity_Scale(self.__ptr, x, y, z)
+end
+
+function Entity:setScale(x, y, z)
+	return Polycore.Entity_setScale(self.__ptr, x, y, z)
+end
+
+function Entity:getScale()
+	return Polycore.Entity_getScale(self.__ptr)
+end
+
+function Entity:getCombinedPosition()
+	return Polycore.Entity_getCombinedPosition(self.__ptr)
+end
+
+function Entity:getCombinedPitch()
+	return Polycore.Entity_getCombinedPitch(self.__ptr)
+end
+
+function Entity:getCombinedYaw()
+	return Polycore.Entity_getCombinedYaw(self.__ptr)
+end
+
+function Entity:getCombinedRoll()
+	return Polycore.Entity_getCombinedRoll(self.__ptr)
+end
+
+function Entity:setParentEntity(entity)
+	return Polycore.Entity_setParentEntity(self.__ptr, entity.__ptr)
+end
+
+function Entity:getParentEntity()
+	return Polycore.Entity_getParentEntity(self.__ptr)
+end
+
+function Entity:rebuildRotation()
+	return Polycore.Entity_rebuildRotation(self.__ptr)
+end
+
+function Entity:dirtyMatrix(val)
+	return Polycore.Entity_dirtyMatrix(self.__ptr, val)
+end
+
+function Entity:setPitch(pitch)
+	return Polycore.Entity_setPitch(self.__ptr, pitch)
+end
+
+function Entity:setYaw(yaw)
+	return Polycore.Entity_setYaw(self.__ptr, yaw)
+end
+
+function Entity:setRoll(roll)
+	return Polycore.Entity_setRoll(self.__ptr, roll)
+end
+
+function Entity:Roll(roll)
+	return Polycore.Entity_Roll(self.__ptr, roll)
+end
+
+function Entity:Yaw(roll)
+	return Polycore.Entity_Yaw(self.__ptr, roll)
+end
+
+function Entity:Pitch(roll)
+	return Polycore.Entity_Pitch(self.__ptr, roll)
+end
+
+function Entity:getPitch()
+	return Polycore.Entity_getPitch(self.__ptr)
+end
+
+function Entity:getYaw()
+	return Polycore.Entity_getYaw(self.__ptr)
+end
+
+function Entity:getRoll()
+	return Polycore.Entity_getRoll(self.__ptr)
+end
+
+function Entity:setRotationQuat(w, x, y, z)
+	return Polycore.Entity_setRotationQuat(self.__ptr, w, x, y, z)
+end
+
+function Entity:getRotationQuat()
+	return Polycore.Entity_getRotationQuat(self.__ptr)
+end
+
+function Entity:getTransformMatrix()
+	return Polycore.Entity_getTransformMatrix(self.__ptr)
+end
+
+function Entity:getConcatenatedMatrix()
+	return Polycore.Entity_getConcatenatedMatrix(self.__ptr)
+end
+
+function Entity:getConcatenatedRollMatrix()
+	return Polycore.Entity_getConcatenatedRollMatrix(self.__ptr)
+end
+
+function Entity:setTransformByMatrix(matrix)
+	return Polycore.Entity_setTransformByMatrix(self.__ptr, matrix.__ptr)
+end
+
+function Entity:setTransformByMatrixPure(matrix)
+	return Polycore.Entity_setTransformByMatrixPure(self.__ptr, matrix.__ptr)
+end
+
+function Entity:setRenderer(r_enderer)
+	return Polycore.Entity_setRenderer(self.__ptr, r_enderer.__ptr)
+end
+
+function Entity:getCombinedColor()
+	return Polycore.Entity_getCombinedColor(self.__ptr)
+end
+
+function Entity:setColor(r, g, b, a)
+	return Polycore.Entity_setColor(self.__ptr, r, g, b, a)
+end
+
+function Entity:setColorInt(r, g, b, a)
+	return Polycore.Entity_setColorInt(self.__ptr, r, g, b, a)
+end
+
+function Entity:recalculateBBox()
+	return Polycore.Entity_recalculateBBox(self.__ptr)
+end
+
+function Entity:getBBoxRadius()
+	return Polycore.Entity_getBBoxRadius(self.__ptr)
+end
+
+function Entity:getCompoundBBoxRadius()
+	return Polycore.Entity_getCompoundBBoxRadius(self.__ptr)
+end
+
+function Entity:setBBoxRadius(rad)
+	return Polycore.Entity_setBBoxRadius(self.__ptr, rad)
+end
+
+function Entity:setBlendingMode(newBl_endingMode)
+	return Polycore.Entity_setBlendingMode(self.__ptr, newBl_endingMode)
+end
+
+function Entity:getChildCenter()
+	return Polycore.Entity_getChildCenter(self.__ptr)
+end
+
+function Entity:setDepthWrite(val)
+	return Polycore.Entity_setDepthWrite(self.__ptr, val)
+end
+
+function Entity:doUpdates()
+	return Polycore.Entity_doUpdates(self.__ptr)
+end
+
+function Entity:lookAt(loc, upVector)
+	return Polycore.Entity_lookAt(self.__ptr, loc.__ptr, upVector.__ptr)
+end
+
+function Entity:lookAtEntity(entity, upVector)
+	return Polycore.Entity_lookAtEntity(self.__ptr, entity.__ptr, upVector.__ptr)
+end
+
+function Entity:getLookAtMatrix(loc, upVector)
+	return Polycore.Entity_getLookAtMatrix(self.__ptr, loc.__ptr, upVector.__ptr)
+end
+
+function Entity:buildPositionMatrix()
+	return Polycore.Entity_buildPositionMatrix(self.__ptr)
+end
+
+function Entity:adjustMatrixForChildren()
+	return Polycore.Entity_adjustMatrixForChildren(self.__ptr)
+end
+
+function Entity:setMask(mask)
+	return Polycore.Entity_setMask(self.__ptr, mask.__ptr)
+end
+
+function Entity:clearMask()
+	return Polycore.Entity_clearMask(self.__ptr)
+end
+
+function Entity:getCompoundScale()
+	return Polycore.Entity_getCompoundScale(self.__ptr)
+end
+
+function Entity:getEntityProp(propName)
+	return Polycore.Entity_getEntityProp(self.__ptr, propName)
+end
+

+ 28 - 0
Bindings/Contents/LUA/API/Polycode/Event.lua

@@ -0,0 +1,28 @@
+class "Event"
+
+function Event:Event()
+	if self.__ptr == nil then
+		self.__ptr = Polycore.Event()
+	end
+end
+
+function Event:getEventCode()
+	return Polycore.Event_getEventCode(self.__ptr)
+end
+
+function Event:setEventCode(eventCode)
+	return Polycore.Event_setEventCode(self.__ptr, eventCode)
+end
+
+function Event:getDispatcher()
+	return Polycore.Event_getDispatcher(self.__ptr)
+end
+
+function Event:setDispatcher(dispatcher)
+	return Polycore.Event_setDispatcher(self.__ptr, dispatcher.__ptr)
+end
+
+function Event:getEventType()
+	return Polycore.Event_getEventType(self.__ptr)
+end
+

+ 38 - 0
Bindings/Contents/LUA/API/Polycode/EventDispatcher.lua

@@ -0,0 +1,38 @@
+require "Polycode/EventHandler"
+
+class "EventDispatcher" (EventHandler)
+
+function EventDispatcher:EventDispatcher()
+	if self.__ptr == nil then
+		self.__ptr = Polycore.EventDispatcher()
+	end
+end
+
+function EventDispatcher:removeAllHandlers()
+	return Polycore.EventDispatcher_removeAllHandlers(self.__ptr)
+end
+
+function EventDispatcher:removeAllHandlersForListener(listener)
+	return Polycore.EventDispatcher_removeAllHandlersForListener(self.__ptr, listener.__ptr)
+end
+
+function EventDispatcher:addEventListener(handler, eventCode)
+	return Polycore.EventDispatcher_addEventListener(self.__ptr, handler.__ptr, eventCode)
+end
+
+function EventDispatcher:removeEventListener(handler, eventCode)
+	return Polycore.EventDispatcher_removeEventListener(self.__ptr, handler.__ptr, eventCode)
+end
+
+function EventDispatcher:__dispatchEvent(event, eventCode)
+	return Polycore.EventDispatcher___dispatchEvent(self.__ptr, event.__ptr, eventCode)
+end
+
+function EventDispatcher:dispatchEvent(event, eventCode)
+	return Polycore.EventDispatcher_dispatchEvent(self.__ptr, event.__ptr, eventCode)
+end
+
+function EventDispatcher:dispatchEventNoDelete(event, eventCode)
+	return Polycore.EventDispatcher_dispatchEventNoDelete(self.__ptr, event.__ptr, eventCode)
+end
+

+ 16 - 0
Bindings/Contents/LUA/API/Polycode/EventHandler.lua

@@ -0,0 +1,16 @@
+class "EventHandler"
+
+function EventHandler:EventHandler()
+	if self.__ptr == nil then
+		self.__ptr = Polycore.EventHandler()
+	end
+end
+
+function EventHandler:secondaryHandler(event)
+	return Polycore.EventHandler_secondaryHandler(self.__ptr, event.__ptr)
+end
+
+function EventHandler:handleEvent(event)
+	return Polycore.EventHandler_handleEvent(self.__ptr, event.__ptr)
+end
+

+ 12 - 0
Bindings/Contents/LUA/API/Polycode/FixedShader.lua

@@ -0,0 +1,12 @@
+class "FixedShader"
+
+function FixedShader:FixedShader()
+	if self.__ptr == nil then
+		self.__ptr = Polycore.FixedShader()
+	end
+end
+
+function FixedShader:createBinding()
+	return Polycore.FixedShader_createBinding(self.__ptr)
+end
+

+ 24 - 0
Bindings/Contents/LUA/API/Polycode/FixedShaderBinding.lua

@@ -0,0 +1,24 @@
+class "FixedShaderBinding"
+
+function FixedShaderBinding:FixedShaderBinding(shader)
+	if self.__ptr == nil then
+		self.__ptr = Polycore.FixedShaderBinding(shader)
+	end
+end
+
+function FixedShaderBinding:addTexture(name, texture)
+	return Polycore.FixedShaderBinding_addTexture(self.__ptr, name, texture.__ptr)
+end
+
+function FixedShaderBinding:addCubemap(name, cubemap)
+	return Polycore.FixedShaderBinding_addCubemap(self.__ptr, name, cubemap.__ptr)
+end
+
+function FixedShaderBinding:addParam(type, name, value)
+	return Polycore.FixedShaderBinding_addParam(self.__ptr, type, name, value)
+end
+
+function FixedShaderBinding:getDiffuseTexture()
+	return Polycore.FixedShaderBinding_getDiffuseTexture(self.__ptr)
+end
+

+ 16 - 0
Bindings/Contents/LUA/API/Polycode/Font.lua

@@ -0,0 +1,16 @@
+class "Font"
+
+function Font:Font(fileName)
+	if self.__ptr == nil then
+		self.__ptr = Polycore.Font(fileName)
+	end
+end
+
+function Font:getFace()
+	return Polycore.Font_getFace(self.__ptr)
+end
+
+function Font:isValid()
+	return Polycore.Font_isValid(self.__ptr)
+end
+

+ 16 - 0
Bindings/Contents/LUA/API/Polycode/FontManager.lua

@@ -0,0 +1,16 @@
+class "FontManager"
+
+function FontManager:FontManager()
+	if self.__ptr == nil then
+		self.__ptr = Polycore.FontManager()
+	end
+end
+
+function FontManager:registerFont(fontName, fontPath)
+	return Polycore.FontManager_registerFont(self.__ptr, fontName, fontPath)
+end
+
+function FontManager:getFontByName(fontName)
+	return Polycore.FontManager_getFontByName(self.__ptr, fontName)
+end
+

+ 76 - 0
Bindings/Contents/LUA/API/Polycode/GenericScene.lua

@@ -0,0 +1,76 @@
+class "GenericScene"
+
+function GenericScene:GenericScene()
+	if self.__ptr == nil then
+		self.__ptr = Polycore.GenericScene()
+	end
+end
+
+function GenericScene:Render()
+	return Polycore.GenericScene_Render(self.__ptr)
+end
+
+function GenericScene:RenderDepthOnly(targetCamera)
+	return Polycore.GenericScene_RenderDepthOnly(self.__ptr, targetCamera.__ptr)
+end
+
+function GenericScene:addGrid(gridTexture)
+	return Polycore.GenericScene_addGrid(self.__ptr, gridTexture)
+end
+
+function GenericScene:readString(inFile)
+	return Polycore.GenericScene_readString(self.__ptr, inFile.__ptr)
+end
+
+function GenericScene:loadScene(fileName)
+	return Polycore.GenericScene_loadScene(self.__ptr, fileName)
+end
+
+function GenericScene:generateLightmaps(lightMapRes, lightMapQuality, numRadPasses)
+	return Polycore.GenericScene_generateLightmaps(self.__ptr, lightMapRes, lightMapQuality, numRadPasses)
+end
+
+function GenericScene:addLight(light)
+	return Polycore.GenericScene_addLight(self.__ptr, light.__ptr)
+end
+
+function GenericScene:getNearestLight(pos)
+	return Polycore.GenericScene_getNearestLight(self.__ptr, pos.__ptr)
+end
+
+function GenericScene:writeEntityMatrix(entity, outFile)
+	return Polycore.GenericScene_writeEntityMatrix(self.__ptr, entity.__ptr, outFile.__ptr)
+end
+
+function GenericScene:writeString(str, outFile)
+	return Polycore.GenericScene_writeString(self.__ptr, str, outFile.__ptr)
+end
+
+function GenericScene:saveScene(fileName)
+	return Polycore.GenericScene_saveScene(self.__ptr, fileName)
+end
+
+function GenericScene:getNumStaticGeometry()
+	return Polycore.GenericScene_getNumStaticGeometry(self.__ptr)
+end
+
+function GenericScene:getStaticGeometry(index)
+	return Polycore.GenericScene_getStaticGeometry(self.__ptr, index)
+end
+
+function GenericScene:loadCollisionChild(entity, autoCollide, type)
+	return Polycore.GenericScene_loadCollisionChild(self.__ptr, entity.__ptr, autoCollide, type)
+end
+
+function GenericScene:getNumLights()
+	return Polycore.GenericScene_getNumLights(self.__ptr)
+end
+
+function GenericScene:getLight(index)
+	return Polycore.GenericScene_getLight(self.__ptr, index)
+end
+
+function GenericScene:getCustomEntityByType(type)
+	return Polycore.GenericScene_getCustomEntityByType(self.__ptr, type)
+end
+

+ 120 - 0
Bindings/Contents/LUA/API/Polycode/Image.lua

@@ -0,0 +1,120 @@
+class "Image"
+
+function Image:Image(fileName)
+	if self.__ptr == nil then
+		self.__ptr = Polycore.Image(fileName)
+	end
+end
+
+function Image:loadImage(fileName)
+	return Polycore.Image_loadImage(self.__ptr, fileName)
+end
+
+function Image:loadPNG(fileName)
+	return Polycore.Image_loadPNG(self.__ptr, fileName)
+end
+
+function Image:createEmpty(width, height)
+	return Polycore.Image_createEmpty(self.__ptr, width, height)
+end
+
+function Image:fill(r, g, b, a)
+	return Polycore.Image_fill(self.__ptr, r, g, b, a)
+end
+
+function Image:setPixel(x, y, r, g, b, a)
+	return Polycore.Image_setPixel(self.__ptr, x, y, r, g, b, a)
+end
+
+function Image:getPixel(x, y)
+	return Polycore.Image_getPixel(self.__ptr, x, y)
+end
+
+function Image:setAAPixel(x, y, col)
+	return Polycore.Image_setAAPixel(self.__ptr, x, y, col.__ptr)
+end
+
+function Image:swap(v1, v2)
+	return Polycore.Image_swap(self.__ptr, v1.__ptr, v2.__ptr)
+end
+
+function Image:line(x0, y0, x1, y1, col)
+	return Polycore.Image_line(self.__ptr, x0, y0, x1, y1, col.__ptr)
+end
+
+function Image:moveTo(x, y)
+	return Polycore.Image_moveTo(self.__ptr, x, y)
+end
+
+function Image:move(x, y)
+	return Polycore.Image_move(self.__ptr, x, y)
+end
+
+function Image:lineTo(x, y, col)
+	return Polycore.Image_lineTo(self.__ptr, x, y, col.__ptr)
+end
+
+function Image:drawRect(x, y, w, h, col)
+	return Polycore.Image_drawRect(self.__ptr, x, y, w, h, col.__ptr)
+end
+
+function Image:perlinNoise(seed, alpha)
+	return Polycore.Image_perlinNoise(self.__ptr, seed, alpha)
+end
+
+function Image:fastBlur(blurSize)
+	return Polycore.Image_fastBlur(self.__ptr, blurSize)
+end
+
+function Image:fastBlurVert(blurSize)
+	return Polycore.Image_fastBlurVert(self.__ptr, blurSize)
+end
+
+function Image:fastBlurHor(blurSize)
+	return Polycore.Image_fastBlurHor(self.__ptr, blurSize)
+end
+
+function Image:darken(amt, color, alpha)
+	return Polycore.Image_darken(self.__ptr, amt, color, alpha)
+end
+
+function Image:lighten(amt, color, alpha)
+	return Polycore.Image_lighten(self.__ptr, amt, color, alpha)
+end
+
+function Image:multiply(amt, color, alpha)
+	return Polycore.Image_multiply(self.__ptr, amt, color, alpha)
+end
+
+function Image:getBrushX()
+	return Polycore.Image_getBrushX(self.__ptr)
+end
+
+function Image:getBrushY()
+	return Polycore.Image_getBrushY(self.__ptr)
+end
+
+function Image:isLoaded()
+	return Polycore.Image_isLoaded(self.__ptr)
+end
+
+function Image:getType()
+	return Polycore.Image_getType(self.__ptr)
+end
+
+function Image:writeBMP(fileName)
+	return Polycore.Image_writeBMP(self.__ptr, fileName)
+end
+
+function Image:getWidth()
+	return Polycore.Image_getWidth(self.__ptr)
+end
+
+function Image:getHeight()
+	return Polycore.Image_getHeight(self.__ptr)
+end
+
+function Image:getPixels()
+	return Polycore.Image_getPixels(self.__ptr)
+end
+

+ 14 - 0
Bindings/Contents/LUA/API/Polycode/InputEvent.lua

@@ -0,0 +1,14 @@
+require "Polycode/Event"
+
+class "InputEvent" (Event)
+
+function InputEvent:InputEvent(mousePosition, timestamp)
+	if self.__ptr == nil then
+		self.__ptr = Polycore.InputEvent(mousePosition, timestamp)
+	end
+end
+
+function InputEvent:keyCode()
+	return Polycore.InputEvent_keyCode(self.__ptr)
+end
+

+ 30 - 0
Bindings/Contents/LUA/API/Polycode/Label.lua

@@ -0,0 +1,30 @@
+require "Polycode/Image"
+
+class "Label" (Image)
+
+function Label:Label(font, text, size, antiAliasMode)
+	if self.__ptr == nil then
+		self.__ptr = Polycore.Label(font, text, size, antiAliasMode)
+	end
+end
+
+function Label:setText(text)
+	return Polycore.Label_setText(self.__ptr, text)
+end
+
+function Label:getText()
+	return Polycore.Label_getText(self.__ptr)
+end
+
+function Label:getTextWidth(font, text, size)
+	return Polycore.Label_getTextWidth(self.__ptr, font.__ptr, text, size)
+end
+
+function Label:getTextHeight(font, text, size)
+	return Polycore.Label_getTextHeight(self.__ptr, font.__ptr, text, size)
+end
+
+function Label:getFont()
+	return Polycore.Label_getFont(self.__ptr)
+end
+

+ 16 - 0
Bindings/Contents/LUA/API/Polycode/Logger.lua

@@ -0,0 +1,16 @@
+class "Logger"
+
+function Logger:Logger()
+	if self.__ptr == nil then
+		self.__ptr = Polycore.Logger()
+	end
+end
+
+function Logger:log(format)
+	return Polycore.Logger_log(self.__ptr, format.__ptr)
+end
+
+function Logger:logw(str)
+	return Polycore.Logger_logw(self.__ptr, str.__ptr)
+end
+

+ 46 - 0
Bindings/Contents/LUA/API/Polycode/Material.lua

@@ -0,0 +1,46 @@
+require "Polycode/Resource"
+
+class "Material" (Resource)
+
+function Material:Material(name)
+	if self.__ptr == nil then
+		self.__ptr = Polycore.Material(name)
+	end
+end
+
+function Material:addShader(shader, shaderBinding)
+	return Polycore.Material_addShader(self.__ptr, shader.__ptr, shaderBinding.__ptr)
+end
+
+function Material:getNumShaders()
+	return Polycore.Material_getNumShaders(self.__ptr)
+end
+
+function Material:addShaderRenderTarget(newTarget)
+	return Polycore.Material_addShaderRenderTarget(self.__ptr, newTarget.__ptr)
+end
+
+function Material:getNumShaderRenderTargets()
+	return Polycore.Material_getNumShaderRenderTargets(self.__ptr)
+end
+
+function Material:getShaderRenderTarget(index)
+	return Polycore.Material_getShaderRenderTarget(self.__ptr, index)
+end
+
+function Material:getName()
+	return Polycore.Material_getName(self.__ptr)
+end
+
+function Material:getShader(index)
+	return Polycore.Material_getShader(self.__ptr, index)
+end
+
+function Material:getShaderBinding(index)
+	return Polycore.Material_getShaderBinding(self.__ptr, index)
+end
+
+function Material:loadMaterial(fileName)
+	return Polycore.Material_loadMaterial(self.__ptr, fileName)
+end
+

+ 76 - 0
Bindings/Contents/LUA/API/Polycode/MaterialManager.lua

@@ -0,0 +1,76 @@
+class "MaterialManager"
+
+function MaterialManager:MaterialManager()
+	if self.__ptr == nil then
+		self.__ptr = Polycore.MaterialManager()
+	end
+end
+
+function MaterialManager:Update(elapsed)
+	return Polycore.MaterialManager_Update(self.__ptr, elapsed)
+end
+
+function MaterialManager:createFramebufferTexture(width, height, type)
+	return Polycore.MaterialManager_createFramebufferTexture(self.__ptr, width, height, type)
+end
+
+function MaterialManager:createTexture(width, height, imageData, clamp, type)
+	return Polycore.MaterialManager_createTexture(self.__ptr, width, height, imageData.__ptr, clamp, type)
+end
+
+function MaterialManager:createNewTexture(width, height, clamp, type)
+	return Polycore.MaterialManager_createNewTexture(self.__ptr, width, height, clamp, type)
+end
+
+function MaterialManager:createTextureFromImage(image, clamp)
+	return Polycore.MaterialManager_createTextureFromImage(self.__ptr, image.__ptr, clamp)
+end
+
+function MaterialManager:createTextureFromFile(fileName, clamp)
+	return Polycore.MaterialManager_createTextureFromFile(self.__ptr, fileName, clamp)
+end
+
+function MaterialManager:deleteTexture(texture)
+	return Polycore.MaterialManager_deleteTexture(self.__ptr, texture.__ptr)
+end
+
+function MaterialManager:reloadTextures()
+	return Polycore.MaterialManager_reloadTextures(self.__ptr)
+end
+
+function MaterialManager:reloadProgramsAndTextures()
+	return Polycore.MaterialManager_reloadProgramsAndTextures(self.__ptr)
+end
+
+function MaterialManager:reloadPrograms()
+	return Polycore.MaterialManager_reloadPrograms(self.__ptr)
+end
+
+function MaterialManager:addShaderModule(module)
+	return Polycore.MaterialManager_addShaderModule(self.__ptr, module.__ptr)
+end
+
+function MaterialManager:getTextureByResourcePath(resourcePath)
+	return Polycore.MaterialManager_getTextureByResourcePath(self.__ptr, resourcePath)
+end
+
+function MaterialManager:cubemapFromXMLNode(node)
+	return Polycore.MaterialManager_cubemapFromXMLNode(self.__ptr, node.__ptr)
+end
+
+function MaterialManager:loadMaterialsFromFile(fileName)
+	return Polycore.MaterialManager_loadMaterialsFromFile(self.__ptr, fileName)
+end
+
+function MaterialManager:materialFromXMLNode(node)
+	return Polycore.MaterialManager_materialFromXMLNode(self.__ptr, node.__ptr)
+end
+
+function MaterialManager:setShaderFromXMLNode(node)
+	return Polycore.MaterialManager_setShaderFromXMLNode(self.__ptr, node.__ptr)
+end
+
+function MaterialManager:createShaderFromXMLNode(node)
+	return Polycore.MaterialManager_createShaderFromXMLNode(self.__ptr, node.__ptr)
+end
+

+ 44 - 0
Bindings/Contents/LUA/API/Polycode/Matrix4.lua

@@ -0,0 +1,44 @@
+class "Matrix4"
+
+function Matrix4:Matrix4()
+	if self.__ptr == nil then
+		self.__ptr = Polycore.Matrix4()
+	end
+end
+
+function Matrix4:init()
+	return Polycore.Matrix4_init(self.__ptr)
+end
+
+function Matrix4:identity()
+	return Polycore.Matrix4_identity(self.__ptr)
+end
+
+function Matrix4:rotateVector(v2)
+	return Polycore.Matrix4_rotateVector(self.__ptr, v2.__ptr)
+end
+
+function Matrix4:getPosition()
+	return Polycore.Matrix4_getPosition(self.__ptr)
+end
+
+function Matrix4:setPosition(x, y, z)
+	return Polycore.Matrix4_setPosition(self.__ptr, x, y, z)
+end
+
+function Matrix4:setScale(scale)
+	return Polycore.Matrix4_setScale(self.__ptr, scale.__ptr)
+end
+
+function Matrix4:getEulerAngles(ax, ay, az)
+	return Polycore.Matrix4_getEulerAngles(self.__ptr, ax.__ptr, ay.__ptr, az.__ptr)
+end
+
+function Matrix4:inverse()
+	return Polycore.Matrix4_inverse(self.__ptr)
+end
+
+function Matrix4:inverseAffine()
+	return Polycore.Matrix4_inverseAffine(self.__ptr)
+end
+

+ 104 - 0
Bindings/Contents/LUA/API/Polycode/Mesh.lua

@@ -0,0 +1,104 @@
+class "Mesh"
+
+function Mesh:Mesh(fileName)
+	if self.__ptr == nil then
+		self.__ptr = Polycore.Mesh(fileName)
+	end
+end
+
+function Mesh:addPolygon(newPolygon)
+	return Polycore.Mesh_addPolygon(self.__ptr, newPolygon.__ptr)
+end
+
+function Mesh:loadMesh(fileName)
+	return Polycore.Mesh_loadMesh(self.__ptr, fileName)
+end
+
+function Mesh:loadFromFile(inFile)
+	return Polycore.Mesh_loadFromFile(self.__ptr, inFile.__ptr)
+end
+
+function Mesh:saveToFile(outFile)
+	return Polycore.Mesh_saveToFile(self.__ptr, outFile.__ptr)
+end
+
+function Mesh:getPolygonCount()
+	return Polycore.Mesh_getPolygonCount(self.__ptr)
+end
+
+function Mesh:getPolygon(index)
+	return Polycore.Mesh_getPolygon(self.__ptr, index)
+end
+
+function Mesh:createPlane(w, h)
+	return Polycore.Mesh_createPlane(self.__ptr, w, h)
+end
+
+function Mesh:createBox(w, d, h)
+	return Polycore.Mesh_createBox(self.__ptr, w, d, h)
+end
+
+function Mesh:createSphere(radius, numRings, numSegments)
+	return Polycore.Mesh_createSphere(self.__ptr, radius, numRings, numSegments)
+end
+
+function Mesh:addVertex(vertex)
+	return Polycore.Mesh_addVertex(self.__ptr, vertex.__ptr)
+end
+
+function Mesh:getVertex(index)
+	return Polycore.Mesh_getVertex(self.__ptr, index)
+end
+
+function Mesh:getNumVertices()
+	return Polycore.Mesh_getNumVertices(self.__ptr)
+end
+
+function Mesh:recenterMesh()
+	return Polycore.Mesh_recenterMesh(self.__ptr)
+end
+
+function Mesh:useVertexNormals(val)
+	return Polycore.Mesh_useVertexNormals(self.__ptr, val)
+end
+
+function Mesh:getVertexIndex(vertex)
+	return Polycore.Mesh_getVertexIndex(self.__ptr, vertex.__ptr)
+end
+
+function Mesh:setVertexBuffer(buffer)
+	return Polycore.Mesh_setVertexBuffer(self.__ptr, buffer.__ptr)
+end
+
+function Mesh:getVertexBuffer()
+	return Polycore.Mesh_getVertexBuffer(self.__ptr)
+end
+
+function Mesh:usesFaceUV()
+	return Polycore.Mesh_usesFaceUV(self.__ptr)
+end
+
+function Mesh:getRadius()
+	return Polycore.Mesh_getRadius(self.__ptr)
+end
+
+function Mesh:calculateNormals()
+	return Polycore.Mesh_calculateNormals(self.__ptr)
+end
+
+function Mesh:getMeshType()
+	return Polycore.Mesh_getMeshType(self.__ptr)
+end
+
+function Mesh:setMeshType(newType)
+	return Polycore.Mesh_setMeshType(self.__ptr, newType)
+end
+
+function Mesh:calculateBBox()
+	return Polycore.Mesh_calculateBBox(self.__ptr)
+end
+
+function Mesh:hasVertexBuffer()
+	return Polycore.Mesh_hasVertexBuffer(self.__ptr)
+end
+

+ 42 - 0
Bindings/Contents/LUA/API/Polycode/OSBasics.lua

@@ -0,0 +1,42 @@
+class "OSBasics"
+
+function OSBasics:open(filename, opts)
+	return Polycore.OSBasics_open(self.__ptr, filename, opts)
+end
+
+function OSBasics:close(file)
+	return Polycore.OSBasics_close(self.__ptr, file.__ptr)
+end
+
+function OSBasics:read(ptr, size, count, stream)
+	return Polycore.OSBasics_read(self.__ptr, ptr.__ptr, size.__ptr, count.__ptr, stream.__ptr)
+end
+
+function OSBasics:write(ptr, size, count, stream)
+	return Polycore.OSBasics_write(self.__ptr, ptr.__ptr, size.__ptr, count.__ptr, stream.__ptr)
+end
+
+function OSBasics:seek(stream, offset, origin)
+	return Polycore.OSBasics_seek(self.__ptr, stream.__ptr, offset.__ptr, origin)
+end
+
+function OSBasics:tell(stream)
+	return Polycore.OSBasics_tell(self.__ptr, stream.__ptr)
+end
+
+function OSBasics:parsePhysFSFolder(pathString, showHidden)
+	return Polycore.OSBasics_parsePhysFSFolder(self.__ptr, pathString, showHidden)
+end
+
+function OSBasics:parseFolder(pathString, showHidden)
+	return Polycore.OSBasics_parseFolder(self.__ptr, pathString, showHidden)
+end
+
+function OSBasics:isFolder(pathString)
+	return Polycore.OSBasics_isFolder(self.__ptr, pathString)
+end
+
+function OSBasics:createFolder(pathString)
+	return Polycore.OSBasics_createFolder(self.__ptr, pathString)
+end
+

+ 12 - 0
Bindings/Contents/LUA/API/Polycode/OSFILE.lua

@@ -0,0 +1,12 @@
+class "OSFILE"
+
+function OSFILE:OSFILE()
+	if self.__ptr == nil then
+		self.__ptr = Polycore.OSFILE()
+	end
+end
+
+function OSFILE:debugDump()
+	return Polycore.OSFILE_debugDump(self.__ptr)
+end
+

+ 8 - 0
Bindings/Contents/LUA/API/Polycode/OSFileEntry.lua

@@ -0,0 +1,8 @@
+class "OSFileEntry"
+
+function OSFileEntry:OSFileEntry()
+	if self.__ptr == nil then
+		self.__ptr = Polycore.OSFileEntry()
+	end
+end
+

+ 12 - 0
Bindings/Contents/LUA/API/Polycode/ObjectEntry.lua

@@ -0,0 +1,12 @@
+class "ObjectEntry"
+
+function ObjectEntry:ObjectEntry()
+	if self.__ptr == nil then
+		self.__ptr = Polycore.ObjectEntry()
+	end
+end
+
+function ObjectEntry:addChild(name)
+	return Polycore.ObjectEntry_addChild(self.__ptr, name)
+end
+

+ 14 - 0
Bindings/Contents/LUA/API/Polycode/OpenGLCubemap.lua

@@ -0,0 +1,14 @@
+require "Polycode/Cubemap"
+
+class "OpenGLCubemap" (Cubemap)
+
+function OpenGLCubemap:OpenGLCubemap(t0, t1, t2, t3, t4, t5)
+	if self.__ptr == nil then
+		self.__ptr = Polycore.OpenGLCubemap(t0, t1, t2, t3, t4, t5)
+	end
+end
+
+function OpenGLCubemap:getTextureID()
+	return Polycore.OpenGLCubemap_getTextureID(self.__ptr)
+end
+

+ 20 - 0
Bindings/Contents/LUA/API/Polycode/Particle.lua

@@ -0,0 +1,20 @@
+class "Particle"
+
+function Particle:Particle(particleType, isScreenParticle, material, texture, particleMesh)
+	if self.__ptr == nil then
+		self.__ptr = Polycore.Particle(particleType, isScreenParticle, material, texture, particleMesh)
+	end
+end
+
+function Particle:Reset(continuious)
+	return Polycore.Particle_Reset(self.__ptr, continuious)
+end
+
+function Particle:createSceneParticle(particleType, texture, particleMesh)
+	return Polycore.Particle_createSceneParticle(self.__ptr, particleType, texture.__ptr, particleMesh.__ptr)
+end
+
+function Particle:createScreenParticle(particleType, texture, particleMesh)
+	return Polycore.Particle_createScreenParticle(self.__ptr, particleType, texture.__ptr, particleMesh.__ptr)
+end
+

+ 12 - 0
Bindings/Contents/LUA/API/Polycode/Perlin.lua

@@ -0,0 +1,12 @@
+class "Perlin"
+
+function Perlin:Perlin(octaves, freq, amp, seed)
+	if self.__ptr == nil then
+		self.__ptr = Polycore.Perlin(octaves, freq, amp, seed)
+	end
+end
+
+function Perlin:Get(x, y)
+	return Polycore.Perlin_Get(self.__ptr, x, y)
+end
+

+ 12 - 0
Bindings/Contents/LUA/API/Polycode/PolycodeModule.lua

@@ -0,0 +1,12 @@
+class "PolycodeModule"
+
+function PolycodeModule:PolycodeModule()
+	if self.__ptr == nil then
+		self.__ptr = Polycore.PolycodeModule()
+	end
+end
+
+function PolycodeModule:getType()
+	return Polycore.PolycodeModule_getType(self.__ptr)
+end
+

+ 68 - 0
Bindings/Contents/LUA/API/Polycode/Polygon.lua

@@ -0,0 +1,68 @@
+class "Polygon"
+
+function Polygon:Polygon()
+	if self.__ptr == nil then
+		self.__ptr = Polycore.Polygon()
+	end
+end
+
+function Polygon:getVertexCount()
+	return Polycore.Polygon_getVertexCount(self.__ptr)
+end
+
+function Polygon:getVertex(index)
+	return Polycore.Polygon_getVertex(self.__ptr, index)
+end
+
+function Polygon:addVertex(x, y, z)
+	return Polycore.Polygon_addVertex(self.__ptr, x, y, z)
+end
+
+function Polygon:removeVertex(index)
+	return Polycore.Polygon_removeVertex(self.__ptr, index)
+end
+
+function Polygon:addTexCoord(u, v)
+	return Polycore.Polygon_addTexCoord(self.__ptr, u, v)
+end
+
+function Polygon:addTexCoord2(u, v)
+	return Polycore.Polygon_addTexCoord2(self.__ptr, u, v)
+end
+
+function Polygon:getTexCoord(index)
+	return Polycore.Polygon_getTexCoord(self.__ptr, index)
+end
+
+function Polygon:getTexCoord2(index)
+	return Polycore.Polygon_getTexCoord2(self.__ptr, index)
+end
+
+function Polygon:calculateNormal()
+	return Polycore.Polygon_calculateNormal(self.__ptr)
+end
+
+function Polygon:getFaceNormal()
+	return Polycore.Polygon_getFaceNormal(self.__ptr)
+end
+
+function Polygon:getBounds2D()
+	return Polycore.Polygon_getBounds2D(self.__ptr)
+end
+
+function Polygon:setNormal(normal)
+	return Polycore.Polygon_setNormal(self.__ptr, normal.__ptr)
+end
+
+function Polygon:flipUVY()
+	return Polycore.Polygon_flipUVY(self.__ptr)
+end
+
+function Polygon:setUseFaceUV(val)
+	return Polycore.Polygon_setUseFaceUV(self.__ptr, val)
+end
+
+function Polygon:usesFaceUV()
+	return Polycore.Polygon_usesFaceUV(self.__ptr)
+end
+

+ 84 - 0
Bindings/Contents/LUA/API/Polycode/Quaternion.lua

@@ -0,0 +1,84 @@
+class "Quaternion"
+
+function Quaternion:Quaternion(w, x, y, z)
+	if self.__ptr == nil then
+		self.__ptr = Polycore.Quaternion(w, x, y, z)
+	end
+end
+
+function Quaternion:setFromMatrix(kRot)
+	return Polycore.Quaternion_setFromMatrix(self.__ptr, kRot.__ptr)
+end
+
+function Quaternion:Slerp(fT, rkP, rkQ, shortestPath)
+	return Polycore.Quaternion_Slerp(self.__ptr, fT, rkP.__ptr, rkQ.__ptr, shortestPath)
+end
+
+function Quaternion:Dot(rkQ)
+	return Polycore.Quaternion_Dot(self.__ptr, rkQ.__ptr)
+end
+
+function Quaternion:Log()
+	return Polycore.Quaternion_Log(self.__ptr)
+end
+
+function Quaternion:Exp()
+	return Polycore.Quaternion_Exp(self.__ptr)
+end
+
+function Quaternion:Norm()
+	return Polycore.Quaternion_Norm(self.__ptr)
+end
+
+function Quaternion:normalise()
+	return Polycore.Quaternion_normalise(self.__ptr)
+end
+
+function Quaternion:lookAt(D, upVector)
+	return Polycore.Quaternion_lookAt(self.__ptr, D.__ptr, upVector.__ptr)
+end
+
+function Quaternion:createFromMatrix(matrix)
+	return Polycore.Quaternion_createFromMatrix(self.__ptr, matrix.__ptr)
+end
+
+function Quaternion:Squad(fT, rkP, rkA, rkB, rkQ, shortestPath)
+	return Polycore.Quaternion_Squad(self.__ptr, fT, rkP.__ptr, rkA.__ptr, rkB.__ptr, rkQ.__ptr, shortestPath)
+end
+
+function Quaternion:Inverse()
+	return Polycore.Quaternion_Inverse(self.__ptr)
+end
+
+function Quaternion:set(w, x, y, z)
+	return Polycore.Quaternion_set(self.__ptr, w, x, y, z)
+end
+
+function Quaternion:inverse()
+	return Polycore.Quaternion_inverse(self.__ptr)
+end
+
+function Quaternion:InvSqrt(x)
+	return Polycore.Quaternion_InvSqrt(self.__ptr, x)
+end
+
+function Quaternion:fromAxes(az, ay, ax)
+	return Polycore.Quaternion_fromAxes(self.__ptr, az, ay, ax)
+end
+
+function Quaternion:FromAngleAxis(rfAngle, rkAxis)
+	return Polycore.Quaternion_FromAngleAxis(self.__ptr, rfAngle.__ptr, rkAxis.__ptr)
+end
+
+function Quaternion:ToAngleAxis(rfAngle, rkAxis)
+	return Polycore.Quaternion_ToAngleAxis(self.__ptr, rfAngle.__ptr, rkAxis.__ptr)
+end
+
+function Quaternion:createFromAxisAngle(x, y, z, degrees)
+	return Polycore.Quaternion_createFromAxisAngle(self.__ptr, x, y, z, degrees)
+end
+
+function Quaternion:createMatrix()
+	return Polycore.Quaternion_createMatrix(self.__ptr)
+end
+

+ 20 - 0
Bindings/Contents/LUA/API/Polycode/QuaternionCurve.lua

@@ -0,0 +1,20 @@
+class "QuaternionCurve"
+
+function QuaternionCurve:QuaternionCurve(wCurve, xCurve, yCurve, zCurve)
+	if self.__ptr == nil then
+		self.__ptr = Polycore.QuaternionCurve(wCurve, xCurve, yCurve, zCurve)
+	end
+end
+
+function QuaternionCurve:interpolate(t, useShortestPath)
+	return Polycore.QuaternionCurve_interpolate(self.__ptr, t, useShortestPath)
+end
+
+function QuaternionCurve:generatePointsFromCurves(wCurve, xCurve, yCurve, zCurve)
+	return Polycore.QuaternionCurve_generatePointsFromCurves(self.__ptr, wCurve.__ptr, xCurve.__ptr, yCurve.__ptr, zCurve.__ptr)
+end
+
+function QuaternionCurve:recalcTangents()
+	return Polycore.QuaternionCurve_recalcTangents(self.__ptr)
+end
+

+ 14 - 0
Bindings/Contents/LUA/API/Polycode/QuaternionTween.lua

@@ -0,0 +1,14 @@
+require "Polycode/Tween"
+
+class "QuaternionTween" (Tween)
+
+function QuaternionTween:QuaternionTween(target, wCurve, xCurve, yCurve, zCurve, easeType, time, _repeat)
+	if self.__ptr == nil then
+		self.__ptr = Polycore.QuaternionTween(target, wCurve, xCurve, yCurve, zCurve, easeType, time, _repeat)
+	end
+end
+
+function QuaternionTween:updateCustomTween()
+	return Polycore.QuaternionTween_updateCustomTween(self.__ptr)
+end
+

+ 12 - 0
Bindings/Contents/LUA/API/Polycode/Rectangle.lua

@@ -0,0 +1,12 @@
+class "Rectangle"
+
+function Rectangle:Rectangle()
+	if self.__ptr == nil then
+		self.__ptr = Polycore.Rectangle()
+	end
+end
+
+function Rectangle:setRect(x, y, w, h)
+	return Polycore.Rectangle_setRect(self.__ptr, x, y, w, h)
+end
+

+ 28 - 0
Bindings/Contents/LUA/API/Polycode/Resource.lua

@@ -0,0 +1,28 @@
+class "Resource"
+
+function Resource:Resource(type)
+	if self.__ptr == nil then
+		self.__ptr = Polycore.Resource(type)
+	end
+end
+
+function Resource:getResourceName()
+	return Polycore.Resource_getResourceName(self.__ptr)
+end
+
+function Resource:getResourceType()
+	return Polycore.Resource_getResourceType(self.__ptr)
+end
+
+function Resource:setResourceName(newName)
+	return Polycore.Resource_setResourceName(self.__ptr, newName)
+end
+
+function Resource:setResourcePath(path)
+	return Polycore.Resource_setResourcePath(self.__ptr, path)
+end
+
+function Resource:getResourcePath()
+	return Polycore.Resource_getResourcePath(self.__ptr)
+end
+

+ 52 - 0
Bindings/Contents/LUA/API/Polycode/ResourceManager.lua

@@ -0,0 +1,52 @@
+class "ResourceManager"
+
+function ResourceManager:ResourceManager()
+	if self.__ptr == nil then
+		self.__ptr = Polycore.ResourceManager()
+	end
+end
+
+function ResourceManager:addResource(resource)
+	return Polycore.ResourceManager_addResource(self.__ptr, resource.__ptr)
+end
+
+function ResourceManager:addDirResource(dirPath, recursive)
+	return Polycore.ResourceManager_addDirResource(self.__ptr, dirPath, recursive)
+end
+
+function ResourceManager:addArchive(zipPath)
+	return Polycore.ResourceManager_addArchive(self.__ptr, zipPath)
+end
+
+function ResourceManager:readFile(fileName)
+	return Polycore.ResourceManager_readFile(self.__ptr, fileName)
+end
+
+function ResourceManager:parseTextures(dirPath, recursive)
+	return Polycore.ResourceManager_parseTextures(self.__ptr, dirPath, recursive)
+end
+
+function ResourceManager:parseMaterials(dirPath, recursive)
+	return Polycore.ResourceManager_parseMaterials(self.__ptr, dirPath, recursive)
+end
+
+function ResourceManager:parseShaders(dirPath, recursive)
+	return Polycore.ResourceManager_parseShaders(self.__ptr, dirPath, recursive)
+end
+
+function ResourceManager:parsePrograms(dirPath, recursive)
+	return Polycore.ResourceManager_parsePrograms(self.__ptr, dirPath, recursive)
+end
+
+function ResourceManager:parseCubemaps(dirPath, recursive)
+	return Polycore.ResourceManager_parseCubemaps(self.__ptr, dirPath, recursive)
+end
+
+function ResourceManager:getResource(resourceType, resourceName)
+	return Polycore.ResourceManager_getResource(self.__ptr, resourceType, resourceName)
+end
+
+function ResourceManager:addShaderModule(module)
+	return Polycore.ResourceManager_addShaderModule(self.__ptr, module.__ptr)
+end
+

+ 14 - 0
Bindings/Contents/LUA/API/Polycode/SceneEntity.lua

@@ -0,0 +1,14 @@
+require "Polycode/Entity"
+
+class "SceneEntity" (Entity)
+
+function SceneEntity:SceneEntity()
+	if self.__ptr == nil then
+		self.__ptr = Polycore.SceneEntity()
+	end
+end
+
+function SceneEntity:testMouseCollision(x, y)
+	return Polycore.SceneEntity_testMouseCollision(self.__ptr, x, y)
+end
+

+ 26 - 0
Bindings/Contents/LUA/API/Polycode/SceneLabel.lua

@@ -0,0 +1,26 @@
+require "Polycode/SceneEntity"
+
+class "SceneLabel" (SceneEntity)
+
+function SceneLabel:SceneLabel(fontName, text, size, scale, amode)
+	if self.__ptr == nil then
+		self.__ptr = Polycore.SceneLabel(fontName, text, size, scale, amode)
+	end
+end
+
+function SceneLabel:testMouseCollision(x, y)
+	return Polycore.SceneLabel_testMouseCollision(self.__ptr, x, y)
+end
+
+function SceneLabel:setText(newText)
+	return Polycore.SceneLabel_setText(self.__ptr, newText)
+end
+
+function SceneLabel:getLabel()
+	return Polycore.SceneLabel_getLabel(self.__ptr)
+end
+
+function SceneLabel:Render()
+	return Polycore.SceneLabel_Render(self.__ptr)
+end
+

+ 58 - 0
Bindings/Contents/LUA/API/Polycode/SceneLight.lua

@@ -0,0 +1,58 @@
+require "Polycode/SceneEntity"
+
+class "SceneLight" (SceneEntity)
+
+function SceneLight:SceneLight(type, intensity, distance, parentScene)
+	if self.__ptr == nil then
+		self.__ptr = Polycore.SceneLight(type, intensity, distance, parentScene)
+	end
+end
+
+function SceneLight:getIntensity()
+	return Polycore.SceneLight_getIntensity(self.__ptr)
+end
+
+function SceneLight:getDistance()
+	return Polycore.SceneLight_getDistance(self.__ptr)
+end
+
+function SceneLight:getType()
+	return Polycore.SceneLight_getType(self.__ptr)
+end
+
+function SceneLight:renderDepthMap(scene)
+	return Polycore.SceneLight_renderDepthMap(self.__ptr, scene.__ptr)
+end
+
+function SceneLight:Render()
+	return Polycore.SceneLight_Render(self.__ptr)
+end
+
+function SceneLight:getLightViewMatrix()
+	return Polycore.SceneLight_getLightViewMatrix(self.__ptr)
+end
+
+function SceneLight:getZBufferTexture()
+	return Polycore.SceneLight_getZBufferTexture(self.__ptr)
+end
+
+function SceneLight:setLightColor(r, g, b)
+	return Polycore.SceneLight_setLightColor(self.__ptr, r, g, b)
+end
+
+function SceneLight:enableShadows(val, resolution)
+	return Polycore.SceneLight_enableShadows(self.__ptr, val, resolution)
+end
+
+function SceneLight:setShadowMapFOV(fov)
+	return Polycore.SceneLight_setShadowMapFOV(self.__ptr, fov)
+end
+
+function SceneLight:areShadowsEnabled()
+	return Polycore.SceneLight_areShadowsEnabled(self.__ptr)
+end
+
+function SceneLight:getLightType()
+	return Polycore.SceneLight_getLightType(self.__ptr)
+end
+

+ 14 - 0
Bindings/Contents/LUA/API/Polycode/SceneLine.lua

@@ -0,0 +1,14 @@
+require "Polycode/SceneEntity"
+
+class "SceneLine" (SceneEntity)
+
+function SceneLine:SceneLine(ent1, ent2)
+	if self.__ptr == nil then
+		self.__ptr = Polycore.SceneLine(ent1, ent2)
+	end
+end
+
+function SceneLine:Render()
+	return Polycore.SceneLine_Render(self.__ptr)
+end
+

+ 28 - 0
Bindings/Contents/LUA/API/Polycode/SceneManager.lua

@@ -0,0 +1,28 @@
+class "SceneManager"
+
+function SceneManager:SceneManager()
+	if self.__ptr == nil then
+		self.__ptr = Polycore.SceneManager()
+	end
+end
+
+function SceneManager:addScene(newScene)
+	return Polycore.SceneManager_addScene(self.__ptr, newScene.__ptr)
+end
+
+function SceneManager:Update()
+	return Polycore.SceneManager_Update(self.__ptr)
+end
+
+function SceneManager:UpdateVirtual()
+	return Polycore.SceneManager_UpdateVirtual(self.__ptr)
+end
+
+function SceneManager:removeScene(scene)
+	return Polycore.SceneManager_removeScene(self.__ptr, scene.__ptr)
+end
+
+function SceneManager:registerRenderTexture(r_enderTexture)
+	return Polycore.SceneManager_registerRenderTexture(self.__ptr, r_enderTexture.__ptr)
+end
+

+ 66 - 0
Bindings/Contents/LUA/API/Polycode/SceneMesh.lua

@@ -0,0 +1,66 @@
+require "Polycode/SceneEntity"
+
+class "SceneMesh" (SceneEntity)
+
+function SceneMesh:SceneMesh(fileName)
+	if self.__ptr == nil then
+		self.__ptr = Polycore.SceneMesh(fileName)
+	end
+end
+
+function SceneMesh:Render()
+	return Polycore.SceneMesh_Render(self.__ptr)
+end
+
+function SceneMesh:getLocalShaderOptions()
+	return Polycore.SceneMesh_getLocalShaderOptions(self.__ptr)
+end
+
+function SceneMesh:getMesh()
+	return Polycore.SceneMesh_getMesh(self.__ptr)
+end
+
+function SceneMesh:getTexture()
+	return Polycore.SceneMesh_getTexture(self.__ptr)
+end
+
+function SceneMesh:getMaterial()
+	return Polycore.SceneMesh_getMaterial(self.__ptr)
+end
+
+function SceneMesh:loadTexture(fileName, clamp)
+	return Polycore.SceneMesh_loadTexture(self.__ptr, fileName, clamp)
+end
+
+function SceneMesh:loadSkeleton(fileName)
+	return Polycore.SceneMesh_loadSkeleton(self.__ptr, fileName)
+end
+
+function SceneMesh:setTexture(texture)
+	return Polycore.SceneMesh_setTexture(self.__ptr, texture.__ptr)
+end
+
+function SceneMesh:setMaterial(material)
+	return Polycore.SceneMesh_setMaterial(self.__ptr, material.__ptr)
+end
+
+function SceneMesh:setMesh(mesh)
+	return Polycore.SceneMesh_setMesh(self.__ptr, mesh.__ptr)
+end
+
+function SceneMesh:setSkeleton(skeleton)
+	return Polycore.SceneMesh_setSkeleton(self.__ptr, skeleton.__ptr)
+end
+
+function SceneMesh:getSkeleton()
+	return Polycore.SceneMesh_getSkeleton(self.__ptr)
+end
+
+function SceneMesh:renderMeshLocally()
+	return Polycore.SceneMesh_renderMeshLocally(self.__ptr)
+end
+
+function SceneMesh:cacheToVertexBuffer(cache)
+	return Polycore.SceneMesh_cacheToVertexBuffer(self.__ptr, cache)
+end
+

+ 22 - 0
Bindings/Contents/LUA/API/Polycode/SceneParticleEmitter.lua

@@ -0,0 +1,22 @@
+require "Polycode/SceneEntity"
+
+class "SceneParticleEmitter" (SceneEntity)
+
+function SceneParticleEmitter:SceneParticleEmitter(imageFile, particleMesh, emitter, particleParentScene, particleType, emitterType, lifespan, numParticles, direction, gravity, deviation)
+	if self.__ptr == nil then
+		self.__ptr = Polycore.SceneParticleEmitter(imageFile, particleMesh, emitter, particleParentScene, particleType, emitterType, lifespan, numParticles, direction, gravity, deviation)
+	end
+end
+
+function SceneParticleEmitter:addParticleBody(particleBody)
+	return Polycore.SceneParticleEmitter_addParticleBody(self.__ptr, particleBody.__ptr)
+end
+
+function SceneParticleEmitter:getBaseMatrix()
+	return Polycore.SceneParticleEmitter_getBaseMatrix(self.__ptr)
+end
+
+function SceneParticleEmitter:Update()
+	return Polycore.SceneParticleEmitter_Update(self.__ptr)
+end
+

+ 10 - 0
Bindings/Contents/LUA/API/Polycode/ScenePrimitive.lua

@@ -0,0 +1,10 @@
+require "Polycode/SceneMesh"
+
+class "ScenePrimitive" (SceneMesh)
+
+function ScenePrimitive:ScenePrimitive(type, v1, v2, v3)
+	if self.__ptr == nil then
+		self.__ptr = Polycore.ScenePrimitive(type, v1, v2, v3)
+	end
+end
+

+ 24 - 0
Bindings/Contents/LUA/API/Polycode/SceneRenderTexture.lua

@@ -0,0 +1,24 @@
+class "SceneRenderTexture"
+
+function SceneRenderTexture:SceneRenderTexture(targetScene, targetCamera, r_enderWidth, r_enderHeight)
+	if self.__ptr == nil then
+		self.__ptr = Polycore.SceneRenderTexture(targetScene, targetCamera, r_enderWidth, r_enderHeight)
+	end
+end
+
+function SceneRenderTexture:drawScreen()
+	return Polycore.SceneRenderTexture_drawScreen(self.__ptr)
+end
+
+function SceneRenderTexture:getTargetTexture()
+	return Polycore.SceneRenderTexture_getTargetTexture(self.__ptr)
+end
+
+function SceneRenderTexture:getTargetScene()
+	return Polycore.SceneRenderTexture_getTargetScene(self.__ptr)
+end
+
+function SceneRenderTexture:getTargetCamera()
+	return Polycore.SceneRenderTexture_getTargetCamera(self.__ptr)
+end
+

+ 89 - 5
Bindings/Contents/LUA/API/Polycode/Screen.lua

@@ -1,10 +1,94 @@
+require "Polycode/EventDispatcher"
 
 
-class "Screen"
+class "Screen" (EventDispatcher)
 
 
 function Screen:Screen()
 function Screen:Screen()
-	self.__ptr = Polycore.Screen()
+	if self.__ptr == nil then
+		self.__ptr = Polycore.Screen()
+	end
+end
+
+function Screen:addChild(newEntity)
+	return Polycore.Screen_addChild(self.__ptr, newEntity.__ptr)
+end
+
+function Screen:removeChild(entityToRemove)
+	return Polycore.Screen_removeChild(self.__ptr, entityToRemove.__ptr)
+end
+
+function Screen:setScreenOffset(x, y)
+	return Polycore.Screen_setScreenOffset(self.__ptr, x, y)
+end
+
+function Screen:getScreenOffset()
+	return Polycore.Screen_getScreenOffset(self.__ptr)
+end
+
+function Screen:Shutdown()
+	return Polycore.Screen_Shutdown(self.__ptr)
+end
+
+function Screen:Update()
+	return Polycore.Screen_Update(self.__ptr)
+end
+
+function Screen:getEntityAt(x, y)
+	return Polycore.Screen_getEntityAt(self.__ptr, x, y)
+end
+
+function Screen:Render()
+	return Polycore.Screen_Render(self.__ptr)
+end
+
+function Screen:setRenderer(r_enderer)
+	return Polycore.Screen_setRenderer(self.__ptr, r_enderer.__ptr)
+end
+
+function Screen:setNormalizedCoordinates(newVal, yCoordinateSize)
+	return Polycore.Screen_setNormalizedCoordinates(self.__ptr, newVal, yCoordinateSize)
+end
+
+function Screen:setScreenShader(shaderName)
+	return Polycore.Screen_setScreenShader(self.__ptr, shaderName)
+end
+
+function Screen:handleEvent(event)
+	return Polycore.Screen_handleEvent(self.__ptr, event.__ptr)
+end
+
+function Screen:getHighestZIndex()
+	return Polycore.Screen_getHighestZIndex(self.__ptr)
+end
+
+function Screen:sortChildren()
+	return Polycore.Screen_sortChildren(self.__ptr)
+end
+
+function Screen:cmpZindex(left, right)
+	return Polycore.Screen_cmpZindex(self.__ptr, left.__ptr, right.__ptr)
+end
+
+function Screen:handleInputEvent(inputEvent)
+	return Polycore.Screen_handleInputEvent(self.__ptr, inputEvent.__ptr)
+end
+
+function Screen:hasFilterShader()
+	return Polycore.Screen_hasFilterShader(self.__ptr)
+end
+
+function Screen:drawFilter()
+	return Polycore.Screen_drawFilter(self.__ptr)
+end
+
+function Screen:usesNormalizedCoordinates()
+	return Polycore.Screen_usesNormalizedCoordinates(self.__ptr)
+end
+
+function Screen:getYCoordinateSize()
+	return Polycore.Screen_getYCoordinateSize(self.__ptr)
+end
+
+function Screen:getRootEntity()
+	return Polycore.Screen_getRootEntity(self.__ptr)
 end
 end
 
 
-function addChild(child)
-	Polycore.Screen_addChild(self.__ptr, child.__ptr)
-end

+ 10 - 0
Bindings/Contents/LUA/API/Polycode/ScreenCurve.lua

@@ -0,0 +1,10 @@
+require "Polycode/ScreenShape"
+
+class "ScreenCurve" (ScreenShape)
+
+function ScreenCurve:ScreenCurve(curve, numVertices)
+	if self.__ptr == nil then
+		self.__ptr = Polycore.ScreenCurve(curve, numVertices)
+	end
+end
+

+ 158 - 0
Bindings/Contents/LUA/API/Polycode/ScreenEntity.lua

@@ -0,0 +1,158 @@
+require "Polycode/Entity"
+
+class "ScreenEntity" (Entity)
+
+function ScreenEntity:ScreenEntity()
+	if self.__ptr == nil then
+		self.__ptr = Polycore.ScreenEntity()
+	end
+end
+
+function ScreenEntity:setPosition(x, y)
+	return Polycore.ScreenEntity_setPosition(self.__ptr, x, y)
+end
+
+function ScreenEntity:setScale(x, y)
+	return Polycore.ScreenEntity_setScale(self.__ptr, x, y)
+end
+
+function ScreenEntity:setRotation(roatation)
+	return Polycore.ScreenEntity_setRotation(self.__ptr, roatation)
+end
+
+function ScreenEntity:getRotation()
+	return Polycore.ScreenEntity_getRotation(self.__ptr)
+end
+
+function ScreenEntity:_onMouseDown(x, y, mouseButton, timestamp)
+	return Polycore.ScreenEntity__onMouseDown(self.__ptr, x, y, mouseButton, timestamp)
+end
+
+function ScreenEntity:_onMouseUp(x, y, mouseButton, timestamp)
+	return Polycore.ScreenEntity__onMouseUp(self.__ptr, x, y, mouseButton, timestamp)
+end
+
+function ScreenEntity:_onMouseMove(x, y, timestamp)
+	return Polycore.ScreenEntity__onMouseMove(self.__ptr, x, y, timestamp)
+end
+
+function ScreenEntity:_onMouseWheelUp(x, y, timestamp)
+	return Polycore.ScreenEntity__onMouseWheelUp(self.__ptr, x, y, timestamp)
+end
+
+function ScreenEntity:_onMouseWheelDown(x, y, timestamp)
+	return Polycore.ScreenEntity__onMouseWheelDown(self.__ptr, x, y, timestamp)
+end
+
+function ScreenEntity:onMouseDown(x, y)
+	return Polycore.ScreenEntity_onMouseDown(self.__ptr, x, y)
+end
+
+function ScreenEntity:onMouseUp(x, y)
+	return Polycore.ScreenEntity_onMouseUp(self.__ptr, x, y)
+end
+
+function ScreenEntity:onMouseMove(x, y)
+	return Polycore.ScreenEntity_onMouseMove(self.__ptr, x, y)
+end
+
+function ScreenEntity:onMouseWheelUp(x, y)
+	return Polycore.ScreenEntity_onMouseWheelUp(self.__ptr, x, y)
+end
+
+function ScreenEntity:onMouseWheelDown(x, y)
+	return Polycore.ScreenEntity_onMouseWheelDown(self.__ptr, x, y)
+end
+
+function ScreenEntity:_onKeyDown(key, charCode)
+	return Polycore.ScreenEntity__onKeyDown(self.__ptr, key.__ptr, charCode.__ptr)
+end
+
+function ScreenEntity:_onKeyUp(key, charCode)
+	return Polycore.ScreenEntity__onKeyUp(self.__ptr, key.__ptr, charCode.__ptr)
+end
+
+function ScreenEntity:onKeyDown(key, charCode)
+	return Polycore.ScreenEntity_onKeyDown(self.__ptr, key.__ptr, charCode.__ptr)
+end
+
+function ScreenEntity:onKeyUp(key, charCode)
+	return Polycore.ScreenEntity_onKeyUp(self.__ptr, key.__ptr, charCode.__ptr)
+end
+
+function ScreenEntity:hitTest(x, y)
+	return Polycore.ScreenEntity_hitTest(self.__ptr, x, y)
+end
+
+function ScreenEntity:buildPositionMatrix()
+	return Polycore.ScreenEntity_buildPositionMatrix(self.__ptr)
+end
+
+function ScreenEntity:adjustMatrixForChildren()
+	return Polycore.ScreenEntity_adjustMatrixForChildren(self.__ptr)
+end
+
+function ScreenEntity:getWidth()
+	return Polycore.ScreenEntity_getWidth(self.__ptr)
+end
+
+function ScreenEntity:getHeight()
+	return Polycore.ScreenEntity_getHeight(self.__ptr)
+end
+
+function ScreenEntity:setWidth(w)
+	return Polycore.ScreenEntity_setWidth(self.__ptr, w)
+end
+
+function ScreenEntity:setHeight(h)
+	return Polycore.ScreenEntity_setHeight(self.__ptr, h)
+end
+
+function ScreenEntity:onGainFocus()
+	return Polycore.ScreenEntity_onGainFocus(self.__ptr)
+end
+
+function ScreenEntity:onLoseFocus()
+	return Polycore.ScreenEntity_onLoseFocus(self.__ptr)
+end
+
+function ScreenEntity:startDrag(xOffset, yOffset)
+	return Polycore.ScreenEntity_startDrag(self.__ptr, xOffset, yOffset)
+end
+
+function ScreenEntity:stopDrag()
+	return Polycore.ScreenEntity_stopDrag(self.__ptr)
+end
+
+function ScreenEntity:setBlendingMode(newBl_endingMode)
+	return Polycore.ScreenEntity_setBlendingMode(self.__ptr, newBl_endingMode)
+end
+
+function ScreenEntity:setPositionMode(newPositionMode)
+	return Polycore.ScreenEntity_setPositionMode(self.__ptr, newPositionMode)
+end
+
+function ScreenEntity:setDragLimits(rect)
+	return Polycore.ScreenEntity_setDragLimits(self.__ptr, rect.__ptr)
+end
+
+function ScreenEntity:clearDragLimits()
+	return Polycore.ScreenEntity_clearDragLimits(self.__ptr)
+end
+
+function ScreenEntity:focusChild(child)
+	return Polycore.ScreenEntity_focusChild(self.__ptr, child.__ptr)
+end
+
+function ScreenEntity:focusNextChild()
+	return Polycore.ScreenEntity_focusNextChild(self.__ptr)
+end
+
+function ScreenEntity:getPosition2D()
+	return Polycore.ScreenEntity_getPosition2D(self.__ptr)
+end
+
+function ScreenEntity:isFocusable()
+	return Polycore.ScreenEntity_isFocusable(self.__ptr)
+end
+

+ 10 - 0
Bindings/Contents/LUA/API/Polycode/ScreenEvent.lua

@@ -0,0 +1,10 @@
+require "Polycode/Event"
+
+class "ScreenEvent" (Event)
+
+function ScreenEvent:ScreenEvent()
+	if self.__ptr == nil then
+		self.__ptr = Polycore.ScreenEvent()
+	end
+end
+

+ 22 - 0
Bindings/Contents/LUA/API/Polycode/ScreenImage.lua

@@ -0,0 +1,22 @@
+require "Polycode/ScreenShape"
+
+class "ScreenImage" (ScreenShape)
+
+function ScreenImage:ScreenImage(fileName)
+	if self.__ptr == nil then
+		self.__ptr = Polycore.ScreenImage(fileName)
+	end
+end
+
+function ScreenImage:setImageCoordinates(x, y, width, height)
+	return Polycore.ScreenImage_setImageCoordinates(self.__ptr, x, y, width, height)
+end
+
+function ScreenImage:getImageWidth()
+	return Polycore.ScreenImage_getImageWidth(self.__ptr)
+end
+
+function ScreenImage:getImageHeight()
+	return Polycore.ScreenImage_getImageHeight(self.__ptr)
+end
+

+ 26 - 0
Bindings/Contents/LUA/API/Polycode/ScreenLabel.lua

@@ -0,0 +1,26 @@
+require "Polycode/ScreenShape"
+
+class "ScreenLabel" (ScreenShape)
+
+function ScreenLabel:ScreenLabel(fontName, text, size, amode)
+	if self.__ptr == nil then
+		self.__ptr = Polycore.ScreenLabel(fontName, text, size, amode)
+	end
+end
+
+function ScreenLabel:addDropShadow(color, size, offsetX, offsetY)
+	return Polycore.ScreenLabel_addDropShadow(self.__ptr, color.__ptr, size, offsetX, offsetY)
+end
+
+function ScreenLabel:setText(newText)
+	return Polycore.ScreenLabel_setText(self.__ptr, newText)
+end
+
+function ScreenLabel:getText()
+	return Polycore.ScreenLabel_getText(self.__ptr)
+end
+
+function ScreenLabel:getLabel()
+	return Polycore.ScreenLabel_getLabel(self.__ptr)
+end
+

+ 22 - 0
Bindings/Contents/LUA/API/Polycode/ScreenLine.lua

@@ -0,0 +1,22 @@
+require "Polycode/ScreenEntity"
+
+class "ScreenLine" (ScreenEntity)
+
+function ScreenLine:ScreenLine(start, _end)
+	if self.__ptr == nil then
+		self.__ptr = Polycore.ScreenLine(start, _end)
+	end
+end
+
+function ScreenLine:Update()
+	return Polycore.ScreenLine_Update(self.__ptr)
+end
+
+function ScreenLine:Render()
+	return Polycore.ScreenLine_Render(self.__ptr)
+end
+
+function ScreenLine:setLineWidth(width)
+	return Polycore.ScreenLine_setLineWidth(self.__ptr, width)
+end
+

+ 26 - 0
Bindings/Contents/LUA/API/Polycode/ScreenManager.lua

@@ -0,0 +1,26 @@
+require "Polycode/EventDispatcher"
+
+class "ScreenManager" (EventDispatcher)
+
+function ScreenManager:ScreenManager()
+	if self.__ptr == nil then
+		self.__ptr = Polycore.ScreenManager()
+	end
+end
+
+function ScreenManager:removeScreen(screen)
+	return Polycore.ScreenManager_removeScreen(self.__ptr, screen.__ptr)
+end
+
+function ScreenManager:addScreen(screen)
+	return Polycore.ScreenManager_addScreen(self.__ptr, screen.__ptr)
+end
+
+function ScreenManager:Update()
+	return Polycore.ScreenManager_Update(self.__ptr)
+end
+
+function ScreenManager:handleEvent(event)
+	return Polycore.ScreenManager_handleEvent(self.__ptr, event.__ptr)
+end
+

+ 30 - 0
Bindings/Contents/LUA/API/Polycode/ScreenMesh.lua

@@ -0,0 +1,30 @@
+require "Polycode/ScreenEntity"
+
+class "ScreenMesh" (ScreenEntity)
+
+function ScreenMesh:ScreenMesh(fileName)
+	if self.__ptr == nil then
+		self.__ptr = Polycore.ScreenMesh(fileName)
+	end
+end
+
+function ScreenMesh:Render()
+	return Polycore.ScreenMesh_Render(self.__ptr)
+end
+
+function ScreenMesh:getMesh()
+	return Polycore.ScreenMesh_getMesh(self.__ptr)
+end
+
+function ScreenMesh:getTexture()
+	return Polycore.ScreenMesh_getTexture(self.__ptr)
+end
+
+function ScreenMesh:loadTexture(fileName)
+	return Polycore.ScreenMesh_loadTexture(self.__ptr, fileName)
+end
+
+function ScreenMesh:setTexture(texture)
+	return Polycore.ScreenMesh_setTexture(self.__ptr, texture.__ptr)
+end
+

+ 22 - 0
Bindings/Contents/LUA/API/Polycode/ScreenParticleEmitter.lua

@@ -0,0 +1,22 @@
+require "Polycode/ScreenEntity"
+
+class "ScreenParticleEmitter" (ScreenEntity)
+
+function ScreenParticleEmitter:ScreenParticleEmitter(imageFile, particleMesh, emitter, particleParentScreen, particleType, emitterType, lifespan, numParticles, direction, gravity, deviation)
+	if self.__ptr == nil then
+		self.__ptr = Polycore.ScreenParticleEmitter(imageFile, particleMesh, emitter, particleParentScreen, particleType, emitterType, lifespan, numParticles, direction, gravity, deviation)
+	end
+end
+
+function ScreenParticleEmitter:addParticleBody(particleBody)
+	return Polycore.ScreenParticleEmitter_addParticleBody(self.__ptr, particleBody.__ptr)
+end
+
+function ScreenParticleEmitter:getBaseMatrix()
+	return Polycore.ScreenParticleEmitter_getBaseMatrix(self.__ptr)
+end
+
+function ScreenParticleEmitter:Update()
+	return Polycore.ScreenParticleEmitter_Update(self.__ptr)
+end
+

+ 38 - 0
Bindings/Contents/LUA/API/Polycode/ScreenShape.lua

@@ -0,0 +1,38 @@
+require "Polycode/ScreenMesh"
+
+class "ScreenShape" (ScreenMesh)
+
+function ScreenShape:ScreenShape(shapeType, option1, option2, option3, option4)
+	if self.__ptr == nil then
+		self.__ptr = Polycore.ScreenShape(shapeType, option1, option2, option3, option4)
+	end
+end
+
+function ScreenShape:Render()
+	return Polycore.ScreenShape_Render(self.__ptr)
+end
+
+function ScreenShape:setStrokeColor(r, g, b, a)
+	return Polycore.ScreenShape_setStrokeColor(self.__ptr, r, g, b, a)
+end
+
+function ScreenShape:setStrokeWidth(width)
+	return Polycore.ScreenShape_setStrokeWidth(self.__ptr, width)
+end
+
+function ScreenShape:setGradient(r1, g1, b1, a1, r2, g2, b2, a2)
+	return Polycore.ScreenShape_setGradient(self.__ptr, r1, g1, b1, a1, r2, g2, b2, a2)
+end
+
+function ScreenShape:clearGradient()
+	return Polycore.ScreenShape_clearGradient(self.__ptr)
+end
+
+function ScreenShape:setShapeSize(newWidth, newHeight)
+	return Polycore.ScreenShape_setShapeSize(self.__ptr, newWidth, newHeight)
+end
+
+function ScreenShape:addShapePoint(x, y)
+	return Polycore.ScreenShape_addShapePoint(self.__ptr, x, y)
+end
+

+ 22 - 0
Bindings/Contents/LUA/API/Polycode/ScreenSprite.lua

@@ -0,0 +1,22 @@
+require "Polycode/ScreenShape"
+
+class "ScreenSprite" (ScreenShape)
+
+function ScreenSprite:ScreenSprite(fileName, spriteWidth, spriteHeight)
+	if self.__ptr == nil then
+		self.__ptr = Polycore.ScreenSprite(fileName, spriteWidth, spriteHeight)
+	end
+end
+
+function ScreenSprite:addAnimation(name, frames, speed)
+	return Polycore.ScreenSprite_addAnimation(self.__ptr, name, frames, speed)
+end
+
+function ScreenSprite:playAnimation(name, startFrame, once)
+	return Polycore.ScreenSprite_playAnimation(self.__ptr, name, startFrame, once)
+end
+
+function ScreenSprite:Update()
+	return Polycore.ScreenSprite_Update(self.__ptr)
+end
+

+ 58 - 0
Bindings/Contents/LUA/API/Polycode/Skeleton.lua

@@ -0,0 +1,58 @@
+require "Polycode/SceneEntity"
+
+class "Skeleton" (SceneEntity)
+
+function Skeleton:Skeleton(fileName)
+	if self.__ptr == nil then
+		self.__ptr = Polycore.Skeleton(fileName)
+	end
+end
+
+function Skeleton:loadSkeleton(fileName)
+	return Polycore.Skeleton_loadSkeleton(self.__ptr, fileName)
+end
+
+function Skeleton:playAnimation(animName)
+	return Polycore.Skeleton_playAnimation(self.__ptr, animName)
+end
+
+function Skeleton:playAnimationByIndex(index)
+	return Polycore.Skeleton_playAnimationByIndex(self.__ptr, index)
+end
+
+function Skeleton:addAnimation(name, fileName)
+	return Polycore.Skeleton_addAnimation(self.__ptr, name, fileName)
+end
+
+function Skeleton:getAnimation(name)
+	return Polycore.Skeleton_getAnimation(self.__ptr, name)
+end
+
+function Skeleton:Update()
+	return Polycore.Skeleton_Update(self.__ptr)
+end
+
+function Skeleton:getBoneByName(name)
+	return Polycore.Skeleton_getBoneByName(self.__ptr, name)
+end
+
+function Skeleton:bonesVisible(val)
+	return Polycore.Skeleton_bonesVisible(self.__ptr, val)
+end
+
+function Skeleton:enableBoneLabels(labelFont, size, scale, labelColor)
+	return Polycore.Skeleton_enableBoneLabels(self.__ptr, labelFont, size, scale, labelColor.__ptr)
+end
+
+function Skeleton:getNumBones()
+	return Polycore.Skeleton_getNumBones(self.__ptr)
+end
+
+function Skeleton:getBone(index)
+	return Polycore.Skeleton_getBone(self.__ptr, index)
+end
+
+function Skeleton:getCurrentAnimation()
+	return Polycore.Skeleton_getCurrentAnimation(self.__ptr)
+end
+

+ 32 - 0
Bindings/Contents/LUA/API/Polycode/SkeletonAnimation.lua

@@ -0,0 +1,32 @@
+class "SkeletonAnimation"
+
+function SkeletonAnimation:SkeletonAnimation(name, duration)
+	if self.__ptr == nil then
+		self.__ptr = Polycore.SkeletonAnimation(name, duration)
+	end
+end
+
+function SkeletonAnimation:addBoneTrack(boneTrack)
+	return Polycore.SkeletonAnimation_addBoneTrack(self.__ptr, boneTrack.__ptr)
+end
+
+function SkeletonAnimation:getName()
+	return Polycore.SkeletonAnimation_getName(self.__ptr)
+end
+
+function SkeletonAnimation:Play()
+	return Polycore.SkeletonAnimation_Play(self.__ptr)
+end
+
+function SkeletonAnimation:Stop()
+	return Polycore.SkeletonAnimation_Stop(self.__ptr)
+end
+
+function SkeletonAnimation:Update()
+	return Polycore.SkeletonAnimation_Update(self.__ptr)
+end
+
+function SkeletonAnimation:setSpeed(speed)
+	return Polycore.SkeletonAnimation_setSpeed(self.__ptr, speed)
+end
+

+ 40 - 0
Bindings/Contents/LUA/API/Polycode/Sound.lua

@@ -0,0 +1,40 @@
+class "Sound"
+
+function Sound:Sound(fileName)
+	if self.__ptr == nil then
+		self.__ptr = Polycore.Sound(fileName)
+	end
+end
+
+function Sound:Play(once)
+	return Polycore.Sound_Play(self.__ptr, once)
+end
+
+function Sound:Stop()
+	return Polycore.Sound_Stop(self.__ptr)
+end
+
+function Sound:loadWAV(fileName)
+	return Polycore.Sound_loadWAV(self.__ptr, fileName)
+end
+
+function Sound:loadOGG(fileName)
+	return Polycore.Sound_loadOGG(self.__ptr, fileName)
+end
+
+function Sound:GenSource(buffer)
+	return Polycore.Sound_GenSource(self.__ptr, buffer.__ptr)
+end
+
+function Sound:checkALError(operation)
+	return Polycore.Sound_checkALError(self.__ptr, operation)
+end
+
+function Sound:soundError(err)
+	return Polycore.Sound_soundError(self.__ptr, err)
+end
+
+function Sound:soundCheck(result, err)
+	return Polycore.Sound_soundCheck(self.__ptr, result, err)
+end
+

+ 12 - 0
Bindings/Contents/LUA/API/Polycode/SoundManager.lua

@@ -0,0 +1,12 @@
+class "SoundManager"
+
+function SoundManager:SoundManager()
+	if self.__ptr == nil then
+		self.__ptr = Polycore.SoundManager()
+	end
+end
+
+function SoundManager:initAL()
+	return Polycore.SoundManager_initAL(self.__ptr)
+end
+

+ 76 - 0
Bindings/Contents/LUA/API/Polycode/String.lua

@@ -0,0 +1,76 @@
+class "String"
+
+function String:String()
+	if self.__ptr == nil then
+		self.__ptr = Polycore.String()
+	end
+end
+
+function String:size()
+	return Polycore.String_size(self.__ptr)
+end
+
+function String:length()
+	return Polycore.String_length(self.__ptr)
+end
+
+function String:getSTLString()
+	return Polycore.String_getSTLString(self.__ptr)
+end
+
+function String:getSTLWString()
+	return Polycore.String_getSTLWString(self.__ptr)
+end
+
+function String:substr(pos, n)
+	return Polycore.String_substr(self.__ptr, pos.__ptr, n.__ptr)
+end
+
+function String:rfind(str, pos)
+	return Polycore.String_rfind(self.__ptr, str.__ptr, pos.__ptr)
+end
+
+function String:find(str, pos)
+	return Polycore.String_find(self.__ptr, str.__ptr, pos.__ptr)
+end
+
+function String:toLowerCase()
+	return Polycore.String_toLowerCase(self.__ptr)
+end
+
+function String:split(delims)
+	return Polycore.String_split(self.__ptr, delims.__ptr)
+end
+
+function String:replace(what, withWhat)
+	return Polycore.String_replace(self.__ptr, what.__ptr, withWhat.__ptr)
+end
+
+function String:NumberToString(value)
+	return Polycore.String_NumberToString(self.__ptr, value)
+end
+
+function String:c_str()
+	return Polycore.String_c_str(self.__ptr)
+end
+
+function String:wc_str()
+	return Polycore.String_wc_str(self.__ptr)
+end
+
+function String:data()
+	return Polycore.String_data(self.__ptr)
+end
+
+function String:getDataWithEncoding(encoding)
+	return Polycore.String_getDataWithEncoding(self.__ptr, encoding)
+end
+
+function String:setDataWithEncoding(data, encoding)
+	return Polycore.String_setDataWithEncoding(self.__ptr, data.__ptr, encoding)
+end
+
+function String:getDataSizeWithEncoding(encoding)
+	return Polycore.String_getDataSizeWithEncoding(self.__ptr, encoding)
+end
+

+ 38 - 0
Bindings/Contents/LUA/API/Polycode/Timer.lua

@@ -0,0 +1,38 @@
+require "Polycode/EventDispatcher"
+
+class "Timer" (EventDispatcher)
+
+function Timer:Timer(triggerMode, msecs)
+	if self.__ptr == nil then
+		self.__ptr = Polycore.Timer(triggerMode, msecs)
+	end
+end
+
+function Timer:Pause(paused)
+	return Polycore.Timer_Pause(self.__ptr, paused)
+end
+
+function Timer:isPaused()
+	return Polycore.Timer_isPaused(self.__ptr)
+end
+
+function Timer:getTicks()
+	return Polycore.Timer_getTicks(self.__ptr)
+end
+
+function Timer:Update(ticks)
+	return Polycore.Timer_Update(self.__ptr, ticks)
+end
+
+function Timer:Reset()
+	return Polycore.Timer_Reset(self.__ptr)
+end
+
+function Timer:hasElapsed()
+	return Polycore.Timer_hasElapsed(self.__ptr)
+end
+
+function Timer:getElapsedf()
+	return Polycore.Timer_getElapsedf(self.__ptr)
+end
+

+ 20 - 0
Bindings/Contents/LUA/API/Polycode/TimerManager.lua

@@ -0,0 +1,20 @@
+class "TimerManager"
+
+function TimerManager:TimerManager()
+	if self.__ptr == nil then
+		self.__ptr = Polycore.TimerManager()
+	end
+end
+
+function TimerManager:removeTimer(timer)
+	return Polycore.TimerManager_removeTimer(self.__ptr, timer.__ptr)
+end
+
+function TimerManager:addTimer(timer)
+	return Polycore.TimerManager_addTimer(self.__ptr, timer.__ptr)
+end
+
+function TimerManager:Update()
+	return Polycore.TimerManager_Update(self.__ptr)
+end
+

+ 42 - 0
Bindings/Contents/LUA/API/Polycode/Tween.lua

@@ -0,0 +1,42 @@
+require "Polycode/EventDispatcher"
+
+class "Tween" (EventDispatcher)
+
+function Tween:Tween(target, easeType, startVal, _endVal, time, _repeat)
+	if self.__ptr == nil then
+		self.__ptr = Polycore.Tween(target, easeType, startVal, _endVal, time, _repeat)
+	end
+end
+
+function Tween:handleEvent(event)
+	return Polycore.Tween_handleEvent(self.__ptr, event.__ptr)
+end
+
+function Tween:interpolateTween()
+	return Polycore.Tween_interpolateTween(self.__ptr)
+end
+
+function Tween:updateCustomTween()
+	return Polycore.Tween_updateCustomTween(self.__ptr)
+end
+
+function Tween:doOnComplete()
+	return Polycore.Tween_doOnComplete(self.__ptr)
+end
+
+function Tween:Pause(pauseVal)
+	return Polycore.Tween_Pause(self.__ptr, pauseVal)
+end
+
+function Tween:Reset()
+	return Polycore.Tween_Reset(self.__ptr)
+end
+
+function Tween:isComplete()
+	return Polycore.Tween_isComplete(self.__ptr)
+end
+
+function Tween:setSpeed(speed)
+	return Polycore.Tween_setSpeed(self.__ptr, speed)
+end
+

+ 16 - 0
Bindings/Contents/LUA/API/Polycode/TweenManager.lua

@@ -0,0 +1,16 @@
+class "TweenManager"
+
+function TweenManager:TweenManager()
+	if self.__ptr == nil then
+		self.__ptr = Polycore.TweenManager()
+	end
+end
+
+function TweenManager:addTween(tween)
+	return Polycore.TweenManager_addTween(self.__ptr, tween.__ptr)
+end
+
+function TweenManager:Update()
+	return Polycore.TweenManager_Update(self.__ptr)
+end
+

+ 8 - 0
Bindings/Contents/LUA/API/Polycode/Vector2.lua

@@ -0,0 +1,8 @@
+class "Vector2"
+
+function Vector2:Vector2()
+	if self.__ptr == nil then
+		self.__ptr = Polycore.Vector2()
+	end
+end
+

+ 32 - 0
Bindings/Contents/LUA/API/Polycode/Vector3.lua

@@ -0,0 +1,32 @@
+class "Vector3"
+
+function Vector3:Vector3()
+	if self.__ptr == nil then
+		self.__ptr = Polycore.Vector3()
+	end
+end
+
+function Vector3:set(x, y, z)
+	return Polycore.Vector3_set(self.__ptr, x, y, z)
+end
+
+function Vector3:distance(rhs)
+	return Polycore.Vector3_distance(self.__ptr, rhs.__ptr)
+end
+
+function Vector3:length()
+	return Polycore.Vector3_length(self.__ptr)
+end
+
+function Vector3:dot(u)
+	return Polycore.Vector3_dot(self.__ptr, u.__ptr)
+end
+
+function Vector3:crossProduct(rkVector)
+	return Polycore.Vector3_crossProduct(self.__ptr, rkVector.__ptr)
+end
+
+function Vector3:Normalize()
+	return Polycore.Vector3_Normalize(self.__ptr)
+end
+

+ 38 - 0
Bindings/Contents/LUA/API/Polycode/Vertex.lua

@@ -0,0 +1,38 @@
+require "Polycode/Vector3"
+
+class "Vertex" (Vector3)
+
+function Vertex:Vertex()
+	if self.__ptr == nil then
+		self.__ptr = Polycore.Vertex()
+	end
+end
+
+function Vertex:addBoneAssignment(boneID, boneWeight)
+	return Polycore.Vertex_addBoneAssignment(self.__ptr, boneID, boneWeight)
+end
+
+function Vertex:getNumBoneAssignments()
+	return Polycore.Vertex_getNumBoneAssignments(self.__ptr)
+end
+
+function Vertex:getBoneAssignment(index)
+	return Polycore.Vertex_getBoneAssignment(self.__ptr, index)
+end
+
+function Vertex:normalizeWeights()
+	return Polycore.Vertex_normalizeWeights(self.__ptr)
+end
+
+function Vertex:getTexCoord()
+	return Polycore.Vertex_getTexCoord(self.__ptr)
+end
+
+function Vertex:setTexCoord(u, v)
+	return Polycore.Vertex_setTexCoord(self.__ptr, u, v)
+end
+
+function Vertex:setNormal(x, y, z)
+	return Polycore.Vertex_setNormal(self.__ptr, x, y, z)
+end
+

+ 12 - 0
Bindings/Contents/LUA/API/Polycode/VertexBuffer.lua

@@ -0,0 +1,12 @@
+class "VertexBuffer"
+
+function VertexBuffer:VertexBuffer()
+	if self.__ptr == nil then
+		self.__ptr = Polycore.VertexBuffer()
+	end
+end
+
+function VertexBuffer:getVertexCount()
+	return Polycore.VertexBuffer_getVertexCount(self.__ptr)
+end
+

+ 1 - 1
Bindings/Contents/LUA/Include/PolycodeLUA.h

@@ -3,7 +3,7 @@
 
 
 
 
 #include <Polycode.h>
 #include <Polycode.h>
-#include "PolycodeLUA2D.h"
+#include "PolycodeLUAWrappers.h"
 
 
 extern "C" {	
 extern "C" {	
 #include <stdio.h>
 #include <stdio.h>

+ 6209 - 0
Bindings/Contents/LUA/Include/PolycodeLUAWrappers.h

@@ -0,0 +1,6209 @@
+#pragma once
+
+#include <Polycode.h>
+
+#include <PolyGLRenderer.h>
+
+extern "C" {
+
+#include <stdio.h>
+#include "lua.h"
+#include "lualib.h"
+#include "lauxlib.h"
+
+static int Polycore_OSFILE(lua_State *L) {
+	OSFILE *inst = new OSFILE();
+	lua_pushlightuserdata(L, (void*)inst);
+	return 1;
+}
+
+static int Polycore_OSFILE_debugDump(lua_State *L) {
+	luaL_checktype(L, 1, LUA_TLIGHTUSERDATA);
+	OSFILE *inst = (OSFILE*)lua_topointer(L, 1);
+	inst->debugDump();
+	return 0;
+}
+
+static int Polycore_OSFileEntry(lua_State *L) {
+	OSFileEntry *inst = new OSFileEntry();
+	lua_pushlightuserdata(L, (void*)inst);
+	return 1;
+}
+
+static int Polycore_OSBasics_open(lua_State *L) {
+	luaL_checktype(L, 1, LUA_TLIGHTUSERDATA);
+	OSBasics *inst = (OSBasics*)lua_topointer(L, 1);
+	luaL_checktype(L, 2, LUA_TSTRING);
+	String filename = lua_tostring(L, 2);
+	luaL_checktype(L, 3, LUA_TSTRING);
+	String opts = lua_tostring(L, 3);
+	lua_pushlightuserdata(L, (void*)inst->open(filename, opts));
+	return 1;
+}
+
+static int Polycore_OSBasics_close(lua_State *L) {
+	luaL_checktype(L, 1, LUA_TLIGHTUSERDATA);
+	OSBasics *inst = (OSBasics*)lua_topointer(L, 1);
+	luaL_checktype(L, 2, LUA_TLIGHTUSERDATA);
+	OSFILE * file = (OSFILE *)lua_topointer(L, 2);
+	lua_pushinteger(L, inst->close(file));
+	return 1;
+}
+
+static int Polycore_OSBasics_read(lua_State *L) {
+	luaL_checktype(L, 1, LUA_TLIGHTUSERDATA);
+	OSBasics *inst = (OSBasics*)lua_topointer(L, 1);
+	luaL_checktype(L, 2, LUA_TLIGHTUSERDATA);
+	void * ptr = (void *)lua_topointer(L, 2);
+	luaL_checktype(L, 3, LUA_TLIGHTUSERDATA);
+	size_t size = *(size_t*)lua_topointer(L, 3);
+	luaL_checktype(L, 4, LUA_TLIGHTUSERDATA);
+	size_t count = *(size_t*)lua_topointer(L, 4);
+	luaL_checktype(L, 5, LUA_TLIGHTUSERDATA);
+	OSFILE * stream = (OSFILE *)lua_topointer(L, 5);
+	lua_pushinteger(L, inst->read(ptr, size, count, stream));
+	return 1;
+}
+
+static int Polycore_OSBasics_write(lua_State *L) {
+	luaL_checktype(L, 1, LUA_TLIGHTUSERDATA);
+	OSBasics *inst = (OSBasics*)lua_topointer(L, 1);
+	luaL_checktype(L, 2, LUA_TLIGHTUSERDATA);
+	const void * ptr = (const void *)lua_topointer(L, 2);
+	luaL_checktype(L, 3, LUA_TLIGHTUSERDATA);
+	size_t size = *(size_t*)lua_topointer(L, 3);
+	luaL_checktype(L, 4, LUA_TLIGHTUSERDATA);
+	size_t count = *(size_t*)lua_topointer(L, 4);
+	luaL_checktype(L, 5, LUA_TLIGHTUSERDATA);
+	OSFILE * stream = (OSFILE *)lua_topointer(L, 5);
+	lua_pushinteger(L, inst->write(ptr, size, count, stream));
+	return 1;
+}
+
+static int Polycore_OSBasics_seek(lua_State *L) {
+	luaL_checktype(L, 1, LUA_TLIGHTUSERDATA);
+	OSBasics *inst = (OSBasics*)lua_topointer(L, 1);
+	luaL_checktype(L, 2, LUA_TLIGHTUSERDATA);
+	OSFILE * stream = (OSFILE *)lua_topointer(L, 2);
+	luaL_checktype(L, 3, LUA_TLIGHTUSERDATA);
+	long int offset = *(long int*)lua_topointer(L, 3);
+	luaL_checktype(L, 4, LUA_TNUMBER);
+	int origin = lua_tointeger(L, 4);
+	lua_pushinteger(L, inst->seek(stream, offset, origin));
+	return 1;
+}
+
+static int Polycore_OSBasics_tell(lua_State *L) {
+	luaL_checktype(L, 1, LUA_TLIGHTUSERDATA);
+	OSBasics *inst = (OSBasics*)lua_topointer(L, 1);
+	luaL_checktype(L, 2, LUA_TLIGHTUSERDATA);
+	OSFILE * stream = (OSFILE *)lua_topointer(L, 2);
+	lua_pushinteger(L, inst->tell(stream));
+	return 1;
+}
+
+static int Polycore_OSBasics_parsePhysFSFolder(lua_State *L) {
+	luaL_checktype(L, 1, LUA_TLIGHTUSERDATA);
+	OSBasics *inst = (OSBasics*)lua_topointer(L, 1);
+	luaL_checktype(L, 2, LUA_TSTRING);
+	String pathString = lua_tostring(L, 2);
+	luaL_checktype(L, 3, LUA_TBOOLEAN);
+	bool showHidden = lua_toboolean(L, 3);
+	 vector <OSFileEntry > *retInst = new  vector <OSFileEntry >();
+	*retInst = inst->parsePhysFSFolder(pathString, showHidden);
+	lua_pushlightuserdata(L, retInst);
+	return 1;
+}
+
+static int Polycore_OSBasics_parseFolder(lua_State *L) {
+	luaL_checktype(L, 1, LUA_TLIGHTUSERDATA);
+	OSBasics *inst = (OSBasics*)lua_topointer(L, 1);
+	luaL_checktype(L, 2, LUA_TSTRING);
+	String pathString = lua_tostring(L, 2);
+	luaL_checktype(L, 3, LUA_TBOOLEAN);
+	bool showHidden = lua_toboolean(L, 3);
+	 vector <OSFileEntry > *retInst = new  vector <OSFileEntry >();
+	*retInst = inst->parseFolder(pathString, showHidden);
+	lua_pushlightuserdata(L, retInst);
+	return 1;
+}
+
+static int Polycore_OSBasics_isFolder(lua_State *L) {
+	luaL_checktype(L, 1, LUA_TLIGHTUSERDATA);
+	OSBasics *inst = (OSBasics*)lua_topointer(L, 1);
+	luaL_checktype(L, 2, LUA_TSTRING);
+	String pathString = lua_tostring(L, 2);
+	lua_pushboolean(L, inst->isFolder(pathString));
+	return 1;
+}
+
+static int Polycore_OSBasics_createFolder(lua_State *L) {
+	luaL_checktype(L, 1, LUA_TLIGHTUSERDATA);
+	OSBasics *inst = (OSBasics*)lua_topointer(L, 1);
+	luaL_checktype(L, 2, LUA_TSTRING);
+	String pathString = lua_tostring(L, 2);
+	inst->createFolder(pathString);
+	return 0;
+}
+
+static int Polycore_BezierCurve(lua_State *L) {
+	BezierCurve *inst = new BezierCurve();
+	lua_pushlightuserdata(L, (void*)inst);
+	return 1;
+}
+
+static int Polycore_BezierCurve_getControlPoint(lua_State *L) {
+	luaL_checktype(L, 1, LUA_TLIGHTUSERDATA);
+	BezierCurve *inst = (BezierCurve*)lua_topointer(L, 1);
+	luaL_checktype(L, 2, LUA_TNUMBER);
+	unsigned int index = lua_tointeger(L, 2);
+	lua_pushlightuserdata(L, (void*)inst->getControlPoint(index));
+	return 1;
+}
+
+static int Polycore_BezierCurve_getNumControlPoints(lua_State *L) {
+	luaL_checktype(L, 1, LUA_TLIGHTUSERDATA);
+	BezierCurve *inst = (BezierCurve*)lua_topointer(L, 1);
+	lua_pushinteger(L, inst->getNumControlPoints());
+	return 1;
+}
+
+static int Polycore_BezierCurve_addControlPoint(lua_State *L) {
+	luaL_checktype(L, 1, LUA_TLIGHTUSERDATA);
+	BezierCurve *inst = (BezierCurve*)lua_topointer(L, 1);
+	luaL_checktype(L, 2, LUA_TNUMBER);
+	Number p1x = lua_tonumber(L, 2);
+	luaL_checktype(L, 3, LUA_TNUMBER);
+	Number p1y = lua_tonumber(L, 3);
+	luaL_checktype(L, 4, LUA_TNUMBER);
+	Number p1z = lua_tonumber(L, 4);
+	luaL_checktype(L, 5, LUA_TNUMBER);
+	Number p2x = lua_tonumber(L, 5);
+	luaL_checktype(L, 6, LUA_TNUMBER);
+	Number p2y = lua_tonumber(L, 6);
+	luaL_checktype(L, 7, LUA_TNUMBER);
+	Number p2z = lua_tonumber(L, 7);
+	luaL_checktype(L, 8, LUA_TNUMBER);
+	Number p3x = lua_tonumber(L, 8);
+	luaL_checktype(L, 9, LUA_TNUMBER);
+	Number p3y = lua_tonumber(L, 9);
+	luaL_checktype(L, 10, LUA_TNUMBER);
+	Number p3z = lua_tonumber(L, 10);
+	inst->addControlPoint(p1x, p1y, p1z, p2x, p2y, p2z, p3x, p3y, p3z);
+	return 0;
+}
+
+static int Polycore_BezierCurve_addControlPoint3dWithHandles(lua_State *L) {
+	luaL_checktype(L, 1, LUA_TLIGHTUSERDATA);
+	BezierCurve *inst = (BezierCurve*)lua_topointer(L, 1);
+	luaL_checktype(L, 2, LUA_TNUMBER);
+	Number p1x = lua_tonumber(L, 2);
+	luaL_checktype(L, 3, LUA_TNUMBER);
+	Number p1y = lua_tonumber(L, 3);
+	luaL_checktype(L, 4, LUA_TNUMBER);
+	Number p1z = lua_tonumber(L, 4);
+	luaL_checktype(L, 5, LUA_TNUMBER);
+	Number p2x = lua_tonumber(L, 5);
+	luaL_checktype(L, 6, LUA_TNUMBER);
+	Number p2y = lua_tonumber(L, 6);
+	luaL_checktype(L, 7, LUA_TNUMBER);
+	Number p2z = lua_tonumber(L, 7);
+	luaL_checktype(L, 8, LUA_TNUMBER);
+	Number p3x = lua_tonumber(L, 8);
+	luaL_checktype(L, 9, LUA_TNUMBER);
+	Number p3y = lua_tonumber(L, 9);
+	luaL_checktype(L, 10, LUA_TNUMBER);
+	Number p3z = lua_tonumber(L, 10);
+	inst->addControlPoint3dWithHandles(p1x, p1y, p1z, p2x, p2y, p2z, p3x, p3y, p3z);
+	return 0;
+}
+
+static int Polycore_BezierCurve_addControlPoint3d(lua_State *L) {
+	luaL_checktype(L, 1, LUA_TLIGHTUSERDATA);
+	BezierCurve *inst = (BezierCurve*)lua_topointer(L, 1);
+	luaL_checktype(L, 2, LUA_TNUMBER);
+	Number x = lua_tonumber(L, 2);
+	luaL_checktype(L, 3, LUA_TNUMBER);
+	Number y = lua_tonumber(L, 3);
+	luaL_checktype(L, 4, LUA_TNUMBER);
+	Number z = lua_tonumber(L, 4);
+	inst->addControlPoint3d(x, y, z);
+	return 0;
+}
+
+static int Polycore_BezierCurve_addControlPoint2dWithHandles(lua_State *L) {
+	luaL_checktype(L, 1, LUA_TLIGHTUSERDATA);
+	BezierCurve *inst = (BezierCurve*)lua_topointer(L, 1);
+	luaL_checktype(L, 2, LUA_TNUMBER);
+	Number p1x = lua_tonumber(L, 2);
+	luaL_checktype(L, 3, LUA_TNUMBER);
+	Number p1y = lua_tonumber(L, 3);
+	luaL_checktype(L, 4, LUA_TNUMBER);
+	Number p2x = lua_tonumber(L, 4);
+	luaL_checktype(L, 5, LUA_TNUMBER);
+	Number p2y = lua_tonumber(L, 5);
+	luaL_checktype(L, 6, LUA_TNUMBER);
+	Number p3x = lua_tonumber(L, 6);
+	luaL_checktype(L, 7, LUA_TNUMBER);
+	Number p3y = lua_tonumber(L, 7);
+	inst->addControlPoint2dWithHandles(p1x, p1y, p2x, p2y, p3x, p3y);
+	return 0;
+}
+
+static int Polycore_BezierCurve_addControlPoint2d(lua_State *L) {
+	luaL_checktype(L, 1, LUA_TLIGHTUSERDATA);
+	BezierCurve *inst = (BezierCurve*)lua_topointer(L, 1);
+	luaL_checktype(L, 2, LUA_TNUMBER);
+	Number x = lua_tonumber(L, 2);
+	luaL_checktype(L, 3, LUA_TNUMBER);
+	Number y = lua_tonumber(L, 3);
+	inst->addControlPoint2d(x, y);
+	return 0;
+}
+
+static int Polycore_BezierCurve_getHeightAt(lua_State *L) {
+	luaL_checktype(L, 1, LUA_TLIGHTUSERDATA);
+	BezierCurve *inst = (BezierCurve*)lua_topointer(L, 1);
+	luaL_checktype(L, 2, LUA_TNUMBER);
+	Number a = lua_tonumber(L, 2);
+	lua_pushnumber(L, inst->getHeightAt(a));
+	return 1;
+}
+
+static int Polycore_BezierCurve_getPointAt(lua_State *L) {
+	luaL_checktype(L, 1, LUA_TLIGHTUSERDATA);
+	BezierCurve *inst = (BezierCurve*)lua_topointer(L, 1);
+	luaL_checktype(L, 2, LUA_TNUMBER);
+	Number a = lua_tonumber(L, 2);
+	Vector3 *retInst = new Vector3();
+	*retInst = inst->getPointAt(a);
+	lua_pushlightuserdata(L, retInst);
+	return 1;
+}
+
+static int Polycore_BezierCurve_getPointBetween(lua_State *L) {
+	luaL_checktype(L, 1, LUA_TLIGHTUSERDATA);
+	BezierCurve *inst = (BezierCurve*)lua_topointer(L, 1);
+	luaL_checktype(L, 2, LUA_TNUMBER);
+	Number a = lua_tonumber(L, 2);
+	luaL_checktype(L, 3, LUA_TLIGHTUSERDATA);
+	BezierPoint * bp1 = (BezierPoint *)lua_topointer(L, 3);
+	luaL_checktype(L, 4, LUA_TLIGHTUSERDATA);
+	BezierPoint * bp2 = (BezierPoint *)lua_topointer(L, 4);
+	 Vector3 *retInst = new  Vector3();
+	*retInst = inst->getPointBetween(a, bp1, bp2);
+	lua_pushlightuserdata(L, retInst);
+	return 1;
+}
+
+static int Polycore_BezierCurve_rebuildBuffers(lua_State *L) {
+	luaL_checktype(L, 1, LUA_TLIGHTUSERDATA);
+	BezierCurve *inst = (BezierCurve*)lua_topointer(L, 1);
+	inst->rebuildBuffers();
+	return 0;
+}
+
+static int Polycore_Bone(lua_State *L) {
+	luaL_checktype(L, 1, LUA_TSTRING);
+	String boneName = lua_tostring(L, 1);
+	Bone *inst = new Bone(boneName);
+	lua_pushlightuserdata(L, (void*)inst);
+	return 1;
+}
+
+static int Polycore_Bone_enableBoneLabel(lua_State *L) {
+	luaL_checktype(L, 1, LUA_TLIGHTUSERDATA);
+	Bone *inst = (Bone*)lua_topointer(L, 1);
+	luaL_checktype(L, 2, LUA_TSTRING);
+	String labelFont = lua_tostring(L, 2);
+	luaL_checktype(L, 3, LUA_TNUMBER);
+	Number size = lua_tonumber(L, 3);
+	luaL_checktype(L, 4, LUA_TNUMBER);
+	Number scale = lua_tonumber(L, 4);
+	luaL_checktype(L, 5, LUA_TLIGHTUSERDATA);
+	Color labelColor = *(Color*)lua_topointer(L, 5);
+	inst->enableBoneLabel(labelFont, size, scale, labelColor);
+	return 0;
+}
+
+static int Polycore_Bone_getName(lua_State *L) {
+	luaL_checktype(L, 1, LUA_TLIGHTUSERDATA);
+	Bone *inst = (Bone*)lua_topointer(L, 1);
+	lua_pushstring(L, inst->getName().c_str());
+	return 1;
+}
+
+static int Polycore_Bone_Render(lua_State *L) {
+	luaL_checktype(L, 1, LUA_TLIGHTUSERDATA);
+	Bone *inst = (Bone*)lua_topointer(L, 1);
+	inst->Render();
+	return 0;
+}
+
+static int Polycore_Bone_setParentBone(lua_State *L) {
+	luaL_checktype(L, 1, LUA_TLIGHTUSERDATA);
+	Bone *inst = (Bone*)lua_topointer(L, 1);
+	luaL_checktype(L, 2, LUA_TLIGHTUSERDATA);
+	Bone * bone = (Bone *)lua_topointer(L, 2);
+	inst->setParentBone(bone);
+	return 0;
+}
+
+static int Polycore_Bone_addChildBone(lua_State *L) {
+	luaL_checktype(L, 1, LUA_TLIGHTUSERDATA);
+	Bone *inst = (Bone*)lua_topointer(L, 1);
+	luaL_checktype(L, 2, LUA_TLIGHTUSERDATA);
+	Bone * bone = (Bone *)lua_topointer(L, 2);
+	inst->addChildBone(bone);
+	return 0;
+}
+
+static int Polycore_Bone_getParentBone(lua_State *L) {
+	luaL_checktype(L, 1, LUA_TLIGHTUSERDATA);
+	Bone *inst = (Bone*)lua_topointer(L, 1);
+	lua_pushlightuserdata(L, (void*)inst->getParentBone());
+	return 1;
+}
+
+static int Polycore_Bone_getNumChildBones(lua_State *L) {
+	luaL_checktype(L, 1, LUA_TLIGHTUSERDATA);
+	Bone *inst = (Bone*)lua_topointer(L, 1);
+	lua_pushinteger(L, inst->getNumChildBones());
+	return 1;
+}
+
+static int Polycore_Bone_getChildBone(lua_State *L) {
+	luaL_checktype(L, 1, LUA_TLIGHTUSERDATA);
+	Bone *inst = (Bone*)lua_topointer(L, 1);
+	luaL_checktype(L, 2, LUA_TNUMBER);
+	unsigned int index = lua_tointeger(L, 2);
+	lua_pushlightuserdata(L, (void*)inst->getChildBone(index));
+	return 1;
+}
+
+static int Polycore_Bone_getBoneMatrix(lua_State *L) {
+	luaL_checktype(L, 1, LUA_TLIGHTUSERDATA);
+	Bone *inst = (Bone*)lua_topointer(L, 1);
+	Matrix4 *retInst = new Matrix4();
+	*retInst = inst->getBoneMatrix();
+	lua_pushlightuserdata(L, retInst);
+	return 1;
+}
+
+static int Polycore_Bone_setBoneMatrix(lua_State *L) {
+	luaL_checktype(L, 1, LUA_TLIGHTUSERDATA);
+	Bone *inst = (Bone*)lua_topointer(L, 1);
+	luaL_checktype(L, 2, LUA_TLIGHTUSERDATA);
+	Matrix4 matrix = *(Matrix4*)lua_topointer(L, 2);
+	inst->setBoneMatrix(matrix);
+	return 0;
+}
+
+static int Polycore_Bone_getRestMatrix(lua_State *L) {
+	luaL_checktype(L, 1, LUA_TLIGHTUSERDATA);
+	Bone *inst = (Bone*)lua_topointer(L, 1);
+	Matrix4 *retInst = new Matrix4();
+	*retInst = inst->getRestMatrix();
+	lua_pushlightuserdata(L, retInst);
+	return 1;
+}
+
+static int Polycore_Bone_getFullRestMatrix(lua_State *L) {
+	luaL_checktype(L, 1, LUA_TLIGHTUSERDATA);
+	Bone *inst = (Bone*)lua_topointer(L, 1);
+	Matrix4 *retInst = new Matrix4();
+	*retInst = inst->getFullRestMatrix();
+	lua_pushlightuserdata(L, retInst);
+	return 1;
+}
+
+static int Polycore_Bone_getParentRestMatrix(lua_State *L) {
+	luaL_checktype(L, 1, LUA_TLIGHTUSERDATA);
+	Bone *inst = (Bone*)lua_topointer(L, 1);
+	Matrix4 *retInst = new Matrix4();
+	*retInst = inst->getParentRestMatrix();
+	lua_pushlightuserdata(L, retInst);
+	return 1;
+}
+
+static int Polycore_Bone_getFinalMatrix(lua_State *L) {
+	luaL_checktype(L, 1, LUA_TLIGHTUSERDATA);
+	Bone *inst = (Bone*)lua_topointer(L, 1);
+	Matrix4 *retInst = new Matrix4();
+	*retInst = inst->getFinalMatrix();
+	lua_pushlightuserdata(L, retInst);
+	return 1;
+}
+
+static int Polycore_Bone_setRestMatrix(lua_State *L) {
+	luaL_checktype(L, 1, LUA_TLIGHTUSERDATA);
+	Bone *inst = (Bone*)lua_topointer(L, 1);
+	luaL_checktype(L, 2, LUA_TLIGHTUSERDATA);
+	Matrix4 matrix = *(Matrix4*)lua_topointer(L, 2);
+	inst->setRestMatrix(matrix);
+	return 0;
+}
+
+static int Polycore_Bone_setBaseMatrix(lua_State *L) {
+	luaL_checktype(L, 1, LUA_TLIGHTUSERDATA);
+	Bone *inst = (Bone*)lua_topointer(L, 1);
+	luaL_checktype(L, 2, LUA_TLIGHTUSERDATA);
+	Matrix4 matrix = *(Matrix4*)lua_topointer(L, 2);
+	inst->setBaseMatrix(matrix);
+	return 0;
+}
+
+static int Polycore_Bone_getBaseMatrix(lua_State *L) {
+	luaL_checktype(L, 1, LUA_TLIGHTUSERDATA);
+	Bone *inst = (Bone*)lua_topointer(L, 1);
+	Matrix4 *retInst = new Matrix4();
+	*retInst = inst->getBaseMatrix();
+	lua_pushlightuserdata(L, retInst);
+	return 1;
+}
+
+static int Polycore_Bone_getFullBaseMatrix(lua_State *L) {
+	luaL_checktype(L, 1, LUA_TLIGHTUSERDATA);
+	Bone *inst = (Bone*)lua_topointer(L, 1);
+	Matrix4 *retInst = new Matrix4();
+	*retInst = inst->getFullBaseMatrix();
+	lua_pushlightuserdata(L, retInst);
+	return 1;
+}
+
+static int Polycore_Camera(lua_State *L) {
+	luaL_checktype(L, 1, LUA_TLIGHTUSERDATA);
+	Scene * parentScene = (Scene *)lua_topointer(L, 1);
+	Camera *inst = new Camera(parentScene);
+	lua_pushlightuserdata(L, (void*)inst);
+	return 1;
+}
+
+static int Polycore_Camera_buildFrustrumPlanes(lua_State *L) {
+	luaL_checktype(L, 1, LUA_TLIGHTUSERDATA);
+	Camera *inst = (Camera*)lua_topointer(L, 1);
+	inst->buildFrustrumPlanes();
+	return 0;
+}
+
+static int Polycore_Camera_isSphereInFrustrum(lua_State *L) {
+	luaL_checktype(L, 1, LUA_TLIGHTUSERDATA);
+	Camera *inst = (Camera*)lua_topointer(L, 1);
+	luaL_checktype(L, 2, LUA_TLIGHTUSERDATA);
+	Vector3 pos = *(Vector3*)lua_topointer(L, 2);
+	luaL_checktype(L, 3, LUA_TNUMBER);
+	Number fRadius = lua_tonumber(L, 3);
+	lua_pushboolean(L, inst->isSphereInFrustrum(pos, fRadius));
+	return 1;
+}
+
+static int Polycore_Camera_canSee(lua_State *L) {
+	luaL_checktype(L, 1, LUA_TLIGHTUSERDATA);
+	Camera *inst = (Camera*)lua_topointer(L, 1);
+	luaL_checktype(L, 2, LUA_TLIGHTUSERDATA);
+	SceneEntity * entity = (SceneEntity *)lua_topointer(L, 2);
+	lua_pushboolean(L, inst->canSee(entity));
+	return 1;
+}
+
+static int Polycore_Camera_setOrthoMode(lua_State *L) {
+	luaL_checktype(L, 1, LUA_TLIGHTUSERDATA);
+	Camera *inst = (Camera*)lua_topointer(L, 1);
+	luaL_checktype(L, 2, LUA_TBOOLEAN);
+	bool mode = lua_toboolean(L, 2);
+	inst->setOrthoMode(mode);
+	return 0;
+}
+
+static int Polycore_Camera_getOrthoMode(lua_State *L) {
+	luaL_checktype(L, 1, LUA_TLIGHTUSERDATA);
+	Camera *inst = (Camera*)lua_topointer(L, 1);
+	lua_pushboolean(L, inst->getOrthoMode());
+	return 1;
+}
+
+static int Polycore_Camera_setFOV(lua_State *L) {
+	luaL_checktype(L, 1, LUA_TLIGHTUSERDATA);
+	Camera *inst = (Camera*)lua_topointer(L, 1);
+	luaL_checktype(L, 2, LUA_TNUMBER);
+	Number fov = lua_tonumber(L, 2);
+	inst->setFOV(fov);
+	return 0;
+}
+
+static int Polycore_Camera_getFOV(lua_State *L) {
+	luaL_checktype(L, 1, LUA_TLIGHTUSERDATA);
+	Camera *inst = (Camera*)lua_topointer(L, 1);
+	lua_pushnumber(L, inst->getFOV());
+	return 1;
+}
+
+static int Polycore_Camera_doCameraTransform(lua_State *L) {
+	luaL_checktype(L, 1, LUA_TLIGHTUSERDATA);
+	Camera *inst = (Camera*)lua_topointer(L, 1);
+	inst->doCameraTransform();
+	return 0;
+}
+
+static int Polycore_Camera_setLightDepthTexture(lua_State *L) {
+	luaL_checktype(L, 1, LUA_TLIGHTUSERDATA);
+	Camera *inst = (Camera*)lua_topointer(L, 1);
+	luaL_checktype(L, 2, LUA_TLIGHTUSERDATA);
+	Texture * texture = (Texture *)lua_topointer(L, 2);
+	inst->setLightDepthTexture(texture);
+	return 0;
+}
+
+static int Polycore_Camera_setParentScene(lua_State *L) {
+	luaL_checktype(L, 1, LUA_TLIGHTUSERDATA);
+	Camera *inst = (Camera*)lua_topointer(L, 1);
+	luaL_checktype(L, 2, LUA_TLIGHTUSERDATA);
+	Scene * parentScene = (Scene *)lua_topointer(L, 2);
+	inst->setParentScene(parentScene);
+	return 0;
+}
+
+static int Polycore_Camera_hasFilterShader(lua_State *L) {
+	luaL_checktype(L, 1, LUA_TLIGHTUSERDATA);
+	Camera *inst = (Camera*)lua_topointer(L, 1);
+	lua_pushboolean(L, inst->hasFilterShader());
+	return 1;
+}
+
+static int Polycore_Camera_drawFilter(lua_State *L) {
+	luaL_checktype(L, 1, LUA_TLIGHTUSERDATA);
+	Camera *inst = (Camera*)lua_topointer(L, 1);
+	inst->drawFilter();
+	return 0;
+}
+
+static int Polycore_Camera_setExposureLevel(lua_State *L) {
+	luaL_checktype(L, 1, LUA_TLIGHTUSERDATA);
+	Camera *inst = (Camera*)lua_topointer(L, 1);
+	luaL_checktype(L, 2, LUA_TNUMBER);
+	Number level = lua_tonumber(L, 2);
+	inst->setExposureLevel(level);
+	return 0;
+}
+
+static int Polycore_Camera_getExposureLevel(lua_State *L) {
+	luaL_checktype(L, 1, LUA_TLIGHTUSERDATA);
+	Camera *inst = (Camera*)lua_topointer(L, 1);
+	lua_pushnumber(L, inst->getExposureLevel());
+	return 1;
+}
+
+static int Polycore_Camera_createPostFilter(lua_State *L) {
+	luaL_checktype(L, 1, LUA_TLIGHTUSERDATA);
+	Camera *inst = (Camera*)lua_topointer(L, 1);
+	luaL_checktype(L, 2, LUA_TLIGHTUSERDATA);
+	Material * shaderMaterial = (Material *)lua_topointer(L, 2);
+	inst->createPostFilter(shaderMaterial);
+	return 0;
+}
+
+static int Polycore_Camera_setPostFilter(lua_State *L) {
+	luaL_checktype(L, 1, LUA_TLIGHTUSERDATA);
+	Camera *inst = (Camera*)lua_topointer(L, 1);
+	luaL_checktype(L, 2, LUA_TSTRING);
+	String shaderName = lua_tostring(L, 2);
+	inst->setPostFilter(shaderName);
+	return 0;
+}
+
+static int Polycore_Color(lua_State *L) {
+	Color *inst = new Color();
+	lua_pushlightuserdata(L, (void*)inst);
+	return 1;
+}
+
+static int Polycore_Color_setColorHex(lua_State *L) {
+	luaL_checktype(L, 1, LUA_TLIGHTUSERDATA);
+	Color *inst = (Color*)lua_topointer(L, 1);
+	luaL_checktype(L, 2, LUA_TNUMBER);
+	unsigned int hex = lua_tointeger(L, 2);
+	inst->setColorHex(hex);
+	return 0;
+}
+
+static int Polycore_Color_setColorHexRGB(lua_State *L) {
+	luaL_checktype(L, 1, LUA_TLIGHTUSERDATA);
+	Color *inst = (Color*)lua_topointer(L, 1);
+	luaL_checktype(L, 2, LUA_TNUMBER);
+	unsigned int hex = lua_tointeger(L, 2);
+	inst->setColorHexRGB(hex);
+	return 0;
+}
+
+static int Polycore_Color_setColorHSV(lua_State *L) {
+	luaL_checktype(L, 1, LUA_TLIGHTUSERDATA);
+	Color *inst = (Color*)lua_topointer(L, 1);
+	luaL_checktype(L, 2, LUA_TNUMBER);
+	Number h = lua_tonumber(L, 2);
+	luaL_checktype(L, 3, LUA_TNUMBER);
+	Number s = lua_tonumber(L, 3);
+	luaL_checktype(L, 4, LUA_TNUMBER);
+	Number v = lua_tonumber(L, 4);
+	inst->setColorHSV(h, s, v);
+	return 0;
+}
+
+static int Polycore_Color_setColorRGBA(lua_State *L) {
+	luaL_checktype(L, 1, LUA_TLIGHTUSERDATA);
+	Color *inst = (Color*)lua_topointer(L, 1);
+	luaL_checktype(L, 2, LUA_TNUMBER);
+	int r = lua_tointeger(L, 2);
+	luaL_checktype(L, 3, LUA_TNUMBER);
+	int g = lua_tointeger(L, 3);
+	luaL_checktype(L, 4, LUA_TNUMBER);
+	int b = lua_tointeger(L, 4);
+	luaL_checktype(L, 5, LUA_TNUMBER);
+	int a = lua_tointeger(L, 5);
+	inst->setColorRGBA(r, g, b, a);
+	return 0;
+}
+
+static int Polycore_Color_setColorRGB(lua_State *L) {
+	luaL_checktype(L, 1, LUA_TLIGHTUSERDATA);
+	Color *inst = (Color*)lua_topointer(L, 1);
+	luaL_checktype(L, 2, LUA_TNUMBER);
+	int r = lua_tointeger(L, 2);
+	luaL_checktype(L, 3, LUA_TNUMBER);
+	int g = lua_tointeger(L, 3);
+	luaL_checktype(L, 4, LUA_TNUMBER);
+	int b = lua_tointeger(L, 4);
+	inst->setColorRGB(r, g, b);
+	return 0;
+}
+
+static int Polycore_Color_setColor(lua_State *L) {
+	luaL_checktype(L, 1, LUA_TLIGHTUSERDATA);
+	Color *inst = (Color*)lua_topointer(L, 1);
+	luaL_checktype(L, 2, LUA_TNUMBER);
+	Number r = lua_tonumber(L, 2);
+	luaL_checktype(L, 3, LUA_TNUMBER);
+	Number g = lua_tonumber(L, 3);
+	luaL_checktype(L, 4, LUA_TNUMBER);
+	Number b = lua_tonumber(L, 4);
+	luaL_checktype(L, 5, LUA_TNUMBER);
+	Number a = lua_tonumber(L, 5);
+	inst->setColor(r, g, b, a);
+	return 0;
+}
+
+static int Polycore_Color_Random(lua_State *L) {
+	luaL_checktype(L, 1, LUA_TLIGHTUSERDATA);
+	Color *inst = (Color*)lua_topointer(L, 1);
+	inst->Random();
+	return 0;
+}
+
+static int Polycore_Color_getBrightness(lua_State *L) {
+	luaL_checktype(L, 1, LUA_TLIGHTUSERDATA);
+	Color *inst = (Color*)lua_topointer(L, 1);
+	lua_pushnumber(L, inst->getBrightness());
+	return 1;
+}
+
+static int Polycore_Color_getUint(lua_State *L) {
+	luaL_checktype(L, 1, LUA_TLIGHTUSERDATA);
+	Color *inst = (Color*)lua_topointer(L, 1);
+	lua_pushinteger(L, inst->getUint());
+	return 1;
+}
+
+static int Polycore_Config(lua_State *L) {
+	Config *inst = new Config();
+	lua_pushlightuserdata(L, (void*)inst);
+	return 1;
+}
+
+static int Polycore_Config_loadConfig(lua_State *L) {
+	luaL_checktype(L, 1, LUA_TLIGHTUSERDATA);
+	Config *inst = (Config*)lua_topointer(L, 1);
+	luaL_checktype(L, 2, LUA_TSTRING);
+	String configNamespace = lua_tostring(L, 2);
+	luaL_checktype(L, 3, LUA_TSTRING);
+	String fileName = lua_tostring(L, 3);
+	inst->loadConfig(configNamespace, fileName);
+	return 0;
+}
+
+static int Polycore_Config_saveConfig(lua_State *L) {
+	luaL_checktype(L, 1, LUA_TLIGHTUSERDATA);
+	Config *inst = (Config*)lua_topointer(L, 1);
+	luaL_checktype(L, 2, LUA_TSTRING);
+	String configNamespace = lua_tostring(L, 2);
+	luaL_checktype(L, 3, LUA_TSTRING);
+	String fileName = lua_tostring(L, 3);
+	inst->saveConfig(configNamespace, fileName);
+	return 0;
+}
+
+static int Polycore_Config_getEntry(lua_State *L) {
+	luaL_checktype(L, 1, LUA_TLIGHTUSERDATA);
+	Config *inst = (Config*)lua_topointer(L, 1);
+	luaL_checktype(L, 2, LUA_TSTRING);
+	String configNamespace = lua_tostring(L, 2);
+	luaL_checktype(L, 3, LUA_TSTRING);
+	String key = lua_tostring(L, 3);
+	lua_pushlightuserdata(L, (void*)inst->getEntry(configNamespace, key));
+	return 1;
+}
+
+static int Polycore_Config_setStringValue(lua_State *L) {
+	luaL_checktype(L, 1, LUA_TLIGHTUSERDATA);
+	Config *inst = (Config*)lua_topointer(L, 1);
+	luaL_checktype(L, 2, LUA_TSTRING);
+	String configNamespace = lua_tostring(L, 2);
+	luaL_checktype(L, 3, LUA_TSTRING);
+	String key = lua_tostring(L, 3);
+	luaL_checktype(L, 4, LUA_TSTRING);
+	String value = lua_tostring(L, 4);
+	inst->setStringValue(configNamespace, key, value);
+	return 0;
+}
+
+static int Polycore_Config_setNumericValue(lua_State *L) {
+	luaL_checktype(L, 1, LUA_TLIGHTUSERDATA);
+	Config *inst = (Config*)lua_topointer(L, 1);
+	luaL_checktype(L, 2, LUA_TSTRING);
+	String configNamespace = lua_tostring(L, 2);
+	luaL_checktype(L, 3, LUA_TSTRING);
+	String key = lua_tostring(L, 3);
+	luaL_checktype(L, 4, LUA_TNUMBER);
+	Number value = lua_tonumber(L, 4);
+	inst->setNumericValue(configNamespace, key, value);
+	return 0;
+}
+
+static int Polycore_Config_getNumericValue(lua_State *L) {
+	luaL_checktype(L, 1, LUA_TLIGHTUSERDATA);
+	Config *inst = (Config*)lua_topointer(L, 1);
+	luaL_checktype(L, 2, LUA_TSTRING);
+	String configNamespace = lua_tostring(L, 2);
+	luaL_checktype(L, 3, LUA_TSTRING);
+	String key = lua_tostring(L, 3);
+	lua_pushnumber(L, inst->getNumericValue(configNamespace, key));
+	return 1;
+}
+
+static int Polycore_Config_getStringValue(lua_State *L) {
+	luaL_checktype(L, 1, LUA_TLIGHTUSERDATA);
+	Config *inst = (Config*)lua_topointer(L, 1);
+	luaL_checktype(L, 2, LUA_TSTRING);
+	String configNamespace = lua_tostring(L, 2);
+	luaL_checktype(L, 3, LUA_TSTRING);
+	String key = lua_tostring(L, 3);
+	lua_pushstring(L, inst->getStringValue(configNamespace, key).c_str());
+	return 1;
+}
+
+static int Polycore_CoreInput(lua_State *L) {
+	CoreInput *inst = new CoreInput();
+	lua_pushlightuserdata(L, (void*)inst);
+	return 1;
+}
+
+static int Polycore_CoreInput_mouseWheelUp(lua_State *L) {
+	luaL_checktype(L, 1, LUA_TLIGHTUSERDATA);
+	CoreInput *inst = (CoreInput*)lua_topointer(L, 1);
+	luaL_checktype(L, 2, LUA_TNUMBER);
+	int ticks = lua_tointeger(L, 2);
+	inst->mouseWheelUp(ticks);
+	return 0;
+}
+
+static int Polycore_CoreInput_mouseWheelDown(lua_State *L) {
+	luaL_checktype(L, 1, LUA_TLIGHTUSERDATA);
+	CoreInput *inst = (CoreInput*)lua_topointer(L, 1);
+	luaL_checktype(L, 2, LUA_TNUMBER);
+	int ticks = lua_tointeger(L, 2);
+	inst->mouseWheelDown(ticks);
+	return 0;
+}
+
+static int Polycore_CoreInput_getMouseButtonState(lua_State *L) {
+	luaL_checktype(L, 1, LUA_TLIGHTUSERDATA);
+	CoreInput *inst = (CoreInput*)lua_topointer(L, 1);
+	luaL_checktype(L, 2, LUA_TNUMBER);
+	int mouseButton = lua_tointeger(L, 2);
+	lua_pushboolean(L, inst->getMouseButtonState(mouseButton));
+	return 1;
+}
+
+static int Polycore_CoreInput_setMouseButtonState(lua_State *L) {
+	luaL_checktype(L, 1, LUA_TLIGHTUSERDATA);
+	CoreInput *inst = (CoreInput*)lua_topointer(L, 1);
+	luaL_checktype(L, 2, LUA_TNUMBER);
+	int mouseButton = lua_tointeger(L, 2);
+	luaL_checktype(L, 3, LUA_TBOOLEAN);
+	bool state = lua_toboolean(L, 3);
+	luaL_checktype(L, 4, LUA_TNUMBER);
+	int ticks = lua_tointeger(L, 4);
+	inst->setMouseButtonState(mouseButton, state, ticks);
+	return 0;
+}
+
+static int Polycore_CoreInput_setMousePosition(lua_State *L) {
+	luaL_checktype(L, 1, LUA_TLIGHTUSERDATA);
+	CoreInput *inst = (CoreInput*)lua_topointer(L, 1);
+	luaL_checktype(L, 2, LUA_TNUMBER);
+	int x = lua_tointeger(L, 2);
+	luaL_checktype(L, 3, LUA_TNUMBER);
+	int y = lua_tointeger(L, 3);
+	luaL_checktype(L, 4, LUA_TNUMBER);
+	int ticks = lua_tointeger(L, 4);
+	inst->setMousePosition(x, y, ticks);
+	return 0;
+}
+
+static int Polycore_CoreInput_getMousePosition(lua_State *L) {
+	luaL_checktype(L, 1, LUA_TLIGHTUSERDATA);
+	CoreInput *inst = (CoreInput*)lua_topointer(L, 1);
+	Vector2 *retInst = new Vector2();
+	*retInst = inst->getMousePosition();
+	lua_pushlightuserdata(L, retInst);
+	return 1;
+}
+
+static int Polycore_CoreInput_setKeyState(lua_State *L) {
+	luaL_checktype(L, 1, LUA_TLIGHTUSERDATA);
+	CoreInput *inst = (CoreInput*)lua_topointer(L, 1);
+	luaL_checktype(L, 2, LUA_TLIGHTUSERDATA);
+	TAUKey keyCode = *(TAUKey*)lua_topointer(L, 2);
+	luaL_checktype(L, 3, LUA_TLIGHTUSERDATA);
+	wchar_t code = *(wchar_t*)lua_topointer(L, 3);
+	luaL_checktype(L, 4, LUA_TBOOLEAN);
+	bool newState = lua_toboolean(L, 4);
+	luaL_checktype(L, 5, LUA_TNUMBER);
+	int ticks = lua_tointeger(L, 5);
+	inst->setKeyState(keyCode, code, newState, ticks);
+	return 0;
+}
+
+static int Polycore_CoreInput_getKeyState(lua_State *L) {
+	luaL_checktype(L, 1, LUA_TLIGHTUSERDATA);
+	CoreInput *inst = (CoreInput*)lua_topointer(L, 1);
+	luaL_checktype(L, 2, LUA_TLIGHTUSERDATA);
+	TAUKey keyCode = *(TAUKey*)lua_topointer(L, 2);
+	lua_pushboolean(L, inst->getKeyState(keyCode));
+	return 1;
+}
+
+static int Polycore_CoreInput_getMouseDelta(lua_State *L) {
+	luaL_checktype(L, 1, LUA_TLIGHTUSERDATA);
+	CoreInput *inst = (CoreInput*)lua_topointer(L, 1);
+	Vector2 *retInst = new Vector2();
+	*retInst = inst->getMouseDelta();
+	lua_pushlightuserdata(L, retInst);
+	return 1;
+}
+
+static int Polycore_CoreInput_setDeltaPosition(lua_State *L) {
+	luaL_checktype(L, 1, LUA_TLIGHTUSERDATA);
+	CoreInput *inst = (CoreInput*)lua_topointer(L, 1);
+	luaL_checktype(L, 2, LUA_TNUMBER);
+	int x = lua_tointeger(L, 2);
+	luaL_checktype(L, 3, LUA_TNUMBER);
+	int y = lua_tointeger(L, 3);
+	inst->setDeltaPosition(x, y);
+	return 0;
+}
+
+static int Polycore_CoreInput_createEvent(lua_State *L) {
+	luaL_checktype(L, 1, LUA_TLIGHTUSERDATA);
+	CoreInput *inst = (CoreInput*)lua_topointer(L, 1);
+	luaL_checktype(L, 2, LUA_TLIGHTUSERDATA);
+	Event * event = (Event *)lua_topointer(L, 2);
+	lua_pushlightuserdata(L, (void*)inst->createEvent(event));
+	return 1;
+}
+
+static int Polycore_CoreServices_getInstance(lua_State *L) {
+	luaL_checktype(L, 1, LUA_TLIGHTUSERDATA);
+	CoreServices *inst = (CoreServices*)lua_topointer(L, 1);
+	lua_pushlightuserdata(L, (void*)inst->getInstance());
+	return 1;
+}
+
+static int Polycore_CoreServices_getRenderMutex(lua_State *L) {
+	luaL_checktype(L, 1, LUA_TLIGHTUSERDATA);
+	CoreServices *inst = (CoreServices*)lua_topointer(L, 1);
+	lua_pushlightuserdata(L, (void*)inst->getRenderMutex());
+	return 1;
+}
+
+static int Polycore_CoreServices_setRenderer(lua_State *L) {
+	luaL_checktype(L, 1, LUA_TLIGHTUSERDATA);
+	CoreServices *inst = (CoreServices*)lua_topointer(L, 1);
+	luaL_checktype(L, 2, LUA_TLIGHTUSERDATA);
+	Renderer * r_enderer = (Renderer *)lua_topointer(L, 2);
+	inst->setRenderer(r_enderer);
+	return 0;
+}
+
+static int Polycore_CoreServices_getRenderer(lua_State *L) {
+	luaL_checktype(L, 1, LUA_TLIGHTUSERDATA);
+	CoreServices *inst = (CoreServices*)lua_topointer(L, 1);
+	lua_pushlightuserdata(L, (void*)inst->getRenderer());
+	return 1;
+}
+
+static int Polycore_CoreServices_Update(lua_State *L) {
+	luaL_checktype(L, 1, LUA_TLIGHTUSERDATA);
+	CoreServices *inst = (CoreServices*)lua_topointer(L, 1);
+	luaL_checktype(L, 2, LUA_TNUMBER);
+	int elapsed = lua_tointeger(L, 2);
+	inst->Update(elapsed);
+	return 0;
+}
+
+static int Polycore_CoreServices_setCore(lua_State *L) {
+	luaL_checktype(L, 1, LUA_TLIGHTUSERDATA);
+	CoreServices *inst = (CoreServices*)lua_topointer(L, 1);
+	luaL_checktype(L, 2, LUA_TLIGHTUSERDATA);
+	Core * core = (Core *)lua_topointer(L, 2);
+	inst->setCore(core);
+	return 0;
+}
+
+static int Polycore_CoreServices_getCore(lua_State *L) {
+	luaL_checktype(L, 1, LUA_TLIGHTUSERDATA);
+	CoreServices *inst = (CoreServices*)lua_topointer(L, 1);
+	lua_pushlightuserdata(L, (void*)inst->getCore());
+	return 1;
+}
+
+static int Polycore_CoreServices_handleEvent(lua_State *L) {
+	luaL_checktype(L, 1, LUA_TLIGHTUSERDATA);
+	CoreServices *inst = (CoreServices*)lua_topointer(L, 1);
+	luaL_checktype(L, 2, LUA_TLIGHTUSERDATA);
+	Event * event = (Event *)lua_topointer(L, 2);
+	inst->handleEvent(event);
+	return 0;
+}
+
+static int Polycore_CoreServices_installModule(lua_State *L) {
+	luaL_checktype(L, 1, LUA_TLIGHTUSERDATA);
+	CoreServices *inst = (CoreServices*)lua_topointer(L, 1);
+	luaL_checktype(L, 2, LUA_TLIGHTUSERDATA);
+	PolycodeModule * module = (PolycodeModule *)lua_topointer(L, 2);
+	inst->installModule(module);
+	return 0;
+}
+
+static int Polycore_CoreServices_getMaterialManager(lua_State *L) {
+	luaL_checktype(L, 1, LUA_TLIGHTUSERDATA);
+	CoreServices *inst = (CoreServices*)lua_topointer(L, 1);
+	lua_pushlightuserdata(L, (void*)inst->getMaterialManager());
+	return 1;
+}
+
+static int Polycore_CoreServices_getScreenManager(lua_State *L) {
+	luaL_checktype(L, 1, LUA_TLIGHTUSERDATA);
+	CoreServices *inst = (CoreServices*)lua_topointer(L, 1);
+	lua_pushlightuserdata(L, (void*)inst->getScreenManager());
+	return 1;
+}
+
+static int Polycore_CoreServices_getSceneManager(lua_State *L) {
+	luaL_checktype(L, 1, LUA_TLIGHTUSERDATA);
+	CoreServices *inst = (CoreServices*)lua_topointer(L, 1);
+	lua_pushlightuserdata(L, (void*)inst->getSceneManager());
+	return 1;
+}
+
+static int Polycore_CoreServices_getTimerManager(lua_State *L) {
+	luaL_checktype(L, 1, LUA_TLIGHTUSERDATA);
+	CoreServices *inst = (CoreServices*)lua_topointer(L, 1);
+	lua_pushlightuserdata(L, (void*)inst->getTimerManager());
+	return 1;
+}
+
+static int Polycore_CoreServices_getTweenManager(lua_State *L) {
+	luaL_checktype(L, 1, LUA_TLIGHTUSERDATA);
+	CoreServices *inst = (CoreServices*)lua_topointer(L, 1);
+	lua_pushlightuserdata(L, (void*)inst->getTweenManager());
+	return 1;
+}
+
+static int Polycore_CoreServices_getResourceManager(lua_State *L) {
+	luaL_checktype(L, 1, LUA_TLIGHTUSERDATA);
+	CoreServices *inst = (CoreServices*)lua_topointer(L, 1);
+	lua_pushlightuserdata(L, (void*)inst->getResourceManager());
+	return 1;
+}
+
+static int Polycore_CoreServices_getSoundManager(lua_State *L) {
+	luaL_checktype(L, 1, LUA_TLIGHTUSERDATA);
+	CoreServices *inst = (CoreServices*)lua_topointer(L, 1);
+	lua_pushlightuserdata(L, (void*)inst->getSoundManager());
+	return 1;
+}
+
+static int Polycore_CoreServices_getFontManager(lua_State *L) {
+	luaL_checktype(L, 1, LUA_TLIGHTUSERDATA);
+	CoreServices *inst = (CoreServices*)lua_topointer(L, 1);
+	lua_pushlightuserdata(L, (void*)inst->getFontManager());
+	return 1;
+}
+
+static int Polycore_CoreServices_getConfig(lua_State *L) {
+	luaL_checktype(L, 1, LUA_TLIGHTUSERDATA);
+	CoreServices *inst = (CoreServices*)lua_topointer(L, 1);
+	lua_pushlightuserdata(L, (void*)inst->getConfig());
+	return 1;
+}
+
+static int Polycore_Cubemap(lua_State *L) {
+	luaL_checktype(L, 1, LUA_TLIGHTUSERDATA);
+	Texture * t0 = (Texture *)lua_topointer(L, 1);
+	luaL_checktype(L, 2, LUA_TLIGHTUSERDATA);
+	Texture * t1 = (Texture *)lua_topointer(L, 2);
+	luaL_checktype(L, 3, LUA_TLIGHTUSERDATA);
+	Texture * t2 = (Texture *)lua_topointer(L, 3);
+	luaL_checktype(L, 4, LUA_TLIGHTUSERDATA);
+	Texture * t3 = (Texture *)lua_topointer(L, 4);
+	luaL_checktype(L, 5, LUA_TLIGHTUSERDATA);
+	Texture * t4 = (Texture *)lua_topointer(L, 5);
+	luaL_checktype(L, 6, LUA_TLIGHTUSERDATA);
+	Texture * t5 = (Texture *)lua_topointer(L, 6);
+	Cubemap *inst = new Cubemap(t0, t1, t2, t3, t4, t5);
+	lua_pushlightuserdata(L, (void*)inst);
+	return 1;
+}
+
+static int Polycore_Data(lua_State *L) {
+	Data *inst = new Data();
+	lua_pushlightuserdata(L, (void*)inst);
+	return 1;
+}
+
+static int Polycore_Data_loadFromFile(lua_State *L) {
+	luaL_checktype(L, 1, LUA_TLIGHTUSERDATA);
+	Data *inst = (Data*)lua_topointer(L, 1);
+	luaL_checktype(L, 2, LUA_TSTRING);
+	String fileName = lua_tostring(L, 2);
+	inst->loadFromFile(fileName);
+	return 0;
+}
+
+static int Polycore_Data_getAsString(lua_State *L) {
+	luaL_checktype(L, 1, LUA_TLIGHTUSERDATA);
+	Data *inst = (Data*)lua_topointer(L, 1);
+	luaL_checktype(L, 2, LUA_TNUMBER);
+	int encoding = lua_tointeger(L, 2);
+	lua_pushstring(L, inst->getAsString(encoding).c_str());
+	return 1;
+}
+
+static int Polycore_Data_setFromString(lua_State *L) {
+	luaL_checktype(L, 1, LUA_TLIGHTUSERDATA);
+	Data *inst = (Data*)lua_topointer(L, 1);
+	luaL_checktype(L, 2, LUA_TSTRING);
+	String str = lua_tostring(L, 2);
+	luaL_checktype(L, 3, LUA_TNUMBER);
+	int encoding = lua_tointeger(L, 3);
+	inst->setFromString(str, encoding);
+	return 0;
+}
+
+static int Polycore_Data_saveToFile(lua_State *L) {
+	luaL_checktype(L, 1, LUA_TLIGHTUSERDATA);
+	Data *inst = (Data*)lua_topointer(L, 1);
+	luaL_checktype(L, 2, LUA_TSTRING);
+	String fileName = lua_tostring(L, 2);
+	lua_pushboolean(L, inst->saveToFile(fileName));
+	return 1;
+}
+
+static int Polycore_Data_getData(lua_State *L) {
+	luaL_checktype(L, 1, LUA_TLIGHTUSERDATA);
+	Data *inst = (Data*)lua_topointer(L, 1);
+	lua_pushlightuserdata(L, (void*)inst->getData());
+	return 1;
+}
+
+static int Polycore_Entity(lua_State *L) {
+	Entity *inst = new Entity();
+	lua_pushlightuserdata(L, (void*)inst);
+	return 1;
+}
+
+static int Polycore_Entity_Render(lua_State *L) {
+	luaL_checktype(L, 1, LUA_TLIGHTUSERDATA);
+	Entity *inst = (Entity*)lua_topointer(L, 1);
+	inst->Render();
+	return 0;
+}
+
+static int Polycore_Entity_Update(lua_State *L) {
+	luaL_checktype(L, 1, LUA_TLIGHTUSERDATA);
+	Entity *inst = (Entity*)lua_topointer(L, 1);
+	inst->Update();
+	return 0;
+}
+
+static int Polycore_Entity_transformAndRender(lua_State *L) {
+	luaL_checktype(L, 1, LUA_TLIGHTUSERDATA);
+	Entity *inst = (Entity*)lua_topointer(L, 1);
+	inst->transformAndRender();
+	return 0;
+}
+
+static int Polycore_Entity_setMatrix(lua_State *L) {
+	luaL_checktype(L, 1, LUA_TLIGHTUSERDATA);
+	Entity *inst = (Entity*)lua_topointer(L, 1);
+	luaL_checktype(L, 2, LUA_TLIGHTUSERDATA);
+	Matrix4 matrix = *(Matrix4*)lua_topointer(L, 2);
+	inst->setMatrix(matrix);
+	return 0;
+}
+
+static int Polycore_Entity_rebuildTransformMatrix(lua_State *L) {
+	luaL_checktype(L, 1, LUA_TLIGHTUSERDATA);
+	Entity *inst = (Entity*)lua_topointer(L, 1);
+	inst->rebuildTransformMatrix();
+	return 0;
+}
+
+static int Polycore_Entity_addEntity(lua_State *L) {
+	luaL_checktype(L, 1, LUA_TLIGHTUSERDATA);
+	Entity *inst = (Entity*)lua_topointer(L, 1);
+	luaL_checktype(L, 2, LUA_TLIGHTUSERDATA);
+	Entity * newChild = (Entity *)lua_topointer(L, 2);
+	inst->addEntity(newChild);
+	return 0;
+}
+
+static int Polycore_Entity_addChild(lua_State *L) {
+	luaL_checktype(L, 1, LUA_TLIGHTUSERDATA);
+	Entity *inst = (Entity*)lua_topointer(L, 1);
+	luaL_checktype(L, 2, LUA_TLIGHTUSERDATA);
+	Entity * newChild = (Entity *)lua_topointer(L, 2);
+	inst->addChild(newChild);
+	return 0;
+}
+
+static int Polycore_Entity_removeChild(lua_State *L) {
+	luaL_checktype(L, 1, LUA_TLIGHTUSERDATA);
+	Entity *inst = (Entity*)lua_topointer(L, 1);
+	luaL_checktype(L, 2, LUA_TLIGHTUSERDATA);
+	Entity * entityToRemove = (Entity *)lua_topointer(L, 2);
+	inst->removeChild(entityToRemove);
+	return 0;
+}
+
+static int Polycore_Entity_updateEntityMatrix(lua_State *L) {
+	luaL_checktype(L, 1, LUA_TLIGHTUSERDATA);
+	Entity *inst = (Entity*)lua_topointer(L, 1);
+	inst->updateEntityMatrix();
+	return 0;
+}
+
+static int Polycore_Entity_renderChildren(lua_State *L) {
+	luaL_checktype(L, 1, LUA_TLIGHTUSERDATA);
+	Entity *inst = (Entity*)lua_topointer(L, 1);
+	inst->renderChildren();
+	return 0;
+}
+
+static int Polycore_Entity_getPosition(lua_State *L) {
+	luaL_checktype(L, 1, LUA_TLIGHTUSERDATA);
+	Entity *inst = (Entity*)lua_topointer(L, 1);
+	Vector3 *retInst = new Vector3();
+	*retInst = inst->getPosition();
+	lua_pushlightuserdata(L, retInst);
+	return 1;
+}
+
+static int Polycore_Entity_setPosition(lua_State *L) {
+	luaL_checktype(L, 1, LUA_TLIGHTUSERDATA);
+	Entity *inst = (Entity*)lua_topointer(L, 1);
+	luaL_checktype(L, 2, LUA_TNUMBER);
+	Number x = lua_tonumber(L, 2);
+	luaL_checktype(L, 3, LUA_TNUMBER);
+	Number y = lua_tonumber(L, 3);
+	luaL_checktype(L, 4, LUA_TNUMBER);
+	Number z = lua_tonumber(L, 4);
+	inst->setPosition(x, y, z);
+	return 0;
+}
+
+static int Polycore_Entity_setPositionX(lua_State *L) {
+	luaL_checktype(L, 1, LUA_TLIGHTUSERDATA);
+	Entity *inst = (Entity*)lua_topointer(L, 1);
+	luaL_checktype(L, 2, LUA_TNUMBER);
+	Number x = lua_tonumber(L, 2);
+	inst->setPositionX(x);
+	return 0;
+}
+
+static int Polycore_Entity_setPositionY(lua_State *L) {
+	luaL_checktype(L, 1, LUA_TLIGHTUSERDATA);
+	Entity *inst = (Entity*)lua_topointer(L, 1);
+	luaL_checktype(L, 2, LUA_TNUMBER);
+	Number y = lua_tonumber(L, 2);
+	inst->setPositionY(y);
+	return 0;
+}
+
+static int Polycore_Entity_setPositionZ(lua_State *L) {
+	luaL_checktype(L, 1, LUA_TLIGHTUSERDATA);
+	Entity *inst = (Entity*)lua_topointer(L, 1);
+	luaL_checktype(L, 2, LUA_TNUMBER);
+	Number z = lua_tonumber(L, 2);
+	inst->setPositionZ(z);
+	return 0;
+}
+
+static int Polycore_Entity_setScaleX(lua_State *L) {
+	luaL_checktype(L, 1, LUA_TLIGHTUSERDATA);
+	Entity *inst = (Entity*)lua_topointer(L, 1);
+	luaL_checktype(L, 2, LUA_TNUMBER);
+	Number x = lua_tonumber(L, 2);
+	inst->setScaleX(x);
+	return 0;
+}
+
+static int Polycore_Entity_setScaleY(lua_State *L) {
+	luaL_checktype(L, 1, LUA_TLIGHTUSERDATA);
+	Entity *inst = (Entity*)lua_topointer(L, 1);
+	luaL_checktype(L, 2, LUA_TNUMBER);
+	Number y = lua_tonumber(L, 2);
+	inst->setScaleY(y);
+	return 0;
+}
+
+static int Polycore_Entity_setScaleZ(lua_State *L) {
+	luaL_checktype(L, 1, LUA_TLIGHTUSERDATA);
+	Entity *inst = (Entity*)lua_topointer(L, 1);
+	luaL_checktype(L, 2, LUA_TNUMBER);
+	Number z = lua_tonumber(L, 2);
+	inst->setScaleZ(z);
+	return 0;
+}
+
+static int Polycore_Entity_Translate(lua_State *L) {
+	luaL_checktype(L, 1, LUA_TLIGHTUSERDATA);
+	Entity *inst = (Entity*)lua_topointer(L, 1);
+	luaL_checktype(L, 2, LUA_TNUMBER);
+	Number x = lua_tonumber(L, 2);
+	luaL_checktype(L, 3, LUA_TNUMBER);
+	Number y = lua_tonumber(L, 3);
+	luaL_checktype(L, 4, LUA_TNUMBER);
+	Number z = lua_tonumber(L, 4);
+	inst->Translate(x, y, z);
+	return 0;
+}
+
+static int Polycore_Entity_Scale(lua_State *L) {
+	luaL_checktype(L, 1, LUA_TLIGHTUSERDATA);
+	Entity *inst = (Entity*)lua_topointer(L, 1);
+	luaL_checktype(L, 2, LUA_TNUMBER);
+	Number x = lua_tonumber(L, 2);
+	luaL_checktype(L, 3, LUA_TNUMBER);
+	Number y = lua_tonumber(L, 3);
+	luaL_checktype(L, 4, LUA_TNUMBER);
+	Number z = lua_tonumber(L, 4);
+	inst->Scale(x, y, z);
+	return 0;
+}
+
+static int Polycore_Entity_setScale(lua_State *L) {
+	luaL_checktype(L, 1, LUA_TLIGHTUSERDATA);
+	Entity *inst = (Entity*)lua_topointer(L, 1);
+	luaL_checktype(L, 2, LUA_TNUMBER);
+	Number x = lua_tonumber(L, 2);
+	luaL_checktype(L, 3, LUA_TNUMBER);
+	Number y = lua_tonumber(L, 3);
+	luaL_checktype(L, 4, LUA_TNUMBER);
+	Number z = lua_tonumber(L, 4);
+	inst->setScale(x, y, z);
+	return 0;
+}
+
+static int Polycore_Entity_getScale(lua_State *L) {
+	luaL_checktype(L, 1, LUA_TLIGHTUSERDATA);
+	Entity *inst = (Entity*)lua_topointer(L, 1);
+	Vector3 *retInst = new Vector3();
+	*retInst = inst->getScale();
+	lua_pushlightuserdata(L, retInst);
+	return 1;
+}
+
+static int Polycore_Entity_getCombinedPosition(lua_State *L) {
+	luaL_checktype(L, 1, LUA_TLIGHTUSERDATA);
+	Entity *inst = (Entity*)lua_topointer(L, 1);
+	Vector3 *retInst = new Vector3();
+	*retInst = inst->getCombinedPosition();
+	lua_pushlightuserdata(L, retInst);
+	return 1;
+}
+
+static int Polycore_Entity_getCombinedPitch(lua_State *L) {
+	luaL_checktype(L, 1, LUA_TLIGHTUSERDATA);
+	Entity *inst = (Entity*)lua_topointer(L, 1);
+	lua_pushnumber(L, inst->getCombinedPitch());
+	return 1;
+}
+
+static int Polycore_Entity_getCombinedYaw(lua_State *L) {
+	luaL_checktype(L, 1, LUA_TLIGHTUSERDATA);
+	Entity *inst = (Entity*)lua_topointer(L, 1);
+	lua_pushnumber(L, inst->getCombinedYaw());
+	return 1;
+}
+
+static int Polycore_Entity_getCombinedRoll(lua_State *L) {
+	luaL_checktype(L, 1, LUA_TLIGHTUSERDATA);
+	Entity *inst = (Entity*)lua_topointer(L, 1);
+	lua_pushnumber(L, inst->getCombinedRoll());
+	return 1;
+}
+
+static int Polycore_Entity_setParentEntity(lua_State *L) {
+	luaL_checktype(L, 1, LUA_TLIGHTUSERDATA);
+	Entity *inst = (Entity*)lua_topointer(L, 1);
+	luaL_checktype(L, 2, LUA_TLIGHTUSERDATA);
+	Entity * entity = (Entity *)lua_topointer(L, 2);
+	inst->setParentEntity(entity);
+	return 0;
+}
+
+static int Polycore_Entity_getParentEntity(lua_State *L) {
+	luaL_checktype(L, 1, LUA_TLIGHTUSERDATA);
+	Entity *inst = (Entity*)lua_topointer(L, 1);
+	lua_pushlightuserdata(L, (void*)inst->getParentEntity());
+	return 1;
+}
+
+static int Polycore_Entity_rebuildRotation(lua_State *L) {
+	luaL_checktype(L, 1, LUA_TLIGHTUSERDATA);
+	Entity *inst = (Entity*)lua_topointer(L, 1);
+	inst->rebuildRotation();
+	return 0;
+}
+
+static int Polycore_Entity_dirtyMatrix(lua_State *L) {
+	luaL_checktype(L, 1, LUA_TLIGHTUSERDATA);
+	Entity *inst = (Entity*)lua_topointer(L, 1);
+	luaL_checktype(L, 2, LUA_TBOOLEAN);
+	bool val = lua_toboolean(L, 2);
+	inst->dirtyMatrix(val);
+	return 0;
+}
+
+static int Polycore_Entity_setPitch(lua_State *L) {
+	luaL_checktype(L, 1, LUA_TLIGHTUSERDATA);
+	Entity *inst = (Entity*)lua_topointer(L, 1);
+	luaL_checktype(L, 2, LUA_TNUMBER);
+	Number pitch = lua_tonumber(L, 2);
+	inst->setPitch(pitch);
+	return 0;
+}
+
+static int Polycore_Entity_setYaw(lua_State *L) {
+	luaL_checktype(L, 1, LUA_TLIGHTUSERDATA);
+	Entity *inst = (Entity*)lua_topointer(L, 1);
+	luaL_checktype(L, 2, LUA_TNUMBER);
+	Number yaw = lua_tonumber(L, 2);
+	inst->setYaw(yaw);
+	return 0;
+}
+
+static int Polycore_Entity_setRoll(lua_State *L) {
+	luaL_checktype(L, 1, LUA_TLIGHTUSERDATA);
+	Entity *inst = (Entity*)lua_topointer(L, 1);
+	luaL_checktype(L, 2, LUA_TNUMBER);
+	Number roll = lua_tonumber(L, 2);
+	inst->setRoll(roll);
+	return 0;
+}
+
+static int Polycore_Entity_Roll(lua_State *L) {
+	luaL_checktype(L, 1, LUA_TLIGHTUSERDATA);
+	Entity *inst = (Entity*)lua_topointer(L, 1);
+	luaL_checktype(L, 2, LUA_TNUMBER);
+	Number roll = lua_tonumber(L, 2);
+	inst->Roll(roll);
+	return 0;
+}
+
+static int Polycore_Entity_Yaw(lua_State *L) {
+	luaL_checktype(L, 1, LUA_TLIGHTUSERDATA);
+	Entity *inst = (Entity*)lua_topointer(L, 1);
+	luaL_checktype(L, 2, LUA_TNUMBER);
+	Number roll = lua_tonumber(L, 2);
+	inst->Yaw(roll);
+	return 0;
+}
+
+static int Polycore_Entity_Pitch(lua_State *L) {
+	luaL_checktype(L, 1, LUA_TLIGHTUSERDATA);
+	Entity *inst = (Entity*)lua_topointer(L, 1);
+	luaL_checktype(L, 2, LUA_TNUMBER);
+	Number roll = lua_tonumber(L, 2);
+	inst->Pitch(roll);
+	return 0;
+}
+
+static int Polycore_Entity_getPitch(lua_State *L) {
+	luaL_checktype(L, 1, LUA_TLIGHTUSERDATA);
+	Entity *inst = (Entity*)lua_topointer(L, 1);
+	lua_pushnumber(L, inst->getPitch());
+	return 1;
+}
+
+static int Polycore_Entity_getYaw(lua_State *L) {
+	luaL_checktype(L, 1, LUA_TLIGHTUSERDATA);
+	Entity *inst = (Entity*)lua_topointer(L, 1);
+	lua_pushnumber(L, inst->getYaw());
+	return 1;
+}
+
+static int Polycore_Entity_getRoll(lua_State *L) {
+	luaL_checktype(L, 1, LUA_TLIGHTUSERDATA);
+	Entity *inst = (Entity*)lua_topointer(L, 1);
+	lua_pushnumber(L, inst->getRoll());
+	return 1;
+}
+
+static int Polycore_Entity_setRotationQuat(lua_State *L) {
+	luaL_checktype(L, 1, LUA_TLIGHTUSERDATA);
+	Entity *inst = (Entity*)lua_topointer(L, 1);
+	luaL_checktype(L, 2, LUA_TNUMBER);
+	Number w = lua_tonumber(L, 2);
+	luaL_checktype(L, 3, LUA_TNUMBER);
+	Number x = lua_tonumber(L, 3);
+	luaL_checktype(L, 4, LUA_TNUMBER);
+	Number y = lua_tonumber(L, 4);
+	luaL_checktype(L, 5, LUA_TNUMBER);
+	Number z = lua_tonumber(L, 5);
+	inst->setRotationQuat(w, x, y, z);
+	return 0;
+}
+
+static int Polycore_Entity_getRotationQuat(lua_State *L) {
+	luaL_checktype(L, 1, LUA_TLIGHTUSERDATA);
+	Entity *inst = (Entity*)lua_topointer(L, 1);
+	Quaternion *retInst = new Quaternion();
+	*retInst = inst->getRotationQuat();
+	lua_pushlightuserdata(L, retInst);
+	return 1;
+}
+
+static int Polycore_Entity_getTransformMatrix(lua_State *L) {
+	luaL_checktype(L, 1, LUA_TLIGHTUSERDATA);
+	Entity *inst = (Entity*)lua_topointer(L, 1);
+	Matrix4 *retInst = new Matrix4();
+	*retInst = inst->getTransformMatrix();
+	lua_pushlightuserdata(L, retInst);
+	return 1;
+}
+
+static int Polycore_Entity_getConcatenatedMatrix(lua_State *L) {
+	luaL_checktype(L, 1, LUA_TLIGHTUSERDATA);
+	Entity *inst = (Entity*)lua_topointer(L, 1);
+	Matrix4 *retInst = new Matrix4();
+	*retInst = inst->getConcatenatedMatrix();
+	lua_pushlightuserdata(L, retInst);
+	return 1;
+}
+
+static int Polycore_Entity_getConcatenatedRollMatrix(lua_State *L) {
+	luaL_checktype(L, 1, LUA_TLIGHTUSERDATA);
+	Entity *inst = (Entity*)lua_topointer(L, 1);
+	Matrix4 *retInst = new Matrix4();
+	*retInst = inst->getConcatenatedRollMatrix();
+	lua_pushlightuserdata(L, retInst);
+	return 1;
+}
+
+static int Polycore_Entity_setTransformByMatrix(lua_State *L) {
+	luaL_checktype(L, 1, LUA_TLIGHTUSERDATA);
+	Entity *inst = (Entity*)lua_topointer(L, 1);
+	luaL_checktype(L, 2, LUA_TLIGHTUSERDATA);
+	Matrix4 matrix = *(Matrix4*)lua_topointer(L, 2);
+	inst->setTransformByMatrix(matrix);
+	return 0;
+}
+
+static int Polycore_Entity_setTransformByMatrixPure(lua_State *L) {
+	luaL_checktype(L, 1, LUA_TLIGHTUSERDATA);
+	Entity *inst = (Entity*)lua_topointer(L, 1);
+	luaL_checktype(L, 2, LUA_TLIGHTUSERDATA);
+	Matrix4 matrix = *(Matrix4*)lua_topointer(L, 2);
+	inst->setTransformByMatrixPure(matrix);
+	return 0;
+}
+
+static int Polycore_Entity_setRenderer(lua_State *L) {
+	luaL_checktype(L, 1, LUA_TLIGHTUSERDATA);
+	Entity *inst = (Entity*)lua_topointer(L, 1);
+	luaL_checktype(L, 2, LUA_TLIGHTUSERDATA);
+	Renderer * r_enderer = (Renderer *)lua_topointer(L, 2);
+	inst->setRenderer(r_enderer);
+	return 0;
+}
+
+static int Polycore_Entity_getCombinedColor(lua_State *L) {
+	luaL_checktype(L, 1, LUA_TLIGHTUSERDATA);
+	Entity *inst = (Entity*)lua_topointer(L, 1);
+	Color *retInst = new Color();
+	*retInst = inst->getCombinedColor();
+	lua_pushlightuserdata(L, retInst);
+	return 1;
+}
+
+static int Polycore_Entity_setColor(lua_State *L) {
+	luaL_checktype(L, 1, LUA_TLIGHTUSERDATA);
+	Entity *inst = (Entity*)lua_topointer(L, 1);
+	luaL_checktype(L, 2, LUA_TNUMBER);
+	Number r = lua_tonumber(L, 2);
+	luaL_checktype(L, 3, LUA_TNUMBER);
+	Number g = lua_tonumber(L, 3);
+	luaL_checktype(L, 4, LUA_TNUMBER);
+	Number b = lua_tonumber(L, 4);
+	luaL_checktype(L, 5, LUA_TNUMBER);
+	Number a = lua_tonumber(L, 5);
+	inst->setColor(r, g, b, a);
+	return 0;
+}
+
+static int Polycore_Entity_setColorInt(lua_State *L) {
+	luaL_checktype(L, 1, LUA_TLIGHTUSERDATA);
+	Entity *inst = (Entity*)lua_topointer(L, 1);
+	luaL_checktype(L, 2, LUA_TNUMBER);
+	int r = lua_tointeger(L, 2);
+	luaL_checktype(L, 3, LUA_TNUMBER);
+	int g = lua_tointeger(L, 3);
+	luaL_checktype(L, 4, LUA_TNUMBER);
+	int b = lua_tointeger(L, 4);
+	luaL_checktype(L, 5, LUA_TNUMBER);
+	int a = lua_tointeger(L, 5);
+	inst->setColorInt(r, g, b, a);
+	return 0;
+}
+
+static int Polycore_Entity_recalculateBBox(lua_State *L) {
+	luaL_checktype(L, 1, LUA_TLIGHTUSERDATA);
+	Entity *inst = (Entity*)lua_topointer(L, 1);
+	inst->recalculateBBox();
+	return 0;
+}
+
+static int Polycore_Entity_getBBoxRadius(lua_State *L) {
+	luaL_checktype(L, 1, LUA_TLIGHTUSERDATA);
+	Entity *inst = (Entity*)lua_topointer(L, 1);
+	lua_pushnumber(L, inst->getBBoxRadius());
+	return 1;
+}
+
+static int Polycore_Entity_getCompoundBBoxRadius(lua_State *L) {
+	luaL_checktype(L, 1, LUA_TLIGHTUSERDATA);
+	Entity *inst = (Entity*)lua_topointer(L, 1);
+	lua_pushnumber(L, inst->getCompoundBBoxRadius());
+	return 1;
+}
+
+static int Polycore_Entity_setBBoxRadius(lua_State *L) {
+	luaL_checktype(L, 1, LUA_TLIGHTUSERDATA);
+	Entity *inst = (Entity*)lua_topointer(L, 1);
+	luaL_checktype(L, 2, LUA_TNUMBER);
+	Number rad = lua_tonumber(L, 2);
+	inst->setBBoxRadius(rad);
+	return 0;
+}
+
+static int Polycore_Entity_setBlendingMode(lua_State *L) {
+	luaL_checktype(L, 1, LUA_TLIGHTUSERDATA);
+	Entity *inst = (Entity*)lua_topointer(L, 1);
+	luaL_checktype(L, 2, LUA_TNUMBER);
+	int newBl_endingMode = lua_tointeger(L, 2);
+	inst->setBlendingMode(newBl_endingMode);
+	return 0;
+}
+
+static int Polycore_Entity_getChildCenter(lua_State *L) {
+	luaL_checktype(L, 1, LUA_TLIGHTUSERDATA);
+	Entity *inst = (Entity*)lua_topointer(L, 1);
+	Vector3 *retInst = new Vector3();
+	*retInst = inst->getChildCenter();
+	lua_pushlightuserdata(L, retInst);
+	return 1;
+}
+
+static int Polycore_Entity_setDepthWrite(lua_State *L) {
+	luaL_checktype(L, 1, LUA_TLIGHTUSERDATA);
+	Entity *inst = (Entity*)lua_topointer(L, 1);
+	luaL_checktype(L, 2, LUA_TBOOLEAN);
+	bool val = lua_toboolean(L, 2);
+	inst->setDepthWrite(val);
+	return 0;
+}
+
+static int Polycore_Entity_doUpdates(lua_State *L) {
+	luaL_checktype(L, 1, LUA_TLIGHTUSERDATA);
+	Entity *inst = (Entity*)lua_topointer(L, 1);
+	inst->doUpdates();
+	return 0;
+}
+
+static int Polycore_Entity_lookAt(lua_State *L) {
+	luaL_checktype(L, 1, LUA_TLIGHTUSERDATA);
+	Entity *inst = (Entity*)lua_topointer(L, 1);
+	luaL_checktype(L, 2, LUA_TLIGHTUSERDATA);
+	const Vector3 & loc = *( Vector3 *)lua_topointer(L, 2);
+	luaL_checktype(L, 3, LUA_TLIGHTUSERDATA);
+	const Vector3 & upVector = *( Vector3 *)lua_topointer(L, 3);
+	inst->lookAt(loc, upVector);
+	return 0;
+}
+
+static int Polycore_Entity_lookAtEntity(lua_State *L) {
+	luaL_checktype(L, 1, LUA_TLIGHTUSERDATA);
+	Entity *inst = (Entity*)lua_topointer(L, 1);
+	luaL_checktype(L, 2, LUA_TLIGHTUSERDATA);
+	Entity * entity = (Entity *)lua_topointer(L, 2);
+	luaL_checktype(L, 3, LUA_TLIGHTUSERDATA);
+	const Vector3 & upVector = *( Vector3 *)lua_topointer(L, 3);
+	inst->lookAtEntity(entity, upVector);
+	return 0;
+}
+
+static int Polycore_Entity_getLookAtMatrix(lua_State *L) {
+	luaL_checktype(L, 1, LUA_TLIGHTUSERDATA);
+	Entity *inst = (Entity*)lua_topointer(L, 1);
+	luaL_checktype(L, 2, LUA_TLIGHTUSERDATA);
+	const Vector3 & loc = *( Vector3 *)lua_topointer(L, 2);
+	luaL_checktype(L, 3, LUA_TLIGHTUSERDATA);
+	const Vector3 & upVector = *( Vector3 *)lua_topointer(L, 3);
+	Matrix4 *retInst = new Matrix4();
+	*retInst = inst->getLookAtMatrix(loc, upVector);
+	lua_pushlightuserdata(L, retInst);
+	return 1;
+}
+
+static int Polycore_Entity_buildPositionMatrix(lua_State *L) {
+	luaL_checktype(L, 1, LUA_TLIGHTUSERDATA);
+	Entity *inst = (Entity*)lua_topointer(L, 1);
+	 Matrix4 *retInst = new  Matrix4();
+	*retInst = inst->buildPositionMatrix();
+	lua_pushlightuserdata(L, retInst);
+	return 1;
+}
+
+static int Polycore_Entity_adjustMatrixForChildren(lua_State *L) {
+	luaL_checktype(L, 1, LUA_TLIGHTUSERDATA);
+	Entity *inst = (Entity*)lua_topointer(L, 1);
+	inst->adjustMatrixForChildren();
+	return 0;
+}
+
+static int Polycore_Entity_setMask(lua_State *L) {
+	luaL_checktype(L, 1, LUA_TLIGHTUSERDATA);
+	Entity *inst = (Entity*)lua_topointer(L, 1);
+	luaL_checktype(L, 2, LUA_TLIGHTUSERDATA);
+	Entity * mask = (Entity *)lua_topointer(L, 2);
+	inst->setMask(mask);
+	return 0;
+}
+
+static int Polycore_Entity_clearMask(lua_State *L) {
+	luaL_checktype(L, 1, LUA_TLIGHTUSERDATA);
+	Entity *inst = (Entity*)lua_topointer(L, 1);
+	inst->clearMask();
+	return 0;
+}
+
+static int Polycore_Entity_getCompoundScale(lua_State *L) {
+	luaL_checktype(L, 1, LUA_TLIGHTUSERDATA);
+	Entity *inst = (Entity*)lua_topointer(L, 1);
+	Vector3 *retInst = new Vector3();
+	*retInst = inst->getCompoundScale();
+	lua_pushlightuserdata(L, retInst);
+	return 1;
+}
+
+static int Polycore_Entity_getEntityProp(lua_State *L) {
+	luaL_checktype(L, 1, LUA_TLIGHTUSERDATA);
+	Entity *inst = (Entity*)lua_topointer(L, 1);
+	luaL_checktype(L, 2, LUA_TSTRING);
+	String propName = lua_tostring(L, 2);
+	lua_pushstring(L, inst->getEntityProp(propName).c_str());
+	return 1;
+}
+
+static int Polycore_Event(lua_State *L) {
+	Event *inst = new Event();
+	lua_pushlightuserdata(L, (void*)inst);
+	return 1;
+}
+
+static int Polycore_Event_getEventCode(lua_State *L) {
+	luaL_checktype(L, 1, LUA_TLIGHTUSERDATA);
+	Event *inst = (Event*)lua_topointer(L, 1);
+	lua_pushinteger(L, inst->getEventCode());
+	return 1;
+}
+
+static int Polycore_Event_setEventCode(lua_State *L) {
+	luaL_checktype(L, 1, LUA_TLIGHTUSERDATA);
+	Event *inst = (Event*)lua_topointer(L, 1);
+	luaL_checktype(L, 2, LUA_TNUMBER);
+	int eventCode = lua_tointeger(L, 2);
+	inst->setEventCode(eventCode);
+	return 0;
+}
+
+static int Polycore_Event_getDispatcher(lua_State *L) {
+	luaL_checktype(L, 1, LUA_TLIGHTUSERDATA);
+	Event *inst = (Event*)lua_topointer(L, 1);
+	lua_pushlightuserdata(L, (void*)inst->getDispatcher());
+	return 1;
+}
+
+static int Polycore_Event_setDispatcher(lua_State *L) {
+	luaL_checktype(L, 1, LUA_TLIGHTUSERDATA);
+	Event *inst = (Event*)lua_topointer(L, 1);
+	luaL_checktype(L, 2, LUA_TLIGHTUSERDATA);
+	EventDispatcher * dispatcher = (EventDispatcher *)lua_topointer(L, 2);
+	inst->setDispatcher(dispatcher);
+	return 0;
+}
+
+static int Polycore_Event_getEventType(lua_State *L) {
+	luaL_checktype(L, 1, LUA_TLIGHTUSERDATA);
+	Event *inst = (Event*)lua_topointer(L, 1);
+	lua_pushstring(L, inst->getEventType().c_str());
+	return 1;
+}
+
+static int Polycore_EventDispatcher(lua_State *L) {
+	EventDispatcher *inst = new EventDispatcher();
+	lua_pushlightuserdata(L, (void*)inst);
+	return 1;
+}
+
+static int Polycore_EventDispatcher_removeAllHandlers(lua_State *L) {
+	luaL_checktype(L, 1, LUA_TLIGHTUSERDATA);
+	EventDispatcher *inst = (EventDispatcher*)lua_topointer(L, 1);
+	inst->removeAllHandlers();
+	return 0;
+}
+
+static int Polycore_EventDispatcher_removeAllHandlersForListener(lua_State *L) {
+	luaL_checktype(L, 1, LUA_TLIGHTUSERDATA);
+	EventDispatcher *inst = (EventDispatcher*)lua_topointer(L, 1);
+	luaL_checktype(L, 2, LUA_TLIGHTUSERDATA);
+	void * listener = (void *)lua_topointer(L, 2);
+	inst->removeAllHandlersForListener(listener);
+	return 0;
+}
+
+static int Polycore_EventDispatcher_addEventListener(lua_State *L) {
+	luaL_checktype(L, 1, LUA_TLIGHTUSERDATA);
+	EventDispatcher *inst = (EventDispatcher*)lua_topointer(L, 1);
+	luaL_checktype(L, 2, LUA_TLIGHTUSERDATA);
+	EventHandler * handler = (EventHandler *)lua_topointer(L, 2);
+	luaL_checktype(L, 3, LUA_TNUMBER);
+	int eventCode = lua_tointeger(L, 3);
+	inst->addEventListener(handler, eventCode);
+	return 0;
+}
+
+static int Polycore_EventDispatcher_removeEventListener(lua_State *L) {
+	luaL_checktype(L, 1, LUA_TLIGHTUSERDATA);
+	EventDispatcher *inst = (EventDispatcher*)lua_topointer(L, 1);
+	luaL_checktype(L, 2, LUA_TLIGHTUSERDATA);
+	EventHandler * handler = (EventHandler *)lua_topointer(L, 2);
+	luaL_checktype(L, 3, LUA_TNUMBER);
+	int eventCode = lua_tointeger(L, 3);
+	inst->removeEventListener(handler, eventCode);
+	return 0;
+}
+
+static int Polycore_EventDispatcher___dispatchEvent(lua_State *L) {
+	luaL_checktype(L, 1, LUA_TLIGHTUSERDATA);
+	EventDispatcher *inst = (EventDispatcher*)lua_topointer(L, 1);
+	luaL_checktype(L, 2, LUA_TLIGHTUSERDATA);
+	Event * event = (Event *)lua_topointer(L, 2);
+	luaL_checktype(L, 3, LUA_TNUMBER);
+	int eventCode = lua_tointeger(L, 3);
+	inst->__dispatchEvent(event, eventCode);
+	return 0;
+}
+
+static int Polycore_EventDispatcher_dispatchEvent(lua_State *L) {
+	luaL_checktype(L, 1, LUA_TLIGHTUSERDATA);
+	EventDispatcher *inst = (EventDispatcher*)lua_topointer(L, 1);
+	luaL_checktype(L, 2, LUA_TLIGHTUSERDATA);
+	Event * event = (Event *)lua_topointer(L, 2);
+	luaL_checktype(L, 3, LUA_TNUMBER);
+	int eventCode = lua_tointeger(L, 3);
+	inst->dispatchEvent(event, eventCode);
+	return 0;
+}
+
+static int Polycore_EventDispatcher_dispatchEventNoDelete(lua_State *L) {
+	luaL_checktype(L, 1, LUA_TLIGHTUSERDATA);
+	EventDispatcher *inst = (EventDispatcher*)lua_topointer(L, 1);
+	luaL_checktype(L, 2, LUA_TLIGHTUSERDATA);
+	Event * event = (Event *)lua_topointer(L, 2);
+	luaL_checktype(L, 3, LUA_TNUMBER);
+	int eventCode = lua_tointeger(L, 3);
+	inst->dispatchEventNoDelete(event, eventCode);
+	return 0;
+}
+
+static int Polycore_EventHandler(lua_State *L) {
+	EventHandler *inst = new EventHandler();
+	lua_pushlightuserdata(L, (void*)inst);
+	return 1;
+}
+
+static int Polycore_EventHandler_secondaryHandler(lua_State *L) {
+	luaL_checktype(L, 1, LUA_TLIGHTUSERDATA);
+	EventHandler *inst = (EventHandler*)lua_topointer(L, 1);
+	luaL_checktype(L, 2, LUA_TLIGHTUSERDATA);
+	Event * event = (Event *)lua_topointer(L, 2);
+	inst->secondaryHandler(event);
+	return 0;
+}
+
+static int Polycore_EventHandler_handleEvent(lua_State *L) {
+	luaL_checktype(L, 1, LUA_TLIGHTUSERDATA);
+	EventHandler *inst = (EventHandler*)lua_topointer(L, 1);
+	luaL_checktype(L, 2, LUA_TLIGHTUSERDATA);
+	Event * event = (Event *)lua_topointer(L, 2);
+	inst->handleEvent(event);
+	return 0;
+}
+
+static int Polycore_FixedShader(lua_State *L) {
+	FixedShader *inst = new FixedShader();
+	lua_pushlightuserdata(L, (void*)inst);
+	return 1;
+}
+
+static int Polycore_FixedShader_createBinding(lua_State *L) {
+	luaL_checktype(L, 1, LUA_TLIGHTUSERDATA);
+	FixedShader *inst = (FixedShader*)lua_topointer(L, 1);
+	lua_pushlightuserdata(L, (void*)inst->createBinding());
+	return 1;
+}
+
+static int Polycore_FixedShaderBinding(lua_State *L) {
+	luaL_checktype(L, 1, LUA_TLIGHTUSERDATA);
+	FixedShader * shader = (FixedShader *)lua_topointer(L, 1);
+	FixedShaderBinding *inst = new FixedShaderBinding(shader);
+	lua_pushlightuserdata(L, (void*)inst);
+	return 1;
+}
+
+static int Polycore_FixedShaderBinding_addTexture(lua_State *L) {
+	luaL_checktype(L, 1, LUA_TLIGHTUSERDATA);
+	FixedShaderBinding *inst = (FixedShaderBinding*)lua_topointer(L, 1);
+	luaL_checktype(L, 2, LUA_TSTRING);
+	String name = lua_tostring(L, 2);
+	luaL_checktype(L, 3, LUA_TLIGHTUSERDATA);
+	Texture * texture = (Texture *)lua_topointer(L, 3);
+	inst->addTexture(name, texture);
+	return 0;
+}
+
+static int Polycore_FixedShaderBinding_addCubemap(lua_State *L) {
+	luaL_checktype(L, 1, LUA_TLIGHTUSERDATA);
+	FixedShaderBinding *inst = (FixedShaderBinding*)lua_topointer(L, 1);
+	luaL_checktype(L, 2, LUA_TSTRING);
+	String name = lua_tostring(L, 2);
+	luaL_checktype(L, 3, LUA_TLIGHTUSERDATA);
+	Cubemap * cubemap = (Cubemap *)lua_topointer(L, 3);
+	inst->addCubemap(name, cubemap);
+	return 0;
+}
+
+static int Polycore_FixedShaderBinding_addParam(lua_State *L) {
+	luaL_checktype(L, 1, LUA_TLIGHTUSERDATA);
+	FixedShaderBinding *inst = (FixedShaderBinding*)lua_topointer(L, 1);
+	luaL_checktype(L, 2, LUA_TSTRING);
+	String type = lua_tostring(L, 2);
+	luaL_checktype(L, 3, LUA_TSTRING);
+	String name = lua_tostring(L, 3);
+	luaL_checktype(L, 4, LUA_TSTRING);
+	String value = lua_tostring(L, 4);
+	inst->addParam(type, name, value);
+	return 0;
+}
+
+static int Polycore_FixedShaderBinding_getDiffuseTexture(lua_State *L) {
+	luaL_checktype(L, 1, LUA_TLIGHTUSERDATA);
+	FixedShaderBinding *inst = (FixedShaderBinding*)lua_topointer(L, 1);
+	lua_pushlightuserdata(L, (void*)inst->getDiffuseTexture());
+	return 1;
+}
+
+static int Polycore_Font(lua_State *L) {
+	luaL_checktype(L, 1, LUA_TSTRING);
+	String fileName = lua_tostring(L, 1);
+	Font *inst = new Font(fileName);
+	lua_pushlightuserdata(L, (void*)inst);
+	return 1;
+}
+
+static int Polycore_Font_getFace(lua_State *L) {
+	luaL_checktype(L, 1, LUA_TLIGHTUSERDATA);
+	Font *inst = (Font*)lua_topointer(L, 1);
+	FT_Face *retInst = new FT_Face();
+	*retInst = inst->getFace();
+	lua_pushlightuserdata(L, retInst);
+	return 1;
+}
+
+static int Polycore_Font_isValid(lua_State *L) {
+	luaL_checktype(L, 1, LUA_TLIGHTUSERDATA);
+	Font *inst = (Font*)lua_topointer(L, 1);
+	lua_pushboolean(L, inst->isValid());
+	return 1;
+}
+
+static int Polycore_FontManager(lua_State *L) {
+	FontManager *inst = new FontManager();
+	lua_pushlightuserdata(L, (void*)inst);
+	return 1;
+}
+
+static int Polycore_FontManager_registerFont(lua_State *L) {
+	luaL_checktype(L, 1, LUA_TLIGHTUSERDATA);
+	FontManager *inst = (FontManager*)lua_topointer(L, 1);
+	luaL_checktype(L, 2, LUA_TSTRING);
+	String fontName = lua_tostring(L, 2);
+	luaL_checktype(L, 3, LUA_TSTRING);
+	String fontPath = lua_tostring(L, 3);
+	inst->registerFont(fontName, fontPath);
+	return 0;
+}
+
+static int Polycore_FontManager_getFontByName(lua_State *L) {
+	luaL_checktype(L, 1, LUA_TLIGHTUSERDATA);
+	FontManager *inst = (FontManager*)lua_topointer(L, 1);
+	luaL_checktype(L, 2, LUA_TSTRING);
+	String fontName = lua_tostring(L, 2);
+	lua_pushlightuserdata(L, (void*)inst->getFontByName(fontName));
+	return 1;
+}
+
+static int Polycore_GenericScene(lua_State *L) {
+	GenericScene *inst = new GenericScene();
+	lua_pushlightuserdata(L, (void*)inst);
+	return 1;
+}
+
+static int Polycore_GenericScene_Render(lua_State *L) {
+	luaL_checktype(L, 1, LUA_TLIGHTUSERDATA);
+	GenericScene *inst = (GenericScene*)lua_topointer(L, 1);
+	inst->Render();
+	return 0;
+}
+
+static int Polycore_GenericScene_RenderDepthOnly(lua_State *L) {
+	luaL_checktype(L, 1, LUA_TLIGHTUSERDATA);
+	GenericScene *inst = (GenericScene*)lua_topointer(L, 1);
+	luaL_checktype(L, 2, LUA_TLIGHTUSERDATA);
+	Camera * targetCamera = (Camera *)lua_topointer(L, 2);
+	inst->RenderDepthOnly(targetCamera);
+	return 0;
+}
+
+static int Polycore_GenericScene_addGrid(lua_State *L) {
+	luaL_checktype(L, 1, LUA_TLIGHTUSERDATA);
+	GenericScene *inst = (GenericScene*)lua_topointer(L, 1);
+	luaL_checktype(L, 2, LUA_TSTRING);
+	String gridTexture = lua_tostring(L, 2);
+	inst->addGrid(gridTexture);
+	return 0;
+}
+
+static int Polycore_GenericScene_readString(lua_State *L) {
+	luaL_checktype(L, 1, LUA_TLIGHTUSERDATA);
+	GenericScene *inst = (GenericScene*)lua_topointer(L, 1);
+	luaL_checktype(L, 2, LUA_TLIGHTUSERDATA);
+	OSFILE * inFile = (OSFILE *)lua_topointer(L, 2);
+	lua_pushstring(L, inst->readString(inFile).c_str());
+	return 1;
+}
+
+static int Polycore_GenericScene_loadScene(lua_State *L) {
+	luaL_checktype(L, 1, LUA_TLIGHTUSERDATA);
+	GenericScene *inst = (GenericScene*)lua_topointer(L, 1);
+	luaL_checktype(L, 2, LUA_TSTRING);
+	String fileName = lua_tostring(L, 2);
+	inst->loadScene(fileName);
+	return 0;
+}
+
+static int Polycore_GenericScene_generateLightmaps(lua_State *L) {
+	luaL_checktype(L, 1, LUA_TLIGHTUSERDATA);
+	GenericScene *inst = (GenericScene*)lua_topointer(L, 1);
+	luaL_checktype(L, 2, LUA_TNUMBER);
+	Number lightMapRes = lua_tonumber(L, 2);
+	luaL_checktype(L, 3, LUA_TNUMBER);
+	Number lightMapQuality = lua_tonumber(L, 3);
+	luaL_checktype(L, 4, LUA_TNUMBER);
+	int numRadPasses = lua_tointeger(L, 4);
+	inst->generateLightmaps(lightMapRes, lightMapQuality, numRadPasses);
+	return 0;
+}
+
+static int Polycore_GenericScene_addLight(lua_State *L) {
+	luaL_checktype(L, 1, LUA_TLIGHTUSERDATA);
+	GenericScene *inst = (GenericScene*)lua_topointer(L, 1);
+	luaL_checktype(L, 2, LUA_TLIGHTUSERDATA);
+	SceneLight * light = (SceneLight *)lua_topointer(L, 2);
+	inst->addLight(light);
+	return 0;
+}
+
+static int Polycore_GenericScene_getNearestLight(lua_State *L) {
+	luaL_checktype(L, 1, LUA_TLIGHTUSERDATA);
+	GenericScene *inst = (GenericScene*)lua_topointer(L, 1);
+	luaL_checktype(L, 2, LUA_TLIGHTUSERDATA);
+	Vector3 pos = *(Vector3*)lua_topointer(L, 2);
+	lua_pushlightuserdata(L, (void*)inst->getNearestLight(pos));
+	return 1;
+}
+
+static int Polycore_GenericScene_writeEntityMatrix(lua_State *L) {
+	luaL_checktype(L, 1, LUA_TLIGHTUSERDATA);
+	GenericScene *inst = (GenericScene*)lua_topointer(L, 1);
+	luaL_checktype(L, 2, LUA_TLIGHTUSERDATA);
+	SceneEntity * entity = (SceneEntity *)lua_topointer(L, 2);
+	luaL_checktype(L, 3, LUA_TLIGHTUSERDATA);
+	OSFILE * outFile = (OSFILE *)lua_topointer(L, 3);
+	inst->writeEntityMatrix(entity, outFile);
+	return 0;
+}
+
+static int Polycore_GenericScene_writeString(lua_State *L) {
+	luaL_checktype(L, 1, LUA_TLIGHTUSERDATA);
+	GenericScene *inst = (GenericScene*)lua_topointer(L, 1);
+	luaL_checktype(L, 2, LUA_TSTRING);
+	String str = lua_tostring(L, 2);
+	luaL_checktype(L, 3, LUA_TLIGHTUSERDATA);
+	OSFILE * outFile = (OSFILE *)lua_topointer(L, 3);
+	inst->writeString(str, outFile);
+	return 0;
+}
+
+static int Polycore_GenericScene_saveScene(lua_State *L) {
+	luaL_checktype(L, 1, LUA_TLIGHTUSERDATA);
+	GenericScene *inst = (GenericScene*)lua_topointer(L, 1);
+	luaL_checktype(L, 2, LUA_TSTRING);
+	String fileName = lua_tostring(L, 2);
+	inst->saveScene(fileName);
+	return 0;
+}
+
+static int Polycore_GenericScene_getNumStaticGeometry(lua_State *L) {
+	luaL_checktype(L, 1, LUA_TLIGHTUSERDATA);
+	GenericScene *inst = (GenericScene*)lua_topointer(L, 1);
+	lua_pushinteger(L, inst->getNumStaticGeometry());
+	return 1;
+}
+
+static int Polycore_GenericScene_getStaticGeometry(lua_State *L) {
+	luaL_checktype(L, 1, LUA_TLIGHTUSERDATA);
+	GenericScene *inst = (GenericScene*)lua_topointer(L, 1);
+	luaL_checktype(L, 2, LUA_TNUMBER);
+	int index = lua_tointeger(L, 2);
+	lua_pushlightuserdata(L, (void*)inst->getStaticGeometry(index));
+	return 1;
+}
+
+static int Polycore_GenericScene_loadCollisionChild(lua_State *L) {
+	luaL_checktype(L, 1, LUA_TLIGHTUSERDATA);
+	GenericScene *inst = (GenericScene*)lua_topointer(L, 1);
+	luaL_checktype(L, 2, LUA_TLIGHTUSERDATA);
+	SceneEntity * entity = (SceneEntity *)lua_topointer(L, 2);
+	luaL_checktype(L, 3, LUA_TBOOLEAN);
+	bool autoCollide = lua_toboolean(L, 3);
+	luaL_checktype(L, 4, LUA_TNUMBER);
+	int type = lua_tointeger(L, 4);
+	inst->loadCollisionChild(entity, autoCollide, type);
+	return 0;
+}
+
+static int Polycore_GenericScene_getNumLights(lua_State *L) {
+	luaL_checktype(L, 1, LUA_TLIGHTUSERDATA);
+	GenericScene *inst = (GenericScene*)lua_topointer(L, 1);
+	lua_pushinteger(L, inst->getNumLights());
+	return 1;
+}
+
+static int Polycore_GenericScene_getLight(lua_State *L) {
+	luaL_checktype(L, 1, LUA_TLIGHTUSERDATA);
+	GenericScene *inst = (GenericScene*)lua_topointer(L, 1);
+	luaL_checktype(L, 2, LUA_TNUMBER);
+	int index = lua_tointeger(L, 2);
+	lua_pushlightuserdata(L, (void*)inst->getLight(index));
+	return 1;
+}
+
+static int Polycore_GenericScene_getCustomEntityByType(lua_State *L) {
+	luaL_checktype(L, 1, LUA_TLIGHTUSERDATA);
+	GenericScene *inst = (GenericScene*)lua_topointer(L, 1);
+	luaL_checktype(L, 2, LUA_TSTRING);
+	String type = lua_tostring(L, 2);
+	lua_pushlightuserdata(L, (void*)inst->getCustomEntityByType(type));
+	return 1;
+}
+
+static int Polycore_OpenGLCubemap(lua_State *L) {
+	luaL_checktype(L, 1, LUA_TLIGHTUSERDATA);
+	Texture * t0 = (Texture *)lua_topointer(L, 1);
+	luaL_checktype(L, 2, LUA_TLIGHTUSERDATA);
+	Texture * t1 = (Texture *)lua_topointer(L, 2);
+	luaL_checktype(L, 3, LUA_TLIGHTUSERDATA);
+	Texture * t2 = (Texture *)lua_topointer(L, 3);
+	luaL_checktype(L, 4, LUA_TLIGHTUSERDATA);
+	Texture * t3 = (Texture *)lua_topointer(L, 4);
+	luaL_checktype(L, 5, LUA_TLIGHTUSERDATA);
+	Texture * t4 = (Texture *)lua_topointer(L, 5);
+	luaL_checktype(L, 6, LUA_TLIGHTUSERDATA);
+	Texture * t5 = (Texture *)lua_topointer(L, 6);
+	OpenGLCubemap *inst = new OpenGLCubemap(t0, t1, t2, t3, t4, t5);
+	lua_pushlightuserdata(L, (void*)inst);
+	return 1;
+}
+
+static int Polycore_OpenGLCubemap_getTextureID(lua_State *L) {
+	luaL_checktype(L, 1, LUA_TLIGHTUSERDATA);
+	OpenGLCubemap *inst = (OpenGLCubemap*)lua_topointer(L, 1);
+	GLuint *retInst = new GLuint();
+	*retInst = inst->getTextureID();
+	lua_pushlightuserdata(L, retInst);
+	return 1;
+}
+
+static int Polycore_Image(lua_State *L) {
+	luaL_checktype(L, 1, LUA_TSTRING);
+	String fileName = lua_tostring(L, 1);
+	Image *inst = new Image(fileName);
+	lua_pushlightuserdata(L, (void*)inst);
+	return 1;
+}
+
+static int Polycore_Image_loadImage(lua_State *L) {
+	luaL_checktype(L, 1, LUA_TLIGHTUSERDATA);
+	Image *inst = (Image*)lua_topointer(L, 1);
+	luaL_checktype(L, 2, LUA_TSTRING);
+	String fileName = lua_tostring(L, 2);
+	lua_pushboolean(L, inst->loadImage(fileName));
+	return 1;
+}
+
+static int Polycore_Image_loadPNG(lua_State *L) {
+	luaL_checktype(L, 1, LUA_TLIGHTUSERDATA);
+	Image *inst = (Image*)lua_topointer(L, 1);
+	luaL_checktype(L, 2, LUA_TSTRING);
+	String fileName = lua_tostring(L, 2);
+	lua_pushboolean(L, inst->loadPNG(fileName));
+	return 1;
+}
+
+static int Polycore_Image_createEmpty(lua_State *L) {
+	luaL_checktype(L, 1, LUA_TLIGHTUSERDATA);
+	Image *inst = (Image*)lua_topointer(L, 1);
+	luaL_checktype(L, 2, LUA_TNUMBER);
+	unsigned int width = lua_tointeger(L, 2);
+	luaL_checktype(L, 3, LUA_TNUMBER);
+	unsigned int height = lua_tointeger(L, 3);
+	inst->createEmpty(width, height);
+	return 0;
+}
+
+static int Polycore_Image_fill(lua_State *L) {
+	luaL_checktype(L, 1, LUA_TLIGHTUSERDATA);
+	Image *inst = (Image*)lua_topointer(L, 1);
+	luaL_checktype(L, 2, LUA_TNUMBER);
+	Number r = lua_tonumber(L, 2);
+	luaL_checktype(L, 3, LUA_TNUMBER);
+	Number g = lua_tonumber(L, 3);
+	luaL_checktype(L, 4, LUA_TNUMBER);
+	Number b = lua_tonumber(L, 4);
+	luaL_checktype(L, 5, LUA_TNUMBER);
+	Number a = lua_tonumber(L, 5);
+	inst->fill(r, g, b, a);
+	return 0;
+}
+
+static int Polycore_Image_setPixel(lua_State *L) {
+	luaL_checktype(L, 1, LUA_TLIGHTUSERDATA);
+	Image *inst = (Image*)lua_topointer(L, 1);
+	luaL_checktype(L, 2, LUA_TNUMBER);
+	int x = lua_tointeger(L, 2);
+	luaL_checktype(L, 3, LUA_TNUMBER);
+	int y = lua_tointeger(L, 3);
+	luaL_checktype(L, 4, LUA_TNUMBER);
+	Number r = lua_tonumber(L, 4);
+	luaL_checktype(L, 5, LUA_TNUMBER);
+	Number g = lua_tonumber(L, 5);
+	luaL_checktype(L, 6, LUA_TNUMBER);
+	Number b = lua_tonumber(L, 6);
+	luaL_checktype(L, 7, LUA_TNUMBER);
+	Number a = lua_tonumber(L, 7);
+	inst->setPixel(x, y, r, g, b, a);
+	return 0;
+}
+
+static int Polycore_Image_getPixel(lua_State *L) {
+	luaL_checktype(L, 1, LUA_TLIGHTUSERDATA);
+	Image *inst = (Image*)lua_topointer(L, 1);
+	luaL_checktype(L, 2, LUA_TNUMBER);
+	int x = lua_tointeger(L, 2);
+	luaL_checktype(L, 3, LUA_TNUMBER);
+	int y = lua_tointeger(L, 3);
+	Color *retInst = new Color();
+	*retInst = inst->getPixel(x, y);
+	lua_pushlightuserdata(L, retInst);
+	return 1;
+}
+
+static int Polycore_Image_setAAPixel(lua_State *L) {
+	luaL_checktype(L, 1, LUA_TLIGHTUSERDATA);
+	Image *inst = (Image*)lua_topointer(L, 1);
+	luaL_checktype(L, 2, LUA_TNUMBER);
+	int x = lua_tointeger(L, 2);
+	luaL_checktype(L, 3, LUA_TNUMBER);
+	int y = lua_tointeger(L, 3);
+	luaL_checktype(L, 4, LUA_TLIGHTUSERDATA);
+	Color col = *(Color*)lua_topointer(L, 4);
+	inst->setAAPixel(x, y, col);
+	return 0;
+}
+
+static int Polycore_Image_swap(lua_State *L) {
+	luaL_checktype(L, 1, LUA_TLIGHTUSERDATA);
+	Image *inst = (Image*)lua_topointer(L, 1);
+	luaL_checktype(L, 2, LUA_TLIGHTUSERDATA);
+	int * v1 = (int *)lua_topointer(L, 2);
+	luaL_checktype(L, 3, LUA_TLIGHTUSERDATA);
+	int * v2 = (int *)lua_topointer(L, 3);
+	inst->swap(v1, v2);
+	return 0;
+}
+
+static int Polycore_Image_line(lua_State *L) {
+	luaL_checktype(L, 1, LUA_TLIGHTUSERDATA);
+	Image *inst = (Image*)lua_topointer(L, 1);
+	luaL_checktype(L, 2, LUA_TNUMBER);
+	int x0 = lua_tointeger(L, 2);
+	luaL_checktype(L, 3, LUA_TNUMBER);
+	int y0 = lua_tointeger(L, 3);
+	luaL_checktype(L, 4, LUA_TNUMBER);
+	int x1 = lua_tointeger(L, 4);
+	luaL_checktype(L, 5, LUA_TNUMBER);
+	int y1 = lua_tointeger(L, 5);
+	luaL_checktype(L, 6, LUA_TLIGHTUSERDATA);
+	Color col = *(Color*)lua_topointer(L, 6);
+	inst->line(x0, y0, x1, y1, col);
+	return 0;
+}
+
+static int Polycore_Image_moveTo(lua_State *L) {
+	luaL_checktype(L, 1, LUA_TLIGHTUSERDATA);
+	Image *inst = (Image*)lua_topointer(L, 1);
+	luaL_checktype(L, 2, LUA_TNUMBER);
+	int x = lua_tointeger(L, 2);
+	luaL_checktype(L, 3, LUA_TNUMBER);
+	int y = lua_tointeger(L, 3);
+	inst->moveTo(x, y);
+	return 0;
+}
+
+static int Polycore_Image_move(lua_State *L) {
+	luaL_checktype(L, 1, LUA_TLIGHTUSERDATA);
+	Image *inst = (Image*)lua_topointer(L, 1);
+	luaL_checktype(L, 2, LUA_TNUMBER);
+	int x = lua_tointeger(L, 2);
+	luaL_checktype(L, 3, LUA_TNUMBER);
+	int y = lua_tointeger(L, 3);
+	inst->move(x, y);
+	return 0;
+}
+
+static int Polycore_Image_lineTo(lua_State *L) {
+	luaL_checktype(L, 1, LUA_TLIGHTUSERDATA);
+	Image *inst = (Image*)lua_topointer(L, 1);
+	luaL_checktype(L, 2, LUA_TNUMBER);
+	int x = lua_tointeger(L, 2);
+	luaL_checktype(L, 3, LUA_TNUMBER);
+	int y = lua_tointeger(L, 3);
+	luaL_checktype(L, 4, LUA_TLIGHTUSERDATA);
+	Color col = *(Color*)lua_topointer(L, 4);
+	inst->lineTo(x, y, col);
+	return 0;
+}
+
+static int Polycore_Image_drawRect(lua_State *L) {
+	luaL_checktype(L, 1, LUA_TLIGHTUSERDATA);
+	Image *inst = (Image*)lua_topointer(L, 1);
+	luaL_checktype(L, 2, LUA_TNUMBER);
+	int x = lua_tointeger(L, 2);
+	luaL_checktype(L, 3, LUA_TNUMBER);
+	int y = lua_tointeger(L, 3);
+	luaL_checktype(L, 4, LUA_TNUMBER);
+	int w = lua_tointeger(L, 4);
+	luaL_checktype(L, 5, LUA_TNUMBER);
+	int h = lua_tointeger(L, 5);
+	luaL_checktype(L, 6, LUA_TLIGHTUSERDATA);
+	Color col = *(Color*)lua_topointer(L, 6);
+	inst->drawRect(x, y, w, h, col);
+	return 0;
+}
+
+static int Polycore_Image_perlinNoise(lua_State *L) {
+	luaL_checktype(L, 1, LUA_TLIGHTUSERDATA);
+	Image *inst = (Image*)lua_topointer(L, 1);
+	luaL_checktype(L, 2, LUA_TNUMBER);
+	int seed = lua_tointeger(L, 2);
+	luaL_checktype(L, 3, LUA_TBOOLEAN);
+	bool alpha = lua_toboolean(L, 3);
+	inst->perlinNoise(seed, alpha);
+	return 0;
+}
+
+static int Polycore_Image_fastBlur(lua_State *L) {
+	luaL_checktype(L, 1, LUA_TLIGHTUSERDATA);
+	Image *inst = (Image*)lua_topointer(L, 1);
+	luaL_checktype(L, 2, LUA_TNUMBER);
+	int blurSize = lua_tointeger(L, 2);
+	inst->fastBlur(blurSize);
+	return 0;
+}
+
+static int Polycore_Image_fastBlurVert(lua_State *L) {
+	luaL_checktype(L, 1, LUA_TLIGHTUSERDATA);
+	Image *inst = (Image*)lua_topointer(L, 1);
+	luaL_checktype(L, 2, LUA_TNUMBER);
+	int blurSize = lua_tointeger(L, 2);
+	inst->fastBlurVert(blurSize);
+	return 0;
+}
+
+static int Polycore_Image_fastBlurHor(lua_State *L) {
+	luaL_checktype(L, 1, LUA_TLIGHTUSERDATA);
+	Image *inst = (Image*)lua_topointer(L, 1);
+	luaL_checktype(L, 2, LUA_TNUMBER);
+	int blurSize = lua_tointeger(L, 2);
+	inst->fastBlurHor(blurSize);
+	return 0;
+}
+
+static int Polycore_Image_darken(lua_State *L) {
+	luaL_checktype(L, 1, LUA_TLIGHTUSERDATA);
+	Image *inst = (Image*)lua_topointer(L, 1);
+	luaL_checktype(L, 2, LUA_TNUMBER);
+	Number amt = lua_tonumber(L, 2);
+	luaL_checktype(L, 3, LUA_TBOOLEAN);
+	bool color = lua_toboolean(L, 3);
+	luaL_checktype(L, 4, LUA_TBOOLEAN);
+	bool alpha = lua_toboolean(L, 4);
+	inst->darken(amt, color, alpha);
+	return 0;
+}
+
+static int Polycore_Image_lighten(lua_State *L) {
+	luaL_checktype(L, 1, LUA_TLIGHTUSERDATA);
+	Image *inst = (Image*)lua_topointer(L, 1);
+	luaL_checktype(L, 2, LUA_TNUMBER);
+	Number amt = lua_tonumber(L, 2);
+	luaL_checktype(L, 3, LUA_TBOOLEAN);
+	bool color = lua_toboolean(L, 3);
+	luaL_checktype(L, 4, LUA_TBOOLEAN);
+	bool alpha = lua_toboolean(L, 4);
+	inst->lighten(amt, color, alpha);
+	return 0;
+}
+
+static int Polycore_Image_multiply(lua_State *L) {
+	luaL_checktype(L, 1, LUA_TLIGHTUSERDATA);
+	Image *inst = (Image*)lua_topointer(L, 1);
+	luaL_checktype(L, 2, LUA_TNUMBER);
+	Number amt = lua_tonumber(L, 2);
+	luaL_checktype(L, 3, LUA_TBOOLEAN);
+	bool color = lua_toboolean(L, 3);
+	luaL_checktype(L, 4, LUA_TBOOLEAN);
+	bool alpha = lua_toboolean(L, 4);
+	inst->multiply(amt, color, alpha);
+	return 0;
+}
+
+static int Polycore_Image_getBrushX(lua_State *L) {
+	luaL_checktype(L, 1, LUA_TLIGHTUSERDATA);
+	Image *inst = (Image*)lua_topointer(L, 1);
+	lua_pushinteger(L, inst->getBrushX());
+	return 1;
+}
+
+static int Polycore_Image_getBrushY(lua_State *L) {
+	luaL_checktype(L, 1, LUA_TLIGHTUSERDATA);
+	Image *inst = (Image*)lua_topointer(L, 1);
+	lua_pushinteger(L, inst->getBrushY());
+	return 1;
+}
+
+static int Polycore_Image_isLoaded(lua_State *L) {
+	luaL_checktype(L, 1, LUA_TLIGHTUSERDATA);
+	Image *inst = (Image*)lua_topointer(L, 1);
+	lua_pushboolean(L, inst->isLoaded());
+	return 1;
+}
+
+static int Polycore_Image_getType(lua_State *L) {
+	luaL_checktype(L, 1, LUA_TLIGHTUSERDATA);
+	Image *inst = (Image*)lua_topointer(L, 1);
+	lua_pushinteger(L, inst->getType());
+	return 1;
+}
+
+static int Polycore_Image_writeBMP(lua_State *L) {
+	luaL_checktype(L, 1, LUA_TLIGHTUSERDATA);
+	Image *inst = (Image*)lua_topointer(L, 1);
+	luaL_checktype(L, 2, LUA_TSTRING);
+	String fileName = lua_tostring(L, 2);
+	inst->writeBMP(fileName);
+	return 0;
+}
+
+static int Polycore_Image_getWidth(lua_State *L) {
+	luaL_checktype(L, 1, LUA_TLIGHTUSERDATA);
+	Image *inst = (Image*)lua_topointer(L, 1);
+	lua_pushinteger(L, inst->getWidth());
+	return 1;
+}
+
+static int Polycore_Image_getHeight(lua_State *L) {
+	luaL_checktype(L, 1, LUA_TLIGHTUSERDATA);
+	Image *inst = (Image*)lua_topointer(L, 1);
+	lua_pushinteger(L, inst->getHeight());
+	return 1;
+}
+
+static int Polycore_Image_getPixels(lua_State *L) {
+	luaL_checktype(L, 1, LUA_TLIGHTUSERDATA);
+	Image *inst = (Image*)lua_topointer(L, 1);
+	lua_pushlightuserdata(L, (void*)inst->getPixels());
+	return 1;
+}
+
+static int Polycore_InputEvent(lua_State *L) {
+	luaL_checktype(L, 1, LUA_TLIGHTUSERDATA);
+	Vector2 mousePosition = *(Vector2*)lua_topointer(L, 1);
+	luaL_checktype(L, 2, LUA_TNUMBER);
+	int timestamp = lua_tointeger(L, 2);
+	InputEvent *inst = new InputEvent(mousePosition, timestamp);
+	lua_pushlightuserdata(L, (void*)inst);
+	return 1;
+}
+
+static int Polycore_InputEvent_keyCode(lua_State *L) {
+	luaL_checktype(L, 1, LUA_TLIGHTUSERDATA);
+	InputEvent *inst = (InputEvent*)lua_topointer(L, 1);
+	lua_pushinteger(L, inst->keyCode());
+	return 1;
+}
+
+static int Polycore_Label(lua_State *L) {
+	luaL_checktype(L, 1, LUA_TLIGHTUSERDATA);
+	Font * font = (Font *)lua_topointer(L, 1);
+	luaL_checktype(L, 2, LUA_TSTRING);
+	String text = lua_tostring(L, 2);
+	luaL_checktype(L, 3, LUA_TNUMBER);
+	int size = lua_tointeger(L, 3);
+	luaL_checktype(L, 4, LUA_TNUMBER);
+	int antiAliasMode = lua_tointeger(L, 4);
+	Label *inst = new Label(font, text, size, antiAliasMode);
+	lua_pushlightuserdata(L, (void*)inst);
+	return 1;
+}
+
+static int Polycore_Label_setText(lua_State *L) {
+	luaL_checktype(L, 1, LUA_TLIGHTUSERDATA);
+	Label *inst = (Label*)lua_topointer(L, 1);
+	luaL_checktype(L, 2, LUA_TSTRING);
+	String text = lua_tostring(L, 2);
+	inst->setText(text);
+	return 0;
+}
+
+static int Polycore_Label_getText(lua_State *L) {
+	luaL_checktype(L, 1, LUA_TLIGHTUSERDATA);
+	Label *inst = (Label*)lua_topointer(L, 1);
+	lua_pushstring(L, inst->getText().c_str());
+	return 1;
+}
+
+static int Polycore_Label_getTextWidth(lua_State *L) {
+	luaL_checktype(L, 1, LUA_TLIGHTUSERDATA);
+	Label *inst = (Label*)lua_topointer(L, 1);
+	luaL_checktype(L, 2, LUA_TLIGHTUSERDATA);
+	Font * font = (Font *)lua_topointer(L, 2);
+	luaL_checktype(L, 3, LUA_TSTRING);
+	String text = lua_tostring(L, 3);
+	luaL_checktype(L, 4, LUA_TNUMBER);
+	int size = lua_tointeger(L, 4);
+	lua_pushinteger(L, inst->getTextWidth(font, text, size));
+	return 1;
+}
+
+static int Polycore_Label_getTextHeight(lua_State *L) {
+	luaL_checktype(L, 1, LUA_TLIGHTUSERDATA);
+	Label *inst = (Label*)lua_topointer(L, 1);
+	luaL_checktype(L, 2, LUA_TLIGHTUSERDATA);
+	Font * font = (Font *)lua_topointer(L, 2);
+	luaL_checktype(L, 3, LUA_TSTRING);
+	String text = lua_tostring(L, 3);
+	luaL_checktype(L, 4, LUA_TNUMBER);
+	int size = lua_tointeger(L, 4);
+	lua_pushinteger(L, inst->getTextHeight(font, text, size));
+	return 1;
+}
+
+static int Polycore_Label_getFont(lua_State *L) {
+	luaL_checktype(L, 1, LUA_TLIGHTUSERDATA);
+	Label *inst = (Label*)lua_topointer(L, 1);
+	lua_pushlightuserdata(L, (void*)inst->getFont());
+	return 1;
+}
+
+static int Polycore_Logger(lua_State *L) {
+	Logger *inst = new Logger();
+	lua_pushlightuserdata(L, (void*)inst);
+	return 1;
+}
+
+static int Polycore_Logger_log(lua_State *L) {
+	luaL_checktype(L, 1, LUA_TLIGHTUSERDATA);
+	Logger *inst = (Logger*)lua_topointer(L, 1);
+	luaL_checktype(L, 2, LUA_TLIGHTUSERDATA);
+	const char * format = (const char *)lua_topointer(L, 2);
+	inst->log(format);
+	return 0;
+}
+
+static int Polycore_Logger_logw(lua_State *L) {
+	luaL_checktype(L, 1, LUA_TLIGHTUSERDATA);
+	Logger *inst = (Logger*)lua_topointer(L, 1);
+	luaL_checktype(L, 2, LUA_TLIGHTUSERDATA);
+	const char * str = (const char *)lua_topointer(L, 2);
+	inst->logw(str);
+	return 0;
+}
+
+static int Polycore_Material(lua_State *L) {
+	luaL_checktype(L, 1, LUA_TSTRING);
+	String name = lua_tostring(L, 1);
+	Material *inst = new Material(name);
+	lua_pushlightuserdata(L, (void*)inst);
+	return 1;
+}
+
+static int Polycore_Material_addShader(lua_State *L) {
+	luaL_checktype(L, 1, LUA_TLIGHTUSERDATA);
+	Material *inst = (Material*)lua_topointer(L, 1);
+	luaL_checktype(L, 2, LUA_TLIGHTUSERDATA);
+	Shader * shader = (Shader *)lua_topointer(L, 2);
+	luaL_checktype(L, 3, LUA_TLIGHTUSERDATA);
+	ShaderBinding * shaderBinding = (ShaderBinding *)lua_topointer(L, 3);
+	inst->addShader(shader, shaderBinding);
+	return 0;
+}
+
+static int Polycore_Material_getNumShaders(lua_State *L) {
+	luaL_checktype(L, 1, LUA_TLIGHTUSERDATA);
+	Material *inst = (Material*)lua_topointer(L, 1);
+	lua_pushinteger(L, inst->getNumShaders());
+	return 1;
+}
+
+static int Polycore_Material_addShaderRenderTarget(lua_State *L) {
+	luaL_checktype(L, 1, LUA_TLIGHTUSERDATA);
+	Material *inst = (Material*)lua_topointer(L, 1);
+	luaL_checktype(L, 2, LUA_TLIGHTUSERDATA);
+	ShaderRenderTarget * newTarget = (ShaderRenderTarget *)lua_topointer(L, 2);
+	inst->addShaderRenderTarget(newTarget);
+	return 0;
+}
+
+static int Polycore_Material_getNumShaderRenderTargets(lua_State *L) {
+	luaL_checktype(L, 1, LUA_TLIGHTUSERDATA);
+	Material *inst = (Material*)lua_topointer(L, 1);
+	lua_pushinteger(L, inst->getNumShaderRenderTargets());
+	return 1;
+}
+
+static int Polycore_Material_getShaderRenderTarget(lua_State *L) {
+	luaL_checktype(L, 1, LUA_TLIGHTUSERDATA);
+	Material *inst = (Material*)lua_topointer(L, 1);
+	luaL_checktype(L, 2, LUA_TNUMBER);
+	unsigned int index = lua_tointeger(L, 2);
+	lua_pushlightuserdata(L, (void*)inst->getShaderRenderTarget(index));
+	return 1;
+}
+
+static int Polycore_Material_getName(lua_State *L) {
+	luaL_checktype(L, 1, LUA_TLIGHTUSERDATA);
+	Material *inst = (Material*)lua_topointer(L, 1);
+	lua_pushstring(L, inst->getName().c_str());
+	return 1;
+}
+
+static int Polycore_Material_getShader(lua_State *L) {
+	luaL_checktype(L, 1, LUA_TLIGHTUSERDATA);
+	Material *inst = (Material*)lua_topointer(L, 1);
+	luaL_checktype(L, 2, LUA_TNUMBER);
+	unsigned int index = lua_tointeger(L, 2);
+	lua_pushlightuserdata(L, (void*)inst->getShader(index));
+	return 1;
+}
+
+static int Polycore_Material_getShaderBinding(lua_State *L) {
+	luaL_checktype(L, 1, LUA_TLIGHTUSERDATA);
+	Material *inst = (Material*)lua_topointer(L, 1);
+	luaL_checktype(L, 2, LUA_TNUMBER);
+	unsigned int index = lua_tointeger(L, 2);
+	lua_pushlightuserdata(L, (void*)inst->getShaderBinding(index));
+	return 1;
+}
+
+static int Polycore_Material_loadMaterial(lua_State *L) {
+	luaL_checktype(L, 1, LUA_TLIGHTUSERDATA);
+	Material *inst = (Material*)lua_topointer(L, 1);
+	luaL_checktype(L, 2, LUA_TSTRING);
+	String fileName = lua_tostring(L, 2);
+	inst->loadMaterial(fileName);
+	return 0;
+}
+
+static int Polycore_MaterialManager(lua_State *L) {
+	MaterialManager *inst = new MaterialManager();
+	lua_pushlightuserdata(L, (void*)inst);
+	return 1;
+}
+
+static int Polycore_MaterialManager_Update(lua_State *L) {
+	luaL_checktype(L, 1, LUA_TLIGHTUSERDATA);
+	MaterialManager *inst = (MaterialManager*)lua_topointer(L, 1);
+	luaL_checktype(L, 2, LUA_TNUMBER);
+	int elapsed = lua_tointeger(L, 2);
+	inst->Update(elapsed);
+	return 0;
+}
+
+static int Polycore_MaterialManager_createFramebufferTexture(lua_State *L) {
+	luaL_checktype(L, 1, LUA_TLIGHTUSERDATA);
+	MaterialManager *inst = (MaterialManager*)lua_topointer(L, 1);
+	luaL_checktype(L, 2, LUA_TNUMBER);
+	int width = lua_tointeger(L, 2);
+	luaL_checktype(L, 3, LUA_TNUMBER);
+	int height = lua_tointeger(L, 3);
+	luaL_checktype(L, 4, LUA_TNUMBER);
+	int type = lua_tointeger(L, 4);
+	lua_pushlightuserdata(L, (void*)inst->createFramebufferTexture(width, height, type));
+	return 1;
+}
+
+static int Polycore_MaterialManager_createTexture(lua_State *L) {
+	luaL_checktype(L, 1, LUA_TLIGHTUSERDATA);
+	MaterialManager *inst = (MaterialManager*)lua_topointer(L, 1);
+	luaL_checktype(L, 2, LUA_TNUMBER);
+	int width = lua_tointeger(L, 2);
+	luaL_checktype(L, 3, LUA_TNUMBER);
+	int height = lua_tointeger(L, 3);
+	luaL_checktype(L, 4, LUA_TLIGHTUSERDATA);
+	char * imageData = (char *)lua_topointer(L, 4);
+	luaL_checktype(L, 5, LUA_TBOOLEAN);
+	bool clamp = lua_toboolean(L, 5);
+	luaL_checktype(L, 6, LUA_TNUMBER);
+	int type = lua_tointeger(L, 6);
+	lua_pushlightuserdata(L, (void*)inst->createTexture(width, height, imageData, clamp, type));
+	return 1;
+}
+
+static int Polycore_MaterialManager_createNewTexture(lua_State *L) {
+	luaL_checktype(L, 1, LUA_TLIGHTUSERDATA);
+	MaterialManager *inst = (MaterialManager*)lua_topointer(L, 1);
+	luaL_checktype(L, 2, LUA_TNUMBER);
+	int width = lua_tointeger(L, 2);
+	luaL_checktype(L, 3, LUA_TNUMBER);
+	int height = lua_tointeger(L, 3);
+	luaL_checktype(L, 4, LUA_TBOOLEAN);
+	bool clamp = lua_toboolean(L, 4);
+	luaL_checktype(L, 5, LUA_TNUMBER);
+	int type = lua_tointeger(L, 5);
+	lua_pushlightuserdata(L, (void*)inst->createNewTexture(width, height, clamp, type));
+	return 1;
+}
+
+static int Polycore_MaterialManager_createTextureFromImage(lua_State *L) {
+	luaL_checktype(L, 1, LUA_TLIGHTUSERDATA);
+	MaterialManager *inst = (MaterialManager*)lua_topointer(L, 1);
+	luaL_checktype(L, 2, LUA_TLIGHTUSERDATA);
+	Image * image = (Image *)lua_topointer(L, 2);
+	luaL_checktype(L, 3, LUA_TBOOLEAN);
+	bool clamp = lua_toboolean(L, 3);
+	lua_pushlightuserdata(L, (void*)inst->createTextureFromImage(image, clamp));
+	return 1;
+}
+
+static int Polycore_MaterialManager_createTextureFromFile(lua_State *L) {
+	luaL_checktype(L, 1, LUA_TLIGHTUSERDATA);
+	MaterialManager *inst = (MaterialManager*)lua_topointer(L, 1);
+	luaL_checktype(L, 2, LUA_TSTRING);
+	String fileName = lua_tostring(L, 2);
+	luaL_checktype(L, 3, LUA_TBOOLEAN);
+	bool clamp = lua_toboolean(L, 3);
+	lua_pushlightuserdata(L, (void*)inst->createTextureFromFile(fileName, clamp));
+	return 1;
+}
+
+static int Polycore_MaterialManager_deleteTexture(lua_State *L) {
+	luaL_checktype(L, 1, LUA_TLIGHTUSERDATA);
+	MaterialManager *inst = (MaterialManager*)lua_topointer(L, 1);
+	luaL_checktype(L, 2, LUA_TLIGHTUSERDATA);
+	Texture * texture = (Texture *)lua_topointer(L, 2);
+	inst->deleteTexture(texture);
+	return 0;
+}
+
+static int Polycore_MaterialManager_reloadTextures(lua_State *L) {
+	luaL_checktype(L, 1, LUA_TLIGHTUSERDATA);
+	MaterialManager *inst = (MaterialManager*)lua_topointer(L, 1);
+	inst->reloadTextures();
+	return 0;
+}
+
+static int Polycore_MaterialManager_reloadProgramsAndTextures(lua_State *L) {
+	luaL_checktype(L, 1, LUA_TLIGHTUSERDATA);
+	MaterialManager *inst = (MaterialManager*)lua_topointer(L, 1);
+	inst->reloadProgramsAndTextures();
+	return 0;
+}
+
+static int Polycore_MaterialManager_reloadPrograms(lua_State *L) {
+	luaL_checktype(L, 1, LUA_TLIGHTUSERDATA);
+	MaterialManager *inst = (MaterialManager*)lua_topointer(L, 1);
+	inst->reloadPrograms();
+	return 0;
+}
+
+static int Polycore_MaterialManager_addShaderModule(lua_State *L) {
+	luaL_checktype(L, 1, LUA_TLIGHTUSERDATA);
+	MaterialManager *inst = (MaterialManager*)lua_topointer(L, 1);
+	luaL_checktype(L, 2, LUA_TLIGHTUSERDATA);
+	PolycodeShaderModule * module = (PolycodeShaderModule *)lua_topointer(L, 2);
+	inst->addShaderModule(module);
+	return 0;
+}
+
+static int Polycore_MaterialManager_getTextureByResourcePath(lua_State *L) {
+	luaL_checktype(L, 1, LUA_TLIGHTUSERDATA);
+	MaterialManager *inst = (MaterialManager*)lua_topointer(L, 1);
+	luaL_checktype(L, 2, LUA_TSTRING);
+	String resourcePath = lua_tostring(L, 2);
+	lua_pushlightuserdata(L, (void*)inst->getTextureByResourcePath(resourcePath));
+	return 1;
+}
+
+static int Polycore_MaterialManager_cubemapFromXMLNode(lua_State *L) {
+	luaL_checktype(L, 1, LUA_TLIGHTUSERDATA);
+	MaterialManager *inst = (MaterialManager*)lua_topointer(L, 1);
+	luaL_checktype(L, 2, LUA_TLIGHTUSERDATA);
+	TiXmlNode * node = (TiXmlNode *)lua_topointer(L, 2);
+	lua_pushlightuserdata(L, (void*)inst->cubemapFromXMLNode(node));
+	return 1;
+}
+
+static int Polycore_MaterialManager_loadMaterialsFromFile(lua_State *L) {
+	luaL_checktype(L, 1, LUA_TLIGHTUSERDATA);
+	MaterialManager *inst = (MaterialManager*)lua_topointer(L, 1);
+	luaL_checktype(L, 2, LUA_TSTRING);
+	String fileName = lua_tostring(L, 2);
+	inst->loadMaterialsFromFile(fileName);
+	return 0;
+}
+
+static int Polycore_MaterialManager_materialFromXMLNode(lua_State *L) {
+	luaL_checktype(L, 1, LUA_TLIGHTUSERDATA);
+	MaterialManager *inst = (MaterialManager*)lua_topointer(L, 1);
+	luaL_checktype(L, 2, LUA_TLIGHTUSERDATA);
+	TiXmlNode * node = (TiXmlNode *)lua_topointer(L, 2);
+	lua_pushlightuserdata(L, (void*)inst->materialFromXMLNode(node));
+	return 1;
+}
+
+static int Polycore_MaterialManager_setShaderFromXMLNode(lua_State *L) {
+	luaL_checktype(L, 1, LUA_TLIGHTUSERDATA);
+	MaterialManager *inst = (MaterialManager*)lua_topointer(L, 1);
+	luaL_checktype(L, 2, LUA_TLIGHTUSERDATA);
+	TiXmlNode * node = (TiXmlNode *)lua_topointer(L, 2);
+	lua_pushlightuserdata(L, (void*)inst->setShaderFromXMLNode(node));
+	return 1;
+}
+
+static int Polycore_MaterialManager_createShaderFromXMLNode(lua_State *L) {
+	luaL_checktype(L, 1, LUA_TLIGHTUSERDATA);
+	MaterialManager *inst = (MaterialManager*)lua_topointer(L, 1);
+	luaL_checktype(L, 2, LUA_TLIGHTUSERDATA);
+	TiXmlNode * node = (TiXmlNode *)lua_topointer(L, 2);
+	lua_pushlightuserdata(L, (void*)inst->createShaderFromXMLNode(node));
+	return 1;
+}
+
+static int Polycore_Matrix4(lua_State *L) {
+	Matrix4 *inst = new Matrix4();
+	lua_pushlightuserdata(L, (void*)inst);
+	return 1;
+}
+
+static int Polycore_Matrix4_init(lua_State *L) {
+	luaL_checktype(L, 1, LUA_TLIGHTUSERDATA);
+	Matrix4 *inst = (Matrix4*)lua_topointer(L, 1);
+	inst->init();
+	return 0;
+}
+
+static int Polycore_Matrix4_identity(lua_State *L) {
+	luaL_checktype(L, 1, LUA_TLIGHTUSERDATA);
+	Matrix4 *inst = (Matrix4*)lua_topointer(L, 1);
+	inst->identity();
+	return 0;
+}
+
+static int Polycore_Matrix4_rotateVector(lua_State *L) {
+	luaL_checktype(L, 1, LUA_TLIGHTUSERDATA);
+	Matrix4 *inst = (Matrix4*)lua_topointer(L, 1);
+	luaL_checktype(L, 2, LUA_TLIGHTUSERDATA);
+	const Vector3 & v2 = *( Vector3 *)lua_topointer(L, 2);
+	 Vector3 *retInst = new  Vector3();
+	*retInst = inst->rotateVector(v2);
+	lua_pushlightuserdata(L, retInst);
+	return 1;
+}
+
+static int Polycore_Matrix4_getPosition(lua_State *L) {
+	luaL_checktype(L, 1, LUA_TLIGHTUSERDATA);
+	Matrix4 *inst = (Matrix4*)lua_topointer(L, 1);
+	 Vector3 *retInst = new  Vector3();
+	*retInst = inst->getPosition();
+	lua_pushlightuserdata(L, retInst);
+	return 1;
+}
+
+static int Polycore_Matrix4_setPosition(lua_State *L) {
+	luaL_checktype(L, 1, LUA_TLIGHTUSERDATA);
+	Matrix4 *inst = (Matrix4*)lua_topointer(L, 1);
+	luaL_checktype(L, 2, LUA_TNUMBER);
+	Number x = lua_tonumber(L, 2);
+	luaL_checktype(L, 3, LUA_TNUMBER);
+	Number y = lua_tonumber(L, 3);
+	luaL_checktype(L, 4, LUA_TNUMBER);
+	Number z = lua_tonumber(L, 4);
+	inst->setPosition(x, y, z);
+	return 0;
+}
+
+static int Polycore_Matrix4_setScale(lua_State *L) {
+	luaL_checktype(L, 1, LUA_TLIGHTUSERDATA);
+	Matrix4 *inst = (Matrix4*)lua_topointer(L, 1);
+	luaL_checktype(L, 2, LUA_TLIGHTUSERDATA);
+	Vector3 scale = *(Vector3*)lua_topointer(L, 2);
+	inst->setScale(scale);
+	return 0;
+}
+
+static int Polycore_Matrix4_getEulerAngles(lua_State *L) {
+	luaL_checktype(L, 1, LUA_TLIGHTUSERDATA);
+	Matrix4 *inst = (Matrix4*)lua_topointer(L, 1);
+	luaL_checktype(L, 2, LUA_TLIGHTUSERDATA);
+	Number * ax = (Number *)lua_topointer(L, 2);
+	luaL_checktype(L, 3, LUA_TLIGHTUSERDATA);
+	Number * ay = (Number *)lua_topointer(L, 3);
+	luaL_checktype(L, 4, LUA_TLIGHTUSERDATA);
+	Number * az = (Number *)lua_topointer(L, 4);
+	inst->getEulerAngles(ax, ay, az);
+	return 0;
+}
+
+static int Polycore_Matrix4_inverse(lua_State *L) {
+	luaL_checktype(L, 1, LUA_TLIGHTUSERDATA);
+	Matrix4 *inst = (Matrix4*)lua_topointer(L, 1);
+	Matrix4 *retInst = new Matrix4();
+	*retInst = inst->inverse();
+	lua_pushlightuserdata(L, retInst);
+	return 1;
+}
+
+static int Polycore_Matrix4_inverseAffine(lua_State *L) {
+	luaL_checktype(L, 1, LUA_TLIGHTUSERDATA);
+	Matrix4 *inst = (Matrix4*)lua_topointer(L, 1);
+	Matrix4 *retInst = new Matrix4();
+	*retInst = inst->inverseAffine();
+	lua_pushlightuserdata(L, retInst);
+	return 1;
+}
+
+static int Polycore_Mesh(lua_State *L) {
+	luaL_checktype(L, 1, LUA_TSTRING);
+	String fileName = lua_tostring(L, 1);
+	Mesh *inst = new Mesh(fileName);
+	lua_pushlightuserdata(L, (void*)inst);
+	return 1;
+}
+
+static int Polycore_Mesh_addPolygon(lua_State *L) {
+	luaL_checktype(L, 1, LUA_TLIGHTUSERDATA);
+	Mesh *inst = (Mesh*)lua_topointer(L, 1);
+	luaL_checktype(L, 2, LUA_TLIGHTUSERDATA);
+	Polycode::Polygon * newPolygon = (Polycode::Polygon *)lua_topointer(L, 2);
+	inst->addPolygon(newPolygon);
+	return 0;
+}
+
+static int Polycore_Mesh_loadMesh(lua_State *L) {
+	luaL_checktype(L, 1, LUA_TLIGHTUSERDATA);
+	Mesh *inst = (Mesh*)lua_topointer(L, 1);
+	luaL_checktype(L, 2, LUA_TSTRING);
+	String fileName = lua_tostring(L, 2);
+	inst->loadMesh(fileName);
+	return 0;
+}
+
+static int Polycore_Mesh_loadFromFile(lua_State *L) {
+	luaL_checktype(L, 1, LUA_TLIGHTUSERDATA);
+	Mesh *inst = (Mesh*)lua_topointer(L, 1);
+	luaL_checktype(L, 2, LUA_TLIGHTUSERDATA);
+	OSFILE * inFile = (OSFILE *)lua_topointer(L, 2);
+	inst->loadFromFile(inFile);
+	return 0;
+}
+
+static int Polycore_Mesh_saveToFile(lua_State *L) {
+	luaL_checktype(L, 1, LUA_TLIGHTUSERDATA);
+	Mesh *inst = (Mesh*)lua_topointer(L, 1);
+	luaL_checktype(L, 2, LUA_TLIGHTUSERDATA);
+	OSFILE * outFile = (OSFILE *)lua_topointer(L, 2);
+	inst->saveToFile(outFile);
+	return 0;
+}
+
+static int Polycore_Mesh_getPolygonCount(lua_State *L) {
+	luaL_checktype(L, 1, LUA_TLIGHTUSERDATA);
+	Mesh *inst = (Mesh*)lua_topointer(L, 1);
+	lua_pushinteger(L, inst->getPolygonCount());
+	return 1;
+}
+
+static int Polycore_Mesh_getPolygon(lua_State *L) {
+	luaL_checktype(L, 1, LUA_TLIGHTUSERDATA);
+	Mesh *inst = (Mesh*)lua_topointer(L, 1);
+	luaL_checktype(L, 2, LUA_TNUMBER);
+	unsigned int index = lua_tointeger(L, 2);
+	lua_pushlightuserdata(L, (void*)inst->getPolygon(index));
+	return 1;
+}
+
+static int Polycore_Mesh_createPlane(lua_State *L) {
+	luaL_checktype(L, 1, LUA_TLIGHTUSERDATA);
+	Mesh *inst = (Mesh*)lua_topointer(L, 1);
+	luaL_checktype(L, 2, LUA_TNUMBER);
+	Number w = lua_tonumber(L, 2);
+	luaL_checktype(L, 3, LUA_TNUMBER);
+	Number h = lua_tonumber(L, 3);
+	inst->createPlane(w, h);
+	return 0;
+}
+
+static int Polycore_Mesh_createBox(lua_State *L) {
+	luaL_checktype(L, 1, LUA_TLIGHTUSERDATA);
+	Mesh *inst = (Mesh*)lua_topointer(L, 1);
+	luaL_checktype(L, 2, LUA_TNUMBER);
+	Number w = lua_tonumber(L, 2);
+	luaL_checktype(L, 3, LUA_TNUMBER);
+	Number d = lua_tonumber(L, 3);
+	luaL_checktype(L, 4, LUA_TNUMBER);
+	Number h = lua_tonumber(L, 4);
+	inst->createBox(w, d, h);
+	return 0;
+}
+
+static int Polycore_Mesh_createSphere(lua_State *L) {
+	luaL_checktype(L, 1, LUA_TLIGHTUSERDATA);
+	Mesh *inst = (Mesh*)lua_topointer(L, 1);
+	luaL_checktype(L, 2, LUA_TNUMBER);
+	Number radius = lua_tonumber(L, 2);
+	luaL_checktype(L, 3, LUA_TNUMBER);
+	Number numRings = lua_tonumber(L, 3);
+	luaL_checktype(L, 4, LUA_TNUMBER);
+	Number numSegments = lua_tonumber(L, 4);
+	inst->createSphere(radius, numRings, numSegments);
+	return 0;
+}
+
+static int Polycore_Mesh_addVertex(lua_State *L) {
+	luaL_checktype(L, 1, LUA_TLIGHTUSERDATA);
+	Mesh *inst = (Mesh*)lua_topointer(L, 1);
+	luaL_checktype(L, 2, LUA_TLIGHTUSERDATA);
+	Vertex * vertex = (Vertex *)lua_topointer(L, 2);
+	inst->addVertex(vertex);
+	return 0;
+}
+
+static int Polycore_Mesh_getVertex(lua_State *L) {
+	luaL_checktype(L, 1, LUA_TLIGHTUSERDATA);
+	Mesh *inst = (Mesh*)lua_topointer(L, 1);
+	luaL_checktype(L, 2, LUA_TNUMBER);
+	unsigned int index = lua_tointeger(L, 2);
+	lua_pushlightuserdata(L, (void*)inst->getVertex(index));
+	return 1;
+}
+
+static int Polycore_Mesh_getNumVertices(lua_State *L) {
+	luaL_checktype(L, 1, LUA_TLIGHTUSERDATA);
+	Mesh *inst = (Mesh*)lua_topointer(L, 1);
+	lua_pushinteger(L, inst->getNumVertices());
+	return 1;
+}
+
+static int Polycore_Mesh_recenterMesh(lua_State *L) {
+	luaL_checktype(L, 1, LUA_TLIGHTUSERDATA);
+	Mesh *inst = (Mesh*)lua_topointer(L, 1);
+	Vector3 *retInst = new Vector3();
+	*retInst = inst->recenterMesh();
+	lua_pushlightuserdata(L, retInst);
+	return 1;
+}
+
+static int Polycore_Mesh_useVertexNormals(lua_State *L) {
+	luaL_checktype(L, 1, LUA_TLIGHTUSERDATA);
+	Mesh *inst = (Mesh*)lua_topointer(L, 1);
+	luaL_checktype(L, 2, LUA_TBOOLEAN);
+	bool val = lua_toboolean(L, 2);
+	inst->useVertexNormals(val);
+	return 0;
+}
+
+static int Polycore_Mesh_getVertexIndex(lua_State *L) {
+	luaL_checktype(L, 1, LUA_TLIGHTUSERDATA);
+	Mesh *inst = (Mesh*)lua_topointer(L, 1);
+	luaL_checktype(L, 2, LUA_TLIGHTUSERDATA);
+	Vertex * vertex = (Vertex *)lua_topointer(L, 2);
+	lua_pushinteger(L, inst->getVertexIndex(vertex));
+	return 1;
+}
+
+static int Polycore_Mesh_setVertexBuffer(lua_State *L) {
+	luaL_checktype(L, 1, LUA_TLIGHTUSERDATA);
+	Mesh *inst = (Mesh*)lua_topointer(L, 1);
+	luaL_checktype(L, 2, LUA_TLIGHTUSERDATA);
+	VertexBuffer * buffer = (VertexBuffer *)lua_topointer(L, 2);
+	inst->setVertexBuffer(buffer);
+	return 0;
+}
+
+static int Polycore_Mesh_getVertexBuffer(lua_State *L) {
+	luaL_checktype(L, 1, LUA_TLIGHTUSERDATA);
+	Mesh *inst = (Mesh*)lua_topointer(L, 1);
+	lua_pushlightuserdata(L, (void*)inst->getVertexBuffer());
+	return 1;
+}
+
+static int Polycore_Mesh_usesFaceUV(lua_State *L) {
+	luaL_checktype(L, 1, LUA_TLIGHTUSERDATA);
+	Mesh *inst = (Mesh*)lua_topointer(L, 1);
+	lua_pushboolean(L, inst->usesFaceUV());
+	return 1;
+}
+
+static int Polycore_Mesh_getRadius(lua_State *L) {
+	luaL_checktype(L, 1, LUA_TLIGHTUSERDATA);
+	Mesh *inst = (Mesh*)lua_topointer(L, 1);
+	lua_pushnumber(L, inst->getRadius());
+	return 1;
+}
+
+static int Polycore_Mesh_calculateNormals(lua_State *L) {
+	luaL_checktype(L, 1, LUA_TLIGHTUSERDATA);
+	Mesh *inst = (Mesh*)lua_topointer(L, 1);
+	inst->calculateNormals();
+	return 0;
+}
+
+static int Polycore_Mesh_getMeshType(lua_State *L) {
+	luaL_checktype(L, 1, LUA_TLIGHTUSERDATA);
+	Mesh *inst = (Mesh*)lua_topointer(L, 1);
+	lua_pushinteger(L, inst->getMeshType());
+	return 1;
+}
+
+static int Polycore_Mesh_setMeshType(lua_State *L) {
+	luaL_checktype(L, 1, LUA_TLIGHTUSERDATA);
+	Mesh *inst = (Mesh*)lua_topointer(L, 1);
+	luaL_checktype(L, 2, LUA_TNUMBER);
+	int newType = lua_tointeger(L, 2);
+	inst->setMeshType(newType);
+	return 0;
+}
+
+static int Polycore_Mesh_calculateBBox(lua_State *L) {
+	luaL_checktype(L, 1, LUA_TLIGHTUSERDATA);
+	Mesh *inst = (Mesh*)lua_topointer(L, 1);
+	Vector3 *retInst = new Vector3();
+	*retInst = inst->calculateBBox();
+	lua_pushlightuserdata(L, retInst);
+	return 1;
+}
+
+static int Polycore_Mesh_hasVertexBuffer(lua_State *L) {
+	luaL_checktype(L, 1, LUA_TLIGHTUSERDATA);
+	Mesh *inst = (Mesh*)lua_topointer(L, 1);
+	lua_pushboolean(L, inst->hasVertexBuffer());
+	return 1;
+}
+
+static int Polycore_VertexBuffer(lua_State *L) {
+	VertexBuffer *inst = new VertexBuffer();
+	lua_pushlightuserdata(L, (void*)inst);
+	return 1;
+}
+
+static int Polycore_VertexBuffer_getVertexCount(lua_State *L) {
+	luaL_checktype(L, 1, LUA_TLIGHTUSERDATA);
+	VertexBuffer *inst = (VertexBuffer*)lua_topointer(L, 1);
+	lua_pushinteger(L, inst->getVertexCount());
+	return 1;
+}
+
+static int Polycore_PolycodeModule(lua_State *L) {
+	PolycodeModule *inst = new PolycodeModule();
+	lua_pushlightuserdata(L, (void*)inst);
+	return 1;
+}
+
+static int Polycore_PolycodeModule_getType(lua_State *L) {
+	luaL_checktype(L, 1, LUA_TLIGHTUSERDATA);
+	PolycodeModule *inst = (PolycodeModule*)lua_topointer(L, 1);
+	lua_pushinteger(L, inst->getType());
+	return 1;
+}
+
+static int Polycore_ObjectEntry(lua_State *L) {
+	ObjectEntry *inst = new ObjectEntry();
+	lua_pushlightuserdata(L, (void*)inst);
+	return 1;
+}
+
+static int Polycore_ObjectEntry_addChild(lua_State *L) {
+	luaL_checktype(L, 1, LUA_TLIGHTUSERDATA);
+	ObjectEntry *inst = (ObjectEntry*)lua_topointer(L, 1);
+	luaL_checktype(L, 2, LUA_TSTRING);
+	String name = lua_tostring(L, 2);
+	lua_pushlightuserdata(L, (void*)inst->addChild(name));
+	return 1;
+}
+
+static int Polycore_Particle(lua_State *L) {
+	luaL_checktype(L, 1, LUA_TNUMBER);
+	int particleType = lua_tointeger(L, 1);
+	luaL_checktype(L, 2, LUA_TBOOLEAN);
+	bool isScreenParticle = lua_toboolean(L, 2);
+	luaL_checktype(L, 3, LUA_TLIGHTUSERDATA);
+	Material * material = (Material *)lua_topointer(L, 3);
+	luaL_checktype(L, 4, LUA_TLIGHTUSERDATA);
+	Texture * texture = (Texture *)lua_topointer(L, 4);
+	luaL_checktype(L, 5, LUA_TLIGHTUSERDATA);
+	Mesh * particleMesh = (Mesh *)lua_topointer(L, 5);
+	Particle *inst = new Particle(particleType, isScreenParticle, material, texture, particleMesh);
+	lua_pushlightuserdata(L, (void*)inst);
+	return 1;
+}
+
+static int Polycore_Particle_Reset(lua_State *L) {
+	luaL_checktype(L, 1, LUA_TLIGHTUSERDATA);
+	Particle *inst = (Particle*)lua_topointer(L, 1);
+	luaL_checktype(L, 2, LUA_TBOOLEAN);
+	bool continuious = lua_toboolean(L, 2);
+	inst->Reset(continuious);
+	return 0;
+}
+
+static int Polycore_Particle_createSceneParticle(lua_State *L) {
+	luaL_checktype(L, 1, LUA_TLIGHTUSERDATA);
+	Particle *inst = (Particle*)lua_topointer(L, 1);
+	luaL_checktype(L, 2, LUA_TNUMBER);
+	int particleType = lua_tointeger(L, 2);
+	luaL_checktype(L, 3, LUA_TLIGHTUSERDATA);
+	Texture * texture = (Texture *)lua_topointer(L, 3);
+	luaL_checktype(L, 4, LUA_TLIGHTUSERDATA);
+	Mesh * particleMesh = (Mesh *)lua_topointer(L, 4);
+	inst->createSceneParticle(particleType, texture, particleMesh);
+	return 0;
+}
+
+static int Polycore_Particle_createScreenParticle(lua_State *L) {
+	luaL_checktype(L, 1, LUA_TLIGHTUSERDATA);
+	Particle *inst = (Particle*)lua_topointer(L, 1);
+	luaL_checktype(L, 2, LUA_TNUMBER);
+	int particleType = lua_tointeger(L, 2);
+	luaL_checktype(L, 3, LUA_TLIGHTUSERDATA);
+	Texture * texture = (Texture *)lua_topointer(L, 3);
+	luaL_checktype(L, 4, LUA_TLIGHTUSERDATA);
+	Mesh * particleMesh = (Mesh *)lua_topointer(L, 4);
+	inst->createScreenParticle(particleType, texture, particleMesh);
+	return 0;
+}
+
+static int Polycore_ScreenParticleEmitter(lua_State *L) {
+	luaL_checktype(L, 1, LUA_TSTRING);
+	String imageFile = lua_tostring(L, 1);
+	luaL_checktype(L, 2, LUA_TLIGHTUSERDATA);
+	Mesh * particleMesh = (Mesh *)lua_topointer(L, 2);
+	luaL_checktype(L, 3, LUA_TLIGHTUSERDATA);
+	ScreenMesh * emitter = (ScreenMesh *)lua_topointer(L, 3);
+	luaL_checktype(L, 4, LUA_TLIGHTUSERDATA);
+	Screen * particleParentScreen = (Screen *)lua_topointer(L, 4);
+	luaL_checktype(L, 5, LUA_TNUMBER);
+	int particleType = lua_tointeger(L, 5);
+	luaL_checktype(L, 6, LUA_TNUMBER);
+	int emitterType = lua_tointeger(L, 6);
+	luaL_checktype(L, 7, LUA_TNUMBER);
+	Number lifespan = lua_tonumber(L, 7);
+	luaL_checktype(L, 8, LUA_TNUMBER);
+	unsigned int numParticles = lua_tointeger(L, 8);
+	luaL_checktype(L, 9, LUA_TLIGHTUSERDATA);
+	Vector3 direction = *(Vector3*)lua_topointer(L, 9);
+	luaL_checktype(L, 10, LUA_TLIGHTUSERDATA);
+	Vector3 gravity = *(Vector3*)lua_topointer(L, 10);
+	luaL_checktype(L, 11, LUA_TLIGHTUSERDATA);
+	Vector3 deviation = *(Vector3*)lua_topointer(L, 11);
+	ScreenParticleEmitter *inst = new ScreenParticleEmitter(imageFile, particleMesh, emitter, particleParentScreen, particleType, emitterType, lifespan, numParticles, direction, gravity, deviation);
+	lua_pushlightuserdata(L, (void*)inst);
+	return 1;
+}
+
+static int Polycore_ScreenParticleEmitter_addParticleBody(lua_State *L) {
+	luaL_checktype(L, 1, LUA_TLIGHTUSERDATA);
+	ScreenParticleEmitter *inst = (ScreenParticleEmitter*)lua_topointer(L, 1);
+	luaL_checktype(L, 2, LUA_TLIGHTUSERDATA);
+	Entity * particleBody = (Entity *)lua_topointer(L, 2);
+	inst->addParticleBody(particleBody);
+	return 0;
+}
+
+static int Polycore_ScreenParticleEmitter_getBaseMatrix(lua_State *L) {
+	luaL_checktype(L, 1, LUA_TLIGHTUSERDATA);
+	ScreenParticleEmitter *inst = (ScreenParticleEmitter*)lua_topointer(L, 1);
+	Matrix4 *retInst = new Matrix4();
+	*retInst = inst->getBaseMatrix();
+	lua_pushlightuserdata(L, retInst);
+	return 1;
+}
+
+static int Polycore_ScreenParticleEmitter_Update(lua_State *L) {
+	luaL_checktype(L, 1, LUA_TLIGHTUSERDATA);
+	ScreenParticleEmitter *inst = (ScreenParticleEmitter*)lua_topointer(L, 1);
+	inst->Update();
+	return 0;
+}
+
+static int Polycore_SceneParticleEmitter(lua_State *L) {
+	luaL_checktype(L, 1, LUA_TSTRING);
+	String imageFile = lua_tostring(L, 1);
+	luaL_checktype(L, 2, LUA_TLIGHTUSERDATA);
+	Mesh * particleMesh = (Mesh *)lua_topointer(L, 2);
+	luaL_checktype(L, 3, LUA_TLIGHTUSERDATA);
+	SceneMesh * emitter = (SceneMesh *)lua_topointer(L, 3);
+	luaL_checktype(L, 4, LUA_TLIGHTUSERDATA);
+	Scene * particleParentScene = (Scene *)lua_topointer(L, 4);
+	luaL_checktype(L, 5, LUA_TNUMBER);
+	int particleType = lua_tointeger(L, 5);
+	luaL_checktype(L, 6, LUA_TNUMBER);
+	int emitterType = lua_tointeger(L, 6);
+	luaL_checktype(L, 7, LUA_TNUMBER);
+	Number lifespan = lua_tonumber(L, 7);
+	luaL_checktype(L, 8, LUA_TNUMBER);
+	unsigned int numParticles = lua_tointeger(L, 8);
+	luaL_checktype(L, 9, LUA_TLIGHTUSERDATA);
+	Vector3 direction = *(Vector3*)lua_topointer(L, 9);
+	luaL_checktype(L, 10, LUA_TLIGHTUSERDATA);
+	Vector3 gravity = *(Vector3*)lua_topointer(L, 10);
+	luaL_checktype(L, 11, LUA_TLIGHTUSERDATA);
+	Vector3 deviation = *(Vector3*)lua_topointer(L, 11);
+	SceneParticleEmitter *inst = new SceneParticleEmitter(imageFile, particleMesh, emitter, particleParentScene, particleType, emitterType, lifespan, numParticles, direction, gravity, deviation);
+	lua_pushlightuserdata(L, (void*)inst);
+	return 1;
+}
+
+static int Polycore_SceneParticleEmitter_addParticleBody(lua_State *L) {
+	luaL_checktype(L, 1, LUA_TLIGHTUSERDATA);
+	SceneParticleEmitter *inst = (SceneParticleEmitter*)lua_topointer(L, 1);
+	luaL_checktype(L, 2, LUA_TLIGHTUSERDATA);
+	Entity * particleBody = (Entity *)lua_topointer(L, 2);
+	inst->addParticleBody(particleBody);
+	return 0;
+}
+
+static int Polycore_SceneParticleEmitter_getBaseMatrix(lua_State *L) {
+	luaL_checktype(L, 1, LUA_TLIGHTUSERDATA);
+	SceneParticleEmitter *inst = (SceneParticleEmitter*)lua_topointer(L, 1);
+	Matrix4 *retInst = new Matrix4();
+	*retInst = inst->getBaseMatrix();
+	lua_pushlightuserdata(L, retInst);
+	return 1;
+}
+
+static int Polycore_SceneParticleEmitter_Update(lua_State *L) {
+	luaL_checktype(L, 1, LUA_TLIGHTUSERDATA);
+	SceneParticleEmitter *inst = (SceneParticleEmitter*)lua_topointer(L, 1);
+	inst->Update();
+	return 0;
+}
+
+static int Polycore_Perlin(lua_State *L) {
+	luaL_checktype(L, 1, LUA_TNUMBER);
+	int octaves = lua_tointeger(L, 1);
+	luaL_checktype(L, 2, LUA_TNUMBER);
+	Number freq = lua_tonumber(L, 2);
+	luaL_checktype(L, 3, LUA_TNUMBER);
+	Number amp = lua_tonumber(L, 3);
+	luaL_checktype(L, 4, LUA_TNUMBER);
+	int seed = lua_tointeger(L, 4);
+	Perlin *inst = new Perlin(octaves, freq, amp, seed);
+	lua_pushlightuserdata(L, (void*)inst);
+	return 1;
+}
+
+static int Polycore_Perlin_Get(lua_State *L) {
+	luaL_checktype(L, 1, LUA_TLIGHTUSERDATA);
+	Perlin *inst = (Perlin*)lua_topointer(L, 1);
+	luaL_checktype(L, 2, LUA_TNUMBER);
+	Number x = lua_tonumber(L, 2);
+	luaL_checktype(L, 3, LUA_TNUMBER);
+	Number y = lua_tonumber(L, 3);
+	lua_pushnumber(L, inst->Get(x, y));
+	return 1;
+}
+
+static int Polycore_Polygon(lua_State *L) {
+	Polycode::Polygon *inst = new Polycode::Polygon();
+	lua_pushlightuserdata(L, (void*)inst);
+	return 1;
+}
+
+static int Polycore_Polygon_getVertexCount(lua_State *L) {
+	luaL_checktype(L, 1, LUA_TLIGHTUSERDATA);
+	Polycode::Polygon *inst = (Polycode::Polygon*)lua_topointer(L, 1);
+	lua_pushinteger(L, inst->getVertexCount());
+	return 1;
+}
+
+static int Polycore_Polygon_getVertex(lua_State *L) {
+	luaL_checktype(L, 1, LUA_TLIGHTUSERDATA);
+	Polycode::Polygon *inst = (Polycode::Polygon*)lua_topointer(L, 1);
+	luaL_checktype(L, 2, LUA_TNUMBER);
+	unsigned int index = lua_tointeger(L, 2);
+	lua_pushlightuserdata(L, (void*)inst->getVertex(index));
+	return 1;
+}
+
+static int Polycore_Polygon_addVertex(lua_State *L) {
+	luaL_checktype(L, 1, LUA_TLIGHTUSERDATA);
+	Polycode::Polygon *inst = (Polycode::Polygon*)lua_topointer(L, 1);
+	luaL_checktype(L, 2, LUA_TNUMBER);
+	Number x = lua_tonumber(L, 2);
+	luaL_checktype(L, 3, LUA_TNUMBER);
+	Number y = lua_tonumber(L, 3);
+	luaL_checktype(L, 4, LUA_TNUMBER);
+	Number z = lua_tonumber(L, 4);
+	lua_pushlightuserdata(L, (void*)inst->addVertex(x, y, z));
+	return 1;
+}
+
+static int Polycore_Polygon_removeVertex(lua_State *L) {
+	luaL_checktype(L, 1, LUA_TLIGHTUSERDATA);
+	Polycode::Polygon *inst = (Polycode::Polygon*)lua_topointer(L, 1);
+	luaL_checktype(L, 2, LUA_TNUMBER);
+	int index = lua_tointeger(L, 2);
+	inst->removeVertex(index);
+	return 0;
+}
+
+static int Polycore_Polygon_addTexCoord(lua_State *L) {
+	luaL_checktype(L, 1, LUA_TLIGHTUSERDATA);
+	Polycode::Polygon *inst = (Polycode::Polygon*)lua_topointer(L, 1);
+	luaL_checktype(L, 2, LUA_TNUMBER);
+	Number u = lua_tonumber(L, 2);
+	luaL_checktype(L, 3, LUA_TNUMBER);
+	Number v = lua_tonumber(L, 3);
+	inst->addTexCoord(u, v);
+	return 0;
+}
+
+static int Polycore_Polygon_addTexCoord2(lua_State *L) {
+	luaL_checktype(L, 1, LUA_TLIGHTUSERDATA);
+	Polycode::Polygon *inst = (Polycode::Polygon*)lua_topointer(L, 1);
+	luaL_checktype(L, 2, LUA_TNUMBER);
+	Number u = lua_tonumber(L, 2);
+	luaL_checktype(L, 3, LUA_TNUMBER);
+	Number v = lua_tonumber(L, 3);
+	inst->addTexCoord2(u, v);
+	return 0;
+}
+
+static int Polycore_Polygon_getTexCoord(lua_State *L) {
+	luaL_checktype(L, 1, LUA_TLIGHTUSERDATA);
+	Polycode::Polygon *inst = (Polycode::Polygon*)lua_topointer(L, 1);
+	luaL_checktype(L, 2, LUA_TNUMBER);
+	int index = lua_tointeger(L, 2);
+	Vector2 *retInst = new Vector2();
+	*retInst = inst->getTexCoord(index);
+	lua_pushlightuserdata(L, retInst);
+	return 1;
+}
+
+static int Polycore_Polygon_getTexCoord2(lua_State *L) {
+	luaL_checktype(L, 1, LUA_TLIGHTUSERDATA);
+	Polycode::Polygon *inst = (Polycode::Polygon*)lua_topointer(L, 1);
+	luaL_checktype(L, 2, LUA_TNUMBER);
+	int index = lua_tointeger(L, 2);
+	Vector2 *retInst = new Vector2();
+	*retInst = inst->getTexCoord2(index);
+	lua_pushlightuserdata(L, retInst);
+	return 1;
+}
+
+static int Polycore_Polygon_calculateNormal(lua_State *L) {
+	luaL_checktype(L, 1, LUA_TLIGHTUSERDATA);
+	Polycode::Polygon *inst = (Polycode::Polygon*)lua_topointer(L, 1);
+	inst->calculateNormal();
+	return 0;
+}
+
+static int Polycore_Polygon_getFaceNormal(lua_State *L) {
+	luaL_checktype(L, 1, LUA_TLIGHTUSERDATA);
+	Polycode::Polygon *inst = (Polycode::Polygon*)lua_topointer(L, 1);
+	Vector3 *retInst = new Vector3();
+	*retInst = inst->getFaceNormal();
+	lua_pushlightuserdata(L, retInst);
+	return 1;
+}
+
+static int Polycore_Polygon_getBounds2D(lua_State *L) {
+	luaL_checktype(L, 1, LUA_TLIGHTUSERDATA);
+	Polycode::Polygon *inst = (Polycode::Polygon*)lua_topointer(L, 1);
+	Rectangle *retInst = new Rectangle();
+	*retInst = inst->getBounds2D();
+	lua_pushlightuserdata(L, retInst);
+	return 1;
+}
+
+static int Polycore_Polygon_setNormal(lua_State *L) {
+	luaL_checktype(L, 1, LUA_TLIGHTUSERDATA);
+	Polycode::Polygon *inst = (Polycode::Polygon*)lua_topointer(L, 1);
+	luaL_checktype(L, 2, LUA_TLIGHTUSERDATA);
+	Vector3 normal = *(Vector3*)lua_topointer(L, 2);
+	inst->setNormal(normal);
+	return 0;
+}
+
+static int Polycore_Polygon_flipUVY(lua_State *L) {
+	luaL_checktype(L, 1, LUA_TLIGHTUSERDATA);
+	Polycode::Polygon *inst = (Polycode::Polygon*)lua_topointer(L, 1);
+	inst->flipUVY();
+	return 0;
+}
+
+static int Polycore_Polygon_setUseFaceUV(lua_State *L) {
+	luaL_checktype(L, 1, LUA_TLIGHTUSERDATA);
+	Polycode::Polygon *inst = (Polycode::Polygon*)lua_topointer(L, 1);
+	luaL_checktype(L, 2, LUA_TBOOLEAN);
+	bool val = lua_toboolean(L, 2);
+	inst->setUseFaceUV(val);
+	return 0;
+}
+
+static int Polycore_Polygon_usesFaceUV(lua_State *L) {
+	luaL_checktype(L, 1, LUA_TLIGHTUSERDATA);
+	Polycode::Polygon *inst = (Polycode::Polygon*)lua_topointer(L, 1);
+	lua_pushboolean(L, inst->usesFaceUV());
+	return 1;
+}
+
+static int Polycore_Quaternion(lua_State *L) {
+	luaL_checktype(L, 1, LUA_TNUMBER);
+	Number w = lua_tonumber(L, 1);
+	luaL_checktype(L, 2, LUA_TNUMBER);
+	Number x = lua_tonumber(L, 2);
+	luaL_checktype(L, 3, LUA_TNUMBER);
+	Number y = lua_tonumber(L, 3);
+	luaL_checktype(L, 4, LUA_TNUMBER);
+	Number z = lua_tonumber(L, 4);
+	Quaternion *inst = new Quaternion(w, x, y, z);
+	lua_pushlightuserdata(L, (void*)inst);
+	return 1;
+}
+
+static int Polycore_Quaternion_setFromMatrix(lua_State *L) {
+	luaL_checktype(L, 1, LUA_TLIGHTUSERDATA);
+	Quaternion *inst = (Quaternion*)lua_topointer(L, 1);
+	luaL_checktype(L, 2, LUA_TLIGHTUSERDATA);
+	const Matrix4 & kRot = *( Matrix4 *)lua_topointer(L, 2);
+	inst->setFromMatrix(kRot);
+	return 0;
+}
+
+static int Polycore_Quaternion_Slerp(lua_State *L) {
+	luaL_checktype(L, 1, LUA_TLIGHTUSERDATA);
+	Quaternion *inst = (Quaternion*)lua_topointer(L, 1);
+	luaL_checktype(L, 2, LUA_TNUMBER);
+	Number fT = lua_tonumber(L, 2);
+	luaL_checktype(L, 3, LUA_TLIGHTUSERDATA);
+	const Quaternion & rkP = *( Quaternion *)lua_topointer(L, 3);
+	luaL_checktype(L, 4, LUA_TLIGHTUSERDATA);
+	const Quaternion & rkQ = *( Quaternion *)lua_topointer(L, 4);
+	luaL_checktype(L, 5, LUA_TBOOLEAN);
+	bool shortestPath = lua_toboolean(L, 5);
+	 Quaternion *retInst = new  Quaternion();
+	*retInst = inst->Slerp(fT, rkP, rkQ, shortestPath);
+	lua_pushlightuserdata(L, retInst);
+	return 1;
+}
+
+static int Polycore_Quaternion_Dot(lua_State *L) {
+	luaL_checktype(L, 1, LUA_TLIGHTUSERDATA);
+	Quaternion *inst = (Quaternion*)lua_topointer(L, 1);
+	luaL_checktype(L, 2, LUA_TLIGHTUSERDATA);
+	const Quaternion & rkQ = *( Quaternion *)lua_topointer(L, 2);
+	lua_pushnumber(L, inst->Dot(rkQ));
+	return 1;
+}
+
+static int Polycore_Quaternion_Log(lua_State *L) {
+	luaL_checktype(L, 1, LUA_TLIGHTUSERDATA);
+	Quaternion *inst = (Quaternion*)lua_topointer(L, 1);
+	Quaternion *retInst = new Quaternion();
+	*retInst = inst->Log();
+	lua_pushlightuserdata(L, retInst);
+	return 1;
+}
+
+static int Polycore_Quaternion_Exp(lua_State *L) {
+	luaL_checktype(L, 1, LUA_TLIGHTUSERDATA);
+	Quaternion *inst = (Quaternion*)lua_topointer(L, 1);
+	Quaternion *retInst = new Quaternion();
+	*retInst = inst->Exp();
+	lua_pushlightuserdata(L, retInst);
+	return 1;
+}
+
+static int Polycore_Quaternion_Norm(lua_State *L) {
+	luaL_checktype(L, 1, LUA_TLIGHTUSERDATA);
+	Quaternion *inst = (Quaternion*)lua_topointer(L, 1);
+	lua_pushnumber(L, inst->Norm());
+	return 1;
+}
+
+static int Polycore_Quaternion_normalise(lua_State *L) {
+	luaL_checktype(L, 1, LUA_TLIGHTUSERDATA);
+	Quaternion *inst = (Quaternion*)lua_topointer(L, 1);
+	lua_pushnumber(L, inst->normalise());
+	return 1;
+}
+
+static int Polycore_Quaternion_lookAt(lua_State *L) {
+	luaL_checktype(L, 1, LUA_TLIGHTUSERDATA);
+	Quaternion *inst = (Quaternion*)lua_topointer(L, 1);
+	luaL_checktype(L, 2, LUA_TLIGHTUSERDATA);
+	const Vector3 & D = *( Vector3 *)lua_topointer(L, 2);
+	luaL_checktype(L, 3, LUA_TLIGHTUSERDATA);
+	const Vector3 & upVector = *( Vector3 *)lua_topointer(L, 3);
+	inst->lookAt(D, upVector);
+	return 0;
+}
+
+static int Polycore_Quaternion_createFromMatrix(lua_State *L) {
+	luaL_checktype(L, 1, LUA_TLIGHTUSERDATA);
+	Quaternion *inst = (Quaternion*)lua_topointer(L, 1);
+	luaL_checktype(L, 2, LUA_TLIGHTUSERDATA);
+	Matrix4 matrix = *(Matrix4*)lua_topointer(L, 2);
+	inst->createFromMatrix(matrix);
+	return 0;
+}
+
+static int Polycore_Quaternion_Squad(lua_State *L) {
+	luaL_checktype(L, 1, LUA_TLIGHTUSERDATA);
+	Quaternion *inst = (Quaternion*)lua_topointer(L, 1);
+	luaL_checktype(L, 2, LUA_TNUMBER);
+	Number fT = lua_tonumber(L, 2);
+	luaL_checktype(L, 3, LUA_TLIGHTUSERDATA);
+	const Quaternion & rkP = *( Quaternion *)lua_topointer(L, 3);
+	luaL_checktype(L, 4, LUA_TLIGHTUSERDATA);
+	const Quaternion & rkA = *( Quaternion *)lua_topointer(L, 4);
+	luaL_checktype(L, 5, LUA_TLIGHTUSERDATA);
+	const Quaternion & rkB = *( Quaternion *)lua_topointer(L, 5);
+	luaL_checktype(L, 6, LUA_TLIGHTUSERDATA);
+	const Quaternion & rkQ = *( Quaternion *)lua_topointer(L, 6);
+	luaL_checktype(L, 7, LUA_TBOOLEAN);
+	bool shortestPath = lua_toboolean(L, 7);
+	 Quaternion *retInst = new  Quaternion();
+	*retInst = inst->Squad(fT, rkP, rkA, rkB, rkQ, shortestPath);
+	lua_pushlightuserdata(L, retInst);
+	return 1;
+}
+
+static int Polycore_Quaternion_Inverse(lua_State *L) {
+	luaL_checktype(L, 1, LUA_TLIGHTUSERDATA);
+	Quaternion *inst = (Quaternion*)lua_topointer(L, 1);
+	Quaternion *retInst = new Quaternion();
+	*retInst = inst->Inverse();
+	lua_pushlightuserdata(L, retInst);
+	return 1;
+}
+
+static int Polycore_Quaternion_set(lua_State *L) {
+	luaL_checktype(L, 1, LUA_TLIGHTUSERDATA);
+	Quaternion *inst = (Quaternion*)lua_topointer(L, 1);
+	luaL_checktype(L, 2, LUA_TNUMBER);
+	Number w = lua_tonumber(L, 2);
+	luaL_checktype(L, 3, LUA_TNUMBER);
+	Number x = lua_tonumber(L, 3);
+	luaL_checktype(L, 4, LUA_TNUMBER);
+	Number y = lua_tonumber(L, 4);
+	luaL_checktype(L, 5, LUA_TNUMBER);
+	Number z = lua_tonumber(L, 5);
+	inst->set(w, x, y, z);
+	return 0;
+}
+
+static int Polycore_Quaternion_inverse(lua_State *L) {
+	luaL_checktype(L, 1, LUA_TLIGHTUSERDATA);
+	Quaternion *inst = (Quaternion*)lua_topointer(L, 1);
+	Quaternion *retInst = new Quaternion();
+	*retInst = inst->inverse();
+	lua_pushlightuserdata(L, retInst);
+	return 1;
+}
+
+static int Polycore_Quaternion_InvSqrt(lua_State *L) {
+	luaL_checktype(L, 1, LUA_TLIGHTUSERDATA);
+	Quaternion *inst = (Quaternion*)lua_topointer(L, 1);
+	luaL_checktype(L, 2, LUA_TNUMBER);
+	Number x = lua_tonumber(L, 2);
+	lua_pushnumber(L, inst->InvSqrt(x));
+	return 1;
+}
+
+static int Polycore_Quaternion_fromAxes(lua_State *L) {
+	luaL_checktype(L, 1, LUA_TLIGHTUSERDATA);
+	Quaternion *inst = (Quaternion*)lua_topointer(L, 1);
+	luaL_checktype(L, 2, LUA_TNUMBER);
+	Number az = lua_tonumber(L, 2);
+	luaL_checktype(L, 3, LUA_TNUMBER);
+	Number ay = lua_tonumber(L, 3);
+	luaL_checktype(L, 4, LUA_TNUMBER);
+	Number ax = lua_tonumber(L, 4);
+	inst->fromAxes(az, ay, ax);
+	return 0;
+}
+
+static int Polycore_Quaternion_FromAngleAxis(lua_State *L) {
+	luaL_checktype(L, 1, LUA_TLIGHTUSERDATA);
+	Quaternion *inst = (Quaternion*)lua_topointer(L, 1);
+	luaL_checktype(L, 2, LUA_TLIGHTUSERDATA);
+	const Number & rfAngle = *( Number *)lua_topointer(L, 2);
+	luaL_checktype(L, 3, LUA_TLIGHTUSERDATA);
+	const Vector3 & rkAxis = *( Vector3 *)lua_topointer(L, 3);
+	inst->FromAngleAxis(rfAngle, rkAxis);
+	return 0;
+}
+
+static int Polycore_Quaternion_ToAngleAxis(lua_State *L) {
+	luaL_checktype(L, 1, LUA_TLIGHTUSERDATA);
+	Quaternion *inst = (Quaternion*)lua_topointer(L, 1);
+	luaL_checktype(L, 2, LUA_TLIGHTUSERDATA);
+	Number & rfAngle = *(Number *)lua_topointer(L, 2);
+	luaL_checktype(L, 3, LUA_TLIGHTUSERDATA);
+	Vector3 & rkAxis = *(Vector3 *)lua_topointer(L, 3);
+	inst->ToAngleAxis(rfAngle, rkAxis);
+	return 0;
+}
+
+static int Polycore_Quaternion_createFromAxisAngle(lua_State *L) {
+	luaL_checktype(L, 1, LUA_TLIGHTUSERDATA);
+	Quaternion *inst = (Quaternion*)lua_topointer(L, 1);
+	luaL_checktype(L, 2, LUA_TNUMBER);
+	Number x = lua_tonumber(L, 2);
+	luaL_checktype(L, 3, LUA_TNUMBER);
+	Number y = lua_tonumber(L, 3);
+	luaL_checktype(L, 4, LUA_TNUMBER);
+	Number z = lua_tonumber(L, 4);
+	luaL_checktype(L, 5, LUA_TNUMBER);
+	Number degrees = lua_tonumber(L, 5);
+	inst->createFromAxisAngle(x, y, z, degrees);
+	return 0;
+}
+
+static int Polycore_Quaternion_createMatrix(lua_State *L) {
+	luaL_checktype(L, 1, LUA_TLIGHTUSERDATA);
+	Quaternion *inst = (Quaternion*)lua_topointer(L, 1);
+	Matrix4 *retInst = new Matrix4();
+	*retInst = inst->createMatrix();
+	lua_pushlightuserdata(L, retInst);
+	return 1;
+}
+
+static int Polycore_QuaternionCurve(lua_State *L) {
+	luaL_checktype(L, 1, LUA_TLIGHTUSERDATA);
+	BezierCurve * wCurve = (BezierCurve *)lua_topointer(L, 1);
+	luaL_checktype(L, 2, LUA_TLIGHTUSERDATA);
+	BezierCurve * xCurve = (BezierCurve *)lua_topointer(L, 2);
+	luaL_checktype(L, 3, LUA_TLIGHTUSERDATA);
+	BezierCurve * yCurve = (BezierCurve *)lua_topointer(L, 3);
+	luaL_checktype(L, 4, LUA_TLIGHTUSERDATA);
+	BezierCurve * zCurve = (BezierCurve *)lua_topointer(L, 4);
+	QuaternionCurve *inst = new QuaternionCurve(wCurve, xCurve, yCurve, zCurve);
+	lua_pushlightuserdata(L, (void*)inst);
+	return 1;
+}
+
+static int Polycore_QuaternionCurve_interpolate(lua_State *L) {
+	luaL_checktype(L, 1, LUA_TLIGHTUSERDATA);
+	QuaternionCurve *inst = (QuaternionCurve*)lua_topointer(L, 1);
+	luaL_checktype(L, 2, LUA_TNUMBER);
+	Number t = lua_tonumber(L, 2);
+	luaL_checktype(L, 3, LUA_TBOOLEAN);
+	bool useShortestPath = lua_toboolean(L, 3);
+	Quaternion *retInst = new Quaternion();
+	*retInst = inst->interpolate(t, useShortestPath);
+	lua_pushlightuserdata(L, retInst);
+	return 1;
+}
+
+static int Polycore_QuaternionCurve_generatePointsFromCurves(lua_State *L) {
+	luaL_checktype(L, 1, LUA_TLIGHTUSERDATA);
+	QuaternionCurve *inst = (QuaternionCurve*)lua_topointer(L, 1);
+	luaL_checktype(L, 2, LUA_TLIGHTUSERDATA);
+	BezierCurve * wCurve = (BezierCurve *)lua_topointer(L, 2);
+	luaL_checktype(L, 3, LUA_TLIGHTUSERDATA);
+	BezierCurve * xCurve = (BezierCurve *)lua_topointer(L, 3);
+	luaL_checktype(L, 4, LUA_TLIGHTUSERDATA);
+	BezierCurve * yCurve = (BezierCurve *)lua_topointer(L, 4);
+	luaL_checktype(L, 5, LUA_TLIGHTUSERDATA);
+	BezierCurve * zCurve = (BezierCurve *)lua_topointer(L, 5);
+	inst->generatePointsFromCurves(wCurve, xCurve, yCurve, zCurve);
+	return 0;
+}
+
+static int Polycore_QuaternionCurve_recalcTangents(lua_State *L) {
+	luaL_checktype(L, 1, LUA_TLIGHTUSERDATA);
+	QuaternionCurve *inst = (QuaternionCurve*)lua_topointer(L, 1);
+	inst->recalcTangents();
+	return 0;
+}
+
+static int Polycore_Rectangle(lua_State *L) {
+	Rectangle *inst = new Rectangle();
+	lua_pushlightuserdata(L, (void*)inst);
+	return 1;
+}
+
+static int Polycore_Rectangle_setRect(lua_State *L) {
+	luaL_checktype(L, 1, LUA_TLIGHTUSERDATA);
+	Rectangle *inst = (Rectangle*)lua_topointer(L, 1);
+	luaL_checktype(L, 2, LUA_TNUMBER);
+	Number x = lua_tonumber(L, 2);
+	luaL_checktype(L, 3, LUA_TNUMBER);
+	Number y = lua_tonumber(L, 3);
+	luaL_checktype(L, 4, LUA_TNUMBER);
+	Number w = lua_tonumber(L, 4);
+	luaL_checktype(L, 5, LUA_TNUMBER);
+	Number h = lua_tonumber(L, 5);
+	inst->setRect(x, y, w, h);
+	return 0;
+}
+
+static int Polycore_Resource(lua_State *L) {
+	luaL_checktype(L, 1, LUA_TNUMBER);
+	int type = lua_tointeger(L, 1);
+	Resource *inst = new Resource(type);
+	lua_pushlightuserdata(L, (void*)inst);
+	return 1;
+}
+
+static int Polycore_Resource_getResourceName(lua_State *L) {
+	luaL_checktype(L, 1, LUA_TLIGHTUSERDATA);
+	Resource *inst = (Resource*)lua_topointer(L, 1);
+	lua_pushstring(L, inst->getResourceName().c_str());
+	return 1;
+}
+
+static int Polycore_Resource_getResourceType(lua_State *L) {
+	luaL_checktype(L, 1, LUA_TLIGHTUSERDATA);
+	Resource *inst = (Resource*)lua_topointer(L, 1);
+	lua_pushinteger(L, inst->getResourceType());
+	return 1;
+}
+
+static int Polycore_Resource_setResourceName(lua_State *L) {
+	luaL_checktype(L, 1, LUA_TLIGHTUSERDATA);
+	Resource *inst = (Resource*)lua_topointer(L, 1);
+	luaL_checktype(L, 2, LUA_TSTRING);
+	String newName = lua_tostring(L, 2);
+	inst->setResourceName(newName);
+	return 0;
+}
+
+static int Polycore_Resource_setResourcePath(lua_State *L) {
+	luaL_checktype(L, 1, LUA_TLIGHTUSERDATA);
+	Resource *inst = (Resource*)lua_topointer(L, 1);
+	luaL_checktype(L, 2, LUA_TSTRING);
+	String path = lua_tostring(L, 2);
+	inst->setResourcePath(path);
+	return 0;
+}
+
+static int Polycore_Resource_getResourcePath(lua_State *L) {
+	luaL_checktype(L, 1, LUA_TLIGHTUSERDATA);
+	Resource *inst = (Resource*)lua_topointer(L, 1);
+	lua_pushstring(L, inst->getResourcePath().c_str());
+	return 1;
+}
+
+static int Polycore_ResourceManager(lua_State *L) {
+	ResourceManager *inst = new ResourceManager();
+	lua_pushlightuserdata(L, (void*)inst);
+	return 1;
+}
+
+static int Polycore_ResourceManager_addResource(lua_State *L) {
+	luaL_checktype(L, 1, LUA_TLIGHTUSERDATA);
+	ResourceManager *inst = (ResourceManager*)lua_topointer(L, 1);
+	luaL_checktype(L, 2, LUA_TLIGHTUSERDATA);
+	Resource * resource = (Resource *)lua_topointer(L, 2);
+	inst->addResource(resource);
+	return 0;
+}
+
+static int Polycore_ResourceManager_addDirResource(lua_State *L) {
+	luaL_checktype(L, 1, LUA_TLIGHTUSERDATA);
+	ResourceManager *inst = (ResourceManager*)lua_topointer(L, 1);
+	luaL_checktype(L, 2, LUA_TSTRING);
+	String dirPath = lua_tostring(L, 2);
+	luaL_checktype(L, 3, LUA_TBOOLEAN);
+	bool recursive = lua_toboolean(L, 3);
+	inst->addDirResource(dirPath, recursive);
+	return 0;
+}
+
+static int Polycore_ResourceManager_addArchive(lua_State *L) {
+	luaL_checktype(L, 1, LUA_TLIGHTUSERDATA);
+	ResourceManager *inst = (ResourceManager*)lua_topointer(L, 1);
+	luaL_checktype(L, 2, LUA_TSTRING);
+	String zipPath = lua_tostring(L, 2);
+	inst->addArchive(zipPath);
+	return 0;
+}
+
+static int Polycore_ResourceManager_readFile(lua_State *L) {
+	luaL_checktype(L, 1, LUA_TLIGHTUSERDATA);
+	ResourceManager *inst = (ResourceManager*)lua_topointer(L, 1);
+	luaL_checktype(L, 2, LUA_TSTRING);
+	String fileName = lua_tostring(L, 2);
+	lua_pushboolean(L, inst->readFile(fileName));
+	return 1;
+}
+
+static int Polycore_ResourceManager_parseTextures(lua_State *L) {
+	luaL_checktype(L, 1, LUA_TLIGHTUSERDATA);
+	ResourceManager *inst = (ResourceManager*)lua_topointer(L, 1);
+	luaL_checktype(L, 2, LUA_TSTRING);
+	String dirPath = lua_tostring(L, 2);
+	luaL_checktype(L, 3, LUA_TBOOLEAN);
+	bool recursive = lua_toboolean(L, 3);
+	inst->parseTextures(dirPath, recursive);
+	return 0;
+}
+
+static int Polycore_ResourceManager_parseMaterials(lua_State *L) {
+	luaL_checktype(L, 1, LUA_TLIGHTUSERDATA);
+	ResourceManager *inst = (ResourceManager*)lua_topointer(L, 1);
+	luaL_checktype(L, 2, LUA_TSTRING);
+	String dirPath = lua_tostring(L, 2);
+	luaL_checktype(L, 3, LUA_TBOOLEAN);
+	bool recursive = lua_toboolean(L, 3);
+	inst->parseMaterials(dirPath, recursive);
+	return 0;
+}
+
+static int Polycore_ResourceManager_parseShaders(lua_State *L) {
+	luaL_checktype(L, 1, LUA_TLIGHTUSERDATA);
+	ResourceManager *inst = (ResourceManager*)lua_topointer(L, 1);
+	luaL_checktype(L, 2, LUA_TSTRING);
+	String dirPath = lua_tostring(L, 2);
+	luaL_checktype(L, 3, LUA_TBOOLEAN);
+	bool recursive = lua_toboolean(L, 3);
+	inst->parseShaders(dirPath, recursive);
+	return 0;
+}
+
+static int Polycore_ResourceManager_parsePrograms(lua_State *L) {
+	luaL_checktype(L, 1, LUA_TLIGHTUSERDATA);
+	ResourceManager *inst = (ResourceManager*)lua_topointer(L, 1);
+	luaL_checktype(L, 2, LUA_TSTRING);
+	String dirPath = lua_tostring(L, 2);
+	luaL_checktype(L, 3, LUA_TBOOLEAN);
+	bool recursive = lua_toboolean(L, 3);
+	inst->parsePrograms(dirPath, recursive);
+	return 0;
+}
+
+static int Polycore_ResourceManager_parseCubemaps(lua_State *L) {
+	luaL_checktype(L, 1, LUA_TLIGHTUSERDATA);
+	ResourceManager *inst = (ResourceManager*)lua_topointer(L, 1);
+	luaL_checktype(L, 2, LUA_TSTRING);
+	String dirPath = lua_tostring(L, 2);
+	luaL_checktype(L, 3, LUA_TBOOLEAN);
+	bool recursive = lua_toboolean(L, 3);
+	inst->parseCubemaps(dirPath, recursive);
+	return 0;
+}
+
+static int Polycore_ResourceManager_getResource(lua_State *L) {
+	luaL_checktype(L, 1, LUA_TLIGHTUSERDATA);
+	ResourceManager *inst = (ResourceManager*)lua_topointer(L, 1);
+	luaL_checktype(L, 2, LUA_TNUMBER);
+	int resourceType = lua_tointeger(L, 2);
+	luaL_checktype(L, 3, LUA_TSTRING);
+	String resourceName = lua_tostring(L, 3);
+	lua_pushlightuserdata(L, (void*)inst->getResource(resourceType, resourceName));
+	return 1;
+}
+
+static int Polycore_ResourceManager_addShaderModule(lua_State *L) {
+	luaL_checktype(L, 1, LUA_TLIGHTUSERDATA);
+	ResourceManager *inst = (ResourceManager*)lua_topointer(L, 1);
+	luaL_checktype(L, 2, LUA_TLIGHTUSERDATA);
+	PolycodeShaderModule * module = (PolycodeShaderModule *)lua_topointer(L, 2);
+	inst->addShaderModule(module);
+	return 0;
+}
+
+static int Polycore_SceneEntity(lua_State *L) {
+	SceneEntity *inst = new SceneEntity();
+	lua_pushlightuserdata(L, (void*)inst);
+	return 1;
+}
+
+static int Polycore_SceneEntity_testMouseCollision(lua_State *L) {
+	luaL_checktype(L, 1, LUA_TLIGHTUSERDATA);
+	SceneEntity *inst = (SceneEntity*)lua_topointer(L, 1);
+	luaL_checktype(L, 2, LUA_TNUMBER);
+	Number x = lua_tonumber(L, 2);
+	luaL_checktype(L, 3, LUA_TNUMBER);
+	Number y = lua_tonumber(L, 3);
+	lua_pushboolean(L, inst->testMouseCollision(x, y));
+	return 1;
+}
+
+static int Polycore_SceneLabel(lua_State *L) {
+	luaL_checktype(L, 1, LUA_TSTRING);
+	String fontName = lua_tostring(L, 1);
+	luaL_checktype(L, 2, LUA_TSTRING);
+	String text = lua_tostring(L, 2);
+	luaL_checktype(L, 3, LUA_TNUMBER);
+	int size = lua_tointeger(L, 3);
+	luaL_checktype(L, 4, LUA_TNUMBER);
+	Number scale = lua_tonumber(L, 4);
+	luaL_checktype(L, 5, LUA_TNUMBER);
+	int amode = lua_tointeger(L, 5);
+	SceneLabel *inst = new SceneLabel(fontName, text, size, scale, amode);
+	lua_pushlightuserdata(L, (void*)inst);
+	return 1;
+}
+
+static int Polycore_SceneLabel_testMouseCollision(lua_State *L) {
+	luaL_checktype(L, 1, LUA_TLIGHTUSERDATA);
+	SceneLabel *inst = (SceneLabel*)lua_topointer(L, 1);
+	luaL_checktype(L, 2, LUA_TNUMBER);
+	Number x = lua_tonumber(L, 2);
+	luaL_checktype(L, 3, LUA_TNUMBER);
+	Number y = lua_tonumber(L, 3);
+	lua_pushboolean(L, inst->testMouseCollision(x, y));
+	return 1;
+}
+
+static int Polycore_SceneLabel_setText(lua_State *L) {
+	luaL_checktype(L, 1, LUA_TLIGHTUSERDATA);
+	SceneLabel *inst = (SceneLabel*)lua_topointer(L, 1);
+	luaL_checktype(L, 2, LUA_TSTRING);
+	String newText = lua_tostring(L, 2);
+	inst->setText(newText);
+	return 0;
+}
+
+static int Polycore_SceneLabel_getLabel(lua_State *L) {
+	luaL_checktype(L, 1, LUA_TLIGHTUSERDATA);
+	SceneLabel *inst = (SceneLabel*)lua_topointer(L, 1);
+	lua_pushlightuserdata(L, (void*)inst->getLabel());
+	return 1;
+}
+
+static int Polycore_SceneLabel_Render(lua_State *L) {
+	luaL_checktype(L, 1, LUA_TLIGHTUSERDATA);
+	SceneLabel *inst = (SceneLabel*)lua_topointer(L, 1);
+	inst->Render();
+	return 0;
+}
+
+static int Polycore_SceneLight(lua_State *L) {
+	luaL_checktype(L, 1, LUA_TNUMBER);
+	int type = lua_tointeger(L, 1);
+	luaL_checktype(L, 2, LUA_TNUMBER);
+	Number intensity = lua_tonumber(L, 2);
+	luaL_checktype(L, 3, LUA_TNUMBER);
+	Number distance = lua_tonumber(L, 3);
+	luaL_checktype(L, 4, LUA_TLIGHTUSERDATA);
+	Scene * parentScene = (Scene *)lua_topointer(L, 4);
+	SceneLight *inst = new SceneLight(type, intensity, distance, parentScene);
+	lua_pushlightuserdata(L, (void*)inst);
+	return 1;
+}
+
+static int Polycore_SceneLight_getIntensity(lua_State *L) {
+	luaL_checktype(L, 1, LUA_TLIGHTUSERDATA);
+	SceneLight *inst = (SceneLight*)lua_topointer(L, 1);
+	lua_pushnumber(L, inst->getIntensity());
+	return 1;
+}
+
+static int Polycore_SceneLight_getDistance(lua_State *L) {
+	luaL_checktype(L, 1, LUA_TLIGHTUSERDATA);
+	SceneLight *inst = (SceneLight*)lua_topointer(L, 1);
+	lua_pushnumber(L, inst->getDistance());
+	return 1;
+}
+
+static int Polycore_SceneLight_getType(lua_State *L) {
+	luaL_checktype(L, 1, LUA_TLIGHTUSERDATA);
+	SceneLight *inst = (SceneLight*)lua_topointer(L, 1);
+	lua_pushinteger(L, inst->getType());
+	return 1;
+}
+
+static int Polycore_SceneLight_renderDepthMap(lua_State *L) {
+	luaL_checktype(L, 1, LUA_TLIGHTUSERDATA);
+	SceneLight *inst = (SceneLight*)lua_topointer(L, 1);
+	luaL_checktype(L, 2, LUA_TLIGHTUSERDATA);
+	Scene * scene = (Scene *)lua_topointer(L, 2);
+	inst->renderDepthMap(scene);
+	return 0;
+}
+
+static int Polycore_SceneLight_Render(lua_State *L) {
+	luaL_checktype(L, 1, LUA_TLIGHTUSERDATA);
+	SceneLight *inst = (SceneLight*)lua_topointer(L, 1);
+	inst->Render();
+	return 0;
+}
+
+static int Polycore_SceneLight_getLightViewMatrix(lua_State *L) {
+	luaL_checktype(L, 1, LUA_TLIGHTUSERDATA);
+	SceneLight *inst = (SceneLight*)lua_topointer(L, 1);
+	Matrix4 *retInst = new Matrix4();
+	*retInst = inst->getLightViewMatrix();
+	lua_pushlightuserdata(L, retInst);
+	return 1;
+}
+
+static int Polycore_SceneLight_getZBufferTexture(lua_State *L) {
+	luaL_checktype(L, 1, LUA_TLIGHTUSERDATA);
+	SceneLight *inst = (SceneLight*)lua_topointer(L, 1);
+	lua_pushlightuserdata(L, (void*)inst->getZBufferTexture());
+	return 1;
+}
+
+static int Polycore_SceneLight_setLightColor(lua_State *L) {
+	luaL_checktype(L, 1, LUA_TLIGHTUSERDATA);
+	SceneLight *inst = (SceneLight*)lua_topointer(L, 1);
+	luaL_checktype(L, 2, LUA_TNUMBER);
+	Number r = lua_tonumber(L, 2);
+	luaL_checktype(L, 3, LUA_TNUMBER);
+	Number g = lua_tonumber(L, 3);
+	luaL_checktype(L, 4, LUA_TNUMBER);
+	Number b = lua_tonumber(L, 4);
+	inst->setLightColor(r, g, b);
+	return 0;
+}
+
+static int Polycore_SceneLight_enableShadows(lua_State *L) {
+	luaL_checktype(L, 1, LUA_TLIGHTUSERDATA);
+	SceneLight *inst = (SceneLight*)lua_topointer(L, 1);
+	luaL_checktype(L, 2, LUA_TBOOLEAN);
+	bool val = lua_toboolean(L, 2);
+	luaL_checktype(L, 3, LUA_TNUMBER);
+	Number resolution = lua_tonumber(L, 3);
+	inst->enableShadows(val, resolution);
+	return 0;
+}
+
+static int Polycore_SceneLight_setShadowMapFOV(lua_State *L) {
+	luaL_checktype(L, 1, LUA_TLIGHTUSERDATA);
+	SceneLight *inst = (SceneLight*)lua_topointer(L, 1);
+	luaL_checktype(L, 2, LUA_TNUMBER);
+	Number fov = lua_tonumber(L, 2);
+	inst->setShadowMapFOV(fov);
+	return 0;
+}
+
+static int Polycore_SceneLight_areShadowsEnabled(lua_State *L) {
+	luaL_checktype(L, 1, LUA_TLIGHTUSERDATA);
+	SceneLight *inst = (SceneLight*)lua_topointer(L, 1);
+	lua_pushboolean(L, inst->areShadowsEnabled());
+	return 1;
+}
+
+static int Polycore_SceneLight_getLightType(lua_State *L) {
+	luaL_checktype(L, 1, LUA_TLIGHTUSERDATA);
+	SceneLight *inst = (SceneLight*)lua_topointer(L, 1);
+	lua_pushinteger(L, inst->getLightType());
+	return 1;
+}
+
+static int Polycore_SceneLine(lua_State *L) {
+	luaL_checktype(L, 1, LUA_TLIGHTUSERDATA);
+	SceneEntity * ent1 = (SceneEntity *)lua_topointer(L, 1);
+	luaL_checktype(L, 2, LUA_TLIGHTUSERDATA);
+	SceneEntity * ent2 = (SceneEntity *)lua_topointer(L, 2);
+	SceneLine *inst = new SceneLine(ent1, ent2);
+	lua_pushlightuserdata(L, (void*)inst);
+	return 1;
+}
+
+static int Polycore_SceneLine_Render(lua_State *L) {
+	luaL_checktype(L, 1, LUA_TLIGHTUSERDATA);
+	SceneLine *inst = (SceneLine*)lua_topointer(L, 1);
+	inst->Render();
+	return 0;
+}
+
+static int Polycore_SceneManager(lua_State *L) {
+	SceneManager *inst = new SceneManager();
+	lua_pushlightuserdata(L, (void*)inst);
+	return 1;
+}
+
+static int Polycore_SceneManager_addScene(lua_State *L) {
+	luaL_checktype(L, 1, LUA_TLIGHTUSERDATA);
+	SceneManager *inst = (SceneManager*)lua_topointer(L, 1);
+	luaL_checktype(L, 2, LUA_TLIGHTUSERDATA);
+	Scene * newScene = (Scene *)lua_topointer(L, 2);
+	inst->addScene(newScene);
+	return 0;
+}
+
+static int Polycore_SceneManager_Update(lua_State *L) {
+	luaL_checktype(L, 1, LUA_TLIGHTUSERDATA);
+	SceneManager *inst = (SceneManager*)lua_topointer(L, 1);
+	inst->Update();
+	return 0;
+}
+
+static int Polycore_SceneManager_UpdateVirtual(lua_State *L) {
+	luaL_checktype(L, 1, LUA_TLIGHTUSERDATA);
+	SceneManager *inst = (SceneManager*)lua_topointer(L, 1);
+	inst->UpdateVirtual();
+	return 0;
+}
+
+static int Polycore_SceneManager_removeScene(lua_State *L) {
+	luaL_checktype(L, 1, LUA_TLIGHTUSERDATA);
+	SceneManager *inst = (SceneManager*)lua_topointer(L, 1);
+	luaL_checktype(L, 2, LUA_TLIGHTUSERDATA);
+	Scene * scene = (Scene *)lua_topointer(L, 2);
+	inst->removeScene(scene);
+	return 0;
+}
+
+static int Polycore_SceneManager_registerRenderTexture(lua_State *L) {
+	luaL_checktype(L, 1, LUA_TLIGHTUSERDATA);
+	SceneManager *inst = (SceneManager*)lua_topointer(L, 1);
+	luaL_checktype(L, 2, LUA_TLIGHTUSERDATA);
+	SceneRenderTexture * r_enderTexture = (SceneRenderTexture *)lua_topointer(L, 2);
+	inst->registerRenderTexture(r_enderTexture);
+	return 0;
+}
+
+static int Polycore_SceneMesh(lua_State *L) {
+	luaL_checktype(L, 1, LUA_TSTRING);
+	String fileName = lua_tostring(L, 1);
+	SceneMesh *inst = new SceneMesh(fileName);
+	lua_pushlightuserdata(L, (void*)inst);
+	return 1;
+}
+
+static int Polycore_SceneMesh_Render(lua_State *L) {
+	luaL_checktype(L, 1, LUA_TLIGHTUSERDATA);
+	SceneMesh *inst = (SceneMesh*)lua_topointer(L, 1);
+	inst->Render();
+	return 0;
+}
+
+static int Polycore_SceneMesh_getLocalShaderOptions(lua_State *L) {
+	luaL_checktype(L, 1, LUA_TLIGHTUSERDATA);
+	SceneMesh *inst = (SceneMesh*)lua_topointer(L, 1);
+	lua_pushlightuserdata(L, (void*)inst->getLocalShaderOptions());
+	return 1;
+}
+
+static int Polycore_SceneMesh_getMesh(lua_State *L) {
+	luaL_checktype(L, 1, LUA_TLIGHTUSERDATA);
+	SceneMesh *inst = (SceneMesh*)lua_topointer(L, 1);
+	lua_pushlightuserdata(L, (void*)inst->getMesh());
+	return 1;
+}
+
+static int Polycore_SceneMesh_getTexture(lua_State *L) {
+	luaL_checktype(L, 1, LUA_TLIGHTUSERDATA);
+	SceneMesh *inst = (SceneMesh*)lua_topointer(L, 1);
+	lua_pushlightuserdata(L, (void*)inst->getTexture());
+	return 1;
+}
+
+static int Polycore_SceneMesh_getMaterial(lua_State *L) {
+	luaL_checktype(L, 1, LUA_TLIGHTUSERDATA);
+	SceneMesh *inst = (SceneMesh*)lua_topointer(L, 1);
+	lua_pushlightuserdata(L, (void*)inst->getMaterial());
+	return 1;
+}
+
+static int Polycore_SceneMesh_loadTexture(lua_State *L) {
+	luaL_checktype(L, 1, LUA_TLIGHTUSERDATA);
+	SceneMesh *inst = (SceneMesh*)lua_topointer(L, 1);
+	luaL_checktype(L, 2, LUA_TSTRING);
+	String fileName = lua_tostring(L, 2);
+	luaL_checktype(L, 3, LUA_TBOOLEAN);
+	bool clamp = lua_toboolean(L, 3);
+	inst->loadTexture(fileName, clamp);
+	return 0;
+}
+
+static int Polycore_SceneMesh_loadSkeleton(lua_State *L) {
+	luaL_checktype(L, 1, LUA_TLIGHTUSERDATA);
+	SceneMesh *inst = (SceneMesh*)lua_topointer(L, 1);
+	luaL_checktype(L, 2, LUA_TSTRING);
+	String fileName = lua_tostring(L, 2);
+	inst->loadSkeleton(fileName);
+	return 0;
+}
+
+static int Polycore_SceneMesh_setTexture(lua_State *L) {
+	luaL_checktype(L, 1, LUA_TLIGHTUSERDATA);
+	SceneMesh *inst = (SceneMesh*)lua_topointer(L, 1);
+	luaL_checktype(L, 2, LUA_TLIGHTUSERDATA);
+	Texture * texture = (Texture *)lua_topointer(L, 2);
+	inst->setTexture(texture);
+	return 0;
+}
+
+static int Polycore_SceneMesh_setMaterial(lua_State *L) {
+	luaL_checktype(L, 1, LUA_TLIGHTUSERDATA);
+	SceneMesh *inst = (SceneMesh*)lua_topointer(L, 1);
+	luaL_checktype(L, 2, LUA_TLIGHTUSERDATA);
+	Material * material = (Material *)lua_topointer(L, 2);
+	inst->setMaterial(material);
+	return 0;
+}
+
+static int Polycore_SceneMesh_setMesh(lua_State *L) {
+	luaL_checktype(L, 1, LUA_TLIGHTUSERDATA);
+	SceneMesh *inst = (SceneMesh*)lua_topointer(L, 1);
+	luaL_checktype(L, 2, LUA_TLIGHTUSERDATA);
+	Mesh * mesh = (Mesh *)lua_topointer(L, 2);
+	inst->setMesh(mesh);
+	return 0;
+}
+
+static int Polycore_SceneMesh_setSkeleton(lua_State *L) {
+	luaL_checktype(L, 1, LUA_TLIGHTUSERDATA);
+	SceneMesh *inst = (SceneMesh*)lua_topointer(L, 1);
+	luaL_checktype(L, 2, LUA_TLIGHTUSERDATA);
+	Skeleton * skeleton = (Skeleton *)lua_topointer(L, 2);
+	inst->setSkeleton(skeleton);
+	return 0;
+}
+
+static int Polycore_SceneMesh_getSkeleton(lua_State *L) {
+	luaL_checktype(L, 1, LUA_TLIGHTUSERDATA);
+	SceneMesh *inst = (SceneMesh*)lua_topointer(L, 1);
+	lua_pushlightuserdata(L, (void*)inst->getSkeleton());
+	return 1;
+}
+
+static int Polycore_SceneMesh_renderMeshLocally(lua_State *L) {
+	luaL_checktype(L, 1, LUA_TLIGHTUSERDATA);
+	SceneMesh *inst = (SceneMesh*)lua_topointer(L, 1);
+	inst->renderMeshLocally();
+	return 0;
+}
+
+static int Polycore_SceneMesh_cacheToVertexBuffer(lua_State *L) {
+	luaL_checktype(L, 1, LUA_TLIGHTUSERDATA);
+	SceneMesh *inst = (SceneMesh*)lua_topointer(L, 1);
+	luaL_checktype(L, 2, LUA_TBOOLEAN);
+	bool cache = lua_toboolean(L, 2);
+	inst->cacheToVertexBuffer(cache);
+	return 0;
+}
+
+static int Polycore_ScenePrimitive(lua_State *L) {
+	luaL_checktype(L, 1, LUA_TNUMBER);
+	int type = lua_tointeger(L, 1);
+	luaL_checktype(L, 2, LUA_TNUMBER);
+	Number v1 = lua_tonumber(L, 2);
+	luaL_checktype(L, 3, LUA_TNUMBER);
+	Number v2 = lua_tonumber(L, 3);
+	luaL_checktype(L, 4, LUA_TNUMBER);
+	Number v3 = lua_tonumber(L, 4);
+	ScenePrimitive *inst = new ScenePrimitive(type, v1, v2, v3);
+	lua_pushlightuserdata(L, (void*)inst);
+	return 1;
+}
+
+static int Polycore_SceneRenderTexture(lua_State *L) {
+	luaL_checktype(L, 1, LUA_TLIGHTUSERDATA);
+	Scene * targetScene = (Scene *)lua_topointer(L, 1);
+	luaL_checktype(L, 2, LUA_TLIGHTUSERDATA);
+	Camera * targetCamera = (Camera *)lua_topointer(L, 2);
+	luaL_checktype(L, 3, LUA_TNUMBER);
+	int r_enderWidth = lua_tointeger(L, 3);
+	luaL_checktype(L, 4, LUA_TNUMBER);
+	int r_enderHeight = lua_tointeger(L, 4);
+	SceneRenderTexture *inst = new SceneRenderTexture(targetScene, targetCamera, r_enderWidth, r_enderHeight);
+	lua_pushlightuserdata(L, (void*)inst);
+	return 1;
+}
+
+static int Polycore_SceneRenderTexture_drawScreen(lua_State *L) {
+	luaL_checktype(L, 1, LUA_TLIGHTUSERDATA);
+	SceneRenderTexture *inst = (SceneRenderTexture*)lua_topointer(L, 1);
+	inst->drawScreen();
+	return 0;
+}
+
+static int Polycore_SceneRenderTexture_getTargetTexture(lua_State *L) {
+	luaL_checktype(L, 1, LUA_TLIGHTUSERDATA);
+	SceneRenderTexture *inst = (SceneRenderTexture*)lua_topointer(L, 1);
+	lua_pushlightuserdata(L, (void*)inst->getTargetTexture());
+	return 1;
+}
+
+static int Polycore_SceneRenderTexture_getTargetScene(lua_State *L) {
+	luaL_checktype(L, 1, LUA_TLIGHTUSERDATA);
+	SceneRenderTexture *inst = (SceneRenderTexture*)lua_topointer(L, 1);
+	lua_pushlightuserdata(L, (void*)inst->getTargetScene());
+	return 1;
+}
+
+static int Polycore_SceneRenderTexture_getTargetCamera(lua_State *L) {
+	luaL_checktype(L, 1, LUA_TLIGHTUSERDATA);
+	SceneRenderTexture *inst = (SceneRenderTexture*)lua_topointer(L, 1);
+	lua_pushlightuserdata(L, (void*)inst->getTargetCamera());
+	return 1;
+}
+
+static int Polycore_Screen(lua_State *L) {
+	Screen *inst = new Screen();
+	lua_pushlightuserdata(L, (void*)inst);
+	return 1;
+}
+
+static int Polycore_Screen_addChild(lua_State *L) {
+	luaL_checktype(L, 1, LUA_TLIGHTUSERDATA);
+	Screen *inst = (Screen*)lua_topointer(L, 1);
+	luaL_checktype(L, 2, LUA_TLIGHTUSERDATA);
+	ScreenEntity * newEntity = (ScreenEntity *)lua_topointer(L, 2);
+	lua_pushlightuserdata(L, (void*)inst->addChild(newEntity));
+	return 1;
+}
+
+static int Polycore_Screen_removeChild(lua_State *L) {
+	luaL_checktype(L, 1, LUA_TLIGHTUSERDATA);
+	Screen *inst = (Screen*)lua_topointer(L, 1);
+	luaL_checktype(L, 2, LUA_TLIGHTUSERDATA);
+	ScreenEntity * entityToRemove = (ScreenEntity *)lua_topointer(L, 2);
+	lua_pushlightuserdata(L, (void*)inst->removeChild(entityToRemove));
+	return 1;
+}
+
+static int Polycore_Screen_setScreenOffset(lua_State *L) {
+	luaL_checktype(L, 1, LUA_TLIGHTUSERDATA);
+	Screen *inst = (Screen*)lua_topointer(L, 1);
+	luaL_checktype(L, 2, LUA_TNUMBER);
+	Number x = lua_tonumber(L, 2);
+	luaL_checktype(L, 3, LUA_TNUMBER);
+	Number y = lua_tonumber(L, 3);
+	inst->setScreenOffset(x, y);
+	return 0;
+}
+
+static int Polycore_Screen_getScreenOffset(lua_State *L) {
+	luaL_checktype(L, 1, LUA_TLIGHTUSERDATA);
+	Screen *inst = (Screen*)lua_topointer(L, 1);
+	Vector2 *retInst = new Vector2();
+	*retInst = inst->getScreenOffset();
+	lua_pushlightuserdata(L, retInst);
+	return 1;
+}
+
+static int Polycore_Screen_Shutdown(lua_State *L) {
+	luaL_checktype(L, 1, LUA_TLIGHTUSERDATA);
+	Screen *inst = (Screen*)lua_topointer(L, 1);
+	inst->Shutdown();
+	return 0;
+}
+
+static int Polycore_Screen_Update(lua_State *L) {
+	luaL_checktype(L, 1, LUA_TLIGHTUSERDATA);
+	Screen *inst = (Screen*)lua_topointer(L, 1);
+	inst->Update();
+	return 0;
+}
+
+static int Polycore_Screen_getEntityAt(lua_State *L) {
+	luaL_checktype(L, 1, LUA_TLIGHTUSERDATA);
+	Screen *inst = (Screen*)lua_topointer(L, 1);
+	luaL_checktype(L, 2, LUA_TNUMBER);
+	Number x = lua_tonumber(L, 2);
+	luaL_checktype(L, 3, LUA_TNUMBER);
+	Number y = lua_tonumber(L, 3);
+	lua_pushlightuserdata(L, (void*)inst->getEntityAt(x, y));
+	return 1;
+}
+
+static int Polycore_Screen_Render(lua_State *L) {
+	luaL_checktype(L, 1, LUA_TLIGHTUSERDATA);
+	Screen *inst = (Screen*)lua_topointer(L, 1);
+	inst->Render();
+	return 0;
+}
+
+static int Polycore_Screen_setRenderer(lua_State *L) {
+	luaL_checktype(L, 1, LUA_TLIGHTUSERDATA);
+	Screen *inst = (Screen*)lua_topointer(L, 1);
+	luaL_checktype(L, 2, LUA_TLIGHTUSERDATA);
+	Renderer * r_enderer = (Renderer *)lua_topointer(L, 2);
+	inst->setRenderer(r_enderer);
+	return 0;
+}
+
+static int Polycore_Screen_setNormalizedCoordinates(lua_State *L) {
+	luaL_checktype(L, 1, LUA_TLIGHTUSERDATA);
+	Screen *inst = (Screen*)lua_topointer(L, 1);
+	luaL_checktype(L, 2, LUA_TBOOLEAN);
+	bool newVal = lua_toboolean(L, 2);
+	luaL_checktype(L, 3, LUA_TNUMBER);
+	Number yCoordinateSize = lua_tonumber(L, 3);
+	inst->setNormalizedCoordinates(newVal, yCoordinateSize);
+	return 0;
+}
+
+static int Polycore_Screen_setScreenShader(lua_State *L) {
+	luaL_checktype(L, 1, LUA_TLIGHTUSERDATA);
+	Screen *inst = (Screen*)lua_topointer(L, 1);
+	luaL_checktype(L, 2, LUA_TSTRING);
+	String shaderName = lua_tostring(L, 2);
+	inst->setScreenShader(shaderName);
+	return 0;
+}
+
+static int Polycore_Screen_handleEvent(lua_State *L) {
+	luaL_checktype(L, 1, LUA_TLIGHTUSERDATA);
+	Screen *inst = (Screen*)lua_topointer(L, 1);
+	luaL_checktype(L, 2, LUA_TLIGHTUSERDATA);
+	Event * event = (Event *)lua_topointer(L, 2);
+	inst->handleEvent(event);
+	return 0;
+}
+
+static int Polycore_Screen_getHighestZIndex(lua_State *L) {
+	luaL_checktype(L, 1, LUA_TLIGHTUSERDATA);
+	Screen *inst = (Screen*)lua_topointer(L, 1);
+	lua_pushinteger(L, inst->getHighestZIndex());
+	return 1;
+}
+
+static int Polycore_Screen_sortChildren(lua_State *L) {
+	luaL_checktype(L, 1, LUA_TLIGHTUSERDATA);
+	Screen *inst = (Screen*)lua_topointer(L, 1);
+	inst->sortChildren();
+	return 0;
+}
+
+static int Polycore_Screen_cmpZindex(lua_State *L) {
+	luaL_checktype(L, 1, LUA_TLIGHTUSERDATA);
+	Screen *inst = (Screen*)lua_topointer(L, 1);
+	luaL_checktype(L, 2, LUA_TLIGHTUSERDATA);
+	const ScreenEntity * left = (const ScreenEntity *)lua_topointer(L, 2);
+	luaL_checktype(L, 3, LUA_TLIGHTUSERDATA);
+	const ScreenEntity * right = (const ScreenEntity *)lua_topointer(L, 3);
+	lua_pushboolean(L, inst->cmpZindex(left, right));
+	return 1;
+}
+
+static int Polycore_Screen_handleInputEvent(lua_State *L) {
+	luaL_checktype(L, 1, LUA_TLIGHTUSERDATA);
+	Screen *inst = (Screen*)lua_topointer(L, 1);
+	luaL_checktype(L, 2, LUA_TLIGHTUSERDATA);
+	InputEvent * inputEvent = (InputEvent *)lua_topointer(L, 2);
+	inst->handleInputEvent(inputEvent);
+	return 0;
+}
+
+static int Polycore_Screen_hasFilterShader(lua_State *L) {
+	luaL_checktype(L, 1, LUA_TLIGHTUSERDATA);
+	Screen *inst = (Screen*)lua_topointer(L, 1);
+	lua_pushboolean(L, inst->hasFilterShader());
+	return 1;
+}
+
+static int Polycore_Screen_drawFilter(lua_State *L) {
+	luaL_checktype(L, 1, LUA_TLIGHTUSERDATA);
+	Screen *inst = (Screen*)lua_topointer(L, 1);
+	inst->drawFilter();
+	return 0;
+}
+
+static int Polycore_Screen_usesNormalizedCoordinates(lua_State *L) {
+	luaL_checktype(L, 1, LUA_TLIGHTUSERDATA);
+	Screen *inst = (Screen*)lua_topointer(L, 1);
+	lua_pushboolean(L, inst->usesNormalizedCoordinates());
+	return 1;
+}
+
+static int Polycore_Screen_getYCoordinateSize(lua_State *L) {
+	luaL_checktype(L, 1, LUA_TLIGHTUSERDATA);
+	Screen *inst = (Screen*)lua_topointer(L, 1);
+	lua_pushnumber(L, inst->getYCoordinateSize());
+	return 1;
+}
+
+static int Polycore_Screen_getRootEntity(lua_State *L) {
+	luaL_checktype(L, 1, LUA_TLIGHTUSERDATA);
+	Screen *inst = (Screen*)lua_topointer(L, 1);
+	lua_pushlightuserdata(L, (void*)inst->getRootEntity());
+	return 1;
+}
+
+static int Polycore_ScreenCurve(lua_State *L) {
+	luaL_checktype(L, 1, LUA_TLIGHTUSERDATA);
+	BezierCurve * curve = (BezierCurve *)lua_topointer(L, 1);
+	luaL_checktype(L, 2, LUA_TNUMBER);
+	int numVertices = lua_tointeger(L, 2);
+	ScreenCurve *inst = new ScreenCurve(curve, numVertices);
+	lua_pushlightuserdata(L, (void*)inst);
+	return 1;
+}
+
+static int Polycore_ScreenEntity(lua_State *L) {
+	ScreenEntity *inst = new ScreenEntity();
+	lua_pushlightuserdata(L, (void*)inst);
+	return 1;
+}
+
+static int Polycore_ScreenEntity_setPosition(lua_State *L) {
+	luaL_checktype(L, 1, LUA_TLIGHTUSERDATA);
+	ScreenEntity *inst = (ScreenEntity*)lua_topointer(L, 1);
+	luaL_checktype(L, 2, LUA_TNUMBER);
+	Number x = lua_tonumber(L, 2);
+	luaL_checktype(L, 3, LUA_TNUMBER);
+	Number y = lua_tonumber(L, 3);
+	inst->setPosition(x, y);
+	return 0;
+}
+
+static int Polycore_ScreenEntity_setScale(lua_State *L) {
+	luaL_checktype(L, 1, LUA_TLIGHTUSERDATA);
+	ScreenEntity *inst = (ScreenEntity*)lua_topointer(L, 1);
+	luaL_checktype(L, 2, LUA_TNUMBER);
+	Number x = lua_tonumber(L, 2);
+	luaL_checktype(L, 3, LUA_TNUMBER);
+	Number y = lua_tonumber(L, 3);
+	inst->setScale(x, y);
+	return 0;
+}
+
+static int Polycore_ScreenEntity_setRotation(lua_State *L) {
+	luaL_checktype(L, 1, LUA_TLIGHTUSERDATA);
+	ScreenEntity *inst = (ScreenEntity*)lua_topointer(L, 1);
+	luaL_checktype(L, 2, LUA_TNUMBER);
+	Number roatation = lua_tonumber(L, 2);
+	inst->setRotation(roatation);
+	return 0;
+}
+
+static int Polycore_ScreenEntity_getRotation(lua_State *L) {
+	luaL_checktype(L, 1, LUA_TLIGHTUSERDATA);
+	ScreenEntity *inst = (ScreenEntity*)lua_topointer(L, 1);
+	lua_pushnumber(L, inst->getRotation());
+	return 1;
+}
+
+static int Polycore_ScreenEntity__onMouseDown(lua_State *L) {
+	luaL_checktype(L, 1, LUA_TLIGHTUSERDATA);
+	ScreenEntity *inst = (ScreenEntity*)lua_topointer(L, 1);
+	luaL_checktype(L, 2, LUA_TNUMBER);
+	Number x = lua_tonumber(L, 2);
+	luaL_checktype(L, 3, LUA_TNUMBER);
+	Number y = lua_tonumber(L, 3);
+	luaL_checktype(L, 4, LUA_TNUMBER);
+	int mouseButton = lua_tointeger(L, 4);
+	luaL_checktype(L, 5, LUA_TNUMBER);
+	int timestamp = lua_tointeger(L, 5);
+	lua_pushboolean(L, inst->_onMouseDown(x, y, mouseButton, timestamp));
+	return 1;
+}
+
+static int Polycore_ScreenEntity__onMouseUp(lua_State *L) {
+	luaL_checktype(L, 1, LUA_TLIGHTUSERDATA);
+	ScreenEntity *inst = (ScreenEntity*)lua_topointer(L, 1);
+	luaL_checktype(L, 2, LUA_TNUMBER);
+	Number x = lua_tonumber(L, 2);
+	luaL_checktype(L, 3, LUA_TNUMBER);
+	Number y = lua_tonumber(L, 3);
+	luaL_checktype(L, 4, LUA_TNUMBER);
+	int mouseButton = lua_tointeger(L, 4);
+	luaL_checktype(L, 5, LUA_TNUMBER);
+	int timestamp = lua_tointeger(L, 5);
+	lua_pushboolean(L, inst->_onMouseUp(x, y, mouseButton, timestamp));
+	return 1;
+}
+
+static int Polycore_ScreenEntity__onMouseMove(lua_State *L) {
+	luaL_checktype(L, 1, LUA_TLIGHTUSERDATA);
+	ScreenEntity *inst = (ScreenEntity*)lua_topointer(L, 1);
+	luaL_checktype(L, 2, LUA_TNUMBER);
+	Number x = lua_tonumber(L, 2);
+	luaL_checktype(L, 3, LUA_TNUMBER);
+	Number y = lua_tonumber(L, 3);
+	luaL_checktype(L, 4, LUA_TNUMBER);
+	int timestamp = lua_tointeger(L, 4);
+	inst->_onMouseMove(x, y, timestamp);
+	return 0;
+}
+
+static int Polycore_ScreenEntity__onMouseWheelUp(lua_State *L) {
+	luaL_checktype(L, 1, LUA_TLIGHTUSERDATA);
+	ScreenEntity *inst = (ScreenEntity*)lua_topointer(L, 1);
+	luaL_checktype(L, 2, LUA_TNUMBER);
+	Number x = lua_tonumber(L, 2);
+	luaL_checktype(L, 3, LUA_TNUMBER);
+	Number y = lua_tonumber(L, 3);
+	luaL_checktype(L, 4, LUA_TNUMBER);
+	int timestamp = lua_tointeger(L, 4);
+	inst->_onMouseWheelUp(x, y, timestamp);
+	return 0;
+}
+
+static int Polycore_ScreenEntity__onMouseWheelDown(lua_State *L) {
+	luaL_checktype(L, 1, LUA_TLIGHTUSERDATA);
+	ScreenEntity *inst = (ScreenEntity*)lua_topointer(L, 1);
+	luaL_checktype(L, 2, LUA_TNUMBER);
+	Number x = lua_tonumber(L, 2);
+	luaL_checktype(L, 3, LUA_TNUMBER);
+	Number y = lua_tonumber(L, 3);
+	luaL_checktype(L, 4, LUA_TNUMBER);
+	int timestamp = lua_tointeger(L, 4);
+	inst->_onMouseWheelDown(x, y, timestamp);
+	return 0;
+}
+
+static int Polycore_ScreenEntity_onMouseDown(lua_State *L) {
+	luaL_checktype(L, 1, LUA_TLIGHTUSERDATA);
+	ScreenEntity *inst = (ScreenEntity*)lua_topointer(L, 1);
+	luaL_checktype(L, 2, LUA_TNUMBER);
+	Number x = lua_tonumber(L, 2);
+	luaL_checktype(L, 3, LUA_TNUMBER);
+	Number y = lua_tonumber(L, 3);
+	inst->onMouseDown(x, y);
+	return 0;
+}
+
+static int Polycore_ScreenEntity_onMouseUp(lua_State *L) {
+	luaL_checktype(L, 1, LUA_TLIGHTUSERDATA);
+	ScreenEntity *inst = (ScreenEntity*)lua_topointer(L, 1);
+	luaL_checktype(L, 2, LUA_TNUMBER);
+	Number x = lua_tonumber(L, 2);
+	luaL_checktype(L, 3, LUA_TNUMBER);
+	Number y = lua_tonumber(L, 3);
+	inst->onMouseUp(x, y);
+	return 0;
+}
+
+static int Polycore_ScreenEntity_onMouseMove(lua_State *L) {
+	luaL_checktype(L, 1, LUA_TLIGHTUSERDATA);
+	ScreenEntity *inst = (ScreenEntity*)lua_topointer(L, 1);
+	luaL_checktype(L, 2, LUA_TNUMBER);
+	Number x = lua_tonumber(L, 2);
+	luaL_checktype(L, 3, LUA_TNUMBER);
+	Number y = lua_tonumber(L, 3);
+	inst->onMouseMove(x, y);
+	return 0;
+}
+
+static int Polycore_ScreenEntity_onMouseWheelUp(lua_State *L) {
+	luaL_checktype(L, 1, LUA_TLIGHTUSERDATA);
+	ScreenEntity *inst = (ScreenEntity*)lua_topointer(L, 1);
+	luaL_checktype(L, 2, LUA_TNUMBER);
+	Number x = lua_tonumber(L, 2);
+	luaL_checktype(L, 3, LUA_TNUMBER);
+	Number y = lua_tonumber(L, 3);
+	inst->onMouseWheelUp(x, y);
+	return 0;
+}
+
+static int Polycore_ScreenEntity_onMouseWheelDown(lua_State *L) {
+	luaL_checktype(L, 1, LUA_TLIGHTUSERDATA);
+	ScreenEntity *inst = (ScreenEntity*)lua_topointer(L, 1);
+	luaL_checktype(L, 2, LUA_TNUMBER);
+	Number x = lua_tonumber(L, 2);
+	luaL_checktype(L, 3, LUA_TNUMBER);
+	Number y = lua_tonumber(L, 3);
+	inst->onMouseWheelDown(x, y);
+	return 0;
+}
+
+static int Polycore_ScreenEntity__onKeyDown(lua_State *L) {
+	luaL_checktype(L, 1, LUA_TLIGHTUSERDATA);
+	ScreenEntity *inst = (ScreenEntity*)lua_topointer(L, 1);
+	luaL_checktype(L, 2, LUA_TLIGHTUSERDATA);
+	TAUKey key = *(TAUKey*)lua_topointer(L, 2);
+	luaL_checktype(L, 3, LUA_TLIGHTUSERDATA);
+	wchar_t charCode = *(wchar_t*)lua_topointer(L, 3);
+	inst->_onKeyDown(key, charCode);
+	return 0;
+}
+
+static int Polycore_ScreenEntity__onKeyUp(lua_State *L) {
+	luaL_checktype(L, 1, LUA_TLIGHTUSERDATA);
+	ScreenEntity *inst = (ScreenEntity*)lua_topointer(L, 1);
+	luaL_checktype(L, 2, LUA_TLIGHTUSERDATA);
+	TAUKey key = *(TAUKey*)lua_topointer(L, 2);
+	luaL_checktype(L, 3, LUA_TLIGHTUSERDATA);
+	wchar_t charCode = *(wchar_t*)lua_topointer(L, 3);
+	inst->_onKeyUp(key, charCode);
+	return 0;
+}
+
+static int Polycore_ScreenEntity_onKeyDown(lua_State *L) {
+	luaL_checktype(L, 1, LUA_TLIGHTUSERDATA);
+	ScreenEntity *inst = (ScreenEntity*)lua_topointer(L, 1);
+	luaL_checktype(L, 2, LUA_TLIGHTUSERDATA);
+	TAUKey key = *(TAUKey*)lua_topointer(L, 2);
+	luaL_checktype(L, 3, LUA_TLIGHTUSERDATA);
+	wchar_t charCode = *(wchar_t*)lua_topointer(L, 3);
+	inst->onKeyDown(key, charCode);
+	return 0;
+}
+
+static int Polycore_ScreenEntity_onKeyUp(lua_State *L) {
+	luaL_checktype(L, 1, LUA_TLIGHTUSERDATA);
+	ScreenEntity *inst = (ScreenEntity*)lua_topointer(L, 1);
+	luaL_checktype(L, 2, LUA_TLIGHTUSERDATA);
+	TAUKey key = *(TAUKey*)lua_topointer(L, 2);
+	luaL_checktype(L, 3, LUA_TLIGHTUSERDATA);
+	wchar_t charCode = *(wchar_t*)lua_topointer(L, 3);
+	inst->onKeyUp(key, charCode);
+	return 0;
+}
+
+static int Polycore_ScreenEntity_hitTest(lua_State *L) {
+	luaL_checktype(L, 1, LUA_TLIGHTUSERDATA);
+	ScreenEntity *inst = (ScreenEntity*)lua_topointer(L, 1);
+	luaL_checktype(L, 2, LUA_TNUMBER);
+	Number x = lua_tonumber(L, 2);
+	luaL_checktype(L, 3, LUA_TNUMBER);
+	Number y = lua_tonumber(L, 3);
+	lua_pushboolean(L, inst->hitTest(x, y));
+	return 1;
+}
+
+static int Polycore_ScreenEntity_buildPositionMatrix(lua_State *L) {
+	luaL_checktype(L, 1, LUA_TLIGHTUSERDATA);
+	ScreenEntity *inst = (ScreenEntity*)lua_topointer(L, 1);
+	Matrix4 *retInst = new Matrix4();
+	*retInst = inst->buildPositionMatrix();
+	lua_pushlightuserdata(L, retInst);
+	return 1;
+}
+
+static int Polycore_ScreenEntity_adjustMatrixForChildren(lua_State *L) {
+	luaL_checktype(L, 1, LUA_TLIGHTUSERDATA);
+	ScreenEntity *inst = (ScreenEntity*)lua_topointer(L, 1);
+	inst->adjustMatrixForChildren();
+	return 0;
+}
+
+static int Polycore_ScreenEntity_getWidth(lua_State *L) {
+	luaL_checktype(L, 1, LUA_TLIGHTUSERDATA);
+	ScreenEntity *inst = (ScreenEntity*)lua_topointer(L, 1);
+	lua_pushnumber(L, inst->getWidth());
+	return 1;
+}
+
+static int Polycore_ScreenEntity_getHeight(lua_State *L) {
+	luaL_checktype(L, 1, LUA_TLIGHTUSERDATA);
+	ScreenEntity *inst = (ScreenEntity*)lua_topointer(L, 1);
+	lua_pushnumber(L, inst->getHeight());
+	return 1;
+}
+
+static int Polycore_ScreenEntity_setWidth(lua_State *L) {
+	luaL_checktype(L, 1, LUA_TLIGHTUSERDATA);
+	ScreenEntity *inst = (ScreenEntity*)lua_topointer(L, 1);
+	luaL_checktype(L, 2, LUA_TNUMBER);
+	Number w = lua_tonumber(L, 2);
+	inst->setWidth(w);
+	return 0;
+}
+
+static int Polycore_ScreenEntity_setHeight(lua_State *L) {
+	luaL_checktype(L, 1, LUA_TLIGHTUSERDATA);
+	ScreenEntity *inst = (ScreenEntity*)lua_topointer(L, 1);
+	luaL_checktype(L, 2, LUA_TNUMBER);
+	Number h = lua_tonumber(L, 2);
+	inst->setHeight(h);
+	return 0;
+}
+
+static int Polycore_ScreenEntity_onGainFocus(lua_State *L) {
+	luaL_checktype(L, 1, LUA_TLIGHTUSERDATA);
+	ScreenEntity *inst = (ScreenEntity*)lua_topointer(L, 1);
+	inst->onGainFocus();
+	return 0;
+}
+
+static int Polycore_ScreenEntity_onLoseFocus(lua_State *L) {
+	luaL_checktype(L, 1, LUA_TLIGHTUSERDATA);
+	ScreenEntity *inst = (ScreenEntity*)lua_topointer(L, 1);
+	inst->onLoseFocus();
+	return 0;
+}
+
+static int Polycore_ScreenEntity_startDrag(lua_State *L) {
+	luaL_checktype(L, 1, LUA_TLIGHTUSERDATA);
+	ScreenEntity *inst = (ScreenEntity*)lua_topointer(L, 1);
+	luaL_checktype(L, 2, LUA_TNUMBER);
+	Number xOffset = lua_tonumber(L, 2);
+	luaL_checktype(L, 3, LUA_TNUMBER);
+	Number yOffset = lua_tonumber(L, 3);
+	inst->startDrag(xOffset, yOffset);
+	return 0;
+}
+
+static int Polycore_ScreenEntity_stopDrag(lua_State *L) {
+	luaL_checktype(L, 1, LUA_TLIGHTUSERDATA);
+	ScreenEntity *inst = (ScreenEntity*)lua_topointer(L, 1);
+	inst->stopDrag();
+	return 0;
+}
+
+static int Polycore_ScreenEntity_setBlendingMode(lua_State *L) {
+	luaL_checktype(L, 1, LUA_TLIGHTUSERDATA);
+	ScreenEntity *inst = (ScreenEntity*)lua_topointer(L, 1);
+	luaL_checktype(L, 2, LUA_TNUMBER);
+	int newBl_endingMode = lua_tointeger(L, 2);
+	inst->setBlendingMode(newBl_endingMode);
+	return 0;
+}
+
+static int Polycore_ScreenEntity_setPositionMode(lua_State *L) {
+	luaL_checktype(L, 1, LUA_TLIGHTUSERDATA);
+	ScreenEntity *inst = (ScreenEntity*)lua_topointer(L, 1);
+	luaL_checktype(L, 2, LUA_TNUMBER);
+	int newPositionMode = lua_tointeger(L, 2);
+	inst->setPositionMode(newPositionMode);
+	return 0;
+}
+
+static int Polycore_ScreenEntity_setDragLimits(lua_State *L) {
+	luaL_checktype(L, 1, LUA_TLIGHTUSERDATA);
+	ScreenEntity *inst = (ScreenEntity*)lua_topointer(L, 1);
+	luaL_checktype(L, 2, LUA_TLIGHTUSERDATA);
+	Rectangle rect = *(Rectangle*)lua_topointer(L, 2);
+	inst->setDragLimits(rect);
+	return 0;
+}
+
+static int Polycore_ScreenEntity_clearDragLimits(lua_State *L) {
+	luaL_checktype(L, 1, LUA_TLIGHTUSERDATA);
+	ScreenEntity *inst = (ScreenEntity*)lua_topointer(L, 1);
+	inst->clearDragLimits();
+	return 0;
+}
+
+static int Polycore_ScreenEntity_focusChild(lua_State *L) {
+	luaL_checktype(L, 1, LUA_TLIGHTUSERDATA);
+	ScreenEntity *inst = (ScreenEntity*)lua_topointer(L, 1);
+	luaL_checktype(L, 2, LUA_TLIGHTUSERDATA);
+	ScreenEntity * child = (ScreenEntity *)lua_topointer(L, 2);
+	inst->focusChild(child);
+	return 0;
+}
+
+static int Polycore_ScreenEntity_focusNextChild(lua_State *L) {
+	luaL_checktype(L, 1, LUA_TLIGHTUSERDATA);
+	ScreenEntity *inst = (ScreenEntity*)lua_topointer(L, 1);
+	inst->focusNextChild();
+	return 0;
+}
+
+static int Polycore_ScreenEntity_getPosition2D(lua_State *L) {
+	luaL_checktype(L, 1, LUA_TLIGHTUSERDATA);
+	ScreenEntity *inst = (ScreenEntity*)lua_topointer(L, 1);
+	Vector2 *retInst = new Vector2();
+	*retInst = inst->getPosition2D();
+	lua_pushlightuserdata(L, retInst);
+	return 1;
+}
+
+static int Polycore_ScreenEntity_isFocusable(lua_State *L) {
+	luaL_checktype(L, 1, LUA_TLIGHTUSERDATA);
+	ScreenEntity *inst = (ScreenEntity*)lua_topointer(L, 1);
+	lua_pushboolean(L, inst->isFocusable());
+	return 1;
+}
+
+static int Polycore_ScreenEvent(lua_State *L) {
+	ScreenEvent *inst = new ScreenEvent();
+	lua_pushlightuserdata(L, (void*)inst);
+	return 1;
+}
+
+static int Polycore_ScreenImage(lua_State *L) {
+	luaL_checktype(L, 1, LUA_TSTRING);
+	String fileName = lua_tostring(L, 1);
+	ScreenImage *inst = new ScreenImage(fileName);
+	lua_pushlightuserdata(L, (void*)inst);
+	return 1;
+}
+
+static int Polycore_ScreenImage_setImageCoordinates(lua_State *L) {
+	luaL_checktype(L, 1, LUA_TLIGHTUSERDATA);
+	ScreenImage *inst = (ScreenImage*)lua_topointer(L, 1);
+	luaL_checktype(L, 2, LUA_TNUMBER);
+	Number x = lua_tonumber(L, 2);
+	luaL_checktype(L, 3, LUA_TNUMBER);
+	Number y = lua_tonumber(L, 3);
+	luaL_checktype(L, 4, LUA_TNUMBER);
+	Number width = lua_tonumber(L, 4);
+	luaL_checktype(L, 5, LUA_TNUMBER);
+	Number height = lua_tonumber(L, 5);
+	inst->setImageCoordinates(x, y, width, height);
+	return 0;
+}
+
+static int Polycore_ScreenImage_getImageWidth(lua_State *L) {
+	luaL_checktype(L, 1, LUA_TLIGHTUSERDATA);
+	ScreenImage *inst = (ScreenImage*)lua_topointer(L, 1);
+	lua_pushnumber(L, inst->getImageWidth());
+	return 1;
+}
+
+static int Polycore_ScreenImage_getImageHeight(lua_State *L) {
+	luaL_checktype(L, 1, LUA_TLIGHTUSERDATA);
+	ScreenImage *inst = (ScreenImage*)lua_topointer(L, 1);
+	lua_pushnumber(L, inst->getImageHeight());
+	return 1;
+}
+
+static int Polycore_ScreenLabel(lua_State *L) {
+	luaL_checktype(L, 1, LUA_TSTRING);
+	String fontName = lua_tostring(L, 1);
+	luaL_checktype(L, 2, LUA_TSTRING);
+	String text = lua_tostring(L, 2);
+	luaL_checktype(L, 3, LUA_TNUMBER);
+	int size = lua_tointeger(L, 3);
+	luaL_checktype(L, 4, LUA_TNUMBER);
+	int amode = lua_tointeger(L, 4);
+	ScreenLabel *inst = new ScreenLabel(fontName, text, size, amode);
+	lua_pushlightuserdata(L, (void*)inst);
+	return 1;
+}
+
+static int Polycore_ScreenLabel_addDropShadow(lua_State *L) {
+	luaL_checktype(L, 1, LUA_TLIGHTUSERDATA);
+	ScreenLabel *inst = (ScreenLabel*)lua_topointer(L, 1);
+	luaL_checktype(L, 2, LUA_TLIGHTUSERDATA);
+	Color color = *(Color*)lua_topointer(L, 2);
+	luaL_checktype(L, 3, LUA_TNUMBER);
+	Number size = lua_tonumber(L, 3);
+	luaL_checktype(L, 4, LUA_TNUMBER);
+	Number offsetX = lua_tonumber(L, 4);
+	luaL_checktype(L, 5, LUA_TNUMBER);
+	Number offsetY = lua_tonumber(L, 5);
+	inst->addDropShadow(color, size, offsetX, offsetY);
+	return 0;
+}
+
+static int Polycore_ScreenLabel_setText(lua_State *L) {
+	luaL_checktype(L, 1, LUA_TLIGHTUSERDATA);
+	ScreenLabel *inst = (ScreenLabel*)lua_topointer(L, 1);
+	luaL_checktype(L, 2, LUA_TSTRING);
+	String newText = lua_tostring(L, 2);
+	inst->setText(newText);
+	return 0;
+}
+
+static int Polycore_ScreenLabel_getText(lua_State *L) {
+	luaL_checktype(L, 1, LUA_TLIGHTUSERDATA);
+	ScreenLabel *inst = (ScreenLabel*)lua_topointer(L, 1);
+	lua_pushstring(L, inst->getText().c_str());
+	return 1;
+}
+
+static int Polycore_ScreenLabel_getLabel(lua_State *L) {
+	luaL_checktype(L, 1, LUA_TLIGHTUSERDATA);
+	ScreenLabel *inst = (ScreenLabel*)lua_topointer(L, 1);
+	lua_pushlightuserdata(L, (void*)inst->getLabel());
+	return 1;
+}
+
+static int Polycore_ScreenLine(lua_State *L) {
+	luaL_checktype(L, 1, LUA_TLIGHTUSERDATA);
+	Vector2 * start = (Vector2 *)lua_topointer(L, 1);
+	luaL_checktype(L, 2, LUA_TLIGHTUSERDATA);
+	Vector2 * _end = (Vector2 *)lua_topointer(L, 2);
+	ScreenLine *inst = new ScreenLine(start, _end);
+	lua_pushlightuserdata(L, (void*)inst);
+	return 1;
+}
+
+static int Polycore_ScreenLine_Update(lua_State *L) {
+	luaL_checktype(L, 1, LUA_TLIGHTUSERDATA);
+	ScreenLine *inst = (ScreenLine*)lua_topointer(L, 1);
+	inst->Update();
+	return 0;
+}
+
+static int Polycore_ScreenLine_Render(lua_State *L) {
+	luaL_checktype(L, 1, LUA_TLIGHTUSERDATA);
+	ScreenLine *inst = (ScreenLine*)lua_topointer(L, 1);
+	inst->Render();
+	return 0;
+}
+
+static int Polycore_ScreenLine_setLineWidth(lua_State *L) {
+	luaL_checktype(L, 1, LUA_TLIGHTUSERDATA);
+	ScreenLine *inst = (ScreenLine*)lua_topointer(L, 1);
+	luaL_checktype(L, 2, LUA_TNUMBER);
+	Number width = lua_tonumber(L, 2);
+	inst->setLineWidth(width);
+	return 0;
+}
+
+static int Polycore_ScreenManager(lua_State *L) {
+	ScreenManager *inst = new ScreenManager();
+	lua_pushlightuserdata(L, (void*)inst);
+	return 1;
+}
+
+static int Polycore_ScreenManager_removeScreen(lua_State *L) {
+	luaL_checktype(L, 1, LUA_TLIGHTUSERDATA);
+	ScreenManager *inst = (ScreenManager*)lua_topointer(L, 1);
+	luaL_checktype(L, 2, LUA_TLIGHTUSERDATA);
+	Screen * screen = (Screen *)lua_topointer(L, 2);
+	inst->removeScreen(screen);
+	return 0;
+}
+
+static int Polycore_ScreenManager_addScreen(lua_State *L) {
+	luaL_checktype(L, 1, LUA_TLIGHTUSERDATA);
+	ScreenManager *inst = (ScreenManager*)lua_topointer(L, 1);
+	luaL_checktype(L, 2, LUA_TLIGHTUSERDATA);
+	Screen * screen = (Screen *)lua_topointer(L, 2);
+	inst->addScreen(screen);
+	return 0;
+}
+
+static int Polycore_ScreenManager_Update(lua_State *L) {
+	luaL_checktype(L, 1, LUA_TLIGHTUSERDATA);
+	ScreenManager *inst = (ScreenManager*)lua_topointer(L, 1);
+	inst->Update();
+	return 0;
+}
+
+static int Polycore_ScreenManager_handleEvent(lua_State *L) {
+	luaL_checktype(L, 1, LUA_TLIGHTUSERDATA);
+	ScreenManager *inst = (ScreenManager*)lua_topointer(L, 1);
+	luaL_checktype(L, 2, LUA_TLIGHTUSERDATA);
+	Event * event = (Event *)lua_topointer(L, 2);
+	inst->handleEvent(event);
+	return 0;
+}
+
+static int Polycore_ScreenMesh(lua_State *L) {
+	luaL_checktype(L, 1, LUA_TSTRING);
+	String fileName = lua_tostring(L, 1);
+	ScreenMesh *inst = new ScreenMesh(fileName);
+	lua_pushlightuserdata(L, (void*)inst);
+	return 1;
+}
+
+static int Polycore_ScreenMesh_Render(lua_State *L) {
+	luaL_checktype(L, 1, LUA_TLIGHTUSERDATA);
+	ScreenMesh *inst = (ScreenMesh*)lua_topointer(L, 1);
+	inst->Render();
+	return 0;
+}
+
+static int Polycore_ScreenMesh_getMesh(lua_State *L) {
+	luaL_checktype(L, 1, LUA_TLIGHTUSERDATA);
+	ScreenMesh *inst = (ScreenMesh*)lua_topointer(L, 1);
+	lua_pushlightuserdata(L, (void*)inst->getMesh());
+	return 1;
+}
+
+static int Polycore_ScreenMesh_getTexture(lua_State *L) {
+	luaL_checktype(L, 1, LUA_TLIGHTUSERDATA);
+	ScreenMesh *inst = (ScreenMesh*)lua_topointer(L, 1);
+	lua_pushlightuserdata(L, (void*)inst->getTexture());
+	return 1;
+}
+
+static int Polycore_ScreenMesh_loadTexture(lua_State *L) {
+	luaL_checktype(L, 1, LUA_TLIGHTUSERDATA);
+	ScreenMesh *inst = (ScreenMesh*)lua_topointer(L, 1);
+	luaL_checktype(L, 2, LUA_TSTRING);
+	String fileName = lua_tostring(L, 2);
+	inst->loadTexture(fileName);
+	return 0;
+}
+
+static int Polycore_ScreenMesh_setTexture(lua_State *L) {
+	luaL_checktype(L, 1, LUA_TLIGHTUSERDATA);
+	ScreenMesh *inst = (ScreenMesh*)lua_topointer(L, 1);
+	luaL_checktype(L, 2, LUA_TLIGHTUSERDATA);
+	Texture * texture = (Texture *)lua_topointer(L, 2);
+	inst->setTexture(texture);
+	return 0;
+}
+
+static int Polycore_ScreenShape(lua_State *L) {
+	luaL_checktype(L, 1, LUA_TNUMBER);
+	int shapeType = lua_tointeger(L, 1);
+	luaL_checktype(L, 2, LUA_TNUMBER);
+	Number option1 = lua_tonumber(L, 2);
+	luaL_checktype(L, 3, LUA_TNUMBER);
+	Number option2 = lua_tonumber(L, 3);
+	luaL_checktype(L, 4, LUA_TNUMBER);
+	Number option3 = lua_tonumber(L, 4);
+	luaL_checktype(L, 5, LUA_TNUMBER);
+	Number option4 = lua_tonumber(L, 5);
+	ScreenShape *inst = new ScreenShape(shapeType, option1, option2, option3, option4);
+	lua_pushlightuserdata(L, (void*)inst);
+	return 1;
+}
+
+static int Polycore_ScreenShape_Render(lua_State *L) {
+	luaL_checktype(L, 1, LUA_TLIGHTUSERDATA);
+	ScreenShape *inst = (ScreenShape*)lua_topointer(L, 1);
+	inst->Render();
+	return 0;
+}
+
+static int Polycore_ScreenShape_setStrokeColor(lua_State *L) {
+	luaL_checktype(L, 1, LUA_TLIGHTUSERDATA);
+	ScreenShape *inst = (ScreenShape*)lua_topointer(L, 1);
+	luaL_checktype(L, 2, LUA_TNUMBER);
+	Number r = lua_tonumber(L, 2);
+	luaL_checktype(L, 3, LUA_TNUMBER);
+	Number g = lua_tonumber(L, 3);
+	luaL_checktype(L, 4, LUA_TNUMBER);
+	Number b = lua_tonumber(L, 4);
+	luaL_checktype(L, 5, LUA_TNUMBER);
+	Number a = lua_tonumber(L, 5);
+	inst->setStrokeColor(r, g, b, a);
+	return 0;
+}
+
+static int Polycore_ScreenShape_setStrokeWidth(lua_State *L) {
+	luaL_checktype(L, 1, LUA_TLIGHTUSERDATA);
+	ScreenShape *inst = (ScreenShape*)lua_topointer(L, 1);
+	luaL_checktype(L, 2, LUA_TNUMBER);
+	Number width = lua_tonumber(L, 2);
+	inst->setStrokeWidth(width);
+	return 0;
+}
+
+static int Polycore_ScreenShape_setGradient(lua_State *L) {
+	luaL_checktype(L, 1, LUA_TLIGHTUSERDATA);
+	ScreenShape *inst = (ScreenShape*)lua_topointer(L, 1);
+	luaL_checktype(L, 2, LUA_TNUMBER);
+	Number r1 = lua_tonumber(L, 2);
+	luaL_checktype(L, 3, LUA_TNUMBER);
+	Number g1 = lua_tonumber(L, 3);
+	luaL_checktype(L, 4, LUA_TNUMBER);
+	Number b1 = lua_tonumber(L, 4);
+	luaL_checktype(L, 5, LUA_TNUMBER);
+	Number a1 = lua_tonumber(L, 5);
+	luaL_checktype(L, 6, LUA_TNUMBER);
+	Number r2 = lua_tonumber(L, 6);
+	luaL_checktype(L, 7, LUA_TNUMBER);
+	Number g2 = lua_tonumber(L, 7);
+	luaL_checktype(L, 8, LUA_TNUMBER);
+	Number b2 = lua_tonumber(L, 8);
+	luaL_checktype(L, 9, LUA_TNUMBER);
+	Number a2 = lua_tonumber(L, 9);
+	inst->setGradient(r1, g1, b1, a1, r2, g2, b2, a2);
+	return 0;
+}
+
+static int Polycore_ScreenShape_clearGradient(lua_State *L) {
+	luaL_checktype(L, 1, LUA_TLIGHTUSERDATA);
+	ScreenShape *inst = (ScreenShape*)lua_topointer(L, 1);
+	inst->clearGradient();
+	return 0;
+}
+
+static int Polycore_ScreenShape_setShapeSize(lua_State *L) {
+	luaL_checktype(L, 1, LUA_TLIGHTUSERDATA);
+	ScreenShape *inst = (ScreenShape*)lua_topointer(L, 1);
+	luaL_checktype(L, 2, LUA_TNUMBER);
+	Number newWidth = lua_tonumber(L, 2);
+	luaL_checktype(L, 3, LUA_TNUMBER);
+	Number newHeight = lua_tonumber(L, 3);
+	inst->setShapeSize(newWidth, newHeight);
+	return 0;
+}
+
+static int Polycore_ScreenShape_addShapePoint(lua_State *L) {
+	luaL_checktype(L, 1, LUA_TLIGHTUSERDATA);
+	ScreenShape *inst = (ScreenShape*)lua_topointer(L, 1);
+	luaL_checktype(L, 2, LUA_TNUMBER);
+	Number x = lua_tonumber(L, 2);
+	luaL_checktype(L, 3, LUA_TNUMBER);
+	Number y = lua_tonumber(L, 3);
+	inst->addShapePoint(x, y);
+	return 0;
+}
+
+static int Polycore_ScreenSprite(lua_State *L) {
+	luaL_checktype(L, 1, LUA_TSTRING);
+	String fileName = lua_tostring(L, 1);
+	luaL_checktype(L, 2, LUA_TNUMBER);
+	Number spriteWidth = lua_tonumber(L, 2);
+	luaL_checktype(L, 3, LUA_TNUMBER);
+	Number spriteHeight = lua_tonumber(L, 3);
+	ScreenSprite *inst = new ScreenSprite(fileName, spriteWidth, spriteHeight);
+	lua_pushlightuserdata(L, (void*)inst);
+	return 1;
+}
+
+static int Polycore_ScreenSprite_addAnimation(lua_State *L) {
+	luaL_checktype(L, 1, LUA_TLIGHTUSERDATA);
+	ScreenSprite *inst = (ScreenSprite*)lua_topointer(L, 1);
+	luaL_checktype(L, 2, LUA_TSTRING);
+	String name = lua_tostring(L, 2);
+	luaL_checktype(L, 3, LUA_TSTRING);
+	String frames = lua_tostring(L, 3);
+	luaL_checktype(L, 4, LUA_TNUMBER);
+	Number speed = lua_tonumber(L, 4);
+	inst->addAnimation(name, frames, speed);
+	return 0;
+}
+
+static int Polycore_ScreenSprite_playAnimation(lua_State *L) {
+	luaL_checktype(L, 1, LUA_TLIGHTUSERDATA);
+	ScreenSprite *inst = (ScreenSprite*)lua_topointer(L, 1);
+	luaL_checktype(L, 2, LUA_TSTRING);
+	String name = lua_tostring(L, 2);
+	luaL_checktype(L, 3, LUA_TNUMBER);
+	int startFrame = lua_tointeger(L, 3);
+	luaL_checktype(L, 4, LUA_TBOOLEAN);
+	bool once = lua_toboolean(L, 4);
+	inst->playAnimation(name, startFrame, once);
+	return 0;
+}
+
+static int Polycore_ScreenSprite_Update(lua_State *L) {
+	luaL_checktype(L, 1, LUA_TLIGHTUSERDATA);
+	ScreenSprite *inst = (ScreenSprite*)lua_topointer(L, 1);
+	inst->Update();
+	return 0;
+}
+
+static int Polycore_SkeletonAnimation(lua_State *L) {
+	luaL_checktype(L, 1, LUA_TSTRING);
+	String name = lua_tostring(L, 1);
+	luaL_checktype(L, 2, LUA_TNUMBER);
+	Number duration = lua_tonumber(L, 2);
+	SkeletonAnimation *inst = new SkeletonAnimation(name, duration);
+	lua_pushlightuserdata(L, (void*)inst);
+	return 1;
+}
+
+static int Polycore_SkeletonAnimation_addBoneTrack(lua_State *L) {
+	luaL_checktype(L, 1, LUA_TLIGHTUSERDATA);
+	SkeletonAnimation *inst = (SkeletonAnimation*)lua_topointer(L, 1);
+	luaL_checktype(L, 2, LUA_TLIGHTUSERDATA);
+	BoneTrack * boneTrack = (BoneTrack *)lua_topointer(L, 2);
+	inst->addBoneTrack(boneTrack);
+	return 0;
+}
+
+static int Polycore_SkeletonAnimation_getName(lua_State *L) {
+	luaL_checktype(L, 1, LUA_TLIGHTUSERDATA);
+	SkeletonAnimation *inst = (SkeletonAnimation*)lua_topointer(L, 1);
+	lua_pushstring(L, inst->getName().c_str());
+	return 1;
+}
+
+static int Polycore_SkeletonAnimation_Play(lua_State *L) {
+	luaL_checktype(L, 1, LUA_TLIGHTUSERDATA);
+	SkeletonAnimation *inst = (SkeletonAnimation*)lua_topointer(L, 1);
+	inst->Play();
+	return 0;
+}
+
+static int Polycore_SkeletonAnimation_Stop(lua_State *L) {
+	luaL_checktype(L, 1, LUA_TLIGHTUSERDATA);
+	SkeletonAnimation *inst = (SkeletonAnimation*)lua_topointer(L, 1);
+	inst->Stop();
+	return 0;
+}
+
+static int Polycore_SkeletonAnimation_Update(lua_State *L) {
+	luaL_checktype(L, 1, LUA_TLIGHTUSERDATA);
+	SkeletonAnimation *inst = (SkeletonAnimation*)lua_topointer(L, 1);
+	inst->Update();
+	return 0;
+}
+
+static int Polycore_SkeletonAnimation_setSpeed(lua_State *L) {
+	luaL_checktype(L, 1, LUA_TLIGHTUSERDATA);
+	SkeletonAnimation *inst = (SkeletonAnimation*)lua_topointer(L, 1);
+	luaL_checktype(L, 2, LUA_TNUMBER);
+	Number speed = lua_tonumber(L, 2);
+	inst->setSpeed(speed);
+	return 0;
+}
+
+static int Polycore_Skeleton(lua_State *L) {
+	luaL_checktype(L, 1, LUA_TSTRING);
+	String fileName = lua_tostring(L, 1);
+	Skeleton *inst = new Skeleton(fileName);
+	lua_pushlightuserdata(L, (void*)inst);
+	return 1;
+}
+
+static int Polycore_Skeleton_loadSkeleton(lua_State *L) {
+	luaL_checktype(L, 1, LUA_TLIGHTUSERDATA);
+	Skeleton *inst = (Skeleton*)lua_topointer(L, 1);
+	luaL_checktype(L, 2, LUA_TSTRING);
+	String fileName = lua_tostring(L, 2);
+	inst->loadSkeleton(fileName);
+	return 0;
+}
+
+static int Polycore_Skeleton_playAnimation(lua_State *L) {
+	luaL_checktype(L, 1, LUA_TLIGHTUSERDATA);
+	Skeleton *inst = (Skeleton*)lua_topointer(L, 1);
+	luaL_checktype(L, 2, LUA_TSTRING);
+	String animName = lua_tostring(L, 2);
+	inst->playAnimation(animName);
+	return 0;
+}
+
+static int Polycore_Skeleton_playAnimationByIndex(lua_State *L) {
+	luaL_checktype(L, 1, LUA_TLIGHTUSERDATA);
+	Skeleton *inst = (Skeleton*)lua_topointer(L, 1);
+	luaL_checktype(L, 2, LUA_TNUMBER);
+	int index = lua_tointeger(L, 2);
+	inst->playAnimationByIndex(index);
+	return 0;
+}
+
+static int Polycore_Skeleton_addAnimation(lua_State *L) {
+	luaL_checktype(L, 1, LUA_TLIGHTUSERDATA);
+	Skeleton *inst = (Skeleton*)lua_topointer(L, 1);
+	luaL_checktype(L, 2, LUA_TSTRING);
+	String name = lua_tostring(L, 2);
+	luaL_checktype(L, 3, LUA_TSTRING);
+	String fileName = lua_tostring(L, 3);
+	inst->addAnimation(name, fileName);
+	return 0;
+}
+
+static int Polycore_Skeleton_getAnimation(lua_State *L) {
+	luaL_checktype(L, 1, LUA_TLIGHTUSERDATA);
+	Skeleton *inst = (Skeleton*)lua_topointer(L, 1);
+	luaL_checktype(L, 2, LUA_TSTRING);
+	String name = lua_tostring(L, 2);
+	lua_pushlightuserdata(L, (void*)inst->getAnimation(name));
+	return 1;
+}
+
+static int Polycore_Skeleton_Update(lua_State *L) {
+	luaL_checktype(L, 1, LUA_TLIGHTUSERDATA);
+	Skeleton *inst = (Skeleton*)lua_topointer(L, 1);
+	inst->Update();
+	return 0;
+}
+
+static int Polycore_Skeleton_getBoneByName(lua_State *L) {
+	luaL_checktype(L, 1, LUA_TLIGHTUSERDATA);
+	Skeleton *inst = (Skeleton*)lua_topointer(L, 1);
+	luaL_checktype(L, 2, LUA_TSTRING);
+	String name = lua_tostring(L, 2);
+	lua_pushlightuserdata(L, (void*)inst->getBoneByName(name));
+	return 1;
+}
+
+static int Polycore_Skeleton_bonesVisible(lua_State *L) {
+	luaL_checktype(L, 1, LUA_TLIGHTUSERDATA);
+	Skeleton *inst = (Skeleton*)lua_topointer(L, 1);
+	luaL_checktype(L, 2, LUA_TBOOLEAN);
+	bool val = lua_toboolean(L, 2);
+	inst->bonesVisible(val);
+	return 0;
+}
+
+static int Polycore_Skeleton_enableBoneLabels(lua_State *L) {
+	luaL_checktype(L, 1, LUA_TLIGHTUSERDATA);
+	Skeleton *inst = (Skeleton*)lua_topointer(L, 1);
+	luaL_checktype(L, 2, LUA_TSTRING);
+	String labelFont = lua_tostring(L, 2);
+	luaL_checktype(L, 3, LUA_TNUMBER);
+	Number size = lua_tonumber(L, 3);
+	luaL_checktype(L, 4, LUA_TNUMBER);
+	Number scale = lua_tonumber(L, 4);
+	luaL_checktype(L, 5, LUA_TLIGHTUSERDATA);
+	Color labelColor = *(Color*)lua_topointer(L, 5);
+	inst->enableBoneLabels(labelFont, size, scale, labelColor);
+	return 0;
+}
+
+static int Polycore_Skeleton_getNumBones(lua_State *L) {
+	luaL_checktype(L, 1, LUA_TLIGHTUSERDATA);
+	Skeleton *inst = (Skeleton*)lua_topointer(L, 1);
+	lua_pushinteger(L, inst->getNumBones());
+	return 1;
+}
+
+static int Polycore_Skeleton_getBone(lua_State *L) {
+	luaL_checktype(L, 1, LUA_TLIGHTUSERDATA);
+	Skeleton *inst = (Skeleton*)lua_topointer(L, 1);
+	luaL_checktype(L, 2, LUA_TNUMBER);
+	int index = lua_tointeger(L, 2);
+	lua_pushlightuserdata(L, (void*)inst->getBone(index));
+	return 1;
+}
+
+static int Polycore_Skeleton_getCurrentAnimation(lua_State *L) {
+	luaL_checktype(L, 1, LUA_TLIGHTUSERDATA);
+	Skeleton *inst = (Skeleton*)lua_topointer(L, 1);
+	lua_pushlightuserdata(L, (void*)inst->getCurrentAnimation());
+	return 1;
+}
+
+static int Polycore_BoneTrack(lua_State *L) {
+	luaL_checktype(L, 1, LUA_TLIGHTUSERDATA);
+	Bone * bone = (Bone *)lua_topointer(L, 1);
+	luaL_checktype(L, 2, LUA_TNUMBER);
+	Number length = lua_tonumber(L, 2);
+	BoneTrack *inst = new BoneTrack(bone, length);
+	lua_pushlightuserdata(L, (void*)inst);
+	return 1;
+}
+
+static int Polycore_BoneTrack_Play(lua_State *L) {
+	luaL_checktype(L, 1, LUA_TLIGHTUSERDATA);
+	BoneTrack *inst = (BoneTrack*)lua_topointer(L, 1);
+	inst->Play();
+	return 0;
+}
+
+static int Polycore_BoneTrack_Stop(lua_State *L) {
+	luaL_checktype(L, 1, LUA_TLIGHTUSERDATA);
+	BoneTrack *inst = (BoneTrack*)lua_topointer(L, 1);
+	inst->Stop();
+	return 0;
+}
+
+static int Polycore_BoneTrack_Update(lua_State *L) {
+	luaL_checktype(L, 1, LUA_TLIGHTUSERDATA);
+	BoneTrack *inst = (BoneTrack*)lua_topointer(L, 1);
+	inst->Update();
+	return 0;
+}
+
+static int Polycore_BoneTrack_setSpeed(lua_State *L) {
+	luaL_checktype(L, 1, LUA_TLIGHTUSERDATA);
+	BoneTrack *inst = (BoneTrack*)lua_topointer(L, 1);
+	luaL_checktype(L, 2, LUA_TNUMBER);
+	Number speed = lua_tonumber(L, 2);
+	inst->setSpeed(speed);
+	return 0;
+}
+
+static int Polycore_Sound(lua_State *L) {
+	luaL_checktype(L, 1, LUA_TSTRING);
+	String fileName = lua_tostring(L, 1);
+	Sound *inst = new Sound(fileName);
+	lua_pushlightuserdata(L, (void*)inst);
+	return 1;
+}
+
+static int Polycore_Sound_Play(lua_State *L) {
+	luaL_checktype(L, 1, LUA_TLIGHTUSERDATA);
+	Sound *inst = (Sound*)lua_topointer(L, 1);
+	luaL_checktype(L, 2, LUA_TBOOLEAN);
+	bool once = lua_toboolean(L, 2);
+	inst->Play(once);
+	return 0;
+}
+
+static int Polycore_Sound_Stop(lua_State *L) {
+	luaL_checktype(L, 1, LUA_TLIGHTUSERDATA);
+	Sound *inst = (Sound*)lua_topointer(L, 1);
+	inst->Stop();
+	return 0;
+}
+
+static int Polycore_Sound_loadWAV(lua_State *L) {
+	luaL_checktype(L, 1, LUA_TLIGHTUSERDATA);
+	Sound *inst = (Sound*)lua_topointer(L, 1);
+	luaL_checktype(L, 2, LUA_TSTRING);
+	String fileName = lua_tostring(L, 2);
+	ALuint *retInst = new ALuint();
+	*retInst = inst->loadWAV(fileName);
+	lua_pushlightuserdata(L, retInst);
+	return 1;
+}
+
+static int Polycore_Sound_loadOGG(lua_State *L) {
+	luaL_checktype(L, 1, LUA_TLIGHTUSERDATA);
+	Sound *inst = (Sound*)lua_topointer(L, 1);
+	luaL_checktype(L, 2, LUA_TSTRING);
+	String fileName = lua_tostring(L, 2);
+	ALuint *retInst = new ALuint();
+	*retInst = inst->loadOGG(fileName);
+	lua_pushlightuserdata(L, retInst);
+	return 1;
+}
+
+static int Polycore_Sound_GenSource(lua_State *L) {
+	luaL_checktype(L, 1, LUA_TLIGHTUSERDATA);
+	Sound *inst = (Sound*)lua_topointer(L, 1);
+	luaL_checktype(L, 2, LUA_TLIGHTUSERDATA);
+	ALuint buffer = *(ALuint*)lua_topointer(L, 2);
+	ALuint *retInst = new ALuint();
+	*retInst = inst->GenSource(buffer);
+	lua_pushlightuserdata(L, retInst);
+	return 1;
+}
+
+static int Polycore_Sound_checkALError(lua_State *L) {
+	luaL_checktype(L, 1, LUA_TLIGHTUSERDATA);
+	Sound *inst = (Sound*)lua_topointer(L, 1);
+	luaL_checktype(L, 2, LUA_TSTRING);
+	String operation = lua_tostring(L, 2);
+	inst->checkALError(operation);
+	return 0;
+}
+
+static int Polycore_Sound_soundError(lua_State *L) {
+	luaL_checktype(L, 1, LUA_TLIGHTUSERDATA);
+	Sound *inst = (Sound*)lua_topointer(L, 1);
+	luaL_checktype(L, 2, LUA_TSTRING);
+	String err = lua_tostring(L, 2);
+	inst->soundError(err);
+	return 0;
+}
+
+static int Polycore_Sound_soundCheck(lua_State *L) {
+	luaL_checktype(L, 1, LUA_TLIGHTUSERDATA);
+	Sound *inst = (Sound*)lua_topointer(L, 1);
+	luaL_checktype(L, 2, LUA_TBOOLEAN);
+	bool result = lua_toboolean(L, 2);
+	luaL_checktype(L, 3, LUA_TSTRING);
+	String err = lua_tostring(L, 3);
+	inst->soundCheck(result, err);
+	return 0;
+}
+
+static int Polycore_SoundManager(lua_State *L) {
+	SoundManager *inst = new SoundManager();
+	lua_pushlightuserdata(L, (void*)inst);
+	return 1;
+}
+
+static int Polycore_SoundManager_initAL(lua_State *L) {
+	luaL_checktype(L, 1, LUA_TLIGHTUSERDATA);
+	SoundManager *inst = (SoundManager*)lua_topointer(L, 1);
+	inst->initAL();
+	return 0;
+}
+
+static int Polycore_String(lua_State *L) {
+	String *inst = new String();
+	lua_pushlightuserdata(L, (void*)inst);
+	return 1;
+}
+
+static int Polycore_String_size(lua_State *L) {
+	luaL_checktype(L, 1, LUA_TLIGHTUSERDATA);
+	String *inst = (String*)lua_topointer(L, 1);
+	lua_pushinteger(L, inst->size());
+	return 1;
+}
+
+static int Polycore_String_length(lua_State *L) {
+	luaL_checktype(L, 1, LUA_TLIGHTUSERDATA);
+	String *inst = (String*)lua_topointer(L, 1);
+	lua_pushinteger(L, inst->length());
+	return 1;
+}
+
+static int Polycore_String_getSTLString(lua_State *L) {
+	luaL_checktype(L, 1, LUA_TLIGHTUSERDATA);
+	String *inst = (String*)lua_topointer(L, 1);
+	string *retInst = new string();
+	*retInst = inst->getSTLString();
+	lua_pushlightuserdata(L, retInst);
+	return 1;
+}
+
+static int Polycore_String_getSTLWString(lua_State *L) {
+	luaL_checktype(L, 1, LUA_TLIGHTUSERDATA);
+	String *inst = (String*)lua_topointer(L, 1);
+	wstring *retInst = new wstring();
+	*retInst = inst->getSTLWString();
+	lua_pushlightuserdata(L, retInst);
+	return 1;
+}
+
+static int Polycore_String_substr(lua_State *L) {
+	luaL_checktype(L, 1, LUA_TLIGHTUSERDATA);
+	String *inst = (String*)lua_topointer(L, 1);
+	luaL_checktype(L, 2, LUA_TLIGHTUSERDATA);
+	size_t pos = *(size_t*)lua_topointer(L, 2);
+	luaL_checktype(L, 3, LUA_TLIGHTUSERDATA);
+	size_t n = *(size_t*)lua_topointer(L, 3);
+	lua_pushstring(L, inst->substr(pos, n).c_str());
+	return 1;
+}
+
+static int Polycore_String_rfind(lua_State *L) {
+	luaL_checktype(L, 1, LUA_TLIGHTUSERDATA);
+	String *inst = (String*)lua_topointer(L, 1);
+	luaL_checktype(L, 2, LUA_TLIGHTUSERDATA);
+	const String & str = *( String *)lua_topointer(L, 2);
+	luaL_checktype(L, 3, LUA_TLIGHTUSERDATA);
+	size_t pos = *(size_t*)lua_topointer(L, 3);
+	lua_pushinteger(L, inst->rfind(str, pos));
+	return 1;
+}
+
+static int Polycore_String_find(lua_State *L) {
+	luaL_checktype(L, 1, LUA_TLIGHTUSERDATA);
+	String *inst = (String*)lua_topointer(L, 1);
+	luaL_checktype(L, 2, LUA_TLIGHTUSERDATA);
+	const String & str = *( String *)lua_topointer(L, 2);
+	luaL_checktype(L, 3, LUA_TLIGHTUSERDATA);
+	size_t pos = *(size_t*)lua_topointer(L, 3);
+	lua_pushinteger(L, inst->find(str, pos));
+	return 1;
+}
+
+static int Polycore_String_toLowerCase(lua_State *L) {
+	luaL_checktype(L, 1, LUA_TLIGHTUSERDATA);
+	String *inst = (String*)lua_topointer(L, 1);
+	lua_pushstring(L, inst->toLowerCase().c_str());
+	return 1;
+}
+
+static int Polycore_String_split(lua_State *L) {
+	luaL_checktype(L, 1, LUA_TLIGHTUSERDATA);
+	String *inst = (String*)lua_topointer(L, 1);
+	luaL_checktype(L, 2, LUA_TLIGHTUSERDATA);
+	const String & delims = *( String *)lua_topointer(L, 2);
+	vector <String > *retInst = new vector <String >();
+	*retInst = inst->split(delims);
+	lua_pushlightuserdata(L, retInst);
+	return 1;
+}
+
+static int Polycore_String_replace(lua_State *L) {
+	luaL_checktype(L, 1, LUA_TLIGHTUSERDATA);
+	String *inst = (String*)lua_topointer(L, 1);
+	luaL_checktype(L, 2, LUA_TLIGHTUSERDATA);
+	const String & what = *( String *)lua_topointer(L, 2);
+	luaL_checktype(L, 3, LUA_TLIGHTUSERDATA);
+	const String & withWhat = *( String *)lua_topointer(L, 3);
+	lua_pushstring(L, inst->replace(what, withWhat).c_str());
+	return 1;
+}
+
+static int Polycore_String_NumberToString(lua_State *L) {
+	luaL_checktype(L, 1, LUA_TLIGHTUSERDATA);
+	String *inst = (String*)lua_topointer(L, 1);
+	luaL_checktype(L, 2, LUA_TNUMBER);
+	Number value = lua_tonumber(L, 2);
+	lua_pushstring(L, inst->NumberToString(value).c_str());
+	return 1;
+}
+
+static int Polycore_String_c_str(lua_State *L) {
+	luaL_checktype(L, 1, LUA_TLIGHTUSERDATA);
+	String *inst = (String*)lua_topointer(L, 1);
+	lua_pushlightuserdata(L, (void*)inst->c_str());
+	return 1;
+}
+
+static int Polycore_String_wc_str(lua_State *L) {
+	luaL_checktype(L, 1, LUA_TLIGHTUSERDATA);
+	String *inst = (String*)lua_topointer(L, 1);
+	lua_pushlightuserdata(L, (void*)inst->wc_str());
+	return 1;
+}
+
+static int Polycore_String_data(lua_State *L) {
+	luaL_checktype(L, 1, LUA_TLIGHTUSERDATA);
+	String *inst = (String*)lua_topointer(L, 1);
+	lua_pushlightuserdata(L, (void*)inst->data());
+	return 1;
+}
+
+static int Polycore_String_getDataWithEncoding(lua_State *L) {
+	luaL_checktype(L, 1, LUA_TLIGHTUSERDATA);
+	String *inst = (String*)lua_topointer(L, 1);
+	luaL_checktype(L, 2, LUA_TNUMBER);
+	int encoding = lua_tointeger(L, 2);
+	lua_pushlightuserdata(L, (void*)inst->getDataWithEncoding(encoding));
+	return 1;
+}
+
+static int Polycore_String_setDataWithEncoding(lua_State *L) {
+	luaL_checktype(L, 1, LUA_TLIGHTUSERDATA);
+	String *inst = (String*)lua_topointer(L, 1);
+	luaL_checktype(L, 2, LUA_TLIGHTUSERDATA);
+	char * data = (char *)lua_topointer(L, 2);
+	luaL_checktype(L, 3, LUA_TNUMBER);
+	int encoding = lua_tointeger(L, 3);
+	inst->setDataWithEncoding(data, encoding);
+	return 0;
+}
+
+static int Polycore_String_getDataSizeWithEncoding(lua_State *L) {
+	luaL_checktype(L, 1, LUA_TLIGHTUSERDATA);
+	String *inst = (String*)lua_topointer(L, 1);
+	luaL_checktype(L, 2, LUA_TNUMBER);
+	int encoding = lua_tointeger(L, 2);
+	lua_pushinteger(L, inst->getDataSizeWithEncoding(encoding));
+	return 1;
+}
+
+static int Polycore_Timer(lua_State *L) {
+	luaL_checktype(L, 1, LUA_TBOOLEAN);
+	bool triggerMode = lua_toboolean(L, 1);
+	luaL_checktype(L, 2, LUA_TNUMBER);
+	int msecs = lua_tointeger(L, 2);
+	Timer *inst = new Timer(triggerMode, msecs);
+	lua_pushlightuserdata(L, (void*)inst);
+	return 1;
+}
+
+static int Polycore_Timer_Pause(lua_State *L) {
+	luaL_checktype(L, 1, LUA_TLIGHTUSERDATA);
+	Timer *inst = (Timer*)lua_topointer(L, 1);
+	luaL_checktype(L, 2, LUA_TBOOLEAN);
+	bool paused = lua_toboolean(L, 2);
+	inst->Pause(paused);
+	return 0;
+}
+
+static int Polycore_Timer_isPaused(lua_State *L) {
+	luaL_checktype(L, 1, LUA_TLIGHTUSERDATA);
+	Timer *inst = (Timer*)lua_topointer(L, 1);
+	lua_pushboolean(L, inst->isPaused());
+	return 1;
+}
+
+static int Polycore_Timer_getTicks(lua_State *L) {
+	luaL_checktype(L, 1, LUA_TLIGHTUSERDATA);
+	Timer *inst = (Timer*)lua_topointer(L, 1);
+	lua_pushinteger(L, inst->getTicks());
+	return 1;
+}
+
+static int Polycore_Timer_Update(lua_State *L) {
+	luaL_checktype(L, 1, LUA_TLIGHTUSERDATA);
+	Timer *inst = (Timer*)lua_topointer(L, 1);
+	luaL_checktype(L, 2, LUA_TNUMBER);
+	unsigned int ticks = lua_tointeger(L, 2);
+	inst->Update(ticks);
+	return 0;
+}
+
+static int Polycore_Timer_Reset(lua_State *L) {
+	luaL_checktype(L, 1, LUA_TLIGHTUSERDATA);
+	Timer *inst = (Timer*)lua_topointer(L, 1);
+	inst->Reset();
+	return 0;
+}
+
+static int Polycore_Timer_hasElapsed(lua_State *L) {
+	luaL_checktype(L, 1, LUA_TLIGHTUSERDATA);
+	Timer *inst = (Timer*)lua_topointer(L, 1);
+	lua_pushboolean(L, inst->hasElapsed());
+	return 1;
+}
+
+static int Polycore_Timer_getElapsedf(lua_State *L) {
+	luaL_checktype(L, 1, LUA_TLIGHTUSERDATA);
+	Timer *inst = (Timer*)lua_topointer(L, 1);
+	lua_pushnumber(L, inst->getElapsedf());
+	return 1;
+}
+
+static int Polycore_TimerManager(lua_State *L) {
+	TimerManager *inst = new TimerManager();
+	lua_pushlightuserdata(L, (void*)inst);
+	return 1;
+}
+
+static int Polycore_TimerManager_removeTimer(lua_State *L) {
+	luaL_checktype(L, 1, LUA_TLIGHTUSERDATA);
+	TimerManager *inst = (TimerManager*)lua_topointer(L, 1);
+	luaL_checktype(L, 2, LUA_TLIGHTUSERDATA);
+	Timer * timer = (Timer *)lua_topointer(L, 2);
+	inst->removeTimer(timer);
+	return 0;
+}
+
+static int Polycore_TimerManager_addTimer(lua_State *L) {
+	luaL_checktype(L, 1, LUA_TLIGHTUSERDATA);
+	TimerManager *inst = (TimerManager*)lua_topointer(L, 1);
+	luaL_checktype(L, 2, LUA_TLIGHTUSERDATA);
+	Timer * timer = (Timer *)lua_topointer(L, 2);
+	inst->addTimer(timer);
+	return 0;
+}
+
+static int Polycore_TimerManager_Update(lua_State *L) {
+	luaL_checktype(L, 1, LUA_TLIGHTUSERDATA);
+	TimerManager *inst = (TimerManager*)lua_topointer(L, 1);
+	inst->Update();
+	return 0;
+}
+
+static int Polycore_Tween(lua_State *L) {
+	luaL_checktype(L, 1, LUA_TLIGHTUSERDATA);
+	Number * target = (Number *)lua_topointer(L, 1);
+	luaL_checktype(L, 2, LUA_TNUMBER);
+	int easeType = lua_tointeger(L, 2);
+	luaL_checktype(L, 3, LUA_TNUMBER);
+	Number startVal = lua_tonumber(L, 3);
+	luaL_checktype(L, 4, LUA_TNUMBER);
+	Number _endVal = lua_tonumber(L, 4);
+	luaL_checktype(L, 5, LUA_TNUMBER);
+	Number time = lua_tonumber(L, 5);
+	luaL_checktype(L, 6, LUA_TBOOLEAN);
+	bool _repeat = lua_toboolean(L, 6);
+	Tween *inst = new Tween(target, easeType, startVal, _endVal, time, _repeat);
+	lua_pushlightuserdata(L, (void*)inst);
+	return 1;
+}
+
+static int Polycore_Tween_handleEvent(lua_State *L) {
+	luaL_checktype(L, 1, LUA_TLIGHTUSERDATA);
+	Tween *inst = (Tween*)lua_topointer(L, 1);
+	luaL_checktype(L, 2, LUA_TLIGHTUSERDATA);
+	Event * event = (Event *)lua_topointer(L, 2);
+	inst->handleEvent(event);
+	return 0;
+}
+
+static int Polycore_Tween_interpolateTween(lua_State *L) {
+	luaL_checktype(L, 1, LUA_TLIGHTUSERDATA);
+	Tween *inst = (Tween*)lua_topointer(L, 1);
+	lua_pushnumber(L, inst->interpolateTween());
+	return 1;
+}
+
+static int Polycore_Tween_updateCustomTween(lua_State *L) {
+	luaL_checktype(L, 1, LUA_TLIGHTUSERDATA);
+	Tween *inst = (Tween*)lua_topointer(L, 1);
+	inst->updateCustomTween();
+	return 0;
+}
+
+static int Polycore_Tween_doOnComplete(lua_State *L) {
+	luaL_checktype(L, 1, LUA_TLIGHTUSERDATA);
+	Tween *inst = (Tween*)lua_topointer(L, 1);
+	inst->doOnComplete();
+	return 0;
+}
+
+static int Polycore_Tween_Pause(lua_State *L) {
+	luaL_checktype(L, 1, LUA_TLIGHTUSERDATA);
+	Tween *inst = (Tween*)lua_topointer(L, 1);
+	luaL_checktype(L, 2, LUA_TBOOLEAN);
+	bool pauseVal = lua_toboolean(L, 2);
+	inst->Pause(pauseVal);
+	return 0;
+}
+
+static int Polycore_Tween_Reset(lua_State *L) {
+	luaL_checktype(L, 1, LUA_TLIGHTUSERDATA);
+	Tween *inst = (Tween*)lua_topointer(L, 1);
+	inst->Reset();
+	return 0;
+}
+
+static int Polycore_Tween_isComplete(lua_State *L) {
+	luaL_checktype(L, 1, LUA_TLIGHTUSERDATA);
+	Tween *inst = (Tween*)lua_topointer(L, 1);
+	lua_pushboolean(L, inst->isComplete());
+	return 1;
+}
+
+static int Polycore_Tween_setSpeed(lua_State *L) {
+	luaL_checktype(L, 1, LUA_TLIGHTUSERDATA);
+	Tween *inst = (Tween*)lua_topointer(L, 1);
+	luaL_checktype(L, 2, LUA_TNUMBER);
+	Number speed = lua_tonumber(L, 2);
+	inst->setSpeed(speed);
+	return 0;
+}
+
+static int Polycore_BezierPathTween(lua_State *L) {
+	luaL_checktype(L, 1, LUA_TLIGHTUSERDATA);
+	Vector3 * target = (Vector3 *)lua_topointer(L, 1);
+	luaL_checktype(L, 2, LUA_TLIGHTUSERDATA);
+	BezierCurve * curve = (BezierCurve *)lua_topointer(L, 2);
+	luaL_checktype(L, 3, LUA_TNUMBER);
+	int easeType = lua_tointeger(L, 3);
+	luaL_checktype(L, 4, LUA_TNUMBER);
+	Number time = lua_tonumber(L, 4);
+	luaL_checktype(L, 5, LUA_TBOOLEAN);
+	bool _repeat = lua_toboolean(L, 5);
+	BezierPathTween *inst = new BezierPathTween(target, curve, easeType, time, _repeat);
+	lua_pushlightuserdata(L, (void*)inst);
+	return 1;
+}
+
+static int Polycore_BezierPathTween_updateCustomTween(lua_State *L) {
+	luaL_checktype(L, 1, LUA_TLIGHTUSERDATA);
+	BezierPathTween *inst = (BezierPathTween*)lua_topointer(L, 1);
+	inst->updateCustomTween();
+	return 0;
+}
+
+static int Polycore_QuaternionTween(lua_State *L) {
+	luaL_checktype(L, 1, LUA_TLIGHTUSERDATA);
+	Quaternion * target = (Quaternion *)lua_topointer(L, 1);
+	luaL_checktype(L, 2, LUA_TLIGHTUSERDATA);
+	BezierCurve * wCurve = (BezierCurve *)lua_topointer(L, 2);
+	luaL_checktype(L, 3, LUA_TLIGHTUSERDATA);
+	BezierCurve * xCurve = (BezierCurve *)lua_topointer(L, 3);
+	luaL_checktype(L, 4, LUA_TLIGHTUSERDATA);
+	BezierCurve * yCurve = (BezierCurve *)lua_topointer(L, 4);
+	luaL_checktype(L, 5, LUA_TLIGHTUSERDATA);
+	BezierCurve * zCurve = (BezierCurve *)lua_topointer(L, 5);
+	luaL_checktype(L, 6, LUA_TNUMBER);
+	int easeType = lua_tointeger(L, 6);
+	luaL_checktype(L, 7, LUA_TNUMBER);
+	Number time = lua_tonumber(L, 7);
+	luaL_checktype(L, 8, LUA_TBOOLEAN);
+	bool _repeat = lua_toboolean(L, 8);
+	QuaternionTween *inst = new QuaternionTween(target, wCurve, xCurve, yCurve, zCurve, easeType, time, _repeat);
+	lua_pushlightuserdata(L, (void*)inst);
+	return 1;
+}
+
+static int Polycore_QuaternionTween_updateCustomTween(lua_State *L) {
+	luaL_checktype(L, 1, LUA_TLIGHTUSERDATA);
+	QuaternionTween *inst = (QuaternionTween*)lua_topointer(L, 1);
+	inst->updateCustomTween();
+	return 0;
+}
+
+static int Polycore_TweenManager(lua_State *L) {
+	TweenManager *inst = new TweenManager();
+	lua_pushlightuserdata(L, (void*)inst);
+	return 1;
+}
+
+static int Polycore_TweenManager_addTween(lua_State *L) {
+	luaL_checktype(L, 1, LUA_TLIGHTUSERDATA);
+	TweenManager *inst = (TweenManager*)lua_topointer(L, 1);
+	luaL_checktype(L, 2, LUA_TLIGHTUSERDATA);
+	Tween * tween = (Tween *)lua_topointer(L, 2);
+	inst->addTween(tween);
+	return 0;
+}
+
+static int Polycore_TweenManager_Update(lua_State *L) {
+	luaL_checktype(L, 1, LUA_TLIGHTUSERDATA);
+	TweenManager *inst = (TweenManager*)lua_topointer(L, 1);
+	inst->Update();
+	return 0;
+}
+
+static int Polycore_Vector2(lua_State *L) {
+	Vector2 *inst = new Vector2();
+	lua_pushlightuserdata(L, (void*)inst);
+	return 1;
+}
+
+static int Polycore_Vector3(lua_State *L) {
+	Vector3 *inst = new Vector3();
+	lua_pushlightuserdata(L, (void*)inst);
+	return 1;
+}
+
+static int Polycore_Vector3_set(lua_State *L) {
+	luaL_checktype(L, 1, LUA_TLIGHTUSERDATA);
+	Vector3 *inst = (Vector3*)lua_topointer(L, 1);
+	luaL_checktype(L, 2, LUA_TNUMBER);
+	Number x = lua_tonumber(L, 2);
+	luaL_checktype(L, 3, LUA_TNUMBER);
+	Number y = lua_tonumber(L, 3);
+	luaL_checktype(L, 4, LUA_TNUMBER);
+	Number z = lua_tonumber(L, 4);
+	inst->set(x, y, z);
+	return 0;
+}
+
+static int Polycore_Vector3_distance(lua_State *L) {
+	luaL_checktype(L, 1, LUA_TLIGHTUSERDATA);
+	Vector3 *inst = (Vector3*)lua_topointer(L, 1);
+	luaL_checktype(L, 2, LUA_TLIGHTUSERDATA);
+	const Vector3 & rhs = *( Vector3 *)lua_topointer(L, 2);
+	lua_pushnumber(L, inst->distance(rhs));
+	return 1;
+}
+
+static int Polycore_Vector3_length(lua_State *L) {
+	luaL_checktype(L, 1, LUA_TLIGHTUSERDATA);
+	Vector3 *inst = (Vector3*)lua_topointer(L, 1);
+	lua_pushnumber(L, inst->length());
+	return 1;
+}
+
+static int Polycore_Vector3_dot(lua_State *L) {
+	luaL_checktype(L, 1, LUA_TLIGHTUSERDATA);
+	Vector3 *inst = (Vector3*)lua_topointer(L, 1);
+	luaL_checktype(L, 2, LUA_TLIGHTUSERDATA);
+	Vector3 & u = *(Vector3 *)lua_topointer(L, 2);
+	lua_pushnumber(L, inst->dot(u));
+	return 1;
+}
+
+static int Polycore_Vector3_crossProduct(lua_State *L) {
+	luaL_checktype(L, 1, LUA_TLIGHTUSERDATA);
+	Vector3 *inst = (Vector3*)lua_topointer(L, 1);
+	luaL_checktype(L, 2, LUA_TLIGHTUSERDATA);
+	const Vector3 & rkVector = *( Vector3 *)lua_topointer(L, 2);
+	 Vector3 *retInst = new  Vector3();
+	*retInst = inst->crossProduct(rkVector);
+	lua_pushlightuserdata(L, retInst);
+	return 1;
+}
+
+static int Polycore_Vector3_Normalize(lua_State *L) {
+	luaL_checktype(L, 1, LUA_TLIGHTUSERDATA);
+	Vector3 *inst = (Vector3*)lua_topointer(L, 1);
+	inst->Normalize();
+	return 0;
+}
+
+static int Polycore_Vertex(lua_State *L) {
+	Vertex *inst = new Vertex();
+	lua_pushlightuserdata(L, (void*)inst);
+	return 1;
+}
+
+static int Polycore_Vertex_addBoneAssignment(lua_State *L) {
+	luaL_checktype(L, 1, LUA_TLIGHTUSERDATA);
+	Vertex *inst = (Vertex*)lua_topointer(L, 1);
+	luaL_checktype(L, 2, LUA_TNUMBER);
+	unsigned int boneID = lua_tointeger(L, 2);
+	luaL_checktype(L, 3, LUA_TNUMBER);
+	Number boneWeight = lua_tonumber(L, 3);
+	inst->addBoneAssignment(boneID, boneWeight);
+	return 0;
+}
+
+static int Polycore_Vertex_getNumBoneAssignments(lua_State *L) {
+	luaL_checktype(L, 1, LUA_TLIGHTUSERDATA);
+	Vertex *inst = (Vertex*)lua_topointer(L, 1);
+	lua_pushinteger(L, inst->getNumBoneAssignments());
+	return 1;
+}
+
+static int Polycore_Vertex_getBoneAssignment(lua_State *L) {
+	luaL_checktype(L, 1, LUA_TLIGHTUSERDATA);
+	Vertex *inst = (Vertex*)lua_topointer(L, 1);
+	luaL_checktype(L, 2, LUA_TNUMBER);
+	unsigned int index = lua_tointeger(L, 2);
+	lua_pushlightuserdata(L, (void*)inst->getBoneAssignment(index));
+	return 1;
+}
+
+static int Polycore_Vertex_normalizeWeights(lua_State *L) {
+	luaL_checktype(L, 1, LUA_TLIGHTUSERDATA);
+	Vertex *inst = (Vertex*)lua_topointer(L, 1);
+	inst->normalizeWeights();
+	return 0;
+}
+
+static int Polycore_Vertex_getTexCoord(lua_State *L) {
+	luaL_checktype(L, 1, LUA_TLIGHTUSERDATA);
+	Vertex *inst = (Vertex*)lua_topointer(L, 1);
+	Vector2 *retInst = new Vector2();
+	*retInst = inst->getTexCoord();
+	lua_pushlightuserdata(L, retInst);
+	return 1;
+}
+
+static int Polycore_Vertex_setTexCoord(lua_State *L) {
+	luaL_checktype(L, 1, LUA_TLIGHTUSERDATA);
+	Vertex *inst = (Vertex*)lua_topointer(L, 1);
+	luaL_checktype(L, 2, LUA_TNUMBER);
+	Number u = lua_tonumber(L, 2);
+	luaL_checktype(L, 3, LUA_TNUMBER);
+	Number v = lua_tonumber(L, 3);
+	inst->setTexCoord(u, v);
+	return 0;
+}
+
+static int Polycore_Vertex_setNormal(lua_State *L) {
+	luaL_checktype(L, 1, LUA_TLIGHTUSERDATA);
+	Vertex *inst = (Vertex*)lua_topointer(L, 1);
+	luaL_checktype(L, 2, LUA_TNUMBER);
+	Number x = lua_tonumber(L, 2);
+	luaL_checktype(L, 3, LUA_TNUMBER);
+	Number y = lua_tonumber(L, 3);
+	luaL_checktype(L, 4, LUA_TNUMBER);
+	Number z = lua_tonumber(L, 4);
+	inst->setNormal(x, y, z);
+	return 0;
+}
+
+}

+ 655 - 10
Bindings/Contents/LUA/Source/PolycodeLUA.cpp

@@ -1,26 +1,671 @@
-
 #include "PolycodeLUA.h"
 #include "PolycodeLUA.h"
-#include "PolycodeLUA2D.h"
+#include "PolycodeLUAWrappers.h"
 
 
 int luaopen_Polycode(lua_State *L) {
 int luaopen_Polycode(lua_State *L) {
-	static const struct luaL_reg polycodeLib [] = {
-		//Screen
+	static const struct luaL_reg polycodeLib [] = {		{"OSFILE", Polycore_OSFILE},
+		{"OSFILE_debugDump", Polycore_OSFILE_debugDump},
+		{"OSFileEntry", Polycore_OSFileEntry},
+		{"OSBasics_open", Polycore_OSBasics_open},
+		{"OSBasics_close", Polycore_OSBasics_close},
+		{"OSBasics_read", Polycore_OSBasics_read},
+		{"OSBasics_write", Polycore_OSBasics_write},
+		{"OSBasics_seek", Polycore_OSBasics_seek},
+		{"OSBasics_tell", Polycore_OSBasics_tell},
+		{"OSBasics_parsePhysFSFolder", Polycore_OSBasics_parsePhysFSFolder},
+		{"OSBasics_parseFolder", Polycore_OSBasics_parseFolder},
+		{"OSBasics_isFolder", Polycore_OSBasics_isFolder},
+		{"OSBasics_createFolder", Polycore_OSBasics_createFolder},
+		{"BezierCurve", Polycore_BezierCurve},
+		{"BezierCurve_getControlPoint", Polycore_BezierCurve_getControlPoint},
+		{"BezierCurve_getNumControlPoints", Polycore_BezierCurve_getNumControlPoints},
+		{"BezierCurve_addControlPoint", Polycore_BezierCurve_addControlPoint},
+		{"BezierCurve_addControlPoint3dWithHandles", Polycore_BezierCurve_addControlPoint3dWithHandles},
+		{"BezierCurve_addControlPoint3d", Polycore_BezierCurve_addControlPoint3d},
+		{"BezierCurve_addControlPoint2dWithHandles", Polycore_BezierCurve_addControlPoint2dWithHandles},
+		{"BezierCurve_addControlPoint2d", Polycore_BezierCurve_addControlPoint2d},
+		{"BezierCurve_getHeightAt", Polycore_BezierCurve_getHeightAt},
+		{"BezierCurve_getPointAt", Polycore_BezierCurve_getPointAt},
+		{"BezierCurve_getPointBetween", Polycore_BezierCurve_getPointBetween},
+		{"BezierCurve_rebuildBuffers", Polycore_BezierCurve_rebuildBuffers},
+		{"Bone", Polycore_Bone},
+		{"Bone_enableBoneLabel", Polycore_Bone_enableBoneLabel},
+		{"Bone_getName", Polycore_Bone_getName},
+		{"Bone_Render", Polycore_Bone_Render},
+		{"Bone_setParentBone", Polycore_Bone_setParentBone},
+		{"Bone_addChildBone", Polycore_Bone_addChildBone},
+		{"Bone_getParentBone", Polycore_Bone_getParentBone},
+		{"Bone_getNumChildBones", Polycore_Bone_getNumChildBones},
+		{"Bone_getChildBone", Polycore_Bone_getChildBone},
+		{"Bone_getBoneMatrix", Polycore_Bone_getBoneMatrix},
+		{"Bone_setBoneMatrix", Polycore_Bone_setBoneMatrix},
+		{"Bone_getRestMatrix", Polycore_Bone_getRestMatrix},
+		{"Bone_getFullRestMatrix", Polycore_Bone_getFullRestMatrix},
+		{"Bone_getParentRestMatrix", Polycore_Bone_getParentRestMatrix},
+		{"Bone_getFinalMatrix", Polycore_Bone_getFinalMatrix},
+		{"Bone_setRestMatrix", Polycore_Bone_setRestMatrix},
+		{"Bone_setBaseMatrix", Polycore_Bone_setBaseMatrix},
+		{"Bone_getBaseMatrix", Polycore_Bone_getBaseMatrix},
+		{"Bone_getFullBaseMatrix", Polycore_Bone_getFullBaseMatrix},
+		{"Camera", Polycore_Camera},
+		{"Camera_buildFrustrumPlanes", Polycore_Camera_buildFrustrumPlanes},
+		{"Camera_isSphereInFrustrum", Polycore_Camera_isSphereInFrustrum},
+		{"Camera_canSee", Polycore_Camera_canSee},
+		{"Camera_setOrthoMode", Polycore_Camera_setOrthoMode},
+		{"Camera_getOrthoMode", Polycore_Camera_getOrthoMode},
+		{"Camera_setFOV", Polycore_Camera_setFOV},
+		{"Camera_getFOV", Polycore_Camera_getFOV},
+		{"Camera_doCameraTransform", Polycore_Camera_doCameraTransform},
+		{"Camera_setLightDepthTexture", Polycore_Camera_setLightDepthTexture},
+		{"Camera_setParentScene", Polycore_Camera_setParentScene},
+		{"Camera_hasFilterShader", Polycore_Camera_hasFilterShader},
+		{"Camera_drawFilter", Polycore_Camera_drawFilter},
+		{"Camera_setExposureLevel", Polycore_Camera_setExposureLevel},
+		{"Camera_getExposureLevel", Polycore_Camera_getExposureLevel},
+		{"Camera_createPostFilter", Polycore_Camera_createPostFilter},
+		{"Camera_setPostFilter", Polycore_Camera_setPostFilter},
+		{"Color", Polycore_Color},
+		{"Color_setColorHex", Polycore_Color_setColorHex},
+		{"Color_setColorHexRGB", Polycore_Color_setColorHexRGB},
+		{"Color_setColorHSV", Polycore_Color_setColorHSV},
+		{"Color_setColorRGBA", Polycore_Color_setColorRGBA},
+		{"Color_setColorRGB", Polycore_Color_setColorRGB},
+		{"Color_setColor", Polycore_Color_setColor},
+		{"Color_Random", Polycore_Color_Random},
+		{"Color_getBrightness", Polycore_Color_getBrightness},
+		{"Color_getUint", Polycore_Color_getUint},
+		{"Config", Polycore_Config},
+		{"Config_loadConfig", Polycore_Config_loadConfig},
+		{"Config_saveConfig", Polycore_Config_saveConfig},
+		{"Config_getEntry", Polycore_Config_getEntry},
+		{"Config_setStringValue", Polycore_Config_setStringValue},
+		{"Config_setNumericValue", Polycore_Config_setNumericValue},
+		{"Config_getNumericValue", Polycore_Config_getNumericValue},
+		{"Config_getStringValue", Polycore_Config_getStringValue},
+		{"CoreInput", Polycore_CoreInput},
+		{"CoreInput_mouseWheelUp", Polycore_CoreInput_mouseWheelUp},
+		{"CoreInput_mouseWheelDown", Polycore_CoreInput_mouseWheelDown},
+		{"CoreInput_getMouseButtonState", Polycore_CoreInput_getMouseButtonState},
+		{"CoreInput_setMouseButtonState", Polycore_CoreInput_setMouseButtonState},
+		{"CoreInput_setMousePosition", Polycore_CoreInput_setMousePosition},
+		{"CoreInput_getMousePosition", Polycore_CoreInput_getMousePosition},
+		{"CoreInput_setKeyState", Polycore_CoreInput_setKeyState},
+		{"CoreInput_getKeyState", Polycore_CoreInput_getKeyState},
+		{"CoreInput_getMouseDelta", Polycore_CoreInput_getMouseDelta},
+		{"CoreInput_setDeltaPosition", Polycore_CoreInput_setDeltaPosition},
+		{"CoreInput_createEvent", Polycore_CoreInput_createEvent},
+		{"CoreServices_getInstance", Polycore_CoreServices_getInstance},
+		{"CoreServices_getRenderMutex", Polycore_CoreServices_getRenderMutex},
+		{"CoreServices_setRenderer", Polycore_CoreServices_setRenderer},
+		{"CoreServices_getRenderer", Polycore_CoreServices_getRenderer},
+		{"CoreServices_Update", Polycore_CoreServices_Update},
+		{"CoreServices_setCore", Polycore_CoreServices_setCore},
+		{"CoreServices_getCore", Polycore_CoreServices_getCore},
+		{"CoreServices_handleEvent", Polycore_CoreServices_handleEvent},
+		{"CoreServices_installModule", Polycore_CoreServices_installModule},
+		{"CoreServices_getMaterialManager", Polycore_CoreServices_getMaterialManager},
+		{"CoreServices_getScreenManager", Polycore_CoreServices_getScreenManager},
+		{"CoreServices_getSceneManager", Polycore_CoreServices_getSceneManager},
+		{"CoreServices_getTimerManager", Polycore_CoreServices_getTimerManager},
+		{"CoreServices_getTweenManager", Polycore_CoreServices_getTweenManager},
+		{"CoreServices_getResourceManager", Polycore_CoreServices_getResourceManager},
+		{"CoreServices_getSoundManager", Polycore_CoreServices_getSoundManager},
+		{"CoreServices_getFontManager", Polycore_CoreServices_getFontManager},
+		{"CoreServices_getConfig", Polycore_CoreServices_getConfig},
+		{"Cubemap", Polycore_Cubemap},
+		{"Data", Polycore_Data},
+		{"Data_loadFromFile", Polycore_Data_loadFromFile},
+		{"Data_getAsString", Polycore_Data_getAsString},
+		{"Data_setFromString", Polycore_Data_setFromString},
+		{"Data_saveToFile", Polycore_Data_saveToFile},
+		{"Data_getData", Polycore_Data_getData},
+		{"Entity", Polycore_Entity},
+		{"Entity_Render", Polycore_Entity_Render},
+		{"Entity_Update", Polycore_Entity_Update},
+		{"Entity_transformAndRender", Polycore_Entity_transformAndRender},
+		{"Entity_setMatrix", Polycore_Entity_setMatrix},
+		{"Entity_rebuildTransformMatrix", Polycore_Entity_rebuildTransformMatrix},
+		{"Entity_addEntity", Polycore_Entity_addEntity},
+		{"Entity_addChild", Polycore_Entity_addChild},
+		{"Entity_removeChild", Polycore_Entity_removeChild},
+		{"Entity_updateEntityMatrix", Polycore_Entity_updateEntityMatrix},
+		{"Entity_renderChildren", Polycore_Entity_renderChildren},
+		{"Entity_getPosition", Polycore_Entity_getPosition},
+		{"Entity_setPosition", Polycore_Entity_setPosition},
+		{"Entity_setPositionX", Polycore_Entity_setPositionX},
+		{"Entity_setPositionY", Polycore_Entity_setPositionY},
+		{"Entity_setPositionZ", Polycore_Entity_setPositionZ},
+		{"Entity_setScaleX", Polycore_Entity_setScaleX},
+		{"Entity_setScaleY", Polycore_Entity_setScaleY},
+		{"Entity_setScaleZ", Polycore_Entity_setScaleZ},
+		{"Entity_Translate", Polycore_Entity_Translate},
+		{"Entity_Scale", Polycore_Entity_Scale},
+		{"Entity_setScale", Polycore_Entity_setScale},
+		{"Entity_getScale", Polycore_Entity_getScale},
+		{"Entity_getCombinedPosition", Polycore_Entity_getCombinedPosition},
+		{"Entity_getCombinedPitch", Polycore_Entity_getCombinedPitch},
+		{"Entity_getCombinedYaw", Polycore_Entity_getCombinedYaw},
+		{"Entity_getCombinedRoll", Polycore_Entity_getCombinedRoll},
+		{"Entity_setParentEntity", Polycore_Entity_setParentEntity},
+		{"Entity_getParentEntity", Polycore_Entity_getParentEntity},
+		{"Entity_rebuildRotation", Polycore_Entity_rebuildRotation},
+		{"Entity_dirtyMatrix", Polycore_Entity_dirtyMatrix},
+		{"Entity_setPitch", Polycore_Entity_setPitch},
+		{"Entity_setYaw", Polycore_Entity_setYaw},
+		{"Entity_setRoll", Polycore_Entity_setRoll},
+		{"Entity_Roll", Polycore_Entity_Roll},
+		{"Entity_Yaw", Polycore_Entity_Yaw},
+		{"Entity_Pitch", Polycore_Entity_Pitch},
+		{"Entity_getPitch", Polycore_Entity_getPitch},
+		{"Entity_getYaw", Polycore_Entity_getYaw},
+		{"Entity_getRoll", Polycore_Entity_getRoll},
+		{"Entity_setRotationQuat", Polycore_Entity_setRotationQuat},
+		{"Entity_getRotationQuat", Polycore_Entity_getRotationQuat},
+		{"Entity_getTransformMatrix", Polycore_Entity_getTransformMatrix},
+		{"Entity_getConcatenatedMatrix", Polycore_Entity_getConcatenatedMatrix},
+		{"Entity_getConcatenatedRollMatrix", Polycore_Entity_getConcatenatedRollMatrix},
+		{"Entity_setTransformByMatrix", Polycore_Entity_setTransformByMatrix},
+		{"Entity_setTransformByMatrixPure", Polycore_Entity_setTransformByMatrixPure},
+		{"Entity_setRenderer", Polycore_Entity_setRenderer},
+		{"Entity_getCombinedColor", Polycore_Entity_getCombinedColor},
+		{"Entity_setColor", Polycore_Entity_setColor},
+		{"Entity_setColorInt", Polycore_Entity_setColorInt},
+		{"Entity_recalculateBBox", Polycore_Entity_recalculateBBox},
+		{"Entity_getBBoxRadius", Polycore_Entity_getBBoxRadius},
+		{"Entity_getCompoundBBoxRadius", Polycore_Entity_getCompoundBBoxRadius},
+		{"Entity_setBBoxRadius", Polycore_Entity_setBBoxRadius},
+		{"Entity_setBlendingMode", Polycore_Entity_setBlendingMode},
+		{"Entity_getChildCenter", Polycore_Entity_getChildCenter},
+		{"Entity_setDepthWrite", Polycore_Entity_setDepthWrite},
+		{"Entity_doUpdates", Polycore_Entity_doUpdates},
+		{"Entity_lookAt", Polycore_Entity_lookAt},
+		{"Entity_lookAtEntity", Polycore_Entity_lookAtEntity},
+		{"Entity_getLookAtMatrix", Polycore_Entity_getLookAtMatrix},
+		{"Entity_buildPositionMatrix", Polycore_Entity_buildPositionMatrix},
+		{"Entity_adjustMatrixForChildren", Polycore_Entity_adjustMatrixForChildren},
+		{"Entity_setMask", Polycore_Entity_setMask},
+		{"Entity_clearMask", Polycore_Entity_clearMask},
+		{"Entity_getCompoundScale", Polycore_Entity_getCompoundScale},
+		{"Entity_getEntityProp", Polycore_Entity_getEntityProp},
+		{"Event", Polycore_Event},
+		{"Event_getEventCode", Polycore_Event_getEventCode},
+		{"Event_setEventCode", Polycore_Event_setEventCode},
+		{"Event_getDispatcher", Polycore_Event_getDispatcher},
+		{"Event_setDispatcher", Polycore_Event_setDispatcher},
+		{"Event_getEventType", Polycore_Event_getEventType},
+		{"EventDispatcher", Polycore_EventDispatcher},
+		{"EventDispatcher_removeAllHandlers", Polycore_EventDispatcher_removeAllHandlers},
+		{"EventDispatcher_removeAllHandlersForListener", Polycore_EventDispatcher_removeAllHandlersForListener},
+		{"EventDispatcher_addEventListener", Polycore_EventDispatcher_addEventListener},
+		{"EventDispatcher_removeEventListener", Polycore_EventDispatcher_removeEventListener},
+		{"EventDispatcher___dispatchEvent", Polycore_EventDispatcher___dispatchEvent},
+		{"EventDispatcher_dispatchEvent", Polycore_EventDispatcher_dispatchEvent},
+		{"EventDispatcher_dispatchEventNoDelete", Polycore_EventDispatcher_dispatchEventNoDelete},
+		{"EventHandler", Polycore_EventHandler},
+		{"EventHandler_secondaryHandler", Polycore_EventHandler_secondaryHandler},
+		{"EventHandler_handleEvent", Polycore_EventHandler_handleEvent},
+		{"FixedShader", Polycore_FixedShader},
+		{"FixedShader_createBinding", Polycore_FixedShader_createBinding},
+		{"FixedShaderBinding", Polycore_FixedShaderBinding},
+		{"FixedShaderBinding_addTexture", Polycore_FixedShaderBinding_addTexture},
+		{"FixedShaderBinding_addCubemap", Polycore_FixedShaderBinding_addCubemap},
+		{"FixedShaderBinding_addParam", Polycore_FixedShaderBinding_addParam},
+		{"FixedShaderBinding_getDiffuseTexture", Polycore_FixedShaderBinding_getDiffuseTexture},
+		{"Font", Polycore_Font},
+		{"Font_getFace", Polycore_Font_getFace},
+		{"Font_isValid", Polycore_Font_isValid},
+		{"FontManager", Polycore_FontManager},
+		{"FontManager_registerFont", Polycore_FontManager_registerFont},
+		{"FontManager_getFontByName", Polycore_FontManager_getFontByName},
+		{"GenericScene", Polycore_GenericScene},
+		{"GenericScene_Render", Polycore_GenericScene_Render},
+		{"GenericScene_RenderDepthOnly", Polycore_GenericScene_RenderDepthOnly},
+		{"GenericScene_addGrid", Polycore_GenericScene_addGrid},
+		{"GenericScene_readString", Polycore_GenericScene_readString},
+		{"GenericScene_loadScene", Polycore_GenericScene_loadScene},
+		{"GenericScene_generateLightmaps", Polycore_GenericScene_generateLightmaps},
+		{"GenericScene_addLight", Polycore_GenericScene_addLight},
+		{"GenericScene_getNearestLight", Polycore_GenericScene_getNearestLight},
+		{"GenericScene_writeEntityMatrix", Polycore_GenericScene_writeEntityMatrix},
+		{"GenericScene_writeString", Polycore_GenericScene_writeString},
+		{"GenericScene_saveScene", Polycore_GenericScene_saveScene},
+		{"GenericScene_getNumStaticGeometry", Polycore_GenericScene_getNumStaticGeometry},
+		{"GenericScene_getStaticGeometry", Polycore_GenericScene_getStaticGeometry},
+		{"GenericScene_loadCollisionChild", Polycore_GenericScene_loadCollisionChild},
+		{"GenericScene_getNumLights", Polycore_GenericScene_getNumLights},
+		{"GenericScene_getLight", Polycore_GenericScene_getLight},
+		{"GenericScene_getCustomEntityByType", Polycore_GenericScene_getCustomEntityByType},
+		{"OpenGLCubemap", Polycore_OpenGLCubemap},
+		{"OpenGLCubemap_getTextureID", Polycore_OpenGLCubemap_getTextureID},
+		{"Image", Polycore_Image},
+		{"Image_loadImage", Polycore_Image_loadImage},
+		{"Image_loadPNG", Polycore_Image_loadPNG},
+		{"Image_createEmpty", Polycore_Image_createEmpty},
+		{"Image_fill", Polycore_Image_fill},
+		{"Image_setPixel", Polycore_Image_setPixel},
+		{"Image_getPixel", Polycore_Image_getPixel},
+		{"Image_setAAPixel", Polycore_Image_setAAPixel},
+		{"Image_swap", Polycore_Image_swap},
+		{"Image_line", Polycore_Image_line},
+		{"Image_moveTo", Polycore_Image_moveTo},
+		{"Image_move", Polycore_Image_move},
+		{"Image_lineTo", Polycore_Image_lineTo},
+		{"Image_drawRect", Polycore_Image_drawRect},
+		{"Image_perlinNoise", Polycore_Image_perlinNoise},
+		{"Image_fastBlur", Polycore_Image_fastBlur},
+		{"Image_fastBlurVert", Polycore_Image_fastBlurVert},
+		{"Image_fastBlurHor", Polycore_Image_fastBlurHor},
+		{"Image_darken", Polycore_Image_darken},
+		{"Image_lighten", Polycore_Image_lighten},
+		{"Image_multiply", Polycore_Image_multiply},
+		{"Image_getBrushX", Polycore_Image_getBrushX},
+		{"Image_getBrushY", Polycore_Image_getBrushY},
+		{"Image_isLoaded", Polycore_Image_isLoaded},
+		{"Image_getType", Polycore_Image_getType},
+		{"Image_writeBMP", Polycore_Image_writeBMP},
+		{"Image_getWidth", Polycore_Image_getWidth},
+		{"Image_getHeight", Polycore_Image_getHeight},
+		{"Image_getPixels", Polycore_Image_getPixels},
+		{"InputEvent", Polycore_InputEvent},
+		{"InputEvent_keyCode", Polycore_InputEvent_keyCode},
+		{"Label", Polycore_Label},
+		{"Label_setText", Polycore_Label_setText},
+		{"Label_getText", Polycore_Label_getText},
+		{"Label_getTextWidth", Polycore_Label_getTextWidth},
+		{"Label_getTextHeight", Polycore_Label_getTextHeight},
+		{"Label_getFont", Polycore_Label_getFont},
+		{"Logger", Polycore_Logger},
+		{"Logger_log", Polycore_Logger_log},
+		{"Logger_logw", Polycore_Logger_logw},
+		{"Material", Polycore_Material},
+		{"Material_addShader", Polycore_Material_addShader},
+		{"Material_getNumShaders", Polycore_Material_getNumShaders},
+		{"Material_addShaderRenderTarget", Polycore_Material_addShaderRenderTarget},
+		{"Material_getNumShaderRenderTargets", Polycore_Material_getNumShaderRenderTargets},
+		{"Material_getShaderRenderTarget", Polycore_Material_getShaderRenderTarget},
+		{"Material_getName", Polycore_Material_getName},
+		{"Material_getShader", Polycore_Material_getShader},
+		{"Material_getShaderBinding", Polycore_Material_getShaderBinding},
+		{"Material_loadMaterial", Polycore_Material_loadMaterial},
+		{"MaterialManager", Polycore_MaterialManager},
+		{"MaterialManager_Update", Polycore_MaterialManager_Update},
+		{"MaterialManager_createFramebufferTexture", Polycore_MaterialManager_createFramebufferTexture},
+		{"MaterialManager_createTexture", Polycore_MaterialManager_createTexture},
+		{"MaterialManager_createNewTexture", Polycore_MaterialManager_createNewTexture},
+		{"MaterialManager_createTextureFromImage", Polycore_MaterialManager_createTextureFromImage},
+		{"MaterialManager_createTextureFromFile", Polycore_MaterialManager_createTextureFromFile},
+		{"MaterialManager_deleteTexture", Polycore_MaterialManager_deleteTexture},
+		{"MaterialManager_reloadTextures", Polycore_MaterialManager_reloadTextures},
+		{"MaterialManager_reloadProgramsAndTextures", Polycore_MaterialManager_reloadProgramsAndTextures},
+		{"MaterialManager_reloadPrograms", Polycore_MaterialManager_reloadPrograms},
+		{"MaterialManager_addShaderModule", Polycore_MaterialManager_addShaderModule},
+		{"MaterialManager_getTextureByResourcePath", Polycore_MaterialManager_getTextureByResourcePath},
+		{"MaterialManager_cubemapFromXMLNode", Polycore_MaterialManager_cubemapFromXMLNode},
+		{"MaterialManager_loadMaterialsFromFile", Polycore_MaterialManager_loadMaterialsFromFile},
+		{"MaterialManager_materialFromXMLNode", Polycore_MaterialManager_materialFromXMLNode},
+		{"MaterialManager_setShaderFromXMLNode", Polycore_MaterialManager_setShaderFromXMLNode},
+		{"MaterialManager_createShaderFromXMLNode", Polycore_MaterialManager_createShaderFromXMLNode},
+		{"Matrix4", Polycore_Matrix4},
+		{"Matrix4_init", Polycore_Matrix4_init},
+		{"Matrix4_identity", Polycore_Matrix4_identity},
+		{"Matrix4_rotateVector", Polycore_Matrix4_rotateVector},
+		{"Matrix4_getPosition", Polycore_Matrix4_getPosition},
+		{"Matrix4_setPosition", Polycore_Matrix4_setPosition},
+		{"Matrix4_setScale", Polycore_Matrix4_setScale},
+		{"Matrix4_getEulerAngles", Polycore_Matrix4_getEulerAngles},
+		{"Matrix4_inverse", Polycore_Matrix4_inverse},
+		{"Matrix4_inverseAffine", Polycore_Matrix4_inverseAffine},
+		{"Mesh", Polycore_Mesh},
+		{"Mesh_addPolygon", Polycore_Mesh_addPolygon},
+		{"Mesh_loadMesh", Polycore_Mesh_loadMesh},
+		{"Mesh_loadFromFile", Polycore_Mesh_loadFromFile},
+		{"Mesh_saveToFile", Polycore_Mesh_saveToFile},
+		{"Mesh_getPolygonCount", Polycore_Mesh_getPolygonCount},
+		{"Mesh_getPolygon", Polycore_Mesh_getPolygon},
+		{"Mesh_createPlane", Polycore_Mesh_createPlane},
+		{"Mesh_createBox", Polycore_Mesh_createBox},
+		{"Mesh_createSphere", Polycore_Mesh_createSphere},
+		{"Mesh_addVertex", Polycore_Mesh_addVertex},
+		{"Mesh_getVertex", Polycore_Mesh_getVertex},
+		{"Mesh_getNumVertices", Polycore_Mesh_getNumVertices},
+		{"Mesh_recenterMesh", Polycore_Mesh_recenterMesh},
+		{"Mesh_useVertexNormals", Polycore_Mesh_useVertexNormals},
+		{"Mesh_getVertexIndex", Polycore_Mesh_getVertexIndex},
+		{"Mesh_setVertexBuffer", Polycore_Mesh_setVertexBuffer},
+		{"Mesh_getVertexBuffer", Polycore_Mesh_getVertexBuffer},
+		{"Mesh_usesFaceUV", Polycore_Mesh_usesFaceUV},
+		{"Mesh_getRadius", Polycore_Mesh_getRadius},
+		{"Mesh_calculateNormals", Polycore_Mesh_calculateNormals},
+		{"Mesh_getMeshType", Polycore_Mesh_getMeshType},
+		{"Mesh_setMeshType", Polycore_Mesh_setMeshType},
+		{"Mesh_calculateBBox", Polycore_Mesh_calculateBBox},
+		{"Mesh_hasVertexBuffer", Polycore_Mesh_hasVertexBuffer},
+		{"VertexBuffer", Polycore_VertexBuffer},
+		{"VertexBuffer_getVertexCount", Polycore_VertexBuffer_getVertexCount},
+		{"PolycodeModule", Polycore_PolycodeModule},
+		{"PolycodeModule_getType", Polycore_PolycodeModule_getType},
+		{"ObjectEntry", Polycore_ObjectEntry},
+		{"ObjectEntry_addChild", Polycore_ObjectEntry_addChild},
+		{"Particle", Polycore_Particle},
+		{"Particle_Reset", Polycore_Particle_Reset},
+		{"Particle_createSceneParticle", Polycore_Particle_createSceneParticle},
+		{"Particle_createScreenParticle", Polycore_Particle_createScreenParticle},
+		{"ScreenParticleEmitter", Polycore_ScreenParticleEmitter},
+		{"ScreenParticleEmitter_addParticleBody", Polycore_ScreenParticleEmitter_addParticleBody},
+		{"ScreenParticleEmitter_getBaseMatrix", Polycore_ScreenParticleEmitter_getBaseMatrix},
+		{"ScreenParticleEmitter_Update", Polycore_ScreenParticleEmitter_Update},
+		{"SceneParticleEmitter", Polycore_SceneParticleEmitter},
+		{"SceneParticleEmitter_addParticleBody", Polycore_SceneParticleEmitter_addParticleBody},
+		{"SceneParticleEmitter_getBaseMatrix", Polycore_SceneParticleEmitter_getBaseMatrix},
+		{"SceneParticleEmitter_Update", Polycore_SceneParticleEmitter_Update},
+		{"Perlin", Polycore_Perlin},
+		{"Perlin_Get", Polycore_Perlin_Get},
+		{"Polygon", Polycore_Polygon},
+		{"Polygon_getVertexCount", Polycore_Polygon_getVertexCount},
+		{"Polygon_getVertex", Polycore_Polygon_getVertex},
+		{"Polygon_addVertex", Polycore_Polygon_addVertex},
+		{"Polygon_removeVertex", Polycore_Polygon_removeVertex},
+		{"Polygon_addTexCoord", Polycore_Polygon_addTexCoord},
+		{"Polygon_addTexCoord2", Polycore_Polygon_addTexCoord2},
+		{"Polygon_getTexCoord", Polycore_Polygon_getTexCoord},
+		{"Polygon_getTexCoord2", Polycore_Polygon_getTexCoord2},
+		{"Polygon_calculateNormal", Polycore_Polygon_calculateNormal},
+		{"Polygon_getFaceNormal", Polycore_Polygon_getFaceNormal},
+		{"Polygon_getBounds2D", Polycore_Polygon_getBounds2D},
+		{"Polygon_setNormal", Polycore_Polygon_setNormal},
+		{"Polygon_flipUVY", Polycore_Polygon_flipUVY},
+		{"Polygon_setUseFaceUV", Polycore_Polygon_setUseFaceUV},
+		{"Polygon_usesFaceUV", Polycore_Polygon_usesFaceUV},
+		{"Quaternion", Polycore_Quaternion},
+		{"Quaternion_setFromMatrix", Polycore_Quaternion_setFromMatrix},
+		{"Quaternion_Slerp", Polycore_Quaternion_Slerp},
+		{"Quaternion_Dot", Polycore_Quaternion_Dot},
+		{"Quaternion_Log", Polycore_Quaternion_Log},
+		{"Quaternion_Exp", Polycore_Quaternion_Exp},
+		{"Quaternion_Norm", Polycore_Quaternion_Norm},
+		{"Quaternion_normalise", Polycore_Quaternion_normalise},
+		{"Quaternion_lookAt", Polycore_Quaternion_lookAt},
+		{"Quaternion_createFromMatrix", Polycore_Quaternion_createFromMatrix},
+		{"Quaternion_Squad", Polycore_Quaternion_Squad},
+		{"Quaternion_Inverse", Polycore_Quaternion_Inverse},
+		{"Quaternion_set", Polycore_Quaternion_set},
+		{"Quaternion_inverse", Polycore_Quaternion_inverse},
+		{"Quaternion_InvSqrt", Polycore_Quaternion_InvSqrt},
+		{"Quaternion_fromAxes", Polycore_Quaternion_fromAxes},
+		{"Quaternion_FromAngleAxis", Polycore_Quaternion_FromAngleAxis},
+		{"Quaternion_ToAngleAxis", Polycore_Quaternion_ToAngleAxis},
+		{"Quaternion_createFromAxisAngle", Polycore_Quaternion_createFromAxisAngle},
+		{"Quaternion_createMatrix", Polycore_Quaternion_createMatrix},
+		{"QuaternionCurve", Polycore_QuaternionCurve},
+		{"QuaternionCurve_interpolate", Polycore_QuaternionCurve_interpolate},
+		{"QuaternionCurve_generatePointsFromCurves", Polycore_QuaternionCurve_generatePointsFromCurves},
+		{"QuaternionCurve_recalcTangents", Polycore_QuaternionCurve_recalcTangents},
+		{"Rectangle", Polycore_Rectangle},
+		{"Rectangle_setRect", Polycore_Rectangle_setRect},
+		{"Resource", Polycore_Resource},
+		{"Resource_getResourceName", Polycore_Resource_getResourceName},
+		{"Resource_getResourceType", Polycore_Resource_getResourceType},
+		{"Resource_setResourceName", Polycore_Resource_setResourceName},
+		{"Resource_setResourcePath", Polycore_Resource_setResourcePath},
+		{"Resource_getResourcePath", Polycore_Resource_getResourcePath},
+		{"ResourceManager", Polycore_ResourceManager},
+		{"ResourceManager_addResource", Polycore_ResourceManager_addResource},
+		{"ResourceManager_addDirResource", Polycore_ResourceManager_addDirResource},
+		{"ResourceManager_addArchive", Polycore_ResourceManager_addArchive},
+		{"ResourceManager_readFile", Polycore_ResourceManager_readFile},
+		{"ResourceManager_parseTextures", Polycore_ResourceManager_parseTextures},
+		{"ResourceManager_parseMaterials", Polycore_ResourceManager_parseMaterials},
+		{"ResourceManager_parseShaders", Polycore_ResourceManager_parseShaders},
+		{"ResourceManager_parsePrograms", Polycore_ResourceManager_parsePrograms},
+		{"ResourceManager_parseCubemaps", Polycore_ResourceManager_parseCubemaps},
+		{"ResourceManager_getResource", Polycore_ResourceManager_getResource},
+		{"ResourceManager_addShaderModule", Polycore_ResourceManager_addShaderModule},
+		{"SceneEntity", Polycore_SceneEntity},
+		{"SceneEntity_testMouseCollision", Polycore_SceneEntity_testMouseCollision},
+		{"SceneLabel", Polycore_SceneLabel},
+		{"SceneLabel_testMouseCollision", Polycore_SceneLabel_testMouseCollision},
+		{"SceneLabel_setText", Polycore_SceneLabel_setText},
+		{"SceneLabel_getLabel", Polycore_SceneLabel_getLabel},
+		{"SceneLabel_Render", Polycore_SceneLabel_Render},
+		{"SceneLight", Polycore_SceneLight},
+		{"SceneLight_getIntensity", Polycore_SceneLight_getIntensity},
+		{"SceneLight_getDistance", Polycore_SceneLight_getDistance},
+		{"SceneLight_getType", Polycore_SceneLight_getType},
+		{"SceneLight_renderDepthMap", Polycore_SceneLight_renderDepthMap},
+		{"SceneLight_Render", Polycore_SceneLight_Render},
+		{"SceneLight_getLightViewMatrix", Polycore_SceneLight_getLightViewMatrix},
+		{"SceneLight_getZBufferTexture", Polycore_SceneLight_getZBufferTexture},
+		{"SceneLight_setLightColor", Polycore_SceneLight_setLightColor},
+		{"SceneLight_enableShadows", Polycore_SceneLight_enableShadows},
+		{"SceneLight_setShadowMapFOV", Polycore_SceneLight_setShadowMapFOV},
+		{"SceneLight_areShadowsEnabled", Polycore_SceneLight_areShadowsEnabled},
+		{"SceneLight_getLightType", Polycore_SceneLight_getLightType},
+		{"SceneLine", Polycore_SceneLine},
+		{"SceneLine_Render", Polycore_SceneLine_Render},
+		{"SceneManager", Polycore_SceneManager},
+		{"SceneManager_addScene", Polycore_SceneManager_addScene},
+		{"SceneManager_Update", Polycore_SceneManager_Update},
+		{"SceneManager_UpdateVirtual", Polycore_SceneManager_UpdateVirtual},
+		{"SceneManager_removeScene", Polycore_SceneManager_removeScene},
+		{"SceneManager_registerRenderTexture", Polycore_SceneManager_registerRenderTexture},
+		{"SceneMesh", Polycore_SceneMesh},
+		{"SceneMesh_Render", Polycore_SceneMesh_Render},
+		{"SceneMesh_getLocalShaderOptions", Polycore_SceneMesh_getLocalShaderOptions},
+		{"SceneMesh_getMesh", Polycore_SceneMesh_getMesh},
+		{"SceneMesh_getTexture", Polycore_SceneMesh_getTexture},
+		{"SceneMesh_getMaterial", Polycore_SceneMesh_getMaterial},
+		{"SceneMesh_loadTexture", Polycore_SceneMesh_loadTexture},
+		{"SceneMesh_loadSkeleton", Polycore_SceneMesh_loadSkeleton},
+		{"SceneMesh_setTexture", Polycore_SceneMesh_setTexture},
+		{"SceneMesh_setMaterial", Polycore_SceneMesh_setMaterial},
+		{"SceneMesh_setMesh", Polycore_SceneMesh_setMesh},
+		{"SceneMesh_setSkeleton", Polycore_SceneMesh_setSkeleton},
+		{"SceneMesh_getSkeleton", Polycore_SceneMesh_getSkeleton},
+		{"SceneMesh_renderMeshLocally", Polycore_SceneMesh_renderMeshLocally},
+		{"SceneMesh_cacheToVertexBuffer", Polycore_SceneMesh_cacheToVertexBuffer},
+		{"ScenePrimitive", Polycore_ScenePrimitive},
+		{"SceneRenderTexture", Polycore_SceneRenderTexture},
+		{"SceneRenderTexture_drawScreen", Polycore_SceneRenderTexture_drawScreen},
+		{"SceneRenderTexture_getTargetTexture", Polycore_SceneRenderTexture_getTargetTexture},
+		{"SceneRenderTexture_getTargetScene", Polycore_SceneRenderTexture_getTargetScene},
+		{"SceneRenderTexture_getTargetCamera", Polycore_SceneRenderTexture_getTargetCamera},
 		{"Screen", Polycore_Screen},
 		{"Screen", Polycore_Screen},
 		{"Screen_addChild", Polycore_Screen_addChild},
 		{"Screen_addChild", Polycore_Screen_addChild},
 		{"Screen_removeChild", Polycore_Screen_removeChild},
 		{"Screen_removeChild", Polycore_Screen_removeChild},
 		{"Screen_setScreenOffset", Polycore_Screen_setScreenOffset},
 		{"Screen_setScreenOffset", Polycore_Screen_setScreenOffset},
 		{"Screen_getScreenOffset", Polycore_Screen_getScreenOffset},
 		{"Screen_getScreenOffset", Polycore_Screen_getScreenOffset},
+		{"Screen_Shutdown", Polycore_Screen_Shutdown},
+		{"Screen_Update", Polycore_Screen_Update},
+		{"Screen_getEntityAt", Polycore_Screen_getEntityAt},
+		{"Screen_Render", Polycore_Screen_Render},
+		{"Screen_setRenderer", Polycore_Screen_setRenderer},
+		{"Screen_setNormalizedCoordinates", Polycore_Screen_setNormalizedCoordinates},
 		{"Screen_setScreenShader", Polycore_Screen_setScreenShader},
 		{"Screen_setScreenShader", Polycore_Screen_setScreenShader},
+		{"Screen_handleEvent", Polycore_Screen_handleEvent},
 		{"Screen_getHighestZIndex", Polycore_Screen_getHighestZIndex},
 		{"Screen_getHighestZIndex", Polycore_Screen_getHighestZIndex},
 		{"Screen_sortChildren", Polycore_Screen_sortChildren},
 		{"Screen_sortChildren", Polycore_Screen_sortChildren},
+		{"Screen_cmpZindex", Polycore_Screen_cmpZindex},
+		{"Screen_handleInputEvent", Polycore_Screen_handleInputEvent},
 		{"Screen_hasFilterShader", Polycore_Screen_hasFilterShader},
 		{"Screen_hasFilterShader", Polycore_Screen_hasFilterShader},
-		{"Screen_setEnabled", Polycore_Screen_setEnabled},
-		{"Screen_getEnabled", Polycore_Screen_getEnabled},
-		
+		{"Screen_drawFilter", Polycore_Screen_drawFilter},
+		{"Screen_usesNormalizedCoordinates", Polycore_Screen_usesNormalizedCoordinates},
+		{"Screen_getYCoordinateSize", Polycore_Screen_getYCoordinateSize},
+		{"Screen_getRootEntity", Polycore_Screen_getRootEntity},
+		{"ScreenCurve", Polycore_ScreenCurve},
+		{"ScreenEntity", Polycore_ScreenEntity},
+		{"ScreenEntity_setPosition", Polycore_ScreenEntity_setPosition},
+		{"ScreenEntity_setScale", Polycore_ScreenEntity_setScale},
+		{"ScreenEntity_setRotation", Polycore_ScreenEntity_setRotation},
+		{"ScreenEntity_getRotation", Polycore_ScreenEntity_getRotation},
+		{"ScreenEntity__onMouseDown", Polycore_ScreenEntity__onMouseDown},
+		{"ScreenEntity__onMouseUp", Polycore_ScreenEntity__onMouseUp},
+		{"ScreenEntity__onMouseMove", Polycore_ScreenEntity__onMouseMove},
+		{"ScreenEntity__onMouseWheelUp", Polycore_ScreenEntity__onMouseWheelUp},
+		{"ScreenEntity__onMouseWheelDown", Polycore_ScreenEntity__onMouseWheelDown},
+		{"ScreenEntity_onMouseDown", Polycore_ScreenEntity_onMouseDown},
+		{"ScreenEntity_onMouseUp", Polycore_ScreenEntity_onMouseUp},
+		{"ScreenEntity_onMouseMove", Polycore_ScreenEntity_onMouseMove},
+		{"ScreenEntity_onMouseWheelUp", Polycore_ScreenEntity_onMouseWheelUp},
+		{"ScreenEntity_onMouseWheelDown", Polycore_ScreenEntity_onMouseWheelDown},
+		{"ScreenEntity__onKeyDown", Polycore_ScreenEntity__onKeyDown},
+		{"ScreenEntity__onKeyUp", Polycore_ScreenEntity__onKeyUp},
+		{"ScreenEntity_onKeyDown", Polycore_ScreenEntity_onKeyDown},
+		{"ScreenEntity_onKeyUp", Polycore_ScreenEntity_onKeyUp},
+		{"ScreenEntity_hitTest", Polycore_ScreenEntity_hitTest},
+		{"ScreenEntity_buildPositionMatrix", Polycore_ScreenEntity_buildPositionMatrix},
+		{"ScreenEntity_adjustMatrixForChildren", Polycore_ScreenEntity_adjustMatrixForChildren},
+		{"ScreenEntity_getWidth", Polycore_ScreenEntity_getWidth},
+		{"ScreenEntity_getHeight", Polycore_ScreenEntity_getHeight},
+		{"ScreenEntity_setWidth", Polycore_ScreenEntity_setWidth},
+		{"ScreenEntity_setHeight", Polycore_ScreenEntity_setHeight},
+		{"ScreenEntity_onGainFocus", Polycore_ScreenEntity_onGainFocus},
+		{"ScreenEntity_onLoseFocus", Polycore_ScreenEntity_onLoseFocus},
+		{"ScreenEntity_startDrag", Polycore_ScreenEntity_startDrag},
+		{"ScreenEntity_stopDrag", Polycore_ScreenEntity_stopDrag},
+		{"ScreenEntity_setBlendingMode", Polycore_ScreenEntity_setBlendingMode},
+		{"ScreenEntity_setPositionMode", Polycore_ScreenEntity_setPositionMode},
+		{"ScreenEntity_setDragLimits", Polycore_ScreenEntity_setDragLimits},
+		{"ScreenEntity_clearDragLimits", Polycore_ScreenEntity_clearDragLimits},
+		{"ScreenEntity_focusChild", Polycore_ScreenEntity_focusChild},
+		{"ScreenEntity_focusNextChild", Polycore_ScreenEntity_focusNextChild},
+		{"ScreenEntity_getPosition2D", Polycore_ScreenEntity_getPosition2D},
+		{"ScreenEntity_isFocusable", Polycore_ScreenEntity_isFocusable},
+		{"ScreenEvent", Polycore_ScreenEvent},
 		{"ScreenImage", Polycore_ScreenImage},
 		{"ScreenImage", Polycore_ScreenImage},
-		{"ScreenImage_setRotation", Polycore_ScreenImage_setRotation},				
-		{NULL, NULL}  /* sentinel */
+		{"ScreenImage_setImageCoordinates", Polycore_ScreenImage_setImageCoordinates},
+		{"ScreenImage_getImageWidth", Polycore_ScreenImage_getImageWidth},
+		{"ScreenImage_getImageHeight", Polycore_ScreenImage_getImageHeight},
+		{"ScreenLabel", Polycore_ScreenLabel},
+		{"ScreenLabel_addDropShadow", Polycore_ScreenLabel_addDropShadow},
+		{"ScreenLabel_setText", Polycore_ScreenLabel_setText},
+		{"ScreenLabel_getText", Polycore_ScreenLabel_getText},
+		{"ScreenLabel_getLabel", Polycore_ScreenLabel_getLabel},
+		{"ScreenLine", Polycore_ScreenLine},
+		{"ScreenLine_Update", Polycore_ScreenLine_Update},
+		{"ScreenLine_Render", Polycore_ScreenLine_Render},
+		{"ScreenLine_setLineWidth", Polycore_ScreenLine_setLineWidth},
+		{"ScreenManager", Polycore_ScreenManager},
+		{"ScreenManager_removeScreen", Polycore_ScreenManager_removeScreen},
+		{"ScreenManager_addScreen", Polycore_ScreenManager_addScreen},
+		{"ScreenManager_Update", Polycore_ScreenManager_Update},
+		{"ScreenManager_handleEvent", Polycore_ScreenManager_handleEvent},
+		{"ScreenMesh", Polycore_ScreenMesh},
+		{"ScreenMesh_Render", Polycore_ScreenMesh_Render},
+		{"ScreenMesh_getMesh", Polycore_ScreenMesh_getMesh},
+		{"ScreenMesh_getTexture", Polycore_ScreenMesh_getTexture},
+		{"ScreenMesh_loadTexture", Polycore_ScreenMesh_loadTexture},
+		{"ScreenMesh_setTexture", Polycore_ScreenMesh_setTexture},
+		{"ScreenShape", Polycore_ScreenShape},
+		{"ScreenShape_Render", Polycore_ScreenShape_Render},
+		{"ScreenShape_setStrokeColor", Polycore_ScreenShape_setStrokeColor},
+		{"ScreenShape_setStrokeWidth", Polycore_ScreenShape_setStrokeWidth},
+		{"ScreenShape_setGradient", Polycore_ScreenShape_setGradient},
+		{"ScreenShape_clearGradient", Polycore_ScreenShape_clearGradient},
+		{"ScreenShape_setShapeSize", Polycore_ScreenShape_setShapeSize},
+		{"ScreenShape_addShapePoint", Polycore_ScreenShape_addShapePoint},
+		{"ScreenSprite", Polycore_ScreenSprite},
+		{"ScreenSprite_addAnimation", Polycore_ScreenSprite_addAnimation},
+		{"ScreenSprite_playAnimation", Polycore_ScreenSprite_playAnimation},
+		{"ScreenSprite_Update", Polycore_ScreenSprite_Update},
+		{"SkeletonAnimation", Polycore_SkeletonAnimation},
+		{"SkeletonAnimation_addBoneTrack", Polycore_SkeletonAnimation_addBoneTrack},
+		{"SkeletonAnimation_getName", Polycore_SkeletonAnimation_getName},
+		{"SkeletonAnimation_Play", Polycore_SkeletonAnimation_Play},
+		{"SkeletonAnimation_Stop", Polycore_SkeletonAnimation_Stop},
+		{"SkeletonAnimation_Update", Polycore_SkeletonAnimation_Update},
+		{"SkeletonAnimation_setSpeed", Polycore_SkeletonAnimation_setSpeed},
+		{"Skeleton", Polycore_Skeleton},
+		{"Skeleton_loadSkeleton", Polycore_Skeleton_loadSkeleton},
+		{"Skeleton_playAnimation", Polycore_Skeleton_playAnimation},
+		{"Skeleton_playAnimationByIndex", Polycore_Skeleton_playAnimationByIndex},
+		{"Skeleton_addAnimation", Polycore_Skeleton_addAnimation},
+		{"Skeleton_getAnimation", Polycore_Skeleton_getAnimation},
+		{"Skeleton_Update", Polycore_Skeleton_Update},
+		{"Skeleton_getBoneByName", Polycore_Skeleton_getBoneByName},
+		{"Skeleton_bonesVisible", Polycore_Skeleton_bonesVisible},
+		{"Skeleton_enableBoneLabels", Polycore_Skeleton_enableBoneLabels},
+		{"Skeleton_getNumBones", Polycore_Skeleton_getNumBones},
+		{"Skeleton_getBone", Polycore_Skeleton_getBone},
+		{"Skeleton_getCurrentAnimation", Polycore_Skeleton_getCurrentAnimation},
+		{"BoneTrack", Polycore_BoneTrack},
+		{"BoneTrack_Play", Polycore_BoneTrack_Play},
+		{"BoneTrack_Stop", Polycore_BoneTrack_Stop},
+		{"BoneTrack_Update", Polycore_BoneTrack_Update},
+		{"BoneTrack_setSpeed", Polycore_BoneTrack_setSpeed},
+		{"Sound", Polycore_Sound},
+		{"Sound_Play", Polycore_Sound_Play},
+		{"Sound_Stop", Polycore_Sound_Stop},
+		{"Sound_loadWAV", Polycore_Sound_loadWAV},
+		{"Sound_loadOGG", Polycore_Sound_loadOGG},
+		{"Sound_GenSource", Polycore_Sound_GenSource},
+		{"Sound_checkALError", Polycore_Sound_checkALError},
+		{"Sound_soundError", Polycore_Sound_soundError},
+		{"Sound_soundCheck", Polycore_Sound_soundCheck},
+		{"SoundManager", Polycore_SoundManager},
+		{"SoundManager_initAL", Polycore_SoundManager_initAL},
+		{"String", Polycore_String},
+		{"String_size", Polycore_String_size},
+		{"String_length", Polycore_String_length},
+		{"String_getSTLString", Polycore_String_getSTLString},
+		{"String_getSTLWString", Polycore_String_getSTLWString},
+		{"String_substr", Polycore_String_substr},
+		{"String_rfind", Polycore_String_rfind},
+		{"String_find", Polycore_String_find},
+		{"String_toLowerCase", Polycore_String_toLowerCase},
+		{"String_split", Polycore_String_split},
+		{"String_replace", Polycore_String_replace},
+		{"String_NumberToString", Polycore_String_NumberToString},
+		{"String_c_str", Polycore_String_c_str},
+		{"String_wc_str", Polycore_String_wc_str},
+		{"String_data", Polycore_String_data},
+		{"String_getDataWithEncoding", Polycore_String_getDataWithEncoding},
+		{"String_setDataWithEncoding", Polycore_String_setDataWithEncoding},
+		{"String_getDataSizeWithEncoding", Polycore_String_getDataSizeWithEncoding},
+		{"Timer", Polycore_Timer},
+		{"Timer_Pause", Polycore_Timer_Pause},
+		{"Timer_isPaused", Polycore_Timer_isPaused},
+		{"Timer_getTicks", Polycore_Timer_getTicks},
+		{"Timer_Update", Polycore_Timer_Update},
+		{"Timer_Reset", Polycore_Timer_Reset},
+		{"Timer_hasElapsed", Polycore_Timer_hasElapsed},
+		{"Timer_getElapsedf", Polycore_Timer_getElapsedf},
+		{"TimerManager", Polycore_TimerManager},
+		{"TimerManager_removeTimer", Polycore_TimerManager_removeTimer},
+		{"TimerManager_addTimer", Polycore_TimerManager_addTimer},
+		{"TimerManager_Update", Polycore_TimerManager_Update},
+		{"Tween", Polycore_Tween},
+		{"Tween_handleEvent", Polycore_Tween_handleEvent},
+		{"Tween_interpolateTween", Polycore_Tween_interpolateTween},
+		{"Tween_updateCustomTween", Polycore_Tween_updateCustomTween},
+		{"Tween_doOnComplete", Polycore_Tween_doOnComplete},
+		{"Tween_Pause", Polycore_Tween_Pause},
+		{"Tween_Reset", Polycore_Tween_Reset},
+		{"Tween_isComplete", Polycore_Tween_isComplete},
+		{"Tween_setSpeed", Polycore_Tween_setSpeed},
+		{"BezierPathTween", Polycore_BezierPathTween},
+		{"BezierPathTween_updateCustomTween", Polycore_BezierPathTween_updateCustomTween},
+		{"QuaternionTween", Polycore_QuaternionTween},
+		{"QuaternionTween_updateCustomTween", Polycore_QuaternionTween_updateCustomTween},
+		{"TweenManager", Polycore_TweenManager},
+		{"TweenManager_addTween", Polycore_TweenManager_addTween},
+		{"TweenManager_Update", Polycore_TweenManager_Update},
+		{"Vector2", Polycore_Vector2},
+		{"Vector3", Polycore_Vector3},
+		{"Vector3_set", Polycore_Vector3_set},
+		{"Vector3_distance", Polycore_Vector3_distance},
+		{"Vector3_length", Polycore_Vector3_length},
+		{"Vector3_dot", Polycore_Vector3_dot},
+		{"Vector3_crossProduct", Polycore_Vector3_crossProduct},
+		{"Vector3_Normalize", Polycore_Vector3_Normalize},
+		{"Vertex", Polycore_Vertex},
+		{"Vertex_addBoneAssignment", Polycore_Vertex_addBoneAssignment},
+		{"Vertex_getNumBoneAssignments", Polycore_Vertex_getNumBoneAssignments},
+		{"Vertex_getBoneAssignment", Polycore_Vertex_getBoneAssignment},
+		{"Vertex_normalizeWeights", Polycore_Vertex_normalizeWeights},
+		{"Vertex_getTexCoord", Polycore_Vertex_getTexCoord},
+		{"Vertex_setTexCoord", Polycore_Vertex_setTexCoord},
+		{"Vertex_setNormal", Polycore_Vertex_setNormal},
+		{NULL, NULL}
 	};
 	};
 	luaL_openlib(L, "Polycore", polycodeLib, 0);
 	luaL_openlib(L, "Polycore", polycodeLib, 0);
-	return 1;	
+	return 1;
 }
 }

+ 669 - 0
Bindings/Scripts/create_lua_library/CppHeaderParser.py

@@ -0,0 +1,669 @@
+#!/usr/bin/python
+#
+# Author: Jashua R. Cloutier (contact via sourceforge username:senexcanis)
+#
+# Copyright (C) 2010, Jashua R. Cloutier
+# All rights reserved.
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions
+# are met:
+#
+# * Redistributions of source code must retain the above copyright
+#   notice, this list of conditions and the following disclaimer.
+#
+# * Redistributions in binary form must reproduce the above copyright
+#   notice, this list of conditions and the following disclaimer in
+#   the documentation and/or other materials provided with the
+#   distribution.
+#
+# * Neither the name of Jashua R. Cloutier nor the names of its
+#   contributors may be used to endorse or promote products derived from
+#   this software without specific prior written permission.
+#
+# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
+# FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
+# COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
+# INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
+# BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+# LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
+# CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
+# ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+# POSSIBILITY OF SUCH DAMAGE.
+#
+#
+# The CppHeaderParser.py script is written in Python 2.4 and released to
+# the open source community for continuous improvements under the BSD
+# 2.0 new license, which can be found at:
+#
+#   http://www.opensource.org/licenses/bsd-license.php
+#
+"""Parse C++ header files and generate a data structure
+representing the class
+"""
+
+import ply.lex as lex
+import os
+import sys
+import re
+
+import inspect
+
+def lineno():
+    """Returns the current line number in our program."""
+    return inspect.currentframe().f_back.f_lineno
+
+
+__version__ = "1.9"
+version = "1.9"
+tokens = [
+    'NUMBER',
+    'NAME',
+    'OPEN_PAREN',
+    'CLOSE_PAREN',
+    'OPEN_BRACE',
+    'CLOSE_BRACE',
+    'COLON',
+    'SEMI_COLON',
+    'COMMA',
+    'COMMENT_SINGLELINE',
+    'COMMENT_MULTILINE',
+    'PRECOMP_MACRO',
+    'PRECOMP_MACRO_CONT', 
+    'ASTERISK',
+    'AMPERSTAND',
+    'EQUALS',
+    'MINUS',
+    'PLUS',  
+    'DIVIDE', 
+    'CHAR_LITERAL', 
+    'STRING_LITERAL',
+    'OPERATOR_DIVIDE_OVERLOAD', 
+    'NEW_LINE',
+]
+
+t_ignore = " \t\r[].|!?%@"
+t_NUMBER = r'[0-9][0-9XxA-Fa-f]*'
+t_NAME = r'[<>A-Za-z_~][A-Za-z0-9_]*'
+t_OPERATOR_DIVIDE_OVERLOAD = r'/='
+t_OPEN_PAREN = r'\('
+t_CLOSE_PAREN = r'\)'
+t_OPEN_BRACE = r'{'
+t_CLOSE_BRACE = r'}'
+t_SEMI_COLON = r';'
+t_COLON = r':'
+t_COMMA = r','
+t_PRECOMP_MACRO = r'\#.*'
+t_PRECOMP_MACRO_CONT = r'.*\\\n'
+def t_COMMENT_SINGLELINE(t):
+    r'\/\/.*\n'
+    global doxygenCommentCache
+    if t.value.startswith("///") or t.value.startswith("//!"):
+        if doxygenCommentCache:
+            doxygenCommentCache += "\n"
+        if t.value.endswith("\n"):
+            doxygenCommentCache += t.value[:-1]
+        else:
+            doxygenCommentCache += t.value
+t_ASTERISK = r'\*'
+t_MINUS = r'\-'
+t_PLUS = r'\+'
+t_DIVIDE = r'/[^/]'
+t_AMPERSTAND = r'&'
+t_EQUALS = r'='
+t_CHAR_LITERAL = "'.'"
+#found at http://wordaligned.org/articles/string-literals-and-regular-expressions
+#TODO: This does not work with the string "bla \" bla"
+t_STRING_LITERAL = r'"([^"\\]|\\.)*"'
+#Found at http://ostermiller.org/findcomment.html
+def t_COMMENT_MULTILINE(t):
+    r'/\*([^*]|[\r\n]|(\*+([^*/]|[\r\n])))*\*+/'
+    global doxygenCommentCache
+    if t.value.startswith("/**") or t.value.startswith("/*!"):
+        #not sure why, but get double new lines
+        v = t.value.replace("\n\n", "\n")
+        #strip prefixing whitespace
+        v = re.sub("\n[\s]+\*", "\n*", v)
+        doxygenCommentCache += v
+def t_NEWLINE(t):
+    r'\n+'
+    t.lexer.lineno += len(t.value)
+
+def t_error(v):
+    print "Lex error: ", v
+
+lex.lex()
+debug = 0
+
+supportedAccessSpecifier = [
+    'public',
+    'protected', 
+    'private'
+]
+
+doxygenCommentCache = ""
+
+def is_namespace(nameStack):
+    """Determines if a namespace is being specified"""
+    if len(nameStack) == 0:
+        return False
+    if nameStack[0] == "namespace":
+        return True
+    return False
+
+def is_enum_namestack(nameStack):
+    """Determines if a namestack is an enum namestack"""
+    if len(nameStack) == 0:
+        return False
+    if nameStack[0] == "enum":
+        return True
+    if len(nameStack) > 1 and nameStack[0] == "typedef" and nameStack[1] == "enum":
+        return True
+    return False
+
+class CppParseError(Exception): pass
+    
+class CppClass(dict):
+    """Takes a name stack and turns it into a class
+    
+    Contains the following Keys:
+    self['name'] - Name of the class
+    self['doxygen'] - Doxygen comments associated with the class if they exist
+    self['inherits'] - List of Classes that this one inherits where the values
+        are of the form {"access": Anything in supportedAccessSpecifier
+                                  "class": Name of the class
+    self['methods'] - Dictionary where keys are from supportedAccessSpecifier
+        and values are a lists of CppMethod's
+    self['properties'] - Dictionary where keys are from supportedAccessSpecifier
+        and values are lists of CppVariable's 
+    self['enums'] - Dictionary where keys are from supportedAccessSpecifier and
+        values are lists of CppEnum's
+    
+    An example of how this could look is as follows:
+    #self =
+    {
+        'name': ""
+        'inherits':[]
+        'methods':
+        {
+            'public':[],
+            'protected':[], 
+            'private':[]
+        }, 
+        'properties':
+        {
+            'public':[],
+            'protected':[], 
+            'private':[]
+        },
+        'enums':
+        {
+            'public':[],
+            'protected':[], 
+            'private':[]
+        }
+    }
+    """
+    def __init__(self, nameStack):
+        if (debug): print "Class:   ",  nameStack
+        if (len(nameStack) < 2):
+            print "Error detecting class"
+            return
+        global doxygenCommentCache
+        if len(doxygenCommentCache):
+            self["doxygen"] = doxygenCommentCache
+            doxygenCommentCache = ""
+        self["name"] = nameStack[1]
+        inheritList = []
+        if ":" in nameStack:
+            nameStack = nameStack[nameStack.index(":") + 1:]
+            while len(nameStack):
+                tmpStack = []
+                tmpInheritClass = {"access":"private"}
+                if "," in nameStack:
+                    tmpStack = nameStack[:nameStack.index(",")]
+                    nameStack = nameStack[nameStack.index(",") + 1:]
+                else:
+                    tmpStack = nameStack
+                    nameStack = []
+                if len(tmpStack) == 0:
+                    break;
+                elif len(tmpStack) == 1:
+                    tmpInheritClass["class"] = tmpStack[0]
+                elif len(tmpStack) == 2:
+                    tmpInheritClass["access"] = tmpStack[0]
+                    tmpInheritClass["class"] = tmpStack[1]
+                else:
+                    print "Warning: Cant figure out class inheriting %s\n"%(" ".join(tmpStack))
+                    continue
+                inheritList.append(tmpInheritClass)
+        methodAccessSpecificList = {}
+        propertyAccessSpecificList = {}
+        enumAccessSpecificList = {}
+        
+        for accessSpecifier in supportedAccessSpecifier:
+            methodAccessSpecificList[accessSpecifier] = []
+            propertyAccessSpecificList[accessSpecifier] = []
+            enumAccessSpecificList[accessSpecifier] = []
+        self['inherits'] = inheritList
+        self['methods'] = methodAccessSpecificList
+        self['properties'] = propertyAccessSpecificList
+        self['enums'] = enumAccessSpecificList
+        self['namespace'] = ""
+
+    def __repr__(self):
+        """Convert class to a string"""
+        namespace_prefix = ""
+        if self["namespace"]: namespace_prefix = self["namespace"] + "::"
+        rtn = "class %s\n"%(namespace_prefix + self["name"])
+        try:
+            print self["doxygen"], 
+        except: pass
+        if "inherits" in self.keys():
+            rtn += "Inherits: "
+            for inheritClass in self["inherits"]:
+                rtn += "%s %s, "%(inheritClass["access"], inheritClass["class"])
+            rtn += "\n"
+        rtn += "{\n"
+        for accessSpecifier in supportedAccessSpecifier:
+            rtn += "%s\n"%(accessSpecifier)
+            #Enums
+            if (len(self["enums"][accessSpecifier])):
+                rtn += "    // Enums\n"
+            for enum in self["enums"][accessSpecifier]:
+                rtn += "    %s\n"%(repr(enum))
+            #Properties
+            if (len(self["properties"][accessSpecifier])):
+                rtn += "    // Properties\n"
+            for property in self["properties"][accessSpecifier]:
+                rtn += "    %s\n"%(repr(property))
+            #Methods
+            if (len(self["methods"][accessSpecifier])):
+                rtn += "    // Method\n"
+            for method in self["methods"][accessSpecifier]:
+                rtn += "    %s\n"%(repr(method))
+        rtn += "}\n"
+        return rtn
+
+class CppMethod(dict):
+    """Takes a name stack and turns it into a method
+    
+    Contains the following Keys:
+    self['rtnType'] - Return type of the method (ex. "int")
+    self['name'] - Name of the method (ex. "getSize")
+    self['doxygen'] - Doxygen comments associated with the method if they exist
+    self['parameters'] - List of CppVariables
+    """
+    def __init__(self, nameStack, curClass):
+        if (debug): print "Method:   ",  nameStack
+        global doxygenCommentCache
+        if len(doxygenCommentCache):
+            self["doxygen"] = doxygenCommentCache
+            doxygenCommentCache = ""
+        if "operator" in nameStack:
+            self["rtnType"] = " ".join(nameStack[:nameStack.index('operator')])
+            self["name"] = "".join(nameStack[nameStack.index('operator'):nameStack.index('(')])
+        else:
+            self["rtnType"] = " ".join(nameStack[:nameStack.index('(') - 1])
+            self["name"] = " ".join(nameStack[nameStack.index('(') - 1:nameStack.index('(')])
+        if len(self["rtnType"]) == 0 or self["name"] == curClass:
+            self["rtnType"] = "void"
+        paramsStack = nameStack[nameStack.index('(') + 1: ]
+        #Remove things from the stack till we hit the last paren, this helps handle abstract and normal methods
+        while (paramsStack[-1]  != ")"):
+            paramsStack.pop()
+        paramsStack.pop()
+        params = []
+        #See if there is a doxygen comment for the variable
+        doxyVarDesc = {}
+        #TODO: Put this into a class
+        if self.has_key("doxygen"):
+            doxyLines = self["doxygen"].split("\n")
+            lastParamDesc = ""
+            for doxyLine in doxyLines:
+                if " @param " in doxyLine or " \param " in doxyLine:
+                    try:
+                        #Strip out the param
+                        doxyLine = doxyLine[doxyLine.find("param ") + 6:]
+                        (var, desc) = doxyLine.split(" ", 1)
+                        doxyVarDesc[var] = desc.strip()
+                        lastParamDesc = var
+                    except: pass
+                elif " @return " in doxyLine or " \return " in doxyLine:
+                    lastParamDesc = ""
+                    # not handled for now
+                elif lastParamDesc:
+                    try:
+                        doxyLine = doxyLine.strip()
+                        if " " not in doxyLine:
+                            lastParamDesc = ""
+                            continue
+                        doxyLine = doxyLine[doxyLine.find(" ") + 1:]
+                        doxyVarDesc[lastParamDesc] += " " + doxyLine
+                    except: pass
+        
+        #Create the variable now
+        while (len(paramsStack)):
+            if (',' in paramsStack):
+                params.append(CppVariable(paramsStack[0:paramsStack.index(',')],  doxyVarDesc=doxyVarDesc))
+                paramsStack = paramsStack[paramsStack.index(',') + 1:]
+            else:
+                param = CppVariable(paramsStack,  doxyVarDesc=doxyVarDesc)
+                if len(param.keys()):
+                    params.append(param)
+                break
+        self["parameters"] = params
+
+
+class CppVariable(dict):
+    """Takes a name stack and turns it into a method
+    
+    Contains the following Keys:
+    self['type'] - Type for the variable (ex. "const string &")
+    self['name'] - Name of the variable (ex. "numItems")
+    self['namespace'] - Namespace containing the enum
+    self['desc'] - Description of the variable if part of a method (optional)
+    self['doxygen'] - Doxygen comments associated with the method if they exist
+    self['defaltValue'] - Default value of the variable, this key will only
+        exist if there is a default value
+    """
+    def __init__(self, nameStack,  **kwargs):
+        if (debug): print "Variable: ",  nameStack
+        if (len(nameStack) < 2):
+            return
+        global doxygenCommentCache
+        if len(doxygenCommentCache):
+            self["doxygen"] = doxygenCommentCache
+            doxygenCommentCache = ""
+        if ("=" in nameStack):
+            self["type"] = " ".join(nameStack[:nameStack.index("=") - 1])
+            self["name"] = nameStack[nameStack.index("=") - 1]
+            self["defaltValue"] = " ".join(nameStack[nameStack.index("=") + 1:])
+        else:
+            self["type"] = " ".join(nameStack[:-1])
+            self["name"] = nameStack[-1]
+        self["type"] = self["type"].replace(" :",":")
+        self["type"] = self["type"].replace(": ",":")
+        self["type"] = self["type"].replace(" <","<")
+        self["type"] = self["type"].replace(" >",">")
+        #Optional doxygen description
+        try:
+            self["desc"] = kwargs["doxyVarDesc"][self["name"]]
+        except: pass
+
+class CppEnum(dict):
+    """Takes a name stack and turns it into an Enum
+    
+    Contains the following Keys:
+    self['name'] - Name of the enum (ex. "ItemState")
+    self['namespace'] - Namespace containing the enum
+    self['values'] - List of values where the values are a dictionary of the
+        form {"name": name of the key (ex. "PARSING_HEADER"),
+                  "value": Specified value of the enum, this key will only exist
+                    if a value for a given enum value was defined
+                }
+    """
+    def __init__(self, nameStack):
+        if len(nameStack) < 4 or "{" not in nameStack or "}" not in nameStack:
+            #Not enough stuff for an enum
+            return
+        global doxygenCommentCache
+        if len(doxygenCommentCache):
+            self["doxygen"] = doxygenCommentCache
+            doxygenCommentCache = ""
+        valueList = []
+        #Figure out what values it has
+        valueStack = nameStack[nameStack.index('{') + 1: nameStack.index('}')]
+        while len(valueStack):
+            tmpStack = []
+            if "," in valueStack:
+                tmpStack = valueStack[:valueStack.index(",")]
+                valueStack = valueStack[valueStack.index(",") + 1:]
+            else:
+                tmpStack = valueStack
+                valueStack = []
+            if len(tmpStack) == 1:
+                valueList.append({"name": tmpStack[0]})
+            elif len(tmpStack) >= 3 and tmpStack[1] == "=":
+                valueList.append({"name": tmpStack[0], "value": " ".join(tmpStack[2:])})
+            elif len(tmpStack) == 2 and tmpStack[1] == "=":
+                if (debug): print "Missed value for %s"%tmpStack[0]
+                valueList.append({"name": tmpStack[0]})
+        if len(valueList):
+            self["values"] = valueList
+        else:
+            #An enum without any values is useless, dont bother existing
+            return
+        #Figure out if it has a name
+        preBraceStack = nameStack[:nameStack.index("{")]
+        postBraceStack = nameStack[nameStack.index("}") + 1:]
+        if (len(preBraceStack) == 2 and "typedef" not in nameStack):
+            self["name"] = preBraceStack[1]           
+        elif len(postBraceStack) and "typedef" in nameStack:
+                self["name"] = " ".join(postBraceStack)
+        #See if there are instances of this
+        if "typedef" not in nameStack and len(postBraceStack):
+            self["instances"] = []
+            for var in postBraceStack:
+                if "," in var:
+                    continue
+                self["instances"].append(var)
+        self["namespace"] = ""
+
+class CppHeader:
+    """Parsed C++ class header
+    
+    Variables produced:
+    self.classes - Dictionary of classes found in a given header file where the
+        key is the name of the class
+    """
+    def __init__(self, headerFileName, argType = "file"):
+        if (argType == "file"):
+            self.headerFileName = os.path.expandvars(headerFileName)
+            self.mainClass = os.path.split(self.headerFileName)[1][:-2]
+            headerFileStr = ""
+#            if headerFileName[-2:] != ".h":
+#                raise Exception("file must be a header file and end with .h")
+        elif argType == "string":
+            self.headerFileName = ""
+            self.mainClass = "???"
+            headerFileStr = headerFileName
+        else:
+            raise Exception("Arg type must be either file or string")
+        self.curClass = ""
+        self.classes = {}
+        self.enums = []
+        self.nameStack = []
+        self.nameSpaces = []
+        self.curAccessSpecifier = 'private'
+    
+        if (len(self.headerFileName)):
+            headerFileStr = "\n".join(open(self.headerFileName).readlines())
+        self.braceDepth = 0
+        lex.input(headerFileStr)
+        curLine = 0
+        curChar = 0
+        try:
+            while True:
+                tok = lex.token()
+                # Example: LexToken(COLON,';',1,373)
+                # where (tok.name, tok.value, ?, ?)
+                if not tok:
+                    break
+                curLine = tok.lineno
+                curChar = tok.lexpos
+                if (tok.type == 'OPEN_BRACE'):
+                    if len(self.nameStack) and is_namespace(self.nameStack):
+                        self.nameSpaces.append(self.nameStack[1])
+                    if len(self.nameStack) and not is_enum_namestack(self.nameStack):
+                        self.evaluate_stack()
+                    else:
+                        self.nameStack.append(tok.value)
+                    self.braceDepth += 1
+                elif (tok.type == 'CLOSE_BRACE'):
+                    if self.braceDepth == 0:
+                        continue
+                    if (self.braceDepth == len(self.nameSpaces)):
+                        tmp = self.nameSpaces.pop()
+                    if len(self.nameStack) and is_enum_namestack(self.nameStack):
+                        self.nameStack.append(tok.value)
+                    elif self.braceDepth < 10:
+                        self.evaluate_stack()
+                    else:
+                        self.nameStack = []
+                    self.braceDepth -= 1
+                    if (self.braceDepth == 0):
+                        self.curClass = ""
+                
+                if (tok.type == 'OPEN_PAREN'):
+                    self.nameStack.append(tok.value)
+                elif (tok.type == 'CLOSE_PAREN'):
+                    self.nameStack.append(tok.value)
+                elif (tok.type == 'EQUALS'):
+                    self.nameStack.append(tok.value)
+                elif (tok.type == 'COMMA'):
+                    self.nameStack.append(tok.value)
+                elif (tok.type == 'NUMBER'):
+                    self.nameStack.append(tok.value)
+                elif (tok.type == 'MINUS'):
+                    self.nameStack.append(tok.value)
+                elif (tok.type == 'PLUS'):
+                    self.nameStack.append(tok.value)
+                elif (tok.type == 'STRING_LITERAL'):
+                    self.nameStack.append(tok.value)
+                elif (tok.type == 'NAME' or tok.type == 'AMPERSTAND' or tok.type == 'ASTERISK'):
+                    if (tok.value == 'class'):
+                        self.nameStack.append(tok.value)
+                    elif (tok.value in supportedAccessSpecifier and self.braceDepth == len(self.nameSpaces) + 1):
+                        self.curAccessSpecifier = tok.value
+                    else:
+                        self.nameStack.append(tok.value)
+                elif (tok.type == 'COLON'):
+                    #Dont want colon to be first in stack
+                    if len(self.nameStack) == 0:
+                        continue
+                    self.nameStack.append(tok.value)
+                elif (tok.type == 'SEMI_COLON'):
+                    if (self.braceDepth < 10):
+                        self.evaluate_stack()
+        except:
+            raise CppParseError("Not able to parse %s on line %d evaluating \"%s\"\nError around: %s"
+                                % (self.headerFileName, tok.lineno, tok.value, " ".join(self.nameStack)))
+        
+    def evaluate_stack(self):
+        """Evaluates the current name stack"""
+        global doxygenCommentCache
+        if (debug): print "Evaluating stack %s at..."%self.nameStack
+        if (len(self.curClass)):
+            if (debug): print "%s (%s) "%(self.curClass, self.curAccessSpecifier), 
+        if (len(self.nameStack) == 0):
+            if (debug): print "line ",lineno()
+            if (debug): print "(Empty Stack)"
+            return
+        elif (self.nameStack[0] == "namespace"):
+            #Taken care of outside of here
+            pass
+        elif (self.nameStack[0] == "class"):
+            if (debug): print "line ",lineno()
+            self.evaluate_class_stack()
+        elif (self.nameStack[0] == "struct"):
+            if (debug): print "line ",lineno()
+            self.curAccessSpecifier = "public"
+            self.evaluate_class_stack()
+        elif (len(self.curClass) == 0):
+            if (debug): print "line ",lineno()
+            if is_enum_namestack(self.nameStack):
+                self.evaluate_enum_stack()
+            self.nameStack = []
+            doxygenCommentCache = ""
+            return
+        elif (self.braceDepth < 1):
+            if (debug): print "line ",lineno()
+            #Ignore global stuff for now
+            if (debug): print "Global stuff: ",  self.nameStack
+            self.nameStack = []
+            doxygenCommentCache = ""
+            return
+        elif (self.braceDepth > len(self.nameSpaces) + 1):
+            if (debug): print "line ",lineno()
+            self.nameStack = []
+            doxygenCommentCache = ""
+            return
+        elif is_enum_namestack(self.nameStack):
+            if (debug): print "line ",lineno()
+            #elif self.nameStack[0] == "enum":
+            self.evaluate_enum_stack()
+        elif ('(' in self.nameStack):
+            if (debug): print "line ",lineno()
+            self.evaluate_method_stack()
+        else:
+            if (debug): print "line ",lineno()
+            self.evaluate_property_stack()
+        self.nameStack = []
+        doxygenCommentCache = ""
+    
+    def evaluate_class_stack(self):
+        """Create a Class out of the name stack (but not its parts)"""
+        #dont support sub classes today
+        if self.braceDepth != len(self.nameSpaces):
+            return
+        newClass = CppClass(self.nameStack)
+        if len(newClass.keys()):
+            self.curClass = newClass["name"]
+            self.classes[self.curClass] = newClass
+        else:
+            self.curClass = ""
+        newClass["namespace"] = self.cur_namespace()
+
+    def evaluate_method_stack(self):
+        """Create a method out of the name stack"""
+        newMethod = CppMethod(self.nameStack, self.curClass)
+        if len(newMethod.keys()):
+            self.classes[self.curClass]["methods"][self.curAccessSpecifier].append(newMethod)
+    
+    def evaluate_property_stack(self):
+        """Create a Property out of the name stack"""
+        newVar = CppVariable(self.nameStack)
+        if len(newVar.keys()):
+            self.classes[self.curClass]["properties"][self.curAccessSpecifier].append(newVar)
+
+    def evaluate_enum_stack(self):
+        """Create an Enum out of the name stack"""
+        newEnum = CppEnum(self.nameStack)
+        if len(newEnum.keys()):
+            if len(self.curClass):
+                newEnum["namespace"] = self.cur_namespace()
+                self.classes[self.curClass]["enums"][self.curAccessSpecifier].append(newEnum)
+            else:
+                newEnum["namespace"] = self.cur_namespace()                            
+#                print "Adding global enum"
+                self.enums.append(newEnum)
+            #This enum has instances, turn them into properties
+            if newEnum.has_key("instances"):
+                instanceType = "enum"
+                if newEnum.has_key("name"):
+                    instanceType = newEnum["name"]
+                for instance in newEnum["instances"]:
+                    self.nameStack = [instanceType,  instance]
+                    self.evaluate_property_stack()
+                del newEnum["instances"]
+
+    def cur_namespace(self, add_double_colon = False):
+        rtn = ""
+        i = 0
+        while i < len(self.nameSpaces):
+            rtn += self.nameSpaces[i]
+            if add_double_colon or i < len(self.nameSpaces) - 1:
+                rtn += "::"
+            i+=1
+        return rtn
+    
+    
+    def __repr__(self):
+        rtn = ""
+        for className in self.classes.keys():
+            rtn += repr(self.classes[className])
+        return rtn

BIN
Bindings/Scripts/create_lua_library/CppHeaderParser.pyc


+ 200 - 0
Bindings/Scripts/create_lua_library/create_lua_library.py

@@ -0,0 +1,200 @@
+import sys
+import CppHeaderParser
+import os
+
+out = ""
+sout = ""
+
+lfout = ""
+
+sout += "#include \"PolycodeLUA.h\"\n"
+sout += "#include \"PolycodeLUAWrappers.h\"\n\n"
+
+sout += "int luaopen_Polycode(lua_State *L) {\n"
+sout += "\tstatic const struct luaL_reg polycodeLib [] = {"
+
+out += "#pragma once\n\n"
+out += "#include <Polycode.h>\n\n"
+out += "#include <PolyGLRenderer.h>\n\n"
+
+out += "extern \"C\" {\n\n"
+out += "#include <stdio.h>\n"
+out += "#include \"lua.h\"\n"
+out += "#include \"lualib.h\"\n"
+out += "#include \"lauxlib.h\"\n\n"
+
+
+files = os.listdir("../../../Core/Contents/Include")
+for fileName in files:
+	ignore = ["PolyCocoaCore", "PolyAGLCore", "PolyGLES1Renderer", "PolyGLRenderer", "tinyxml", "tinystr", "PolyiPhoneCore", "PolyGLES1Texture", "PolyGLTexture", "PolyGLVertexBuffer", "PolyRenderer", "PolyThreaded", "PolyTexture", "PolyShader", "PolyScene"]
+	if fileName.split(".")[1] == "h" and fileName.split(".")[0] not in ignore:
+		headerFile = "../../../Core/Contents/Include/%s" % fileName
+		print "Parsing %s" % fileName
+		try:
+			f = open(headerFile)
+			contents = f.read().replace("_PolyExport", "")
+			cppHeader = CppHeaderParser.CppHeader(contents, "string")
+			ignore_classes = ["ParticleEmitter", "PolycodeShaderModule", "Core", "Object", "Shader", "Texture", "Scene", "Threaded", "Renderer", "ShaderBinding"]
+			for ckey in cppHeader.classes:
+				c = cppHeader.classes[ckey]
+				lout = ""
+				inherits = False
+				if len(c["inherits"]) > 0:
+					if c["inherits"][0]["class"] not in ignore_classes:
+						lout += "require \"Polycode/%s\"\n\n" % (c["inherits"][0]["class"])
+						lout += "class \"%s\" (%s)\n\n" % (ckey, c["inherits"][0]["class"])
+						inherits = True
+				if inherits == False:
+					lout += "class \"%s\"\n\n" % ckey
+		
+				if len(c["methods"]["public"]) < 2 or ckey in ignore_classes:
+					continue
+
+				if ckey == "OSFileEntry":
+					print c["methods"]["public"]
+				parsed_methods = []
+				ignore_methods = ["readByte32", "readByte16", "getCustomEntitiesByType"]
+				for pm in c["methods"]["public"]:
+					if pm["name"] in parsed_methods or pm["name"].find("operator") > -1 or pm["name"] in ignore_methods:
+						continue 
+
+					if pm["name"] == "~"+ckey:
+						out += ""
+					else:
+						if pm["name"] == ckey:
+							sout += "\t\t{\"%s\", Polycore_%s},\n" % (ckey, ckey)
+							out += "static int Polycore_%s(lua_State *L) {\n" % (ckey)
+							idx = 1
+						else: 
+							sout += "\t\t{\"%s_%s\", Polycore_%s_%s},\n" % (ckey, pm["name"], ckey, pm["name"])
+							out += "static int Polycore_%s_%s(lua_State *L) {\n" % (ckey, pm["name"])
+							out += "\tluaL_checktype(L, 1, LUA_TLIGHTUSERDATA);\n"
+							out += "\t%s *inst = (%s*)lua_topointer(L, 1);\n" % (ckey.replace("Polygon", "Polycode::Polygon"), ckey.replace("Polygon", "Polycode::Polygon"))
+							idx = 2
+						paramlist = []
+						lparamlist = []
+						for param in pm["parameters"]:
+							if not param.has_key("type"):
+								continue
+							if param["type"] == "0":
+								continue
+
+							param["name"] = param["name"].replace("end", "_end").replace("repeat", "_repeat")
+							if"type" in param:
+								luatype = "LUA_TLIGHTUSERDATA"
+								if param["type"].find("*") > -1:
+									luafunc = "(%s)lua_topointer" % (param["type"].replace("Polygon", "Polycode::Polygon"))
+								elif param["type"].find("&") > -1:
+									luafunc = "*(%s*)lua_topointer" % (param["type"].replace("const", "").replace("&", "").replace("Polygon", "Polycode::Polygon"))
+								else:
+									luafunc = "*(%s*)lua_topointer" % (param["type"])
+								lend = ".__ptr"
+								if param["type"] == "int" or param["type"] == "unsigned int":
+									luafunc = "lua_tointeger"
+									luatype = "LUA_TNUMBER"
+									lend = ""
+								if param["type"] == "bool":
+									luafunc = "lua_toboolean"
+									luatype = "LUA_TBOOLEAN"
+									lend = ""
+								if param["type"] == "Number":
+									luatype = "LUA_TNUMBER"
+									luafunc = "lua_tonumber"
+									lend = ""
+								if param["type"] == "String":
+									luatype = "LUA_TSTRING"
+									luafunc = "lua_tostring"
+									lend = ""
+								
+								param["type"] = param["type"].replace("Polygon", "Polycode::Polygon")
+
+								out += "\tluaL_checktype(L, %d, %s);\n" % (idx, luatype);
+								out += "\t%s %s = %s(L, %d);\n" % (param["type"], param["name"], luafunc, idx)
+								paramlist.append(param["name"])
+							
+								lparamlist.append(param["name"]+lend)
+								idx = idx +1
+					
+						if pm["name"] == ckey:
+							out += "\t%s *inst = new %s(%s);\n" % (ckey.replace("Polygon", "Polycode::Polygon"), ckey.replace("Polygon", "Polycode::Polygon"), ", ".join(paramlist))
+							out += "\tlua_pushlightuserdata(L, (void*)inst);\n"
+							out += "\treturn 1;\n"
+						else:
+							call = "inst->%s(%s)" % (pm["name"], ", ".join(paramlist))
+							if pm["rtnType"] == "void" or pm["rtnType"] == "static void" or pm["rtnType"] == "virtual void" or pm["rtnType"] == "inline void":
+								out += "\t%s;\n" % (call)
+								out += "\treturn 0;\n"
+							else:
+								outfunc = "lua_pushlightuserdata"
+								basicType = False
+								retFunc = ""
+								if pm["rtnType"] == "Number" or  pm["rtnType"] == "inline Number":
+									outfunc = "lua_pushnumber"
+									basicType = True
+								if pm["rtnType"] == "String" or pm["rtnType"] == "static String":
+									outfunc = "lua_pushstring"
+									basicType = True
+									retFunc = ".c_str()"
+								if pm["rtnType"] == "int" or pm["rtnType"] == "static int" or  pm["rtnType"] == "size_t" or pm["rtnType"] == "static size_t" or pm["rtnType"] == "long" or pm["rtnType"] == "unsigned int" or pm["rtnType"] == "static long":
+									outfunc = "lua_pushinteger"
+									basicType = True
+								if pm["rtnType"] == "bool" or pm["rtnType"] == "static bool" or pm["rtnType"] == "virtual bool":
+									outfunc = "lua_pushboolean"
+									basicType = True
+
+								if pm["rtnType"].find("*") > -1:
+									out += "\t%s(L, (void*)%s%s);\n" % (outfunc, call, retFunc)
+								elif basicType == True:
+									out += "\t%s(L, %s%s);\n" % (outfunc, call, retFunc)
+								else:
+									className = pm["rtnType"].replace("const", "").replace("&", "").replace("inline", "").replace("virtual", "").replace("static", "")
+									if className == "Polygon":
+										className = "Polycode::Polygon"
+									out += "\t%s *retInst = new %s();\n" % (className, className)
+									out += "\t*retInst = %s;\n" % (call)
+									out += "\t%s(L, retInst);\n" % (outfunc)
+								out += "\treturn 1;\n"
+						out += "}\n\n"
+							
+						if pm["name"] == ckey:
+							lout += "function %s:%s(%s)\n" % (ckey, ckey, ", ".join(paramlist))
+							lout += "\tif self.__ptr == nil then\n"
+							lout += "\t\tself.__ptr = Polycore.%s(%s)\n" % (ckey, ", ".join(paramlist))
+							lout += "\tend\n"
+							lout += "end\n\n"
+						else:
+							lout += "function %s:%s(%s)\n" % (ckey, pm["name"], ", ".join(paramlist))
+							if len(lparamlist):
+								lout += "\treturn Polycore.%s_%s(self.__ptr, %s)\n" % (ckey, pm["name"], ", ".join(lparamlist))
+							else:
+								lout += "\treturn Polycore.%s_%s(self.__ptr)\n" % (ckey, pm["name"])
+							lout += "end\n\n"
+
+					parsed_methods.append(pm["name"])
+				lfout += "require \"Polycode/%s\"\n" % ckey
+				fout = open("../../Contents/LUA/API/Polycode/%s.lua" % ckey, "w")
+				fout.write(lout)
+		except CppHeaderParser.CppParseError,  e:
+			print e
+			sys.exit(1)
+		
+out += "}"
+
+sout += "\t\t{NULL, NULL}\n"
+sout += "\t};\n"
+sout += "\tluaL_openlib(L, \"Polycore\", polycodeLib, 0);\n"
+sout += "\treturn 1;\n"
+sout += "}"
+
+
+fout = open("../../Contents/LUA/API/Polycode.lua", "w")
+fout.write(lfout)
+
+fout = open("../../Contents/LUA/Include/PolycodeLUAWrappers.h", "w")
+fout.write(out)
+
+fout = open("../../Contents/LUA/Source/PolycodeLUA.cpp", "w")
+fout.write(sout)
+
+#print cppHeader
+

+ 1 - 3
Core/Contents/Include/PolyScreen.h

@@ -54,9 +54,7 @@ namespace Polycode {
 		void drawFilter();
 		void drawFilter();
 		
 		
 		bool usesNormalizedCoordinates() { return useNormalizedCoordinates; }
 		bool usesNormalizedCoordinates() { return useNormalizedCoordinates; }
-		Number getYCoordinateSize() { return yCoordinateSize; }
-		
-		bool Lua_EntitiesEqual(ScreenEntity *ent1, ScreenEntity *ent2) { return ent1 == ent2; }
+		Number getYCoordinateSize() { return yCoordinateSize; }	
 		
 		
 		ScreenEntity *getRootEntity() { return rootEntity; }
 		ScreenEntity *getRootEntity() { return rootEntity; }
 		
 		

+ 1 - 1
Core/Contents/Source/OSBasics.cpp

@@ -88,7 +88,7 @@ OSFILE *OSBasics::open(String filename, String opts) {
 			return retFile;
 			return retFile;
 		}
 		}
 	} else {
 	} else {
-	//	Logger::log("File doesn't exist in archive\n");
+		Logger::log("File doesn't exist in archive (%s)\n", filename.c_str());
 	}
 	}
 	
 	
 	FILE *file = fopen(filename.c_str(), opts.c_str());
 	FILE *file = fopen(filename.c_str(), opts.c_str());

+ 1 - 1
IDE/Build/Mac OS X/Polycode-Info.plist

@@ -7,7 +7,7 @@
 	<key>CFBundleExecutable</key>
 	<key>CFBundleExecutable</key>
 	<string>${EXECUTABLE_NAME}</string>
 	<string>${EXECUTABLE_NAME}</string>
 	<key>CFBundleIconFile</key>
 	<key>CFBundleIconFile</key>
-	<string></string>
+	<string>main_icon</string>
 	<key>CFBundleIdentifier</key>
 	<key>CFBundleIdentifier</key>
 	<string>com.yourcompany.${PRODUCT_NAME:rfc1034identifier}</string>
 	<string>com.yourcompany.${PRODUCT_NAME:rfc1034identifier}</string>
 	<key>CFBundleInfoDictionaryVersion</key>
 	<key>CFBundleInfoDictionaryVersion</key>

+ 4 - 0
IDE/Build/Mac OS X/Polycode.xcodeproj/project.pbxproj

@@ -32,6 +32,7 @@
 		6DFBF64A12A3758400C43A7D /* OpenAL.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 6DFBF64812A3758400C43A7D /* OpenAL.framework */; };
 		6DFBF64A12A3758400C43A7D /* OpenAL.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 6DFBF64812A3758400C43A7D /* OpenAL.framework */; };
 		6DFBF64B12A3758400C43A7D /* OpenGL.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 6DFBF64912A3758400C43A7D /* OpenGL.framework */; };
 		6DFBF64B12A3758400C43A7D /* OpenGL.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 6DFBF64912A3758400C43A7D /* OpenGL.framework */; };
 		6DFBF8AB12A3F30F00C43A7D /* libPolycodeUI.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 6DFBF8AA12A3F30F00C43A7D /* libPolycodeUI.a */; };
 		6DFBF8AB12A3F30F00C43A7D /* libPolycodeUI.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 6DFBF8AA12A3F30F00C43A7D /* libPolycodeUI.a */; };
+		6DFF70531342F77200B0C47E /* main_icon.icns in Resources */ = {isa = PBXBuildFile; fileRef = 6DFF70521342F77200B0C47E /* main_icon.icns */; };
 		8D11072B0486CEB800E47090 /* InfoPlist.strings in Resources */ = {isa = PBXBuildFile; fileRef = 089C165CFE840E0CC02AAC07 /* InfoPlist.strings */; };
 		8D11072B0486CEB800E47090 /* InfoPlist.strings in Resources */ = {isa = PBXBuildFile; fileRef = 089C165CFE840E0CC02AAC07 /* InfoPlist.strings */; };
 		8D11072D0486CEB800E47090 /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 29B97316FDCFA39411CA2CEA /* main.m */; settings = {ATTRIBUTES = (); }; };
 		8D11072D0486CEB800E47090 /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 29B97316FDCFA39411CA2CEA /* main.m */; settings = {ATTRIBUTES = (); }; };
 		8D11072F0486CEB800E47090 /* Cocoa.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 1058C7A1FEA54F0111CA2CBB /* Cocoa.framework */; };
 		8D11072F0486CEB800E47090 /* Cocoa.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 1058C7A1FEA54F0111CA2CBB /* Cocoa.framework */; };
@@ -97,6 +98,7 @@
 		6DFBF64812A3758400C43A7D /* OpenAL.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = OpenAL.framework; path = System/Library/Frameworks/OpenAL.framework; sourceTree = SDKROOT; };
 		6DFBF64812A3758400C43A7D /* OpenAL.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = OpenAL.framework; path = System/Library/Frameworks/OpenAL.framework; sourceTree = SDKROOT; };
 		6DFBF64912A3758400C43A7D /* OpenGL.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = OpenGL.framework; path = /System/Library/Frameworks/OpenGL.framework; sourceTree = "<absolute>"; };
 		6DFBF64912A3758400C43A7D /* OpenGL.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = OpenGL.framework; path = /System/Library/Frameworks/OpenGL.framework; sourceTree = "<absolute>"; };
 		6DFBF8AA12A3F30F00C43A7D /* libPolycodeUI.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; name = libPolycodeUI.a; path = "../../../Modules/Build/Mac OS X/build/Debug/libPolycodeUI.a"; sourceTree = SOURCE_ROOT; };
 		6DFBF8AA12A3F30F00C43A7D /* libPolycodeUI.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; name = libPolycodeUI.a; path = "../../../Modules/Build/Mac OS X/build/Debug/libPolycodeUI.a"; sourceTree = SOURCE_ROOT; };
+		6DFF70521342F77200B0C47E /* main_icon.icns */ = {isa = PBXFileReference; lastKnownFileType = image.icns; name = main_icon.icns; path = ../../../Assets/main_icon.icns; sourceTree = SOURCE_ROOT; };
 		8D1107310486CEB800E47090 /* Polycode-Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; path = "Polycode-Info.plist"; sourceTree = "<group>"; };
 		8D1107310486CEB800E47090 /* Polycode-Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; path = "Polycode-Info.plist"; sourceTree = "<group>"; };
 		8D1107320486CEB800E47090 /* Polycode.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = Polycode.app; sourceTree = BUILT_PRODUCTS_DIR; };
 		8D1107320486CEB800E47090 /* Polycode.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = Polycode.app; sourceTree = BUILT_PRODUCTS_DIR; };
 /* End PBXFileReference section */
 /* End PBXFileReference section */
@@ -196,6 +198,7 @@
 		29B97317FDCFA39411CA2CEA /* Resources */ = {
 		29B97317FDCFA39411CA2CEA /* Resources */ = {
 			isa = PBXGroup;
 			isa = PBXGroup;
 			children = (
 			children = (
+				6DFF70521342F77200B0C47E /* main_icon.icns */,
 				8D1107310486CEB800E47090 /* Polycode-Info.plist */,
 				8D1107310486CEB800E47090 /* Polycode-Info.plist */,
 				089C165CFE840E0CC02AAC07 /* InfoPlist.strings */,
 				089C165CFE840E0CC02AAC07 /* InfoPlist.strings */,
 				1DDD58140DA1D0A300B32029 /* MainMenu.xib */,
 				1DDD58140DA1D0A300B32029 /* MainMenu.xib */,
@@ -307,6 +310,7 @@
 			files = (
 			files = (
 				8D11072B0486CEB800E47090 /* InfoPlist.strings in Resources */,
 				8D11072B0486CEB800E47090 /* InfoPlist.strings in Resources */,
 				1DDD58160DA1D0A300B32029 /* MainMenu.xib in Resources */,
 				1DDD58160DA1D0A300B32029 /* MainMenu.xib in Resources */,
+				6DFF70531342F77200B0C47E /* main_icon.icns in Resources */,
 			);
 			);
 			runOnlyForDeploymentPostprocessing = 0;
 			runOnlyForDeploymentPostprocessing = 0;
 		};
 		};

+ 5 - 5
IDE/Contents/Source/NewProjectWindow.cpp

@@ -45,25 +45,25 @@ NewProjectWindow::NewProjectWindow() : UIWindow(L"Create New Project", 500, 300)
 	
 	
 	ScreenLabel *label2 = new ScreenLabel(fontName, L"Project Name", fontSize, Label::ANTIALIAS_FULL);
 	ScreenLabel *label2 = new ScreenLabel(fontName, L"Project Name", fontSize, Label::ANTIALIAS_FULL);
 	addChild(label2);
 	addChild(label2);
-	label2->setPosition(padding+220, templateContainer->getPosition()->y);		
+	label2->setPosition(padding+220, templateContainer->getPosition().y);		
 
 
 	projectNameInput = new UITextInput(false, 500-padding-220-padding-padding, 12);	
 	projectNameInput = new UITextInput(false, 500-padding-220-padding-padding, 12);	
 	addChild(projectNameInput);
 	addChild(projectNameInput);
-	projectNameInput->setPosition(label2->getPosition()->x, label2->getPosition()->y+label2->getHeight()+2);
+	projectNameInput->setPosition(label2->getPosition().x, label2->getPosition().y+label2->getHeight()+2);
 	
 	
 	ScreenLabel *label3 = new ScreenLabel(fontName, L"Project Location", fontSize, Label::ANTIALIAS_FULL);
 	ScreenLabel *label3 = new ScreenLabel(fontName, L"Project Location", fontSize, Label::ANTIALIAS_FULL);
 	addChild(label3);
 	addChild(label3);
-	label3->setPosition(padding+220, templateContainer->getPosition()->y+50);		
+	label3->setPosition(padding+220, templateContainer->getPosition().y+50);		
 	
 	
 	projectLocationInput = new UITextInput(false, 500-padding-220-padding-padding, 12);	
 	projectLocationInput = new UITextInput(false, 500-padding-220-padding-padding, 12);	
 	addChild(projectLocationInput);
 	addChild(projectLocationInput);
-	projectLocationInput->setPosition(label3->getPosition()->x, label3->getPosition()->y+label3->getHeight()+2);
+	projectLocationInput->setPosition(label3->getPosition().x, label3->getPosition().y+label3->getHeight()+2);
 
 
 	
 	
 	locationSelectButton = new UIButton(L"Choose...", 100);
 	locationSelectButton = new UIButton(L"Choose...", 100);
 	locationSelectButton->addEventListener(this, UIEvent::CLICK_EVENT);	
 	locationSelectButton->addEventListener(this, UIEvent::CLICK_EVENT);	
 	addChild(locationSelectButton);
 	addChild(locationSelectButton);
-	locationSelectButton->setPosition(500-100-padding, projectLocationInput->getPosition()->y+projectLocationInput->getHeight()+5);
+	locationSelectButton->setPosition(500-100-padding, projectLocationInput->getPosition().y+projectLocationInput->getHeight()+5);
 	
 	
 	
 	
 	cancelButton = new UIButton(L"Cancel", 100);
 	cancelButton = new UIButton(L"Cancel", 100);

تفاوت فایلی نمایش داده نمی شود زیرا این فایل بسیار بزرگ است
+ 40 - 1012
Player/Build/Mac OS X/English.lproj/MainMenu.xib


+ 24 - 0
Player/Build/Mac OS X/Polycode Player.xcodeproj/project.pbxproj

@@ -14,6 +14,10 @@
 		6D34134112B7FCD00034FA9B /* IOKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 6D34134012B7FCD00034FA9B /* IOKit.framework */; };
 		6D34134112B7FCD00034FA9B /* IOKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 6D34134012B7FCD00034FA9B /* IOKit.framework */; };
 		6D34153C12B82C7A0034FA9B /* liblua.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 6D34153B12B82C7A0034FA9B /* liblua.a */; };
 		6D34153C12B82C7A0034FA9B /* liblua.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 6D34153B12B82C7A0034FA9B /* liblua.a */; };
 		6D34160612B837250034FA9B /* libPolycodeLUA.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 6D34160512B837250034FA9B /* libPolycodeLUA.a */; };
 		6D34160612B837250034FA9B /* libPolycodeLUA.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 6D34160512B837250034FA9B /* libPolycodeLUA.a */; };
+		6D674A031340FE2700218B97 /* libogg.0.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = 6D674A021340FE2700218B97 /* libogg.0.dylib */; };
+		6D674A071340FE2D00218B97 /* libvorbisfile.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 6D674A041340FE2D00218B97 /* libvorbisfile.a */; };
+		6D674A081340FE2D00218B97 /* libvorbis.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 6D674A051340FE2D00218B97 /* libvorbis.a */; };
+		6D674A091340FE2D00218B97 /* libogg.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 6D674A061340FE2D00218B97 /* libogg.a */; };
 		6DBAB04B12B6EA4300986D01 /* PolySubstanceView.m in Sources */ = {isa = PBXBuildFile; fileRef = 6DBAB04912B6EA4300986D01 /* PolySubstanceView.m */; };
 		6DBAB04B12B6EA4300986D01 /* PolySubstanceView.m in Sources */ = {isa = PBXBuildFile; fileRef = 6DBAB04912B6EA4300986D01 /* PolySubstanceView.m */; };
 		6DBAB07E12B6EAAD00986D01 /* libfreetype.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 6DBAB07712B6EAAD00986D01 /* libfreetype.a */; };
 		6DBAB07E12B6EAAD00986D01 /* libfreetype.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 6DBAB07712B6EAAD00986D01 /* libfreetype.a */; };
 		6DBAB07F12B6EAAD00986D01 /* libz.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 6DBAB07812B6EAAD00986D01 /* libz.a */; };
 		6DBAB07F12B6EAAD00986D01 /* libz.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 6DBAB07812B6EAAD00986D01 /* libz.a */; };
@@ -24,6 +28,7 @@
 		6DBAB08412B6EAAD00986D01 /* libPolyCore.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 6DBAB07D12B6EAAD00986D01 /* libPolyCore.a */; };
 		6DBAB08412B6EAAD00986D01 /* libPolyCore.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 6DBAB07D12B6EAAD00986D01 /* libPolyCore.a */; };
 		6DBAB0BF12B6ECCB00986D01 /* PolycodeCocoaPlayer.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 6DBAB0BE12B6ECCB00986D01 /* PolycodeCocoaPlayer.cpp */; };
 		6DBAB0BF12B6ECCB00986D01 /* PolycodeCocoaPlayer.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 6DBAB0BE12B6ECCB00986D01 /* PolycodeCocoaPlayer.cpp */; };
 		6DBAB0C412B6EE4400986D01 /* PolycodePlayer.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 6DBAB0C312B6EE4400986D01 /* PolycodePlayer.cpp */; };
 		6DBAB0C412B6EE4400986D01 /* PolycodePlayer.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 6DBAB0C312B6EE4400986D01 /* PolycodePlayer.cpp */; };
+		6DFF70421342F4AD00B0C47E /* player_icon.icns in Resources */ = {isa = PBXBuildFile; fileRef = 6DFF70411342F4AD00B0C47E /* player_icon.icns */; };
 		8D15AC2C0486D014006FF6A4 /* Credits.rtf in Resources */ = {isa = PBXBuildFile; fileRef = 2A37F4B9FDCFA73011CA2CEA /* Credits.rtf */; };
 		8D15AC2C0486D014006FF6A4 /* Credits.rtf in Resources */ = {isa = PBXBuildFile; fileRef = 2A37F4B9FDCFA73011CA2CEA /* Credits.rtf */; };
 		8D15AC2F0486D014006FF6A4 /* InfoPlist.strings in Resources */ = {isa = PBXBuildFile; fileRef = 089C165FFE840EACC02AAC07 /* InfoPlist.strings */; };
 		8D15AC2F0486D014006FF6A4 /* InfoPlist.strings in Resources */ = {isa = PBXBuildFile; fileRef = 089C165FFE840EACC02AAC07 /* InfoPlist.strings */; };
 		8D15AC310486D014006FF6A4 /* MyDocument.m in Sources */ = {isa = PBXBuildFile; fileRef = 2A37F4ACFDCFA73011CA2CEA /* MyDocument.m */; settings = {ATTRIBUTES = (); }; };
 		8D15AC310486D014006FF6A4 /* MyDocument.m in Sources */ = {isa = PBXBuildFile; fileRef = 2A37F4ACFDCFA73011CA2CEA /* MyDocument.m */; settings = {ATTRIBUTES = (); }; };
@@ -50,6 +55,10 @@
 		6D34134012B7FCD00034FA9B /* IOKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = IOKit.framework; path = System/Library/Frameworks/IOKit.framework; sourceTree = SDKROOT; };
 		6D34134012B7FCD00034FA9B /* IOKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = IOKit.framework; path = System/Library/Frameworks/IOKit.framework; sourceTree = SDKROOT; };
 		6D34153B12B82C7A0034FA9B /* liblua.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; name = liblua.a; path = ../../../Core/Dependencies/lua/src/liblua.a; sourceTree = SOURCE_ROOT; };
 		6D34153B12B82C7A0034FA9B /* liblua.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; name = liblua.a; path = ../../../Core/Dependencies/lua/src/liblua.a; sourceTree = SOURCE_ROOT; };
 		6D34160512B837250034FA9B /* libPolycodeLUA.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; name = libPolycodeLUA.a; path = "../../../Bindings/Build/Mac OS X/build/Debug/libPolycodeLUA.a"; sourceTree = SOURCE_ROOT; };
 		6D34160512B837250034FA9B /* libPolycodeLUA.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; name = libPolycodeLUA.a; path = "../../../Bindings/Build/Mac OS X/build/Debug/libPolycodeLUA.a"; sourceTree = SOURCE_ROOT; };
+		6D674A021340FE2700218B97 /* libogg.0.dylib */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.dylib"; name = libogg.0.dylib; path = ../../../Core/Dependencies/libogg/libogg.0.dylib; sourceTree = SOURCE_ROOT; };
+		6D674A041340FE2D00218B97 /* libvorbisfile.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; name = libvorbisfile.a; path = ../../../Core/Dependencies/libvorbis/libvorbisfile.a; sourceTree = SOURCE_ROOT; };
+		6D674A051340FE2D00218B97 /* libvorbis.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; name = libvorbis.a; path = ../../../Core/Dependencies/libvorbis/libvorbis.a; sourceTree = SOURCE_ROOT; };
+		6D674A061340FE2D00218B97 /* libogg.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; name = libogg.a; path = ../../../Core/Dependencies/libogg/libogg.a; sourceTree = SOURCE_ROOT; };
 		6DBAB04912B6EA4300986D01 /* PolySubstanceView.m */ = {isa = PBXFileReference; explicitFileType = sourcecode.cpp.objcpp; fileEncoding = 4; name = PolySubstanceView.m; path = ../../../Core/Contents/Source/PolySubstanceView.m; sourceTree = SOURCE_ROOT; };
 		6DBAB04912B6EA4300986D01 /* PolySubstanceView.m */ = {isa = PBXFileReference; explicitFileType = sourcecode.cpp.objcpp; fileEncoding = 4; name = PolySubstanceView.m; path = ../../../Core/Contents/Source/PolySubstanceView.m; sourceTree = SOURCE_ROOT; };
 		6DBAB04A12B6EA4300986D01 /* PolySubstanceView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = PolySubstanceView.h; path = ../../../Core/Contents/Include/PolySubstanceView.h; sourceTree = SOURCE_ROOT; };
 		6DBAB04A12B6EA4300986D01 /* PolySubstanceView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = PolySubstanceView.h; path = ../../../Core/Contents/Include/PolySubstanceView.h; sourceTree = SOURCE_ROOT; };
 		6DBAB07712B6EAAD00986D01 /* libfreetype.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; name = libfreetype.a; path = ../../../Core/Dependencies/freetype/libfreetype.a; sourceTree = SOURCE_ROOT; };
 		6DBAB07712B6EAAD00986D01 /* libfreetype.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; name = libfreetype.a; path = ../../../Core/Dependencies/freetype/libfreetype.a; sourceTree = SOURCE_ROOT; };
@@ -63,6 +72,7 @@
 		6DBAB0BE12B6ECCB00986D01 /* PolycodeCocoaPlayer.cpp */ = {isa = PBXFileReference; explicitFileType = sourcecode.cpp.objcpp; fileEncoding = 4; name = PolycodeCocoaPlayer.cpp; path = ../../Contents/Source/PolycodeCocoaPlayer.cpp; sourceTree = SOURCE_ROOT; };
 		6DBAB0BE12B6ECCB00986D01 /* PolycodeCocoaPlayer.cpp */ = {isa = PBXFileReference; explicitFileType = sourcecode.cpp.objcpp; fileEncoding = 4; name = PolycodeCocoaPlayer.cpp; path = ../../Contents/Source/PolycodeCocoaPlayer.cpp; sourceTree = SOURCE_ROOT; };
 		6DBAB0C212B6EE2200986D01 /* PolycodePlayer.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = PolycodePlayer.h; path = ../../Contents/Include/PolycodePlayer.h; sourceTree = SOURCE_ROOT; };
 		6DBAB0C212B6EE2200986D01 /* PolycodePlayer.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = PolycodePlayer.h; path = ../../Contents/Include/PolycodePlayer.h; sourceTree = SOURCE_ROOT; };
 		6DBAB0C312B6EE4400986D01 /* PolycodePlayer.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = PolycodePlayer.cpp; path = ../../Contents/Source/PolycodePlayer.cpp; sourceTree = SOURCE_ROOT; };
 		6DBAB0C312B6EE4400986D01 /* PolycodePlayer.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = PolycodePlayer.cpp; path = ../../Contents/Source/PolycodePlayer.cpp; sourceTree = SOURCE_ROOT; };
+		6DFF70411342F4AD00B0C47E /* player_icon.icns */ = {isa = PBXFileReference; lastKnownFileType = image.icns; name = player_icon.icns; path = ../../../Assets/player_icon.icns; sourceTree = SOURCE_ROOT; };
 		8D15AC360486D014006FF6A4 /* Polycode_Player-Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; path = "Polycode_Player-Info.plist"; sourceTree = "<group>"; };
 		8D15AC360486D014006FF6A4 /* Polycode_Player-Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; path = "Polycode_Player-Info.plist"; sourceTree = "<group>"; };
 		8D15AC370486D014006FF6A4 /* Polycode Player.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = "Polycode Player.app"; sourceTree = BUILT_PRODUCTS_DIR; };
 		8D15AC370486D014006FF6A4 /* Polycode Player.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = "Polycode Player.app"; sourceTree = BUILT_PRODUCTS_DIR; };
 /* End PBXFileReference section */
 /* End PBXFileReference section */
@@ -84,6 +94,10 @@
 				6D34134112B7FCD00034FA9B /* IOKit.framework in Frameworks */,
 				6D34134112B7FCD00034FA9B /* IOKit.framework in Frameworks */,
 				6D34153C12B82C7A0034FA9B /* liblua.a in Frameworks */,
 				6D34153C12B82C7A0034FA9B /* liblua.a in Frameworks */,
 				6D34160612B837250034FA9B /* libPolycodeLUA.a in Frameworks */,
 				6D34160612B837250034FA9B /* libPolycodeLUA.a in Frameworks */,
+				6D674A031340FE2700218B97 /* libogg.0.dylib in Frameworks */,
+				6D674A071340FE2D00218B97 /* libvorbisfile.a in Frameworks */,
+				6D674A081340FE2D00218B97 /* libvorbis.a in Frameworks */,
+				6D674A091340FE2D00218B97 /* libogg.a in Frameworks */,
 			);
 			);
 			runOnlyForDeploymentPostprocessing = 0;
 			runOnlyForDeploymentPostprocessing = 0;
 		};
 		};
@@ -93,6 +107,10 @@
 		1058C7A6FEA54F5311CA2CBB /* Linked Frameworks */ = {
 		1058C7A6FEA54F5311CA2CBB /* Linked Frameworks */ = {
 			isa = PBXGroup;
 			isa = PBXGroup;
 			children = (
 			children = (
+				6D674A021340FE2700218B97 /* libogg.0.dylib */,
+				6D674A041340FE2D00218B97 /* libvorbisfile.a */,
+				6D674A051340FE2D00218B97 /* libvorbis.a */,
+				6D674A061340FE2D00218B97 /* libogg.a */,
 				6D34160512B837250034FA9B /* libPolycodeLUA.a */,
 				6D34160512B837250034FA9B /* libPolycodeLUA.a */,
 				6D34153B12B82C7A0034FA9B /* liblua.a */,
 				6D34153B12B82C7A0034FA9B /* liblua.a */,
 				6D34134012B7FCD00034FA9B /* IOKit.framework */,
 				6D34134012B7FCD00034FA9B /* IOKit.framework */,
@@ -168,6 +186,7 @@
 		2A37F4B8FDCFA73011CA2CEA /* Resources */ = {
 		2A37F4B8FDCFA73011CA2CEA /* Resources */ = {
 			isa = PBXGroup;
 			isa = PBXGroup;
 			children = (
 			children = (
+				6DFF70411342F4AD00B0C47E /* player_icon.icns */,
 				2A37F4B9FDCFA73011CA2CEA /* Credits.rtf */,
 				2A37F4B9FDCFA73011CA2CEA /* Credits.rtf */,
 				8D15AC360486D014006FF6A4 /* Polycode_Player-Info.plist */,
 				8D15AC360486D014006FF6A4 /* Polycode_Player-Info.plist */,
 				089C165FFE840EACC02AAC07 /* InfoPlist.strings */,
 				089C165FFE840EACC02AAC07 /* InfoPlist.strings */,
@@ -241,6 +260,7 @@
 				8D15AC2F0486D014006FF6A4 /* InfoPlist.strings in Resources */,
 				8D15AC2F0486D014006FF6A4 /* InfoPlist.strings in Resources */,
 				1DDD582C0DA1D0D100B32029 /* MyDocument.xib in Resources */,
 				1DDD582C0DA1D0D100B32029 /* MyDocument.xib in Resources */,
 				1DDD582D0DA1D0D100B32029 /* MainMenu.xib in Resources */,
 				1DDD582D0DA1D0D100B32029 /* MainMenu.xib in Resources */,
+				6DFF70421342F4AD00B0C47E /* player_icon.icns in Resources */,
 			);
 			);
 			runOnlyForDeploymentPostprocessing = 0;
 			runOnlyForDeploymentPostprocessing = 0;
 		};
 		};
@@ -338,6 +358,8 @@
 					"\"$(SRCROOT)/../../../Core/Dependencies/physfs/Debug\"",
 					"\"$(SRCROOT)/../../../Core/Dependencies/physfs/Debug\"",
 					"\"$(SRCROOT)/../../../Core/Dependencies/lua/src\"",
 					"\"$(SRCROOT)/../../../Core/Dependencies/lua/src\"",
 					"\"$(SRCROOT)/../../../Bindings/Build/Mac OS X/build/Debug\"",
 					"\"$(SRCROOT)/../../../Bindings/Build/Mac OS X/build/Debug\"",
+					"\"$(SRCROOT)/../../../Core/Dependencies/libogg\"",
+					"\"$(SRCROOT)/../../../Core/Dependencies/libvorbis\"",
 				);
 				);
 				PRODUCT_NAME = "Polycode Player";
 				PRODUCT_NAME = "Polycode Player";
 			};
 			};
@@ -364,6 +386,8 @@
 					"\"$(SRCROOT)/../../../Core/Dependencies/physfs/Debug\"",
 					"\"$(SRCROOT)/../../../Core/Dependencies/physfs/Debug\"",
 					"\"$(SRCROOT)/../../../Core/Dependencies/lua/src\"",
 					"\"$(SRCROOT)/../../../Core/Dependencies/lua/src\"",
 					"\"$(SRCROOT)/../../../Bindings/Build/Mac OS X/build/Debug\"",
 					"\"$(SRCROOT)/../../../Bindings/Build/Mac OS X/build/Debug\"",
+					"\"$(SRCROOT)/../../../Core/Dependencies/libogg\"",
+					"\"$(SRCROOT)/../../../Core/Dependencies/libvorbis\"",
 				);
 				);
 				PRODUCT_NAME = "Polycode Player";
 				PRODUCT_NAME = "Polycode Player";
 			};
 			};

+ 1 - 1
Player/Build/Mac OS X/Polycode_Player-Info.plist

@@ -40,7 +40,7 @@
 	<key>CFBundleExecutable</key>
 	<key>CFBundleExecutable</key>
 	<string>${EXECUTABLE_NAME}</string>
 	<string>${EXECUTABLE_NAME}</string>
 	<key>CFBundleIconFile</key>
 	<key>CFBundleIconFile</key>
-	<string></string>
+	<string>player_icon</string>
 	<key>CFBundleIdentifier</key>
 	<key>CFBundleIdentifier</key>
 	<string>com.yourcompany.${PRODUCT_NAME:rfc1034identifier}</string>
 	<string>com.yourcompany.${PRODUCT_NAME:rfc1034identifier}</string>
 	<key>CFBundleInfoDictionaryVersion</key>
 	<key>CFBundleInfoDictionaryVersion</key>

+ 9 - 4
Player/Contents/Source/PolycodePlayer.cpp

@@ -124,6 +124,10 @@ extern "C" {
 		lua_pushstring(L, "class");		
 		lua_pushstring(L, "class");		
 		lua_call(L, 1, 0);
 		lua_call(L, 1, 0);
 
 
+		lua_getfield(L, LUA_GLOBALSINDEX, "require");
+		lua_pushstring(L, "Polycode");		
+		lua_call(L, 1, 0);		
+		
 		lua_getfield(L, LUA_GLOBALSINDEX, "require");
 		lua_getfield(L, LUA_GLOBALSINDEX, "require");
 		lua_pushstring(L, "defaults");		
 		lua_pushstring(L, "defaults");		
 		lua_call(L, 1, 0);
 		lua_call(L, 1, 0);
@@ -155,6 +159,7 @@ extern "C" {
 		 */
 		 */
 		OSFILE *inFile = OSBasics::open(fileName, "r");	
 		OSFILE *inFile = OSBasics::open(fileName, "r");	
 		if(inFile) {
 		if(inFile) {
+			Logger::log("Opened entrypoint file...");
 			OSBasics::seek(inFile, 0, SEEK_END);	
 			OSBasics::seek(inFile, 0, SEEK_END);	
 			long progsize = OSBasics::tell(inFile);
 			long progsize = OSBasics::tell(inFile);
 			OSBasics::seek(inFile, 0, SEEK_SET);
 			OSBasics::seek(inFile, 0, SEEK_SET);
@@ -264,9 +269,9 @@ void PolycodePlayer::loadFile(const char *fileName) {
 	string mainFile = "";
 	string mainFile = "";
 	string basePath = fileName;
 	string basePath = fileName;
 	
 	
-	float red = 0.2f;
-	float green = 0.2f;
-	float blue = 0.2f;
+	Number red = 0.2f;
+	Number green = 0.2f;
+	Number blue = 0.2f;
 	
 	
 	frameRate = 60;
 	frameRate = 60;
 	
 	
@@ -314,7 +319,7 @@ void PolycodePlayer::loadFile(const char *fileName) {
 	
 	
 	PolycodeDebugEvent *event = new PolycodeDebugEvent();			
 	PolycodeDebugEvent *event = new PolycodeDebugEvent();			
 	event->xRes = xRes;
 	event->xRes = xRes;
-	event->yRes = yRes;
+	event->yRes = yRes;	
 	
 	
 	createCore();
 	createCore();
 	
 	

+ 9 - 4
Tools/Build/Linux/Makefile

@@ -1,4 +1,9 @@
-INC= -I../../../Core/Dependencies/physfs/ -I../../Contents/polyimport/Include -I../../Dependencies/assimp/include/ -I../../../Core/Contents/Include/
-LIB= ../../Dependencies/assimp/lib/libassimp.dylib ../../../Core/Dependencies/physfs/Debug/libphysfs.a ../../../Core/Build/Mac\ OS\ X/build/Debug/libPolyCore.a -framework IOKit -framework Cocoa
-default:
-	g++ -g ../../Contents/polyimport/Source/*.cpp $(INC) $(LIB) -o polyimport
+INC_POLYIMPORT= -I../../../Core/Dependencies/physfs/ -I../../Contents/polyimport/Include -I../../Dependencies/assimp/include/ -I../../../Core/Contents/Include/
+LIB_POLYIMPORT= ../../Dependencies/assimp/lib/libassimp.dylib ../../../Core/Dependencies/physfs/Debug/libphysfs.a ../../../Core/Build/Mac\ OS\ X/build/Debug/libPolyCore.a -framework IOKit -framework Cocoa
+polyimport:
+	g++ -g ../../Contents/polyimport/Source/*.cpp $(INC_POLYIMPORT) $(LIB_POLYIMPORT) -o polyimport
+
+LIB_POLYBUILD=  ../../../Core/Dependencies/physfs/Debug/libphysfs.a ../../../Core/Build/Mac\ OS\ X/build/Debug/libPolyCore.a -framework IOKit -framework Cocoa 
+INC_POLYBUILD= -I../../../Core/Dependencies/physfs/ -I../../../Core/Dependencies/zlib/ -I../../Contents/polybuild/Include -I../../../Core/Contents/Include/ -I../../Dependencies/unzip11/ 
+polybuild:
+	g++ -g ../../../Core/Dependencies/zlib/libz.a ../../Contents/polybuild/Source/*.cpp ../../Dependencies/unzip11/ioapi.c ../../Dependencies/unzip11/zip.c $(INC_POLYBUILD) $(LIB_POLYBUILD) -o polybuild

برخی فایل ها در این مقایسه diff نمایش داده نمی شوند زیرا تعداد فایل ها بسیار زیاد است