Преглед на файлове

Removed MaterialManager, made all material/shader and program management happen in ResourcePools, removed FontGlyphSheet and SceneImage classes from the codebase. Made all internal resources management and interaction use shared_ptr, renderer resources (shaders, programs, buffers, etc.) now created by the renderer only when used for the first time and deleted automatically in destructor.

Ivan Safrin преди 9 години
родител
ревизия
b0851c5e0d
променени са 100 файла, в които са добавени 632 реда и са изтрити 2765 реда
  1. BIN
      assets/default/default.pak
  2. 2 3
      assets/default/default/DefaultUntextured.frag
  3. 1 2
      bindings/javascript/Polycode.js
  4. 1 1
      bindings/javascript/Polycode/Camera.js
  5. 8 0
      bindings/javascript/Polycode/Core.js
  6. 0 6
      bindings/javascript/Polycode/CoreServices.js
  7. 1 1
      bindings/javascript/Polycode/FontResourceLoader.js
  8. 0 22
      bindings/javascript/Polycode/GPUDrawBuffer.js
  9. 1 12
      bindings/javascript/Polycode/GPUDrawCall.js
  10. 1 1
      bindings/javascript/Polycode/Label.js
  11. 0 11
      bindings/javascript/Polycode/LightInfo.js
  12. 0 112
      bindings/javascript/Polycode/LightInfoBinding.js
  13. 0 24
      bindings/javascript/Polycode/LightShadowInfoBinding.js
  14. 3 3
      bindings/javascript/Polycode/LocalShaderParam.js
  15. 2 14
      bindings/javascript/Polycode/Material.js
  16. 1 1
      bindings/javascript/Polycode/MaterialResourceLoader.js
  17. 1 1
      bindings/javascript/Polycode/MeshResourceLoader.js
  18. 1 1
      bindings/javascript/Polycode/ProgramResourceLoader.js
  19. 0 24
      bindings/javascript/Polycode/RenderBuffer.js
  20. 1 12
      bindings/javascript/Polycode/RenderTargetBinding.js
  21. 0 4
      bindings/javascript/Polycode/RenderThread.js
  22. 10 48
      bindings/javascript/Polycode/Renderer.js
  23. 8 4
      bindings/javascript/Polycode/ResourcePool.js
  24. 1 1
      bindings/javascript/Polycode/SceneEntityInstance.js
  25. 1 1
      bindings/javascript/Polycode/SceneLight.js
  26. 4 22
      bindings/javascript/Polycode/SceneMesh.js
  27. 1 13
      bindings/javascript/Polycode/SceneRenderTexture.js
  28. 1 1
      bindings/javascript/Polycode/SceneSprite.js
  29. 1 1
      bindings/javascript/Polycode/ScriptResourceLoader.js
  30. 0 30
      bindings/javascript/Polycode/Shader.js
  31. 11 16
      bindings/javascript/Polycode/ShaderBinding.js
  32. 1 34
      bindings/javascript/Polycode/ShaderPass.js
  33. 43 0
      bindings/javascript/Polycode/ShaderPlatformData.js
  34. 0 11
      bindings/javascript/Polycode/ShaderRenderTarget.js
  35. 3 9
      bindings/javascript/Polycode/SpriteSet.js
  36. 1 1
      bindings/javascript/Polycode/SpriteState.js
  37. 1 1
      bindings/javascript/Polycode/TextureResourceLoader.js
  38. BIN
      bindings/javascript/js_Polycode.pak
  39. 1 2
      bindings/lua/Polycode.lua
  40. 1 1
      bindings/lua/Polycode/Camera.lua
  41. 9 0
      bindings/lua/Polycode/Core.lua
  42. 20 0
      bindings/lua/Polycode/CoreMotionEvent.lua
  43. 0 8
      bindings/lua/Polycode/CoreServices.lua
  44. 1 1
      bindings/lua/Polycode/FontResourceLoader.lua
  45. 2 20
      bindings/lua/Polycode/GPUDrawBuffer.lua
  46. 0 9
      bindings/lua/Polycode/GPUDrawCall.lua
  47. 1 1
      bindings/lua/Polycode/Label.lua
  48. 0 9
      bindings/lua/Polycode/LightInfo.lua
  49. 0 98
      bindings/lua/Polycode/LightInfoBinding.lua
  50. 0 26
      bindings/lua/Polycode/LightShadowInfoBinding.lua
  51. 3 3
      bindings/lua/Polycode/LocalShaderParam.lua
  52. 2 14
      bindings/lua/Polycode/Material.lua
  53. 1 1
      bindings/lua/Polycode/MaterialResourceLoader.lua
  54. 1 1
      bindings/lua/Polycode/MeshResourceLoader.lua
  55. 1 1
      bindings/lua/Polycode/ProgramResourceLoader.lua
  56. 0 26
      bindings/lua/Polycode/RenderBuffer.lua
  57. 14 0
      bindings/lua/Polycode/RenderFrame.lua
  58. 0 9
      bindings/lua/Polycode/RenderTargetBinding.lua
  59. 0 10
      bindings/lua/Polycode/RenderThread.lua
  60. 10 58
      bindings/lua/Polycode/Renderer.lua
  61. 1 1
      bindings/lua/Polycode/ResourceManager.lua
  62. 9 5
      bindings/lua/Polycode/ResourcePool.lua
  63. 1 1
      bindings/lua/Polycode/SceneEntityInstance.lua
  64. 1 1
      bindings/lua/Polycode/SceneLight.lua
  65. 4 14
      bindings/lua/Polycode/SceneMesh.lua
  66. 1 17
      bindings/lua/Polycode/SceneRenderTexture.lua
  67. 1 1
      bindings/lua/Polycode/SceneSprite.lua
  68. 1 1
      bindings/lua/Polycode/ScriptResourceLoader.lua
  69. 0 26
      bindings/lua/Polycode/Shader.lua
  70. 15 16
      bindings/lua/Polycode/ShaderBinding.lua
  71. 2 29
      bindings/lua/Polycode/ShaderPass.lua
  72. 41 0
      bindings/lua/Polycode/ShaderPlatformData.lua
  73. 0 9
      bindings/lua/Polycode/ShaderRenderTarget.lua
  74. 3 11
      bindings/lua/Polycode/SpriteSet.lua
  75. 1 1
      bindings/lua/Polycode/SpriteState.lua
  76. 1 1
      bindings/lua/Polycode/TextureResourceLoader.lua
  77. BIN
      bindings/lua/lua_Polycode.pak
  78. 0 24
      build/osx/PolycodeCore/PolycodeCore.xcodeproj/project.pbxproj
  79. 4 4
      build/osx/TemplateApp/TemplateApp/PolycodeTemplateApp.mm
  80. 0 2
      include/Polycode.h
  81. 110 683
      include/polycode/bindings/javascript/PolycodeJSWrappers.h
  82. 117 713
      include/polycode/bindings/lua/PolycodeLuaWrappers.h
  83. 5 5
      include/polycode/core/PolyCamera.h
  84. 2 11
      include/polycode/core/PolyCoreServices.h
  85. 10 5
      include/polycode/core/PolyCubemap.h
  86. 0 88
      include/polycode/core/PolyFontGlyphSheet.h
  87. 4 4
      include/polycode/core/PolyGPUDrawBuffer.h
  88. 5 5
      include/polycode/core/PolyLabel.h
  89. 10 21
      include/polycode/core/PolyMaterial.h
  90. 0 110
      include/polycode/core/PolyMaterialManager.h
  91. 15 7
      include/polycode/core/PolyOpenGLGraphicsInterface.h
  92. 28 45
      include/polycode/core/PolyRenderer.h
  93. 32 20
      include/polycode/core/PolyResourceManager.h
  94. 3 3
      include/polycode/core/PolyScene.h
  95. 3 4
      include/polycode/core/PolySceneEntityInstance.h
  96. 0 96
      include/polycode/core/PolySceneImage.h
  97. 2 1
      include/polycode/core/PolySceneLabel.h
  98. 4 3
      include/polycode/core/PolySceneLight.h
  99. 15 26
      include/polycode/core/PolySceneMesh.h
  100. 3 5
      include/polycode/core/PolySceneRenderTexture.h

BIN
assets/default/default.pak


+ 2 - 3
assets/default/default/DefaultUntextured.frag

@@ -8,7 +8,6 @@ varying vec4 varPosition;
 
 
 uniform vec4 diffuse_color;
 uniform vec4 diffuse_color;
 uniform vec4 specular_color;
 uniform vec4 specular_color;
-uniform vec4 entityColor;
 uniform float shininess;
 uniform float shininess;
 
 
 #define MAX_LIGHTS 8
 #define MAX_LIGHTS 8
@@ -121,9 +120,9 @@ void main()
 	doLights(MAX_LIGHTS, varNormal, varPosition, diffuse_val, specular_val);
 	doLights(MAX_LIGHTS, varNormal, varPosition, diffuse_val, specular_val);
 			
 			
     vec4 color = diffuse_val; 	           
     vec4 color = diffuse_val; 	           
-    color = clamp((color*entityColor) + specular_val, 0.0, 1.0);  
+    color = clamp((color) + specular_val, 0.0, 1.0);  
 
 
-	color.a = entityColor.a * diffuse_color.a;	
+	color.a = diffuse_color.a;	
 	gl_FragColor = color;
 	gl_FragColor = color;
 
 
 }
 }

+ 1 - 2
bindings/javascript/Polycode.js

@@ -38,13 +38,13 @@ require('Polycode/ColorRange')
 require('Polycode/Label')
 require('Polycode/Label')
 require('Polycode/Material')
 require('Polycode/Material')
 require('Polycode/ShaderPass')
 require('Polycode/ShaderPass')
-require('Polycode/MaterialManager')
 require('Polycode/Matrix4')
 require('Polycode/Matrix4')
 require('Polycode/Mesh')
 require('Polycode/Mesh')
 require('Polycode/MeshGeometry')
 require('Polycode/MeshGeometry')
 require('Polycode/ObjectEntry')
 require('Polycode/ObjectEntry')
 require('Polycode/BinaryObjectReader')
 require('Polycode/BinaryObjectReader')
 require('Polycode/BinaryObjectWriter')
 require('Polycode/BinaryObjectWriter')
+require('Polycode/ShaderPlatformData')
 require('Polycode/SceneParticle')
 require('Polycode/SceneParticle')
 require('Polycode/SceneParticleEmitter')
 require('Polycode/SceneParticleEmitter')
 require('Polycode/Perlin')
 require('Polycode/Perlin')
@@ -75,7 +75,6 @@ require('Polycode/Scene')
 require('Polycode/SceneEntityInstanceResourceEntry')
 require('Polycode/SceneEntityInstanceResourceEntry')
 require('Polycode/SceneEntityInstance')
 require('Polycode/SceneEntityInstance')
 require('Polycode/SceneEntityInstanceLayer')
 require('Polycode/SceneEntityInstanceLayer')
-require('Polycode/SceneImage')
 require('Polycode/SceneLabel')
 require('Polycode/SceneLabel')
 require('Polycode/SceneLight')
 require('Polycode/SceneLight')
 require('Polycode/SceneCurve')
 require('Polycode/SceneCurve')

+ 1 - 1
bindings/javascript/Polycode/Camera.js

@@ -125,7 +125,7 @@ Camera.prototype.removePostFilter = function() {
 }
 }
 
 
 Camera.prototype.getScreenShaderMaterial = function() {
 Camera.prototype.getScreenShaderMaterial = function() {
-	var retVal = new Material()
+	var retVal = new shared_ptr<Material>()
 	retVal.__ptr = Polycode.Camera_getScreenShaderMaterial(this.__ptr)
 	retVal.__ptr = Polycode.Camera_getScreenShaderMaterial(this.__ptr)
 	return retVal
 	return retVal
 }
 }

+ 8 - 0
bindings/javascript/Polycode/Core.js

@@ -103,6 +103,10 @@ Core.prototype.warpCursor = function(x,y) {
 	Polycode.Core_warpCursor(this.__ptr, x,y)
 	Polycode.Core_warpCursor(this.__ptr, x,y)
 }
 }
 
 
+Core.prototype.openOnScreenKeyboard = function(open) {
+	Polycode.Core_openOnScreenKeyboard(this.__ptr, open)
+}
+
 Core.prototype.createThread = function(target) {
 Core.prototype.createThread = function(target) {
 	Polycode.Core_createThread(this.__ptr, target)
 	Polycode.Core_createThread(this.__ptr, target)
 }
 }
@@ -225,6 +229,10 @@ Core.prototype.prepareRenderContext = function() {
 	Polycode.Core_prepareRenderContext(this.__ptr)
 	Polycode.Core_prepareRenderContext(this.__ptr)
 }
 }
 
 
