Bläddra i källkod

Merge pull request #678 from fodinabor/goodbye_cmake

Goodbye cmake
Ivan Safrin 10 år sedan
förälder
incheckning
a12d9d2cea
42 ändrade filer med 580 tillägg och 168 borttagningar
  1. 7 0
      .gitignore
  2. 1 1
      .gitmodules
  3. 9 0
      .travis.yml
  4. 1 0
      build/linux/Makefile
  5. 11 0
      build/linux/Studio/main.cpp
  6. 2 2
      build/linux/TemplateApp/PolycodeTemplate.cpp
  7. 13 14
      build/linux/TemplateApp/PolycodeTemplateApp.cpp
  8. 3 0
      build/rpi/Makefile
  9. 10 0
      build/rpi/TemplateApp/PolycodeTemplate.cpp
  10. 72 0
      build/rpi/TemplateApp/PolycodeTemplateApp.cpp
  11. 27 0
      build/rpi/TemplateApp/PolycodeTemplateApp.h
  12. BIN
      build/rpi/TemplateApp/main_icon.png
  13. 4 1
      build/windows/universal/Polycode.sln
  14. 3 2
      build/windows/universal/PolycodeCore/PolycodeCore.vcxproj
  15. 0 3
      build/windows/universal/PolycodeCore/PolycodeCore.vcxproj.filters
  16. 1 1
      build/windows/universal/TemplateApp/PolycodeTemplateApp.cpp
  17. 15 12
      build/windows/universal/TemplateApp/TemplateApp.vcxproj
  18. 12 2
      build/windows/win32/Polycode.sln
  19. 13 4
      build/windows/win32/PolycodeCore/PolycodeCore.vcxproj
  20. 50 4
      build/windows/win32/PolycodeStudio/PolycodeStudio.vcxproj
  21. 1 1
      build/windows/win32/PolycodeStudio/PolycodeStudio.vcxproj.filters
  22. 2 1
      build/windows/win32/PolycodeStudio/main.cpp
  23. 12 0
      build/windows/win32/PolycodeUI/PolycodeUI.vcxproj
  24. 4 4
      build/windows/win32/TemplateApp/PolycodeTemplateApp.cpp
  25. 0 0
      build/windows/win32/TemplateApp/TemplateApp.cpp
  26. 37 7
      build/windows/win32/TemplateApp/TemplateApp.vcxproj
  27. 3 3
      build/windows/win32/TemplateApp/TemplateApp.vcxproj.filters
  28. 25 0
      include/ogg/config_types.h
  29. 12 12
      include/polycode/core/PolyCore.h
  30. 1 1
      include/polycode/core/PolyCoreInput.h
  31. 6 3
      include/polycode/core/PolyOpenGLGraphicsInterface.h
  32. 17 4
      include/polycode/core/PolySDLCore.h
  33. 1 1
      include/polycode/core/PolyUWPCore.h
  34. 1 1
      include/polycode/ide/PolycodeIDEApp.h
  35. 16 0
      include/polycode/view/linux/PolycodeView.h
  36. 1 1
      lib
  37. 1 0
      src/core/PolyOpenGLGraphicsInterface.cpp
  38. 2 2
      src/core/PolyPAAudioInterface.cpp
  39. 150 71
      src/core/PolySDLCore.cpp
  40. 5 2
      src/core/PolySceneImage.cpp
  41. 14 8
      src/ide/PolycodeProps.cpp
  42. 15 0
      src/view/linux/PolycodeView.cpp

+ 7 - 0
.gitignore

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

+ 1 - 1
.gitmodules

@@ -1,3 +1,3 @@
 [submodule "lib"]
 [submodule "lib"]
 	path = lib
 	path = lib
-	url = https://github.com/ivansafrin/PolycodeDepBinaries
+	url = https://github.com/fodinabor/PolycodeDepBinaries

+ 9 - 0
.travis.yml

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

