Ivan Safrin 10 лет назад
Родитель
Сommit
9bb06e7e98
76 измененных файлов с 788 добавлено и 254 удалено
  1. 7 0
      .gitignore
  2. 9 0
      .travis.yml
  3. BIN
      assets/default/default.pak
  4. 4 0
      assets/default/default/DefaultShader.frag
  5. 1 1
      assets/default/default/DefaultShader.vert
  6. 4 0
      assets/default/default/DefaultShaderShadows.frag
  7. 1 1
      assets/default/default/DefaultShaderShadows.vert
  8. 4 0
      assets/default/default/DefaultUntextured.frag
  9. 4 0
      assets/default/default/Invert.frag
  10. 1 1
      assets/default/default/LightCube.vert
  11. 1 1
      assets/default/default/ScreenShader.vert
  12. 1 1
      assets/default/default/Unlit.frag
  13. 1 1
      assets/default/default/Unlit.vert
  14. 1 1
      assets/default/default/UnlitPoint.vert
  15. 1 1
      assets/default/default/UnlitUntextured.frag
  16. 1 1
      assets/default/default/UnlitUntextured.vert
  17. 1 1
      assets/default/default/UnlitUntexturedVertexColor.frag
  18. 1 1
      assets/default/default/UnlitUntexturedVertexColor.vert
  19. 1 1
      assets/default/default/UnlitWireframe.frag
  20. 6 6
      build/ios/PolycodeCore/PolycodeCore.xcodeproj/project.pbxproj
  21. 24 6
      build/ios/TemplateApp/TemplateApp.xcodeproj/project.pbxproj
  22. 1 10
      build/ios/TemplateApp/TemplateApp/AppDelegate.h
  23. 7 1
      build/ios/TemplateApp/TemplateApp/AppDelegate.m
  24. 5 0
      build/ios/TemplateApp/TemplateApp/Assets.xcassets/AppIcon.appiconset/Contents.json
  25. 2 3
      build/ios/TemplateApp/TemplateApp/Base.lproj/LaunchScreen.storyboard
  26. 12 9
      build/ios/TemplateApp/TemplateApp/Base.lproj/Main.storyboard
  27. 8 6
      build/ios/TemplateApp/TemplateApp/PolycodeTemplateApp.mm
  28. 9 1
      build/ios/TemplateApp/TemplateApp/ViewController.h
  29. 15 0
      build/ios/TemplateApp/TemplateApp/ViewController.m
  30. 1 0
      build/linux/Makefile
  31. 11 0
      build/linux/Studio/main.cpp
  32. 2 2
      build/linux/TemplateApp/PolycodeTemplate.cpp
  33. 13 14
      build/linux/TemplateApp/PolycodeTemplateApp.cpp
  34. 2 4
      build/osx/TemplateApp/TemplateApp/Base.lproj/MainMenu.xib
  35. 1 1
      build/osx/TemplateApp/TemplateApp/PolycodeTemplateApp.mm
  36. 3 0
      build/rpi/Makefile
  37. 10 0
      build/rpi/TemplateApp/PolycodeTemplate.cpp
  38. 72 0
      build/rpi/TemplateApp/PolycodeTemplateApp.cpp
  39. 27 0
      build/rpi/TemplateApp/PolycodeTemplateApp.h
  40. BIN
      build/rpi/TemplateApp/main_icon.png
  41. 4 1
      build/windows/universal/Polycode.sln
  42. 5 4
      build/windows/universal/PolycodeCore/PolycodeCore.vcxproj
  43. 0 3
      build/windows/universal/PolycodeCore/PolycodeCore.vcxproj.filters
  44. 1 1
      build/windows/universal/TemplateApp/PolycodeTemplateApp.cpp
  45. 15 12
      build/windows/universal/TemplateApp/TemplateApp.vcxproj
  46. 12 2
      build/windows/win32/Polycode.sln
  47. 13 4
      build/windows/win32/PolycodeCore/PolycodeCore.vcxproj
  48. 50 4
      build/windows/win32/PolycodeStudio/PolycodeStudio.vcxproj
  49. 1 1
      build/windows/win32/PolycodeStudio/PolycodeStudio.vcxproj.filters
  50. 2 1
      build/windows/win32/PolycodeStudio/main.cpp
  51. 12 0
      build/windows/win32/PolycodeUI/PolycodeUI.vcxproj
  52. 4 4
      build/windows/win32/TemplateApp/PolycodeTemplateApp.cpp
  53. 0 0
      build/windows/win32/TemplateApp/TemplateApp.cpp
  54. 37 7
      build/windows/win32/TemplateApp/TemplateApp.vcxproj
  55. 3 3
      build/windows/win32/TemplateApp/TemplateApp.vcxproj.filters
  56. 3 3
      include/angle/EGL/egl.h
  57. 1 1
      include/angle/EGL/eglext.h
  58. 1 1
      include/angle/EGL/eglplatform.h
  59. 1 1
      include/angle/GLES2/gl2.h
  60. 1 1
      include/angle/GLES2/gl2platform.h
  61. 25 0
      include/ogg/config_types.h
  62. 12 12
      include/polycode/core/PolyCore.h
  63. 1 1
      include/polycode/core/PolyCoreInput.h
  64. 16 1
      include/polycode/core/PolyIOSCore.h
  65. 13 13
      include/polycode/core/PolyOpenGLGraphicsInterface.h
  66. 17 4
      include/polycode/core/PolySDLCore.h
  67. 7 7
      include/polycode/core/PolyUWPCore.h
  68. 1 1
      include/polycode/ide/PolycodeIDEApp.h
  69. 16 0
      include/polycode/view/linux/PolycodeView.h
  70. 59 7
      src/core/PolyIOSCore.mm
  71. 3 1
      src/core/PolyOpenGLGraphicsInterface.cpp
  72. 2 2
      src/core/PolyPAAudioInterface.cpp
  73. 150 71
      src/core/PolySDLCore.cpp
  74. 5 2
      src/core/PolySceneImage.cpp
  75. 5 3
      src/ide/PolycodeProps.cpp
  76. 15 0
      src/view/linux/PolycodeView.cpp

+ 7 - 0
.gitignore

@@ -1,9 +1,13 @@
 # Created by https://www.gitignore.io
 
 *.o
+*.do
+*.io
+*.dio
 build/linux/TemplateApp/PolycodeTemplate
 build/linux/TemplateApp/default
 build/linux/TemplateApp/default.pak
+build/linux/Studio/*
 
 docs/cldoc
 
@@ -90,6 +94,9 @@ bld/
 # Visual Studo 2015 cache/options directory
 .vs/
 
+# KDev Files
+*.kdev*
+
 # MSTest test Results
 [Tt]est[Rr]esult*/
 [Bb]uild[Ll]og.*

+ 9 - 0
.travis.yml

@@ -0,0 +1,9 @@
+language: cpp
+
+addons:
+  apt:
+    packages:
+    - libsdl1.2-dev
+    - python-ply
+
+script: cd build/linux/ && make all

BIN
assets/default/default.pak


+ 4 - 0
assets/default/default/DefaultShader.frag

@@ -1,3 +1,7 @@
+#ifdef GL_ES
+	precision mediump float;
+#endif
+
 varying vec2 texCoordVar;
 varying vec3 varNormal;
 varying vec4 varPosition;

+ 1 - 1
assets/default/default/DefaultShader.vert

@@ -1,4 +1,4 @@
-#ifdef GLES2
+#ifdef GL_ES
 	precision mediump float;
 #endif
 

+ 4 - 0
assets/default/default/DefaultShaderShadows.frag

@@ -1,3 +1,7 @@
+#ifdef GL_ES
+	precision mediump float;
+#endif
+
 varying vec2 texCoordVar;
 varying vec3 varNormal;
 varying vec4 varPosition;

+ 1 - 1
assets/default/default/DefaultShaderShadows.vert

@@ -1,4 +1,4 @@
-#ifdef GLES2
+#ifdef GL_ES
 	precision mediump float;
 #endif
 

+ 4 - 0
assets/default/default/DefaultUntextured.frag

@@ -1,3 +1,7 @@
+#ifdef GL_ES
+	precision mediump float;
+#endif
+
 varying vec2 texCoordVar;
 varying vec3 varNormal;
 varying vec4 varPosition;

+ 4 - 0
assets/default/default/Invert.frag

@@ -1,3 +1,7 @@
+#ifdef GL_ES
+	precision mediump float;
+#endif
+
 uniform sampler2D screenColorBuffer;
 varying vec2 texCoordVar;
 void main()

+ 1 - 1
assets/default/default/LightCube.vert

@@ -1,4 +1,4 @@
-#ifdef GLES2
+#ifdef GL_ES
 	precision mediump float;
 #endif
 

+ 1 - 1
assets/default/default/ScreenShader.vert

@@ -1,4 +1,4 @@
-#ifdef GLES2
+#ifdef GL_ES
 	precision mediump float;
 #endif
 

+ 1 - 1
assets/default/default/Unlit.frag

@@ -1,4 +1,4 @@
-#ifdef GLES2
+#ifdef GL_ES
 	precision mediump float;
 #endif
 

+ 1 - 1
assets/default/default/Unlit.vert

@@ -1,4 +1,4 @@
-#ifdef GLES2
+#ifdef GL_ES
 	precision mediump float;
 #endif
 

+ 1 - 1
assets/default/default/UnlitPoint.vert

@@ -1,4 +1,4 @@
-#ifdef GLES2
+#ifdef GL_ES
 	precision mediump float;
 #endif
 

+ 1 - 1
assets/default/default/UnlitUntextured.frag

@@ -1,4 +1,4 @@
-#ifdef GLES2
+#ifdef GL_ES
 	precision mediump float;
 #endif
 

+ 1 - 1
assets/default/default/UnlitUntextured.vert

@@ -1,4 +1,4 @@
-#ifdef GLES2
+#ifdef GL_ES
 	precision mediump float;
 #endif
 

+ 1 - 1
assets/default/default/UnlitUntexturedVertexColor.frag

@@ -1,4 +1,4 @@
-#ifdef GLES2
+#ifdef GL_ES
 	precision mediump float;
 #endif
 

+ 1 - 1
assets/default/default/UnlitUntexturedVertexColor.vert

@@ -1,4 +1,4 @@
-#ifdef GLES2
+#ifdef GL_ES
 	precision mediump float;
 #endif
 

+ 1 - 1
assets/default/default/UnlitWireframe.frag

@@ -1,4 +1,4 @@
-#ifdef GLES2
+#ifdef GL_ES
 	precision mediump float;
 #endif
 

+ 6 - 6
build/ios/PolycodeCore/PolycodeCore.xcodeproj/project.pbxproj

@@ -43,7 +43,6 @@
 		8A0F81681BF541F900E24F9B /* PolyParticleEmitter.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 8A0F811A1BF541F800E24F9B /* PolyParticleEmitter.cpp */; };
 		8A0F81691BF541F900E24F9B /* PolyPeer.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 8A0F811B1BF541F800E24F9B /* PolyPeer.cpp */; };
 		8A0F816A1BF541F900E24F9B /* PolyPerlin.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 8A0F811C1BF541F800E24F9B /* PolyPerlin.cpp */; };
-		8A0F816B1BF541F900E24F9B /* PolyPhysFSFileProvider.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 8A0F811D1BF541F800E24F9B /* PolyPhysFSFileProvider.cpp */; };
 		8A0F816C1BF541F900E24F9B /* PolyQuaternion.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 8A0F811E1BF541F800E24F9B /* PolyQuaternion.cpp */; };
 		8A0F816D1BF541F900E24F9B /* PolyQuaternionCurve.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 8A0F811F1BF541F800E24F9B /* PolyQuaternionCurve.cpp */; };
 		8A0F816E1BF541F900E24F9B /* PolyRay.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 8A0F81201BF541F800E24F9B /* PolyRay.cpp */; };
@@ -85,6 +84,7 @@
 		8A0F81921BF541F900E24F9B /* tinyxml.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 8A0F81441BF541F900E24F9B /* tinyxml.cpp */; };
 		8A0F81931BF541F900E24F9B /* tinyxmlerror.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 8A0F81451BF541F900E24F9B /* tinyxmlerror.cpp */; };
 		8A0F81941BF541F900E24F9B /* tinyxmlparser.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 8A0F81461BF541F900E24F9B /* tinyxmlparser.cpp */; };
+		8A35E1A11C87B25900BF9EEA /* PolyPhysFSFileProvider.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 8A35E1A01C87B25900BF9EEA /* PolyPhysFSFileProvider.cpp */; };
 /* End PBXBuildFile section */
 
 /* Begin PBXCopyFilesBuildPhase section */
@@ -138,7 +138,6 @@
 		8A0F80D01BF5417E00E24F9B /* PolyParticleEmitter.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = PolyParticleEmitter.h; path = ../../../include/polycode/core/PolyParticleEmitter.h; sourceTree = "<group>"; };
 		8A0F80D11BF5417E00E24F9B /* PolyPeer.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = PolyPeer.h; path = ../../../include/polycode/core/PolyPeer.h; sourceTree = "<group>"; };
 		8A0F80D21BF5417E00E24F9B /* PolyPerlin.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = PolyPerlin.h; path = ../../../include/polycode/core/PolyPerlin.h; sourceTree = "<group>"; };
-		8A0F80D31BF5417E00E24F9B /* PolyPhysFSFileProvider.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = PolyPhysFSFileProvider.h; path = ../../../include/polycode/core/PolyPhysFSFileProvider.h; sourceTree = "<group>"; };
 		8A0F80D41BF5417E00E24F9B /* PolyQuaternion.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = PolyQuaternion.h; path = ../../../include/polycode/core/PolyQuaternion.h; sourceTree = "<group>"; };
 		8A0F80D51BF5417E00E24F9B /* PolyQuaternionCurve.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = PolyQuaternionCurve.h; path = ../../../include/polycode/core/PolyQuaternionCurve.h; sourceTree = "<group>"; };
 		8A0F80D61BF5417E00E24F9B /* PolyRay.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = PolyRay.h; path = ../../../include/polycode/core/PolyRay.h; sourceTree = "<group>"; };
@@ -212,7 +211,6 @@
 		8A0F811A1BF541F800E24F9B /* PolyParticleEmitter.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = PolyParticleEmitter.cpp; path = ../../../src/core/PolyParticleEmitter.cpp; sourceTree = "<group>"; };
 		8A0F811B1BF541F800E24F9B /* PolyPeer.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = PolyPeer.cpp; path = ../../../src/core/PolyPeer.cpp; sourceTree = "<group>"; };
 		8A0F811C1BF541F800E24F9B /* PolyPerlin.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = PolyPerlin.cpp; path = ../../../src/core/PolyPerlin.cpp; sourceTree = "<group>"; };
-		8A0F811D1BF541F800E24F9B /* PolyPhysFSFileProvider.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = PolyPhysFSFileProvider.cpp; path = ../../../src/core/PolyPhysFSFileProvider.cpp; sourceTree = "<group>"; };
 		8A0F811E1BF541F800E24F9B /* PolyQuaternion.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = PolyQuaternion.cpp; path = ../../../src/core/PolyQuaternion.cpp; sourceTree = "<group>"; };
 		8A0F811F1BF541F800E24F9B /* PolyQuaternionCurve.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = PolyQuaternionCurve.cpp; path = ../../../src/core/PolyQuaternionCurve.cpp; sourceTree = "<group>"; };
 		8A0F81201BF541F800E24F9B /* PolyRay.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = PolyRay.cpp; path = ../../../src/core/PolyRay.cpp; sourceTree = "<group>"; };
@@ -254,6 +252,8 @@
 		8A0F81441BF541F900E24F9B /* tinyxml.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = tinyxml.cpp; path = ../../../src/core/tinyxml.cpp; sourceTree = "<group>"; };
 		8A0F81451BF541F900E24F9B /* tinyxmlerror.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = tinyxmlerror.cpp; path = ../../../src/core/tinyxmlerror.cpp; sourceTree = "<group>"; };
 		8A0F81461BF541F900E24F9B /* tinyxmlparser.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = tinyxmlparser.cpp; path = ../../../src/core/tinyxmlparser.cpp; sourceTree = "<group>"; };
+		8A35E19F1C87B20400BF9EEA /* PolyPhysFSFileProvider.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = PolyPhysFSFileProvider.h; path = ../../../include/polycode/core/PolyPhysFSFileProvider.h; sourceTree = "<group>"; };
+		8A35E1A01C87B25900BF9EEA /* PolyPhysFSFileProvider.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = PolyPhysFSFileProvider.cpp; path = ../../../src/core/PolyPhysFSFileProvider.cpp; sourceTree = "<group>"; };
 /* End PBXFileReference section */
 
 /* Begin PBXFrameworksBuildPhase section */