+Core.prototype.isWindowInitialized = function() {
+	return Polycode.Core_isWindowInitialized(this.__ptr)
+}
+
 Core.prototype.openFile = function(fileName,opts) {
 Core.prototype.openFile = function(fileName,opts) {
 	var retVal = new CoreFile()
 	var retVal = new CoreFile()
 	retVal.__ptr = Polycode.Core_openFile(this.__ptr, fileName,opts)
 	retVal.__ptr = Polycode.Core_openFile(this.__ptr, fileName,opts)

+ 0 - 6
bindings/javascript/Polycode/CoreServices.js

@@ -45,12 +45,6 @@ CoreServices.prototype.getInput = function() {
 	return retVal
 	return retVal
 }
 }
 
 
-CoreServices.prototype.getMaterialManager = function() {
-	var retVal = new MaterialManager()
-	retVal.__ptr = Polycode.CoreServices_getMaterialManager(this.__ptr)
-	return retVal
-}
-
 CoreServices.prototype.getSceneManager = function() {
 CoreServices.prototype.getSceneManager = function() {
 	var retVal = new SceneManager()
 	var retVal = new SceneManager()
 	retVal.__ptr = Polycode.CoreServices_getSceneManager(this.__ptr)
 	retVal.__ptr = Polycode.CoreServices_getSceneManager(this.__ptr)

+ 1 - 1
bindings/javascript/Polycode/FontResourceLoader.js

@@ -8,7 +8,7 @@ Duktape.fin(FontResourceLoader.prototype, function (x) {
 })
 })
 
 
 FontResourceLoader.prototype.loadResource = function(path,targetPool) {
 FontResourceLoader.prototype.loadResource = function(path,targetPool) {
-	var retVal = new Resource()
+	var retVal = new shared_ptr<Resource>()
 	retVal.__ptr = Polycode.FontResourceLoader_loadResource(this.__ptr, path,targetPool)
 	retVal.__ptr = Polycode.FontResourceLoader_loadResource(this.__ptr, path,targetPool)
 	return retVal
 	return retVal
 }
 }

+ 0 - 22
bindings/javascript/Polycode/GPUDrawBuffer.js

@@ -1,6 +1,5 @@
 function GPUDrawBuffer() {
 function GPUDrawBuffer() {
 	Object.defineProperties(this, {
 	Object.defineProperties(this, {
-		'targetFramebuffer': { enumerable: true, configurable: true, get: GPUDrawBuffer.prototype.__get_targetFramebuffer, set: GPUDrawBuffer.prototype.__set_targetFramebuffer},
 		'projectionMatrix': { enumerable: true, configurable: true, get: GPUDrawBuffer.prototype.__get_projectionMatrix, set: GPUDrawBuffer.prototype.__set_projectionMatrix},
 		'projectionMatrix': { enumerable: true, configurable: true, get: GPUDrawBuffer.prototype.__get_projectionMatrix, set: GPUDrawBuffer.prototype.__set_projectionMatrix},
 		'viewMatrix': { enumerable: true, configurable: true, get: GPUDrawBuffer.prototype.__get_viewMatrix, set: GPUDrawBuffer.prototype.__set_viewMatrix},
 		'viewMatrix': { enumerable: true, configurable: true, get: GPUDrawBuffer.prototype.__get_viewMatrix, set: GPUDrawBuffer.prototype.__set_viewMatrix},
 		'cameraMatrix': { enumerable: true, configurable: true, get: GPUDrawBuffer.prototype.__get_cameraMatrix, set: GPUDrawBuffer.prototype.__set_cameraMatrix},
 		'cameraMatrix': { enumerable: true, configurable: true, get: GPUDrawBuffer.prototype.__get_cameraMatrix, set: GPUDrawBuffer.prototype.__set_cameraMatrix},
@@ -8,20 +7,9 @@ function GPUDrawBuffer() {
 		'clearDepthBuffer': { enumerable: true, configurable: true, get: GPUDrawBuffer.prototype.__get_clearDepthBuffer, set: GPUDrawBuffer.prototype.__set_clearDepthBuffer},
 		'clearDepthBuffer': { enumerable: true, configurable: true, get: GPUDrawBuffer.prototype.__get_clearDepthBuffer, set: GPUDrawBuffer.prototype.__set_clearDepthBuffer},
 		'clearColorBuffer': { enumerable: true, configurable: true, get: GPUDrawBuffer.prototype.__get_clearColorBuffer, set: GPUDrawBuffer.prototype.__set_clearColorBuffer},
 		'clearColorBuffer': { enumerable: true, configurable: true, get: GPUDrawBuffer.prototype.__get_clearColorBuffer, set: GPUDrawBuffer.prototype.__set_clearColorBuffer},
 		'backingResolutionScale': { enumerable: true, configurable: true, get: GPUDrawBuffer.prototype.__get_backingResolutionScale, set: GPUDrawBuffer.prototype.__set_backingResolutionScale},
 		'backingResolutionScale': { enumerable: true, configurable: true, get: GPUDrawBuffer.prototype.__get_backingResolutionScale, set: GPUDrawBuffer.prototype.__set_backingResolutionScale},
-		'globalMaterial': { enumerable: true, configurable: true, get: GPUDrawBuffer.prototype.__get_globalMaterial, set: GPUDrawBuffer.prototype.__set_globalMaterial},
 		'viewport': { enumerable: true, configurable: true, get: GPUDrawBuffer.prototype.__get_viewport, set: GPUDrawBuffer.prototype.__set_viewport}
 		'viewport': { enumerable: true, configurable: true, get: GPUDrawBuffer.prototype.__get_viewport, set: GPUDrawBuffer.prototype.__set_viewport}
 	})
 	})
 }
 }
-GPUDrawBuffer.prototype.__get_targetFramebuffer = function() {
-	var retVal = new RenderBuffer()
-	retVal.__ptr = 	Polycode.GPUDrawBuffer__get_targetFramebuffer(this.__ptr)
-	return retVal
-}
-
-GPUDrawBuffer.prototype.__set_targetFramebuffer = function(val) {
-	Polycode.GPUDrawBuffer__set_targetFramebuffer(this.__ptr, val.__ptr)
-}
-
 GPUDrawBuffer.prototype.__get_projectionMatrix = function() {
 GPUDrawBuffer.prototype.__get_projectionMatrix = function() {
 	var retVal = new Matrix4()
 	var retVal = new Matrix4()
 	retVal.__ptr = 	Polycode.GPUDrawBuffer__get_projectionMatrix(this.__ptr)
 	retVal.__ptr = 	Polycode.GPUDrawBuffer__get_projectionMatrix(this.__ptr)
@@ -88,16 +76,6 @@ GPUDrawBuffer.prototype.__set_backingResolutionScale = function(val) {
 	Polycode.GPUDrawBuffer__set_backingResolutionScale(this.__ptr, val.__ptr)
 	Polycode.GPUDrawBuffer__set_backingResolutionScale(this.__ptr, val.__ptr)
 }
 }
 
 
-GPUDrawBuffer.prototype.__get_globalMaterial = function() {
-	var retVal = new Material()
-	retVal.__ptr = 	Polycode.GPUDrawBuffer__get_globalMaterial(this.__ptr)
-	return retVal
-}
-
-GPUDrawBuffer.prototype.__set_globalMaterial = function(val) {
-	Polycode.GPUDrawBuffer__set_globalMaterial(this.__ptr, val.__ptr)
-}
-
 GPUDrawBuffer.prototype.__get_viewport = function() {
 GPUDrawBuffer.prototype.__get_viewport = function() {
 	var retVal = new Rectangle()
 	var retVal = new Rectangle()
 	retVal.__ptr = 	Polycode.GPUDrawBuffer__get_viewport(this.__ptr)
 	retVal.__ptr = 	Polycode.GPUDrawBuffer__get_viewport(this.__ptr)

+ 1 - 12
bindings/javascript/Polycode/GPUDrawCall.js

@@ -1,8 +1,7 @@
 function GPUDrawCall() {
 function GPUDrawCall() {
 	Object.defineProperties(this, {
 	Object.defineProperties(this, {
 		'options': { enumerable: true, configurable: true, get: GPUDrawCall.prototype.__get_options, set: GPUDrawCall.prototype.__set_options},
 		'options': { enumerable: true, configurable: true, get: GPUDrawCall.prototype.__get_options, set: GPUDrawCall.prototype.__set_options},
-		'modelMatrix': { enumerable: true, configurable: true, get: GPUDrawCall.prototype.__get_modelMatrix, set: GPUDrawCall.prototype.__set_modelMatrix},
-		'material': { enumerable: true, configurable: true, get: GPUDrawCall.prototype.__get_material, set: GPUDrawCall.prototype.__set_material}
+		'modelMatrix': { enumerable: true, configurable: true, get: GPUDrawCall.prototype.__get_modelMatrix, set: GPUDrawCall.prototype.__set_modelMatrix}
 	})
 	})
 }
 }
 GPUDrawCall.prototype.__get_options = function() {
 GPUDrawCall.prototype.__get_options = function() {
@@ -25,16 +24,6 @@ GPUDrawCall.prototype.__set_modelMatrix = function(val) {
 	Polycode.GPUDrawCall__set_modelMatrix(this.__ptr, val.__ptr)
 	Polycode.GPUDrawCall__set_modelMatrix(this.__ptr, val.__ptr)
 }
 }
 
 
-GPUDrawCall.prototype.__get_material = function() {
-	var retVal = new Material()
-	retVal.__ptr = 	Polycode.GPUDrawCall__get_material(this.__ptr)
-	return retVal
-}
-
-GPUDrawCall.prototype.__set_material = function(val) {
-	Polycode.GPUDrawCall__set_material(this.__ptr, val.__ptr)
-}
-
 Duktape.fin(GPUDrawCall.prototype, function (x) {
 Duktape.fin(GPUDrawCall.prototype, function (x) {
 	if (x === GPUDrawCall.prototype) {
 	if (x === GPUDrawCall.prototype) {
 		return;
 		return;

+ 1 - 1
bindings/javascript/Polycode/Label.js

@@ -58,7 +58,7 @@ Label.prototype.setFont = function(newFont) {
 }
 }
 
 
 Label.prototype.getFont = function() {
 Label.prototype.getFont = function() {
-	var retVal = new Font()
+	var retVal = new shared_ptr<Font>()
 	retVal.__ptr = Polycode.Label_getFont(this.__ptr)
 	retVal.__ptr = Polycode.Label_getFont(this.__ptr)
 	return retVal
 	return retVal
 }
 }

+ 0 - 11
bindings/javascript/Polycode/LightInfo.js

@@ -13,7 +13,6 @@ function LightInfo() {
 		'spotlightCutoff': { enumerable: true, configurable: true, get: LightInfo.prototype.__get_spotlightCutoff, set: LightInfo.prototype.__set_spotlightCutoff},
 		'spotlightCutoff': { enumerable: true, configurable: true, get: LightInfo.prototype.__get_spotlightCutoff, set: LightInfo.prototype.__set_spotlightCutoff},
 		'spotlightExponent': { enumerable: true, configurable: true, get: LightInfo.prototype.__get_spotlightExponent, set: LightInfo.prototype.__set_spotlightExponent},
 		'spotlightExponent': { enumerable: true, configurable: true, get: LightInfo.prototype.__get_spotlightExponent, set: LightInfo.prototype.__set_spotlightExponent},
 		'shadowsEnabled': { enumerable: true, configurable: true, get: LightInfo.prototype.__get_shadowsEnabled, set: LightInfo.prototype.__set_shadowsEnabled},
 		'shadowsEnabled': { enumerable: true, configurable: true, get: LightInfo.prototype.__get_shadowsEnabled, set: LightInfo.prototype.__set_shadowsEnabled},
-		'shadowMapTexture': { enumerable: true, configurable: true, get: LightInfo.prototype.__get_shadowMapTexture, set: LightInfo.prototype.__set_shadowMapTexture},
 		'lightViewMatrix': { enumerable: true, configurable: true, get: LightInfo.prototype.__get_lightViewMatrix, set: LightInfo.prototype.__set_lightViewMatrix}
 		'lightViewMatrix': { enumerable: true, configurable: true, get: LightInfo.prototype.__get_lightViewMatrix, set: LightInfo.prototype.__set_lightViewMatrix}
 	})
 	})
 }
 }
@@ -129,16 +128,6 @@ LightInfo.prototype.__set_shadowsEnabled = function(val) {
 	Polycode.LightInfo__set_shadowsEnabled(this.__ptr, val)
 	Polycode.LightInfo__set_shadowsEnabled(this.__ptr, val)
 }
 }
 
 
-LightInfo.prototype.__get_shadowMapTexture = function() {
-	var retVal = new Texture()
-	retVal.__ptr = 	Polycode.LightInfo__get_shadowMapTexture(this.__ptr)
-	return retVal
-}
-
-LightInfo.prototype.__set_shadowMapTexture = function(val) {
-	Polycode.LightInfo__set_shadowMapTexture(this.__ptr, val.__ptr)
-}
-
 LightInfo.prototype.__get_lightViewMatrix = function() {
 LightInfo.prototype.__get_lightViewMatrix = function() {
 	var retVal = new Matrix4()
 	var retVal = new Matrix4()
 	retVal.__ptr = 	Polycode.LightInfo__get_lightViewMatrix(this.__ptr)
 	retVal.__ptr = 	Polycode.LightInfo__get_lightViewMatrix(this.__ptr)

+ 0 - 112
bindings/javascript/Polycode/LightInfoBinding.js

@@ -1,117 +1,5 @@
 function LightInfoBinding() {
 function LightInfoBinding() {
-	Object.defineProperties(this, {
-		'position': { enumerable: true, configurable: true, get: LightInfoBinding.prototype.__get_position, set: LightInfoBinding.prototype.__set_position},
-		'direction': { enumerable: true, configurable: true, get: LightInfoBinding.prototype.__get_direction, set: LightInfoBinding.prototype.__set_direction},
-		'specular': { enumerable: true, configurable: true, get: LightInfoBinding.prototype.__get_specular, set: LightInfoBinding.prototype.__set_specular},
-		'diffuse': { enumerable: true, configurable: true, get: LightInfoBinding.prototype.__get_diffuse, set: LightInfoBinding.prototype.__set_diffuse},
-		'spotExponent': { enumerable: true, configurable: true, get: LightInfoBinding.prototype.__get_spotExponent, set: LightInfoBinding.prototype.__set_spotExponent},
-		'spotCosCutoff': { enumerable: true, configurable: true, get: LightInfoBinding.prototype.__get_spotCosCutoff, set: LightInfoBinding.prototype.__set_spotCosCutoff},
-		'constantAttenuation': { enumerable: true, configurable: true, get: LightInfoBinding.prototype.__get_constantAttenuation, set: LightInfoBinding.prototype.__set_constantAttenuation},
-		'linearAttenuation': { enumerable: true, configurable: true, get: LightInfoBinding.prototype.__get_linearAttenuation, set: LightInfoBinding.prototype.__set_linearAttenuation},
-		'quadraticAttenuation': { enumerable: true, configurable: true, get: LightInfoBinding.prototype.__get_quadraticAttenuation, set: LightInfoBinding.prototype.__set_quadraticAttenuation},
-		'shadowEnabled': { enumerable: true, configurable: true, get: LightInfoBinding.prototype.__get_shadowEnabled, set: LightInfoBinding.prototype.__set_shadowEnabled}
-	})
 }
 }
-LightInfoBinding.prototype.__get_position = function() {
-	var retVal = new LocalShaderParam()
-	retVal.__ptr = 	Polycode.LightInfoBinding__get_position(this.__ptr)
-	return retVal
-}
-
-LightInfoBinding.prototype.__set_position = function(val) {
-	Polycode.LightInfoBinding__set_position(this.__ptr, val.__ptr)
-}
-
-LightInfoBinding.prototype.__get_direction = function() {
-	var retVal = new LocalShaderParam()
-	retVal.__ptr = 	Polycode.LightInfoBinding__get_direction(this.__ptr)
-	return retVal
-}
-
-LightInfoBinding.prototype.__set_direction = function(val) {
-	Polycode.LightInfoBinding__set_direction(this.__ptr, val.__ptr)
-}
-
-LightInfoBinding.prototype.__get_specular = function() {
-	var retVal = new LocalShaderParam()
-	retVal.__ptr = 	Polycode.LightInfoBinding__get_specular(this.__ptr)
-	return retVal
-}
-
-LightInfoBinding.prototype.__set_specular = function(val) {
-	Polycode.LightInfoBinding__set_specular(this.__ptr, val.__ptr)
-}
-
-LightInfoBinding.prototype.__get_diffuse = function() {
-	var retVal = new LocalShaderParam()
-	retVal.__ptr = 	Polycode.LightInfoBinding__get_diffuse(this.__ptr)
-	return retVal
-}
-
-LightInfoBinding.prototype.__set_diffuse = function(val) {
-	Polycode.LightInfoBinding__set_diffuse(this.__ptr, val.__ptr)
-}
-
-LightInfoBinding.prototype.__get_spotExponent = function() {
-	var retVal = new LocalShaderParam()
-	retVal.__ptr = 	Polycode.LightInfoBinding__get_spotExponent(this.__ptr)
-	return retVal
-}
-
-LightInfoBinding.prototype.__set_spotExponent = function(val) {
-	Polycode.LightInfoBinding__set_spotExponent(this.__ptr, val.__ptr)
-}
-
-LightInfoBinding.prototype.__get_spotCosCutoff = function() {
-	var retVal = new LocalShaderParam()
-	retVal.__ptr = 	Polycode.LightInfoBinding__get_spotCosCutoff(this.__ptr)
-	return retVal
-}
-
-LightInfoBinding.prototype.__set_spotCosCutoff = function(val) {
-	Polycode.LightInfoBinding__set_spotCosCutoff(this.__ptr, val.__ptr)
-}
-
-LightInfoBinding.prototype.__get_constantAttenuation = function() {
-	var retVal = new LocalShaderParam()
-	retVal.__ptr = 	Polycode.LightInfoBinding__get_constantAttenuation(this.__ptr)
-	return retVal
-}
-
-LightInfoBinding.prototype.__set_constantAttenuation = function(val) {
-	Polycode.LightInfoBinding__set_constantAttenuation(this.__ptr, val.__ptr)
-}
-
-LightInfoBinding.prototype.__get_linearAttenuation = function() {
-	var retVal = new LocalShaderParam()
-	retVal.__ptr = 	Polycode.LightInfoBinding__get_linearAttenuation(this.__ptr)
-	return retVal
-}
-
-LightInfoBinding.prototype.__set_linearAttenuation = function(val) {
-	Polycode.LightInfoBinding__set_linearAttenuation(this.__ptr, val.__ptr)
-}
-
-LightInfoBinding.prototype.__get_quadraticAttenuation = function() {
-	var retVal = new LocalShaderParam()
-	retVal.__ptr = 	Polycode.LightInfoBinding__get_quadraticAttenuation(this.__ptr)
-	return retVal
-}
-
-LightInfoBinding.prototype.__set_quadraticAttenuation = function(val) {
-	Polycode.LightInfoBinding__set_quadraticAttenuation(this.__ptr, val.__ptr)
-}
-
-LightInfoBinding.prototype.__get_shadowEnabled = function() {
-	var retVal = new LocalShaderParam()
-	retVal.__ptr = 	Polycode.LightInfoBinding__get_shadowEnabled(this.__ptr)
-	return retVal
-}
-
-LightInfoBinding.prototype.__set_shadowEnabled = function(val) {
-	Polycode.LightInfoBinding__set_shadowEnabled(this.__ptr, val.__ptr)
-}
-
 Duktape.fin(LightInfoBinding.prototype, function (x) {
 Duktape.fin(LightInfoBinding.prototype, function (x) {
 	if (x === LightInfoBinding.prototype) {
 	if (x === LightInfoBinding.prototype) {
 		return;
 		return;

+ 0 - 24
bindings/javascript/Polycode/LightShadowInfoBinding.js

@@ -1,29 +1,5 @@
 function LightShadowInfoBinding() {
 function LightShadowInfoBinding() {
-	Object.defineProperties(this, {
-		'shadowMatrix': { enumerable: true, configurable: true, get: LightShadowInfoBinding.prototype.__get_shadowMatrix, set: LightShadowInfoBinding.prototype.__set_shadowMatrix},
-		'shadowBuffer': { enumerable: true, configurable: true, get: LightShadowInfoBinding.prototype.__get_shadowBuffer, set: LightShadowInfoBinding.prototype.__set_shadowBuffer}
-	})
 }
 }
-LightShadowInfoBinding.prototype.__get_shadowMatrix = function() {
-	var retVal = new LocalShaderParam()
-	retVal.__ptr = 	Polycode.LightShadowInfoBinding__get_shadowMatrix(this.__ptr)
-	return retVal
-}
-
-LightShadowInfoBinding.prototype.__set_shadowMatrix = function(val) {
-	Polycode.LightShadowInfoBinding__set_shadowMatrix(this.__ptr, val.__ptr)
-}
-
-LightShadowInfoBinding.prototype.__get_shadowBuffer = function() {
-	var retVal = new LocalShaderParam()
-	retVal.__ptr = 	Polycode.LightShadowInfoBinding__get_shadowBuffer(this.__ptr)
-	return retVal
-}
-
-LightShadowInfoBinding.prototype.__set_shadowBuffer = function(val) {
-	Polycode.LightShadowInfoBinding__set_shadowBuffer(this.__ptr, val.__ptr)
-}
-
 Duktape.fin(LightShadowInfoBinding.prototype, function (x) {
 Duktape.fin(LightShadowInfoBinding.prototype, function (x) {
 	if (x === LightShadowInfoBinding.prototype) {
 	if (x === LightShadowInfoBinding.prototype) {
 		return;
 		return;

+ 3 - 3
bindings/javascript/Polycode/LocalShaderParam.js

@@ -57,7 +57,7 @@ Duktape.fin(LocalShaderParam.prototype, function (x) {
 })
 })
 
 
 LocalShaderParam.prototype.Copy = function() {
 LocalShaderParam.prototype.Copy = function() {
-	var retVal = new LocalShaderParam()
+	var retVal = new shared_ptr<LocalShaderParam>()
 	retVal.__ptr = Polycode.LocalShaderParam_Copy(this.__ptr)
 	retVal.__ptr = Polycode.LocalShaderParam_Copy(this.__ptr)
 	return retVal
 	return retVal
 }
 }
@@ -115,7 +115,7 @@ LocalShaderParam.prototype.setTexture = function(texture) {
 }
 }
 
 
 LocalShaderParam.prototype.getTexture = function() {
 LocalShaderParam.prototype.getTexture = function() {
-	var retVal = new Texture()
+	var retVal = new shared_ptr<Texture>()
 	retVal.__ptr = Polycode.LocalShaderParam_getTexture(this.__ptr)
 	retVal.__ptr = Polycode.LocalShaderParam_getTexture(this.__ptr)
 	return retVal
 	return retVal
 }
 }
@@ -125,7 +125,7 @@ LocalShaderParam.prototype.setCubemap = function(cubemap) {
 }
 }
 
 
 LocalShaderParam.prototype.getCubemap = function() {
 LocalShaderParam.prototype.getCubemap = function() {
-	var retVal = new Cubemap()
+	var retVal = new shared_ptr<Cubemap>()
 	retVal.__ptr = Polycode.LocalShaderParam_getCubemap(this.__ptr)
 	retVal.__ptr = Polycode.LocalShaderParam_getCubemap(this.__ptr)
 	return retVal
 	return retVal
 }
 }

+ 2 - 14
bindings/javascript/Polycode/Material.js

@@ -38,14 +38,6 @@ Material.prototype.addShaderPassAtIndex = function(pass,shaderIndex) {
 	Polycode.Material_addShaderPassAtIndex(this.__ptr, pass,shaderIndex)
 	Polycode.Material_addShaderPassAtIndex(this.__ptr, pass,shaderIndex)
 }
 }
 
 
-Material.prototype.addShader = function(shader,shaderBinding) {
-	Polycode.Material_addShader(this.__ptr, shader,shaderBinding)
-}
-
-Material.prototype.addShaderAtIndex = function(shader,shaderBinding,shaderIndex) {
-	Polycode.Material_addShaderAtIndex(this.__ptr, shader,shaderBinding,shaderIndex)
-}
-
 Material.prototype.getNumShaderPasses = function() {
 Material.prototype.getNumShaderPasses = function() {
 	return Polycode.Material_getNumShaderPasses(this.__ptr)
 	return Polycode.Material_getNumShaderPasses(this.__ptr)
 }
 }
@@ -54,10 +46,6 @@ Material.prototype.removeShaderPass = function(shaderIndex) {
 	Polycode.Material_removeShaderPass(this.__ptr, shaderIndex)
 	Polycode.Material_removeShaderPass(this.__ptr, shaderIndex)
 }
 }
 
 
-Material.prototype.recreateExpectedShaderParams = function() {
-	Polycode.Material_recreateExpectedShaderParams(this.__ptr)
-}
-
 Material.prototype.addShaderRenderTarget = function(newTarget) {
 Material.prototype.addShaderRenderTarget = function(newTarget) {
 	Polycode.Material_addShaderRenderTarget(this.__ptr, newTarget)
 	Polycode.Material_addShaderRenderTarget(this.__ptr, newTarget)
 }
 }
@@ -95,13 +83,13 @@ Material.prototype.getShaderPass = function(index) {
 }
 }
 
 
 Material.prototype.getShaderBinding = function(index) {
 Material.prototype.getShaderBinding = function(index) {
-	var retVal = new ShaderBinding()
+	var retVal = new shared_ptr<ShaderBinding>()
 	retVal.__ptr = Polycode.Material_getShaderBinding(this.__ptr, index)
 	retVal.__ptr = Polycode.Material_getShaderBinding(this.__ptr, index)
 	return retVal
 	return retVal
 }
 }
 
 
 Material.prototype.getShader = function(index) {
 Material.prototype.getShader = function(index) {
-	var retVal = new Shader()
+	var retVal = new shared_ptr<Shader>()
 	retVal.__ptr = Polycode.Material_getShader(this.__ptr, index)
 	retVal.__ptr = Polycode.Material_getShader(this.__ptr, index)
 	return retVal
 	return retVal
 }
 }

+ 1 - 1
bindings/javascript/Polycode/MaterialResourceLoader.js

@@ -8,7 +8,7 @@ Duktape.fin(MaterialResourceLoader.prototype, function (x) {
 })
 })
 
 
 MaterialResourceLoader.prototype.loadResource = function(path,targetPool) {
 MaterialResourceLoader.prototype.loadResource = function(path,targetPool) {
-	var retVal = new Resource()
+	var retVal = new shared_ptr<Resource>()
 	retVal.__ptr = Polycode.MaterialResourceLoader_loadResource(this.__ptr, path,targetPool)
 	retVal.__ptr = Polycode.MaterialResourceLoader_loadResource(this.__ptr, path,targetPool)
 	return retVal
 	return retVal
 }
 }

+ 1 - 1
bindings/javascript/Polycode/MeshResourceLoader.js

@@ -8,7 +8,7 @@ Duktape.fin(MeshResourceLoader.prototype, function (x) {
 })
 })
 
 
 MeshResourceLoader.prototype.loadResource = function(path,targetPool) {
 MeshResourceLoader.prototype.loadResource = function(path,targetPool) {
-	var retVal = new Resource()
+	var retVal = new shared_ptr<Resource>()
 	retVal.__ptr = Polycode.MeshResourceLoader_loadResource(this.__ptr, path,targetPool)
 	retVal.__ptr = Polycode.MeshResourceLoader_loadResource(this.__ptr, path,targetPool)
 	return retVal
 	return retVal
 }
 }

+ 1 - 1
bindings/javascript/Polycode/ProgramResourceLoader.js

@@ -8,7 +8,7 @@ Duktape.fin(ProgramResourceLoader.prototype, function (x) {
 })
 })
 
 
 ProgramResourceLoader.prototype.loadResource = function(path,targetPool) {
 ProgramResourceLoader.prototype.loadResource = function(path,targetPool) {
-	var retVal = new Resource()
+	var retVal = new shared_ptr<Resource>()
 	retVal.__ptr = Polycode.ProgramResourceLoader_loadResource(this.__ptr, path,targetPool)
 	retVal.__ptr = Polycode.ProgramResourceLoader_loadResource(this.__ptr, path,targetPool)
 	return retVal
 	return retVal
 }
 }

+ 0 - 24
bindings/javascript/Polycode/RenderBuffer.js

@@ -1,29 +1,5 @@
 function RenderBuffer() {
 function RenderBuffer() {
-	Object.defineProperties(this, {
-		'colorTexture': { enumerable: true, configurable: true, get: RenderBuffer.prototype.__get_colorTexture, set: RenderBuffer.prototype.__set_colorTexture},
-		'depthTexture': { enumerable: true, configurable: true, get: RenderBuffer.prototype.__get_depthTexture, set: RenderBuffer.prototype.__set_depthTexture}
-	})
 }
 }
-RenderBuffer.prototype.__get_colorTexture = function() {
-	var retVal = new Texture()
-	retVal.__ptr = 	Polycode.RenderBuffer__get_colorTexture(this.__ptr)
-	return retVal
-}
-
-RenderBuffer.prototype.__set_colorTexture = function(val) {
-	Polycode.RenderBuffer__set_colorTexture(this.__ptr, val.__ptr)
-}
-
-RenderBuffer.prototype.__get_depthTexture = function() {
-	var retVal = new Texture()
-	retVal.__ptr = 	Polycode.RenderBuffer__get_depthTexture(this.__ptr)
-	return retVal
-}
-
-RenderBuffer.prototype.__set_depthTexture = function(val) {
-	Polycode.RenderBuffer__set_depthTexture(this.__ptr, val.__ptr)
-}
-
 Duktape.fin(RenderBuffer.prototype, function (x) {
 Duktape.fin(RenderBuffer.prototype, function (x) {
 	if (x === RenderBuffer.prototype) {
 	if (x === RenderBuffer.prototype) {
 		return;
 		return;

+ 1 - 12
bindings/javascript/Polycode/RenderTargetBinding.js

@@ -2,8 +2,7 @@ function RenderTargetBinding() {
 	Object.defineProperties(this, {
 	Object.defineProperties(this, {
 		'id': { enumerable: true, configurable: true, get: RenderTargetBinding.prototype.__get_id, set: RenderTargetBinding.prototype.__set_id},
 		'id': { enumerable: true, configurable: true, get: RenderTargetBinding.prototype.__get_id, set: RenderTargetBinding.prototype.__set_id},
 		'name': { enumerable: true, configurable: true, get: RenderTargetBinding.prototype.__get_name, set: RenderTargetBinding.prototype.__set_name},
 		'name': { enumerable: true, configurable: true, get: RenderTargetBinding.prototype.__get_name, set: RenderTargetBinding.prototype.__set_name},
-		'mode': { enumerable: true, configurable: true, get: RenderTargetBinding.prototype.__get_mode, set: RenderTargetBinding.prototype.__set_mode},
-		'buffer': { enumerable: true, configurable: true, get: RenderTargetBinding.prototype.__get_buffer, set: RenderTargetBinding.prototype.__set_buffer}
+		'mode': { enumerable: true, configurable: true, get: RenderTargetBinding.prototype.__get_mode, set: RenderTargetBinding.prototype.__set_mode}
 	})
 	})
 }
 }
 RenderTargetBinding.prototype.__get_id = function() {
 RenderTargetBinding.prototype.__get_id = function() {
@@ -30,16 +29,6 @@ RenderTargetBinding.prototype.__set_mode = function(val) {
 	Polycode.RenderTargetBinding__set_mode(this.__ptr, val)
 	Polycode.RenderTargetBinding__set_mode(this.__ptr, val)
 }
 }
 
 
-RenderTargetBinding.prototype.__get_buffer = function() {
-	var retVal = new RenderBuffer()
-	retVal.__ptr = 	Polycode.RenderTargetBinding__get_buffer(this.__ptr)
-	return retVal
-}
-
-RenderTargetBinding.prototype.__set_buffer = function(val) {
-	Polycode.RenderTargetBinding__set_buffer(this.__ptr, val.__ptr)
-}
-
 Duktape.fin(RenderTargetBinding.prototype, function (x) {
 Duktape.fin(RenderTargetBinding.prototype, function (x) {
 	if (x === RenderTargetBinding.prototype) {
 	if (x === RenderTargetBinding.prototype) {
 		return;
 		return;

+ 0 - 4
bindings/javascript/Polycode/RenderThread.js

@@ -51,10 +51,6 @@ RenderThread.prototype.getFrameInfo = function() {
 	return retVal
 	return retVal
 }
 }
 
 
-RenderThread.prototype.clearFrameQueue = function() {
-	Polycode.RenderThread_clearFrameQueue(this.__ptr)
-}
-
 RenderThread.prototype.initGlobals = function() {
 RenderThread.prototype.initGlobals = function() {
 	Polycode.RenderThread_initGlobals(this.__ptr)
 	Polycode.RenderThread_initGlobals(this.__ptr)
 }
 }

+ 10 - 48
bindings/javascript/Polycode/Renderer.js

@@ -17,32 +17,6 @@ Renderer.prototype.getRenderThread = function() {
 	return retVal
 	return retVal
 }
 }
 
 
-Renderer.prototype.createCubemap = function(t0,t1,t2,t3,t4,t5) {
-	var retVal = new Cubemap()
-	retVal.__ptr = Polycode.Renderer_createCubemap(this.__ptr, t0,t1,t2,t3,t4,t5)
-	return retVal
-}
-
-Renderer.prototype.createTexture = function(width,height,textureData,clamp,createMipmaps,type,filteringMode,anisotropy,framebufferTexture) {
-	var retVal = new Texture()
-	retVal.__ptr = Polycode.Renderer_createTexture(this.__ptr, width,height,textureData,clamp,createMipmaps,type,filteringMode,anisotropy,framebufferTexture)
-	return retVal
-}
-
-Renderer.prototype.createRenderBuffer = function(width,height,attachDepthBuffer,floatingPoint) {
-	var retVal = new RenderBuffer()
-	retVal.__ptr = Polycode.Renderer_createRenderBuffer(this.__ptr, width,height,attachDepthBuffer,floatingPoint)
-	return retVal
-}
-
-Renderer.prototype.destroyRenderBuffer = function(buffer) {
-	Polycode.Renderer_destroyRenderBuffer(this.__ptr, buffer)
-}
-
-Renderer.prototype.destroyTexture = function(texture) {
-	Polycode.Renderer_destroyTexture(this.__ptr, texture)
-}
-
 Renderer.prototype.processDrawBuffer = function(buffer) {
 Renderer.prototype.processDrawBuffer = function(buffer) {
 	Polycode.Renderer_processDrawBuffer(this.__ptr, buffer)
 	Polycode.Renderer_processDrawBuffer(this.__ptr, buffer)
 }
 }
@@ -59,40 +33,28 @@ Renderer.prototype.getBackingResolutionScaleY = function() {
 	return Polycode.Renderer_getBackingResolutionScaleY(this.__ptr)
 	return Polycode.Renderer_getBackingResolutionScaleY(this.__ptr)
 }
 }
 
 
-Renderer.prototype.createProgram = function(fileName) {
-	var retVal = new ShaderProgram()
-	retVal.__ptr = Polycode.Renderer_createProgram(this.__ptr, fileName)
-	return retVal
-}
-
-Renderer.prototype.createShader = function(vertexProgram,fragmentProgram) {
-	var retVal = new Shader()
-	retVal.__ptr = Polycode.Renderer_createShader(this.__ptr, vertexProgram,fragmentProgram)
-	return retVal
-}
-
 Renderer.prototype.enqueueFrameJob = function(jobType,data) {
 Renderer.prototype.enqueueFrameJob = function(jobType,data) {
 	Polycode.Renderer_enqueueFrameJob(this.__ptr, jobType,data)
 	Polycode.Renderer_enqueueFrameJob(this.__ptr, jobType,data)
 }
 }
 
 
-Renderer.prototype.destroyProgram = function(program) {
-	Polycode.Renderer_destroyProgram(this.__ptr, program)
+Renderer.prototype.destroyRenderBufferPlatformData = function(platformData) {
+	Polycode.Renderer_destroyRenderBufferPlatformData(this.__ptr, platformData)
 }
 }
 
 
-Renderer.prototype.destroyShader = function(shader) {
-	Polycode.Renderer_destroyShader(this.__ptr, shader)
+Renderer.prototype.destroyTexturePlatformData = function(platformData) {
+	Polycode.Renderer_destroyTexturePlatformData(this.__ptr, platformData)
 }
 }
 
 
-Renderer.prototype.destroySubmeshPlatformData = function(platformData) {
-	Polycode.Renderer_destroySubmeshPlatformData(this.__ptr, platformData)
+Renderer.prototype.destroyProgramPlatformData = function(platformData) {
+	Polycode.Renderer_destroyProgramPlatformData(this.__ptr, platformData)
 }
 }
 
 
-Renderer.prototype.destroyShaderBinding = function(binding) {
-	Polycode.Renderer_destroyShaderBinding(this.__ptr, binding)
+Renderer.prototype.destroyShaderPlatformData = function(platformData) {
+	Polycode.Renderer_destroyShaderPlatformData(this.__ptr, platformData)
 }
 }
 
 
-Renderer.prototype.destroyShaderParam = function(param) {
-	Polycode.Renderer_destroyShaderParam(this.__ptr, param)
+Renderer.prototype.destroySubmeshPlatformData = function(platformData) {
+	Polycode.Renderer_destroySubmeshPlatformData(this.__ptr, platformData)
 }
 }
 
 
 Renderer.prototype.setTextureParam = function(param,texture) {
 Renderer.prototype.setTextureParam = function(param,texture) {

+ 8 - 4
bindings/javascript/Polycode/ResourcePool.js

@@ -65,20 +65,24 @@ ResourcePool.prototype.loadResourcesFromFolder = function(folder,recursive) {
 	Polycode.ResourcePool_loadResourcesFromFolder(this.__ptr, folder,recursive)
 	Polycode.ResourcePool_loadResourcesFromFolder(this.__ptr, folder,recursive)
 }
 }
 
 
+ResourcePool.prototype.loadResourcesFromMaterialFile = function(path) {
+	Polycode.ResourcePool_loadResourcesFromMaterialFile(this.__ptr, path)
+}
+
 ResourcePool.prototype.loadResource = function(path) {
 ResourcePool.prototype.loadResource = function(path) {
-	var retVal = new Resource()
+	var retVal = new shared_ptr<Resource>()
 	retVal.__ptr = Polycode.ResourcePool_loadResource(this.__ptr, path)
 	retVal.__ptr = Polycode.ResourcePool_loadResource(this.__ptr, path)
 	return retVal
 	return retVal
 }
 }
 
 
 ResourcePool.prototype.loadResourceWithName = function(path,name) {
 ResourcePool.prototype.loadResourceWithName = function(path,name) {
-	var retVal = new Resource()
+	var retVal = new shared_ptr<Resource>()
 	retVal.__ptr = Polycode.ResourcePool_loadResourceWithName(this.__ptr, path,name)
 	retVal.__ptr = Polycode.ResourcePool_loadResourceWithName(this.__ptr, path,name)
 	return retVal
 	return retVal
 }
 }
 
 
 ResourcePool.prototype.getResource = function(resourceType,resourceName) {
 ResourcePool.prototype.getResource = function(resourceType,resourceName) {
-	var retVal = new Resource()
+	var retVal = new shared_ptr<Resource>()
 	retVal.__ptr = Polycode.ResourcePool_getResource(this.__ptr, resourceType,resourceName)
 	retVal.__ptr = Polycode.ResourcePool_getResource(this.__ptr, resourceType,resourceName)
 	return retVal
 	return retVal
 }
 }
@@ -92,7 +96,7 @@ ResourcePool.prototype.setName = function(name) {
 }
 }
 
 
 ResourcePool.prototype.getResourceByPath = function(resourcePath) {
 ResourcePool.prototype.getResourceByPath = function(resourcePath) {
-	var retVal = new Resource()
+	var retVal = new shared_ptr<Resource>()
 	retVal.__ptr = Polycode.ResourcePool_getResourceByPath(this.__ptr, resourcePath)
 	retVal.__ptr = Polycode.ResourcePool_getResourceByPath(this.__ptr, resourcePath)
 	return retVal
 	return retVal
 }
 }

+ 1 - 1
bindings/javascript/Polycode/SceneEntityInstance.js

@@ -76,7 +76,7 @@ SceneEntityInstance.prototype.unlinkResourcePool = function(pool) {
 }
 }
 
 
 SceneEntityInstance.prototype.getResourceEntry = function() {
 SceneEntityInstance.prototype.getResourceEntry = function() {
-	var retVal = new SceneEntityInstanceResourceEntry()
+	var retVal = new shared_ptr<SceneEntityInstanceResourceEntry>()
 	retVal.__ptr = Polycode.SceneEntityInstance_getResourceEntry(this.__ptr)
 	retVal.__ptr = Polycode.SceneEntityInstance_getResourceEntry(this.__ptr)
 	return retVal
 	return retVal
 }
 }

+ 1 - 1
bindings/javascript/Polycode/SceneLight.js

@@ -34,7 +34,7 @@ SceneLight.prototype.renderDepthMap = function(scene) {
 }
 }
 
 
 SceneLight.prototype.getZBufferTexture = function() {
 SceneLight.prototype.getZBufferTexture = function() {
-	var retVal = new Texture()
+	var retVal = new shared_ptr<Texture>()
 	retVal.__ptr = Polycode.SceneLight_getZBufferTexture(this.__ptr)
 	retVal.__ptr = Polycode.SceneLight_getZBufferTexture(this.__ptr)
 	return retVal
 	return retVal
 }
 }

+ 4 - 22
bindings/javascript/Polycode/SceneMesh.js

@@ -3,8 +3,6 @@ function SceneMesh() {
 		'lineWidth': { enumerable: true, configurable: true, get: SceneMesh.prototype.__get_lineWidth, set: SceneMesh.prototype.__set_lineWidth},
 		'lineWidth': { enumerable: true, configurable: true, get: SceneMesh.prototype.__get_lineWidth, set: SceneMesh.prototype.__set_lineWidth},
 		'lineSmooth': { enumerable: true, configurable: true, get: SceneMesh.prototype.__get_lineSmooth, set: SceneMesh.prototype.__set_lineSmooth},
 		'lineSmooth': { enumerable: true, configurable: true, get: SceneMesh.prototype.__get_lineSmooth, set: SceneMesh.prototype.__set_lineSmooth},
 		'pointSmooth': { enumerable: true, configurable: true, get: SceneMesh.prototype.__get_pointSmooth, set: SceneMesh.prototype.__set_pointSmooth},
 		'pointSmooth': { enumerable: true, configurable: true, get: SceneMesh.prototype.__get_pointSmooth, set: SceneMesh.prototype.__set_pointSmooth},
-		'ownsMesh': { enumerable: true, configurable: true, get: SceneMesh.prototype.__get_ownsMesh, set: SceneMesh.prototype.__set_ownsMesh},
-		'ownsSkeleton': { enumerable: true, configurable: true, get: SceneMesh.prototype.__get_ownsSkeleton, set: SceneMesh.prototype.__set_ownsSkeleton},
 		'useGeometryHitDetection': { enumerable: true, configurable: true, get: SceneMesh.prototype.__get_useGeometryHitDetection, set: SceneMesh.prototype.__set_useGeometryHitDetection},
 		'useGeometryHitDetection': { enumerable: true, configurable: true, get: SceneMesh.prototype.__get_useGeometryHitDetection, set: SceneMesh.prototype.__set_useGeometryHitDetection},
 		'alphaTest': { enumerable: true, configurable: true, get: SceneMesh.prototype.__get_alphaTest, set: SceneMesh.prototype.__set_alphaTest},
 		'alphaTest': { enumerable: true, configurable: true, get: SceneMesh.prototype.__get_alphaTest, set: SceneMesh.prototype.__set_alphaTest},
 		'backfaceCulled': { enumerable: true, configurable: true, get: SceneMesh.prototype.__get_backfaceCulled, set: SceneMesh.prototype.__set_backfaceCulled},
 		'backfaceCulled': { enumerable: true, configurable: true, get: SceneMesh.prototype.__get_backfaceCulled, set: SceneMesh.prototype.__set_backfaceCulled},
@@ -35,22 +33,6 @@ SceneMesh.prototype.__set_pointSmooth = function(val) {
 	Polycode.SceneMesh__set_pointSmooth(this.__ptr, val)
 	Polycode.SceneMesh__set_pointSmooth(this.__ptr, val)
 }
 }
 
 
-SceneMesh.prototype.__get_ownsMesh = function() {
-	return Polycode.SceneMesh__get_ownsMesh(this.__ptr)
-}
-
-SceneMesh.prototype.__set_ownsMesh = function(val) {
-	Polycode.SceneMesh__set_ownsMesh(this.__ptr, val)
-}
-
-SceneMesh.prototype.__get_ownsSkeleton = function() {
-	return Polycode.SceneMesh__get_ownsSkeleton(this.__ptr)
-}
-
-SceneMesh.prototype.__set_ownsSkeleton = function(val) {
-	Polycode.SceneMesh__set_ownsSkeleton(this.__ptr, val)
-}
-
 SceneMesh.prototype.__get_useGeometryHitDetection = function() {
 SceneMesh.prototype.__get_useGeometryHitDetection = function() {
 	return Polycode.SceneMesh__get_useGeometryHitDetection(this.__ptr)
 	return Polycode.SceneMesh__get_useGeometryHitDetection(this.__ptr)
 }
 }
@@ -107,19 +89,19 @@ SceneMesh.prototype.removeShaderPass = function(shaderIndex) {
 }
 }
 
 
 SceneMesh.prototype.getMesh = function() {
 SceneMesh.prototype.getMesh = function() {
-	var retVal = new Mesh()
+	var retVal = new shared_ptr<Mesh>()
 	retVal.__ptr = Polycode.SceneMesh_getMesh(this.__ptr)
 	retVal.__ptr = Polycode.SceneMesh_getMesh(this.__ptr)
 	return retVal
 	return retVal
 }
 }
 
 
 SceneMesh.prototype.getMaterial = function() {
 SceneMesh.prototype.getMaterial = function() {
-	var retVal = new Material()
+	var retVal = new shared_ptr<Material>()
 	retVal.__ptr = Polycode.SceneMesh_getMaterial(this.__ptr)
 	retVal.__ptr = Polycode.SceneMesh_getMaterial(this.__ptr)
 	return retVal
 	return retVal
 }
 }
 
 
 SceneMesh.prototype.loadSkeleton = function(fileName) {
 SceneMesh.prototype.loadSkeleton = function(fileName) {
-	var retVal = new Skeleton()
+	var retVal = new shared_ptr<Skeleton>()
 	retVal.__ptr = Polycode.SceneMesh_loadSkeleton(this.__ptr, fileName)
 	retVal.__ptr = Polycode.SceneMesh_loadSkeleton(this.__ptr, fileName)
 	return retVal
 	return retVal
 }
 }
@@ -145,7 +127,7 @@ SceneMesh.prototype.setSkeleton = function(skeleton) {
 }
 }
 
 
 SceneMesh.prototype.getSkeleton = function() {
 SceneMesh.prototype.getSkeleton = function() {
-	var retVal = new Skeleton()
+	var retVal = new shared_ptr<Skeleton>()
 	retVal.__ptr = Polycode.SceneMesh_getSkeleton(this.__ptr)
 	retVal.__ptr = Polycode.SceneMesh_getSkeleton(this.__ptr)
 	return retVal
 	return retVal
 }
 }

+ 1 - 13
bindings/javascript/Polycode/SceneRenderTexture.js

@@ -19,23 +19,11 @@ Duktape.fin(SceneRenderTexture.prototype, function (x) {
 })
 })
 
 
 SceneRenderTexture.prototype.getTargetTexture = function() {
 SceneRenderTexture.prototype.getTargetTexture = function() {
-	var retVal = new Texture()
+	var retVal = new shared_ptr<Texture>()
 	retVal.__ptr = Polycode.SceneRenderTexture_getTargetTexture(this.__ptr)
 	retVal.__ptr = Polycode.SceneRenderTexture_getTargetTexture(this.__ptr)
 	return retVal
 	return retVal
 }
 }
 
 
-SceneRenderTexture.prototype.getFilterColorBufferTexture = function() {
-	var retVal = new Texture()
-	retVal.__ptr = Polycode.SceneRenderTexture_getFilterColorBufferTexture(this.__ptr)
-	return retVal
-}
-
-SceneRenderTexture.prototype.getFilterZBufferTexture = function() {
-	var retVal = new Texture()
-	retVal.__ptr = Polycode.SceneRenderTexture_getFilterZBufferTexture(this.__ptr)
-	return retVal
-}
-
 SceneRenderTexture.prototype.Render = function() {
 SceneRenderTexture.prototype.Render = function() {
 	Polycode.SceneRenderTexture_Render(this.__ptr)
 	Polycode.SceneRenderTexture_Render(this.__ptr)
 }
 }

+ 1 - 1
bindings/javascript/Polycode/SceneSprite.js

@@ -18,7 +18,7 @@ SceneSprite.prototype.getSpriteSet = function() {
 }
 }
 
 
 SceneSprite.prototype.getCurrentSprite = function() {
 SceneSprite.prototype.getCurrentSprite = function() {
-	var retVal = new Sprite()
+	var retVal = new shared_ptr<Sprite>()
 	retVal.__ptr = Polycode.SceneSprite_getCurrentSprite(this.__ptr)
 	retVal.__ptr = Polycode.SceneSprite_getCurrentSprite(this.__ptr)
 	return retVal
 	return retVal
 }
 }

+ 1 - 1
bindings/javascript/Polycode/ScriptResourceLoader.js

@@ -8,7 +8,7 @@ Duktape.fin(ScriptResourceLoader.prototype, function (x) {
 })
 })
 
 
 ScriptResourceLoader.prototype.loadResource = function(path,targetPool) {
 ScriptResourceLoader.prototype.loadResource = function(path,targetPool) {
-	var retVal = new Resource()
+	var retVal = new shared_ptr<Resource>()
 	retVal.__ptr = Polycode.ScriptResourceLoader_loadResource(this.__ptr, path,targetPool)
 	retVal.__ptr = Polycode.ScriptResourceLoader_loadResource(this.__ptr, path,targetPool)
 	return retVal
 	return retVal
 }
 }

+ 0 - 30
bindings/javascript/Polycode/Shader.js

@@ -3,8 +3,6 @@ function Shader() {
 		'numSpotLights': { enumerable: true, configurable: true, get: Shader.prototype.__get_numSpotLights, set: Shader.prototype.__set_numSpotLights},
 		'numSpotLights': { enumerable: true, configurable: true, get: Shader.prototype.__get_numSpotLights, set: Shader.prototype.__set_numSpotLights},
 		'numPointLights': { enumerable: true, configurable: true, get: Shader.prototype.__get_numPointLights, set: Shader.prototype.__set_numPointLights},
 		'numPointLights': { enumerable: true, configurable: true, get: Shader.prototype.__get_numPointLights, set: Shader.prototype.__set_numPointLights},
 		'screenShader': { enumerable: true, configurable: true, get: Shader.prototype.__get_screenShader, set: Shader.prototype.__set_screenShader},
 		'screenShader': { enumerable: true, configurable: true, get: Shader.prototype.__get_screenShader, set: Shader.prototype.__set_screenShader},
-		'vertexProgram': { enumerable: true, configurable: true, get: Shader.prototype.__get_vertexProgram, set: Shader.prototype.__set_vertexProgram},
-		'fragmentProgram': { enumerable: true, configurable: true, get: Shader.prototype.__get_fragmentProgram, set: Shader.prototype.__set_fragmentProgram},
 		'name': { enumerable: true, configurable: true, get: Shader.prototype.__get_name, set: Shader.prototype.__set_name}
 		'name': { enumerable: true, configurable: true, get: Shader.prototype.__get_name, set: Shader.prototype.__set_name}
 	})
 	})
 }
 }
@@ -32,26 +30,6 @@ Shader.prototype.__set_screenShader = function(val) {
 	Polycode.Shader__set_screenShader(this.__ptr, val)
 	Polycode.Shader__set_screenShader(this.__ptr, val)
 }
 }
 
 
-Shader.prototype.__get_vertexProgram = function() {
-	var retVal = new ShaderProgram()
-	retVal.__ptr = 	Polycode.Shader__get_vertexProgram(this.__ptr)
-	return retVal
-}
-
-Shader.prototype.__set_vertexProgram = function(val) {
-	Polycode.Shader__set_vertexProgram(this.__ptr, val.__ptr)
-}
-
-Shader.prototype.__get_fragmentProgram = function() {
-	var retVal = new ShaderProgram()
-	retVal.__ptr = 	Polycode.Shader__get_fragmentProgram(this.__ptr)
-	return retVal
-}
-
-Shader.prototype.__set_fragmentProgram = function(val) {
-	Polycode.Shader__set_fragmentProgram(this.__ptr, val.__ptr)
-}
-
 Shader.prototype.__get_name = function() {
 Shader.prototype.__get_name = function() {
 	return Polycode.Shader__get_name(this.__ptr)
 	return Polycode.Shader__get_name(this.__ptr)
 }
 }
