Jelajahi Sumber

Windows fixes

Ivan Safrin 14 tahun lalu
induk
melakukan
c5ab22c40c

+ 1 - 0
.gitignore

@@ -27,6 +27,7 @@
 *.exp
 *.exp
 *.zip
 *.zip
 *.swo
 *.swo
+*.opensdf
 
 
 Core/Build/Mac\ OS\ X/build
 Core/Build/Mac\ OS\ X/build
 IDE/Build/Mac\ OS\ X/build
 IDE/Build/Mac\ OS\ X/build

TEMPAT SAMPAH
Bindings/Contents/LUA/API/api.pak


+ 9 - 0
Core/Build/MSVC/Polycore/Polycore.vcxproj

@@ -106,6 +106,9 @@
     <ClInclude Include="..\..\..\Contents\Include\PolyGLCubemap.h" />
     <ClInclude Include="..\..\..\Contents\Include\PolyGLCubemap.h" />
     <ClInclude Include="..\..\..\Contents\Include\PolyGlobals.h" />
     <ClInclude Include="..\..\..\Contents\Include\PolyGlobals.h" />
     <ClInclude Include="..\..\..\Contents\Include\PolyGLRenderer.h" />
     <ClInclude Include="..\..\..\Contents\Include\PolyGLRenderer.h" />
+    <ClInclude Include="..\..\..\Contents\Include\PolyGLSLProgram.h" />
+    <ClInclude Include="..\..\..\Contents\Include\PolyGLSLShader.h" />
+    <ClInclude Include="..\..\..\Contents\Include\PolyGLSLShaderModule.h" />
     <ClInclude Include="..\..\..\Contents\Include\PolyGLTexture.h" />
     <ClInclude Include="..\..\..\Contents\Include\PolyGLTexture.h" />
     <ClInclude Include="..\..\..\Contents\Include\PolyGLVertexBuffer.h" />
     <ClInclude Include="..\..\..\Contents\Include\PolyGLVertexBuffer.h" />
     <ClInclude Include="..\..\..\Contents\Include\PolyImage.h" />
     <ClInclude Include="..\..\..\Contents\Include\PolyImage.h" />
@@ -139,6 +142,7 @@
     <ClInclude Include="..\..\..\Contents\Include\PolySceneMesh.h" />
     <ClInclude Include="..\..\..\Contents\Include\PolySceneMesh.h" />
     <ClInclude Include="..\..\..\Contents\Include\PolyScenePrimitive.h" />
     <ClInclude Include="..\..\..\Contents\Include\PolyScenePrimitive.h" />
     <ClInclude Include="..\..\..\Contents\Include\PolySceneRenderTexture.h" />
     <ClInclude Include="..\..\..\Contents\Include\PolySceneRenderTexture.h" />
+    <ClInclude Include="..\..\..\Contents\Include\PolySceneSound.h" />
     <ClInclude Include="..\..\..\Contents\Include\PolyScreen.h" />
     <ClInclude Include="..\..\..\Contents\Include\PolyScreen.h" />
     <ClInclude Include="..\..\..\Contents\Include\PolyScreenCurve.h" />
     <ClInclude Include="..\..\..\Contents\Include\PolyScreenCurve.h" />
     <ClInclude Include="..\..\..\Contents\Include\PolyScreenEntity.h" />
     <ClInclude Include="..\..\..\Contents\Include\PolyScreenEntity.h" />
@@ -190,6 +194,9 @@
     <ClCompile Include="..\..\..\Contents\Source\PolyFontManager.cpp" />
     <ClCompile Include="..\..\..\Contents\Source\PolyFontManager.cpp" />
     <ClCompile Include="..\..\..\Contents\Source\PolyGLCubemap.cpp" />
     <ClCompile Include="..\..\..\Contents\Source\PolyGLCubemap.cpp" />
     <ClCompile Include="..\..\..\Contents\Source\PolyGLRenderer.cpp" />
     <ClCompile Include="..\..\..\Contents\Source\PolyGLRenderer.cpp" />