@@ -312,6 +312,7 @@
 				8A0F80C41BF5417E00E24F9B /* PolyImage.h */,
 				8A0F80C51BF5417E00E24F9B /* PolyInputEvent.h */,
 				8A0F80C61BF5417E00E24F9B /* PolyInputKeys.h */,
+				8A35E19F1C87B20400BF9EEA /* PolyPhysFSFileProvider.h */,
 				8A0F80C71BF5417E00E24F9B /* PolyIOSCore.h */,
 				8A0F80C81BF5417E00E24F9B /* PolyLabel.h */,
 				8A0F80C91BF5417E00E24F9B /* PolyLogger.h */,
@@ -324,7 +325,6 @@
 				8A0F80D01BF5417E00E24F9B /* PolyParticleEmitter.h */,
 				8A0F80D11BF5417E00E24F9B /* PolyPeer.h */,
 				8A0F80D21BF5417E00E24F9B /* PolyPerlin.h */,
-				8A0F80D31BF5417E00E24F9B /* PolyPhysFSFileProvider.h */,
 				8A0F80D41BF5417E00E24F9B /* PolyQuaternion.h */,
 				8A0F80D51BF5417E00E24F9B /* PolyQuaternionCurve.h */,
 				8A0F80D61BF5417E00E24F9B /* PolyRay.h */,
@@ -382,6 +382,7 @@
 				8A0F81031BF541F800E24F9B /* PolyCoreInput.cpp */,
 				8A0F81041BF541F800E24F9B /* PolyCoreServices.cpp */,
 				8A0F81051BF541F800E24F9B /* PolyCubemap.cpp */,
+				8A35E1A01C87B25900BF9EEA /* PolyPhysFSFileProvider.cpp */,
 				8A0F81061BF541F800E24F9B /* PolyData.cpp */,
 				8A0F81071BF541F800E24F9B /* PolyEntity.cpp */,
 				8A0F81081BF541F800E24F9B /* PolyEvent.cpp */,
@@ -405,7 +406,6 @@
 				8A0F811A1BF541F800E24F9B /* PolyParticleEmitter.cpp */,
 				8A0F811B1BF541F800E24F9B /* PolyPeer.cpp */,
 				8A0F811C1BF541F800E24F9B /* PolyPerlin.cpp */,
-				8A0F811D1BF541F800E24F9B /* PolyPhysFSFileProvider.cpp */,
 				8A0F811E1BF541F800E24F9B /* PolyQuaternion.cpp */,
 				8A0F811F1BF541F800E24F9B /* PolyQuaternionCurve.cpp */,
 				8A0F81201BF541F800E24F9B /* PolyRay.cpp */,
@@ -527,6 +527,7 @@
 				8A0F815F1BF541F900E24F9B /* PolyIOSCore.mm in Sources */,
 				8A0F81911BF541F900E24F9B /* tinystr.cpp in Sources */,
 				8A0F81701BF541F900E24F9B /* PolyRenderDataArray.cpp in Sources */,
+				8A35E1A11C87B25900BF9EEA /* PolyPhysFSFileProvider.cpp in Sources */,
 				8A0F814C1BF541F900E24F9B /* PolyClient.cpp in Sources */,
 				8A0F814E1BF541F900E24F9B /* PolyConfig.cpp in Sources */,
 				8A0F815B1BF541F900E24F9B /* PolyFontManager.cpp in Sources */,
@@ -592,7 +593,6 @@
 				8A0F81691BF541F900E24F9B /* PolyPeer.cpp in Sources */,
 				8A0F81531BF541F900E24F9B /* PolyCubemap.cpp in Sources */,
 				8A0F817E1BF541F900E24F9B /* PolySceneSound.cpp in Sources */,
-				8A0F816B1BF541F900E24F9B /* PolyPhysFSFileProvider.cpp in Sources */,
 				8A0F81791BF541F900E24F9B /* PolySceneLine.cpp in Sources */,
 				8A0F81661BF541F900E24F9B /* PolyObject.cpp in Sources */,
 				8A0F81841BF541F900E24F9B /* PolySound.cpp in Sources */,

+ 24 - 6
build/ios/TemplateApp/TemplateApp.xcodeproj/project.pbxproj

@@ -14,8 +14,11 @@
 		8A0F806F1BF536C800E24F9B /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 8A0F806D1BF536C800E24F9B /* LaunchScreen.storyboard */; };
 		8A0F807B1BF53DD200E24F9B /* PolycodeTemplateApp.mm in Sources */ = {isa = PBXBuildFile; fileRef = 8A0F807A1BF53DD200E24F9B /* PolycodeTemplateApp.mm */; };
 		8A0F81991BF56A2D00E24F9B /* PolycodeView.m in Sources */ = {isa = PBXBuildFile; fileRef = 8A0F81981BF56A2D00E24F9B /* PolycodeView.m */; };
+		8A35E14B1C877A8B00BF9EEA /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 8A35E14A1C877A8B00BF9EEA /* main.m */; };
+		8A35E14F1C877DDB00BF9EEA /* libFreetype2.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 8A35E14E1C877DDB00BF9EEA /* libFreetype2.a */; };
+		8A35E1C61C87B3BC00BF9EEA /* libphysfs.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 8A35E1C51C87B3BC00BF9EEA /* libphysfs.a */; };
+		8A35E1DC1C87B50600BF9EEA /* default.pak in Resources */ = {isa = PBXBuildFile; fileRef = 8A35E1DB1C87B50600BF9EEA /* default.pak */; };
 		8AD300AB1BF68290004D243B /* libPolycodeCore.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 8AD300AA1BF68290004D243B /* libPolycodeCore.a */; };
-		8AFAD6CC1C28A95500AD31ED /* libFreetype2.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 8AFAD6CB1C28A95500AD31ED /* libFreetype2.a */; };
 /* End PBXBuildFile section */
 
 /* Begin PBXFileReference section */
@@ -23,7 +26,7 @@
 		8A0F80621BF536C800E24F9B /* AppDelegate.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = AppDelegate.h; sourceTree = "<group>"; };
 		8A0F80631BF536C800E24F9B /* AppDelegate.m */ = {isa = PBXFileReference; explicitFileType = sourcecode.cpp.objcpp.preprocessed; path = AppDelegate.m; sourceTree = "<group>"; };
 		8A0F80651BF536C800E24F9B /* ViewController.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = ViewController.h; sourceTree = "<group>"; };
-		8A0F80661BF536C800E24F9B /* ViewController.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = ViewController.m; sourceTree = "<group>"; };
+		8A0F80661BF536C800E24F9B /* ViewController.m */ = {isa = PBXFileReference; explicitFileType = sourcecode.cpp.objcpp.preprocessed; path = ViewController.m; sourceTree = "<group>"; };
 		8A0F80691BF536C800E24F9B /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = "<group>"; };
 		8A0F806B1BF536C800E24F9B /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = "<group>"; };
 		8A0F806E1BF536C800E24F9B /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = "<group>"; };
@@ -31,8 +34,12 @@
 		8A0F80791BF53DD200E24F9B /* PolycodeTemplateApp.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PolycodeTemplateApp.h; sourceTree = "<group>"; };
 		8A0F807A1BF53DD200E24F9B /* PolycodeTemplateApp.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = PolycodeTemplateApp.mm; sourceTree = "<group>"; };
 		8A0F81981BF56A2D00E24F9B /* PolycodeView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = PolycodeView.m; path = ../../../../src/view/ios/PolycodeView.m; sourceTree = "<group>"; };
+		8A35E14A1C877A8B00BF9EEA /* main.m */ = {isa = PBXFileReference; explicitFileType = sourcecode.cpp.objcpp.preprocessed; fileEncoding = 4; path = main.m; sourceTree = "<group>"; };
+		8A35E14E1C877DDB00BF9EEA /* libFreetype2.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; name = libFreetype2.a; path = ../../../../lib/ios/iphonesimulator/libFreetype2.a; sourceTree = "<group>"; };
+		8A35E19E1C87A54A00BF9EEA /* PolycodeView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = PolycodeView.h; path = ../../../../include/polycode/view/ios/PolycodeView.h; sourceTree = "<group>"; };
+		8A35E1C51C87B3BC00BF9EEA /* libphysfs.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; name = libphysfs.a; path = ../../../../lib/ios/iphonesimulator/libphysfs.a; sourceTree = "<group>"; };
+		8A35E1DB1C87B50600BF9EEA /* default.pak */ = {isa = PBXFileReference; lastKnownFileType = file; name = default.pak; path = ../../../../assets/default/default.pak; sourceTree = "<group>"; };
 		8AD300AA1BF68290004D243B /* libPolycodeCore.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; name = libPolycodeCore.a; path = ../../../../lib/ios/iphonesimulator/libPolycodeCore.a; sourceTree = "<group>"; };
-		8AFAD6CB1C28A95500AD31ED /* libFreetype2.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; name = libFreetype2.a; path = ../../../../lib/ios/iphonesimulator/libFreetype2.a; sourceTree = "<group>"; };
 /* End PBXFileReference section */
 
 /* Begin PBXFrameworksBuildPhase section */
@@ -40,7 +47,8 @@
 			isa = PBXFrameworksBuildPhase;
 			buildActionMask = 2147483647;
 			files = (
-				8AFAD6CC1C28A95500AD31ED /* libFreetype2.a in Frameworks */,
+				8A35E14F1C877DDB00BF9EEA /* libFreetype2.a in Frameworks */,
+				8A35E1C61C87B3BC00BF9EEA /* libphysfs.a in Frameworks */,
 				8AD300AB1BF68290004D243B /* libPolycodeCore.a in Frameworks */,
 			);
 			runOnlyForDeploymentPostprocessing = 0;