@@ -98,11 +76,3 @@ Shader.prototype.reload = function() {
 Shader.prototype.getExpectedParamType = function(name) {
 Shader.prototype.getExpectedParamType = function(name) {
 	return Polycode.Shader_getExpectedParamType(this.__ptr, name)
 	return Polycode.Shader_getExpectedParamType(this.__ptr, name)
 }
 }
-
-Shader.prototype.setVertexProgram = function(vp) {
-	Polycode.Shader_setVertexProgram(this.__ptr, vp)
-}
-
-Shader.prototype.setFragmentProgram = function(fp) {
-	Polycode.Shader_setFragmentProgram(this.__ptr, fp)
-}

+ 11 - 16
bindings/javascript/Polycode/ShaderBinding.js

@@ -1,19 +1,8 @@
 function ShaderBinding() {
 function ShaderBinding() {
 	Object.defineProperties(this, {
 	Object.defineProperties(this, {
-		'targetShader': { enumerable: true, configurable: true, get: ShaderBinding.prototype.__get_targetShader, set: ShaderBinding.prototype.__set_targetShader},
 		'accessMutex': { enumerable: true, configurable: true, get: ShaderBinding.prototype.__get_accessMutex, set: ShaderBinding.prototype.__set_accessMutex}
 		'accessMutex': { enumerable: true, configurable: true, get: ShaderBinding.prototype.__get_accessMutex, set: ShaderBinding.prototype.__set_accessMutex}
 	})
 	})
 }
 }
-ShaderBinding.prototype.__get_targetShader = function() {
-	var retVal = new Shader()
-	retVal.__ptr = 	Polycode.ShaderBinding__get_targetShader(this.__ptr)
-	return retVal
-}
-
-ShaderBinding.prototype.__set_targetShader = function(val) {
-	Polycode.ShaderBinding__set_targetShader(this.__ptr, val.__ptr)
-}
-
 ShaderBinding.prototype.__get_accessMutex = function() {
 ShaderBinding.prototype.__get_accessMutex = function() {
 	var retVal = new CoreMutex()
 	var retVal = new CoreMutex()
 	retVal.__ptr = 	Polycode.ShaderBinding__get_accessMutex(this.__ptr)
 	retVal.__ptr = 	Polycode.ShaderBinding__get_accessMutex(this.__ptr)
@@ -36,29 +25,35 @@ ShaderBinding.prototype.copyTo = function(targetBinding) {
 }
 }
 
 
 ShaderBinding.prototype.addParam = function(type,name) {
 ShaderBinding.prototype.addParam = function(type,name) {
-	var retVal = new LocalShaderParam()
+	var retVal = new shared_ptr<LocalShaderParam>()
 	retVal.__ptr = Polycode.ShaderBinding_addParam(this.__ptr, type,name)
 	retVal.__ptr = Polycode.ShaderBinding_addParam(this.__ptr, type,name)
 	return retVal
 	return retVal
 }
 }
 
 
 ShaderBinding.prototype.addParamPointer = function(type,name,ptr) {
 ShaderBinding.prototype.addParamPointer = function(type,name,ptr) {
-	var retVal = new LocalShaderParam()
+	var retVal = new shared_ptr<LocalShaderParam>()
 	retVal.__ptr = Polycode.ShaderBinding_addParamPointer(this.__ptr, type,name,ptr)
 	retVal.__ptr = Polycode.ShaderBinding_addParamPointer(this.__ptr, type,name,ptr)
 	return retVal
 	return retVal
 }
 }
 
 
+ShaderBinding.prototype.addParamFromData = function(name,data) {
+	var retVal = new shared_ptr<LocalShaderParam>()
+	retVal.__ptr = Polycode.ShaderBinding_addParamFromData(this.__ptr, name,data)
+	return retVal
+}
+
 ShaderBinding.prototype.getNumLocalParams = function() {
 ShaderBinding.prototype.getNumLocalParams = function() {
 	return Polycode.ShaderBinding_getNumLocalParams(this.__ptr)
 	return Polycode.ShaderBinding_getNumLocalParams(this.__ptr)
 }
 }
 
 
 ShaderBinding.prototype.getLocalParam = function(index) {
 ShaderBinding.prototype.getLocalParam = function(index) {
-	var retVal = new LocalShaderParam()
+	var retVal = new shared_ptr<LocalShaderParam>()
 	retVal.__ptr = Polycode.ShaderBinding_getLocalParam(this.__ptr, index)
 	retVal.__ptr = Polycode.ShaderBinding_getLocalParam(this.__ptr, index)
 	return retVal
 	return retVal
 }
 }
 
 
 ShaderBinding.prototype.getLocalParamByName = function(name) {
 ShaderBinding.prototype.getLocalParamByName = function(name) {
-	var retVal = new LocalShaderParam()
+	var retVal = new shared_ptr<LocalShaderParam>()
 	retVal.__ptr = Polycode.ShaderBinding_getLocalParamByName(this.__ptr, name)
 	retVal.__ptr = Polycode.ShaderBinding_getLocalParamByName(this.__ptr, name)
 	return retVal
 	return retVal
 }
 }
@@ -68,7 +63,7 @@ ShaderBinding.prototype.removeParam = function(name) {
 }
 }
 
 
 ShaderBinding.prototype.loadTextureForParam = function(paramName,fileName) {
 ShaderBinding.prototype.loadTextureForParam = function(paramName,fileName) {
-	var retVal = new Texture()
+	var retVal = new shared_ptr<Texture>()
 	retVal.__ptr = Polycode.ShaderBinding_loadTextureForParam(this.__ptr, paramName,fileName)
 	retVal.__ptr = Polycode.ShaderBinding_loadTextureForParam(this.__ptr, paramName,fileName)
 	return retVal
 	return retVal
 }
 }

+ 1 - 34
bindings/javascript/Polycode/ShaderPass.js

@@ -1,22 +1,9 @@
 function ShaderPass() {
 function ShaderPass() {
 	Object.defineProperties(this, {
 	Object.defineProperties(this, {
-		'shader': { enumerable: true, configurable: true, get: ShaderPass.prototype.__get_shader, set: ShaderPass.prototype.__set_shader},
 		'wireframe': { enumerable: true, configurable: true, get: ShaderPass.prototype.__get_wireframe, set: ShaderPass.prototype.__set_wireframe},
 		'wireframe': { enumerable: true, configurable: true, get: ShaderPass.prototype.__get_wireframe, set: ShaderPass.prototype.__set_wireframe},
-		'blendingMode': { enumerable: true, configurable: true, get: ShaderPass.prototype.__get_blendingMode, set: ShaderPass.prototype.__set_blendingMode},
-		'shaderBinding': { enumerable: true, configurable: true, get: ShaderPass.prototype.__get_shaderBinding, set: ShaderPass.prototype.__set_shaderBinding},
-		'materialShaderBinding': { enumerable: true, configurable: true, get: ShaderPass.prototype.__get_materialShaderBinding, set: ShaderPass.prototype.__set_materialShaderBinding}
+		'blendingMode': { enumerable: true, configurable: true, get: ShaderPass.prototype.__get_blendingMode, set: ShaderPass.prototype.__set_blendingMode}
 	})
 	})
 }
 }
-ShaderPass.prototype.__get_shader = function() {
-	var retVal = new Shader()
-	retVal.__ptr = 	Polycode.ShaderPass__get_shader(this.__ptr)
-	return retVal
-}
-
-ShaderPass.prototype.__set_shader = function(val) {
-	Polycode.ShaderPass__set_shader(this.__ptr, val.__ptr)
-}
-
 ShaderPass.prototype.__get_wireframe = function() {
 ShaderPass.prototype.__get_wireframe = function() {
 	return Polycode.ShaderPass__get_wireframe(this.__ptr)
 	return Polycode.ShaderPass__get_wireframe(this.__ptr)
 }
 }
@@ -33,26 +20,6 @@ ShaderPass.prototype.__set_blendingMode = function(val) {
 	Polycode.ShaderPass__set_blendingMode(this.__ptr, val)
 	Polycode.ShaderPass__set_blendingMode(this.__ptr, val)
 }
 }
 
 
-ShaderPass.prototype.__get_shaderBinding = function() {
-	var retVal = new ShaderBinding()
-	retVal.__ptr = 	Polycode.ShaderPass__get_shaderBinding(this.__ptr)
-	return retVal
-}
-
-ShaderPass.prototype.__set_shaderBinding = function(val) {
-	Polycode.ShaderPass__set_shaderBinding(this.__ptr, val.__ptr)
-}
-
-ShaderPass.prototype.__get_materialShaderBinding = function() {
-	var retVal = new ShaderBinding()
-	retVal.__ptr = 	Polycode.ShaderPass__get_materialShaderBinding(this.__ptr)
-	return retVal
-}
-
-ShaderPass.prototype.__set_materialShaderBinding = function(val) {
-	Polycode.ShaderPass__set_materialShaderBinding(this.__ptr, val.__ptr)
-}
-
 Duktape.fin(ShaderPass.prototype, function (x) {
 Duktape.fin(ShaderPass.prototype, function (x) {
 	if (x === ShaderPass.prototype) {
 	if (x === ShaderPass.prototype) {
 		return;
 		return;

+ 43 - 0
bindings/javascript/Polycode/ShaderPlatformData.js

@@ -0,0 +1,43 @@
+function ShaderPlatformData() {
+	Object.defineProperties(this, {
+		'shaderID': { enumerable: true, configurable: true, get: ShaderPlatformData.prototype.__get_shaderID, set: ShaderPlatformData.prototype.__set_shaderID},
+		'vertexProgramID': { enumerable: true, configurable: true, get: ShaderPlatformData.prototype.__get_vertexProgramID, set: ShaderPlatformData.prototype.__set_vertexProgramID},
+		'fragmentProgramID': { enumerable: true, configurable: true, get: ShaderPlatformData.prototype.__get_fragmentProgramID, set: ShaderPlatformData.prototype.__set_fragmentProgramID}
+	})
+}
+ShaderPlatformData.prototype.__get_shaderID = function() {
+	var retVal = new GLuint()
+	retVal.__ptr = 	Polycode.ShaderPlatformData__get_shaderID(this.__ptr)
+	return retVal
+}
+
+ShaderPlatformData.prototype.__set_shaderID = function(val) {
+	Polycode.ShaderPlatformData__set_shaderID(this.__ptr, val.__ptr)
+}
+
+ShaderPlatformData.prototype.__get_vertexProgramID = function() {
+	var retVal = new GLuint()
+	retVal.__ptr = 	Polycode.ShaderPlatformData__get_vertexProgramID(this.__ptr)
+	return retVal
+}
+
+ShaderPlatformData.prototype.__set_vertexProgramID = function(val) {
+	Polycode.ShaderPlatformData__set_vertexProgramID(this.__ptr, val.__ptr)
+}
+
+ShaderPlatformData.prototype.__get_fragmentProgramID = function() {
+	var retVal = new GLuint()
+	retVal.__ptr = 	Polycode.ShaderPlatformData__get_fragmentProgramID(this.__ptr)
+	return retVal
+}
+
+ShaderPlatformData.prototype.__set_fragmentProgramID = function(val) {
+	Polycode.ShaderPlatformData__set_fragmentProgramID(this.__ptr, val.__ptr)
+}
+
+Duktape.fin(ShaderPlatformData.prototype, function (x) {
+	if (x === ShaderPlatformData.prototype) {
+		return;
+	}
+	Polycode.ShaderPlatformData__delete(x.__ptr)
+})

+ 0 - 11
bindings/javascript/Polycode/ShaderRenderTarget.js

@@ -4,7 +4,6 @@ function ShaderRenderTarget() {
 		'width': { enumerable: true, configurable: true, get: ShaderRenderTarget.prototype.__get_width, set: ShaderRenderTarget.prototype.__set_width},
 		'width': { enumerable: true, configurable: true, get: ShaderRenderTarget.prototype.__get_width, set: ShaderRenderTarget.prototype.__set_width},
 		'height': { enumerable: true, configurable: true, get: ShaderRenderTarget.prototype.__get_height, set: ShaderRenderTarget.prototype.__set_height},
 		'height': { enumerable: true, configurable: true, get: ShaderRenderTarget.prototype.__get_height, set: ShaderRenderTarget.prototype.__set_height},
 		'sizeMode': { enumerable: true, configurable: true, get: ShaderRenderTarget.prototype.__get_sizeMode, set: ShaderRenderTarget.prototype.__set_sizeMode},
 		'sizeMode': { enumerable: true, configurable: true, get: ShaderRenderTarget.prototype.__get_sizeMode, set: ShaderRenderTarget.prototype.__set_sizeMode},
-		'buffer': { enumerable: true, configurable: true, get: ShaderRenderTarget.prototype.__get_buffer, set: ShaderRenderTarget.prototype.__set_buffer},
 		'normalizedWidth': { enumerable: true, configurable: true, get: ShaderRenderTarget.prototype.__get_normalizedWidth, set: ShaderRenderTarget.prototype.__set_normalizedWidth},
 		'normalizedWidth': { enumerable: true, configurable: true, get: ShaderRenderTarget.prototype.__get_normalizedWidth, set: ShaderRenderTarget.prototype.__set_normalizedWidth},
 		'normalizedHeight': { enumerable: true, configurable: true, get: ShaderRenderTarget.prototype.__get_normalizedHeight, set: ShaderRenderTarget.prototype.__set_normalizedHeight}
 		'normalizedHeight': { enumerable: true, configurable: true, get: ShaderRenderTarget.prototype.__get_normalizedHeight, set: ShaderRenderTarget.prototype.__set_normalizedHeight}
 	})
 	})
@@ -41,16 +40,6 @@ ShaderRenderTarget.prototype.__set_sizeMode = function(val) {
 	Polycode.ShaderRenderTarget__set_sizeMode(this.__ptr, val)
 	Polycode.ShaderRenderTarget__set_sizeMode(this.__ptr, val)
 }
 }
 
 
-ShaderRenderTarget.prototype.__get_buffer = function() {
-	var retVal = new RenderBuffer()
-	retVal.__ptr = 	Polycode.ShaderRenderTarget__get_buffer(this.__ptr)
-	return retVal
-}
-
-ShaderRenderTarget.prototype.__set_buffer = function(val) {
-	Polycode.ShaderRenderTarget__set_buffer(this.__ptr, val.__ptr)
-}
-
 ShaderRenderTarget.prototype.__get_normalizedWidth = function() {
 ShaderRenderTarget.prototype.__get_normalizedWidth = function() {
 	return Polycode.ShaderRenderTarget__get_normalizedWidth(this.__ptr)
 	return Polycode.ShaderRenderTarget__get_normalizedWidth(this.__ptr)
 }
 }

+ 3 - 9
bindings/javascript/Polycode/SpriteSet.js

@@ -12,17 +12,11 @@ SpriteSet.prototype.setTexture = function(texture) {
 }
 }
 
 
 SpriteSet.prototype.getTexture = function() {
 SpriteSet.prototype.getTexture = function() {
-	var retVal = new Texture()
+	var retVal = new shared_ptr<Texture>()
 	retVal.__ptr = Polycode.SpriteSet_getTexture(this.__ptr)
 	retVal.__ptr = Polycode.SpriteSet_getTexture(this.__ptr)
 	return retVal
 	return retVal
 }
 }
 
 
-SpriteSet.prototype.loadTexture = function(imageFileName) {
-	var retVal = new Texture()
-	retVal.__ptr = Polycode.SpriteSet_loadTexture(this.__ptr, imageFileName)
-	return retVal
-}
-
 SpriteSet.prototype.addSpriteEntry = function(newEntry) {
 SpriteSet.prototype.addSpriteEntry = function(newEntry) {
 	Polycode.SpriteSet_addSpriteEntry(this.__ptr, newEntry)
 	Polycode.SpriteSet_addSpriteEntry(this.__ptr, newEntry)
 }
 }
@@ -32,7 +26,7 @@ SpriteSet.prototype.getNumSpriteEntries = function() {
 }
 }
 
 
 SpriteSet.prototype.getSpriteEntry = function(index) {
 SpriteSet.prototype.getSpriteEntry = function(index) {
-	var retVal = new Sprite()
+	var retVal = new shared_ptr<Sprite>()
 	retVal.__ptr = Polycode.SpriteSet_getSpriteEntry(this.__ptr, index)
 	retVal.__ptr = Polycode.SpriteSet_getSpriteEntry(this.__ptr, index)
 	return retVal
 	return retVal
 }
 }
@@ -86,7 +80,7 @@ SpriteSet.prototype.createFramesFromIslands = function(minDistance,defaultAnchor
 }
 }
 
 
 SpriteSet.prototype.getSpriteByName = function(spriteName) {
 SpriteSet.prototype.getSpriteByName = function(spriteName) {
-	var retVal = new Sprite()
+	var retVal = new shared_ptr<Sprite>()
 	retVal.__ptr = Polycode.SpriteSet_getSpriteByName(this.__ptr, spriteName)
 	retVal.__ptr = Polycode.SpriteSet_getSpriteByName(this.__ptr, spriteName)
 	return retVal
 	return retVal
 }
 }

+ 1 - 1
bindings/javascript/Polycode/SpriteState.js

@@ -24,7 +24,7 @@ SpriteState.prototype.getFrameIDAtIndex = function(index) {
 }
 }
 
 
 SpriteState.prototype.getMeshForFrameIndex = function(index) {
 SpriteState.prototype.getMeshForFrameIndex = function(index) {
-	var retVal = new Mesh()
+	var retVal = new shared_ptr<Mesh>()
 	retVal.__ptr = Polycode.SpriteState_getMeshForFrameIndex(this.__ptr, index)
 	retVal.__ptr = Polycode.SpriteState_getMeshForFrameIndex(this.__ptr, index)
 	return retVal
 	return retVal
 }
 }

+ 1 - 1
bindings/javascript/Polycode/TextureResourceLoader.js

@@ -8,7 +8,7 @@ Duktape.fin(TextureResourceLoader.prototype, function (x) {
 })
 })
 
 
 TextureResourceLoader.prototype.loadResource = function(path,targetPool) {
 TextureResourceLoader.prototype.loadResource = function(path,targetPool) {
-	var retVal = new Resource()
+	var retVal = new shared_ptr<Resource>()
 	retVal.__ptr = Polycode.TextureResourceLoader_loadResource(this.__ptr, path,targetPool)
 	retVal.__ptr = Polycode.TextureResourceLoader_loadResource(this.__ptr, path,targetPool)
 	return retVal
 	return retVal
 }
 }

BIN
bindings/javascript/js_Polycode.pak


+ 1 - 2
bindings/lua/Polycode.lua

@@ -38,13 +38,13 @@ require "Polycode/ColorRange"
 require "Polycode/Label"
 require "Polycode/Label"
 require "Polycode/Material"
 require "Polycode/Material"
 require "Polycode/ShaderPass"
 require "Polycode/ShaderPass"
-require "Polycode/MaterialManager"
 require "Polycode/Matrix4"
 require "Polycode/Matrix4"
 require "Polycode/Mesh"
 require "Polycode/Mesh"
 require "Polycode/MeshGeometry"
 require "Polycode/MeshGeometry"
 require "Polycode/ObjectEntry"
 require "Polycode/ObjectEntry"
 require "Polycode/BinaryObjectReader"
 require "Polycode/BinaryObjectReader"
 require "Polycode/BinaryObjectWriter"
 require "Polycode/BinaryObjectWriter"
+require "Polycode/ShaderPlatformData"
 require "Polycode/SceneParticle"
 require "Polycode/SceneParticle"
 require "Polycode/SceneParticleEmitter"
 require "Polycode/SceneParticleEmitter"
 require "Polycode/Perlin"
 require "Polycode/Perlin"
@@ -75,7 +75,6 @@ require "Polycode/Scene"
 require "Polycode/SceneEntityInstanceResourceEntry"
 require "Polycode/SceneEntityInstanceResourceEntry"
 require "Polycode/SceneEntityInstance"
 require "Polycode/SceneEntityInstance"
 require "Polycode/SceneEntityInstanceLayer"
 require "Polycode/SceneEntityInstanceLayer"
-require "Polycode/SceneImage"
 require "Polycode/SceneLabel"
 require "Polycode/SceneLabel"
 require "Polycode/SceneLight"
 require "Polycode/SceneLight"
 require "Polycode/SceneCurve"
 require "Polycode/SceneCurve"

+ 1 - 1
bindings/lua/Polycode/Camera.lua

@@ -172,7 +172,7 @@ end
 function Camera:getScreenShaderMaterial()
 function Camera:getScreenShaderMaterial()
 	local retVal =  Polycode.Camera_getScreenShaderMaterial(self.__ptr)
 	local retVal =  Polycode.Camera_getScreenShaderMaterial(self.__ptr)
 	if retVal == nil then return nil end
 	if retVal == nil then return nil end
-	local __c = _G["Material"]("__skip_ptr__")
+	local __c = _G["shared_ptr<Material>"]("__skip_ptr__")
 	__c.__ptr = retVal
 	__c.__ptr = retVal
 	return __c
 	return __c
 end
 end

+ 9 - 0
bindings/lua/Polycode/Core.lua

@@ -115,6 +115,10 @@ function Core:warpCursor(x, y)
 	local retVal = Polycode.Core_warpCursor(self.__ptr, x, y)
 	local retVal = Polycode.Core_warpCursor(self.__ptr, x, y)
 end
 end
 
 
+function Core:openOnScreenKeyboard(open)
+	local retVal = Polycode.Core_openOnScreenKeyboard(self.__ptr, open)
+end
+
 function Core:createThread(target)
 function Core:createThread(target)
 	local retVal = Polycode.Core_createThread(self.__ptr, target.__ptr)
 	local retVal = Polycode.Core_createThread(self.__ptr, target.__ptr)
 end
 end
@@ -266,6 +270,11 @@ function Core:prepareRenderContext()
 	local retVal =  Polycode.Core_prepareRenderContext(self.__ptr)
 	local retVal =  Polycode.Core_prepareRenderContext(self.__ptr)
 end
 end
 
 
+function Core:isWindowInitialized()
+	local retVal =  Polycode.Core_isWindowInitialized(self.__ptr)
+	return retVal
+end
+
 function Core:openFile(fileName, opts)
 function Core:openFile(fileName, opts)
 	local retVal = Polycode.Core_openFile(self.__ptr, fileName, opts)
 	local retVal = Polycode.Core_openFile(self.__ptr, fileName, opts)
 	if retVal == nil then return nil end
 	if retVal == nil then return nil end

+ 20 - 0
bindings/lua/Polycode/CoreMotionEvent.lua

@@ -27,6 +27,26 @@ function CoreMotionEvent:__setvar(name,value)
 		return false
 		return false
 	end
 	end
 end
 end
+function CoreMotionEvent:CoreMotionEvent(...)
+	local arg = {...}
+	if type(arg[1]) == "table" and count(arg) == 1 then
+		if ""..arg[1].__classname == "Event" then
+			self.__ptr = arg[1].__ptr
+			return
+		end
+	end
+	for k,v in pairs(arg) do
+		if type(v) == "table" then
+			if v.__ptr ~= nil then
+				arg[k] = v.__ptr
+			end
+		end
+	end
+	if self.__ptr == nil and arg[1] ~= "__skip_ptr__" then
+		self.__ptr = Polycode.CoreMotionEvent(unpack(arg))
+	end
+end
+
 function CoreMotionEvent:__delete()
 function CoreMotionEvent:__delete()
 	if self then Polycode.delete_CoreMotionEvent(self.__ptr) end
 	if self then Polycode.delete_CoreMotionEvent(self.__ptr) end
 end
 end

+ 0 - 8
bindings/lua/Polycode/CoreServices.lua

@@ -71,14 +71,6 @@ function CoreServices:getInput()
 	return __c
 	return __c
 end
 end
 
 
-function CoreServices:getMaterialManager()
-	local retVal =  Polycode.CoreServices_getMaterialManager(self.__ptr)
-	if retVal == nil then return nil end
-	local __c = _G["MaterialManager"]("__skip_ptr__")
-	__c.__ptr = retVal
-	return __c
-end
-
 function CoreServices:getSceneManager()
 function CoreServices:getSceneManager()
 	local retVal =  Polycode.CoreServices_getSceneManager(self.__ptr)
 	local retVal =  Polycode.CoreServices_getSceneManager(self.__ptr)
 	if retVal == nil then return nil end
 	if retVal == nil then return nil end

+ 1 - 1
bindings/lua/Polycode/FontResourceLoader.lua

@@ -18,7 +18,7 @@ end
 function FontResourceLoader:loadResource(path, targetPool)
 function FontResourceLoader:loadResource(path, targetPool)
 	local retVal = Polycode.FontResourceLoader_loadResource(self.__ptr, path, targetPool.__ptr)
 	local retVal = Polycode.FontResourceLoader_loadResource(self.__ptr, path, targetPool.__ptr)
 	if retVal == nil then return nil end
 	if retVal == nil then return nil end
-	local __c = _G["Resource"]("__skip_ptr__")
+	local __c = _G["shared_ptr<Resource>"]("__skip_ptr__")
 	__c.__ptr = retVal
 	__c.__ptr = retVal
 	return __c
 	return __c
 end
 end

+ 2 - 20
bindings/lua/Polycode/GPUDrawBuffer.lua

@@ -2,13 +2,7 @@ class "GPUDrawBuffer"
 
 
 
 
 function GPUDrawBuffer:__getvar(name)
 function GPUDrawBuffer:__getvar(name)
-	if name == "targetFramebuffer" then
-		local retVal = Polycode.GPUDrawBuffer_get_targetFramebuffer(self.__ptr)
-		if retVal == nil then return nil end
-		local __c = _G["RenderBuffer"]("__skip_ptr__")
-		__c.__ptr = retVal
-		return __c
-	elseif name == "projectionMatrix" then
+	if name == "projectionMatrix" then
 		local retVal = Polycode.GPUDrawBuffer_get_projectionMatrix(self.__ptr)
 		local retVal = Polycode.GPUDrawBuffer_get_projectionMatrix(self.__ptr)
 		if retVal == nil then return nil end
 		if retVal == nil then return nil end
 		local __c = _G["Matrix4"]("__skip_ptr__")
 		local __c = _G["Matrix4"]("__skip_ptr__")
@@ -42,12 +36,6 @@ function GPUDrawBuffer:__getvar(name)
 		local __c = _G["Vector2"]("__skip_ptr__")
 		local __c = _G["Vector2"]("__skip_ptr__")
 		__c.__ptr = retVal
 		__c.__ptr = retVal
 		return __c
 		return __c
-	elseif name == "globalMaterial" then
-		local retVal = Polycode.GPUDrawBuffer_get_globalMaterial(self.__ptr)
-		if retVal == nil then return nil end
-		local __c = _G["Material"]("__skip_ptr__")
-		__c.__ptr = retVal
-		return __c
 	elseif name == "viewport" then
 	elseif name == "viewport" then
 		local retVal = Polycode.GPUDrawBuffer_get_viewport(self.__ptr)
 		local retVal = Polycode.GPUDrawBuffer_get_viewport(self.__ptr)
 		if retVal == nil then return nil end
 		if retVal == nil then return nil end
@@ -58,10 +46,7 @@ function GPUDrawBuffer:__getvar(name)
 end
 end
 
 
 function GPUDrawBuffer:__setvar(name,value)
 function GPUDrawBuffer:__setvar(name,value)
-	if name == "targetFramebuffer" then
-		Polycode.GPUDrawBuffer_set_targetFramebuffer(self.__ptr, value.__ptr)
-		return true
-	elseif name == "projectionMatrix" then
+	if name == "projectionMatrix" then
 		Polycode.GPUDrawBuffer_set_projectionMatrix(self.__ptr, value.__ptr)
 		Polycode.GPUDrawBuffer_set_projectionMatrix(self.__ptr, value.__ptr)
 		return true
 		return true
 	elseif name == "viewMatrix" then
 	elseif name == "viewMatrix" then
@@ -82,9 +67,6 @@ function GPUDrawBuffer:__setvar(name,value)
 	elseif name == "backingResolutionScale" then
 	elseif name == "backingResolutionScale" then
 		Polycode.GPUDrawBuffer_set_backingResolutionScale(self.__ptr, value.__ptr)
 		Polycode.GPUDrawBuffer_set_backingResolutionScale(self.__ptr, value.__ptr)
 		return true
 		return true
-	elseif name == "globalMaterial" then
-		Polycode.GPUDrawBuffer_set_globalMaterial(self.__ptr, value.__ptr)
-		return true
 	elseif name == "viewport" then
 	elseif name == "viewport" then
 		Polycode.GPUDrawBuffer_set_viewport(self.__ptr, value.__ptr)
 		Polycode.GPUDrawBuffer_set_viewport(self.__ptr, value.__ptr)
 		return true
 		return true

+ 0 - 9
bindings/lua/Polycode/GPUDrawCall.lua

@@ -14,12 +14,6 @@ function GPUDrawCall:__getvar(name)
 		local __c = _G["Matrix4"]("__skip_ptr__")
 		local __c = _G["Matrix4"]("__skip_ptr__")
 		__c.__ptr = retVal
 		__c.__ptr = retVal
 		return __c
 		return __c
-	elseif name == "material" then
-		local retVal = Polycode.GPUDrawCall_get_material(self.__ptr)
-		if retVal == nil then return nil end
-		local __c = _G["Material"]("__skip_ptr__")
-		__c.__ptr = retVal
-		return __c
 	end
 	end
 end
 end
 
 
@@ -30,9 +24,6 @@ function GPUDrawCall:__setvar(name,value)
 	elseif name == "modelMatrix" then
 	elseif name == "modelMatrix" then
 		Polycode.GPUDrawCall_set_modelMatrix(self.__ptr, value.__ptr)
 		Polycode.GPUDrawCall_set_modelMatrix(self.__ptr, value.__ptr)
 		return true
 		return true
-	elseif name == "material" then
-		Polycode.GPUDrawCall_set_material(self.__ptr, value.__ptr)
-		return true
 	end
 	end
 	return false
 	return false
 end
 end

+ 1 - 1
bindings/lua/Polycode/Label.lua

@@ -90,7 +90,7 @@ end
 function Label:getFont()
 function Label:getFont()
 	local retVal =  Polycode.Label_getFont(self.__ptr)
 	local retVal =  Polycode.Label_getFont(self.__ptr)
 	if retVal == nil then return nil end
 	if retVal == nil then return nil end
-	local __c = _G["Font"]("__skip_ptr__")
+	local __c = _G["shared_ptr<Font>"]("__skip_ptr__")
 	__c.__ptr = retVal
 	__c.__ptr = retVal
 	return __c
 	return __c
 end
 end

+ 0 - 9
bindings/lua/Polycode/LightInfo.lua

@@ -44,12 +44,6 @@ function LightInfo:__getvar(name)
 		return Polycode.LightInfo_get_spotlightExponent(self.__ptr)
 		return Polycode.LightInfo_get_spotlightExponent(self.__ptr)
 	elseif name == "shadowsEnabled" then
 	elseif name == "shadowsEnabled" then
 		return Polycode.LightInfo_get_shadowsEnabled(self.__ptr)
 		return Polycode.LightInfo_get_shadowsEnabled(self.__ptr)
-	elseif name == "shadowMapTexture" then
-		local retVal = Polycode.LightInfo_get_shadowMapTexture(self.__ptr)
-		if retVal == nil then return nil end
-		local __c = _G["Texture"]("__skip_ptr__")
-		__c.__ptr = retVal
-		return __c
 	elseif name == "lightViewMatrix" then
 	elseif name == "lightViewMatrix" then
 		local retVal = Polycode.LightInfo_get_lightViewMatrix(self.__ptr)
 		local retVal = Polycode.LightInfo_get_lightViewMatrix(self.__ptr)
 		if retVal == nil then return nil end
 		if retVal == nil then return nil end
@@ -99,9 +93,6 @@ function LightInfo:__setvar(name,value)
 	elseif name == "shadowsEnabled" then
 	elseif name == "shadowsEnabled" then
 		Polycode.LightInfo_set_shadowsEnabled(self.__ptr, value)
 		Polycode.LightInfo_set_shadowsEnabled(self.__ptr, value)
 		return true
 		return true
-	elseif name == "shadowMapTexture" then
-		Polycode.LightInfo_set_shadowMapTexture(self.__ptr, value.__ptr)
-		return true
 	elseif name == "lightViewMatrix" then
 	elseif name == "lightViewMatrix" then
 		Polycode.LightInfo_set_lightViewMatrix(self.__ptr, value.__ptr)
 		Polycode.LightInfo_set_lightViewMatrix(self.__ptr, value.__ptr)
 		return true
 		return true