+    <ClCompile Include="..\..\..\Contents\Source\PolyGLSLProgram.cpp" />
+    <ClCompile Include="..\..\..\Contents\Source\PolyGLSLShader.cpp" />
+    <ClCompile Include="..\..\..\Contents\Source\PolyGLSLShaderModule.cpp" />
     <ClCompile Include="..\..\..\Contents\Source\PolyGLTexture.cpp" />
     <ClCompile Include="..\..\..\Contents\Source\PolyGLTexture.cpp" />
     <ClCompile Include="..\..\..\Contents\Source\PolyGLVertexBuffer.cpp" />
     <ClCompile Include="..\..\..\Contents\Source\PolyGLVertexBuffer.cpp" />
     <ClCompile Include="..\..\..\Contents\Source\PolyImage.cpp" />
     <ClCompile Include="..\..\..\Contents\Source\PolyImage.cpp" />
@@ -221,6 +228,7 @@
     <ClCompile Include="..\..\..\Contents\Source\PolySceneMesh.cpp" />
     <ClCompile Include="..\..\..\Contents\Source\PolySceneMesh.cpp" />
     <ClCompile Include="..\..\..\Contents\Source\PolyScenePrimitive.cpp" />
     <ClCompile Include="..\..\..\Contents\Source\PolyScenePrimitive.cpp" />
     <ClCompile Include="..\..\..\Contents\Source\PolySceneRenderTexture.cpp" />
     <ClCompile Include="..\..\..\Contents\Source\PolySceneRenderTexture.cpp" />
+    <ClCompile Include="..\..\..\Contents\Source\PolySceneSound.cpp" />
     <ClCompile Include="..\..\..\Contents\Source\PolyScreen.cpp" />
     <ClCompile Include="..\..\..\Contents\Source\PolyScreen.cpp" />
     <ClCompile Include="..\..\..\Contents\Source\PolyScreenCurve.cpp" />
     <ClCompile Include="..\..\..\Contents\Source\PolyScreenCurve.cpp" />
     <ClCompile Include="..\..\..\Contents\Source\PolyScreenEntity.cpp" />
     <ClCompile Include="..\..\..\Contents\Source\PolyScreenEntity.cpp" />
@@ -231,6 +239,7 @@
     <ClCompile Include="..\..\..\Contents\Source\PolyScreenManager.cpp" />
     <ClCompile Include="..\..\..\Contents\Source\PolyScreenManager.cpp" />
     <ClCompile Include="..\..\..\Contents\Source\PolyScreenMesh.cpp" />
     <ClCompile Include="..\..\..\Contents\Source\PolyScreenMesh.cpp" />
     <ClCompile Include="..\..\..\Contents\Source\PolyScreenShape.cpp" />
     <ClCompile Include="..\..\..\Contents\Source\PolyScreenShape.cpp" />
+    <ClCompile Include="..\..\..\Contents\Source\PolyScreenSound.cpp" />
     <ClCompile Include="..\..\..\Contents\Source\PolyScreenSprite.cpp" />
     <ClCompile Include="..\..\..\Contents\Source\PolyScreenSprite.cpp" />
     <ClCompile Include="..\..\..\Contents\Source\PolyShader.cpp" />
     <ClCompile Include="..\..\..\Contents\Source\PolyShader.cpp" />
     <ClCompile Include="..\..\..\Contents\Source\PolySkeleton.cpp" />
     <ClCompile Include="..\..\..\Contents\Source\PolySkeleton.cpp" />

+ 1 - 0
Core/Contents/Include/PolyWinCore.h

@@ -26,6 +26,7 @@
 #include "PolyGlobals.h"
 #include "PolyGlobals.h"
 #include "PolyCore.h"
 #include "PolyCore.h"
 #include "PolyGLRenderer.h"
 #include "PolyGLRenderer.h"
+#include "PolyGLSLShaderModule.h"
 #include <windows.h>
 #include <windows.h>
 #include <windowsx.h>
 #include <windowsx.h>
 #include <WinUser.h>
 #include <WinUser.h>

+ 10 - 2
Core/Contents/Source/PolyGLSLShaderModule.cpp

@@ -29,7 +29,7 @@ using namespace Polycode;
 PFNGLUSEPROGRAMPROC glUseProgram;
 PFNGLUSEPROGRAMPROC glUseProgram;
 PFNGLUNIFORM1IPROC glUniform1i;
 PFNGLUNIFORM1IPROC glUniform1i;
 PFNGLGETUNIFORMLOCATIONARBPROC glGetUniformLocation;
 PFNGLGETUNIFORMLOCATIONARBPROC glGetUniformLocation;