Filskillnaden har hållts tillbaka eftersom den är för stor
+ 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 "PolycodeTemplateApp.h"
-
+#include "polycode/view/linux/PolycodeView.h"
 
 
 int main(int argc, char **argv) {
 int main(int argc, char **argv) {
-	PolycodeView *view = new PolycodeView();
+	PolycodeView *view = new PolycodeView("Polycode Template");
 	PolycodeTemplateApp *app = new PolycodeTemplateApp(view);
 	PolycodeTemplateApp *app = new PolycodeTemplateApp(view);
 	while(app->Update()) {
 	while(app->Update()) {
 	}
 	}

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

@@ -8,7 +8,7 @@
 PolycodeTemplateApp::PolycodeTemplateApp(PolycodeView *view) {
 PolycodeTemplateApp::PolycodeTemplateApp(PolycodeView *view) {
     core = new POLYCODE_CORE(view, 800,480,false,false, 0,0,60);
     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();
     ResourcePool *globalPool = Services()->getResourceManager()->getGlobalPool();
     globalPool->loadResourcesFromFolder("default", true);
     globalPool->loadResourcesFromFolder("default", true);
     
     
@@ -42,25 +42,24 @@ PolycodeTemplateApp::PolycodeTemplateApp(PolycodeView *view) {
     
     
     //sound2->Play(true);
     //sound2->Play(true);
   */
   */
-  
     Services()->getInput()->addEventListener(this, InputEvent::EVENT_KEYDOWN);
     Services()->getInput()->addEventListener(this, InputEvent::EVENT_KEYDOWN);
 }
 }
 
 
 void PolycodeTemplateApp::handleEvent(Event *event) {
 void PolycodeTemplateApp::handleEvent(Event *event) {
     InputEvent *inputEvent = (InputEvent*) 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() {
 PolycodeTemplateApp::~PolycodeTemplateApp() {

Filskillnaden har hållts tillbaka eftersom den är för stor
+ 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
 Microsoft Visual Studio Solution File, Format Version 12.00
 # Visual Studio 14
 # Visual Studio 14
-VisualStudioVersion = 14.0.23107.0
+VisualStudioVersion = 14.0.24720.0
 MinimumVisualStudioVersion = 10.0.40219.1
 MinimumVisualStudioVersion = 10.0.40219.1
 Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "TemplateApp", "TemplateApp\TemplateApp.vcxproj", "{A19BD860-B494-4D18-8AFB-B788E29236CF}"
 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
 EndProject
 Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "PolycodeCore", "PolycodeCore\PolycodeCore.vcxproj", "{EE7AE05C-9AE5-47FA-8A08-28E8D8D89B94}"
 Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "PolycodeCore", "PolycodeCore\PolycodeCore.vcxproj", "{EE7AE05C-9AE5-47FA-8A08-28E8D8D89B94}"
 EndProject
 EndProject

+ 3 - 2
build/windows/universal/PolycodeCore/PolycodeCore.vcxproj

@@ -33,7 +33,6 @@
     <ClInclude Include="..\..\..\..\include\polycode\core\PolyBone.h" />
     <ClInclude Include="..\..\..\..\include\polycode\core\PolyBone.h" />
     <ClInclude Include="..\..\..\..\include\polycode\core\PolyCamera.h" />
     <ClInclude Include="..\..\..\..\include\polycode\core\PolyCamera.h" />
     <ClInclude Include="..\..\..\..\include\polycode\core\PolyClient.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\PolyColor.h" />
     <ClInclude Include="..\..\..\..\include\polycode\core\PolyConfig.h" />
     <ClInclude Include="..\..\..\..\include\polycode\core\PolyConfig.h" />
     <ClInclude Include="..\..\..\..\include\polycode\core\PolyCore.h" />
     <ClInclude Include="..\..\..\..\include\polycode\core\PolyCore.h" />
@@ -264,7 +263,7 @@
   <PropertyGroup />
   <PropertyGroup />
   <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
   <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
     <GenerateManifest>false</GenerateManifest>
     <GenerateManifest>false</GenerateManifest>
-    <IncludePath>../../../../include;$(IncludePath)</IncludePath>
+    <IncludePath>../../../../include/angle;../../../../include;$(IncludePath)</IncludePath>
     <OutDir>..\..\..\..\lib\windows\x86</OutDir>
     <OutDir>..\..\..\..\lib\windows\x86</OutDir>
     <TargetName>Polycored</TargetName>
     <TargetName>Polycored</TargetName>
   </PropertyGroup>
   </PropertyGroup>
@@ -276,9 +275,11 @@
   </PropertyGroup>
   </PropertyGroup>
   <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|ARM'">
   <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|ARM'">
     <GenerateManifest>false</GenerateManifest>
     <GenerateManifest>false</GenerateManifest>
+    <TargetName>Polycored</TargetName>
   </PropertyGroup>
   </PropertyGroup>
   <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|ARM'">
   <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|ARM'">
     <GenerateManifest>false</GenerateManifest>
     <GenerateManifest>false</GenerateManifest>
+    <TargetName>Polycore</TargetName>
   </PropertyGroup>
   </PropertyGroup>
   <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
   <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
     <GenerateManifest>false</GenerateManifest>
     <GenerateManifest>false</GenerateManifest>

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

@@ -24,9 +24,6 @@
     <ClInclude Include="..\..\..\..\include\polycode\core\PolyClient.h">
     <ClInclude Include="..\..\..\..\include\polycode\core\PolyClient.h">
       <Filter>Include</Filter>
       <Filter>Include</Filter>
     </ClInclude>
     </ClInclude>
-    <ClInclude Include="..\..\..\..\include\polycode\core\PolyCocoaCore.h">
-      <Filter>Include</Filter>
-    </ClInclude>
     <ClInclude Include="..\..\..\..\include\Polycode.h">
     <ClInclude Include="..\..\..\..\include\Polycode.h">
       <Filter>Include</Filter>
       <Filter>Include</Filter>
     </ClInclude>
     </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);
     ScenePrimitive *test = new ScenePrimitive(ScenePrimitive::TYPE_VPLANE, 0.5, 0.5);
     test->setMaterialByName("Unlit");
     test->setMaterialByName("Unlit");
-    test->getLocalShaderOptions()->loadTextureForParam("diffuse", "main_icon.png");
+	test->getShaderPass(0).shaderBinding->loadTextureForParam("diffuse", "white.png");
     scene->addChild(test);
     scene->addChild(test);
 
 
 	Sound *bgSound = new Sound("bedlayer_main.wav");
 	Sound *bgSound = new Sound("bedlayer_main.wav");

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

@@ -105,28 +105,30 @@
     <PackageCertificateKeyFile>TemplateApp_TemporaryKey.pfx</PackageCertificateKeyFile>
     <PackageCertificateKeyFile>TemplateApp_TemporaryKey.pfx</PackageCertificateKeyFile>
   </PropertyGroup>
   </PropertyGroup>
   <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
   <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
-    <IncludePath>..\..\..\..\include;$(IncludePath)</IncludePath>
+    <IncludePath>../../../../include/angle;../../../../include;$(IncludePath)</IncludePath>
+    <LibraryPath>..\..\..\..\lib\windows\x86;$(LibraryPath)</LibraryPath>
   </PropertyGroup>
   </PropertyGroup>
   <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
   <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
-    <IncludePath>..\..\..\..\include;$(IncludePath)</IncludePath>
+    <IncludePath>../../../../include/angle;../../../../include;$(IncludePath)</IncludePath>
+    <LibraryPath>..\..\..\..\lib\windows\x86;$(LibraryPath)</LibraryPath>
   </PropertyGroup>
   </PropertyGroup>
   <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|ARM'">
   <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|ARM'">
-    <IncludePath>..\..\..\..\include;$(IncludePath)</IncludePath>
+    <IncludePath>../../../../include/angle;../../../../include;$(IncludePath)</IncludePath>
   </PropertyGroup>
   </PropertyGroup>
   <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|ARM'">
   <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|ARM'">
-    <IncludePath>..\..\..\..\include;$(IncludePath)</IncludePath>
+    <IncludePath>../../../../include/angle;../../../../include;$(IncludePath)</IncludePath>
   </PropertyGroup>
   </PropertyGroup>
   <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
   <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
-    <IncludePath>..\..\..\..\include;$(IncludePath)</IncludePath>
+    <IncludePath>../../../../include/angle;../../../../include;$(IncludePath)</IncludePath>
     <LibraryPath>..\..\..\..\lib\windows\x64;$(LibraryPath)</LibraryPath>
     <LibraryPath>..\..\..\..\lib\windows\x64;$(LibraryPath)</LibraryPath>
   </PropertyGroup>
   </PropertyGroup>
   <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
   <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
-    <IncludePath>..\..\..\..\include;$(IncludePath)</IncludePath>
+    <IncludePath>../../../../include/angle;../../../../include;$(IncludePath)</IncludePath>
     <LibraryPath>..\..\..\..\lib\windows\x64;$(LibraryPath)</LibraryPath>
     <LibraryPath>..\..\..\..\lib\windows\x64;$(LibraryPath)</LibraryPath>
   </PropertyGroup>
   </PropertyGroup>
   <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|ARM'">
   <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|ARM'">
     <Link>
     <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>
       <AdditionalLibraryDirectories>%(AdditionalLibraryDirectories); $(VCInstallDir)\lib\store\arm; $(VCInstallDir)\lib\arm</AdditionalLibraryDirectories>
     </Link>
     </Link>
     <ClCompile>
     <ClCompile>
@@ -140,7 +142,7 @@
   </ItemDefinitionGroup>
   </ItemDefinitionGroup>
   <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|ARM'">
   <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|ARM'">
     <Link>
     <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>
       <AdditionalLibraryDirectories>%(AdditionalLibraryDirectories); $(VCInstallDir)\lib\store\arm; $(VCInstallDir)\lib\arm</AdditionalLibraryDirectories>
     </Link>
     </Link>
     <ClCompile>
     <ClCompile>
@@ -154,7 +156,7 @@
   </ItemDefinitionGroup>
   </ItemDefinitionGroup>
   <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
   <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
     <Link>
     <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>
       <AdditionalLibraryDirectories>%(AdditionalLibraryDirectories); $(VCInstallDir)\lib\store; $(VCInstallDir)\lib</AdditionalLibraryDirectories>
     </Link>
     </Link>
     <ClCompile>
     <ClCompile>
@@ -164,11 +166,12 @@
       <AdditionalOptions>/bigobj %(AdditionalOptions)</AdditionalOptions>
       <AdditionalOptions>/bigobj %(AdditionalOptions)</AdditionalOptions>
       <DisableSpecificWarnings>4453;28204</DisableSpecificWarnings>
       <DisableSpecificWarnings>4453;28204</DisableSpecificWarnings>
       <PreprocessorDefinitions>_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
       <PreprocessorDefinitions>_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+      <PrecompiledHeader>NotUsing</PrecompiledHeader>
     </ClCompile>
     </ClCompile>
   </ItemDefinitionGroup>
   </ItemDefinitionGroup>
   <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
   <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
     <Link>
     <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>
       <AdditionalLibraryDirectories>%(AdditionalLibraryDirectories); $(VCInstallDir)\lib\store; $(VCInstallDir)\lib</AdditionalLibraryDirectories>
     </Link>
     </Link>
     <ClCompile>
     <ClCompile>
@@ -182,7 +185,7 @@
   </ItemDefinitionGroup>
   </ItemDefinitionGroup>
   <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
   <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
     <Link>
     <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>
       <AdditionalLibraryDirectories>%(AdditionalLibraryDirectories); $(VCInstallDir)\lib\store\amd64; $(VCInstallDir)\lib\amd64</AdditionalLibraryDirectories>
     </Link>
     </Link>
     <ClCompile>
     <ClCompile>
@@ -199,7 +202,7 @@
   </ItemDefinitionGroup>
   </ItemDefinitionGroup>
   <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
   <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
     <Link>
     <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>
       <AdditionalLibraryDirectories>%(AdditionalLibraryDirectories); $(VCInstallDir)\lib\store\amd64; $(VCInstallDir)\lib\amd64</AdditionalLibraryDirectories>
     </Link>
     </Link>
     <ClCompile>
     <ClCompile>

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

@@ -1,15 +1,25 @@
 
 
 Microsoft Visual Studio Solution File, Format Version 12.00
 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
 MinimumVisualStudioVersion = 10.0.40219.1
 Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "PolycodeCore", "PolycodeCore\PolycodeCore.vcxproj", "{92C7971A-F305-4B93-A9DC-6B01AF222FF9}"
 Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "PolycodeCore", "PolycodeCore\PolycodeCore.vcxproj", "{92C7971A-F305-4B93-A9DC-6B01AF222FF9}"
 EndProject
 EndProject
 Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "TemplateApp", "TemplateApp\TemplateApp.vcxproj", "{E09F38FA-C860-4E70-8FA4-45DD7165778B}"
 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
 EndProject
 Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "PolycodeStudio", "PolycodeStudio\PolycodeStudio.vcxproj", "{A9A71037-BC64-45D6-B872-90EF22ABB23A}"
 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
 EndProject
 Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "PolycodeUI", "PolycodeUI\PolycodeUI.vcxproj", "{3E46FB61-BF79-46C9-8D1A-A6FFF1EA49FA}"
 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
 EndProject
 Global
 Global
 	GlobalSection(SolutionConfigurationPlatforms) = preSolution
 	GlobalSection(SolutionConfigurationPlatforms) = preSolution

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

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

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

@@ -68,6 +68,7 @@
   <PropertyGroup Label="UserMacros" />
   <PropertyGroup Label="UserMacros" />
   <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
   <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
     <LinkIncremental>true</LinkIncremental>
     <LinkIncremental>true</LinkIncremental>
+    <LibraryPath>..\..\..\..\lib\win32\x86;$(LibraryPath)</LibraryPath>
   </PropertyGroup>
   </PropertyGroup>
   <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
   <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
     <LinkIncremental>true</LinkIncremental>
     <LinkIncremental>true</LinkIncremental>
@@ -76,6 +77,7 @@
   </PropertyGroup>
   </PropertyGroup>
   <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
   <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
     <LinkIncremental>false</LinkIncremental>
     <LinkIncremental>false</LinkIncremental>
+    <LibraryPath>..\..\..\..\lib\win32\x86;$(LibraryPath)</LibraryPath>
   </PropertyGroup>
   </PropertyGroup>
   <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
   <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
     <LinkIncremental>false</LinkIncremental>
     <LinkIncremental>false</LinkIncremental>
@@ -89,11 +91,24 @@
       <WarningLevel>Level3</WarningLevel>
       <WarningLevel>Level3</WarningLevel>
       <Optimization>Disabled</Optimization>
       <Optimization>Disabled</Optimization>
       <PreprocessorDefinitions>WIN32;_DEBUG;_WINDOWS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
       <PreprocessorDefinitions>WIN32;_DEBUG;_WINDOWS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+      <AdditionalIncludeDirectories>..\..\..\..\include;$(ProjectDir)</AdditionalIncludeDirectories>
     </ClCompile>
     </ClCompile>
     <Link>
     <Link>
       <SubSystem>Windows</SubSystem>
       <SubSystem>Windows</SubSystem>
       <GenerateDebugInformation>true</GenerateDebugInformation>
       <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>
     </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>
   <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
   <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
     <ClCompile>
     <ClCompile>
@@ -102,14 +117,23 @@
       <WarningLevel>Level3</WarningLevel>
       <WarningLevel>Level3</WarningLevel>
       <Optimization>Disabled</Optimization>
       <Optimization>Disabled</Optimization>
       <PreprocessorDefinitions>WIN32;_DEBUG;_WINDOWS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
       <PreprocessorDefinitions>WIN32;_DEBUG;_WINDOWS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+      <AdditionalIncludeDirectories>..\..\..\..\include;$(ProjectDir)</AdditionalIncludeDirectories>
     </ClCompile>
     </ClCompile>
     <Link>
     <Link>
       <SubSystem>Windows</SubSystem>
       <SubSystem>Windows</SubSystem>
       <GenerateDebugInformation>true</GenerateDebugInformation>
       <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>
     </Link>
     <PostBuildEvent>
     <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>
     </PostBuildEvent>
   </ItemDefinitionGroup>
   </ItemDefinitionGroup>
   <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
   <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
@@ -121,13 +145,26 @@
       <FunctionLevelLinking>true</FunctionLevelLinking>
       <FunctionLevelLinking>true</FunctionLevelLinking>
       <IntrinsicFunctions>true</IntrinsicFunctions>
       <IntrinsicFunctions>true</IntrinsicFunctions>
       <PreprocessorDefinitions>WIN32;NDEBUG;_WINDOWS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
       <PreprocessorDefinitions>WIN32;NDEBUG;_WINDOWS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+      <AdditionalIncludeDirectories>..\..\..\..\include;$(ProjectDir)</AdditionalIncludeDirectories>
     </ClCompile>
     </ClCompile>
     <Link>
     <Link>
       <SubSystem>Windows</SubSystem>
       <SubSystem>Windows</SubSystem>
       <GenerateDebugInformation>true</GenerateDebugInformation>
       <GenerateDebugInformation>true</GenerateDebugInformation>
       <EnableCOMDATFolding>true</EnableCOMDATFolding>
       <EnableCOMDATFolding>true</EnableCOMDATFolding>
       <OptimizeReferences>true</OptimizeReferences>
       <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>
     </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>
   <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
   <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
     <ClCompile>
     <ClCompile>
@@ -138,16 +175,25 @@
       <FunctionLevelLinking>true</FunctionLevelLinking>
       <FunctionLevelLinking>true</FunctionLevelLinking>
       <IntrinsicFunctions>true</IntrinsicFunctions>
       <IntrinsicFunctions>true</IntrinsicFunctions>
       <PreprocessorDefinitions>WIN32;NDEBUG;_WINDOWS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
       <PreprocessorDefinitions>WIN32;NDEBUG;_WINDOWS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+      <AdditionalIncludeDirectories>..\..\..\..\include;$(ProjectDir)</AdditionalIncludeDirectories>
     </ClCompile>
     </ClCompile>
     <Link>
     <Link>
       <SubSystem>Windows</SubSystem>
       <SubSystem>Windows</SubSystem>
       <GenerateDebugInformation>true</GenerateDebugInformation>
       <GenerateDebugInformation>true</GenerateDebugInformation>
       <EnableCOMDATFolding>true</EnableCOMDATFolding>
       <EnableCOMDATFolding>true</EnableCOMDATFolding>
       <OptimizeReferences>true</OptimizeReferences>
       <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>
     </Link>
     <PostBuildEvent>
     <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>
     </PostBuildEvent>
   </ItemDefinitionGroup>
   </ItemDefinitionGroup>
   <ItemGroup>
   <ItemGroup>

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

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

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

@@ -6,6 +6,7 @@
 #include <Shlobj.h>
 #include <Shlobj.h>
 #include <Shlwapi.h>
 #include <Shlwapi.h>
 #include <shellapi.h>
 #include <shellapi.h>
+#include <Pathcch.h>
 
 
 extern PolycodeIDEApp *globalApp;
 extern PolycodeIDEApp *globalApp;
 
 
@@ -72,7 +73,7 @@ int APIENTRY WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLi
 
 
 	TCHAR FilePath[MAX_PATH] = { 0 };
 	TCHAR FilePath[MAX_PATH] = { 0 };
 	GetModuleFileName( 0, FilePath, MAX_PATH );
 	GetModuleFileName( 0, FilePath, MAX_PATH );
-	PathRemoveFileSpec( FilePath );    
+	PathCchRemoveFileSpec( FilePath, MAX_PATH);
 	SetCurrentDirectory( FilePath );
 	SetCurrentDirectory( FilePath );
 
 
 	PolycodeWinIDEView *view = new PolycodeWinIDEView(hInstance, nCmdShow, L"Polycode", true, false);
 	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'">
   <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
     <OutDir>..\..\..\..\lib\win32\x64</OutDir>
     <OutDir>..\..\..\..\lib\win32\x64</OutDir>
     <IncludePath>..\..\..\..\include;$(IncludePath)</IncludePath>
     <IncludePath>..\..\..\..\include;$(IncludePath)</IncludePath>
+    <TargetName>$(ProjectName)_d</TargetName>
   </PropertyGroup>
   </PropertyGroup>
   <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
   <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
     <OutDir>..\..\..\..\lib\win32\x64</OutDir>
     <OutDir>..\..\..\..\lib\win32\x64</OutDir>
     <IncludePath>..\..\..\..\include;$(IncludePath)</IncludePath>
     <IncludePath>..\..\..\..\include;$(IncludePath)</IncludePath>
   </PropertyGroup>
   </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'">
   <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
     <ClCompile>
     <ClCompile>
       <PrecompiledHeader>
       <PrecompiledHeader>
@@ -81,6 +89,7 @@
       <WarningLevel>Level3</WarningLevel>
       <WarningLevel>Level3</WarningLevel>
       <Optimization>Disabled</Optimization>
       <Optimization>Disabled</Optimization>
       <PreprocessorDefinitions>WIN32;_DEBUG;_LIB;%(PreprocessorDefinitions)</PreprocessorDefinitions>
       <PreprocessorDefinitions>WIN32;_DEBUG;_LIB;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+      <AdditionalIncludeDirectories>..\..\..\..\include</AdditionalIncludeDirectories>
     </ClCompile>
     </ClCompile>
     <Link>
     <Link>
       <SubSystem>Windows</SubSystem>
       <SubSystem>Windows</SubSystem>
@@ -94,6 +103,7 @@
       <WarningLevel>Level3</WarningLevel>
       <WarningLevel>Level3</WarningLevel>
       <Optimization>Disabled</Optimization>
       <Optimization>Disabled</Optimization>
       <PreprocessorDefinitions>WIN32;_DEBUG;_LIB;%(PreprocessorDefinitions)</PreprocessorDefinitions>
       <PreprocessorDefinitions>WIN32;_DEBUG;_LIB;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+      <AdditionalIncludeDirectories>..\..\..\..\include</AdditionalIncludeDirectories>
     </ClCompile>
     </ClCompile>
     <Link>
     <Link>
       <SubSystem>Windows</SubSystem>
       <SubSystem>Windows</SubSystem>
@@ -109,6 +119,7 @@
       <FunctionLevelLinking>true</FunctionLevelLinking>
       <FunctionLevelLinking>true</FunctionLevelLinking>
       <IntrinsicFunctions>true</IntrinsicFunctions>
       <IntrinsicFunctions>true</IntrinsicFunctions>
       <PreprocessorDefinitions>WIN32;NDEBUG;_LIB;%(PreprocessorDefinitions)</PreprocessorDefinitions>
       <PreprocessorDefinitions>WIN32;NDEBUG;_LIB;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+      <AdditionalIncludeDirectories>..\..\..\..\include</AdditionalIncludeDirectories>
     </ClCompile>
     </ClCompile>
     <Link>
     <Link>
       <SubSystem>Windows</SubSystem>
       <SubSystem>Windows</SubSystem>
@@ -126,6 +137,7 @@
       <FunctionLevelLinking>true</FunctionLevelLinking>
       <FunctionLevelLinking>true</FunctionLevelLinking>
       <IntrinsicFunctions>true</IntrinsicFunctions>
       <IntrinsicFunctions>true</IntrinsicFunctions>
       <PreprocessorDefinitions>WIN32;NDEBUG;_LIB;%(PreprocessorDefinitions)</PreprocessorDefinitions>
       <PreprocessorDefinitions>WIN32;NDEBUG;_LIB;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+      <AdditionalIncludeDirectories>..\..\..\..\include</AdditionalIncludeDirectories>
     </ClCompile>
     </ClCompile>
     <Link>
     <Link>
       <SubSystem>Windows</SubSystem>
       <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()->setPosition(5.0, 5.0, 5.0);
     scene->getDefaultCamera()->lookAt(Vector3());
     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);
     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 Label="UserMacros" />
   <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
   <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
     <LinkIncremental>true</LinkIncremental>
     <LinkIncremental>true</LinkIncremental>
+    <LibraryPath>..\..\..\..\lib\win32\$(PlatformShortName);$(LibraryPath)</LibraryPath>
+    <OutDir>$(ProjectDir)\$(Configuration)\</OutDir>
   </PropertyGroup>
   </PropertyGroup>
   <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
   <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
     <LinkIncremental>true</LinkIncremental>
     <LinkIncremental>true</LinkIncremental>
     <IncludePath>..\..\..\..\include;$(IncludePath)</IncludePath>
     <IncludePath>..\..\..\..\include;$(IncludePath)</IncludePath>
-    <LibraryPath>..\..\..\..\lib\win32\x64;$(LibraryPath)</LibraryPath>
+    <LibraryPath>..\..\..\..\lib\win32\$(PlatformShortName);$(LibraryPath)</LibraryPath>
+    <OutDir>$(ProjectDir)\$(Platform)\$(Configuration)\</OutDir>
   </PropertyGroup>
   </PropertyGroup>
   <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
   <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
     <LinkIncremental>false</LinkIncremental>
     <LinkIncremental>false</LinkIncremental>
+    <LibraryPath>..\..\..\..\lib\win32\$(PlatformShortName);$(LibraryPath)</LibraryPath>
+    <OutDir>$(ProjectDir)\$(Configuration)\</OutDir>
   </PropertyGroup>
   </PropertyGroup>
   <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
   <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
     <LinkIncremental>false</LinkIncremental>
     <LinkIncremental>false</LinkIncremental>
     <IncludePath>..\..\..\..\include;$(IncludePath)</IncludePath>
     <IncludePath>..\..\..\..\include;$(IncludePath)</IncludePath>
+    <OutDir>$(ProjectDir)\$(Platform)\$(Configuration)\</OutDir>
+    <LibraryPath>..\..\..\..\lib\win32\$(PlatformShortName);$(LibraryPath)</LibraryPath>
   </PropertyGroup>
   </PropertyGroup>
   <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
   <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
     <ClCompile>
     <ClCompile>
@@ -87,12 +94,18 @@
       </PrecompiledHeader>
       </PrecompiledHeader>
       <WarningLevel>Level3</WarningLevel>
       <WarningLevel>Level3</WarningLevel>
       <Optimization>Disabled</Optimization>
       <Optimization>Disabled</Optimization>
-      <PreprocessorDefinitions>WIN32;_DEBUG;_WINDOWS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+      <PreprocessorDefinitions>_WINDOWS;WIN32;_DEBUG;_WINDOWS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+      <AdditionalIncludeDirectories>..\..\..\..\include</AdditionalIncludeDirectories>
     </ClCompile>
     </ClCompile>
     <Link>
     <Link>
       <SubSystem>Windows</SubSystem>
       <SubSystem>Windows</SubSystem>
       <GenerateDebugInformation>true</GenerateDebugInformation>
       <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>
     </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>
   <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
   <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
     <ClCompile>
     <ClCompile>
@@ -100,13 +113,18 @@
       </PrecompiledHeader>
       </PrecompiledHeader>
       <WarningLevel>Level3</WarningLevel>
       <WarningLevel>Level3</WarningLevel>
       <Optimization>Disabled</Optimization>
       <Optimization>Disabled</Optimization>
-      <PreprocessorDefinitions>WIN32;_DEBUG;_WINDOWS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+      <PreprocessorDefinitions>_WINDOWS;WIN32;_DEBUG;_WINDOWS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+      <AdditionalIncludeDirectories>..\..\..\..\include</AdditionalIncludeDirectories>
     </ClCompile>
     </ClCompile>
     <Link>
     <Link>
       <SubSystem>Windows</SubSystem>
       <SubSystem>Windows</SubSystem>
       <GenerateDebugInformation>true</GenerateDebugInformation>
       <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>
     </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>
   <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
   <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
     <ClCompile>
     <ClCompile>
@@ -116,14 +134,20 @@
       <Optimization>MaxSpeed</Optimization>
       <Optimization>MaxSpeed</Optimization>
       <FunctionLevelLinking>true</FunctionLevelLinking>
       <FunctionLevelLinking>true</FunctionLevelLinking>
       <IntrinsicFunctions>true</IntrinsicFunctions>
       <IntrinsicFunctions>true</IntrinsicFunctions>
-      <PreprocessorDefinitions>WIN32;NDEBUG;_WINDOWS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+      <PreprocessorDefinitions>_WINDOWS;WIN32;NDEBUG;_WINDOWS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+      <AdditionalIncludeDirectories>..\..\..\..\include</AdditionalIncludeDirectories>
     </ClCompile>
     </ClCompile>
     <Link>
     <Link>
       <SubSystem>Windows</SubSystem>
       <SubSystem>Windows</SubSystem>
       <GenerateDebugInformation>true</GenerateDebugInformation>
       <GenerateDebugInformation>true</GenerateDebugInformation>
       <EnableCOMDATFolding>true</EnableCOMDATFolding>
       <EnableCOMDATFolding>true</EnableCOMDATFolding>
       <OptimizeReferences>true</OptimizeReferences>
       <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>
     </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>
   <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
   <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
     <ClCompile>
     <ClCompile>
@@ -133,19 +157,25 @@
       <Optimization>MaxSpeed</Optimization>
       <Optimization>MaxSpeed</Optimization>
       <FunctionLevelLinking>true</FunctionLevelLinking>
       <FunctionLevelLinking>true</FunctionLevelLinking>
       <IntrinsicFunctions>true</IntrinsicFunctions>
       <IntrinsicFunctions>true</IntrinsicFunctions>
-      <PreprocessorDefinitions>WIN32;NDEBUG;_WINDOWS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+      <PreprocessorDefinitions>_WINDOWS;WIN32;NDEBUG;_WINDOWS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+      <AdditionalIncludeDirectories>..\..\..\..\include</AdditionalIncludeDirectories>
     </ClCompile>
     </ClCompile>
     <Link>
     <Link>
       <SubSystem>Windows</SubSystem>
       <SubSystem>Windows</SubSystem>
       <GenerateDebugInformation>true</GenerateDebugInformation>
       <GenerateDebugInformation>true</GenerateDebugInformation>
       <EnableCOMDATFolding>true</EnableCOMDATFolding>
       <EnableCOMDATFolding>true</EnableCOMDATFolding>
       <OptimizeReferences>true</OptimizeReferences>
       <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>
     </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>
   <ItemGroup>
   <ItemGroup>
     <ClCompile Include="..\..\..\..\src\view\win32\PolycodeView.cpp" />
     <ClCompile Include="..\..\..\..\src\view\win32\PolycodeView.cpp" />
     <ClCompile Include="PolycodeTemplateApp.cpp" />
     <ClCompile Include="PolycodeTemplateApp.cpp" />
-    <ClCompile Include="TemapleApp.cpp" />
+    <ClCompile Include="TemplateApp.cpp" />
   </ItemGroup>
   </ItemGroup>
   <ItemGroup>
   <ItemGroup>
     <ClInclude Include="..\..\..\..\include\polycode\view\win32\PolycodeView.h" />
     <ClInclude Include="..\..\..\..\include\polycode\view\win32\PolycodeView.h" />

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

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

+ 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 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;
 			return timeSleptMs;
 		}
 		}
         
         
-        Number getFixedTimestep();
+		Number getFixedTimestep();
 		
 		
 		/**
 		/**
 		* Returns the total ticks elapsed since launch.
 		* 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
 		* @param keyCode The key to check for
 		* @return True if the key is pressed, false otherwise.
 		* @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
 		* Returns the state of the specified joystick button for the specified joystick index. If the joystick index is invalid, returns false

+ 6 - 3
include/polycode/core/PolyOpenGLGraphicsInterface.h

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

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

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

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

@@ -145,4 +145,4 @@ namespace Polycode {
 		EGLSurface mEglSurface;
 		EGLSurface mEglSurface;
 
 
 	};
 	};
-}
+}

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

@@ -25,7 +25,7 @@
 #elif defined(_WINDOWS)
 #elif defined(_WINDOWS)
 #include "polycode/ide/PolycodeWinIDEView.h"
 #include "polycode/ide/PolycodeWinIDEView.h"
 #else
 #else
-#include "polycode/ide/PolycodeView.h"
+#include "polycode/view/linux/PolycodeView.h"
 #endif
 #endif
 
 
 #include "polycode/ide/PolycodeGlobals.h"
 #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;
+    };
+
+}

+ 1 - 1
lib

@@ -1 +1 @@
-Subproject commit 1f45a39574ddda0b22c951c86b01612efda30a43
+Subproject commit 7ac559ef326f395ebf6569df0efcb81ad0f1f157

+ 1 - 0
src/core/PolyOpenGLGraphicsInterface.cpp

@@ -363,6 +363,7 @@ void OpenGLGraphicsInterface::createRenderBuffer(RenderBuffer *renderBuffer) {
         createTexture(renderBuffer->depthTexture);
         createTexture(renderBuffer->depthTexture);
         
         
         glRenderbufferStorage(GL_RENDERBUFFER, GL_DEPTH_COMPONENT, renderBuffer->getWidth(), renderBuffer->getHeight());
         glRenderbufferStorage(GL_RENDERBUFFER, GL_DEPTH_COMPONENT, renderBuffer->getWidth(), renderBuffer->getHeight());
+
         glFramebufferTexture2D(GL_FRAMEBUFFER, GL_DEPTH_ATTACHMENT, GL_TEXTURE_2D, *((GLuint*)renderBuffer->depthTexture->platformData), 0);
         glFramebufferTexture2D(GL_FRAMEBUFFER, GL_DEPTH_ATTACHMENT, GL_TEXTURE_2D, *((GLuint*)renderBuffer->depthTexture->platformData), 0);
     }
     }
     
     

+ 2 - 2
src/core/PolyPAAudioInterface.cpp

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

+ 150 - 71
src/core/PolySDLCore.cpp

@@ -20,21 +20,23 @@
  THE SOFTWARE.
  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.h>
 #include <SDL/SDL_syswm.h>
 #include <SDL/SDL_syswm.h>
 #include <stdio.h>
 #include <stdio.h>
 #include <limits.h>
 #include <limits.h>
+#include <dirent.h>
 
 
 #include <iostream>
 #include <iostream>
 
 
@@ -68,6 +70,16 @@ namespace {
 using namespace Polycode;
 using namespace Polycode;
 using std::vector;
 using std::vector;
 
 
+void SDLCoreMutex::lock()
+{
+	SDL_mutexP(pMutex);
+}
+
+void SDLCoreMutex::unlock() {
+	SDL_mutexV(pMutex);
+}
+
+
 long getThreadID() {
 long getThreadID() {
 	return (long)pthread_self();
 	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) {
 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;
 	this->resizableWindow = view->resizable;
 
 
+	fileProviders.push_back(new BasicFileProvider());
+	fileProviders.push_back(new PhysFSFileProvider());
+	
 	char *buffer = getcwd(NULL, 0);
 	char *buffer = getcwd(NULL, 0);
 	defaultWorkingDirectory = String(buffer);
 	defaultWorkingDirectory = String(buffer);
 	free(buffer);
 	free(buffer);
@@ -92,22 +107,33 @@ SDLCore::SDLCore(PolycodeView *view, int _xRes, int _yRes, bool fullScreen, bool
 	const char *homedir = pw->pw_dir;
 	const char *homedir = pw->pw_dir;
 	userHomeDirectory = String(homedir);
 	userHomeDirectory = String(homedir);
 
 
-	String *windowTitle = (String*)view->windowData;
-
+	windowTitle = (String*)view->windowData;
+	
 	if(resizableWindow) {
 	if(resizableWindow) {
 		unsetenv("SDL_VIDEO_CENTERED");
 		unsetenv("SDL_VIDEO_CENTERED");
 	} else {
 	} else {
 		setenv("SDL_VIDEO_CENTERED", "1", 1);
 		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();
 	eventMutex = createMutex();
-	renderer = new OpenGLRenderer();
+	
+	renderer = new Renderer();
+	OpenGLGraphicsInterface *renderInterface = new OpenGLGraphicsInterface();
+	renderInterface->lineSmooth = true;
+	renderer->setGraphicsInterface(this, renderInterface);
 	services->setRenderer(renderer);
 	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_WM_SetCaption(windowTitle->c_str(), windowTitle->c_str());
 	
 	
 	SDL_EnableUNICODE(1);
 	SDL_EnableUNICODE(1);
@@ -121,6 +147,11 @@ SDLCore::SDLCore(PolycodeView *view, int _xRes, int _yRes, bool fullScreen, bool
 		SDL_JoystickOpen(i);
 		SDL_JoystickOpen(i);
 		input->addJoystick(i);
 		input->addJoystick(i);
 	}
 	}
+	
+	services->getSoundManager()->setAudioInterface(new PAAudioInterface());
+	
+	lastMouseX = 0;
+	lastMouseY = 0;
 
 
 #ifdef USE_X11
 #ifdef USE_X11
 	// Start listening to clipboard events.
 	// 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)
 	//  clipboard events and respond to them)
 	init_scrap();
 	init_scrap();
 #endif // USE_X11
 #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) {
 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_RED_SIZE,   8);
 	SDL_GL_SetAttribute( SDL_GL_GREEN_SIZE, 8);
 	SDL_GL_SetAttribute( SDL_GL_GREEN_SIZE, 8);
 	SDL_GL_SetAttribute( SDL_GL_BLUE_SIZE,  8);
 	SDL_GL_SetAttribute( SDL_GL_BLUE_SIZE,  8);
 	SDL_GL_SetAttribute( SDL_GL_ALPHA_SIZE, 8);
 	SDL_GL_SetAttribute( SDL_GL_ALPHA_SIZE, 8);
 	
 	
 	if(aaLevel > 0) {
 	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 {
 	} 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;
 	flags = SDL_OPENGL;
@@ -163,6 +201,10 @@ void SDLCore::setVideoMode(int xRes, int yRes, bool fullScreen, bool vSync, int
 	if(resizableWindow) {
 	if(resizableWindow) {
 		flags |= SDL_RESIZABLE;
 		flags |= SDL_RESIZABLE;
 	}
 	}
+	
+// 	if(modeInfo->retinaSupport) {
+// 		flags |= SDL_WINDOW_ALLOW_HIGHDPI;
+// 	}
 /*
 /*
 	if(vSync) {
 	if(vSync) {
 		flags |= SDL_DOUBLEBUF;
 		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);
 		SDL_GL_SetAttribute(SDL_GL_SWAP_CONTROL, 1);
 	} else {
 	} else {
 		SDL_GL_SetAttribute(SDL_GL_DOUBLEBUFFER, 0);
 		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);
 	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() {
 vector<Polycode::Rectangle> SDLCore::getVideoModes() {
@@ -254,10 +301,10 @@ unsigned int SDLCore::getTicks() {
 void SDLCore::enableMouse(bool newval) {
 void SDLCore::enableMouse(bool newval) {
 	if(newval) {
 	if(newval) {
 		SDL_ShowCursor(1);
 		SDL_ShowCursor(1);
-		SDL_WM_GrabInput(SDL_GRAB_OFF);
+		//SDL_WM_GrabInput(SDL_GRAB_OFF);
 	} else {
 	} else {
 		SDL_ShowCursor(0);
 		SDL_ShowCursor(0);
-		SDL_WM_GrabInput(SDL_GRAB_ON);
+		//SDL_WM_GrabInput(SDL_GRAB_ON);
 	}
 	}
 	Core::enableMouse(newval);
 	Core::enableMouse(newval);
 }
 }
@@ -307,9 +354,12 @@ bool SDLCore::checkSpecialKeyEvents(PolyKEY key) {
 }
 }
 
 
 void SDLCore::Render() {
 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();
 	SDL_GL_SwapBuffers();
 }
 }
 
 
@@ -327,20 +377,19 @@ bool SDLCore::systemUpdate() {
 					running = false;
 					running = false;
 				break;
 				break;
 				case SDL_VIDEORESIZE:
 				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->xRes = event.resize.w;
 					this->yRes = event.resize.h;
 					this->yRes = event.resize.h;
 					SDL_SetVideoMode(xRes, yRes, 0, flags);
 					SDL_SetVideoMode(xRes, yRes, 0, flags);
-					renderer->Resize(xRes, yRes);	
 					dispatchEvent(new Event(), EVENT_CORE_RESIZE);	
 					dispatchEvent(new Event(), EVENT_CORE_RESIZE);	
 				break;
 				break;
 				case SDL_ACTIVEEVENT:
 				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();
 							gainFocus();
 						} else {
 						} else {
 							loseFocus();
 							loseFocus();
@@ -358,16 +407,16 @@ bool SDLCore::systemUpdate() {
 				break;
 				break;
 				case SDL_KEYDOWN:
 				case SDL_KEYDOWN:
 					if(!checkSpecialKeyEvents((PolyKEY)(event.key.keysym.sym))) {
 					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;
 				break;
 				case SDL_KEYUP:
 				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;
 				break;
 				case SDL_MOUSEBUTTONDOWN:
 				case SDL_MOUSEBUTTONDOWN:
-					if(event.button.button == SDL_BUTTON_WHEELUP) {
+					if(event.button.button == SDL_BUTTON_WHEELUP){
 						input->mouseWheelUp(getTicks());
 						input->mouseWheelUp(getTicks());
-					} else if(event.button.button == SDL_BUTTON_WHEELDOWN) {
+					} else if (event.button.button == SDL_BUTTON_WHEELDOWN){
 						input->mouseWheelDown(getTicks());
 						input->mouseWheelDown(getTicks());
 					} else {
 					} else {
 						switch(event.button.button) {
 						switch(event.button.button) {
@@ -384,24 +433,23 @@ bool SDLCore::systemUpdate() {
 					}
 					}
 				break;
 				break;
 				case SDL_MOUSEBUTTONUP:
 				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;
 				break;
 				case SDL_MOUSEMOTION:
 				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());
 					input->setMousePosition(event.motion.x, event.motion.y, getTicks());
+					lastMouseY = event.motion.y;
+					lastMouseX = event.motion.x;
 				break;
 				break;
 				default:
 				default:
 					break;
 					break;
@@ -418,9 +466,11 @@ void SDLCore::setCursor(int cursorType) {
 
 
 void SDLCore::warpCursor(int x, int y) {
 void SDLCore::warpCursor(int x, int y) {
 	SDL_WarpMouse(x, y);
 	SDL_WarpMouse(x, y);
+	lastMouseX = x;
+	lastMouseY = y;
 }
 }
 
 
-void SDLCore::lockMutex(CoreMutex *mutex) {
+/*void SDLCore::lockMutex(CoreMutex *mutex) {
 	SDLCoreMutex *smutex = (SDLCoreMutex*)mutex;
 	SDLCoreMutex *smutex = (SDLCoreMutex*)mutex;
 	SDL_mutexP(smutex->pMutex);
 	SDL_mutexP(smutex->pMutex);
 
 
@@ -429,7 +479,7 @@ void SDLCore::lockMutex(CoreMutex *mutex) {
 void SDLCore::unlockMutex(CoreMutex *mutex) {
 void SDLCore::unlockMutex(CoreMutex *mutex) {
 	SDLCoreMutex *smutex = (SDLCoreMutex*)mutex;
 	SDLCoreMutex *smutex = (SDLCoreMutex*)mutex;
 	SDL_mutexV(smutex->pMutex);
 	SDL_mutexV(smutex->pMutex);
-}
+}*/
 
 
 CoreMutex *SDLCore::createMutex() {
 CoreMutex *SDLCore::createMutex() {
 	SDLCoreMutex *mutex = new SDLCoreMutex();
 	SDLCoreMutex *mutex = new SDLCoreMutex();
@@ -441,6 +491,7 @@ void SDLCore::copyStringToClipboard(const String& str) {
 #ifdef USE_X11
 #ifdef USE_X11
 	put_scrap(T('T', 'E', 'X', 'T'), str.size(), str.c_str());
 	put_scrap(T('T', 'E', 'X', 'T'), str.size(), str.c_str());
 #endif
 #endif
+// 	SDL_SetClipboardText(str.c_str());
 }
 }
 
 
 String SDLCore::getClipboardString() {
 String SDLCore::getClipboardString() {
@@ -452,7 +503,14 @@ String SDLCore::getClipboardString() {
 	String rval(buffer, dstlen);
 	String rval(buffer, dstlen);
 	free(buffer);
 	free(buffer);
 	return rval;
 	return rval;
-#endif
+	#endif
+// 	String rval;
+// 	if(SDL_HasClipboardText() ==SDL_TRUE){
+// 		rval=SDL_GetClipboardText();
+// 	} else {
+// 		rval="";
+// 	}
+// 	return rval;
 }
 }
 
 
 void SDLCore::createFolder(const String& folderPath) {
 void SDLCore::createFolder(const String& folderPath) {
@@ -505,9 +563,30 @@ String SDLCore::saveFilePicker(std::vector<CoreFileExtension> extensions) {
 }
 }
 
 
 void SDLCore::resizeTo(int xRes, int yRes) {
 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
 #ifdef USE_X11
 // SDL_scrap.c
 // SDL_scrap.c
@@ -947,4 +1026,4 @@ void free_cursors() {
 } // namespace
 } // namespace
 // end X11 cursor
 // 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) {
 SceneImage::SceneImage(const String& fileName) : ScenePrimitive(ScenePrimitive::TYPE_VPLANE, 1, 1) {
     
     
     // RENDERER_TODO
     // RENDERER_TODO
-    Texture *texture = getShaderPass(0).shaderBinding->loadTextureForParam("diffuse", fileName);
+	setMaterialByName("Unlit");
+	Texture *texture = getShaderPass(0).shaderBinding->loadTextureForParam("diffuse", fileName);
 
 
 	imageWidth = texture->getWidth();
 	imageWidth = texture->getWidth();
 	imageHeight = texture->getHeight();
 	imageHeight = texture->getHeight();
@@ -51,6 +52,7 @@ SceneImage::SceneImage(const String& fileName) : ScenePrimitive(ScenePrimitive::
 SceneImage::SceneImage(Image *image) : ScenePrimitive(ScenePrimitive::TYPE_VPLANE, 1, 1) {
 SceneImage::SceneImage(Image *image) : ScenePrimitive(ScenePrimitive::TYPE_VPLANE, 1, 1) {
     // RENDERER_TODO
     // RENDERER_TODO
 	//loadTextureFromImage(image);
 	//loadTextureFromImage(image);
+	setMaterialByName("Unlit");
     Texture *texture = Services()->getMaterialManager()->createTextureFromImage(image);
     Texture *texture = Services()->getMaterialManager()->createTextureFromImage(image);
     getShaderPass(0).shaderBinding->setTextureForParam("diffuse", texture);
     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)  {
 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();
 	imageWidth = texture->getWidth();
 	imageHeight = texture->getHeight();
 	imageHeight = texture->getHeight();

+ 14 - 8
src/ide/PolycodeProps.cpp

@@ -1677,9 +1677,10 @@ TargetBindingProp::TargetBindingProp(Shader *shader, Material *material, ShaderB
 	for(int i=0; i < material->getNumShaderRenderTargets(); i++) {
 	for(int i=0; i < material->getNumShaderRenderTargets(); i++) {
 		ShaderRenderTarget *target = material->getShaderRenderTarget(i);		
 		ShaderRenderTarget *target = material->getShaderRenderTarget(i);		
 		targetComboBox->addComboItem(target->id, (void*) target);
 		targetComboBox->addComboItem(target->id, (void*) target);
-		if(targetBinding->texture == target->texture) {
-			targetComboBox->setSelectedIndex(i);
-		}
+		//RENDERER_UPGRADE: TODO
+		//if(targetBinding->texture == target->texture) {
+		//	targetComboBox->setSelectedIndex(i);
+		//}
 	}
 	}
 	targetComboBox->addEventListener(this, UIEvent::CHANGE_EVENT);
 	targetComboBox->addEventListener(this, UIEvent::CHANGE_EVENT);
 	propContents->addFocusChild(targetComboBox);
 	propContents->addFocusChild(targetComboBox);
@@ -1731,7 +1732,8 @@ void TargetBindingProp::handleEvent(Event *event) {
 		} else {
 		} else {
 			textureComboBox->enabled = true;
 			textureComboBox->enabled = true;
 			textureComboBox->visible = true;
 			textureComboBox->visible = true;
-			binding->setTextureForParam(targetBinding->name, targetBinding->texture);
+			//RENDERER_UPGRADE: TODO
+			//binding->setTextureForParam(targetBinding->name, targetBinding->texture);
 		}		
 		}		
 		
 		
 		if(typeComboBox->getSelectedIndex() == 2 || typeComboBox->getSelectedIndex() == 3) {
 		if(typeComboBox->getSelectedIndex() == 2 || typeComboBox->getSelectedIndex() == 3) {
@@ -1750,7 +1752,8 @@ void TargetBindingProp::handleEvent(Event *event) {
 		dispatchEvent(new Event(), Event::CHANGE_EVENT);
 		dispatchEvent(new Event(), Event::CHANGE_EVENT);
 	} else if(event->getDispatcher() == targetComboBox && event->getEventCode() == UIEvent::CHANGE_EVENT) {
 	} else if(event->getDispatcher() == targetComboBox && event->getEventCode() == UIEvent::CHANGE_EVENT) {
 		ShaderRenderTarget *target = (ShaderRenderTarget*)targetComboBox->getSelectedItem()->data;		
 		ShaderRenderTarget *target = (ShaderRenderTarget*)targetComboBox->getSelectedItem()->data;		
-		targetBinding->texture = target->texture;
+		//RENDERER_UPGRADE: TODO
+// 		targetBinding->texture = target->texture;
 		targetBinding->id  = target->id;
 		targetBinding->id  = target->id;
 		
 		
 		binding->removeRenderTargetBinding(targetBinding);		
 		binding->removeRenderTargetBinding(targetBinding);		
@@ -1758,7 +1761,8 @@ void TargetBindingProp::handleEvent(Event *event) {
 
 
 		binding->removeParam(targetBinding->name);
 		binding->removeParam(targetBinding->name);
 		if(targetBinding->mode == RenderTargetBinding::MODE_IN) {
 		if(targetBinding->mode == RenderTargetBinding::MODE_IN) {
-			binding->setTextureForParam(targetBinding->name, targetBinding->texture);
+			//RENDERER_UPGRADE: TODO
+// 			binding->setTextureForParam(targetBinding->name, targetBinding->texture);
 		}
 		}
 		dispatchEvent(new Event(), Event::CHANGE_EVENT);		
 		dispatchEvent(new Event(), Event::CHANGE_EVENT);		
 	} else if(event->getDispatcher() == textureComboBox && event->getEventCode() == UIEvent::CHANGE_EVENT) {
 	} else if(event->getDispatcher() == textureComboBox && event->getEventCode() == UIEvent::CHANGE_EVENT) {
@@ -1768,7 +1772,8 @@ void TargetBindingProp::handleEvent(Event *event) {
 		binding->addRenderTargetBinding(targetBinding);		
 		binding->addRenderTargetBinding(targetBinding);		
 
 
 		binding->removeParam(targetBinding->name);
 		binding->removeParam(targetBinding->name);
-		binding->setTextureForParam(targetBinding->name, targetBinding->texture);
+		//RENDERER_UPGRADE: TODO
+// 		binding->setTextureForParam(targetBinding->name, targetBinding->texture);
 		dispatchEvent(new Event(), Event::CHANGE_EVENT);
 		dispatchEvent(new Event(), Event::CHANGE_EVENT);
 	}
 	}
 }
 }
@@ -2040,7 +2045,8 @@ void TargetBindingsSheet::handleEvent(Event *event) {
 	if(event->getDispatcher() == addButton->getButton()) {
 	if(event->getDispatcher() == addButton->getButton()) {
 		RenderTargetBinding* newBinding = new RenderTargetBinding();
 		RenderTargetBinding* newBinding = new RenderTargetBinding();
 		newBinding->mode = RenderTargetBinding::MODE_COLOR;
 		newBinding->mode = RenderTargetBinding::MODE_COLOR;
-		newBinding->texture = NULL;		
+		//RENDERER_UPGRADE: TODO
+// 		newBinding->texture = NULL;		
 		binding->addRenderTargetBinding(newBinding);				
 		binding->addRenderTargetBinding(newBinding);				
 		refreshTargets();			
 		refreshTargets();			
 		dispatchEvent(new Event(), Event::CHANGE_EVENT);
 		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() {
+
+    }
+
+}

Vissa filer visades inte eftersom för många filer har ändrats