+ 0 - 98
bindings/lua/Polycode/LightInfoBinding.lua

@@ -1,104 +1,6 @@
 class "LightInfoBinding"
 class "LightInfoBinding"
 
 
 
 
-function LightInfoBinding:__getvar(name)
-	if name == "position" then
-		local retVal = Polycode.LightInfoBinding_get_position(self.__ptr)
-		if retVal == nil then return nil end
-		local __c = _G["LocalShaderParam"]("__skip_ptr__")
-		__c.__ptr = retVal
-		return __c
-	elseif name == "direction" then
-		local retVal = Polycode.LightInfoBinding_get_direction(self.__ptr)
-		if retVal == nil then return nil end
-		local __c = _G["LocalShaderParam"]("__skip_ptr__")
-		__c.__ptr = retVal
-		return __c
-	elseif name == "specular" then
-		local retVal = Polycode.LightInfoBinding_get_specular(self.__ptr)
-		if retVal == nil then return nil end
-		local __c = _G["LocalShaderParam"]("__skip_ptr__")
-		__c.__ptr = retVal
-		return __c
-	elseif name == "diffuse" then
-		local retVal = Polycode.LightInfoBinding_get_diffuse(self.__ptr)
-		if retVal == nil then return nil end
-		local __c = _G["LocalShaderParam"]("__skip_ptr__")
-		__c.__ptr = retVal
-		return __c
-	elseif name == "spotExponent" then
-		local retVal = Polycode.LightInfoBinding_get_spotExponent(self.__ptr)
-		if retVal == nil then return nil end
-		local __c = _G["LocalShaderParam"]("__skip_ptr__")
-		__c.__ptr = retVal
-		return __c
-	elseif name == "spotCosCutoff" then
-		local retVal = Polycode.LightInfoBinding_get_spotCosCutoff(self.__ptr)
-		if retVal == nil then return nil end
-		local __c = _G["LocalShaderParam"]("__skip_ptr__")
-		__c.__ptr = retVal
-		return __c
-	elseif name == "constantAttenuation" then
-		local retVal = Polycode.LightInfoBinding_get_constantAttenuation(self.__ptr)
-		if retVal == nil then return nil end
-		local __c = _G["LocalShaderParam"]("__skip_ptr__")
-		__c.__ptr = retVal
-		return __c
-	elseif name == "linearAttenuation" then
-		local retVal = Polycode.LightInfoBinding_get_linearAttenuation(self.__ptr)
-		if retVal == nil then return nil end
-		local __c = _G["LocalShaderParam"]("__skip_ptr__")
-		__c.__ptr = retVal
-		return __c
-	elseif name == "quadraticAttenuation" then
-		local retVal = Polycode.LightInfoBinding_get_quadraticAttenuation(self.__ptr)
-		if retVal == nil then return nil end
-		local __c = _G["LocalShaderParam"]("__skip_ptr__")
-		__c.__ptr = retVal
-		return __c
-	elseif name == "shadowEnabled" then
-		local retVal = Polycode.LightInfoBinding_get_shadowEnabled(self.__ptr)
-		if retVal == nil then return nil end
-		local __c = _G["LocalShaderParam"]("__skip_ptr__")
-		__c.__ptr = retVal
-		return __c
-	end
-end
-
-function LightInfoBinding:__setvar(name,value)
-	if name == "position" then
-		Polycode.LightInfoBinding_set_position(self.__ptr, value.__ptr)
-		return true
-	elseif name == "direction" then
-		Polycode.LightInfoBinding_set_direction(self.__ptr, value.__ptr)
-		return true
-	elseif name == "specular" then
-		Polycode.LightInfoBinding_set_specular(self.__ptr, value.__ptr)
-		return true
-	elseif name == "diffuse" then
-		Polycode.LightInfoBinding_set_diffuse(self.__ptr, value.__ptr)
-		return true
-	elseif name == "spotExponent" then
-		Polycode.LightInfoBinding_set_spotExponent(self.__ptr, value.__ptr)
-		return true
-	elseif name == "spotCosCutoff" then
-		Polycode.LightInfoBinding_set_spotCosCutoff(self.__ptr, value.__ptr)
-		return true
-	elseif name == "constantAttenuation" then
-		Polycode.LightInfoBinding_set_constantAttenuation(self.__ptr, value.__ptr)
-		return true
-	elseif name == "linearAttenuation" then
-		Polycode.LightInfoBinding_set_linearAttenuation(self.__ptr, value.__ptr)
-		return true
-	elseif name == "quadraticAttenuation" then
-		Polycode.LightInfoBinding_set_quadraticAttenuation(self.__ptr, value.__ptr)
-		return true
-	elseif name == "shadowEnabled" then
-		Polycode.LightInfoBinding_set_shadowEnabled(self.__ptr, value.__ptr)
-		return true
-	end
-	return false
-end
 function LightInfoBinding:__delete()
 function LightInfoBinding:__delete()
 	if self then Polycode.delete_LightInfoBinding(self.__ptr) end
 	if self then Polycode.delete_LightInfoBinding(self.__ptr) end
 end
 end

+ 0 - 26
bindings/lua/Polycode/LightShadowInfoBinding.lua

@@ -1,32 +1,6 @@
 class "LightShadowInfoBinding"
 class "LightShadowInfoBinding"
 
 
 
 
-function LightShadowInfoBinding:__getvar(name)
-	if name == "shadowMatrix" then
-		local retVal = Polycode.LightShadowInfoBinding_get_shadowMatrix(self.__ptr)
-		if retVal == nil then return nil end
-		local __c = _G["LocalShaderParam"]("__skip_ptr__")
-		__c.__ptr = retVal
-		return __c
-	elseif name == "shadowBuffer" then
-		local retVal = Polycode.LightShadowInfoBinding_get_shadowBuffer(self.__ptr)
-		if retVal == nil then return nil end
-		local __c = _G["LocalShaderParam"]("__skip_ptr__")
-		__c.__ptr = retVal
-		return __c
-	end
-end
-
-function LightShadowInfoBinding:__setvar(name,value)
-	if name == "shadowMatrix" then
-		Polycode.LightShadowInfoBinding_set_shadowMatrix(self.__ptr, value.__ptr)
-		return true
-	elseif name == "shadowBuffer" then
-		Polycode.LightShadowInfoBinding_set_shadowBuffer(self.__ptr, value.__ptr)
-		return true
-	end
-	return false
-end
 function LightShadowInfoBinding:__delete()
 function LightShadowInfoBinding:__delete()
 	if self then Polycode.delete_LightShadowInfoBinding(self.__ptr) end
 	if self then Polycode.delete_LightShadowInfoBinding(self.__ptr) end
 end
 end

+ 3 - 3
bindings/lua/Polycode/LocalShaderParam.lua

@@ -55,7 +55,7 @@ end
 function LocalShaderParam:Copy()
 function LocalShaderParam:Copy()
 	local retVal =  Polycode.LocalShaderParam_Copy(self.__ptr)
 	local retVal =  Polycode.LocalShaderParam_Copy(self.__ptr)
 	if retVal == nil then return nil end
 	if retVal == nil then return nil end
-	local __c = _G["LocalShaderParam"]("__skip_ptr__")
+	local __c = _G["shared_ptr<LocalShaderParam>"]("__skip_ptr__")
 	__c.__ptr = retVal
 	__c.__ptr = retVal
 	return __c
 	return __c
 end
 end
@@ -124,7 +124,7 @@ end
 function LocalShaderParam:getTexture()
 function LocalShaderParam:getTexture()
 	local retVal =  Polycode.LocalShaderParam_getTexture(self.__ptr)
 	local retVal =  Polycode.LocalShaderParam_getTexture(self.__ptr)
 	if retVal == nil then return nil end
 	if retVal == nil then return nil end
-	local __c = _G["Texture"]("__skip_ptr__")
+	local __c = _G["shared_ptr<Texture>"]("__skip_ptr__")
 	__c.__ptr = retVal
 	__c.__ptr = retVal
 	return __c
 	return __c
 end
 end
@@ -136,7 +136,7 @@ end
 function LocalShaderParam:getCubemap()
 function LocalShaderParam:getCubemap()
 	local retVal =  Polycode.LocalShaderParam_getCubemap(self.__ptr)
 	local retVal =  Polycode.LocalShaderParam_getCubemap(self.__ptr)
 	if retVal == nil then return nil end
 	if retVal == nil then return nil end
-	local __c = _G["Cubemap"]("__skip_ptr__")
+	local __c = _G["shared_ptr<Cubemap>"]("__skip_ptr__")
 	__c.__ptr = retVal
 	__c.__ptr = retVal
 	return __c
 	return __c
 end
 end

+ 2 - 14
bindings/lua/Polycode/Material.lua

@@ -61,14 +61,6 @@ function Material:addShaderPassAtIndex(pass, shaderIndex)
 	local retVal = Polycode.Material_addShaderPassAtIndex(self.__ptr, pass.__ptr, shaderIndex)
 	local retVal = Polycode.Material_addShaderPassAtIndex(self.__ptr, pass.__ptr, shaderIndex)
 end
 end
 
 
-function Material:addShader(shader, shaderBinding)
-	local retVal = Polycode.Material_addShader(self.__ptr, shader.__ptr, shaderBinding.__ptr)
-end
-
-function Material:addShaderAtIndex(shader, shaderBinding, shaderIndex)
-	local retVal = Polycode.Material_addShaderAtIndex(self.__ptr, shader.__ptr, shaderBinding.__ptr, shaderIndex)
-end
-
 function Material:getNumShaderPasses()
 function Material:getNumShaderPasses()
 	local retVal =  Polycode.Material_getNumShaderPasses(self.__ptr)
 	local retVal =  Polycode.Material_getNumShaderPasses(self.__ptr)
 	return retVal
 	return retVal
@@ -78,10 +70,6 @@ function Material:removeShaderPass(shaderIndex)
 	local retVal = Polycode.Material_removeShaderPass(self.__ptr, shaderIndex)
 	local retVal = Polycode.Material_removeShaderPass(self.__ptr, shaderIndex)
 end
 end
 
 
-function Material:recreateExpectedShaderParams()
-	local retVal =  Polycode.Material_recreateExpectedShaderParams(self.__ptr)
-end
-
 function Material:addShaderRenderTarget(newTarget)
 function Material:addShaderRenderTarget(newTarget)
 	local retVal = Polycode.Material_addShaderRenderTarget(self.__ptr, newTarget.__ptr)
 	local retVal = Polycode.Material_addShaderRenderTarget(self.__ptr, newTarget.__ptr)
 end
 end
@@ -127,7 +115,7 @@ end
 function Material:getShaderBinding(index)
 function Material:getShaderBinding(index)
 	local retVal = Polycode.Material_getShaderBinding(self.__ptr, index)
 	local retVal = Polycode.Material_getShaderBinding(self.__ptr, index)
 	if retVal == nil then return nil end
 	if retVal == nil then return nil end
-	local __c = _G["ShaderBinding"]("__skip_ptr__")
+	local __c = _G["shared_ptr<ShaderBinding>"]("__skip_ptr__")
 	__c.__ptr = retVal
 	__c.__ptr = retVal
 	return __c
 	return __c
 end
 end
@@ -135,7 +123,7 @@ end
 function Material:getShader(index)
 function Material:getShader(index)
 	local retVal = Polycode.Material_getShader(self.__ptr, index)
 	local retVal = Polycode.Material_getShader(self.__ptr, index)
 	if retVal == nil then return nil end
 	if retVal == nil then return nil end
-	local __c = _G["Shader"]("__skip_ptr__")
+	local __c = _G["shared_ptr<Shader>"]("__skip_ptr__")
 	__c.__ptr = retVal
 	__c.__ptr = retVal
 	return __c
 	return __c
 end
 end

+ 1 - 1
bindings/lua/Polycode/MaterialResourceLoader.lua

@@ -18,7 +18,7 @@ end
 function MaterialResourceLoader:loadResource(path, targetPool)
 function MaterialResourceLoader:loadResource(path, targetPool)
 	local retVal = Polycode.MaterialResourceLoader_loadResource(self.__ptr, path, targetPool.__ptr)
 	local retVal = Polycode.MaterialResourceLoader_loadResource(self.__ptr, path, targetPool.__ptr)
 	if retVal == nil then return nil end
 	if retVal == nil then return nil end
-	local __c = _G["Resource"]("__skip_ptr__")
+	local __c = _G["shared_ptr<Resource>"]("__skip_ptr__")
 	__c.__ptr = retVal
 	__c.__ptr = retVal
 	return __c
 	return __c
 end
 end

+ 1 - 1
bindings/lua/Polycode/MeshResourceLoader.lua

@@ -18,7 +18,7 @@ end
 function MeshResourceLoader:loadResource(path, targetPool)
 function MeshResourceLoader:loadResource(path, targetPool)
 	local retVal = Polycode.MeshResourceLoader_loadResource(self.__ptr, path, targetPool.__ptr)
 	local retVal = Polycode.MeshResourceLoader_loadResource(self.__ptr, path, targetPool.__ptr)
 	if retVal == nil then return nil end
 	if retVal == nil then return nil end
-	local __c = _G["Resource"]("__skip_ptr__")
+	local __c = _G["shared_ptr<Resource>"]("__skip_ptr__")
 	__c.__ptr = retVal
 	__c.__ptr = retVal
 	return __c
 	return __c
 end
 end

+ 1 - 1
bindings/lua/Polycode/ProgramResourceLoader.lua

@@ -18,7 +18,7 @@ end
 function ProgramResourceLoader:loadResource(path, targetPool)
 function ProgramResourceLoader:loadResource(path, targetPool)
 	local retVal = Polycode.ProgramResourceLoader_loadResource(self.__ptr, path, targetPool.__ptr)
 	local retVal = Polycode.ProgramResourceLoader_loadResource(self.__ptr, path, targetPool.__ptr)
 	if retVal == nil then return nil end
 	if retVal == nil then return nil end
-	local __c = _G["Resource"]("__skip_ptr__")
+	local __c = _G["shared_ptr<Resource>"]("__skip_ptr__")
 	__c.__ptr = retVal
 	__c.__ptr = retVal
 	return __c
 	return __c
 end
 end

+ 0 - 26
bindings/lua/Polycode/RenderBuffer.lua

@@ -1,32 +1,6 @@
 class "RenderBuffer"
 class "RenderBuffer"
 
 
 
 
-function RenderBuffer:__getvar(name)
-	if name == "colorTexture" then
-		local retVal = Polycode.RenderBuffer_get_colorTexture(self.__ptr)
-		if retVal == nil then return nil end
-		local __c = _G["Texture"]("__skip_ptr__")
-		__c.__ptr = retVal
-		return __c
-	elseif name == "depthTexture" then
-		local retVal = Polycode.RenderBuffer_get_depthTexture(self.__ptr)
-		if retVal == nil then return nil end
-		local __c = _G["Texture"]("__skip_ptr__")
-		__c.__ptr = retVal
-		return __c
-	end
-end
-
-function RenderBuffer:__setvar(name,value)
-	if name == "colorTexture" then
-		Polycode.RenderBuffer_set_colorTexture(self.__ptr, value.__ptr)
-		return true
-	elseif name == "depthTexture" then
-		Polycode.RenderBuffer_set_depthTexture(self.__ptr, value.__ptr)
-		return true
-	end
-	return false
-end
 function RenderBuffer:RenderBuffer(...)
 function RenderBuffer:RenderBuffer(...)
 	local arg = {...}
 	local arg = {...}
 	for k,v in pairs(arg) do
 	for k,v in pairs(arg) do

+ 14 - 0
bindings/lua/Polycode/RenderFrame.lua

@@ -1,6 +1,20 @@
 class "RenderFrame"
 class "RenderFrame"
 
 
 
 
+function RenderFrame:RenderFrame(...)
+	local arg = {...}
+	for k,v in pairs(arg) do
+		if type(v) == "table" then
+			if v.__ptr ~= nil then
+				arg[k] = v.__ptr
+			end
+		end
+	end
+	if self.__ptr == nil and arg[1] ~= "__skip_ptr__" then
+		self.__ptr = Polycode.RenderFrame(unpack(arg))
+	end
+end
+
 function RenderFrame:__delete()
 function RenderFrame:__delete()
 	if self then Polycode.delete_RenderFrame(self.__ptr) end
 	if self then Polycode.delete_RenderFrame(self.__ptr) end
 end
 end

+ 0 - 9
bindings/lua/Polycode/RenderTargetBinding.lua

@@ -12,12 +12,6 @@ function RenderTargetBinding:__getvar(name)
 		return Polycode.RenderTargetBinding_get_name(self.__ptr)
 		return Polycode.RenderTargetBinding_get_name(self.__ptr)
 	elseif name == "mode" then
 	elseif name == "mode" then
 		return Polycode.RenderTargetBinding_get_mode(self.__ptr)
 		return Polycode.RenderTargetBinding_get_mode(self.__ptr)
-	elseif name == "buffer" then
-		local retVal = Polycode.RenderTargetBinding_get_buffer(self.__ptr)
-		if retVal == nil then return nil end
-		local __c = _G["RenderBuffer"]("__skip_ptr__")
-		__c.__ptr = retVal
-		return __c
 	end
 	end
 end
 end
 
 
@@ -31,9 +25,6 @@ function RenderTargetBinding:__setvar(name,value)
 	elseif name == "mode" then
 	elseif name == "mode" then
 		Polycode.RenderTargetBinding_set_mode(self.__ptr, value)
 		Polycode.RenderTargetBinding_set_mode(self.__ptr, value)
 		return true
 		return true
-	elseif name == "buffer" then
-		Polycode.RenderTargetBinding_set_buffer(self.__ptr, value.__ptr)
-		return true
 	end
 	end
 	return false
 	return false
 end
 end

+ 0 - 10
bindings/lua/Polycode/RenderThread.lua

@@ -1,21 +1,15 @@
 class "RenderThread"
 class "RenderThread"
 
 
 RenderThread.JOB_REQUEST_CONTEXT_CHANGE = 0
 RenderThread.JOB_REQUEST_CONTEXT_CHANGE = 0
-RenderThread.JOB_CREATE_TEXTURE = 1
 RenderThread.JOB_PROCESS_DRAW_BUFFER = 2
 RenderThread.JOB_PROCESS_DRAW_BUFFER = 2
 RenderThread.JOB_END_FRAME = 3
 RenderThread.JOB_END_FRAME = 3
-RenderThread.JOB_CREATE_PROGRAM = 4
-RenderThread.JOB_CREATE_SHADER = 5
 RenderThread.JOB_BEGIN_FRAME = 6
 RenderThread.JOB_BEGIN_FRAME = 6
 RenderThread.JOB_DESTROY_TEXTURE = 8
 RenderThread.JOB_DESTROY_TEXTURE = 8
 RenderThread.JOB_DESTROY_SHADER = 9
 RenderThread.JOB_DESTROY_SHADER = 9
 RenderThread.JOB_DESTROY_PROGRAM = 10
 RenderThread.JOB_DESTROY_PROGRAM = 10
 RenderThread.JOB_DESTROY_SUBMESH_BUFFER = 11
 RenderThread.JOB_DESTROY_SUBMESH_BUFFER = 11
-RenderThread.JOB_CREATE_RENDER_BUFFER = 12
 RenderThread.JOB_DESTROY_RENDER_BUFFER = 13
 RenderThread.JOB_DESTROY_RENDER_BUFFER = 13
 RenderThread.JOB_SET_TEXTURE_PARAM = 14
 RenderThread.JOB_SET_TEXTURE_PARAM = 14
-RenderThread.JOB_DESTROY_SHADER_BINDING = 16
-RenderThread.JOB_DESTROY_SHADER_PARAM = 17
 
 
 function RenderThread:RenderThread(...)
 function RenderThread:RenderThread(...)
 	local arg = {...}
 	local arg = {...}
@@ -79,10 +73,6 @@ function RenderThread:getFrameInfo()
 	return __c
 	return __c
 end
 end
 
 
-function RenderThread:clearFrameQueue()
-	local retVal =  Polycode.RenderThread_clearFrameQueue(self.__ptr)
-end
-
 function RenderThread:initGlobals()
 function RenderThread:initGlobals()
 	local retVal =  Polycode.RenderThread_initGlobals(self.__ptr)
 	local retVal =  Polycode.RenderThread_initGlobals(self.__ptr)
 end
 end

+ 10 - 58
bindings/lua/Polycode/Renderer.lua

@@ -22,38 +22,6 @@ function Renderer:getRenderThread()
 	return __c
 	return __c
 end
 end
 
 
-function Renderer:createCubemap(t0, t1, t2, t3, t4, t5)
-	local retVal = Polycode.Renderer_createCubemap(self.__ptr, t0.__ptr, t1.__ptr, t2.__ptr, t3.__ptr, t4.__ptr, t5.__ptr)
-	if retVal == nil then return nil end
-	local __c = _G["Cubemap"]("__skip_ptr__")
-	__c.__ptr = retVal
-	return __c
-end
-
-function Renderer:createTexture(width, height, textureData, clamp, createMipmaps, type, filteringMode, anisotropy, framebufferTexture)
-	local retVal = Polycode.Renderer_createTexture(self.__ptr, width, height, textureData.__ptr, clamp, createMipmaps, type, filteringMode, anisotropy, framebufferTexture)
-	if retVal == nil then return nil end
-	local __c = _G["Texture"]("__skip_ptr__")
-	__c.__ptr = retVal
-	return __c
-end
-
-function Renderer:createRenderBuffer(width, height, attachDepthBuffer, floatingPoint)
-	local retVal = Polycode.Renderer_createRenderBuffer(self.__ptr, width, height, attachDepthBuffer, floatingPoint)
-	if retVal == nil then return nil end
-	local __c = _G["RenderBuffer"]("__skip_ptr__")
-	__c.__ptr = retVal
-	return __c
-end
-
-function Renderer:destroyRenderBuffer(buffer)
-	local retVal = Polycode.Renderer_destroyRenderBuffer(self.__ptr, buffer.__ptr)
-end
-
-function Renderer:destroyTexture(texture)
-	local retVal = Polycode.Renderer_destroyTexture(self.__ptr, texture.__ptr)
-end
-
 function Renderer:processDrawBuffer(buffer)
 function Renderer:processDrawBuffer(buffer)
 	local retVal = Polycode.Renderer_processDrawBuffer(self.__ptr, buffer.__ptr)
 	local retVal = Polycode.Renderer_processDrawBuffer(self.__ptr, buffer.__ptr)
 end
 end
@@ -72,44 +40,28 @@ function Renderer:getBackingResolutionScaleY()
 	return retVal
 	return retVal
 end
 end
 
 
-function Renderer:createProgram(fileName)
-	local retVal = Polycode.Renderer_createProgram(self.__ptr, fileName)
-	if retVal == nil then return nil end
-	local __c = _G["ShaderProgram"]("__skip_ptr__")
-	__c.__ptr = retVal
-	return __c
-end
-
-function Renderer:createShader(vertexProgram, fragmentProgram)
-	local retVal = Polycode.Renderer_createShader(self.__ptr, vertexProgram.__ptr, fragmentProgram.__ptr)
-	if retVal == nil then return nil end
-	local __c = _G["Shader"]("__skip_ptr__")
-	__c.__ptr = retVal
-	return __c
-end
-
 function Renderer:enqueueFrameJob(jobType, data)
 function Renderer:enqueueFrameJob(jobType, data)
 	local retVal = Polycode.Renderer_enqueueFrameJob(self.__ptr, jobType, data.__ptr)
 	local retVal = Polycode.Renderer_enqueueFrameJob(self.__ptr, jobType, data.__ptr)
 end
 end
 
 
-function Renderer:destroyProgram(program)
-	local retVal = Polycode.Renderer_destroyProgram(self.__ptr, program.__ptr)
+function Renderer:destroyRenderBufferPlatformData(platformData)
+	local retVal = Polycode.Renderer_destroyRenderBufferPlatformData(self.__ptr, platformData.__ptr)
 end
 end
 
 
-function Renderer:destroyShader(shader)
-	local retVal = Polycode.Renderer_destroyShader(self.__ptr, shader.__ptr)
+function Renderer:destroyTexturePlatformData(platformData)
+	local retVal = Polycode.Renderer_destroyTexturePlatformData(self.__ptr, platformData.__ptr)
 end
 end
 
 
-function Renderer:destroySubmeshPlatformData(platformData)
-	local retVal = Polycode.Renderer_destroySubmeshPlatformData(self.__ptr, platformData.__ptr)
+function Renderer:destroyProgramPlatformData(platformData)
+	local retVal = Polycode.Renderer_destroyProgramPlatformData(self.__ptr, platformData.__ptr)
 end
 end
 
 
-function Renderer:destroyShaderBinding(binding)
-	local retVal = Polycode.Renderer_destroyShaderBinding(self.__ptr, binding.__ptr)
+function Renderer:destroyShaderPlatformData(platformData)
+	local retVal = Polycode.Renderer_destroyShaderPlatformData(self.__ptr, platformData.__ptr)
 end
 end
 
 
-function Renderer:destroyShaderParam(param)
-	local retVal = Polycode.Renderer_destroyShaderParam(self.__ptr, param.__ptr)
+function Renderer:destroySubmeshPlatformData(platformData)
+	local retVal = Polycode.Renderer_destroySubmeshPlatformData(self.__ptr, platformData.__ptr)
 end
 end
 
 
 function Renderer:setTextureParam(param, texture)
 function Renderer:setTextureParam(param, texture)

+ 1 - 1
bindings/lua/Polycode/ResourceManager.lua

@@ -80,7 +80,7 @@ function ResourceManager:getResources(resourceType)
 	local retVal = Polycode.ResourceManager_getResources(self.__ptr, resourceType)
 	local retVal = Polycode.ResourceManager_getResources(self.__ptr, resourceType)
 	if retVal == nil then return nil end
 	if retVal == nil then return nil end
 	for i=1,count(retVal) do
 	for i=1,count(retVal) do
-		local __c  = _G["Resource"]("__skip_ptr__")
+		local __c  = _G["shared_ptr<Resource"]("__skip_ptr__")
 		__c.__ptr = retVal[i]
 		__c.__ptr = retVal[i]
 		retVal[i] = __c
 		retVal[i] = __c
 	end
 	end

+ 9 - 5
bindings/lua/Polycode/ResourcePool.lua

@@ -79,10 +79,14 @@ function ResourcePool:loadResourcesFromFolder(folder, recursive)
 	local retVal = Polycode.ResourcePool_loadResourcesFromFolder(self.__ptr, folder, recursive)
 	local retVal = Polycode.ResourcePool_loadResourcesFromFolder(self.__ptr, folder, recursive)
 end
 end
 
 
+function ResourcePool:loadResourcesFromMaterialFile(path)
+	local retVal = Polycode.ResourcePool_loadResourcesFromMaterialFile(self.__ptr, path)
+end
+
 function ResourcePool:loadResource(path)
 function ResourcePool:loadResource(path)
 	local retVal = Polycode.ResourcePool_loadResource(self.__ptr, path)
 	local retVal = Polycode.ResourcePool_loadResource(self.__ptr, path)
 	if retVal == nil then return nil end
 	if retVal == nil then return nil end
-	local __c = _G["Resource"]("__skip_ptr__")
+	local __c = _G["shared_ptr<Resource>"]("__skip_ptr__")
 	__c.__ptr = retVal
 	__c.__ptr = retVal
 	return __c
 	return __c
 end
 end
@@ -90,7 +94,7 @@ end
 function ResourcePool:loadResourceWithName(path, name)
 function ResourcePool:loadResourceWithName(path, name)
 	local retVal = Polycode.ResourcePool_loadResourceWithName(self.__ptr, path, name)
 	local retVal = Polycode.ResourcePool_loadResourceWithName(self.__ptr, path, name)
 	if retVal == nil then return nil end
 	if retVal == nil then return nil end
-	local __c = _G["Resource"]("__skip_ptr__")
+	local __c = _G["shared_ptr<Resource>"]("__skip_ptr__")
 	__c.__ptr = retVal
 	__c.__ptr = retVal
 	return __c
 	return __c
 end
 end
@@ -98,7 +102,7 @@ end
 function ResourcePool:getResource(resourceType, resourceName)
 function ResourcePool:getResource(resourceType, resourceName)
 	local retVal = Polycode.ResourcePool_getResource(self.__ptr, resourceType, resourceName)
 	local retVal = Polycode.ResourcePool_getResource(self.__ptr, resourceType, resourceName)
 	if retVal == nil then return nil end
 	if retVal == nil then return nil end
-	local __c = _G["Resource"]("__skip_ptr__")
+	local __c = _G["shared_ptr<Resource>"]("__skip_ptr__")
 	__c.__ptr = retVal
 	__c.__ptr = retVal
 	return __c
 	return __c
 end
 end
@@ -115,7 +119,7 @@ end
 function ResourcePool:getResourceByPath(resourcePath)
 function ResourcePool:getResourceByPath(resourcePath)
 	local retVal = Polycode.ResourcePool_getResourceByPath(self.__ptr, resourcePath)
 	local retVal = Polycode.ResourcePool_getResourceByPath(self.__ptr, resourcePath)
 	if retVal == nil then return nil end
 	if retVal == nil then return nil end
-	local __c = _G["Resource"]("__skip_ptr__")
+	local __c = _G["shared_ptr<Resource>"]("__skip_ptr__")
 	__c.__ptr = retVal
 	__c.__ptr = retVal
 	return __c
 	return __c
 end
 end
@@ -128,7 +132,7 @@ function ResourcePool:getResources(resourceType)
 	local retVal = Polycode.ResourcePool_getResources(self.__ptr, resourceType)
 	local retVal = Polycode.ResourcePool_getResources(self.__ptr, resourceType)
 	if retVal == nil then return nil end
 	if retVal == nil then return nil end
 	for i=1,count(retVal) do
 	for i=1,count(retVal) do
-		local __c  = _G["Resource"]("__skip_ptr__")
+		local __c  = _G["shared_ptr<Resource"]("__skip_ptr__")
 		__c.__ptr = retVal[i]
 		__c.__ptr = retVal[i]
 		retVal[i] = __c
 		retVal[i] = __c
 	end
 	end

+ 1 - 1
bindings/lua/Polycode/SceneEntityInstance.lua

@@ -121,7 +121,7 @@ end
 function SceneEntityInstance:getResourceEntry()
 function SceneEntityInstance:getResourceEntry()
 	local retVal =  Polycode.SceneEntityInstance_getResourceEntry(self.__ptr)
 	local retVal =  Polycode.SceneEntityInstance_getResourceEntry(self.__ptr)
 	if retVal == nil then return nil end
 	if retVal == nil then return nil end
-	local __c = _G["SceneEntityInstanceResourceEntry"]("__skip_ptr__")
+	local __c = _G["shared_ptr<SceneEntityInstanceResourceEntry>"]("__skip_ptr__")
 	__c.__ptr = retVal
 	__c.__ptr = retVal
 	return __c
 	return __c
 end
 end

+ 1 - 1
bindings/lua/Polycode/SceneLight.lua

@@ -65,7 +65,7 @@ end
 function SceneLight:getZBufferTexture()
 function SceneLight:getZBufferTexture()
 	local retVal =  Polycode.SceneLight_getZBufferTexture(self.__ptr)
 	local retVal =  Polycode.SceneLight_getZBufferTexture(self.__ptr)
 	if retVal == nil then return nil end
 	if retVal == nil then return nil end
-	local __c = _G["Texture"]("__skip_ptr__")
+	local __c = _G["shared_ptr<Texture>"]("__skip_ptr__")
 	__c.__ptr = retVal
 	__c.__ptr = retVal
 	return __c
 	return __c
 end
 end

+ 4 - 14
bindings/lua/Polycode/SceneMesh.lua

@@ -10,10 +10,6 @@ function SceneMesh:__getvar(name)
 		return Polycode.SceneMesh_get_lineSmooth(self.__ptr)
 		return Polycode.SceneMesh_get_lineSmooth(self.__ptr)
 	elseif name == "pointSmooth" then
 	elseif name == "pointSmooth" then
 		return Polycode.SceneMesh_get_pointSmooth(self.__ptr)
 		return Polycode.SceneMesh_get_pointSmooth(self.__ptr)
-	elseif name == "ownsMesh" then
-		return Polycode.SceneMesh_get_ownsMesh(self.__ptr)
-	elseif name == "ownsSkeleton" then
-		return Polycode.SceneMesh_get_ownsSkeleton(self.__ptr)
 	elseif name == "useGeometryHitDetection" then
 	elseif name == "useGeometryHitDetection" then
 		return Polycode.SceneMesh_get_useGeometryHitDetection(self.__ptr)
 		return Polycode.SceneMesh_get_useGeometryHitDetection(self.__ptr)
 	elseif name == "alphaTest" then
 	elseif name == "alphaTest" then