-PFNGLACTIVETEXTUREPROC glActiveTexture;
+extern PFNGLACTIVETEXTUREPROC glActiveTexture;
 PFNGLCREATESHADERPROC glCreateShader;
 PFNGLCREATESHADERPROC glCreateShader;
 PFNGLSHADERSOURCEPROC glShaderSource;
 PFNGLSHADERSOURCEPROC glShaderSource;
 PFNGLCOMPILESHADERPROC glCompileShader;
 PFNGLCOMPILESHADERPROC glCompileShader;
@@ -39,11 +39,14 @@ PFNGLLINKPROGRAMPROC glLinkProgram;
 PFNGLDETACHSHADERPROC glDetachShader;
 PFNGLDETACHSHADERPROC glDetachShader;
 PFNGLDELETESHADERPROC glDeleteShader;
 PFNGLDELETESHADERPROC glDeleteShader;
 PFNGLDELETEPROGRAMPROC glDeleteProgram;
 PFNGLDELETEPROGRAMPROC glDeleteProgram;
+
+PFNGLUNIFORMMATRIX4FVPROC glUniformMatrix4fv;
+PFNGLGETSHADERIVPROC glGetShaderiv;
+PFNGLGETSHADERINFOLOGPROC glGetShaderInfoLog;
 #endif
 #endif
 
 
 GLSLShaderModule::GLSLShaderModule() : PolycodeShaderModule() {
 GLSLShaderModule::GLSLShaderModule() : PolycodeShaderModule() {
 #ifdef _WINDOWS
 #ifdef _WINDOWS
-	glActiveTexture   = (PFNGLACTIVETEXTUREPROC)wglGetProcAddress("glActiveTexture");
 	glUseProgram   = (PFNGLUSEPROGRAMPROC)wglGetProcAddress("glUseProgram");
 	glUseProgram   = (PFNGLUSEPROGRAMPROC)wglGetProcAddress("glUseProgram");
 	glUniform1i = (PFNGLUNIFORM1IPROC)wglGetProcAddress("glUniform1i");
 	glUniform1i = (PFNGLUNIFORM1IPROC)wglGetProcAddress("glUniform1i");
 	glGetUniformLocation = (PFNGLGETUNIFORMLOCATIONARBPROC)wglGetProcAddress("glGetUniformLocation");
 	glGetUniformLocation = (PFNGLGETUNIFORMLOCATIONARBPROC)wglGetProcAddress("glGetUniformLocation");
@@ -56,6 +59,11 @@ GLSLShaderModule::GLSLShaderModule() : PolycodeShaderModule() {
 	glDetachShader = (PFNGLDETACHSHADERPROC)wglGetProcAddress("glDetachShader");
 	glDetachShader = (PFNGLDETACHSHADERPROC)wglGetProcAddress("glDetachShader");
 	glDeleteShader = (PFNGLDELETESHADERPROC)wglGetProcAddress("glDeleteShader");
 	glDeleteShader = (PFNGLDELETESHADERPROC)wglGetProcAddress("glDeleteShader");
 	glDeleteProgram = (PFNGLDELETEPROGRAMPROC)wglGetProcAddress("glDeleteProgram");
 	glDeleteProgram = (PFNGLDELETEPROGRAMPROC)wglGetProcAddress("glDeleteProgram");
+
+	glUniformMatrix4fv = (PFNGLUNIFORMMATRIX4FVPROC)wglGetProcAddress("glUniformMatrix4fv");
+	glGetShaderiv = (PFNGLGETSHADERIVPROC)wglGetProcAddress("glGetShaderiv");
+	glGetShaderInfoLog = (PFNGLGETSHADERINFOLOGPROC)wglGetProcAddress("glGetShaderInfoLog");
+
 #endif
 #endif
 }
 }
 
 

+ 2 - 0
Core/Contents/Source/PolyWinCore.cpp

@@ -69,6 +69,8 @@ Win32Core::Win32Core(PolycodeViewBase *view, int xRes, int yRes, bool fullScreen
 //	}
 //	}
 
 
 	((OpenGLRenderer*)renderer)->initOSSpecific();
 	((OpenGLRenderer*)renderer)->initOSSpecific();
+
+	CoreServices::getInstance()->installModule(new GLSLShaderModule());	
 }
 }
 
 
 Win32Core::~Win32Core() {
 Win32Core::~Win32Core() {

+ 1 - 7
Modules/Build/MSVC/Modules/Modules.sln

@@ -1,8 +1,6 @@
 
 
 Microsoft Visual Studio Solution File, Format Version 11.00
 Microsoft Visual Studio Solution File, Format Version 11.00
-# Visual C++ Express 2010
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libPolycodeGLSL", "..\libPolycodeGLSL\libPolycodeGLSL.vcxproj", "{EDF0C4BB-B062-431D-BE69-7487A2B7C92E}"
-EndProject
+# Visual Studio 2010
 Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libPolycode3DPhysics", "libPolycode3DPhysics\libPolycode3DPhysics.vcxproj", "{B443C52F-21D6-4B45-B8B3-E3E4361D2972}"
 Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libPolycode3DPhysics", "libPolycode3DPhysics\libPolycode3DPhysics.vcxproj", "{B443C52F-21D6-4B45-B8B3-E3E4361D2972}"
 EndProject
 EndProject
 Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Physics2D", "Physics2D\Physics2D.vcxproj", "{A413360F-DCCA-49C0-9DC2-9B49B2FAE388}"
 Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Physics2D", "Physics2D\Physics2D.vcxproj", "{A413360F-DCCA-49C0-9DC2-9B49B2FAE388}"
@@ -17,10 +15,6 @@ Global
 		Release|Win32 = Release|Win32
 		Release|Win32 = Release|Win32
 	EndGlobalSection
 	EndGlobalSection
 	GlobalSection(ProjectConfigurationPlatforms) = postSolution
 	GlobalSection(ProjectConfigurationPlatforms) = postSolution
-		{EDF0C4BB-B062-431D-BE69-7487A2B7C92E}.Debug|Win32.ActiveCfg = Debug|Win32
-		{EDF0C4BB-B062-431D-BE69-7487A2B7C92E}.Debug|Win32.Build.0 = Debug|Win32
-		{EDF0C4BB-B062-431D-BE69-7487A2B7C92E}.Release|Win32.ActiveCfg = Release|Win32
-		{EDF0C4BB-B062-431D-BE69-7487A2B7C92E}.Release|Win32.Build.0 = Release|Win32
 		{B443C52F-21D6-4B45-B8B3-E3E4361D2972}.Debug|Win32.ActiveCfg = Debug|Win32
 		{B443C52F-21D6-4B45-B8B3-E3E4361D2972}.Debug|Win32.ActiveCfg = Debug|Win32
 		{B443C52F-21D6-4B45-B8B3-E3E4361D2972}.Debug|Win32.Build.0 = Debug|Win32
 		{B443C52F-21D6-4B45-B8B3-E3E4361D2972}.Debug|Win32.Build.0 = Debug|Win32
 		{B443C52F-21D6-4B45-B8B3-E3E4361D2972}.Release|Win32.ActiveCfg = Release|Win32
 		{B443C52F-21D6-4B45-B8B3-E3E4361D2972}.Release|Win32.ActiveCfg = Release|Win32

TEMPAT SAMPAH
Modules/Build/MSVC/Modules/Modules.suo


TEMPAT SAMPAH
Player/Build/MSVC/PolycodePlayer/Debug/api.pak


TEMPAT SAMPAH
Player/Build/MSVC/PolycodePlayer/Debug/default.pak


+ 2 - 2
Player/Build/MSVC/PolycodePlayer/PolycodePlayer.vcxproj

@@ -58,7 +58,7 @@
     <Link>
     <Link>
       <SubSystem>Windows</SubSystem>
       <SubSystem>Windows</SubSystem>
       <GenerateDebugInformation>true</GenerateDebugInformation>
       <GenerateDebugInformation>true</GenerateDebugInformation>
-      <AdditionalDependencies>lua51.lib;libPolycodeGLSL.lib;libPolycodeLUA.lib;Polycore.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>lua51.lib;libPolycodeLUA.lib;Polycore.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>
     </Link>
     </Link>
   </ItemDefinitionGroup>
   </ItemDefinitionGroup>
   <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
   <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
@@ -76,7 +76,7 @@
       <GenerateDebugInformation>true</GenerateDebugInformation>
       <GenerateDebugInformation>true</GenerateDebugInformation>
       <EnableCOMDATFolding>true</EnableCOMDATFolding>
       <EnableCOMDATFolding>true</EnableCOMDATFolding>
       <OptimizeReferences>true</OptimizeReferences>
       <OptimizeReferences>true</OptimizeReferences>
-      <AdditionalDependencies>lua51.lib;libPolycodeGLSL.lib;libPolycodeLUA.lib;Polycore.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>lua51.lib;libPolycodeLUA.lib;Polycore.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>
     </Link>
     </Link>
   </ItemDefinitionGroup>
   </ItemDefinitionGroup>
   <ItemGroup>
   <ItemGroup>

+ 1 - 1
Player/Build/MSVC/PolycodePlayer/PolycodePlayerView.cpp

@@ -104,7 +104,7 @@ ofn.Flags = OFN_PATHMUSTEXIST | OFN_FILEMUSTEXIST;
 
 
 						 if (GetOpenFileName(&ofn)==TRUE) {
 						 if (GetOpenFileName(&ofn)==TRUE) {
 
 
-							 TCHAR tpath[2049];
+							 TCHAR tpath[2049];
 							 GetModuleFileName(NULL, (LPWSTR)tpath, 2048);
 							 GetModuleFileName(NULL, (LPWSTR)tpath, 2048);
 							 STARTUPINFO si;
 							 STARTUPINFO si;
 							 PROCESS_INFORMATION pi;
 							 PROCESS_INFORMATION pi;

TEMPAT SAMPAH
Player/Build/MSVC/PolycodePlayer/api.pak


TEMPAT SAMPAH
Player/Build/MSVC/PolycodePlayer/default.pak


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

@@ -405,12 +405,6 @@ void PolycodePlayer::loadFile(const char *fileName) {
 	Logger::log("Core created...\n");
 	Logger::log("Core created...\n");
 	
 	
 	CoreServices::getInstance()->getResourceManager()->addArchive("api.pak");
 	CoreServices::getInstance()->getResourceManager()->addArchive("api.pak");
-	CoreServices::getInstance()->getResourceManager()->addArchive("default.pak");
-	CoreServices::getInstance()->getResourceManager()->addDirResource("default", false);
-	
-	
-	CoreServices::getInstance()->installModule(new GLSLShaderModule());	
-	
 	
 	
 	if(configFile.root["packedItems"]) {
 	if(configFile.root["packedItems"]) {
 		ObjectEntry *packed = configFile.root["packedItems"];
 		ObjectEntry *packed = configFile.root["packedItems"];
@@ -432,6 +426,10 @@ void PolycodePlayer::loadFile(const char *fileName) {
 	//core->addEventListener(this, Core::EVENT_CORE_RESIZE);
 	//core->addEventListener(this, Core::EVENT_CORE_RESIZE);
 	core->setVideoMode(xRes, yRes, fullScreen, aaLevel);
 	core->setVideoMode(xRes, yRes, fullScreen, aaLevel);
 		
 		
+	CoreServices::getInstance()->getResourceManager()->addArchive("default.pak");
+	CoreServices::getInstance()->getResourceManager()->addDirResource("default", false);
+
+
 //	dispatchEvent(event, PolycodeDebugEvent::EVENT_RESIZE);		
 //	dispatchEvent(event, PolycodeDebugEvent::EVENT_RESIZE);		
 	
 	
 	CoreServices::getInstance()->getRenderer()->setClearColor(red, green, blue);
 	CoreServices::getInstance()->getRenderer()->setClearColor(red, green, blue);

+ 1 - 1
Player/Contents/Source/PolycodePlayer.mm

@@ -375,7 +375,7 @@ void PolycodePlayer::loadFile(const char *fileName) {
 	CoreServices::getInstance()->getResourceManager()->addDirResource("default");
 	CoreServices::getInstance()->getResourceManager()->addDirResource("default");
 	
 	
 	
 	
-	CoreServices::getInstance()->installModule(new GLSLShaderModule());	
+	//CoreServices::getInstance()->installModule(new GLSLShaderModule());	
 	
 	
 	
 	
 	if(configFile.root["packedItems"]) {
 	if(configFile.root["packedItems"]) {