@@ -67,7 +75,8 @@
 		8A0F805E1BF536C800E24F9B /* TemplateApp */ = {
 			isa = PBXGroup;
 			children = (
-				8AFAD6CB1C28A95500AD31ED /* libFreetype2.a */,
+				8A35E14E1C877DDB00BF9EEA /* libFreetype2.a */,
+				8A35E1C51C87B3BC00BF9EEA /* libphysfs.a */,
 				8AD300AA1BF68290004D243B /* libPolycodeCore.a */,
 				8A0F80621BF536C800E24F9B /* AppDelegate.h */,
 				8A0F80631BF536C800E24F9B /* AppDelegate.m */,
@@ -75,10 +84,13 @@
 				8A0F80661BF536C800E24F9B /* ViewController.m */,
 				8A0F80791BF53DD200E24F9B /* PolycodeTemplateApp.h */,
 				8A0F807A1BF53DD200E24F9B /* PolycodeTemplateApp.mm */,
+				8A35E1DB1C87B50600BF9EEA /* default.pak */,
 				8A0F80681BF536C800E24F9B /* Main.storyboard */,
-				8A0F806B1BF536C800E24F9B /* Assets.xcassets */,
+				8A35E19E1C87A54A00BF9EEA /* PolycodeView.h */,
 				8A0F81981BF56A2D00E24F9B /* PolycodeView.m */,
+				8A0F806B1BF536C800E24F9B /* Assets.xcassets */,
 				8A0F806D1BF536C800E24F9B /* LaunchScreen.storyboard */,
+				8A35E14A1C877A8B00BF9EEA /* main.m */,
 				8A0F80701BF536C800E24F9B /* Info.plist */,
 			);
 			path = TemplateApp;
@@ -143,6 +155,7 @@
 			files = (
 				8A0F806F1BF536C800E24F9B /* LaunchScreen.storyboard in Resources */,
 				8A0F806C1BF536C800E24F9B /* Assets.xcassets in Resources */,
+				8A35E1DC1C87B50600BF9EEA /* default.pak in Resources */,
 				8A0F806A1BF536C800E24F9B /* Main.storyboard in Resources */,
 			);
 			runOnlyForDeploymentPostprocessing = 0;
@@ -154,6 +167,7 @@
 			isa = PBXSourcesBuildPhase;
 			buildActionMask = 2147483647;
 			files = (
+				8A35E14B1C877A8B00BF9EEA /* main.m in Sources */,
 				8A0F80671BF536C800E24F9B /* ViewController.m in Sources */,
 				8A0F807B1BF53DD200E24F9B /* PolycodeTemplateApp.mm in Sources */,
 				8A0F80641BF536C800E24F9B /* AppDelegate.m in Sources */,
@@ -269,10 +283,12 @@
 			isa = XCBuildConfiguration;
 			buildSettings = {
 				ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
+				GCC_NO_COMMON_BLOCKS = YES;
 				HEADER_SEARCH_PATHS = "\"$(SRCROOT)/../../../include\"";
 				INFOPLIST_FILE = TemplateApp/Info.plist;
 				LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
 				LIBRARY_SEARCH_PATHS = "\"$(SRCROOT)/../../../lib/ios/iphonesimulator\"";
+				OTHER_LDFLAGS = "";
 				PRODUCT_BUNDLE_IDENTIFIER = org.polycode.TemplateApp;
 				PRODUCT_NAME = "$(TARGET_NAME)";
 			};
@@ -282,10 +298,12 @@
 			isa = XCBuildConfiguration;
 			buildSettings = {
 				ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
+				GCC_NO_COMMON_BLOCKS = YES;
 				HEADER_SEARCH_PATHS = "\"$(SRCROOT)/../../../include\"";
 				INFOPLIST_FILE = TemplateApp/Info.plist;
 				LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
 				LIBRARY_SEARCH_PATHS = "\"$(SRCROOT)/../../../lib/ios/iphonesimulator\"";
+				OTHER_LDFLAGS = "";
 				PRODUCT_BUNDLE_IDENTIFIER = org.polycode.TemplateApp;
 				PRODUCT_NAME = "$(TARGET_NAME)";
 			};

+ 1 - 10
build/ios/TemplateApp/TemplateApp/AppDelegate.h

@@ -1,19 +1,10 @@
 
 
 #import <UIKit/UIKit.h>
-#import "polycode/view/ios/PolycodeView.h"
-#include "PolycodeTemplateApp.h"
 
-@interface AppDelegate : UIResponder <UIApplicationDelegate> {
-    @private
-    UIWindow *window;
-    PolycodeView *mainView;
-    PolycodeTemplateApp *app;
-    NSTimer *timer;
-}
+@interface AppDelegate : UIResponder <UIApplicationDelegate>
 
 @property (strong, nonatomic) UIWindow *window;
-@property (strong, nonatomic) PolycodeView *mainView;
 
 
 @end

+ 7 - 1
build/ios/TemplateApp/TemplateApp/AppDelegate.m

@@ -1,4 +1,10 @@
-
+//
+//  AppDelegate.m
+//  Testing222
+//
+//  Created by Ivan Safrin on 3/2/16.
+//  Copyright © 2016 Polycode. All rights reserved.
+//
 
 #import "AppDelegate.h"
 

+ 5 - 0
build/ios/TemplateApp/TemplateApp/Assets.xcassets/AppIcon.appiconset/Contents.json

@@ -59,6 +59,11 @@
       "idiom" : "ipad",
       "size" : "76x76",
       "scale" : "2x"
+    },
+    {
+      "idiom" : "ipad",
+      "size" : "83.5x83.5",
+      "scale" : "2x"
     }
   ],
   "info" : {

+ 2 - 3
build/ios/TemplateApp/TemplateApp/Base.lproj/LaunchScreen.storyboard

@@ -1,8 +1,8 @@
 <?xml version="1.0" encoding="UTF-8" standalone="no"?>
-<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="9059" systemVersion="15B42" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" launchScreen="YES" useTraitCollections="YES" initialViewController="01J-lp-oVM">
+<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="9532" systemVersion="15C50" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" launchScreen="YES" useTraitCollections="YES" initialViewController="01J-lp-oVM">
     <dependencies>
         <deployment identifier="iOS"/>
-        <plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="9049"/>
+        <plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="9530"/>
     </dependencies>
     <scenes>
         <!--View Controller-->
@@ -16,7 +16,6 @@
                     <view key="view" contentMode="scaleToFill" id="Ze5-6b-2t3">
                         <rect key="frame" x="0.0" y="0.0" width="600" height="600"/>
                         <autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
-                        <animations/>
                         <color key="backgroundColor" white="1" alpha="1" colorSpace="custom" customColorSpace="calibratedWhite"/>
                     </view>
                 </viewController>

+ 12 - 9
build/ios/TemplateApp/TemplateApp/Base.lproj/Main.storyboard

@@ -1,8 +1,8 @@
 <?xml version="1.0" encoding="UTF-8" standalone="no"?>
-<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="9059" systemVersion="15B42" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" initialViewController="BYZ-38-t0r">
+<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="9532" systemVersion="15C50" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" initialViewController="BYZ-38-t0r">
     <dependencies>
         <deployment identifier="iOS"/>
-        <plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="9049"/>
+        <plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="9530"/>
     </dependencies>
     <scenes>
         <!--View Controller-->
@@ -10,18 +10,21 @@
             <objects>
                 <viewController id="BYZ-38-t0r" customClass="ViewController" sceneMemberID="viewController">
                     <layoutGuides>
-                        <viewControllerLayoutGuide type="top" id="y3c-jy-aDJ"/>
-                        <viewControllerLayoutGuide type="bottom" id="wfy-db-euE"/>
+                        <viewControllerLayoutGuide type="top" id="CcZ-Kq-cqd"/>
+                        <viewControllerLayoutGuide type="bottom" id="cfD-uc-FeA"/>
                     </layoutGuides>
-                    <view key="view" contentMode="scaleToFill" id="8bC-Xf-vdC" customClass="PolycodeView">
+                    <glkView key="view" opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center" enableSetNeedsDisplay="NO" id="2t5-1N-wWB" customClass="PolycodeView">
                         <rect key="frame" x="0.0" y="0.0" width="600" height="600"/>
-                        <autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
-                        <animations/>
-                        <color key="backgroundColor" white="1" alpha="1" colorSpace="custom" customColorSpace="calibratedWhite"/>
-                    </view>
+                        <autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
+                        <color key="backgroundColor" red="0.0" green="0.0" blue="0.0" alpha="1" colorSpace="calibratedRGB"/>
+                    </glkView>
+                    <connections>
+                        <outlet property="mainView" destination="2t5-1N-wWB" id="N2W-rf-Rkf"/>
+                    </connections>
                 </viewController>
                 <placeholder placeholderIdentifier="IBFirstResponder" id="dkx-z0-nzr" sceneMemberID="firstResponder"/>
             </objects>
+            <point key="canvasLocation" x="246" y="486"/>
         </scene>
     </scenes>
 </document>

+ 8 - 6
build/ios/TemplateApp/TemplateApp/PolycodeTemplateApp.mm

@@ -6,17 +6,19 @@
 
 
 PolycodeTemplateApp::PolycodeTemplateApp(PolycodeView *view) {
-    core = new POLYCODE_CORE(view, 1280/2,720/2,false,false, 0,0,60, 0, true);
+    core = new POLYCODE_CORE(view, 64,64,false,false, 0,0,60, 0, true);
     
-    core->addFileSource("archive", "default.pak");
+    NSString *str = [[NSBundle mainBundle] pathForResource: @"default" ofType: @"pak"];
+    
+    core->addFileSource("archive", [str UTF8String]);
     ResourcePool *globalPool = Services()->getResourceManager()->getGlobalPool();
     globalPool->loadResourcesFromFolder("default", true);
     
-	// Write your code here!
+    // Write your code here!
     
     Scene *scene = new Scene(Scene::SCENE_2D);
     scene->useClearColor = true;
-   
+    scene->clearColor.setColor(0.2, 0.0, 0.0, 1.0);
     
     ScenePrimitive *test = new ScenePrimitive(ScenePrimitive::TYPE_VPLANE, 10.0, 10.0);
     test->setMaterialByName("UnlitUntextured");
@@ -25,8 +27,8 @@ PolycodeTemplateApp::PolycodeTemplateApp(PolycodeView *view) {
     test->scissorBox.setRect(100, 50, 100, 30);
     scene->addChild(test);
     
-    Sound *music = new Sound("BUGSHUFFLE.ogg");
-    music->Play();
+//    Sound *music = new Sound("BUGSHUFFLE.ogg");
+//    music->Play();
     
     Services()->getInput()->addEventListener(this, InputEvent::EVENT_KEYDOWN);
 }

+ 9 - 1
build/ios/TemplateApp/TemplateApp/ViewController.h

@@ -7,9 +7,17 @@
 //
 
 #import <UIKit/UIKit.h>
+#import "polycode/view/ios/PolycodeView.h"
+#include "PolycodeTemplateApp.h"
 
-@interface ViewController : UIViewController
+@interface ViewController : UIViewController {
+@private
+    PolycodeView *_mainView;
+    PolycodeTemplateApp *app;
+    NSTimer *timer;
+}
 
+@property (strong, nonatomic) IBOutlet PolycodeView *mainView;
 
 @end
 

+ 15 - 0
build/ios/TemplateApp/TemplateApp/ViewController.m

@@ -17,6 +17,21 @@
 - (void)viewDidLoad {
     [super viewDidLoad];
     // Do any additional setup after loading the view, typically from a nib.
+    
+    app = new PolycodeTemplateApp(_mainView);
+    timer = [NSTimer timerWithTimeInterval:(1.0f/60.0f)
+                                    target:self
+                                  selector:@selector(animationTimer:)
+                                  userInfo:nil
+                                   repeats:YES];
+    [[NSRunLoop currentRunLoop] addTimer:timer forMode:NSDefaultRunLoopMode];
+}
+
+- (void)animationTimer:(NSTimer *)timer
+{
+    if(!app->Update()) {
+        //       [[NSApplication sharedApplication] stop:self];
+    }
 }
 
 - (void)didReceiveMemoryWarning {

Разница между файлами не показана из-за своего большого размера
+ 1 - 0
build/linux/Makefile


+ 11 - 0
build/linux/Studio/main.cpp

@@ -0,0 +1,11 @@
+#include "Polycode.h"
+#include "polycode/view/linux/PolycodeView.h"
+#include "polycode/ide/PolycodeIDEApp.h"
+
+int main(int argc, char *argv[]) {
+	PolycodeView *view = new PolycodeView("Polycode", true);
+	PolycodeIDEApp *app = new PolycodeIDEApp(view);
+	while(app->Update()) {}
+	app->saveConfigFile();
+	return 0;
+}

+ 2 - 2
build/linux/TemplateApp/PolycodeTemplate.cpp

@@ -1,8 +1,8 @@
 #include "PolycodeTemplateApp.h"
-
+#include "polycode/view/linux/PolycodeView.h"
 
 int main(int argc, char **argv) {
-	PolycodeView *view = new PolycodeView();
+	PolycodeView *view = new PolycodeView("Polycode Template");
 	PolycodeTemplateApp *app = new PolycodeTemplateApp(view);
 	while(app->Update()) {
 	}

+ 13 - 14
build/linux/TemplateApp/PolycodeTemplateApp.cpp

@@ -8,7 +8,7 @@
 PolycodeTemplateApp::PolycodeTemplateApp(PolycodeView *view) {
     core = new POLYCODE_CORE(view, 800,480,false,false, 0,0,60);
     
-  //  core->addFileSource("archive", "default.pak");
+    core->addFileSource("archive", "default.pak");
     ResourcePool *globalPool = Services()->getResourceManager()->getGlobalPool();
     globalPool->loadResourcesFromFolder("default", true);
     
@@ -42,25 +42,24 @@ PolycodeTemplateApp::PolycodeTemplateApp(PolycodeView *view) {
     
     //sound2->Play(true);
   */
-  
     Services()->getInput()->addEventListener(this, InputEvent::EVENT_KEYDOWN);
 }
 
 void PolycodeTemplateApp::handleEvent(Event *event) {
     InputEvent *inputEvent = (InputEvent*) event;
     
-    switch(inputEvent->getKey()) {
-        case KEY_z:
-            sound1->Play(true);
-        break;
-        case KEY_x:
-            sound2->Play();
-        break;
-        case KEY_c:
-            sound3->Play();
-        break;
-            
-    }
+//     switch(inputEvent->getKey()) {
+//         case KEY_z:
+//             sound1->Play(true);
+//         break;
+//         case KEY_x:
+//             sound2->Play();
+//         break;
+//         case KEY_c:
+//             sound3->Play();
+//         break;
+//             
+//     }
 }
 
 PolycodeTemplateApp::~PolycodeTemplateApp() {

+ 2 - 4
build/osx/TemplateApp/TemplateApp/Base.lproj/MainMenu.xib

@@ -1,8 +1,8 @@
 <?xml version="1.0" encoding="UTF-8" standalone="no"?>
-<document type="com.apple.InterfaceBuilder3.Cocoa.XIB" version="3.0" toolsVersion="8191" systemVersion="15A284" targetRuntime="MacOSX.Cocoa" propertyAccessControl="none" useAutolayout="YES" customObjectInstantitationMethod="direct">
+<document type="com.apple.InterfaceBuilder3.Cocoa.XIB" version="3.0" toolsVersion="9532" systemVersion="15C50" targetRuntime="MacOSX.Cocoa" propertyAccessControl="none" useAutolayout="YES" customObjectInstantitationMethod="direct">
     <dependencies>
         <deployment identifier="macosx"/>
-        <plugIn identifier="com.apple.InterfaceBuilder.CocoaPlugin" version="8191"/>
+        <plugIn identifier="com.apple.InterfaceBuilder.CocoaPlugin" version="9532"/>
     </dependencies>
     <objects>
         <customObject id="-2" userLabel="File's Owner" customClass="NSApplication">
@@ -79,7 +79,6 @@
                 <subviews>
                     <openGLView useAuxiliaryDepthBufferStencil="NO" translatesAutoresizingMaskIntoConstraints="NO" id="tWU-Qa-Oa0" customClass="PolycodeView">
                         <rect key="frame" x="0.0" y="0.0" width="480" height="360"/>
-                        <animations/>
                     </openGLView>
                 </subviews>
                 <constraints>
@@ -88,7 +87,6 @@
                     <constraint firstAttribute="trailing" secondItem="tWU-Qa-Oa0" secondAttribute="trailing" id="pHk-gH-OUj"/>
                     <constraint firstAttribute="bottom" secondItem="tWU-Qa-Oa0" secondAttribute="bottom" id="ymg-dO-AoI"/>
                 </constraints>
-                <animations/>
             </view>
         </window>
     </objects>

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

@@ -37,7 +37,7 @@ PolycodeTemplateApp::PolycodeTemplateApp(PolycodeView *view) {
     camera->getShaderPass(3).shaderBinding->addParam(ProgramParam::PARAM_NUMBER, "bloomFactor")->setNumber(2.0);
     camera->getShaderPass(3).shaderBinding->addParam(ProgramParam::PARAM_NUMBER, "exposure")->setNumber(0.7);
     
-    
+  //  scene->getDefaultCamera()->setPostFilterByName("Invert");
 //    Sound *music = new Sound("BUGSHUFFLE.ogg");
   //  music->Play();
     

Разница между файлами не показана из-за своего большого размера
+ 3 - 0
build/rpi/Makefile


+ 10 - 0
build/rpi/TemplateApp/PolycodeTemplate.cpp

@@ -0,0 +1,10 @@
+#include "PolycodeTemplateApp.h"
+
+
+int main(int argc, char **argv) {
+	PolycodeView *view = new PolycodeView();
+	PolycodeTemplateApp *app = new PolycodeTemplateApp(view);
+	while(app->Update()) {
+	}
+	return 0;
+}

+ 72 - 0
build/rpi/TemplateApp/PolycodeTemplateApp.cpp

@@ -0,0 +1,72 @@
+//
+// Polycode template. Write your code here.
+// 
+
+#include "PolycodeTemplateApp.h"
+
+
+PolycodeTemplateApp::PolycodeTemplateApp(PolycodeView *view) {
+    core = new POLYCODE_CORE(view, 800,480,false,false, 0,0,60);
+    
+  //  core->addFileSource("archive", "default.pak");
+    ResourcePool *globalPool = Services()->getResourceManager()->getGlobalPool();
+    globalPool->loadResourcesFromFolder("default", true);
+    
+	// Write your code here!
+    
+    Scene *scene = new Scene(Scene::SCENE_2D);
+    scene->useClearColor = true;
+    
+    ScenePrimitive *test = new ScenePrimitive(ScenePrimitive::TYPE_VPLANE, 0.5, 0.5);
+    test->setMaterialByName("Unlit");
+    test->getShaderPass(0).shaderBinding->loadTextureForParam("diffuse", "main_icon.png");
+    scene->addChild(test);
+	test->setPositionY(0.2);
+    
+    SceneLabel *testLabel = new SceneLabel("Hello Polycode!", 32, "sans", Label::ANTIALIAS_FULL, 0.2);
+	testLabel->setPositionY(-0.2);
+    scene->addChild(testLabel);
+    
+/*
+    bgSound = new Sound("bedlayer_main.wav");
+    bgSound->Play();
+//    bgSound->setPitch(10.0);
+    
+    
+    sound1 = new Sound("marimba-lo.wav");
+    
+    sound1->setPitch(2.3);
+    
+    sound2 = new Sound("initial_touch_01.wav");
+    sound3 = new Sound("curve_02_c.wav");
+    
+    //sound2->Play(true);
+  */
+  
+    Services()->getInput()->addEventListener(this, InputEvent::EVENT_KEYDOWN);
+}
+
+void PolycodeTemplateApp::handleEvent(Event *event) {
+    InputEvent *inputEvent = (InputEvent*) event;
+    
+    switch(inputEvent->getKey()) {
+        case KEY_z:
+            sound1->Play(true);
+        break;
+        case KEY_x:
+            sound2->Play();
+        break;
+        case KEY_c:
+            sound3->Play();
+        break;
+            
+    }
+}
+
+PolycodeTemplateApp::~PolycodeTemplateApp() {
+    
+}
+
+bool PolycodeTemplateApp::Update() {
+    return core->updateAndRender();
+}

+ 27 - 0
build/rpi/TemplateApp/PolycodeTemplateApp.h

@@ -0,0 +1,27 @@
+//
+// Polycode template. Write your code here.
+//
+
+#include "Polycode.h"
+
+using namespace Polycode;
+
+class PolycodeTemplateApp : public EventHandler {
+public:
+    PolycodeTemplateApp(PolycodeView *view);
+    ~PolycodeTemplateApp();
+    
+    void handleEvent(Event *event);
+    
+    bool Update();
+    
+private:
+    
+    Sound *bgSound;
+    
+    Sound *sound1;
+    Sound *sound2;
+    Sound *sound3;
+    
+    Core *core;
+};

BIN
build/rpi/TemplateApp/main_icon.png


+ 4 - 1
build/windows/universal/Polycode.sln

@@ -1,9 +1,12 @@
 
 Microsoft Visual Studio Solution File, Format Version 12.00
 # Visual Studio 14
-VisualStudioVersion = 14.0.23107.0
+VisualStudioVersion = 14.0.24720.0
 MinimumVisualStudioVersion = 10.0.40219.1
 Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "TemplateApp", "TemplateApp\TemplateApp.vcxproj", "{A19BD860-B494-4D18-8AFB-B788E29236CF}"
+	ProjectSection(ProjectDependencies) = postProject
+		{EE7AE05C-9AE5-47FA-8A08-28E8D8D89B94} = {EE7AE05C-9AE5-47FA-8A08-28E8D8D89B94}
+	EndProjectSection
 EndProject
 Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "PolycodeCore", "PolycodeCore\PolycodeCore.vcxproj", "{EE7AE05C-9AE5-47FA-8A08-28E8D8D89B94}"
 EndProject

+ 5 - 4
build/windows/universal/PolycodeCore/PolycodeCore.vcxproj

@@ -33,7 +33,6 @@
     <ClInclude Include="..\..\..\..\include\polycode\core\PolyBone.h" />
     <ClInclude Include="..\..\..\..\include\polycode\core\PolyCamera.h" />
     <ClInclude Include="..\..\..\..\include\polycode\core\PolyClient.h" />
-    <ClInclude Include="..\..\..\..\include\polycode\core\PolyCocoaCore.h" />
     <ClInclude Include="..\..\..\..\include\polycode\core\PolyColor.h" />
     <ClInclude Include="..\..\..\..\include\polycode\core\PolyConfig.h" />
     <ClInclude Include="..\..\..\..\include\polycode\core\PolyCore.h" />
@@ -264,7 +263,7 @@
   <PropertyGroup />
   <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
     <GenerateManifest>false</GenerateManifest>
-    <IncludePath>../../../../include;$(IncludePath)</IncludePath>
+    <IncludePath>../../../../include/angle;../../../../include;$(IncludePath)</IncludePath>
     <OutDir>..\..\..\..\lib\windows\x86</OutDir>
     <TargetName>Polycored</TargetName>
   </PropertyGroup>
@@ -276,9 +275,11 @@
   </PropertyGroup>
   <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|ARM'">
     <GenerateManifest>false</GenerateManifest>
+    <TargetName>Polycored</TargetName>
   </PropertyGroup>
   <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|ARM'">
     <GenerateManifest>false</GenerateManifest>
+    <TargetName>Polycore</TargetName>
   </PropertyGroup>
   <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
     <GenerateManifest>false</GenerateManifest>
@@ -348,7 +349,7 @@
       <PrecompiledHeader>NotUsing</PrecompiledHeader>
       <CompileAsWinRT>false</CompileAsWinRT>
       <SDLCheck>true</SDLCheck>
-      <PreprocessorDefinitions>_CRT_SECURE_NO_WARNINGS;_UNICODE;UNICODE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+      <PreprocessorDefinitions>NO_OGG;_CRT_SECURE_NO_WARNINGS;_UNICODE;UNICODE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
     </ClCompile>
     <Link>
       <SubSystem>Console</SubSystem>
@@ -364,7 +365,7 @@
       <PrecompiledHeader>NotUsing</PrecompiledHeader>
       <CompileAsWinRT>false</CompileAsWinRT>
       <SDLCheck>true</SDLCheck>
-      <PreprocessorDefinitions>_CRT_SECURE_NO_WARNINGS;_WINDOWS;_UNICODE;UNICODE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+      <PreprocessorDefinitions>NO_OGG;_CRT_SECURE_NO_WARNINGS;_WINDOWS;_UNICODE;UNICODE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
     </ClCompile>
     <Link>
       <SubSystem>Console</SubSystem>

+ 0 - 3
build/windows/universal/PolycodeCore/PolycodeCore.vcxproj.filters

@@ -24,9 +24,6 @@
     <ClInclude Include="..\..\..\..\include\polycode\core\PolyClient.h">
       <Filter>Include</Filter>
     </ClInclude>
-    <ClInclude Include="..\..\..\..\include\polycode\core\PolyCocoaCore.h">
-      <Filter>Include</Filter>
-    </ClInclude>
     <ClInclude Include="..\..\..\..\include\Polycode.h">
       <Filter>Include</Filter>
     </ClInclude>

+ 1 - 1
build/windows/universal/TemplateApp/PolycodeTemplateApp.cpp

@@ -23,7 +23,7 @@ PolycodeTemplateApp::PolycodeTemplateApp(PolycodeView *view) {
     
     ScenePrimitive *test = new ScenePrimitive(ScenePrimitive::TYPE_VPLANE, 0.5, 0.5);
     test->setMaterialByName("Unlit");
-    test->getLocalShaderOptions()->loadTextureForParam("diffuse", "main_icon.png");
+	test->getShaderPass(0).shaderBinding->loadTextureForParam("diffuse", "white.png");
     scene->addChild(test);
 
 	Sound *bgSound = new Sound("bedlayer_main.wav");

+ 15 - 12
build/windows/universal/TemplateApp/TemplateApp.vcxproj

@@ -105,28 +105,30 @@
     <PackageCertificateKeyFile>TemplateApp_TemporaryKey.pfx</PackageCertificateKeyFile>
   </PropertyGroup>
   <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
-    <IncludePath>..\..\..\..\include;$(IncludePath)</IncludePath>
+    <IncludePath>../../../../include/angle;../../../../include;$(IncludePath)</IncludePath>
+    <LibraryPath>..\..\..\..\lib\windows\x86;$(LibraryPath)</LibraryPath>
   </PropertyGroup>
   <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
-    <IncludePath>..\..\..\..\include;$(IncludePath)</IncludePath>
+    <IncludePath>../../../../include/angle;../../../../include;$(IncludePath)</IncludePath>
+    <LibraryPath>..\..\..\..\lib\windows\x86;$(LibraryPath)</LibraryPath>
   </PropertyGroup>
   <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|ARM'">
-    <IncludePath>..\..\..\..\include;$(IncludePath)</IncludePath>
+    <IncludePath>../../../../include/angle;../../../../include;$(IncludePath)</IncludePath>
   </PropertyGroup>
   <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|ARM'">
-    <IncludePath>..\..\..\..\include;$(IncludePath)</IncludePath>
+    <IncludePath>../../../../include/angle;../../../../include;$(IncludePath)</IncludePath>
   </PropertyGroup>
   <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
-    <IncludePath>..\..\..\..\include;$(IncludePath)</IncludePath>
+    <IncludePath>../../../../include/angle;../../../../include;$(IncludePath)</IncludePath>
     <LibraryPath>..\..\..\..\lib\windows\x64;$(LibraryPath)</LibraryPath>
   </PropertyGroup>
   <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
-    <IncludePath>..\..\..\..\include;$(IncludePath)</IncludePath>
+    <IncludePath>../../../../include/angle;../../../../include;$(IncludePath)</IncludePath>
     <LibraryPath>..\..\..\..\lib\windows\x64;$(LibraryPath)</LibraryPath>
   </PropertyGroup>
   <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|ARM'">
     <Link>
-      <AdditionalDependencies>mincore.lib;d3d12.lib;dxgi.lib;windowscodecs.lib;%(AdditionalDependencies)</AdditionalDependencies>
+      <AdditionalDependencies>freetype.lib;mincore.lib;libGLESv2.lib;libEGL.lib;libogg.lib;libvorbis.lib;libvorbisfile.lib;physfs.lib;portaudio.lib;Xaudio2.lib;Polycored.lib</AdditionalDependencies>
       <AdditionalLibraryDirectories>%(AdditionalLibraryDirectories); $(VCInstallDir)\lib\store\arm; $(VCInstallDir)\lib\arm</AdditionalLibraryDirectories>
     </Link>
     <ClCompile>
@@ -140,7 +142,7 @@
   </ItemDefinitionGroup>
   <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|ARM'">
     <Link>
-      <AdditionalDependencies>mincore.lib;d3d12.lib;dxgi.lib;windowscodecs.lib;%(AdditionalDependencies)</AdditionalDependencies>
+      <AdditionalDependencies>freetype.lib;mincore.lib;libGLESv2.lib;libEGL.lib;libogg.lib;libvorbis.lib;libvorbisfile.lib;physfs.lib;portaudio.lib;Xaudio2.lib;Polycore.lib;%(AdditionalDependencies)</AdditionalDependencies>
       <AdditionalLibraryDirectories>%(AdditionalLibraryDirectories); $(VCInstallDir)\lib\store\arm; $(VCInstallDir)\lib\arm</AdditionalLibraryDirectories>
     </Link>
     <ClCompile>
@@ -154,7 +156,7 @@
   </ItemDefinitionGroup>
   <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
     <Link>
-      <AdditionalDependencies>mincore.lib;d3d12.lib;dxgi.lib;windowscodecs.lib;%(AdditionalDependencies)</AdditionalDependencies>
+      <AdditionalDependencies>freetype.lib;mincore.lib;libGLESv2.lib;libEGL.lib;libogg.lib;libvorbis.lib;libvorbisfile.lib;physfs.lib;portaudio.lib;Xaudio2.lib;Polycored.lib</AdditionalDependencies>
       <AdditionalLibraryDirectories>%(AdditionalLibraryDirectories); $(VCInstallDir)\lib\store; $(VCInstallDir)\lib</AdditionalLibraryDirectories>
     </Link>
     <ClCompile>
@@ -164,11 +166,12 @@
       <AdditionalOptions>/bigobj %(AdditionalOptions)</AdditionalOptions>
       <DisableSpecificWarnings>4453;28204</DisableSpecificWarnings>
       <PreprocessorDefinitions>_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+      <PrecompiledHeader>NotUsing</PrecompiledHeader>
     </ClCompile>
   </ItemDefinitionGroup>
   <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
     <Link>
-      <AdditionalDependencies>mincore.lib;d3d12.lib;dxgi.lib;windowscodecs.lib;%(AdditionalDependencies)</AdditionalDependencies>
+      <AdditionalDependencies>freetype.lib;mincore.lib;libGLESv2.lib;libEGL.lib;libogg.lib;libvorbis.lib;libvorbisfile.lib;physfs.lib;portaudio.lib;Xaudio2.lib;Polycore.lib;%(AdditionalDependencies)</AdditionalDependencies>
       <AdditionalLibraryDirectories>%(AdditionalLibraryDirectories); $(VCInstallDir)\lib\store; $(VCInstallDir)\lib</AdditionalLibraryDirectories>
     </Link>
     <ClCompile>
@@ -182,7 +185,7 @@
   </ItemDefinitionGroup>
   <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
     <Link>
-      <AdditionalDependencies>freetype.lib;Polycored.lib;libGLESv2.lib;libEGL.lib;%(AdditionalDependencies)</AdditionalDependencies>
+      <AdditionalDependencies>freetype.lib;mincore.lib;libGLESv2.lib;libEGL.lib;libogg.lib;libvorbis.lib;libvorbisfile.lib;physfs.lib;portaudio.lib;Xaudio2.lib;Polycored.lib</AdditionalDependencies>
       <AdditionalLibraryDirectories>%(AdditionalLibraryDirectories); $(VCInstallDir)\lib\store\amd64; $(VCInstallDir)\lib\amd64</AdditionalLibraryDirectories>
     </Link>
     <ClCompile>
@@ -199,7 +202,7 @@
   </ItemDefinitionGroup>
   <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
     <Link>
-      <AdditionalDependencies>freetype.lib;Polycore.lib;mincore.lib;libGLESv2.lib;libEGL.lib;%(AdditionalDependencies)</AdditionalDependencies>
+      <AdditionalDependencies>freetype.lib;mincore.lib;libGLESv2.lib;libEGL.lib;libogg.lib;libvorbis.lib;libvorbisfile.lib;physfs.lib;portaudio.lib;Xaudio2.lib;Polycore.lib;%(AdditionalDependencies)</AdditionalDependencies>
       <AdditionalLibraryDirectories>%(AdditionalLibraryDirectories); $(VCInstallDir)\lib\store\amd64; $(VCInstallDir)\lib\amd64</AdditionalLibraryDirectories>
     </Link>
     <ClCompile>

+ 12 - 2
build/windows/win32/Polycode.sln

@@ -1,15 +1,25 @@
 
 Microsoft Visual Studio Solution File, Format Version 12.00
-# Visual Studio Express 2013 for Windows Desktop
-VisualStudioVersion = 12.0.40629.0
+# Visual Studio 14
+VisualStudioVersion = 14.0.24720.0
 MinimumVisualStudioVersion = 10.0.40219.1
 Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "PolycodeCore", "PolycodeCore\PolycodeCore.vcxproj", "{92C7971A-F305-4B93-A9DC-6B01AF222FF9}"
 EndProject
 Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "TemplateApp", "TemplateApp\TemplateApp.vcxproj", "{E09F38FA-C860-4E70-8FA4-45DD7165778B}"
+	ProjectSection(ProjectDependencies) = postProject
+		{92C7971A-F305-4B93-A9DC-6B01AF222FF9} = {92C7971A-F305-4B93-A9DC-6B01AF222FF9}
+	EndProjectSection
 EndProject
 Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "PolycodeStudio", "PolycodeStudio\PolycodeStudio.vcxproj", "{A9A71037-BC64-45D6-B872-90EF22ABB23A}"
+	ProjectSection(ProjectDependencies) = postProject
+		{92C7971A-F305-4B93-A9DC-6B01AF222FF9} = {92C7971A-F305-4B93-A9DC-6B01AF222FF9}
+		{3E46FB61-BF79-46C9-8D1A-A6FFF1EA49FA} = {3E46FB61-BF79-46C9-8D1A-A6FFF1EA49FA}
+	EndProjectSection
 EndProject
 Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "PolycodeUI", "PolycodeUI\PolycodeUI.vcxproj", "{3E46FB61-BF79-46C9-8D1A-A6FFF1EA49FA}"
+	ProjectSection(ProjectDependencies) = postProject
+		{92C7971A-F305-4B93-A9DC-6B01AF222FF9} = {92C7971A-F305-4B93-A9DC-6B01AF222FF9}
+	EndProjectSection
 EndProject
 Global
 	GlobalSection(SolutionConfigurationPlatforms) = preSolution

+ 13 - 4
build/windows/win32/PolycodeCore/PolycodeCore.vcxproj

@@ -69,18 +69,22 @@
   <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
     <IncludePath>..\..\..\..\include;$(IncludePath)</IncludePath>
     <OutDir>..\..\..\..\lib\win32\x86</OutDir>
+    <TargetName>Polycore_d</TargetName>
   </PropertyGroup>
   <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
     <IncludePath>..\..\..\..\include;$(IncludePath)</IncludePath>
     <OutDir>..\..\..\..\lib\win32\x64</OutDir>
+    <TargetName>Polycore_d</TargetName>
   </PropertyGroup>
   <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
     <IncludePath>..\..\..\..\include;$(IncludePath)</IncludePath>
     <OutDir>..\..\..\..\lib\win32\x86</OutDir>
+    <TargetName>Polycore</TargetName>
   </PropertyGroup>
   <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
     <IncludePath>..\..\..\..\include;$(IncludePath)</IncludePath>
     <OutDir>..\..\..\..\lib\win32\x64</OutDir>
+    <TargetName>Polycore</TargetName>
   </PropertyGroup>
   <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
     <ClCompile>
@@ -88,7 +92,9 @@
       </PrecompiledHeader>
       <WarningLevel>Level3</WarningLevel>
       <Optimization>Disabled</Optimization>
-      <PreprocessorDefinitions>WIN32;_DEBUG;_LIB;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+      <PreprocessorDefinitions>_WINDOWS;WIN32;_DEBUG;_LIB;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+      <AdditionalIncludeDirectories>
+      </AdditionalIncludeDirectories>
     </ClCompile>
     <Link>
       <SubSystem>Windows</SubSystem>
@@ -101,7 +107,8 @@
       </PrecompiledHeader>
       <WarningLevel>Level3</WarningLevel>
       <Optimization>Disabled</Optimization>
-      <PreprocessorDefinitions>WIN32;_DEBUG;_LIB;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+      <PreprocessorDefinitions>_WINDOWS;WIN32;_DEBUG;_LIB;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+      <AdditionalIncludeDirectories>..\..\..\include</AdditionalIncludeDirectories>
     </ClCompile>
     <Link>
       <SubSystem>Windows</SubSystem>
@@ -116,7 +123,8 @@
       <Optimization>MaxSpeed</Optimization>
       <FunctionLevelLinking>true</FunctionLevelLinking>
       <IntrinsicFunctions>true</IntrinsicFunctions>
-      <PreprocessorDefinitions>WIN32;NDEBUG;_LIB;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+      <PreprocessorDefinitions>_WINDOWS;WIN32;NDEBUG;_LIB;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+      <AdditionalIncludeDirectories>..\..\..\include</AdditionalIncludeDirectories>
     </ClCompile>
     <Link>
       <SubSystem>Windows</SubSystem>
@@ -133,7 +141,8 @@
       <Optimization>MaxSpeed</Optimization>
       <FunctionLevelLinking>true</FunctionLevelLinking>
       <IntrinsicFunctions>true</IntrinsicFunctions>
-      <PreprocessorDefinitions>WIN32;NDEBUG;_LIB;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+      <PreprocessorDefinitions>_WINDOWS;WIN32;NDEBUG;_LIB;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+      <AdditionalIncludeDirectories>..\..\..\include</AdditionalIncludeDirectories>
     </ClCompile>
     <Link>
       <SubSystem>Windows</SubSystem>

+ 50 - 4
build/windows/win32/PolycodeStudio/PolycodeStudio.vcxproj

@@ -68,6 +68,7 @@
   <PropertyGroup Label="UserMacros" />
   <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
     <LinkIncremental>true</LinkIncremental>
+    <LibraryPath>..\..\..\..\lib\win32\x86;$(LibraryPath)</LibraryPath>
   </PropertyGroup>
   <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
     <LinkIncremental>true</LinkIncremental>
@@ -76,6 +77,7 @@
   </PropertyGroup>
   <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
     <LinkIncremental>false</LinkIncremental>
+    <LibraryPath>..\..\..\..\lib\win32\x86;$(LibraryPath)</LibraryPath>
   </PropertyGroup>
   <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
     <LinkIncremental>false</LinkIncremental>
@@ -89,11 +91,24 @@
       <WarningLevel>Level3</WarningLevel>
       <Optimization>Disabled</Optimization>
       <PreprocessorDefinitions>WIN32;_DEBUG;_WINDOWS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+      <AdditionalIncludeDirectories>..\..\..\..\include;$(ProjectDir)</AdditionalIncludeDirectories>
     </ClCompile>
     <Link>
       <SubSystem>Windows</SubSystem>
       <GenerateDebugInformation>true</GenerateDebugInformation>
+      <AdditionalDependencies>ws2_32.lib;winmm.lib;pathcch.lib;portaudio.lib;lua5.1.lib;libvorbisfile.lib;libvorbis.lib;libogg.lib;opengl32.lib;glew32s.lib;glew32.lib;freetype.lib;physfs.lib;zlib.lib;PolycodeUI_d.lib;Polycore_d.lib;%(AdditionalDependencies)</AdditionalDependencies>
     </Link>
+    <PostBuildEvent>
+      <Command>if not exist "$(TargetDir)default.pak" copy "..\..\..\..\assets\default\default.pak" "$(TargetDir)"
+if not exist "$(TargetDir)glew32.dll" copy "..\..\..\..\lib\win32\$(PlatformTarget)\bin\glew32.dll" "$(TargetDir)"
+
+xcopy /E /Y "..\..\..\..\assets\ide" "$(TargetDir)"
+
+if not exist "$(TargetDir)Standalone" (
+  mkdir "$(TargetDir)Standalone"
+)
+@rem xcopy /E /Y "$(PolycodeDir)..\Standalone" "$(TargetDir)Standalone"</Command>
+    </PostBuildEvent>
   </ItemDefinitionGroup>
   <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
     <ClCompile>
@@ -102,14 +117,23 @@
       <WarningLevel>Level3</WarningLevel>
       <Optimization>Disabled</Optimization>
       <PreprocessorDefinitions>WIN32;_DEBUG;_WINDOWS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+      <AdditionalIncludeDirectories>..\..\..\..\include;$(ProjectDir)</AdditionalIncludeDirectories>
     </ClCompile>
     <Link>
       <SubSystem>Windows</SubSystem>
       <GenerateDebugInformation>true</GenerateDebugInformation>
-      <AdditionalDependencies>Shlwapi.lib;PolycodeUI.lib;ws2_32.lib;opengl32.lib;glew32.lib;zlib.lib;freetype.lib;libogg.lib;libvorbis.lib;libvorbisfile.lib;lua5.1.lib;physfs.lib;PolycodeCore.lib;Winmm.lib;kernel32.lib;user32.lib;gdi32.lib;winspool.lib;comdlg32.lib;advapi32.lib;shell32.lib;ole32.lib;oleaut32.lib;uuid.lib;odbc32.lib;odbccp32.lib;%(AdditionalDependencies)</AdditionalDependencies>
+      <AdditionalDependencies>ws2_32.lib;winmm.lib;pathcch.lib;portaudio.lib;lua5.1.lib;libvorbisfile.lib;libvorbis.lib;libogg.lib;opengl32.lib;glew32s.lib;glew32.lib;freetype.lib;physfs.lib;zlib.lib;PolycodeUI_d.lib;Polycore_d.lib;%(AdditionalDependencies)</AdditionalDependencies>
     </Link>
     <PostBuildEvent>
-      <Command>xcopy /E /Y "$(ProjectDir)\..\..\..\..\assets\ide\*" "$(ProjectDir)"</Command>
+      <Command>if not exist "$(TargetDir)default.pak" copy "..\..\..\..\assets\default\default.pak" "$(TargetDir)"
+if not exist "$(TargetDir)glew32.dll" copy "..\..\..\..\lib\win32\$(PlatformTarget)\bin\glew32.dll" "$(TargetDir)"
+
+xcopy /E /Y "..\..\..\..\assets\ide" "$(TargetDir)"
+
+if not exist "$(TargetDir)Standalone" (
+  mkdir "$(TargetDir)Standalone"
+)
+@rem xcopy /E /Y "$(PolycodeDir)..\Standalone" "$(TargetDir)Standalone"</Command>
     </PostBuildEvent>
   </ItemDefinitionGroup>
   <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
@@ -121,13 +145,26 @@
       <FunctionLevelLinking>true</FunctionLevelLinking>
       <IntrinsicFunctions>true</IntrinsicFunctions>
       <PreprocessorDefinitions>WIN32;NDEBUG;_WINDOWS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+      <AdditionalIncludeDirectories>..\..\..\..\include;$(ProjectDir)</AdditionalIncludeDirectories>
     </ClCompile>
     <Link>
       <SubSystem>Windows</SubSystem>
       <GenerateDebugInformation>true</GenerateDebugInformation>
       <EnableCOMDATFolding>true</EnableCOMDATFolding>
       <OptimizeReferences>true</OptimizeReferences>
+      <AdditionalDependencies>ws2_32.lib;winmm.lib;pathcch.lib;portaudio.lib;lua5.1.lib;libvorbisfile.lib;libvorbis.lib;libogg.lib;opengl32.lib;glew32s.lib;glew32.lib;freetype.lib;physfs.lib;zlib.lib;PolycodeUI.lib;Polycore.lib;%(AdditionalDependencies)</AdditionalDependencies>
     </Link>
+    <PostBuildEvent>
+      <Command>if not exist "$(TargetDir)default.pak" copy "..\..\..\..\assets\default\default.pak" "$(TargetDir)"
+if not exist "$(TargetDir)glew32.dll" copy "..\..\..\..\lib\win32\$(PlatformTarget)\bin\glew32.dll" "$(TargetDir)"
+
+xcopy /E /Y "..\..\..\..\assets\ide" "$(TargetDir)"
+
+if not exist "$(TargetDir)Standalone" (
+  mkdir "$(TargetDir)Standalone"
+)
+@rem xcopy /E /Y "$(PolycodeDir)..\Standalone" "$(TargetDir)Standalone"</Command>
+    </PostBuildEvent>
   </ItemDefinitionGroup>
   <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
     <ClCompile>
@@ -138,16 +175,25 @@
       <FunctionLevelLinking>true</FunctionLevelLinking>
       <IntrinsicFunctions>true</IntrinsicFunctions>
       <PreprocessorDefinitions>WIN32;NDEBUG;_WINDOWS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+      <AdditionalIncludeDirectories>..\..\..\..\include;$(ProjectDir)</AdditionalIncludeDirectories>
     </ClCompile>
     <Link>
       <SubSystem>Windows</SubSystem>
       <GenerateDebugInformation>true</GenerateDebugInformation>
       <EnableCOMDATFolding>true</EnableCOMDATFolding>
       <OptimizeReferences>true</OptimizeReferences>
-      <AdditionalDependencies>Shlwapi.lib;PolycodeUI.lib;ws2_32.lib;opengl32.lib;glew32.lib;zlib.lib;freetype.lib;libogg.lib;libvorbis.lib;libvorbisfile.lib;lua5.1.lib;physfs.lib;PolycodeCore.lib;Winmm.lib;kernel32.lib;user32.lib;gdi32.lib;winspool.lib;comdlg32.lib;advapi32.lib;shell32.lib;ole32.lib;oleaut32.lib;uuid.lib;odbc32.lib;odbccp32.lib;%(AdditionalDependencies)</AdditionalDependencies>
+      <AdditionalDependencies>ws2_32.lib;winmm.lib;pathcch.lib;portaudio.lib;lua5.1.lib;libvorbisfile.lib;libvorbis.lib;libogg.lib;opengl32.lib;glew32s.lib;glew32.lib;freetype.lib;physfs.lib;zlib.lib;PolycodeUI.lib;Polycore.lib;%(AdditionalDependencies)</AdditionalDependencies>
     </Link>
     <PostBuildEvent>
-      <Command>xcopy /E /Y "$(ProjectDir)\..\..\..\..\assets\ide\*" "$(OutDir)"</Command>
+      <Command>if not exist "$(TargetDir)default.pak" copy "..\..\..\..\assets\default\default.pak" "$(TargetDir)"
+if not exist "$(TargetDir)glew32.dll" copy "..\..\..\..\lib\win32\$(PlatformTarget)\bin\glew32.dll" "$(TargetDir)"
+
+xcopy /E /Y "..\..\..\..\assets\ide" "$(TargetDir)"
+
+if not exist "$(TargetDir)Standalone" (
+  mkdir "$(TargetDir)Standalone"
+)
+@rem xcopy /E /Y "$(PolycodeDir)..\Standalone" "$(TargetDir)Standalone"</Command>
     </PostBuildEvent>
   </ItemDefinitionGroup>
   <ItemGroup>

+ 1 - 1
build/windows/win32/PolycodeStudio/PolycodeStudio.vcxproj.filters

@@ -234,7 +234,7 @@
       <Filter>Header Files</Filter>
     </ClInclude>
     <ClInclude Include="resource.h">
-      <Filter>Header Files</Filter>
+      <Filter>Resource Files</Filter>
     </ClInclude>
   </ItemGroup>
   <ItemGroup>

+ 2 - 1
build/windows/win32/PolycodeStudio/main.cpp

@@ -6,6 +6,7 @@
 #include <Shlobj.h>
 #include <Shlwapi.h>
 #include <shellapi.h>
+#include <Pathcch.h>
 
 extern PolycodeIDEApp *globalApp;
 
@@ -72,7 +73,7 @@ int APIENTRY WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLi
 
 	TCHAR FilePath[MAX_PATH] = { 0 };
 	GetModuleFileName( 0, FilePath, MAX_PATH );
-	PathRemoveFileSpec( FilePath );    
+	PathCchRemoveFileSpec( FilePath, MAX_PATH);
 	SetCurrentDirectory( FilePath );
 
 	PolycodeWinIDEView *view = new PolycodeWinIDEView(hInstance, nCmdShow, L"Polycode", true, false);

+ 12 - 0
build/windows/win32/PolycodeUI/PolycodeUI.vcxproj

@@ -69,11 +69,19 @@
   <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
     <OutDir>..\..\..\..\lib\win32\x64</OutDir>
     <IncludePath>..\..\..\..\include;$(IncludePath)</IncludePath>
+    <TargetName>$(ProjectName)_d</TargetName>
   </PropertyGroup>
   <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
     <OutDir>..\..\..\..\lib\win32\x64</OutDir>
     <IncludePath>..\..\..\..\include;$(IncludePath)</IncludePath>
   </PropertyGroup>
+  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
+    <OutDir>..\..\..\..\lib\win32\x86\</OutDir>
+    <TargetName>$(ProjectName)_d</TargetName>
+  </PropertyGroup>
+  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
+    <OutDir>..\..\..\..\lib\win32\x86\</OutDir>
+  </PropertyGroup>
   <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
     <ClCompile>
       <PrecompiledHeader>
@@ -81,6 +89,7 @@
       <WarningLevel>Level3</WarningLevel>
       <Optimization>Disabled</Optimization>
       <PreprocessorDefinitions>WIN32;_DEBUG;_LIB;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+      <AdditionalIncludeDirectories>..\..\..\..\include</AdditionalIncludeDirectories>
     </ClCompile>
     <Link>
       <SubSystem>Windows</SubSystem>
@@ -94,6 +103,7 @@
       <WarningLevel>Level3</WarningLevel>
       <Optimization>Disabled</Optimization>
       <PreprocessorDefinitions>WIN32;_DEBUG;_LIB;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+      <AdditionalIncludeDirectories>..\..\..\..\include</AdditionalIncludeDirectories>
     </ClCompile>
     <Link>
       <SubSystem>Windows</SubSystem>
@@ -109,6 +119,7 @@
       <FunctionLevelLinking>true</FunctionLevelLinking>
       <IntrinsicFunctions>true</IntrinsicFunctions>
       <PreprocessorDefinitions>WIN32;NDEBUG;_LIB;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+      <AdditionalIncludeDirectories>..\..\..\..\include</AdditionalIncludeDirectories>
     </ClCompile>
     <Link>
       <SubSystem>Windows</SubSystem>
@@ -126,6 +137,7 @@
       <FunctionLevelLinking>true</FunctionLevelLinking>
       <IntrinsicFunctions>true</IntrinsicFunctions>
       <PreprocessorDefinitions>WIN32;NDEBUG;_LIB;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+      <AdditionalIncludeDirectories>..\..\..\..\include</AdditionalIncludeDirectories>
     </ClCompile>
     <Link>
       <SubSystem>Windows</SubSystem>

+ 4 - 4
build/windows/win32/TemplateApp/PolycodeTemplateApp.cpp

@@ -20,10 +20,10 @@ PolycodeTemplateApp::PolycodeTemplateApp(PolycodeView *view) {
     scene->getDefaultCamera()->setPosition(5.0, 5.0, 5.0);
     scene->getDefaultCamera()->lookAt(Vector3());
     
-   test = new ScenePrimitive(ScenePrimitive::TYPE_BOX, 1.0, 1.0, 1.0);
-    test->setMaterialByName("DefaultTextured");
-//    test->getShaderPass(0).shaderBinding->loadTextureForParam("diffuse", "white.png");
-  //  test->getShaderPass(0).shaderBinding->addParam(ProgramParam::PARAM_COLOR, "diffuse_color")->setColor(Color(1.0, 1.0, 1.0, 1.0));
+	test = new ScenePrimitive(ScenePrimitive::TYPE_BOX, 1.0, 1.0, 1.0);
+	test->setMaterialByName("DefaultTextured");
+	test->getShaderPass(0).shaderBinding->loadTextureForParam("diffuse", "white.png");
+	test->getShaderPass(0).shaderBinding->addParam(ProgramParam::PARAM_COLOR, "diffuse_color")->setColor(Color(1.0, 1.0, 1.0, 1.0));
     scene->addChild(test);
     
 

+ 0 - 0
build/windows/win32/TemplateApp/TemapleApp.cpp → build/windows/win32/TemplateApp/TemplateApp.cpp


+ 37 - 7
build/windows/win32/TemplateApp/TemplateApp.vcxproj

@@ -68,18 +68,25 @@
   <PropertyGroup Label="UserMacros" />
   <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
     <LinkIncremental>true</LinkIncremental>
+    <LibraryPath>..\..\..\..\lib\win32\$(PlatformShortName);$(LibraryPath)</LibraryPath>
+    <OutDir>$(ProjectDir)\$(Configuration)\</OutDir>
   </PropertyGroup>
   <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
     <LinkIncremental>true</LinkIncremental>
     <IncludePath>..\..\..\..\include;$(IncludePath)</IncludePath>
-    <LibraryPath>..\..\..\..\lib\win32\x64;$(LibraryPath)</LibraryPath>
+    <LibraryPath>..\..\..\..\lib\win32\$(PlatformShortName);$(LibraryPath)</LibraryPath>
+    <OutDir>$(ProjectDir)\$(Platform)\$(Configuration)\</OutDir>
   </PropertyGroup>
   <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
     <LinkIncremental>false</LinkIncremental>
+    <LibraryPath>..\..\..\..\lib\win32\$(PlatformShortName);$(LibraryPath)</LibraryPath>
+    <OutDir>$(ProjectDir)\$(Configuration)\</OutDir>
   </PropertyGroup>
   <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
     <LinkIncremental>false</LinkIncremental>
     <IncludePath>..\..\..\..\include;$(IncludePath)</IncludePath>
+    <OutDir>$(ProjectDir)\$(Platform)\$(Configuration)\</OutDir>
+    <LibraryPath>..\..\..\..\lib\win32\$(PlatformShortName);$(LibraryPath)</LibraryPath>
   </PropertyGroup>
   <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
     <ClCompile>
@@ -87,12 +94,18 @@
       </PrecompiledHeader>
       <WarningLevel>Level3</WarningLevel>
       <Optimization>Disabled</Optimization>
-      <PreprocessorDefinitions>WIN32;_DEBUG;_WINDOWS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+      <PreprocessorDefinitions>_WINDOWS;WIN32;_DEBUG;_WINDOWS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+      <AdditionalIncludeDirectories>..\..\..\..\include</AdditionalIncludeDirectories>
     </ClCompile>
     <Link>
       <SubSystem>Windows</SubSystem>
       <GenerateDebugInformation>true</GenerateDebugInformation>
+      <AdditionalDependencies>ws2_32.lib;winmm.lib;portaudio.lib;libvorbisfile.lib;libvorbis.lib;libogg.lib;opengl32.lib;glew32s.lib;glew32.lib;freetype.lib;physfs.lib;zlib.lib;Polycore_d.lib;%(AdditionalDependencies)</AdditionalDependencies>
     </Link>
+    <PostBuildEvent>
+      <Command>if not exist "$(TargetDir)default.pak" copy "..\..\..\..\assets\default\default.pak" "$(TargetDir)"
+if not exist "$(TargetDir)glew32.dll" copy "..\..\..\..\lib\win32\$(PlatformTarget)\bin\glew32.dll" "$(TargetDir)"</Command>
+    </PostBuildEvent>
   </ItemDefinitionGroup>
   <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
     <ClCompile>
@@ -100,13 +113,18 @@
       </PrecompiledHeader>
       <WarningLevel>Level3</WarningLevel>
       <Optimization>Disabled</Optimization>
-      <PreprocessorDefinitions>WIN32;_DEBUG;_WINDOWS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+      <PreprocessorDefinitions>_WINDOWS;WIN32;_DEBUG;_WINDOWS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+      <AdditionalIncludeDirectories>..\..\..\..\include</AdditionalIncludeDirectories>
     </ClCompile>
     <Link>
       <SubSystem>Windows</SubSystem>
       <GenerateDebugInformation>true</GenerateDebugInformation>
-      <AdditionalDependencies>ws2_32.lib;opengl32.lib;glew32.lib;zlib.lib;freetype.lib;libogg.lib;libvorbis.lib;libvorbisfile.lib;lua5.1.lib;physfs.lib;PolycodeCore.lib;Winmm.lib;kernel32.lib;user32.lib;gdi32.lib;winspool.lib;comdlg32.lib;advapi32.lib;shell32.lib;ole32.lib;oleaut32.lib;uuid.lib;odbc32.lib;odbccp32.lib;%(AdditionalDependencies)</AdditionalDependencies>
+      <AdditionalDependencies>ws2_32.lib;winmm.lib;portaudio.lib;libvorbisfile.lib;libvorbis.lib;libogg.lib;opengl32.lib;glew32s.lib;glew32.lib;freetype.lib;physfs.lib;zlib.lib;Polycore_d.lib;%(AdditionalDependencies)</AdditionalDependencies>
     </Link>
+    <PostBuildEvent>
+      <Command>if not exist "$(TargetDir)default.pak" copy "..\..\..\..\assets\default\default.pak" "$(TargetDir)"
+if not exist "$(TargetDir)glew32.dll" copy "..\..\..\..\lib\win32\$(PlatformTarget)\bin\glew32.dll" "$(TargetDir)"</Command>
+    </PostBuildEvent>
   </ItemDefinitionGroup>
   <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
     <ClCompile>
@@ -116,14 +134,20 @@
       <Optimization>MaxSpeed</Optimization>
       <FunctionLevelLinking>true</FunctionLevelLinking>
       <IntrinsicFunctions>true</IntrinsicFunctions>
-      <PreprocessorDefinitions>WIN32;NDEBUG;_WINDOWS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+      <PreprocessorDefinitions>_WINDOWS;WIN32;NDEBUG;_WINDOWS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+      <AdditionalIncludeDirectories>..\..\..\..\include</AdditionalIncludeDirectories>
     </ClCompile>
     <Link>
       <SubSystem>Windows</SubSystem>
       <GenerateDebugInformation>true</GenerateDebugInformation>
       <EnableCOMDATFolding>true</EnableCOMDATFolding>
       <OptimizeReferences>true</OptimizeReferences>
+      <AdditionalDependencies>ws2_32.lib;winmm.lib;portaudio.lib;libvorbisfile.lib;libvorbis.lib;libogg.lib;opengl32.lib;glew32s.lib;glew32.lib;freetype.lib;physfs.lib;zlib.lib;Polycore.lib;%(AdditionalDependencies)</AdditionalDependencies>
     </Link>
+    <PostBuildEvent>
+      <Command>if not exist "$(TargetDir)default.pak" copy "..\..\..\..\assets\default\default.pak" "$(TargetDir)"
+if not exist "$(TargetDir)glew32.dll" copy "..\..\..\..\lib\win32\$(PlatformTarget)\bin\glew32.dll" "$(TargetDir)"</Command>
+    </PostBuildEvent>
   </ItemDefinitionGroup>
   <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
     <ClCompile>
@@ -133,19 +157,25 @@
       <Optimization>MaxSpeed</Optimization>
       <FunctionLevelLinking>true</FunctionLevelLinking>
       <IntrinsicFunctions>true</IntrinsicFunctions>
-      <PreprocessorDefinitions>WIN32;NDEBUG;_WINDOWS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+      <PreprocessorDefinitions>_WINDOWS;WIN32;NDEBUG;_WINDOWS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+      <AdditionalIncludeDirectories>..\..\..\..\include</AdditionalIncludeDirectories>
     </ClCompile>
     <Link>
       <SubSystem>Windows</SubSystem>
       <GenerateDebugInformation>true</GenerateDebugInformation>
       <EnableCOMDATFolding>true</EnableCOMDATFolding>
       <OptimizeReferences>true</OptimizeReferences>
+      <AdditionalDependencies>ws2_32.lib;winmm.lib;portaudio.lib;libvorbisfile.lib;libvorbis.lib;libogg.lib;opengl32.lib;glew32s.lib;glew32.lib;freetype.lib;physfs.lib;zlib.lib;Polycore.lib;%(AdditionalDependencies)</AdditionalDependencies>
     </Link>
+    <PostBuildEvent>
+      <Command>if not exist "$(TargetDir)default.pak" copy "..\..\..\..\assets\default\default.pak" "$(TargetDir)"
+if not exist "$(TargetDir)glew32.dll" copy "..\..\..\..\lib\win32\$(PlatformTarget)\bin\glew32.dll" "$(TargetDir)"</Command>
+    </PostBuildEvent>
   </ItemDefinitionGroup>
   <ItemGroup>
     <ClCompile Include="..\..\..\..\src\view\win32\PolycodeView.cpp" />
     <ClCompile Include="PolycodeTemplateApp.cpp" />
-    <ClCompile Include="TemapleApp.cpp" />
+    <ClCompile Include="TemplateApp.cpp" />
   </ItemGroup>
   <ItemGroup>
     <ClInclude Include="..\..\..\..\include\polycode\view\win32\PolycodeView.h" />

+ 3 - 3
build/windows/win32/TemplateApp/TemplateApp.vcxproj.filters

@@ -15,15 +15,15 @@
     </Filter>
   </ItemGroup>
   <ItemGroup>
-    <ClCompile Include="TemapleApp.cpp">
-      <Filter>Source Files</Filter>
-    </ClCompile>
     <ClCompile Include="PolycodeTemplateApp.cpp">
       <Filter>Source Files</Filter>
     </ClCompile>
     <ClCompile Include="..\..\..\..\src\view\win32\PolycodeView.cpp">
       <Filter>Source Files</Filter>
     </ClCompile>
+    <ClCompile Include="TemplateApp.cpp">
+      <Filter>Source Files</Filter>
+    </ClCompile>
   </ItemGroup>
   <ItemGroup>
     <ClInclude Include="PolycodeTemplateApp.h">

+ 3 - 3
include/angle/EGL/egl.h

@@ -36,7 +36,7 @@ extern "C" {
 ** Khronos $Revision: 29318 $ on $Date: 2015-01-02 03:16:10 -0800 (Fri, 02 Jan 2015) $
 */
 
-#include <EGL/eglplatform.h>
+#include <angle/EGL/eglplatform.h>
 
 /* Generated on date 20150102 */
 
@@ -53,8 +53,8 @@ extern "C" {
 #define EGL_VERSION_1_0 1
 typedef unsigned int EGLBoolean;
 typedef void *EGLDisplay;
-#include <KHR/khrplatform.h>
-#include <EGL/eglplatform.h>
+#include <angle/KHR/khrplatform.h>
+#include <angle/EGL/eglplatform.h>
 typedef void *EGLConfig;
 typedef void *EGLSurface;
 typedef void *EGLContext;

+ 1 - 1
include/angle/EGL/eglext.h

@@ -36,7 +36,7 @@ extern "C" {
 ** Khronos $Revision: 27018 $ on $Date: 2014-06-10 08:06:12 -0700 (Tue, 10 Jun 2014) $
 */
 
-#include <EGL/eglplatform.h>
+#include <angle/EGL/eglplatform.h>
 
 #define EGL_EGLEXT_VERSION 20140610
 

+ 1 - 1
include/angle/EGL/eglplatform.h

@@ -34,7 +34,7 @@
  * by filing a bug against product "EGL" component "Registry".
  */
 
-#include <KHR/khrplatform.h>
+#include <angle/KHR/khrplatform.h>
 
 /* Macros used in EGL function prototype declarations.
  *

+ 1 - 1
include/angle/GLES2/gl2.h

@@ -3,7 +3,7 @@
 
 /* $Revision: 20555 $ on $Date:: 2013-02-12 14:32:47 -0800 #$ */
 
-#include <GLES2/gl2platform.h>
+#include <angle/GLES2/gl2platform.h>
 
 #ifdef __cplusplus
 extern "C" {

+ 1 - 1
include/angle/GLES2/gl2platform.h

@@ -17,7 +17,7 @@
  * by filing a bug against product "OpenGL-ES" component "Registry".
  */
 
-#include <KHR/khrplatform.h>
+#include <angle/KHR/khrplatform.h>
 
 #ifndef GL_APICALL
 #define GL_APICALL  KHRONOS_APICALL

+ 25 - 0
include/ogg/config_types.h

@@ -0,0 +1,25 @@
+#ifndef __CONFIG_TYPES_H__
+#define __CONFIG_TYPES_H__
+
+/* these are filled in by configure */
+#define INCLUDE_INTTYPES_H 1
+#define INCLUDE_STDINT_H 1
+#define INCLUDE_SYS_TYPES_H 1
+
+#if INCLUDE_INTTYPES_H
+#  include <inttypes.h>
+#endif
+#if INCLUDE_STDINT_H
+#  include <stdint.h>
+#endif
+#if INCLUDE_SYS_TYPES_H
+#  include <sys/types.h>
+#endif
+
+typedef short ogg_int16_t;
+typedef unsigned short ogg_uint16_t;
+typedef int ogg_int32_t;
+typedef unsigned int ogg_uint32_t;
+typedef long ogg_int64_t;
+
+#endif

+ 12 - 12
include/polycode/core/PolyCore.h

@@ -298,18 +298,18 @@ namespace Polycode {
 		
 		virtual String saveFilePicker(std::vector<CoreFileExtension> extensions) = 0;
 
-        virtual void handleVideoModeChange(VideoModeChangeInfo *modeInfo) = 0;
-        virtual void flushRenderContext() = 0;
-        
-        CoreFile *openFile(const Polycode::String& fileName, const Polycode::String& opts);
-        void closeFile(CoreFile *file);
-        
-        void addFileSource(const String &type, const String &source);
-        void removeFileSource(const String &type, const String &source);
-        
-        std::vector<OSFileEntry> parseFolder(const Polycode::String& pathString, bool showHidden);
+		virtual void handleVideoModeChange(VideoModeChangeInfo *modeInfo) = 0;
+		virtual void flushRenderContext() = 0;
+		
+		CoreFile *openFile(const Polycode::String& fileName, const Polycode::String& opts);
+		void closeFile(CoreFile *file);
+		
+		void addFileSource(const String &type, const String &source);
+		void removeFileSource(const String &type, const String &source);
+		
+		std::vector<OSFileEntry> parseFolder(const Polycode::String& pathString, bool showHidden);
 
-        virtual bool systemParseFolder(const Polycode::String& pathString, bool showHidden, std::vector<OSFileEntry> &targetVector) = 0;
+		virtual bool systemParseFolder(const Polycode::String& pathString, bool showHidden, std::vector<OSFileEntry> &targetVector) = 0;
         
         
 		/**
@@ -357,7 +357,7 @@ namespace Polycode {
 			return timeSleptMs;
 		}
         
-        Number getFixedTimestep();
+		Number getFixedTimestep();
 		
 		/**
 		* Returns the total ticks elapsed since launch.

+ 1 - 1
include/polycode/core/PolyCoreInput.h

@@ -95,7 +95,7 @@ namespace Polycode {
 		* @param keyCode The key to check for
 		* @return True if the key is pressed, false otherwise.
 		*/				
-		bool getKeyState(PolyKEY keyCode);		
+		bool getKeyState(PolyKEY keyCode);
 		
 		/** 
 		* Returns the state of the specified joystick button for the specified joystick index. If the joystick index is invalid, returns false

+ 16 - 1
include/polycode/core/PolyIOSCore.h

@@ -24,9 +24,24 @@ THE SOFTWARE.
 
 #include "polycode/core/PolyCore.h"
 #import "polycode/view/ios/PolycodeView.h"
+#include "polycode/core/PolyOpenGLGraphicsInterface.h"
+#include <pthread.h>
+
+@class PolycodeView;
+
+using namespace Polycode;
 
 #define POLYCODE_CORE IOSCore
 
+class _PolyExport PosixMutex : public CoreMutex {
+public:
+    void lock();
+    void unlock();
+    pthread_mutex_t pMutex;
+};
+
+
+
 namespace Polycode {
 
 	class _PolyExport IOSCore : public Core {
@@ -64,7 +79,7 @@ namespace Polycode {
 
 	private:
         
-        
+        PolycodeView *glView;
 
 	};
 }

+ 13 - 13
include/polycode/core/PolyOpenGLGraphicsInterface.h

@@ -40,29 +40,29 @@ THE SOFTWARE.
     #include <OpenGLES/ES2/glext.h>
 
 #elif PLATFORM == PLATFORM_WINDOWS
-/*
-	#if defined(WINAPI_FAMILY)
-		#include <GLES2/gl2.h>
-		#include <GLES2/gl2ext.h>
-		#include <EGL/egl.h>
-		#include <EGL/eglext.h>
-		#include <EGL/eglplatform.h>
-		#include <angle_windowsstore.h>
+
+	#if defined(WINAPI_FAMILY) && (WINAPI_FAMILY == WINAPI_FAMILY_PC_APP || WINAPI == WINAPI_FAMILIY_PHONE_APP)
+		#define STRICT_OPENGLES2
+		#include <angle/GLES2/gl2.h>
+		#include <angle/GLES2/gl2ext.h>
+		#include <angle/EGL/egl.h>
+		#include <angle/EGL/eglext.h>
+		#include <angle/EGL/eglplatform.h>
+		#include <angle/angle_windowsstore.h>
 	#else
-	*/
 		#include <glew/GL/glew.h>
-/*
 	#endif
-	*/
 #else	
 	#if defined(USE_EGL)
 		#include <EGL/egl.h>
 		#include <EGL/eglext.h>
 		#include <GLES2/gl2.h>
 	#else
-		#include <GL/gl.h>
+		#include <glew/GL/glew.h>
+		
+		/*#include <GL/gl.h>
 		#include <GL/glu.h>
-		#include <GL/glext.h>
+		#include <GL/glext.h>*/
 	#endif
 #endif
 

+ 17 - 4
include/polycode/core/PolySDLCore.h

@@ -25,6 +25,9 @@
 #include "PolyGlobals.h"
 #include "PolyCore.h"
 #include <vector>
+// #include <SDL2/SDL.h>
+
+#include "polycode/core/PolyPAAudioInterface.h"
 
 #define POLYCODE_CORE SDLCore
 
@@ -36,6 +39,8 @@ namespace Polycode {
 
 	class _PolyExport SDLCoreMutex : public CoreMutex {
 	public:
+		void lock();
+		void unlock();
 		SDL_mutex *pMutex;
 	};
 
@@ -51,14 +56,19 @@ namespace Polycode {
 		unsigned int getTicks();
 		bool systemUpdate();
 		void Render();
+		void flushRenderContext();
+		
+		void handleVideoModeChange(VideoModeChangeInfo *modeInfo);
 		void setVideoMode(int xRes, int yRes, bool fullScreen, bool vSync, int aaLevel, int anisotropyLevel, bool retinaSupport = true);
 		void createThread(Threaded *target);
 		std::vector<Rectangle> getVideoModes();
 		
+		bool systemParseFolder(const String& pathString, bool showHidden, std::vector<OSFileEntry> &targetVector);
+				
 		void setCursor(int cursorType);
 		void warpCursor(int x, int y);
-		void lockMutex(CoreMutex *mutex);
-		void unlockMutex(CoreMutex *mutex);
+		//void lockMutex(CoreMutex *mutex);
+		//void unlockMutex(CoreMutex *mutex);
 		CoreMutex *createMutex();
 		void copyStringToClipboard(const String& str);
 		String getClipboardString();
@@ -74,12 +84,15 @@ namespace Polycode {
 		String executeExternalCommand(String command, String args, String inDirectory="");
 		void openURL(String url);
 
-
 	private:
 		bool checkSpecialKeyEvents(PolyKEY key);
-
+		
 		uint32_t flags;
 		bool resizableWindow;
 		
+		String* windowTitle;
+		
+		int lastMouseX;
+		int lastMouseY;
 	};
 }

+ 7 - 7
include/polycode/core/PolyUWPCore.h

@@ -33,12 +33,12 @@ THE SOFTWARE.
 #include <wrl\client.h>
 #include <wrl.h>
 
-#include <GLES2/gl2.h>
-#include <GLES2/gl2ext.h>
-#include <EGL/egl.h>
-#include <EGL/eglext.h>
-#include <EGL/eglplatform.h>
-#include <angle_windowsstore.h>
+#include <angle/GLES2/gl2.h>
+#include <angle/GLES2/gl2ext.h>
+#include <angle/EGL/egl.h>
+#include <angle/EGL/eglext.h>
+#include <angle/EGL/eglplatform.h>
+#include <angle/angle_windowsstore.h>
 
 #include "polycode/core/PolyXAudio2AudioInterface.h"
 
@@ -145,4 +145,4 @@ namespace Polycode {
 		EGLSurface mEglSurface;
 
 	};
-}
+}

+ 1 - 1
include/polycode/ide/PolycodeIDEApp.h

@@ -25,7 +25,7 @@
 #elif defined(_WINDOWS)
 #include "polycode/ide/PolycodeWinIDEView.h"
 #else
-#include "polycode/ide/PolycodeView.h"
+#include "polycode/view/linux/PolycodeView.h"
 #endif
 
 #include "polycode/ide/PolycodeGlobals.h"

+ 16 - 0
include/polycode/view/linux/PolycodeView.h

@@ -0,0 +1,16 @@
+#pragma once
+
+#include "polycode/core/PolySDLCore.h"
+
+namespace Polycode {
+
+    class PolycodeView : public PolycodeViewBase {
+        public:
+            PolycodeView(const char *title, bool resizable = false);
+            ~PolycodeView();
+
+            String windowTitle;
+	    bool resizable;
+    };
+
+}

+ 59 - 7
src/core/PolyIOSCore.mm

@@ -23,11 +23,35 @@ THE SOFTWARE.
 
 #include "polycode/core/PolyIOSCore.h"
 
+#include "polycode/core/PolyBasicFileProvider.h"
+#include "polycode/core/PolyPhysFSFileProvider.h"
+
 using namespace Polycode;
 
+void PosixMutex::lock() {
+    pthread_mutex_lock(&pMutex);
+}
+
+void PosixMutex::unlock() {
+    pthread_mutex_unlock(&pMutex);
+}
 
 IOSCore::IOSCore(PolycodeView *view, int xRes, int yRes, bool fullScreen, bool vSync, int aaLevel, int anisotropyLevel, int frameRate, int monitorIndex, bool retinaSupport)
 	: Core(xRes, yRes, fullScreen, vSync, aaLevel, anisotropyLevel, frameRate, monitorIndex) {
+        
+        
+        fileProviders.push_back(new BasicFileProvider());
+        fileProviders.push_back(new PhysFSFileProvider());
+        
+        glView = view;
+        
+        renderer = new Renderer();
+                
+        OpenGLGraphicsInterface *interface = new OpenGLGraphicsInterface();
+        renderer->setGraphicsInterface(this, interface);
+        services->setRenderer(renderer);
+        
+        setVideoMode([glView frame].size.width , [glView frame].size.height, fullScreen, vSync, aaLevel, anisotropyLevel, retinaSupport);
 
 }
 
@@ -36,7 +60,10 @@ IOSCore::~IOSCore() {
 }
 
 void IOSCore::Render() {
-
+    renderer->beginFrame();
+    services->Render(Polycode::Rectangle(0, 0, getBackingXRes(), getBackingYRes()));
+    renderer->endFrame();
+    [glView display];
 }
 
 
@@ -65,13 +92,23 @@ void launchThread(Threaded *target) {
 	target->scheduledForRemoval = true;
 }
 
-void IOSCore::createThread(Threaded * target) {
+void *ManagedThreadFunc(void *data) {
+    Threaded *target = static_cast<Threaded*>(data);
+    target->runThread();
+    target->scheduledForRemoval = true;
+    return NULL;
+}
 
-	 
+void IOSCore::createThread(Threaded *target) {
+    Core::createThread(target);
+    pthread_t thread;
+    pthread_create( &thread, NULL, ManagedThreadFunc, (void*)target);
 }
 
 CoreMutex *IOSCore::createMutex() {
-    return NULL;
+    PosixMutex *mutex = new PosixMutex();
+    pthread_mutex_init(&mutex->pMutex, NULL);
+    return mutex;
 }
 
 void IOSCore::copyStringToClipboard(const String& str) {
@@ -112,7 +149,22 @@ String IOSCore::saveFilePicker(std::vector<CoreFileExtension> extensions) {
 }
 
 void IOSCore::handleVideoModeChange(VideoModeChangeInfo *modeInfo) {
-
+    
+    xRes = modeInfo->xRes;
+    yRes = modeInfo->yRes;
+    
+    EAGLContext *context = [[EAGLContext alloc] initWithAPI:kEAGLRenderingAPIOpenGLES2];
+    
+    if (!context) {
+        printf("Failed to create ES context...\n");
+    }
+    
+    glView.context = context;
+    glView.drawableDepthFormat = GLKViewDrawableDepthFormat24;
+    
+    [EAGLContext setCurrentContext:context];
+    
+    
 }
 
 void IOSCore::flushRenderContext() {
@@ -148,9 +200,9 @@ void IOSCore::setDeviceSize(Number x, Number y) {
 }
 
 Number IOSCore::getBackingXRes() {
-	return 1.0;
+	return getXRes();
 }
 
 Number IOSCore::getBackingYRes() {
-	return 1.0;
+	return getYRes();
 }

+ 3 - 1
src/core/PolyOpenGLGraphicsInterface.cpp

@@ -174,7 +174,9 @@ void OpenGLGraphicsInterface::setParamInShader(Shader *shader, ProgramParam *par
             if(localParam) {
                 Texture* texture = localParam->getTexture();
                 if(texture) {
-                    glBindTexture(GL_TEXTURE_2D, *((GLuint*) texture->platformData));
+                    if(texture->platformData) {
+                        glBindTexture(GL_TEXTURE_2D, *((GLuint*) texture->platformData));
+                    }
                 } else {
                     glBindTexture(GL_TEXTURE_2D, 0);                    
                 }

+ 2 - 2
src/core/PolyPAAudioInterface.cpp

@@ -27,7 +27,7 @@
 using namespace Polycode;
 
 PAAudioInterface::PAAudioInterface() {
-    
+    mixer = NULL;
     
     PaError error = Pa_Initialize();
     if(error != paNoError) {
@@ -77,7 +77,7 @@ int PAAudioInterface::paCallback(const void *inputBuffer, void *outputBuffer,
                       PaStreamCallbackFlags statusFlags,
                                  void *userData) {
     PAAudioInterface *audioInterface = (PAAudioInterface*) userData;
-    if(outputBuffer) {
+    if(outputBuffer && audioInterface->getMixer()) {
         int16_t *out = (int16_t*)outputBuffer;
         audioInterface->getMixer()->mixIntoBuffer(out, framesPerBuffer);
     }

+ 150 - 71
src/core/PolySDLCore.cpp

@@ -20,21 +20,23 @@
  THE SOFTWARE.
 */		
 
-#include "PolySDLCore.h"
-#include "PolycodeView.h"
-#include "PolyCoreServices.h"
-#include "PolyCoreInput.h"
-#include "PolyMaterialManager.h"
-#include "PolyThreaded.h"
-
-#include "PolyGLRenderer.h"
-#include "PolyGLSLShaderModule.h"
-#include "PolyRectangle.h"
+#include "polycode/core/PolySDLCore.h"
+#include "polycode/view/linux/PolycodeView.h"
+#include "polycode/core/PolyCoreServices.h"
+#include "polycode/core/PolyCoreInput.h"
+#include "polycode/core/PolyMaterialManager.h"
+#include "polycode/core/PolyThreaded.h"
+#include "polycode/core/PolyLogger.h"
+
+#include "polycode/core/PolyOpenGLGraphicsInterface.h"
+#include "polycode/core/PolyBasicFileProvider.h"
+#include "polycode/core/PolyPhysFSFileProvider.h"
 
 #include <SDL/SDL.h>
 #include <SDL/SDL_syswm.h>
 #include <stdio.h>
 #include <limits.h>
+#include <dirent.h>
 
 #include <iostream>
 
@@ -68,6 +70,16 @@ namespace {
 using namespace Polycode;
 using std::vector;
 
+void SDLCoreMutex::lock()
+{
+	SDL_mutexP(pMutex);
+}
+
+void SDLCoreMutex::unlock() {
+	SDL_mutexV(pMutex);
+}
+
+
 long getThreadID() {
 	return (long)pthread_self();
 }
@@ -81,9 +93,12 @@ void Core::getScreenInfo(int *width, int *height, int *hz) {
 }
 
 SDLCore::SDLCore(PolycodeView *view, int _xRes, int _yRes, bool fullScreen, bool vSync, int aaLevel, int anisotropyLevel, int frameRate, int monitorIndex, bool retinaSupport) : Core(_xRes, _yRes, fullScreen, vSync, aaLevel, anisotropyLevel, frameRate, monitorIndex) {
-
+  
 	this->resizableWindow = view->resizable;
 
+	fileProviders.push_back(new BasicFileProvider());
+	fileProviders.push_back(new PhysFSFileProvider());
+	
 	char *buffer = getcwd(NULL, 0);
 	defaultWorkingDirectory = String(buffer);
 	free(buffer);
@@ -92,22 +107,33 @@ SDLCore::SDLCore(PolycodeView *view, int _xRes, int _yRes, bool fullScreen, bool
 	const char *homedir = pw->pw_dir;
 	userHomeDirectory = String(homedir);
 
-	String *windowTitle = (String*)view->windowData;
-
+	windowTitle = (String*)view->windowData;
+	
 	if(resizableWindow) {
 		unsetenv("SDL_VIDEO_CENTERED");
 	} else {
 		setenv("SDL_VIDEO_CENTERED", "1", 1);
 	}
-
-	if(SDL_Init(SDL_INIT_VIDEO|SDL_INIT_JOYSTICK) < 0) {
+	
+	int sdlerror = SDL_Init(SDL_INIT_VIDEO|SDL_INIT_JOYSTICK);
+	if(sdlerror < 0) {
+	  Logger::log("SDL_Init failed! Code: %d, %s\n", sdlerror, SDL_GetError());
+	}
+	
+	SDL_Surface* icon = SDL_LoadBMP("icon.bmp");
+	if(icon){
+		SDL_WM_SetIcon(icon, NULL);
 	}
 	
 	eventMutex = createMutex();
-	renderer = new OpenGLRenderer();
+	
+	renderer = new Renderer();
+	OpenGLGraphicsInterface *renderInterface = new OpenGLGraphicsInterface();
+	renderInterface->lineSmooth = true;
+	renderer->setGraphicsInterface(this, renderInterface);
 	services->setRenderer(renderer);
-
-	setVideoMode(xRes, yRes, fullScreen, vSync, aaLevel, anisotropyLevel);
+	setVideoMode(xRes, yRes, fullScreen, vSync, aaLevel, anisotropyLevel, retinaSupport);
+	
 	SDL_WM_SetCaption(windowTitle->c_str(), windowTitle->c_str());
 	
 	SDL_EnableUNICODE(1);
@@ -121,6 +147,11 @@ SDLCore::SDLCore(PolycodeView *view, int _xRes, int _yRes, bool fullScreen, bool
 		SDL_JoystickOpen(i);
 		input->addJoystick(i);
 	}
+	
+	services->getSoundManager()->setAudioInterface(new PAAudioInterface());
+	
+	lastMouseX = 0;
+	lastMouseY = 0;
 
 #ifdef USE_X11
 	// Start listening to clipboard events.
@@ -128,30 +159,37 @@ SDLCore::SDLCore(PolycodeView *view, int _xRes, int _yRes, bool fullScreen, bool
 	//  clipboard events and respond to them)
 	init_scrap();
 #endif // USE_X11
-
-	((OpenGLRenderer*)renderer)->Init();
-	CoreServices::getInstance()->installModule(new GLSLShaderModule());	
 }
 
 void SDLCore::setVideoMode(int xRes, int yRes, bool fullScreen, bool vSync, int aaLevel, int anisotropyLevel, bool retinaSupport) {
-	this->xRes = xRes;
-	this->yRes = yRes;
-	this->fullScreen = fullScreen;
-	this->aaLevel = aaLevel;
+	//renderer->Resize(xRes, yRes);
+	//CoreServices::getInstance()->getMaterialManager()->reloadProgramsAndTextures();
+	//dispatchEvent(new Event(), EVENT_CORE_RESIZE);
+	Core::setVideoMode(xRes, yRes, fullScreen, vSync, aaLevel, anisotropyLevel, retinaSupport);
+}
+
+void SDLCore::handleVideoModeChange(VideoModeChangeInfo* modeInfo){
 
-	SDL_GL_SetAttribute( SDL_GL_DEPTH_SIZE, 24);	
-	SDL_GL_SetAttribute( SDL_GL_DOUBLEBUFFER, 1);			
+	this->xRes = modeInfo->xRes;
+	this->yRes = modeInfo->yRes;
+	this->fullScreen = modeInfo->fullScreen;
+	this->aaLevel = modeInfo->aaLevel;
+	this->anisotropyLevel = modeInfo->anisotropyLevel;
+	this->vSync = modeInfo->vSync;
+	
+	SDL_GL_SetAttribute( SDL_GL_DEPTH_SIZE, 24);
+	SDL_GL_SetAttribute( SDL_GL_DOUBLEBUFFER, 1);
 	SDL_GL_SetAttribute( SDL_GL_RED_SIZE,   8);
 	SDL_GL_SetAttribute( SDL_GL_GREEN_SIZE, 8);
 	SDL_GL_SetAttribute( SDL_GL_BLUE_SIZE,  8);
 	SDL_GL_SetAttribute( SDL_GL_ALPHA_SIZE, 8);
 	
 	if(aaLevel > 0) {
-		SDL_GL_SetAttribute( SDL_GL_MULTISAMPLEBUFFERS, 1);
-		SDL_GL_SetAttribute( SDL_GL_MULTISAMPLESAMPLES, aaLevel); //0, 2, 4	
+		SDL_GL_SetAttribute(SDL_GL_MULTISAMPLEBUFFERS, 1);
+		SDL_GL_SetAttribute(SDL_GL_MULTISAMPLESAMPLES, aaLevel); //0, 2, 4
 	} else {
-		SDL_GL_SetAttribute( SDL_GL_MULTISAMPLEBUFFERS, 0);
-		SDL_GL_SetAttribute( SDL_GL_MULTISAMPLESAMPLES, 0);
+		SDL_GL_SetAttribute(SDL_GL_MULTISAMPLEBUFFERS, 0);
+		SDL_GL_SetAttribute(SDL_GL_MULTISAMPLESAMPLES, 0);
 	}
 	
 	flags = SDL_OPENGL;
@@ -163,6 +201,10 @@ void SDLCore::setVideoMode(int xRes, int yRes, bool fullScreen, bool vSync, int
 	if(resizableWindow) {
 		flags |= SDL_RESIZABLE;
 	}
+	
+// 	if(modeInfo->retinaSupport) {
+// 		flags |= SDL_WINDOW_ALLOW_HIGHDPI;
+// 	}
 /*
 	if(vSync) {
 		flags |= SDL_DOUBLEBUF;
@@ -170,14 +212,19 @@ void SDLCore::setVideoMode(int xRes, int yRes, bool fullScreen, bool vSync, int
 		SDL_GL_SetAttribute(SDL_GL_SWAP_CONTROL, 1);
 	} else {
 		SDL_GL_SetAttribute(SDL_GL_DOUBLEBUFFER, 0);
-		SDL_GL_SetAttribute(SDL_GL_SWAP_CONTROL, 0);
+ -		SDL_GL_SetAttribute(SDL_GL_SWAP_CONTROL, 0);
 	}
 */
+
 	SDL_SetVideoMode(xRes, yRes, 0, flags);
+
+	int glewcode = glewInit();
+	if (glewcode != GLEW_OK){
+	  Logger::log("glewInit failed! code: %d, %s\n", glewcode, glewGetErrorString(glewcode));
+	}
 	
-	renderer->Resize(xRes, yRes);
-	//CoreServices::getInstance()->getMaterialManager()->reloadProgramsAndTextures();
-	dispatchEvent(new Event(), EVENT_CORE_RESIZE);	
+	//setVSync(modeInfo->vSync);
+	renderer->setAnisotropyAmount(modeInfo->anisotropyLevel);
 }
 
 vector<Polycode::Rectangle> SDLCore::getVideoModes() {
@@ -254,10 +301,10 @@ unsigned int SDLCore::getTicks() {
 void SDLCore::enableMouse(bool newval) {
 	if(newval) {
 		SDL_ShowCursor(1);
-		SDL_WM_GrabInput(SDL_GRAB_OFF);
+		//SDL_WM_GrabInput(SDL_GRAB_OFF);
 	} else {
 		SDL_ShowCursor(0);
-		SDL_WM_GrabInput(SDL_GRAB_ON);
+		//SDL_WM_GrabInput(SDL_GRAB_ON);
 	}
 	Core::enableMouse(newval);
 }
@@ -307,9 +354,12 @@ bool SDLCore::checkSpecialKeyEvents(PolyKEY key) {
 }
 
 void SDLCore::Render() {
-	renderer->BeginRender();
-	services->Render();
-	renderer->EndRender();
+	renderer->beginFrame();
+	services->Render(Polycode::Rectangle(0, 0, getBackingXRes(), getBackingYRes()));
+	renderer->endFrame();
+}
+
+void SDLCore::flushRenderContext(){
 	SDL_GL_SwapBuffers();
 }
 
@@ -327,20 +377,19 @@ bool SDLCore::systemUpdate() {
 					running = false;
 				break;
 				case SDL_VIDEORESIZE:
-	if(resizableWindow) {
-		unsetenv("SDL_VIDEO_CENTERED");
-	} else {
-		setenv("SDL_VIDEO_CENTERED", "1", 1);
-	}
+					if(resizableWindow) {
+						unsetenv("SDL_VIDEO_CENTERED");
+					} else {
+						setenv("SDL_VIDEO_CENTERED", "1", 1);
+					}
 					this->xRes = event.resize.w;
 					this->yRes = event.resize.h;
 					SDL_SetVideoMode(xRes, yRes, 0, flags);
-					renderer->Resize(xRes, yRes);	
 					dispatchEvent(new Event(), EVENT_CORE_RESIZE);	
 				break;
 				case SDL_ACTIVEEVENT:
-					if(event.active.state == SDL_APPINPUTFOCUS) {
-						if(event.active.gain == 1) {
+					if(event.active.state == SDL_APPINPUTFOCUS){
+						if(event.active.gain == 1){
 							gainFocus();
 						} else {
 							loseFocus();
@@ -358,16 +407,16 @@ bool SDLCore::systemUpdate() {
 				break;
 				case SDL_KEYDOWN:
 					if(!checkSpecialKeyEvents((PolyKEY)(event.key.keysym.sym))) {
-						input->setKeyState((PolyKEY)(event.key.keysym.sym), (char)event.key.keysym.unicode, true, getTicks());
+						input->setKeyState((PolyKEY)(event.key.keysym.sym), event.key.keysym.unicode, true, getTicks());
 					}
 				break;
 				case SDL_KEYUP:
-					input->setKeyState((PolyKEY)(event.key.keysym.sym), (char)event.key.keysym.unicode, false, getTicks());
+					input->setKeyState((PolyKEY)(event.key.keysym.sym), event.key.keysym.unicode, false, getTicks());
 				break;
 				case SDL_MOUSEBUTTONDOWN:
-					if(event.button.button == SDL_BUTTON_WHEELUP) {
+					if(event.button.button == SDL_BUTTON_WHEELUP){
 						input->mouseWheelUp(getTicks());
-					} else if(event.button.button == SDL_BUTTON_WHEELDOWN) {
+					} else if (event.button.button == SDL_BUTTON_WHEELDOWN){
 						input->mouseWheelDown(getTicks());
 					} else {
 						switch(event.button.button) {
@@ -384,24 +433,23 @@ bool SDLCore::systemUpdate() {
 					}
 				break;
 				case SDL_MOUSEBUTTONUP:
-					if(event.button.button == SDL_BUTTON_WHEELUP || event.button.button == SDL_BUTTON_WHEELDOWN) {						
-					} else {
-						switch(event.button.button) {
-							case SDL_BUTTON_LEFT:
-								input->setMouseButtonState(CoreInput::MOUSE_BUTTON1, false, getTicks());
-							break;
-							case SDL_BUTTON_RIGHT:
-								input->setMouseButtonState(CoreInput::MOUSE_BUTTON2, false, getTicks());
-							break;
-							case SDL_BUTTON_MIDDLE:
-								input->setMouseButtonState(CoreInput::MOUSE_BUTTON3, false, getTicks());
-							break;
-						}
+					switch(event.button.button) {
+						case SDL_BUTTON_LEFT:
+							input->setMouseButtonState(CoreInput::MOUSE_BUTTON1, false, getTicks());
+						break;
+						case SDL_BUTTON_RIGHT:
+							input->setMouseButtonState(CoreInput::MOUSE_BUTTON2, false, getTicks());
+						break;
+						case SDL_BUTTON_MIDDLE:
+							input->setMouseButtonState(CoreInput::MOUSE_BUTTON3, false, getTicks());
+						break;
 					}
 				break;
 				case SDL_MOUSEMOTION:
-					input->setDeltaPosition(event.motion.xrel, event.motion.yrel);					
+					input->setDeltaPosition(lastMouseX - event.motion.x, lastMouseY - event.motion.y);					
 					input->setMousePosition(event.motion.x, event.motion.y, getTicks());
+					lastMouseY = event.motion.y;
+					lastMouseX = event.motion.x;
 				break;
 				default:
 					break;
@@ -418,9 +466,11 @@ void SDLCore::setCursor(int cursorType) {
 
 void SDLCore::warpCursor(int x, int y) {
 	SDL_WarpMouse(x, y);
+	lastMouseX = x;
+	lastMouseY = y;
 }
 
-void SDLCore::lockMutex(CoreMutex *mutex) {
+/*void SDLCore::lockMutex(CoreMutex *mutex) {
 	SDLCoreMutex *smutex = (SDLCoreMutex*)mutex;
 	SDL_mutexP(smutex->pMutex);
 
@@ -429,7 +479,7 @@ void SDLCore::lockMutex(CoreMutex *mutex) {
 void SDLCore::unlockMutex(CoreMutex *mutex) {
 	SDLCoreMutex *smutex = (SDLCoreMutex*)mutex;
 	SDL_mutexV(smutex->pMutex);
-}
+}*/
 
 CoreMutex *SDLCore::createMutex() {
 	SDLCoreMutex *mutex = new SDLCoreMutex();
@@ -441,6 +491,7 @@ void SDLCore::copyStringToClipboard(const String& str) {
 #ifdef USE_X11
 	put_scrap(T('T', 'E', 'X', 'T'), str.size(), str.c_str());
 #endif
+// 	SDL_SetClipboardText(str.c_str());
 }
 
 String SDLCore::getClipboardString() {
@@ -452,7 +503,14 @@ String SDLCore::getClipboardString() {
 	String rval(buffer, dstlen);
 	free(buffer);
 	return rval;
-#endif
+	#endif
+// 	String rval;
+// 	if(SDL_HasClipboardText() ==SDL_TRUE){
+// 		rval=SDL_GetClipboardText();
+// 	} else {
+// 		rval="";
+// 	}
+// 	return rval;
 }
 
 void SDLCore::createFolder(const String& folderPath) {
@@ -505,9 +563,30 @@ String SDLCore::saveFilePicker(std::vector<CoreFileExtension> extensions) {
 }
 
 void SDLCore::resizeTo(int xRes, int yRes) {
-	renderer->Resize(xRes, yRes);
+	this->xRes = xRes;
+	this->yRes = yRes;
+	dispatchEvent(new Event(), EVENT_CORE_RESIZE);
 }
 
+bool SDLCore::systemParseFolder(const String& pathString, bool showHidden, vector< OSFileEntry >& targetVector) {
+    DIR           *d;
+    struct dirent *dir;
+    
+    d = opendir(pathString.c_str());
+    if(d) {
+        while ((dir = readdir(d)) != NULL) {
+            if(dir->d_name[0] != '.' || (dir->d_name[0] == '.'  && showHidden)) {
+                if(dir->d_type == DT_DIR) {
+                    targetVector.push_back(OSFileEntry(pathString, dir->d_name, OSFileEntry::TYPE_FOLDER));
+                } else {
+                    targetVector.push_back(OSFileEntry(pathString, dir->d_name, OSFileEntry::TYPE_FILE));
+                }
+            }
+        }
+        closedir(d);
+    }
+    return true;
+}
 
 #ifdef USE_X11
 // SDL_scrap.c
@@ -947,4 +1026,4 @@ void free_cursors() {
 } // namespace
 // end X11 cursor
 
-#endif // USE_X11
+#endif // USE_X11

+ 5 - 2
src/core/PolySceneImage.cpp

@@ -38,7 +38,8 @@ SceneImage* SceneImage::SceneImageWithTexture(Texture *texture) {
 SceneImage::SceneImage(const String& fileName) : ScenePrimitive(ScenePrimitive::TYPE_VPLANE, 1, 1) {
     
     // RENDERER_TODO
-    Texture *texture = getShaderPass(0).shaderBinding->loadTextureForParam("diffuse", fileName);
+	setMaterialByName("Unlit");
+	Texture *texture = getShaderPass(0).shaderBinding->loadTextureForParam("diffuse", fileName);
 
 	imageWidth = texture->getWidth();
 	imageHeight = texture->getHeight();
@@ -51,6 +52,7 @@ SceneImage::SceneImage(const String& fileName) : ScenePrimitive(ScenePrimitive::
 SceneImage::SceneImage(Image *image) : ScenePrimitive(ScenePrimitive::TYPE_VPLANE, 1, 1) {
     // RENDERER_TODO
 	//loadTextureFromImage(image);
+	setMaterialByName("Unlit");
     Texture *texture = Services()->getMaterialManager()->createTextureFromImage(image);
     getShaderPass(0).shaderBinding->setTextureForParam("diffuse", texture);
 
@@ -63,7 +65,8 @@ SceneImage::SceneImage(Image *image) : ScenePrimitive(ScenePrimitive::TYPE_VPLAN
 }
 
 SceneImage::SceneImage(Texture *texture) : ScenePrimitive(ScenePrimitive::TYPE_VPLANE, 1, 1)  {
-    getShaderPass(0).shaderBinding->setTextureForParam("diffuse", texture);
+	setMaterialByName("Unlit");
+	getShaderPass(0).shaderBinding->setTextureForParam("diffuse", texture);
 
 	imageWidth = texture->getWidth();
 	imageHeight = texture->getHeight();

+ 5 - 3
src/ide/PolycodeProps.cpp

@@ -1677,6 +1677,7 @@ TargetBindingProp::TargetBindingProp(Shader *shader, Material *material, ShaderB
 	for(int i=0; i < material->getNumShaderRenderTargets(); i++) {
 		ShaderRenderTarget *target = material->getShaderRenderTarget(i);		
 		targetComboBox->addComboItem(target->id, (void*) target);
+
 		if(targetBinding->buffer == target->buffer) {
 			targetComboBox->setSelectedIndex(i);
 		}
@@ -1732,7 +1733,7 @@ void TargetBindingProp::handleEvent(Event *event) {
 			textureComboBox->enabled = true;
 			textureComboBox->visible = true;
 			binding->setTextureForParam(targetBinding->name, targetBinding->buffer->colorTexture);
-		}		
+		}
 		
 		if(typeComboBox->getSelectedIndex() == 2 || typeComboBox->getSelectedIndex() == 3) {
 			targetComboBox->enabled = false;
@@ -1750,6 +1751,7 @@ void TargetBindingProp::handleEvent(Event *event) {
 		dispatchEvent(new Event(), Event::CHANGE_EVENT);
 	} else if(event->getDispatcher() == targetComboBox && event->getEventCode() == UIEvent::CHANGE_EVENT) {
 		ShaderRenderTarget *target = (ShaderRenderTarget*)targetComboBox->getSelectedItem()->data;		
+
 		targetBinding->buffer = target->buffer;
 		targetBinding->id  = target->id;
 		
@@ -1758,7 +1760,7 @@ void TargetBindingProp::handleEvent(Event *event) {
 
 		binding->removeParam(targetBinding->name);
 		if(targetBinding->mode == RenderTargetBinding::MODE_IN) {
-			binding->setTextureForParam(targetBinding->name, targetBinding->buffer->colorTexture);
+        binding->setTextureForParam(targetBinding->name, targetBinding->buffer->colorTexture);
 		}
 		dispatchEvent(new Event(), Event::CHANGE_EVENT);		
 	} else if(event->getDispatcher() == textureComboBox && event->getEventCode() == UIEvent::CHANGE_EVENT) {
@@ -2040,7 +2042,7 @@ void TargetBindingsSheet::handleEvent(Event *event) {
 	if(event->getDispatcher() == addButton->getButton()) {
 		RenderTargetBinding* newBinding = new RenderTargetBinding();
 		newBinding->mode = RenderTargetBinding::MODE_COLOR;
-		newBinding->buffer = NULL;		
+		newBinding->buffer = NULL;
 		binding->addRenderTargetBinding(newBinding);				
 		refreshTargets();			
 		dispatchEvent(new Event(), Event::CHANGE_EVENT);

+ 15 - 0
src/view/linux/PolycodeView.cpp

@@ -0,0 +1,15 @@
+#include "polycode/view/linux/PolycodeView.h"
+
+namespace Polycode {
+
+    PolycodeView::PolycodeView(const char *title, bool resizable) : PolycodeViewBase() {
+        windowTitle = title;
+        windowData = &windowTitle;
+	this->resizable = resizable;
+    }
+
+    PolycodeView::~PolycodeView() {
+
+    }
+
+}

Некоторые файлы не были показаны из-за большого количества измененных файлов