@@ -38,12 +34,6 @@ function SceneMesh:__setvar(name,value)
 	elseif name == "pointSmooth" then
 	elseif name == "pointSmooth" then
 		Polycode.SceneMesh_set_pointSmooth(self.__ptr, value)
 		Polycode.SceneMesh_set_pointSmooth(self.__ptr, value)
 		return true
 		return true
-	elseif name == "ownsMesh" then
-		Polycode.SceneMesh_set_ownsMesh(self.__ptr, value)
-		return true
-	elseif name == "ownsSkeleton" then
-		Polycode.SceneMesh_set_ownsSkeleton(self.__ptr, value)
-		return true
 	elseif name == "useGeometryHitDetection" then
 	elseif name == "useGeometryHitDetection" then
 		Polycode.SceneMesh_set_useGeometryHitDetection(self.__ptr, value)
 		Polycode.SceneMesh_set_useGeometryHitDetection(self.__ptr, value)
 		return true
 		return true
@@ -119,7 +109,7 @@ end
 function SceneMesh:getMesh()
 function SceneMesh:getMesh()
 	local retVal =  Polycode.SceneMesh_getMesh(self.__ptr)
 	local retVal =  Polycode.SceneMesh_getMesh(self.__ptr)
 	if retVal == nil then return nil end
 	if retVal == nil then return nil end
-	local __c = _G["Mesh"]("__skip_ptr__")
+	local __c = _G["shared_ptr<Mesh>"]("__skip_ptr__")
 	__c.__ptr = retVal
 	__c.__ptr = retVal
 	return __c
 	return __c
 end
 end
@@ -127,7 +117,7 @@ end
 function SceneMesh:getMaterial()
 function SceneMesh:getMaterial()
 	local retVal =  Polycode.SceneMesh_getMaterial(self.__ptr)
 	local retVal =  Polycode.SceneMesh_getMaterial(self.__ptr)
 	if retVal == nil then return nil end
 	if retVal == nil then return nil end
-	local __c = _G["Material"]("__skip_ptr__")
+	local __c = _G["shared_ptr<Material>"]("__skip_ptr__")
 	__c.__ptr = retVal
 	__c.__ptr = retVal
 	return __c
 	return __c
 end
 end
@@ -135,7 +125,7 @@ end
 function SceneMesh:loadSkeleton(fileName)
 function SceneMesh:loadSkeleton(fileName)
 	local retVal = Polycode.SceneMesh_loadSkeleton(self.__ptr, fileName)
 	local retVal = Polycode.SceneMesh_loadSkeleton(self.__ptr, fileName)
 	if retVal == nil then return nil end
 	if retVal == nil then return nil end
-	local __c = _G["Skeleton"]("__skip_ptr__")
+	local __c = _G["shared_ptr<Skeleton>"]("__skip_ptr__")
 	__c.__ptr = retVal
 	__c.__ptr = retVal
 	return __c
 	return __c
 end
 end
@@ -163,7 +153,7 @@ end
 function SceneMesh:getSkeleton()
 function SceneMesh:getSkeleton()
 	local retVal =  Polycode.SceneMesh_getSkeleton(self.__ptr)
 	local retVal =  Polycode.SceneMesh_getSkeleton(self.__ptr)
 	if retVal == nil then return nil end
 	if retVal == nil then return nil end
-	local __c = _G["Skeleton"]("__skip_ptr__")
+	local __c = _G["shared_ptr<Skeleton>"]("__skip_ptr__")
 	__c.__ptr = retVal
 	__c.__ptr = retVal
 	return __c
 	return __c
 end
 end

+ 1 - 17
bindings/lua/Polycode/SceneRenderTexture.lua

@@ -31,23 +31,7 @@ end
 function SceneRenderTexture:getTargetTexture()
 function SceneRenderTexture:getTargetTexture()
 	local retVal =  Polycode.SceneRenderTexture_getTargetTexture(self.__ptr)
 	local retVal =  Polycode.SceneRenderTexture_getTargetTexture(self.__ptr)
 	if retVal == nil then return nil end
 	if retVal == nil then return nil end
-	local __c = _G["Texture"]("__skip_ptr__")
-	__c.__ptr = retVal
-	return __c
-end
-
-function SceneRenderTexture:getFilterColorBufferTexture()
-	local retVal =  Polycode.SceneRenderTexture_getFilterColorBufferTexture(self.__ptr)
-	if retVal == nil then return nil end
-	local __c = _G["Texture"]("__skip_ptr__")
-	__c.__ptr = retVal
-	return __c
-end
-
-function SceneRenderTexture:getFilterZBufferTexture()
-	local retVal =  Polycode.SceneRenderTexture_getFilterZBufferTexture(self.__ptr)
-	if retVal == nil then return nil end
-	local __c = _G["Texture"]("__skip_ptr__")
+	local __c = _G["shared_ptr<Texture>"]("__skip_ptr__")
 	__c.__ptr = retVal
 	__c.__ptr = retVal
 	return __c
 	return __c
 end
 end

+ 1 - 1
bindings/lua/Polycode/SceneSprite.lua

@@ -46,7 +46,7 @@ end
 function SceneSprite:getCurrentSprite()
 function SceneSprite:getCurrentSprite()
 	local retVal =  Polycode.SceneSprite_getCurrentSprite(self.__ptr)
 	local retVal =  Polycode.SceneSprite_getCurrentSprite(self.__ptr)
 	if retVal == nil then return nil end
 	if retVal == nil then return nil end
-	local __c = _G["Sprite"]("__skip_ptr__")
+	local __c = _G["shared_ptr<Sprite>"]("__skip_ptr__")
 	__c.__ptr = retVal
 	__c.__ptr = retVal
 	return __c
 	return __c
 end
 end

+ 1 - 1
bindings/lua/Polycode/ScriptResourceLoader.lua

@@ -18,7 +18,7 @@ end
 function ScriptResourceLoader:loadResource(path, targetPool)
 function ScriptResourceLoader:loadResource(path, targetPool)
 	local retVal = Polycode.ScriptResourceLoader_loadResource(self.__ptr, path, targetPool.__ptr)
 	local retVal = Polycode.ScriptResourceLoader_loadResource(self.__ptr, path, targetPool.__ptr)
 	if retVal == nil then return nil end
 	if retVal == nil then return nil end
-	local __c = _G["Resource"]("__skip_ptr__")
+	local __c = _G["shared_ptr<Resource>"]("__skip_ptr__")
 	__c.__ptr = retVal
 	__c.__ptr = retVal
 	return __c
 	return __c
 end
 end

+ 0 - 26
bindings/lua/Polycode/Shader.lua

@@ -10,18 +10,6 @@ function Shader:__getvar(name)
 		return Polycode.Shader_get_numPointLights(self.__ptr)
 		return Polycode.Shader_get_numPointLights(self.__ptr)
 	elseif name == "screenShader" then
 	elseif name == "screenShader" then
 		return Polycode.Shader_get_screenShader(self.__ptr)
 		return Polycode.Shader_get_screenShader(self.__ptr)
-	elseif name == "vertexProgram" then
-		local retVal = Polycode.Shader_get_vertexProgram(self.__ptr)
-		if retVal == nil then return nil end
-		local __c = _G["ShaderProgram"]("__skip_ptr__")
-		__c.__ptr = retVal
-		return __c
-	elseif name == "fragmentProgram" then
-		local retVal = Polycode.Shader_get_fragmentProgram(self.__ptr)
-		if retVal == nil then return nil end
-		local __c = _G["ShaderProgram"]("__skip_ptr__")
-		__c.__ptr = retVal
-		return __c
 	elseif name == "name" then
 	elseif name == "name" then
 		return Polycode.Shader_get_name(self.__ptr)
 		return Polycode.Shader_get_name(self.__ptr)
 	end
 	end
@@ -40,12 +28,6 @@ function Shader:__setvar(name,value)
 	elseif name == "screenShader" then
 	elseif name == "screenShader" then
 		Polycode.Shader_set_screenShader(self.__ptr, value)
 		Polycode.Shader_set_screenShader(self.__ptr, value)
 		return true
 		return true
-	elseif name == "vertexProgram" then
-		Polycode.Shader_set_vertexProgram(self.__ptr, value.__ptr)
-		return true
-	elseif name == "fragmentProgram" then
-		Polycode.Shader_set_fragmentProgram(self.__ptr, value.__ptr)
-		return true
 	elseif name == "name" then
 	elseif name == "name" then
 		Polycode.Shader_set_name(self.__ptr, value)
 		Polycode.Shader_set_name(self.__ptr, value)
 		return true
 		return true
@@ -95,14 +77,6 @@ function Shader:getExpectedParamType(name)
 	return retVal
 	return retVal
 end
 end
 
 
-function Shader:setVertexProgram(vp)
-	local retVal = Polycode.Shader_setVertexProgram(self.__ptr, vp.__ptr)
-end
-
-function Shader:setFragmentProgram(fp)
-	local retVal = Polycode.Shader_setFragmentProgram(self.__ptr, fp.__ptr)
-end
-
 function Shader:__delete()
 function Shader:__delete()
 	if self then Polycode.delete_Shader(self.__ptr) end
 	if self then Polycode.delete_Shader(self.__ptr) end
 end
 end

+ 15 - 16
bindings/lua/Polycode/ShaderBinding.lua

@@ -2,13 +2,7 @@ class "ShaderBinding"
 
 
 
 
 function ShaderBinding:__getvar(name)
 function ShaderBinding:__getvar(name)
-	if name == "targetShader" then
-		local retVal = Polycode.ShaderBinding_get_targetShader(self.__ptr)
-		if retVal == nil then return nil end
-		local __c = _G["Shader"]("__skip_ptr__")
-		__c.__ptr = retVal
-		return __c
-	elseif name == "accessMutex" then
+	if name == "accessMutex" then
 		local retVal = Polycode.ShaderBinding_get_accessMutex(self.__ptr)
 		local retVal = Polycode.ShaderBinding_get_accessMutex(self.__ptr)
 		if retVal == nil then return nil end
 		if retVal == nil then return nil end
 		local __c = _G["CoreMutex"]("__skip_ptr__")
 		local __c = _G["CoreMutex"]("__skip_ptr__")
@@ -18,10 +12,7 @@ function ShaderBinding:__getvar(name)
 end
 end
 
 
 function ShaderBinding:__setvar(name,value)
 function ShaderBinding:__setvar(name,value)
-	if name == "targetShader" then
-		Polycode.ShaderBinding_set_targetShader(self.__ptr, value.__ptr)
-		return true
-	elseif name == "accessMutex" then
+	if name == "accessMutex" then
 		Polycode.ShaderBinding_set_accessMutex(self.__ptr, value.__ptr)
 		Polycode.ShaderBinding_set_accessMutex(self.__ptr, value.__ptr)
 		return true
 		return true
 	end
 	end
@@ -48,7 +39,7 @@ end
 function ShaderBinding:addParam(type, name)
 function ShaderBinding:addParam(type, name)
 	local retVal = Polycode.ShaderBinding_addParam(self.__ptr, type, name)
 	local retVal = Polycode.ShaderBinding_addParam(self.__ptr, type, name)
 	if retVal == nil then return nil end
 	if retVal == nil then return nil end
-	local __c = _G["LocalShaderParam"]("__skip_ptr__")
+	local __c = _G["shared_ptr<LocalShaderParam>"]("__skip_ptr__")
 	__c.__ptr = retVal
 	__c.__ptr = retVal
 	return __c
 	return __c
 end
 end
@@ -56,7 +47,15 @@ end
 function ShaderBinding:addParamPointer(type, name, ptr)
 function ShaderBinding:addParamPointer(type, name, ptr)
 	local retVal = Polycode.ShaderBinding_addParamPointer(self.__ptr, type, name, ptr.__ptr)
 	local retVal = Polycode.ShaderBinding_addParamPointer(self.__ptr, type, name, ptr.__ptr)
 	if retVal == nil then return nil end
 	if retVal == nil then return nil end
-	local __c = _G["LocalShaderParam"]("__skip_ptr__")
+	local __c = _G["shared_ptr<LocalShaderParam>"]("__skip_ptr__")
+	__c.__ptr = retVal
+	return __c
+end
+
+function ShaderBinding:addParamFromData(name, data)
+	local retVal = Polycode.ShaderBinding_addParamFromData(self.__ptr, name, data)
+	if retVal == nil then return nil end
+	local __c = _G["shared_ptr<LocalShaderParam>"]("__skip_ptr__")
 	__c.__ptr = retVal
 	__c.__ptr = retVal
 	return __c
 	return __c
 end
 end
@@ -69,7 +68,7 @@ end
 function ShaderBinding:getLocalParam(index)
 function ShaderBinding:getLocalParam(index)
 	local retVal = Polycode.ShaderBinding_getLocalParam(self.__ptr, index)
 	local retVal = Polycode.ShaderBinding_getLocalParam(self.__ptr, index)
 	if retVal == nil then return nil end
 	if retVal == nil then return nil end
-	local __c = _G["LocalShaderParam"]("__skip_ptr__")
+	local __c = _G["shared_ptr<LocalShaderParam>"]("__skip_ptr__")
 	__c.__ptr = retVal
 	__c.__ptr = retVal
 	return __c
 	return __c
 end
 end
@@ -77,7 +76,7 @@ end
 function ShaderBinding:getLocalParamByName(name)
 function ShaderBinding:getLocalParamByName(name)
 	local retVal = Polycode.ShaderBinding_getLocalParamByName(self.__ptr, name)
 	local retVal = Polycode.ShaderBinding_getLocalParamByName(self.__ptr, name)
 	if retVal == nil then return nil end
 	if retVal == nil then return nil end
-	local __c = _G["LocalShaderParam"]("__skip_ptr__")
+	local __c = _G["shared_ptr<LocalShaderParam>"]("__skip_ptr__")
 	__c.__ptr = retVal
 	__c.__ptr = retVal
 	return __c
 	return __c
 end
 end
@@ -89,7 +88,7 @@ end
 function ShaderBinding:loadTextureForParam(paramName, fileName)
 function ShaderBinding:loadTextureForParam(paramName, fileName)
 	local retVal = Polycode.ShaderBinding_loadTextureForParam(self.__ptr, paramName, fileName)
 	local retVal = Polycode.ShaderBinding_loadTextureForParam(self.__ptr, paramName, fileName)
 	if retVal == nil then return nil end
 	if retVal == nil then return nil end
-	local __c = _G["Texture"]("__skip_ptr__")
+	local __c = _G["shared_ptr<Texture>"]("__skip_ptr__")
 	__c.__ptr = retVal
 	__c.__ptr = retVal
 	return __c
 	return __c
 end
 end

+ 2 - 29
bindings/lua/Polycode/ShaderPass.lua

@@ -2,47 +2,20 @@ class "ShaderPass"
 
 
 
 
 function ShaderPass:__getvar(name)
 function ShaderPass:__getvar(name)
-	if name == "shader" then
-		local retVal = Polycode.ShaderPass_get_shader(self.__ptr)
-		if retVal == nil then return nil end
-		local __c = _G["Shader"]("__skip_ptr__")
-		__c.__ptr = retVal
-		return __c
-	elseif name == "wireframe" then
+	if name == "wireframe" then
 		return Polycode.ShaderPass_get_wireframe(self.__ptr)
 		return Polycode.ShaderPass_get_wireframe(self.__ptr)
 	elseif name == "blendingMode" then
 	elseif name == "blendingMode" then
 		return Polycode.ShaderPass_get_blendingMode(self.__ptr)
 		return Polycode.ShaderPass_get_blendingMode(self.__ptr)
-	elseif name == "shaderBinding" then
-		local retVal = Polycode.ShaderPass_get_shaderBinding(self.__ptr)
-		if retVal == nil then return nil end
-		local __c = _G["ShaderBinding"]("__skip_ptr__")
-		__c.__ptr = retVal
-		return __c
-	elseif name == "materialShaderBinding" then
-		local retVal = Polycode.ShaderPass_get_materialShaderBinding(self.__ptr)
-		if retVal == nil then return nil end
-		local __c = _G["ShaderBinding"]("__skip_ptr__")
-		__c.__ptr = retVal
-		return __c
 	end
 	end
 end
 end
 
 
 function ShaderPass:__setvar(name,value)
 function ShaderPass:__setvar(name,value)
-	if name == "shader" then
-		Polycode.ShaderPass_set_shader(self.__ptr, value.__ptr)
-		return true
-	elseif name == "wireframe" then
+	if name == "wireframe" then
 		Polycode.ShaderPass_set_wireframe(self.__ptr, value)
 		Polycode.ShaderPass_set_wireframe(self.__ptr, value)
 		return true
 		return true
 	elseif name == "blendingMode" then
 	elseif name == "blendingMode" then
 		Polycode.ShaderPass_set_blendingMode(self.__ptr, value)
 		Polycode.ShaderPass_set_blendingMode(self.__ptr, value)
 		return true
 		return true
-	elseif name == "shaderBinding" then
-		Polycode.ShaderPass_set_shaderBinding(self.__ptr, value.__ptr)
-		return true
-	elseif name == "materialShaderBinding" then
-		Polycode.ShaderPass_set_materialShaderBinding(self.__ptr, value.__ptr)
-		return true
 	end
 	end
 	return false
 	return false
 end
 end

+ 41 - 0
bindings/lua/Polycode/ShaderPlatformData.lua

@@ -0,0 +1,41 @@
+class "ShaderPlatformData"
+
+
+function ShaderPlatformData:__getvar(name)
+	if name == "shaderID" then
+		local retVal = Polycode.ShaderPlatformData_get_shaderID(self.__ptr)
+		if retVal == nil then return nil end
+		local __c = _G["GLuint"]("__skip_ptr__")
+		__c.__ptr = retVal
+		return __c
+	elseif name == "vertexProgramID" then
+		local retVal = Polycode.ShaderPlatformData_get_vertexProgramID(self.__ptr)
+		if retVal == nil then return nil end
+		local __c = _G["GLuint"]("__skip_ptr__")
+		__c.__ptr = retVal
+		return __c
+	elseif name == "fragmentProgramID" then
+		local retVal = Polycode.ShaderPlatformData_get_fragmentProgramID(self.__ptr)
+		if retVal == nil then return nil end
+		local __c = _G["GLuint"]("__skip_ptr__")
+		__c.__ptr = retVal
+		return __c
+	end
+end
+
+function ShaderPlatformData:__setvar(name,value)
+	if name == "shaderID" then
+		Polycode.ShaderPlatformData_set_shaderID(self.__ptr, value.__ptr)
+		return true
+	elseif name == "vertexProgramID" then
+		Polycode.ShaderPlatformData_set_vertexProgramID(self.__ptr, value.__ptr)
+		return true
+	elseif name == "fragmentProgramID" then
+		Polycode.ShaderPlatformData_set_fragmentProgramID(self.__ptr, value.__ptr)
+		return true
+	end
+	return false
+end
+function ShaderPlatformData:__delete()
+	if self then Polycode.delete_ShaderPlatformData(self.__ptr) end
+end

+ 0 - 9
bindings/lua/Polycode/ShaderRenderTarget.lua

@@ -12,12 +12,6 @@ function ShaderRenderTarget:__getvar(name)
 		return Polycode.ShaderRenderTarget_get_height(self.__ptr)
 		return Polycode.ShaderRenderTarget_get_height(self.__ptr)
 	elseif name == "sizeMode" then
 	elseif name == "sizeMode" then
 		return Polycode.ShaderRenderTarget_get_sizeMode(self.__ptr)
 		return Polycode.ShaderRenderTarget_get_sizeMode(self.__ptr)
-	elseif name == "buffer" then
-		local retVal = Polycode.ShaderRenderTarget_get_buffer(self.__ptr)
-		if retVal == nil then return nil end
-		local __c = _G["RenderBuffer"]("__skip_ptr__")
-		__c.__ptr = retVal
-		return __c
 	elseif name == "normalizedWidth" then
 	elseif name == "normalizedWidth" then
 		return Polycode.ShaderRenderTarget_get_normalizedWidth(self.__ptr)
 		return Polycode.ShaderRenderTarget_get_normalizedWidth(self.__ptr)
 	elseif name == "normalizedHeight" then
 	elseif name == "normalizedHeight" then
@@ -38,9 +32,6 @@ function ShaderRenderTarget:__setvar(name,value)
 	elseif name == "sizeMode" then
 	elseif name == "sizeMode" then
 		Polycode.ShaderRenderTarget_set_sizeMode(self.__ptr, value)
 		Polycode.ShaderRenderTarget_set_sizeMode(self.__ptr, value)
 		return true
 		return true
-	elseif name == "buffer" then
-		Polycode.ShaderRenderTarget_set_buffer(self.__ptr, value.__ptr)
-		return true
 	elseif name == "normalizedWidth" then
 	elseif name == "normalizedWidth" then
 		Polycode.ShaderRenderTarget_set_normalizedWidth(self.__ptr, value)
 		Polycode.ShaderRenderTarget_set_normalizedWidth(self.__ptr, value)
 		return true
 		return true

+ 3 - 11
bindings/lua/Polycode/SpriteSet.lua

@@ -30,15 +30,7 @@ end
 function SpriteSet:getTexture()
 function SpriteSet:getTexture()
 	local retVal =  Polycode.SpriteSet_getTexture(self.__ptr)
 	local retVal =  Polycode.SpriteSet_getTexture(self.__ptr)
 	if retVal == nil then return nil end
 	if retVal == nil then return nil end
-	local __c = _G["Texture"]("__skip_ptr__")
-	__c.__ptr = retVal
-	return __c
-end
-
-function SpriteSet:loadTexture(imageFileName)
-	local retVal = Polycode.SpriteSet_loadTexture(self.__ptr, imageFileName)
-	if retVal == nil then return nil end
-	local __c = _G["Texture"]("__skip_ptr__")
+	local __c = _G["shared_ptr<Texture>"]("__skip_ptr__")
 	__c.__ptr = retVal
 	__c.__ptr = retVal
 	return __c
 	return __c
 end
 end
@@ -55,7 +47,7 @@ end
 function SpriteSet:getSpriteEntry(index)
 function SpriteSet:getSpriteEntry(index)
 	local retVal = Polycode.SpriteSet_getSpriteEntry(self.__ptr, index)
 	local retVal = Polycode.SpriteSet_getSpriteEntry(self.__ptr, index)
 	if retVal == nil then return nil end
 	if retVal == nil then return nil end
-	local __c = _G["Sprite"]("__skip_ptr__")
+	local __c = _G["shared_ptr<Sprite>"]("__skip_ptr__")
 	__c.__ptr = retVal
 	__c.__ptr = retVal
 	return __c
 	return __c
 end
 end
@@ -116,7 +108,7 @@ end
 function SpriteSet:getSpriteByName(spriteName)
 function SpriteSet:getSpriteByName(spriteName)
 	local retVal = Polycode.SpriteSet_getSpriteByName(self.__ptr, spriteName)
 	local retVal = Polycode.SpriteSet_getSpriteByName(self.__ptr, spriteName)
 	if retVal == nil then return nil end
 	if retVal == nil then return nil end
-	local __c = _G["Sprite"]("__skip_ptr__")
+	local __c = _G["shared_ptr<Sprite>"]("__skip_ptr__")
 	__c.__ptr = retVal
 	__c.__ptr = retVal
 	return __c
 	return __c
 end
 end

+ 1 - 1
bindings/lua/Polycode/SpriteState.lua

@@ -37,7 +37,7 @@ end
 function SpriteState:getMeshForFrameIndex(index)
 function SpriteState:getMeshForFrameIndex(index)
 	local retVal = Polycode.SpriteState_getMeshForFrameIndex(self.__ptr, index)
 	local retVal = Polycode.SpriteState_getMeshForFrameIndex(self.__ptr, index)
 	if retVal == nil then return nil end
 	if retVal == nil then return nil end
-	local __c = _G["Mesh"]("__skip_ptr__")
+	local __c = _G["shared_ptr<Mesh>"]("__skip_ptr__")
 	__c.__ptr = retVal
 	__c.__ptr = retVal
 	return __c
 	return __c
 end
 end

+ 1 - 1
bindings/lua/Polycode/TextureResourceLoader.lua

@@ -18,7 +18,7 @@ end
 function TextureResourceLoader:loadResource(path, targetPool)
 function TextureResourceLoader:loadResource(path, targetPool)
 	local retVal = Polycode.TextureResourceLoader_loadResource(self.__ptr, path, targetPool.__ptr)
 	local retVal = Polycode.TextureResourceLoader_loadResource(self.__ptr, path, targetPool.__ptr)
 	if retVal == nil then return nil end
 	if retVal == nil then return nil end
-	local __c = _G["Resource"]("__skip_ptr__")
+	local __c = _G["shared_ptr<Resource>"]("__skip_ptr__")
 	__c.__ptr = retVal
 	__c.__ptr = retVal
 	return __c
 	return __c
 end
 end

BIN
bindings/lua/lua_Polycode.pak


+ 0 - 24
build/osx/PolycodeCore/PolycodeCore.xcodeproj/project.pbxproj

@@ -34,7 +34,6 @@
 		8A8652421B72865C009F94DD /* PolyEventDispatcher.h in Headers */ = {isa = PBXBuildFile; fileRef = 8A8651F71B72865C009F94DD /* PolyEventDispatcher.h */; };
 		8A8652421B72865C009F94DD /* PolyEventDispatcher.h in Headers */ = {isa = PBXBuildFile; fileRef = 8A8651F71B72865C009F94DD /* PolyEventDispatcher.h */; };
 		8A8652431B72865C009F94DD /* PolyEventHandler.h in Headers */ = {isa = PBXBuildFile; fileRef = 8A8651F81B72865C009F94DD /* PolyEventHandler.h */; };
 		8A8652431B72865C009F94DD /* PolyEventHandler.h in Headers */ = {isa = PBXBuildFile; fileRef = 8A8651F81B72865C009F94DD /* PolyEventHandler.h */; };
 		8A8652441B72865C009F94DD /* PolyFont.h in Headers */ = {isa = PBXBuildFile; fileRef = 8A8651F91B72865C009F94DD /* PolyFont.h */; };
 		8A8652441B72865C009F94DD /* PolyFont.h in Headers */ = {isa = PBXBuildFile; fileRef = 8A8651F91B72865C009F94DD /* PolyFont.h */; };
-		8A8652451B72865C009F94DD /* PolyFontGlyphSheet.h in Headers */ = {isa = PBXBuildFile; fileRef = 8A8651FA1B72865C009F94DD /* PolyFontGlyphSheet.h */; };
 		8A8652471B72865C009F94DD /* PolyGlobals.h in Headers */ = {isa = PBXBuildFile; fileRef = 8A8651FC1B72865C009F94DD /* PolyGlobals.h */; };
 		8A8652471B72865C009F94DD /* PolyGlobals.h in Headers */ = {isa = PBXBuildFile; fileRef = 8A8651FC1B72865C009F94DD /* PolyGlobals.h */; };
 		8A8652481B72865C009F94DD /* PolyGPUDrawBuffer.h in Headers */ = {isa = PBXBuildFile; fileRef = 8A8651FD1B72865C009F94DD /* PolyGPUDrawBuffer.h */; };
 		8A8652481B72865C009F94DD /* PolyGPUDrawBuffer.h in Headers */ = {isa = PBXBuildFile; fileRef = 8A8651FD1B72865C009F94DD /* PolyGPUDrawBuffer.h */; };
 		8A8652491B72865C009F94DD /* PolyImage.h in Headers */ = {isa = PBXBuildFile; fileRef = 8A8651FE1B72865C009F94DD /* PolyImage.h */; };
 		8A8652491B72865C009F94DD /* PolyImage.h in Headers */ = {isa = PBXBuildFile; fileRef = 8A8651FE1B72865C009F94DD /* PolyImage.h */; };
@@ -43,7 +42,6 @@
 		8A86524C1B72865C009F94DD /* PolyLabel.h in Headers */ = {isa = PBXBuildFile; fileRef = 8A8652011B72865C009F94DD /* PolyLabel.h */; };
 		8A86524C1B72865C009F94DD /* PolyLabel.h in Headers */ = {isa = PBXBuildFile; fileRef = 8A8652011B72865C009F94DD /* PolyLabel.h */; };
 		8A86524D1B72865C009F94DD /* PolyLogger.h in Headers */ = {isa = PBXBuildFile; fileRef = 8A8652021B72865C009F94DD /* PolyLogger.h */; };
 		8A86524D1B72865C009F94DD /* PolyLogger.h in Headers */ = {isa = PBXBuildFile; fileRef = 8A8652021B72865C009F94DD /* PolyLogger.h */; };
 		8A86524E1B72865C009F94DD /* PolyMaterial.h in Headers */ = {isa = PBXBuildFile; fileRef = 8A8652031B72865C009F94DD /* PolyMaterial.h */; };
 		8A86524E1B72865C009F94DD /* PolyMaterial.h in Headers */ = {isa = PBXBuildFile; fileRef = 8A8652031B72865C009F94DD /* PolyMaterial.h */; };
-		8A86524F1B72865C009F94DD /* PolyMaterialManager.h in Headers */ = {isa = PBXBuildFile; fileRef = 8A8652041B72865C009F94DD /* PolyMaterialManager.h */; };
 		8A8652501B72865C009F94DD /* PolyMatrix4.h in Headers */ = {isa = PBXBuildFile; fileRef = 8A8652051B72865C009F94DD /* PolyMatrix4.h */; };
 		8A8652501B72865C009F94DD /* PolyMatrix4.h in Headers */ = {isa = PBXBuildFile; fileRef = 8A8652051B72865C009F94DD /* PolyMatrix4.h */; };
 		8A8652511B72865C009F94DD /* PolyMesh.h in Headers */ = {isa = PBXBuildFile; fileRef = 8A8652061B72865C009F94DD /* PolyMesh.h */; };
 		8A8652511B72865C009F94DD /* PolyMesh.h in Headers */ = {isa = PBXBuildFile; fileRef = 8A8652061B72865C009F94DD /* PolyMesh.h */; };
 		8A8652521B72865C009F94DD /* PolyObject.h in Headers */ = {isa = PBXBuildFile; fileRef = 8A8652071B72865C009F94DD /* PolyObject.h */; };
 		8A8652521B72865C009F94DD /* PolyObject.h in Headers */ = {isa = PBXBuildFile; fileRef = 8A8652071B72865C009F94DD /* PolyObject.h */; };
@@ -61,7 +59,6 @@
 		8A86525E1B72865C009F94DD /* PolyResourceManager.h in Headers */ = {isa = PBXBuildFile; fileRef = 8A8652131B72865C009F94DD /* PolyResourceManager.h */; };
 		8A86525E1B72865C009F94DD /* PolyResourceManager.h in Headers */ = {isa = PBXBuildFile; fileRef = 8A8652131B72865C009F94DD /* PolyResourceManager.h */; };
 		8A86525F1B72865C009F94DD /* PolyScene.h in Headers */ = {isa = PBXBuildFile; fileRef = 8A8652141B72865C009F94DD /* PolyScene.h */; };
 		8A86525F1B72865C009F94DD /* PolyScene.h in Headers */ = {isa = PBXBuildFile; fileRef = 8A8652141B72865C009F94DD /* PolyScene.h */; };
 		8A8652601B72865C009F94DD /* PolySceneEntityInstance.h in Headers */ = {isa = PBXBuildFile; fileRef = 8A8652151B72865C009F94DD /* PolySceneEntityInstance.h */; };
 		8A8652601B72865C009F94DD /* PolySceneEntityInstance.h in Headers */ = {isa = PBXBuildFile; fileRef = 8A8652151B72865C009F94DD /* PolySceneEntityInstance.h */; };
-		8A8652611B72865C009F94DD /* PolySceneImage.h in Headers */ = {isa = PBXBuildFile; fileRef = 8A8652161B72865C009F94DD /* PolySceneImage.h */; };
 		8A8652621B72865C009F94DD /* PolySceneLabel.h in Headers */ = {isa = PBXBuildFile; fileRef = 8A8652171B72865C009F94DD /* PolySceneLabel.h */; };
 		8A8652621B72865C009F94DD /* PolySceneLabel.h in Headers */ = {isa = PBXBuildFile; fileRef = 8A8652171B72865C009F94DD /* PolySceneLabel.h */; };
 		8A8652631B72865C009F94DD /* PolySceneLight.h in Headers */ = {isa = PBXBuildFile; fileRef = 8A8652181B72865C009F94DD /* PolySceneLight.h */; };
 		8A8652631B72865C009F94DD /* PolySceneLight.h in Headers */ = {isa = PBXBuildFile; fileRef = 8A8652181B72865C009F94DD /* PolySceneLight.h */; };
 		8A8652641B72865C009F94DD /* PolySceneLine.h in Headers */ = {isa = PBXBuildFile; fileRef = 8A8652191B72865C009F94DD /* PolySceneLine.h */; };
 		8A8652641B72865C009F94DD /* PolySceneLine.h in Headers */ = {isa = PBXBuildFile; fileRef = 8A8652191B72865C009F94DD /* PolySceneLine.h */; };
@@ -110,14 +107,12 @@
 		8A8652E41B72867F009F94DD /* PolyEventDispatcher.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 8A8652991B72867E009F94DD /* PolyEventDispatcher.cpp */; };
 		8A8652E41B72867F009F94DD /* PolyEventDispatcher.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 8A8652991B72867E009F94DD /* PolyEventDispatcher.cpp */; };
 		8A8652E51B72867F009F94DD /* PolyEventHandler.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 8A86529A1B72867E009F94DD /* PolyEventHandler.cpp */; };
 		8A8652E51B72867F009F94DD /* PolyEventHandler.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 8A86529A1B72867E009F94DD /* PolyEventHandler.cpp */; };
 		8A8652E61B72867F009F94DD /* PolyFont.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 8A86529B1B72867E009F94DD /* PolyFont.cpp */; };
 		8A8652E61B72867F009F94DD /* PolyFont.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 8A86529B1B72867E009F94DD /* PolyFont.cpp */; };
-		8A8652E71B72867F009F94DD /* PolyFontGlyphSheet.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 8A86529C1B72867E009F94DD /* PolyFontGlyphSheet.cpp */; };
 		8A8652E91B72867F009F94DD /* PolyGPUDrawBuffer.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 8A86529E1B72867E009F94DD /* PolyGPUDrawBuffer.cpp */; };
 		8A8652E91B72867F009F94DD /* PolyGPUDrawBuffer.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 8A86529E1B72867E009F94DD /* PolyGPUDrawBuffer.cpp */; };
 		8A8652EA1B72867F009F94DD /* PolyImage.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 8A86529F1B72867E009F94DD /* PolyImage.cpp */; };
 		8A8652EA1B72867F009F94DD /* PolyImage.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 8A86529F1B72867E009F94DD /* PolyImage.cpp */; };
 		8A8652EB1B72867F009F94DD /* PolyInputEvent.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 8A8652A01B72867E009F94DD /* PolyInputEvent.cpp */; };
 		8A8652EB1B72867F009F94DD /* PolyInputEvent.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 8A8652A01B72867E009F94DD /* PolyInputEvent.cpp */; };
 		8A8652EC1B72867F009F94DD /* PolyLabel.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 8A8652A11B72867E009F94DD /* PolyLabel.cpp */; };
 		8A8652EC1B72867F009F94DD /* PolyLabel.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 8A8652A11B72867E009F94DD /* PolyLabel.cpp */; };
 		8A8652ED1B72867F009F94DD /* PolyLogger.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 8A8652A21B72867E009F94DD /* PolyLogger.cpp */; };
 		8A8652ED1B72867F009F94DD /* PolyLogger.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 8A8652A21B72867E009F94DD /* PolyLogger.cpp */; };
 		8A8652EE1B72867F009F94DD /* PolyMaterial.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 8A8652A31B72867E009F94DD /* PolyMaterial.cpp */; };
 		8A8652EE1B72867F009F94DD /* PolyMaterial.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 8A8652A31B72867E009F94DD /* PolyMaterial.cpp */; };
-		8A8652EF1B72867F009F94DD /* PolyMaterialManager.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 8A8652A41B72867E009F94DD /* PolyMaterialManager.cpp */; };
 		8A8652F01B72867F009F94DD /* PolyMatrix4.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 8A8652A51B72867E009F94DD /* PolyMatrix4.cpp */; };
 		8A8652F01B72867F009F94DD /* PolyMatrix4.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 8A8652A51B72867E009F94DD /* PolyMatrix4.cpp */; };
 		8A8652F11B72867F009F94DD /* PolyMesh.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 8A8652A61B72867E009F94DD /* PolyMesh.cpp */; };
 		8A8652F11B72867F009F94DD /* PolyMesh.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 8A8652A61B72867E009F94DD /* PolyMesh.cpp */; };
 		8A8652F21B72867F009F94DD /* PolyObject.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 8A8652A71B72867E009F94DD /* PolyObject.cpp */; };
 		8A8652F21B72867F009F94DD /* PolyObject.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 8A8652A71B72867E009F94DD /* PolyObject.cpp */; };
@@ -135,7 +130,6 @@
 		8A8652FE1B72867F009F94DD /* PolyResourceManager.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 8A8652B31B72867F009F94DD /* PolyResourceManager.cpp */; };
 		8A8652FE1B72867F009F94DD /* PolyResourceManager.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 8A8652B31B72867F009F94DD /* PolyResourceManager.cpp */; };
 		8A8652FF1B72867F009F94DD /* PolyScene.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 8A8652B41B72867F009F94DD /* PolyScene.cpp */; };
 		8A8652FF1B72867F009F94DD /* PolyScene.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 8A8652B41B72867F009F94DD /* PolyScene.cpp */; };
 		8A8653001B72867F009F94DD /* PolySceneEntityInstance.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 8A8652B51B72867F009F94DD /* PolySceneEntityInstance.cpp */; };
 		8A8653001B72867F009F94DD /* PolySceneEntityInstance.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 8A8652B51B72867F009F94DD /* PolySceneEntityInstance.cpp */; };
-		8A8653011B72867F009F94DD /* PolySceneImage.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 8A8652B61B72867F009F94DD /* PolySceneImage.cpp */; };
 		8A8653021B72867F009F94DD /* PolySceneLabel.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 8A8652B71B72867F009F94DD /* PolySceneLabel.cpp */; };
 		8A8653021B72867F009F94DD /* PolySceneLabel.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 8A8652B71B72867F009F94DD /* PolySceneLabel.cpp */; };
 		8A8653031B72867F009F94DD /* PolySceneLight.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 8A8652B81B72867F009F94DD /* PolySceneLight.cpp */; };
 		8A8653031B72867F009F94DD /* PolySceneLight.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 8A8652B81B72867F009F94DD /* PolySceneLight.cpp */; };
 		8A8653041B72867F009F94DD /* PolySceneLine.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 8A8652B91B72867F009F94DD /* PolySceneLine.cpp */; };
 		8A8653041B72867F009F94DD /* PolySceneLine.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 8A8652B91B72867F009F94DD /* PolySceneLine.cpp */; };
@@ -205,7 +199,6 @@
 		8A8651F71B72865C009F94DD /* PolyEventDispatcher.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = PolyEventDispatcher.h; path = ../../../include/polycode/core/PolyEventDispatcher.h; sourceTree = "<group>"; };
 		8A8651F71B72865C009F94DD /* PolyEventDispatcher.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = PolyEventDispatcher.h; path = ../../../include/polycode/core/PolyEventDispatcher.h; sourceTree = "<group>"; };
 		8A8651F81B72865C009F94DD /* PolyEventHandler.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = PolyEventHandler.h; path = ../../../include/polycode/core/PolyEventHandler.h; sourceTree = "<group>"; };
 		8A8651F81B72865C009F94DD /* PolyEventHandler.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = PolyEventHandler.h; path = ../../../include/polycode/core/PolyEventHandler.h; sourceTree = "<group>"; };
 		8A8651F91B72865C009F94DD /* PolyFont.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = PolyFont.h; path = ../../../include/polycode/core/PolyFont.h; sourceTree = "<group>"; };
 		8A8651F91B72865C009F94DD /* PolyFont.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = PolyFont.h; path = ../../../include/polycode/core/PolyFont.h; sourceTree = "<group>"; };
-		8A8651FA1B72865C009F94DD /* PolyFontGlyphSheet.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = PolyFontGlyphSheet.h; path = ../../../include/polycode/core/PolyFontGlyphSheet.h; sourceTree = "<group>"; };
 		8A8651FC1B72865C009F94DD /* PolyGlobals.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = PolyGlobals.h; path = ../../../include/polycode/core/PolyGlobals.h; sourceTree = "<group>"; };
 		8A8651FC1B72865C009F94DD /* PolyGlobals.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = PolyGlobals.h; path = ../../../include/polycode/core/PolyGlobals.h; sourceTree = "<group>"; };
 		8A8651FD1B72865C009F94DD /* PolyGPUDrawBuffer.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = PolyGPUDrawBuffer.h; path = ../../../include/polycode/core/PolyGPUDrawBuffer.h; sourceTree = "<group>"; };
 		8A8651FD1B72865C009F94DD /* PolyGPUDrawBuffer.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = PolyGPUDrawBuffer.h; path = ../../../include/polycode/core/PolyGPUDrawBuffer.h; sourceTree = "<group>"; };
 		8A8651FE1B72865C009F94DD /* PolyImage.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = PolyImage.h; path = ../../../include/polycode/core/PolyImage.h; sourceTree = "<group>"; };
 		8A8651FE1B72865C009F94DD /* PolyImage.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = PolyImage.h; path = ../../../include/polycode/core/PolyImage.h; sourceTree = "<group>"; };
@@ -214,7 +207,6 @@
 		8A8652011B72865C009F94DD /* PolyLabel.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = PolyLabel.h; path = ../../../include/polycode/core/PolyLabel.h; sourceTree = "<group>"; };
 		8A8652011B72865C009F94DD /* PolyLabel.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = PolyLabel.h; path = ../../../include/polycode/core/PolyLabel.h; sourceTree = "<group>"; };
 		8A8652021B72865C009F94DD /* PolyLogger.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = PolyLogger.h; path = ../../../include/polycode/core/PolyLogger.h; sourceTree = "<group>"; };
 		8A8652021B72865C009F94DD /* PolyLogger.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = PolyLogger.h; path = ../../../include/polycode/core/PolyLogger.h; sourceTree = "<group>"; };
 		8A8652031B72865C009F94DD /* PolyMaterial.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = PolyMaterial.h; path = ../../../include/polycode/core/PolyMaterial.h; sourceTree = "<group>"; };
 		8A8652031B72865C009F94DD /* PolyMaterial.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = PolyMaterial.h; path = ../../../include/polycode/core/PolyMaterial.h; sourceTree = "<group>"; };
-		8A8652041B72865C009F94DD /* PolyMaterialManager.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = PolyMaterialManager.h; path = ../../../include/polycode/core/PolyMaterialManager.h; sourceTree = "<group>"; };
 		8A8652051B72865C009F94DD /* PolyMatrix4.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = PolyMatrix4.h; path = ../../../include/polycode/core/PolyMatrix4.h; sourceTree = "<group>"; };
 		8A8652051B72865C009F94DD /* PolyMatrix4.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = PolyMatrix4.h; path = ../../../include/polycode/core/PolyMatrix4.h; sourceTree = "<group>"; };
 		8A8652061B72865C009F94DD /* PolyMesh.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = PolyMesh.h; path = ../../../include/polycode/core/PolyMesh.h; sourceTree = "<group>"; };
 		8A8652061B72865C009F94DD /* PolyMesh.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = PolyMesh.h; path = ../../../include/polycode/core/PolyMesh.h; sourceTree = "<group>"; };
 		8A8652071B72865C009F94DD /* PolyObject.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = PolyObject.h; path = ../../../include/polycode/core/PolyObject.h; sourceTree = "<group>"; };
 		8A8652071B72865C009F94DD /* PolyObject.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = PolyObject.h; path = ../../../include/polycode/core/PolyObject.h; sourceTree = "<group>"; };
@@ -232,7 +224,6 @@
 		8A8652131B72865C009F94DD /* PolyResourceManager.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = PolyResourceManager.h; path = ../../../include/polycode/core/PolyResourceManager.h; sourceTree = "<group>"; };
 		8A8652131B72865C009F94DD /* PolyResourceManager.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = PolyResourceManager.h; path = ../../../include/polycode/core/PolyResourceManager.h; sourceTree = "<group>"; };
 		8A8652141B72865C009F94DD /* PolyScene.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = PolyScene.h; path = ../../../include/polycode/core/PolyScene.h; sourceTree = "<group>"; };
 		8A8652141B72865C009F94DD /* PolyScene.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = PolyScene.h; path = ../../../include/polycode/core/PolyScene.h; sourceTree = "<group>"; };
 		8A8652151B72865C009F94DD /* PolySceneEntityInstance.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = PolySceneEntityInstance.h; path = ../../../include/polycode/core/PolySceneEntityInstance.h; sourceTree = "<group>"; };
 		8A8652151B72865C009F94DD /* PolySceneEntityInstance.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = PolySceneEntityInstance.h; path = ../../../include/polycode/core/PolySceneEntityInstance.h; sourceTree = "<group>"; };
-		8A8652161B72865C009F94DD /* PolySceneImage.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = PolySceneImage.h; path = ../../../include/polycode/core/PolySceneImage.h; sourceTree = "<group>"; };
 		8A8652171B72865C009F94DD /* PolySceneLabel.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = PolySceneLabel.h; path = ../../../include/polycode/core/PolySceneLabel.h; sourceTree = "<group>"; };
 		8A8652171B72865C009F94DD /* PolySceneLabel.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = PolySceneLabel.h; path = ../../../include/polycode/core/PolySceneLabel.h; sourceTree = "<group>"; };
 		8A8652181B72865C009F94DD /* PolySceneLight.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = PolySceneLight.h; path = ../../../include/polycode/core/PolySceneLight.h; sourceTree = "<group>"; };
 		8A8652181B72865C009F94DD /* PolySceneLight.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = PolySceneLight.h; path = ../../../include/polycode/core/PolySceneLight.h; sourceTree = "<group>"; };
 		8A8652191B72865C009F94DD /* PolySceneLine.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = PolySceneLine.h; path = ../../../include/polycode/core/PolySceneLine.h; sourceTree = "<group>"; };
 		8A8652191B72865C009F94DD /* PolySceneLine.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = PolySceneLine.h; path = ../../../include/polycode/core/PolySceneLine.h; sourceTree = "<group>"; };
@@ -281,14 +272,12 @@
 		8A8652991B72867E009F94DD /* PolyEventDispatcher.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = PolyEventDispatcher.cpp; path = ../../../src/core/PolyEventDispatcher.cpp; sourceTree = "<group>"; };
 		8A8652991B72867E009F94DD /* PolyEventDispatcher.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = PolyEventDispatcher.cpp; path = ../../../src/core/PolyEventDispatcher.cpp; sourceTree = "<group>"; };
 		8A86529A1B72867E009F94DD /* PolyEventHandler.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = PolyEventHandler.cpp; path = ../../../src/core/PolyEventHandler.cpp; sourceTree = "<group>"; };
 		8A86529A1B72867E009F94DD /* PolyEventHandler.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = PolyEventHandler.cpp; path = ../../../src/core/PolyEventHandler.cpp; sourceTree = "<group>"; };
 		8A86529B1B72867E009F94DD /* PolyFont.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = PolyFont.cpp; path = ../../../src/core/PolyFont.cpp; sourceTree = "<group>"; };
 		8A86529B1B72867E009F94DD /* PolyFont.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = PolyFont.cpp; path = ../../../src/core/PolyFont.cpp; sourceTree = "<group>"; };
-		8A86529C1B72867E009F94DD /* PolyFontGlyphSheet.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = PolyFontGlyphSheet.cpp; path = ../../../src/core/PolyFontGlyphSheet.cpp; sourceTree = "<group>"; };
 		8A86529E1B72867E009F94DD /* PolyGPUDrawBuffer.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = PolyGPUDrawBuffer.cpp; path = ../../../src/core/PolyGPUDrawBuffer.cpp; sourceTree = "<group>"; };
 		8A86529E1B72867E009F94DD /* PolyGPUDrawBuffer.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = PolyGPUDrawBuffer.cpp; path = ../../../src/core/PolyGPUDrawBuffer.cpp; sourceTree = "<group>"; };
 		8A86529F1B72867E009F94DD /* PolyImage.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = PolyImage.cpp; path = ../../../src/core/PolyImage.cpp; sourceTree = "<group>"; };
 		8A86529F1B72867E009F94DD /* PolyImage.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = PolyImage.cpp; path = ../../../src/core/PolyImage.cpp; sourceTree = "<group>"; };
 		8A8652A01B72867E009F94DD /* PolyInputEvent.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = PolyInputEvent.cpp; path = ../../../src/core/PolyInputEvent.cpp; sourceTree = "<group>"; };
 		8A8652A01B72867E009F94DD /* PolyInputEvent.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = PolyInputEvent.cpp; path = ../../../src/core/PolyInputEvent.cpp; sourceTree = "<group>"; };
 		8A8652A11B72867E009F94DD /* PolyLabel.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = PolyLabel.cpp; path = ../../../src/core/PolyLabel.cpp; sourceTree = "<group>"; };
 		8A8652A11B72867E009F94DD /* PolyLabel.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = PolyLabel.cpp; path = ../../../src/core/PolyLabel.cpp; sourceTree = "<group>"; };
 		8A8652A21B72867E009F94DD /* PolyLogger.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = PolyLogger.cpp; path = ../../../src/core/PolyLogger.cpp; sourceTree = "<group>"; };
 		8A8652A21B72867E009F94DD /* PolyLogger.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = PolyLogger.cpp; path = ../../../src/core/PolyLogger.cpp; sourceTree = "<group>"; };
 		8A8652A31B72867E009F94DD /* PolyMaterial.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = PolyMaterial.cpp; path = ../../../src/core/PolyMaterial.cpp; sourceTree = "<group>"; };
 		8A8652A31B72867E009F94DD /* PolyMaterial.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = PolyMaterial.cpp; path = ../../../src/core/PolyMaterial.cpp; sourceTree = "<group>"; };
-		8A8652A41B72867E009F94DD /* PolyMaterialManager.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = PolyMaterialManager.cpp; path = ../../../src/core/PolyMaterialManager.cpp; sourceTree = "<group>"; };
 		8A8652A51B72867E009F94DD /* PolyMatrix4.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = PolyMatrix4.cpp; path = ../../../src/core/PolyMatrix4.cpp; sourceTree = "<group>"; };
 		8A8652A51B72867E009F94DD /* PolyMatrix4.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = PolyMatrix4.cpp; path = ../../../src/core/PolyMatrix4.cpp; sourceTree = "<group>"; };
 		8A8652A61B72867E009F94DD /* PolyMesh.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = PolyMesh.cpp; path = ../../../src/core/PolyMesh.cpp; sourceTree = "<group>"; };
 		8A8652A61B72867E009F94DD /* PolyMesh.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = PolyMesh.cpp; path = ../../../src/core/PolyMesh.cpp; sourceTree = "<group>"; };
 		8A8652A71B72867E009F94DD /* PolyObject.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = PolyObject.cpp; path = ../../../src/core/PolyObject.cpp; sourceTree = "<group>"; };
 		8A8652A71B72867E009F94DD /* PolyObject.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = PolyObject.cpp; path = ../../../src/core/PolyObject.cpp; sourceTree = "<group>"; };
@@ -306,7 +295,6 @@
 		8A8652B31B72867F009F94DD /* PolyResourceManager.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = PolyResourceManager.cpp; path = ../../../src/core/PolyResourceManager.cpp; sourceTree = "<group>"; };
 		8A8652B31B72867F009F94DD /* PolyResourceManager.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = PolyResourceManager.cpp; path = ../../../src/core/PolyResourceManager.cpp; sourceTree = "<group>"; };
 		8A8652B41B72867F009F94DD /* PolyScene.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = PolyScene.cpp; path = ../../../src/core/PolyScene.cpp; sourceTree = "<group>"; };
 		8A8652B41B72867F009F94DD /* PolyScene.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = PolyScene.cpp; path = ../../../src/core/PolyScene.cpp; sourceTree = "<group>"; };
 		8A8652B51B72867F009F94DD /* PolySceneEntityInstance.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = PolySceneEntityInstance.cpp; path = ../../../src/core/PolySceneEntityInstance.cpp; sourceTree = "<group>"; };
 		8A8652B51B72867F009F94DD /* PolySceneEntityInstance.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = PolySceneEntityInstance.cpp; path = ../../../src/core/PolySceneEntityInstance.cpp; sourceTree = "<group>"; };
-		8A8652B61B72867F009F94DD /* PolySceneImage.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = PolySceneImage.cpp; path = ../../../src/core/PolySceneImage.cpp; sourceTree = "<group>"; };
 		8A8652B71B72867F009F94DD /* PolySceneLabel.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = PolySceneLabel.cpp; path = ../../../src/core/PolySceneLabel.cpp; sourceTree = "<group>"; };
 		8A8652B71B72867F009F94DD /* PolySceneLabel.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = PolySceneLabel.cpp; path = ../../../src/core/PolySceneLabel.cpp; sourceTree = "<group>"; };
 		8A8652B81B72867F009F94DD /* PolySceneLight.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = PolySceneLight.cpp; path = ../../../src/core/PolySceneLight.cpp; sourceTree = "<group>"; };
 		8A8652B81B72867F009F94DD /* PolySceneLight.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = PolySceneLight.cpp; path = ../../../src/core/PolySceneLight.cpp; sourceTree = "<group>"; };
 		8A8652B91B72867F009F94DD /* PolySceneLine.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = PolySceneLine.cpp; path = ../../../src/core/PolySceneLine.cpp; sourceTree = "<group>"; };
 		8A8652B91B72867F009F94DD /* PolySceneLine.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = PolySceneLine.cpp; path = ../../../src/core/PolySceneLine.cpp; sourceTree = "<group>"; };
@@ -396,14 +384,12 @@
 				8A8652991B72867E009F94DD /* PolyEventDispatcher.cpp */,
 				8A8652991B72867E009F94DD /* PolyEventDispatcher.cpp */,
 				8A86529A1B72867E009F94DD /* PolyEventHandler.cpp */,
 				8A86529A1B72867E009F94DD /* PolyEventHandler.cpp */,
 				8A86529B1B72867E009F94DD /* PolyFont.cpp */,
 				8A86529B1B72867E009F94DD /* PolyFont.cpp */,
-				8A86529C1B72867E009F94DD /* PolyFontGlyphSheet.cpp */,
 				8A86529E1B72867E009F94DD /* PolyGPUDrawBuffer.cpp */,
 				8A86529E1B72867E009F94DD /* PolyGPUDrawBuffer.cpp */,
 				8A86529F1B72867E009F94DD /* PolyImage.cpp */,
 				8A86529F1B72867E009F94DD /* PolyImage.cpp */,
 				8A8652A01B72867E009F94DD /* PolyInputEvent.cpp */,
 				8A8652A01B72867E009F94DD /* PolyInputEvent.cpp */,
 				8A8652A11B72867E009F94DD /* PolyLabel.cpp */,
 				8A8652A11B72867E009F94DD /* PolyLabel.cpp */,
 				8A8652A21B72867E009F94DD /* PolyLogger.cpp */,
 				8A8652A21B72867E009F94DD /* PolyLogger.cpp */,
 				8A8652A31B72867E009F94DD /* PolyMaterial.cpp */,
 				8A8652A31B72867E009F94DD /* PolyMaterial.cpp */,
-				8A8652A41B72867E009F94DD /* PolyMaterialManager.cpp */,
 				8A8652A51B72867E009F94DD /* PolyMatrix4.cpp */,
 				8A8652A51B72867E009F94DD /* PolyMatrix4.cpp */,
 				8A8652A61B72867E009F94DD /* PolyMesh.cpp */,
 				8A8652A61B72867E009F94DD /* PolyMesh.cpp */,
 				8A8652A71B72867E009F94DD /* PolyObject.cpp */,
 				8A8652A71B72867E009F94DD /* PolyObject.cpp */,
@@ -421,7 +407,6 @@
 				8A8652B31B72867F009F94DD /* PolyResourceManager.cpp */,
 				8A8652B31B72867F009F94DD /* PolyResourceManager.cpp */,
 				8A8652B41B72867F009F94DD /* PolyScene.cpp */,
 				8A8652B41B72867F009F94DD /* PolyScene.cpp */,
 				8A8652B51B72867F009F94DD /* PolySceneEntityInstance.cpp */,
 				8A8652B51B72867F009F94DD /* PolySceneEntityInstance.cpp */,
-				8A8652B61B72867F009F94DD /* PolySceneImage.cpp */,
 				8A8652B71B72867F009F94DD /* PolySceneLabel.cpp */,
 				8A8652B71B72867F009F94DD /* PolySceneLabel.cpp */,
 				8A8652B81B72867F009F94DD /* PolySceneLight.cpp */,
 				8A8652B81B72867F009F94DD /* PolySceneLight.cpp */,
 				8A8652B91B72867F009F94DD /* PolySceneLine.cpp */,
 				8A8652B91B72867F009F94DD /* PolySceneLine.cpp */,
@@ -492,7 +477,6 @@
 				8A8651F71B72865C009F94DD /* PolyEventDispatcher.h */,
 				8A8651F71B72865C009F94DD /* PolyEventDispatcher.h */,
 				8A8651F81B72865C009F94DD /* PolyEventHandler.h */,
 				8A8651F81B72865C009F94DD /* PolyEventHandler.h */,
 				8A8651F91B72865C009F94DD /* PolyFont.h */,
 				8A8651F91B72865C009F94DD /* PolyFont.h */,
-				8A8651FA1B72865C009F94DD /* PolyFontGlyphSheet.h */,
 				8A8651FC1B72865C009F94DD /* PolyGlobals.h */,
 				8A8651FC1B72865C009F94DD /* PolyGlobals.h */,
 				8A8651FD1B72865C009F94DD /* PolyGPUDrawBuffer.h */,
 				8A8651FD1B72865C009F94DD /* PolyGPUDrawBuffer.h */,
 				8A8651FE1B72865C009F94DD /* PolyImage.h */,
 				8A8651FE1B72865C009F94DD /* PolyImage.h */,
@@ -501,7 +485,6 @@
 				8A8652011B72865C009F94DD /* PolyLabel.h */,
 				8A8652011B72865C009F94DD /* PolyLabel.h */,
 				8A8652021B72865C009F94DD /* PolyLogger.h */,
 				8A8652021B72865C009F94DD /* PolyLogger.h */,
 				8A8652031B72865C009F94DD /* PolyMaterial.h */,
 				8A8652031B72865C009F94DD /* PolyMaterial.h */,
-				8A8652041B72865C009F94DD /* PolyMaterialManager.h */,
 				8A8652051B72865C009F94DD /* PolyMatrix4.h */,
 				8A8652051B72865C009F94DD /* PolyMatrix4.h */,
 				8A8652061B72865C009F94DD /* PolyMesh.h */,
 				8A8652061B72865C009F94DD /* PolyMesh.h */,
 				8A8652071B72865C009F94DD /* PolyObject.h */,
 				8A8652071B72865C009F94DD /* PolyObject.h */,
@@ -519,7 +502,6 @@
 				8A8652131B72865C009F94DD /* PolyResourceManager.h */,
 				8A8652131B72865C009F94DD /* PolyResourceManager.h */,
 				8A8652141B72865C009F94DD /* PolyScene.h */,
 				8A8652141B72865C009F94DD /* PolyScene.h */,
 				8A8652151B72865C009F94DD /* PolySceneEntityInstance.h */,
 				8A8652151B72865C009F94DD /* PolySceneEntityInstance.h */,
-				8A8652161B72865C009F94DD /* PolySceneImage.h */,
 				8A8652171B72865C009F94DD /* PolySceneLabel.h */,
 				8A8652171B72865C009F94DD /* PolySceneLabel.h */,
 				8A8652181B72865C009F94DD /* PolySceneLight.h */,
 				8A8652181B72865C009F94DD /* PolySceneLight.h */,
 				8A8652191B72865C009F94DD /* PolySceneLine.h */,
 				8A8652191B72865C009F94DD /* PolySceneLine.h */,
@@ -566,7 +548,6 @@
 				6D904FCF1CC2A4E900D0E80A /* PolyScript.h in Headers */,
 				6D904FCF1CC2A4E900D0E80A /* PolyScript.h in Headers */,
 				8A86526D1B72865C009F94DD /* PolyServerWorld.h in Headers */,
 				8A86526D1B72865C009F94DD /* PolyServerWorld.h in Headers */,
 				8A825F231B829BA70039E823 /* PolyPAAudioInterface.h in Headers */,
 				8A825F231B829BA70039E823 /* PolyPAAudioInterface.h in Headers */,
-				8A86524F1B72865C009F94DD /* PolyMaterialManager.h in Headers */,
 				8A8652891B72866C009F94DD /* tinyxml.h in Headers */,
 				8A8652891B72866C009F94DD /* tinyxml.h in Headers */,
 				8A8652351B72865C009F94DD /* PolyCamera.h in Headers */,
 				8A8652351B72865C009F94DD /* PolyCamera.h in Headers */,
 				8A86524E1B72865C009F94DD /* PolyMaterial.h in Headers */,
 				8A86524E1B72865C009F94DD /* PolyMaterial.h in Headers */,
@@ -592,7 +573,6 @@
 				8A8652471B72865C009F94DD /* PolyGlobals.h in Headers */,
 				8A8652471B72865C009F94DD /* PolyGlobals.h in Headers */,
 				8A8652421B72865C009F94DD /* PolyEventDispatcher.h in Headers */,
 				8A8652421B72865C009F94DD /* PolyEventDispatcher.h in Headers */,
 				8A8652581B72865C009F94DD /* PolyQuaternionCurve.h in Headers */,
 				8A8652581B72865C009F94DD /* PolyQuaternionCurve.h in Headers */,
-				8A8652451B72865C009F94DD /* PolyFontGlyphSheet.h in Headers */,
 				8A8652671B72865C009F94DD /* PolyScenePrimitive.h in Headers */,
 				8A8652671B72865C009F94DD /* PolyScenePrimitive.h in Headers */,
 				8A8652751B72865C009F94DD /* PolyThreaded.h in Headers */,
 				8A8652751B72865C009F94DD /* PolyThreaded.h in Headers */,
 				8A8652691B72865C009F94DD /* PolySceneSound.h in Headers */,
 				8A8652691B72865C009F94DD /* PolySceneSound.h in Headers */,
@@ -619,7 +599,6 @@
 				8A8652371B72865C009F94DD /* PolyCocoaCore.h in Headers */,
 				8A8652371B72865C009F94DD /* PolyCocoaCore.h in Headers */,
 				8A8652861B72866C009F94DD /* rgbe.h in Headers */,
 				8A8652861B72866C009F94DD /* rgbe.h in Headers */,
 				8A8652781B72865C009F94DD /* PolyTween.h in Headers */,
 				8A8652781B72865C009F94DD /* PolyTween.h in Headers */,
-				8A8652611B72865C009F94DD /* PolySceneImage.h in Headers */,
 				8A8652491B72865C009F94DD /* PolyImage.h in Headers */,
 				8A8652491B72865C009F94DD /* PolyImage.h in Headers */,
 				8A9D122F1CDD503C00ACD484 /* PolycodeJS.h in Headers */,
 				8A9D122F1CDD503C00ACD484 /* PolycodeJS.h in Headers */,
 				8A86526E1B72865C009F94DD /* PolyShader.h in Headers */,
 				8A86526E1B72865C009F94DD /* PolyShader.h in Headers */,
@@ -735,7 +714,6 @@
 				8A8652F11B72867F009F94DD /* PolyMesh.cpp in Sources */,
 				8A8652F11B72867F009F94DD /* PolyMesh.cpp in Sources */,
 				8A8652E21B72867F009F94DD /* PolyEntity.cpp in Sources */,
 				8A8652E21B72867F009F94DD /* PolyEntity.cpp in Sources */,
 				8A8652F21B72867F009F94DD /* PolyObject.cpp in Sources */,
 				8A8652F21B72867F009F94DD /* PolyObject.cpp in Sources */,
-				8A8653011B72867F009F94DD /* PolySceneImage.cpp in Sources */,
 				8A40875E1D0087AD009FF944 /* duktape.cpp in Sources */,
 				8A40875E1D0087AD009FF944 /* duktape.cpp in Sources */,
 				8A8653001B72867F009F94DD /* PolySceneEntityInstance.cpp in Sources */,
 				8A8653001B72867F009F94DD /* PolySceneEntityInstance.cpp in Sources */,
 				8A8652DC1B72867F009F94DD /* PolyConfig.cpp in Sources */,
 				8A8652DC1B72867F009F94DD /* PolyConfig.cpp in Sources */,
@@ -749,7 +727,6 @@
 				8A8653071B72867F009F94DD /* PolyScenePrimitive.cpp in Sources */,
 				8A8653071B72867F009F94DD /* PolyScenePrimitive.cpp in Sources */,
 				8A8652F71B72867F009F94DD /* PolyQuaternion.cpp in Sources */,
 				8A8652F71B72867F009F94DD /* PolyQuaternion.cpp in Sources */,
 				8A8652F31B72867F009F94DD /* PolyOpenGLGraphicsInterface.cpp in Sources */,
 				8A8652F31B72867F009F94DD /* PolyOpenGLGraphicsInterface.cpp in Sources */,
-				8A8652E71B72867F009F94DD /* PolyFontGlyphSheet.cpp in Sources */,
 				8A8652E41B72867F009F94DD /* PolyEventDispatcher.cpp in Sources */,
 				8A8652E41B72867F009F94DD /* PolyEventDispatcher.cpp in Sources */,
 				8A86531F1B72867F009F94DD /* tinyxmlparser.cpp in Sources */,
 				8A86531F1B72867F009F94DD /* tinyxmlparser.cpp in Sources */,
 				8A8652EB1B72867F009F94DD /* PolyInputEvent.cpp in Sources */,
 				8A8652EB1B72867F009F94DD /* PolyInputEvent.cpp in Sources */,
@@ -794,7 +771,6 @@
 				8A86530F1B72867F009F94DD /* PolySound.cpp in Sources */,
 				8A86530F1B72867F009F94DD /* PolySound.cpp in Sources */,
 				8A8652F61B72867F009F94DD /* PolyPerlin.cpp in Sources */,
 				8A8652F61B72867F009F94DD /* PolyPerlin.cpp in Sources */,
 				8A8653101B72867F009F94DD /* PolySoundManager.cpp in Sources */,
 				8A8653101B72867F009F94DD /* PolySoundManager.cpp in Sources */,
-				8A8652EF1B72867F009F94DD /* PolyMaterialManager.cpp in Sources */,
 				8A8653921B7434D8009F94DD /* PolyCoreFileProvider.cpp in Sources */,
 				8A8653921B7434D8009F94DD /* PolyCoreFileProvider.cpp in Sources */,
 				8A8653061B72867F009F94DD /* PolySceneMesh.cpp in Sources */,
 				8A8653061B72867F009F94DD /* PolySceneMesh.cpp in Sources */,
 				8A5EF4FC1CD90E4800F8466A /* PolycodeLua.cpp in Sources */,
 				8A5EF4FC1CD90E4800F8466A /* PolycodeLua.cpp in Sources */,

+ 4 - 4
build/osx/TemplateApp/TemplateApp/PolycodeTemplateApp.mm

@@ -18,7 +18,7 @@ PolycodeTemplateApp::PolycodeTemplateApp(PolycodeView *view) {
     core->addFileSource("archive", "hdr.pak");
     core->addFileSource("archive", "hdr.pak");
     globalPool->loadResourcesFromFolder("hdr", true);
     globalPool->loadResourcesFromFolder("hdr", true);
     
     
-    Polycode:Script *rotateScript = (Script*) globalPool->loadResource("rotate.js");
+	//std::shared_ptr<Script>rotateScript = std::static_pointer_cast<Script>(globalPool->loadResource("rotate.js"));
     
     
 	// Write your code here!
 	// Write your code here!
     
     
@@ -28,7 +28,7 @@ PolycodeTemplateApp::PolycodeTemplateApp(PolycodeView *view) {
     
     
    // scene->setOverrideMaterial((Material*)globalPool->getResource(Resource::RESOURCE_MATERIAL, "Unlit"));
    // scene->setOverrideMaterial((Material*)globalPool->getResource(Resource::RESOURCE_MATERIAL, "Unlit"));
     
     
-    for(int i=0; i  < 3000; i++) {
+    for(int i=0; i  < 2000; i++) {
         
         
         MeshGeometry geom;
         MeshGeometry geom;
         geom.createVPlane(0.5, 0.5);
         geom.createVPlane(0.5, 0.5);
@@ -71,7 +71,7 @@ bool PolycodeTemplateApp::Update() {
     for(int i=0; i < tests.size(); i++) {
     for(int i=0; i < tests.size(); i++) {
         tests[i]->Roll(elapsed * 30.0);
         tests[i]->Roll(elapsed * 30.0);
     }
     }
-	/*
+	
     if(tests.size() > 0) {
     if(tests.size() > 0) {
         SceneMesh *removing = tests[0];
         SceneMesh *removing = tests[0];
         tests.erase(tests.begin());
         tests.erase(tests.begin());
@@ -90,7 +90,7 @@ bool PolycodeTemplateApp::Update() {
         scene->addChild(test);
         scene->addChild(test);
         tests.push_back(test);
         tests.push_back(test);
     }
     }
-    */
+	 
     ++numFrames;
     ++numFrames;
     counter += elapsed;
     counter += elapsed;
     if(counter >= 1.0) {
     if(counter >= 1.0) {

+ 0 - 2
include/Polycode.h

@@ -53,7 +53,6 @@
 #include "polycode/core/PolyImage.h"
 #include "polycode/core/PolyImage.h"
 #include "polycode/core/PolyLabel.h"
 #include "polycode/core/PolyLabel.h"
 #include "polycode/core/PolyFont.h"
 #include "polycode/core/PolyFont.h"
-#include "polycode/core/PolyFontGlyphSheet.h"
 #include "polycode/core/PolyTexture.h"
 #include "polycode/core/PolyTexture.h"
 #include "polycode/core/PolyMaterial.h"
 #include "polycode/core/PolyMaterial.h"
 #include "polycode/core/PolyMesh.h"
 #include "polycode/core/PolyMesh.h"
@@ -77,7 +76,6 @@
 #include "polycode/core/PolySound.h"
 #include "polycode/core/PolySound.h"
 #include "polycode/core/PolySoundManager.h"
 #include "polycode/core/PolySoundManager.h"
 #include "polycode/core/PolySceneSound.h"
 #include "polycode/core/PolySceneSound.h"
-#include "polycode/core/PolySceneImage.h"
 #include "polycode/core/PolyClient.h"
 #include "polycode/core/PolyClient.h"
 #include "polycode/core/PolyPeer.h"
 #include "polycode/core/PolyPeer.h"
 #include "polycode/core/PolyServer.h"
 #include "polycode/core/PolyServer.h"

Файловите разлики са ограничени, защото са твърде много
+ 110 - 683
include/polycode/bindings/javascript/PolycodeJSWrappers.h


Файловите разлики са ограничени, защото са твърде много
+ 117 - 713
include/polycode/bindings/lua/PolycodeLuaWrappers.h


+ 5 - 5
include/polycode/core/PolyCamera.h

@@ -189,13 +189,13 @@ namespace Polycode {
 			/**
 			/**
 			 * Binds target buffers and renders the scene in multiple passes based on the post filter material.
 			 * Binds target buffers and renders the scene in multiple passes based on the post filter material.
 			 */
 			 */
-			void drawFilter(RenderBuffer *targetBuffer);
+			void drawFilter(std::shared_ptr<RenderBuffer> targetBuffer);
 
 
 			/**
 			/**
 			* Sets the post-processing shader for the camera.
 			* Sets the post-processing shader for the camera.
 			* @param shaderMaterial Post processing shader material.
 			* @param shaderMaterial Post processing shader material.
 			*/
 			*/
-			void setPostFilter(Material *material);
+			void setPostFilter(std::shared_ptr<Material> material);
 			
 			
 			/**
 			/**
 			* Sets the post-processing shader for the camera by name. The material needs have been added as a resource.
 			* Sets the post-processing shader for the camera by name. The material needs have been added as a resource.
@@ -211,7 +211,7 @@ namespace Polycode {
 			/**
 			/**
 			* Returns the shader material applied to the camera.
 			* Returns the shader material applied to the camera.
 			*/			
 			*/			
-			Material *getScreenShaderMaterial() { return filterShaderMaterial; }	
+			std::shared_ptr<Material> getScreenShaderMaterial() { return filterShaderMaterial; }
 
 
 			/**
 			/**
 			 * Clones the camera.
 			 * Clones the camera.
@@ -308,8 +308,8 @@ namespace Polycode {
 
 
 			Scene *parentScene;
 			Scene *parentScene;
 
 
-			Material *filterShaderMaterial;			
-			RenderBuffer *originalFramebuffer;
+			std::shared_ptr<Material> filterShaderMaterial;
+			std::shared_ptr<RenderBuffer> originalFramebuffer;
 		
 		
 			bool _hasFilterShader;
 			bool _hasFilterShader;
 	};	
 	};	

+ 2 - 11
include/polycode/core/PolyCoreServices.h

@@ -23,8 +23,8 @@ THE SOFTWARE.
 #pragma once
 #pragma once
 #include "polycode/core/PolyGlobals.h"
 #include "polycode/core/PolyGlobals.h"
 #include "polycode/core/PolyString.h"
 #include "polycode/core/PolyString.h"
+#include "polycode/core/PolyRectangle.h"
 #include "polycode/core/PolyEventDispatcher.h"
 #include "polycode/core/PolyEventDispatcher.h"
-#include "polycode/core/PolyMaterialManager.h"
 #include <map>
 #include <map>
 
 
 namespace Polycode {
 namespace Polycode {
@@ -86,15 +86,7 @@ namespace Polycode {
 			 */
 			 */
 			CoreInput *getInput();
 			CoreInput *getInput();
 			
 			
-			void handleEvent(Event *event);
-
-			/**
-			* Returns the material manager. The material manager is responsible for loading and managing textures, shaders and materials.
-			* @return Material manager.
-			* @see MaterialManager
-			*/
-			MaterialManager *getMaterialManager();
-			
+			void handleEvent(Event *event);		
 			
 			
 			/**
 			/**
 			* Returns the scene manager. The screen manager is responsible for maintaining and rendering 3D scenes.
 			* Returns the scene manager. The screen manager is responsible for maintaining and rendering 3D scenes.
@@ -160,7 +152,6 @@ namespace Polycode {
 					
 					
 			Core *core;
 			Core *core;
 			Config *config;
 			Config *config;
-			MaterialManager *materialManager;
 			SceneManager *sceneManager;
 			SceneManager *sceneManager;
 			Logger *logger;
 			Logger *logger;
 			TimerManager *timerManager;
 			TimerManager *timerManager;

+ 10 - 5
include/polycode/core/PolyCubemap.h

@@ -30,10 +30,15 @@ namespace Polycode {
 
 
 	class _PolyExport Cubemap : public Resource {
 	class _PolyExport Cubemap : public Resource {
 		public:
 		public:
-			Cubemap(Texture *t0, Texture *t1, Texture *t2, Texture *t3, Texture *t4, Texture *t5);
-			
-			Texture *getTexture(int index);			
-			void setTexture(Texture *texture, int index);
+			Cubemap(std::shared_ptr<Texture> t0,
+					std::shared_ptr<Texture> t1,
+					std::shared_ptr<Texture> t2,
+					std::shared_ptr<Texture> t3,
+					std::shared_ptr<Texture> t4,
+					std::shared_ptr<Texture> t5);
+		
+			std::shared_ptr<Texture> getTexture(int index);			
+			void setTexture(std::shared_ptr<Texture>, int index);
 			
 			
 			virtual void recreateFromTextures(){}
 			virtual void recreateFromTextures(){}
 			
 			
@@ -48,7 +53,7 @@ namespace Polycode {
 																	
 																	
 		protected:
 		protected:
 		
 		
-			std::vector<Texture*> textures;
+			std::vector<std::shared_ptr<Texture> > textures;
 		
 		
 	};
 	};
 }
 }

+ 0 - 88
include/polycode/core/PolyFontGlyphSheet.h

@@ -1,88 +0,0 @@
-
-#pragma once
-#include "polycode/core/PolyGlobals.h"
-#define generic GenericFreetypeLibrary
-#include "ft2build.h"
-#include FT_FREETYPE_H
-#undef generic
-#include "polycode/core/PolyString.h"
-#include "polycode/core/PolyVector2.h"
-#include <vector>
-#include <map>
-#include <set>
-
-
-namespace Polycode {
-	
-	class String;
-	class Texture;
-	class Image;
-	class Font;
-
-	struct FontTextureGlyph {
-		Vector2 offset[4];
-		Vector2 texCoord[4];
-		Vector2 advance;
-	};
-
-	/** Wraps a sheet of rendered font glyphs on a Texture.
-	 *	Use in combination with TextMesh to render text from minimal texture creation. */
-	class _PolyExport FontGlyphSheet : public PolyBase {
-		public:
-
-			enum FontTextureGlyphMode {
-				/** Regular anti-aliased font rendering. Colour is pure-white for clean custom tinting with an alpha channel. */
-				ANTIALIAS,
-				/** Using distance-from-edge calculation as described in the Valve paper.
-				 *
-				 *	"Improved Alpha-Tested Magnification for Vector Textures and Special Effects"
-				 *	http://www.valvesoftware.com/publications/2007/SIGGRAPH2007_AlphaTestedMagnification.pdf
-				 *
-				 * To make the most of this:
-				 *	 set renderer->alphaTestValue = 0.5
-				 *	 set sceneMesh->alphaTest = true
-				 *	 set sceneMesh->blendingMode = Renderer::BLEND_MODE_NONE;
-				 *
-				 * Or use a custom shader - alpha values of 0.5 indicate the boundary.
-				 * */
-				ALPHA_TEST
-			};
-
-			FontGlyphSheet(Font* font, int size = 32, FontTextureGlyphMode mode = ANTIALIAS);
-			virtual ~FontGlyphSheet();
-			
-			void setMode(FontTextureGlyphMode mode) { this->mode = mode; }
-			/** Set height of font to be rendered in pixels. */
-			void setSize(int size);
-
-			/** Scans extraCharacters for anything that isn't currently in the rendered sheet and rebuilds the sheet if necessary. */
-			void addGlyphs(String extraCharacters);
-
-			/** Convenience method to build a sheet with all of the visible ASCII characters. */
-			void buildVisibleAscii();
-
-			/** Convenience method to build a sheet of glyphs with one of each of what is in characters. */
-			void buildGlyphs(String characters);
-
-			/** Creates the sheet given a set of characters. */
-			void buildGlyphs(std::set<wchar_t> characters);
-
-			/** Returns the currently rendered characters as a set. */
-			std::set<wchar_t> getCharacters() const;
-
-			/** Used by TextMesh to generate the vertices for the given text into the vertex array.
-				@return the next index after that which was used */
-			//int renderStringVertices(String text, std::vector<Vertex*>& vertices, int index = 0);
-
-			Texture* getTexture() { return texture; }
-
-			int tabWidth;
-			
-		protected:
-			Font* font;
-			FontTextureGlyphMode mode;
-			Texture* texture;
-			std::map<wchar_t,FontTextureGlyph> locations;
-			int size;
-	};
-}

+ 4 - 4
include/polycode/core/PolyGPUDrawBuffer.h

@@ -49,7 +49,7 @@ namespace Polycode {
 			Number spotlightCutoff;
 			Number spotlightCutoff;
 			Number spotlightExponent;
 			Number spotlightExponent;
 			bool shadowsEnabled;
 			bool shadowsEnabled;
-			Texture *shadowMapTexture;
+			std::shared_ptr<Texture> shadowMapTexture;
 			Matrix4 lightViewMatrix;
 			Matrix4 lightViewMatrix;
 	};
 	};
 	
 	
@@ -74,7 +74,7 @@ namespace Polycode {
 		std::shared_ptr<MeshGeometry> submesh;
 		std::shared_ptr<MeshGeometry> submesh;
 		GPUDrawOptions options;
 		GPUDrawOptions options;
 		Matrix4 modelMatrix;
 		Matrix4 modelMatrix;
-		Material *material;
+		std::shared_ptr<Material> material;
 		std::vector<ShaderPass> shaderPasses;
 		std::vector<ShaderPass> shaderPasses;
 	};
 	};
 	
 	
@@ -83,7 +83,7 @@ namespace Polycode {
 		GPUDrawBuffer();
 		GPUDrawBuffer();
 		~GPUDrawBuffer();
 		~GPUDrawBuffer();
 		
 		
-		RenderBuffer *targetFramebuffer;
+		std::shared_ptr<RenderBuffer> targetFramebuffer;
 		Matrix4 projectionMatrix;
 		Matrix4 projectionMatrix;
 		Matrix4 viewMatrix;
 		Matrix4 viewMatrix;
 		Matrix4 cameraMatrix;
 		Matrix4 cameraMatrix;
@@ -91,7 +91,7 @@ namespace Polycode {
 		bool clearDepthBuffer;
 		bool clearDepthBuffer;
 		bool clearColorBuffer;
 		bool clearColorBuffer;
 		Vector2 backingResolutionScale;
 		Vector2 backingResolutionScale;
-		Material *globalMaterial;
+		std::shared_ptr<Material> globalMaterial;
 		
 		
 		std::vector<LightInfo> lights;
 		std::vector<LightInfo> lights;
 		
 		

+ 5 - 5
include/polycode/core/PolyLabel.h

@@ -25,8 +25,8 @@ THE SOFTWARE.
 #include "polycode/core/PolyGlobals.h"
 #include "polycode/core/PolyGlobals.h"
 #include "polycode/core/PolyColor.h"
 #include "polycode/core/PolyColor.h"
 #include "polycode/core/PolyImage.h"
 #include "polycode/core/PolyImage.h"
-
 #include "polycode/core/PolyFont.h"
 #include "polycode/core/PolyFont.h"
+#include <memory>
 
 
 #include FT_GLYPH_H
 #include FT_GLYPH_H
 #include FT_IMAGE_H
 #include FT_IMAGE_H
@@ -74,7 +74,7 @@ namespace Polycode {
 			 * @param premultiplyAlpha If set to true, will premultiply alpha in the label image.
 			 * @param premultiplyAlpha If set to true, will premultiply alpha in the label image.
 			 * @see Font
 			 * @see Font
 			 */
 			 */
-			Label(Font *font, const String& text, int size, int antiAliasMode, bool premultiplyAlpha = false, const Color &backgroundColor = Color(0.0, 0.0, 0.0, 0.0), const Color &foregroundColor = Color(1.0, 1.0, 1.0, 1.0));
+			Label(std::shared_ptr<Font> font, const String& text, int size, int antiAliasMode, bool premultiplyAlpha = false, const Color &backgroundColor = Color(0.0, 0.0, 0.0, 0.0), const Color &foregroundColor = Color(1.0, 1.0, 1.0, 1.0));
 			virtual ~Label();
 			virtual ~Label();
 		
 		
 			/**
 			/**
@@ -149,13 +149,13 @@ namespace Polycode {
 			 * Sets the Font used to render text in the label.
 			 * Sets the Font used to render text in the label.
 			 * @see Font
 			 * @see Font
 			 */
 			 */
-			void setFont(Font *newFont);
+			void setFont(std::shared_ptr<Font> newFont);
 		
 		
 			/**
 			/**
 			 * Returns the Font currently used to render text in the label.
 			 * Returns the Font currently used to render text in the label.
 			 * @see Font
 			 * @see Font
 			 */
 			 */
-			Font *getFont() const;
+			std::shared_ptr<Font> getFont() const;
 			
 			
 			/**
 			/**
 			 * Sets the vertical pixel size of text rendered in the label.
 			 * Sets the vertical pixel size of text rendered in the label.
@@ -221,7 +221,7 @@ namespace Polycode {
 			int antiAliasMode;
 			int antiAliasMode;
 			int size;
 			int size;
 			String text;
 			String text;
-			Font *font;
+			std::shared_ptr<Font> font;
 	};
 	};
 
 
 }
 }

+ 10 - 21
include/polycode/core/PolyMaterial.h

@@ -24,8 +24,10 @@ THE SOFTWARE.
 #include "polycode/core/PolyString.h"
 #include "polycode/core/PolyString.h"
 #include "polycode/core/PolyGlobals.h"
 #include "polycode/core/PolyGlobals.h"
 #include "polycode/core/PolyResource.h"
 #include "polycode/core/PolyResource.h"
+#include "polycode/core/PolyResourceManager.h"
 #include "polycode/core/PolyColor.h"
 #include "polycode/core/PolyColor.h"
 #include <vector>
 #include <vector>
+#include <memory>
 
 
 namespace Polycode {
 namespace Polycode {
 	
 	
@@ -41,11 +43,11 @@ namespace Polycode {
 			ShaderPass(Shader *shader);
 			ShaderPass(Shader *shader);
 			ShaderPass(const ShaderPass &other);
 			ShaderPass(const ShaderPass &other);
 			~ShaderPass();
 			~ShaderPass();
-			Shader *shader;
+			std::shared_ptr<Shader> shader;
 			bool wireframe;
 			bool wireframe;
 			unsigned short blendingMode;
 			unsigned short blendingMode;
-			ShaderBinding* shaderBinding;
-			ShaderBinding* materialShaderBinding;
+			std::shared_ptr<ShaderBinding> shaderBinding;
+			std::shared_ptr<ShaderBinding> materialShaderBinding;
 	};
 	};
 
 
 	class _PolyExport Material : public Resource {
 	class _PolyExport Material : public Resource {
@@ -54,32 +56,22 @@ namespace Polycode {
 			virtual ~Material();
 			virtual ~Material();
 
 
 			void addShaderPass(const ShaderPass &pass);
 			void addShaderPass(const ShaderPass &pass);
-			void addShaderPassAtIndex(const ShaderPass &pass, unsigned int shaderIndex);
-		
-			/* DEPRECATED! Use addShaderPass! */
-			void addShader(Shader *shader,ShaderBinding *shaderBinding);
-			/* DEPRECATED! Use addShaderPassAtIndex! */
-			void addShaderAtIndex(Shader *shader,ShaderBinding *shaderBinding, int shaderIndex);			
+			void addShaderPassAtIndex(const ShaderPass &pass, unsigned int shaderIndex);	
 			unsigned int getNumShaderPasses() const;
 			unsigned int getNumShaderPasses() const;
-			
 		
 		
 			void removeShaderPass(int shaderIndex);
 			void removeShaderPass(int shaderIndex);
-			
-			void recreateExpectedShaderParams();
-		
+
 			void addShaderRenderTarget(ShaderRenderTarget *newTarget);
 			void addShaderRenderTarget(ShaderRenderTarget *newTarget);
 			int getNumShaderRenderTargets();
 			int getNumShaderRenderTargets();
 			ShaderRenderTarget *getShaderRenderTarget(unsigned int index);
 			ShaderRenderTarget *getShaderRenderTarget(unsigned int index);
 			void removeShaderRenderTarget(int index);
 			void removeShaderRenderTarget(int index);
-			void recreateRenderTarget(ShaderRenderTarget *renderTarget);	
+			void recreateRenderTarget(ShaderRenderTarget *renderTarget);
 			void recreateRenderTargets();
 			void recreateRenderTargets();
-			
-			void handleEvent(Event *event);
 						
 						
 			const String& getName() const;
 			const String& getName() const;
 			ShaderPass getShaderPass(unsigned int index) const;
 			ShaderPass getShaderPass(unsigned int index) const;
-			ShaderBinding *getShaderBinding(unsigned int index) const;
-			Shader *getShader(unsigned int index) const;
+			std::shared_ptr<ShaderBinding> getShaderBinding(unsigned int index) const;
+			std::shared_ptr<Shader> getShader(unsigned int index) const;
 		
 		
 			void loadMaterial(const String& fileName);
 			void loadMaterial(const String& fileName);
 			
 			
@@ -88,9 +80,6 @@ namespace Polycode {
 			void clearShaders();
 			void clearShaders();
 							
 							
 			bool fp16RenderTargets;
 			bool fp16RenderTargets;
-			
-			void *shaderModule;
-			
 			int blendingMode;
 			int blendingMode;
 			bool screenMaterial;
 			bool screenMaterial;
 			
 			

+ 0 - 110
include/polycode/core/PolyMaterialManager.h

@@ -1,110 +0,0 @@
-/*
-Copyright (C) 2011 by Ivan Safrin
-
-Permission is hereby granted, free of charge, to any person obtaining a copy
-of this software and associated documentation files (the "Software"), to deal
-in the Software without restriction, including without limitation the rights
-to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-copies of the Software, and to permit persons to whom the Software is
-furnished to do so, subject to the following conditions:
-
-The above copyright notice and this permission notice shall be included in
-all copies or substantial portions of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
-OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
-THE SOFTWARE.
-*/
- 
-#pragma once
-#include "polycode/core/PolyGlobals.h"
-#include "polycode/core/PolyImage.h"
-#include "polycode/core/PolyObject.h"
-#include "polycode/core/PolyShader.h"
-#include <vector>
-
-class TiXmlNode;
-
-namespace Polycode {
-	
-	class Cubemap;
-	class Material;
-	class Texture;
-	class SceneRenderTexture;
-	class Shader;
-	class String;
-	class ShaderProgram;
-	class ResourcePool;
-	
-	/**
-	* Manages loading and reloading of materials, textures and shaders. This class should be only accessed from the CoreServices singleton.
-	*/
-	class _PolyExport MaterialManager : public PolyBase {
-		public:
-			MaterialManager();
-			~MaterialManager();
-			
-			void Update(int elapsed);
-
-			Texture *createTexture(int width, int height, char *imageData, bool clamp=true, bool createMipmaps = false, int type=Image::IMAGE_RGBA);
-			Texture *createNewTexture(int width, int height, bool clamp=true, bool createMipmaps = false, int type=Image::IMAGE_RGBA);
-			Texture *createTextureFromImage(Image *image, bool clamp=true, bool createMipmaps = false);
-			Texture *createTextureFromFile(const String& fileName, bool clamp=true, bool createMipmaps = false, ResourcePool *resourcePool = NULL);
-			void deleteTexture(Texture *texture);
-		
-			void reloadTextures();
-			
-			void reloadProgramsAndTextures();
-			void reloadPrograms();
-		
-			Texture *getTextureByResourcePath(const String& resourcePath) const;
-			ShaderProgram *createProgramFromFile(String programPath);			
-			void loadMaterialLibraryIntoPool(ResourcePool *pool, const String &materialFile);
-		
-			// cubemaps
-		
-			Cubemap *cubemapFromXMLNode(TiXmlNode *node);
-		
-			// materials
-			Material *materialFromXMLNode(ResourcePool *resourcePool, TiXmlNode *node);
-			
-			Material *createMaterial(ResourcePool *resourcePool, String materialName, String shaderName);
-			
-			Shader *setShaderFromXMLNode(ResourcePool *resourcePool, TiXmlNode *node);
-			Shader *createShaderFromXMLNode(ResourcePool *resourcePool, TiXmlNode *node);
-			Shader *createShader(ResourcePool *resourcePool, String shaderType, String name, String vpName, String fpName, bool screenShader);
-		
-			std::vector<Material*> loadMaterialsFromFile(ResourcePool *resourcePool, const String &fileName);
-			std::vector<Shader*> loadShadersFromFile(ResourcePool *resourcePool, String fileName);
-			std::vector<Cubemap*> loadCubemapsFromFile(String fileName);
-		
-			void setAnisotropyAmount(unsigned int anisotropy);
-			void setTextureFilteringMode(unsigned int textureFilteringMode);
-			unsigned int getTextureFilteringMode();
-						
-			void addMaterial(Material *material);
-			void addShader(Shader *shader);
-		
-			unsigned int getNumShaders();
-			Shader *getShaderByIndex(unsigned int index);
-		
-			bool premultiplyAlphaOnLoad;
-			bool clampDefault;
-			bool mipmapsDefault;
-			bool keepTextureData;
-			
-		private:
-		
-			unsigned int textureFilteringMode;
-			unsigned int anisotropyAmount;
-		
-			std::vector<Texture*> textures;
-			std::vector<Material*> materials;
-			std::vector<Shader*> shaders;
-
-	};
-};

+ 15 - 7
include/polycode/core/PolyOpenGLGraphicsInterface.h

@@ -72,8 +72,16 @@ THE SOFTWARE.
 #endif
 #endif
 
 
 namespace Polycode {
 namespace Polycode {
+	
+	class ShaderPlatformData {
+		public:
+			GLuint shaderID;
+			GLuint vertexProgramID;
+			GLuint fragmentProgramID;
+			std::vector<GLuint*> expectedData;
+	};
+	
 	class _PolyExport OpenGLGraphicsInterface : public GraphicsInterface {
 	class _PolyExport OpenGLGraphicsInterface : public GraphicsInterface {
-		
 	public:
 	public:
 		
 		
 		OpenGLGraphicsInterface();
 		OpenGLGraphicsInterface();
@@ -82,7 +90,6 @@ namespace Polycode {
 		// implementation
 		// implementation
 		
 		
 		void createTexture(Texture *texture);
 		void createTexture(Texture *texture);
-		void destroyTexture(Texture *texture);
 		
 		
 		void setViewport(unsigned int x,unsigned  int y,unsigned  int width, unsigned height);
 		void setViewport(unsigned int x,unsigned  int y,unsigned  int width, unsigned height);
 		void clearBuffers(const Color &clearColor, bool colorBuffer, bool depthBuffer, bool stencilBuffer);
 		void clearBuffers(const Color &clearColor, bool colorBuffer, bool depthBuffer, bool stencilBuffer);
@@ -92,23 +99,24 @@ namespace Polycode {
 		void useShader(Shader *shader);
 		void useShader(Shader *shader);
 		
 		
 		void createProgram(ShaderProgram *program);
 		void createProgram(ShaderProgram *program);
-		void destroyProgram(ShaderProgram *program);
-		
 		void createShader(Shader *shader);
 		void createShader(Shader *shader);
-		void destroyShader(Shader *shader);
 		
 		
 		void beginDrawCall();
 		void beginDrawCall();
 		void endDrawCall();
 		void endDrawCall();
 		void setBlendingMode(unsigned int blendingMode);
 		void setBlendingMode(unsigned int blendingMode);
 		
 		
 		void createRenderBuffer(RenderBuffer *renderBuffer);
 		void createRenderBuffer(RenderBuffer *renderBuffer);
-		void destroyRenderBuffer(RenderBuffer *renderBuffer);
 		void bindRenderBuffer(RenderBuffer *renderBuffer);
 		void bindRenderBuffer(RenderBuffer *renderBuffer);
 		
 		
 		void createSubmeshBuffers(MeshGeometry *submesh);
 		void createSubmeshBuffers(MeshGeometry *submesh);
-		void destroySubmeshBufferData(void *platformData);
 		void drawSubmeshBuffers(MeshGeometry *submesh, Shader *shader);
 		void drawSubmeshBuffers(MeshGeometry *submesh, Shader *shader);
 		
 		
+		void destroySubmeshBufferData(void *platformData);
+		void destroyProgramData(void *platformData);
+		void destroyShaderData(void *platformData);
+		void destroyTextureData(void *platformData);
+		void destroyRenderBufferData(void *platformData);
+		
 		void drawIndices(int type, IndexDataArray *indexArray);
 		void drawIndices(int type, IndexDataArray *indexArray);
 		void drawArrays(int type, unsigned int vertexCount);
 		void drawArrays(int type, unsigned int vertexCount);
 		
 		

+ 28 - 45
include/polycode/core/PolyRenderer.h

@@ -52,21 +52,23 @@ namespace Polycode {
 			virtual void setAttributeInShader(Shader *shader, ProgramAttribute *attribute, AttributeBinding *attributeBinding) = 0;
 			virtual void setAttributeInShader(Shader *shader, ProgramAttribute *attribute, AttributeBinding *attributeBinding) = 0;
 			virtual void disableAttribute(Shader *shader, const ProgramAttribute &attribute) = 0;
 			virtual void disableAttribute(Shader *shader, const ProgramAttribute &attribute) = 0;
 			virtual void createTexture(Texture *texture) = 0;
 			virtual void createTexture(Texture *texture) = 0;
-			virtual void destroyTexture(Texture *texture) = 0;
 		
 		
 			virtual void setViewport(unsigned int x,unsigned  int y,unsigned  int width, unsigned height) = 0;
 			virtual void setViewport(unsigned int x,unsigned  int y,unsigned  int width, unsigned height) = 0;
 			virtual void clearBuffers(const Color &clearColor, bool colorBuffer, bool depthBuffer, bool stencilBuffer) = 0;
 			virtual void clearBuffers(const Color &clearColor, bool colorBuffer, bool depthBuffer, bool stencilBuffer) = 0;
 			virtual void createProgram(ShaderProgram *program) = 0;
 			virtual void createProgram(ShaderProgram *program) = 0;
-			virtual void destroyProgram(ShaderProgram *program) = 0;
 
 
-			virtual void destroyShader(Shader *shader) = 0;
 			virtual void createShader(Shader *shader) = 0;
 			virtual void createShader(Shader *shader) = 0;
 			virtual void useShader(Shader *shader) = 0;
 			virtual void useShader(Shader *shader) = 0;
 
 
 			virtual void createSubmeshBuffers(MeshGeometry *submesh) = 0;
 			virtual void createSubmeshBuffers(MeshGeometry *submesh) = 0;
-			virtual void destroySubmeshBufferData(void *platformData) = 0;
 			virtual void drawSubmeshBuffers(MeshGeometry *submesh, Shader *shader) = 0;
 			virtual void drawSubmeshBuffers(MeshGeometry *submesh, Shader *shader) = 0;
 		
 		
+			virtual void destroySubmeshBufferData(void *platformData) = 0;
+			virtual void destroyProgramData(void *platformData) = 0;
+			virtual void destroyShaderData(void *platformData) = 0;
+			virtual void destroyTextureData(void *platformData) = 0;
+			virtual void destroyRenderBufferData(void *platformData) = 0;
+		
 			virtual void enableDepthTest(bool val) = 0;
 			virtual void enableDepthTest(bool val) = 0;
 			virtual void enableDepthWrite(bool val) = 0;
 			virtual void enableDepthWrite(bool val) = 0;
 			virtual void setBlendingMode(unsigned int blendingMode) = 0;
 			virtual void setBlendingMode(unsigned int blendingMode) = 0;
@@ -79,7 +81,6 @@ namespace Polycode {
 			virtual void setWireframeMode(bool val) = 0;
 			virtual void setWireframeMode(bool val) = 0;
 		
 		
 			virtual void createRenderBuffer(RenderBuffer *renderBuffer) = 0;
 			virtual void createRenderBuffer(RenderBuffer *renderBuffer) = 0;
-			virtual void destroyRenderBuffer(RenderBuffer *renderBuffer) = 0;
 			virtual void bindRenderBuffer(RenderBuffer *buffer) = 0;
 			virtual void bindRenderBuffer(RenderBuffer *buffer) = 0;
 		
 		
 			virtual void beginDrawCall() = 0;
 			virtual void beginDrawCall() = 0;
@@ -102,22 +103,22 @@ namespace Polycode {
 
 
 	class LightInfoBinding {
 	class LightInfoBinding {
 		public:
 		public:
-			LocalShaderParam *position;
-			LocalShaderParam *direction;
-			LocalShaderParam *specular;
-			LocalShaderParam *diffuse;
-			LocalShaderParam *spotExponent;
-			LocalShaderParam *spotCosCutoff;
-			LocalShaderParam *constantAttenuation;
-			LocalShaderParam *linearAttenuation;
-			LocalShaderParam *quadraticAttenuation;
-			LocalShaderParam *shadowEnabled;
+			std::shared_ptr<LocalShaderParam> position;
+			std::shared_ptr<LocalShaderParam> direction;
+			std::shared_ptr<LocalShaderParam> specular;
+			std::shared_ptr<LocalShaderParam> diffuse;
+			std::shared_ptr<LocalShaderParam> spotExponent;
+			std::shared_ptr<LocalShaderParam> spotCosCutoff;
+			std::shared_ptr<LocalShaderParam> constantAttenuation;
+			std::shared_ptr<LocalShaderParam> linearAttenuation;
+			std::shared_ptr<LocalShaderParam> quadraticAttenuation;
+			std::shared_ptr<LocalShaderParam> shadowEnabled;
 	};
 	};
 	
 	
 	class LightShadowInfoBinding {
 	class LightShadowInfoBinding {
 	public:
 	public:
-		LocalShaderParam *shadowMatrix;
-		LocalShaderParam *shadowBuffer;
+		std::shared_ptr<LocalShaderParam> shadowMatrix;
+		std::shared_ptr<LocalShaderParam> shadowBuffer;
 	};
 	};
 	
 	
 	class _PolyExport RenderFrame : public PolyBase {
 	class _PolyExport RenderFrame : public PolyBase {
@@ -131,7 +132,8 @@ namespace Polycode {
 			RenderThread();
 			RenderThread();
 			 void setGraphicsInterface(Core *core, GraphicsInterface *graphicsInterface);
 			 void setGraphicsInterface(Core *core, GraphicsInterface *graphicsInterface);
 			virtual void runThread();
 			virtual void runThread();
-		void updateRenderThread();	 
+		
+			void updateRenderThread();
 			void enqueueFrame(RenderFrame *frame);
 			void enqueueFrame(RenderFrame *frame);
 		
 		
 			void enqueueJob(int jobType, void *data, void *data2=NULL);
 			void enqueueJob(int jobType, void *data, void *data2=NULL);
@@ -142,30 +144,22 @@ namespace Polycode {
 			void processDrawBufferLights(GPUDrawBuffer *buffer);
 			void processDrawBufferLights(GPUDrawBuffer *buffer);
 			void processDrawBuffer(GPUDrawBuffer *buffer);
 			void processDrawBuffer(GPUDrawBuffer *buffer);
 			RenderThreadDebugInfo getFrameInfo();
 			RenderThreadDebugInfo getFrameInfo();
-		
-			void clearFrameQueue();
-		
+				
 			void initGlobals();
 			void initGlobals();
 		
 		
 			void lockRenderMutex();
 			void lockRenderMutex();
 			void unlockRenderMutex();
 			void unlockRenderMutex();
 		
 		
 			static const int JOB_REQUEST_CONTEXT_CHANGE = 0;
 			static const int JOB_REQUEST_CONTEXT_CHANGE = 0;
-			static const int JOB_CREATE_TEXTURE = 1;
 			static const int JOB_PROCESS_DRAW_BUFFER = 2;
 			static const int JOB_PROCESS_DRAW_BUFFER = 2;
 			static const int JOB_END_FRAME = 3;
 			static const int JOB_END_FRAME = 3;
-			static const int JOB_CREATE_PROGRAM = 4;
-			static const int JOB_CREATE_SHADER = 5;
 			static const int JOB_BEGIN_FRAME = 6;
 			static const int JOB_BEGIN_FRAME = 6;
 			static const int JOB_DESTROY_TEXTURE = 8;
 			static const int JOB_DESTROY_TEXTURE = 8;
 			static const int JOB_DESTROY_SHADER = 9;
 			static const int JOB_DESTROY_SHADER = 9;
 			static const int JOB_DESTROY_PROGRAM = 10;
 			static const int JOB_DESTROY_PROGRAM = 10;
 			static const int JOB_DESTROY_SUBMESH_BUFFER = 11;
 			static const int JOB_DESTROY_SUBMESH_BUFFER = 11;
-			static const int JOB_CREATE_RENDER_BUFFER = 12;
 			static const int JOB_DESTROY_RENDER_BUFFER = 13;
 			static const int JOB_DESTROY_RENDER_BUFFER = 13;
 			static const int JOB_SET_TEXTURE_PARAM = 14;
 			static const int JOB_SET_TEXTURE_PARAM = 14;
-			static const int JOB_DESTROY_SHADER_BINDING = 16;
-			static const int JOB_DESTROY_SHADER_PARAM = 17;
 		
 		
 		protected:
 		protected:
 		
 		
@@ -184,9 +178,9 @@ namespace Polycode {
 			GraphicsInterface *graphicsInterface;
 			GraphicsInterface *graphicsInterface;
 		
 		
 			ShaderBinding *rendererShaderBinding;
 			ShaderBinding *rendererShaderBinding;
-			LocalShaderParam *projectionMatrixParam;
-			LocalShaderParam *viewMatrixParam;
-			LocalShaderParam *modelMatrixParam;
+			std::shared_ptr<LocalShaderParam> projectionMatrixParam;
+			std::shared_ptr<LocalShaderParam>  viewMatrixParam;
+			std::shared_ptr<LocalShaderParam>  modelMatrixParam;
 		
 		
 			LightInfoBinding lights[RENDERER_MAX_LIGHTS];
 			LightInfoBinding lights[RENDERER_MAX_LIGHTS];
 			LightShadowInfoBinding lightShadows[RENDERER_MAX_LIGHT_SHADOWS];
 			LightShadowInfoBinding lightShadows[RENDERER_MAX_LIGHT_SHADOWS];
@@ -201,31 +195,20 @@ namespace Polycode {
 		
 		
 		RenderThread *getRenderThread();
 		RenderThread *getRenderThread();
 
 
-		Cubemap *createCubemap(Texture *t0, Texture *t1, Texture *t2, Texture *t3, Texture *t4, Texture *t5);
-		Texture *createTexture(unsigned int width, unsigned int height, char *textureData, bool clamp, bool createMipmaps, int type, unsigned int filteringMode, unsigned int anisotropy, bool framebufferTexture);
-		
-		RenderBuffer *createRenderBuffer(unsigned int width, unsigned int height, bool attachDepthBuffer, bool floatingPoint);
-		void destroyRenderBuffer(RenderBuffer *buffer);
-		
-		void destroyTexture(Texture *texture);
-
 		void processDrawBuffer(GPUDrawBuffer *buffer);
 		void processDrawBuffer(GPUDrawBuffer *buffer);
 		
 		
 		void setBackingResolutionScale(Number xScale, Number yScale);
 		void setBackingResolutionScale(Number xScale, Number yScale);
 		Number getBackingResolutionScaleX();
 		Number getBackingResolutionScaleX();
 		Number getBackingResolutionScaleY();
 		Number getBackingResolutionScaleY();
-		ShaderProgram *createProgram(const String &fileName);
-		Shader *createShader(ShaderProgram *vertexProgram, ShaderProgram *fragmentProgram);
 		
 		
 		void enqueueFrameJob(int jobType, void *data);
 		void enqueueFrameJob(int jobType, void *data);
 		
 		
-		void destroyProgram(ShaderProgram *program);
-		void destroyShader(Shader *shader);
+		void destroyRenderBufferPlatformData(void *platformData);
+		void destroyTexturePlatformData(void *platformData);
+		void destroyProgramPlatformData(void *platformData);
+		void destroyShaderPlatformData(void *platformData);
 		void destroySubmeshPlatformData(void *platformData);
 		void destroySubmeshPlatformData(void *platformData);
 		
 		
-		void destroyShaderBinding(ShaderBinding *binding);
-		void destroyShaderParam(LocalShaderParam *param);
-		
 		void setTextureParam(LocalShaderParam *param, Texture *texture);
 		void setTextureParam(LocalShaderParam *param, Texture *texture);
 		
 		
 		void setAnisotropyAmount(Number amount);
 		void setAnisotropyAmount(Number amount);

+ 32 - 20
include/polycode/core/PolyResourceManager.h

@@ -25,7 +25,7 @@ THE SOFTWARE.
 #include "polycode/core/PolyGlobals.h"
 #include "polycode/core/PolyGlobals.h"
 #include "polycode/core/PolyEventDispatcher.h"
 #include "polycode/core/PolyEventDispatcher.h"
 #include <vector>
 #include <vector>
-
+#include "tinyxml.h"
 #define generic GenericFreetypeLibrary
 #define generic GenericFreetypeLibrary
 #include "ft2build.h"
 #include "ft2build.h"
 #include FT_FREETYPE_H
 #include FT_FREETYPE_H
@@ -40,14 +40,18 @@ extern "C" {
 	#include "duktape.h"
 	#include "duktape.h"
 }
 }
 
 
+#include <memory>
+
 #define RESOURCE_CHECK_INTERVAL 2000
 #define RESOURCE_CHECK_INTERVAL 2000
 
 
 namespace Polycode {
 namespace Polycode {
 
 
 	class Resource;
 	class Resource;
-	class PolycodeShaderModule;
 	class String;
 	class String;
 	class ResourceLoader;
 	class ResourceLoader;
+	class Shader;
+	class Cubemap;
+	class Material;
 	
 	
 	class _PolyExport ResourcePool : public EventDispatcher {
 	class _PolyExport ResourcePool : public EventDispatcher {
 		public:
 		public:
@@ -56,23 +60,24 @@ namespace Polycode {
 		
 		
 			void setFallbackPool(ResourcePool *pool);
 			void setFallbackPool(ResourcePool *pool);
 		
 		
-			void addResource(Resource *resource);
-			void removeResource(Resource *resource);
-			bool hasResource(Resource *resource);
+			void addResource(std::shared_ptr<Resource> resource);
+			void removeResource(std::shared_ptr<Resource> resource);
+			bool hasResource(std::shared_ptr<Resource> resource);
 		
 		
 			void loadResourcesFromFolder(const String &folder, bool recursive);
 			void loadResourcesFromFolder(const String &folder, bool recursive);
+			void loadResourcesFromMaterialFile(const String &path);
 		
 		
-			Resource *loadResource(const String &path);
-			Resource *loadResourceWithName(const String &path, const String &name);
+			std::shared_ptr<Resource> loadResource(const String &path);
+			std::shared_ptr<Resource> loadResourceWithName(const String &path, const String &name);
 		
 		
-			Resource *getResource(int resourceType, const String& resourceName) const;
+			std::shared_ptr<Resource> getResource(int resourceType, const String& resourceName) const;
 			String getName();
 			String getName();
 			void setName(const String &name);
 			void setName(const String &name);
 		
 		
-			Resource *getResourceByPath(const String& resourcePath) const;
+			std::shared_ptr<Resource> getResourceByPath(const String& resourcePath) const;
 			void Update(int elapsed);
 			void Update(int elapsed);
 		
 		
-			std::vector<Resource *> getResources(int resourceType);
+			std::vector<std::shared_ptr<Resource> > getResources(int resourceType);
 		
 		
 			void checkForChangedFiles();
 			void checkForChangedFiles();
 		
 		
@@ -88,10 +93,17 @@ namespace Polycode {
 		
 		
 			void loadResourcesFromFolderWithLoader(const String &folder, bool recursive, ResourceLoader *loader, const String &containingFolder);
 			void loadResourcesFromFolderWithLoader(const String &folder, bool recursive, ResourceLoader *loader, const String &containingFolder);
 		
 		
+			void loadShadersFromFile(const String &fileName);
+			std::shared_ptr<Shader> createShaderFromXMLNode(TiXmlNode *node);
+			std::shared_ptr<Cubemap> cubemapFromXMLNode(TiXmlNode *node);
+			void loadCubemapsFromFile(const String &fileName);
+			void loadMaterialsFromFile(const String &fileName);
+			std::shared_ptr<Material> materialFromXMLNode(TiXmlNode *node);
+
 			ResourcePool *fallbackPool;
 			ResourcePool *fallbackPool;
 			String name;
 			String name;
 			int ticksSinceCheck;
 			int ticksSinceCheck;
-			std::vector <Resource*> resources;
+			std::vector <std::shared_ptr<Resource> > resources;
 		
 		
 	};
 	};
 	
 	
@@ -99,33 +111,33 @@ namespace Polycode {
 		public:
 		public:
 			virtual ~ResourceLoader() {}
 			virtual ~ResourceLoader() {}
 			bool canHandleExtension(const String &extension);
 			bool canHandleExtension(const String &extension);
-			virtual Resource *loadResource(const String &path, ResourcePool *targetPool) = 0;
+			virtual std::shared_ptr<Resource> loadResource(const String &path, ResourcePool *targetPool) = 0;
 			std::vector<String> extensions;
 			std::vector<String> extensions;
 	};
 	};
 	
 	
 	class _PolyExport TextureResourceLoader : public ResourceLoader {
 	class _PolyExport TextureResourceLoader : public ResourceLoader {
 		public:
 		public:
 			TextureResourceLoader();
 			TextureResourceLoader();
-			Resource *loadResource(const String &path, ResourcePool *targetPool);
+			std::shared_ptr<Resource> loadResource(const String &path, ResourcePool *targetPool);
 	};
 	};
 	
 	
 	class _PolyExport ProgramResourceLoader : public ResourceLoader {
 	class _PolyExport ProgramResourceLoader : public ResourceLoader {
 	public:
 	public:
 		ProgramResourceLoader();
 		ProgramResourceLoader();
-		Resource *loadResource(const String &path, ResourcePool *targetPool);
+		std::shared_ptr<Resource> loadResource(const String &path, ResourcePool *targetPool);
 	};
 	};
 
 
 	class _PolyExport MaterialResourceLoader : public ResourceLoader {
 	class _PolyExport MaterialResourceLoader : public ResourceLoader {
 	public:
 	public:
 			MaterialResourceLoader();
 			MaterialResourceLoader();
-			Resource *loadResource(const String &path, ResourcePool *targetPool);
+			std::shared_ptr<Resource> loadResource(const String &path, ResourcePool *targetPool);
 	};
 	};
 	
 	
 	class _PolyExport FontResourceLoader : public ResourceLoader {
 	class _PolyExport FontResourceLoader : public ResourceLoader {
 	public:
 	public:
 		FontResourceLoader();
 		FontResourceLoader();
 		~FontResourceLoader();
 		~FontResourceLoader();
-		Resource *loadResource(const String &path, ResourcePool *targetPool);
+		std::shared_ptr<Resource> loadResource(const String &path, ResourcePool *targetPool);
 	private:
 	private:
 		FT_Library FTLibrary;
 		FT_Library FTLibrary;
 	};
 	};
@@ -140,7 +152,7 @@ namespace Polycode {
 	public:
 	public:
 		ScriptResourceLoader();
 		ScriptResourceLoader();
 		~ScriptResourceLoader();
 		~ScriptResourceLoader();
-		Resource *loadResource(const String &path, ResourcePool *targetPool);
+		std::shared_ptr<Resource> loadResource(const String &path, ResourcePool *targetPool);
 	private:
 	private:
 		
 		
 		void initJavascript();
 		void initJavascript();
@@ -155,7 +167,7 @@ namespace Polycode {
 	class _PolyExport MeshResourceLoader : public ResourceLoader {
 	class _PolyExport MeshResourceLoader : public ResourceLoader {
 	public:
 	public:
 		MeshResourceLoader();
 		MeshResourceLoader();
-		Resource *loadResource(const String &path, ResourcePool *targetPool);
+		std::shared_ptr<Resource> loadResource(const String &path, ResourcePool *targetPool);
 	};
 	};
 	
 	
 	/**
 	/**
@@ -179,9 +191,9 @@ namespace Polycode {
 			void addResourcePool(ResourcePool *pool);
 			void addResourcePool(ResourcePool *pool);
 			void removeResourcePool(ResourcePool *pool);
 			void removeResourcePool(ResourcePool *pool);
 		
 		
-			std::vector<Resource*> getResources(int resourceType);
+			std::vector<std::shared_ptr<Resource> > getResources(int resourceType);
 		
 		
-			void removeResource(Resource *resource);
+			void removeResource(std::shared_ptr<Resource> resource);
 		
 		
 			void subscribeToResourcePool(ResourcePool *pool);
 			void subscribeToResourcePool(ResourcePool *pool);
 			void unsubscibeFromResourcePool(ResourcePool *pool);
 			void unsubscibeFromResourcePool(ResourcePool *pool);

+ 3 - 3
include/polycode/core/PolyScene.h

@@ -122,9 +122,9 @@ namespace Polycode {
 		bool isEnabled();		
 		bool isEnabled();		
 		void setEnabled(bool enabled);
 		void setEnabled(bool enabled);
 		
 		
-		void Render(Camera *targetCamera, RenderBuffer *targetFramebuffer, Material *overrideMaterial, bool sendLights);
+		void Render(Camera *targetCamera, std::shared_ptr<RenderBuffer> targetFramebuffer, std::shared_ptr<Material> overrideMaterial, bool sendLights);
 		
 		
-		void setOverrideMaterial(Material *material);
+		void setOverrideMaterial(std::shared_ptr<Material> material);
 		
 		
 		void handleEvent(Event *event);
 		void handleEvent(Event *event);
 		
 		
@@ -212,7 +212,7 @@ namespace Polycode {
 		Camera *defaultCamera;
 		Camera *defaultCamera;
 		Camera *activeCamera;
 		Camera *activeCamera;
 		
 		
-		Material *overrideMaterial;
+		std::shared_ptr<Material> overrideMaterial;
 		
 		
 		Core *core;
 		Core *core;
 		
 		

+ 3 - 4
include/polycode/core/PolySceneEntityInstance.h

@@ -67,7 +67,7 @@ class SceneEntityInstance : public Entity {
 	
 	
 		void unlinkResourcePool(ResourcePool *pool);
 		void unlinkResourcePool(ResourcePool *pool);
 	
 	
-		SceneEntityInstanceResourceEntry *getResourceEntry();
+		std::shared_ptr<SceneEntityInstanceResourceEntry> getResourceEntry();
 	
 	
 		ResourcePool *getTopLevelResourcePool();
 		ResourcePool *getTopLevelResourcePool();
 
 
@@ -86,14 +86,13 @@ class SceneEntityInstance : public Entity {
 		
 		
 	protected:
 	protected:
 		
 		
-		std::vector<SceneEntityInstanceLayer*> layers;
-	
+		std::vector<SceneEntityInstanceLayer*> layers;	
 		void rebuildResourceLinks();
 		void rebuildResourceLinks();
 	
 	
 		ResourcePool *topLevelResourcePool;
 		ResourcePool *topLevelResourcePool;
 		std::vector<ResourcePool*> resourcePools;
 		std::vector<ResourcePool*> resourcePools;
 		Scene *parentScene;
 		Scene *parentScene;
-		SceneEntityInstanceResourceEntry *resourceEntry;
+		std::shared_ptr<SceneEntityInstanceResourceEntry> resourceEntry;
 		
 		
 };
 };
 	
 	

+ 0 - 96
include/polycode/core/PolySceneImage.h

@@ -1,96 +0,0 @@
-/*
-Copyright (C) 2011 by Ivan Safrin
-
-Permission is hereby granted, free of charge, to any person obtaining a copy
-of this software and associated documentation files (the "Software"), to deal
-in the Software without restriction, including without limitation the rights
-to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-copies of the Software, and to permit persons to whom the Software is
-furnished to do so, subject to the following conditions:
-
-The above copyright notice and this permission notice shall be included in
-all copies or substantial portions of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
-OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
-THE SOFTWARE.
-*/
-
-#pragma once
-#include "polycode/core/PolyGlobals.h"
-#include "polycode/core/PolyImage.h"
-#include "polycode/core/PolyScenePrimitive.h"
-
-namespace Polycode {
-
-	/**
-	* 2D screen image display. This ScreenEntity can load and display and image.
-	*/
-	class _PolyExport SceneImage : public ScenePrimitive {
-		public:
-		/**
-		* Create screen image from file.
-		* @param fileName 
-		*/
-		explicit SceneImage(const String& fileName);
-
-		/**
-		* Create screen image from Image.
-		* @param image Image to create from.
-		*/		
-		explicit SceneImage(Image *image);
-
-		/**
-		 * Create screen image from Texture.
-		 * @param texture Texture to create from.
-		 */		
-		explicit SceneImage(Texture *texture);
-
-		/**
-		* Create screen image from Image.
-		* @param image Image to create from.
-		*/				
-		static SceneImage* SceneImageWithImage(Image *image);
-
-		/**
-		 * Create screen image from Texture.
-		 * @param texture Texture to create from.
-		 */				
-		static SceneImage* SceneImageWithTexture(Texture *texture);
-
-		virtual ~SceneImage();
-
-		virtual Entity *Clone(bool deepClone, bool ignoreEditorOnly) const;
-		virtual void applyClone(Entity *clone, bool deepClone, bool ignoreEditorOnly) const;
-
-		/**
-		* Changes which part of the image is displayed.
-		* @param x X position of the display rectangle.
-		* @param y Y position of the display rectangle.
-		* @param width Width of the display rectangle.
-		* @param height Height of the display rectangle.
-		*/				
-		void setImageCoordinates(Number x, Number y, Number width, Number height, Number realWidth=-1, Number realHeight=-1);
-
-		/**
-		* Returns the image width.
-		*/ 
-		Number getImageWidth() const;
-
-		/**
-		* Returns the image height.
-		*/		
-		Number getImageHeight() const;
-
-		protected:
-
-		Number imageWidth;
-		Number imageHeight;
-
-	};
-
-}

+ 2 - 1
include/polycode/core/PolySceneLabel.h

@@ -23,6 +23,7 @@ THE SOFTWARE.
 #pragma once
 #pragma once
 #include "polycode/core/PolyGlobals.h"
 #include "polycode/core/PolyGlobals.h"
 #include "polycode/core/PolyScenePrimitive.h"
 #include "polycode/core/PolyScenePrimitive.h"
+#include <memory>
 
 
 namespace Polycode {
 namespace Polycode {
 	
 	
@@ -74,7 +75,7 @@ namespace Polycode {
 						
 						
 		protected:
 		protected:
 			
 			
-				 
+			std::shared_ptr<Texture> texture;
 			Number actualHeight;
 			Number actualHeight;
 			Number labelScale;
 			Number labelScale;
 			Label *label;
 			Label *label;

+ 4 - 3
include/polycode/core/PolySceneLight.h

@@ -24,6 +24,7 @@ THE SOFTWARE.
 #pragma once
 #pragma once
 #include "polycode/core/PolyGlobals.h"
 #include "polycode/core/PolyGlobals.h"
 #include "polycode/core/PolyEntity.h"
 #include "polycode/core/PolyEntity.h"
+#include <memory>
 
 
 namespace Polycode {
 namespace Polycode {
 
 
@@ -85,7 +86,7 @@ namespace Polycode {
 			static const int POINT_LIGHT = 0;
 			static const int POINT_LIGHT = 0;
 			static const int SPOT_LIGHT = 1;
 			static const int SPOT_LIGHT = 1;
 			
 			
-			Texture *getZBufferTexture() const;
+			std::shared_ptr<Texture> getZBufferTexture() const;
 			
 			
 			/**
 			/**
 			* Sets the light color.
 			* Sets the light color.
@@ -190,8 +191,8 @@ namespace Polycode {
 		
 		
 			LightInfo lightInfo;
 			LightInfo lightInfo;
 
 
-			RenderBuffer *shadowMapRenderBuffer;
-			Material *unlitMaterial;
+			std::shared_ptr<RenderBuffer> shadowMapRenderBuffer;
+			std::shared_ptr<Material> unlitMaterial;
 			Camera *spotCamera;
 			Camera *spotCamera;
 			Scene *parentScene;
 			Scene *parentScene;
 		
 		

+ 15 - 26
include/polycode/core/PolySceneMesh.h

@@ -51,14 +51,14 @@ namespace Polycode {
 			/**
 			/**
 			* Construct scene mesh from an existing Mesh instance.
 			* Construct scene mesh from an existing Mesh instance.
 			*/
 			*/
-			explicit SceneMesh(Mesh *mesh);
+			explicit SceneMesh(std::shared_ptr<Mesh> mesh);
 		
 		
 			SceneMesh();
 			SceneMesh();
 			
 			
 			/**
 			/**
 			* Construct scene mesh from an existing Mesh instance.
 			* Construct scene mesh from an existing Mesh instance.
 			*/			
 			*/			
-			static SceneMesh *SceneMeshFromMesh(Mesh *mesh);
+			static SceneMesh *SceneMeshFromMesh(std::shared_ptr<Mesh> mesh);
 			
 			
 			virtual ~SceneMesh();
 			virtual ~SceneMesh();
 			
 			
@@ -73,18 +73,18 @@ namespace Polycode {
 			/**
 			/**
 			* Returns the Mesh instance of the actual mesh.
 			* Returns the Mesh instance of the actual mesh.
 			*/
 			*/
-			Mesh *getMesh();
+			std::shared_ptr<Mesh> getMesh();
 			
 			
 			/**
 			/**
 			* Returns the material applied.
 			* Returns the material applied.
 			*/							
 			*/							
-			Material *getMaterial();
+			std::shared_ptr<Material> getMaterial();
 			
 			
 			/**
 			/**
 			* Loads a skeleton from a file and applies it to the scene mesh.
 			* Loads a skeleton from a file and applies it to the scene mesh.
 			* @param fileName Filename to load the skeleton from.
 			* @param fileName Filename to load the skeleton from.
 			*/
 			*/
-			Skeleton *loadSkeleton(const String& fileName);
+			std::shared_ptr<Skeleton> loadSkeleton(const String& fileName);
 
 
 			/**
 			/**
 			* Clears the currently applied material
 			* Clears the currently applied material
@@ -95,7 +95,7 @@ namespace Polycode {
 			* Set material from existing Material instance.
 			* Set material from existing Material instance.
 			* @param material Material to apply.
 			* @param material Material to apply.
 			*/												
 			*/												
-			void setMaterial(Material *material);
+			void setMaterial(std::shared_ptr<Material> material);
 			
 			
 			/**
 			/**
 			* Set material by name. You can create materials in material files and name them there, then use this to set a material by name to a scene mesh.
 			* Set material by name. You can create materials in material files and name them there, then use this to set a material by name to a scene mesh.
@@ -107,18 +107,18 @@ namespace Polycode {
 			* Set the mesh this scene mesh renders.
 			* Set the mesh this scene mesh renders.
 			* @param mesh Set a new mesh to render.
 			* @param mesh Set a new mesh to render.
 			*/															
 			*/															
-			void setMesh(Mesh *mesh);
+			void setMesh(std::shared_ptr<Mesh> mesh);
 		
 		
 			/**
 			/**
 			* Sets a skeleton from an existing skeleton instance.
 			* Sets a skeleton from an existing skeleton instance.
 			* @param skeleton Skeleton to set to this mesh.
 			* @param skeleton Skeleton to set to this mesh.
 			*/
 			*/
-			void setSkeleton(Skeleton *skeleton);
+			void setSkeleton(std::shared_ptr<Skeleton> skeleton);
 			
 			
 			/**
 			/**
 			* Returns the skeleton applied to this scene mesh.
 			* Returns the skeleton applied to this scene mesh.
 			*/
 			*/
-			Skeleton *getSkeleton();
+			std::shared_ptr<Skeleton> getSkeleton();
 		
 		
 			void applySkeletonLocally();
 			void applySkeletonLocally();
 			
 			
@@ -135,12 +135,12 @@ namespace Polycode {
 			/**
 			/**
 			 * Sets the filename path of the mesh.
 			 * Sets the filename path of the mesh.
 			 */
 			 */
-			void setFilename(String fileName);
+			void setFilename(const String &fileName);
 		
 		
 			/**
 			/**
 			 * Loads mesh from file. Deletes current mesh if ownsMesh is set to true.
 			 * Loads mesh from file. Deletes current mesh if ownsMesh is set to true.
 			 */
 			 */
-			void loadFromFile(String fileName);
+			void loadFromFile(const String &fileName);
 		
 		
 			/**
 			/**
 			 * Line width for line-based meshes.
 			 * Line width for line-based meshes.
@@ -157,16 +157,6 @@ namespace Polycode {
 			 */
 			 */
 			bool pointSmooth;
 			bool pointSmooth;
 			
 			
-			/**
-			* If true, will delete its Mesh upon destruction or mesh loading. (defaults to true)
-			*/ 
-			bool ownsMesh;
-
-			/**
-			* If true, will delete its Skeleton upon destruction. (defaults to true)
-			*/			
-			bool ownsSkeleton;
-			
 			/**
 			/**
 			 * If set to true, will check against actual geometry polygons on ray hit detection. Defaults to false.
 			 * If set to true, will check against actual geometry polygons on ray hit detection. Defaults to false.
 			 */
 			 */
@@ -197,16 +187,15 @@ namespace Polycode {
 		protected:
 		protected:
 		
 		
 			bool useVertexBuffer;
 			bool useVertexBuffer;
-			Mesh *mesh;
-			Material *material;
-			Skeleton *skeleton;
+			std::shared_ptr<Mesh> mesh;
+			std::shared_ptr<Material> material;
+			std::shared_ptr<Skeleton> skeleton;
 		
 		
 			std::vector<ShaderPass> shaderPasses;
 			std::vector<ShaderPass> shaderPasses;
 		
 		
 			String fileName;
 			String fileName;
 			std::vector<Matrix4> materialBoneMatrices;
 			std::vector<Matrix4> materialBoneMatrices;
-					
-		
+
 			VertexDataArray skeletalVertexPositions;
 			VertexDataArray skeletalVertexPositions;
 			VertexDataArray skeletalVertexNormals;
 			VertexDataArray skeletalVertexNormals;
 		
 		

+ 3 - 5
include/polycode/core/PolySceneRenderTexture.h

@@ -23,6 +23,7 @@ THE SOFTWARE.
 #pragma once
 #pragma once
 #include "polycode/core/PolyGlobals.h"
 #include "polycode/core/PolyGlobals.h"
 #include "polycode/core/PolyImage.h"
 #include "polycode/core/PolyImage.h"
+#include <memory>
 
 
 namespace Polycode {
 namespace Polycode {
 
 
@@ -52,10 +53,7 @@ namespace Polycode {
 			/**
 			/**
 			* Returns the actual render texture.
 			* Returns the actual render texture.
 			*/
 			*/
-			Texture *getTargetTexture();
-			
-			Texture *getFilterColorBufferTexture();
-			Texture *getFilterZBufferTexture();
+			std::shared_ptr<Texture> getTargetTexture();
 		
 		
 			void Render();
 			void Render();
 		
 		
@@ -79,7 +77,7 @@ namespace Polycode {
 			bool floatingPoint;
 			bool floatingPoint;
 		
 		
 			Renderer *renderer;
 			Renderer *renderer;
-			RenderBuffer *targetFramebuffer;
+			std::shared_ptr<RenderBuffer> targetFramebuffer;
 		
 		
 			Scene *targetScene;
 			Scene *targetScene;
 			Camera *targetCamera;
 			Camera *targetCamera;

Някои файлове не бяха показани, защото твърде много файлове са промени