diff --git a/changes.txt b/changes.txt index aff4b77d..6ba84d7b 100644 --- a/changes.txt +++ b/changes.txt @@ -8,6 +8,44 @@ Changes in ogl-es (not yet released - will be merged with trunk at some point) -------------------------- Changes in 1.9 (not yet released) +- Fix first calculation of the camerascenenode boundingsphere. +- Fix bug with ignored opening brace in .X files with DeclData section. Thx @Alin for bugreport and patch. +- Fix problem with OpenGL textures cache. +- Add clear buffer flags and marked some methods used for clear buffers as deprecated. +- Fix: CGUIImage no longer scales wrong when working with textures which don't have the original image size. +- Fix CSoftwareTexture2 calculation for OriginalSize of ITexture. It was returning the changed texture size instead of the original one before. +- Fix skinned meshes not playing their last frame. Also clarified animation documentation to describe current behavior more exactly. +- Add IWriteFile::flush interface (thx @ JLouisB for the patch). +- CLightSceneNode::updateAbsolutePosition does now light recalculations. This is to fix using animators with lights. +- Fix collada export for objects with rotations around more than 1 axis. +- Add ISceneNodeAnimatorCameraMaya::setTargetMinDistance and getTargetMinDistance. +- Add override font to IGUITreeView +- CGUIComboBox now updates selection-list when font changes while it's open (thx @ rubixcuber for bugreport) +- CAnimatedMeshSceneNode::setMesh does now set the animation speed again to that of the mesh (had been changed in 1.7, but not for obvious reasons) +- .x meshloader regards now AnimTicksPerSecond (thx @qian for a test-model and bugreport) +- Interface getMeshType moved from IAnimatedMesh up to IMesh. +- Add b3d mesh-writer. Static writer written by Hendu, support for animated meshes added by JLouisB, testing and bugfixes by CuteAlien. +- Node-collision functions of SceneCollisionManager like getSceneNodeFromScreenCoordinatesBB will now ignore collisions against empty boundingboxes. +- Cameras return again an empty boundingbox (at 0,0,0) instead of returning the frustum boundingbox (was changed in very old Irrlicht version). + You can access the frustum boundingbox through the frustum itself. + This means cameras no longer show up in the node-collision of the SceneCollisionManager (showing up there because of their frustum bounding-box was too confusing). +- Fix problem in IrrlichtDevice::setResizable on X11 that caused window titlebars to hide occasionally under the taskbar in some systems (Ubuntu, Mint). +- Added new IRenderTarget interface. +- Replace the swprintf and snprintf defines by swprintf_irr and snprintf_irr to avoid conflicts with the standard libraries (and other libraries). +- XBox support removed as it would need DX8 (this was about the original XBox). +- Support for Direct3D 8 removed after svn revision 5052 due to lack of maintenance. +- _IRR_IMPLEMENT_MANAGED_MARSHALLING_BUGFIX removed. This was a bugfix for VS2003 (in combination with .NET) which we haven't supported in a while. +- VS 2005 support removed after svn revision 5048. +- WinCE 6 supported removed after svn revision 5046. +- NVidia CG support removed after svn revision 5045 due to lack of maintenance. NVidia has also stopped supporting this. +- TA burningvideo: + enabled triangle fan again so that skybox works.[need more testmeshes if other trianglefan than skybox doesn't work] + correct vc2013 project files for x64,static lib + correct alphablend vs add [was broken] +- Add a new core::rect constructor which takes a dimension parameter and set's left-top to 0. +- mtl (obj) format reader and write now regards texture scaling and translation. (thx @thanhle for noticing and patch proposal). +- Added Visual Studio 2013 project files. +- Added new color formats: ECF_R8, ECF_R8G8, ECF_D16, ECF_D32, ECF_D24S8. - Can now enable/disable backround drawing for IGUITable. - Bugfix: Cloning CBillboardSceneNode now copies colors and sizes. - EditBox works now with numpad on X11 @@ -84,9 +122,28 @@ Changes in 1.9 (not yet released) - Add IColladaMeshWriter::findGeometryNameForNode - Add getters IGUIButton::isDrawBorderEnabled and IGUIButton::isDrawBackgroundEnabled --------------------------- -Changes in 1.8.2 +- changed CSkyBoxSceneNode to drawIndexedTriangleList instead of drawIndexedTriangleFan (because software renderers don't have fans.. and i needed the demo functionable) +- added x64 to vs2008 project ( buildAllExamples_v9 ) [paths: obj64, win64-visualstudio] +- burningvideo: getMaxTextureSize adjusted [ changed meaning of SOFTWARE_DRIVER_2_TEXTURE_MAXSIZE +- burningvideo: mipmaplevel adjusted ( not that bad bokeh...(sometimes) ) +-------------------------- +Changes in 1.8.4 + - Tests give now a warning when stabilizing screenshots failed. Aslo trying more often now (a hack as taking screenshots otherwise fails often in windowed mode on some systems). + +-------------------------- +Changes in 1.8.3 (13.9.2015) + - Fix the fix for compiling on GCC5 (thanks to est31 for report and patch) + +-------------------------- +Changes in 1.8.2 (30.8.2015) + + - Add VS2013 project files + - Fix compiling with IRR_LINUX_XCURSOR_ + - Fix compiling with NO_IRR_COMPILE_WITH_LIBJPEG_ (thx to anontypist for report and patch). + - Fix compiling on GCC5 on MinGW (thanks to Slipxy for finding the bug and to osense for reporting it). + - Fix loading of .X and .B3D models with non-normalized quaternion rotations (thanks to JLouisB for a test-model). + - Fix compiling on Free BSD (thanks to leper for reporting and patch) - Fix bug with multiple SetPixelFormat calls. (reported and fixed by anontypist) - Fix bug related to memory release in PNG image loader. Thanks elephoenix for it. - Fix crash in CGUIListBox when users pressed end key folled by any other key in an empty, focused list box (thanks at porcus for report and patch). diff --git a/examples/01.HelloWorld/HelloWorld.dev b/examples/01.HelloWorld/HelloWorld.dev deleted file mode 100644 index 9de3da79..00000000 --- a/examples/01.HelloWorld/HelloWorld.dev +++ /dev/null @@ -1,59 +0,0 @@ -[Project] -FileName=example.dev -Name=Irrlicht Example 01 HelloWorld -UnitCount=1 -Type=1 -Ver=1 -ObjFiles= -Includes=..\..\include -Libs= -PrivateResource= -ResourceIncludes= -MakeIncludes= -Compiler= -CppCompiler= -Linker=../../lib/Win32-gcc/libIrrlicht.a_@@_ -IsCpp=1 -Icon= -ExeOutput=../../bin/Win32-gcc -ObjectOutput= -OverrideOutput=1 -OverrideOutputName=01.HelloWorld.exe -HostApplication= -Folders= -CommandLine= -IncludeVersionInfo=0 -SupportXPThemes=0 -CompilerSet=0 -CompilerSettings=0000000000000000000000 -UseCustomMakefile=0 -CustomMakefile= - -[Unit1] -FileName=main.cpp -CompileCpp=1 -Folder=Projekt1 -Compile=1 -Link=1 -Priority=1000 -OverrideBuildCmd=0 -BuildCmd= - -[VersionInfo] -Major=0 -Minor=1 -Release=1 -Build=1 -LanguageID=1033 -CharsetID=1252 -CompanyName= -FileVersion= -FileDescription=Irrlicht Engine example compiled using DevCpp and gcc -InternalName= -LegalCopyright= -LegalTrademarks= -OriginalFilename= -ProductName= -ProductVersion= -AutoIncBuildNr=0 - diff --git a/examples/01.HelloWorld/HelloWorld_vc10.vcxproj b/examples/01.HelloWorld/HelloWorld_vc10.vcxproj index 696621fc..509ccbed 100644 --- a/examples/01.HelloWorld/HelloWorld_vc10.vcxproj +++ b/examples/01.HelloWorld/HelloWorld_vc10.vcxproj @@ -38,11 +38,13 @@ Application false MultiByte + Windows7.1SDK Application false MultiByte + Windows7.1SDK diff --git a/examples/01.HelloWorld/HelloWorld_vc11.vcxproj b/examples/01.HelloWorld/HelloWorld_vc11.vcxproj index f5f1fae8..c131e023 100644 --- a/examples/01.HelloWorld/HelloWorld_vc11.vcxproj +++ b/examples/01.HelloWorld/HelloWorld_vc11.vcxproj @@ -28,25 +28,25 @@ Application false MultiByte - v110 + Windows7.1SDK Application false MultiByte - v110 + Windows7.1SDK Application false MultiByte - v110 + Windows7.1SDK Application false MultiByte - v110 + Windows7.1SDK diff --git a/examples/01.HelloWorld/HelloWorld_vc12.vcxproj b/examples/01.HelloWorld/HelloWorld_vc12.vcxproj new file mode 100644 index 00000000..109da6b3 --- /dev/null +++ b/examples/01.HelloWorld/HelloWorld_vc12.vcxproj @@ -0,0 +1,235 @@ + + + + + Debug + Win32 + + + Debug + x64 + + + Release + Win32 + + + Release + x64 + + + + 01.HelloWorld + {5AD4C95C-BA38-4692-BA4B-8C25A86208F9} + HelloWorld + + + + Application + false + MultiByte + Windows7.1SDK + + + Application + false + MultiByte + Windows7.1SDK + + + Application + false + MultiByte + Windows7.1SDK + + + Application + false + MultiByte + Windows7.1SDK + + + + + + + + + + + + + + + + + + + + + + + <_ProjectFileVersion>10.0.30319.1 + ..\..\bin\Win32-VisualStudio\ + ..\..\bin\Win64-VisualStudio\ + + + ..\..\bin\Win32-VisualStudio\ + ..\..\bin\Win32-VisualStudio\ + + + AllRules.ruleset + AllRules.ruleset + + + + + AllRules.ruleset + AllRules.ruleset + + + + + + + + .\Debug/HelloWorld.tlb + + + + + Disabled + ..\..\include;%(AdditionalIncludeDirectories) + WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions) + EnableFastChecks + MultiThreadedDebug + + + Level3 + EditAndContinue + + + _DEBUG;%(PreprocessorDefinitions) + 0x0c07 + + + ..\..\bin\Win32-VisualStudio\01.HelloWorld.exe + ..\..\lib\Win32-visualstudio;%(AdditionalLibraryDirectories) + true + Console + + + + + + + .\Debug/HelloWorld.tlb + + + + + Disabled + ..\..\include;%(AdditionalIncludeDirectories) + WIN32;WIN64;_DEBUG;_CONSOLE;%(PreprocessorDefinitions) + EnableFastChecks + MultiThreadedDebug + + + Level3 + ProgramDatabase + + + _DEBUG;%(PreprocessorDefinitions) + 0x0c07 + + + ..\..\bin\Win64-VisualStudio\01.HelloWorld.exe + ..\..\lib\Win64-visualstudio;%(AdditionalLibraryDirectories) + true + Console + + + + + + + .\Release/HelloWorld.tlb + + + + + MaxSpeed + OnlyExplicitInline + ..\..\include;%(AdditionalIncludeDirectories) + WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions) + true + MultiThreaded + true + + + Level3 + + + NDEBUG;%(PreprocessorDefinitions) + 0x0c07 + + + ..\..\bin\Win32-VisualStudio\01.HelloWorld.exe + ..\..\lib\Win32-visualstudio;%(AdditionalLibraryDirectories) + Console + + + + + + + .\Release/HelloWorld.tlb + + + + + MaxSpeed + OnlyExplicitInline + ..\..\include;%(AdditionalIncludeDirectories) + WIN32;WIN64;NDEBUG;_CONSOLE;%(PreprocessorDefinitions) + true + MultiThreaded + true + + + Level3 + + + NDEBUG;%(PreprocessorDefinitions) + 0x0c07 + + + ..\..\bin\Win64-VisualStudio\01.HelloWorld.exe + ..\..\lib\Win64-visualstudio;%(AdditionalLibraryDirectories) + Console + + + + + + + Disabled + Disabled + %(AdditionalIncludeDirectories) + %(AdditionalIncludeDirectories) + %(PreprocessorDefinitions) + %(PreprocessorDefinitions) + EnableFastChecks + EnableFastChecks + MaxSpeed + MaxSpeed + %(AdditionalIncludeDirectories) + %(AdditionalIncludeDirectories) + %(PreprocessorDefinitions) + %(PreprocessorDefinitions) + + + + + + \ No newline at end of file diff --git a/examples/01.HelloWorld/HelloWorld_vc14.vcxproj b/examples/01.HelloWorld/HelloWorld_vc14.vcxproj new file mode 100644 index 00000000..23853d7b --- /dev/null +++ b/examples/01.HelloWorld/HelloWorld_vc14.vcxproj @@ -0,0 +1,235 @@ + + + + + Debug + Win32 + + + Debug + x64 + + + Release + Win32 + + + Release + x64 + + + + 01.HelloWorld + {5AD4C95C-BA38-4692-BA4B-8C25A86208F9} + HelloWorld + + + + Application + false + MultiByte + v140 + + + Application + false + MultiByte + v140 + + + Application + false + MultiByte + v140 + + + Application + false + MultiByte + v140 + + + + + + + + + + + + + + + + + + + + + + + <_ProjectFileVersion>10.0.30319.1 + ..\..\bin\Win32-VisualStudio\ + ..\..\bin\Win64-VisualStudio\ + + + ..\..\bin\Win32-VisualStudio\ + ..\..\bin\Win32-VisualStudio\ + + + AllRules.ruleset + AllRules.ruleset + + + + + AllRules.ruleset + AllRules.ruleset + + + + + + + + .\Debug/HelloWorld.tlb + + + + + Disabled + ..\..\include;%(AdditionalIncludeDirectories) + WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions) + EnableFastChecks + MultiThreadedDebug + + + Level3 + EditAndContinue + + + _DEBUG;%(PreprocessorDefinitions) + 0x0c07 + + + ..\..\bin\Win32-VisualStudio\01.HelloWorld.exe + ..\..\lib\Win32-visualstudio;%(AdditionalLibraryDirectories) + true + Console + + + + + + + .\Debug/HelloWorld.tlb + + + + + Disabled + ..\..\include;%(AdditionalIncludeDirectories) + WIN32;WIN64;_DEBUG;_CONSOLE;%(PreprocessorDefinitions) + EnableFastChecks + MultiThreadedDebug + + + Level3 + ProgramDatabase + + + _DEBUG;%(PreprocessorDefinitions) + 0x0c07 + + + ..\..\bin\Win64-VisualStudio\01.HelloWorld.exe + ..\..\lib\Win64-visualstudio;%(AdditionalLibraryDirectories) + true + Console + + + + + + + .\Release/HelloWorld.tlb + + + + + MaxSpeed + OnlyExplicitInline + ..\..\include;%(AdditionalIncludeDirectories) + WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions) + true + MultiThreaded + true + + + Level3 + + + NDEBUG;%(PreprocessorDefinitions) + 0x0c07 + + + ..\..\bin\Win32-VisualStudio\01.HelloWorld.exe + ..\..\lib\Win32-visualstudio;%(AdditionalLibraryDirectories) + Console + + + + + + + .\Release/HelloWorld.tlb + + + + + MaxSpeed + OnlyExplicitInline + ..\..\include;%(AdditionalIncludeDirectories) + WIN32;WIN64;NDEBUG;_CONSOLE;%(PreprocessorDefinitions) + true + MultiThreaded + true + + + Level3 + + + NDEBUG;%(PreprocessorDefinitions) + 0x0c07 + + + ..\..\bin\Win64-VisualStudio\01.HelloWorld.exe + ..\..\lib\Win64-visualstudio;%(AdditionalLibraryDirectories) + Console + + + + + + + Disabled + Disabled + %(AdditionalIncludeDirectories) + %(AdditionalIncludeDirectories) + %(PreprocessorDefinitions) + %(PreprocessorDefinitions) + EnableFastChecks + EnableFastChecks + MaxSpeed + MaxSpeed + %(AdditionalIncludeDirectories) + %(AdditionalIncludeDirectories) + %(PreprocessorDefinitions) + %(PreprocessorDefinitions) + + + + + + \ No newline at end of file diff --git a/examples/01.HelloWorld/HelloWorld_vc8.vcproj b/examples/01.HelloWorld/HelloWorld_vc8.vcproj deleted file mode 100644 index ac110312..00000000 --- a/examples/01.HelloWorld/HelloWorld_vc8.vcproj +++ /dev/null @@ -1,231 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/examples/01.HelloWorld/HelloWorld_vc9.vcproj b/examples/01.HelloWorld/HelloWorld_vc9.vcproj deleted file mode 100644 index 982d2025..00000000 --- a/examples/01.HelloWorld/HelloWorld_vc9.vcproj +++ /dev/null @@ -1,230 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/examples/01.HelloWorld/main.cpp b/examples/01.HelloWorld/main.cpp index 31776efc..226bcf2c 100644 --- a/examples/01.HelloWorld/main.cpp +++ b/examples/01.HelloWorld/main.cpp @@ -43,6 +43,7 @@ After we have set up the IDE, the compiler will know where to find the Irrlicht Engine header files so we can include it now in our code. */ #include +#include "exampleHelper.h" /* In the Irrlicht Engine, everything can be found in the namespace 'irr'. So if @@ -77,7 +78,7 @@ of the console window, which pops up when starting a program with main(). This is done by the second pragma. We could also use the WinMain method, though losing platform independence then. */ -#ifdef _IRR_WINDOWS_ +#ifdef _MSC_VER #pragma comment(lib, "Irrlicht.lib") #pragma comment(linker, "/subsystem:windows /ENTRY:mainCRTStartup") #endif @@ -95,10 +96,9 @@ int main() parameters: - deviceType: Type of the device. This can currently be the Null-device, - one of the two software renderers, D3D8, D3D9, or OpenGL. In this + one of the two software renderers, D3D9, or OpenGL. In this example we use EDT_SOFTWARE, but to try out, you might want to - change it to EDT_BURNINGSVIDEO, EDT_NULL, EDT_DIRECT3D8, - EDT_DIRECT3D9, or EDT_OPENGL. + change it to EDT_BURNINGSVIDEO, EDT_NULL, EDT_DIRECT3D9, or EDT_OPENGL. - windowSize: Size of the Window or screen in FullScreenMode to be created. In this example we use 640x480. @@ -153,6 +153,11 @@ int main() guienv->addStaticText(L"Hello World! This is the Irrlicht Software renderer!", rect(10,10,260,22), true); + /* + Get a media path dedicated for your platform. + */ + const io::path mediaPath = getExampleMediaPath(); + /* To show something interesting, we load a Quake 2 model and display it. We only have to get the Mesh from the Scene Manager with getMesh() and add @@ -165,7 +170,7 @@ int main() other supported file format. By the way, that cool Quake 2 model called sydney was modelled by Brian Collins. */ - IAnimatedMesh* mesh = smgr->getMesh("../../media/sydney.md2"); + IAnimatedMesh* mesh = smgr->getMesh(mediaPath + "sydney.md2"); if (!mesh) { device->drop(); @@ -185,7 +190,7 @@ int main() { node->setMaterialFlag(EMF_LIGHTING, false); node->setMD2Animation(scene::EMAT_STAND); - node->setMaterialTexture( 0, driver->getTexture("../../media/sydney.bmp") ); + node->setMaterialTexture( 0, driver->getTexture(mediaPath + "sydney.bmp") ); } /* @@ -210,7 +215,7 @@ int main() the GUI Environment draw their content. With the endScene() call everything is presented on the screen. */ - driver->beginScene(true, true, SColor(255,100,101,140)); + driver->beginScene(ECBF_COLOR | ECBF_DEPTH, SColor(255,100,101,140)); smgr->drawAll(); guienv->drawAll(); diff --git a/examples/02.Quake3Map/Quake3Map.dev b/examples/02.Quake3Map/Quake3Map.dev deleted file mode 100644 index 3e0a69e7..00000000 --- a/examples/02.Quake3Map/Quake3Map.dev +++ /dev/null @@ -1,59 +0,0 @@ -[Project] -FileName=example.dev -Name=Irrlicht Example 02 Quake3Map -UnitCount=1 -Type=1 -Ver=1 -ObjFiles= -Includes=..\..\include -Libs= -PrivateResource= -ResourceIncludes= -MakeIncludes= -Compiler= -CppCompiler= -Linker=../../lib/Win32-gcc/libIrrlicht.a_@@_ -IsCpp=1 -Icon= -ExeOutput=../../bin/Win32-gcc -ObjectOutput=obj -OverrideOutput=1 -OverrideOutputName=02.Quake3Map.exe -HostApplication= -Folders= -CommandLine= -IncludeVersionInfo=0 -SupportXPThemes=0 -CompilerSet=0 -CompilerSettings=0000000000000000000000 -UseCustomMakefile=0 -CustomMakefile= - -[Unit1] -FileName=main.cpp -CompileCpp=1 -Folder=Projekt1 -Compile=1 -Link=1 -Priority=1000 -OverrideBuildCmd=0 -BuildCmd= - -[VersionInfo] -Major=0 -Minor=1 -Release=1 -Build=1 -LanguageID=1033 -CharsetID=1252 -CompanyName= -FileVersion= -FileDescription=Irrlicht Engine example compiled using DevCpp and gcc -InternalName= -LegalCopyright= -LegalTrademarks= -OriginalFilename= -ProductName= -ProductVersion= -AutoIncBuildNr=0 - diff --git a/examples/02.Quake3Map/Quake3Map_vc10.vcxproj b/examples/02.Quake3Map/Quake3Map_vc10.vcxproj index da32873a..f45673aa 100644 --- a/examples/02.Quake3Map/Quake3Map_vc10.vcxproj +++ b/examples/02.Quake3Map/Quake3Map_vc10.vcxproj @@ -28,21 +28,25 @@ Application false MultiByte + Windows7.1SDK Application false MultiByte + Windows7.1SDK Application false MultiByte + Windows7.1SDK Application false MultiByte + Windows7.1SDK diff --git a/examples/02.Quake3Map/Quake3Map_vc11.vcxproj b/examples/02.Quake3Map/Quake3Map_vc11.vcxproj index 579a0162..f45673aa 100644 --- a/examples/02.Quake3Map/Quake3Map_vc11.vcxproj +++ b/examples/02.Quake3Map/Quake3Map_vc11.vcxproj @@ -28,25 +28,25 @@ Application false MultiByte - v110 + Windows7.1SDK Application false MultiByte - v110 + Windows7.1SDK Application false MultiByte - v110 + Windows7.1SDK Application false MultiByte - v110 + Windows7.1SDK diff --git a/examples/02.Quake3Map/Quake3Map_vc12.vcxproj b/examples/02.Quake3Map/Quake3Map_vc12.vcxproj new file mode 100644 index 00000000..042060f3 --- /dev/null +++ b/examples/02.Quake3Map/Quake3Map_vc12.vcxproj @@ -0,0 +1,235 @@ + + + + + Debug + Win32 + + + Debug + x64 + + + Release + Win32 + + + Release + x64 + + + + 02.Quake3Map + {D1A464A2-D479-458C-98A2-60965D823CD1} + Quake3Map + + + + Application + false + MultiByte + Windows7.1SDK + + + Application + false + MultiByte + Windows7.1SDK + + + Application + false + MultiByte + Windows7.1SDK + + + Application + false + MultiByte + Windows7.1SDK + + + + + + + + + + + + + + + + + + + + + + + <_ProjectFileVersion>10.0.30319.1 + ..\..\bin\Win32-VisualStudio\ + ..\..\bin\Win64-VisualStudio\ + + + ..\..\bin\Win32-VisualStudio\ + ..\..\bin\Win64-VisualStudio\ + + + AllRules.ruleset + AllRules.ruleset + + + + + AllRules.ruleset + AllRules.ruleset + + + + + + + + .\Debug/Quake3Map.tlb + + + + + Disabled + ..\..\include;%(AdditionalIncludeDirectories) + WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions) + EnableFastChecks + MultiThreadedDebug + + + Level3 + EditAndContinue + + + _DEBUG;%(PreprocessorDefinitions) + 0x0c07 + + + ..\..\bin\Win32-VisualStudio\02.Quake3Map.exe + ..\..\lib\Win32-visualstudio;%(AdditionalLibraryDirectories) + true + Console + + + + + + + .\Debug/Quake3Map.tlb + + + + + Disabled + ..\..\include;%(AdditionalIncludeDirectories) + WIN32;WIN64;_DEBUG;_CONSOLE;%(PreprocessorDefinitions) + EnableFastChecks + MultiThreadedDebug + + + Level3 + ProgramDatabase + + + _DEBUG;%(PreprocessorDefinitions) + 0x0c07 + + + ..\..\bin\Win64-VisualStudio\02.Quake3Map.exe + ..\..\lib\Win64-visualstudio;%(AdditionalLibraryDirectories) + true + Console + + + + + + + .\Release/Quake3Map.tlb + + + + + MaxSpeed + OnlyExplicitInline + ..\..\include;%(AdditionalIncludeDirectories) + WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions) + true + MultiThreaded + true + + + Level3 + + + NDEBUG;%(PreprocessorDefinitions) + 0x0c07 + + + ..\..\bin\Win32-VisualStudio\02.Quake3Map.exe + ..\..\lib\Win32-visualstudio;%(AdditionalLibraryDirectories) + Console + + + + + + + .\Release/Quake3Map.tlb + + + + + MaxSpeed + OnlyExplicitInline + ..\..\include;%(AdditionalIncludeDirectories) + WIN32;WIN64;NDEBUG;_CONSOLE;%(PreprocessorDefinitions) + true + MultiThreaded + true + + + Level3 + + + NDEBUG;%(PreprocessorDefinitions) + 0x0c07 + + + ..\..\bin\Win64-VisualStudio\02.Quake3Map.exe + ..\..\lib\Win64-visualstudio;%(AdditionalLibraryDirectories) + Console + + + + + + + Disabled + Disabled + %(AdditionalIncludeDirectories) + %(AdditionalIncludeDirectories) + %(PreprocessorDefinitions) + %(PreprocessorDefinitions) + EnableFastChecks + EnableFastChecks + MaxSpeed + MaxSpeed + %(AdditionalIncludeDirectories) + %(AdditionalIncludeDirectories) + %(PreprocessorDefinitions) + %(PreprocessorDefinitions) + + + + + + \ No newline at end of file diff --git a/examples/02.Quake3Map/Quake3Map_vc14.vcxproj b/examples/02.Quake3Map/Quake3Map_vc14.vcxproj new file mode 100644 index 00000000..df7001d1 --- /dev/null +++ b/examples/02.Quake3Map/Quake3Map_vc14.vcxproj @@ -0,0 +1,235 @@ + + + + + Debug + Win32 + + + Debug + x64 + + + Release + Win32 + + + Release + x64 + + + + 02.Quake3Map + {D1A464A2-D479-458C-98A2-60965D823CD1} + Quake3Map + + + + Application + false + MultiByte + v140 + + + Application + false + MultiByte + v140 + + + Application + false + MultiByte + v140 + + + Application + false + MultiByte + v140 + + + + + + + + + + + + + + + + + + + + + + + <_ProjectFileVersion>10.0.30319.1 + ..\..\bin\Win32-VisualStudio\ + ..\..\bin\Win64-VisualStudio\ + + + ..\..\bin\Win32-VisualStudio\ + ..\..\bin\Win64-VisualStudio\ + + + AllRules.ruleset + AllRules.ruleset + + + + + AllRules.ruleset + AllRules.ruleset + + + + + + + + .\Debug/Quake3Map.tlb + + + + + Disabled + ..\..\include;%(AdditionalIncludeDirectories) + WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions) + EnableFastChecks + MultiThreadedDebug + + + Level3 + EditAndContinue + + + _DEBUG;%(PreprocessorDefinitions) + 0x0c07 + + + ..\..\bin\Win32-VisualStudio\02.Quake3Map.exe + ..\..\lib\Win32-visualstudio;%(AdditionalLibraryDirectories) + true + Console + + + + + + + .\Debug/Quake3Map.tlb + + + + + Disabled + ..\..\include;%(AdditionalIncludeDirectories) + WIN32;WIN64;_DEBUG;_CONSOLE;%(PreprocessorDefinitions) + EnableFastChecks + MultiThreadedDebug + + + Level3 + ProgramDatabase + + + _DEBUG;%(PreprocessorDefinitions) + 0x0c07 + + + ..\..\bin\Win64-VisualStudio\02.Quake3Map.exe + ..\..\lib\Win64-visualstudio;%(AdditionalLibraryDirectories) + true + Console + + + + + + + .\Release/Quake3Map.tlb + + + + + MaxSpeed + OnlyExplicitInline + ..\..\include;%(AdditionalIncludeDirectories) + WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions) + true + MultiThreaded + true + + + Level3 + + + NDEBUG;%(PreprocessorDefinitions) + 0x0c07 + + + ..\..\bin\Win32-VisualStudio\02.Quake3Map.exe + ..\..\lib\Win32-visualstudio;%(AdditionalLibraryDirectories) + Console + + + + + + + .\Release/Quake3Map.tlb + + + + + MaxSpeed + OnlyExplicitInline + ..\..\include;%(AdditionalIncludeDirectories) + WIN32;WIN64;NDEBUG;_CONSOLE;%(PreprocessorDefinitions) + true + MultiThreaded + true + + + Level3 + + + NDEBUG;%(PreprocessorDefinitions) + 0x0c07 + + + ..\..\bin\Win64-VisualStudio\02.Quake3Map.exe + ..\..\lib\Win64-visualstudio;%(AdditionalLibraryDirectories) + Console + + + + + + + Disabled + Disabled + %(AdditionalIncludeDirectories) + %(AdditionalIncludeDirectories) + %(PreprocessorDefinitions) + %(PreprocessorDefinitions) + EnableFastChecks + EnableFastChecks + MaxSpeed + MaxSpeed + %(AdditionalIncludeDirectories) + %(AdditionalIncludeDirectories) + %(PreprocessorDefinitions) + %(PreprocessorDefinitions) + + + + + + \ No newline at end of file diff --git a/examples/02.Quake3Map/Quake3Map_vc8.vcproj b/examples/02.Quake3Map/Quake3Map_vc8.vcproj deleted file mode 100644 index bae5931d..00000000 --- a/examples/02.Quake3Map/Quake3Map_vc8.vcproj +++ /dev/null @@ -1,231 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/examples/02.Quake3Map/Quake3Map_vc9.vcproj b/examples/02.Quake3Map/Quake3Map_vc9.vcproj deleted file mode 100644 index 8acc07a5..00000000 --- a/examples/02.Quake3Map/Quake3Map_vc9.vcproj +++ /dev/null @@ -1,230 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/examples/02.Quake3Map/main.cpp b/examples/02.Quake3Map/main.cpp index 6cfcea27..cd3f32fe 100644 --- a/examples/02.Quake3Map/main.cpp +++ b/examples/02.Quake3Map/main.cpp @@ -13,7 +13,8 @@ and an additional file to be able to ask the user for a driver type using the console. */ #include -#include +#include "driverChoice.h" +#include "exampleHelper.h" /* As already written in the HelloWorld example, in the Irrlicht Engine everything @@ -47,36 +48,12 @@ int main() which video driver to use. The Software device might be too slow to draw a huge Quake 3 map, but just for the fun of it, we make this decision possible, too. - Instead of copying this whole code into your app, you can simply include - driverChoice.h from Irrlicht's include directory. The function - driverChoiceConsole does exactly the same. */ // ask user for driver - - video::E_DRIVER_TYPE driverType; - - printf("Please select the driver you want for this example:\n"\ - " (a) OpenGL ES 2.x\n (b) OpenGL ES 1.x\n (c) OpenGL 1.x-4.x\n"\ - " (d) Direct3D 9.0c\n (e) Direct3D 8.1\n"\ - " (f) Burning's Software Renderer\n (g) Software Renderer\n"\ - " (h) NullDevice\n (otherKey) exit\n\n"); - - char i; - std::cin >> i; - - switch(i) - { - case 'a': driverType = video::EDT_OGLES2; break; - case 'b': driverType = video::EDT_OGLES1; break; - case 'c': driverType = video::EDT_OPENGL; break; - case 'd': driverType = video::EDT_DIRECT3D9;break; - case 'e': driverType = video::EDT_DIRECT3D8;break; - case 'f': driverType = video::EDT_BURNINGSVIDEO;break; - case 'g': driverType = video::EDT_SOFTWARE; break; - case 'h': driverType = video::EDT_NULL; break; - default: return 1; - } + video::E_DRIVER_TYPE driverType=driverChoiceConsole(); + if (driverType==video::EDT_COUNT) + return 1; // create device and exit if creation failed @@ -101,7 +78,7 @@ int main() we are able to read from the files in that archive as if they are directly stored on the disk. */ - device->getFileSystem()->addFileArchive("../../media/map-20kdm2.pk3"); + device->getFileSystem()->addFileArchive(getExampleMediaPath() + "map-20kdm2.pk3"); /* Now we can load the mesh by calling @@ -176,7 +153,7 @@ int main() { if (device->isWindowActive()) { - driver->beginScene(true, true, video::SColor(255,200,200,200)); + driver->beginScene(video::ECBF_COLOR | video::ECBF_DEPTH, video::SColor(255,200,200,200)); smgr->drawAll(); driver->endScene(); diff --git a/examples/03.CustomSceneNode/CustomSceneNode.dev b/examples/03.CustomSceneNode/CustomSceneNode.dev deleted file mode 100644 index 57c5ee0c..00000000 --- a/examples/03.CustomSceneNode/CustomSceneNode.dev +++ /dev/null @@ -1,59 +0,0 @@ -[Project] -FileName=example.dev -Name=Irrlicht Example 03 Custom Scene Node -UnitCount=1 -Type=1 -Ver=1 -ObjFiles= -Includes=..\..\include -Libs= -PrivateResource= -ResourceIncludes= -MakeIncludes= -Compiler= -CppCompiler= -Linker=../../lib/Win32-gcc/libIrrlicht.a_@@_ -IsCpp=1 -Icon= -ExeOutput=../../bin/Win32-gcc -ObjectOutput=obj -OverrideOutput=1 -OverrideOutputName=03.CustomSceneNode.exe -HostApplication= -Folders= -CommandLine= -IncludeVersionInfo=0 -SupportXPThemes=0 -CompilerSet=0 -CompilerSettings=0000000000000000000000 -UseCustomMakefile=0 -CustomMakefile= - -[Unit1] -FileName=main.cpp -CompileCpp=1 -Folder=Projekt1 -Compile=1 -Link=1 -Priority=1000 -OverrideBuildCmd=0 -BuildCmd= - -[VersionInfo] -Major=0 -Minor=1 -Release=1 -Build=1 -LanguageID=1033 -CharsetID=1252 -CompanyName= -FileVersion= -FileDescription=Irrlicht Engine example compiled using DevCpp and gcc -InternalName= -LegalCopyright= -LegalTrademarks= -OriginalFilename= -ProductName= -ProductVersion= -AutoIncBuildNr=0 - diff --git a/examples/03.CustomSceneNode/CustomSceneNode_vc10.vcxproj b/examples/03.CustomSceneNode/CustomSceneNode_vc10.vcxproj index 5512e23d..77e9e6e1 100644 --- a/examples/03.CustomSceneNode/CustomSceneNode_vc10.vcxproj +++ b/examples/03.CustomSceneNode/CustomSceneNode_vc10.vcxproj @@ -28,21 +28,25 @@ Application false MultiByte + Windows7.1SDK Application false MultiByte + Windows7.1SDK Application false MultiByte + Windows7.1SDK Application false MultiByte + Windows7.1SDK diff --git a/examples/03.CustomSceneNode/CustomSceneNode_vc11.vcxproj b/examples/03.CustomSceneNode/CustomSceneNode_vc11.vcxproj index 52f6ef20..77e9e6e1 100644 --- a/examples/03.CustomSceneNode/CustomSceneNode_vc11.vcxproj +++ b/examples/03.CustomSceneNode/CustomSceneNode_vc11.vcxproj @@ -28,25 +28,25 @@ Application false MultiByte - v110 + Windows7.1SDK Application false MultiByte - v110 + Windows7.1SDK Application false MultiByte - v110 + Windows7.1SDK Application false MultiByte - v110 + Windows7.1SDK diff --git a/examples/03.CustomSceneNode/CustomSceneNode_vc12.vcxproj b/examples/03.CustomSceneNode/CustomSceneNode_vc12.vcxproj new file mode 100644 index 00000000..aa125e42 --- /dev/null +++ b/examples/03.CustomSceneNode/CustomSceneNode_vc12.vcxproj @@ -0,0 +1,247 @@ + + + + + Debug + Win32 + + + Debug + x64 + + + Release + Win32 + + + Release + x64 + + + + 03.CustomSceneNode + {171CCDFA-C140-4956-8EB7-F0168F4521D3} + CustomSceneNode + + + + Application + false + MultiByte + Windows7.1SDK + + + Application + false + MultiByte + Windows7.1SDK + + + Application + false + MultiByte + Windows7.1SDK + + + Application + false + MultiByte + Windows7.1SDK + + + + + + + + + + + + + + + + + + + + + + + <_ProjectFileVersion>10.0.30319.1 + ..\..\bin\Win32-VisualStudio\ + ..\..\bin\Win64-VisualStudio\ + + + ..\..\bin\Win32-VisualStudio\ + ..\..\bin\Win64-VisualStudio\ + + + AllRules.ruleset + AllRules.ruleset + + + + + AllRules.ruleset + AllRules.ruleset + + + + + + + + .\Debug/CustomSceneNode.tlb + + + + + Disabled + ..\..\include;%(AdditionalIncludeDirectories) + WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions) + EnableFastChecks + MultiThreadedDebug + + + Level3 + EditAndContinue + + + _DEBUG;%(PreprocessorDefinitions) + 0x0c07 + + + ..\..\bin\Win32-VisualStudio\03.CustomSceneNode.exe + ..\..\lib\Win32-visualstudio;%(AdditionalLibraryDirectories) + true + Console + + + + + + + .\Debug/CustomSceneNode.tlb + + + + + Disabled + ..\..\include;%(AdditionalIncludeDirectories) + WIN32;WIN64;_DEBUG;_CONSOLE;%(PreprocessorDefinitions) + EnableFastChecks + MultiThreadedDebug + + + Level3 + ProgramDatabase + + + _DEBUG;%(PreprocessorDefinitions) + 0x0c07 + + + ..\..\bin\Win64-VisualStudio\03.CustomSceneNode.exe + ..\..\lib\Win64-visualstudio;%(AdditionalLibraryDirectories) + true + Console + + + + + + + .\Release/CustomSceneNode.tlb + + + + + MaxSpeed + OnlyExplicitInline + ..\..\include;%(AdditionalIncludeDirectories) + WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions) + true + MultiThreaded + true + + + .\Release/CustomSceneNode.pch + .\Release/ + .\Release/ + .\Release/ + Level3 + + + NDEBUG;%(PreprocessorDefinitions) + 0x0c07 + + + ..\..\bin\Win32-VisualStudio\03.CustomSceneNode.exe + ..\..\lib\Win32-visualstudio;%(AdditionalLibraryDirectories) + .\Release/CustomSceneNode.pdb + Console + false + + + + + + + .\Release/CustomSceneNode.tlb + + + + + MaxSpeed + OnlyExplicitInline + ..\..\include;%(AdditionalIncludeDirectories) + WIN32;WIN64;NDEBUG;_CONSOLE;%(PreprocessorDefinitions) + true + MultiThreaded + true + + + .\Release/CustomSceneNode.pch + .\Release/ + .\Release/ + .\Release/ + Level3 + + + NDEBUG;%(PreprocessorDefinitions) + 0x0c07 + + + ..\..\bin\Win64-VisualStudio\03.CustomSceneNode.exe + ..\..\lib\Win64-visualstudio;%(AdditionalLibraryDirectories) + .\Release/CustomSceneNode.pdb + Console + false + + + + + + + Disabled + Disabled + %(AdditionalIncludeDirectories) + %(AdditionalIncludeDirectories) + %(PreprocessorDefinitions) + %(PreprocessorDefinitions) + EnableFastChecks + EnableFastChecks + MaxSpeed + MaxSpeed + %(AdditionalIncludeDirectories) + %(AdditionalIncludeDirectories) + %(PreprocessorDefinitions) + %(PreprocessorDefinitions) + + + + + + \ No newline at end of file diff --git a/examples/03.CustomSceneNode/CustomSceneNode_vc14.vcxproj b/examples/03.CustomSceneNode/CustomSceneNode_vc14.vcxproj new file mode 100644 index 00000000..42e75d1f --- /dev/null +++ b/examples/03.CustomSceneNode/CustomSceneNode_vc14.vcxproj @@ -0,0 +1,247 @@ + + + + + Debug + Win32 + + + Debug + x64 + + + Release + Win32 + + + Release + x64 + + + + 03.CustomSceneNode + {171CCDFA-C140-4956-8EB7-F0168F4521D3} + CustomSceneNode + + + + Application + false + MultiByte + v140 + + + Application + false + MultiByte + v140 + + + Application + false + MultiByte + v140 + + + Application + false + MultiByte + v140 + + + + + + + + + + + + + + + + + + + + + + + <_ProjectFileVersion>10.0.30319.1 + ..\..\bin\Win32-VisualStudio\ + ..\..\bin\Win64-VisualStudio\ + + + ..\..\bin\Win32-VisualStudio\ + ..\..\bin\Win64-VisualStudio\ + + + AllRules.ruleset + AllRules.ruleset + + + + + AllRules.ruleset + AllRules.ruleset + + + + + + + + .\Debug/CustomSceneNode.tlb + + + + + Disabled + ..\..\include;%(AdditionalIncludeDirectories) + WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions) + EnableFastChecks + MultiThreadedDebug + + + Level3 + EditAndContinue + + + _DEBUG;%(PreprocessorDefinitions) + 0x0c07 + + + ..\..\bin\Win32-VisualStudio\03.CustomSceneNode.exe + ..\..\lib\Win32-visualstudio;%(AdditionalLibraryDirectories) + true + Console + + + + + + + .\Debug/CustomSceneNode.tlb + + + + + Disabled + ..\..\include;%(AdditionalIncludeDirectories) + WIN32;WIN64;_DEBUG;_CONSOLE;%(PreprocessorDefinitions) + EnableFastChecks + MultiThreadedDebug + + + Level3 + ProgramDatabase + + + _DEBUG;%(PreprocessorDefinitions) + 0x0c07 + + + ..\..\bin\Win64-VisualStudio\03.CustomSceneNode.exe + ..\..\lib\Win64-visualstudio;%(AdditionalLibraryDirectories) + true + Console + + + + + + + .\Release/CustomSceneNode.tlb + + + + + MaxSpeed + OnlyExplicitInline + ..\..\include;%(AdditionalIncludeDirectories) + WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions) + true + MultiThreaded + true + + + .\Release/CustomSceneNode.pch + .\Release/ + .\Release/ + .\Release/ + Level3 + + + NDEBUG;%(PreprocessorDefinitions) + 0x0c07 + + + ..\..\bin\Win32-VisualStudio\03.CustomSceneNode.exe + ..\..\lib\Win32-visualstudio;%(AdditionalLibraryDirectories) + .\Release/CustomSceneNode.pdb + Console + false + + + + + + + .\Release/CustomSceneNode.tlb + + + + + MaxSpeed + OnlyExplicitInline + ..\..\include;%(AdditionalIncludeDirectories) + WIN32;WIN64;NDEBUG;_CONSOLE;%(PreprocessorDefinitions) + true + MultiThreaded + true + + + .\Release/CustomSceneNode.pch + .\Release/ + .\Release/ + .\Release/ + Level3 + + + NDEBUG;%(PreprocessorDefinitions) + 0x0c07 + + + ..\..\bin\Win64-VisualStudio\03.CustomSceneNode.exe + ..\..\lib\Win64-visualstudio;%(AdditionalLibraryDirectories) + .\Release/CustomSceneNode.pdb + Console + false + + + + + + + Disabled + Disabled + %(AdditionalIncludeDirectories) + %(AdditionalIncludeDirectories) + %(PreprocessorDefinitions) + %(PreprocessorDefinitions) + EnableFastChecks + EnableFastChecks + MaxSpeed + MaxSpeed + %(AdditionalIncludeDirectories) + %(AdditionalIncludeDirectories) + %(PreprocessorDefinitions) + %(PreprocessorDefinitions) + + + + + + \ No newline at end of file diff --git a/examples/03.CustomSceneNode/CustomSceneNode_vc8.vcproj b/examples/03.CustomSceneNode/CustomSceneNode_vc8.vcproj deleted file mode 100644 index 42c7879e..00000000 --- a/examples/03.CustomSceneNode/CustomSceneNode_vc8.vcproj +++ /dev/null @@ -1,231 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/examples/03.CustomSceneNode/CustomSceneNode_vc9.vcproj b/examples/03.CustomSceneNode/CustomSceneNode_vc9.vcproj deleted file mode 100644 index 50f0382b..00000000 --- a/examples/03.CustomSceneNode/CustomSceneNode_vc9.vcproj +++ /dev/null @@ -1,230 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/examples/03.CustomSceneNode/main.cpp b/examples/03.CustomSceneNode/main.cpp index 37bc2094..4e842955 100644 --- a/examples/03.CustomSceneNode/main.cpp +++ b/examples/03.CustomSceneNode/main.cpp @@ -244,7 +244,7 @@ int main() u32 frames=0; while(device->run()) { - driver->beginScene(true, true, video::SColor(0,100,100,100)); + driver->beginScene(video::ECBF_COLOR | video::ECBF_DEPTH, video::SColor(0,100,100,100)); smgr->drawAll(); diff --git a/examples/04.Movement/Movement.dev b/examples/04.Movement/Movement.dev deleted file mode 100644 index 0753c109..00000000 --- a/examples/04.Movement/Movement.dev +++ /dev/null @@ -1,59 +0,0 @@ -[Project] -FileName=example.dev -Name=Irrlicht Example 04 Movement -UnitCount=1 -Type=1 -Ver=1 -ObjFiles= -Includes=..\..\include -Libs= -PrivateResource= -ResourceIncludes= -MakeIncludes= -Compiler= -CppCompiler= -Linker=../../lib/Win32-gcc/libIrrlicht.a_@@_ -IsCpp=1 -Icon= -ExeOutput=../../bin/Win32-gcc -ObjectOutput=obj -OverrideOutput=1 -OverrideOutputName=04.Movement.exe -HostApplication= -Folders= -CommandLine= -IncludeVersionInfo=0 -SupportXPThemes=0 -CompilerSet=0 -CompilerSettings=0000000000000000000000 -UseCustomMakefile=0 -CustomMakefile= - -[Unit1] -FileName=main.cpp -CompileCpp=1 -Folder=Projekt1 -Compile=1 -Link=1 -Priority=1000 -OverrideBuildCmd=0 -BuildCmd= - -[VersionInfo] -Major=0 -Minor=1 -Release=1 -Build=1 -LanguageID=1033 -CharsetID=1252 -CompanyName= -FileVersion= -FileDescription=Irrlicht Engine example compiled using DevCpp and gcc -InternalName= -LegalCopyright= -LegalTrademarks= -OriginalFilename= -ProductName= -ProductVersion= -AutoIncBuildNr=0 - diff --git a/examples/04.Movement/Movement_vc10.vcxproj b/examples/04.Movement/Movement_vc10.vcxproj index 7e59058b..131479da 100644 --- a/examples/04.Movement/Movement_vc10.vcxproj +++ b/examples/04.Movement/Movement_vc10.vcxproj @@ -28,21 +28,25 @@ Application false MultiByte + Windows7.1SDK Application false MultiByte + Windows7.1SDK Application false MultiByte + Windows7.1SDK Application false MultiByte + Windows7.1SDK diff --git a/examples/04.Movement/Movement_vc11.vcxproj b/examples/04.Movement/Movement_vc11.vcxproj index 7fe03392..131479da 100644 --- a/examples/04.Movement/Movement_vc11.vcxproj +++ b/examples/04.Movement/Movement_vc11.vcxproj @@ -28,25 +28,25 @@ Application false MultiByte - v110 + Windows7.1SDK Application false MultiByte - v110 + Windows7.1SDK Application false MultiByte - v110 + Windows7.1SDK Application false MultiByte - v110 + Windows7.1SDK diff --git a/examples/04.Movement/Movement_vc12.vcxproj b/examples/04.Movement/Movement_vc12.vcxproj new file mode 100644 index 00000000..bbebe747 --- /dev/null +++ b/examples/04.Movement/Movement_vc12.vcxproj @@ -0,0 +1,235 @@ + + + + + Debug + Win32 + + + Debug + x64 + + + Release + Win32 + + + Release + x64 + + + + 04.Movement + {7BDBB7E8-E0C9-4A0D-83C1-D389D6140FEF} + Movement + + + + Application + false + MultiByte + Windows7.1SDK + + + Application + false + MultiByte + Windows7.1SDK + + + Application + false + MultiByte + Windows7.1SDK + + + Application + false + MultiByte + Windows7.1SDK + + + + + + + + + + + + + + + + + + + + + + + <_ProjectFileVersion>10.0.30319.1 + ..\..\bin\Win32-VisualStudio\ + ..\..\bin\Win64-VisualStudio\ + + + ..\..\bin\Win32-VisualStudio\ + ..\..\bin\Win64-VisualStudio\ + + + AllRules.ruleset + AllRules.ruleset + + + + + AllRules.ruleset + AllRules.ruleset + + + + + + + + .\Debug/Movement.tlb + + + + + Disabled + ..\..\include;%(AdditionalIncludeDirectories) + WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions) + EnableFastChecks + MultiThreadedDebug + + + Level3 + EditAndContinue + + + _DEBUG;%(PreprocessorDefinitions) + 0x0c07 + + + ..\..\bin\Win32-VisualStudio\04.Movement.exe + ..\..\lib\Win32-visualstudio;%(AdditionalLibraryDirectories) + true + Console + + + + + + + .\Debug/Movement.tlb + + + + + Disabled + ..\..\include;%(AdditionalIncludeDirectories) + WIN32;WIN64;_DEBUG;_CONSOLE;%(PreprocessorDefinitions) + EnableFastChecks + MultiThreadedDebug + + + Level3 + ProgramDatabase + + + _DEBUG;%(PreprocessorDefinitions) + 0x0c07 + + + ..\..\bin\Win64-VisualStudio\04.Movement.exe + ..\..\lib\Win64-visualstudio;%(AdditionalLibraryDirectories) + true + Console + + + + + + + .\Release/Movement.tlb + + + + + MaxSpeed + OnlyExplicitInline + ..\..\include;%(AdditionalIncludeDirectories) + WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions) + true + MultiThreaded + true + + + Level3 + + + NDEBUG;%(PreprocessorDefinitions) + 0x0c07 + + + ..\..\bin\Win32-VisualStudio\04.Movement.exe + ..\..\lib\Win32-visualstudio;%(AdditionalLibraryDirectories) + Console + + + + + + + .\Release/Movement.tlb + + + + + MaxSpeed + OnlyExplicitInline + ..\..\include;%(AdditionalIncludeDirectories) + WIN32;WIN64;NDEBUG;_CONSOLE;%(PreprocessorDefinitions) + true + MultiThreaded + true + + + Level3 + + + NDEBUG;%(PreprocessorDefinitions) + 0x0c07 + + + ..\..\bin\Win64-VisualStudio\04.Movement.exe + ..\..\lib\Win64-visualstudio;%(AdditionalLibraryDirectories) + Console + + + + + + + Disabled + Disabled + %(AdditionalIncludeDirectories) + %(AdditionalIncludeDirectories) + %(PreprocessorDefinitions) + %(PreprocessorDefinitions) + EnableFastChecks + EnableFastChecks + MaxSpeed + MaxSpeed + %(AdditionalIncludeDirectories) + %(AdditionalIncludeDirectories) + %(PreprocessorDefinitions) + %(PreprocessorDefinitions) + + + + + + \ No newline at end of file diff --git a/examples/04.Movement/Movement_vc14.vcxproj b/examples/04.Movement/Movement_vc14.vcxproj new file mode 100644 index 00000000..f56853e9 --- /dev/null +++ b/examples/04.Movement/Movement_vc14.vcxproj @@ -0,0 +1,235 @@ + + + + + Debug + Win32 + + + Debug + x64 + + + Release + Win32 + + + Release + x64 + + + + 04.Movement + {7BDBB7E8-E0C9-4A0D-83C1-D389D6140FEF} + Movement + + + + Application + false + MultiByte + v140 + + + Application + false + MultiByte + v140 + + + Application + false + MultiByte + v140 + + + Application + false + MultiByte + v140 + + + + + + + + + + + + + + + + + + + + + + + <_ProjectFileVersion>10.0.30319.1 + ..\..\bin\Win32-VisualStudio\ + ..\..\bin\Win64-VisualStudio\ + + + ..\..\bin\Win32-VisualStudio\ + ..\..\bin\Win64-VisualStudio\ + + + AllRules.ruleset + AllRules.ruleset + + + + + AllRules.ruleset + AllRules.ruleset + + + + + + + + .\Debug/Movement.tlb + + + + + Disabled + ..\..\include;%(AdditionalIncludeDirectories) + WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions) + EnableFastChecks + MultiThreadedDebug + + + Level3 + EditAndContinue + + + _DEBUG;%(PreprocessorDefinitions) + 0x0c07 + + + ..\..\bin\Win32-VisualStudio\04.Movement.exe + ..\..\lib\Win32-visualstudio;%(AdditionalLibraryDirectories) + true + Console + + + + + + + .\Debug/Movement.tlb + + + + + Disabled + ..\..\include;%(AdditionalIncludeDirectories) + WIN32;WIN64;_DEBUG;_CONSOLE;%(PreprocessorDefinitions) + EnableFastChecks + MultiThreadedDebug + + + Level3 + ProgramDatabase + + + _DEBUG;%(PreprocessorDefinitions) + 0x0c07 + + + ..\..\bin\Win64-VisualStudio\04.Movement.exe + ..\..\lib\Win64-visualstudio;%(AdditionalLibraryDirectories) + true + Console + + + + + + + .\Release/Movement.tlb + + + + + MaxSpeed + OnlyExplicitInline + ..\..\include;%(AdditionalIncludeDirectories) + WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions) + true + MultiThreaded + true + + + Level3 + + + NDEBUG;%(PreprocessorDefinitions) + 0x0c07 + + + ..\..\bin\Win32-VisualStudio\04.Movement.exe + ..\..\lib\Win32-visualstudio;%(AdditionalLibraryDirectories) + Console + + + + + + + .\Release/Movement.tlb + + + + + MaxSpeed + OnlyExplicitInline + ..\..\include;%(AdditionalIncludeDirectories) + WIN32;WIN64;NDEBUG;_CONSOLE;%(PreprocessorDefinitions) + true + MultiThreaded + true + + + Level3 + + + NDEBUG;%(PreprocessorDefinitions) + 0x0c07 + + + ..\..\bin\Win64-VisualStudio\04.Movement.exe + ..\..\lib\Win64-visualstudio;%(AdditionalLibraryDirectories) + Console + + + + + + + Disabled + Disabled + %(AdditionalIncludeDirectories) + %(AdditionalIncludeDirectories) + %(PreprocessorDefinitions) + %(PreprocessorDefinitions) + EnableFastChecks + EnableFastChecks + MaxSpeed + MaxSpeed + %(AdditionalIncludeDirectories) + %(AdditionalIncludeDirectories) + %(PreprocessorDefinitions) + %(PreprocessorDefinitions) + + + + + + \ No newline at end of file diff --git a/examples/04.Movement/Movement_vc8.vcproj b/examples/04.Movement/Movement_vc8.vcproj deleted file mode 100644 index 8f56add3..00000000 --- a/examples/04.Movement/Movement_vc8.vcproj +++ /dev/null @@ -1,231 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/examples/04.Movement/Movement_vc9.vcproj b/examples/04.Movement/Movement_vc9.vcproj deleted file mode 100644 index 074fe40b..00000000 --- a/examples/04.Movement/Movement_vc9.vcproj +++ /dev/null @@ -1,230 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/examples/04.Movement/main.cpp b/examples/04.Movement/main.cpp index 7bacda36..af890924 100644 --- a/examples/04.Movement/main.cpp +++ b/examples/04.Movement/main.cpp @@ -19,6 +19,7 @@ and tell the linker to link with the .lib file. #include #include "driverChoice.h" +#include "exampleHelper.h" using namespace irr; @@ -87,6 +88,8 @@ int main() video::IVideoDriver* driver = device->getVideoDriver(); scene::ISceneManager* smgr = device->getSceneManager(); + const io::path mediaPath = getExampleMediaPath(); + /* Create the node which will be moved with the WSAD keys. We create a sphere node, which is a built-in geometry primitive. We place the node @@ -98,7 +101,7 @@ int main() if (node) { node->setPosition(core::vector3df(0,0,30)); - node->setMaterialTexture(0, driver->getTexture("../../media/wall.bmp")); + node->setMaterialTexture(0, driver->getTexture(mediaPath + "wall.bmp")); node->setMaterialFlag(video::EMF_LIGHTING, false); } @@ -115,7 +118,7 @@ int main() if (n) { - n->setMaterialTexture(0, driver->getTexture("../../media/t351sml.jpg")); + n->setMaterialTexture(0, driver->getTexture(mediaPath + "t351sml.jpg")); n->setMaterialFlag(video::EMF_LIGHTING, false); scene::ISceneNodeAnimator* anim = smgr->createFlyCircleAnimator(core::vector3df(0,0,30), 20.0f); @@ -131,7 +134,7 @@ int main() a b3d model, which uses a 'fly straight' animator to run between to points. */ scene::IAnimatedMeshSceneNode* anms = - smgr->addAnimatedMeshSceneNode(smgr->getMesh("../../media/ninja.b3d")); + smgr->addAnimatedMeshSceneNode(smgr->getMesh(mediaPath + "ninja.b3d")); if (anms) { @@ -164,7 +167,7 @@ int main() anms->setScale(core::vector3df(2.f,2.f,2.f)); anms->setRotation(core::vector3df(0,-90,0)); -// anms->setMaterialTexture(0, driver->getTexture("../../media/sydney.bmp")); +// anms->setMaterialTexture(0, driver->getTexture(mediaPath + "sydney.bmp")); } @@ -180,7 +183,7 @@ int main() Add a colorful irrlicht logo */ device->getGUIEnvironment()->addImage( - driver->getTexture("../../media/irrlichtlogoalpha2.tga"), + driver->getTexture(mediaPath + "irrlichtlogoalpha2.tga"), core::position2d(10,20)); gui::IGUIStaticText* diagnostics = device->getGUIEnvironment()->addStaticText( @@ -224,7 +227,7 @@ int main() node->setPosition(nodePosition); - driver->beginScene(true, true, video::SColor(255,113,113,133)); + driver->beginScene(video::ECBF_COLOR | video::ECBF_DEPTH, video::SColor(255,113,113,133)); smgr->drawAll(); // draw the 3d scene device->getGUIEnvironment()->drawAll(); // draw the gui environment (the logo) diff --git a/examples/05.UserInterface/UserInterface.dev b/examples/05.UserInterface/UserInterface.dev deleted file mode 100644 index 6a32ece1..00000000 --- a/examples/05.UserInterface/UserInterface.dev +++ /dev/null @@ -1,59 +0,0 @@ -[Project] -FileName=example.dev -Name=Irrlicht Example 05 User Interface -UnitCount=1 -Type=1 -Ver=1 -ObjFiles= -Includes=..\..\include -Libs= -PrivateResource= -ResourceIncludes= -MakeIncludes= -Compiler= -CppCompiler= -Linker=../../lib/Win32-gcc/libIrrlicht.a_@@_ -IsCpp=1 -Icon= -ExeOutput=../../bin/Win32-gcc -ObjectOutput=obj -OverrideOutput=1 -OverrideOutputName=05.UserInterface.exe -HostApplication= -Folders= -CommandLine= -IncludeVersionInfo=0 -SupportXPThemes=0 -CompilerSet=0 -CompilerSettings=0000000000000000000000 -UseCustomMakefile=0 -CustomMakefile= - -[Unit1] -FileName=main.cpp -CompileCpp=1 -Folder=Projekt1 -Compile=1 -Link=1 -Priority=1000 -OverrideBuildCmd=0 -BuildCmd= - -[VersionInfo] -Major=0 -Minor=1 -Release=1 -Build=1 -LanguageID=1033 -CharsetID=1252 -CompanyName= -FileVersion= -FileDescription=Irrlicht Engine example compiled using DevCpp and gcc -InternalName= -LegalCopyright= -LegalTrademarks= -OriginalFilename= -ProductName= -ProductVersion= -AutoIncBuildNr=0 - diff --git a/examples/05.UserInterface/UserInterface_vc10.vcxproj b/examples/05.UserInterface/UserInterface_vc10.vcxproj index 12c05010..d4be57f1 100644 --- a/examples/05.UserInterface/UserInterface_vc10.vcxproj +++ b/examples/05.UserInterface/UserInterface_vc10.vcxproj @@ -28,21 +28,25 @@ Application false MultiByte + Windows7.1SDK Application false MultiByte + Windows7.1SDK Application false MultiByte + Windows7.1SDK Application false MultiByte + Windows7.1SDK diff --git a/examples/05.UserInterface/UserInterface_vc11.vcxproj b/examples/05.UserInterface/UserInterface_vc11.vcxproj index cc6561b3..d4be57f1 100644 --- a/examples/05.UserInterface/UserInterface_vc11.vcxproj +++ b/examples/05.UserInterface/UserInterface_vc11.vcxproj @@ -28,25 +28,25 @@ Application false MultiByte - v110 + Windows7.1SDK Application false MultiByte - v110 + Windows7.1SDK Application false MultiByte - v110 + Windows7.1SDK Application false MultiByte - v110 + Windows7.1SDK diff --git a/examples/05.UserInterface/UserInterface_vc12.vcxproj b/examples/05.UserInterface/UserInterface_vc12.vcxproj new file mode 100644 index 00000000..3945262f --- /dev/null +++ b/examples/05.UserInterface/UserInterface_vc12.vcxproj @@ -0,0 +1,235 @@ + + + + + Debug + Win32 + + + Debug + x64 + + + Release + Win32 + + + Release + x64 + + + + 05.UserInterface + {622C9DD7-0391-49FF-AF53-24F9D5A8EC53} + UserInterface + + + + Application + false + MultiByte + Windows7.1SDK + + + Application + false + MultiByte + Windows7.1SDK + + + Application + false + MultiByte + Windows7.1SDK + + + Application + false + MultiByte + Windows7.1SDK + + + + + + + + + + + + + + + + + + + + + + + <_ProjectFileVersion>10.0.30319.1 + ..\..\bin\Win32-VisualStudio\ + ..\..\bin\Win64-VisualStudio\ + + + ..\..\bin\Win32-VisualStudio\ + ..\..\bin\Win64-VisualStudio\ + + + AllRules.ruleset + AllRules.ruleset + + + + + AllRules.ruleset + AllRules.ruleset + + + + + + + + .\Debug/UserInterface.tlb + + + + + Disabled + ..\..\include;%(AdditionalIncludeDirectories) + WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions) + EnableFastChecks + MultiThreadedDebug + + + Level3 + EditAndContinue + + + _DEBUG;%(PreprocessorDefinitions) + 0x0c07 + + + ..\..\bin\Win32-VisualStudio\05.UserInterface.exe + ..\..\lib\Win32-visualstudio;%(AdditionalLibraryDirectories) + true + Console + + + + + + + .\Debug/UserInterface.tlb + + + + + Disabled + ..\..\include;%(AdditionalIncludeDirectories) + WIN32;WIN64;_DEBUG;_CONSOLE;%(PreprocessorDefinitions) + EnableFastChecks + MultiThreadedDebug + + + Level3 + ProgramDatabase + + + _DEBUG;%(PreprocessorDefinitions) + 0x0c07 + + + ..\..\bin\Win64-VisualStudio\05.UserInterface.exe + ..\..\lib\Win64-visualstudio;%(AdditionalLibraryDirectories) + true + Console + + + + + + + .\Release/UserInterface.tlb + + + + + MaxSpeed + OnlyExplicitInline + ..\..\include;%(AdditionalIncludeDirectories) + WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions) + true + MultiThreaded + true + + + Level3 + + + NDEBUG;%(PreprocessorDefinitions) + 0x0c07 + + + ..\..\bin\Win32-VisualStudio\05.UserInterface.exe + ..\..\lib\Win32-visualstudio;%(AdditionalLibraryDirectories) + Console + + + + + + + .\Release/UserInterface.tlb + + + + + MaxSpeed + OnlyExplicitInline + ..\..\include;%(AdditionalIncludeDirectories) + WIN32;WIN64;NDEBUG;_CONSOLE;%(PreprocessorDefinitions) + true + MultiThreaded + true + + + Level3 + + + NDEBUG;%(PreprocessorDefinitions) + 0x0c07 + + + ..\..\bin\Win64-VisualStudio\05.UserInterface.exe + ..\..\lib\Win64-visualstudio;%(AdditionalLibraryDirectories) + Console + + + + + + + Disabled + Disabled + %(AdditionalIncludeDirectories) + %(AdditionalIncludeDirectories) + %(PreprocessorDefinitions) + %(PreprocessorDefinitions) + EnableFastChecks + EnableFastChecks + MaxSpeed + MaxSpeed + %(AdditionalIncludeDirectories) + %(AdditionalIncludeDirectories) + %(PreprocessorDefinitions) + %(PreprocessorDefinitions) + + + + + + \ No newline at end of file diff --git a/examples/05.UserInterface/UserInterface_vc14.vcxproj b/examples/05.UserInterface/UserInterface_vc14.vcxproj new file mode 100644 index 00000000..0b66809b --- /dev/null +++ b/examples/05.UserInterface/UserInterface_vc14.vcxproj @@ -0,0 +1,235 @@ + + + + + Debug + Win32 + + + Debug + x64 + + + Release + Win32 + + + Release + x64 + + + + 05.UserInterface + {622C9DD7-0391-49FF-AF53-24F9D5A8EC53} + UserInterface + + + + Application + false + MultiByte + v140 + + + Application + false + MultiByte + v140 + + + Application + false + MultiByte + v140 + + + Application + false + MultiByte + v140 + + + + + + + + + + + + + + + + + + + + + + + <_ProjectFileVersion>10.0.30319.1 + ..\..\bin\Win32-VisualStudio\ + ..\..\bin\Win64-VisualStudio\ + + + ..\..\bin\Win32-VisualStudio\ + ..\..\bin\Win64-VisualStudio\ + + + AllRules.ruleset + AllRules.ruleset + + + + + AllRules.ruleset + AllRules.ruleset + + + + + + + + .\Debug/UserInterface.tlb + + + + + Disabled + ..\..\include;%(AdditionalIncludeDirectories) + WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions) + EnableFastChecks + MultiThreadedDebug + + + Level3 + EditAndContinue + + + _DEBUG;%(PreprocessorDefinitions) + 0x0c07 + + + ..\..\bin\Win32-VisualStudio\05.UserInterface.exe + ..\..\lib\Win32-visualstudio;%(AdditionalLibraryDirectories) + true + Console + + + + + + + .\Debug/UserInterface.tlb + + + + + Disabled + ..\..\include;%(AdditionalIncludeDirectories) + WIN32;WIN64;_DEBUG;_CONSOLE;%(PreprocessorDefinitions) + EnableFastChecks + MultiThreadedDebug + + + Level3 + ProgramDatabase + + + _DEBUG;%(PreprocessorDefinitions) + 0x0c07 + + + ..\..\bin\Win64-VisualStudio\05.UserInterface.exe + ..\..\lib\Win64-visualstudio;%(AdditionalLibraryDirectories) + true + Console + + + + + + + .\Release/UserInterface.tlb + + + + + MaxSpeed + OnlyExplicitInline + ..\..\include;%(AdditionalIncludeDirectories) + WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions) + true + MultiThreaded + true + + + Level3 + + + NDEBUG;%(PreprocessorDefinitions) + 0x0c07 + + + ..\..\bin\Win32-VisualStudio\05.UserInterface.exe + ..\..\lib\Win32-visualstudio;%(AdditionalLibraryDirectories) + Console + + + + + + + .\Release/UserInterface.tlb + + + + + MaxSpeed + OnlyExplicitInline + ..\..\include;%(AdditionalIncludeDirectories) + WIN32;WIN64;NDEBUG;_CONSOLE;%(PreprocessorDefinitions) + true + MultiThreaded + true + + + Level3 + + + NDEBUG;%(PreprocessorDefinitions) + 0x0c07 + + + ..\..\bin\Win64-VisualStudio\05.UserInterface.exe + ..\..\lib\Win64-visualstudio;%(AdditionalLibraryDirectories) + Console + + + + + + + Disabled + Disabled + %(AdditionalIncludeDirectories) + %(AdditionalIncludeDirectories) + %(PreprocessorDefinitions) + %(PreprocessorDefinitions) + EnableFastChecks + EnableFastChecks + MaxSpeed + MaxSpeed + %(AdditionalIncludeDirectories) + %(AdditionalIncludeDirectories) + %(PreprocessorDefinitions) + %(PreprocessorDefinitions) + + + + + + \ No newline at end of file diff --git a/examples/05.UserInterface/UserInterface_vc8.vcproj b/examples/05.UserInterface/UserInterface_vc8.vcproj deleted file mode 100644 index fdc4fef2..00000000 --- a/examples/05.UserInterface/UserInterface_vc8.vcproj +++ /dev/null @@ -1,231 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/examples/05.UserInterface/UserInterface_vc9.vcproj b/examples/05.UserInterface/UserInterface_vc9.vcproj deleted file mode 100644 index e1922389..00000000 --- a/examples/05.UserInterface/UserInterface_vc9.vcproj +++ /dev/null @@ -1,230 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/examples/05.UserInterface/main.cpp b/examples/05.UserInterface/main.cpp index e8fcc0e2..654b6ee2 100644 --- a/examples/05.UserInterface/main.cpp +++ b/examples/05.UserInterface/main.cpp @@ -12,6 +12,7 @@ and a pointer to a listbox. */ #include #include "driverChoice.h" +#include "exampleHelper.h" using namespace irr; @@ -21,7 +22,7 @@ using namespace video; using namespace io; using namespace gui; -#ifdef _IRR_WINDOWS_ +#ifdef _MSC_VER #pragma comment(lib, "Irrlicht.lib") #endif @@ -198,6 +199,8 @@ int main() video::IVideoDriver* driver = device->getVideoDriver(); IGUIEnvironment* env = device->getGUIEnvironment(); + const io::path mediaPath = getExampleMediaPath(); + /* To make the font a little bit nicer, we load an external font and set it as the new default font in the skin. @@ -206,7 +209,7 @@ int main() */ IGUISkin* skin = env->getSkin(); - IGUIFont* font = env->getFont("../../media/fonthaettenschweiler.bmp"); + IGUIFont* font = env->getFont(mediaPath + "fonthaettenschweiler.bmp"); if (font) skin->setFont(font); @@ -264,7 +267,7 @@ int main() /* And at last, we create a nice Irrlicht Engine logo in the top left corner. */ - env->addImage(driver->getTexture("../../media/irrlichtlogo2.png"), + env->addImage(driver->getTexture(mediaPath + "irrlichtlogo2.png"), position2d(10,10)); @@ -275,7 +278,7 @@ int main() while(device->run() && driver) if (device->isWindowActive()) { - driver->beginScene(true, true, SColor(0,200,200,200)); + driver->beginScene(video::ECBF_COLOR | video::ECBF_DEPTH, SColor(0,200,200,200)); env->drawAll(); diff --git a/examples/06.2DGraphics/2DGraphics.dev b/examples/06.2DGraphics/2DGraphics.dev deleted file mode 100644 index 93694f1f..00000000 --- a/examples/06.2DGraphics/2DGraphics.dev +++ /dev/null @@ -1,59 +0,0 @@ -[Project] -FileName=example.dev -Name=Irrlicht Example 06 2D Graphics -UnitCount=1 -Type=1 -Ver=1 -ObjFiles= -Includes=..\..\include -Libs= -PrivateResource= -ResourceIncludes= -MakeIncludes= -Compiler= -CppCompiler= -Linker=../../lib/Win32-gcc/libIrrlicht.a_@@_ -IsCpp=1 -Icon= -ExeOutput=../../bin/Win32-gcc -ObjectOutput=obj -OverrideOutput=1 -OverrideOutputName=06.2DGraphics.exe -HostApplication= -Folders= -CommandLine= -IncludeVersionInfo=0 -SupportXPThemes=0 -CompilerSet=0 -CompilerSettings=0000000000000000000000 -UseCustomMakefile=0 -CustomMakefile= - -[Unit1] -FileName=main.cpp -CompileCpp=1 -Folder=Projekt1 -Compile=1 -Link=1 -Priority=1000 -OverrideBuildCmd=0 -BuildCmd= - -[VersionInfo] -Major=0 -Minor=1 -Release=1 -Build=1 -LanguageID=1033 -CharsetID=1252 -CompanyName= -FileVersion= -FileDescription=Irrlicht Engine example compiled using DevCpp and gcc -InternalName= -LegalCopyright= -LegalTrademarks= -OriginalFilename= -ProductName= -ProductVersion= -AutoIncBuildNr=0 - diff --git a/examples/06.2DGraphics/2DGraphics_vc10.vcxproj b/examples/06.2DGraphics/2DGraphics_vc10.vcxproj index b0f184ed..07fd309f 100644 --- a/examples/06.2DGraphics/2DGraphics_vc10.vcxproj +++ b/examples/06.2DGraphics/2DGraphics_vc10.vcxproj @@ -28,21 +28,25 @@ Application false MultiByte + Windows7.1SDK Application false MultiByte + Windows7.1SDK Application false MultiByte + Windows7.1SDK Application false MultiByte + Windows7.1SDK diff --git a/examples/06.2DGraphics/2DGraphics_vc11.vcxproj b/examples/06.2DGraphics/2DGraphics_vc11.vcxproj index 66e7aa07..07fd309f 100644 --- a/examples/06.2DGraphics/2DGraphics_vc11.vcxproj +++ b/examples/06.2DGraphics/2DGraphics_vc11.vcxproj @@ -28,25 +28,25 @@ Application false MultiByte - v110 + Windows7.1SDK Application false MultiByte - v110 + Windows7.1SDK Application false MultiByte - v110 + Windows7.1SDK Application false MultiByte - v110 + Windows7.1SDK diff --git a/examples/06.2DGraphics/2DGraphics_vc12.vcxproj b/examples/06.2DGraphics/2DGraphics_vc12.vcxproj new file mode 100644 index 00000000..a4750aad --- /dev/null +++ b/examples/06.2DGraphics/2DGraphics_vc12.vcxproj @@ -0,0 +1,235 @@ + + + + + Debug + Win32 + + + Debug + x64 + + + Release + Win32 + + + Release + x64 + + + + 06.2DGraphics + {E71B6F18-10DC-4101-A541-F6D33F71B2BD} + 2DGraphics + + + + Application + false + MultiByte + Windows7.1SDK + + + Application + false + MultiByte + Windows7.1SDK + + + Application + false + MultiByte + Windows7.1SDK + + + Application + false + MultiByte + Windows7.1SDK + + + + + + + + + + + + + + + + + + + + + + + <_ProjectFileVersion>10.0.30319.1 + ..\..\bin\Win32-VisualStudio\ + ..\..\bin\Win64-VisualStudio\ + + + ..\..\bin\Win32-VisualStudio\ + ..\..\bin\Win64-VisualStudio\ + + + AllRules.ruleset + AllRules.ruleset + + + + + AllRules.ruleset + AllRules.ruleset + + + + + + + + .\Release/2DGraphics.tlb + + + + + MaxSpeed + OnlyExplicitInline + ..\..\include;%(AdditionalIncludeDirectories) + WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions) + true + MultiThreaded + true + + + Level3 + + + NDEBUG;%(PreprocessorDefinitions) + 0x0c07 + + + ..\..\bin\Win32-VisualStudio\06.2DGraphics.exe + ..\..\lib\Win32-visualstudio;%(AdditionalLibraryDirectories) + Console + + + + + + + .\Release/2DGraphics.tlb + + + + + MaxSpeed + OnlyExplicitInline + ..\..\include;%(AdditionalIncludeDirectories) + WIN32;WIN64;NDEBUG;_CONSOLE;%(PreprocessorDefinitions) + true + MultiThreaded + true + + + Level3 + + + NDEBUG;%(PreprocessorDefinitions) + 0x0c07 + + + ..\..\bin\Win64-VisualStudio\06.2DGraphics.exe + ..\..\lib\Win64-visualstudio;%(AdditionalLibraryDirectories) + Console + + + + + + + .\Debug/2DGraphics.tlb + + + + + Disabled + ..\..\include;%(AdditionalIncludeDirectories) + WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions) + EnableFastChecks + MultiThreadedDebug + + + Level3 + EditAndContinue + + + _DEBUG;%(PreprocessorDefinitions) + 0x0c07 + + + ..\..\bin\Win32-VisualStudio\06.2DGraphics.exe + ..\..\lib\Win32-visualstudio;%(AdditionalLibraryDirectories) + true + Console + + + + + + + .\Debug/2DGraphics.tlb + + + + + Disabled + ..\..\include;%(AdditionalIncludeDirectories) + WIN32;WIN64;_DEBUG;_CONSOLE;%(PreprocessorDefinitions) + EnableFastChecks + MultiThreadedDebug + + + Level3 + ProgramDatabase + + + _DEBUG;%(PreprocessorDefinitions) + 0x0c07 + + + ..\..\bin\Win64-VisualStudio\06.2DGraphics.exe + ..\..\lib\Win64-visualstudio;%(AdditionalLibraryDirectories) + true + Console + + + + + + + Disabled + Disabled + %(AdditionalIncludeDirectories) + %(AdditionalIncludeDirectories) + %(PreprocessorDefinitions) + %(PreprocessorDefinitions) + EnableFastChecks + EnableFastChecks + MaxSpeed + MaxSpeed + %(AdditionalIncludeDirectories) + %(AdditionalIncludeDirectories) + %(PreprocessorDefinitions) + %(PreprocessorDefinitions) + + + + + + \ No newline at end of file diff --git a/examples/06.2DGraphics/2DGraphics_vc14.vcxproj b/examples/06.2DGraphics/2DGraphics_vc14.vcxproj new file mode 100644 index 00000000..e4d22b1c --- /dev/null +++ b/examples/06.2DGraphics/2DGraphics_vc14.vcxproj @@ -0,0 +1,235 @@ + + + + + Debug + Win32 + + + Debug + x64 + + + Release + Win32 + + + Release + x64 + + + + 06.2DGraphics + {E71B6F18-10DC-4101-A541-F6D33F71B2BD} + 2DGraphics + + + + Application + false + MultiByte + v140 + + + Application + false + MultiByte + v140 + + + Application + false + MultiByte + v140 + + + Application + false + MultiByte + v140 + + + + + + + + + + + + + + + + + + + + + + + <_ProjectFileVersion>10.0.30319.1 + ..\..\bin\Win32-VisualStudio\ + ..\..\bin\Win64-VisualStudio\ + + + ..\..\bin\Win32-VisualStudio\ + ..\..\bin\Win64-VisualStudio\ + + + AllRules.ruleset + AllRules.ruleset + + + + + AllRules.ruleset + AllRules.ruleset + + + + + + + + .\Release/2DGraphics.tlb + + + + + MaxSpeed + OnlyExplicitInline + ..\..\include;%(AdditionalIncludeDirectories) + WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions) + true + MultiThreaded + true + + + Level3 + + + NDEBUG;%(PreprocessorDefinitions) + 0x0c07 + + + ..\..\bin\Win32-VisualStudio\06.2DGraphics.exe + ..\..\lib\Win32-visualstudio;%(AdditionalLibraryDirectories) + Console + + + + + + + .\Release/2DGraphics.tlb + + + + + MaxSpeed + OnlyExplicitInline + ..\..\include;%(AdditionalIncludeDirectories) + WIN32;WIN64;NDEBUG;_CONSOLE;%(PreprocessorDefinitions) + true + MultiThreaded + true + + + Level3 + + + NDEBUG;%(PreprocessorDefinitions) + 0x0c07 + + + ..\..\bin\Win64-VisualStudio\06.2DGraphics.exe + ..\..\lib\Win64-visualstudio;%(AdditionalLibraryDirectories) + Console + + + + + + + .\Debug/2DGraphics.tlb + + + + + Disabled + ..\..\include;%(AdditionalIncludeDirectories) + WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions) + EnableFastChecks + MultiThreadedDebug + + + Level3 + EditAndContinue + + + _DEBUG;%(PreprocessorDefinitions) + 0x0c07 + + + ..\..\bin\Win32-VisualStudio\06.2DGraphics.exe + ..\..\lib\Win32-visualstudio;%(AdditionalLibraryDirectories) + true + Console + + + + + + + .\Debug/2DGraphics.tlb + + + + + Disabled + ..\..\include;%(AdditionalIncludeDirectories) + WIN32;WIN64;_DEBUG;_CONSOLE;%(PreprocessorDefinitions) + EnableFastChecks + MultiThreadedDebug + + + Level3 + ProgramDatabase + + + _DEBUG;%(PreprocessorDefinitions) + 0x0c07 + + + ..\..\bin\Win64-VisualStudio\06.2DGraphics.exe + ..\..\lib\Win64-visualstudio;%(AdditionalLibraryDirectories) + true + Console + + + + + + + Disabled + Disabled + %(AdditionalIncludeDirectories) + %(AdditionalIncludeDirectories) + %(PreprocessorDefinitions) + %(PreprocessorDefinitions) + EnableFastChecks + EnableFastChecks + MaxSpeed + MaxSpeed + %(AdditionalIncludeDirectories) + %(AdditionalIncludeDirectories) + %(PreprocessorDefinitions) + %(PreprocessorDefinitions) + + + + + + \ No newline at end of file diff --git a/examples/06.2DGraphics/2DGraphics_vc8.vcproj b/examples/06.2DGraphics/2DGraphics_vc8.vcproj deleted file mode 100644 index 8a10914c..00000000 --- a/examples/06.2DGraphics/2DGraphics_vc8.vcproj +++ /dev/null @@ -1,231 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/examples/06.2DGraphics/2DGraphics_vc9.vcproj b/examples/06.2DGraphics/2DGraphics_vc9.vcproj deleted file mode 100644 index e78f8a03..00000000 --- a/examples/06.2DGraphics/2DGraphics_vc9.vcproj +++ /dev/null @@ -1,230 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/examples/06.2DGraphics/main.cpp b/examples/06.2DGraphics/main.cpp index 40e311a4..4338a9bf 100644 --- a/examples/06.2DGraphics/main.cpp +++ b/examples/06.2DGraphics/main.cpp @@ -11,6 +11,7 @@ and tell the linker to link with the .lib file. */ #include #include "driverChoice.h" +#include "exampleHelper.h" using namespace irr; @@ -41,6 +42,8 @@ int main() video::IVideoDriver* driver = device->getVideoDriver(); + const io::path mediaPath = getExampleMediaPath(); + /* All 2d graphics in this example are put together into one texture, 2ddemo.png. Because we want to draw colorkey based sprites, we need to @@ -54,7 +57,7 @@ int main() e.g. all black pixels transparent. Please note that makeColorKeyTexture just creates an alpha channel based on the color. */ - video::ITexture* images = driver->getTexture("../../media/2ddemo.png"); + video::ITexture* images = driver->getTexture(mediaPath + "2ddemo.png"); driver->makeColorKeyTexture(images, core::position2d(0,0)); /* @@ -66,7 +69,7 @@ int main() */ gui::IGUIFont* font = device->getGUIEnvironment()->getBuiltInFont(); gui::IGUIFont* font2 = - device->getGUIEnvironment()->getFont("../../media/fonthaettenschweiler.bmp"); + device->getGUIEnvironment()->getFont(mediaPath + "fonthaettenschweiler.bmp"); core::rect imp1(349,15,385,78); core::rect imp2(387,15,423,78); @@ -90,7 +93,7 @@ int main() { u32 time = device->getTimer()->getTime(); - driver->beginScene(true, true, video::SColor(255,120,102,136)); + driver->beginScene(video::ECBF_COLOR | video::ECBF_DEPTH, video::SColor(255,120,102,136)); /* First, we draw 3 sprites, using the alpha channel we diff --git a/examples/07.Collision/Collision.dev b/examples/07.Collision/Collision.dev deleted file mode 100644 index c13a041e..00000000 --- a/examples/07.Collision/Collision.dev +++ /dev/null @@ -1,59 +0,0 @@ -[Project] -FileName=example.dev -Name=Irrlicht Example 07 Collision -UnitCount=1 -Type=1 -Ver=1 -ObjFiles= -Includes=..\..\include -Libs= -PrivateResource= -ResourceIncludes= -MakeIncludes= -Compiler= -CppCompiler= -Linker=../../lib/Win32-gcc/libIrrlicht.a_@@_ -IsCpp=1 -Icon= -ExeOutput=../../bin/Win32-gcc -ObjectOutput=obj -OverrideOutput=1 -OverrideOutputName=07.Collision.exe -HostApplication= -Folders= -CommandLine= -IncludeVersionInfo=0 -SupportXPThemes=0 -CompilerSet=0 -CompilerSettings=0000000000000000000000 -UseCustomMakefile=0 -CustomMakefile= - -[Unit1] -FileName=main.cpp -CompileCpp=1 -Folder=Projekt1 -Compile=1 -Link=1 -Priority=1000 -OverrideBuildCmd=0 -BuildCmd= - -[VersionInfo] -Major=0 -Minor=1 -Release=1 -Build=1 -LanguageID=1033 -CharsetID=1252 -CompanyName= -FileVersion= -FileDescription=Irrlicht Engine example compiled using DevCpp and gcc -InternalName= -LegalCopyright= -LegalTrademarks= -OriginalFilename= -ProductName= -ProductVersion= -AutoIncBuildNr=0 - diff --git a/examples/07.Collision/Collision_vc10.vcxproj b/examples/07.Collision/Collision_vc10.vcxproj index 03a94c8a..72fcae0a 100644 --- a/examples/07.Collision/Collision_vc10.vcxproj +++ b/examples/07.Collision/Collision_vc10.vcxproj @@ -28,21 +28,25 @@ Application false MultiByte + Windows7.1SDK Application false MultiByte + Windows7.1SDK Application false MultiByte + Windows7.1SDK Application false MultiByte + Windows7.1SDK diff --git a/examples/07.Collision/Collision_vc11.vcxproj b/examples/07.Collision/Collision_vc11.vcxproj index 0db4b42f..72fcae0a 100644 --- a/examples/07.Collision/Collision_vc11.vcxproj +++ b/examples/07.Collision/Collision_vc11.vcxproj @@ -28,25 +28,25 @@ Application false MultiByte - v110 + Windows7.1SDK Application false MultiByte - v110 + Windows7.1SDK Application false MultiByte - v110 + Windows7.1SDK Application false MultiByte - v110 + Windows7.1SDK diff --git a/examples/07.Collision/Collision_vc12.vcxproj b/examples/07.Collision/Collision_vc12.vcxproj new file mode 100644 index 00000000..6434626b --- /dev/null +++ b/examples/07.Collision/Collision_vc12.vcxproj @@ -0,0 +1,235 @@ + + + + + Debug + Win32 + + + Debug + x64 + + + Release + Win32 + + + Release + x64 + + + + 07.Collision + {3E30297B-5BE3-4A5C-B31E-08A28ADDB29E} + Collision + + + + Application + false + MultiByte + Windows7.1SDK + + + Application + false + MultiByte + Windows7.1SDK + + + Application + false + MultiByte + Windows7.1SDK + + + Application + false + MultiByte + Windows7.1SDK + + + + + + + + + + + + + + + + + + + + + + + <_ProjectFileVersion>10.0.30319.1 + ..\..\bin\Win32-VisualStudio\ + ..\..\bin\Win64-VisualStudio\ + + + ..\..\bin\Win32-VisualStudio\ + ..\..\bin\Win64-VisualStudio\ + + + AllRules.ruleset + AllRules.ruleset + + + + + AllRules.ruleset + AllRules.ruleset + + + + + + + + .\Debug/Collision.tlb + + + + + Disabled + ..\..\include;%(AdditionalIncludeDirectories) + WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions) + EnableFastChecks + MultiThreadedDebug + + + Level3 + EditAndContinue + + + _DEBUG;%(PreprocessorDefinitions) + 0x0c07 + + + ..\..\bin\Win32-VisualStudio\07.Collision.exe + ..\..\lib\Win32-visualstudio;%(AdditionalLibraryDirectories) + true + Console + + + + + + + .\Debug/Collision.tlb + + + + + Disabled + ..\..\include;%(AdditionalIncludeDirectories) + WIN32;WIN64;_DEBUG;_CONSOLE;%(PreprocessorDefinitions) + EnableFastChecks + MultiThreadedDebug + + + Level3 + ProgramDatabase + + + _DEBUG;%(PreprocessorDefinitions) + 0x0c07 + + + ..\..\bin\Win64-VisualStudio\07.Collision.exe + ..\..\lib\Win64-visualstudio;%(AdditionalLibraryDirectories) + true + Console + + + + + + + .\Release/Collision.tlb + + + + + MaxSpeed + OnlyExplicitInline + ..\..\include;%(AdditionalIncludeDirectories) + WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions) + true + MultiThreaded + true + + + Level3 + + + NDEBUG;%(PreprocessorDefinitions) + 0x0c07 + + + ..\..\bin\Win32-VisualStudio\07.Collision.exe + ..\..\lib\Win32-visualstudio;%(AdditionalLibraryDirectories) + Console + + + + + + + .\Release/Collision.tlb + + + + + MaxSpeed + OnlyExplicitInline + ..\..\include;%(AdditionalIncludeDirectories) + WIN32;WIN64;NDEBUG;_CONSOLE;%(PreprocessorDefinitions) + true + MultiThreaded + true + + + Level3 + + + NDEBUG;%(PreprocessorDefinitions) + 0x0c07 + + + ..\..\bin\Win64-VisualStudio\07.Collision.exe + ..\..\lib\Win64-visualstudio;%(AdditionalLibraryDirectories) + Console + + + + + + + Disabled + Disabled + %(AdditionalIncludeDirectories) + %(AdditionalIncludeDirectories) + %(PreprocessorDefinitions) + %(PreprocessorDefinitions) + EnableFastChecks + EnableFastChecks + MaxSpeed + MaxSpeed + %(AdditionalIncludeDirectories) + %(AdditionalIncludeDirectories) + %(PreprocessorDefinitions) + %(PreprocessorDefinitions) + + + + + + \ No newline at end of file diff --git a/examples/07.Collision/Collision_vc14.vcxproj b/examples/07.Collision/Collision_vc14.vcxproj new file mode 100644 index 00000000..06983f17 --- /dev/null +++ b/examples/07.Collision/Collision_vc14.vcxproj @@ -0,0 +1,235 @@ + + + + + Debug + Win32 + + + Debug + x64 + + + Release + Win32 + + + Release + x64 + + + + 07.Collision + {3E30297B-5BE3-4A5C-B31E-08A28ADDB29E} + Collision + + + + Application + false + MultiByte + v140 + + + Application + false + MultiByte + v140 + + + Application + false + MultiByte + v140 + + + Application + false + MultiByte + v140 + + + + + + + + + + + + + + + + + + + + + + + <_ProjectFileVersion>10.0.30319.1 + ..\..\bin\Win32-VisualStudio\ + ..\..\bin\Win64-VisualStudio\ + + + ..\..\bin\Win32-VisualStudio\ + ..\..\bin\Win64-VisualStudio\ + + + AllRules.ruleset + AllRules.ruleset + + + + + AllRules.ruleset + AllRules.ruleset + + + + + + + + .\Debug/Collision.tlb + + + + + Disabled + ..\..\include;%(AdditionalIncludeDirectories) + WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions) + EnableFastChecks + MultiThreadedDebug + + + Level3 + EditAndContinue + + + _DEBUG;%(PreprocessorDefinitions) + 0x0c07 + + + ..\..\bin\Win32-VisualStudio\07.Collision.exe + ..\..\lib\Win32-visualstudio;%(AdditionalLibraryDirectories) + true + Console + + + + + + + .\Debug/Collision.tlb + + + + + Disabled + ..\..\include;%(AdditionalIncludeDirectories) + WIN32;WIN64;_DEBUG;_CONSOLE;%(PreprocessorDefinitions) + EnableFastChecks + MultiThreadedDebug + + + Level3 + ProgramDatabase + + + _DEBUG;%(PreprocessorDefinitions) + 0x0c07 + + + ..\..\bin\Win64-VisualStudio\07.Collision.exe + ..\..\lib\Win64-visualstudio;%(AdditionalLibraryDirectories) + true + Console + + + + + + + .\Release/Collision.tlb + + + + + MaxSpeed + OnlyExplicitInline + ..\..\include;%(AdditionalIncludeDirectories) + WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions) + true + MultiThreaded + true + + + Level3 + + + NDEBUG;%(PreprocessorDefinitions) + 0x0c07 + + + ..\..\bin\Win32-VisualStudio\07.Collision.exe + ..\..\lib\Win32-visualstudio;%(AdditionalLibraryDirectories) + Console + + + + + + + .\Release/Collision.tlb + + + + + MaxSpeed + OnlyExplicitInline + ..\..\include;%(AdditionalIncludeDirectories) + WIN32;WIN64;NDEBUG;_CONSOLE;%(PreprocessorDefinitions) + true + MultiThreaded + true + + + Level3 + + + NDEBUG;%(PreprocessorDefinitions) + 0x0c07 + + + ..\..\bin\Win64-VisualStudio\07.Collision.exe + ..\..\lib\Win64-visualstudio;%(AdditionalLibraryDirectories) + Console + + + + + + + Disabled + Disabled + %(AdditionalIncludeDirectories) + %(AdditionalIncludeDirectories) + %(PreprocessorDefinitions) + %(PreprocessorDefinitions) + EnableFastChecks + EnableFastChecks + MaxSpeed + MaxSpeed + %(AdditionalIncludeDirectories) + %(AdditionalIncludeDirectories) + %(PreprocessorDefinitions) + %(PreprocessorDefinitions) + + + + + + \ No newline at end of file diff --git a/examples/07.Collision/Collision_vc8.vcproj b/examples/07.Collision/Collision_vc8.vcproj deleted file mode 100644 index 4a2b6c17..00000000 --- a/examples/07.Collision/Collision_vc8.vcproj +++ /dev/null @@ -1,231 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/examples/07.Collision/Collision_vc9.vcproj b/examples/07.Collision/Collision_vc9.vcproj deleted file mode 100644 index 3cca93da..00000000 --- a/examples/07.Collision/Collision_vc9.vcproj +++ /dev/null @@ -1,230 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/examples/07.Collision/main.cpp b/examples/07.Collision/main.cpp index 8387c499..6d785268 100644 --- a/examples/07.Collision/main.cpp +++ b/examples/07.Collision/main.cpp @@ -12,6 +12,7 @@ following code starts up the engine and loads the level, as per tutorial 2. */ #include #include "driverChoice.h" +#include "exampleHelper.h" using namespace irr; @@ -53,7 +54,9 @@ int main() video::IVideoDriver* driver = device->getVideoDriver(); scene::ISceneManager* smgr = device->getSceneManager(); - device->getFileSystem()->addFileArchive("../../media/map-20kdm2.pk3"); + const io::path mediaPath = getExampleMediaPath(); + + device->getFileSystem()->addFileArchive(mediaPath + "map-20kdm2.pk3"); scene::IAnimatedMesh* q3levelmesh = smgr->getMesh("20kdm2.bsp"); scene::IMeshSceneNode* q3node = 0; @@ -153,7 +156,7 @@ int main() // Add the billboard. scene::IBillboardSceneNode * bill = smgr->addBillboardSceneNode(); bill->setMaterialType(video::EMT_TRANSPARENT_ADD_COLOR ); - bill->setMaterialTexture(0, driver->getTexture("../../media/particle.bmp")); + bill->setMaterialTexture(0, driver->getTexture(mediaPath + "particle.bmp")); bill->setMaterialFlag(video::EMF_LIGHTING, false); bill->setMaterialFlag(video::EMF_ZBUFFER, false); bill->setSize(core::dimension2d(20.0f, 20.0f)); @@ -167,13 +170,13 @@ int main() video::SMaterial material; // Add an MD2 node, which uses vertex-based animation. - node = smgr->addAnimatedMeshSceneNode(smgr->getMesh("../../media/faerie.md2"), + node = smgr->addAnimatedMeshSceneNode(smgr->getMesh(mediaPath + "faerie.md2"), 0, IDFlag_IsPickable | IDFlag_IsHighlightable); node->setPosition(core::vector3df(-90,-15,-140)); // Put its feet on the floor. node->setScale(core::vector3df(1.6f)); // Make it appear realistically scaled node->setMD2Animation(scene::EMAT_POINT); node->setAnimationSpeed(20.f); - material.setTexture(0, driver->getTexture("../../media/faerie2.bmp")); + material.setTexture(0, driver->getTexture(mediaPath + "faerie2.bmp")); material.Lighting = true; material.NormalizeNormals = true; node->getMaterial(0) = material; @@ -185,7 +188,7 @@ int main() selector->drop(); // We're done with this selector, so drop it now. // And this B3D file uses skinned skeletal animation. - node = smgr->addAnimatedMeshSceneNode(smgr->getMesh("../../media/ninja.b3d"), + node = smgr->addAnimatedMeshSceneNode(smgr->getMesh(mediaPath + "ninja.b3d"), 0, IDFlag_IsPickable | IDFlag_IsHighlightable); node->setScale(core::vector3df(10)); node->setPosition(core::vector3df(-75,-66,-80)); @@ -199,7 +202,7 @@ int main() selector->drop(); // This X files uses skeletal animation, but without skinning. - node = smgr->addAnimatedMeshSceneNode(smgr->getMesh("../../media/dwarf.x"), + node = smgr->addAnimatedMeshSceneNode(smgr->getMesh(mediaPath + "dwarf.x"), 0, IDFlag_IsPickable | IDFlag_IsHighlightable); node->setPosition(core::vector3df(-70,-66,-30)); // Put its feet on the floor. node->setRotation(core::vector3df(0,-90,0)); // And turn it towards the camera. @@ -211,7 +214,7 @@ int main() // And this mdl file uses skinned skeletal animation. - node = smgr->addAnimatedMeshSceneNode(smgr->getMesh("../../media/yodan.mdl"), + node = smgr->addAnimatedMeshSceneNode(smgr->getMesh(mediaPath + "yodan.mdl"), 0, IDFlag_IsPickable | IDFlag_IsHighlightable); node->setPosition(core::vector3df(-90,-25,20)); node->setScale(core::vector3df(0.8f)); @@ -242,7 +245,7 @@ int main() while(device->run()) if (device->isWindowActive()) { - driver->beginScene(true, true, 0); + driver->beginScene(video::ECBF_COLOR | video::ECBF_DEPTH, video::SColor(0)); smgr->drawAll(); // Unlight any currently highlighted scene node diff --git a/examples/08.SpecialFX/SpecialFX.dev b/examples/08.SpecialFX/SpecialFX.dev deleted file mode 100644 index b2c2f261..00000000 --- a/examples/08.SpecialFX/SpecialFX.dev +++ /dev/null @@ -1,59 +0,0 @@ -[Project] -FileName=example.dev -Name=Irrlicht Example 08 Special Effects -UnitCount=1 -Type=1 -Ver=1 -ObjFiles= -Includes=..\..\include -Libs= -PrivateResource= -ResourceIncludes= -MakeIncludes= -Compiler= -CppCompiler= -Linker=../../lib/Win32-gcc/libIrrlicht.a_@@_ -IsCpp=1 -Icon= -ExeOutput=../../bin/Win32-gcc -ObjectOutput=obj -OverrideOutput=1 -OverrideOutputName=08.SpecialFX.exe -HostApplication= -Folders= -CommandLine= -IncludeVersionInfo=0 -SupportXPThemes=0 -CompilerSet=0 -CompilerSettings=0000000000000000000000 -UseCustomMakefile=0 -CustomMakefile= - -[Unit1] -FileName=main.cpp -CompileCpp=1 -Folder=Projekt1 -Compile=1 -Link=1 -Priority=1000 -OverrideBuildCmd=0 -BuildCmd= - -[VersionInfo] -Major=0 -Minor=1 -Release=1 -Build=1 -LanguageID=1033 -CharsetID=1252 -CompanyName= -FileVersion= -FileDescription=Irrlicht Engine example compiled using DevCpp and gcc -InternalName= -LegalCopyright= -LegalTrademarks= -OriginalFilename= -ProductName= -ProductVersion= -AutoIncBuildNr=0 - diff --git a/examples/08.SpecialFX/SpecialFX_vc10.vcxproj b/examples/08.SpecialFX/SpecialFX_vc10.vcxproj index c46d1c03..fd669a1a 100644 --- a/examples/08.SpecialFX/SpecialFX_vc10.vcxproj +++ b/examples/08.SpecialFX/SpecialFX_vc10.vcxproj @@ -28,21 +28,25 @@ Application false MultiByte + Windows7.1SDK Application false MultiByte + Windows7.1SDK Application false MultiByte + Windows7.1SDK Application false MultiByte + Windows7.1SDK diff --git a/examples/08.SpecialFX/SpecialFX_vc11.vcxproj b/examples/08.SpecialFX/SpecialFX_vc11.vcxproj index 3e2e1c04..fd669a1a 100644 --- a/examples/08.SpecialFX/SpecialFX_vc11.vcxproj +++ b/examples/08.SpecialFX/SpecialFX_vc11.vcxproj @@ -28,25 +28,25 @@ Application false MultiByte - v110 + Windows7.1SDK Application false MultiByte - v110 + Windows7.1SDK Application false MultiByte - v110 + Windows7.1SDK Application false MultiByte - v110 + Windows7.1SDK diff --git a/examples/08.SpecialFX/SpecialFX_vc12.vcxproj b/examples/08.SpecialFX/SpecialFX_vc12.vcxproj new file mode 100644 index 00000000..45f60640 --- /dev/null +++ b/examples/08.SpecialFX/SpecialFX_vc12.vcxproj @@ -0,0 +1,235 @@ + + + + + Debug + Win32 + + + Debug + x64 + + + Release + Win32 + + + Release + x64 + + + + 08.SpecialFX + {C869BF55-B9D6-4980-BC92-60FA0CF8411A} + SpecialFX + + + + Application + false + MultiByte + Windows7.1SDK + + + Application + false + MultiByte + Windows7.1SDK + + + Application + false + MultiByte + Windows7.1SDK + + + Application + false + MultiByte + Windows7.1SDK + + + + + + + + + + + + + + + + + + + + + + + <_ProjectFileVersion>10.0.30319.1 + ..\..\bin\Win32-VisualStudio\ + ..\..\bin\Win64-VisualStudio\ + + + ..\..\bin\Win32-VisualStudio\ + ..\..\bin\Win64-VisualStudio\ + + + AllRules.ruleset + AllRules.ruleset + + + + + AllRules.ruleset + AllRules.ruleset + + + + + + + + .\Release/SpecialFX.tlb + + + + + MaxSpeed + OnlyExplicitInline + ..\..\include;%(AdditionalIncludeDirectories) + WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions) + true + MultiThreaded + true + + + Level3 + + + NDEBUG;%(PreprocessorDefinitions) + 0x0c07 + + + ..\..\bin\Win32-VisualStudio\08.SpecialFx.exe + ..\..\lib\Win32-visualstudio;%(AdditionalLibraryDirectories) + Console + + + + + + + .\Release/SpecialFX.tlb + + + + + MaxSpeed + OnlyExplicitInline + ..\..\include;%(AdditionalIncludeDirectories) + WIN32;WIN64;NDEBUG;_CONSOLE;%(PreprocessorDefinitions) + true + MultiThreaded + true + + + Level3 + + + NDEBUG;%(PreprocessorDefinitions) + 0x0c07 + + + ..\..\bin\Win64-VisualStudio\08.SpecialFx.exe + ..\..\lib\Win64-visualstudio;%(AdditionalLibraryDirectories) + Console + + + + + + + .\Debug/SpecialFX.tlb + + + + + Disabled + ..\..\include;%(AdditionalIncludeDirectories) + WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions) + EnableFastChecks + MultiThreadedDebug + + + Level3 + EditAndContinue + + + _DEBUG;%(PreprocessorDefinitions) + 0x0c07 + + + ..\..\bin\Win32-VisualStudio\08.SpecialFx.exe + ..\..\lib\Win32-visualstudio;%(AdditionalLibraryDirectories) + true + Console + + + + + + + .\Debug/SpecialFX.tlb + + + + + Disabled + ..\..\include;%(AdditionalIncludeDirectories) + WIN32;WIN64;_DEBUG;_CONSOLE;%(PreprocessorDefinitions) + EnableFastChecks + MultiThreadedDebug + + + Level3 + ProgramDatabase + + + _DEBUG;%(PreprocessorDefinitions) + 0x0c07 + + + ..\..\bin\Win64-VisualStudio\08.SpecialFx.exe + ..\..\lib\Win64-visualstudio;%(AdditionalLibraryDirectories) + true + Console + + + + + + + Disabled + Disabled + %(AdditionalIncludeDirectories) + %(AdditionalIncludeDirectories) + %(PreprocessorDefinitions) + %(PreprocessorDefinitions) + EnableFastChecks + EnableFastChecks + MaxSpeed + MaxSpeed + %(AdditionalIncludeDirectories) + %(AdditionalIncludeDirectories) + %(PreprocessorDefinitions) + %(PreprocessorDefinitions) + + + + + + \ No newline at end of file diff --git a/examples/08.SpecialFX/SpecialFX_vc14.vcxproj b/examples/08.SpecialFX/SpecialFX_vc14.vcxproj new file mode 100644 index 00000000..d91a31f6 --- /dev/null +++ b/examples/08.SpecialFX/SpecialFX_vc14.vcxproj @@ -0,0 +1,235 @@ + + + + + Debug + Win32 + + + Debug + x64 + + + Release + Win32 + + + Release + x64 + + + + 08.SpecialFX + {C869BF55-B9D6-4980-BC92-60FA0CF8411A} + SpecialFX + + + + Application + false + MultiByte + v140 + + + Application + false + MultiByte + v140 + + + Application + false + MultiByte + v140 + + + Application + false + MultiByte + v140 + + + + + + + + + + + + + + + + + + + + + + + <_ProjectFileVersion>10.0.30319.1 + ..\..\bin\Win32-VisualStudio\ + ..\..\bin\Win64-VisualStudio\ + + + ..\..\bin\Win32-VisualStudio\ + ..\..\bin\Win64-VisualStudio\ + + + AllRules.ruleset + AllRules.ruleset + + + + + AllRules.ruleset + AllRules.ruleset + + + + + + + + .\Release/SpecialFX.tlb + + + + + MaxSpeed + OnlyExplicitInline + ..\..\include;%(AdditionalIncludeDirectories) + WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions) + true + MultiThreaded + true + + + Level3 + + + NDEBUG;%(PreprocessorDefinitions) + 0x0c07 + + + ..\..\bin\Win32-VisualStudio\08.SpecialFx.exe + ..\..\lib\Win32-visualstudio;%(AdditionalLibraryDirectories) + Console + + + + + + + .\Release/SpecialFX.tlb + + + + + MaxSpeed + OnlyExplicitInline + ..\..\include;%(AdditionalIncludeDirectories) + WIN32;WIN64;NDEBUG;_CONSOLE;%(PreprocessorDefinitions) + true + MultiThreaded + true + + + Level3 + + + NDEBUG;%(PreprocessorDefinitions) + 0x0c07 + + + ..\..\bin\Win64-VisualStudio\08.SpecialFx.exe + ..\..\lib\Win64-visualstudio;%(AdditionalLibraryDirectories) + Console + + + + + + + .\Debug/SpecialFX.tlb + + + + + Disabled + ..\..\include;%(AdditionalIncludeDirectories) + WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions) + EnableFastChecks + MultiThreadedDebug + + + Level3 + EditAndContinue + + + _DEBUG;%(PreprocessorDefinitions) + 0x0c07 + + + ..\..\bin\Win32-VisualStudio\08.SpecialFx.exe + ..\..\lib\Win32-visualstudio;%(AdditionalLibraryDirectories) + true + Console + + + + + + + .\Debug/SpecialFX.tlb + + + + + Disabled + ..\..\include;%(AdditionalIncludeDirectories) + WIN32;WIN64;_DEBUG;_CONSOLE;%(PreprocessorDefinitions) + EnableFastChecks + MultiThreadedDebug + + + Level3 + ProgramDatabase + + + _DEBUG;%(PreprocessorDefinitions) + 0x0c07 + + + ..\..\bin\Win64-VisualStudio\08.SpecialFx.exe + ..\..\lib\Win64-visualstudio;%(AdditionalLibraryDirectories) + true + Console + + + + + + + Disabled + Disabled + %(AdditionalIncludeDirectories) + %(AdditionalIncludeDirectories) + %(PreprocessorDefinitions) + %(PreprocessorDefinitions) + EnableFastChecks + EnableFastChecks + MaxSpeed + MaxSpeed + %(AdditionalIncludeDirectories) + %(AdditionalIncludeDirectories) + %(PreprocessorDefinitions) + %(PreprocessorDefinitions) + + + + + + \ No newline at end of file diff --git a/examples/08.SpecialFX/SpecialFX_vc8.vcproj b/examples/08.SpecialFX/SpecialFX_vc8.vcproj deleted file mode 100644 index 21dd96f0..00000000 --- a/examples/08.SpecialFX/SpecialFX_vc8.vcproj +++ /dev/null @@ -1,231 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/examples/08.SpecialFX/SpecialFX_vc9.vcproj b/examples/08.SpecialFX/SpecialFX_vc9.vcproj deleted file mode 100644 index 29763e5f..00000000 --- a/examples/08.SpecialFX/SpecialFX_vc9.vcproj +++ /dev/null @@ -1,230 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/examples/08.SpecialFX/ant.properties b/examples/08.SpecialFX/ant.properties deleted file mode 100644 index a51e6a08..00000000 --- a/examples/08.SpecialFX/ant.properties +++ /dev/null @@ -1,17 +0,0 @@ -# This file is used to override default values used by the Ant build system. -# -# This file must be checked into Version Control Systems, as it is -# integral to the build system of your project. - -# This file is only used by the Ant script. - -# You can use this to override default values such as -# 'source.dir' for the location of your java source folder and -# 'out.dir' for the location of your output folder. - -# You can also use it define how the release builds are signed by declaring -# the following properties: -# 'key.store' for the location of your keystore and -# 'key.alias' for the name of the key to use. -# The password will be asked during the build when you use the 'release' target. - diff --git a/examples/08.SpecialFX/jni/Application.mk b/examples/08.SpecialFX/jni/Application.mk deleted file mode 100644 index 3b68cfdd..00000000 --- a/examples/08.SpecialFX/jni/Application.mk +++ /dev/null @@ -1,2 +0,0 @@ -APP_MODULES := SFX -APP_PLATFORM :=android-9 diff --git a/examples/08.SpecialFX/main.cpp b/examples/08.SpecialFX/main.cpp index 1e5716d1..c2abaa61 100644 --- a/examples/08.SpecialFX/main.cpp +++ b/examples/08.SpecialFX/main.cpp @@ -13,14 +13,9 @@ runs slow on your hardware. */ #include -#ifndef _IRR_ANDROID_PLATFORM_ -# include -# include "driverChoice.h" -#else -# include "CAndroidAssetFileArchive.h" -# include -# include -#endif +#include +#include "driverChoice.h" +#include "exampleHelper.h" using namespace irr; @@ -28,17 +23,8 @@ using namespace irr; #pragma comment(lib, "Irrlicht.lib") #endif -#ifndef _IRR_ANDROID_PLATFORM_ int main() -#else -void android_main(struct android_app* app) -#endif { -#ifdef _IRR_ANDROID_PLATFORM_ - app_dummy(); - const bool shadows = false; - video::E_DRIVER_TYPE driverType=video::EDT_OGLES1; -#else // ask if user would like shadows char i; printf("Please press 'y' if you want to use realtime shadows.\n"); @@ -50,46 +36,25 @@ void android_main(struct android_app* app) // ask user for driver video::E_DRIVER_TYPE driverType=driverChoiceConsole(); if (driverType==video::EDT_COUNT) - { -#ifdef _IRR_ANDROID_PLATFORM_ - return; -#else return 1; -#endif - } -#endif + /* Create device and exit if creation failed. We make the stencil flag optional to avoid slow screen modes for runs without shadows. */ -#ifdef _IRR_ANDROID_PLATFORM_ - struct irr::SIrrlichtCreationParameters p; - p.DriverType = driverType; - // The android app object is needed by the irrlicht device. - p.PrivateData = app; - p.WindowSize = core::dimension2d(1280,800); - IrrlichtDevice *device = createDeviceEx(p); -#else IrrlichtDevice *device = createDevice(driverType, core::dimension2d(640, 480), - 16, false, shadows); -#endif - + 16, false, shadows); if (device == 0) - { -#ifdef _IRR_ANDROID_PLATFORM_ - return; -#else - return 1; // could not create selected driver. -#endif - } + return 1; // could not create selected driver. video::IVideoDriver* driver = device->getVideoDriver(); scene::ISceneManager* smgr = device->getSceneManager(); - scene::ISceneNode* node = 0; + + const io::path mediaPath = getExampleMediaPath(); /* For our environment, we load a .3ds file. It is a small room I modelled @@ -105,29 +70,15 @@ void android_main(struct android_app* app) off too with this code. */ -#ifdef _IRR_ANDROID_PLATFORM_ - scene::IAnimatedMesh* mesh = smgr->getMesh("media/room.3ds"); -#else - scene::IAnimatedMesh* mesh = smgr->getMesh("../../media/room.3ds"); -#endif + scene::IAnimatedMesh* mesh = smgr->getMesh(mediaPath + "room.3ds"); - if (mesh) - { - smgr->getMeshManipulator()->makePlanarTextureMapping(mesh->getMesh(0), 0.004f); + smgr->getMeshManipulator()->makePlanarTextureMapping(mesh->getMesh(0), 0.004f); - node = smgr->addAnimatedMeshSceneNode(mesh); - if (node) - { - ((scene::IAnimatedMeshSceneNode*)node)->addShadowVolumeSceneNode(); + scene::ISceneNode* node = 0; -#ifdef _IRR_ANDROID_PLATFORM_ - node->setMaterialTexture(0, driver->getTexture("media/wall.jpg")); -#else - node->setMaterialTexture(0, driver->getTexture("../../media/wall.jpg")); -#endif - node->getMaterial(0).SpecularColor.set(0,0,0,0); - } - } + node = smgr->addAnimatedMeshSceneNode(mesh); + node->setMaterialTexture(0, driver->getTexture(mediaPath + "wall.jpg")); + node->getMaterial(0).SpecularColor.set(0,0,0,0); /* Now, for the first special effect: Animated water. It works like this: @@ -140,30 +91,19 @@ void android_main(struct android_app* app) want to. */ - mesh = 0;//smgr->addHillPlaneMesh( "myHill", -// core::dimension2d(20,20), -// core::dimension2d(40,40), 0, 0, -// core::dimension2d(0,0), -// core::dimension2d(10,10)); + mesh = smgr->addHillPlaneMesh( "myHill", + core::dimension2d(20,20), + core::dimension2d(40,40), 0, 0, + core::dimension2d(0,0), + core::dimension2d(10,10)); - if (mesh) - { - node = smgr->addWaterSurfaceSceneNode(mesh->getMesh(0), 3.0f, 300.0f, 30.0f); - if (node) - { - node->setPosition(core::vector3df(0,7,0)); + node = smgr->addWaterSurfaceSceneNode(mesh->getMesh(0), 3.0f, 300.0f, 30.0f); + node->setPosition(core::vector3df(0,7,0)); -#ifdef _IRR_ANDROID_PLATFORM_ - node->setMaterialTexture(0, driver->getTexture("media/stones.jpg")); - node->setMaterialTexture(1, driver->getTexture("media/water.jpg")); -#else - node->setMaterialTexture(0, driver->getTexture("../../media/stones.jpg")); - node->setMaterialTexture(1, driver->getTexture("../../media/water.jpg")); -#endif + node->setMaterialTexture(0, driver->getTexture(mediaPath + "stones.jpg")); + node->setMaterialTexture(1, driver->getTexture(mediaPath + "water.jpg")); - node->setMaterialType(video::EMT_REFLECTION_2_LAYER); - } - } + node->setMaterialType(video::EMT_REFLECTION_2_LAYER); /* The second special effect is very basic, I bet you saw it already in @@ -176,70 +116,17 @@ void android_main(struct android_app* app) node = smgr->addLightSceneNode(0, core::vector3df(0,0,0), video::SColorf(1.0f, 0.6f, 0.7f, 1.0f), 800.0f); - if (node) - { - scene::ISceneNodeAnimator* anim = 0; - anim = smgr->createFlyCircleAnimator (core::vector3df(0,150,0),250.0f); - node->addAnimator(anim); - anim->drop(); - } + scene::ISceneNodeAnimator* anim = 0; + anim = smgr->createFlyCircleAnimator (core::vector3df(0,150,0),250.0f); + node->addAnimator(anim); + anim->drop(); // attach billboard to light node = smgr->addBillboardSceneNode(node, core::dimension2d(50, 50)); - if (node) - { - node->setMaterialFlag(video::EMF_LIGHTING, false); - node->setMaterialType(video::EMT_TRANSPARENT_ADD_COLOR); -#ifdef _IRR_ANDROID_PLATFORM_ - node->setMaterialTexture(0, driver->getTexture("media/particlewhite.bmp")); -#else - node->setMaterialTexture(0, driver->getTexture("../../media/particlewhite.bmp")); -#endif - } - - /* - Next we add a volumetric light node, which adds a glowing fake area light to - the scene. Like with the billboards and particle systems we also assign a - texture for the desired effect, though this time we'll use a texture animator - to create the illusion of a magical glowing area effect. - */ - scene::IVolumeLightSceneNode * n = smgr->addVolumeLightSceneNode(0, -1, - 32, // Subdivisions on U axis - 32, // Subdivisions on V axis - video::SColor(0, 255, 255, 255), // foot color - video::SColor(0, 0, 0, 0)); // tail color - - if (n) - { - n->setScale(core::vector3df(56.0f, 56.0f, 56.0f)); - n->setPosition(core::vector3df(-120,50,40)); - - // load textures for animation - core::array textures; - for (s32 g=7; g > 0; --g) - { - core::stringc tmp; -#ifdef _IRR_ANDROID_PLATFORM_ - tmp = "media/portal"; -#else - tmp = "../../media/portal"; -#endif - tmp += g; - tmp += ".bmp"; - video::ITexture* t = driver->getTexture( tmp.c_str() ); - textures.push_back(t); - } - - // create texture animator - scene::ISceneNodeAnimator* glow = smgr->createTextureAnimator(textures, 150); - - // add the animator - n->addAnimator(glow); - - // drop the animator because it was created with a create() function - glow->drop(); - } + node->setMaterialFlag(video::EMF_LIGHTING, false); + node->setMaterialType(video::EMT_TRANSPARENT_ADD_COLOR); + node->setMaterialTexture(0, driver->getTexture(mediaPath + "particlewhite.bmp")); /* The next special effect is a lot more interesting: A particle system. @@ -278,7 +165,7 @@ void android_main(struct android_app* app) // create a particle system - scene::IParticleSystemSceneNode* ps = + scene::IParticleSystemSceneNode* ps = smgr->addParticleSystemSceneNode(false); if (ps) @@ -305,10 +192,49 @@ void android_main(struct android_app* app) ps->setScale(core::vector3df(2,2,2)); ps->setMaterialFlag(video::EMF_LIGHTING, false); ps->setMaterialFlag(video::EMF_ZWRITE_ENABLE, false); - ps->setMaterialTexture(0, driver->getTexture("../../media/fire.bmp")); + ps->setMaterialTexture(0, driver->getTexture(mediaPath + "fire.bmp")); ps->setMaterialType(video::EMT_TRANSPARENT_ADD_COLOR); } + /* + Next we add a volumetric light node, which adds a glowing fake area light to + the scene. Like with the billboards and particle systems we also assign a + texture for the desired effect, though this time we'll use a texture animator + to create the illusion of a magical glowing area effect. + */ + scene::IVolumeLightSceneNode * n = smgr->addVolumeLightSceneNode(0, -1, + 32, // Subdivisions on U axis + 32, // Subdivisions on V axis + video::SColor(0, 255, 255, 255), // foot color + video::SColor(0, 0, 0, 0)); // tail color + + if (n) + { + n->setScale(core::vector3df(56.0f, 56.0f, 56.0f)); + n->setPosition(core::vector3df(-120,50,40)); + + // load textures for animation + core::array textures; + for (s32 g=7; g > 0; --g) + { + core::stringc tmp(mediaPath); + tmp += "portal"; + tmp += g; + tmp += ".bmp"; + video::ITexture* t = driver->getTexture( tmp.c_str() ); + textures.push_back(t); + } + + // create texture animator + scene::ISceneNodeAnimator* glow = smgr->createTextureAnimator(textures, 150); + + // add the animator + n->addAnimator(glow); + + // drop the animator because it was created with a create() function + glow->drop(); + } + /* As our last special effect, we want a dynamic shadow be casted from an animated character. For this we load a DirectX .x model and place it @@ -327,11 +253,7 @@ void android_main(struct android_app* app) // add animated character -#ifdef _IRR_ANDROID_PLATFORM_ - mesh = smgr->getMesh("media/dwarf.x"); -#else - mesh = smgr->getMesh("../../media/dwarf.x"); -#endif + mesh = smgr->getMesh(mediaPath + "dwarf.x"); scene::IAnimatedMeshSceneNode* anode = 0; anode = smgr->addAnimatedMeshSceneNode(mesh); @@ -363,7 +285,7 @@ void android_main(struct android_app* app) while(device->run()) if (device->isWindowActive()) { - driver->beginScene(true, true, 0); + driver->beginScene(video::ECBF_COLOR | video::ECBF_DEPTH, video::SColor(0)); smgr->drawAll(); @@ -385,12 +307,7 @@ void android_main(struct android_app* app) device->drop(); -#ifdef _IRR_ANDROID_PLATFORM_ - return; -#else - return 0; -#endif - + return 0; } /* diff --git a/examples/09.Meshviewer/MeshViewer.dev b/examples/09.Meshviewer/MeshViewer.dev deleted file mode 100644 index 47416a14..00000000 --- a/examples/09.Meshviewer/MeshViewer.dev +++ /dev/null @@ -1,59 +0,0 @@ -[Project] -FileName=example.dev -Name=Irrlicht Example 09 Mesh Viewer -UnitCount=1 -Type=1 -Ver=1 -ObjFiles= -Includes=..\..\include -Libs= -PrivateResource= -ResourceIncludes= -MakeIncludes= -Compiler= -CppCompiler= -Linker=../../lib/Win32-gcc/libIrrlicht.a_@@_ -IsCpp=1 -Icon= -ExeOutput=../../bin/Win32-gcc -ObjectOutput=obj -OverrideOutput=1 -OverrideOutputName=09.MeshViewer.exe -HostApplication= -Folders= -CommandLine= -IncludeVersionInfo=0 -SupportXPThemes=0 -CompilerSet=0 -CompilerSettings=0000000000000000000000 -UseCustomMakefile=0 -CustomMakefile= - -[Unit1] -FileName=main.cpp -CompileCpp=1 -Folder=Projekt1 -Compile=1 -Link=1 -Priority=1000 -OverrideBuildCmd=0 -BuildCmd= - -[VersionInfo] -Major=0 -Minor=1 -Release=1 -Build=1 -LanguageID=1033 -CharsetID=1252 -CompanyName= -FileVersion= -FileDescription=Irrlicht Engine example compiled using DevCpp and gcc -InternalName= -LegalCopyright= -LegalTrademarks= -OriginalFilename= -ProductName= -ProductVersion= -AutoIncBuildNr=0 - diff --git a/examples/09.Meshviewer/Meshviewer_vc10.vcxproj b/examples/09.Meshviewer/Meshviewer_vc10.vcxproj index c9e9e970..eb918ccd 100644 --- a/examples/09.Meshviewer/Meshviewer_vc10.vcxproj +++ b/examples/09.Meshviewer/Meshviewer_vc10.vcxproj @@ -28,21 +28,25 @@ Application false MultiByte + Windows7.1SDK Application false MultiByte + Windows7.1SDK Application false MultiByte + Windows7.1SDK Application false MultiByte + Windows7.1SDK diff --git a/examples/09.Meshviewer/Meshviewer_vc11.vcxproj b/examples/09.Meshviewer/Meshviewer_vc11.vcxproj index 24ffe1e3..eb918ccd 100644 --- a/examples/09.Meshviewer/Meshviewer_vc11.vcxproj +++ b/examples/09.Meshviewer/Meshviewer_vc11.vcxproj @@ -28,25 +28,25 @@ Application false MultiByte - v110 + Windows7.1SDK Application false MultiByte - v110 + Windows7.1SDK Application false MultiByte - v110 + Windows7.1SDK Application false MultiByte - v110 + Windows7.1SDK diff --git a/examples/09.Meshviewer/Meshviewer_vc12.vcxproj b/examples/09.Meshviewer/Meshviewer_vc12.vcxproj new file mode 100644 index 00000000..effddf22 --- /dev/null +++ b/examples/09.Meshviewer/Meshviewer_vc12.vcxproj @@ -0,0 +1,235 @@ + + + + + Debug + Win32 + + + Debug + x64 + + + Release + Win32 + + + Release + x64 + + + + 09.Meshviewer + {2AE24484-22FC-481B-9A40-7CD0DA5C8E06} + Meshviewer + + + + Application + false + MultiByte + Windows7.1SDK + + + Application + false + MultiByte + Windows7.1SDK + + + Application + false + MultiByte + Windows7.1SDK + + + Application + false + MultiByte + Windows7.1SDK + + + + + + + + + + + + + + + + + + + + + + + <_ProjectFileVersion>10.0.30319.1 + ..\..\bin\Win32-VisualStudio\ + ..\..\bin\Win64-VisualStudio\ + + + ..\..\bin\Win32-VisualStudio\ + ..\..\bin\Win64-VisualStudio\ + + + AllRules.ruleset + AllRules.ruleset + + + + + AllRules.ruleset + AllRules.ruleset + + + + + + + + .\Release/Meshviewer.tlb + + + + + MaxSpeed + OnlyExplicitInline + ..\..\include;%(AdditionalIncludeDirectories) + WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions) + true + MultiThreaded + true + + + Level3 + + + NDEBUG;%(PreprocessorDefinitions) + 0x0c07 + + + ..\..\bin\Win32-VisualStudio\09.MeshViewer.exe + ..\..\lib\Win32-visualstudio;%(AdditionalLibraryDirectories) + Console + + + + + + + .\Release/Meshviewer.tlb + + + + + MaxSpeed + OnlyExplicitInline + ..\..\include;%(AdditionalIncludeDirectories) + WIN32;WIN64;NDEBUG;_CONSOLE;%(PreprocessorDefinitions) + true + MultiThreaded + true + + + Level3 + + + NDEBUG;%(PreprocessorDefinitions) + 0x0c07 + + + ..\..\bin\Win64-VisualStudio\09.MeshViewer.exe + ..\..\lib\Win64-visualstudio;%(AdditionalLibraryDirectories) + Console + + + + + + + .\Debug/Meshviewer.tlb + + + + + Disabled + ..\..\include;%(AdditionalIncludeDirectories) + WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions) + EnableFastChecks + MultiThreadedDebug + + + Level3 + EditAndContinue + + + _DEBUG;%(PreprocessorDefinitions) + 0x0c07 + + + ..\..\bin\Win32-VisualStudio\09.MeshViewer.exe + ..\..\lib\Win32-visualstudio;%(AdditionalLibraryDirectories) + true + Console + + + + + + + .\Debug/Meshviewer.tlb + + + + + Disabled + ..\..\include;%(AdditionalIncludeDirectories) + WIN32;WIN64;_DEBUG;_CONSOLE;%(PreprocessorDefinitions) + EnableFastChecks + MultiThreadedDebug + + + Level3 + ProgramDatabase + + + _DEBUG;%(PreprocessorDefinitions) + 0x0c07 + + + ..\..\bin\Win64-VisualStudio\09.MeshViewer.exe + ..\..\lib\Win64-visualstudio;%(AdditionalLibraryDirectories) + true + Console + + + + + + + Disabled + Disabled + %(AdditionalIncludeDirectories) + %(AdditionalIncludeDirectories) + %(PreprocessorDefinitions) + %(PreprocessorDefinitions) + EnableFastChecks + EnableFastChecks + MaxSpeed + MaxSpeed + %(AdditionalIncludeDirectories) + %(AdditionalIncludeDirectories) + %(PreprocessorDefinitions) + %(PreprocessorDefinitions) + + + + + + \ No newline at end of file diff --git a/examples/09.Meshviewer/Meshviewer_vc14.vcxproj b/examples/09.Meshviewer/Meshviewer_vc14.vcxproj new file mode 100644 index 00000000..f96053dd --- /dev/null +++ b/examples/09.Meshviewer/Meshviewer_vc14.vcxproj @@ -0,0 +1,235 @@ + + + + + Debug + Win32 + + + Debug + x64 + + + Release + Win32 + + + Release + x64 + + + + 09.Meshviewer + {2AE24484-22FC-481B-9A40-7CD0DA5C8E06} + Meshviewer + + + + Application + false + MultiByte + v140 + + + Application + false + MultiByte + v140 + + + Application + false + MultiByte + v140 + + + Application + false + MultiByte + v140 + + + + + + + + + + + + + + + + + + + + + + + <_ProjectFileVersion>10.0.30319.1 + ..\..\bin\Win32-VisualStudio\ + ..\..\bin\Win64-VisualStudio\ + + + ..\..\bin\Win32-VisualStudio\ + ..\..\bin\Win64-VisualStudio\ + + + AllRules.ruleset + AllRules.ruleset + + + + + AllRules.ruleset + AllRules.ruleset + + + + + + + + .\Release/Meshviewer.tlb + + + + + MaxSpeed + OnlyExplicitInline + ..\..\include;%(AdditionalIncludeDirectories) + WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions) + true + MultiThreaded + true + + + Level3 + + + NDEBUG;%(PreprocessorDefinitions) + 0x0c07 + + + ..\..\bin\Win32-VisualStudio\09.MeshViewer.exe + ..\..\lib\Win32-visualstudio;%(AdditionalLibraryDirectories) + Console + + + + + + + .\Release/Meshviewer.tlb + + + + + MaxSpeed + OnlyExplicitInline + ..\..\include;%(AdditionalIncludeDirectories) + WIN32;WIN64;NDEBUG;_CONSOLE;%(PreprocessorDefinitions) + true + MultiThreaded + true + + + Level3 + + + NDEBUG;%(PreprocessorDefinitions) + 0x0c07 + + + ..\..\bin\Win64-VisualStudio\09.MeshViewer.exe + ..\..\lib\Win64-visualstudio;%(AdditionalLibraryDirectories) + Console + + + + + + + .\Debug/Meshviewer.tlb + + + + + Disabled + ..\..\include;%(AdditionalIncludeDirectories) + WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions) + EnableFastChecks + MultiThreadedDebug + + + Level3 + EditAndContinue + + + _DEBUG;%(PreprocessorDefinitions) + 0x0c07 + + + ..\..\bin\Win32-VisualStudio\09.MeshViewer.exe + ..\..\lib\Win32-visualstudio;%(AdditionalLibraryDirectories) + true + Console + + + + + + + .\Debug/Meshviewer.tlb + + + + + Disabled + ..\..\include;%(AdditionalIncludeDirectories) + WIN32;WIN64;_DEBUG;_CONSOLE;%(PreprocessorDefinitions) + EnableFastChecks + MultiThreadedDebug + + + Level3 + ProgramDatabase + + + _DEBUG;%(PreprocessorDefinitions) + 0x0c07 + + + ..\..\bin\Win64-VisualStudio\09.MeshViewer.exe + ..\..\lib\Win64-visualstudio;%(AdditionalLibraryDirectories) + true + Console + + + + + + + Disabled + Disabled + %(AdditionalIncludeDirectories) + %(AdditionalIncludeDirectories) + %(PreprocessorDefinitions) + %(PreprocessorDefinitions) + EnableFastChecks + EnableFastChecks + MaxSpeed + MaxSpeed + %(AdditionalIncludeDirectories) + %(AdditionalIncludeDirectories) + %(PreprocessorDefinitions) + %(PreprocessorDefinitions) + + + + + + \ No newline at end of file diff --git a/examples/09.Meshviewer/Meshviewer_vc8.vcproj b/examples/09.Meshviewer/Meshviewer_vc8.vcproj deleted file mode 100644 index 03467710..00000000 --- a/examples/09.Meshviewer/Meshviewer_vc8.vcproj +++ /dev/null @@ -1,231 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/examples/09.Meshviewer/Meshviewer_vc9.vcproj b/examples/09.Meshviewer/Meshviewer_vc9.vcproj deleted file mode 100644 index f6a80386..00000000 --- a/examples/09.Meshviewer/Meshviewer_vc9.vcproj +++ /dev/null @@ -1,230 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/examples/09.Meshviewer/main.cpp b/examples/09.Meshviewer/main.cpp index b9dc5502..559646e7 100644 --- a/examples/09.Meshviewer/main.cpp +++ b/examples/09.Meshviewer/main.cpp @@ -15,6 +15,7 @@ tutorial, we use a lot stuff from the gui namespace. */ #include #include "driverChoice.h" +#include "exampleHelper.h" using namespace irr; using namespace gui; @@ -239,7 +240,6 @@ void loadModel(const c8* fn) else { scene::IAnimatedMeshSceneNode* animModel = Device->getSceneManager()->addAnimatedMeshSceneNode(m); - animModel->setAnimationSpeed(30); Model = animModel; } Model->setMaterialFlag(video::EMF_LIGHTING, UseLight); @@ -756,7 +756,7 @@ int main(int argc, char* argv[]) video::SColorf(1.0f,1.0f,1.0f),2000); smgr->setAmbientLight(video::SColorf(0.3f,0.3f,0.3f)); // add our media directory as "search path" - Device->getFileSystem()->addFileArchive("../../media/"); + Device->getFileSystem()->addFileArchive(getExampleMediaPath()); /* The next step is to read the configuration file. It is stored in the xml @@ -997,7 +997,7 @@ int main(int argc, char* argv[]) if (Device->isWindowActive()) { - driver->beginScene(true, true, video::SColor(150,50,50,50)); + driver->beginScene(video::ECBF_COLOR | video::ECBF_DEPTH, video::SColor(150,50,50,50)); smgr->drawAll(); env->drawAll(); diff --git a/examples/10.Shaders/Shaders.dev b/examples/10.Shaders/Shaders.dev deleted file mode 100644 index bcaa4f88..00000000 --- a/examples/10.Shaders/Shaders.dev +++ /dev/null @@ -1,59 +0,0 @@ -[Project] -FileName=example.dev -Name=Irrlicht Example 10 Shaders -UnitCount=1 -Type=1 -Ver=1 -ObjFiles= -Includes=..\..\include -Libs= -PrivateResource= -ResourceIncludes= -MakeIncludes= -Compiler= -CppCompiler= -Linker=../../lib/Win32-gcc/libIrrlicht.a_@@_ -IsCpp=1 -Icon= -ExeOutput=../../bin/Win32-gcc -ObjectOutput=obj -OverrideOutput=1 -OverrideOutputName=10.Shaders.exe -HostApplication= -Folders= -CommandLine= -IncludeVersionInfo=0 -SupportXPThemes=0 -CompilerSet=0 -CompilerSettings=0000000000000000000000 -UseCustomMakefile=0 -CustomMakefile= - -[Unit1] -FileName=main.cpp -CompileCpp=1 -Folder=Projekt1 -Compile=1 -Link=1 -Priority=1000 -OverrideBuildCmd=0 -BuildCmd= - -[VersionInfo] -Major=0 -Minor=1 -Release=1 -Build=1 -LanguageID=1033 -CharsetID=1252 -CompanyName= -FileVersion= -FileDescription=Irrlicht Engine example compiled using DevCpp and gcc -InternalName= -LegalCopyright= -LegalTrademarks= -OriginalFilename= -ProductName= -ProductVersion= -AutoIncBuildNr=0 - diff --git a/examples/10.Shaders/Shaders_vc10.vcxproj b/examples/10.Shaders/Shaders_vc10.vcxproj index c2a526e6..55e1e888 100644 --- a/examples/10.Shaders/Shaders_vc10.vcxproj +++ b/examples/10.Shaders/Shaders_vc10.vcxproj @@ -28,21 +28,25 @@ Application false MultiByte + Windows7.1SDK Application false MultiByte + Windows7.1SDK Application false MultiByte + Windows7.1SDK Application false MultiByte + Windows7.1SDK diff --git a/examples/10.Shaders/Shaders_vc11.vcxproj b/examples/10.Shaders/Shaders_vc11.vcxproj index 30ae6427..55e1e888 100644 --- a/examples/10.Shaders/Shaders_vc11.vcxproj +++ b/examples/10.Shaders/Shaders_vc11.vcxproj @@ -28,25 +28,25 @@ Application false MultiByte - v110 + Windows7.1SDK Application false MultiByte - v110 + Windows7.1SDK Application false MultiByte - v110 + Windows7.1SDK Application false MultiByte - v110 + Windows7.1SDK diff --git a/examples/10.Shaders/Shaders_vc12.vcxproj b/examples/10.Shaders/Shaders_vc12.vcxproj new file mode 100644 index 00000000..b7dedf0a --- /dev/null +++ b/examples/10.Shaders/Shaders_vc12.vcxproj @@ -0,0 +1,235 @@ + + + + + Debug + Win32 + + + Debug + x64 + + + Release + Win32 + + + Release + x64 + + + + 10.Shaders + {27158C82-CD15-4A9B-9848-35E7065B209F} + Shaders + + + + Application + false + MultiByte + Windows7.1SDK + + + Application + false + MultiByte + Windows7.1SDK + + + Application + false + MultiByte + Windows7.1SDK + + + Application + false + MultiByte + Windows7.1SDK + + + + + + + + + + + + + + + + + + + + + + + <_ProjectFileVersion>10.0.30319.1 + ..\..\bin\Win32-VisualStudio\ + ..\..\bin\Win64-VisualStudio\ + + + ..\..\bin\Win32-VisualStudio\ + ..\..\bin\Win64-VisualStudio\ + + + AllRules.ruleset + AllRules.ruleset + + + + + AllRules.ruleset + AllRules.ruleset + + + + + + + + .\Debug/Shaders.tlb + + + + + Disabled + ..\..\include;%(AdditionalIncludeDirectories) + WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions) + EnableFastChecks + MultiThreadedDebug + + + Level3 + EditAndContinue + + + _DEBUG;%(PreprocessorDefinitions) + 0x0c07 + + + ..\..\bin\Win32-VisualStudio\10.Shaders.exe + ..\..\lib\Win32-visualstudio;%(AdditionalLibraryDirectories) + true + Console + + + + + + + .\Debug/Shaders.tlb + + + + + Disabled + ..\..\include;%(AdditionalIncludeDirectories) + WIN32;WIN64;_DEBUG;_CONSOLE;%(PreprocessorDefinitions) + EnableFastChecks + MultiThreadedDebug + + + Level3 + ProgramDatabase + + + _DEBUG;%(PreprocessorDefinitions) + 0x0c07 + + + ..\..\bin\Win64-VisualStudio\10.Shaders.exe + ..\..\lib\Win64-visualstudio;%(AdditionalLibraryDirectories) + true + Console + + + + + + + .\Release/Shaders.tlb + + + + + MaxSpeed + OnlyExplicitInline + ..\..\include;%(AdditionalIncludeDirectories) + WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions) + true + MultiThreaded + true + + + Level3 + + + NDEBUG;%(PreprocessorDefinitions) + 0x0c07 + + + ..\..\bin\Win32-VisualStudio\10.Shaders.exe + ..\..\lib\Win32-visualstudio;%(AdditionalLibraryDirectories) + Console + + + + + + + .\Release/Shaders.tlb + + + + + MaxSpeed + OnlyExplicitInline + ..\..\include;%(AdditionalIncludeDirectories) + WIN32;WIN64;NDEBUG;_CONSOLE;%(PreprocessorDefinitions) + true + MultiThreaded + true + + + Level3 + + + NDEBUG;%(PreprocessorDefinitions) + 0x0c07 + + + ..\..\bin\Win64-VisualStudio\10.Shaders.exe + ..\..\lib\Win64-visualstudio;%(AdditionalLibraryDirectories) + Console + + + + + + + Disabled + Disabled + %(AdditionalIncludeDirectories) + %(AdditionalIncludeDirectories) + %(PreprocessorDefinitions) + %(PreprocessorDefinitions) + EnableFastChecks + EnableFastChecks + MaxSpeed + MaxSpeed + %(AdditionalIncludeDirectories) + %(AdditionalIncludeDirectories) + %(PreprocessorDefinitions) + %(PreprocessorDefinitions) + + + + + + \ No newline at end of file diff --git a/examples/10.Shaders/Shaders_vc14.vcxproj b/examples/10.Shaders/Shaders_vc14.vcxproj new file mode 100644 index 00000000..dfc7ff69 --- /dev/null +++ b/examples/10.Shaders/Shaders_vc14.vcxproj @@ -0,0 +1,235 @@ + + + + + Debug + Win32 + + + Debug + x64 + + + Release + Win32 + + + Release + x64 + + + + 10.Shaders + {27158C82-CD15-4A9B-9848-35E7065B209F} + Shaders + + + + Application + false + MultiByte + v140 + + + Application + false + MultiByte + v140 + + + Application + false + MultiByte + v140 + + + Application + false + MultiByte + v140 + + + + + + + + + + + + + + + + + + + + + + + <_ProjectFileVersion>10.0.30319.1 + ..\..\bin\Win32-VisualStudio\ + ..\..\bin\Win64-VisualStudio\ + + + ..\..\bin\Win32-VisualStudio\ + ..\..\bin\Win64-VisualStudio\ + + + AllRules.ruleset + AllRules.ruleset + + + + + AllRules.ruleset + AllRules.ruleset + + + + + + + + .\Debug/Shaders.tlb + + + + + Disabled + ..\..\include;%(AdditionalIncludeDirectories) + WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions) + EnableFastChecks + MultiThreadedDebug + + + Level3 + EditAndContinue + + + _DEBUG;%(PreprocessorDefinitions) + 0x0c07 + + + ..\..\bin\Win32-VisualStudio\10.Shaders.exe + ..\..\lib\Win32-visualstudio;%(AdditionalLibraryDirectories) + true + Console + + + + + + + .\Debug/Shaders.tlb + + + + + Disabled + ..\..\include;%(AdditionalIncludeDirectories) + WIN32;WIN64;_DEBUG;_CONSOLE;%(PreprocessorDefinitions) + EnableFastChecks + MultiThreadedDebug + + + Level3 + ProgramDatabase + + + _DEBUG;%(PreprocessorDefinitions) + 0x0c07 + + + ..\..\bin\Win64-VisualStudio\10.Shaders.exe + ..\..\lib\Win64-visualstudio;%(AdditionalLibraryDirectories) + true + Console + + + + + + + .\Release/Shaders.tlb + + + + + MaxSpeed + OnlyExplicitInline + ..\..\include;%(AdditionalIncludeDirectories) + WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions) + true + MultiThreaded + true + + + Level3 + + + NDEBUG;%(PreprocessorDefinitions) + 0x0c07 + + + ..\..\bin\Win32-VisualStudio\10.Shaders.exe + ..\..\lib\Win32-visualstudio;%(AdditionalLibraryDirectories) + Console + + + + + + + .\Release/Shaders.tlb + + + + + MaxSpeed + OnlyExplicitInline + ..\..\include;%(AdditionalIncludeDirectories) + WIN32;WIN64;NDEBUG;_CONSOLE;%(PreprocessorDefinitions) + true + MultiThreaded + true + + + Level3 + + + NDEBUG;%(PreprocessorDefinitions) + 0x0c07 + + + ..\..\bin\Win64-VisualStudio\10.Shaders.exe + ..\..\lib\Win64-visualstudio;%(AdditionalLibraryDirectories) + Console + + + + + + + Disabled + Disabled + %(AdditionalIncludeDirectories) + %(AdditionalIncludeDirectories) + %(PreprocessorDefinitions) + %(PreprocessorDefinitions) + EnableFastChecks + EnableFastChecks + MaxSpeed + MaxSpeed + %(AdditionalIncludeDirectories) + %(AdditionalIncludeDirectories) + %(PreprocessorDefinitions) + %(PreprocessorDefinitions) + + + + + + \ No newline at end of file diff --git a/examples/10.Shaders/Shaders_vc8.vcproj b/examples/10.Shaders/Shaders_vc8.vcproj deleted file mode 100644 index f107140c..00000000 --- a/examples/10.Shaders/Shaders_vc8.vcproj +++ /dev/null @@ -1,231 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/examples/10.Shaders/Shaders_vc9.vcproj b/examples/10.Shaders/Shaders_vc9.vcproj deleted file mode 100644 index d870b03e..00000000 --- a/examples/10.Shaders/Shaders_vc9.vcproj +++ /dev/null @@ -1,230 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/examples/10.Shaders/main.cpp b/examples/10.Shaders/main.cpp index 7bee49fa..779ef1ba 100644 --- a/examples/10.Shaders/main.cpp +++ b/examples/10.Shaders/main.cpp @@ -1,12 +1,12 @@ /** Example 010 Shaders -This tutorial shows how to use shaders for D3D8, D3D9, OpenGL, and Cg with the +This tutorial shows how to use shaders for D3D9, and OpenGL with the engine and how to create new material types with them. It also shows how to disable the generation of mipmaps at texture loading, and how to use text scene nodes. This tutorial does not explain how shaders work. I would recommend to read the -D3D, OpenGL, or Cg documentation, to search a tutorial, or to read a book about +D3D or OpenGL, documentation, to search a tutorial, or to read a book about this. At first, we need to include all headers and do the stuff we always do, like in @@ -15,6 +15,7 @@ nearly all other tutorials: #include #include #include "driverChoice.h" +#include "exampleHelper.h" using namespace irr; @@ -42,7 +43,6 @@ the variable name as parameter instead of the register index. IrrlichtDevice* device = 0; bool UseHighLevelShaders = false; -bool UseCgShaders = false; class MyShaderCallBack : public video::IShaderConstantSetCallBack { @@ -169,10 +169,6 @@ int main() if (i == 'y') { UseHighLevelShaders = true; - printf("Please press 'y' if you want to use Cg shaders.\n"); - std::cin >> i; - if (i == 'y') - UseCgShaders = true; } } @@ -188,16 +184,18 @@ int main() scene::ISceneManager* smgr = device->getSceneManager(); gui::IGUIEnvironment* gui = device->getGUIEnvironment(); + const io::path mediaPath = getExampleMediaPath(); + /* Now for the more interesting parts. If we are using Direct3D, we want to load vertex and pixel shader programs, if we have OpenGL, we want to use ARB fragment and vertex programs. I wrote the corresponding - programs down into the files d3d8.ps, d3d8.vs, d3d9.ps, d3d9.vs, - opengl.ps and opengl.vs. We only need the right filenames now. This is - done in the following switch. Note, that it is not necessary to write - the shaders into text files, like in this example. You can even write - the shaders directly as strings into the cpp source file, and use later - addShaderMaterial() instead of addShaderMaterialFromFiles(). + programs down into the files d3d9.ps, d3d9.vs, opengl.ps and opengl.vs. + We only need the right filenames now. This is done in the following switch. + Note, that it is not necessary to write the shaders into text files, + like in this example. You can even write the shaders directly as strings + into the cpp source file, and use later addShaderMaterial() instead of + addShaderMaterialFromFiles(). */ io::path vsFileName; // filename for the vertex shader @@ -205,21 +203,16 @@ int main() switch(driverType) { - case video::EDT_DIRECT3D8: - psFileName = "../../media/d3d8.psh"; - vsFileName = "../../media/d3d8.vsh"; - break; case video::EDT_DIRECT3D9: if (UseHighLevelShaders) { - // Cg can also handle this syntax - psFileName = "../../media/d3d9.hlsl"; + psFileName = mediaPath + "d3d9.hlsl"; vsFileName = psFileName; // both shaders are in the same file } else { - psFileName = "../../media/d3d9.psh"; - vsFileName = "../../media/d3d9.vsh"; + psFileName = mediaPath + "d3d9.psh"; + vsFileName = mediaPath + "d3d9.vsh"; } break; @@ -234,22 +227,13 @@ int main() case video::EDT_OPENGL: if (UseHighLevelShaders) { - if (!UseCgShaders) - { - psFileName = "../../media/opengl.frag"; - vsFileName = "../../media/opengl.vert"; - } - else - { - // Use HLSL syntax for Cg - psFileName = "../../media/d3d9.hlsl"; - vsFileName = psFileName; // both shaders are in the same file - } + psFileName = mediaPath + "opengl.frag"; + vsFileName = mediaPath + "opengl.vert"; } else { - psFileName = "../../media/opengl.psh"; - vsFileName = "../../media/opengl.vsh"; + psFileName = mediaPath + "opengl.psh"; + vsFileName = mediaPath + "opengl.vsh"; } break; } @@ -322,12 +306,10 @@ int main() if (UseHighLevelShaders) { // Choose the desired shader type. Default is the native - // shader type for the driver, for Cg pass the special - // enum value EGSL_CG - const video::E_GPU_SHADING_LANGUAGE shadingLanguage = - UseCgShaders ? video::EGSL_CG:video::EGSL_DEFAULT; + // shader type for the driver + const video::E_GPU_SHADING_LANGUAGE shadingLanguage = video::EGSL_DEFAULT; - // create material from high level shaders (hlsl, glsl or cg) + // create material from high level shaders (hlsl, glsl) newMaterialType1 = gpu->addHighLevelShaderMaterialFromFiles( vsFileName, "vertexMain", video::EVST_VS_1_1, @@ -364,7 +346,7 @@ int main() scene::ISceneNode* node = smgr->addCubeSceneNode(50); node->setPosition(core::vector3df(0,0,0)); - node->setMaterialTexture(0, driver->getTexture("../../media/wall.bmp")); + node->setMaterialTexture(0, driver->getTexture(mediaPath + "wall.bmp")); node->setMaterialFlag(video::EMF_LIGHTING, false); node->setMaterialType((video::E_MATERIAL_TYPE)newMaterialType1); @@ -385,7 +367,7 @@ int main() node = smgr->addCubeSceneNode(50); node->setPosition(core::vector3df(0,-10,50)); - node->setMaterialTexture(0, driver->getTexture("../../media/wall.bmp")); + node->setMaterialTexture(0, driver->getTexture(mediaPath + "wall.bmp")); node->setMaterialFlag(video::EMF_LIGHTING, false); node->setMaterialFlag(video::EMF_BLEND_OPERATION, true); node->setMaterialType((video::E_MATERIAL_TYPE)newMaterialType2); @@ -407,7 +389,7 @@ int main() node = smgr->addCubeSceneNode(50); node->setPosition(core::vector3df(0,50,25)); - node->setMaterialTexture(0, driver->getTexture("../../media/wall.bmp")); + node->setMaterialTexture(0, driver->getTexture(mediaPath + "wall.bmp")); node->setMaterialFlag(video::EMF_LIGHTING, false); smgr->addTextSceneNode(gui->getBuiltInFont(), L"NO SHADER", video::SColor(255,255,255,255), node); @@ -423,12 +405,12 @@ int main() driver->setTextureCreationFlag(video::ETCF_CREATE_MIP_MAPS, false); smgr->addSkyBoxSceneNode( - driver->getTexture("../../media/irrlicht2_up.jpg"), - driver->getTexture("../../media/irrlicht2_dn.jpg"), - driver->getTexture("../../media/irrlicht2_lf.jpg"), - driver->getTexture("../../media/irrlicht2_rt.jpg"), - driver->getTexture("../../media/irrlicht2_ft.jpg"), - driver->getTexture("../../media/irrlicht2_bk.jpg")); + driver->getTexture(mediaPath + "irrlicht2_up.jpg"), + driver->getTexture(mediaPath + "irrlicht2_dn.jpg"), + driver->getTexture(mediaPath + "irrlicht2_lf.jpg"), + driver->getTexture(mediaPath + "irrlicht2_rt.jpg"), + driver->getTexture(mediaPath + "irrlicht2_ft.jpg"), + driver->getTexture(mediaPath + "irrlicht2_bk.jpg")); driver->setTextureCreationFlag(video::ETCF_CREATE_MIP_MAPS, true); @@ -448,7 +430,7 @@ int main() while(device->run()) if (device->isWindowActive()) { - driver->beginScene(true, true, video::SColor(255,0,0,0)); + driver->beginScene(video::ECBF_COLOR | video::ECBF_DEPTH, video::SColor(255,0,0,0)); smgr->drawAll(); driver->endScene(); diff --git a/examples/11.PerPixelLighting/PerPixelLighting.dev b/examples/11.PerPixelLighting/PerPixelLighting.dev deleted file mode 100644 index c83a502b..00000000 --- a/examples/11.PerPixelLighting/PerPixelLighting.dev +++ /dev/null @@ -1,59 +0,0 @@ -[Project] -FileName=example.dev -Name=Irrlicht Example 11 Per-Pixel Lighting -UnitCount=1 -Type=1 -Ver=1 -ObjFiles= -Includes=..\..\include -Libs= -PrivateResource= -ResourceIncludes= -MakeIncludes= -Compiler= -CppCompiler= -Linker=../../lib/Win32-gcc/libIrrlicht.a_@@_ -IsCpp=1 -Icon= -ExeOutput=../../bin/Win32-gcc -ObjectOutput=obj -OverrideOutput=1 -OverrideOutputName=11.PerPixelLighting.exe -HostApplication= -Folders= -CommandLine= -IncludeVersionInfo=0 -SupportXPThemes=0 -CompilerSet=0 -CompilerSettings=0000000000000000000000 -UseCustomMakefile=0 -CustomMakefile= - -[Unit1] -FileName=main.cpp -CompileCpp=1 -Folder=Projekt1 -Compile=1 -Link=1 -Priority=1000 -OverrideBuildCmd=0 -BuildCmd= - -[VersionInfo] -Major=0 -Minor=1 -Release=1 -Build=1 -LanguageID=1033 -CharsetID=1252 -CompanyName= -FileVersion= -FileDescription=Irrlicht Engine example compiled using DevCpp and gcc -InternalName= -LegalCopyright= -LegalTrademarks= -OriginalFilename= -ProductName= -ProductVersion= -AutoIncBuildNr=0 - diff --git a/examples/11.PerPixelLighting/PerPixelLighting_vc10.vcxproj b/examples/11.PerPixelLighting/PerPixelLighting_vc10.vcxproj index 267ded9e..2179bc44 100644 --- a/examples/11.PerPixelLighting/PerPixelLighting_vc10.vcxproj +++ b/examples/11.PerPixelLighting/PerPixelLighting_vc10.vcxproj @@ -28,21 +28,25 @@ Application false MultiByte + Windows7.1SDK Application false MultiByte + Windows7.1SDK Application false MultiByte + Windows7.1SDK Application false MultiByte + Windows7.1SDK diff --git a/examples/11.PerPixelLighting/PerPixelLighting_vc11.vcxproj b/examples/11.PerPixelLighting/PerPixelLighting_vc11.vcxproj index 06fce8fe..2179bc44 100644 --- a/examples/11.PerPixelLighting/PerPixelLighting_vc11.vcxproj +++ b/examples/11.PerPixelLighting/PerPixelLighting_vc11.vcxproj @@ -28,25 +28,25 @@ Application false MultiByte - v110 + Windows7.1SDK Application false MultiByte - v110 + Windows7.1SDK Application false MultiByte - v110 + Windows7.1SDK Application false MultiByte - v110 + Windows7.1SDK diff --git a/examples/11.PerPixelLighting/PerPixelLighting_vc12.vcxproj b/examples/11.PerPixelLighting/PerPixelLighting_vc12.vcxproj new file mode 100644 index 00000000..ca2c3f4c --- /dev/null +++ b/examples/11.PerPixelLighting/PerPixelLighting_vc12.vcxproj @@ -0,0 +1,235 @@ + + + + + Debug + Win32 + + + Debug + x64 + + + Release + Win32 + + + Release + x64 + + + + 11.PerPixelLighting + {C4B42409-542D-4EFC-9E6B-44713FD47A33} + PerPixelLighting + + + + Application + false + MultiByte + Windows7.1SDK + + + Application + false + MultiByte + Windows7.1SDK + + + Application + false + MultiByte + Windows7.1SDK + + + Application + false + MultiByte + Windows7.1SDK + + + + + + + + + + + + + + + + + + + + + + + <_ProjectFileVersion>10.0.30319.1 + ..\..\bin\Win32-VisualStudio\ + ..\..\bin\Win64-VisualStudio\ + + + ..\..\bin\Win32-VisualStudio\ + ..\..\bin\Win64-VisualStudio\ + + + AllRules.ruleset + AllRules.ruleset + + + + + AllRules.ruleset + AllRules.ruleset + + + + + + + + .\Debug/PerPixelLighting.tlb + + + + + Disabled + ..\..\include;%(AdditionalIncludeDirectories) + WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions) + EnableFastChecks + MultiThreadedDebug + + + Level3 + EditAndContinue + + + _DEBUG;%(PreprocessorDefinitions) + 0x0c07 + + + ..\..\bin\Win32-VisualStudio\11.PerPixelLighting.exe + ..\..\lib\Win32-visualstudio;%(AdditionalLibraryDirectories) + true + Console + + + + + + + .\Debug/PerPixelLighting.tlb + + + + + Disabled + ..\..\include;%(AdditionalIncludeDirectories) + WIN32;WIN64;_DEBUG;_CONSOLE;%(PreprocessorDefinitions) + EnableFastChecks + MultiThreadedDebug + + + Level3 + ProgramDatabase + + + _DEBUG;%(PreprocessorDefinitions) + 0x0c07 + + + ..\..\bin\Win64-VisualStudio\11.PerPixelLighting.exe + ..\..\lib\Win64-visualstudio;%(AdditionalLibraryDirectories) + true + Console + + + + + + + .\Release/PerPixelLighting.tlb + + + + + MaxSpeed + OnlyExplicitInline + ..\..\include;%(AdditionalIncludeDirectories) + WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions) + true + MultiThreaded + true + + + Level3 + + + NDEBUG;%(PreprocessorDefinitions) + 0x0c07 + + + ..\..\bin\Win32-VisualStudio\11.PerPixelLighting.exe + ..\..\lib\Win32-visualstudio;%(AdditionalLibraryDirectories) + Console + + + + + + + .\Release/PerPixelLighting.tlb + + + + + MaxSpeed + OnlyExplicitInline + ..\..\include;%(AdditionalIncludeDirectories) + WIN32;WIN64;NDEBUG;_CONSOLE;%(PreprocessorDefinitions) + true + MultiThreaded + true + + + Level3 + + + NDEBUG;%(PreprocessorDefinitions) + 0x0c07 + + + ..\..\bin\Win64-VisualStudio\11.PerPixelLighting.exe + ..\..\lib\Win64-visualstudio;%(AdditionalLibraryDirectories) + Console + + + + + + + Disabled + Disabled + %(AdditionalIncludeDirectories) + %(AdditionalIncludeDirectories) + %(PreprocessorDefinitions) + %(PreprocessorDefinitions) + EnableFastChecks + EnableFastChecks + MaxSpeed + MaxSpeed + %(AdditionalIncludeDirectories) + %(AdditionalIncludeDirectories) + %(PreprocessorDefinitions) + %(PreprocessorDefinitions) + + + + + + \ No newline at end of file diff --git a/examples/11.PerPixelLighting/PerPixelLighting_vc14.vcxproj b/examples/11.PerPixelLighting/PerPixelLighting_vc14.vcxproj new file mode 100644 index 00000000..3e6da846 --- /dev/null +++ b/examples/11.PerPixelLighting/PerPixelLighting_vc14.vcxproj @@ -0,0 +1,235 @@ + + + + + Debug + Win32 + + + Debug + x64 + + + Release + Win32 + + + Release + x64 + + + + 11.PerPixelLighting + {C4B42409-542D-4EFC-9E6B-44713FD47A33} + PerPixelLighting + + + + Application + false + MultiByte + v140 + + + Application + false + MultiByte + v140 + + + Application + false + MultiByte + v140 + + + Application + false + MultiByte + v140 + + + + + + + + + + + + + + + + + + + + + + + <_ProjectFileVersion>10.0.30319.1 + ..\..\bin\Win32-VisualStudio\ + ..\..\bin\Win64-VisualStudio\ + + + ..\..\bin\Win32-VisualStudio\ + ..\..\bin\Win64-VisualStudio\ + + + AllRules.ruleset + AllRules.ruleset + + + + + AllRules.ruleset + AllRules.ruleset + + + + + + + + .\Debug/PerPixelLighting.tlb + + + + + Disabled + ..\..\include;%(AdditionalIncludeDirectories) + WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions) + EnableFastChecks + MultiThreadedDebug + + + Level3 + EditAndContinue + + + _DEBUG;%(PreprocessorDefinitions) + 0x0c07 + + + ..\..\bin\Win32-VisualStudio\11.PerPixelLighting.exe + ..\..\lib\Win32-visualstudio;%(AdditionalLibraryDirectories) + true + Console + + + + + + + .\Debug/PerPixelLighting.tlb + + + + + Disabled + ..\..\include;%(AdditionalIncludeDirectories) + WIN32;WIN64;_DEBUG;_CONSOLE;%(PreprocessorDefinitions) + EnableFastChecks + MultiThreadedDebug + + + Level3 + ProgramDatabase + + + _DEBUG;%(PreprocessorDefinitions) + 0x0c07 + + + ..\..\bin\Win64-VisualStudio\11.PerPixelLighting.exe + ..\..\lib\Win64-visualstudio;%(AdditionalLibraryDirectories) + true + Console + + + + + + + .\Release/PerPixelLighting.tlb + + + + + MaxSpeed + OnlyExplicitInline + ..\..\include;%(AdditionalIncludeDirectories) + WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions) + true + MultiThreaded + true + + + Level3 + + + NDEBUG;%(PreprocessorDefinitions) + 0x0c07 + + + ..\..\bin\Win32-VisualStudio\11.PerPixelLighting.exe + ..\..\lib\Win32-visualstudio;%(AdditionalLibraryDirectories) + Console + + + + + + + .\Release/PerPixelLighting.tlb + + + + + MaxSpeed + OnlyExplicitInline + ..\..\include;%(AdditionalIncludeDirectories) + WIN32;WIN64;NDEBUG;_CONSOLE;%(PreprocessorDefinitions) + true + MultiThreaded + true + + + Level3 + + + NDEBUG;%(PreprocessorDefinitions) + 0x0c07 + + + ..\..\bin\Win64-VisualStudio\11.PerPixelLighting.exe + ..\..\lib\Win64-visualstudio;%(AdditionalLibraryDirectories) + Console + + + + + + + Disabled + Disabled + %(AdditionalIncludeDirectories) + %(AdditionalIncludeDirectories) + %(PreprocessorDefinitions) + %(PreprocessorDefinitions) + EnableFastChecks + EnableFastChecks + MaxSpeed + MaxSpeed + %(AdditionalIncludeDirectories) + %(AdditionalIncludeDirectories) + %(PreprocessorDefinitions) + %(PreprocessorDefinitions) + + + + + + \ No newline at end of file diff --git a/examples/11.PerPixelLighting/PerPixelLighting_vc8.vcproj b/examples/11.PerPixelLighting/PerPixelLighting_vc8.vcproj deleted file mode 100644 index b6830db2..00000000 --- a/examples/11.PerPixelLighting/PerPixelLighting_vc8.vcproj +++ /dev/null @@ -1,231 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/examples/11.PerPixelLighting/PerPixelLighting_vc9.vcproj b/examples/11.PerPixelLighting/PerPixelLighting_vc9.vcproj deleted file mode 100644 index c9ed0337..00000000 --- a/examples/11.PerPixelLighting/PerPixelLighting_vc9.vcproj +++ /dev/null @@ -1,230 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/examples/11.PerPixelLighting/main.cpp b/examples/11.PerPixelLighting/main.cpp index d0e3daec..337d4b3e 100644 --- a/examples/11.PerPixelLighting/main.cpp +++ b/examples/11.PerPixelLighting/main.cpp @@ -10,6 +10,7 @@ nearly all other tutorials. */ #include #include "driverChoice.h" +#include "exampleHelper.h" using namespace irr; @@ -38,7 +39,7 @@ public: // set a nicer font gui::IGUISkin* skin = env->getSkin(); - gui::IGUIFont* font = env->getFont("../../media/fonthaettenschweiler.bmp"); + gui::IGUIFont* font = env->getFont(getExampleMediaPath() + "fonthaettenschweiler.bmp"); if (font) skin->setFont(font); @@ -198,8 +199,10 @@ int main() driver->setTextureCreationFlag(video::ETCF_ALWAYS_32_BIT, true); + const io::path mediaPath = getExampleMediaPath(); + // add irrlicht logo - env->addImage(driver->getTexture("../../media/irrlichtlogo3.png"), + env->addImage(driver->getTexture(mediaPath + "irrlichtlogo3.png"), core::position2d(10,10)); // add camera @@ -228,7 +231,7 @@ int main() IMeshManipulator::makePlanarTextureMapping() method. */ - scene::IAnimatedMesh* roomMesh = smgr->getMesh("../../media/room.3ds"); + scene::IAnimatedMesh* roomMesh = smgr->getMesh(mediaPath + "room.3ds"); scene::ISceneNode* room = 0; scene::ISceneNode* earth = 0; @@ -256,14 +259,14 @@ int main() */ video::ITexture* normalMap = - driver->getTexture("../../media/rockwall_height.bmp"); + driver->getTexture(mediaPath + "rockwall_height.bmp"); if (normalMap) driver->makeNormalMapTexture(normalMap, 9.0f); /* // The Normal Map and the displacement map/height map in the alpha channel video::ITexture* normalMap = - driver->getTexture("../../media/rockwall_NRM.tga"); + driver->getTexture(mediaPath + "rockwall_NRM.tga"); */ /* But just setting color and normal map is not everything. The @@ -283,7 +286,7 @@ int main() room = smgr->addMeshSceneNode(tangentMesh); room->setMaterialTexture(0, - driver->getTexture("../../media/rockwall.jpg")); + driver->getTexture(mediaPath + "rockwall.jpg")); room->setMaterialTexture(1, normalMap); // Stones don't glitter.. @@ -311,7 +314,7 @@ int main() // add earth sphere - scene::IAnimatedMesh* earthMesh = smgr->getMesh("../../media/earth.x"); + scene::IAnimatedMesh* earthMesh = smgr->getMesh(mediaPath + "earth.x"); if (earthMesh) { //perform various task with the mesh manipulator @@ -334,7 +337,7 @@ int main() earth->setPosition(core::vector3df(-70,130,45)); // load heightmap, create normal map from it and set it - video::ITexture* earthNormalMap = driver->getTexture("../../media/earthbump.jpg"); + video::ITexture* earthNormalMap = driver->getTexture(mediaPath + "earthbump.jpg"); if (earthNormalMap) { driver->makeNormalMapTexture(earthNormalMap, 20.0f); @@ -381,7 +384,7 @@ int main() bill->setMaterialFlag(video::EMF_LIGHTING, false); bill->setMaterialFlag(video::EMF_ZWRITE_ENABLE, false); bill->setMaterialType(video::EMT_TRANSPARENT_ADD_COLOR); - bill->setMaterialTexture(0, driver->getTexture("../../media/particlegreen.jpg")); + bill->setMaterialTexture(0, driver->getTexture(mediaPath + "particlegreen.jpg")); /* Now the same again, with the second light. The difference is that we @@ -412,7 +415,7 @@ int main() bill->setMaterialFlag(video::EMF_LIGHTING, false); bill->setMaterialFlag(video::EMF_ZWRITE_ENABLE, false); bill->setMaterialType(video::EMT_TRANSPARENT_ADD_COLOR); - bill->setMaterialTexture(0, driver->getTexture("../../media/particlered.bmp")); + bill->setMaterialTexture(0, driver->getTexture(mediaPath + "particlered.bmp")); // add particle system scene::IParticleSystemSceneNode* ps = @@ -439,7 +442,7 @@ int main() // adjust some material settings ps->setMaterialFlag(video::EMF_LIGHTING, false); ps->setMaterialFlag(video::EMF_ZWRITE_ENABLE, false); - ps->setMaterialTexture(0, driver->getTexture("../../media/fireball.bmp")); + ps->setMaterialTexture(0, driver->getTexture(mediaPath + "fireball.bmp")); ps->setMaterialType(video::EMT_TRANSPARENT_ADD_COLOR); MyEventReceiver receiver(room, earth, env, driver); @@ -454,7 +457,7 @@ int main() while(device->run()) if (device->isWindowActive()) { - driver->beginScene(true, true, 0); + driver->beginScene(video::ECBF_COLOR | video::ECBF_DEPTH, video::SColor(0)); smgr->drawAll(); env->drawAll(); diff --git a/examples/12.TerrainRendering/TerrainRendering.dev b/examples/12.TerrainRendering/TerrainRendering.dev deleted file mode 100644 index 678e5365..00000000 --- a/examples/12.TerrainRendering/TerrainRendering.dev +++ /dev/null @@ -1,59 +0,0 @@ -[Project] -FileName=example.dev -Name=Irrlicht Example 12 Terrain Rendering -UnitCount=1 -Type=1 -Ver=1 -ObjFiles= -Includes=..\..\include -Libs= -PrivateResource= -ResourceIncludes= -MakeIncludes= -Compiler= -CppCompiler= -Linker=../../lib/Win32-gcc/libIrrlicht.a_@@_ -IsCpp=1 -Icon= -ExeOutput=../../bin/Win32-gcc -ObjectOutput=obj -OverrideOutput=1 -OverrideOutputName=12.TerrainRendering.exe -HostApplication= -Folders= -CommandLine= -IncludeVersionInfo=0 -SupportXPThemes=0 -CompilerSet=0 -CompilerSettings=0000000000000000000000 -UseCustomMakefile=0 -CustomMakefile= - -[Unit1] -FileName=main.cpp -CompileCpp=1 -Folder=Projekt1 -Compile=1 -Link=1 -Priority=1000 -OverrideBuildCmd=0 -BuildCmd= - -[VersionInfo] -Major=0 -Minor=1 -Release=1 -Build=1 -LanguageID=1033 -CharsetID=1252 -CompanyName= -FileVersion= -FileDescription=Irrlicht Engine example compiled using DevCpp and gcc -InternalName= -LegalCopyright= -LegalTrademarks= -OriginalFilename= -ProductName= -ProductVersion= -AutoIncBuildNr=0 - diff --git a/examples/12.TerrainRendering/TerrainRendering_vc10.vcxproj b/examples/12.TerrainRendering/TerrainRendering_vc10.vcxproj index c68f9ff6..22bd8b6d 100644 --- a/examples/12.TerrainRendering/TerrainRendering_vc10.vcxproj +++ b/examples/12.TerrainRendering/TerrainRendering_vc10.vcxproj @@ -28,21 +28,25 @@ Application false MultiByte + Windows7.1SDK Application false MultiByte + Windows7.1SDK Application false MultiByte + Windows7.1SDK Application false MultiByte + Windows7.1SDK diff --git a/examples/12.TerrainRendering/TerrainRendering_vc11.vcxproj b/examples/12.TerrainRendering/TerrainRendering_vc11.vcxproj index d91cb762..22bd8b6d 100644 --- a/examples/12.TerrainRendering/TerrainRendering_vc11.vcxproj +++ b/examples/12.TerrainRendering/TerrainRendering_vc11.vcxproj @@ -28,25 +28,25 @@ Application false MultiByte - v110 + Windows7.1SDK Application false MultiByte - v110 + Windows7.1SDK Application false MultiByte - v110 + Windows7.1SDK Application false MultiByte - v110 + Windows7.1SDK diff --git a/examples/12.TerrainRendering/TerrainRendering_vc12.vcxproj b/examples/12.TerrainRendering/TerrainRendering_vc12.vcxproj new file mode 100644 index 00000000..4fb6b9b8 --- /dev/null +++ b/examples/12.TerrainRendering/TerrainRendering_vc12.vcxproj @@ -0,0 +1,235 @@ + + + + + Debug + Win32 + + + Debug + x64 + + + Release + Win32 + + + Release + x64 + + + + 12.TerrainRendering + {3A5B74E5-6390-43B0-A459-2793B81FFD31} + TerrainRendering + + + + Application + false + MultiByte + Windows7.1SDK + + + Application + false + MultiByte + Windows7.1SDK + + + Application + false + MultiByte + Windows7.1SDK + + + Application + false + MultiByte + Windows7.1SDK + + + + + + + + + + + + + + + + + + + + + + + <_ProjectFileVersion>10.0.30319.1 + ..\..\bin\Win32-VisualStudio\ + ..\..\bin\Win64-VisualStudio\ + + + ..\..\bin\Win32-VisualStudio\ + ..\..\bin\Win64-VisualStudio\ + + + AllRules.ruleset + AllRules.ruleset + + + + + AllRules.ruleset + AllRules.ruleset + + + + + + + + .\Debug/TerrainRendering.tlb + + + + + Disabled + ..\..\include;%(AdditionalIncludeDirectories) + WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions) + EnableFastChecks + MultiThreadedDebug + + + Level3 + EditAndContinue + + + _DEBUG;%(PreprocessorDefinitions) + 0x0c07 + + + ..\..\bin\Win32-VisualStudio\12.TerrainRendering.exe + ..\..\lib\Win32-visualstudio;%(AdditionalLibraryDirectories) + true + Console + + + + + + + .\Debug/TerrainRendering.tlb + + + + + Disabled + ..\..\include;%(AdditionalIncludeDirectories) + WIN32;WIN64;_DEBUG;_CONSOLE;%(PreprocessorDefinitions) + EnableFastChecks + MultiThreadedDebug + + + Level3 + ProgramDatabase + + + _DEBUG;%(PreprocessorDefinitions) + 0x0c07 + + + ..\..\bin\Win64-VisualStudio\12.TerrainRendering.exe + ..\..\lib\Win64-visualstudio;%(AdditionalLibraryDirectories) + true + Console + + + + + + + .\Release/TerrainRendering.tlb + + + + + MaxSpeed + OnlyExplicitInline + ..\..\include;%(AdditionalIncludeDirectories) + WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions) + true + MultiThreaded + true + + + Level3 + + + NDEBUG;%(PreprocessorDefinitions) + 0x0c07 + + + ..\..\bin\Win32-VisualStudio\12.TerrainRendering.exe + ..\..\lib\Win32-visualstudio;%(AdditionalLibraryDirectories) + Console + + + + + + + .\Release/TerrainRendering.tlb + + + + + MaxSpeed + OnlyExplicitInline + ..\..\include;%(AdditionalIncludeDirectories) + WIN32;WIN64;NDEBUG;_CONSOLE;%(PreprocessorDefinitions) + true + MultiThreaded + true + + + Level3 + + + NDEBUG;%(PreprocessorDefinitions) + 0x0c07 + + + ..\..\bin\Win64-VisualStudio\12.TerrainRendering.exe + ..\..\lib\Win64-visualstudio;%(AdditionalLibraryDirectories) + Console + + + + + + + Disabled + Disabled + %(AdditionalIncludeDirectories) + %(AdditionalIncludeDirectories) + %(PreprocessorDefinitions) + %(PreprocessorDefinitions) + EnableFastChecks + EnableFastChecks + MaxSpeed + MaxSpeed + %(AdditionalIncludeDirectories) + %(AdditionalIncludeDirectories) + %(PreprocessorDefinitions) + %(PreprocessorDefinitions) + + + + + + \ No newline at end of file diff --git a/examples/12.TerrainRendering/TerrainRendering_vc14.vcxproj b/examples/12.TerrainRendering/TerrainRendering_vc14.vcxproj new file mode 100644 index 00000000..bf067fa2 --- /dev/null +++ b/examples/12.TerrainRendering/TerrainRendering_vc14.vcxproj @@ -0,0 +1,235 @@ + + + + + Debug + Win32 + + + Debug + x64 + + + Release + Win32 + + + Release + x64 + + + + 12.TerrainRendering + {3A5B74E5-6390-43B0-A459-2793B81FFD31} + TerrainRendering + + + + Application + false + MultiByte + v140 + + + Application + false + MultiByte + v140 + + + Application + false + MultiByte + v140 + + + Application + false + MultiByte + v140 + + + + + + + + + + + + + + + + + + + + + + + <_ProjectFileVersion>10.0.30319.1 + ..\..\bin\Win32-VisualStudio\ + ..\..\bin\Win64-VisualStudio\ + + + ..\..\bin\Win32-VisualStudio\ + ..\..\bin\Win64-VisualStudio\ + + + AllRules.ruleset + AllRules.ruleset + + + + + AllRules.ruleset + AllRules.ruleset + + + + + + + + .\Debug/TerrainRendering.tlb + + + + + Disabled + ..\..\include;%(AdditionalIncludeDirectories) + WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions) + EnableFastChecks + MultiThreadedDebug + + + Level3 + EditAndContinue + + + _DEBUG;%(PreprocessorDefinitions) + 0x0c07 + + + ..\..\bin\Win32-VisualStudio\12.TerrainRendering.exe + ..\..\lib\Win32-visualstudio;%(AdditionalLibraryDirectories) + true + Console + + + + + + + .\Debug/TerrainRendering.tlb + + + + + Disabled + ..\..\include;%(AdditionalIncludeDirectories) + WIN32;WIN64;_DEBUG;_CONSOLE;%(PreprocessorDefinitions) + EnableFastChecks + MultiThreadedDebug + + + Level3 + ProgramDatabase + + + _DEBUG;%(PreprocessorDefinitions) + 0x0c07 + + + ..\..\bin\Win64-VisualStudio\12.TerrainRendering.exe + ..\..\lib\Win64-visualstudio;%(AdditionalLibraryDirectories) + true + Console + + + + + + + .\Release/TerrainRendering.tlb + + + + + MaxSpeed + OnlyExplicitInline + ..\..\include;%(AdditionalIncludeDirectories) + WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions) + true + MultiThreaded + true + + + Level3 + + + NDEBUG;%(PreprocessorDefinitions) + 0x0c07 + + + ..\..\bin\Win32-VisualStudio\12.TerrainRendering.exe + ..\..\lib\Win32-visualstudio;%(AdditionalLibraryDirectories) + Console + + + + + + + .\Release/TerrainRendering.tlb + + + + + MaxSpeed + OnlyExplicitInline + ..\..\include;%(AdditionalIncludeDirectories) + WIN32;WIN64;NDEBUG;_CONSOLE;%(PreprocessorDefinitions) + true + MultiThreaded + true + + + Level3 + + + NDEBUG;%(PreprocessorDefinitions) + 0x0c07 + + + ..\..\bin\Win64-VisualStudio\12.TerrainRendering.exe + ..\..\lib\Win64-visualstudio;%(AdditionalLibraryDirectories) + Console + + + + + + + Disabled + Disabled + %(AdditionalIncludeDirectories) + %(AdditionalIncludeDirectories) + %(PreprocessorDefinitions) + %(PreprocessorDefinitions) + EnableFastChecks + EnableFastChecks + MaxSpeed + MaxSpeed + %(AdditionalIncludeDirectories) + %(AdditionalIncludeDirectories) + %(PreprocessorDefinitions) + %(PreprocessorDefinitions) + + + + + + \ No newline at end of file diff --git a/examples/12.TerrainRendering/TerrainRendering_vc8.vcproj b/examples/12.TerrainRendering/TerrainRendering_vc8.vcproj deleted file mode 100644 index 757e2f66..00000000 --- a/examples/12.TerrainRendering/TerrainRendering_vc8.vcproj +++ /dev/null @@ -1,231 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/examples/12.TerrainRendering/TerrainRendering_vc9.vcproj b/examples/12.TerrainRendering/TerrainRendering_vc9.vcproj deleted file mode 100644 index 8a7f2f13..00000000 --- a/examples/12.TerrainRendering/TerrainRendering_vc9.vcproj +++ /dev/null @@ -1,230 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/examples/12.TerrainRendering/main.cpp b/examples/12.TerrainRendering/main.cpp index d8292448..5686bf32 100644 --- a/examples/12.TerrainRendering/main.cpp +++ b/examples/12.TerrainRendering/main.cpp @@ -16,6 +16,7 @@ toggles between solid and detail mapped material. */ #include #include "driverChoice.h" +#include "exampleHelper.h" using namespace irr; @@ -118,12 +119,14 @@ int main() driver->setTextureCreationFlag(video::ETCF_ALWAYS_32_BIT, true); + const io::path mediaPath = getExampleMediaPath(); + // add irrlicht logo - env->addImage(driver->getTexture("../../media/irrlichtlogo2.png"), + env->addImage(driver->getTexture(mediaPath + "irrlichtlogo2.png"), core::position2d(10,10)); //set other font - env->getSkin()->setFont(env->getFont("../../media/fontlucida.png")); + env->getSkin()->setFont(env->getFont(mediaPath + "fontlucida.png")); // add some help text env->addStaticText( @@ -160,7 +163,7 @@ int main() // add terrain scene node scene::ITerrainSceneNode* terrain = smgr->addTerrainSceneNode( - "../../media/terrain-heightmap.bmp", + mediaPath + "terrain-heightmap.bmp", 0, // parent node -1, // node id core::vector3df(0.f, 0.f, 0.f), // position @@ -175,9 +178,9 @@ int main() terrain->setMaterialFlag(video::EMF_LIGHTING, false); terrain->setMaterialTexture(0, - driver->getTexture("../../media/terrain-texture.jpg")); + driver->getTexture(mediaPath + "terrain-texture.jpg")); terrain->setMaterialTexture(1, - driver->getTexture("../../media/detailmap3.jpg")); + driver->getTexture(mediaPath + "detailmap3.jpg")); terrain->setMaterialType(video::EMT_DETAIL_MAP); @@ -226,13 +229,13 @@ int main() driver->setTextureCreationFlag(video::ETCF_CREATE_MIP_MAPS, false); scene::ISceneNode* skybox=smgr->addSkyBoxSceneNode( - driver->getTexture("../../media/irrlicht2_up.jpg"), - driver->getTexture("../../media/irrlicht2_dn.jpg"), - driver->getTexture("../../media/irrlicht2_lf.jpg"), - driver->getTexture("../../media/irrlicht2_rt.jpg"), - driver->getTexture("../../media/irrlicht2_ft.jpg"), - driver->getTexture("../../media/irrlicht2_bk.jpg")); - scene::ISceneNode* skydome=smgr->addSkyDomeSceneNode(driver->getTexture("../../media/skydome.jpg"),16,8,0.95f,2.0f); + driver->getTexture(mediaPath + "irrlicht2_up.jpg"), + driver->getTexture(mediaPath + "irrlicht2_dn.jpg"), + driver->getTexture(mediaPath + "irrlicht2_lf.jpg"), + driver->getTexture(mediaPath + "irrlicht2_rt.jpg"), + driver->getTexture(mediaPath + "irrlicht2_ft.jpg"), + driver->getTexture(mediaPath + "irrlicht2_bk.jpg")); + scene::ISceneNode* skydome=smgr->addSkyDomeSceneNode(driver->getTexture(mediaPath + "skydome.jpg"),16,8,0.95f,2.0f); driver->setTextureCreationFlag(video::ETCF_CREATE_MIP_MAPS, true); @@ -249,7 +252,7 @@ int main() while(device->run()) if (device->isWindowActive()) { - driver->beginScene(true, true, 0 ); + driver->beginScene(video::ECBF_COLOR | video::ECBF_DEPTH, video::SColor(0)); smgr->drawAll(); env->drawAll(); diff --git a/examples/13.RenderToTexture/RenderToTexture.dev b/examples/13.RenderToTexture/RenderToTexture.dev deleted file mode 100644 index 0ebdf280..00000000 --- a/examples/13.RenderToTexture/RenderToTexture.dev +++ /dev/null @@ -1,59 +0,0 @@ -[Project] -FileName=example.dev -Name=Irrlicht Example 13 Render To Texture -UnitCount=1 -Type=1 -Ver=1 -ObjFiles= -Includes=..\..\include -Libs= -PrivateResource= -ResourceIncludes= -MakeIncludes= -Compiler= -CppCompiler= -Linker=../../lib/Win32-gcc/libIrrlicht.a_@@_ -IsCpp=1 -Icon= -ExeOutput=../../bin/Win32-gcc -ObjectOutput=obj -OverrideOutput=1 -OverrideOutputName=13.RenderToTexture.exe -HostApplication= -Folders= -CommandLine= -IncludeVersionInfo=0 -SupportXPThemes=0 -CompilerSet=0 -CompilerSettings=0000000000000000000000 -UseCustomMakefile=0 -CustomMakefile= - -[Unit1] -FileName=main.cpp -CompileCpp=1 -Folder=Projekt1 -Compile=1 -Link=1 -Priority=1000 -OverrideBuildCmd=0 -BuildCmd= - -[VersionInfo] -Major=0 -Minor=1 -Release=1 -Build=1 -LanguageID=1033 -CharsetID=1252 -CompanyName= -FileVersion= -FileDescription=Irrlicht Engine example compiled using DevCpp and gcc -InternalName= -LegalCopyright= -LegalTrademarks= -OriginalFilename= -ProductName= -ProductVersion= -AutoIncBuildNr=0 - diff --git a/examples/13.RenderToTexture/RenderToTexture_vc10.vcxproj b/examples/13.RenderToTexture/RenderToTexture_vc10.vcxproj index e3760545..b41b2772 100644 --- a/examples/13.RenderToTexture/RenderToTexture_vc10.vcxproj +++ b/examples/13.RenderToTexture/RenderToTexture_vc10.vcxproj @@ -28,21 +28,25 @@ Application false MultiByte + Windows7.1SDK Application false MultiByte + Windows7.1SDK Application false MultiByte + Windows7.1SDK Application false MultiByte + Windows7.1SDK diff --git a/examples/13.RenderToTexture/RenderToTexture_vc11.vcxproj b/examples/13.RenderToTexture/RenderToTexture_vc11.vcxproj index f80b7c73..b41b2772 100644 --- a/examples/13.RenderToTexture/RenderToTexture_vc11.vcxproj +++ b/examples/13.RenderToTexture/RenderToTexture_vc11.vcxproj @@ -28,25 +28,25 @@ Application false MultiByte - v110 + Windows7.1SDK Application false MultiByte - v110 + Windows7.1SDK Application false MultiByte - v110 + Windows7.1SDK Application false MultiByte - v110 + Windows7.1SDK diff --git a/examples/13.RenderToTexture/RenderToTexture_vc12.vcxproj b/examples/13.RenderToTexture/RenderToTexture_vc12.vcxproj new file mode 100644 index 00000000..5ede2aee --- /dev/null +++ b/examples/13.RenderToTexture/RenderToTexture_vc12.vcxproj @@ -0,0 +1,235 @@ + + + + + Debug + Win32 + + + Debug + x64 + + + Release + Win32 + + + Release + x64 + + + + 13.RenderToTexture + {0914E5C8-5352-467B-8421-C9EB35BD5596} + RenderToTexture + + + + Application + false + MultiByte + Windows7.1SDK + + + Application + false + MultiByte + Windows7.1SDK + + + Application + false + MultiByte + Windows7.1SDK + + + Application + false + MultiByte + Windows7.1SDK + + + + + + + + + + + + + + + + + + + + + + + <_ProjectFileVersion>10.0.30319.1 + ..\..\bin\Win32-VisualStudio\ + ..\..\bin\Win64-VisualStudio\ + + + ..\..\bin\Win32-VisualStudio\ + ..\..\bin\Win64-VisualStudio\ + + + AllRules.ruleset + AllRules.ruleset + + + + + AllRules.ruleset + AllRules.ruleset + + + + + + + + .\Release/RenderToTexture.tlb + + + + + MaxSpeed + OnlyExplicitInline + ..\..\include;%(AdditionalIncludeDirectories) + WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions) + true + MultiThreaded + true + + + Level3 + + + NDEBUG;%(PreprocessorDefinitions) + 0x0c07 + + + ..\..\bin\Win32-VisualStudio\13.RenderToTexture.exe + ..\..\lib\Win32-visualstudio;%(AdditionalLibraryDirectories) + Console + + + + + + + .\Release/RenderToTexture.tlb + + + + + MaxSpeed + OnlyExplicitInline + ..\..\include;%(AdditionalIncludeDirectories) + WIN32;WIN64;NDEBUG;_CONSOLE;%(PreprocessorDefinitions) + true + MultiThreaded + true + + + Level3 + + + NDEBUG;%(PreprocessorDefinitions) + 0x0c07 + + + ..\..\bin\Win64-VisualStudio\13.RenderToTexture.exe + ..\..\lib\Win64-visualstudio;%(AdditionalLibraryDirectories) + Console + + + + + + + .\Debug/RenderToTexture.tlb + + + + + Disabled + ..\..\include;%(AdditionalIncludeDirectories) + WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions) + EnableFastChecks + MultiThreadedDebug + + + Level3 + EditAndContinue + + + _DEBUG;%(PreprocessorDefinitions) + 0x0c07 + + + ..\..\bin\Win32-VisualStudio\13.RenderToTexture.exe + ..\..\lib\Win32-visualstudio;%(AdditionalLibraryDirectories) + true + Console + + + + + + + .\Debug/RenderToTexture.tlb + + + + + Disabled + ..\..\include;%(AdditionalIncludeDirectories) + WIN32;WIN64;_DEBUG;_CONSOLE;%(PreprocessorDefinitions) + EnableFastChecks + MultiThreadedDebug + + + Level3 + ProgramDatabase + + + _DEBUG;%(PreprocessorDefinitions) + 0x0c07 + + + ..\..\bin\Win64-VisualStudio\13.RenderToTexture.exe + ..\..\lib\Win64-visualstudio;%(AdditionalLibraryDirectories) + true + Console + + + + + + + Disabled + Disabled + %(AdditionalIncludeDirectories) + %(AdditionalIncludeDirectories) + %(PreprocessorDefinitions) + %(PreprocessorDefinitions) + EnableFastChecks + EnableFastChecks + MaxSpeed + MaxSpeed + %(AdditionalIncludeDirectories) + %(AdditionalIncludeDirectories) + %(PreprocessorDefinitions) + %(PreprocessorDefinitions) + + + + + + \ No newline at end of file diff --git a/examples/13.RenderToTexture/RenderToTexture_vc14.vcxproj b/examples/13.RenderToTexture/RenderToTexture_vc14.vcxproj new file mode 100644 index 00000000..5316976e --- /dev/null +++ b/examples/13.RenderToTexture/RenderToTexture_vc14.vcxproj @@ -0,0 +1,235 @@ + + + + + Debug + Win32 + + + Debug + x64 + + + Release + Win32 + + + Release + x64 + + + + 13.RenderToTexture + {0914E5C8-5352-467B-8421-C9EB35BD5596} + RenderToTexture + + + + Application + false + MultiByte + v140 + + + Application + false + MultiByte + v140 + + + Application + false + MultiByte + v140 + + + Application + false + MultiByte + v140 + + + + + + + + + + + + + + + + + + + + + + + <_ProjectFileVersion>10.0.30319.1 + ..\..\bin\Win32-VisualStudio\ + ..\..\bin\Win64-VisualStudio\ + + + ..\..\bin\Win32-VisualStudio\ + ..\..\bin\Win64-VisualStudio\ + + + AllRules.ruleset + AllRules.ruleset + + + + + AllRules.ruleset + AllRules.ruleset + + + + + + + + .\Release/RenderToTexture.tlb + + + + + MaxSpeed + OnlyExplicitInline + ..\..\include;%(AdditionalIncludeDirectories) + WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions) + true + MultiThreaded + true + + + Level3 + + + NDEBUG;%(PreprocessorDefinitions) + 0x0c07 + + + ..\..\bin\Win32-VisualStudio\13.RenderToTexture.exe + ..\..\lib\Win32-visualstudio;%(AdditionalLibraryDirectories) + Console + + + + + + + .\Release/RenderToTexture.tlb + + + + + MaxSpeed + OnlyExplicitInline + ..\..\include;%(AdditionalIncludeDirectories) + WIN32;WIN64;NDEBUG;_CONSOLE;%(PreprocessorDefinitions) + true + MultiThreaded + true + + + Level3 + + + NDEBUG;%(PreprocessorDefinitions) + 0x0c07 + + + ..\..\bin\Win64-VisualStudio\13.RenderToTexture.exe + ..\..\lib\Win64-visualstudio;%(AdditionalLibraryDirectories) + Console + + + + + + + .\Debug/RenderToTexture.tlb + + + + + Disabled + ..\..\include;%(AdditionalIncludeDirectories) + WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions) + EnableFastChecks + MultiThreadedDebug + + + Level3 + EditAndContinue + + + _DEBUG;%(PreprocessorDefinitions) + 0x0c07 + + + ..\..\bin\Win32-VisualStudio\13.RenderToTexture.exe + ..\..\lib\Win32-visualstudio;%(AdditionalLibraryDirectories) + true + Console + + + + + + + .\Debug/RenderToTexture.tlb + + + + + Disabled + ..\..\include;%(AdditionalIncludeDirectories) + WIN32;WIN64;_DEBUG;_CONSOLE;%(PreprocessorDefinitions) + EnableFastChecks + MultiThreadedDebug + + + Level3 + ProgramDatabase + + + _DEBUG;%(PreprocessorDefinitions) + 0x0c07 + + + ..\..\bin\Win64-VisualStudio\13.RenderToTexture.exe + ..\..\lib\Win64-visualstudio;%(AdditionalLibraryDirectories) + true + Console + + + + + + + Disabled + Disabled + %(AdditionalIncludeDirectories) + %(AdditionalIncludeDirectories) + %(PreprocessorDefinitions) + %(PreprocessorDefinitions) + EnableFastChecks + EnableFastChecks + MaxSpeed + MaxSpeed + %(AdditionalIncludeDirectories) + %(AdditionalIncludeDirectories) + %(PreprocessorDefinitions) + %(PreprocessorDefinitions) + + + + + + \ No newline at end of file diff --git a/examples/13.RenderToTexture/RenderToTexture_vc8.vcproj b/examples/13.RenderToTexture/RenderToTexture_vc8.vcproj deleted file mode 100644 index dc2840c2..00000000 --- a/examples/13.RenderToTexture/RenderToTexture_vc8.vcproj +++ /dev/null @@ -1,231 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/examples/13.RenderToTexture/RenderToTexture_vc9.vcproj b/examples/13.RenderToTexture/RenderToTexture_vc9.vcproj deleted file mode 100644 index 7ee213bc..00000000 --- a/examples/13.RenderToTexture/RenderToTexture_vc9.vcproj +++ /dev/null @@ -1,230 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/examples/13.RenderToTexture/main.cpp b/examples/13.RenderToTexture/main.cpp index 35ea0095..1d3166ac 100644 --- a/examples/13.RenderToTexture/main.cpp +++ b/examples/13.RenderToTexture/main.cpp @@ -10,6 +10,7 @@ for the rendering driver, create the Irrlicht Device: #include #include "driverChoice.h" +#include "exampleHelper.h" using namespace irr; @@ -36,6 +37,8 @@ int main() video::IVideoDriver* driver = device->getVideoDriver(); scene::ISceneManager* smgr = device->getSceneManager(); gui::IGUIEnvironment* env = device->getGUIEnvironment(); + + const io::path mediaPath = getExampleMediaPath(); /* Now, we load an animated mesh to be displayed. As in most examples, @@ -48,12 +51,12 @@ int main() // load and display animated fairy mesh scene::IAnimatedMeshSceneNode* fairy = smgr->addAnimatedMeshSceneNode( - smgr->getMesh("../../media/faerie.md2")); + smgr->getMesh(mediaPath + "faerie.md2")); if (fairy) { fairy->setMaterialTexture(0, - driver->getTexture("../../media/faerie2.bmp")); // set diffuse texture + driver->getTexture(mediaPath + "faerie2.bmp")); // set diffuse texture fairy->setMaterialFlag(video::EMF_LIGHTING, true); // enable dynamic lighting fairy->getMaterial(0).Shininess = 20.0f; // set size of specular highlights fairy->setPosition(core::vector3df(-10,0,-100)); @@ -109,14 +112,20 @@ int main() */ // create render target - video::ITexture* rt = 0; + video::IRenderTarget* renderTarget = 0; + video::ITexture* renderTargetTex = 0; scene::ICameraSceneNode* fixedCam = 0; if (driver->queryFeature(video::EVDF_RENDER_TO_TARGET)) { - rt = driver->addRenderTargetTexture(core::dimension2d(256,256), "RTT1"); - test->setMaterialTexture(0, rt); // set material of cube to render target + renderTargetTex = driver->addRenderTargetTexture(core::dimension2d(256, 256), "RTT1", video::ECF_A8R8G8B8); + video::ITexture* renderTargetDepth = driver->addRenderTargetTexture(core::dimension2d(256, 256), "DepthStencil", video::ECF_D16); + + renderTarget = driver->addRenderTarget(); + renderTarget->setTexture(renderTargetTex, renderTargetDepth); + + test->setMaterialTexture(0, renderTargetTex); // set material of cube to render target // add fixed camera fixedCam = smgr->addCameraSceneNode(0, core::vector3df(10,10,-80), @@ -126,7 +135,7 @@ int main() { // create problem text gui::IGUISkin* skin = env->getSkin(); - gui::IGUIFont* font = env->getFont("../../media/fonthaettenschweiler.bmp"); + gui::IGUIFont* font = env->getFont(mediaPath + "fonthaettenschweiler.bmp"); if (font) skin->setFont(font); @@ -159,14 +168,14 @@ int main() while(device->run()) if (device->isWindowActive()) { - driver->beginScene(true, true, 0); + driver->beginScene(video::ECBF_COLOR | video::ECBF_DEPTH, video::SColor(0)); - if (rt) + if (renderTarget) { // draw scene into render target // set render target texture - driver->setRenderTarget(rt, true, true, video::SColor(0,0,0,255)); + driver->setRenderTarget(renderTarget, video::ECBF_COLOR | video::ECBF_DEPTH, video::SColor(0,0,0,255)); // make cube invisible and set fixed camera as active camera test->setVisible(false); @@ -177,7 +186,7 @@ int main() // set back old render target // The buffer might have been distorted, so clear it - driver->setRenderTarget(0, true, true, 0); + driver->setRenderTarget((video::IRenderTarget*)0, 0, video::SColor(0)); // make the cube visible and set the user controlled camera as active one test->setVisible(true); diff --git a/examples/14.Win32Window/Win32Window.dev b/examples/14.Win32Window/Win32Window.dev deleted file mode 100644 index 61925633..00000000 --- a/examples/14.Win32Window/Win32Window.dev +++ /dev/null @@ -1,59 +0,0 @@ -[Project] -FileName=example.dev -Name=Irrlicht Example 14 Win32 Window -UnitCount=1 -Type=1 -Ver=1 -ObjFiles= -Includes=..\..\include -Libs= -PrivateResource= -ResourceIncludes= -MakeIncludes= -Compiler= -CppCompiler= -Linker=../../lib/Win32-gcc/libIrrlicht.a_@@_ -IsCpp=1 -Icon= -ExeOutput=../../bin/Win32-gcc -ObjectOutput=obj -OverrideOutput=1 -OverrideOutputName=14.Win32Window.exe -HostApplication= -Folders= -CommandLine= -IncludeVersionInfo=0 -SupportXPThemes=0 -CompilerSet=0 -CompilerSettings=0000000000000000000000 -UseCustomMakefile=0 -CustomMakefile= - -[Unit1] -FileName=main.cpp -CompileCpp=1 -Folder=Projekt1 -Compile=1 -Link=1 -Priority=1000 -OverrideBuildCmd=0 -BuildCmd= - -[VersionInfo] -Major=0 -Minor=1 -Release=1 -Build=1 -LanguageID=1033 -CharsetID=1252 -CompanyName= -FileVersion= -FileDescription=Irrlicht Engine example compiled using DevCpp and gcc -InternalName= -LegalCopyright= -LegalTrademarks= -OriginalFilename= -ProductName= -ProductVersion= -AutoIncBuildNr=0 - diff --git a/examples/14.Win32Window/Win32Window_vc10.vcxproj b/examples/14.Win32Window/Win32Window_vc10.vcxproj index f18c5834..0ea47dbd 100644 --- a/examples/14.Win32Window/Win32Window_vc10.vcxproj +++ b/examples/14.Win32Window/Win32Window_vc10.vcxproj @@ -28,21 +28,25 @@ Application false MultiByte + Windows7.1SDK Application false MultiByte + Windows7.1SDK Application false MultiByte + Windows7.1SDK Application false MultiByte + Windows7.1SDK diff --git a/examples/14.Win32Window/Win32Window_vc11.vcxproj b/examples/14.Win32Window/Win32Window_vc11.vcxproj index 07a2fce9..0ea47dbd 100644 --- a/examples/14.Win32Window/Win32Window_vc11.vcxproj +++ b/examples/14.Win32Window/Win32Window_vc11.vcxproj @@ -28,25 +28,25 @@ Application false MultiByte - v110 + Windows7.1SDK Application false MultiByte - v110 + Windows7.1SDK Application false MultiByte - v110 + Windows7.1SDK Application false MultiByte - v110 + Windows7.1SDK diff --git a/examples/14.Win32Window/Win32Window_vc12.vcxproj b/examples/14.Win32Window/Win32Window_vc12.vcxproj new file mode 100644 index 00000000..814a398d --- /dev/null +++ b/examples/14.Win32Window/Win32Window_vc12.vcxproj @@ -0,0 +1,239 @@ + + + + + Debug + Win32 + + + Debug + x64 + + + Release + Win32 + + + Release + x64 + + + + 14.Win32Window + {772FBE05-D05A-467B-9842-BEC409EEA8D0} + Win32Window + + + + Application + false + MultiByte + Windows7.1SDK + + + Application + false + MultiByte + Windows7.1SDK + + + Application + false + MultiByte + Windows7.1SDK + + + Application + false + MultiByte + Windows7.1SDK + + + + + + + + + + + + + + + + + + + + + + + <_ProjectFileVersion>10.0.30319.1 + ..\..\bin\Win32-VisualStudio\ + ..\..\bin\Win64-VisualStudio\ + + + ..\..\bin\Win32-VisualStudio\ + ..\..\bin\Win64-VisualStudio\ + + + AllRules.ruleset + AllRules.ruleset + + + + + AllRules.ruleset + AllRules.ruleset + + + + + + + + .\Debug/Win32Window.tlb + + + + + Disabled + ..\..\include;%(AdditionalIncludeDirectories) + WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions) + EnableFastChecks + MultiThreadedDebug + + + Level3 + EditAndContinue + + + _DEBUG;%(PreprocessorDefinitions) + 0x0c07 + + + opengl32.lib;%(AdditionalDependencies) + ..\..\bin\Win32-VisualStudio\14.Win32Window.exe + ..\..\lib\Win32-visualstudio;%(AdditionalLibraryDirectories) + true + Console + + + + + + + .\Debug/Win32Window.tlb + + + + + Disabled + ..\..\include;%(AdditionalIncludeDirectories) + WIN32;WIN64;_DEBUG;_CONSOLE;%(PreprocessorDefinitions) + EnableFastChecks + MultiThreadedDebug + + + Level3 + ProgramDatabase + + + _DEBUG;%(PreprocessorDefinitions) + 0x0c07 + + + opengl32.lib;%(AdditionalDependencies) + ..\..\bin\Win64-VisualStudio\14.Win32Window.exe + ..\..\lib\Win64-visualstudio;%(AdditionalLibraryDirectories) + true + Console + + + + + + + .\Release/Win32Window.tlb + + + + + MaxSpeed + OnlyExplicitInline + ..\..\include;%(AdditionalIncludeDirectories) + WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions) + true + MultiThreaded + true + + + Level3 + + + NDEBUG;%(PreprocessorDefinitions) + 0x0c07 + + + opengl32.lib;%(AdditionalDependencies) + ..\..\bin\Win32-VisualStudio\14.Win32Window.exe + ..\..\lib\Win32-visualstudio;%(AdditionalLibraryDirectories) + Console + + + + + + + .\Release/Win32Window.tlb + + + + + MaxSpeed + OnlyExplicitInline + ..\..\include;%(AdditionalIncludeDirectories) + WIN32;WIN64;NDEBUG;_CONSOLE;%(PreprocessorDefinitions) + true + MultiThreaded + true + + + Level3 + + + NDEBUG;%(PreprocessorDefinitions) + 0x0c07 + + + opengl32.lib;%(AdditionalDependencies) + ..\..\bin\Win64-VisualStudio\14.Win32Window.exe + ..\..\lib\Win64-visualstudio;%(AdditionalLibraryDirectories) + Console + + + + + + + Disabled + Disabled + %(AdditionalIncludeDirectories) + %(AdditionalIncludeDirectories) + %(PreprocessorDefinitions) + %(PreprocessorDefinitions) + EnableFastChecks + EnableFastChecks + MaxSpeed + MaxSpeed + %(AdditionalIncludeDirectories) + %(AdditionalIncludeDirectories) + %(PreprocessorDefinitions) + %(PreprocessorDefinitions) + + + + + + \ No newline at end of file diff --git a/examples/14.Win32Window/Win32Window_vc14.vcxproj b/examples/14.Win32Window/Win32Window_vc14.vcxproj new file mode 100644 index 00000000..3142d412 --- /dev/null +++ b/examples/14.Win32Window/Win32Window_vc14.vcxproj @@ -0,0 +1,239 @@ + + + + + Debug + Win32 + + + Debug + x64 + + + Release + Win32 + + + Release + x64 + + + + 14.Win32Window + {772FBE05-D05A-467B-9842-BEC409EEA8D0} + Win32Window + + + + Application + false + MultiByte + v140 + + + Application + false + MultiByte + v140 + + + Application + false + MultiByte + v140 + + + Application + false + MultiByte + v140 + + + + + + + + + + + + + + + + + + + + + + + <_ProjectFileVersion>10.0.30319.1 + ..\..\bin\Win32-VisualStudio\ + ..\..\bin\Win64-VisualStudio\ + + + ..\..\bin\Win32-VisualStudio\ + ..\..\bin\Win64-VisualStudio\ + + + AllRules.ruleset + AllRules.ruleset + + + + + AllRules.ruleset + AllRules.ruleset + + + + + + + + .\Debug/Win32Window.tlb + + + + + Disabled + ..\..\include;%(AdditionalIncludeDirectories) + WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions) + EnableFastChecks + MultiThreadedDebug + + + Level3 + EditAndContinue + + + _DEBUG;%(PreprocessorDefinitions) + 0x0c07 + + + opengl32.lib;%(AdditionalDependencies) + ..\..\bin\Win32-VisualStudio\14.Win32Window.exe + ..\..\lib\Win32-visualstudio;%(AdditionalLibraryDirectories) + true + Console + + + + + + + .\Debug/Win32Window.tlb + + + + + Disabled + ..\..\include;%(AdditionalIncludeDirectories) + WIN32;WIN64;_DEBUG;_CONSOLE;%(PreprocessorDefinitions) + EnableFastChecks + MultiThreadedDebug + + + Level3 + ProgramDatabase + + + _DEBUG;%(PreprocessorDefinitions) + 0x0c07 + + + opengl32.lib;%(AdditionalDependencies) + ..\..\bin\Win64-VisualStudio\14.Win32Window.exe + ..\..\lib\Win64-visualstudio;%(AdditionalLibraryDirectories) + true + Console + + + + + + + .\Release/Win32Window.tlb + + + + + MaxSpeed + OnlyExplicitInline + ..\..\include;%(AdditionalIncludeDirectories) + WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions) + true + MultiThreaded + true + + + Level3 + + + NDEBUG;%(PreprocessorDefinitions) + 0x0c07 + + + opengl32.lib;%(AdditionalDependencies) + ..\..\bin\Win32-VisualStudio\14.Win32Window.exe + ..\..\lib\Win32-visualstudio;%(AdditionalLibraryDirectories) + Console + + + + + + + .\Release/Win32Window.tlb + + + + + MaxSpeed + OnlyExplicitInline + ..\..\include;%(AdditionalIncludeDirectories) + WIN32;WIN64;NDEBUG;_CONSOLE;%(PreprocessorDefinitions) + true + MultiThreaded + true + + + Level3 + + + NDEBUG;%(PreprocessorDefinitions) + 0x0c07 + + + opengl32.lib;%(AdditionalDependencies) + ..\..\bin\Win64-VisualStudio\14.Win32Window.exe + ..\..\lib\Win64-visualstudio;%(AdditionalLibraryDirectories) + Console + + + + + + + Disabled + Disabled + %(AdditionalIncludeDirectories) + %(AdditionalIncludeDirectories) + %(PreprocessorDefinitions) + %(PreprocessorDefinitions) + EnableFastChecks + EnableFastChecks + MaxSpeed + MaxSpeed + %(AdditionalIncludeDirectories) + %(AdditionalIncludeDirectories) + %(PreprocessorDefinitions) + %(PreprocessorDefinitions) + + + + + + \ No newline at end of file diff --git a/examples/14.Win32Window/Win32Window_vc8.vcproj b/examples/14.Win32Window/Win32Window_vc8.vcproj deleted file mode 100644 index efbf43d3..00000000 --- a/examples/14.Win32Window/Win32Window_vc8.vcproj +++ /dev/null @@ -1,232 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/examples/14.Win32Window/Win32Window_vc9.vcproj b/examples/14.Win32Window/Win32Window_vc9.vcproj deleted file mode 100644 index 2902fba4..00000000 --- a/examples/14.Win32Window/Win32Window_vc9.vcproj +++ /dev/null @@ -1,232 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/examples/14.Win32Window/main.cpp b/examples/14.Win32Window/main.cpp index 8de3303e..183381b9 100644 --- a/examples/14.Win32Window/main.cpp +++ b/examples/14.Win32Window/main.cpp @@ -16,10 +16,13 @@ windows book for details. #include // this example only runs with windows #include #include "driverChoice.h" +#include "exampleHelper.h" using namespace irr; +#ifdef _MSC_VER #pragma comment(lib, "irrlicht.lib") +#endif HWND hOKButton; HWND hWnd; @@ -76,7 +79,7 @@ int main() HINSTANCE hInstance = 0; // create dialog - const char* Win32ClassName = "CIrrlichtWindowsTestDialog"; + const fschar_t* Win32ClassName = __TEXT("CIrrlichtWindowsTestDialog"); WNDCLASSEX wcex; wcex.cbSize = sizeof(WNDCLASSEX); @@ -100,7 +103,7 @@ int main() int windowWidth = 440; int windowHeight = 380; - hWnd = CreateWindow( Win32ClassName, "Irrlicht Win32 window example", + hWnd = CreateWindow( Win32ClassName, __TEXT("Irrlicht Win32 window example"), style, 100, 100, windowWidth, windowHeight, NULL, NULL, hInstance, NULL); @@ -111,18 +114,18 @@ int main() // create ok button - hOKButton = CreateWindow("BUTTON", "OK - Close", WS_CHILD | WS_VISIBLE | BS_TEXT, + hOKButton = CreateWindow(__TEXT("BUTTON"), __TEXT("OK - Close"), WS_CHILD | WS_VISIBLE | BS_TEXT, windowWidth - 160, windowHeight - 40, 150, 30, hWnd, NULL, hInstance, NULL); // create some text - CreateWindow("STATIC", "This is Irrlicht running inside a standard Win32 window.\n"\ - "Also mixing with MFC and .NET Windows.Forms is possible.", + CreateWindow(__TEXT("STATIC"), __TEXT("This is Irrlicht running inside a standard Win32 window.\n")\ + __TEXT("Also mixing with MFC and .NET Windows.Forms is possible."), WS_CHILD | WS_VISIBLE, 20, 20, 400, 40, hWnd, NULL, hInstance, NULL); // create window to put irrlicht in - HWND hIrrlichtWindow = CreateWindow("BUTTON", "", + HWND hIrrlichtWindow = CreateWindow(__TEXT("BUTTON"), __TEXT(""), WS_CHILD | WS_VISIBLE | BS_OWNERDRAW, 50, 80, 320, 220, hWnd, NULL, hInstance, NULL); video::SExposedVideoData videodata((key=='b')?hIrrlichtWindow:0); @@ -172,18 +175,20 @@ int main() scene::ISceneNode* cube = smgr->addCubeSceneNode(20); - cube->setMaterialTexture(0, driver->getTexture("../../media/wall.bmp")); - cube->setMaterialTexture(1, driver->getTexture("../../media/water.jpg")); + const io::path mediaPath = getExampleMediaPath(); + + cube->setMaterialTexture(0, driver->getTexture(mediaPath + "wall.bmp")); + cube->setMaterialTexture(1, driver->getTexture(mediaPath + "water.jpg")); cube->setMaterialFlag( video::EMF_LIGHTING, false ); cube->setMaterialType( video::EMT_REFLECTION_2_LAYER ); smgr->addSkyBoxSceneNode( - driver->getTexture("../../media/irrlicht2_up.jpg"), - driver->getTexture("../../media/irrlicht2_dn.jpg"), - driver->getTexture("../../media/irrlicht2_lf.jpg"), - driver->getTexture("../../media/irrlicht2_rt.jpg"), - driver->getTexture("../../media/irrlicht2_ft.jpg"), - driver->getTexture("../../media/irrlicht2_bk.jpg")); + driver->getTexture(mediaPath + "irrlicht2_up.jpg"), + driver->getTexture(mediaPath + "irrlicht2_dn.jpg"), + driver->getTexture(mediaPath + "irrlicht2_lf.jpg"), + driver->getTexture(mediaPath + "irrlicht2_rt.jpg"), + driver->getTexture(mediaPath + "irrlicht2_ft.jpg"), + driver->getTexture(mediaPath + "irrlicht2_bk.jpg")); // This shows that we can render to multiple windows within one application device->getGUIEnvironment()->addStaticText(core::stringw("Second screen render").c_str(),core::recti(0,0,200,200)); @@ -209,12 +214,12 @@ int main() while (device->run()) { - driver->beginScene(true, true, 0, videodata); + driver->beginScene(video::ECBF_COLOR | video::ECBF_DEPTH, video::SColor(0), 1.f, 0, videodata); smgr->drawAll(); driver->endScene(); if (key=='b') { - driver->beginScene(true, true, 0xbbbbbbbb); + driver->beginScene(video::ECBF_COLOR | video::ECBF_DEPTH, video::SColor(0xbbbbbbbb)); device->getGUIEnvironment()->drawAll(); driver->endScene(); } diff --git a/examples/15.LoadIrrFile/LoadIrrFile.dev b/examples/15.LoadIrrFile/LoadIrrFile.dev deleted file mode 100644 index b43fe688..00000000 --- a/examples/15.LoadIrrFile/LoadIrrFile.dev +++ /dev/null @@ -1,59 +0,0 @@ -[Project] -FileName=example.dev -Name=Irrlicht Example 15 Load .irr File -UnitCount=1 -Type=1 -Ver=1 -ObjFiles= -Includes=..\..\include -Libs= -PrivateResource= -ResourceIncludes= -MakeIncludes= -Compiler= -CppCompiler= -Linker=../../lib/Win32-gcc/libIrrlicht.a_@@_ -IsCpp=1 -Icon= -ExeOutput=../../bin/Win32-gcc -ObjectOutput=obj -OverrideOutput=1 -OverrideOutputName=15.LoadIrrFile.exe -HostApplication= -Folders= -CommandLine= -IncludeVersionInfo=0 -SupportXPThemes=0 -CompilerSet=0 -CompilerSettings=0000000000000000000000 -UseCustomMakefile=0 -CustomMakefile= - -[Unit1] -FileName=main.cpp -CompileCpp=1 -Folder=Projekt1 -Compile=1 -Link=1 -Priority=1000 -OverrideBuildCmd=0 -BuildCmd= - -[VersionInfo] -Major=0 -Minor=1 -Release=1 -Build=1 -LanguageID=1033 -CharsetID=1252 -CompanyName= -FileVersion= -FileDescription=Irrlicht Engine example compiled using DevCpp and gcc -InternalName= -LegalCopyright= -LegalTrademarks= -OriginalFilename= -ProductName= -ProductVersion= -AutoIncBuildNr=0 - diff --git a/examples/15.LoadIrrFile/LoadIrrFile_vc10.vcxproj b/examples/15.LoadIrrFile/LoadIrrFile_vc10.vcxproj index ffc91ed0..db6dec20 100644 --- a/examples/15.LoadIrrFile/LoadIrrFile_vc10.vcxproj +++ b/examples/15.LoadIrrFile/LoadIrrFile_vc10.vcxproj @@ -28,21 +28,25 @@ Application false MultiByte + Windows7.1SDK Application false MultiByte + Windows7.1SDK Application false MultiByte + Windows7.1SDK Application false MultiByte + Windows7.1SDK diff --git a/examples/15.LoadIrrFile/LoadIrrFile_vc11.vcxproj b/examples/15.LoadIrrFile/LoadIrrFile_vc11.vcxproj index 42306968..db6dec20 100644 --- a/examples/15.LoadIrrFile/LoadIrrFile_vc11.vcxproj +++ b/examples/15.LoadIrrFile/LoadIrrFile_vc11.vcxproj @@ -28,25 +28,25 @@ Application false MultiByte - v110 + Windows7.1SDK Application false MultiByte - v110 + Windows7.1SDK Application false MultiByte - v110 + Windows7.1SDK Application false MultiByte - v110 + Windows7.1SDK diff --git a/examples/15.LoadIrrFile/LoadIrrFile_vc12.vcxproj b/examples/15.LoadIrrFile/LoadIrrFile_vc12.vcxproj new file mode 100644 index 00000000..97b4c717 --- /dev/null +++ b/examples/15.LoadIrrFile/LoadIrrFile_vc12.vcxproj @@ -0,0 +1,235 @@ + + + + + Debug + Win32 + + + Debug + x64 + + + Release + Win32 + + + Release + x64 + + + + 15.LoadIrrFile + {78C9F424-523C-49AC-94B7-823AA4A26BF9} + LoadIrrFile + + + + Application + false + MultiByte + Windows7.1SDK + + + Application + false + MultiByte + Windows7.1SDK + + + Application + false + MultiByte + Windows7.1SDK + + + Application + false + MultiByte + Windows7.1SDK + + + + + + + + + + + + + + + + + + + + + + + <_ProjectFileVersion>10.0.30319.1 + ..\..\bin\Win32-VisualStudio\ + ..\..\bin\Win64-VisualStudio\ + + + ..\..\bin\Win32-VisualStudio\ + ..\..\bin\Win64-VisualStudio\ + + + AllRules.ruleset + AllRules.ruleset + + + + + AllRules.ruleset + AllRules.ruleset + + + + + + + + .\Debug/LoadIrrFile.tlb + + + + + Disabled + ..\..\include;%(AdditionalIncludeDirectories) + WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions) + EnableFastChecks + MultiThreadedDebug + + + Level3 + EditAndContinue + + + _DEBUG;%(PreprocessorDefinitions) + 0x0c07 + + + ..\..\bin\Win32-VisualStudio\15.LoadIrrFile.exe + ..\..\lib\Win32-visualstudio;%(AdditionalLibraryDirectories) + true + Console + + + + + + + .\Debug/LoadIrrFile.tlb + + + + + Disabled + ..\..\include;%(AdditionalIncludeDirectories) + WIN32;WIN64;_DEBUG;_CONSOLE;%(PreprocessorDefinitions) + EnableFastChecks + MultiThreadedDebug + + + Level3 + ProgramDatabase + + + _DEBUG;%(PreprocessorDefinitions) + 0x0c07 + + + ..\..\bin\Win64-VisualStudio\15.LoadIrrFile.exe + ..\..\lib\Win64-visualstudio;%(AdditionalLibraryDirectories) + true + Console + + + + + + + .\Release/LoadIrrFile.tlb + + + + + MaxSpeed + OnlyExplicitInline + ..\..\include;%(AdditionalIncludeDirectories) + WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions) + true + MultiThreaded + true + + + Level3 + + + NDEBUG;%(PreprocessorDefinitions) + 0x0c07 + + + ..\..\bin\Win32-VisualStudio\15.LoadIrrFile.exe + ..\..\lib\Win32-visualstudio;%(AdditionalLibraryDirectories) + Console + + + + + + + .\Release/LoadIrrFile.tlb + + + + + MaxSpeed + OnlyExplicitInline + ..\..\include;%(AdditionalIncludeDirectories) + WIN32;WIN64;NDEBUG;_CONSOLE;%(PreprocessorDefinitions) + true + MultiThreaded + true + + + Level3 + + + NDEBUG;%(PreprocessorDefinitions) + 0x0c07 + + + ..\..\bin\Win64-VisualStudio\15.LoadIrrFile.exe + ..\..\lib\Win64-visualstudio;%(AdditionalLibraryDirectories) + Console + + + + + + + Disabled + Disabled + %(AdditionalIncludeDirectories) + %(AdditionalIncludeDirectories) + %(PreprocessorDefinitions) + %(PreprocessorDefinitions) + EnableFastChecks + EnableFastChecks + MaxSpeed + MaxSpeed + %(AdditionalIncludeDirectories) + %(AdditionalIncludeDirectories) + %(PreprocessorDefinitions) + %(PreprocessorDefinitions) + + + + + + \ No newline at end of file diff --git a/examples/15.LoadIrrFile/LoadIrrFile_vc14.vcxproj b/examples/15.LoadIrrFile/LoadIrrFile_vc14.vcxproj new file mode 100644 index 00000000..0811f131 --- /dev/null +++ b/examples/15.LoadIrrFile/LoadIrrFile_vc14.vcxproj @@ -0,0 +1,235 @@ + + + + + Debug + Win32 + + + Debug + x64 + + + Release + Win32 + + + Release + x64 + + + + 15.LoadIrrFile + {78C9F424-523C-49AC-94B7-823AA4A26BF9} + LoadIrrFile + + + + Application + false + MultiByte + v140 + + + Application + false + MultiByte + v140 + + + Application + false + MultiByte + v140 + + + Application + false + MultiByte + v140 + + + + + + + + + + + + + + + + + + + + + + + <_ProjectFileVersion>10.0.30319.1 + ..\..\bin\Win32-VisualStudio\ + ..\..\bin\Win64-VisualStudio\ + + + ..\..\bin\Win32-VisualStudio\ + ..\..\bin\Win64-VisualStudio\ + + + AllRules.ruleset + AllRules.ruleset + + + + + AllRules.ruleset + AllRules.ruleset + + + + + + + + .\Debug/LoadIrrFile.tlb + + + + + Disabled + ..\..\include;%(AdditionalIncludeDirectories) + WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions) + EnableFastChecks + MultiThreadedDebug + + + Level3 + EditAndContinue + + + _DEBUG;%(PreprocessorDefinitions) + 0x0c07 + + + ..\..\bin\Win32-VisualStudio\15.LoadIrrFile.exe + ..\..\lib\Win32-visualstudio;%(AdditionalLibraryDirectories) + true + Console + + + + + + + .\Debug/LoadIrrFile.tlb + + + + + Disabled + ..\..\include;%(AdditionalIncludeDirectories) + WIN32;WIN64;_DEBUG;_CONSOLE;%(PreprocessorDefinitions) + EnableFastChecks + MultiThreadedDebug + + + Level3 + ProgramDatabase + + + _DEBUG;%(PreprocessorDefinitions) + 0x0c07 + + + ..\..\bin\Win64-VisualStudio\15.LoadIrrFile.exe + ..\..\lib\Win64-visualstudio;%(AdditionalLibraryDirectories) + true + Console + + + + + + + .\Release/LoadIrrFile.tlb + + + + + MaxSpeed + OnlyExplicitInline + ..\..\include;%(AdditionalIncludeDirectories) + WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions) + true + MultiThreaded + true + + + Level3 + + + NDEBUG;%(PreprocessorDefinitions) + 0x0c07 + + + ..\..\bin\Win32-VisualStudio\15.LoadIrrFile.exe + ..\..\lib\Win32-visualstudio;%(AdditionalLibraryDirectories) + Console + + + + + + + .\Release/LoadIrrFile.tlb + + + + + MaxSpeed + OnlyExplicitInline + ..\..\include;%(AdditionalIncludeDirectories) + WIN32;WIN64;NDEBUG;_CONSOLE;%(PreprocessorDefinitions) + true + MultiThreaded + true + + + Level3 + + + NDEBUG;%(PreprocessorDefinitions) + 0x0c07 + + + ..\..\bin\Win64-VisualStudio\15.LoadIrrFile.exe + ..\..\lib\Win64-visualstudio;%(AdditionalLibraryDirectories) + Console + + + + + + + Disabled + Disabled + %(AdditionalIncludeDirectories) + %(AdditionalIncludeDirectories) + %(PreprocessorDefinitions) + %(PreprocessorDefinitions) + EnableFastChecks + EnableFastChecks + MaxSpeed + MaxSpeed + %(AdditionalIncludeDirectories) + %(AdditionalIncludeDirectories) + %(PreprocessorDefinitions) + %(PreprocessorDefinitions) + + + + + + \ No newline at end of file diff --git a/examples/15.LoadIrrFile/LoadIrrFile_vc8.vcproj b/examples/15.LoadIrrFile/LoadIrrFile_vc8.vcproj deleted file mode 100644 index d78a2633..00000000 --- a/examples/15.LoadIrrFile/LoadIrrFile_vc8.vcproj +++ /dev/null @@ -1,231 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/examples/15.LoadIrrFile/LoadIrrFile_vc9.vcproj b/examples/15.LoadIrrFile/LoadIrrFile_vc9.vcproj deleted file mode 100644 index a7bea1b6..00000000 --- a/examples/15.LoadIrrFile/LoadIrrFile_vc9.vcproj +++ /dev/null @@ -1,230 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/examples/15.LoadIrrFile/main.cpp b/examples/15.LoadIrrFile/main.cpp index 42327cd9..d28e6f67 100644 --- a/examples/15.LoadIrrFile/main.cpp +++ b/examples/15.LoadIrrFile/main.cpp @@ -12,6 +12,7 @@ Lets start: Create an Irrlicht device and setup the window. #include #include "driverChoice.h" +#include "exampleHelper.h" using namespace irr; @@ -51,10 +52,17 @@ int main(int argc, char** argv) */ // load the scene + /* You might have to work around some minor problems in current .irr loader: + - It can't load meshes relative to the .irr file, but only relative to the working directory. + So you might have to change your working directory to the path where the .irr file is in. + - When passing a custom parent node to loadScene then irr_scene attributes will be passed to that. + Usually not a problem, but for example AmbientLight will not change that way unless you create a custom + SceneNode type which can interpret those attributes. + */ if (argc>1) smgr->loadScene(argv[1]); else - smgr->loadScene("../../media/example.irr"); + smgr->loadScene(getExampleMediaPath() + "example.irr"); /* Now we'll create a camera, and give it a collision response animator @@ -145,7 +153,7 @@ int main(int argc, char** argv) while(device->run()) if (device->isWindowActive()) { - driver->beginScene(true, true, video::SColor(0,200,200,200)); + driver->beginScene(video::ECBF_COLOR | video::ECBF_DEPTH, video::SColor(0,200,200,200)); smgr->drawAll(); driver->endScene(); diff --git a/examples/16.Quake3MapShader/Quake3MapShader.dev b/examples/16.Quake3MapShader/Quake3MapShader.dev deleted file mode 100644 index 14ebb420..00000000 --- a/examples/16.Quake3MapShader/Quake3MapShader.dev +++ /dev/null @@ -1,59 +0,0 @@ -[Project] -FileName=example.dev -Name=Irrlicht Example 16 Quake3 Map Shader -UnitCount=1 -Type=1 -Ver=1 -ObjFiles= -Includes=..\..\include -Libs= -PrivateResource= -ResourceIncludes= -MakeIncludes= -Compiler= -CppCompiler= -Linker=../../lib/Win32-gcc/libIrrlicht.a_@@_ -IsCpp=1 -Icon= -ExeOutput=../../bin/Win32-gcc -ObjectOutput=obj -OverrideOutput=1 -OverrideOutputName=16.Quake3MapShader.exe -HostApplication= -Folders= -CommandLine= -IncludeVersionInfo=0 -SupportXPThemes=0 -CompilerSet=0 -CompilerSettings=0000000000000000000000 -UseCustomMakefile=0 -CustomMakefile= - -[Unit1] -FileName=main.cpp -CompileCpp=1 -Folder=Projekt1 -Compile=1 -Link=1 -Priority=1000 -OverrideBuildCmd=0 -BuildCmd= - -[VersionInfo] -Major=0 -Minor=1 -Release=1 -Build=1 -LanguageID=1033 -CharsetID=1252 -CompanyName= -FileVersion= -FileDescription=Irrlicht Engine example compiled using DevCpp and gcc -InternalName= -LegalCopyright= -LegalTrademarks= -OriginalFilename= -ProductName= -ProductVersion= -AutoIncBuildNr=0 - diff --git a/examples/16.Quake3MapShader/Quake3MapShader_vc10.vcxproj b/examples/16.Quake3MapShader/Quake3MapShader_vc10.vcxproj index ea09774a..b5564f80 100644 --- a/examples/16.Quake3MapShader/Quake3MapShader_vc10.vcxproj +++ b/examples/16.Quake3MapShader/Quake3MapShader_vc10.vcxproj @@ -28,18 +28,22 @@ Application MultiByte + Windows7.1SDK Application MultiByte + Windows7.1SDK Application MultiByte + Windows7.1SDK Application MultiByte + Windows7.1SDK diff --git a/examples/16.Quake3MapShader/Quake3MapShader_vc11.vcxproj b/examples/16.Quake3MapShader/Quake3MapShader_vc11.vcxproj index 1bd3735e..b5564f80 100644 --- a/examples/16.Quake3MapShader/Quake3MapShader_vc11.vcxproj +++ b/examples/16.Quake3MapShader/Quake3MapShader_vc11.vcxproj @@ -28,22 +28,22 @@ Application MultiByte - v110 + Windows7.1SDK Application MultiByte - v110 + Windows7.1SDK Application MultiByte - v110 + Windows7.1SDK Application MultiByte - v110 + Windows7.1SDK diff --git a/examples/16.Quake3MapShader/Quake3MapShader_vc12.vcxproj b/examples/16.Quake3MapShader/Quake3MapShader_vc12.vcxproj new file mode 100644 index 00000000..e41579e1 --- /dev/null +++ b/examples/16.Quake3MapShader/Quake3MapShader_vc12.vcxproj @@ -0,0 +1,194 @@ + + + + + Debug + Win32 + + + Debug + x64 + + + Release + Win32 + + + Release + x64 + + + + 16.Quake3MapShader + {EB3B38EA-5CE7-4983-845B-880661E69D09} + 16.Quake3MapShader + Win32Proj + + + + Application + MultiByte + Windows7.1SDK + + + Application + MultiByte + Windows7.1SDK + + + Application + MultiByte + Windows7.1SDK + + + Application + MultiByte + Windows7.1SDK + + + + + + + + + + + + + + + + + + + + + + + <_ProjectFileVersion>10.0.30319.1 + ..\..\bin\Win32-VisualStudio\ + ..\..\bin\Win64-VisualStudio\ + true + true + ..\..\bin\Win32-VisualStudio\ + ..\..\bin\Win64-VisualStudio\ + + + AllRules.ruleset + AllRules.ruleset + + + + + AllRules.ruleset + AllRules.ruleset + + + + + + + + Disabled + ..\..\include;%(AdditionalIncludeDirectories) + WIN32;_DEBUG;_WINDOWS;%(PreprocessorDefinitions) + true + EnableFastChecks + MultiThreadedDebug + + + Level3 + EditAndContinue + Cdecl + + + ..\..\bin\Win32-VisualStudio\16.Quake3MapShader.exe + ..\..\lib\Win32-visualstudio;%(AdditionalLibraryDirectories) + true + Console + + + + + + + Disabled + ..\..\include;%(AdditionalIncludeDirectories) + WIN32;WIN64;_DEBUG;_WINDOWS;%(PreprocessorDefinitions) + EnableFastChecks + MultiThreadedDebug + + + Level3 + ProgramDatabase + Cdecl + + + ..\..\bin\Win64-VisualStudio\16.Quake3MapShader.exe + ..\..\lib\Win64-visualstudio;%(AdditionalLibraryDirectories) + true + Console + + + + + + + true + Speed + ..\..\include;%(AdditionalIncludeDirectories) + WIN32;NDEBUG;_WINDOWS;%(PreprocessorDefinitions) + MultiThreaded + false + + + Level3 + + + Cdecl + + + ..\..\bin\Win32-VisualStudio\16.Quake3MapShader.exe + ..\..\lib\Win32-visualstudio;%(AdditionalLibraryDirectories) + false + Console + true + true + + + + + + + true + Speed + ..\..\include;%(AdditionalIncludeDirectories) + WIN32;WIN64;NDEBUG;_WINDOWS;%(PreprocessorDefinitions) + MultiThreaded + false + + + Level3 + + + Cdecl + + + ..\..\bin\Win64-VisualStudio\16.Quake3MapShader.exe + ..\..\lib\Win64-visualstudio;%(AdditionalLibraryDirectories) + false + Console + true + true + + + + + + + + + + + \ No newline at end of file diff --git a/examples/16.Quake3MapShader/Quake3MapShader_vc14.vcxproj b/examples/16.Quake3MapShader/Quake3MapShader_vc14.vcxproj new file mode 100644 index 00000000..9c850a13 --- /dev/null +++ b/examples/16.Quake3MapShader/Quake3MapShader_vc14.vcxproj @@ -0,0 +1,194 @@ + + + + + Debug + Win32 + + + Debug + x64 + + + Release + Win32 + + + Release + x64 + + + + 16.Quake3MapShader + {EB3B38EA-5CE7-4983-845B-880661E69D09} + 16.Quake3MapShader + Win32Proj + + + + Application + MultiByte + v140 + + + Application + MultiByte + v140 + + + Application + MultiByte + v140 + + + Application + MultiByte + v140 + + + + + + + + + + + + + + + + + + + + + + + <_ProjectFileVersion>10.0.30319.1 + ..\..\bin\Win32-VisualStudio\ + ..\..\bin\Win64-VisualStudio\ + true + true + ..\..\bin\Win32-VisualStudio\ + ..\..\bin\Win64-VisualStudio\ + + + AllRules.ruleset + AllRules.ruleset + + + + + AllRules.ruleset + AllRules.ruleset + + + + + + + + Disabled + ..\..\include;%(AdditionalIncludeDirectories) + WIN32;_DEBUG;_WINDOWS;%(PreprocessorDefinitions) + true + EnableFastChecks + MultiThreadedDebug + + + Level3 + EditAndContinue + Cdecl + + + ..\..\bin\Win32-VisualStudio\16.Quake3MapShader.exe + ..\..\lib\Win32-visualstudio;%(AdditionalLibraryDirectories) + true + Console + + + + + + + Disabled + ..\..\include;%(AdditionalIncludeDirectories) + WIN32;WIN64;_DEBUG;_WINDOWS;%(PreprocessorDefinitions) + EnableFastChecks + MultiThreadedDebug + + + Level3 + ProgramDatabase + Cdecl + + + ..\..\bin\Win64-VisualStudio\16.Quake3MapShader.exe + ..\..\lib\Win64-visualstudio;%(AdditionalLibraryDirectories) + true + Console + + + + + + + true + Speed + ..\..\include;%(AdditionalIncludeDirectories) + WIN32;NDEBUG;_WINDOWS;%(PreprocessorDefinitions) + MultiThreaded + false + + + Level3 + + + Cdecl + + + ..\..\bin\Win32-VisualStudio\16.Quake3MapShader.exe + ..\..\lib\Win32-visualstudio;%(AdditionalLibraryDirectories) + false + Console + true + true + + + + + + + true + Speed + ..\..\include;%(AdditionalIncludeDirectories) + WIN32;WIN64;NDEBUG;_WINDOWS;%(PreprocessorDefinitions) + MultiThreaded + false + + + Level3 + + + Cdecl + + + ..\..\bin\Win64-VisualStudio\16.Quake3MapShader.exe + ..\..\lib\Win64-visualstudio;%(AdditionalLibraryDirectories) + false + Console + true + true + + + + + + + + + + + \ No newline at end of file diff --git a/examples/16.Quake3MapShader/Quake3MapShader_vc8.vcproj b/examples/16.Quake3MapShader/Quake3MapShader_vc8.vcproj deleted file mode 100644 index 65fc83c2..00000000 --- a/examples/16.Quake3MapShader/Quake3MapShader_vc8.vcproj +++ /dev/null @@ -1,190 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/examples/16.Quake3MapShader/Quake3MapShader_vc9.vcproj b/examples/16.Quake3MapShader/Quake3MapShader_vc9.vcproj deleted file mode 100644 index a533ce0d..00000000 --- a/examples/16.Quake3MapShader/Quake3MapShader_vc9.vcproj +++ /dev/null @@ -1,188 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/examples/16.Quake3MapShader/main.cpp b/examples/16.Quake3MapShader/main.cpp index 63917053..4a91b4e3 100644 --- a/examples/16.Quake3MapShader/main.cpp +++ b/examples/16.Quake3MapShader/main.cpp @@ -10,6 +10,7 @@ to ask the user for a driver type using the console. */ #include #include "driverChoice.h" +#include "exampleHelper.h" /* define which Quake3 Level should be loaded @@ -32,7 +33,7 @@ to ask the user for a driver type using the console. #ifdef IRRLICHT_QUAKE3_ARENA #define QUAKE3_STORAGE_FORMAT addFileArchive - #define QUAKE3_STORAGE_1 "../../media/map-20kdm2.pk3" + #define QUAKE3_STORAGE_1 getExampleMediaPath() + "map-20kdm2.pk3" #define QUAKE3_MAP_NAME "maps/20kdm2.bsp" #endif @@ -75,7 +76,7 @@ public: if (image) { c8 buf[256]; - snprintf(buf, 256, "%s_shot%04d.jpg", + snprintf_irr(buf, 256, "%s_shot%04d.jpg", FilenameTemplate.c_str(), ++Number); Device->getVideoDriver()->writeImageToFile(image, buf, 85 ); @@ -144,8 +145,10 @@ int IRRCALLCONV main(int argc, char* argv[]) scene::ISceneManager* smgr = device->getSceneManager(); gui::IGUIEnvironment* gui = device->getGUIEnvironment(); + const io::path mediaPath = getExampleMediaPath(); + //! add our private media directory to the file system - device->getFileSystem()->addFileArchive("../../media/"); + device->getFileSystem()->addFileArchive(mediaPath); /* To display the Quake 3 map, we first need to load it. Quake 3 maps @@ -211,7 +214,7 @@ int IRRCALLCONV main(int argc, char* argv[]) const scene::IMesh * const additional_mesh = mesh->getMesh(quake3::E_Q3_MESH_ITEMS); #ifdef SHOW_SHADER_NAME - gui::IGUIFont *font = device->getGUIEnvironment()->getFont("../../media/fontlucida.png"); + gui::IGUIFont *font = device->getGUIEnvironment()->getFont(mediaPath + "fontlucida.png"); u32 count = 0; #endif @@ -329,7 +332,6 @@ int IRRCALLCONV main(int argc, char* argv[]) case video::EDT_OPENGL: gui->addImage(driver->getTexture("opengllogo.png"), pos); break; - case video::EDT_DIRECT3D8: case video::EDT_DIRECT3D9: gui->addImage(driver->getTexture("directxlogo.png"), pos); break; @@ -347,7 +349,7 @@ int IRRCALLCONV main(int argc, char* argv[]) while(device->run()) if (device->isWindowActive()) { - driver->beginScene(true, true, video::SColor(255,20,20,40)); + driver->beginScene(video::ECBF_COLOR | video::ECBF_DEPTH, video::SColor(255,20,20,40)); smgr->drawAll(); gui->drawAll(); driver->endScene(); diff --git a/examples/17.HelloWorld_Mobile/17. HelloWorld for Windows Mobile on PC_vc10.vcxproj b/examples/17.HelloWorld_Mobile/17. HelloWorld for Windows Mobile on PC_vc10.vcxproj index e46cb0c9..0f047407 100644 --- a/examples/17.HelloWorld_Mobile/17. HelloWorld for Windows Mobile on PC_vc10.vcxproj +++ b/examples/17.HelloWorld_Mobile/17. HelloWorld for Windows Mobile on PC_vc10.vcxproj @@ -29,19 +29,23 @@ Application Unicode true + Windows7.1SDK Application Unicode true + Windows7.1SDK Application Unicode + Windows7.1SDK Application Unicode + Windows7.1SDK diff --git a/examples/17.HelloWorld_Mobile/17. HelloWorld for Windows Mobile on PC_vc11.vcxproj b/examples/17.HelloWorld_Mobile/17. HelloWorld for Windows Mobile on PC_vc11.vcxproj index 27b8ed41..0f047407 100644 --- a/examples/17.HelloWorld_Mobile/17. HelloWorld for Windows Mobile on PC_vc11.vcxproj +++ b/examples/17.HelloWorld_Mobile/17. HelloWorld for Windows Mobile on PC_vc11.vcxproj @@ -29,23 +29,23 @@ Application Unicode true - v110 + Windows7.1SDK Application Unicode true - v110 + Windows7.1SDK Application Unicode - v110 + Windows7.1SDK Application Unicode - v110 + Windows7.1SDK diff --git a/examples/17.HelloWorld_Mobile/17. HelloWorld for Windows Mobile on PC_vc12.vcxproj b/examples/17.HelloWorld_Mobile/17. HelloWorld for Windows Mobile on PC_vc12.vcxproj new file mode 100644 index 00000000..30079f8b --- /dev/null +++ b/examples/17.HelloWorld_Mobile/17. HelloWorld for Windows Mobile on PC_vc12.vcxproj @@ -0,0 +1,180 @@ + + + + + Debug + Win32 + + + Debug + x64 + + + Release + Win32 + + + Release + x64 + + + + 17.HelloWorld_Mobile + {2A29B6B1-AFC4-46C7-9944-7052AAE66F7B} + My17HelloWorldforWindowsMobileonPC + Win32Proj + + + + Application + Unicode + true + Windows7.1SDK + + + Application + Unicode + true + Windows7.1SDK + + + Application + Unicode + Windows7.1SDK + + + Application + Unicode + Windows7.1SDK + + + + + + + + + + + + + + + + + + + <_ProjectFileVersion>10.0.30319.1 + ..\..\bin\Win32-VisualStudio\ + ..\..\bin\Win64-VisualStudio\ + true + true + ..\..\bin\Win32-VisualStudio\ + ..\..\bin\Win64-VisualStudio\ + false + false + AllRules.ruleset + AllRules.ruleset + + + + + AllRules.ruleset + AllRules.ruleset + + + + + + + + Disabled + ..\..\include;%(AdditionalIncludeDirectories) + WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions) + true + EnableFastChecks + MultiThreadedDebugDLL + + + Level3 + EditAndContinue + + + ..\..\bin\Win32-VisualStudio\17.HelloWorld_Mobile.exe + ..\..\lib\Win32-visualstudio;%(AdditionalLibraryDirectories) + true + Console + + + + + + + Disabled + ..\..\include;%(AdditionalIncludeDirectories) + WIN32;WIN64;_DEBUG;_CONSOLE;%(PreprocessorDefinitions) + EnableFastChecks + MultiThreadedDebugDLL + + + Level3 + ProgramDatabase + + + ..\..\bin\Win64-VisualStudio\17.HelloWorld_Mobile.exe + ..\..\lib\Win64-visualstudio;%(AdditionalLibraryDirectories) + true + Console + + + + + + + ..\..\include;%(AdditionalIncludeDirectories) + WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions) + MultiThreadedDLL + + + Level3 + ProgramDatabase + + + ..\..\bin\Win32-VisualStudio\17.HelloWorld_Mobile.exe + ..\..\lib\Win32-visualstudio;%(AdditionalLibraryDirectories) + false + Console + true + true + + + + + + + ..\..\include;%(AdditionalIncludeDirectories) + WIN32;WIN64;NDEBUG;_CONSOLE;%(PreprocessorDefinitions) + MultiThreadedDLL + + + Level3 + ProgramDatabase + + + ..\..\bin\Win64-VisualStudio\17.HelloWorld_Mobile.exe + ..\..\lib\Win64-visualstudio;%(AdditionalLibraryDirectories) + false + Console + true + true + + + + + + + + + + + \ No newline at end of file diff --git a/examples/17.HelloWorld_Mobile/main.cpp b/examples/17.HelloWorld_Mobile/main.cpp index 24a82ca5..9db5806f 100644 --- a/examples/17.HelloWorld_Mobile/main.cpp +++ b/examples/17.HelloWorld_Mobile/main.cpp @@ -1,17 +1,15 @@ -/** Example 017 Helloworld mobile - This example show Hello World for Windows mobile. - It compiles on other platform too. The only differences between the original - examples are. You need a GUI, because otherwise you can't quit the application. - You need a Filesystem, which is relative based to your executable. +/** Deprecated. This was Example 017 Helloworld mobile for WinCE 6. + But WinCE6 support has been removed for Irrlicht 1.9. + If you still need that please use Irrlicht 1.8 or svn revision 5045 which was the last one to include it. + + Sources still kept for now as it compiles on other platform too. And we might use this example again + once we support Windows RT. */ #include -#ifdef _IRR_WINDOWS_ +#if defined ( _IRR_WINDOWS_ ) #include -#elif defined(_IRR_IPHONE_PLATFORM_) - #import - #import #endif using namespace irr; @@ -23,20 +21,6 @@ using namespace gui; #pragma comment(lib, "Irrlicht.lib") - -#ifdef _IRR_IPHONE_PLATFORM_ -@interface AppDelegate : UIResponder -{ - UIWindow* window; - IrrlichtDevice* device; -} - -@property (strong, nonatomic) UIWindow *window; - -@end -#endif - -#if !defined(_IRR_IPHONE_PLATFORM_) class EventReceiver_basic : public IEventReceiver { private: @@ -65,6 +49,170 @@ public: } }; +class CSampleSceneNode : public ISceneNode +{ + aabbox3d Box; + S3DVertex Vertices[4]; + SMaterial Material; +public: + + CSampleSceneNode(ISceneNode* parent, ISceneManager* mgr, s32 id) + : ISceneNode(parent, mgr, id) + { + Material.Wireframe = false; + Material.Lighting = false; + + Vertices[0] = S3DVertex(0,0,10, 1,1,0, SColor(255,0,255,255), 0, 1); + Vertices[1] = S3DVertex(10,0,-10, 1,0,0, SColor(255,255,0,255), 1, 1); + Vertices[2] = S3DVertex(0,20,0, 0,1,1, SColor(255,255,255,0), 1, 0); + Vertices[3] = S3DVertex(-10,0,-10, 0,0,1, SColor(255,0,255,0), 0, 0); + Box.reset(Vertices[0].Pos); + for (s32 i=1; i<4; ++i) + Box.addInternalPoint(Vertices[i].Pos); + } + virtual void OnRegisterSceneNode() + { + if (IsVisible) + SceneManager->registerNodeForRendering(this); + + ISceneNode::OnRegisterSceneNode(); + } + + virtual void render() + { + u16 indices[] = { 0,2,3, 2,1,3, 1,0,3, 2,0,1 }; + IVideoDriver* driver = SceneManager->getVideoDriver(); + + driver->setMaterial(Material); + driver->setTransform(ETS_WORLD, AbsoluteTransformation); + driver->drawIndexedTriangleList(&Vertices[0], 4, &indices[0], 4); + } + + virtual const aabbox3d& getBoundingBox() const + { + return Box; + } + + virtual u32 getMaterialCount() + { + return 1; + } + + virtual SMaterial& getMaterial(u32 i) + { + return Material; + } +}; + +/*! + Startup a Windows Mobile Device +*/ +IrrlichtDevice *startup() +{ + // both software and burnings video can be used + E_DRIVER_TYPE driverType = EDT_SOFTWARE; // EDT_BURNINGSVIDEO; + + // create device + IrrlichtDevice *device = 0; + + // Use window mode on PC + device = createDevice(driverType, dimension2d(240, 320), 16, false ); + if ( 0 == device ) + return 0; + + IVideoDriver* driver = device->getVideoDriver(); + ISceneManager* smgr = device->getSceneManager(); + IGUIEnvironment* guienv = device->getGUIEnvironment(); + + // set the filesystem relative to the executable +#if defined (_IRR_WINDOWS_) + { + wchar_t buf[255]; + GetModuleFileNameW ( 0, buf, 255 ); + + io::path base = buf; + base = base.subString ( 0, base.findLast ( '\\' ) + 1 ); + device->getFileSystem()->addFileArchive ( base ); + } +#endif + + IGUIStaticText *text = guienv->addStaticText(L"FPS: 25", + rect(140,15,200,30), false, false, 0, 100 ); + + guienv->addButton(core::rect(200,10,238,30), 0, 2, L"Quit"); + + // add irrlicht logo + guienv->addImage(driver->getTexture("../../media/irrlichtlogo3.png"), + core::position2d(0,-2)); + return device; +} + +/*! +*/ +int run ( IrrlichtDevice *device ) +{ + while(device->run()) + if (device->isWindowActive()) + { + device->getVideoDriver()->beginScene(true, true, SColor(0,100,100,100)); + device->getSceneManager()->drawAll(); + device->getGUIEnvironment()->drawAll(); + device->getVideoDriver()->endScene (); + + IGUIElement *stat = device->getGUIEnvironment()-> + getRootGUIElement()->getElementFromId ( 100 ); + if ( stat ) + { + stringw str = L"FPS: "; + str += (s32)device->getVideoDriver()->getFPS(); + + stat->setText ( str.c_str() ); + } + } + + device->drop(); + return 0; +} + +/*! +*/ +int example_customscenenode() +{ + // create device + IrrlichtDevice *device = startup(); + if (device == 0) + return 1; // could not create selected driver. + + // create engine and camera + EventReceiver_basic receiver(device); + device->setEventReceiver(&receiver); + + IVideoDriver* driver = device->getVideoDriver(); + ISceneManager* smgr = device->getSceneManager(); + IGUIEnvironment* guienv = device->getGUIEnvironment(); + + + smgr->addCameraSceneNode(0, vector3df(0,-40,0), vector3df(0,0,0)); + + CSampleSceneNode *myNode = + new CSampleSceneNode(smgr->getRootSceneNode(), smgr, 666); + + ISceneNodeAnimator* anim = + smgr->createRotationAnimator(vector3df(0.8f, 0, 0.8f)); + + if(anim) + { + myNode->addAnimator(anim); + anim->drop(); + anim = 0; // As I shouldn't refer to it again, ensure that I can't + } + + myNode->drop(); + myNode = 0; // As I shouldn't refer to it again, ensure that I can't + + return run ( device ); +} + class EventReceiver_terrain : public IEventReceiver { public: @@ -134,208 +282,11 @@ private: bool showBox; }; -class CSampleSceneNode : public ISceneNode -{ - aabbox3d Box; - S3DVertex Vertices[4]; - SMaterial Material; -public: - CSampleSceneNode(ISceneNode* parent, ISceneManager* mgr, s32 id) - : ISceneNode(parent, mgr, id) - { - Material.Wireframe = false; - Material.Lighting = false; - - Vertices[0] = S3DVertex(0,0,10, 1,1,0, SColor(255,0,255,255), 0, 1); - Vertices[1] = S3DVertex(10,0,-10, 1,0,0, SColor(255,255,0,255), 1, 1); - Vertices[2] = S3DVertex(0,20,0, 0,1,1, SColor(255,255,255,0), 1, 0); - Vertices[3] = S3DVertex(-10,0,-10, 0,0,1, SColor(255,0,255,0), 0, 0); - Box.reset(Vertices[0].Pos); - for (s32 i=1; i<4; ++i) - Box.addInternalPoint(Vertices[i].Pos); - } - virtual void OnRegisterSceneNode() - { - if (IsVisible) - SceneManager->registerNodeForRendering(this); - - ISceneNode::OnRegisterSceneNode(); - } - - virtual void render() - { - u16 indices[] = { 0,2,3, 2,1,3, 1,0,3, 2,0,1 }; - IVideoDriver* driver = SceneManager->getVideoDriver(); - - driver->setMaterial(Material); - driver->setTransform(ETS_WORLD, AbsoluteTransformation); - driver->drawIndexedTriangleList(&Vertices[0], 4, &indices[0], 4); - } - - virtual const aabbox3d& getBoundingBox() const - { - return Box; - } - - virtual u32 getMaterialCount() - { - return 1; - } - - virtual SMaterial& getMaterial(u32 i) - { - return Material; - } -}; -#endif - -IrrlichtDevice *startup() -{ - // create device - IrrlichtDevice *device = 0; - -#ifdef _IRR_IPHONE_PLATFORM_ - AppDelegate* delegate = (AppDelegate*)[[UIApplication sharedApplication] delegate]; - - SIrrlichtCreationParameters param; - param.DriverType = EDT_OGLES2; - param.WindowSize = dimension2d(0,0); - param.WindowId = delegate.window; - param.Bits = 24; - param.ZBufferBits = 16; - param.AntiAlias = 0; - - device = createDeviceEx(param); -#elif defined(_IRR_USE_WINDOWS_CE_DEVICE_) - // set to standard mobile fullscreen 240x320 - device = createDevice(EDT_OPENGL, dimension2d(240, 320), 16, true); -#else - // on PC. use window mode - device = createDevice(EDT_OPENGL, dimension2d(240, 320), 16, false); -#endif - if (!device) - return 0; - - IVideoDriver* driver = device->getVideoDriver(); - ISceneManager* smgr = device->getSceneManager(); - IGUIEnvironment* guienv = device->getGUIEnvironment(); - -#if defined(_IRR_IPHONE_PLATFORM_) - stringc mediaPath = "media/"; -#else - stringc mediaPath = "../../media/"; -#endif - - // set the filesystem relative to the executable -#if defined (_IRR_WINDOWS_) - { - wchar_t buf[255]; - GetModuleFileNameW ( 0, buf, 255 ); - - io::path base = buf; - base = base.subString ( 0, base.findLast ( '\\' ) + 1 ); - device->getFileSystem()->addFileArchive ( base ); - } -#endif - - IGUIStaticText *text = guienv->addStaticText(L"FPS: 25", - rect(140,15,200,30), false, false, 0, 100 ); - - -#if !defined(_IRR_IPHONE_PLATFORM_) - // programmable quit button isn't allowed on iOS. - guienv->addButton(core::rect(200,10,238,30), 0, 2, L"Quit"); -#endif - - // add irrlicht logo - guienv->addImage(driver->getTexture(mediaPath + "irrlichtlogo3.png"), - core::position2d(0,-2)); - return device; -} - -/*! +/* +The start of the main function starts like in most other example. We ask the user +for the desired renderer and start it up. This time with the advanced parameter handling. */ -int run ( IrrlichtDevice *device ) -{ -#ifdef _IRR_IPHONE_PLATFORM_ - while (device) - { - NSAutoreleasePool* tPool = [[NSAutoreleasePool alloc] init]; - while(CFRunLoopRunInMode(kCFRunLoopDefaultMode, 0.002f, TRUE) == kCFRunLoopRunHandledSource); - [tPool release]; - - if(device->run()) -#else - while(device->run()) - if (device->isWindowActive()) -#endif - { - device->getVideoDriver()->beginScene(true, true, SColor(0,100,100,100)); - device->getSceneManager()->drawAll(); - device->getGUIEnvironment()->drawAll(); - device->getVideoDriver()->endScene (); - - IGUIElement *stat = device->getGUIEnvironment()-> - getRootGUIElement()->getElementFromId ( 100 ); - if ( stat ) - { - stringw str = L"FPS: "; - str += (s32)device->getVideoDriver()->getFPS(); - - stat->setText ( str.c_str() ); - } - } - -#ifndef _IRR_IPHONE_PLATFORM_ - device->drop(); -#else - else - break; - } -#endif - - return 1; -} - -#if !defined(_IRR_IPHONE_PLATFORM_) -int example_customscenenode() -{ - // create device - IrrlichtDevice *device = startup(); - if (device == 0) - return 1; // could not create selected driver. - - // create engine and camera - EventReceiver_basic receiver(device); - device->setEventReceiver(&receiver); - - IVideoDriver* driver = device->getVideoDriver(); - ISceneManager* smgr = device->getSceneManager(); - IGUIEnvironment* guienv = device->getGUIEnvironment(); - - - smgr->addCameraSceneNode(0, vector3df(0,-40,0), vector3df(0,0,0)); - - CSampleSceneNode *myNode = - new CSampleSceneNode(smgr->getRootSceneNode(), smgr, 666); - - ISceneNodeAnimator* anim = - smgr->createRotationAnimator(vector3df(0.8f, 0, 0.8f)); - - if(anim) - { - myNode->addAnimator(anim); - anim->drop(); - anim = 0; // As I shouldn't refer to it again, ensure that I can't - } - - myNode->drop(); - myNode = 0; // As I shouldn't refer to it again, ensure that I can't - - return run ( device ); -} - int example_terrain() { // create device @@ -478,46 +429,26 @@ int example_terrain() return run ( device ); } -#endif -#ifdef _IRR_IPHONE_PLATFORM_ -IrrlichtDevice* example_helloworld() -#else +/* +*/ int example_helloworld() -#endif { // create device IrrlichtDevice *device = startup(); - if (device == 0) -#ifdef _IRR_IPHONE_PLATFORM_ - return 0; -#else - return 1; -#endif + return 1; // could not create selected driver. IVideoDriver* driver = device->getVideoDriver(); ISceneManager* smgr = device->getSceneManager(); IGUIEnvironment* guienv = device->getGUIEnvironment(); -#if defined(_IRR_IPHONE_PLATFORM_) - stringc mediaPath = "media/"; -#else - stringc mediaPath = "../../media/"; -#endif - - IAnimatedMesh* mesh = smgr->getMesh(mediaPath + "sydney.md2"); - + IAnimatedMesh* mesh = smgr->getMesh("../../media/sydney.md2"); if (!mesh) { device->drop(); -#ifdef _IRR_IPHONE_PLATFORM_ - return 0; -#else - return 1; -#endif + return 1; } - IAnimatedMeshSceneNode* node = smgr->addAnimatedMeshSceneNode( mesh ); /* @@ -532,7 +463,7 @@ int example_helloworld() { node->setMaterialFlag(EMF_LIGHTING, false); node->setMD2Animation(scene::EMAT_STAND); - node->setMaterialTexture( 0, driver->getTexture(mediaPath + "sydney.bmp") ); + node->setMaterialTexture( 0, driver->getTexture("../../media/sydney.bmp") ); } /* @@ -542,98 +473,25 @@ int example_helloworld() */ smgr->addCameraSceneNode(0, vector3df(0,30,-40), vector3df(0,5,0)); -#ifdef _IRR_IPHONE_PLATFORM_ - return device; -#else EventReceiver_basic receiver(device); device->setEventReceiver(&receiver); return run ( device ); -#endif + } -#if defined (_IRR_USE_WINDOWS_CE_DEVICE_) - #pragma comment(linker, "/subsystem:WINDOWSCE /ENTRY:main") -#elif defined (_IRR_WINDOWS_) +#if defined (_IRR_WINDOWS_) #pragma comment(linker, "/subsystem:windows /ENTRY:mainCRTStartup") #endif /* */ -#ifdef _IRR_IPHONE_PLATFORM_ -@implementation AppDelegate - -@synthesize window; - -- (void)applicationDidFinishLaunching:(UIApplication*)application +int main() { - // if you need ViewController or you don't want to see warning: - // "Application windows are expected to have a root view controller - // at the end of application launch" create custom UIWindow here - // and apply your ViewController to it in following way: - // window.rootViewController = YourViewController - // it's important to do this step before createDevice method. - device = example_helloworld(); - - [self performSelectorOnMainThread:@selector(applicationUpdate) withObject:nil waitUntilDone:NO]; -} - -- (void) applicationUpdate -{ - run(device); -} - -- (void)applicationDidEnterBackground:(UIApplication *)application -{ - // you should pause rendering here, because some iOS versions, - // doesn't allow to send OpenGL rendering commands, when app - // is inactive. -} - -- (void)applicationWillEnterForeground:(UIApplication *)application -{ - // you should unpause rendering here. -} - -- (void)applicationWillResignActive:(UIApplication *)application -{ - // you should pause rendering here, because some iOS versions, - // doesn't allow to send OpenGL rendering commands, when app - // is inactive. -} - -- (void)applicationDidBecomeActive:(UIApplication *)application -{ - // you should unpause rendering here. -} - -- (void)applicationWillTerminate:(UIApplication *)application -{ - device->drop(); -} - -- (void)dealloc -{ - [window release]; - [super dealloc]; -} - -@end -#endif - -int main(int argc, char *argv[]) -{ -#ifdef _IRR_IPHONE_PLATFORM_ - NSAutoreleasePool* pool = [[NSAutoreleasePool alloc] init]; - int retVal = UIApplicationMain(argc, argv, nil, NSStringFromClass([AppDelegate class])); - [pool release]; - - return retVal; -#else - example_helloworld(); + example_helloworld (); example_customscenenode(); //example_terrain(); - - return 0; -#endif } + +/* +**/ diff --git a/examples/18.SplitScreen/SplitScreen.dev b/examples/18.SplitScreen/SplitScreen.dev deleted file mode 100644 index cd843c63..00000000 --- a/examples/18.SplitScreen/SplitScreen.dev +++ /dev/null @@ -1,59 +0,0 @@ -[Project] -FileName=example.dev -Name=Irrlicht Example 18 SplitScreen -UnitCount=1 -Type=1 -Ver=1 -ObjFiles= -Includes=..\..\include -Libs= -PrivateResource= -ResourceIncludes= -MakeIncludes= -Compiler= -CppCompiler= -Linker=../../lib/Win32-gcc/libIrrlicht.a_@@_ -IsCpp=1 -Icon= -ExeOutput=../../bin/Win32-gcc -ObjectOutput=obj -OverrideOutput=1 -OverrideOutputName=18.SplitScreen.exe -HostApplication= -Folders= -CommandLine= -IncludeVersionInfo=0 -SupportXPThemes=0 -CompilerSet=0 -CompilerSettings=0000000000000000000000 -UseCustomMakefile=0 -CustomMakefile= - -[Unit1] -FileName=main.cpp -CompileCpp=1 -Folder=Projekt1 -Compile=1 -Link=1 -Priority=1000 -OverrideBuildCmd=0 -BuildCmd= - -[VersionInfo] -Major=0 -Minor=1 -Release=1 -Build=1 -LanguageID=1033 -CharsetID=1252 -CompanyName= -FileVersion= -FileDescription=Irrlicht Engine example compiled using DevCpp and gcc -InternalName= -LegalCopyright= -LegalTrademarks= -OriginalFilename= -ProductName= -ProductVersion= -AutoIncBuildNr=0 - diff --git a/examples/18.SplitScreen/SplitScreen_vc10.vcxproj b/examples/18.SplitScreen/SplitScreen_vc10.vcxproj index a5c926ec..a0c211c7 100644 --- a/examples/18.SplitScreen/SplitScreen_vc10.vcxproj +++ b/examples/18.SplitScreen/SplitScreen_vc10.vcxproj @@ -28,18 +28,22 @@ Application MultiByte + Windows7.1SDK Application MultiByte + Windows7.1SDK Application MultiByte + Windows7.1SDK Application MultiByte + Windows7.1SDK diff --git a/examples/18.SplitScreen/SplitScreen_vc11.vcxproj b/examples/18.SplitScreen/SplitScreen_vc11.vcxproj index 954ace31..e4707c58 100644 --- a/examples/18.SplitScreen/SplitScreen_vc11.vcxproj +++ b/examples/18.SplitScreen/SplitScreen_vc11.vcxproj @@ -28,22 +28,22 @@ Application MultiByte - v110 + Windows7.1SDK Application MultiByte - v110 + Windows7.1SDK Application MultiByte - v110 + Windows7.1SDK Application MultiByte - v110 + Windows7.1SDK diff --git a/examples/18.SplitScreen/SplitScreen_vc12.vcxproj b/examples/18.SplitScreen/SplitScreen_vc12.vcxproj new file mode 100644 index 00000000..1c6c62d3 --- /dev/null +++ b/examples/18.SplitScreen/SplitScreen_vc12.vcxproj @@ -0,0 +1,194 @@ + + + + + Debug + Win32 + + + Debug + x64 + + + Release + Win32 + + + Release + x64 + + + + 18.SplitScreen + {1AB9413E-4F53-42A3-8CB2-CB4BE22336D0} + 18.SplitScreen + Win32Proj + + + + Application + MultiByte + Windows7.1SDK + + + Application + MultiByte + Windows7.1SDK + + + Application + MultiByte + Windows7.1SDK + + + Application + MultiByte + Windows7.1SDK + + + + + + + + + + + + + + + + + + + + + + + <_ProjectFileVersion>10.0.30319.1 + ..\..\bin\Win32-VisualStudio\ + ..\..\bin\Win64-VisualStudio\ + true + true + ..\..\bin\Win32-VisualStudio\ + ..\..\bin\Win64-VisualStudio\ + + + AllRules.ruleset + AllRules.ruleset + + + + + AllRules.ruleset + AllRules.ruleset + + + + + + + + Disabled + ..\..\include;%(AdditionalIncludeDirectories) + WIN32;_DEBUG;_WINDOWS;%(PreprocessorDefinitions) + true + EnableFastChecks + MultiThreadedDebug + + + Level3 + EditAndContinue + + + ..\..\bin\Win32-VisualStudio\18.SplitScreen.exe + ..\..\lib\Win32-visualstudio;%(AdditionalLibraryDirectories) + true + $(OutDir)SplitScreen.pdb + Console + + + + + + + Disabled + ..\..\include;%(AdditionalIncludeDirectories) + WIN32;WIN64;_DEBUG;_WINDOWS;%(PreprocessorDefinitions) + EnableFastChecks + MultiThreadedDebug + + + Level3 + ProgramDatabase + + + ..\..\bin\Win64-VisualStudio\18.SplitScreen.exe + ..\..\lib\Win64-visualstudio;%(AdditionalLibraryDirectories) + true + $(OutDir)SplitScreen.pdb + Console + + + + + + + true + Speed + ..\..\include;%(AdditionalIncludeDirectories) + WIN32;NDEBUG;_WINDOWS;%(PreprocessorDefinitions) + MultiThreaded + false + + + Level3 + + + Cdecl + + + ..\..\bin\Win32-VisualStudio\18.SplitScreen.exe + ..\..\lib\Win32-visualstudio;%(AdditionalLibraryDirectories) + false + Console + true + true + + + + + + + true + Speed + ..\..\include;%(AdditionalIncludeDirectories) + WIN32;WIN64;NDEBUG;_WINDOWS;%(PreprocessorDefinitions) + MultiThreaded + false + + + Level3 + + + Cdecl + + + ..\..\bin\Win64-VisualStudio\18.SplitScreen.exe + ..\..\lib\Win64-visualstudio;%(AdditionalLibraryDirectories) + false + Console + true + true + + + + + + + + + + + \ No newline at end of file diff --git a/examples/18.SplitScreen/SplitScreen_vc14.vcxproj b/examples/18.SplitScreen/SplitScreen_vc14.vcxproj new file mode 100644 index 00000000..7004b80c --- /dev/null +++ b/examples/18.SplitScreen/SplitScreen_vc14.vcxproj @@ -0,0 +1,194 @@ + + + + + Debug + Win32 + + + Debug + x64 + + + Release + Win32 + + + Release + x64 + + + + 18.SplitScreen + {1AB9413E-4F53-42A3-8CB2-CB4BE22336D0} + 18.SplitScreen + Win32Proj + + + + Application + MultiByte + v140 + + + Application + MultiByte + v140 + + + Application + MultiByte + v140 + + + Application + MultiByte + v140 + + + + + + + + + + + + + + + + + + + + + + + <_ProjectFileVersion>10.0.30319.1 + ..\..\bin\Win32-VisualStudio\ + ..\..\bin\Win64-VisualStudio\ + true + true + ..\..\bin\Win32-VisualStudio\ + ..\..\bin\Win64-VisualStudio\ + + + AllRules.ruleset + AllRules.ruleset + + + + + AllRules.ruleset + AllRules.ruleset + + + + + + + + Disabled + ..\..\include;%(AdditionalIncludeDirectories) + WIN32;_DEBUG;_WINDOWS;%(PreprocessorDefinitions) + true + EnableFastChecks + MultiThreadedDebug + + + Level3 + EditAndContinue + + + ..\..\bin\Win32-VisualStudio\18.SplitScreen.exe + ..\..\lib\Win32-visualstudio;%(AdditionalLibraryDirectories) + true + $(OutDir)SplitScreen.pdb + Console + + + + + + + Disabled + ..\..\include;%(AdditionalIncludeDirectories) + WIN32;WIN64;_DEBUG;_WINDOWS;%(PreprocessorDefinitions) + EnableFastChecks + MultiThreadedDebug + + + Level3 + ProgramDatabase + + + ..\..\bin\Win64-VisualStudio\18.SplitScreen.exe + ..\..\lib\Win64-visualstudio;%(AdditionalLibraryDirectories) + true + $(OutDir)SplitScreen.pdb + Console + + + + + + + true + Speed + ..\..\include;%(AdditionalIncludeDirectories) + WIN32;NDEBUG;_WINDOWS;%(PreprocessorDefinitions) + MultiThreaded + false + + + Level3 + + + Cdecl + + + ..\..\bin\Win32-VisualStudio\18.SplitScreen.exe + ..\..\lib\Win32-visualstudio;%(AdditionalLibraryDirectories) + false + Console + true + true + + + + + + + true + Speed + ..\..\include;%(AdditionalIncludeDirectories) + WIN32;WIN64;NDEBUG;_WINDOWS;%(PreprocessorDefinitions) + MultiThreaded + false + + + Level3 + + + Cdecl + + + ..\..\bin\Win64-VisualStudio\18.SplitScreen.exe + ..\..\lib\Win64-visualstudio;%(AdditionalLibraryDirectories) + false + Console + true + true + + + + + + + + + + + \ No newline at end of file diff --git a/examples/18.SplitScreen/SplitScreen_vc8.vcproj b/examples/18.SplitScreen/SplitScreen_vc8.vcproj deleted file mode 100644 index 906b9504..00000000 --- a/examples/18.SplitScreen/SplitScreen_vc8.vcproj +++ /dev/null @@ -1,189 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/examples/18.SplitScreen/SplitScreen_vc9.vcproj b/examples/18.SplitScreen/SplitScreen_vc9.vcproj deleted file mode 100644 index 86f6552b..00000000 --- a/examples/18.SplitScreen/SplitScreen_vc9.vcproj +++ /dev/null @@ -1,188 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/examples/18.SplitScreen/main.cpp b/examples/18.SplitScreen/main.cpp index 32266c5b..600b7bf8 100644 --- a/examples/18.SplitScreen/main.cpp +++ b/examples/18.SplitScreen/main.cpp @@ -12,6 +12,7 @@ nothing to say about it) #include #include "driverChoice.h" +#include "exampleHelper.h" #ifdef _MSC_VER #pragma comment(lib, "Irrlicht.lib") @@ -93,15 +94,17 @@ int main() ISceneManager *smgr = device->getSceneManager(); IVideoDriver *driver = device->getVideoDriver(); + const io::path mediaPath = getExampleMediaPath(); + //Load model - IAnimatedMesh *model = smgr->getMesh("../../media/sydney.md2"); + IAnimatedMesh *model = smgr->getMesh(mediaPath + "sydney.md2"); if (!model) return 1; IAnimatedMeshSceneNode *model_node = smgr->addAnimatedMeshSceneNode(model); //Load texture if (model_node) { - ITexture *texture = driver->getTexture("../../media/sydney.bmp"); + ITexture *texture = driver->getTexture(mediaPath + "sydney.bmp"); model_node->setMaterialTexture(0,texture); model_node->setMD2Animation(scene::EMAT_RUN); //Disable lighting (we've got no light) @@ -109,7 +112,7 @@ int main() } //Load map - device->getFileSystem()->addFileArchive("../../media/map-20kdm2.pk3"); + device->getFileSystem()->addFileArchive(mediaPath + "map-20kdm2.pk3"); IAnimatedMesh *map = smgr->getMesh("20kdm2.bsp"); if (map) { @@ -169,7 +172,7 @@ Sounds a little complicated, but you'll see it isn't: { //Set the viewpoint to the whole screen and begin scene driver->setViewPort(rect(0,0,ResX,ResY)); - driver->beginScene(true,true,SColor(255,100,100,100)); + driver->beginScene(video::ECBF_COLOR | video::ECBF_DEPTH, SColor(255,100,100,100)); //If SplitScreen is used if (SplitScreen) { diff --git a/examples/19.MouseAndJoystick/MouseAndJoystick.dev b/examples/19.MouseAndJoystick/MouseAndJoystick.dev deleted file mode 100644 index cac84183..00000000 --- a/examples/19.MouseAndJoystick/MouseAndJoystick.dev +++ /dev/null @@ -1,59 +0,0 @@ -[Project] -FileName=example.dev -Name=Irrlicht Example 04 MouseAndJoystick -UnitCount=1 -Type=1 -Ver=1 -ObjFiles= -Includes=..\..\include -Libs= -PrivateResource= -ResourceIncludes= -MakeIncludes= -Compiler= -CppCompiler= -Linker=../../lib/Win32-gcc/libIrrlicht.a_@@_ -IsCpp=1 -Icon= -ExeOutput=../../bin/Win32-gcc -ObjectOutput=obj -OverrideOutput=1 -OverrideOutputName=19.MouseAndJoystick.exe -HostApplication= -Folders= -CommandLine= -IncludeVersionInfo=0 -SupportXPThemes=0 -CompilerSet=0 -CompilerSettings=0000000000000000000000 -UseCustomMakefile=0 -CustomMakefile= - -[Unit1] -FileName=main.cpp -CompileCpp=1 -Folder=Projekt1 -Compile=1 -Link=1 -Priority=1000 -OverrideBuildCmd=0 -BuildCmd= - -[VersionInfo] -Major=0 -Minor=1 -Release=1 -Build=1 -LanguageID=1033 -CharsetID=1252 -CompanyName= -FileVersion= -FileDescription=Irrlicht Engine example compiled using DevCpp and gcc -InternalName= -LegalCopyright= -LegalTrademarks= -OriginalFilename= -ProductName= -ProductVersion= -AutoIncBuildNr=0 - diff --git a/examples/19.MouseAndJoystick/MouseAndJoystick_vc10.vcxproj b/examples/19.MouseAndJoystick/MouseAndJoystick_vc10.vcxproj index aaa80275..16c3a38f 100644 --- a/examples/19.MouseAndJoystick/MouseAndJoystick_vc10.vcxproj +++ b/examples/19.MouseAndJoystick/MouseAndJoystick_vc10.vcxproj @@ -27,18 +27,22 @@ Application MultiByte + Windows7.1SDK Application MultiByte + Windows7.1SDK Application MultiByte + Windows7.1SDK Application MultiByte + Windows7.1SDK diff --git a/examples/19.MouseAndJoystick/MouseAndJoystick_vc11.vcxproj b/examples/19.MouseAndJoystick/MouseAndJoystick_vc11.vcxproj index 44c2b07b..16c3a38f 100644 --- a/examples/19.MouseAndJoystick/MouseAndJoystick_vc11.vcxproj +++ b/examples/19.MouseAndJoystick/MouseAndJoystick_vc11.vcxproj @@ -27,22 +27,22 @@ Application MultiByte - v110 + Windows7.1SDK Application MultiByte - v110 + Windows7.1SDK Application MultiByte - v110 + Windows7.1SDK Application MultiByte - v110 + Windows7.1SDK diff --git a/examples/19.MouseAndJoystick/MouseAndJoystick_vc12.vcxproj b/examples/19.MouseAndJoystick/MouseAndJoystick_vc12.vcxproj new file mode 100644 index 00000000..24dca694 --- /dev/null +++ b/examples/19.MouseAndJoystick/MouseAndJoystick_vc12.vcxproj @@ -0,0 +1,231 @@ + + + + + Debug + Win32 + + + Debug + x64 + + + Release + Win32 + + + Release + x64 + + + + 19.MouseAndJoystick + {FE853A36-E0D1-4AC5-A792-B643E70D2953} + MouseAndJoystick + + + + Application + MultiByte + Windows7.1SDK + + + Application + MultiByte + Windows7.1SDK + + + Application + MultiByte + Windows7.1SDK + + + Application + MultiByte + Windows7.1SDK + + + + + + + + + + + + + + + + + + + + + + + <_ProjectFileVersion>10.0.30319.1 + ..\..\bin\Win32-VisualStudio\ + ..\..\bin\Win64-VisualStudio\ + + + ..\..\bin\Win32-VisualStudio\ + ..\..\bin\Win64-VisualStudio\ + + + AllRules.ruleset + AllRules.ruleset + + + + + AllRules.ruleset + AllRules.ruleset + + + + + + + + .\Debug/MouseAndJoystick.tlb + + + + + Disabled + ..\..\include;%(AdditionalIncludeDirectories) + WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions) + EnableFastChecks + MultiThreadedDebug + + + Level3 + EditAndContinue + + + _DEBUG;%(PreprocessorDefinitions) + 0x0c07 + + + ..\..\bin\Win32-VisualStudio\19.MouseAndJoystick.exe + ..\..\lib\Win32-visualstudio;%(AdditionalLibraryDirectories) + true + Console + + + + + + + .\Debug/MouseAndJoystick.tlb + + + + + Disabled + ..\..\include;%(AdditionalIncludeDirectories) + WIN32;WIN64;_DEBUG;_CONSOLE;%(PreprocessorDefinitions) + EnableFastChecks + MultiThreadedDebug + + + Level3 + ProgramDatabase + + + _DEBUG;%(PreprocessorDefinitions) + 0x0c07 + + + ..\..\bin\Win64-VisualStudio\19.MouseAndJoystick.exe + ..\..\lib\Win64-visualstudio;%(AdditionalLibraryDirectories) + true + Console + + + + + + + .\Release/MouseAndJoystick.tlb + + + + + MaxSpeed + OnlyExplicitInline + ..\..\include;%(AdditionalIncludeDirectories) + WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions) + true + MultiThreaded + true + + + Level3 + + + NDEBUG;%(PreprocessorDefinitions) + 0x0c07 + + + ..\..\bin\Win32-VisualStudio\19.MouseAndJoystick.exe + ..\..\lib\Win32-visualstudio;%(AdditionalLibraryDirectories) + Console + + + + + + + .\Release/MouseAndJoystick.tlb + + + + + MaxSpeed + OnlyExplicitInline + ..\..\include;%(AdditionalIncludeDirectories) + WIN32;WIN64;NDEBUG;_CONSOLE;%(PreprocessorDefinitions) + true + MultiThreaded + true + + + Level3 + + + NDEBUG;%(PreprocessorDefinitions) + 0x0c07 + + + ..\..\bin\Win64-VisualStudio\19.MouseAndJoystick.exe + ..\..\lib\Win64-visualstudio;%(AdditionalLibraryDirectories) + Console + + + + + + + Disabled + Disabled + %(AdditionalIncludeDirectories) + %(AdditionalIncludeDirectories) + %(PreprocessorDefinitions) + %(PreprocessorDefinitions) + EnableFastChecks + EnableFastChecks + MaxSpeed + MaxSpeed + %(AdditionalIncludeDirectories) + %(AdditionalIncludeDirectories) + %(PreprocessorDefinitions) + %(PreprocessorDefinitions) + + + + + + \ No newline at end of file diff --git a/examples/19.MouseAndJoystick/MouseAndJoystick_vc14.vcxproj b/examples/19.MouseAndJoystick/MouseAndJoystick_vc14.vcxproj new file mode 100644 index 00000000..1c452c59 --- /dev/null +++ b/examples/19.MouseAndJoystick/MouseAndJoystick_vc14.vcxproj @@ -0,0 +1,231 @@ + + + + + Debug + Win32 + + + Debug + x64 + + + Release + Win32 + + + Release + x64 + + + + 19.MouseAndJoystick + {FE853A36-E0D1-4AC5-A792-B643E70D2953} + MouseAndJoystick + + + + Application + MultiByte + v140 + + + Application + MultiByte + v140 + + + Application + MultiByte + v140 + + + Application + MultiByte + v140 + + + + + + + + + + + + + + + + + + + + + + + <_ProjectFileVersion>10.0.30319.1 + ..\..\bin\Win32-VisualStudio\ + ..\..\bin\Win64-VisualStudio\ + + + ..\..\bin\Win32-VisualStudio\ + ..\..\bin\Win64-VisualStudio\ + + + AllRules.ruleset + AllRules.ruleset + + + + + AllRules.ruleset + AllRules.ruleset + + + + + + + + .\Debug/MouseAndJoystick.tlb + + + + + Disabled + ..\..\include;%(AdditionalIncludeDirectories) + WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions) + EnableFastChecks + MultiThreadedDebug + + + Level3 + EditAndContinue + + + _DEBUG;%(PreprocessorDefinitions) + 0x0c07 + + + ..\..\bin\Win32-VisualStudio\19.MouseAndJoystick.exe + ..\..\lib\Win32-visualstudio;%(AdditionalLibraryDirectories) + true + Console + + + + + + + .\Debug/MouseAndJoystick.tlb + + + + + Disabled + ..\..\include;%(AdditionalIncludeDirectories) + WIN32;WIN64;_DEBUG;_CONSOLE;%(PreprocessorDefinitions) + EnableFastChecks + MultiThreadedDebug + + + Level3 + ProgramDatabase + + + _DEBUG;%(PreprocessorDefinitions) + 0x0c07 + + + ..\..\bin\Win64-VisualStudio\19.MouseAndJoystick.exe + ..\..\lib\Win64-visualstudio;%(AdditionalLibraryDirectories) + true + Console + + + + + + + .\Release/MouseAndJoystick.tlb + + + + + MaxSpeed + OnlyExplicitInline + ..\..\include;%(AdditionalIncludeDirectories) + WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions) + true + MultiThreaded + true + + + Level3 + + + NDEBUG;%(PreprocessorDefinitions) + 0x0c07 + + + ..\..\bin\Win32-VisualStudio\19.MouseAndJoystick.exe + ..\..\lib\Win32-visualstudio;%(AdditionalLibraryDirectories) + Console + + + + + + + .\Release/MouseAndJoystick.tlb + + + + + MaxSpeed + OnlyExplicitInline + ..\..\include;%(AdditionalIncludeDirectories) + WIN32;WIN64;NDEBUG;_CONSOLE;%(PreprocessorDefinitions) + true + MultiThreaded + true + + + Level3 + + + NDEBUG;%(PreprocessorDefinitions) + 0x0c07 + + + ..\..\bin\Win64-VisualStudio\19.MouseAndJoystick.exe + ..\..\lib\Win64-visualstudio;%(AdditionalLibraryDirectories) + Console + + + + + + + Disabled + Disabled + %(AdditionalIncludeDirectories) + %(AdditionalIncludeDirectories) + %(PreprocessorDefinitions) + %(PreprocessorDefinitions) + EnableFastChecks + EnableFastChecks + MaxSpeed + MaxSpeed + %(AdditionalIncludeDirectories) + %(AdditionalIncludeDirectories) + %(PreprocessorDefinitions) + %(PreprocessorDefinitions) + + + + + + \ No newline at end of file diff --git a/examples/19.MouseAndJoystick/MouseAndJoystick_vc8.vcproj b/examples/19.MouseAndJoystick/MouseAndJoystick_vc8.vcproj deleted file mode 100644 index 51b7facd..00000000 --- a/examples/19.MouseAndJoystick/MouseAndJoystick_vc8.vcproj +++ /dev/null @@ -1,231 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/examples/19.MouseAndJoystick/MouseAndJoystick_vc9.vcproj b/examples/19.MouseAndJoystick/MouseAndJoystick_vc9.vcproj deleted file mode 100644 index e121452f..00000000 --- a/examples/19.MouseAndJoystick/MouseAndJoystick_vc9.vcproj +++ /dev/null @@ -1,230 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/examples/19.MouseAndJoystick/main.cpp b/examples/19.MouseAndJoystick/main.cpp index 4563278a..faa63057 100644 --- a/examples/19.MouseAndJoystick/main.cpp +++ b/examples/19.MouseAndJoystick/main.cpp @@ -268,7 +268,7 @@ int main() // Turn lighting on and off depending on whether the left mouse button is down. node->setMaterialFlag(video::EMF_LIGHTING, receiver.GetMouseState().LeftButtonDown); - driver->beginScene(true, true, video::SColor(255,113,113,133)); + driver->beginScene(video::ECBF_COLOR | video::ECBF_DEPTH, video::SColor(255,113,113,133)); smgr->drawAll(); // draw the 3d scene driver->endScene(); } diff --git a/examples/20.ManagedLights/ManagedLights.dev b/examples/20.ManagedLights/ManagedLights.dev deleted file mode 100644 index 9804fee2..00000000 --- a/examples/20.ManagedLights/ManagedLights.dev +++ /dev/null @@ -1,59 +0,0 @@ -[Project] -FileName=example.dev -Name=Irrlicht Example 20 ManagedLights -UnitCount=1 -Type=1 -Ver=1 -ObjFiles= -Includes=..\..\include -Libs= -PrivateResource= -ResourceIncludes= -MakeIncludes= -Compiler= -CppCompiler= -Linker=../../lib/Win32-gcc/libIrrlicht.a_@@_ -IsCpp=1 -Icon= -ExeOutput=../../bin/Win32-gcc -ObjectOutput=obj -OverrideOutput=1 -OverrideOutputName=20.ManagedLights.exe -HostApplication= -Folders= -CommandLine= -IncludeVersionInfo=0 -SupportXPThemes=0 -CompilerSet=0 -CompilerSettings=0000000000000000000000 -UseCustomMakefile=0 -CustomMakefile= - -[Unit1] -FileName=main.cpp -CompileCpp=1 -Folder=Projekt1 -Compile=1 -Link=1 -Priority=1000 -OverrideBuildCmd=0 -BuildCmd= - -[VersionInfo] -Major=0 -Minor=1 -Release=1 -Build=1 -LanguageID=1033 -CharsetID=1252 -CompanyName= -FileVersion= -FileDescription=Irrlicht Engine example compiled using DevCpp and gcc -InternalName= -LegalCopyright= -LegalTrademarks= -OriginalFilename= -ProductName= -ProductVersion= -AutoIncBuildNr=0 - diff --git a/examples/20.ManagedLights/ManagedLights_vc10.vcxproj b/examples/20.ManagedLights/ManagedLights_vc10.vcxproj index 0144522e..53568a92 100644 --- a/examples/20.ManagedLights/ManagedLights_vc10.vcxproj +++ b/examples/20.ManagedLights/ManagedLights_vc10.vcxproj @@ -27,18 +27,22 @@ Application MultiByte + Windows7.1SDK Application MultiByte + Windows7.1SDK Application MultiByte + Windows7.1SDK Application MultiByte + Windows7.1SDK diff --git a/examples/20.ManagedLights/ManagedLights_vc11.vcxproj b/examples/20.ManagedLights/ManagedLights_vc11.vcxproj index 7a861292..53568a92 100644 --- a/examples/20.ManagedLights/ManagedLights_vc11.vcxproj +++ b/examples/20.ManagedLights/ManagedLights_vc11.vcxproj @@ -27,22 +27,22 @@ Application MultiByte - v110 + Windows7.1SDK Application MultiByte - v110 + Windows7.1SDK Application MultiByte - v110 + Windows7.1SDK Application MultiByte - v110 + Windows7.1SDK diff --git a/examples/20.ManagedLights/ManagedLights_vc12.vcxproj b/examples/20.ManagedLights/ManagedLights_vc12.vcxproj new file mode 100644 index 00000000..287f1b96 --- /dev/null +++ b/examples/20.ManagedLights/ManagedLights_vc12.vcxproj @@ -0,0 +1,234 @@ + + + + + Debug + Win32 + + + Debug + x64 + + + Release + Win32 + + + Release + x64 + + + + 20.ManagedLights + {16007FE2-142B-47F8-93E1-519BA3F39E71} + ManagedLights + + + + Application + MultiByte + Windows7.1SDK + + + Application + MultiByte + Windows7.1SDK + + + Application + MultiByte + Windows7.1SDK + + + Application + MultiByte + Windows7.1SDK + + + + + + + + + + + + + + + + + + + + + + + <_ProjectFileVersion>10.0.30319.1 + ..\..\bin\Win32-VisualStudio\ + ..\..\bin\Win64-VisualStudio\ + + + ..\..\bin\Win32-VisualStudio\ + ..\..\bin\Win64-VisualStudio\ + + + AllRules.ruleset + AllRules.ruleset + + + + + AllRules.ruleset + AllRules.ruleset + + + + + + + + .\Debug/ManagedLights.tlb + + + + + Disabled + ..\..\include;%(AdditionalIncludeDirectories) + WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions) + EnableFastChecks + MultiThreadedDebug + + + Level3 + EditAndContinue + + + _DEBUG;%(PreprocessorDefinitions) + 0x0c07 + + + ..\..\Lib\Win32-visualstudio\Irrlicht.lib;%(AdditionalDependencies) + ..\..\bin\Win32-VisualStudio\20.ManagedLights.exe + ..\..\lib\Win32-visualstudio;%(AdditionalLibraryDirectories) + true + Console + + + + + + + .\Debug/ManagedLights.tlb + + + + + Disabled + ..\..\include;%(AdditionalIncludeDirectories) + WIN32;WIN64;_DEBUG;_CONSOLE;%(PreprocessorDefinitions) + EnableFastChecks + MultiThreadedDebug + + + Level3 + ProgramDatabase + + + _DEBUG;%(PreprocessorDefinitions) + 0x0c07 + + + 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) + ..\..\bin\Win64-VisualStudio\20.ManagedLights.exe + ..\..\lib\Win64-visualstudio;%(AdditionalLibraryDirectories) + true + Console + + + + + + + .\Release/ManagedLights.tlb + + + + + MaxSpeed + OnlyExplicitInline + ..\..\include;%(AdditionalIncludeDirectories) + WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions) + true + MultiThreaded + true + + + Level3 + + + NDEBUG;%(PreprocessorDefinitions) + 0x0c07 + + + ..\..\bin\Win32-VisualStudio\20.ManagedLights.exe + ..\..\lib\Win32-visualstudio;%(AdditionalLibraryDirectories) + Console + + + + + + + .\Release/ManagedLights.tlb + + + + + MaxSpeed + OnlyExplicitInline + ..\..\include;%(AdditionalIncludeDirectories) + WIN32;WIN64;NDEBUG;_CONSOLE;%(PreprocessorDefinitions) + true + MultiThreaded + true + + + Level3 + + + NDEBUG;%(PreprocessorDefinitions) + 0x0c07 + + + ..\..\bin\Win64-VisualStudio\20.ManagedLights.exe + ..\..\lib\Win64-visualstudio;%(AdditionalLibraryDirectories) + Console + + + 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) + + + + + Disabled + Disabled + %(AdditionalIncludeDirectories) + %(AdditionalIncludeDirectories) + %(PreprocessorDefinitions) + %(PreprocessorDefinitions) + EnableFastChecks + EnableFastChecks + MaxSpeed + MaxSpeed + %(AdditionalIncludeDirectories) + %(AdditionalIncludeDirectories) + %(PreprocessorDefinitions) + %(PreprocessorDefinitions) + + + + + + \ No newline at end of file diff --git a/examples/20.ManagedLights/ManagedLights_vc14.vcxproj b/examples/20.ManagedLights/ManagedLights_vc14.vcxproj new file mode 100644 index 00000000..31e9e782 --- /dev/null +++ b/examples/20.ManagedLights/ManagedLights_vc14.vcxproj @@ -0,0 +1,234 @@ + + + + + Debug + Win32 + + + Debug + x64 + + + Release + Win32 + + + Release + x64 + + + + 20.ManagedLights + {16007FE2-142B-47F8-93E1-519BA3F39E71} + ManagedLights + + + + Application + MultiByte + v140 + + + Application + MultiByte + v140 + + + Application + MultiByte + v140 + + + Application + MultiByte + v140 + + + + + + + + + + + + + + + + + + + + + + + <_ProjectFileVersion>10.0.30319.1 + ..\..\bin\Win32-VisualStudio\ + ..\..\bin\Win64-VisualStudio\ + + + ..\..\bin\Win32-VisualStudio\ + ..\..\bin\Win64-VisualStudio\ + + + AllRules.ruleset + AllRules.ruleset + + + + + AllRules.ruleset + AllRules.ruleset + + + + + + + + .\Debug/ManagedLights.tlb + + + + + Disabled + ..\..\include;%(AdditionalIncludeDirectories) + WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions) + EnableFastChecks + MultiThreadedDebug + + + Level3 + EditAndContinue + + + _DEBUG;%(PreprocessorDefinitions) + 0x0c07 + + + ..\..\Lib\Win32-visualstudio\Irrlicht.lib;%(AdditionalDependencies) + ..\..\bin\Win32-VisualStudio\20.ManagedLights.exe + ..\..\lib\Win32-visualstudio;%(AdditionalLibraryDirectories) + true + Console + + + + + + + .\Debug/ManagedLights.tlb + + + + + Disabled + ..\..\include;%(AdditionalIncludeDirectories) + WIN32;WIN64;_DEBUG;_CONSOLE;%(PreprocessorDefinitions) + EnableFastChecks + MultiThreadedDebug + + + Level3 + ProgramDatabase + + + _DEBUG;%(PreprocessorDefinitions) + 0x0c07 + + + 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) + ..\..\bin\Win64-VisualStudio\20.ManagedLights.exe + ..\..\lib\Win64-visualstudio;%(AdditionalLibraryDirectories) + true + Console + + + + + + + .\Release/ManagedLights.tlb + + + + + MaxSpeed + OnlyExplicitInline + ..\..\include;%(AdditionalIncludeDirectories) + WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions) + true + MultiThreaded + true + + + Level3 + + + NDEBUG;%(PreprocessorDefinitions) + 0x0c07 + + + ..\..\bin\Win32-VisualStudio\20.ManagedLights.exe + ..\..\lib\Win32-visualstudio;%(AdditionalLibraryDirectories) + Console + + + + + + + .\Release/ManagedLights.tlb + + + + + MaxSpeed + OnlyExplicitInline + ..\..\include;%(AdditionalIncludeDirectories) + WIN32;WIN64;NDEBUG;_CONSOLE;%(PreprocessorDefinitions) + true + MultiThreaded + true + + + Level3 + + + NDEBUG;%(PreprocessorDefinitions) + 0x0c07 + + + ..\..\bin\Win64-VisualStudio\20.ManagedLights.exe + ..\..\lib\Win64-visualstudio;%(AdditionalLibraryDirectories) + Console + + + 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) + + + + + Disabled + Disabled + %(AdditionalIncludeDirectories) + %(AdditionalIncludeDirectories) + %(PreprocessorDefinitions) + %(PreprocessorDefinitions) + EnableFastChecks + EnableFastChecks + MaxSpeed + MaxSpeed + %(AdditionalIncludeDirectories) + %(AdditionalIncludeDirectories) + %(PreprocessorDefinitions) + %(PreprocessorDefinitions) + + + + + + \ No newline at end of file diff --git a/examples/20.ManagedLights/ManagedLights_vc8.vcproj b/examples/20.ManagedLights/ManagedLights_vc8.vcproj deleted file mode 100644 index 2f37f63f..00000000 --- a/examples/20.ManagedLights/ManagedLights_vc8.vcproj +++ /dev/null @@ -1,231 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/examples/20.ManagedLights/ManagedLights_vc9.vcproj b/examples/20.ManagedLights/ManagedLights_vc9.vcproj deleted file mode 100644 index 736faa65..00000000 --- a/examples/20.ManagedLights/ManagedLights_vc9.vcproj +++ /dev/null @@ -1,231 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/examples/20.ManagedLights/main.cpp b/examples/20.ManagedLights/main.cpp index f67337ab..f1fdb50d 100644 --- a/examples/20.ManagedLights/main.cpp +++ b/examples/20.ManagedLights/main.cpp @@ -8,6 +8,7 @@ node callbacks, are left out for simplicity of the example. #include #include "driverChoice.h" +#include "exampleHelper.h" using namespace irr; using namespace core; @@ -290,11 +291,13 @@ int main(int argumentCount, char * argumentValues[]) scene::ISceneManager* smgr = device->getSceneManager(); gui::IGUIEnvironment* guienv = device->getGUIEnvironment(); + const io::path mediaPath = getExampleMediaPath(); + gui::IGUISkin* skin = guienv->getSkin(); if (skin) { skin->setColor(gui::EGDC_BUTTON_TEXT, video::SColor(255, 255, 255, 255)); - gui::IGUIFont* font = guienv->getFont("../../media/fontlucida.png"); + gui::IGUIFont* font = guienv->getFont(mediaPath + "fontlucida.png"); if(font) skin->setFont(font); } @@ -325,21 +328,21 @@ Add several "zones". You could use this technique to light individual rooms, fo scene::IBillboardSceneNode * billboard = smgr->addBillboardSceneNode(node); billboard->setPosition(vector3df(0, -14, 30)); billboard->setMaterialType(video::EMT_TRANSPARENT_ADD_COLOR ); - billboard->setMaterialTexture(0, driver->getTexture("../../media/particle.bmp")); + billboard->setMaterialTexture(0, driver->getTexture(mediaPath + "particle.bmp")); billboard->setMaterialFlag(video::EMF_LIGHTING, false); smgr->addLightSceneNode(billboard, vector3df(0, 0, 0), video::SColorf(1, 0, 0), lightRadius); billboard = smgr->addBillboardSceneNode(node); billboard->setPosition(vector3df(-21, -14, -21)); billboard->setMaterialType(video::EMT_TRANSPARENT_ADD_COLOR ); - billboard->setMaterialTexture(0, driver->getTexture("../../media/particle.bmp")); + billboard->setMaterialTexture(0, driver->getTexture(mediaPath + "particle.bmp")); billboard->setMaterialFlag(video::EMF_LIGHTING, false); smgr->addLightSceneNode(billboard, vector3df(0, 0, 0), video::SColorf(0, 1, 0), lightRadius); billboard = smgr->addBillboardSceneNode(node); billboard->setPosition(vector3df(21, -14, -21)); billboard->setMaterialType(video::EMT_TRANSPARENT_ADD_COLOR ); - billboard->setMaterialTexture(0, driver->getTexture("../../media/particle.bmp")); + billboard->setMaterialTexture(0, driver->getTexture(mediaPath + "particle.bmp")); billboard->setMaterialFlag(video::EMF_LIGHTING, false); smgr->addLightSceneNode(billboard, vector3df(0, 0, 0), video::SColorf(0, 0, 1), lightRadius); @@ -359,7 +362,7 @@ Add several "zones". You could use this technique to light individual rooms, fo while(device->run()) { - driver->beginScene(true, true, video::SColor(255,100,101,140)); + driver->beginScene(video::ECBF_COLOR | video::ECBF_DEPTH, video::SColor(255,100,101,140)); smgr->drawAll(); guienv->drawAll(); driver->endScene(); diff --git a/examples/21.Quake3Explorer/Quake3Explorer.dev b/examples/21.Quake3Explorer/Quake3Explorer.dev deleted file mode 100644 index 193c6bd9..00000000 --- a/examples/21.Quake3Explorer/Quake3Explorer.dev +++ /dev/null @@ -1,99 +0,0 @@ -[Project] -FileName=Quake3Explorer.dev -Name=Irrlicht Example 21 Quake3 Explorer -UnitCount=5 -Type=1 -Ver=1 -ObjFiles= -Includes=..\..\include -Libs= -PrivateResource= -ResourceIncludes= -MakeIncludes= -Compiler= -CppCompiler= -Linker=../../lib/Win32-gcc/libIrrlicht.a_@@_ -IsCpp=1 -Icon= -ExeOutput=../../bin/Win32-gcc -ObjectOutput=obj -OverrideOutput=1 -OverrideOutputName=21.Quake3Explorer.exe -HostApplication= -Folders= -CommandLine= -IncludeVersionInfo=0 -SupportXPThemes=0 -CompilerSet=0 -CompilerSettings=0000000000000000000000 -UseCustomMakefile=0 -CustomMakefile= - -[Unit1] -FileName=main.cpp -CompileCpp=1 -Folder=Projekt1 -Compile=1 -Link=1 -Priority=1000 -OverrideBuildCmd=0 -BuildCmd= - -[VersionInfo] -Major=0 -Minor=1 -Release=1 -Build=1 -LanguageID=1033 -CharsetID=1252 -CompanyName= -FileVersion= -FileDescription=Irrlicht Engine example compiled using DevCpp and gcc -InternalName= -LegalCopyright= -LegalTrademarks= -OriginalFilename= -ProductName= -ProductVersion= -AutoIncBuildNr=0 - -[Unit2] -FileName=q3factory.cpp -CompileCpp=1 -Folder=Irrlicht Example 21 Quake3 Explorer -Compile=1 -Link=1 -Priority=1000 -OverrideBuildCmd=0 -BuildCmd= - -[Unit3] -FileName=q3factory.h -CompileCpp=1 -Folder=Irrlicht Example 21 Quake3 Explorer -Compile=1 -Link=1 -Priority=1000 -OverrideBuildCmd=0 -BuildCmd= - -[Unit4] -FileName=sound.cpp -CompileCpp=1 -Folder=Irrlicht Example 21 Quake3 Explorer -Compile=1 -Link=1 -Priority=1000 -OverrideBuildCmd=0 -BuildCmd= - -[Unit5] -FileName=sound.h -CompileCpp=1 -Folder=Irrlicht Example 21 Quake3 Explorer -Compile=1 -Link=1 -Priority=1000 -OverrideBuildCmd=0 -BuildCmd= - diff --git a/examples/21.Quake3Explorer/Quake3Explorer_vc10.vcxproj b/examples/21.Quake3Explorer/Quake3Explorer_vc10.vcxproj index 1d0a4780..6520ded2 100644 --- a/examples/21.Quake3Explorer/Quake3Explorer_vc10.vcxproj +++ b/examples/21.Quake3Explorer/Quake3Explorer_vc10.vcxproj @@ -28,18 +28,22 @@ Application MultiByte + Windows7.1SDK Application MultiByte + Windows7.1SDK Application MultiByte + Windows7.1SDK Application MultiByte + Windows7.1SDK diff --git a/examples/21.Quake3Explorer/Quake3Explorer_vc11.vcxproj b/examples/21.Quake3Explorer/Quake3Explorer_vc11.vcxproj index d0c29b2c..fd2e79a9 100644 --- a/examples/21.Quake3Explorer/Quake3Explorer_vc11.vcxproj +++ b/examples/21.Quake3Explorer/Quake3Explorer_vc11.vcxproj @@ -28,22 +28,22 @@ Application MultiByte - v110 + Windows7.1SDK Application MultiByte - v110 + Windows7.1SDK Application MultiByte - v110 + Windows7.1SDK Application MultiByte - v110 + Windows7.1SDK diff --git a/examples/21.Quake3Explorer/Quake3Explorer_vc12.vcxproj b/examples/21.Quake3Explorer/Quake3Explorer_vc12.vcxproj new file mode 100644 index 00000000..cec12893 --- /dev/null +++ b/examples/21.Quake3Explorer/Quake3Explorer_vc12.vcxproj @@ -0,0 +1,200 @@ + + + + + Debug + Win32 + + + Debug + x64 + + + Release + Win32 + + + Release + x64 + + + + 21.Quake3Explorer + {CDC4AAA9-72E1-4FFA-A04D-7EF59D8B97CD} + 21.Quake3Explorer + Win32Proj + + + + Application + MultiByte + Windows7.1SDK + + + Application + MultiByte + Windows7.1SDK + + + Application + MultiByte + Windows7.1SDK + + + Application + MultiByte + Windows7.1SDK + + + + + + + + + + + + + + + + + + + + + + + <_ProjectFileVersion>10.0.30319.1 + ..\..\bin\Win32-VisualStudio\ + ..\..\bin\Win64-VisualStudio\ + true + true + ..\..\bin\Win32-VisualStudio\ + ..\..\bin\Win64-VisualStudio\ + false + false + AllRules.ruleset + AllRules.ruleset + + + + + AllRules.ruleset + AllRules.ruleset + + + + + + + + Disabled + ..\..\include;%(AdditionalIncludeDirectories) + WIN32;_DEBUG;_WINDOWS;%(PreprocessorDefinitions) + true + EnableFastChecks + MultiThreadedDebug + + + Level3 + EditAndContinue + + + ..\..\bin\Win32-VisualStudio\21.Quake3Explorer.exe + ..\..\lib\Win32-visualstudio;%(AdditionalLibraryDirectories) + true + $(OutDir)Quake3MapShader.pdb + Console + + + + + + + Disabled + ..\..\include;%(AdditionalIncludeDirectories) + WIN32;WIN64;_DEBUG;_WINDOWS;%(PreprocessorDefinitions) + EnableFastChecks + MultiThreadedDebug + + + Level3 + ProgramDatabase + + + ..\..\bin\Win64-VisualStudio\21.Quake3Explorer.exe + ..\..\lib\Win64-visualstudio;%(AdditionalLibraryDirectories) + true + $(OutDir)Quake3MapShader.pdb + Console + + + + + + + true + Speed + ..\..\include;%(AdditionalIncludeDirectories) + WIN32;NDEBUG;_WINDOWS;%(PreprocessorDefinitions) + MultiThreaded + false + + + Level3 + + + FastCall + + + ..\..\bin\Win32-VisualStudio\21.Quake3Explorer.exe + ..\..\lib\Win32-visualstudio;%(AdditionalLibraryDirectories) + false + Console + true + true + + + + + + + true + Speed + ..\..\include;%(AdditionalIncludeDirectories) + WIN32;WIN64;NDEBUG;_WINDOWS;%(PreprocessorDefinitions) + MultiThreaded + false + + + Level3 + + + FastCall + + + ..\..\bin\Win64-VisualStudio\21.Quake3Explorer.exe + ..\..\lib\Win64-visualstudio;%(AdditionalLibraryDirectories) + false + Console + true + true + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/examples/21.Quake3Explorer/Quake3Explorer_vc14.vcxproj b/examples/21.Quake3Explorer/Quake3Explorer_vc14.vcxproj new file mode 100644 index 00000000..eadcfea5 --- /dev/null +++ b/examples/21.Quake3Explorer/Quake3Explorer_vc14.vcxproj @@ -0,0 +1,200 @@ + + + + + Debug + Win32 + + + Debug + x64 + + + Release + Win32 + + + Release + x64 + + + + 21.Quake3Explorer + {CDC4AAA9-72E1-4FFA-A04D-7EF59D8B97CD} + 21.Quake3Explorer + Win32Proj + + + + Application + MultiByte + v140 + + + Application + MultiByte + v140 + + + Application + MultiByte + v140 + + + Application + MultiByte + v140 + + + + + + + + + + + + + + + + + + + + + + + <_ProjectFileVersion>10.0.30319.1 + ..\..\bin\Win32-VisualStudio\ + ..\..\bin\Win64-VisualStudio\ + true + true + ..\..\bin\Win32-VisualStudio\ + ..\..\bin\Win64-VisualStudio\ + false + false + AllRules.ruleset + AllRules.ruleset + + + + + AllRules.ruleset + AllRules.ruleset + + + + + + + + Disabled + ..\..\include;%(AdditionalIncludeDirectories) + WIN32;_DEBUG;_WINDOWS;%(PreprocessorDefinitions) + true + EnableFastChecks + MultiThreadedDebug + + + Level3 + EditAndContinue + + + ..\..\bin\Win32-VisualStudio\21.Quake3Explorer.exe + ..\..\lib\Win32-visualstudio;%(AdditionalLibraryDirectories) + true + $(OutDir)Quake3MapShader.pdb + Console + + + + + + + Disabled + ..\..\include;%(AdditionalIncludeDirectories) + WIN32;WIN64;_DEBUG;_WINDOWS;%(PreprocessorDefinitions) + EnableFastChecks + MultiThreadedDebug + + + Level3 + ProgramDatabase + + + ..\..\bin\Win64-VisualStudio\21.Quake3Explorer.exe + ..\..\lib\Win64-visualstudio;%(AdditionalLibraryDirectories) + true + $(OutDir)Quake3MapShader.pdb + Console + + + + + + + true + Speed + ..\..\include;%(AdditionalIncludeDirectories) + WIN32;NDEBUG;_WINDOWS;%(PreprocessorDefinitions) + MultiThreaded + false + + + Level3 + + + FastCall + + + ..\..\bin\Win32-VisualStudio\21.Quake3Explorer.exe + ..\..\lib\Win32-visualstudio;%(AdditionalLibraryDirectories) + false + Console + true + true + + + + + + + true + Speed + ..\..\include;%(AdditionalIncludeDirectories) + WIN32;WIN64;NDEBUG;_WINDOWS;%(PreprocessorDefinitions) + MultiThreaded + false + + + Level3 + + + FastCall + + + ..\..\bin\Win64-VisualStudio\21.Quake3Explorer.exe + ..\..\lib\Win64-visualstudio;%(AdditionalLibraryDirectories) + false + Console + true + true + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/examples/21.Quake3Explorer/Quake3Explorer_vc8.vcproj b/examples/21.Quake3Explorer/Quake3Explorer_vc8.vcproj deleted file mode 100644 index 90450273..00000000 --- a/examples/21.Quake3Explorer/Quake3Explorer_vc8.vcproj +++ /dev/null @@ -1,210 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/examples/21.Quake3Explorer/Quake3Explorer_vc9.vcproj b/examples/21.Quake3Explorer/Quake3Explorer_vc9.vcproj deleted file mode 100644 index 36aee41e..00000000 --- a/examples/21.Quake3Explorer/Quake3Explorer_vc9.vcproj +++ /dev/null @@ -1,204 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/examples/21.Quake3Explorer/main.cpp b/examples/21.Quake3Explorer/main.cpp index ca59cd0a..23860788 100644 --- a/examples/21.Quake3Explorer/main.cpp +++ b/examples/21.Quake3Explorer/main.cpp @@ -19,8 +19,9 @@ ftp://ftp.idsoftware.com/idstuff/quake3/win32/q3ademo.exe Copyright 2006-2011 Burningwater, Thomas Alten */ -#include "driverChoice.h" #include +#include "driverChoice.h" +#include "exampleHelper.h" #include "q3factory.h" #include "sound.h" @@ -107,14 +108,16 @@ void GameData::setDefault () CurrentMapName = ""; CurrentArchiveList.clear (); + const io::path mediaPath = getExampleMediaPath(); + // Explorer Media directory - CurrentArchiveList.push_back ( StartupDir + "../../media/" ); + CurrentArchiveList.push_back ( StartupDir + mediaPath ); // Add the original quake3 files before you load your custom map // Most mods are using the original shaders, models&items&weapons CurrentArchiveList.push_back("/q/baseq3/"); - CurrentArchiveList.push_back(StartupDir + "../../media/map-20kdm2.pk3"); + CurrentArchiveList.push_back(StartupDir + mediaPath + "map-20kdm2.pk3"); } /* @@ -196,13 +199,13 @@ s32 GameData::save ( const path &filename ) if (!file) return 0; - snprintf ( buf, 128, "playerposition %.f %.f %.f\nplayerrotation %.f %.f %.f\n", + snprintf_irr ( buf, 128, "playerposition %.f %.f %.f\nplayerrotation %.f %.f %.f\n", PlayerPosition.X, PlayerPosition.Z, PlayerPosition.Y, PlayerRotation.X, PlayerRotation.Z, PlayerRotation.Y); file->write ( buf, (s32) strlen ( buf ) ); for ( i = 0; i != fs->getFileArchiveCount(); ++i ) { - snprintf ( buf, 128, "archive %s\n",stringc ( fs->getFileArchive(i)->getFileList()->getPath() ).c_str () ); + snprintf_irr ( buf, 128, "archive %s\n",stringc ( fs->getFileArchive(i)->getFileList()->getPath() ).c_str () ); file->write ( buf, (s32) strlen ( buf ) ); } @@ -327,7 +330,7 @@ void Q3Player::create ( IrrlichtDevice *device, IQ3LevelMesh* mesh, ISceneNode * s32 count = weaponMesh->getAnimationCount(); for ( s32 i = 0; i != count; ++i ) { - snprintf ( buf, 64, "Animation: %s", weaponMesh->getAnimationName(i) ); + snprintf_irr ( buf, 64, "Animation: %s", weaponMesh->getAnimationName(i) ); device->getLogger()->log(buf, ELL_INFORMATION); } } @@ -410,7 +413,7 @@ void Q3Player::setAnim ( const c8 *name ) { if ( name ) { - snprintf ( animation, 64, "%s", name ); + snprintf_irr ( animation, 64, "%s", name ); if ( WeaponNode ) { WeaponNode->setAnimationEndCallback ( this ); @@ -605,7 +608,7 @@ void CQuake3EventHandler::createTextures() data = (u32*) ( (u8*) data + image->getPitch() ); } image->unlock(); - snprintf ( buf, 64, "smoke_%02d", i ); + snprintf_irr ( buf, 64, "smoke_%02d", i ); driver->addTexture( buf, image ); image->drop (); } @@ -624,7 +627,7 @@ void CQuake3EventHandler::createTextures() data = (u32*) ( (u8*) data + image->getPitch() ); } image->unlock(); - snprintf ( buf, 64, "fog_%02d", i ); + snprintf_irr ( buf, 64, "fog_%02d", i ); driver->addTexture( buf, image ); image->drop (); } @@ -678,7 +681,6 @@ void CQuake3EventHandler::CreateGUI() env->addStaticText ( L"VideoDriver:", rect( dim.Width - 400, 24, dim.Width - 310, 40 ),false, false, gui.Window, -1, false ); gui.VideoDriver = env->addComboBox(rect( dim.Width - 300, 24, dim.Width - 10, 40 ),gui.Window); gui.VideoDriver->addItem(L"Direct3D 9.0c", EDT_DIRECT3D9 ); - gui.VideoDriver->addItem(L"Direct3D 8.1", EDT_DIRECT3D8 ); gui.VideoDriver->addItem(L"OpenGL 1.5", EDT_OPENGL); gui.VideoDriver->addItem(L"Software Renderer", EDT_OGLES1); gui.VideoDriver->addItem(L"Burning's Video (TM) Thomas Alten", EDT_BURNINGSVIDEO); @@ -713,7 +715,7 @@ void CQuake3EventHandler::CreateGUI() else if ( core::equals ( aspect, 1.6f ) ) a = "16:10 widescreen"; else if ( core::equals ( aspect, 2.133333f ) ) a = "20:9 widescreen"; - snprintf ( buf, sizeof ( buf ), "%d x %d, %s",w, h, a ); + snprintf_irr ( buf, sizeof ( buf ), "%d x %d, %s",w, h, a ); gui.VideoMode->addItem ( stringw ( buf ).c_str(), val ); } } @@ -1150,14 +1152,14 @@ void CQuake3EventHandler::addSceneTreeItem( ISceneNode * parent, IGUITreeViewNod if ( imageIndex < 0 ) { - swprintf ( msg, 128, L"%hs,%hs", + swprintf_irr ( msg, 128, L"%hs,%hs", Game->Device->getSceneManager ()->getSceneNodeTypeName ( (*it)->getType () ), (*it)->getName() ); } else { - swprintf ( msg, 128, L"%hs",(*it)->getName() ); + swprintf_irr ( msg, 128, L"%hs",(*it)->getName() ); } node = nodeParent->addChildBack( msg, 0, imageIndex ); @@ -1167,7 +1169,7 @@ void CQuake3EventHandler::addSceneTreeItem( ISceneNode * parent, IGUITreeViewNod for (; ait != (*it)->getAnimators().end(); ++ait) { imageIndex = -1; - swprintf ( msg, 128, L"%hs", + swprintf_irr ( msg, 128, L"%hs", Game->Device->getSceneManager ()->getAnimatorTypeName ( (*ait)->getType () ) ); @@ -1217,14 +1219,14 @@ void CQuake3EventHandler::AddSky( u32 dome, const c8 *texture) static const c8*p[] = { "ft", "rt", "bk", "lf", "up", "dn" }; u32 i = 0; - snprintf ( buf, 64, "%s_%s.jpg", texture, p[i] ); + snprintf_irr ( buf, 64, "%s_%s.jpg", texture, p[i] ); SkyNode = smgr->addSkyBoxSceneNode( driver->getTexture ( buf ), 0, 0, 0, 0, 0 ); if (SkyNode) { for ( i = 0; i < 6; ++i ) { - snprintf ( buf, 64, "%s_%s.jpg", texture, p[i] ); + snprintf_irr ( buf, 64, "%s_%s.jpg", texture, p[i] ); SkyNode->getMaterial(i).setTexture ( 0, driver->getTexture ( buf ) ); } } @@ -1232,7 +1234,7 @@ void CQuake3EventHandler::AddSky( u32 dome, const c8 *texture) else if ( 1 == dome ) { - snprintf ( buf, 64, "%s.jpg", texture ); + snprintf_irr ( buf, 64, "%s.jpg", texture ); SkyNode = smgr->addSkyDomeSceneNode( driver->getTexture( buf ), 32,32, 1.f, 1.f, 1000.f, 0, 11); @@ -1240,7 +1242,7 @@ void CQuake3EventHandler::AddSky( u32 dome, const c8 *texture) else if ( 2 == dome ) { - snprintf ( buf, 64, "%s.jpg", texture ); + snprintf_irr ( buf, 64, "%s.jpg", texture ); SkyNode = smgr->addSkyDomeSceneNode( driver->getTexture( buf ), 16,8, 0.95f, 2.f, 1000.f, 0, 11); @@ -1518,11 +1520,8 @@ bool CQuake3EventHandler::OnEvent(const SEvent& eve) rot = cam->getRotation (); } - static const c8 *dName[] = { "null", "software", "burning", - "d3d8", "d3d9", "opengl" }; - - snprintf(buf, 256, "%s_%ls_%.0f_%.0f_%.0f_%.0f_%.0f_%.0f.jpg", - dName[Game->Device->getVideoDriver()->getDriverType()], + snprintf_irr(buf, 256, "%s_%ls_%.0f_%.0f_%.0f_%.0f_%.0f_%.0f.jpg", + DRIVER_TYPE_NAMES_SHORT[Game->Device->getVideoDriver()->getDriverType()], Game->CurrentMapName.c_str(), pos.X, pos.Y, pos.Z, rot.X, rot.Y, rot.Z @@ -1785,7 +1784,7 @@ void CQuake3EventHandler::useItem( Q3Player * player) node->addAnimator(anim); anim->drop(); - snprintf ( buf, 64, "bullet: %s on %.1f,%1.f,%1.f", + snprintf_irr ( buf, 64, "bullet: %s on %.1f,%1.f,%1.f", imp.when ? "hit" : "nohit", end.X, end.Y, end.Z ); node->setName ( buf ); @@ -1853,7 +1852,7 @@ void CQuake3EventHandler::createParticleImpacts( u32 now ) { pas = sm->addParticleSystemSceneNode(false, BulletParent, -1, Impacts[i].pos); - snprintf ( buf, 64, "bullet impact smoke at %.1f,%.1f,%1.f", + snprintf_irr ( buf, 64, "bullet impact smoke at %.1f,%.1f,%1.f", Impacts[i].pos.X,Impacts[i].pos.Y,Impacts[i].pos.Z); pas->setName ( buf ); @@ -1929,7 +1928,7 @@ void CQuake3EventHandler::Render() if (anaglyph) { scene::ICameraSceneNode* cameraOld = Game->Device->getSceneManager()->getActiveCamera(); - driver->beginScene(true, true, SColor(0,0,0,0)); + driver->beginScene(video::ECBF_COLOR | video::ECBF_DEPTH, SColor(0,0,0,0)); driver->getOverrideMaterial().Material.ColorMask = ECP_NONE; driver->getOverrideMaterial().EnableFlags = EMF_COLOR_MASK; driver->getOverrideMaterial().EnablePasses = ESNRP_SKY_BOX + @@ -1938,7 +1937,7 @@ void CQuake3EventHandler::Render() ESNRP_TRANSPARENT_EFFECT + ESNRP_SHADOW; Game->Device->getSceneManager()->drawAll(); - driver->clearZBuffer(); + driver->clearBuffers(video::ECBF_DEPTH, video::SColor(255,0,0,0)); const vector3df oldPosition = cameraOld->getPosition(); const vector3df oldTarget = cameraOld->getTarget(); @@ -1966,7 +1965,7 @@ void CQuake3EventHandler::Render() camera->setTarget(focusPoint); Game->Device->getSceneManager()->drawAll(); - driver->clearZBuffer(); + driver->clearBuffers(video::ECBF_DEPTH, video::SColor(255, 0, 0, 0)); //Right eye... move.setTranslation( vector3df(1.5f,0.0f,0.0f) ); @@ -2000,7 +1999,7 @@ void CQuake3EventHandler::Render() } else { - driver->beginScene(true, true, SColor(0,0,0,0)); + driver->beginScene(video::ECBF_COLOR | video::ECBF_DEPTH, SColor(0,0,0,0)); Game->Device->getSceneManager()->drawAll(); } Game->Device->getGUIEnvironment()->drawAll(); @@ -2026,7 +2025,7 @@ void CQuake3EventHandler::Animate() #ifdef _IRR_SCENEMANAGER_DEBUG IAttributes * attr = Game->Device->getSceneManager()->getParameters(); - swprintf ( msg, 128, + swprintf_irr ( msg, 128, L"Q3 %s [%ls], FPS:%03d Tri:%.03fm Cull %d/%d nodes (%d,%d,%d)", Game->CurrentMapName.c_str(), driver->getName(), @@ -2039,7 +2038,7 @@ void CQuake3EventHandler::Animate() attr->getAttributeAsInt ( "drawn_transparent_effect" ) ); #else -swprintf ( msg, 128, +swprintf_irr ( msg, 128, L"Q3 %s [%ls], FPS:%03d Tri:%.03fm", Game->CurrentMapName.c_str(), driver->getName(), @@ -2049,7 +2048,7 @@ swprintf ( msg, 128, #endif Game->Device->setWindowCaption( msg ); - swprintf ( msg, 128, + swprintf_irr ( msg, 128, L"%03d fps, F1 GUI on/off, F2 respawn, F3-F6 toggle Nodes, F7 Collision on/off" L", F8 Gravity on/off, Right Mouse Toggle GUI", Game->Device->getVideoDriver()->getFPS () diff --git a/examples/21.Quake3Explorer/q3factory.cpp b/examples/21.Quake3Explorer/q3factory.cpp index 445543fc..0c98a080 100644 --- a/examples/21.Quake3Explorer/q3factory.cpp +++ b/examples/21.Quake3Explorer/q3factory.cpp @@ -331,7 +331,7 @@ void Q3ShaderFactory ( Q3LevelLoadParameter &loadParam, loadParam.startTime = device->getTimer()->getRealTime(); if ( loadParam.verbose > 1 ) { - snprintf(buf, 128, "q3shaderfactory start" ); + snprintf_irr(buf, 128, "q3shaderfactory start" ); device->getLogger()->log( buf, ELL_INFORMATION); } } @@ -402,7 +402,7 @@ void Q3ShaderFactory ( Q3LevelLoadParameter &loadParam, // show Debug Shader Name if ( showShaderName && node ) { - swprintf ( (wchar_t*) buf, 64, L"%hs:%d", node->getName(),node->getID() ); + swprintf_irr ( (wchar_t*) buf, 64, L"%hs:%d", node->getName(),node->getID() ); smgr->addBillboardTextSceneNode( font, (wchar_t*) buf, @@ -485,7 +485,7 @@ void Q3ShaderFactory ( Q3LevelLoadParameter &loadParam, if ( loadParam.verbose > 0 ) { loadParam.endTime = device->getTimer()->getRealTime (); - snprintf(buf, 128, "q3shaderfactory needed %04d ms to create %d shader nodes", + snprintf_irr(buf, 128, "q3shaderfactory needed %04d ms to create %d shader nodes", loadParam.endTime - loadParam.startTime, sceneNodeID ); @@ -594,7 +594,7 @@ void Q3ModelFactory ( Q3LevelLoadParameter &loadParam, if ( 0 == node ) { - snprintf ( buf, 128, "q3ModelFactory shader %s failed", meshBuffer->Shader.c_str() ); + snprintf_irr ( buf, 128, "q3ModelFactory shader %s failed", meshBuffer->Shader.c_str() ); device->getLogger()->log ( buf ); continue; } @@ -635,7 +635,7 @@ void Q3ModelFactory ( Q3LevelLoadParameter &loadParam, // show name if ( showShaderName ) { - swprintf ( (wchar_t*) buf, sizeof(buf) / 2, L"%hs", itemElement->key ); + swprintf_irr ( (wchar_t*) buf, sizeof(buf) / 2, L"%hs", itemElement->key ); smgr->addBillboardTextSceneNode( font, (wchar_t*) buf, diff --git a/examples/21.Quake3Explorer/sound.cpp b/examples/21.Quake3Explorer/sound.cpp index 75615c1d..f693e660 100644 --- a/examples/21.Quake3Explorer/sound.cpp +++ b/examples/21.Quake3Explorer/sound.cpp @@ -12,7 +12,7 @@ #ifdef USE_IRRKLANG #include -#ifdef _IRR_WINDOWS_ +#ifdef _MSC_VER #pragma comment (lib, "irrKlang.lib") #endif @@ -22,12 +22,12 @@ struct soundfile: public IFileReader { soundfile ( io::IReadFile* f ): file (f ) {} virtual ~soundfile () { file->drop (); } - + virtual ik_s32 read(void* buffer, ik_u32 sizeToRead) { return file->read ( buffer, sizeToRead ); } virtual bool seek(ik_s32 finalPos, bool relativeMovement = false) { return file->seek ( finalPos, relativeMovement ); } virtual ik_s32 getSize(){ return file->getSize (); } virtual ik_s32 getPos() {return file->getPos (); } - virtual const ik_c8* getFileName() { return file->getFileName (); } + virtual const ik_c8* getFileName() { return file->getFileName().c_str(); } io::IReadFile* file; }; @@ -46,7 +46,7 @@ struct klangFactory : public irrklang::IFileFactory IrrlichtDevice *Device; }; - + ISoundEngine *engine = 0; ISound *backMusic = 0; diff --git a/examples/22.MaterialViewer/MaterialViewer.dev b/examples/22.MaterialViewer/MaterialViewer.dev deleted file mode 100644 index dfd9d4db..00000000 --- a/examples/22.MaterialViewer/MaterialViewer.dev +++ /dev/null @@ -1,59 +0,0 @@ -[Project] -FileName=example.dev -Name=Irrlicht Example 22 Material Viewer -UnitCount=1 -Type=1 -Ver=1 -ObjFiles= -Includes=..\..\include -Libs= -PrivateResource= -ResourceIncludes= -MakeIncludes= -Compiler= -CppCompiler= -Linker=../../lib/Win32-gcc/libIrrlicht.a_@@_ -IsCpp=1 -Icon= -ExeOutput=../../bin/Win32-gcc -ObjectOutput=obj -OverrideOutput=1 -OverrideOutputName=22.MaterialViewer.exe -HostApplication= -Folders= -CommandLine= -IncludeVersionInfo=0 -SupportXPThemes=0 -CompilerSet=0 -CompilerSettings=0000000000000000000000 -UseCustomMakefile=0 -CustomMakefile= - -[Unit1] -FileName=main.cpp -CompileCpp=1 -Folder=Projekt1 -Compile=1 -Link=1 -Priority=1000 -OverrideBuildCmd=0 -BuildCmd= - -[VersionInfo] -Major=0 -Minor=1 -Release=1 -Build=1 -LanguageID=1033 -CharsetID=1252 -CompanyName= -FileVersion= -FileDescription=Irrlicht Engine example compiled using DevCpp and gcc -InternalName= -LegalCopyright= -LegalTrademarks= -OriginalFilename= -ProductName= -ProductVersion= -AutoIncBuildNr=0 - diff --git a/examples/22.MaterialViewer/MaterialViewer_vc10.vcxproj b/examples/22.MaterialViewer/MaterialViewer_vc10.vcxproj index f74b53db..5e5560bd 100644 --- a/examples/22.MaterialViewer/MaterialViewer_vc10.vcxproj +++ b/examples/22.MaterialViewer/MaterialViewer_vc10.vcxproj @@ -27,18 +27,22 @@ Application MultiByte + Windows7.1SDK Application MultiByte + Windows7.1SDK Application MultiByte + Windows7.1SDK Application MultiByte + Windows7.1SDK diff --git a/examples/22.MaterialViewer/MaterialViewer_vc11.vcxproj b/examples/22.MaterialViewer/MaterialViewer_vc11.vcxproj index 6ea9a2ba..582faee9 100644 --- a/examples/22.MaterialViewer/MaterialViewer_vc11.vcxproj +++ b/examples/22.MaterialViewer/MaterialViewer_vc11.vcxproj @@ -27,22 +27,22 @@ Application MultiByte - v110 + Windows7.1SDK Application MultiByte - v110 + Windows7.1SDK Application MultiByte - v110 + Windows7.1SDK Application MultiByte - v110 + Windows7.1SDK diff --git a/examples/22.MaterialViewer/MaterialViewer_vc12.vcxproj b/examples/22.MaterialViewer/MaterialViewer_vc12.vcxproj new file mode 100644 index 00000000..ca494237 --- /dev/null +++ b/examples/22.MaterialViewer/MaterialViewer_vc12.vcxproj @@ -0,0 +1,235 @@ + + + + + Debug + Win32 + + + Debug + x64 + + + Release + Win32 + + + Release + x64 + + + + 22.MaterialViewer + {4E6C2F8D-BA92-4C5B-96FD-72D4FE8BD7FA} + MaterialViewer + + + + Application + MultiByte + Windows7.1SDK + + + Application + MultiByte + Windows7.1SDK + + + Application + MultiByte + Windows7.1SDK + + + Application + MultiByte + Windows7.1SDK + + + + + + + + + + + + + + + + + + + + + + + <_ProjectFileVersion>10.0.30319.1 + ..\..\bin\Win32-VisualStudio\ + ..\..\bin\Win64-VisualStudio\ + + + ..\..\bin\Win32-VisualStudio\ + ..\..\bin\Win64-VisualStudio\ + + + AllRules.ruleset + AllRules.ruleset + + + + + AllRules.ruleset + AllRules.ruleset + + + + + + + + .\Release/MaterialViewer.tlb + + + + + MaxSpeed + OnlyExplicitInline + ..\..\include;%(AdditionalIncludeDirectories) + WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions) + true + MultiThreaded + true + + + Level3 + + + NDEBUG;%(PreprocessorDefinitions) + 0x0c07 + + + ..\..\bin\Win32-VisualStudio\22.MaterialViewer.exe + ..\..\lib\Win32-visualstudio;%(AdditionalLibraryDirectories) + .\Release/MaterialViewer.pdb + Console + + + + + + + .\Release/MaterialViewer.tlb + + + + + MaxSpeed + OnlyExplicitInline + ..\..\include;%(AdditionalIncludeDirectories) + WIN32;WIN64;NDEBUG;_CONSOLE;%(PreprocessorDefinitions) + true + MultiThreaded + true + + + Level3 + + + NDEBUG;%(PreprocessorDefinitions) + 0x0c07 + + + ..\..\bin\Win64-VisualStudio\22.MaterialViewer.exe + ..\..\lib\Win64-visualstudio;%(AdditionalLibraryDirectories) + .\Release/MaterialViewer.pdb + Console + + + + + + + .\Debug/MaterialViewer.tlb + + + + + Disabled + ..\..\include;%(AdditionalIncludeDirectories) + WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions) + EnableFastChecks + MultiThreadedDebug + + + Level3 + EditAndContinue + + + _DEBUG;%(PreprocessorDefinitions) + 0x0c07 + + + ..\..\bin\Win32-VisualStudio\22.MaterialViewer.exe + ..\..\lib\Win32-visualstudio;%(AdditionalLibraryDirectories) + true + .\Debug/MaterialViewer.pdb + Console + + + + + + + .\Debug/MaterialViewer.tlb + + + + + Disabled + ..\..\include;%(AdditionalIncludeDirectories) + WIN32;WIN64;_DEBUG;_CONSOLE;%(PreprocessorDefinitions) + EnableFastChecks + MultiThreadedDebug + + + Level3 + ProgramDatabase + + + _DEBUG;%(PreprocessorDefinitions) + 0x0c07 + + + ..\..\bin\Win64-VisualStudio\22.MaterialViewer.exe + ..\..\lib\Win64-visualstudio;%(AdditionalLibraryDirectories) + true + .\Debug/MaterialViewer.pdb + Console + + + + + + + Disabled + Disabled + %(AdditionalIncludeDirectories) + %(AdditionalIncludeDirectories) + %(PreprocessorDefinitions) + %(PreprocessorDefinitions) + EnableFastChecks + EnableFastChecks + MaxSpeed + MaxSpeed + %(AdditionalIncludeDirectories) + %(AdditionalIncludeDirectories) + %(PreprocessorDefinitions) + %(PreprocessorDefinitions) + + + + + + \ No newline at end of file diff --git a/examples/22.MaterialViewer/MaterialViewer_vc14.vcxproj b/examples/22.MaterialViewer/MaterialViewer_vc14.vcxproj new file mode 100644 index 00000000..f568176e --- /dev/null +++ b/examples/22.MaterialViewer/MaterialViewer_vc14.vcxproj @@ -0,0 +1,235 @@ + + + + + Debug + Win32 + + + Debug + x64 + + + Release + Win32 + + + Release + x64 + + + + 22.MaterialViewer + {4E6C2F8D-BA92-4C5B-96FD-72D4FE8BD7FA} + MaterialViewer + + + + Application + MultiByte + v140 + + + Application + MultiByte + v140 + + + Application + MultiByte + v140 + + + Application + MultiByte + v140 + + + + + + + + + + + + + + + + + + + + + + + <_ProjectFileVersion>10.0.30319.1 + ..\..\bin\Win32-VisualStudio\ + ..\..\bin\Win64-VisualStudio\ + + + ..\..\bin\Win32-VisualStudio\ + ..\..\bin\Win64-VisualStudio\ + + + AllRules.ruleset + AllRules.ruleset + + + + + AllRules.ruleset + AllRules.ruleset + + + + + + + + .\Release/MaterialViewer.tlb + + + + + MaxSpeed + OnlyExplicitInline + ..\..\include;%(AdditionalIncludeDirectories) + WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions) + true + MultiThreaded + true + + + Level3 + + + NDEBUG;%(PreprocessorDefinitions) + 0x0c07 + + + ..\..\bin\Win32-VisualStudio\22.MaterialViewer.exe + ..\..\lib\Win32-visualstudio;%(AdditionalLibraryDirectories) + .\Release/MaterialViewer.pdb + Console + + + + + + + .\Release/MaterialViewer.tlb + + + + + MaxSpeed + OnlyExplicitInline + ..\..\include;%(AdditionalIncludeDirectories) + WIN32;WIN64;NDEBUG;_CONSOLE;%(PreprocessorDefinitions) + true + MultiThreaded + true + + + Level3 + + + NDEBUG;%(PreprocessorDefinitions) + 0x0c07 + + + ..\..\bin\Win64-VisualStudio\22.MaterialViewer.exe + ..\..\lib\Win64-visualstudio;%(AdditionalLibraryDirectories) + .\Release/MaterialViewer.pdb + Console + + + + + + + .\Debug/MaterialViewer.tlb + + + + + Disabled + ..\..\include;%(AdditionalIncludeDirectories) + WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions) + EnableFastChecks + MultiThreadedDebug + + + Level3 + EditAndContinue + + + _DEBUG;%(PreprocessorDefinitions) + 0x0c07 + + + ..\..\bin\Win32-VisualStudio\22.MaterialViewer.exe + ..\..\lib\Win32-visualstudio;%(AdditionalLibraryDirectories) + true + .\Debug/MaterialViewer.pdb + Console + + + + + + + .\Debug/MaterialViewer.tlb + + + + + Disabled + ..\..\include;%(AdditionalIncludeDirectories) + WIN32;WIN64;_DEBUG;_CONSOLE;%(PreprocessorDefinitions) + EnableFastChecks + MultiThreadedDebug + + + Level3 + ProgramDatabase + + + _DEBUG;%(PreprocessorDefinitions) + 0x0c07 + + + ..\..\bin\Win64-VisualStudio\22.MaterialViewer.exe + ..\..\lib\Win64-visualstudio;%(AdditionalLibraryDirectories) + true + .\Debug/MaterialViewer.pdb + Console + + + + + + + Disabled + Disabled + %(AdditionalIncludeDirectories) + %(AdditionalIncludeDirectories) + %(PreprocessorDefinitions) + %(PreprocessorDefinitions) + EnableFastChecks + EnableFastChecks + MaxSpeed + MaxSpeed + %(AdditionalIncludeDirectories) + %(AdditionalIncludeDirectories) + %(PreprocessorDefinitions) + %(PreprocessorDefinitions) + + + + + + \ No newline at end of file diff --git a/examples/22.MaterialViewer/MaterialViewer_vc8.vcproj b/examples/22.MaterialViewer/MaterialViewer_vc8.vcproj deleted file mode 100644 index 1e7c0db3..00000000 --- a/examples/22.MaterialViewer/MaterialViewer_vc8.vcproj +++ /dev/null @@ -1,231 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/examples/22.MaterialViewer/MaterialViewer_vc9.vcproj b/examples/22.MaterialViewer/MaterialViewer_vc9.vcproj deleted file mode 100644 index 8ce9803b..00000000 --- a/examples/22.MaterialViewer/MaterialViewer_vc9.vcproj +++ /dev/null @@ -1,230 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/examples/22.MaterialViewer/main.cpp b/examples/22.MaterialViewer/main.cpp index d57a91be..08b7a21a 100755 --- a/examples/22.MaterialViewer/main.cpp +++ b/examples/22.MaterialViewer/main.cpp @@ -14,6 +14,7 @@ You can move the camera while left-mouse button is clicked. #include #include "driverChoice.h" +#include "exampleHelper.h" #include "main.h" using namespace irr; @@ -674,7 +675,7 @@ bool CApp::init(int argc, char *argv[]) // set a nicer font gui::IGUISkin* skin = guiEnv->getSkin(); - gui::IGUIFont* font = guiEnv->getFont("../../media/fonthaettenschweiler.bmp"); + gui::IGUIFont* font = guiEnv->getFont(getExampleMediaPath() + "fonthaettenschweiler.bmp"); if (font) skin->setFont(font); @@ -830,7 +831,7 @@ bool CApp::update() // draw everything video::SColor bkColor( skin->getColor(gui::EGDC_APP_WORKSPACE) ); - videoDriver->beginScene(true, true, bkColor); + videoDriver->beginScene(video::ECBF_COLOR | video::ECBF_DEPTH, bkColor); smgr->drawAll(); guiEnv->drawAll(); diff --git a/examples/23.SMeshHandling/SMeshHandling.dev b/examples/23.SMeshHandling/SMeshHandling.dev deleted file mode 100644 index 94043f38..00000000 --- a/examples/23.SMeshHandling/SMeshHandling.dev +++ /dev/null @@ -1,59 +0,0 @@ -[Project] -FileName=example.dev -Name=Irrlicht Example 23 SMeshHandling -UnitCount=1 -Type=1 -Ver=1 -ObjFiles= -Includes=..\..\include -Libs= -PrivateResource= -ResourceIncludes= -MakeIncludes= -Compiler= -CppCompiler= -Linker=../../lib/Win32-gcc/libIrrlicht.a_@@_ -IsCpp=1 -Icon= -ExeOutput=../../bin/Win32-gcc -ObjectOutput=obj -OverrideOutput=1 -OverrideOutputName=23.SMeshHandling.exe -HostApplication= -Folders= -CommandLine= -IncludeVersionInfo=0 -SupportXPThemes=0 -CompilerSet=0 -CompilerSettings=0000000000000000000000 -UseCustomMakefile=0 -CustomMakefile= - -[Unit1] -FileName=main.cpp -CompileCpp=1 -Folder=Projekt1 -Compile=1 -Link=1 -Priority=1000 -OverrideBuildCmd=0 -BuildCmd= - -[VersionInfo] -Major=0 -Minor=1 -Release=1 -Build=1 -LanguageID=1033 -CharsetID=1252 -CompanyName= -FileVersion= -FileDescription=Irrlicht Engine example compiled using DevCpp and gcc -InternalName= -LegalCopyright= -LegalTrademarks= -OriginalFilename= -ProductName= -ProductVersion= -AutoIncBuildNr=0 - diff --git a/examples/23.SMeshHandling/SMeshHandling_vc10.vcxproj b/examples/23.SMeshHandling/SMeshHandling_vc10.vcxproj index 4af5ad0d..949f1ce6 100644 --- a/examples/23.SMeshHandling/SMeshHandling_vc10.vcxproj +++ b/examples/23.SMeshHandling/SMeshHandling_vc10.vcxproj @@ -28,18 +28,22 @@ Application MultiByte + Windows7.1SDK Application MultiByte + Windows7.1SDK Application MultiByte + Windows7.1SDK Application MultiByte + Windows7.1SDK diff --git a/examples/23.SMeshHandling/SMeshHandling_vc11.vcxproj b/examples/23.SMeshHandling/SMeshHandling_vc11.vcxproj index 7f2a7811..83332f4d 100644 --- a/examples/23.SMeshHandling/SMeshHandling_vc11.vcxproj +++ b/examples/23.SMeshHandling/SMeshHandling_vc11.vcxproj @@ -28,22 +28,22 @@ Application MultiByte - v110 + Windows7.1SDK Application MultiByte - v110 + Windows7.1SDK Application MultiByte - v110 + Windows7.1SDK Application MultiByte - v110 + Windows7.1SDK diff --git a/examples/23.SMeshHandling/SMeshHandling_vc12.vcxproj b/examples/23.SMeshHandling/SMeshHandling_vc12.vcxproj new file mode 100644 index 00000000..46b2382c --- /dev/null +++ b/examples/23.SMeshHandling/SMeshHandling_vc12.vcxproj @@ -0,0 +1,192 @@ + + + + + Debug + Win32 + + + Debug + x64 + + + Release + Win32 + + + Release + x64 + + + + 23.SMeshHandling + {6AEC2AA2-C9FF-4B7D-B07A-94A9D34B41D7} + 23.SMeshHandling + Win32Proj + + + + Application + MultiByte + Windows7.1SDK + + + Application + MultiByte + Windows7.1SDK + + + Application + MultiByte + Windows7.1SDK + + + Application + MultiByte + Windows7.1SDK + + + + + + + + + + + + + + + + + + + + + + + <_ProjectFileVersion>10.0.30319.1 + ..\..\bin\Win32-VisualStudio\ + ..\..\bin\Win64-VisualStudio\ + true + true + ..\..\bin\Win32-VisualStudio\ + ..\..\bin\Win64-VisualStudio\ + false + false + AllRules.ruleset + AllRules.ruleset + + + + + AllRules.ruleset + AllRules.ruleset + + + + + + + + Disabled + ..\..\include;%(AdditionalIncludeDirectories) + WIN32;_DEBUG;_WINDOWS;%(PreprocessorDefinitions) + true + EnableFastChecks + MultiThreadedDebug + + + Level3 + EditAndContinue + + + ..\..\bin\Win32-VisualStudio\23.SMeshHandling.exe + ..\..\lib\Win32-visualstudio;%(AdditionalLibraryDirectories) + true + $(OutDir)SMeshHandling.pdb + Console + + + + + + + Disabled + ..\..\include;%(AdditionalIncludeDirectories) + WIN32;WIN64;_DEBUG;_WINDOWS;%(PreprocessorDefinitions) + EnableFastChecks + MultiThreadedDebug + + + Level3 + ProgramDatabase + + + ..\..\bin\Win64-VisualStudio\23.SMeshHandling.exe + ..\..\lib\Win64-visualstudio;%(AdditionalLibraryDirectories) + true + $(OutDir)SMeshHandling.pdb + Console + + + + + + + true + Speed + ..\..\include;%(AdditionalIncludeDirectories) + WIN32;NDEBUG;_WINDOWS;%(PreprocessorDefinitions) + Sync + + + Level3 + + + Cdecl + + + ..\..\bin\Win32-VisualStudio\23.SMeshHandling.exe + ..\..\lib\Win32-visualstudio;%(AdditionalLibraryDirectories) + false + Console + true + true + + + + + + + true + Speed + ..\..\include;%(AdditionalIncludeDirectories) + WIN32;WIN64;NDEBUG;_WINDOWS;%(PreprocessorDefinitions) + Sync + + + Level3 + + + Cdecl + + + ..\..\bin\Win64-VisualStudio\23.SMeshHandling.exe + ..\..\lib\Win64-visualstudio;%(AdditionalLibraryDirectories) + false + Console + true + true + + + + + + + + + + + \ No newline at end of file diff --git a/examples/23.SMeshHandling/SMeshHandling_vc14.vcxproj b/examples/23.SMeshHandling/SMeshHandling_vc14.vcxproj new file mode 100644 index 00000000..6c9b712b --- /dev/null +++ b/examples/23.SMeshHandling/SMeshHandling_vc14.vcxproj @@ -0,0 +1,192 @@ + + + + + Debug + Win32 + + + Debug + x64 + + + Release + Win32 + + + Release + x64 + + + + 23.SMeshHandling + {6AEC2AA2-C9FF-4B7D-B07A-94A9D34B41D7} + 23.SMeshHandling + Win32Proj + + + + Application + MultiByte + v140 + + + Application + MultiByte + v140 + + + Application + MultiByte + v140 + + + Application + MultiByte + v140 + + + + + + + + + + + + + + + + + + + + + + + <_ProjectFileVersion>10.0.30319.1 + ..\..\bin\Win32-VisualStudio\ + ..\..\bin\Win64-VisualStudio\ + true + true + ..\..\bin\Win32-VisualStudio\ + ..\..\bin\Win64-VisualStudio\ + false + false + AllRules.ruleset + AllRules.ruleset + + + + + AllRules.ruleset + AllRules.ruleset + + + + + + + + Disabled + ..\..\include;%(AdditionalIncludeDirectories) + WIN32;_DEBUG;_WINDOWS;%(PreprocessorDefinitions) + true + EnableFastChecks + MultiThreadedDebug + + + Level3 + EditAndContinue + + + ..\..\bin\Win32-VisualStudio\23.SMeshHandling.exe + ..\..\lib\Win32-visualstudio;%(AdditionalLibraryDirectories) + true + $(OutDir)SMeshHandling.pdb + Console + + + + + + + Disabled + ..\..\include;%(AdditionalIncludeDirectories) + WIN32;WIN64;_DEBUG;_WINDOWS;%(PreprocessorDefinitions) + EnableFastChecks + MultiThreadedDebug + + + Level3 + ProgramDatabase + + + ..\..\bin\Win64-VisualStudio\23.SMeshHandling.exe + ..\..\lib\Win64-visualstudio;%(AdditionalLibraryDirectories) + true + $(OutDir)SMeshHandling.pdb + Console + + + + + + + true + Speed + ..\..\include;%(AdditionalIncludeDirectories) + WIN32;NDEBUG;_WINDOWS;%(PreprocessorDefinitions) + Sync + + + Level3 + + + Cdecl + + + ..\..\bin\Win32-VisualStudio\23.SMeshHandling.exe + ..\..\lib\Win32-visualstudio;%(AdditionalLibraryDirectories) + false + Console + true + true + + + + + + + true + Speed + ..\..\include;%(AdditionalIncludeDirectories) + WIN32;WIN64;NDEBUG;_WINDOWS;%(PreprocessorDefinitions) + Sync + + + Level3 + + + Cdecl + + + ..\..\bin\Win64-VisualStudio\23.SMeshHandling.exe + ..\..\lib\Win64-visualstudio;%(AdditionalLibraryDirectories) + false + Console + true + true + + + + + + + + + + + \ No newline at end of file diff --git a/examples/23.SMeshHandling/SMeshHandling_vc8.vcproj b/examples/23.SMeshHandling/SMeshHandling_vc8.vcproj deleted file mode 100644 index ecc91356..00000000 --- a/examples/23.SMeshHandling/SMeshHandling_vc8.vcproj +++ /dev/null @@ -1,190 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/examples/23.SMeshHandling/SMeshHandling_vc9.vcproj b/examples/23.SMeshHandling/SMeshHandling_vc9.vcproj deleted file mode 100644 index b1b921ef..00000000 --- a/examples/23.SMeshHandling/SMeshHandling_vc9.vcproj +++ /dev/null @@ -1,187 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/examples/23.SMeshHandling/main.cpp b/examples/23.SMeshHandling/main.cpp index c3c2ccf8..2baa1d95 100644 --- a/examples/23.SMeshHandling/main.cpp +++ b/examples/23.SMeshHandling/main.cpp @@ -411,7 +411,7 @@ int main(int argc, char* argv[]) mesh.init(hm, 50.f, yellow, driver); } - driver->beginScene(true, true, SColor(0xff000000)); + driver->beginScene(video::ECBF_COLOR | video::ECBF_DEPTH, SColor(0xff000000)); smgr->drawAll(); driver->endScene(); } diff --git a/examples/24.CursorControl/CursorControl_vc10.vcxproj b/examples/24.CursorControl/CursorControl_vc10.vcxproj index 0ca57a94..913c520a 100644 --- a/examples/24.CursorControl/CursorControl_vc10.vcxproj +++ b/examples/24.CursorControl/CursorControl_vc10.vcxproj @@ -28,18 +28,22 @@ Application MultiByte + Windows7.1SDK Application MultiByte + Windows7.1SDK Application MultiByte + Windows7.1SDK Application MultiByte + Windows7.1SDK diff --git a/examples/24.CursorControl/CursorControl_vc11.vcxproj b/examples/24.CursorControl/CursorControl_vc11.vcxproj index 362f064f..7eadc6f1 100644 --- a/examples/24.CursorControl/CursorControl_vc11.vcxproj +++ b/examples/24.CursorControl/CursorControl_vc11.vcxproj @@ -28,22 +28,22 @@ Application MultiByte - v110 + Windows7.1SDK Application MultiByte - v110 + Windows7.1SDK Application MultiByte - v110 + Windows7.1SDK Application MultiByte - v110 + Windows7.1SDK diff --git a/examples/24.CursorControl/CursorControl_vc12.vcxproj b/examples/24.CursorControl/CursorControl_vc12.vcxproj new file mode 100644 index 00000000..26fdf871 --- /dev/null +++ b/examples/24.CursorControl/CursorControl_vc12.vcxproj @@ -0,0 +1,188 @@ + + + + + Debug + Win32 + + + Debug + x64 + + + Release + Win32 + + + Release + x64 + + + + 24.CursorControl + {02B67A37-50E1-49DB-BECF-905BC029C2FE} + 24.CursorControl + Win32Proj + + + + Application + MultiByte + Windows7.1SDK + + + Application + MultiByte + Windows7.1SDK + + + Application + MultiByte + Windows7.1SDK + + + Application + MultiByte + Windows7.1SDK + + + + + + + + + + + + + + + + + + + + + + + <_ProjectFileVersion>10.0.30319.1 + ..\..\bin\Win32-VisualStudio\ + ..\..\bin\Win64-VisualStudio\ + ..\..\bin\Win32-VisualStudio\ + ..\..\bin\Win64-VisualStudio\ + AllRules.ruleset + AllRules.ruleset + + + + + AllRules.ruleset + AllRules.ruleset + + + + + + + + Disabled + ..\..\include;%(AdditionalIncludeDirectories) + WIN32;_DEBUG;_WINDOWS;%(PreprocessorDefinitions) + true + EnableFastChecks + MultiThreadedDebug + + + Level3 + EditAndContinue + + + ..\..\bin\Win32-VisualStudio\24.CursorControl.exe + ..\..\lib\Win32-visualstudio;%(AdditionalLibraryDirectories) + true + $(OutDir)CursorControl.pdb + Console + + + + + + + Disabled + ..\..\include;%(AdditionalIncludeDirectories) + WIN32;WIN64;_DEBUG;_WINDOWS;%(PreprocessorDefinitions) + EnableFastChecks + MultiThreadedDebug + + + Level3 + ProgramDatabase + + + ..\..\bin\Win64-VisualStudio\24.CursorControl.exe + ..\..\lib\Win64-visualstudio;%(AdditionalLibraryDirectories) + true + $(OutDir)CursorControl.pdb + Console + + + + + + + true + Speed + ..\..\include;%(AdditionalIncludeDirectories) + WIN32;NDEBUG;_WINDOWS;%(PreprocessorDefinitions) + Sync + + + Level3 + + + Cdecl + + + ..\..\bin\Win32-VisualStudio\24.CursorControl.exe + ..\..\lib\Win32-visualstudio;%(AdditionalLibraryDirectories) + false + Console + true + true + + + + + + + true + Speed + ..\..\include;%(AdditionalIncludeDirectories) + WIN32;WIN64;NDEBUG;_WINDOWS;%(PreprocessorDefinitions) + Sync + + + Level3 + + + Cdecl + + + ..\..\bin\Win64-VisualStudio\24.CursorControl.exe + ..\..\lib\Win64-visualstudio;%(AdditionalLibraryDirectories) + false + Console + true + true + + + + + + + + + + + \ No newline at end of file diff --git a/examples/24.CursorControl/CursorControl_vc14.vcxproj b/examples/24.CursorControl/CursorControl_vc14.vcxproj new file mode 100644 index 00000000..40a0a88e --- /dev/null +++ b/examples/24.CursorControl/CursorControl_vc14.vcxproj @@ -0,0 +1,188 @@ + + + + + Debug + Win32 + + + Debug + x64 + + + Release + Win32 + + + Release + x64 + + + + 24.CursorControl + {02B67A37-50E1-49DB-BECF-905BC029C2FE} + 24.CursorControl + Win32Proj + + + + Application + MultiByte + v140 + + + Application + MultiByte + v140 + + + Application + MultiByte + v140 + + + Application + MultiByte + v140 + + + + + + + + + + + + + + + + + + + + + + + <_ProjectFileVersion>10.0.30319.1 + ..\..\bin\Win32-VisualStudio\ + ..\..\bin\Win64-VisualStudio\ + ..\..\bin\Win32-VisualStudio\ + ..\..\bin\Win64-VisualStudio\ + AllRules.ruleset + AllRules.ruleset + + + + + AllRules.ruleset + AllRules.ruleset + + + + + + + + Disabled + ..\..\include;%(AdditionalIncludeDirectories) + WIN32;_DEBUG;_WINDOWS;%(PreprocessorDefinitions) + true + EnableFastChecks + MultiThreadedDebug + + + Level3 + EditAndContinue + + + ..\..\bin\Win32-VisualStudio\24.CursorControl.exe + ..\..\lib\Win32-visualstudio;%(AdditionalLibraryDirectories) + true + $(OutDir)CursorControl.pdb + Console + + + + + + + Disabled + ..\..\include;%(AdditionalIncludeDirectories) + WIN32;WIN64;_DEBUG;_WINDOWS;%(PreprocessorDefinitions) + EnableFastChecks + MultiThreadedDebug + + + Level3 + ProgramDatabase + + + ..\..\bin\Win64-VisualStudio\24.CursorControl.exe + ..\..\lib\Win64-visualstudio;%(AdditionalLibraryDirectories) + true + $(OutDir)CursorControl.pdb + Console + + + + + + + true + Speed + ..\..\include;%(AdditionalIncludeDirectories) + WIN32;NDEBUG;_WINDOWS;%(PreprocessorDefinitions) + Sync + + + Level3 + + + Cdecl + + + ..\..\bin\Win32-VisualStudio\24.CursorControl.exe + ..\..\lib\Win32-visualstudio;%(AdditionalLibraryDirectories) + false + Console + true + true + + + + + + + true + Speed + ..\..\include;%(AdditionalIncludeDirectories) + WIN32;WIN64;NDEBUG;_WINDOWS;%(PreprocessorDefinitions) + Sync + + + Level3 + + + Cdecl + + + ..\..\bin\Win64-VisualStudio\24.CursorControl.exe + ..\..\lib\Win64-visualstudio;%(AdditionalLibraryDirectories) + false + Console + true + true + + + + + + + + + + + \ No newline at end of file diff --git a/examples/24.CursorControl/CursorControl_vc8.vcproj b/examples/24.CursorControl/CursorControl_vc8.vcproj deleted file mode 100644 index 61489427..00000000 --- a/examples/24.CursorControl/CursorControl_vc8.vcproj +++ /dev/null @@ -1,190 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/examples/24.CursorControl/CursorControl_vc9.vcproj b/examples/24.CursorControl/CursorControl_vc9.vcproj deleted file mode 100644 index 90ebf1fd..00000000 --- a/examples/24.CursorControl/CursorControl_vc9.vcproj +++ /dev/null @@ -1,185 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/examples/24.CursorControl/main.cpp b/examples/24.CursorControl/main.cpp index ff7c16f2..22c22cb7 100644 --- a/examples/24.CursorControl/main.cpp +++ b/examples/24.CursorControl/main.cpp @@ -6,6 +6,7 @@ It can also be used for experiments with the mouse in general. #include #include "driverChoice.h" +#include "exampleHelper.h" using namespace irr; using namespace core; @@ -14,7 +15,7 @@ using namespace video; using namespace io; using namespace gui; -#ifdef _IRR_WINDOWS_ +#ifdef _MSC_VER #pragma comment(lib, "Irrlicht.lib") #endif @@ -472,13 +473,15 @@ int main() SpriteBankIcons = env->addEmptySpriteBank(io::path("cursor_icons")); context.SpriteBox->setSpriteBank(SpriteBankIcons); + const io::path mediaPath = getExampleMediaPath(); + // create one animated icon from several files array< io::path > files; - files.push_back( io::path("../../media/icon_crosshairs16x16bw1.png") ); - files.push_back( io::path("../../media/icon_crosshairs16x16bw2.png") ); - files.push_back( io::path("../../media/icon_crosshairs16x16bw3.png") ); - files.push_back( io::path("../../media/icon_crosshairs16x16bw3.png") ); - files.push_back( io::path("../../media/icon_crosshairs16x16bw2.png") ); + files.push_back( io::path(mediaPath + "icon_crosshairs16x16bw1.png") ); + files.push_back( io::path(mediaPath + "icon_crosshairs16x16bw2.png") ); + files.push_back( io::path(mediaPath + "icon_crosshairs16x16bw3.png") ); + files.push_back( io::path(mediaPath + "icon_crosshairs16x16bw3.png") ); + files.push_back( io::path(mediaPath + "icon_crosshairs16x16bw2.png") ); SCursorSprite spriteBw; // the sprite + some additional information needed for cursors spriteBw.SpriteId = AddAnimatedIconToSpriteBank( SpriteBankIcons, driver, files, 200 ); spriteBw.SpriteBank = SpriteBankIcons; @@ -493,7 +496,7 @@ int main() iconRects.push_back( rect(0,16, 16, 32) ); iconRects.push_back( rect(16,0, 32, 16) ); SCursorSprite spriteCol; // the sprite + some additional information needed for cursors - spriteCol.SpriteId = AddAnimatedIconToSpriteBank( SpriteBankIcons, driver, io::path("../../media/icon_crosshairs16x16col.png"), iconRects, 200 ); + spriteCol.SpriteId = AddAnimatedIconToSpriteBank( SpriteBankIcons, driver, io::path(mediaPath + "icon_crosshairs16x16col.png"), iconRects, 200 ); spriteCol.HotSpot = position2d(7,7); spriteCol.SpriteBank = SpriteBankIcons; context.addIcon(L"crosshair_colored", spriteCol); @@ -503,15 +506,15 @@ int main() SCursorSprite spriteNonAnimated(SpriteBankIcons, 0, position2d(7,7)); rectIcon = rect(0,0, 16, 16); - spriteNonAnimated.SpriteId = AddIconToSpriteBank( SpriteBankIcons, driver, io::path("../../media/icon_crosshairs16x16col.png"), rectIcon ); + spriteNonAnimated.SpriteId = AddIconToSpriteBank( SpriteBankIcons, driver, io::path(mediaPath + "icon_crosshairs16x16col.png"), rectIcon ); context.addIcon(L"crosshair_col1", spriteNonAnimated, false); rectIcon = rect(16,0, 32, 16); - spriteNonAnimated.SpriteId = AddIconToSpriteBank( SpriteBankIcons, driver, io::path("../../media/icon_crosshairs16x16col.png"), rectIcon ); + spriteNonAnimated.SpriteId = AddIconToSpriteBank( SpriteBankIcons, driver, io::path(mediaPath + "icon_crosshairs16x16col.png"), rectIcon ); context.addIcon(L"crosshair_col2", spriteNonAnimated, false); rectIcon = rect(0,16, 16, 32); - spriteNonAnimated.SpriteId = AddIconToSpriteBank( SpriteBankIcons, driver, io::path("../../media/icon_crosshairs16x16col.png"), rectIcon ); + spriteNonAnimated.SpriteId = AddIconToSpriteBank( SpriteBankIcons, driver, io::path(mediaPath + "icon_crosshairs16x16col.png"), rectIcon ); context.addIcon(L"crosshair_col3", spriteNonAnimated, false); @@ -526,7 +529,7 @@ int main() context.update(); - driver->beginScene(true, true, SColor(0,200,200,200)); + driver->beginScene(video::ECBF_COLOR | video::ECBF_DEPTH, SColor(0,200,200,200)); env->drawAll(); diff --git a/examples/25.XmlHandling/XmlHandling_vc10.vcxproj b/examples/25.XmlHandling/XmlHandling_vc10.vcxproj index 2f550a14..43f9e73f 100644 --- a/examples/25.XmlHandling/XmlHandling_vc10.vcxproj +++ b/examples/25.XmlHandling/XmlHandling_vc10.vcxproj @@ -28,18 +28,22 @@ Application MultiByte + Windows7.1SDK Application MultiByte + Windows7.1SDK Application MultiByte + Windows7.1SDK Application MultiByte + Windows7.1SDK diff --git a/examples/25.XmlHandling/XmlHandling_vc11.vcxproj b/examples/25.XmlHandling/XmlHandling_vc11.vcxproj index b150b959..43f9e73f 100644 --- a/examples/25.XmlHandling/XmlHandling_vc11.vcxproj +++ b/examples/25.XmlHandling/XmlHandling_vc11.vcxproj @@ -28,22 +28,22 @@ Application MultiByte - v110 + Windows7.1SDK Application MultiByte - v110 + Windows7.1SDK Application MultiByte - v110 + Windows7.1SDK Application MultiByte - v110 + Windows7.1SDK diff --git a/examples/25.XmlHandling/XmlHandling_vc12.vcxproj b/examples/25.XmlHandling/XmlHandling_vc12.vcxproj new file mode 100644 index 00000000..53546373 --- /dev/null +++ b/examples/25.XmlHandling/XmlHandling_vc12.vcxproj @@ -0,0 +1,182 @@ + + + + + Debug + Win32 + + + Debug + x64 + + + Release + Win32 + + + Release + x64 + + + + 25.XmlHandling + {8FDA260E-EF27-4F8C-8720-7AF707DD0D9E} + 25.XmlHandling + Win32Proj + + + + Application + MultiByte + Windows7.1SDK + + + Application + MultiByte + Windows7.1SDK + + + Application + MultiByte + Windows7.1SDK + + + Application + MultiByte + Windows7.1SDK + + + + + + + + + + + + + + + + + + + + + + + <_ProjectFileVersion>10.0.30319.1 + ..\..\bin\Win32-VisualStudio\ + ..\..\bin\Win64-VisualStudio\ + ..\..\bin\Win32-VisualStudio\ + ..\..\bin\Win64-VisualStudio\ + AllRules.ruleset + AllRules.ruleset + + + + + AllRules.ruleset + AllRules.ruleset + + + + + + + + Disabled + ..\..\include;%(AdditionalIncludeDirectories) + WIN32;_DEBUG;_WINDOWS;%(PreprocessorDefinitions) + true + EnableFastChecks + MultiThreadedDebug + + + Level3 + EditAndContinue + + + ..\..\lib\Win32-visualstudio;%(AdditionalLibraryDirectories) + true + Console + + + + + + + Disabled + ..\..\include;%(AdditionalIncludeDirectories) + WIN32;WIN64;_DEBUG;_WINDOWS;%(PreprocessorDefinitions) + EnableFastChecks + MultiThreadedDebug + + + Level3 + ProgramDatabase + + + ..\..\lib\Win64-visualstudio;%(AdditionalLibraryDirectories) + true + Console + + + + + + + true + Speed + ..\..\include;%(AdditionalIncludeDirectories) + WIN32;NDEBUG;_WINDOWS;%(PreprocessorDefinitions) + false + + + Level3 + + + Cdecl + + + ..\..\lib\Win32-visualstudio;%(AdditionalLibraryDirectories) + false + Console + true + true + + + + + + + true + Speed + ..\..\include;%(AdditionalIncludeDirectories) + WIN32;WIN64;NDEBUG;_WINDOWS;%(PreprocessorDefinitions) + false + + + Level3 + + + Cdecl + + + ..\..\lib\Win64-visualstudio;%(AdditionalLibraryDirectories) + false + Console + true + true + + + + + + + + + + + \ No newline at end of file diff --git a/examples/25.XmlHandling/XmlHandling_vc14.vcxproj b/examples/25.XmlHandling/XmlHandling_vc14.vcxproj new file mode 100644 index 00000000..4fdb56a3 --- /dev/null +++ b/examples/25.XmlHandling/XmlHandling_vc14.vcxproj @@ -0,0 +1,182 @@ + + + + + Debug + Win32 + + + Debug + x64 + + + Release + Win32 + + + Release + x64 + + + + 25.XmlHandling + {8FDA260E-EF27-4F8C-8720-7AF707DD0D9E} + 25.XmlHandling + Win32Proj + + + + Application + MultiByte + v140 + + + Application + MultiByte + v140 + + + Application + MultiByte + v140 + + + Application + MultiByte + v140 + + + + + + + + + + + + + + + + + + + + + + + <_ProjectFileVersion>10.0.30319.1 + ..\..\bin\Win32-VisualStudio\ + ..\..\bin\Win64-VisualStudio\ + ..\..\bin\Win32-VisualStudio\ + ..\..\bin\Win64-VisualStudio\ + AllRules.ruleset + AllRules.ruleset + + + + + AllRules.ruleset + AllRules.ruleset + + + + + + + + Disabled + ..\..\include;%(AdditionalIncludeDirectories) + WIN32;_DEBUG;_WINDOWS;%(PreprocessorDefinitions) + true + EnableFastChecks + MultiThreadedDebug + + + Level3 + EditAndContinue + + + ..\..\lib\Win32-visualstudio;%(AdditionalLibraryDirectories) + true + Console + + + + + + + Disabled + ..\..\include;%(AdditionalIncludeDirectories) + WIN32;WIN64;_DEBUG;_WINDOWS;%(PreprocessorDefinitions) + EnableFastChecks + MultiThreadedDebug + + + Level3 + ProgramDatabase + + + ..\..\lib\Win64-visualstudio;%(AdditionalLibraryDirectories) + true + Console + + + + + + + true + Speed + ..\..\include;%(AdditionalIncludeDirectories) + WIN32;NDEBUG;_WINDOWS;%(PreprocessorDefinitions) + false + + + Level3 + + + Cdecl + + + ..\..\lib\Win32-visualstudio;%(AdditionalLibraryDirectories) + false + Console + true + true + + + + + + + true + Speed + ..\..\include;%(AdditionalIncludeDirectories) + WIN32;WIN64;NDEBUG;_WINDOWS;%(PreprocessorDefinitions) + false + + + Level3 + + + Cdecl + + + ..\..\lib\Win64-visualstudio;%(AdditionalLibraryDirectories) + false + Console + true + true + + + + + + + + + + + \ No newline at end of file diff --git a/examples/25.XmlHandling/XmlHandling_vc8.vcproj b/examples/25.XmlHandling/XmlHandling_vc8.vcproj deleted file mode 100644 index 0831ba9a..00000000 --- a/examples/25.XmlHandling/XmlHandling_vc8.vcproj +++ /dev/null @@ -1,190 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/examples/25.XmlHandling/XmlHandling_vc9.vcproj b/examples/25.XmlHandling/XmlHandling_vc9.vcproj deleted file mode 100644 index 79a1048f..00000000 --- a/examples/25.XmlHandling/XmlHandling_vc9.vcproj +++ /dev/null @@ -1,185 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/examples/25.XmlHandling/main.cpp b/examples/25.XmlHandling/main.cpp index 3eb261de..657ad8dc 100644 --- a/examples/25.XmlHandling/main.cpp +++ b/examples/25.XmlHandling/main.cpp @@ -10,6 +10,7 @@ can easily be integrated into own apps. */ #include +#include "exampleHelper.h" using namespace irr; using namespace core; @@ -18,7 +19,7 @@ using namespace video; using namespace io; using namespace gui; -#ifdef _IRR_WINDOWS_ +#ifdef _MSC_VER #pragma comment(lib, "Irrlicht.lib") #endif @@ -429,7 +430,7 @@ int main() // Try to load config. // I leave it as an exercise of the reader to store the configuration in the local application data folder, // the only logical place to store config data for games. For all other operating systems I redirect to your manuals - app.Settings = new SettingManager("../../media/settings.xml"); + app.Settings = new SettingManager(getExampleMediaPath() + "settings.xml"); if ( !app.Settings->load() ) { // ... @@ -489,7 +490,7 @@ int main() { if (app.Device->isWindowActive()) { - app.Driver->beginScene(true, true, SColor(0,200,200,200)); + app.Driver->beginScene(video::ECBF_COLOR | video::ECBF_DEPTH, SColor(0,200,200,200)); app.Gui->drawAll(); app.Driver->endScene(); } diff --git a/examples/26.OcclusionQuery/OcclusionQuery.dev b/examples/26.OcclusionQuery/OcclusionQuery.dev deleted file mode 100644 index e9d7c04b..00000000 --- a/examples/26.OcclusionQuery/OcclusionQuery.dev +++ /dev/null @@ -1,59 +0,0 @@ -[Project] -FileName=example.dev -Name=Irrlicht Example 26 OcclusionQuery -UnitCount=1 -Type=1 -Ver=1 -ObjFiles= -Includes=..\..\include -Libs= -PrivateResource= -ResourceIncludes= -MakeIncludes= -Compiler= -CppCompiler= -Linker=../../lib/Win32-gcc/libIrrlicht.a_@@_ -IsCpp=1 -Icon= -ExeOutput=../../bin/Win32-gcc -ObjectOutput=obj -OverrideOutput=1 -OverrideOutputName=26.OcclusionQuery.exe -HostApplication= -Folders= -CommandLine= -IncludeVersionInfo=0 -SupportXPThemes=0 -CompilerSet=0 -CompilerSettings=0000000000000000000000 -UseCustomMakefile=0 -CustomMakefile= - -[Unit1] -FileName=main.cpp -CompileCpp=1 -Folder=Projekt1 -Compile=1 -Link=1 -Priority=1000 -OverrideBuildCmd=0 -BuildCmd= - -[VersionInfo] -Major=0 -Minor=1 -Release=1 -Build=1 -LanguageID=1033 -CharsetID=1252 -CompanyName= -FileVersion= -FileDescription=Irrlicht Engine example compiled using DevCpp and gcc -InternalName= -LegalCopyright= -LegalTrademarks= -OriginalFilename= -ProductName= -ProductVersion= -AutoIncBuildNr=0 - diff --git a/examples/26.OcclusionQuery/OcclusionQuery_vc10.vcxproj b/examples/26.OcclusionQuery/OcclusionQuery_vc10.vcxproj index d56f9950..370d3683 100644 --- a/examples/26.OcclusionQuery/OcclusionQuery_vc10.vcxproj +++ b/examples/26.OcclusionQuery/OcclusionQuery_vc10.vcxproj @@ -28,21 +28,25 @@ Application false MultiByte + Windows7.1SDK Application false MultiByte + Windows7.1SDK Application false MultiByte + Windows7.1SDK Application false MultiByte + Windows7.1SDK diff --git a/examples/26.OcclusionQuery/OcclusionQuery_vc11.vcxproj b/examples/26.OcclusionQuery/OcclusionQuery_vc11.vcxproj index fb8b7a97..370d3683 100644 --- a/examples/26.OcclusionQuery/OcclusionQuery_vc11.vcxproj +++ b/examples/26.OcclusionQuery/OcclusionQuery_vc11.vcxproj @@ -28,25 +28,25 @@ Application false MultiByte - v110 + Windows7.1SDK Application false MultiByte - v110 + Windows7.1SDK Application false MultiByte - v110 + Windows7.1SDK Application false MultiByte - v110 + Windows7.1SDK diff --git a/examples/26.OcclusionQuery/OcclusionQuery_vc12.vcxproj b/examples/26.OcclusionQuery/OcclusionQuery_vc12.vcxproj new file mode 100644 index 00000000..e181a45f --- /dev/null +++ b/examples/26.OcclusionQuery/OcclusionQuery_vc12.vcxproj @@ -0,0 +1,235 @@ + + + + + Debug + Win32 + + + Debug + x64 + + + Release + Win32 + + + Release + x64 + + + + 26.OcclusionQuery + {5CE0E2E7-879D-4152-B61D-24E7D0707B45} + OcclusionQuery + + + + Application + false + MultiByte + Windows7.1SDK + + + Application + false + MultiByte + Windows7.1SDK + + + Application + false + MultiByte + Windows7.1SDK + + + Application + false + MultiByte + Windows7.1SDK + + + + + + + + + + + + + + + + + + + + + + + <_ProjectFileVersion>10.0.30319.1 + ..\..\bin\Win32-VisualStudio\ + ..\..\bin\Win64-VisualStudio\ + + + ..\..\bin\Win32-VisualStudio\ + ..\..\bin\Win64-VisualStudio\ + + + AllRules.ruleset + AllRules.ruleset + + + + + AllRules.ruleset + AllRules.ruleset + + + + + + + + .\Debug\OcclusionQuery.tlb + + + + + Disabled + ..\..\include;%(AdditionalIncludeDirectories) + WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions) + EnableFastChecks + MultiThreadedDebug + + + Level3 + EditAndContinue + + + _DEBUG;%(PreprocessorDefinitions) + 0x0c07 + + + ..\..\bin\Win32-VisualStudio\26.OcclusionQuery.exe + ..\..\lib\Win32-visualstudio;%(AdditionalLibraryDirectories) + true + Console + + + + + + + .\Debug\OcclusionQuery.tlb + + + + + Disabled + ..\..\include;%(AdditionalIncludeDirectories) + WIN32;WIN64;_DEBUG;_CONSOLE;%(PreprocessorDefinitions) + EnableFastChecks + MultiThreadedDebug + + + Level3 + ProgramDatabase + + + _DEBUG;%(PreprocessorDefinitions) + 0x0c07 + + + ..\..\bin\Win64-VisualStudio\26.OcclusionQuery.exe + ..\..\lib\Win64-visualstudio;%(AdditionalLibraryDirectories) + true + Console + + + + + + + .\Release\OcclusionQuery.tlb + + + + + MaxSpeed + OnlyExplicitInline + ..\..\include;%(AdditionalIncludeDirectories) + WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions) + true + MultiThreaded + true + + + Level3 + + + NDEBUG;%(PreprocessorDefinitions) + 0x0c07 + + + ..\..\bin\Win32-VisualStudio\26.OcclusionQuery.exe + ..\..\lib\Win32-visualstudio;%(AdditionalLibraryDirectories) + Console + + + + + + + .\Release\OcclusionQuery.tlb + + + + + MaxSpeed + OnlyExplicitInline + ..\..\include;%(AdditionalIncludeDirectories) + WIN32;WIN64;NDEBUG;_CONSOLE;%(PreprocessorDefinitions) + true + MultiThreaded + true + + + Level3 + + + NDEBUG;%(PreprocessorDefinitions) + 0x0c07 + + + ..\..\bin\Win64-VisualStudio\26.OcclusionQuery.exe + ..\..\lib\Win64-visualstudio;%(AdditionalLibraryDirectories) + Console + + + + + + + Disabled + Disabled + %(AdditionalIncludeDirectories) + %(AdditionalIncludeDirectories) + %(PreprocessorDefinitions) + %(PreprocessorDefinitions) + EnableFastChecks + EnableFastChecks + MaxSpeed + MaxSpeed + %(AdditionalIncludeDirectories) + %(AdditionalIncludeDirectories) + %(PreprocessorDefinitions) + %(PreprocessorDefinitions) + + + + + + \ No newline at end of file diff --git a/examples/26.OcclusionQuery/OcclusionQuery_vc14.vcxproj b/examples/26.OcclusionQuery/OcclusionQuery_vc14.vcxproj new file mode 100644 index 00000000..d52b6d59 --- /dev/null +++ b/examples/26.OcclusionQuery/OcclusionQuery_vc14.vcxproj @@ -0,0 +1,235 @@ + + + + + Debug + Win32 + + + Debug + x64 + + + Release + Win32 + + + Release + x64 + + + + 26.OcclusionQuery + {5CE0E2E7-879D-4152-B61D-24E7D0707B45} + OcclusionQuery + + + + Application + false + MultiByte + v140 + + + Application + false + MultiByte + v140 + + + Application + false + MultiByte + v140 + + + Application + false + MultiByte + v140 + + + + + + + + + + + + + + + + + + + + + + + <_ProjectFileVersion>10.0.30319.1 + ..\..\bin\Win32-VisualStudio\ + ..\..\bin\Win64-VisualStudio\ + + + ..\..\bin\Win32-VisualStudio\ + ..\..\bin\Win64-VisualStudio\ + + + AllRules.ruleset + AllRules.ruleset + + + + + AllRules.ruleset + AllRules.ruleset + + + + + + + + .\Debug\OcclusionQuery.tlb + + + + + Disabled + ..\..\include;%(AdditionalIncludeDirectories) + WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions) + EnableFastChecks + MultiThreadedDebug + + + Level3 + EditAndContinue + + + _DEBUG;%(PreprocessorDefinitions) + 0x0c07 + + + ..\..\bin\Win32-VisualStudio\26.OcclusionQuery.exe + ..\..\lib\Win32-visualstudio;%(AdditionalLibraryDirectories) + true + Console + + + + + + + .\Debug\OcclusionQuery.tlb + + + + + Disabled + ..\..\include;%(AdditionalIncludeDirectories) + WIN32;WIN64;_DEBUG;_CONSOLE;%(PreprocessorDefinitions) + EnableFastChecks + MultiThreadedDebug + + + Level3 + ProgramDatabase + + + _DEBUG;%(PreprocessorDefinitions) + 0x0c07 + + + ..\..\bin\Win64-VisualStudio\26.OcclusionQuery.exe + ..\..\lib\Win64-visualstudio;%(AdditionalLibraryDirectories) + true + Console + + + + + + + .\Release\OcclusionQuery.tlb + + + + + MaxSpeed + OnlyExplicitInline + ..\..\include;%(AdditionalIncludeDirectories) + WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions) + true + MultiThreaded + true + + + Level3 + + + NDEBUG;%(PreprocessorDefinitions) + 0x0c07 + + + ..\..\bin\Win32-VisualStudio\26.OcclusionQuery.exe + ..\..\lib\Win32-visualstudio;%(AdditionalLibraryDirectories) + Console + + + + + + + .\Release\OcclusionQuery.tlb + + + + + MaxSpeed + OnlyExplicitInline + ..\..\include;%(AdditionalIncludeDirectories) + WIN32;WIN64;NDEBUG;_CONSOLE;%(PreprocessorDefinitions) + true + MultiThreaded + true + + + Level3 + + + NDEBUG;%(PreprocessorDefinitions) + 0x0c07 + + + ..\..\bin\Win64-VisualStudio\26.OcclusionQuery.exe + ..\..\lib\Win64-visualstudio;%(AdditionalLibraryDirectories) + Console + + + + + + + Disabled + Disabled + %(AdditionalIncludeDirectories) + %(AdditionalIncludeDirectories) + %(PreprocessorDefinitions) + %(PreprocessorDefinitions) + EnableFastChecks + EnableFastChecks + MaxSpeed + MaxSpeed + %(AdditionalIncludeDirectories) + %(AdditionalIncludeDirectories) + %(PreprocessorDefinitions) + %(PreprocessorDefinitions) + + + + + + \ No newline at end of file diff --git a/examples/26.OcclusionQuery/OcclusionQuery_vc8.vcproj b/examples/26.OcclusionQuery/OcclusionQuery_vc8.vcproj deleted file mode 100644 index faa137fc..00000000 --- a/examples/26.OcclusionQuery/OcclusionQuery_vc8.vcproj +++ /dev/null @@ -1,231 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/examples/26.OcclusionQuery/OcclusionQuery_vc9.vcproj b/examples/26.OcclusionQuery/OcclusionQuery_vc9.vcproj deleted file mode 100644 index c15a5275..00000000 --- a/examples/26.OcclusionQuery/OcclusionQuery_vc9.vcproj +++ /dev/null @@ -1,230 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/examples/26.OcclusionQuery/main.cpp b/examples/26.OcclusionQuery/main.cpp index 17f64b2f..d6de904c 100644 --- a/examples/26.OcclusionQuery/main.cpp +++ b/examples/26.OcclusionQuery/main.cpp @@ -42,6 +42,7 @@ of the objects and camera. #include #include "driverChoice.h" +#include "exampleHelper.h" using namespace irr; @@ -102,6 +103,8 @@ int main() video::IVideoDriver* driver = device->getVideoDriver(); scene::ISceneManager* smgr = device->getSceneManager(); + const io::path mediaPath = getExampleMediaPath(); + smgr->getGUIEnvironment()->addStaticText(L"Press Space to hide occluder.", core::recti(10,10, 200,50)); /* @@ -111,7 +114,7 @@ int main() if (node) { node->setPosition(core::vector3df(0,0,60)); - node->setMaterialTexture(0, driver->getTexture("../../media/wall.bmp")); + node->setMaterialTexture(0, driver->getTexture(mediaPath + "wall.bmp")); node->setMaterialFlag(video::EMF_LIGHTING, false); } @@ -124,7 +127,7 @@ int main() if (plane) { - plane->setMaterialTexture(0, driver->getTexture("../../media/t351sml.jpg")); + plane->setMaterialTexture(0, driver->getTexture(mediaPath + "t351sml.jpg")); plane->setMaterialFlag(video::EMF_LIGHTING, false); plane->setMaterialFlag(video::EMF_BACK_FACE_CULLING, true); } @@ -154,7 +157,7 @@ int main() { plane->setVisible(!receiver.IsKeyDown(irr::KEY_SPACE)); - driver->beginScene(true, true, video::SColor(255,113,113,133)); + driver->beginScene(video::ECBF_COLOR | video::ECBF_DEPTH, video::SColor(255,113,113,133)); /* First, we draw the scene, possibly without the occluded element. This is necessary because we need the occluder to be drawn first. You can also use several scene diff --git a/examples/30.Profiling/Profiling_vc12.vcxproj b/examples/30.Profiling/Profiling_vc12.vcxproj new file mode 100644 index 00000000..1b5e4972 --- /dev/null +++ b/examples/30.Profiling/Profiling_vc12.vcxproj @@ -0,0 +1,188 @@ + + + + + Debug + Win32 + + + Debug + x64 + + + Release + Win32 + + + Release + x64 + + + + 30.Profiling + {65D9DE2E-B73E-4ADF-96D1-BF4A8B7F4F97} + 30.Profiling + Win32Proj + + + + Application + MultiByte + Windows7.1SDK + + + Application + MultiByte + Windows7.1SDK + + + Application + MultiByte + Windows7.1SDK + + + Application + MultiByte + Windows7.1SDK + + + + + + + + + + + + + + + + + + + + + + + <_ProjectFileVersion>10.0.30319.1 + ..\..\bin\Win32-VisualStudio\ + ..\..\bin\Win64-VisualStudio\ + ..\..\bin\Win32-VisualStudio\ + ..\..\bin\Win64-VisualStudio\ + AllRules.ruleset + AllRules.ruleset + + + + + AllRules.ruleset + AllRules.ruleset + + + + + + + + Disabled + ..\..\include;%(AdditionalIncludeDirectories) + WIN32;_DEBUG;_WINDOWS;%(PreprocessorDefinitions) + true + EnableFastChecks + MultiThreadedDebug + + + Level3 + EditAndContinue + + + ..\..\bin\Win32-VisualStudio\30.Profiling.exe + ..\..\lib\Win32-visualstudio;%(AdditionalLibraryDirectories) + true + $(OutDir)Profiling.pdb + Console + + + + + + + Disabled + ..\..\include;%(AdditionalIncludeDirectories) + WIN32;WIN64;_DEBUG;_WINDOWS;%(PreprocessorDefinitions) + EnableFastChecks + MultiThreadedDebug + + + Level3 + ProgramDatabase + + + ..\..\bin\Win64-VisualStudio\30.Profiling.exe + ..\..\lib\Win64-visualstudio;%(AdditionalLibraryDirectories) + true + $(OutDir)Profiling.pdb + Console + + + + + + + true + Speed + ..\..\include;%(AdditionalIncludeDirectories) + WIN32;NDEBUG;_WINDOWS;%(PreprocessorDefinitions) + Sync + + + Level3 + + + Cdecl + + + ..\..\bin\Win32-VisualStudio\30.Profiling.exe + ..\..\lib\Win32-visualstudio;%(AdditionalLibraryDirectories) + false + Console + true + true + + + + + + + true + Speed + ..\..\include;%(AdditionalIncludeDirectories) + WIN32;WIN64;NDEBUG;_WINDOWS;%(PreprocessorDefinitions) + Sync + + + Level3 + + + Cdecl + + + ..\..\bin\Win64-VisualStudio\30.Profiling.exe + ..\..\lib\Win64-visualstudio;%(AdditionalLibraryDirectories) + false + Console + true + true + + + + + + + + + + + \ No newline at end of file diff --git a/examples/30.Profiling/Profiling_vc14.vcxproj b/examples/30.Profiling/Profiling_vc14.vcxproj new file mode 100644 index 00000000..caf33cd9 --- /dev/null +++ b/examples/30.Profiling/Profiling_vc14.vcxproj @@ -0,0 +1,188 @@ + + + + + Debug + Win32 + + + Debug + x64 + + + Release + Win32 + + + Release + x64 + + + + 30.Profiling + {65D9DE2E-B73E-4ADF-96D1-BF4A8B7F4F97} + 30.Profiling + Win32Proj + + + + Application + MultiByte + v140 + + + Application + MultiByte + v140 + + + Application + MultiByte + v140 + + + Application + MultiByte + v140 + + + + + + + + + + + + + + + + + + + + + + + <_ProjectFileVersion>10.0.30319.1 + ..\..\bin\Win32-VisualStudio\ + ..\..\bin\Win64-VisualStudio\ + ..\..\bin\Win32-VisualStudio\ + ..\..\bin\Win64-VisualStudio\ + AllRules.ruleset + AllRules.ruleset + + + + + AllRules.ruleset + AllRules.ruleset + + + + + + + + Disabled + ..\..\include;%(AdditionalIncludeDirectories) + WIN32;_DEBUG;_WINDOWS;%(PreprocessorDefinitions) + true + EnableFastChecks + MultiThreadedDebug + + + Level3 + EditAndContinue + + + ..\..\bin\Win32-VisualStudio\30.Profiling.exe + ..\..\lib\Win32-visualstudio;%(AdditionalLibraryDirectories) + true + $(OutDir)Profiling.pdb + Console + + + + + + + Disabled + ..\..\include;%(AdditionalIncludeDirectories) + WIN32;WIN64;_DEBUG;_WINDOWS;%(PreprocessorDefinitions) + EnableFastChecks + MultiThreadedDebug + + + Level3 + ProgramDatabase + + + ..\..\bin\Win64-VisualStudio\30.Profiling.exe + ..\..\lib\Win64-visualstudio;%(AdditionalLibraryDirectories) + true + $(OutDir)Profiling.pdb + Console + + + + + + + true + Speed + ..\..\include;%(AdditionalIncludeDirectories) + WIN32;NDEBUG;_WINDOWS;%(PreprocessorDefinitions) + Sync + + + Level3 + + + Cdecl + + + ..\..\bin\Win32-VisualStudio\30.Profiling.exe + ..\..\lib\Win32-visualstudio;%(AdditionalLibraryDirectories) + false + Console + true + true + + + + + + + true + Speed + ..\..\include;%(AdditionalIncludeDirectories) + WIN32;WIN64;NDEBUG;_WINDOWS;%(PreprocessorDefinitions) + Sync + + + Level3 + + + Cdecl + + + ..\..\bin\Win64-VisualStudio\30.Profiling.exe + ..\..\lib\Win64-visualstudio;%(AdditionalLibraryDirectories) + false + Console + true + true + + + + + + + + + + + \ No newline at end of file diff --git a/examples/30.Profiling/Profiling_vc8.vcproj b/examples/30.Profiling/Profiling_vc8.vcproj deleted file mode 100644 index faa34e95..00000000 --- a/examples/30.Profiling/Profiling_vc8.vcproj +++ /dev/null @@ -1,190 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/examples/30.Profiling/Profiling_vc9.vcproj b/examples/30.Profiling/Profiling_vc9.vcproj deleted file mode 100644 index 0b237daa..00000000 --- a/examples/30.Profiling/Profiling_vc9.vcproj +++ /dev/null @@ -1,185 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/examples/30.Profiling/main.cpp b/examples/30.Profiling/main.cpp index 34da11f4..0ad479af 100644 --- a/examples/30.Profiling/main.cpp +++ b/examples/30.Profiling/main.cpp @@ -53,8 +53,9 @@ collecting profiling information is disabled by default for speed reasons. #include #include "driverChoice.h" +#include "exampleHelper.h" -#ifdef _IRR_WINDOWS_ +#ifdef _MSC_VER #pragma comment(lib, "Irrlicht.lib") #endif @@ -233,7 +234,7 @@ public: */ MY_PROFILE(CProfileScope p(L"dwarfes", L"grp switch scene");) - scene::IAnimatedMesh* aniMesh = SceneManager->getMesh( "../../media/dwarf.x" ); + scene::IAnimatedMesh* aniMesh = SceneManager->getMesh( getExampleMediaPath() + "dwarf.x" ); if (aniMesh) { scene::IMesh * mesh = aniMesh->getMesh (0); @@ -336,10 +337,12 @@ int main() IGUIEnvironment* env = device->getGUIEnvironment(); scene::ISceneManager* smgr = device->getSceneManager(); + const io::path mediaPath = getExampleMediaPath(); + /* A map we use for one of our test-scenes. */ - device->getFileSystem()->addFileArchive("../../media/map-20kdm2.pk3"); + device->getFileSystem()->addFileArchive(mediaPath + "map-20kdm2.pk3"); MyEventReceiver receiver(smgr); device->setEventReceiver(&receiver); @@ -373,7 +376,7 @@ int main() /* Get a monospaced font - it's nicer when working with rows of numbers. */ - IGUIFont* font = env->getFont("../../media/fontcourier.bmp"); + IGUIFont* font = env->getFont(mediaPath + "fontcourier.bmp"); if (font) receiver.GuiProfiler->setOverrideFont(font); @@ -455,7 +458,7 @@ int main() */ recursive(5); - driver->beginScene(true, true, SColor(0,200,200,200)); + driver->beginScene(video::ECBF_COLOR | video::ECBF_DEPTH, SColor(0,200,200,200)); /* If you want to profile only some lines and not a complete scope diff --git a/examples/BuildAllExamples.workspace b/examples/BuildAllExamples.workspace index 7ddbb5b4..5b070708 100644 --- a/examples/BuildAllExamples.workspace +++ b/examples/BuildAllExamples.workspace @@ -5,7 +5,7 @@ - + @@ -27,7 +27,7 @@ - + diff --git a/examples/BuildAllExamples_v8.sln b/examples/BuildAllExamples_v8.sln deleted file mode 100644 index 43683788..00000000 --- a/examples/BuildAllExamples_v8.sln +++ /dev/null @@ -1,236 +0,0 @@ - -Microsoft Visual Studio Solution File, Format Version 9.00 -# Visual Studio 2005 -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Irrlicht", "..\source\Irrlicht\Irrlicht8.0.vcproj", "{E08E042A-6C45-411B-92BE-3CC31331019F}" -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "01.HelloWorld_vc8", "01.HelloWorld\HelloWorld_vc8.vcproj", "{5AD4C95C-BA38-4692-BA4B-8C25A86208F9}" - ProjectSection(ProjectDependencies) = postProject - {E08E042A-6C45-411B-92BE-3CC31331019F} = {E08E042A-6C45-411B-92BE-3CC31331019F} - EndProjectSection -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "02.Quake3Map_vc8", "02.Quake3Map\Quake3Map_vc8.vcproj", "{D1A464A2-D479-458C-98A2-60965D823CD1}" - ProjectSection(ProjectDependencies) = postProject - {E08E042A-6C45-411B-92BE-3CC31331019F} = {E08E042A-6C45-411B-92BE-3CC31331019F} - EndProjectSection -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "03.CustomSceneNode_vc8", "03.CustomSceneNode\CustomSceneNode_vc8.vcproj", "{171CCDFA-C140-4956-8EB7-F0168F4521D3}" - ProjectSection(ProjectDependencies) = postProject - {E08E042A-6C45-411B-92BE-3CC31331019F} = {E08E042A-6C45-411B-92BE-3CC31331019F} - EndProjectSection -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "04.Movement_vc8", "04.Movement\Movement_vc8.vcproj", "{7BDBB7E8-E0C9-4A0D-83C1-D389D6140FEF}" - ProjectSection(ProjectDependencies) = postProject - {E08E042A-6C45-411B-92BE-3CC31331019F} = {E08E042A-6C45-411B-92BE-3CC31331019F} - EndProjectSection -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "05.UserInterface_vc8", "05.UserInterface\UserInterface_vc8.vcproj", "{622C9DD7-0391-49FF-AF53-24F9D5A8EC53}" - ProjectSection(ProjectDependencies) = postProject - {E08E042A-6C45-411B-92BE-3CC31331019F} = {E08E042A-6C45-411B-92BE-3CC31331019F} - EndProjectSection -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "06.2DGraphics_vc8", "06.2DGraphics\2DGraphics_vc8.vcproj", "{E71B6F18-10DC-4101-A541-F6D33F71B2BD}" - ProjectSection(ProjectDependencies) = postProject - {E08E042A-6C45-411B-92BE-3CC31331019F} = {E08E042A-6C45-411B-92BE-3CC31331019F} - EndProjectSection -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "07.Collision_vc8", "07.Collision\Collision_vc8.vcproj", "{3E30297B-5BE3-4A5C-B31E-08A28ADDB29E}" - ProjectSection(ProjectDependencies) = postProject - {E08E042A-6C45-411B-92BE-3CC31331019F} = {E08E042A-6C45-411B-92BE-3CC31331019F} - EndProjectSection -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "08.SpecialFX_vc8", "08.SpecialFX\SpecialFX_vc8.vcproj", "{C869BF55-B9D6-4980-BC92-60FA0CF8411A}" - ProjectSection(ProjectDependencies) = postProject - {E08E042A-6C45-411B-92BE-3CC31331019F} = {E08E042A-6C45-411B-92BE-3CC31331019F} - EndProjectSection -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "09.Meshviewer_vc8", "09.Meshviewer\Meshviewer_vc8.vcproj", "{2AE24484-22FC-481B-9A40-7CD0DA5C8E06}" - ProjectSection(ProjectDependencies) = postProject - {E08E042A-6C45-411B-92BE-3CC31331019F} = {E08E042A-6C45-411B-92BE-3CC31331019F} - EndProjectSection -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "10.Shaders_vc8", "10.Shaders\Shaders_vc8.vcproj", "{27158C82-CD15-4A9B-9848-35E7065B209F}" - ProjectSection(ProjectDependencies) = postProject - {E08E042A-6C45-411B-92BE-3CC31331019F} = {E08E042A-6C45-411B-92BE-3CC31331019F} - EndProjectSection -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "11.PerPixelLighting_vc8", "11.PerPixelLighting\PerPixelLighting_vc8.vcproj", "{C4B42409-542D-4EFC-9E6B-44713FD47A33}" - ProjectSection(ProjectDependencies) = postProject - {E08E042A-6C45-411B-92BE-3CC31331019F} = {E08E042A-6C45-411B-92BE-3CC31331019F} - EndProjectSection -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "12.TerrainRendering_vc8", "12.TerrainRendering\TerrainRendering_vc8.vcproj", "{3A5B74E5-6390-43B0-A459-2793B81FFD31}" - ProjectSection(ProjectDependencies) = postProject - {E08E042A-6C45-411B-92BE-3CC31331019F} = {E08E042A-6C45-411B-92BE-3CC31331019F} - EndProjectSection -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "13.RenderToTexture_vc8", "13.RenderToTexture\RenderToTexture_vc8.vcproj", "{0914E5C8-5352-467B-8421-C9EB35BD5596}" - ProjectSection(ProjectDependencies) = postProject - {E08E042A-6C45-411B-92BE-3CC31331019F} = {E08E042A-6C45-411B-92BE-3CC31331019F} - EndProjectSection -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "14.Win32Window_vc8", "14.Win32Window\Win32Window_vc8.vcproj", "{772FBE05-D05A-467B-9842-BEC409EEA8D0}" - ProjectSection(ProjectDependencies) = postProject - {E08E042A-6C45-411B-92BE-3CC31331019F} = {E08E042A-6C45-411B-92BE-3CC31331019F} - EndProjectSection -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "15.LoadIrrFile_vc8", "15.LoadIrrFile\LoadIrrFile_vc8.vcproj", "{78C9F424-523C-49AC-94B7-823AA4A26BF9}" - ProjectSection(ProjectDependencies) = postProject - {E08E042A-6C45-411B-92BE-3CC31331019F} = {E08E042A-6C45-411B-92BE-3CC31331019F} - EndProjectSection -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "16.Quake3MapShader_vc8", "16.Quake3MapShader\Quake3MapShader_vc8.vcproj", "{EB3B38EA-5CE7-4983-845B-880661E69D09}" - ProjectSection(ProjectDependencies) = postProject - {E08E042A-6C45-411B-92BE-3CC31331019F} = {E08E042A-6C45-411B-92BE-3CC31331019F} - EndProjectSection -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "17.HelloWorld for Windows Mobile on PC", "17.HelloWorld_Mobile\17. HelloWorld for Windows Mobile on PC_v8.vcproj", "{2A29B6B1-AFC4-46C7-9944-7052AAE66F7B}" - ProjectSection(ProjectDependencies) = postProject - {E08E042A-6C45-411B-92BE-3CC31331019F} = {E08E042A-6C45-411B-92BE-3CC31331019F} - EndProjectSection -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "19.MouseAndJoystick_vc8", "19.MouseAndJoystick\MouseAndJoystick_vc8.vcproj", "{FE853A36-E0D1-4AC5-A792-B643E70D2953}" - ProjectSection(ProjectDependencies) = postProject - {E08E042A-6C45-411B-92BE-3CC31331019F} = {E08E042A-6C45-411B-92BE-3CC31331019F} - EndProjectSection -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "20.ManagedLights_vc8", "20.ManagedLights\ManagedLights_vc8.vcproj", "{16007FE2-142B-47F8-93E1-519BA3F39E71}" - ProjectSection(ProjectDependencies) = postProject - {E08E042A-6C45-411B-92BE-3CC31331019F} = {E08E042A-6C45-411B-92BE-3CC31331019F} - EndProjectSection -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "21.Quake3Explorer_vc8", "21.Quake3Explorer\Quake3Explorer_vc8.vcproj", "{CDC4AAA9-72E1-4FFA-A04D-7EF59D8B97CD}" - ProjectSection(ProjectDependencies) = postProject - {E08E042A-6C45-411B-92BE-3CC31331019F} = {E08E042A-6C45-411B-92BE-3CC31331019F} - EndProjectSection -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "22.MaterialViewer_vc8", "22.MaterialViewer\MaterialViewer_vc8.vcproj", "{2856AB41-9BC5-4716-9B35-762A65F6F5D1}" - ProjectSection(ProjectDependencies) = postProject - {E08E042A-6C45-411B-92BE-3CC31331019F} = {E08E042A-6C45-411B-92BE-3CC31331019F} - EndProjectSection -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "23.SMeshHandling_vc8", "23.SMeshHandling\SMeshHandling_vc8.vcproj", "{08D2F676-9DEB-4443-AEF7-52CC6F7D5F7C}" - ProjectSection(ProjectDependencies) = postProject - {E08E042A-6C45-411B-92BE-3CC31331019F} = {E08E042A-6C45-411B-92BE-3CC31331019F} - EndProjectSection -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "24.CursorControl_vc8", "24.CursorControl\CursorControl_vc8.vcproj", "{02B67A37-50E1-49DB-BECF-905BC029C2FE}" - ProjectSection(ProjectDependencies) = postProject - {E08E042A-6C45-411B-92BE-3CC31331019F} = {E08E042A-6C45-411B-92BE-3CC31331019F} - EndProjectSection -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Demo_vc8", "Demo\Demo_vc8.vcproj", "{6F076455-D955-45D4-9C68-4AD4E45F2D47}" - ProjectSection(ProjectDependencies) = postProject - {E08E042A-6C45-411B-92BE-3CC31331019F} = {E08E042A-6C45-411B-92BE-3CC31331019F} - EndProjectSection -EndProject -Global - GlobalSection(SolutionConfigurationPlatforms) = preSolution - Debug|Win32 = Debug|Win32 - Release|Win32 = Release|Win32 - EndGlobalSection - GlobalSection(ProjectConfigurationPlatforms) = postSolution - {5AD4C95C-BA38-4692-BA4B-8C25A86208F9}.Debug|Win32.ActiveCfg = Debug|Win32 - {5AD4C95C-BA38-4692-BA4B-8C25A86208F9}.Debug|Win32.Build.0 = Debug|Win32 - {5AD4C95C-BA38-4692-BA4B-8C25A86208F9}.Release|Win32.ActiveCfg = Release|Win32 - {5AD4C95C-BA38-4692-BA4B-8C25A86208F9}.Release|Win32.Build.0 = Release|Win32 - {D1A464A2-D479-458C-98A2-60965D823CD1}.Debug|Win32.ActiveCfg = Debug|Win32 - {D1A464A2-D479-458C-98A2-60965D823CD1}.Debug|Win32.Build.0 = Debug|Win32 - {D1A464A2-D479-458C-98A2-60965D823CD1}.Release|Win32.ActiveCfg = Release|Win32 - {D1A464A2-D479-458C-98A2-60965D823CD1}.Release|Win32.Build.0 = Release|Win32 - {171CCDFA-C140-4956-8EB7-F0168F4521D3}.Debug|Win32.ActiveCfg = Debug|Win32 - {171CCDFA-C140-4956-8EB7-F0168F4521D3}.Debug|Win32.Build.0 = Debug|Win32 - {171CCDFA-C140-4956-8EB7-F0168F4521D3}.Release|Win32.ActiveCfg = Release|Win32 - {171CCDFA-C140-4956-8EB7-F0168F4521D3}.Release|Win32.Build.0 = Release|Win32 - {7BDBB7E8-E0C9-4A0D-83C1-D389D6140FEF}.Debug|Win32.ActiveCfg = Debug|Win32 - {7BDBB7E8-E0C9-4A0D-83C1-D389D6140FEF}.Debug|Win32.Build.0 = Debug|Win32 - {7BDBB7E8-E0C9-4A0D-83C1-D389D6140FEF}.Release|Win32.ActiveCfg = Release|Win32 - {7BDBB7E8-E0C9-4A0D-83C1-D389D6140FEF}.Release|Win32.Build.0 = Release|Win32 - {622C9DD7-0391-49FF-AF53-24F9D5A8EC53}.Debug|Win32.ActiveCfg = Debug|Win32 - {622C9DD7-0391-49FF-AF53-24F9D5A8EC53}.Debug|Win32.Build.0 = Debug|Win32 - {622C9DD7-0391-49FF-AF53-24F9D5A8EC53}.Release|Win32.ActiveCfg = Release|Win32 - {622C9DD7-0391-49FF-AF53-24F9D5A8EC53}.Release|Win32.Build.0 = Release|Win32 - {E71B6F18-10DC-4101-A541-F6D33F71B2BD}.Debug|Win32.ActiveCfg = Debug|Win32 - {E71B6F18-10DC-4101-A541-F6D33F71B2BD}.Debug|Win32.Build.0 = Debug|Win32 - {E71B6F18-10DC-4101-A541-F6D33F71B2BD}.Release|Win32.ActiveCfg = Release|Win32 - {E71B6F18-10DC-4101-A541-F6D33F71B2BD}.Release|Win32.Build.0 = Release|Win32 - {3E30297B-5BE3-4A5C-B31E-08A28ADDB29E}.Debug|Win32.ActiveCfg = Debug|Win32 - {3E30297B-5BE3-4A5C-B31E-08A28ADDB29E}.Debug|Win32.Build.0 = Debug|Win32 - {3E30297B-5BE3-4A5C-B31E-08A28ADDB29E}.Release|Win32.ActiveCfg = Release|Win32 - {3E30297B-5BE3-4A5C-B31E-08A28ADDB29E}.Release|Win32.Build.0 = Release|Win32 - {C869BF55-B9D6-4980-BC92-60FA0CF8411A}.Debug|Win32.ActiveCfg = Debug|Win32 - {C869BF55-B9D6-4980-BC92-60FA0CF8411A}.Debug|Win32.Build.0 = Debug|Win32 - {C869BF55-B9D6-4980-BC92-60FA0CF8411A}.Release|Win32.ActiveCfg = Release|Win32 - {C869BF55-B9D6-4980-BC92-60FA0CF8411A}.Release|Win32.Build.0 = Release|Win32 - {2AE24484-22FC-481B-9A40-7CD0DA5C8E06}.Debug|Win32.ActiveCfg = Debug|Win32 - {2AE24484-22FC-481B-9A40-7CD0DA5C8E06}.Debug|Win32.Build.0 = Debug|Win32 - {2AE24484-22FC-481B-9A40-7CD0DA5C8E06}.Release|Win32.ActiveCfg = Release|Win32 - {2AE24484-22FC-481B-9A40-7CD0DA5C8E06}.Release|Win32.Build.0 = Release|Win32 - {27158C82-CD15-4A9B-9848-35E7065B209F}.Debug|Win32.ActiveCfg = Debug|Win32 - {27158C82-CD15-4A9B-9848-35E7065B209F}.Debug|Win32.Build.0 = Debug|Win32 - {27158C82-CD15-4A9B-9848-35E7065B209F}.Release|Win32.ActiveCfg = Release|Win32 - {27158C82-CD15-4A9B-9848-35E7065B209F}.Release|Win32.Build.0 = Release|Win32 - {C4B42409-542D-4EFC-9E6B-44713FD47A33}.Debug|Win32.ActiveCfg = Debug|Win32 - {C4B42409-542D-4EFC-9E6B-44713FD47A33}.Debug|Win32.Build.0 = Debug|Win32 - {C4B42409-542D-4EFC-9E6B-44713FD47A33}.Release|Win32.ActiveCfg = Release|Win32 - {C4B42409-542D-4EFC-9E6B-44713FD47A33}.Release|Win32.Build.0 = Release|Win32 - {3A5B74E5-6390-43B0-A459-2793B81FFD31}.Debug|Win32.ActiveCfg = Debug|Win32 - {3A5B74E5-6390-43B0-A459-2793B81FFD31}.Debug|Win32.Build.0 = Debug|Win32 - {3A5B74E5-6390-43B0-A459-2793B81FFD31}.Release|Win32.ActiveCfg = Release|Win32 - {3A5B74E5-6390-43B0-A459-2793B81FFD31}.Release|Win32.Build.0 = Release|Win32 - {0914E5C8-5352-467B-8421-C9EB35BD5596}.Debug|Win32.ActiveCfg = Debug|Win32 - {0914E5C8-5352-467B-8421-C9EB35BD5596}.Debug|Win32.Build.0 = Debug|Win32 - {0914E5C8-5352-467B-8421-C9EB35BD5596}.Release|Win32.ActiveCfg = Release|Win32 - {0914E5C8-5352-467B-8421-C9EB35BD5596}.Release|Win32.Build.0 = Release|Win32 - {772FBE05-D05A-467B-9842-BEC409EEA8D0}.Debug|Win32.ActiveCfg = Debug|Win32 - {772FBE05-D05A-467B-9842-BEC409EEA8D0}.Debug|Win32.Build.0 = Debug|Win32 - {772FBE05-D05A-467B-9842-BEC409EEA8D0}.Release|Win32.ActiveCfg = Release|Win32 - {772FBE05-D05A-467B-9842-BEC409EEA8D0}.Release|Win32.Build.0 = Release|Win32 - {78C9F424-523C-49AC-94B7-823AA4A26BF9}.Debug|Win32.ActiveCfg = Debug|Win32 - {78C9F424-523C-49AC-94B7-823AA4A26BF9}.Debug|Win32.Build.0 = Debug|Win32 - {78C9F424-523C-49AC-94B7-823AA4A26BF9}.Release|Win32.ActiveCfg = Release|Win32 - {78C9F424-523C-49AC-94B7-823AA4A26BF9}.Release|Win32.Build.0 = Release|Win32 - {E08E042A-6C45-411B-92BE-3CC31331019F}.Debug|Win32.ActiveCfg = Debug|Win32 - {E08E042A-6C45-411B-92BE-3CC31331019F}.Debug|Win32.Build.0 = Debug|Win32 - {E08E042A-6C45-411B-92BE-3CC31331019F}.Release|Win32.ActiveCfg = Release|Win32 - {E08E042A-6C45-411B-92BE-3CC31331019F}.Release|Win32.Build.0 = Release|Win32 - {6F076455-D955-45D4-9C68-4AD4E45F2D47}.Debug|Win32.ActiveCfg = Debug|Win32 - {6F076455-D955-45D4-9C68-4AD4E45F2D47}.Debug|Win32.Build.0 = Debug|Win32 - {6F076455-D955-45D4-9C68-4AD4E45F2D47}.Release|Win32.ActiveCfg = Release|Win32 - {6F076455-D955-45D4-9C68-4AD4E45F2D47}.Release|Win32.Build.0 = Release|Win32 - {EB3B38EA-5CE7-4983-845B-880661E69D09}.Debug|Win32.ActiveCfg = Debug|Win32 - {EB3B38EA-5CE7-4983-845B-880661E69D09}.Debug|Win32.Build.0 = Debug|Win32 - {EB3B38EA-5CE7-4983-845B-880661E69D09}.Release|Win32.ActiveCfg = Release|Win32 - {EB3B38EA-5CE7-4983-845B-880661E69D09}.Release|Win32.Build.0 = Release|Win32 - {FE853A36-E0D1-4AC5-A792-B643E70D2953}.Debug|Win32.ActiveCfg = Debug|Win32 - {FE853A36-E0D1-4AC5-A792-B643E70D2953}.Debug|Win32.Build.0 = Debug|Win32 - {FE853A36-E0D1-4AC5-A792-B643E70D2953}.Release|Win32.ActiveCfg = Release|Win32 - {FE853A36-E0D1-4AC5-A792-B643E70D2953}.Release|Win32.Build.0 = Release|Win32 - {16007FE2-142B-47F8-93E1-519BA3F39E71}.Debug|Win32.ActiveCfg = Debug|Win32 - {16007FE2-142B-47F8-93E1-519BA3F39E71}.Debug|Win32.Build.0 = Debug|Win32 - {16007FE2-142B-47F8-93E1-519BA3F39E71}.Release|Win32.ActiveCfg = Release|Win32 - {16007FE2-142B-47F8-93E1-519BA3F39E71}.Release|Win32.Build.0 = Release|Win32 - {CDC4AAA9-72E1-4FFA-A04D-7EF59D8B97CD}.Debug|Win32.ActiveCfg = Debug|Win32 - {CDC4AAA9-72E1-4FFA-A04D-7EF59D8B97CD}.Debug|Win32.Build.0 = Debug|Win32 - {CDC4AAA9-72E1-4FFA-A04D-7EF59D8B97CD}.Release|Win32.ActiveCfg = Release|Win32 - {CDC4AAA9-72E1-4FFA-A04D-7EF59D8B97CD}.Release|Win32.Build.0 = Release|Win32 - {2A29B6B1-AFC4-46C7-9944-7052AAE66F7B}.Debug|Win32.ActiveCfg = Debug|Win32 - {2A29B6B1-AFC4-46C7-9944-7052AAE66F7B}.Debug|Win32.Build.0 = Debug|Win32 - {2A29B6B1-AFC4-46C7-9944-7052AAE66F7B}.Release|Win32.ActiveCfg = Release|Win32 - {2A29B6B1-AFC4-46C7-9944-7052AAE66F7B}.Release|Win32.Build.0 = Release|Win32 - {2856AB41-9BC5-4716-9B35-762A65F6F5D1}.Debug|Win32.ActiveCfg = Debug|Win32 - {2856AB41-9BC5-4716-9B35-762A65F6F5D1}.Debug|Win32.Build.0 = Debug|Win32 - {2856AB41-9BC5-4716-9B35-762A65F6F5D1}.Release|Win32.ActiveCfg = Release|Win32 - {2856AB41-9BC5-4716-9B35-762A65F6F5D1}.Release|Win32.Build.0 = Release|Win32 - {08D2F676-9DEB-4443-AEF7-52CC6F7D5F7C}.Debug|Win32.ActiveCfg = Debug|Win32 - {08D2F676-9DEB-4443-AEF7-52CC6F7D5F7C}.Debug|Win32.Build.0 = Debug|Win32 - {08D2F676-9DEB-4443-AEF7-52CC6F7D5F7C}.Release|Win32.ActiveCfg = Release|Win32 - {08D2F676-9DEB-4443-AEF7-52CC6F7D5F7C}.Release|Win32.Build.0 = Release|Win32 - {02B67A37-50E1-49DB-BECF-905BC029C2FE}.Debug|Win32.ActiveCfg = Debug|Win32 - {02B67A37-50E1-49DB-BECF-905BC029C2FE}.Debug|Win32.Build.0 = Debug|Win32 - {02B67A37-50E1-49DB-BECF-905BC029C2FE}.Release|Win32.ActiveCfg = Release|Win32 - {02B67A37-50E1-49DB-BECF-905BC029C2FE}.Release|Win32.Build.0 = Release|Win32 - EndGlobalSection - GlobalSection(SolutionProperties) = preSolution - HideSolutionNode = FALSE - EndGlobalSection -EndGlobal diff --git a/examples/BuildAllExamples_v9.sln b/examples/BuildAllExamples_v9.sln deleted file mode 100644 index d56014ba..00000000 --- a/examples/BuildAllExamples_v9.sln +++ /dev/null @@ -1,290 +0,0 @@ - -Microsoft Visual Studio Solution File, Format Version 10.00 -# Visual C++ Express 2008 -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "01.HelloWorld_vc9", "01.HelloWorld\HelloWorld_vc9.vcproj", "{5AD4C95C-BA38-4692-BA4B-8C25A86208F9}" - ProjectSection(ProjectDependencies) = postProject - {E08E042A-6C45-411B-92BE-3CC31331019F} = {E08E042A-6C45-411B-92BE-3CC31331019F} - EndProjectSection -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "02.Quake3Map_vc9", "02.Quake3Map\Quake3Map_vc9.vcproj", "{D1A464A2-D479-458C-98A2-60965D823CD1}" - ProjectSection(ProjectDependencies) = postProject - {E08E042A-6C45-411B-92BE-3CC31331019F} = {E08E042A-6C45-411B-92BE-3CC31331019F} - EndProjectSection -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "03.CustomSceneNode_vc9", "03.CustomSceneNode\CustomSceneNode_vc9.vcproj", "{171CCDFA-C140-4956-8EB7-F0168F4521D3}" - ProjectSection(ProjectDependencies) = postProject - {E08E042A-6C45-411B-92BE-3CC31331019F} = {E08E042A-6C45-411B-92BE-3CC31331019F} - EndProjectSection -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "04.Movement_vc9", "04.Movement\Movement_vc9.vcproj", "{7BDBB7E8-E0C9-4A0D-83C1-D389D6140FEF}" - ProjectSection(ProjectDependencies) = postProject - {E08E042A-6C45-411B-92BE-3CC31331019F} = {E08E042A-6C45-411B-92BE-3CC31331019F} - EndProjectSection -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "05.UserInterface_vc8", "05.UserInterface\UserInterface_vc9.vcproj", "{622C9DD7-0391-49FF-AF53-24F9D5A8EC53}" - ProjectSection(ProjectDependencies) = postProject - {E08E042A-6C45-411B-92BE-3CC31331019F} = {E08E042A-6C45-411B-92BE-3CC31331019F} - EndProjectSection -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "06.2DGraphics_vc9", "06.2DGraphics\2DGraphics_vc9.vcproj", "{E71B6F18-10DC-4101-A541-F6D33F71B2BD}" - ProjectSection(ProjectDependencies) = postProject - {E08E042A-6C45-411B-92BE-3CC31331019F} = {E08E042A-6C45-411B-92BE-3CC31331019F} - EndProjectSection -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "07.Collision_vc9", "07.Collision\Collision_vc9.vcproj", "{3E30297B-5BE3-4A5C-B31E-08A28ADDB29E}" - ProjectSection(ProjectDependencies) = postProject - {E08E042A-6C45-411B-92BE-3CC31331019F} = {E08E042A-6C45-411B-92BE-3CC31331019F} - EndProjectSection -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "08.SpecialFX_vc9", "08.SpecialFX\SpecialFX_vc9.vcproj", "{C869BF55-B9D6-4980-BC92-60FA0CF8411A}" - ProjectSection(ProjectDependencies) = postProject - {E08E042A-6C45-411B-92BE-3CC31331019F} = {E08E042A-6C45-411B-92BE-3CC31331019F} - EndProjectSection -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "09.Meshviewer_vc9", "09.Meshviewer\Meshviewer_vc9.vcproj", "{2AE24484-22FC-481B-9A40-7CD0DA5C8E06}" - ProjectSection(ProjectDependencies) = postProject - {E08E042A-6C45-411B-92BE-3CC31331019F} = {E08E042A-6C45-411B-92BE-3CC31331019F} - EndProjectSection -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "10.Shaders_vc9", "10.Shaders\Shaders_vc9.vcproj", "{27158C82-CD15-4A9B-9848-35E7065B209F}" - ProjectSection(ProjectDependencies) = postProject - {E08E042A-6C45-411B-92BE-3CC31331019F} = {E08E042A-6C45-411B-92BE-3CC31331019F} - EndProjectSection -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "11.PerPixelLighting_vc9", "11.PerPixelLighting\PerPixelLighting_vc9.vcproj", "{C4B42409-542D-4EFC-9E6B-44713FD47A33}" - ProjectSection(ProjectDependencies) = postProject - {E08E042A-6C45-411B-92BE-3CC31331019F} = {E08E042A-6C45-411B-92BE-3CC31331019F} - EndProjectSection -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "12.TerrainRendering_vc9", "12.TerrainRendering\TerrainRendering_vc9.vcproj", "{3A5B74E5-6390-43B0-A459-2793B81FFD31}" - ProjectSection(ProjectDependencies) = postProject - {E08E042A-6C45-411B-92BE-3CC31331019F} = {E08E042A-6C45-411B-92BE-3CC31331019F} - EndProjectSection -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "13.RenderToTexture_vc9", "13.RenderToTexture\RenderToTexture_vc9.vcproj", "{0914E5C8-5352-467B-8421-C9EB35BD5596}" - ProjectSection(ProjectDependencies) = postProject - {E08E042A-6C45-411B-92BE-3CC31331019F} = {E08E042A-6C45-411B-92BE-3CC31331019F} - EndProjectSection -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "14.Win32Window_vc9", "14.Win32Window\Win32Window_vc9.vcproj", "{772FBE05-D05A-467B-9842-BEC409EEA8D0}" - ProjectSection(ProjectDependencies) = postProject - {E08E042A-6C45-411B-92BE-3CC31331019F} = {E08E042A-6C45-411B-92BE-3CC31331019F} - EndProjectSection -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "15.LoadIrrFile_vc9", "15.LoadIrrFile\LoadIrrFile_vc9.vcproj", "{78C9F424-523C-49AC-94B7-823AA4A26BF9}" - ProjectSection(ProjectDependencies) = postProject - {E08E042A-6C45-411B-92BE-3CC31331019F} = {E08E042A-6C45-411B-92BE-3CC31331019F} - EndProjectSection -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Irrlicht", "..\source\Irrlicht\Irrlicht9.0.vcproj", "{E08E042A-6C45-411B-92BE-3CC31331019F}" -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Demo_vc9", "Demo\Demo_vc9.vcproj", "{6F076455-D955-45D4-9C68-4AD4E45F2D47}" - ProjectSection(ProjectDependencies) = postProject - {E08E042A-6C45-411B-92BE-3CC31331019F} = {E08E042A-6C45-411B-92BE-3CC31331019F} - EndProjectSection -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "16.Quake3MapShader_vc9", "16.Quake3MapShader\Quake3MapShader_vc9.vcproj", "{EB3B38EA-5CE7-4983-845B-880661E69D09}" - ProjectSection(ProjectDependencies) = postProject - {E08E042A-6C45-411B-92BE-3CC31331019F} = {E08E042A-6C45-411B-92BE-3CC31331019F} - EndProjectSection -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "17.HelloWorld_Mobile_v9", "17.HelloWorld_Mobile\17. HelloWorld for Windows Mobile on PC_v9.vcproj", "{2A29B6B1-AFC4-46C7-9944-7052AAE66F7B}" - ProjectSection(ProjectDependencies) = postProject - {E08E042A-6C45-411B-92BE-3CC31331019F} = {E08E042A-6C45-411B-92BE-3CC31331019F} - EndProjectSection -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "18.SplitScreen_vc9", "18.SplitScreen\SplitScreen_vc9.vcproj", "{1AB9413E-4F53-42A3-8CB2-CB4BE22336D0}" - ProjectSection(ProjectDependencies) = postProject - {E08E042A-6C45-411B-92BE-3CC31331019F} = {E08E042A-6C45-411B-92BE-3CC31331019F} - EndProjectSection -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "19.MouseAndJoystick_vc9", "19.MouseAndJoystick\MouseAndJoystick_vc9.vcproj", "{FE853A36-E0D1-4AC5-A792-B643E70D2953}" - ProjectSection(ProjectDependencies) = postProject - {E08E042A-6C45-411B-92BE-3CC31331019F} = {E08E042A-6C45-411B-92BE-3CC31331019F} - EndProjectSection -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "20.ManagedLights_vc9", "20.ManagedLights\ManagedLights_vc9.vcproj", "{16007FE2-142B-47F8-93E1-519BA3F39E71}" - ProjectSection(ProjectDependencies) = postProject - {E08E042A-6C45-411B-92BE-3CC31331019F} = {E08E042A-6C45-411B-92BE-3CC31331019F} - EndProjectSection -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "21.Quake3Explorer_vc9", "21.Quake3Explorer\Quake3Explorer_vc9.vcproj", "{CDC4AAA9-72E1-4FFA-A04D-7EF59D8B97CD}" - ProjectSection(ProjectDependencies) = postProject - {E08E042A-6C45-411B-92BE-3CC31331019F} = {E08E042A-6C45-411B-92BE-3CC31331019F} - EndProjectSection -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "22.MaterialViewer_vc9", "22.MaterialViewer\MaterialViewer_vc9.vcproj", "{F4C8112D-57A8-4D01-BB62-BAC6A09A6902}" - ProjectSection(ProjectDependencies) = postProject - {E08E042A-6C45-411B-92BE-3CC31331019F} = {E08E042A-6C45-411B-92BE-3CC31331019F} - EndProjectSection -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "23.SMeshHandling_vc9", "23.SMeshHandling\SMeshHandling_vc9.vcproj", "{6AEC2AA2-C9FF-4B7D-B07A-94A9D34B41D7}" - ProjectSection(ProjectDependencies) = postProject - {E08E042A-6C45-411B-92BE-3CC31331019F} = {E08E042A-6C45-411B-92BE-3CC31331019F} - EndProjectSection -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "24.CursorControl_vc9", "24.CursorControl\CursorControl_vc9.vcproj", "{02B67A37-50E1-49DB-BECF-905BC029C2FE}" - ProjectSection(ProjectDependencies) = postProject - {E08E042A-6C45-411B-92BE-3CC31331019F} = {E08E042A-6C45-411B-92BE-3CC31331019F} - EndProjectSection -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "GUI Editor_v9", "..\tools\GUIEditor\GUI Editor_v9.vcproj", "{853A396E-C031-4C26-A716-5B4E176BE11D}" - ProjectSection(ProjectDependencies) = postProject - {E08E042A-6C45-411B-92BE-3CC31331019F} = {E08E042A-6C45-411B-92BE-3CC31331019F} - EndProjectSection -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Font Tool", "..\tools\IrrFontTool\newFontTool\irrFontTool_v9.vcproj", "{4D53E40F-37E3-42B1-8848-F4C6F8313A17}" - ProjectSection(ProjectDependencies) = postProject - {E08E042A-6C45-411B-92BE-3CC31331019F} = {E08E042A-6C45-411B-92BE-3CC31331019F} - EndProjectSection -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Mesh Converter", "..\tools\MeshConverter\MeshConverter_v9.vcproj", "{E72B637E-4AA6-46F3-885F-AC67B4B470ED}" - ProjectSection(ProjectDependencies) = postProject - {E08E042A-6C45-411B-92BE-3CC31331019F} = {E08E042A-6C45-411B-92BE-3CC31331019F} - EndProjectSection -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "25.XmlHandling_vc9", "25.XmlHandling\XmlHandling_vc9.vcproj", "{8FDA260E-EF27-4F8C-8720-7AF707DD0D9E}" -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "26.OcclusionQuery_vc9", "26.OcclusionQuery\OcclusionQuery_vc9.vcproj", "{9A859369-0A56-4DAB-9E0C-9F93C91CF0F2}" -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "30.Profiling_vc9", "30.Profiling\Profiling_vc9.vcproj", "{65D9DE2E-B73E-4ADF-96D1-BF4A8B7F4F97}" -EndProject -Global - GlobalSection(SolutionConfigurationPlatforms) = preSolution - Debug|Win32 = Debug|Win32 - Release|Win32 = Release|Win32 - EndGlobalSection - GlobalSection(ProjectConfigurationPlatforms) = postSolution - {5AD4C95C-BA38-4692-BA4B-8C25A86208F9}.Debug|Win32.ActiveCfg = Debug|Win32 - {5AD4C95C-BA38-4692-BA4B-8C25A86208F9}.Debug|Win32.Build.0 = Debug|Win32 - {5AD4C95C-BA38-4692-BA4B-8C25A86208F9}.Release|Win32.ActiveCfg = Release|Win32 - {5AD4C95C-BA38-4692-BA4B-8C25A86208F9}.Release|Win32.Build.0 = Release|Win32 - {D1A464A2-D479-458C-98A2-60965D823CD1}.Debug|Win32.ActiveCfg = Debug|Win32 - {D1A464A2-D479-458C-98A2-60965D823CD1}.Debug|Win32.Build.0 = Debug|Win32 - {D1A464A2-D479-458C-98A2-60965D823CD1}.Release|Win32.ActiveCfg = Release|Win32 - {D1A464A2-D479-458C-98A2-60965D823CD1}.Release|Win32.Build.0 = Release|Win32 - {171CCDFA-C140-4956-8EB7-F0168F4521D3}.Debug|Win32.ActiveCfg = Debug|Win32 - {171CCDFA-C140-4956-8EB7-F0168F4521D3}.Debug|Win32.Build.0 = Debug|Win32 - {171CCDFA-C140-4956-8EB7-F0168F4521D3}.Release|Win32.ActiveCfg = Release|Win32 - {171CCDFA-C140-4956-8EB7-F0168F4521D3}.Release|Win32.Build.0 = Release|Win32 - {7BDBB7E8-E0C9-4A0D-83C1-D389D6140FEF}.Debug|Win32.ActiveCfg = Debug|Win32 - {7BDBB7E8-E0C9-4A0D-83C1-D389D6140FEF}.Debug|Win32.Build.0 = Debug|Win32 - {7BDBB7E8-E0C9-4A0D-83C1-D389D6140FEF}.Release|Win32.ActiveCfg = Release|Win32 - {7BDBB7E8-E0C9-4A0D-83C1-D389D6140FEF}.Release|Win32.Build.0 = Release|Win32 - {622C9DD7-0391-49FF-AF53-24F9D5A8EC53}.Debug|Win32.ActiveCfg = Debug|Win32 - {622C9DD7-0391-49FF-AF53-24F9D5A8EC53}.Debug|Win32.Build.0 = Debug|Win32 - {622C9DD7-0391-49FF-AF53-24F9D5A8EC53}.Release|Win32.ActiveCfg = Release|Win32 - {622C9DD7-0391-49FF-AF53-24F9D5A8EC53}.Release|Win32.Build.0 = Release|Win32 - {E71B6F18-10DC-4101-A541-F6D33F71B2BD}.Debug|Win32.ActiveCfg = Debug|Win32 - {E71B6F18-10DC-4101-A541-F6D33F71B2BD}.Debug|Win32.Build.0 = Debug|Win32 - {E71B6F18-10DC-4101-A541-F6D33F71B2BD}.Release|Win32.ActiveCfg = Release|Win32 - {E71B6F18-10DC-4101-A541-F6D33F71B2BD}.Release|Win32.Build.0 = Release|Win32 - {3E30297B-5BE3-4A5C-B31E-08A28ADDB29E}.Debug|Win32.ActiveCfg = Debug|Win32 - {3E30297B-5BE3-4A5C-B31E-08A28ADDB29E}.Debug|Win32.Build.0 = Debug|Win32 - {3E30297B-5BE3-4A5C-B31E-08A28ADDB29E}.Release|Win32.ActiveCfg = Release|Win32 - {3E30297B-5BE3-4A5C-B31E-08A28ADDB29E}.Release|Win32.Build.0 = Release|Win32 - {C869BF55-B9D6-4980-BC92-60FA0CF8411A}.Debug|Win32.ActiveCfg = Debug|Win32 - {C869BF55-B9D6-4980-BC92-60FA0CF8411A}.Debug|Win32.Build.0 = Debug|Win32 - {C869BF55-B9D6-4980-BC92-60FA0CF8411A}.Release|Win32.ActiveCfg = Release|Win32 - {C869BF55-B9D6-4980-BC92-60FA0CF8411A}.Release|Win32.Build.0 = Release|Win32 - {2AE24484-22FC-481B-9A40-7CD0DA5C8E06}.Debug|Win32.ActiveCfg = Debug|Win32 - {2AE24484-22FC-481B-9A40-7CD0DA5C8E06}.Debug|Win32.Build.0 = Debug|Win32 - {2AE24484-22FC-481B-9A40-7CD0DA5C8E06}.Release|Win32.ActiveCfg = Release|Win32 - {2AE24484-22FC-481B-9A40-7CD0DA5C8E06}.Release|Win32.Build.0 = Release|Win32 - {27158C82-CD15-4A9B-9848-35E7065B209F}.Debug|Win32.ActiveCfg = Debug|Win32 - {27158C82-CD15-4A9B-9848-35E7065B209F}.Debug|Win32.Build.0 = Debug|Win32 - {27158C82-CD15-4A9B-9848-35E7065B209F}.Release|Win32.ActiveCfg = Release|Win32 - {27158C82-CD15-4A9B-9848-35E7065B209F}.Release|Win32.Build.0 = Release|Win32 - {C4B42409-542D-4EFC-9E6B-44713FD47A33}.Debug|Win32.ActiveCfg = Debug|Win32 - {C4B42409-542D-4EFC-9E6B-44713FD47A33}.Debug|Win32.Build.0 = Debug|Win32 - {C4B42409-542D-4EFC-9E6B-44713FD47A33}.Release|Win32.ActiveCfg = Release|Win32 - {C4B42409-542D-4EFC-9E6B-44713FD47A33}.Release|Win32.Build.0 = Release|Win32 - {3A5B74E5-6390-43B0-A459-2793B81FFD31}.Debug|Win32.ActiveCfg = Debug|Win32 - {3A5B74E5-6390-43B0-A459-2793B81FFD31}.Debug|Win32.Build.0 = Debug|Win32 - {3A5B74E5-6390-43B0-A459-2793B81FFD31}.Release|Win32.ActiveCfg = Release|Win32 - {3A5B74E5-6390-43B0-A459-2793B81FFD31}.Release|Win32.Build.0 = Release|Win32 - {0914E5C8-5352-467B-8421-C9EB35BD5596}.Debug|Win32.ActiveCfg = Debug|Win32 - {0914E5C8-5352-467B-8421-C9EB35BD5596}.Debug|Win32.Build.0 = Debug|Win32 - {0914E5C8-5352-467B-8421-C9EB35BD5596}.Release|Win32.ActiveCfg = Release|Win32 - {0914E5C8-5352-467B-8421-C9EB35BD5596}.Release|Win32.Build.0 = Release|Win32 - {772FBE05-D05A-467B-9842-BEC409EEA8D0}.Debug|Win32.ActiveCfg = Debug|Win32 - {772FBE05-D05A-467B-9842-BEC409EEA8D0}.Debug|Win32.Build.0 = Debug|Win32 - {772FBE05-D05A-467B-9842-BEC409EEA8D0}.Release|Win32.ActiveCfg = Release|Win32 - {772FBE05-D05A-467B-9842-BEC409EEA8D0}.Release|Win32.Build.0 = Release|Win32 - {78C9F424-523C-49AC-94B7-823AA4A26BF9}.Debug|Win32.ActiveCfg = Debug|Win32 - {78C9F424-523C-49AC-94B7-823AA4A26BF9}.Debug|Win32.Build.0 = Debug|Win32 - {78C9F424-523C-49AC-94B7-823AA4A26BF9}.Release|Win32.ActiveCfg = Release|Win32 - {78C9F424-523C-49AC-94B7-823AA4A26BF9}.Release|Win32.Build.0 = Release|Win32 - {E08E042A-6C45-411B-92BE-3CC31331019F}.Debug|Win32.ActiveCfg = Debug|Win32 - {E08E042A-6C45-411B-92BE-3CC31331019F}.Debug|Win32.Build.0 = Debug|Win32 - {E08E042A-6C45-411B-92BE-3CC31331019F}.Release|Win32.ActiveCfg = Release|Win32 - {E08E042A-6C45-411B-92BE-3CC31331019F}.Release|Win32.Build.0 = Release|Win32 - {6F076455-D955-45D4-9C68-4AD4E45F2D47}.Debug|Win32.ActiveCfg = Debug|Win32 - {6F076455-D955-45D4-9C68-4AD4E45F2D47}.Debug|Win32.Build.0 = Debug|Win32 - {6F076455-D955-45D4-9C68-4AD4E45F2D47}.Release|Win32.ActiveCfg = Release|Win32 - {6F076455-D955-45D4-9C68-4AD4E45F2D47}.Release|Win32.Build.0 = Release|Win32 - {EB3B38EA-5CE7-4983-845B-880661E69D09}.Debug|Win32.ActiveCfg = Debug|Win32 - {EB3B38EA-5CE7-4983-845B-880661E69D09}.Debug|Win32.Build.0 = Debug|Win32 - {EB3B38EA-5CE7-4983-845B-880661E69D09}.Release|Win32.ActiveCfg = Release|Win32 - {EB3B38EA-5CE7-4983-845B-880661E69D09}.Release|Win32.Build.0 = Release|Win32 - {2A29B6B1-AFC4-46C7-9944-7052AAE66F7B}.Debug|Win32.ActiveCfg = Debug|Win32 - {2A29B6B1-AFC4-46C7-9944-7052AAE66F7B}.Debug|Win32.Build.0 = Debug|Win32 - {2A29B6B1-AFC4-46C7-9944-7052AAE66F7B}.Release|Win32.ActiveCfg = Release|Win32 - {2A29B6B1-AFC4-46C7-9944-7052AAE66F7B}.Release|Win32.Build.0 = Release|Win32 - {1AB9413E-4F53-42A3-8CB2-CB4BE22336D0}.Debug|Win32.ActiveCfg = Debug|Win32 - {1AB9413E-4F53-42A3-8CB2-CB4BE22336D0}.Debug|Win32.Build.0 = Debug|Win32 - {1AB9413E-4F53-42A3-8CB2-CB4BE22336D0}.Release|Win32.ActiveCfg = Release|Win32 - {1AB9413E-4F53-42A3-8CB2-CB4BE22336D0}.Release|Win32.Build.0 = Release|Win32 - {FE853A36-E0D1-4AC5-A792-B643E70D2953}.Debug|Win32.ActiveCfg = Debug|Win32 - {FE853A36-E0D1-4AC5-A792-B643E70D2953}.Debug|Win32.Build.0 = Debug|Win32 - {FE853A36-E0D1-4AC5-A792-B643E70D2953}.Release|Win32.ActiveCfg = Release|Win32 - {FE853A36-E0D1-4AC5-A792-B643E70D2953}.Release|Win32.Build.0 = Release|Win32 - {16007FE2-142B-47F8-93E1-519BA3F39E71}.Debug|Win32.ActiveCfg = Debug|Win32 - {16007FE2-142B-47F8-93E1-519BA3F39E71}.Debug|Win32.Build.0 = Debug|Win32 - {16007FE2-142B-47F8-93E1-519BA3F39E71}.Release|Win32.ActiveCfg = Release|Win32 - {16007FE2-142B-47F8-93E1-519BA3F39E71}.Release|Win32.Build.0 = Release|Win32 - {CDC4AAA9-72E1-4FFA-A04D-7EF59D8B97CD}.Debug|Win32.ActiveCfg = Debug|Win32 - {CDC4AAA9-72E1-4FFA-A04D-7EF59D8B97CD}.Debug|Win32.Build.0 = Debug|Win32 - {CDC4AAA9-72E1-4FFA-A04D-7EF59D8B97CD}.Release|Win32.ActiveCfg = Release|Win32 - {CDC4AAA9-72E1-4FFA-A04D-7EF59D8B97CD}.Release|Win32.Build.0 = Release|Win32 - {F4C8112D-57A8-4D01-BB62-BAC6A09A6902}.Debug|Win32.ActiveCfg = Debug|Win32 - {F4C8112D-57A8-4D01-BB62-BAC6A09A6902}.Debug|Win32.Build.0 = Debug|Win32 - {F4C8112D-57A8-4D01-BB62-BAC6A09A6902}.Release|Win32.ActiveCfg = Release|Win32 - {F4C8112D-57A8-4D01-BB62-BAC6A09A6902}.Release|Win32.Build.0 = Release|Win32 - {6AEC2AA2-C9FF-4B7D-B07A-94A9D34B41D7}.Debug|Win32.ActiveCfg = Debug|Win32 - {6AEC2AA2-C9FF-4B7D-B07A-94A9D34B41D7}.Debug|Win32.Build.0 = Debug|Win32 - {6AEC2AA2-C9FF-4B7D-B07A-94A9D34B41D7}.Release|Win32.ActiveCfg = Release|Win32 - {6AEC2AA2-C9FF-4B7D-B07A-94A9D34B41D7}.Release|Win32.Build.0 = Release|Win32 - {02B67A37-50E1-49DB-BECF-905BC029C2FE}.Debug|Win32.ActiveCfg = Debug|Win32 - {02B67A37-50E1-49DB-BECF-905BC029C2FE}.Debug|Win32.Build.0 = Debug|Win32 - {02B67A37-50E1-49DB-BECF-905BC029C2FE}.Release|Win32.ActiveCfg = Release|Win32 - {02B67A37-50E1-49DB-BECF-905BC029C2FE}.Release|Win32.Build.0 = Release|Win32 - {853A396E-C031-4C26-A716-5B4E176BE11D}.Debug|Win32.ActiveCfg = Debug|Win32 - {853A396E-C031-4C26-A716-5B4E176BE11D}.Debug|Win32.Build.0 = Debug|Win32 - {853A396E-C031-4C26-A716-5B4E176BE11D}.Release|Win32.ActiveCfg = Release|Win32 - {853A396E-C031-4C26-A716-5B4E176BE11D}.Release|Win32.Build.0 = Release|Win32 - {4D53E40F-37E3-42B1-8848-F4C6F8313A17}.Debug|Win32.ActiveCfg = Debug|Win32 - {4D53E40F-37E3-42B1-8848-F4C6F8313A17}.Debug|Win32.Build.0 = Debug|Win32 - {4D53E40F-37E3-42B1-8848-F4C6F8313A17}.Release|Win32.ActiveCfg = Release|Win32 - {4D53E40F-37E3-42B1-8848-F4C6F8313A17}.Release|Win32.Build.0 = Release|Win32 - {E72B637E-4AA6-46F3-885F-AC67B4B470ED}.Debug|Win32.ActiveCfg = Debug|Win32 - {E72B637E-4AA6-46F3-885F-AC67B4B470ED}.Debug|Win32.Build.0 = Debug|Win32 - {E72B637E-4AA6-46F3-885F-AC67B4B470ED}.Release|Win32.ActiveCfg = Release|Win32 - {E72B637E-4AA6-46F3-885F-AC67B4B470ED}.Release|Win32.Build.0 = Release|Win32 - {8FDA260E-EF27-4F8C-8720-7AF707DD0D9E}.Debug|Win32.ActiveCfg = Debug|Win32 - {8FDA260E-EF27-4F8C-8720-7AF707DD0D9E}.Debug|Win32.Build.0 = Debug|Win32 - {8FDA260E-EF27-4F8C-8720-7AF707DD0D9E}.Release|Win32.ActiveCfg = Release|Win32 - {8FDA260E-EF27-4F8C-8720-7AF707DD0D9E}.Release|Win32.Build.0 = Release|Win32 - {9A859369-0A56-4DAB-9E0C-9F93C91CF0F2}.Debug|Win32.ActiveCfg = Debug|Win32 - {9A859369-0A56-4DAB-9E0C-9F93C91CF0F2}.Debug|Win32.Build.0 = Debug|Win32 - {9A859369-0A56-4DAB-9E0C-9F93C91CF0F2}.Release|Win32.ActiveCfg = Release|Win32 - {9A859369-0A56-4DAB-9E0C-9F93C91CF0F2}.Release|Win32.Build.0 = Release|Win32 - {65D9DE2E-B73E-4ADF-96D1-BF4A8B7F4F97}.Debug|Win32.ActiveCfg = Debug|Win32 - {65D9DE2E-B73E-4ADF-96D1-BF4A8B7F4F97}.Debug|Win32.Build.0 = Debug|Win32 - {65D9DE2E-B73E-4ADF-96D1-BF4A8B7F4F97}.Release|Win32.ActiveCfg = Release|Win32 - {65D9DE2E-B73E-4ADF-96D1-BF4A8B7F4F97}.Release|Win32.Build.0 = Release|Win32 - EndGlobalSection - GlobalSection(SolutionProperties) = preSolution - HideSolutionNode = FALSE - EndGlobalSection -EndGlobal diff --git a/examples/BuildAllExamples_vc12.sln b/examples/BuildAllExamples_vc12.sln new file mode 100644 index 00000000..4c87d9fc --- /dev/null +++ b/examples/BuildAllExamples_vc12.sln @@ -0,0 +1,1072 @@ + +Microsoft Visual Studio Solution File, Format Version 12.00 +# Visual Studio Express 2013 for Windows Desktop +VisualStudioVersion = 12.0.30501.0 +MinimumVisualStudioVersion = 10.0.40219.1 +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "01.HelloWorld", "01.HelloWorld\HelloWorld_vc12.vcxproj", "{5AD4C95C-BA38-4692-BA4B-8C25A86208F9}" + ProjectSection(ProjectDependencies) = postProject + {E08E042A-6C45-411B-92BE-3CC31331019F} = {E08E042A-6C45-411B-92BE-3CC31331019F} + EndProjectSection +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "02.Quake3Map", "02.Quake3Map\Quake3Map_vc12.vcxproj", "{D1A464A2-D479-458C-98A2-60965D823CD1}" + ProjectSection(ProjectDependencies) = postProject + {E08E042A-6C45-411B-92BE-3CC31331019F} = {E08E042A-6C45-411B-92BE-3CC31331019F} + EndProjectSection +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "03.CustomSceneNode", "03.CustomSceneNode\CustomSceneNode_vc12.vcxproj", "{171CCDFA-C140-4956-8EB7-F0168F4521D3}" + ProjectSection(ProjectDependencies) = postProject + {E08E042A-6C45-411B-92BE-3CC31331019F} = {E08E042A-6C45-411B-92BE-3CC31331019F} + EndProjectSection +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "04.Movement", "04.Movement\Movement_vc12.vcxproj", "{7BDBB7E8-E0C9-4A0D-83C1-D389D6140FEF}" + ProjectSection(ProjectDependencies) = postProject + {E08E042A-6C45-411B-92BE-3CC31331019F} = {E08E042A-6C45-411B-92BE-3CC31331019F} + EndProjectSection +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "05.UserInterface", "05.UserInterface\UserInterface_vc12.vcxproj", "{622C9DD7-0391-49FF-AF53-24F9D5A8EC53}" + ProjectSection(ProjectDependencies) = postProject + {E08E042A-6C45-411B-92BE-3CC31331019F} = {E08E042A-6C45-411B-92BE-3CC31331019F} + EndProjectSection +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "06.2DGraphics", "06.2DGraphics\2DGraphics_vc12.vcxproj", "{E71B6F18-10DC-4101-A541-F6D33F71B2BD}" + ProjectSection(ProjectDependencies) = postProject + {E08E042A-6C45-411B-92BE-3CC31331019F} = {E08E042A-6C45-411B-92BE-3CC31331019F} + EndProjectSection +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "07.Collision", "07.Collision\Collision_vc12.vcxproj", "{3E30297B-5BE3-4A5C-B31E-08A28ADDB29E}" + ProjectSection(ProjectDependencies) = postProject + {E08E042A-6C45-411B-92BE-3CC31331019F} = {E08E042A-6C45-411B-92BE-3CC31331019F} + EndProjectSection +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "08.SpecialFX", "08.SpecialFX\SpecialFX_vc12.vcxproj", "{C869BF55-B9D6-4980-BC92-60FA0CF8411A}" + ProjectSection(ProjectDependencies) = postProject + {E08E042A-6C45-411B-92BE-3CC31331019F} = {E08E042A-6C45-411B-92BE-3CC31331019F} + EndProjectSection +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "09.Meshviewer", "09.Meshviewer\Meshviewer_vc12.vcxproj", "{2AE24484-22FC-481B-9A40-7CD0DA5C8E06}" + ProjectSection(ProjectDependencies) = postProject + {E08E042A-6C45-411B-92BE-3CC31331019F} = {E08E042A-6C45-411B-92BE-3CC31331019F} + EndProjectSection +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "10.Shaders", "10.Shaders\Shaders_vc12.vcxproj", "{27158C82-CD15-4A9B-9848-35E7065B209F}" + ProjectSection(ProjectDependencies) = postProject + {E08E042A-6C45-411B-92BE-3CC31331019F} = {E08E042A-6C45-411B-92BE-3CC31331019F} + EndProjectSection +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "11.PerPixelLighting", "11.PerPixelLighting\PerPixelLighting_vc12.vcxproj", "{C4B42409-542D-4EFC-9E6B-44713FD47A33}" + ProjectSection(ProjectDependencies) = postProject + {E08E042A-6C45-411B-92BE-3CC31331019F} = {E08E042A-6C45-411B-92BE-3CC31331019F} + EndProjectSection +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "12.TerrainRendering", "12.TerrainRendering\TerrainRendering_vc12.vcxproj", "{3A5B74E5-6390-43B0-A459-2793B81FFD31}" + ProjectSection(ProjectDependencies) = postProject + {E08E042A-6C45-411B-92BE-3CC31331019F} = {E08E042A-6C45-411B-92BE-3CC31331019F} + EndProjectSection +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "13.RenderToTexture", "13.RenderToTexture\RenderToTexture_vc12.vcxproj", "{0914E5C8-5352-467B-8421-C9EB35BD5596}" + ProjectSection(ProjectDependencies) = postProject + {E08E042A-6C45-411B-92BE-3CC31331019F} = {E08E042A-6C45-411B-92BE-3CC31331019F} + EndProjectSection +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "14.Win32Window", "14.Win32Window\Win32Window_vc12.vcxproj", "{772FBE05-D05A-467B-9842-BEC409EEA8D0}" + ProjectSection(ProjectDependencies) = postProject + {E08E042A-6C45-411B-92BE-3CC31331019F} = {E08E042A-6C45-411B-92BE-3CC31331019F} + EndProjectSection +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "15.LoadIrrFile", "15.LoadIrrFile\LoadIrrFile_vc12.vcxproj", "{78C9F424-523C-49AC-94B7-823AA4A26BF9}" + ProjectSection(ProjectDependencies) = postProject + {E08E042A-6C45-411B-92BE-3CC31331019F} = {E08E042A-6C45-411B-92BE-3CC31331019F} + EndProjectSection +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "16.Quake3MapShader", "16.Quake3MapShader\Quake3MapShader_vc12.vcxproj", "{EB3B38EA-5CE7-4983-845B-880661E69D09}" + ProjectSection(ProjectDependencies) = postProject + {E08E042A-6C45-411B-92BE-3CC31331019F} = {E08E042A-6C45-411B-92BE-3CC31331019F} + EndProjectSection +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "17.HelloWorld_Mobile", "17.HelloWorld_Mobile\17. HelloWorld for Windows Mobile on PC_vc12.vcxproj", "{2A29B6B1-AFC4-46C7-9944-7052AAE66F7B}" + ProjectSection(ProjectDependencies) = postProject + {E08E042A-6C45-411B-92BE-3CC31331019F} = {E08E042A-6C45-411B-92BE-3CC31331019F} + EndProjectSection +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "18.SplitScreen", "18.SplitScreen\SplitScreen_vc12.vcxproj", "{1AB9413E-4F53-42A3-8CB2-CB4BE22336D0}" + ProjectSection(ProjectDependencies) = postProject + {E08E042A-6C45-411B-92BE-3CC31331019F} = {E08E042A-6C45-411B-92BE-3CC31331019F} + EndProjectSection +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "19.MouseAndJoystick", "19.MouseAndJoystick\MouseAndJoystick_vc12.vcxproj", "{FE853A36-E0D1-4AC5-A792-B643E70D2953}" + ProjectSection(ProjectDependencies) = postProject + {E08E042A-6C45-411B-92BE-3CC31331019F} = {E08E042A-6C45-411B-92BE-3CC31331019F} + EndProjectSection +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "20.ManagedLights", "20.ManagedLights\ManagedLights_vc12.vcxproj", "{16007FE2-142B-47F8-93E1-519BA3F39E71}" + ProjectSection(ProjectDependencies) = postProject + {E08E042A-6C45-411B-92BE-3CC31331019F} = {E08E042A-6C45-411B-92BE-3CC31331019F} + EndProjectSection +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "21.Quake3Explorer", "21.Quake3Explorer\Quake3Explorer_vc12.vcxproj", "{CDC4AAA9-72E1-4FFA-A04D-7EF59D8B97CD}" + ProjectSection(ProjectDependencies) = postProject + {E08E042A-6C45-411B-92BE-3CC31331019F} = {E08E042A-6C45-411B-92BE-3CC31331019F} + EndProjectSection +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "22.MaterialViewer", "22.MaterialViewer\MaterialViewer_vc12.vcxproj", "{4E6C2F8D-BA92-4C5B-96FD-72D4FE8BD7FA}" + ProjectSection(ProjectDependencies) = postProject + {E08E042A-6C45-411B-92BE-3CC31331019F} = {E08E042A-6C45-411B-92BE-3CC31331019F} + EndProjectSection +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "23.SMeshHandling", "23.SMeshHandling\SMeshHandling_vc12.vcxproj", "{6AEC2AA2-C9FF-4B7D-B07A-94A9D34B41D7}" + ProjectSection(ProjectDependencies) = postProject + {E08E042A-6C45-411B-92BE-3CC31331019F} = {E08E042A-6C45-411B-92BE-3CC31331019F} + EndProjectSection +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "24.CursorControl", "24.CursorControl\CursorControl_vc12.vcxproj", "{02B67A37-50E1-49DB-BECF-905BC029C2FE}" + ProjectSection(ProjectDependencies) = postProject + {E08E042A-6C45-411B-92BE-3CC31331019F} = {E08E042A-6C45-411B-92BE-3CC31331019F} + EndProjectSection +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "25.XmlHandling", "25.XmlHandling\XmlHandling_vc12.vcxproj", "{8FDA260E-EF27-4F8C-8720-7AF707DD0D9E}" + ProjectSection(ProjectDependencies) = postProject + {E08E042A-6C45-411B-92BE-3CC31331019F} = {E08E042A-6C45-411B-92BE-3CC31331019F} + EndProjectSection +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "26.OcclusionQuery", "26.OcclusionQuery\OcclusionQuery_vc12.vcxproj", "{5CE0E2E7-879D-4152-B61D-24E7D0707B45}" + ProjectSection(ProjectDependencies) = postProject + {E08E042A-6C45-411B-92BE-3CC31331019F} = {E08E042A-6C45-411B-92BE-3CC31331019F} + EndProjectSection +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "30.Profiling", "30.Profiling\Profiling_vc12.vcxproj", "{65D9DE2E-B73E-4ADF-96D1-BF4A8B7F4F97}" + ProjectSection(ProjectDependencies) = postProject + {E08E042A-6C45-411B-92BE-3CC31331019F} = {E08E042A-6C45-411B-92BE-3CC31331019F} + EndProjectSection +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "GUIEditor", "..\tools\GUIEditor\GUI Editor_vc12.vcxproj", "{853A396E-C031-4C26-A716-5B4E176BE11D}" +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "FontTool", "..\tools\IrrFontTool\newFontTool\irrFontTool_vc12.vcxproj", "{4D53E40F-37E3-42B1-8848-F4C6F8313A17}" +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "MeshConverter", "..\tools\MeshConverter\MeshConverter_vc12.vcxproj", "{E72B637E-4AA6-46F3-885F-AC67B4B470ED}" +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Demo", "Demo\Demo_vc12.vcxproj", "{6F076455-D955-45D4-9C68-4AD4E45F2D47}" + ProjectSection(ProjectDependencies) = postProject + {E08E042A-6C45-411B-92BE-3CC31331019F} = {E08E042A-6C45-411B-92BE-3CC31331019F} + EndProjectSection +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Irrlicht", "..\source\Irrlicht\Irrlicht12.0.vcxproj", "{E08E042A-6C45-411B-92BE-3CC31331019F}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Win32 = Debug|Win32 + Debug|x64 = Debug|x64 + Release - Fast FPU|Win32 = Release - Fast FPU|Win32 + Release - Fast FPU|x64 = Release - Fast FPU|x64 + Release|Win32 = Release|Win32 + Release|x64 = Release|x64 + SDL-Debug|Win32 = SDL-Debug|Win32 + SDL-Debug|x64 = SDL-Debug|x64 + Static lib - Debug|Win32 = Static lib - Debug|Win32 + Static lib - Debug|x64 = Static lib - Debug|x64 + Static lib - Release - Fast FPU|Win32 = Static lib - Release - Fast FPU|Win32 + Static lib - Release - Fast FPU|x64 = Static lib - Release - Fast FPU|x64 + Static lib - Release|Win32 = Static lib - Release|Win32 + Static lib - Release|x64 = Static lib - Release|x64 + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {5AD4C95C-BA38-4692-BA4B-8C25A86208F9}.Debug|Win32.ActiveCfg = Debug|Win32 + {5AD4C95C-BA38-4692-BA4B-8C25A86208F9}.Debug|Win32.Build.0 = Debug|Win32 + {5AD4C95C-BA38-4692-BA4B-8C25A86208F9}.Debug|x64.ActiveCfg = Debug|x64 + {5AD4C95C-BA38-4692-BA4B-8C25A86208F9}.Debug|x64.Build.0 = Debug|x64 + {5AD4C95C-BA38-4692-BA4B-8C25A86208F9}.Release - Fast FPU|Win32.ActiveCfg = Release|Win32 + {5AD4C95C-BA38-4692-BA4B-8C25A86208F9}.Release - Fast FPU|Win32.Build.0 = Release|Win32 + {5AD4C95C-BA38-4692-BA4B-8C25A86208F9}.Release - Fast FPU|x64.ActiveCfg = Release|x64 + {5AD4C95C-BA38-4692-BA4B-8C25A86208F9}.Release - Fast FPU|x64.Build.0 = Release|x64 + {5AD4C95C-BA38-4692-BA4B-8C25A86208F9}.Release|Win32.ActiveCfg = Release|Win32 + {5AD4C95C-BA38-4692-BA4B-8C25A86208F9}.Release|Win32.Build.0 = Release|Win32 + {5AD4C95C-BA38-4692-BA4B-8C25A86208F9}.Release|x64.ActiveCfg = Release|x64 + {5AD4C95C-BA38-4692-BA4B-8C25A86208F9}.Release|x64.Build.0 = Release|x64 + {5AD4C95C-BA38-4692-BA4B-8C25A86208F9}.SDL-Debug|Win32.ActiveCfg = Debug|Win32 + {5AD4C95C-BA38-4692-BA4B-8C25A86208F9}.SDL-Debug|Win32.Build.0 = Debug|Win32 + {5AD4C95C-BA38-4692-BA4B-8C25A86208F9}.SDL-Debug|x64.ActiveCfg = Debug|x64 + {5AD4C95C-BA38-4692-BA4B-8C25A86208F9}.SDL-Debug|x64.Build.0 = Debug|x64 + {5AD4C95C-BA38-4692-BA4B-8C25A86208F9}.Static lib - Debug|Win32.ActiveCfg = Debug|Win32 + {5AD4C95C-BA38-4692-BA4B-8C25A86208F9}.Static lib - Debug|Win32.Build.0 = Debug|Win32 + {5AD4C95C-BA38-4692-BA4B-8C25A86208F9}.Static lib - Debug|x64.ActiveCfg = Debug|x64 + {5AD4C95C-BA38-4692-BA4B-8C25A86208F9}.Static lib - Debug|x64.Build.0 = Debug|x64 + {5AD4C95C-BA38-4692-BA4B-8C25A86208F9}.Static lib - Release - Fast FPU|Win32.ActiveCfg = Release|Win32 + {5AD4C95C-BA38-4692-BA4B-8C25A86208F9}.Static lib - Release - Fast FPU|Win32.Build.0 = Release|Win32 + {5AD4C95C-BA38-4692-BA4B-8C25A86208F9}.Static lib - Release - Fast FPU|x64.ActiveCfg = Release|x64 + {5AD4C95C-BA38-4692-BA4B-8C25A86208F9}.Static lib - Release - Fast FPU|x64.Build.0 = Release|x64 + {5AD4C95C-BA38-4692-BA4B-8C25A86208F9}.Static lib - Release|Win32.ActiveCfg = Release|Win32 + {5AD4C95C-BA38-4692-BA4B-8C25A86208F9}.Static lib - Release|Win32.Build.0 = Release|Win32 + {5AD4C95C-BA38-4692-BA4B-8C25A86208F9}.Static lib - Release|x64.ActiveCfg = Release|x64 + {5AD4C95C-BA38-4692-BA4B-8C25A86208F9}.Static lib - Release|x64.Build.0 = Release|x64 + {D1A464A2-D479-458C-98A2-60965D823CD1}.Debug|Win32.ActiveCfg = Debug|Win32 + {D1A464A2-D479-458C-98A2-60965D823CD1}.Debug|Win32.Build.0 = Debug|Win32 + {D1A464A2-D479-458C-98A2-60965D823CD1}.Debug|x64.ActiveCfg = Debug|x64 + {D1A464A2-D479-458C-98A2-60965D823CD1}.Debug|x64.Build.0 = Debug|x64 + {D1A464A2-D479-458C-98A2-60965D823CD1}.Release - Fast FPU|Win32.ActiveCfg = Release|Win32 + {D1A464A2-D479-458C-98A2-60965D823CD1}.Release - Fast FPU|Win32.Build.0 = Release|Win32 + {D1A464A2-D479-458C-98A2-60965D823CD1}.Release - Fast FPU|x64.ActiveCfg = Release|x64 + {D1A464A2-D479-458C-98A2-60965D823CD1}.Release - Fast FPU|x64.Build.0 = Release|x64 + {D1A464A2-D479-458C-98A2-60965D823CD1}.Release|Win32.ActiveCfg = Release|Win32 + {D1A464A2-D479-458C-98A2-60965D823CD1}.Release|Win32.Build.0 = Release|Win32 + {D1A464A2-D479-458C-98A2-60965D823CD1}.Release|x64.ActiveCfg = Release|x64 + {D1A464A2-D479-458C-98A2-60965D823CD1}.Release|x64.Build.0 = Release|x64 + {D1A464A2-D479-458C-98A2-60965D823CD1}.SDL-Debug|Win32.ActiveCfg = Debug|Win32 + {D1A464A2-D479-458C-98A2-60965D823CD1}.SDL-Debug|Win32.Build.0 = Debug|Win32 + {D1A464A2-D479-458C-98A2-60965D823CD1}.SDL-Debug|x64.ActiveCfg = Debug|x64 + {D1A464A2-D479-458C-98A2-60965D823CD1}.SDL-Debug|x64.Build.0 = Debug|x64 + {D1A464A2-D479-458C-98A2-60965D823CD1}.Static lib - Debug|Win32.ActiveCfg = Debug|Win32 + {D1A464A2-D479-458C-98A2-60965D823CD1}.Static lib - Debug|Win32.Build.0 = Debug|Win32 + {D1A464A2-D479-458C-98A2-60965D823CD1}.Static lib - Debug|x64.ActiveCfg = Debug|x64 + {D1A464A2-D479-458C-98A2-60965D823CD1}.Static lib - Debug|x64.Build.0 = Debug|x64 + {D1A464A2-D479-458C-98A2-60965D823CD1}.Static lib - Release - Fast FPU|Win32.ActiveCfg = Release|Win32 + {D1A464A2-D479-458C-98A2-60965D823CD1}.Static lib - Release - Fast FPU|Win32.Build.0 = Release|Win32 + {D1A464A2-D479-458C-98A2-60965D823CD1}.Static lib - Release - Fast FPU|x64.ActiveCfg = Release|x64 + {D1A464A2-D479-458C-98A2-60965D823CD1}.Static lib - Release - Fast FPU|x64.Build.0 = Release|x64 + {D1A464A2-D479-458C-98A2-60965D823CD1}.Static lib - Release|Win32.ActiveCfg = Release|Win32 + {D1A464A2-D479-458C-98A2-60965D823CD1}.Static lib - Release|Win32.Build.0 = Release|Win32 + {D1A464A2-D479-458C-98A2-60965D823CD1}.Static lib - Release|x64.ActiveCfg = Release|x64 + {D1A464A2-D479-458C-98A2-60965D823CD1}.Static lib - Release|x64.Build.0 = Release|x64 + {171CCDFA-C140-4956-8EB7-F0168F4521D3}.Debug|Win32.ActiveCfg = Debug|Win32 + {171CCDFA-C140-4956-8EB7-F0168F4521D3}.Debug|Win32.Build.0 = Debug|Win32 + {171CCDFA-C140-4956-8EB7-F0168F4521D3}.Debug|x64.ActiveCfg = Debug|x64 + {171CCDFA-C140-4956-8EB7-F0168F4521D3}.Debug|x64.Build.0 = Debug|x64 + {171CCDFA-C140-4956-8EB7-F0168F4521D3}.Release - Fast FPU|Win32.ActiveCfg = Release|Win32 + {171CCDFA-C140-4956-8EB7-F0168F4521D3}.Release - Fast FPU|Win32.Build.0 = Release|Win32 + {171CCDFA-C140-4956-8EB7-F0168F4521D3}.Release - Fast FPU|x64.ActiveCfg = Release|x64 + {171CCDFA-C140-4956-8EB7-F0168F4521D3}.Release - Fast FPU|x64.Build.0 = Release|x64 + {171CCDFA-C140-4956-8EB7-F0168F4521D3}.Release|Win32.ActiveCfg = Release|Win32 + {171CCDFA-C140-4956-8EB7-F0168F4521D3}.Release|Win32.Build.0 = Release|Win32 + {171CCDFA-C140-4956-8EB7-F0168F4521D3}.Release|x64.ActiveCfg = Release|x64 + {171CCDFA-C140-4956-8EB7-F0168F4521D3}.Release|x64.Build.0 = Release|x64 + {171CCDFA-C140-4956-8EB7-F0168F4521D3}.SDL-Debug|Win32.ActiveCfg = Debug|Win32 + {171CCDFA-C140-4956-8EB7-F0168F4521D3}.SDL-Debug|Win32.Build.0 = Debug|Win32 + {171CCDFA-C140-4956-8EB7-F0168F4521D3}.SDL-Debug|x64.ActiveCfg = Debug|x64 + {171CCDFA-C140-4956-8EB7-F0168F4521D3}.SDL-Debug|x64.Build.0 = Debug|x64 + {171CCDFA-C140-4956-8EB7-F0168F4521D3}.Static lib - Debug|Win32.ActiveCfg = Debug|Win32 + {171CCDFA-C140-4956-8EB7-F0168F4521D3}.Static lib - Debug|Win32.Build.0 = Debug|Win32 + {171CCDFA-C140-4956-8EB7-F0168F4521D3}.Static lib - Debug|x64.ActiveCfg = Debug|x64 + {171CCDFA-C140-4956-8EB7-F0168F4521D3}.Static lib - Debug|x64.Build.0 = Debug|x64 + {171CCDFA-C140-4956-8EB7-F0168F4521D3}.Static lib - Release - Fast FPU|Win32.ActiveCfg = Release|Win32 + {171CCDFA-C140-4956-8EB7-F0168F4521D3}.Static lib - Release - Fast FPU|Win32.Build.0 = Release|Win32 + {171CCDFA-C140-4956-8EB7-F0168F4521D3}.Static lib - Release - Fast FPU|x64.ActiveCfg = Release|x64 + {171CCDFA-C140-4956-8EB7-F0168F4521D3}.Static lib - Release - Fast FPU|x64.Build.0 = Release|x64 + {171CCDFA-C140-4956-8EB7-F0168F4521D3}.Static lib - Release|Win32.ActiveCfg = Release|Win32 + {171CCDFA-C140-4956-8EB7-F0168F4521D3}.Static lib - Release|Win32.Build.0 = Release|Win32 + {171CCDFA-C140-4956-8EB7-F0168F4521D3}.Static lib - Release|x64.ActiveCfg = Release|x64 + {171CCDFA-C140-4956-8EB7-F0168F4521D3}.Static lib - Release|x64.Build.0 = Release|x64 + {7BDBB7E8-E0C9-4A0D-83C1-D389D6140FEF}.Debug|Win32.ActiveCfg = Debug|Win32 + {7BDBB7E8-E0C9-4A0D-83C1-D389D6140FEF}.Debug|Win32.Build.0 = Debug|Win32 + {7BDBB7E8-E0C9-4A0D-83C1-D389D6140FEF}.Debug|x64.ActiveCfg = Debug|x64 + {7BDBB7E8-E0C9-4A0D-83C1-D389D6140FEF}.Debug|x64.Build.0 = Debug|x64 + {7BDBB7E8-E0C9-4A0D-83C1-D389D6140FEF}.Release - Fast FPU|Win32.ActiveCfg = Release|Win32 + {7BDBB7E8-E0C9-4A0D-83C1-D389D6140FEF}.Release - Fast FPU|Win32.Build.0 = Release|Win32 + {7BDBB7E8-E0C9-4A0D-83C1-D389D6140FEF}.Release - Fast FPU|x64.ActiveCfg = Release|x64 + {7BDBB7E8-E0C9-4A0D-83C1-D389D6140FEF}.Release - Fast FPU|x64.Build.0 = Release|x64 + {7BDBB7E8-E0C9-4A0D-83C1-D389D6140FEF}.Release|Win32.ActiveCfg = Release|Win32 + {7BDBB7E8-E0C9-4A0D-83C1-D389D6140FEF}.Release|Win32.Build.0 = Release|Win32 + {7BDBB7E8-E0C9-4A0D-83C1-D389D6140FEF}.Release|x64.ActiveCfg = Release|x64 + {7BDBB7E8-E0C9-4A0D-83C1-D389D6140FEF}.Release|x64.Build.0 = Release|x64 + {7BDBB7E8-E0C9-4A0D-83C1-D389D6140FEF}.SDL-Debug|Win32.ActiveCfg = Debug|Win32 + {7BDBB7E8-E0C9-4A0D-83C1-D389D6140FEF}.SDL-Debug|Win32.Build.0 = Debug|Win32 + {7BDBB7E8-E0C9-4A0D-83C1-D389D6140FEF}.SDL-Debug|x64.ActiveCfg = Debug|x64 + {7BDBB7E8-E0C9-4A0D-83C1-D389D6140FEF}.SDL-Debug|x64.Build.0 = Debug|x64 + {7BDBB7E8-E0C9-4A0D-83C1-D389D6140FEF}.Static lib - Debug|Win32.ActiveCfg = Debug|Win32 + {7BDBB7E8-E0C9-4A0D-83C1-D389D6140FEF}.Static lib - Debug|Win32.Build.0 = Debug|Win32 + {7BDBB7E8-E0C9-4A0D-83C1-D389D6140FEF}.Static lib - Debug|x64.ActiveCfg = Debug|x64 + {7BDBB7E8-E0C9-4A0D-83C1-D389D6140FEF}.Static lib - Debug|x64.Build.0 = Debug|x64 + {7BDBB7E8-E0C9-4A0D-83C1-D389D6140FEF}.Static lib - Release - Fast FPU|Win32.ActiveCfg = Release|Win32 + {7BDBB7E8-E0C9-4A0D-83C1-D389D6140FEF}.Static lib - Release - Fast FPU|Win32.Build.0 = Release|Win32 + {7BDBB7E8-E0C9-4A0D-83C1-D389D6140FEF}.Static lib - Release - Fast FPU|x64.ActiveCfg = Release|x64 + {7BDBB7E8-E0C9-4A0D-83C1-D389D6140FEF}.Static lib - Release - Fast FPU|x64.Build.0 = Release|x64 + {7BDBB7E8-E0C9-4A0D-83C1-D389D6140FEF}.Static lib - Release|Win32.ActiveCfg = Release|Win32 + {7BDBB7E8-E0C9-4A0D-83C1-D389D6140FEF}.Static lib - Release|Win32.Build.0 = Release|Win32 + {7BDBB7E8-E0C9-4A0D-83C1-D389D6140FEF}.Static lib - Release|x64.ActiveCfg = Release|x64 + {7BDBB7E8-E0C9-4A0D-83C1-D389D6140FEF}.Static lib - Release|x64.Build.0 = Release|x64 + {622C9DD7-0391-49FF-AF53-24F9D5A8EC53}.Debug|Win32.ActiveCfg = Debug|Win32 + {622C9DD7-0391-49FF-AF53-24F9D5A8EC53}.Debug|Win32.Build.0 = Debug|Win32 + {622C9DD7-0391-49FF-AF53-24F9D5A8EC53}.Debug|x64.ActiveCfg = Debug|x64 + {622C9DD7-0391-49FF-AF53-24F9D5A8EC53}.Debug|x64.Build.0 = Debug|x64 + {622C9DD7-0391-49FF-AF53-24F9D5A8EC53}.Release - Fast FPU|Win32.ActiveCfg = Release|Win32 + {622C9DD7-0391-49FF-AF53-24F9D5A8EC53}.Release - Fast FPU|Win32.Build.0 = Release|Win32 + {622C9DD7-0391-49FF-AF53-24F9D5A8EC53}.Release - Fast FPU|x64.ActiveCfg = Release|x64 + {622C9DD7-0391-49FF-AF53-24F9D5A8EC53}.Release - Fast FPU|x64.Build.0 = Release|x64 + {622C9DD7-0391-49FF-AF53-24F9D5A8EC53}.Release|Win32.ActiveCfg = Release|Win32 + {622C9DD7-0391-49FF-AF53-24F9D5A8EC53}.Release|Win32.Build.0 = Release|Win32 + {622C9DD7-0391-49FF-AF53-24F9D5A8EC53}.Release|x64.ActiveCfg = Release|x64 + {622C9DD7-0391-49FF-AF53-24F9D5A8EC53}.Release|x64.Build.0 = Release|x64 + {622C9DD7-0391-49FF-AF53-24F9D5A8EC53}.SDL-Debug|Win32.ActiveCfg = Debug|Win32 + {622C9DD7-0391-49FF-AF53-24F9D5A8EC53}.SDL-Debug|Win32.Build.0 = Debug|Win32 + {622C9DD7-0391-49FF-AF53-24F9D5A8EC53}.SDL-Debug|x64.ActiveCfg = Debug|x64 + {622C9DD7-0391-49FF-AF53-24F9D5A8EC53}.SDL-Debug|x64.Build.0 = Debug|x64 + {622C9DD7-0391-49FF-AF53-24F9D5A8EC53}.Static lib - Debug|Win32.ActiveCfg = Debug|Win32 + {622C9DD7-0391-49FF-AF53-24F9D5A8EC53}.Static lib - Debug|Win32.Build.0 = Debug|Win32 + {622C9DD7-0391-49FF-AF53-24F9D5A8EC53}.Static lib - Debug|x64.ActiveCfg = Debug|x64 + {622C9DD7-0391-49FF-AF53-24F9D5A8EC53}.Static lib - Debug|x64.Build.0 = Debug|x64 + {622C9DD7-0391-49FF-AF53-24F9D5A8EC53}.Static lib - Release - Fast FPU|Win32.ActiveCfg = Release|Win32 + {622C9DD7-0391-49FF-AF53-24F9D5A8EC53}.Static lib - Release - Fast FPU|Win32.Build.0 = Release|Win32 + {622C9DD7-0391-49FF-AF53-24F9D5A8EC53}.Static lib - Release - Fast FPU|x64.ActiveCfg = Release|x64 + {622C9DD7-0391-49FF-AF53-24F9D5A8EC53}.Static lib - Release - Fast FPU|x64.Build.0 = Release|x64 + {622C9DD7-0391-49FF-AF53-24F9D5A8EC53}.Static lib - Release|Win32.ActiveCfg = Release|Win32 + {622C9DD7-0391-49FF-AF53-24F9D5A8EC53}.Static lib - Release|Win32.Build.0 = Release|Win32 + {622C9DD7-0391-49FF-AF53-24F9D5A8EC53}.Static lib - Release|x64.ActiveCfg = Release|x64 + {622C9DD7-0391-49FF-AF53-24F9D5A8EC53}.Static lib - Release|x64.Build.0 = Release|x64 + {E71B6F18-10DC-4101-A541-F6D33F71B2BD}.Debug|Win32.ActiveCfg = Debug|Win32 + {E71B6F18-10DC-4101-A541-F6D33F71B2BD}.Debug|Win32.Build.0 = Debug|Win32 + {E71B6F18-10DC-4101-A541-F6D33F71B2BD}.Debug|x64.ActiveCfg = Debug|x64 + {E71B6F18-10DC-4101-A541-F6D33F71B2BD}.Debug|x64.Build.0 = Debug|x64 + {E71B6F18-10DC-4101-A541-F6D33F71B2BD}.Release - Fast FPU|Win32.ActiveCfg = Release|Win32 + {E71B6F18-10DC-4101-A541-F6D33F71B2BD}.Release - Fast FPU|Win32.Build.0 = Release|Win32 + {E71B6F18-10DC-4101-A541-F6D33F71B2BD}.Release - Fast FPU|x64.ActiveCfg = Release|x64 + {E71B6F18-10DC-4101-A541-F6D33F71B2BD}.Release - Fast FPU|x64.Build.0 = Release|x64 + {E71B6F18-10DC-4101-A541-F6D33F71B2BD}.Release|Win32.ActiveCfg = Release|Win32 + {E71B6F18-10DC-4101-A541-F6D33F71B2BD}.Release|Win32.Build.0 = Release|Win32 + {E71B6F18-10DC-4101-A541-F6D33F71B2BD}.Release|x64.ActiveCfg = Release|x64 + {E71B6F18-10DC-4101-A541-F6D33F71B2BD}.Release|x64.Build.0 = Release|x64 + {E71B6F18-10DC-4101-A541-F6D33F71B2BD}.SDL-Debug|Win32.ActiveCfg = Debug|Win32 + {E71B6F18-10DC-4101-A541-F6D33F71B2BD}.SDL-Debug|Win32.Build.0 = Debug|Win32 + {E71B6F18-10DC-4101-A541-F6D33F71B2BD}.SDL-Debug|x64.ActiveCfg = Debug|x64 + {E71B6F18-10DC-4101-A541-F6D33F71B2BD}.SDL-Debug|x64.Build.0 = Debug|x64 + {E71B6F18-10DC-4101-A541-F6D33F71B2BD}.Static lib - Debug|Win32.ActiveCfg = Debug|Win32 + {E71B6F18-10DC-4101-A541-F6D33F71B2BD}.Static lib - Debug|Win32.Build.0 = Debug|Win32 + {E71B6F18-10DC-4101-A541-F6D33F71B2BD}.Static lib - Debug|x64.ActiveCfg = Debug|x64 + {E71B6F18-10DC-4101-A541-F6D33F71B2BD}.Static lib - Debug|x64.Build.0 = Debug|x64 + {E71B6F18-10DC-4101-A541-F6D33F71B2BD}.Static lib - Release - Fast FPU|Win32.ActiveCfg = Release|Win32 + {E71B6F18-10DC-4101-A541-F6D33F71B2BD}.Static lib - Release - Fast FPU|Win32.Build.0 = Release|Win32 + {E71B6F18-10DC-4101-A541-F6D33F71B2BD}.Static lib - Release - Fast FPU|x64.ActiveCfg = Release|x64 + {E71B6F18-10DC-4101-A541-F6D33F71B2BD}.Static lib - Release - Fast FPU|x64.Build.0 = Release|x64 + {E71B6F18-10DC-4101-A541-F6D33F71B2BD}.Static lib - Release|Win32.ActiveCfg = Release|Win32 + {E71B6F18-10DC-4101-A541-F6D33F71B2BD}.Static lib - Release|Win32.Build.0 = Release|Win32 + {E71B6F18-10DC-4101-A541-F6D33F71B2BD}.Static lib - Release|x64.ActiveCfg = Release|x64 + {E71B6F18-10DC-4101-A541-F6D33F71B2BD}.Static lib - Release|x64.Build.0 = Release|x64 + {3E30297B-5BE3-4A5C-B31E-08A28ADDB29E}.Debug|Win32.ActiveCfg = Debug|Win32 + {3E30297B-5BE3-4A5C-B31E-08A28ADDB29E}.Debug|Win32.Build.0 = Debug|Win32 + {3E30297B-5BE3-4A5C-B31E-08A28ADDB29E}.Debug|x64.ActiveCfg = Debug|x64 + {3E30297B-5BE3-4A5C-B31E-08A28ADDB29E}.Debug|x64.Build.0 = Debug|x64 + {3E30297B-5BE3-4A5C-B31E-08A28ADDB29E}.Release - Fast FPU|Win32.ActiveCfg = Release|Win32 + {3E30297B-5BE3-4A5C-B31E-08A28ADDB29E}.Release - Fast FPU|Win32.Build.0 = Release|Win32 + {3E30297B-5BE3-4A5C-B31E-08A28ADDB29E}.Release - Fast FPU|x64.ActiveCfg = Release|x64 + {3E30297B-5BE3-4A5C-B31E-08A28ADDB29E}.Release - Fast FPU|x64.Build.0 = Release|x64 + {3E30297B-5BE3-4A5C-B31E-08A28ADDB29E}.Release|Win32.ActiveCfg = Release|Win32 + {3E30297B-5BE3-4A5C-B31E-08A28ADDB29E}.Release|Win32.Build.0 = Release|Win32 + {3E30297B-5BE3-4A5C-B31E-08A28ADDB29E}.Release|x64.ActiveCfg = Release|x64 + {3E30297B-5BE3-4A5C-B31E-08A28ADDB29E}.Release|x64.Build.0 = Release|x64 + {3E30297B-5BE3-4A5C-B31E-08A28ADDB29E}.SDL-Debug|Win32.ActiveCfg = Debug|Win32 + {3E30297B-5BE3-4A5C-B31E-08A28ADDB29E}.SDL-Debug|Win32.Build.0 = Debug|Win32 + {3E30297B-5BE3-4A5C-B31E-08A28ADDB29E}.SDL-Debug|x64.ActiveCfg = Debug|x64 + {3E30297B-5BE3-4A5C-B31E-08A28ADDB29E}.SDL-Debug|x64.Build.0 = Debug|x64 + {3E30297B-5BE3-4A5C-B31E-08A28ADDB29E}.Static lib - Debug|Win32.ActiveCfg = Debug|Win32 + {3E30297B-5BE3-4A5C-B31E-08A28ADDB29E}.Static lib - Debug|Win32.Build.0 = Debug|Win32 + {3E30297B-5BE3-4A5C-B31E-08A28ADDB29E}.Static lib - Debug|x64.ActiveCfg = Debug|x64 + {3E30297B-5BE3-4A5C-B31E-08A28ADDB29E}.Static lib - Debug|x64.Build.0 = Debug|x64 + {3E30297B-5BE3-4A5C-B31E-08A28ADDB29E}.Static lib - Release - Fast FPU|Win32.ActiveCfg = Release|Win32 + {3E30297B-5BE3-4A5C-B31E-08A28ADDB29E}.Static lib - Release - Fast FPU|Win32.Build.0 = Release|Win32 + {3E30297B-5BE3-4A5C-B31E-08A28ADDB29E}.Static lib - Release - Fast FPU|x64.ActiveCfg = Release|x64 + {3E30297B-5BE3-4A5C-B31E-08A28ADDB29E}.Static lib - Release - Fast FPU|x64.Build.0 = Release|x64 + {3E30297B-5BE3-4A5C-B31E-08A28ADDB29E}.Static lib - Release|Win32.ActiveCfg = Release|Win32 + {3E30297B-5BE3-4A5C-B31E-08A28ADDB29E}.Static lib - Release|Win32.Build.0 = Release|Win32 + {3E30297B-5BE3-4A5C-B31E-08A28ADDB29E}.Static lib - Release|x64.ActiveCfg = Release|x64 + {3E30297B-5BE3-4A5C-B31E-08A28ADDB29E}.Static lib - Release|x64.Build.0 = Release|x64 + {C869BF55-B9D6-4980-BC92-60FA0CF8411A}.Debug|Win32.ActiveCfg = Debug|Win32 + {C869BF55-B9D6-4980-BC92-60FA0CF8411A}.Debug|Win32.Build.0 = Debug|Win32 + {C869BF55-B9D6-4980-BC92-60FA0CF8411A}.Debug|x64.ActiveCfg = Debug|x64 + {C869BF55-B9D6-4980-BC92-60FA0CF8411A}.Debug|x64.Build.0 = Debug|x64 + {C869BF55-B9D6-4980-BC92-60FA0CF8411A}.Release - Fast FPU|Win32.ActiveCfg = Release|Win32 + {C869BF55-B9D6-4980-BC92-60FA0CF8411A}.Release - Fast FPU|Win32.Build.0 = Release|Win32 + {C869BF55-B9D6-4980-BC92-60FA0CF8411A}.Release - Fast FPU|x64.ActiveCfg = Release|x64 + {C869BF55-B9D6-4980-BC92-60FA0CF8411A}.Release - Fast FPU|x64.Build.0 = Release|x64 + {C869BF55-B9D6-4980-BC92-60FA0CF8411A}.Release|Win32.ActiveCfg = Release|Win32 + {C869BF55-B9D6-4980-BC92-60FA0CF8411A}.Release|Win32.Build.0 = Release|Win32 + {C869BF55-B9D6-4980-BC92-60FA0CF8411A}.Release|x64.ActiveCfg = Release|x64 + {C869BF55-B9D6-4980-BC92-60FA0CF8411A}.Release|x64.Build.0 = Release|x64 + {C869BF55-B9D6-4980-BC92-60FA0CF8411A}.SDL-Debug|Win32.ActiveCfg = Debug|Win32 + {C869BF55-B9D6-4980-BC92-60FA0CF8411A}.SDL-Debug|Win32.Build.0 = Debug|Win32 + {C869BF55-B9D6-4980-BC92-60FA0CF8411A}.SDL-Debug|x64.ActiveCfg = Debug|x64 + {C869BF55-B9D6-4980-BC92-60FA0CF8411A}.SDL-Debug|x64.Build.0 = Debug|x64 + {C869BF55-B9D6-4980-BC92-60FA0CF8411A}.Static lib - Debug|Win32.ActiveCfg = Debug|Win32 + {C869BF55-B9D6-4980-BC92-60FA0CF8411A}.Static lib - Debug|Win32.Build.0 = Debug|Win32 + {C869BF55-B9D6-4980-BC92-60FA0CF8411A}.Static lib - Debug|x64.ActiveCfg = Debug|x64 + {C869BF55-B9D6-4980-BC92-60FA0CF8411A}.Static lib - Debug|x64.Build.0 = Debug|x64 + {C869BF55-B9D6-4980-BC92-60FA0CF8411A}.Static lib - Release - Fast FPU|Win32.ActiveCfg = Release|Win32 + {C869BF55-B9D6-4980-BC92-60FA0CF8411A}.Static lib - Release - Fast FPU|Win32.Build.0 = Release|Win32 + {C869BF55-B9D6-4980-BC92-60FA0CF8411A}.Static lib - Release - Fast FPU|x64.ActiveCfg = Release|x64 + {C869BF55-B9D6-4980-BC92-60FA0CF8411A}.Static lib - Release - Fast FPU|x64.Build.0 = Release|x64 + {C869BF55-B9D6-4980-BC92-60FA0CF8411A}.Static lib - Release|Win32.ActiveCfg = Release|Win32 + {C869BF55-B9D6-4980-BC92-60FA0CF8411A}.Static lib - Release|Win32.Build.0 = Release|Win32 + {C869BF55-B9D6-4980-BC92-60FA0CF8411A}.Static lib - Release|x64.ActiveCfg = Release|x64 + {C869BF55-B9D6-4980-BC92-60FA0CF8411A}.Static lib - Release|x64.Build.0 = Release|x64 + {2AE24484-22FC-481B-9A40-7CD0DA5C8E06}.Debug|Win32.ActiveCfg = Debug|Win32 + {2AE24484-22FC-481B-9A40-7CD0DA5C8E06}.Debug|Win32.Build.0 = Debug|Win32 + {2AE24484-22FC-481B-9A40-7CD0DA5C8E06}.Debug|x64.ActiveCfg = Debug|x64 + {2AE24484-22FC-481B-9A40-7CD0DA5C8E06}.Debug|x64.Build.0 = Debug|x64 + {2AE24484-22FC-481B-9A40-7CD0DA5C8E06}.Release - Fast FPU|Win32.ActiveCfg = Release|Win32 + {2AE24484-22FC-481B-9A40-7CD0DA5C8E06}.Release - Fast FPU|Win32.Build.0 = Release|Win32 + {2AE24484-22FC-481B-9A40-7CD0DA5C8E06}.Release - Fast FPU|x64.ActiveCfg = Release|x64 + {2AE24484-22FC-481B-9A40-7CD0DA5C8E06}.Release - Fast FPU|x64.Build.0 = Release|x64 + {2AE24484-22FC-481B-9A40-7CD0DA5C8E06}.Release|Win32.ActiveCfg = Release|Win32 + {2AE24484-22FC-481B-9A40-7CD0DA5C8E06}.Release|Win32.Build.0 = Release|Win32 + {2AE24484-22FC-481B-9A40-7CD0DA5C8E06}.Release|x64.ActiveCfg = Release|x64 + {2AE24484-22FC-481B-9A40-7CD0DA5C8E06}.Release|x64.Build.0 = Release|x64 + {2AE24484-22FC-481B-9A40-7CD0DA5C8E06}.SDL-Debug|Win32.ActiveCfg = Debug|Win32 + {2AE24484-22FC-481B-9A40-7CD0DA5C8E06}.SDL-Debug|Win32.Build.0 = Debug|Win32 + {2AE24484-22FC-481B-9A40-7CD0DA5C8E06}.SDL-Debug|x64.ActiveCfg = Debug|x64 + {2AE24484-22FC-481B-9A40-7CD0DA5C8E06}.SDL-Debug|x64.Build.0 = Debug|x64 + {2AE24484-22FC-481B-9A40-7CD0DA5C8E06}.Static lib - Debug|Win32.ActiveCfg = Debug|Win32 + {2AE24484-22FC-481B-9A40-7CD0DA5C8E06}.Static lib - Debug|Win32.Build.0 = Debug|Win32 + {2AE24484-22FC-481B-9A40-7CD0DA5C8E06}.Static lib - Debug|x64.ActiveCfg = Debug|x64 + {2AE24484-22FC-481B-9A40-7CD0DA5C8E06}.Static lib - Debug|x64.Build.0 = Debug|x64 + {2AE24484-22FC-481B-9A40-7CD0DA5C8E06}.Static lib - Release - Fast FPU|Win32.ActiveCfg = Release|Win32 + {2AE24484-22FC-481B-9A40-7CD0DA5C8E06}.Static lib - Release - Fast FPU|Win32.Build.0 = Release|Win32 + {2AE24484-22FC-481B-9A40-7CD0DA5C8E06}.Static lib - Release - Fast FPU|x64.ActiveCfg = Release|x64 + {2AE24484-22FC-481B-9A40-7CD0DA5C8E06}.Static lib - Release - Fast FPU|x64.Build.0 = Release|x64 + {2AE24484-22FC-481B-9A40-7CD0DA5C8E06}.Static lib - Release|Win32.ActiveCfg = Release|Win32 + {2AE24484-22FC-481B-9A40-7CD0DA5C8E06}.Static lib - Release|Win32.Build.0 = Release|Win32 + {2AE24484-22FC-481B-9A40-7CD0DA5C8E06}.Static lib - Release|x64.ActiveCfg = Release|x64 + {2AE24484-22FC-481B-9A40-7CD0DA5C8E06}.Static lib - Release|x64.Build.0 = Release|x64 + {27158C82-CD15-4A9B-9848-35E7065B209F}.Debug|Win32.ActiveCfg = Debug|Win32 + {27158C82-CD15-4A9B-9848-35E7065B209F}.Debug|Win32.Build.0 = Debug|Win32 + {27158C82-CD15-4A9B-9848-35E7065B209F}.Debug|x64.ActiveCfg = Debug|x64 + {27158C82-CD15-4A9B-9848-35E7065B209F}.Debug|x64.Build.0 = Debug|x64 + {27158C82-CD15-4A9B-9848-35E7065B209F}.Release - Fast FPU|Win32.ActiveCfg = Release|Win32 + {27158C82-CD15-4A9B-9848-35E7065B209F}.Release - Fast FPU|Win32.Build.0 = Release|Win32 + {27158C82-CD15-4A9B-9848-35E7065B209F}.Release - Fast FPU|x64.ActiveCfg = Release|x64 + {27158C82-CD15-4A9B-9848-35E7065B209F}.Release - Fast FPU|x64.Build.0 = Release|x64 + {27158C82-CD15-4A9B-9848-35E7065B209F}.Release|Win32.ActiveCfg = Release|Win32 + {27158C82-CD15-4A9B-9848-35E7065B209F}.Release|Win32.Build.0 = Release|Win32 + {27158C82-CD15-4A9B-9848-35E7065B209F}.Release|x64.ActiveCfg = Release|x64 + {27158C82-CD15-4A9B-9848-35E7065B209F}.Release|x64.Build.0 = Release|x64 + {27158C82-CD15-4A9B-9848-35E7065B209F}.SDL-Debug|Win32.ActiveCfg = Debug|Win32 + {27158C82-CD15-4A9B-9848-35E7065B209F}.SDL-Debug|Win32.Build.0 = Debug|Win32 + {27158C82-CD15-4A9B-9848-35E7065B209F}.SDL-Debug|x64.ActiveCfg = Debug|x64 + {27158C82-CD15-4A9B-9848-35E7065B209F}.SDL-Debug|x64.Build.0 = Debug|x64 + {27158C82-CD15-4A9B-9848-35E7065B209F}.Static lib - Debug|Win32.ActiveCfg = Debug|Win32 + {27158C82-CD15-4A9B-9848-35E7065B209F}.Static lib - Debug|Win32.Build.0 = Debug|Win32 + {27158C82-CD15-4A9B-9848-35E7065B209F}.Static lib - Debug|x64.ActiveCfg = Debug|x64 + {27158C82-CD15-4A9B-9848-35E7065B209F}.Static lib - Debug|x64.Build.0 = Debug|x64 + {27158C82-CD15-4A9B-9848-35E7065B209F}.Static lib - Release - Fast FPU|Win32.ActiveCfg = Release|Win32 + {27158C82-CD15-4A9B-9848-35E7065B209F}.Static lib - Release - Fast FPU|Win32.Build.0 = Release|Win32 + {27158C82-CD15-4A9B-9848-35E7065B209F}.Static lib - Release - Fast FPU|x64.ActiveCfg = Release|x64 + {27158C82-CD15-4A9B-9848-35E7065B209F}.Static lib - Release - Fast FPU|x64.Build.0 = Release|x64 + {27158C82-CD15-4A9B-9848-35E7065B209F}.Static lib - Release|Win32.ActiveCfg = Release|Win32 + {27158C82-CD15-4A9B-9848-35E7065B209F}.Static lib - Release|Win32.Build.0 = Release|Win32 + {27158C82-CD15-4A9B-9848-35E7065B209F}.Static lib - Release|x64.ActiveCfg = Release|x64 + {27158C82-CD15-4A9B-9848-35E7065B209F}.Static lib - Release|x64.Build.0 = Release|x64 + {C4B42409-542D-4EFC-9E6B-44713FD47A33}.Debug|Win32.ActiveCfg = Debug|Win32 + {C4B42409-542D-4EFC-9E6B-44713FD47A33}.Debug|Win32.Build.0 = Debug|Win32 + {C4B42409-542D-4EFC-9E6B-44713FD47A33}.Debug|x64.ActiveCfg = Debug|x64 + {C4B42409-542D-4EFC-9E6B-44713FD47A33}.Debug|x64.Build.0 = Debug|x64 + {C4B42409-542D-4EFC-9E6B-44713FD47A33}.Release - Fast FPU|Win32.ActiveCfg = Release|Win32 + {C4B42409-542D-4EFC-9E6B-44713FD47A33}.Release - Fast FPU|Win32.Build.0 = Release|Win32 + {C4B42409-542D-4EFC-9E6B-44713FD47A33}.Release - Fast FPU|x64.ActiveCfg = Release|x64 + {C4B42409-542D-4EFC-9E6B-44713FD47A33}.Release - Fast FPU|x64.Build.0 = Release|x64 + {C4B42409-542D-4EFC-9E6B-44713FD47A33}.Release|Win32.ActiveCfg = Release|Win32 + {C4B42409-542D-4EFC-9E6B-44713FD47A33}.Release|Win32.Build.0 = Release|Win32 + {C4B42409-542D-4EFC-9E6B-44713FD47A33}.Release|x64.ActiveCfg = Release|x64 + {C4B42409-542D-4EFC-9E6B-44713FD47A33}.Release|x64.Build.0 = Release|x64 + {C4B42409-542D-4EFC-9E6B-44713FD47A33}.SDL-Debug|Win32.ActiveCfg = Debug|Win32 + {C4B42409-542D-4EFC-9E6B-44713FD47A33}.SDL-Debug|Win32.Build.0 = Debug|Win32 + {C4B42409-542D-4EFC-9E6B-44713FD47A33}.SDL-Debug|x64.ActiveCfg = Debug|x64 + {C4B42409-542D-4EFC-9E6B-44713FD47A33}.SDL-Debug|x64.Build.0 = Debug|x64 + {C4B42409-542D-4EFC-9E6B-44713FD47A33}.Static lib - Debug|Win32.ActiveCfg = Debug|Win32 + {C4B42409-542D-4EFC-9E6B-44713FD47A33}.Static lib - Debug|Win32.Build.0 = Debug|Win32 + {C4B42409-542D-4EFC-9E6B-44713FD47A33}.Static lib - Debug|x64.ActiveCfg = Debug|x64 + {C4B42409-542D-4EFC-9E6B-44713FD47A33}.Static lib - Debug|x64.Build.0 = Debug|x64 + {C4B42409-542D-4EFC-9E6B-44713FD47A33}.Static lib - Release - Fast FPU|Win32.ActiveCfg = Release|Win32 + {C4B42409-542D-4EFC-9E6B-44713FD47A33}.Static lib - Release - Fast FPU|Win32.Build.0 = Release|Win32 + {C4B42409-542D-4EFC-9E6B-44713FD47A33}.Static lib - Release - Fast FPU|x64.ActiveCfg = Release|x64 + {C4B42409-542D-4EFC-9E6B-44713FD47A33}.Static lib - Release - Fast FPU|x64.Build.0 = Release|x64 + {C4B42409-542D-4EFC-9E6B-44713FD47A33}.Static lib - Release|Win32.ActiveCfg = Release|Win32 + {C4B42409-542D-4EFC-9E6B-44713FD47A33}.Static lib - Release|Win32.Build.0 = Release|Win32 + {C4B42409-542D-4EFC-9E6B-44713FD47A33}.Static lib - Release|x64.ActiveCfg = Release|x64 + {C4B42409-542D-4EFC-9E6B-44713FD47A33}.Static lib - Release|x64.Build.0 = Release|x64 + {3A5B74E5-6390-43B0-A459-2793B81FFD31}.Debug|Win32.ActiveCfg = Debug|Win32 + {3A5B74E5-6390-43B0-A459-2793B81FFD31}.Debug|Win32.Build.0 = Debug|Win32 + {3A5B74E5-6390-43B0-A459-2793B81FFD31}.Debug|x64.ActiveCfg = Debug|x64 + {3A5B74E5-6390-43B0-A459-2793B81FFD31}.Debug|x64.Build.0 = Debug|x64 + {3A5B74E5-6390-43B0-A459-2793B81FFD31}.Release - Fast FPU|Win32.ActiveCfg = Release|Win32 + {3A5B74E5-6390-43B0-A459-2793B81FFD31}.Release - Fast FPU|Win32.Build.0 = Release|Win32 + {3A5B74E5-6390-43B0-A459-2793B81FFD31}.Release - Fast FPU|x64.ActiveCfg = Release|x64 + {3A5B74E5-6390-43B0-A459-2793B81FFD31}.Release - Fast FPU|x64.Build.0 = Release|x64 + {3A5B74E5-6390-43B0-A459-2793B81FFD31}.Release|Win32.ActiveCfg = Release|Win32 + {3A5B74E5-6390-43B0-A459-2793B81FFD31}.Release|Win32.Build.0 = Release|Win32 + {3A5B74E5-6390-43B0-A459-2793B81FFD31}.Release|x64.ActiveCfg = Release|x64 + {3A5B74E5-6390-43B0-A459-2793B81FFD31}.Release|x64.Build.0 = Release|x64 + {3A5B74E5-6390-43B0-A459-2793B81FFD31}.SDL-Debug|Win32.ActiveCfg = Debug|Win32 + {3A5B74E5-6390-43B0-A459-2793B81FFD31}.SDL-Debug|Win32.Build.0 = Debug|Win32 + {3A5B74E5-6390-43B0-A459-2793B81FFD31}.SDL-Debug|x64.ActiveCfg = Debug|x64 + {3A5B74E5-6390-43B0-A459-2793B81FFD31}.SDL-Debug|x64.Build.0 = Debug|x64 + {3A5B74E5-6390-43B0-A459-2793B81FFD31}.Static lib - Debug|Win32.ActiveCfg = Debug|Win32 + {3A5B74E5-6390-43B0-A459-2793B81FFD31}.Static lib - Debug|Win32.Build.0 = Debug|Win32 + {3A5B74E5-6390-43B0-A459-2793B81FFD31}.Static lib - Debug|x64.ActiveCfg = Debug|x64 + {3A5B74E5-6390-43B0-A459-2793B81FFD31}.Static lib - Debug|x64.Build.0 = Debug|x64 + {3A5B74E5-6390-43B0-A459-2793B81FFD31}.Static lib - Release - Fast FPU|Win32.ActiveCfg = Release|Win32 + {3A5B74E5-6390-43B0-A459-2793B81FFD31}.Static lib - Release - Fast FPU|Win32.Build.0 = Release|Win32 + {3A5B74E5-6390-43B0-A459-2793B81FFD31}.Static lib - Release - Fast FPU|x64.ActiveCfg = Release|x64 + {3A5B74E5-6390-43B0-A459-2793B81FFD31}.Static lib - Release - Fast FPU|x64.Build.0 = Release|x64 + {3A5B74E5-6390-43B0-A459-2793B81FFD31}.Static lib - Release|Win32.ActiveCfg = Release|Win32 + {3A5B74E5-6390-43B0-A459-2793B81FFD31}.Static lib - Release|Win32.Build.0 = Release|Win32 + {3A5B74E5-6390-43B0-A459-2793B81FFD31}.Static lib - Release|x64.ActiveCfg = Release|x64 + {3A5B74E5-6390-43B0-A459-2793B81FFD31}.Static lib - Release|x64.Build.0 = Release|x64 + {0914E5C8-5352-467B-8421-C9EB35BD5596}.Debug|Win32.ActiveCfg = Debug|Win32 + {0914E5C8-5352-467B-8421-C9EB35BD5596}.Debug|Win32.Build.0 = Debug|Win32 + {0914E5C8-5352-467B-8421-C9EB35BD5596}.Debug|x64.ActiveCfg = Debug|x64 + {0914E5C8-5352-467B-8421-C9EB35BD5596}.Debug|x64.Build.0 = Debug|x64 + {0914E5C8-5352-467B-8421-C9EB35BD5596}.Release - Fast FPU|Win32.ActiveCfg = Release|Win32 + {0914E5C8-5352-467B-8421-C9EB35BD5596}.Release - Fast FPU|Win32.Build.0 = Release|Win32 + {0914E5C8-5352-467B-8421-C9EB35BD5596}.Release - Fast FPU|x64.ActiveCfg = Release|x64 + {0914E5C8-5352-467B-8421-C9EB35BD5596}.Release - Fast FPU|x64.Build.0 = Release|x64 + {0914E5C8-5352-467B-8421-C9EB35BD5596}.Release|Win32.ActiveCfg = Release|Win32 + {0914E5C8-5352-467B-8421-C9EB35BD5596}.Release|Win32.Build.0 = Release|Win32 + {0914E5C8-5352-467B-8421-C9EB35BD5596}.Release|x64.ActiveCfg = Release|x64 + {0914E5C8-5352-467B-8421-C9EB35BD5596}.Release|x64.Build.0 = Release|x64 + {0914E5C8-5352-467B-8421-C9EB35BD5596}.SDL-Debug|Win32.ActiveCfg = Debug|Win32 + {0914E5C8-5352-467B-8421-C9EB35BD5596}.SDL-Debug|Win32.Build.0 = Debug|Win32 + {0914E5C8-5352-467B-8421-C9EB35BD5596}.SDL-Debug|x64.ActiveCfg = Debug|x64 + {0914E5C8-5352-467B-8421-C9EB35BD5596}.SDL-Debug|x64.Build.0 = Debug|x64 + {0914E5C8-5352-467B-8421-C9EB35BD5596}.Static lib - Debug|Win32.ActiveCfg = Debug|Win32 + {0914E5C8-5352-467B-8421-C9EB35BD5596}.Static lib - Debug|Win32.Build.0 = Debug|Win32 + {0914E5C8-5352-467B-8421-C9EB35BD5596}.Static lib - Debug|x64.ActiveCfg = Debug|x64 + {0914E5C8-5352-467B-8421-C9EB35BD5596}.Static lib - Debug|x64.Build.0 = Debug|x64 + {0914E5C8-5352-467B-8421-C9EB35BD5596}.Static lib - Release - Fast FPU|Win32.ActiveCfg = Release|Win32 + {0914E5C8-5352-467B-8421-C9EB35BD5596}.Static lib - Release - Fast FPU|Win32.Build.0 = Release|Win32 + {0914E5C8-5352-467B-8421-C9EB35BD5596}.Static lib - Release - Fast FPU|x64.ActiveCfg = Release|x64 + {0914E5C8-5352-467B-8421-C9EB35BD5596}.Static lib - Release - Fast FPU|x64.Build.0 = Release|x64 + {0914E5C8-5352-467B-8421-C9EB35BD5596}.Static lib - Release|Win32.ActiveCfg = Release|Win32 + {0914E5C8-5352-467B-8421-C9EB35BD5596}.Static lib - Release|Win32.Build.0 = Release|Win32 + {0914E5C8-5352-467B-8421-C9EB35BD5596}.Static lib - Release|x64.ActiveCfg = Release|x64 + {0914E5C8-5352-467B-8421-C9EB35BD5596}.Static lib - Release|x64.Build.0 = Release|x64 + {772FBE05-D05A-467B-9842-BEC409EEA8D0}.Debug|Win32.ActiveCfg = Debug|Win32 + {772FBE05-D05A-467B-9842-BEC409EEA8D0}.Debug|Win32.Build.0 = Debug|Win32 + {772FBE05-D05A-467B-9842-BEC409EEA8D0}.Debug|x64.ActiveCfg = Debug|x64 + {772FBE05-D05A-467B-9842-BEC409EEA8D0}.Debug|x64.Build.0 = Debug|x64 + {772FBE05-D05A-467B-9842-BEC409EEA8D0}.Release - Fast FPU|Win32.ActiveCfg = Release|Win32 + {772FBE05-D05A-467B-9842-BEC409EEA8D0}.Release - Fast FPU|Win32.Build.0 = Release|Win32 + {772FBE05-D05A-467B-9842-BEC409EEA8D0}.Release - Fast FPU|x64.ActiveCfg = Release|x64 + {772FBE05-D05A-467B-9842-BEC409EEA8D0}.Release - Fast FPU|x64.Build.0 = Release|x64 + {772FBE05-D05A-467B-9842-BEC409EEA8D0}.Release|Win32.ActiveCfg = Release|Win32 + {772FBE05-D05A-467B-9842-BEC409EEA8D0}.Release|Win32.Build.0 = Release|Win32 + {772FBE05-D05A-467B-9842-BEC409EEA8D0}.Release|x64.ActiveCfg = Release|x64 + {772FBE05-D05A-467B-9842-BEC409EEA8D0}.Release|x64.Build.0 = Release|x64 + {772FBE05-D05A-467B-9842-BEC409EEA8D0}.SDL-Debug|Win32.ActiveCfg = Debug|Win32 + {772FBE05-D05A-467B-9842-BEC409EEA8D0}.SDL-Debug|Win32.Build.0 = Debug|Win32 + {772FBE05-D05A-467B-9842-BEC409EEA8D0}.SDL-Debug|x64.ActiveCfg = Debug|x64 + {772FBE05-D05A-467B-9842-BEC409EEA8D0}.SDL-Debug|x64.Build.0 = Debug|x64 + {772FBE05-D05A-467B-9842-BEC409EEA8D0}.Static lib - Debug|Win32.ActiveCfg = Debug|Win32 + {772FBE05-D05A-467B-9842-BEC409EEA8D0}.Static lib - Debug|Win32.Build.0 = Debug|Win32 + {772FBE05-D05A-467B-9842-BEC409EEA8D0}.Static lib - Debug|x64.ActiveCfg = Debug|x64 + {772FBE05-D05A-467B-9842-BEC409EEA8D0}.Static lib - Debug|x64.Build.0 = Debug|x64 + {772FBE05-D05A-467B-9842-BEC409EEA8D0}.Static lib - Release - Fast FPU|Win32.ActiveCfg = Release|Win32 + {772FBE05-D05A-467B-9842-BEC409EEA8D0}.Static lib - Release - Fast FPU|Win32.Build.0 = Release|Win32 + {772FBE05-D05A-467B-9842-BEC409EEA8D0}.Static lib - Release - Fast FPU|x64.ActiveCfg = Release|x64 + {772FBE05-D05A-467B-9842-BEC409EEA8D0}.Static lib - Release - Fast FPU|x64.Build.0 = Release|x64 + {772FBE05-D05A-467B-9842-BEC409EEA8D0}.Static lib - Release|Win32.ActiveCfg = Release|Win32 + {772FBE05-D05A-467B-9842-BEC409EEA8D0}.Static lib - Release|Win32.Build.0 = Release|Win32 + {772FBE05-D05A-467B-9842-BEC409EEA8D0}.Static lib - Release|x64.ActiveCfg = Release|x64 + {772FBE05-D05A-467B-9842-BEC409EEA8D0}.Static lib - Release|x64.Build.0 = Release|x64 + {78C9F424-523C-49AC-94B7-823AA4A26BF9}.Debug|Win32.ActiveCfg = Debug|Win32 + {78C9F424-523C-49AC-94B7-823AA4A26BF9}.Debug|Win32.Build.0 = Debug|Win32 + {78C9F424-523C-49AC-94B7-823AA4A26BF9}.Debug|x64.ActiveCfg = Debug|x64 + {78C9F424-523C-49AC-94B7-823AA4A26BF9}.Debug|x64.Build.0 = Debug|x64 + {78C9F424-523C-49AC-94B7-823AA4A26BF9}.Release - Fast FPU|Win32.ActiveCfg = Release|Win32 + {78C9F424-523C-49AC-94B7-823AA4A26BF9}.Release - Fast FPU|Win32.Build.0 = Release|Win32 + {78C9F424-523C-49AC-94B7-823AA4A26BF9}.Release - Fast FPU|x64.ActiveCfg = Release|x64 + {78C9F424-523C-49AC-94B7-823AA4A26BF9}.Release - Fast FPU|x64.Build.0 = Release|x64 + {78C9F424-523C-49AC-94B7-823AA4A26BF9}.Release|Win32.ActiveCfg = Release|Win32 + {78C9F424-523C-49AC-94B7-823AA4A26BF9}.Release|Win32.Build.0 = Release|Win32 + {78C9F424-523C-49AC-94B7-823AA4A26BF9}.Release|x64.ActiveCfg = Release|x64 + {78C9F424-523C-49AC-94B7-823AA4A26BF9}.Release|x64.Build.0 = Release|x64 + {78C9F424-523C-49AC-94B7-823AA4A26BF9}.SDL-Debug|Win32.ActiveCfg = Debug|Win32 + {78C9F424-523C-49AC-94B7-823AA4A26BF9}.SDL-Debug|Win32.Build.0 = Debug|Win32 + {78C9F424-523C-49AC-94B7-823AA4A26BF9}.SDL-Debug|x64.ActiveCfg = Debug|x64 + {78C9F424-523C-49AC-94B7-823AA4A26BF9}.SDL-Debug|x64.Build.0 = Debug|x64 + {78C9F424-523C-49AC-94B7-823AA4A26BF9}.Static lib - Debug|Win32.ActiveCfg = Debug|Win32 + {78C9F424-523C-49AC-94B7-823AA4A26BF9}.Static lib - Debug|Win32.Build.0 = Debug|Win32 + {78C9F424-523C-49AC-94B7-823AA4A26BF9}.Static lib - Debug|x64.ActiveCfg = Debug|x64 + {78C9F424-523C-49AC-94B7-823AA4A26BF9}.Static lib - Debug|x64.Build.0 = Debug|x64 + {78C9F424-523C-49AC-94B7-823AA4A26BF9}.Static lib - Release - Fast FPU|Win32.ActiveCfg = Release|Win32 + {78C9F424-523C-49AC-94B7-823AA4A26BF9}.Static lib - Release - Fast FPU|Win32.Build.0 = Release|Win32 + {78C9F424-523C-49AC-94B7-823AA4A26BF9}.Static lib - Release - Fast FPU|x64.ActiveCfg = Release|x64 + {78C9F424-523C-49AC-94B7-823AA4A26BF9}.Static lib - Release - Fast FPU|x64.Build.0 = Release|x64 + {78C9F424-523C-49AC-94B7-823AA4A26BF9}.Static lib - Release|Win32.ActiveCfg = Release|Win32 + {78C9F424-523C-49AC-94B7-823AA4A26BF9}.Static lib - Release|Win32.Build.0 = Release|Win32 + {78C9F424-523C-49AC-94B7-823AA4A26BF9}.Static lib - Release|x64.ActiveCfg = Release|x64 + {78C9F424-523C-49AC-94B7-823AA4A26BF9}.Static lib - Release|x64.Build.0 = Release|x64 + {EB3B38EA-5CE7-4983-845B-880661E69D09}.Debug|Win32.ActiveCfg = Debug|Win32 + {EB3B38EA-5CE7-4983-845B-880661E69D09}.Debug|Win32.Build.0 = Debug|Win32 + {EB3B38EA-5CE7-4983-845B-880661E69D09}.Debug|x64.ActiveCfg = Debug|x64 + {EB3B38EA-5CE7-4983-845B-880661E69D09}.Debug|x64.Build.0 = Debug|x64 + {EB3B38EA-5CE7-4983-845B-880661E69D09}.Release - Fast FPU|Win32.ActiveCfg = Release|Win32 + {EB3B38EA-5CE7-4983-845B-880661E69D09}.Release - Fast FPU|Win32.Build.0 = Release|Win32 + {EB3B38EA-5CE7-4983-845B-880661E69D09}.Release - Fast FPU|x64.ActiveCfg = Release|x64 + {EB3B38EA-5CE7-4983-845B-880661E69D09}.Release - Fast FPU|x64.Build.0 = Release|x64 + {EB3B38EA-5CE7-4983-845B-880661E69D09}.Release|Win32.ActiveCfg = Release|Win32 + {EB3B38EA-5CE7-4983-845B-880661E69D09}.Release|Win32.Build.0 = Release|Win32 + {EB3B38EA-5CE7-4983-845B-880661E69D09}.Release|x64.ActiveCfg = Release|x64 + {EB3B38EA-5CE7-4983-845B-880661E69D09}.Release|x64.Build.0 = Release|x64 + {EB3B38EA-5CE7-4983-845B-880661E69D09}.SDL-Debug|Win32.ActiveCfg = Debug|Win32 + {EB3B38EA-5CE7-4983-845B-880661E69D09}.SDL-Debug|Win32.Build.0 = Debug|Win32 + {EB3B38EA-5CE7-4983-845B-880661E69D09}.SDL-Debug|x64.ActiveCfg = Debug|x64 + {EB3B38EA-5CE7-4983-845B-880661E69D09}.SDL-Debug|x64.Build.0 = Debug|x64 + {EB3B38EA-5CE7-4983-845B-880661E69D09}.Static lib - Debug|Win32.ActiveCfg = Debug|Win32 + {EB3B38EA-5CE7-4983-845B-880661E69D09}.Static lib - Debug|Win32.Build.0 = Debug|Win32 + {EB3B38EA-5CE7-4983-845B-880661E69D09}.Static lib - Debug|x64.ActiveCfg = Debug|x64 + {EB3B38EA-5CE7-4983-845B-880661E69D09}.Static lib - Debug|x64.Build.0 = Debug|x64 + {EB3B38EA-5CE7-4983-845B-880661E69D09}.Static lib - Release - Fast FPU|Win32.ActiveCfg = Release|Win32 + {EB3B38EA-5CE7-4983-845B-880661E69D09}.Static lib - Release - Fast FPU|Win32.Build.0 = Release|Win32 + {EB3B38EA-5CE7-4983-845B-880661E69D09}.Static lib - Release - Fast FPU|x64.ActiveCfg = Release|x64 + {EB3B38EA-5CE7-4983-845B-880661E69D09}.Static lib - Release - Fast FPU|x64.Build.0 = Release|x64 + {EB3B38EA-5CE7-4983-845B-880661E69D09}.Static lib - Release|Win32.ActiveCfg = Release|Win32 + {EB3B38EA-5CE7-4983-845B-880661E69D09}.Static lib - Release|Win32.Build.0 = Release|Win32 + {EB3B38EA-5CE7-4983-845B-880661E69D09}.Static lib - Release|x64.ActiveCfg = Release|x64 + {EB3B38EA-5CE7-4983-845B-880661E69D09}.Static lib - Release|x64.Build.0 = Release|x64 + {2A29B6B1-AFC4-46C7-9944-7052AAE66F7B}.Debug|Win32.ActiveCfg = Debug|Win32 + {2A29B6B1-AFC4-46C7-9944-7052AAE66F7B}.Debug|Win32.Build.0 = Debug|Win32 + {2A29B6B1-AFC4-46C7-9944-7052AAE66F7B}.Debug|x64.ActiveCfg = Debug|x64 + {2A29B6B1-AFC4-46C7-9944-7052AAE66F7B}.Debug|x64.Build.0 = Debug|x64 + {2A29B6B1-AFC4-46C7-9944-7052AAE66F7B}.Release - Fast FPU|Win32.ActiveCfg = Release|Win32 + {2A29B6B1-AFC4-46C7-9944-7052AAE66F7B}.Release - Fast FPU|Win32.Build.0 = Release|Win32 + {2A29B6B1-AFC4-46C7-9944-7052AAE66F7B}.Release - Fast FPU|x64.ActiveCfg = Release|x64 + {2A29B6B1-AFC4-46C7-9944-7052AAE66F7B}.Release - Fast FPU|x64.Build.0 = Release|x64 + {2A29B6B1-AFC4-46C7-9944-7052AAE66F7B}.Release|Win32.ActiveCfg = Release|Win32 + {2A29B6B1-AFC4-46C7-9944-7052AAE66F7B}.Release|Win32.Build.0 = Release|Win32 + {2A29B6B1-AFC4-46C7-9944-7052AAE66F7B}.Release|x64.ActiveCfg = Release|x64 + {2A29B6B1-AFC4-46C7-9944-7052AAE66F7B}.Release|x64.Build.0 = Release|x64 + {2A29B6B1-AFC4-46C7-9944-7052AAE66F7B}.SDL-Debug|Win32.ActiveCfg = Debug|Win32 + {2A29B6B1-AFC4-46C7-9944-7052AAE66F7B}.SDL-Debug|Win32.Build.0 = Debug|Win32 + {2A29B6B1-AFC4-46C7-9944-7052AAE66F7B}.SDL-Debug|x64.ActiveCfg = Debug|x64 + {2A29B6B1-AFC4-46C7-9944-7052AAE66F7B}.SDL-Debug|x64.Build.0 = Debug|x64 + {2A29B6B1-AFC4-46C7-9944-7052AAE66F7B}.Static lib - Debug|Win32.ActiveCfg = Debug|Win32 + {2A29B6B1-AFC4-46C7-9944-7052AAE66F7B}.Static lib - Debug|Win32.Build.0 = Debug|Win32 + {2A29B6B1-AFC4-46C7-9944-7052AAE66F7B}.Static lib - Debug|x64.ActiveCfg = Debug|x64 + {2A29B6B1-AFC4-46C7-9944-7052AAE66F7B}.Static lib - Debug|x64.Build.0 = Debug|x64 + {2A29B6B1-AFC4-46C7-9944-7052AAE66F7B}.Static lib - Release - Fast FPU|Win32.ActiveCfg = Release|Win32 + {2A29B6B1-AFC4-46C7-9944-7052AAE66F7B}.Static lib - Release - Fast FPU|Win32.Build.0 = Release|Win32 + {2A29B6B1-AFC4-46C7-9944-7052AAE66F7B}.Static lib - Release - Fast FPU|x64.ActiveCfg = Release|x64 + {2A29B6B1-AFC4-46C7-9944-7052AAE66F7B}.Static lib - Release - Fast FPU|x64.Build.0 = Release|x64 + {2A29B6B1-AFC4-46C7-9944-7052AAE66F7B}.Static lib - Release|Win32.ActiveCfg = Release|Win32 + {2A29B6B1-AFC4-46C7-9944-7052AAE66F7B}.Static lib - Release|Win32.Build.0 = Release|Win32 + {2A29B6B1-AFC4-46C7-9944-7052AAE66F7B}.Static lib - Release|x64.ActiveCfg = Release|x64 + {2A29B6B1-AFC4-46C7-9944-7052AAE66F7B}.Static lib - Release|x64.Build.0 = Release|x64 + {1AB9413E-4F53-42A3-8CB2-CB4BE22336D0}.Debug|Win32.ActiveCfg = Debug|Win32 + {1AB9413E-4F53-42A3-8CB2-CB4BE22336D0}.Debug|Win32.Build.0 = Debug|Win32 + {1AB9413E-4F53-42A3-8CB2-CB4BE22336D0}.Debug|x64.ActiveCfg = Debug|x64 + {1AB9413E-4F53-42A3-8CB2-CB4BE22336D0}.Debug|x64.Build.0 = Debug|x64 + {1AB9413E-4F53-42A3-8CB2-CB4BE22336D0}.Release - Fast FPU|Win32.ActiveCfg = Release|Win32 + {1AB9413E-4F53-42A3-8CB2-CB4BE22336D0}.Release - Fast FPU|Win32.Build.0 = Release|Win32 + {1AB9413E-4F53-42A3-8CB2-CB4BE22336D0}.Release - Fast FPU|x64.ActiveCfg = Release|x64 + {1AB9413E-4F53-42A3-8CB2-CB4BE22336D0}.Release - Fast FPU|x64.Build.0 = Release|x64 + {1AB9413E-4F53-42A3-8CB2-CB4BE22336D0}.Release|Win32.ActiveCfg = Release|Win32 + {1AB9413E-4F53-42A3-8CB2-CB4BE22336D0}.Release|Win32.Build.0 = Release|Win32 + {1AB9413E-4F53-42A3-8CB2-CB4BE22336D0}.Release|x64.ActiveCfg = Release|x64 + {1AB9413E-4F53-42A3-8CB2-CB4BE22336D0}.Release|x64.Build.0 = Release|x64 + {1AB9413E-4F53-42A3-8CB2-CB4BE22336D0}.SDL-Debug|Win32.ActiveCfg = Debug|Win32 + {1AB9413E-4F53-42A3-8CB2-CB4BE22336D0}.SDL-Debug|Win32.Build.0 = Debug|Win32 + {1AB9413E-4F53-42A3-8CB2-CB4BE22336D0}.SDL-Debug|x64.ActiveCfg = Debug|x64 + {1AB9413E-4F53-42A3-8CB2-CB4BE22336D0}.SDL-Debug|x64.Build.0 = Debug|x64 + {1AB9413E-4F53-42A3-8CB2-CB4BE22336D0}.Static lib - Debug|Win32.ActiveCfg = Debug|Win32 + {1AB9413E-4F53-42A3-8CB2-CB4BE22336D0}.Static lib - Debug|Win32.Build.0 = Debug|Win32 + {1AB9413E-4F53-42A3-8CB2-CB4BE22336D0}.Static lib - Debug|x64.ActiveCfg = Debug|x64 + {1AB9413E-4F53-42A3-8CB2-CB4BE22336D0}.Static lib - Debug|x64.Build.0 = Debug|x64 + {1AB9413E-4F53-42A3-8CB2-CB4BE22336D0}.Static lib - Release - Fast FPU|Win32.ActiveCfg = Release|Win32 + {1AB9413E-4F53-42A3-8CB2-CB4BE22336D0}.Static lib - Release - Fast FPU|Win32.Build.0 = Release|Win32 + {1AB9413E-4F53-42A3-8CB2-CB4BE22336D0}.Static lib - Release - Fast FPU|x64.ActiveCfg = Release|x64 + {1AB9413E-4F53-42A3-8CB2-CB4BE22336D0}.Static lib - Release - Fast FPU|x64.Build.0 = Release|x64 + {1AB9413E-4F53-42A3-8CB2-CB4BE22336D0}.Static lib - Release|Win32.ActiveCfg = Release|Win32 + {1AB9413E-4F53-42A3-8CB2-CB4BE22336D0}.Static lib - Release|Win32.Build.0 = Release|Win32 + {1AB9413E-4F53-42A3-8CB2-CB4BE22336D0}.Static lib - Release|x64.ActiveCfg = Release|x64 + {1AB9413E-4F53-42A3-8CB2-CB4BE22336D0}.Static lib - Release|x64.Build.0 = Release|x64 + {FE853A36-E0D1-4AC5-A792-B643E70D2953}.Debug|Win32.ActiveCfg = Debug|Win32 + {FE853A36-E0D1-4AC5-A792-B643E70D2953}.Debug|Win32.Build.0 = Debug|Win32 + {FE853A36-E0D1-4AC5-A792-B643E70D2953}.Debug|x64.ActiveCfg = Debug|x64 + {FE853A36-E0D1-4AC5-A792-B643E70D2953}.Debug|x64.Build.0 = Debug|x64 + {FE853A36-E0D1-4AC5-A792-B643E70D2953}.Release - Fast FPU|Win32.ActiveCfg = Release|Win32 + {FE853A36-E0D1-4AC5-A792-B643E70D2953}.Release - Fast FPU|Win32.Build.0 = Release|Win32 + {FE853A36-E0D1-4AC5-A792-B643E70D2953}.Release - Fast FPU|x64.ActiveCfg = Release|x64 + {FE853A36-E0D1-4AC5-A792-B643E70D2953}.Release - Fast FPU|x64.Build.0 = Release|x64 + {FE853A36-E0D1-4AC5-A792-B643E70D2953}.Release|Win32.ActiveCfg = Release|Win32 + {FE853A36-E0D1-4AC5-A792-B643E70D2953}.Release|Win32.Build.0 = Release|Win32 + {FE853A36-E0D1-4AC5-A792-B643E70D2953}.Release|x64.ActiveCfg = Release|x64 + {FE853A36-E0D1-4AC5-A792-B643E70D2953}.Release|x64.Build.0 = Release|x64 + {FE853A36-E0D1-4AC5-A792-B643E70D2953}.SDL-Debug|Win32.ActiveCfg = Debug|Win32 + {FE853A36-E0D1-4AC5-A792-B643E70D2953}.SDL-Debug|Win32.Build.0 = Debug|Win32 + {FE853A36-E0D1-4AC5-A792-B643E70D2953}.SDL-Debug|x64.ActiveCfg = Debug|x64 + {FE853A36-E0D1-4AC5-A792-B643E70D2953}.SDL-Debug|x64.Build.0 = Debug|x64 + {FE853A36-E0D1-4AC5-A792-B643E70D2953}.Static lib - Debug|Win32.ActiveCfg = Debug|Win32 + {FE853A36-E0D1-4AC5-A792-B643E70D2953}.Static lib - Debug|Win32.Build.0 = Debug|Win32 + {FE853A36-E0D1-4AC5-A792-B643E70D2953}.Static lib - Debug|x64.ActiveCfg = Debug|x64 + {FE853A36-E0D1-4AC5-A792-B643E70D2953}.Static lib - Debug|x64.Build.0 = Debug|x64 + {FE853A36-E0D1-4AC5-A792-B643E70D2953}.Static lib - Release - Fast FPU|Win32.ActiveCfg = Release|Win32 + {FE853A36-E0D1-4AC5-A792-B643E70D2953}.Static lib - Release - Fast FPU|Win32.Build.0 = Release|Win32 + {FE853A36-E0D1-4AC5-A792-B643E70D2953}.Static lib - Release - Fast FPU|x64.ActiveCfg = Release|x64 + {FE853A36-E0D1-4AC5-A792-B643E70D2953}.Static lib - Release - Fast FPU|x64.Build.0 = Release|x64 + {FE853A36-E0D1-4AC5-A792-B643E70D2953}.Static lib - Release|Win32.ActiveCfg = Release|Win32 + {FE853A36-E0D1-4AC5-A792-B643E70D2953}.Static lib - Release|Win32.Build.0 = Release|Win32 + {FE853A36-E0D1-4AC5-A792-B643E70D2953}.Static lib - Release|x64.ActiveCfg = Release|x64 + {FE853A36-E0D1-4AC5-A792-B643E70D2953}.Static lib - Release|x64.Build.0 = Release|x64 + {16007FE2-142B-47F8-93E1-519BA3F39E71}.Debug|Win32.ActiveCfg = Debug|Win32 + {16007FE2-142B-47F8-93E1-519BA3F39E71}.Debug|Win32.Build.0 = Debug|Win32 + {16007FE2-142B-47F8-93E1-519BA3F39E71}.Debug|x64.ActiveCfg = Debug|x64 + {16007FE2-142B-47F8-93E1-519BA3F39E71}.Debug|x64.Build.0 = Debug|x64 + {16007FE2-142B-47F8-93E1-519BA3F39E71}.Release - Fast FPU|Win32.ActiveCfg = Release|Win32 + {16007FE2-142B-47F8-93E1-519BA3F39E71}.Release - Fast FPU|Win32.Build.0 = Release|Win32 + {16007FE2-142B-47F8-93E1-519BA3F39E71}.Release - Fast FPU|x64.ActiveCfg = Release|x64 + {16007FE2-142B-47F8-93E1-519BA3F39E71}.Release - Fast FPU|x64.Build.0 = Release|x64 + {16007FE2-142B-47F8-93E1-519BA3F39E71}.Release|Win32.ActiveCfg = Release|Win32 + {16007FE2-142B-47F8-93E1-519BA3F39E71}.Release|Win32.Build.0 = Release|Win32 + {16007FE2-142B-47F8-93E1-519BA3F39E71}.Release|x64.ActiveCfg = Release|x64 + {16007FE2-142B-47F8-93E1-519BA3F39E71}.Release|x64.Build.0 = Release|x64 + {16007FE2-142B-47F8-93E1-519BA3F39E71}.SDL-Debug|Win32.ActiveCfg = Debug|Win32 + {16007FE2-142B-47F8-93E1-519BA3F39E71}.SDL-Debug|Win32.Build.0 = Debug|Win32 + {16007FE2-142B-47F8-93E1-519BA3F39E71}.SDL-Debug|x64.ActiveCfg = Debug|x64 + {16007FE2-142B-47F8-93E1-519BA3F39E71}.SDL-Debug|x64.Build.0 = Debug|x64 + {16007FE2-142B-47F8-93E1-519BA3F39E71}.Static lib - Debug|Win32.ActiveCfg = Debug|Win32 + {16007FE2-142B-47F8-93E1-519BA3F39E71}.Static lib - Debug|Win32.Build.0 = Debug|Win32 + {16007FE2-142B-47F8-93E1-519BA3F39E71}.Static lib - Debug|x64.ActiveCfg = Debug|x64 + {16007FE2-142B-47F8-93E1-519BA3F39E71}.Static lib - Debug|x64.Build.0 = Debug|x64 + {16007FE2-142B-47F8-93E1-519BA3F39E71}.Static lib - Release - Fast FPU|Win32.ActiveCfg = Release|Win32 + {16007FE2-142B-47F8-93E1-519BA3F39E71}.Static lib - Release - Fast FPU|Win32.Build.0 = Release|Win32 + {16007FE2-142B-47F8-93E1-519BA3F39E71}.Static lib - Release - Fast FPU|x64.ActiveCfg = Release|x64 + {16007FE2-142B-47F8-93E1-519BA3F39E71}.Static lib - Release - Fast FPU|x64.Build.0 = Release|x64 + {16007FE2-142B-47F8-93E1-519BA3F39E71}.Static lib - Release|Win32.ActiveCfg = Release|Win32 + {16007FE2-142B-47F8-93E1-519BA3F39E71}.Static lib - Release|Win32.Build.0 = Release|Win32 + {16007FE2-142B-47F8-93E1-519BA3F39E71}.Static lib - Release|x64.ActiveCfg = Release|x64 + {16007FE2-142B-47F8-93E1-519BA3F39E71}.Static lib - Release|x64.Build.0 = Release|x64 + {CDC4AAA9-72E1-4FFA-A04D-7EF59D8B97CD}.Debug|Win32.ActiveCfg = Debug|Win32 + {CDC4AAA9-72E1-4FFA-A04D-7EF59D8B97CD}.Debug|Win32.Build.0 = Debug|Win32 + {CDC4AAA9-72E1-4FFA-A04D-7EF59D8B97CD}.Debug|x64.ActiveCfg = Debug|x64 + {CDC4AAA9-72E1-4FFA-A04D-7EF59D8B97CD}.Debug|x64.Build.0 = Debug|x64 + {CDC4AAA9-72E1-4FFA-A04D-7EF59D8B97CD}.Release - Fast FPU|Win32.ActiveCfg = Release|Win32 + {CDC4AAA9-72E1-4FFA-A04D-7EF59D8B97CD}.Release - Fast FPU|Win32.Build.0 = Release|Win32 + {CDC4AAA9-72E1-4FFA-A04D-7EF59D8B97CD}.Release - Fast FPU|x64.ActiveCfg = Release|x64 + {CDC4AAA9-72E1-4FFA-A04D-7EF59D8B97CD}.Release - Fast FPU|x64.Build.0 = Release|x64 + {CDC4AAA9-72E1-4FFA-A04D-7EF59D8B97CD}.Release|Win32.ActiveCfg = Release|Win32 + {CDC4AAA9-72E1-4FFA-A04D-7EF59D8B97CD}.Release|Win32.Build.0 = Release|Win32 + {CDC4AAA9-72E1-4FFA-A04D-7EF59D8B97CD}.Release|x64.ActiveCfg = Release|x64 + {CDC4AAA9-72E1-4FFA-A04D-7EF59D8B97CD}.Release|x64.Build.0 = Release|x64 + {CDC4AAA9-72E1-4FFA-A04D-7EF59D8B97CD}.SDL-Debug|Win32.ActiveCfg = Debug|Win32 + {CDC4AAA9-72E1-4FFA-A04D-7EF59D8B97CD}.SDL-Debug|Win32.Build.0 = Debug|Win32 + {CDC4AAA9-72E1-4FFA-A04D-7EF59D8B97CD}.SDL-Debug|x64.ActiveCfg = Debug|x64 + {CDC4AAA9-72E1-4FFA-A04D-7EF59D8B97CD}.SDL-Debug|x64.Build.0 = Debug|x64 + {CDC4AAA9-72E1-4FFA-A04D-7EF59D8B97CD}.Static lib - Debug|Win32.ActiveCfg = Debug|Win32 + {CDC4AAA9-72E1-4FFA-A04D-7EF59D8B97CD}.Static lib - Debug|Win32.Build.0 = Debug|Win32 + {CDC4AAA9-72E1-4FFA-A04D-7EF59D8B97CD}.Static lib - Debug|x64.ActiveCfg = Debug|x64 + {CDC4AAA9-72E1-4FFA-A04D-7EF59D8B97CD}.Static lib - Debug|x64.Build.0 = Debug|x64 + {CDC4AAA9-72E1-4FFA-A04D-7EF59D8B97CD}.Static lib - Release - Fast FPU|Win32.ActiveCfg = Release|Win32 + {CDC4AAA9-72E1-4FFA-A04D-7EF59D8B97CD}.Static lib - Release - Fast FPU|Win32.Build.0 = Release|Win32 + {CDC4AAA9-72E1-4FFA-A04D-7EF59D8B97CD}.Static lib - Release - Fast FPU|x64.ActiveCfg = Release|x64 + {CDC4AAA9-72E1-4FFA-A04D-7EF59D8B97CD}.Static lib - Release - Fast FPU|x64.Build.0 = Release|x64 + {CDC4AAA9-72E1-4FFA-A04D-7EF59D8B97CD}.Static lib - Release|Win32.ActiveCfg = Release|Win32 + {CDC4AAA9-72E1-4FFA-A04D-7EF59D8B97CD}.Static lib - Release|Win32.Build.0 = Release|Win32 + {CDC4AAA9-72E1-4FFA-A04D-7EF59D8B97CD}.Static lib - Release|x64.ActiveCfg = Release|x64 + {CDC4AAA9-72E1-4FFA-A04D-7EF59D8B97CD}.Static lib - Release|x64.Build.0 = Release|x64 + {4E6C2F8D-BA92-4C5B-96FD-72D4FE8BD7FA}.Debug|Win32.ActiveCfg = Debug|Win32 + {4E6C2F8D-BA92-4C5B-96FD-72D4FE8BD7FA}.Debug|Win32.Build.0 = Debug|Win32 + {4E6C2F8D-BA92-4C5B-96FD-72D4FE8BD7FA}.Debug|x64.ActiveCfg = Debug|x64 + {4E6C2F8D-BA92-4C5B-96FD-72D4FE8BD7FA}.Debug|x64.Build.0 = Debug|x64 + {4E6C2F8D-BA92-4C5B-96FD-72D4FE8BD7FA}.Release - Fast FPU|Win32.ActiveCfg = Release|Win32 + {4E6C2F8D-BA92-4C5B-96FD-72D4FE8BD7FA}.Release - Fast FPU|Win32.Build.0 = Release|Win32 + {4E6C2F8D-BA92-4C5B-96FD-72D4FE8BD7FA}.Release - Fast FPU|x64.ActiveCfg = Release|x64 + {4E6C2F8D-BA92-4C5B-96FD-72D4FE8BD7FA}.Release - Fast FPU|x64.Build.0 = Release|x64 + {4E6C2F8D-BA92-4C5B-96FD-72D4FE8BD7FA}.Release|Win32.ActiveCfg = Release|Win32 + {4E6C2F8D-BA92-4C5B-96FD-72D4FE8BD7FA}.Release|Win32.Build.0 = Release|Win32 + {4E6C2F8D-BA92-4C5B-96FD-72D4FE8BD7FA}.Release|x64.ActiveCfg = Release|x64 + {4E6C2F8D-BA92-4C5B-96FD-72D4FE8BD7FA}.Release|x64.Build.0 = Release|x64 + {4E6C2F8D-BA92-4C5B-96FD-72D4FE8BD7FA}.SDL-Debug|Win32.ActiveCfg = Debug|Win32 + {4E6C2F8D-BA92-4C5B-96FD-72D4FE8BD7FA}.SDL-Debug|Win32.Build.0 = Debug|Win32 + {4E6C2F8D-BA92-4C5B-96FD-72D4FE8BD7FA}.SDL-Debug|x64.ActiveCfg = Debug|x64 + {4E6C2F8D-BA92-4C5B-96FD-72D4FE8BD7FA}.SDL-Debug|x64.Build.0 = Debug|x64 + {4E6C2F8D-BA92-4C5B-96FD-72D4FE8BD7FA}.Static lib - Debug|Win32.ActiveCfg = Debug|Win32 + {4E6C2F8D-BA92-4C5B-96FD-72D4FE8BD7FA}.Static lib - Debug|Win32.Build.0 = Debug|Win32 + {4E6C2F8D-BA92-4C5B-96FD-72D4FE8BD7FA}.Static lib - Debug|x64.ActiveCfg = Debug|x64 + {4E6C2F8D-BA92-4C5B-96FD-72D4FE8BD7FA}.Static lib - Debug|x64.Build.0 = Debug|x64 + {4E6C2F8D-BA92-4C5B-96FD-72D4FE8BD7FA}.Static lib - Release - Fast FPU|Win32.ActiveCfg = Release|Win32 + {4E6C2F8D-BA92-4C5B-96FD-72D4FE8BD7FA}.Static lib - Release - Fast FPU|Win32.Build.0 = Release|Win32 + {4E6C2F8D-BA92-4C5B-96FD-72D4FE8BD7FA}.Static lib - Release - Fast FPU|x64.ActiveCfg = Release|x64 + {4E6C2F8D-BA92-4C5B-96FD-72D4FE8BD7FA}.Static lib - Release - Fast FPU|x64.Build.0 = Release|x64 + {4E6C2F8D-BA92-4C5B-96FD-72D4FE8BD7FA}.Static lib - Release|Win32.ActiveCfg = Release|Win32 + {4E6C2F8D-BA92-4C5B-96FD-72D4FE8BD7FA}.Static lib - Release|Win32.Build.0 = Release|Win32 + {4E6C2F8D-BA92-4C5B-96FD-72D4FE8BD7FA}.Static lib - Release|x64.ActiveCfg = Release|x64 + {4E6C2F8D-BA92-4C5B-96FD-72D4FE8BD7FA}.Static lib - Release|x64.Build.0 = Release|x64 + {6AEC2AA2-C9FF-4B7D-B07A-94A9D34B41D7}.Debug|Win32.ActiveCfg = Debug|Win32 + {6AEC2AA2-C9FF-4B7D-B07A-94A9D34B41D7}.Debug|Win32.Build.0 = Debug|Win32 + {6AEC2AA2-C9FF-4B7D-B07A-94A9D34B41D7}.Debug|x64.ActiveCfg = Debug|x64 + {6AEC2AA2-C9FF-4B7D-B07A-94A9D34B41D7}.Debug|x64.Build.0 = Debug|x64 + {6AEC2AA2-C9FF-4B7D-B07A-94A9D34B41D7}.Release - Fast FPU|Win32.ActiveCfg = Release|Win32 + {6AEC2AA2-C9FF-4B7D-B07A-94A9D34B41D7}.Release - Fast FPU|Win32.Build.0 = Release|Win32 + {6AEC2AA2-C9FF-4B7D-B07A-94A9D34B41D7}.Release - Fast FPU|x64.ActiveCfg = Release|x64 + {6AEC2AA2-C9FF-4B7D-B07A-94A9D34B41D7}.Release - Fast FPU|x64.Build.0 = Release|x64 + {6AEC2AA2-C9FF-4B7D-B07A-94A9D34B41D7}.Release|Win32.ActiveCfg = Release|Win32 + {6AEC2AA2-C9FF-4B7D-B07A-94A9D34B41D7}.Release|Win32.Build.0 = Release|Win32 + {6AEC2AA2-C9FF-4B7D-B07A-94A9D34B41D7}.Release|x64.ActiveCfg = Release|x64 + {6AEC2AA2-C9FF-4B7D-B07A-94A9D34B41D7}.Release|x64.Build.0 = Release|x64 + {6AEC2AA2-C9FF-4B7D-B07A-94A9D34B41D7}.SDL-Debug|Win32.ActiveCfg = Debug|Win32 + {6AEC2AA2-C9FF-4B7D-B07A-94A9D34B41D7}.SDL-Debug|Win32.Build.0 = Debug|Win32 + {6AEC2AA2-C9FF-4B7D-B07A-94A9D34B41D7}.SDL-Debug|x64.ActiveCfg = Debug|x64 + {6AEC2AA2-C9FF-4B7D-B07A-94A9D34B41D7}.SDL-Debug|x64.Build.0 = Debug|x64 + {6AEC2AA2-C9FF-4B7D-B07A-94A9D34B41D7}.Static lib - Debug|Win32.ActiveCfg = Debug|Win32 + {6AEC2AA2-C9FF-4B7D-B07A-94A9D34B41D7}.Static lib - Debug|Win32.Build.0 = Debug|Win32 + {6AEC2AA2-C9FF-4B7D-B07A-94A9D34B41D7}.Static lib - Debug|x64.ActiveCfg = Debug|x64 + {6AEC2AA2-C9FF-4B7D-B07A-94A9D34B41D7}.Static lib - Debug|x64.Build.0 = Debug|x64 + {6AEC2AA2-C9FF-4B7D-B07A-94A9D34B41D7}.Static lib - Release - Fast FPU|Win32.ActiveCfg = Release|Win32 + {6AEC2AA2-C9FF-4B7D-B07A-94A9D34B41D7}.Static lib - Release - Fast FPU|Win32.Build.0 = Release|Win32 + {6AEC2AA2-C9FF-4B7D-B07A-94A9D34B41D7}.Static lib - Release - Fast FPU|x64.ActiveCfg = Release|x64 + {6AEC2AA2-C9FF-4B7D-B07A-94A9D34B41D7}.Static lib - Release - Fast FPU|x64.Build.0 = Release|x64 + {6AEC2AA2-C9FF-4B7D-B07A-94A9D34B41D7}.Static lib - Release|Win32.ActiveCfg = Release|Win32 + {6AEC2AA2-C9FF-4B7D-B07A-94A9D34B41D7}.Static lib - Release|Win32.Build.0 = Release|Win32 + {6AEC2AA2-C9FF-4B7D-B07A-94A9D34B41D7}.Static lib - Release|x64.ActiveCfg = Release|x64 + {6AEC2AA2-C9FF-4B7D-B07A-94A9D34B41D7}.Static lib - Release|x64.Build.0 = Release|x64 + {02B67A37-50E1-49DB-BECF-905BC029C2FE}.Debug|Win32.ActiveCfg = Debug|Win32 + {02B67A37-50E1-49DB-BECF-905BC029C2FE}.Debug|Win32.Build.0 = Debug|Win32 + {02B67A37-50E1-49DB-BECF-905BC029C2FE}.Debug|x64.ActiveCfg = Debug|x64 + {02B67A37-50E1-49DB-BECF-905BC029C2FE}.Debug|x64.Build.0 = Debug|x64 + {02B67A37-50E1-49DB-BECF-905BC029C2FE}.Release - Fast FPU|Win32.ActiveCfg = Release|Win32 + {02B67A37-50E1-49DB-BECF-905BC029C2FE}.Release - Fast FPU|Win32.Build.0 = Release|Win32 + {02B67A37-50E1-49DB-BECF-905BC029C2FE}.Release - Fast FPU|x64.ActiveCfg = Release|x64 + {02B67A37-50E1-49DB-BECF-905BC029C2FE}.Release - Fast FPU|x64.Build.0 = Release|x64 + {02B67A37-50E1-49DB-BECF-905BC029C2FE}.Release|Win32.ActiveCfg = Release|Win32 + {02B67A37-50E1-49DB-BECF-905BC029C2FE}.Release|Win32.Build.0 = Release|Win32 + {02B67A37-50E1-49DB-BECF-905BC029C2FE}.Release|x64.ActiveCfg = Release|x64 + {02B67A37-50E1-49DB-BECF-905BC029C2FE}.Release|x64.Build.0 = Release|x64 + {02B67A37-50E1-49DB-BECF-905BC029C2FE}.SDL-Debug|Win32.ActiveCfg = Debug|Win32 + {02B67A37-50E1-49DB-BECF-905BC029C2FE}.SDL-Debug|Win32.Build.0 = Debug|Win32 + {02B67A37-50E1-49DB-BECF-905BC029C2FE}.SDL-Debug|x64.ActiveCfg = Debug|x64 + {02B67A37-50E1-49DB-BECF-905BC029C2FE}.SDL-Debug|x64.Build.0 = Debug|x64 + {02B67A37-50E1-49DB-BECF-905BC029C2FE}.Static lib - Debug|Win32.ActiveCfg = Debug|Win32 + {02B67A37-50E1-49DB-BECF-905BC029C2FE}.Static lib - Debug|Win32.Build.0 = Debug|Win32 + {02B67A37-50E1-49DB-BECF-905BC029C2FE}.Static lib - Debug|x64.ActiveCfg = Debug|x64 + {02B67A37-50E1-49DB-BECF-905BC029C2FE}.Static lib - Debug|x64.Build.0 = Debug|x64 + {02B67A37-50E1-49DB-BECF-905BC029C2FE}.Static lib - Release - Fast FPU|Win32.ActiveCfg = Release|Win32 + {02B67A37-50E1-49DB-BECF-905BC029C2FE}.Static lib - Release - Fast FPU|Win32.Build.0 = Release|Win32 + {02B67A37-50E1-49DB-BECF-905BC029C2FE}.Static lib - Release - Fast FPU|x64.ActiveCfg = Release|x64 + {02B67A37-50E1-49DB-BECF-905BC029C2FE}.Static lib - Release - Fast FPU|x64.Build.0 = Release|x64 + {02B67A37-50E1-49DB-BECF-905BC029C2FE}.Static lib - Release|Win32.ActiveCfg = Release|Win32 + {02B67A37-50E1-49DB-BECF-905BC029C2FE}.Static lib - Release|Win32.Build.0 = Release|Win32 + {02B67A37-50E1-49DB-BECF-905BC029C2FE}.Static lib - Release|x64.ActiveCfg = Release|x64 + {02B67A37-50E1-49DB-BECF-905BC029C2FE}.Static lib - Release|x64.Build.0 = Release|x64 + {8FDA260E-EF27-4F8C-8720-7AF707DD0D9E}.Debug|Win32.ActiveCfg = Debug|Win32 + {8FDA260E-EF27-4F8C-8720-7AF707DD0D9E}.Debug|Win32.Build.0 = Debug|Win32 + {8FDA260E-EF27-4F8C-8720-7AF707DD0D9E}.Debug|x64.ActiveCfg = Debug|x64 + {8FDA260E-EF27-4F8C-8720-7AF707DD0D9E}.Debug|x64.Build.0 = Debug|x64 + {8FDA260E-EF27-4F8C-8720-7AF707DD0D9E}.Release - Fast FPU|Win32.ActiveCfg = Release|Win32 + {8FDA260E-EF27-4F8C-8720-7AF707DD0D9E}.Release - Fast FPU|Win32.Build.0 = Release|Win32 + {8FDA260E-EF27-4F8C-8720-7AF707DD0D9E}.Release - Fast FPU|x64.ActiveCfg = Release|x64 + {8FDA260E-EF27-4F8C-8720-7AF707DD0D9E}.Release - Fast FPU|x64.Build.0 = Release|x64 + {8FDA260E-EF27-4F8C-8720-7AF707DD0D9E}.Release|Win32.ActiveCfg = Release|Win32 + {8FDA260E-EF27-4F8C-8720-7AF707DD0D9E}.Release|Win32.Build.0 = Release|Win32 + {8FDA260E-EF27-4F8C-8720-7AF707DD0D9E}.Release|x64.ActiveCfg = Release|x64 + {8FDA260E-EF27-4F8C-8720-7AF707DD0D9E}.Release|x64.Build.0 = Release|x64 + {8FDA260E-EF27-4F8C-8720-7AF707DD0D9E}.SDL-Debug|Win32.ActiveCfg = Debug|Win32 + {8FDA260E-EF27-4F8C-8720-7AF707DD0D9E}.SDL-Debug|Win32.Build.0 = Debug|Win32 + {8FDA260E-EF27-4F8C-8720-7AF707DD0D9E}.SDL-Debug|x64.ActiveCfg = Debug|x64 + {8FDA260E-EF27-4F8C-8720-7AF707DD0D9E}.SDL-Debug|x64.Build.0 = Debug|x64 + {8FDA260E-EF27-4F8C-8720-7AF707DD0D9E}.Static lib - Debug|Win32.ActiveCfg = Debug|Win32 + {8FDA260E-EF27-4F8C-8720-7AF707DD0D9E}.Static lib - Debug|Win32.Build.0 = Debug|Win32 + {8FDA260E-EF27-4F8C-8720-7AF707DD0D9E}.Static lib - Debug|x64.ActiveCfg = Debug|x64 + {8FDA260E-EF27-4F8C-8720-7AF707DD0D9E}.Static lib - Debug|x64.Build.0 = Debug|x64 + {8FDA260E-EF27-4F8C-8720-7AF707DD0D9E}.Static lib - Release - Fast FPU|Win32.ActiveCfg = Release|Win32 + {8FDA260E-EF27-4F8C-8720-7AF707DD0D9E}.Static lib - Release - Fast FPU|Win32.Build.0 = Release|Win32 + {8FDA260E-EF27-4F8C-8720-7AF707DD0D9E}.Static lib - Release - Fast FPU|x64.ActiveCfg = Release|x64 + {8FDA260E-EF27-4F8C-8720-7AF707DD0D9E}.Static lib - Release - Fast FPU|x64.Build.0 = Release|x64 + {8FDA260E-EF27-4F8C-8720-7AF707DD0D9E}.Static lib - Release|Win32.ActiveCfg = Release|Win32 + {8FDA260E-EF27-4F8C-8720-7AF707DD0D9E}.Static lib - Release|Win32.Build.0 = Release|Win32 + {8FDA260E-EF27-4F8C-8720-7AF707DD0D9E}.Static lib - Release|x64.ActiveCfg = Release|x64 + {8FDA260E-EF27-4F8C-8720-7AF707DD0D9E}.Static lib - Release|x64.Build.0 = Release|x64 + {5CE0E2E7-879D-4152-B61D-24E7D0707B45}.Debug|Win32.ActiveCfg = Debug|Win32 + {5CE0E2E7-879D-4152-B61D-24E7D0707B45}.Debug|Win32.Build.0 = Debug|Win32 + {5CE0E2E7-879D-4152-B61D-24E7D0707B45}.Debug|x64.ActiveCfg = Debug|x64 + {5CE0E2E7-879D-4152-B61D-24E7D0707B45}.Debug|x64.Build.0 = Debug|x64 + {5CE0E2E7-879D-4152-B61D-24E7D0707B45}.Release - Fast FPU|Win32.ActiveCfg = Release|Win32 + {5CE0E2E7-879D-4152-B61D-24E7D0707B45}.Release - Fast FPU|Win32.Build.0 = Release|Win32 + {5CE0E2E7-879D-4152-B61D-24E7D0707B45}.Release - Fast FPU|x64.ActiveCfg = Release|x64 + {5CE0E2E7-879D-4152-B61D-24E7D0707B45}.Release - Fast FPU|x64.Build.0 = Release|x64 + {5CE0E2E7-879D-4152-B61D-24E7D0707B45}.Release|Win32.ActiveCfg = Release|Win32 + {5CE0E2E7-879D-4152-B61D-24E7D0707B45}.Release|Win32.Build.0 = Release|Win32 + {5CE0E2E7-879D-4152-B61D-24E7D0707B45}.Release|x64.ActiveCfg = Release|x64 + {5CE0E2E7-879D-4152-B61D-24E7D0707B45}.Release|x64.Build.0 = Release|x64 + {5CE0E2E7-879D-4152-B61D-24E7D0707B45}.SDL-Debug|Win32.ActiveCfg = Debug|Win32 + {5CE0E2E7-879D-4152-B61D-24E7D0707B45}.SDL-Debug|Win32.Build.0 = Debug|Win32 + {5CE0E2E7-879D-4152-B61D-24E7D0707B45}.SDL-Debug|x64.ActiveCfg = Debug|x64 + {5CE0E2E7-879D-4152-B61D-24E7D0707B45}.SDL-Debug|x64.Build.0 = Debug|x64 + {5CE0E2E7-879D-4152-B61D-24E7D0707B45}.Static lib - Debug|Win32.ActiveCfg = Debug|Win32 + {5CE0E2E7-879D-4152-B61D-24E7D0707B45}.Static lib - Debug|Win32.Build.0 = Debug|Win32 + {5CE0E2E7-879D-4152-B61D-24E7D0707B45}.Static lib - Debug|x64.ActiveCfg = Debug|x64 + {5CE0E2E7-879D-4152-B61D-24E7D0707B45}.Static lib - Debug|x64.Build.0 = Debug|x64 + {5CE0E2E7-879D-4152-B61D-24E7D0707B45}.Static lib - Release - Fast FPU|Win32.ActiveCfg = Release|Win32 + {5CE0E2E7-879D-4152-B61D-24E7D0707B45}.Static lib - Release - Fast FPU|Win32.Build.0 = Release|Win32 + {5CE0E2E7-879D-4152-B61D-24E7D0707B45}.Static lib - Release - Fast FPU|x64.ActiveCfg = Release|x64 + {5CE0E2E7-879D-4152-B61D-24E7D0707B45}.Static lib - Release - Fast FPU|x64.Build.0 = Release|x64 + {5CE0E2E7-879D-4152-B61D-24E7D0707B45}.Static lib - Release|Win32.ActiveCfg = Release|Win32 + {5CE0E2E7-879D-4152-B61D-24E7D0707B45}.Static lib - Release|Win32.Build.0 = Release|Win32 + {5CE0E2E7-879D-4152-B61D-24E7D0707B45}.Static lib - Release|x64.ActiveCfg = Release|x64 + {5CE0E2E7-879D-4152-B61D-24E7D0707B45}.Static lib - Release|x64.Build.0 = Release|x64 + {65D9DE2E-B73E-4ADF-96D1-BF4A8B7F4F97}.Debug|Win32.ActiveCfg = Debug|Win32 + {65D9DE2E-B73E-4ADF-96D1-BF4A8B7F4F97}.Debug|Win32.Build.0 = Debug|Win32 + {65D9DE2E-B73E-4ADF-96D1-BF4A8B7F4F97}.Debug|x64.ActiveCfg = Debug|x64 + {65D9DE2E-B73E-4ADF-96D1-BF4A8B7F4F97}.Debug|x64.Build.0 = Debug|x64 + {65D9DE2E-B73E-4ADF-96D1-BF4A8B7F4F97}.Release - Fast FPU|Win32.ActiveCfg = Release|Win32 + {65D9DE2E-B73E-4ADF-96D1-BF4A8B7F4F97}.Release - Fast FPU|Win32.Build.0 = Release|Win32 + {65D9DE2E-B73E-4ADF-96D1-BF4A8B7F4F97}.Release - Fast FPU|x64.ActiveCfg = Release|x64 + {65D9DE2E-B73E-4ADF-96D1-BF4A8B7F4F97}.Release - Fast FPU|x64.Build.0 = Release|x64 + {65D9DE2E-B73E-4ADF-96D1-BF4A8B7F4F97}.Release|Win32.ActiveCfg = Release|Win32 + {65D9DE2E-B73E-4ADF-96D1-BF4A8B7F4F97}.Release|Win32.Build.0 = Release|Win32 + {65D9DE2E-B73E-4ADF-96D1-BF4A8B7F4F97}.Release|x64.ActiveCfg = Release|x64 + {65D9DE2E-B73E-4ADF-96D1-BF4A8B7F4F97}.Release|x64.Build.0 = Release|x64 + {65D9DE2E-B73E-4ADF-96D1-BF4A8B7F4F97}.SDL-Debug|Win32.ActiveCfg = Debug|Win32 + {65D9DE2E-B73E-4ADF-96D1-BF4A8B7F4F97}.SDL-Debug|Win32.Build.0 = Debug|Win32 + {65D9DE2E-B73E-4ADF-96D1-BF4A8B7F4F97}.SDL-Debug|x64.ActiveCfg = Debug|x64 + {65D9DE2E-B73E-4ADF-96D1-BF4A8B7F4F97}.SDL-Debug|x64.Build.0 = Debug|x64 + {65D9DE2E-B73E-4ADF-96D1-BF4A8B7F4F97}.Static lib - Debug|Win32.ActiveCfg = Debug|Win32 + {65D9DE2E-B73E-4ADF-96D1-BF4A8B7F4F97}.Static lib - Debug|Win32.Build.0 = Debug|Win32 + {65D9DE2E-B73E-4ADF-96D1-BF4A8B7F4F97}.Static lib - Debug|x64.ActiveCfg = Debug|x64 + {65D9DE2E-B73E-4ADF-96D1-BF4A8B7F4F97}.Static lib - Debug|x64.Build.0 = Debug|x64 + {65D9DE2E-B73E-4ADF-96D1-BF4A8B7F4F97}.Static lib - Release - Fast FPU|Win32.ActiveCfg = Release|Win32 + {65D9DE2E-B73E-4ADF-96D1-BF4A8B7F4F97}.Static lib - Release - Fast FPU|Win32.Build.0 = Release|Win32 + {65D9DE2E-B73E-4ADF-96D1-BF4A8B7F4F97}.Static lib - Release - Fast FPU|x64.ActiveCfg = Release|x64 + {65D9DE2E-B73E-4ADF-96D1-BF4A8B7F4F97}.Static lib - Release - Fast FPU|x64.Build.0 = Release|x64 + {65D9DE2E-B73E-4ADF-96D1-BF4A8B7F4F97}.Static lib - Release|Win32.ActiveCfg = Release|Win32 + {65D9DE2E-B73E-4ADF-96D1-BF4A8B7F4F97}.Static lib - Release|Win32.Build.0 = Release|Win32 + {65D9DE2E-B73E-4ADF-96D1-BF4A8B7F4F97}.Static lib - Release|x64.ActiveCfg = Release|x64 + {65D9DE2E-B73E-4ADF-96D1-BF4A8B7F4F97}.Static lib - Release|x64.Build.0 = Release|x64 + {853A396E-C031-4C26-A716-5B4E176BE11D}.Debug|Win32.ActiveCfg = Debug|Win32 + {853A396E-C031-4C26-A716-5B4E176BE11D}.Debug|Win32.Build.0 = Debug|Win32 + {853A396E-C031-4C26-A716-5B4E176BE11D}.Debug|x64.ActiveCfg = Debug|x64 + {853A396E-C031-4C26-A716-5B4E176BE11D}.Debug|x64.Build.0 = Debug|x64 + {853A396E-C031-4C26-A716-5B4E176BE11D}.Release - Fast FPU|Win32.ActiveCfg = Release|Win32 + {853A396E-C031-4C26-A716-5B4E176BE11D}.Release - Fast FPU|Win32.Build.0 = Release|Win32 + {853A396E-C031-4C26-A716-5B4E176BE11D}.Release - Fast FPU|x64.ActiveCfg = Release|x64 + {853A396E-C031-4C26-A716-5B4E176BE11D}.Release - Fast FPU|x64.Build.0 = Release|x64 + {853A396E-C031-4C26-A716-5B4E176BE11D}.Release|Win32.ActiveCfg = Release|Win32 + {853A396E-C031-4C26-A716-5B4E176BE11D}.Release|Win32.Build.0 = Release|Win32 + {853A396E-C031-4C26-A716-5B4E176BE11D}.Release|x64.ActiveCfg = Release|x64 + {853A396E-C031-4C26-A716-5B4E176BE11D}.Release|x64.Build.0 = Release|x64 + {853A396E-C031-4C26-A716-5B4E176BE11D}.SDL-Debug|Win32.ActiveCfg = Debug|Win32 + {853A396E-C031-4C26-A716-5B4E176BE11D}.SDL-Debug|Win32.Build.0 = Debug|Win32 + {853A396E-C031-4C26-A716-5B4E176BE11D}.SDL-Debug|x64.ActiveCfg = Debug|x64 + {853A396E-C031-4C26-A716-5B4E176BE11D}.SDL-Debug|x64.Build.0 = Debug|x64 + {853A396E-C031-4C26-A716-5B4E176BE11D}.Static lib - Debug|Win32.ActiveCfg = Debug|Win32 + {853A396E-C031-4C26-A716-5B4E176BE11D}.Static lib - Debug|Win32.Build.0 = Debug|Win32 + {853A396E-C031-4C26-A716-5B4E176BE11D}.Static lib - Debug|x64.ActiveCfg = Debug|x64 + {853A396E-C031-4C26-A716-5B4E176BE11D}.Static lib - Debug|x64.Build.0 = Debug|x64 + {853A396E-C031-4C26-A716-5B4E176BE11D}.Static lib - Release - Fast FPU|Win32.ActiveCfg = Release|Win32 + {853A396E-C031-4C26-A716-5B4E176BE11D}.Static lib - Release - Fast FPU|Win32.Build.0 = Release|Win32 + {853A396E-C031-4C26-A716-5B4E176BE11D}.Static lib - Release - Fast FPU|x64.ActiveCfg = Release|x64 + {853A396E-C031-4C26-A716-5B4E176BE11D}.Static lib - Release - Fast FPU|x64.Build.0 = Release|x64 + {853A396E-C031-4C26-A716-5B4E176BE11D}.Static lib - Release|Win32.ActiveCfg = Release|Win32 + {853A396E-C031-4C26-A716-5B4E176BE11D}.Static lib - Release|Win32.Build.0 = Release|Win32 + {853A396E-C031-4C26-A716-5B4E176BE11D}.Static lib - Release|x64.ActiveCfg = Release|x64 + {853A396E-C031-4C26-A716-5B4E176BE11D}.Static lib - Release|x64.Build.0 = Release|x64 + {4D53E40F-37E3-42B1-8848-F4C6F8313A17}.Debug|Win32.ActiveCfg = Debug|Win32 + {4D53E40F-37E3-42B1-8848-F4C6F8313A17}.Debug|Win32.Build.0 = Debug|Win32 + {4D53E40F-37E3-42B1-8848-F4C6F8313A17}.Debug|x64.ActiveCfg = Debug|x64 + {4D53E40F-37E3-42B1-8848-F4C6F8313A17}.Debug|x64.Build.0 = Debug|x64 + {4D53E40F-37E3-42B1-8848-F4C6F8313A17}.Release - Fast FPU|Win32.ActiveCfg = Release|Win32 + {4D53E40F-37E3-42B1-8848-F4C6F8313A17}.Release - Fast FPU|Win32.Build.0 = Release|Win32 + {4D53E40F-37E3-42B1-8848-F4C6F8313A17}.Release - Fast FPU|x64.ActiveCfg = Release|x64 + {4D53E40F-37E3-42B1-8848-F4C6F8313A17}.Release - Fast FPU|x64.Build.0 = Release|x64 + {4D53E40F-37E3-42B1-8848-F4C6F8313A17}.Release|Win32.ActiveCfg = Release|Win32 + {4D53E40F-37E3-42B1-8848-F4C6F8313A17}.Release|Win32.Build.0 = Release|Win32 + {4D53E40F-37E3-42B1-8848-F4C6F8313A17}.Release|x64.ActiveCfg = Release|x64 + {4D53E40F-37E3-42B1-8848-F4C6F8313A17}.Release|x64.Build.0 = Release|x64 + {4D53E40F-37E3-42B1-8848-F4C6F8313A17}.SDL-Debug|Win32.ActiveCfg = Debug|Win32 + {4D53E40F-37E3-42B1-8848-F4C6F8313A17}.SDL-Debug|Win32.Build.0 = Debug|Win32 + {4D53E40F-37E3-42B1-8848-F4C6F8313A17}.SDL-Debug|x64.ActiveCfg = Debug|x64 + {4D53E40F-37E3-42B1-8848-F4C6F8313A17}.SDL-Debug|x64.Build.0 = Debug|x64 + {4D53E40F-37E3-42B1-8848-F4C6F8313A17}.Static lib - Debug|Win32.ActiveCfg = Debug|Win32 + {4D53E40F-37E3-42B1-8848-F4C6F8313A17}.Static lib - Debug|Win32.Build.0 = Debug|Win32 + {4D53E40F-37E3-42B1-8848-F4C6F8313A17}.Static lib - Debug|x64.ActiveCfg = Debug|x64 + {4D53E40F-37E3-42B1-8848-F4C6F8313A17}.Static lib - Debug|x64.Build.0 = Debug|x64 + {4D53E40F-37E3-42B1-8848-F4C6F8313A17}.Static lib - Release - Fast FPU|Win32.ActiveCfg = Release|Win32 + {4D53E40F-37E3-42B1-8848-F4C6F8313A17}.Static lib - Release - Fast FPU|Win32.Build.0 = Release|Win32 + {4D53E40F-37E3-42B1-8848-F4C6F8313A17}.Static lib - Release - Fast FPU|x64.ActiveCfg = Release|x64 + {4D53E40F-37E3-42B1-8848-F4C6F8313A17}.Static lib - Release - Fast FPU|x64.Build.0 = Release|x64 + {4D53E40F-37E3-42B1-8848-F4C6F8313A17}.Static lib - Release|Win32.ActiveCfg = Release|Win32 + {4D53E40F-37E3-42B1-8848-F4C6F8313A17}.Static lib - Release|Win32.Build.0 = Release|Win32 + {4D53E40F-37E3-42B1-8848-F4C6F8313A17}.Static lib - Release|x64.ActiveCfg = Release|x64 + {4D53E40F-37E3-42B1-8848-F4C6F8313A17}.Static lib - Release|x64.Build.0 = Release|x64 + {E72B637E-4AA6-46F3-885F-AC67B4B470ED}.Debug|Win32.ActiveCfg = Debug|Win32 + {E72B637E-4AA6-46F3-885F-AC67B4B470ED}.Debug|Win32.Build.0 = Debug|Win32 + {E72B637E-4AA6-46F3-885F-AC67B4B470ED}.Debug|x64.ActiveCfg = Debug|x64 + {E72B637E-4AA6-46F3-885F-AC67B4B470ED}.Debug|x64.Build.0 = Debug|x64 + {E72B637E-4AA6-46F3-885F-AC67B4B470ED}.Release - Fast FPU|Win32.ActiveCfg = Release|Win32 + {E72B637E-4AA6-46F3-885F-AC67B4B470ED}.Release - Fast FPU|Win32.Build.0 = Release|Win32 + {E72B637E-4AA6-46F3-885F-AC67B4B470ED}.Release - Fast FPU|x64.ActiveCfg = Release|x64 + {E72B637E-4AA6-46F3-885F-AC67B4B470ED}.Release - Fast FPU|x64.Build.0 = Release|x64 + {E72B637E-4AA6-46F3-885F-AC67B4B470ED}.Release|Win32.ActiveCfg = Release|Win32 + {E72B637E-4AA6-46F3-885F-AC67B4B470ED}.Release|Win32.Build.0 = Release|Win32 + {E72B637E-4AA6-46F3-885F-AC67B4B470ED}.Release|x64.ActiveCfg = Release|x64 + {E72B637E-4AA6-46F3-885F-AC67B4B470ED}.Release|x64.Build.0 = Release|x64 + {E72B637E-4AA6-46F3-885F-AC67B4B470ED}.SDL-Debug|Win32.ActiveCfg = Debug|Win32 + {E72B637E-4AA6-46F3-885F-AC67B4B470ED}.SDL-Debug|Win32.Build.0 = Debug|Win32 + {E72B637E-4AA6-46F3-885F-AC67B4B470ED}.SDL-Debug|x64.ActiveCfg = Debug|x64 + {E72B637E-4AA6-46F3-885F-AC67B4B470ED}.SDL-Debug|x64.Build.0 = Debug|x64 + {E72B637E-4AA6-46F3-885F-AC67B4B470ED}.Static lib - Debug|Win32.ActiveCfg = Debug|Win32 + {E72B637E-4AA6-46F3-885F-AC67B4B470ED}.Static lib - Debug|Win32.Build.0 = Debug|Win32 + {E72B637E-4AA6-46F3-885F-AC67B4B470ED}.Static lib - Debug|x64.ActiveCfg = Debug|x64 + {E72B637E-4AA6-46F3-885F-AC67B4B470ED}.Static lib - Debug|x64.Build.0 = Debug|x64 + {E72B637E-4AA6-46F3-885F-AC67B4B470ED}.Static lib - Release - Fast FPU|Win32.ActiveCfg = Release|Win32 + {E72B637E-4AA6-46F3-885F-AC67B4B470ED}.Static lib - Release - Fast FPU|Win32.Build.0 = Release|Win32 + {E72B637E-4AA6-46F3-885F-AC67B4B470ED}.Static lib - Release - Fast FPU|x64.ActiveCfg = Release|x64 + {E72B637E-4AA6-46F3-885F-AC67B4B470ED}.Static lib - Release - Fast FPU|x64.Build.0 = Release|x64 + {E72B637E-4AA6-46F3-885F-AC67B4B470ED}.Static lib - Release|Win32.ActiveCfg = Release|Win32 + {E72B637E-4AA6-46F3-885F-AC67B4B470ED}.Static lib - Release|Win32.Build.0 = Release|Win32 + {E72B637E-4AA6-46F3-885F-AC67B4B470ED}.Static lib - Release|x64.ActiveCfg = Release|x64 + {E72B637E-4AA6-46F3-885F-AC67B4B470ED}.Static lib - Release|x64.Build.0 = Release|x64 + {6F076455-D955-45D4-9C68-4AD4E45F2D47}.Debug|Win32.ActiveCfg = Debug|Win32 + {6F076455-D955-45D4-9C68-4AD4E45F2D47}.Debug|Win32.Build.0 = Debug|Win32 + {6F076455-D955-45D4-9C68-4AD4E45F2D47}.Debug|x64.ActiveCfg = Debug|x64 + {6F076455-D955-45D4-9C68-4AD4E45F2D47}.Debug|x64.Build.0 = Debug|x64 + {6F076455-D955-45D4-9C68-4AD4E45F2D47}.Release - Fast FPU|Win32.ActiveCfg = Release|Win32 + {6F076455-D955-45D4-9C68-4AD4E45F2D47}.Release - Fast FPU|Win32.Build.0 = Release|Win32 + {6F076455-D955-45D4-9C68-4AD4E45F2D47}.Release - Fast FPU|x64.ActiveCfg = Release|x64 + {6F076455-D955-45D4-9C68-4AD4E45F2D47}.Release - Fast FPU|x64.Build.0 = Release|x64 + {6F076455-D955-45D4-9C68-4AD4E45F2D47}.Release|Win32.ActiveCfg = Release|Win32 + {6F076455-D955-45D4-9C68-4AD4E45F2D47}.Release|Win32.Build.0 = Release|Win32 + {6F076455-D955-45D4-9C68-4AD4E45F2D47}.Release|x64.ActiveCfg = Release|x64 + {6F076455-D955-45D4-9C68-4AD4E45F2D47}.Release|x64.Build.0 = Release|x64 + {6F076455-D955-45D4-9C68-4AD4E45F2D47}.SDL-Debug|Win32.ActiveCfg = Debug|Win32 + {6F076455-D955-45D4-9C68-4AD4E45F2D47}.SDL-Debug|Win32.Build.0 = Debug|Win32 + {6F076455-D955-45D4-9C68-4AD4E45F2D47}.SDL-Debug|x64.ActiveCfg = Debug|x64 + {6F076455-D955-45D4-9C68-4AD4E45F2D47}.SDL-Debug|x64.Build.0 = Debug|x64 + {6F076455-D955-45D4-9C68-4AD4E45F2D47}.Static lib - Debug|Win32.ActiveCfg = Debug|Win32 + {6F076455-D955-45D4-9C68-4AD4E45F2D47}.Static lib - Debug|Win32.Build.0 = Debug|Win32 + {6F076455-D955-45D4-9C68-4AD4E45F2D47}.Static lib - Debug|x64.ActiveCfg = Debug|x64 + {6F076455-D955-45D4-9C68-4AD4E45F2D47}.Static lib - Debug|x64.Build.0 = Debug|x64 + {6F076455-D955-45D4-9C68-4AD4E45F2D47}.Static lib - Release - Fast FPU|Win32.ActiveCfg = Release|Win32 + {6F076455-D955-45D4-9C68-4AD4E45F2D47}.Static lib - Release - Fast FPU|Win32.Build.0 = Release|Win32 + {6F076455-D955-45D4-9C68-4AD4E45F2D47}.Static lib - Release - Fast FPU|x64.ActiveCfg = Release|x64 + {6F076455-D955-45D4-9C68-4AD4E45F2D47}.Static lib - Release - Fast FPU|x64.Build.0 = Release|x64 + {6F076455-D955-45D4-9C68-4AD4E45F2D47}.Static lib - Release|Win32.ActiveCfg = Release|Win32 + {6F076455-D955-45D4-9C68-4AD4E45F2D47}.Static lib - Release|Win32.Build.0 = Release|Win32 + {6F076455-D955-45D4-9C68-4AD4E45F2D47}.Static lib - Release|x64.ActiveCfg = Release|x64 + {6F076455-D955-45D4-9C68-4AD4E45F2D47}.Static lib - Release|x64.Build.0 = Release|x64 + {E08E042A-6C45-411B-92BE-3CC31331019F}.Debug|Win32.ActiveCfg = Debug|Win32 + {E08E042A-6C45-411B-92BE-3CC31331019F}.Debug|Win32.Build.0 = Debug|Win32 + {E08E042A-6C45-411B-92BE-3CC31331019F}.Debug|x64.ActiveCfg = Debug|x64 + {E08E042A-6C45-411B-92BE-3CC31331019F}.Debug|x64.Build.0 = Debug|x64 + {E08E042A-6C45-411B-92BE-3CC31331019F}.Release - Fast FPU|Win32.ActiveCfg = Release - Fast FPU|Win32 + {E08E042A-6C45-411B-92BE-3CC31331019F}.Release - Fast FPU|Win32.Build.0 = Release - Fast FPU|Win32 + {E08E042A-6C45-411B-92BE-3CC31331019F}.Release - Fast FPU|x64.ActiveCfg = Release - Fast FPU|x64 + {E08E042A-6C45-411B-92BE-3CC31331019F}.Release - Fast FPU|x64.Build.0 = Release - Fast FPU|x64 + {E08E042A-6C45-411B-92BE-3CC31331019F}.Release|Win32.ActiveCfg = Release|Win32 + {E08E042A-6C45-411B-92BE-3CC31331019F}.Release|Win32.Build.0 = Release|Win32 + {E08E042A-6C45-411B-92BE-3CC31331019F}.Release|x64.ActiveCfg = Release|x64 + {E08E042A-6C45-411B-92BE-3CC31331019F}.Release|x64.Build.0 = Release|x64 + {E08E042A-6C45-411B-92BE-3CC31331019F}.SDL-Debug|Win32.ActiveCfg = SDL-Debug|Win32 + {E08E042A-6C45-411B-92BE-3CC31331019F}.SDL-Debug|Win32.Build.0 = SDL-Debug|Win32 + {E08E042A-6C45-411B-92BE-3CC31331019F}.SDL-Debug|x64.ActiveCfg = SDL-Debug|x64 + {E08E042A-6C45-411B-92BE-3CC31331019F}.SDL-Debug|x64.Build.0 = SDL-Debug|x64 + {E08E042A-6C45-411B-92BE-3CC31331019F}.Static lib - Debug|Win32.ActiveCfg = Static lib - Debug|Win32 + {E08E042A-6C45-411B-92BE-3CC31331019F}.Static lib - Debug|Win32.Build.0 = Static lib - Debug|Win32 + {E08E042A-6C45-411B-92BE-3CC31331019F}.Static lib - Debug|x64.ActiveCfg = Static lib - Debug|x64 + {E08E042A-6C45-411B-92BE-3CC31331019F}.Static lib - Debug|x64.Build.0 = Static lib - Debug|x64 + {E08E042A-6C45-411B-92BE-3CC31331019F}.Static lib - Release - Fast FPU|Win32.ActiveCfg = Static lib - Release - Fast FPU|Win32 + {E08E042A-6C45-411B-92BE-3CC31331019F}.Static lib - Release - Fast FPU|Win32.Build.0 = Static lib - Release - Fast FPU|Win32 + {E08E042A-6C45-411B-92BE-3CC31331019F}.Static lib - Release - Fast FPU|x64.ActiveCfg = Static lib - Release - Fast FPU|x64 + {E08E042A-6C45-411B-92BE-3CC31331019F}.Static lib - Release - Fast FPU|x64.Build.0 = Static lib - Release - Fast FPU|x64 + {E08E042A-6C45-411B-92BE-3CC31331019F}.Static lib - Release|Win32.ActiveCfg = Static lib - Release|Win32 + {E08E042A-6C45-411B-92BE-3CC31331019F}.Static lib - Release|Win32.Build.0 = Static lib - Release|Win32 + {E08E042A-6C45-411B-92BE-3CC31331019F}.Static lib - Release|x64.ActiveCfg = Static lib - Release|x64 + {E08E042A-6C45-411B-92BE-3CC31331019F}.Static lib - Release|x64.Build.0 = Static lib - Release|x64 + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection +EndGlobal diff --git a/examples/BuildAllExamples_vc14.sln b/examples/BuildAllExamples_vc14.sln new file mode 100644 index 00000000..baa04847 --- /dev/null +++ b/examples/BuildAllExamples_vc14.sln @@ -0,0 +1,1039 @@ + +Microsoft Visual Studio Solution File, Format Version 14.00 +# Visual Studio 14 +VisualStudioVersion = 14.0.23107.0 +MinimumVisualStudioVersion = 10.0.40219.1 +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "01.HelloWorld", "01.HelloWorld\HelloWorld_vc14.vcxproj", "{5AD4C95C-BA38-4692-BA4B-8C25A86208F9}" + ProjectSection(ProjectDependencies) = postProject + {E08E042A-6C45-411B-92BE-3CC31331019F} = {E08E042A-6C45-411B-92BE-3CC31331019F} + EndProjectSection +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "02.Quake3Map", "02.Quake3Map\Quake3Map_vc14.vcxproj", "{D1A464A2-D479-458C-98A2-60965D823CD1}" + ProjectSection(ProjectDependencies) = postProject + {E08E042A-6C45-411B-92BE-3CC31331019F} = {E08E042A-6C45-411B-92BE-3CC31331019F} + EndProjectSection +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "03.CustomSceneNode", "03.CustomSceneNode\CustomSceneNode_vc14.vcxproj", "{171CCDFA-C140-4956-8EB7-F0168F4521D3}" + ProjectSection(ProjectDependencies) = postProject + {E08E042A-6C45-411B-92BE-3CC31331019F} = {E08E042A-6C45-411B-92BE-3CC31331019F} + EndProjectSection +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "04.Movement", "04.Movement\Movement_vc14.vcxproj", "{7BDBB7E8-E0C9-4A0D-83C1-D389D6140FEF}" + ProjectSection(ProjectDependencies) = postProject + {E08E042A-6C45-411B-92BE-3CC31331019F} = {E08E042A-6C45-411B-92BE-3CC31331019F} + EndProjectSection +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "05.UserInterface", "05.UserInterface\UserInterface_vc14.vcxproj", "{622C9DD7-0391-49FF-AF53-24F9D5A8EC53}" + ProjectSection(ProjectDependencies) = postProject + {E08E042A-6C45-411B-92BE-3CC31331019F} = {E08E042A-6C45-411B-92BE-3CC31331019F} + EndProjectSection +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "06.2DGraphics", "06.2DGraphics\2DGraphics_vc14.vcxproj", "{E71B6F18-10DC-4101-A541-F6D33F71B2BD}" + ProjectSection(ProjectDependencies) = postProject + {E08E042A-6C45-411B-92BE-3CC31331019F} = {E08E042A-6C45-411B-92BE-3CC31331019F} + EndProjectSection +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "07.Collision", "07.Collision\Collision_vc14.vcxproj", "{3E30297B-5BE3-4A5C-B31E-08A28ADDB29E}" + ProjectSection(ProjectDependencies) = postProject + {E08E042A-6C45-411B-92BE-3CC31331019F} = {E08E042A-6C45-411B-92BE-3CC31331019F} + EndProjectSection +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "08.SpecialFX", "08.SpecialFX\SpecialFX_vc14.vcxproj", "{C869BF55-B9D6-4980-BC92-60FA0CF8411A}" + ProjectSection(ProjectDependencies) = postProject + {E08E042A-6C45-411B-92BE-3CC31331019F} = {E08E042A-6C45-411B-92BE-3CC31331019F} + EndProjectSection +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "09.Meshviewer", "09.Meshviewer\Meshviewer_vc14.vcxproj", "{2AE24484-22FC-481B-9A40-7CD0DA5C8E06}" + ProjectSection(ProjectDependencies) = postProject + {E08E042A-6C45-411B-92BE-3CC31331019F} = {E08E042A-6C45-411B-92BE-3CC31331019F} + EndProjectSection +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "10.Shaders", "10.Shaders\Shaders_vc14.vcxproj", "{27158C82-CD15-4A9B-9848-35E7065B209F}" + ProjectSection(ProjectDependencies) = postProject + {E08E042A-6C45-411B-92BE-3CC31331019F} = {E08E042A-6C45-411B-92BE-3CC31331019F} + EndProjectSection +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "11.PerPixelLighting", "11.PerPixelLighting\PerPixelLighting_vc14.vcxproj", "{C4B42409-542D-4EFC-9E6B-44713FD47A33}" + ProjectSection(ProjectDependencies) = postProject + {E08E042A-6C45-411B-92BE-3CC31331019F} = {E08E042A-6C45-411B-92BE-3CC31331019F} + EndProjectSection +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "12.TerrainRendering", "12.TerrainRendering\TerrainRendering_vc14.vcxproj", "{3A5B74E5-6390-43B0-A459-2793B81FFD31}" + ProjectSection(ProjectDependencies) = postProject + {E08E042A-6C45-411B-92BE-3CC31331019F} = {E08E042A-6C45-411B-92BE-3CC31331019F} + EndProjectSection +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "13.RenderToTexture", "13.RenderToTexture\RenderToTexture_vc14.vcxproj", "{0914E5C8-5352-467B-8421-C9EB35BD5596}" + ProjectSection(ProjectDependencies) = postProject + {E08E042A-6C45-411B-92BE-3CC31331019F} = {E08E042A-6C45-411B-92BE-3CC31331019F} + EndProjectSection +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "14.Win32Window", "14.Win32Window\Win32Window_vc14.vcxproj", "{772FBE05-D05A-467B-9842-BEC409EEA8D0}" + ProjectSection(ProjectDependencies) = postProject + {E08E042A-6C45-411B-92BE-3CC31331019F} = {E08E042A-6C45-411B-92BE-3CC31331019F} + EndProjectSection +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "15.LoadIrrFile", "15.LoadIrrFile\LoadIrrFile_vc14.vcxproj", "{78C9F424-523C-49AC-94B7-823AA4A26BF9}" + ProjectSection(ProjectDependencies) = postProject + {E08E042A-6C45-411B-92BE-3CC31331019F} = {E08E042A-6C45-411B-92BE-3CC31331019F} + EndProjectSection +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "16.Quake3MapShader", "16.Quake3MapShader\Quake3MapShader_vc14.vcxproj", "{EB3B38EA-5CE7-4983-845B-880661E69D09}" + ProjectSection(ProjectDependencies) = postProject + {E08E042A-6C45-411B-92BE-3CC31331019F} = {E08E042A-6C45-411B-92BE-3CC31331019F} + EndProjectSection +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "18.SplitScreen", "18.SplitScreen\SplitScreen_vc14.vcxproj", "{1AB9413E-4F53-42A3-8CB2-CB4BE22336D0}" + ProjectSection(ProjectDependencies) = postProject + {E08E042A-6C45-411B-92BE-3CC31331019F} = {E08E042A-6C45-411B-92BE-3CC31331019F} + EndProjectSection +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "19.MouseAndJoystick", "19.MouseAndJoystick\MouseAndJoystick_vc14.vcxproj", "{FE853A36-E0D1-4AC5-A792-B643E70D2953}" + ProjectSection(ProjectDependencies) = postProject + {E08E042A-6C45-411B-92BE-3CC31331019F} = {E08E042A-6C45-411B-92BE-3CC31331019F} + EndProjectSection +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "20.ManagedLights", "20.ManagedLights\ManagedLights_vc14.vcxproj", "{16007FE2-142B-47F8-93E1-519BA3F39E71}" + ProjectSection(ProjectDependencies) = postProject + {E08E042A-6C45-411B-92BE-3CC31331019F} = {E08E042A-6C45-411B-92BE-3CC31331019F} + EndProjectSection +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "21.Quake3Explorer", "21.Quake3Explorer\Quake3Explorer_vc14.vcxproj", "{CDC4AAA9-72E1-4FFA-A04D-7EF59D8B97CD}" + ProjectSection(ProjectDependencies) = postProject + {E08E042A-6C45-411B-92BE-3CC31331019F} = {E08E042A-6C45-411B-92BE-3CC31331019F} + EndProjectSection +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "22.MaterialViewer", "22.MaterialViewer\MaterialViewer_vc14.vcxproj", "{4E6C2F8D-BA92-4C5B-96FD-72D4FE8BD7FA}" + ProjectSection(ProjectDependencies) = postProject + {E08E042A-6C45-411B-92BE-3CC31331019F} = {E08E042A-6C45-411B-92BE-3CC31331019F} + EndProjectSection +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "23.SMeshHandling", "23.SMeshHandling\SMeshHandling_vc14.vcxproj", "{6AEC2AA2-C9FF-4B7D-B07A-94A9D34B41D7}" + ProjectSection(ProjectDependencies) = postProject + {E08E042A-6C45-411B-92BE-3CC31331019F} = {E08E042A-6C45-411B-92BE-3CC31331019F} + EndProjectSection +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "24.CursorControl", "24.CursorControl\CursorControl_vc14.vcxproj", "{02B67A37-50E1-49DB-BECF-905BC029C2FE}" + ProjectSection(ProjectDependencies) = postProject + {E08E042A-6C45-411B-92BE-3CC31331019F} = {E08E042A-6C45-411B-92BE-3CC31331019F} + EndProjectSection +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "25.XmlHandling", "25.XmlHandling\XmlHandling_vc14.vcxproj", "{8FDA260E-EF27-4F8C-8720-7AF707DD0D9E}" + ProjectSection(ProjectDependencies) = postProject + {E08E042A-6C45-411B-92BE-3CC31331019F} = {E08E042A-6C45-411B-92BE-3CC31331019F} + EndProjectSection +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "26.OcclusionQuery", "26.OcclusionQuery\OcclusionQuery_vc14.vcxproj", "{5CE0E2E7-879D-4152-B61D-24E7D0707B45}" + ProjectSection(ProjectDependencies) = postProject + {E08E042A-6C45-411B-92BE-3CC31331019F} = {E08E042A-6C45-411B-92BE-3CC31331019F} + EndProjectSection +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "30.Profiling", "30.Profiling\Profiling_vc14.vcxproj", "{65D9DE2E-B73E-4ADF-96D1-BF4A8B7F4F97}" + ProjectSection(ProjectDependencies) = postProject + {E08E042A-6C45-411B-92BE-3CC31331019F} = {E08E042A-6C45-411B-92BE-3CC31331019F} + EndProjectSection +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "GUIEditor", "..\tools\GUIEditor\GUI Editor_vc14.vcxproj", "{853A396E-C031-4C26-A716-5B4E176BE11D}" +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "FontTool", "..\tools\IrrFontTool\newFontTool\irrFontTool_vc14.vcxproj", "{4D53E40F-37E3-42B1-8848-F4C6F8313A17}" +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "MeshConverter", "..\tools\MeshConverter\MeshConverter_vc14.vcxproj", "{E72B637E-4AA6-46F3-885F-AC67B4B470ED}" +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Demo", "Demo\Demo_vc14.vcxproj", "{6F076455-D955-45D4-9C68-4AD4E45F2D47}" + ProjectSection(ProjectDependencies) = postProject + {E08E042A-6C45-411B-92BE-3CC31331019F} = {E08E042A-6C45-411B-92BE-3CC31331019F} + EndProjectSection +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Irrlicht", "..\source\Irrlicht\Irrlicht14.0.vcxproj", "{E08E042A-6C45-411B-92BE-3CC31331019F}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Win32 = Debug|Win32 + Debug|x64 = Debug|x64 + Release - Fast FPU|Win32 = Release - Fast FPU|Win32 + Release - Fast FPU|x64 = Release - Fast FPU|x64 + Release|Win32 = Release|Win32 + Release|x64 = Release|x64 + SDL-Debug|Win32 = SDL-Debug|Win32 + SDL-Debug|x64 = SDL-Debug|x64 + Static lib - Debug|Win32 = Static lib - Debug|Win32 + Static lib - Debug|x64 = Static lib - Debug|x64 + Static lib - Release - Fast FPU|Win32 = Static lib - Release - Fast FPU|Win32 + Static lib - Release - Fast FPU|x64 = Static lib - Release - Fast FPU|x64 + Static lib - Release|Win32 = Static lib - Release|Win32 + Static lib - Release|x64 = Static lib - Release|x64 + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {5AD4C95C-BA38-4692-BA4B-8C25A86208F9}.Debug|Win32.ActiveCfg = Debug|Win32 + {5AD4C95C-BA38-4692-BA4B-8C25A86208F9}.Debug|Win32.Build.0 = Debug|Win32 + {5AD4C95C-BA38-4692-BA4B-8C25A86208F9}.Debug|x64.ActiveCfg = Debug|x64 + {5AD4C95C-BA38-4692-BA4B-8C25A86208F9}.Debug|x64.Build.0 = Debug|x64 + {5AD4C95C-BA38-4692-BA4B-8C25A86208F9}.Release - Fast FPU|Win32.ActiveCfg = Release|Win32 + {5AD4C95C-BA38-4692-BA4B-8C25A86208F9}.Release - Fast FPU|Win32.Build.0 = Release|Win32 + {5AD4C95C-BA38-4692-BA4B-8C25A86208F9}.Release - Fast FPU|x64.ActiveCfg = Release|x64 + {5AD4C95C-BA38-4692-BA4B-8C25A86208F9}.Release - Fast FPU|x64.Build.0 = Release|x64 + {5AD4C95C-BA38-4692-BA4B-8C25A86208F9}.Release|Win32.ActiveCfg = Release|Win32 + {5AD4C95C-BA38-4692-BA4B-8C25A86208F9}.Release|Win32.Build.0 = Release|Win32 + {5AD4C95C-BA38-4692-BA4B-8C25A86208F9}.Release|x64.ActiveCfg = Release|x64 + {5AD4C95C-BA38-4692-BA4B-8C25A86208F9}.Release|x64.Build.0 = Release|x64 + {5AD4C95C-BA38-4692-BA4B-8C25A86208F9}.SDL-Debug|Win32.ActiveCfg = Debug|Win32 + {5AD4C95C-BA38-4692-BA4B-8C25A86208F9}.SDL-Debug|Win32.Build.0 = Debug|Win32 + {5AD4C95C-BA38-4692-BA4B-8C25A86208F9}.SDL-Debug|x64.ActiveCfg = Debug|x64 + {5AD4C95C-BA38-4692-BA4B-8C25A86208F9}.SDL-Debug|x64.Build.0 = Debug|x64 + {5AD4C95C-BA38-4692-BA4B-8C25A86208F9}.Static lib - Debug|Win32.ActiveCfg = Debug|Win32 + {5AD4C95C-BA38-4692-BA4B-8C25A86208F9}.Static lib - Debug|Win32.Build.0 = Debug|Win32 + {5AD4C95C-BA38-4692-BA4B-8C25A86208F9}.Static lib - Debug|x64.ActiveCfg = Debug|x64 + {5AD4C95C-BA38-4692-BA4B-8C25A86208F9}.Static lib - Debug|x64.Build.0 = Debug|x64 + {5AD4C95C-BA38-4692-BA4B-8C25A86208F9}.Static lib - Release - Fast FPU|Win32.ActiveCfg = Release|Win32 + {5AD4C95C-BA38-4692-BA4B-8C25A86208F9}.Static lib - Release - Fast FPU|Win32.Build.0 = Release|Win32 + {5AD4C95C-BA38-4692-BA4B-8C25A86208F9}.Static lib - Release - Fast FPU|x64.ActiveCfg = Release|x64 + {5AD4C95C-BA38-4692-BA4B-8C25A86208F9}.Static lib - Release - Fast FPU|x64.Build.0 = Release|x64 + {5AD4C95C-BA38-4692-BA4B-8C25A86208F9}.Static lib - Release|Win32.ActiveCfg = Release|Win32 + {5AD4C95C-BA38-4692-BA4B-8C25A86208F9}.Static lib - Release|Win32.Build.0 = Release|Win32 + {5AD4C95C-BA38-4692-BA4B-8C25A86208F9}.Static lib - Release|x64.ActiveCfg = Release|x64 + {5AD4C95C-BA38-4692-BA4B-8C25A86208F9}.Static lib - Release|x64.Build.0 = Release|x64 + {D1A464A2-D479-458C-98A2-60965D823CD1}.Debug|Win32.ActiveCfg = Debug|Win32 + {D1A464A2-D479-458C-98A2-60965D823CD1}.Debug|Win32.Build.0 = Debug|Win32 + {D1A464A2-D479-458C-98A2-60965D823CD1}.Debug|x64.ActiveCfg = Debug|x64 + {D1A464A2-D479-458C-98A2-60965D823CD1}.Debug|x64.Build.0 = Debug|x64 + {D1A464A2-D479-458C-98A2-60965D823CD1}.Release - Fast FPU|Win32.ActiveCfg = Release|Win32 + {D1A464A2-D479-458C-98A2-60965D823CD1}.Release - Fast FPU|Win32.Build.0 = Release|Win32 + {D1A464A2-D479-458C-98A2-60965D823CD1}.Release - Fast FPU|x64.ActiveCfg = Release|x64 + {D1A464A2-D479-458C-98A2-60965D823CD1}.Release - Fast FPU|x64.Build.0 = Release|x64 + {D1A464A2-D479-458C-98A2-60965D823CD1}.Release|Win32.ActiveCfg = Release|Win32 + {D1A464A2-D479-458C-98A2-60965D823CD1}.Release|Win32.Build.0 = Release|Win32 + {D1A464A2-D479-458C-98A2-60965D823CD1}.Release|x64.ActiveCfg = Release|x64 + {D1A464A2-D479-458C-98A2-60965D823CD1}.Release|x64.Build.0 = Release|x64 + {D1A464A2-D479-458C-98A2-60965D823CD1}.SDL-Debug|Win32.ActiveCfg = Debug|Win32 + {D1A464A2-D479-458C-98A2-60965D823CD1}.SDL-Debug|Win32.Build.0 = Debug|Win32 + {D1A464A2-D479-458C-98A2-60965D823CD1}.SDL-Debug|x64.ActiveCfg = Debug|x64 + {D1A464A2-D479-458C-98A2-60965D823CD1}.SDL-Debug|x64.Build.0 = Debug|x64 + {D1A464A2-D479-458C-98A2-60965D823CD1}.Static lib - Debug|Win32.ActiveCfg = Debug|Win32 + {D1A464A2-D479-458C-98A2-60965D823CD1}.Static lib - Debug|Win32.Build.0 = Debug|Win32 + {D1A464A2-D479-458C-98A2-60965D823CD1}.Static lib - Debug|x64.ActiveCfg = Debug|x64 + {D1A464A2-D479-458C-98A2-60965D823CD1}.Static lib - Debug|x64.Build.0 = Debug|x64 + {D1A464A2-D479-458C-98A2-60965D823CD1}.Static lib - Release - Fast FPU|Win32.ActiveCfg = Release|Win32 + {D1A464A2-D479-458C-98A2-60965D823CD1}.Static lib - Release - Fast FPU|Win32.Build.0 = Release|Win32 + {D1A464A2-D479-458C-98A2-60965D823CD1}.Static lib - Release - Fast FPU|x64.ActiveCfg = Release|x64 + {D1A464A2-D479-458C-98A2-60965D823CD1}.Static lib - Release - Fast FPU|x64.Build.0 = Release|x64 + {D1A464A2-D479-458C-98A2-60965D823CD1}.Static lib - Release|Win32.ActiveCfg = Release|Win32 + {D1A464A2-D479-458C-98A2-60965D823CD1}.Static lib - Release|Win32.Build.0 = Release|Win32 + {D1A464A2-D479-458C-98A2-60965D823CD1}.Static lib - Release|x64.ActiveCfg = Release|x64 + {D1A464A2-D479-458C-98A2-60965D823CD1}.Static lib - Release|x64.Build.0 = Release|x64 + {171CCDFA-C140-4956-8EB7-F0168F4521D3}.Debug|Win32.ActiveCfg = Debug|Win32 + {171CCDFA-C140-4956-8EB7-F0168F4521D3}.Debug|Win32.Build.0 = Debug|Win32 + {171CCDFA-C140-4956-8EB7-F0168F4521D3}.Debug|x64.ActiveCfg = Debug|x64 + {171CCDFA-C140-4956-8EB7-F0168F4521D3}.Debug|x64.Build.0 = Debug|x64 + {171CCDFA-C140-4956-8EB7-F0168F4521D3}.Release - Fast FPU|Win32.ActiveCfg = Release|Win32 + {171CCDFA-C140-4956-8EB7-F0168F4521D3}.Release - Fast FPU|Win32.Build.0 = Release|Win32 + {171CCDFA-C140-4956-8EB7-F0168F4521D3}.Release - Fast FPU|x64.ActiveCfg = Release|x64 + {171CCDFA-C140-4956-8EB7-F0168F4521D3}.Release - Fast FPU|x64.Build.0 = Release|x64 + {171CCDFA-C140-4956-8EB7-F0168F4521D3}.Release|Win32.ActiveCfg = Release|Win32 + {171CCDFA-C140-4956-8EB7-F0168F4521D3}.Release|Win32.Build.0 = Release|Win32 + {171CCDFA-C140-4956-8EB7-F0168F4521D3}.Release|x64.ActiveCfg = Release|x64 + {171CCDFA-C140-4956-8EB7-F0168F4521D3}.Release|x64.Build.0 = Release|x64 + {171CCDFA-C140-4956-8EB7-F0168F4521D3}.SDL-Debug|Win32.ActiveCfg = Debug|Win32 + {171CCDFA-C140-4956-8EB7-F0168F4521D3}.SDL-Debug|Win32.Build.0 = Debug|Win32 + {171CCDFA-C140-4956-8EB7-F0168F4521D3}.SDL-Debug|x64.ActiveCfg = Debug|x64 + {171CCDFA-C140-4956-8EB7-F0168F4521D3}.SDL-Debug|x64.Build.0 = Debug|x64 + {171CCDFA-C140-4956-8EB7-F0168F4521D3}.Static lib - Debug|Win32.ActiveCfg = Debug|Win32 + {171CCDFA-C140-4956-8EB7-F0168F4521D3}.Static lib - Debug|Win32.Build.0 = Debug|Win32 + {171CCDFA-C140-4956-8EB7-F0168F4521D3}.Static lib - Debug|x64.ActiveCfg = Debug|x64 + {171CCDFA-C140-4956-8EB7-F0168F4521D3}.Static lib - Debug|x64.Build.0 = Debug|x64 + {171CCDFA-C140-4956-8EB7-F0168F4521D3}.Static lib - Release - Fast FPU|Win32.ActiveCfg = Release|Win32 + {171CCDFA-C140-4956-8EB7-F0168F4521D3}.Static lib - Release - Fast FPU|Win32.Build.0 = Release|Win32 + {171CCDFA-C140-4956-8EB7-F0168F4521D3}.Static lib - Release - Fast FPU|x64.ActiveCfg = Release|x64 + {171CCDFA-C140-4956-8EB7-F0168F4521D3}.Static lib - Release - Fast FPU|x64.Build.0 = Release|x64 + {171CCDFA-C140-4956-8EB7-F0168F4521D3}.Static lib - Release|Win32.ActiveCfg = Release|Win32 + {171CCDFA-C140-4956-8EB7-F0168F4521D3}.Static lib - Release|Win32.Build.0 = Release|Win32 + {171CCDFA-C140-4956-8EB7-F0168F4521D3}.Static lib - Release|x64.ActiveCfg = Release|x64 + {171CCDFA-C140-4956-8EB7-F0168F4521D3}.Static lib - Release|x64.Build.0 = Release|x64 + {7BDBB7E8-E0C9-4A0D-83C1-D389D6140FEF}.Debug|Win32.ActiveCfg = Debug|Win32 + {7BDBB7E8-E0C9-4A0D-83C1-D389D6140FEF}.Debug|Win32.Build.0 = Debug|Win32 + {7BDBB7E8-E0C9-4A0D-83C1-D389D6140FEF}.Debug|x64.ActiveCfg = Debug|x64 + {7BDBB7E8-E0C9-4A0D-83C1-D389D6140FEF}.Debug|x64.Build.0 = Debug|x64 + {7BDBB7E8-E0C9-4A0D-83C1-D389D6140FEF}.Release - Fast FPU|Win32.ActiveCfg = Release|Win32 + {7BDBB7E8-E0C9-4A0D-83C1-D389D6140FEF}.Release - Fast FPU|Win32.Build.0 = Release|Win32 + {7BDBB7E8-E0C9-4A0D-83C1-D389D6140FEF}.Release - Fast FPU|x64.ActiveCfg = Release|x64 + {7BDBB7E8-E0C9-4A0D-83C1-D389D6140FEF}.Release - Fast FPU|x64.Build.0 = Release|x64 + {7BDBB7E8-E0C9-4A0D-83C1-D389D6140FEF}.Release|Win32.ActiveCfg = Release|Win32 + {7BDBB7E8-E0C9-4A0D-83C1-D389D6140FEF}.Release|Win32.Build.0 = Release|Win32 + {7BDBB7E8-E0C9-4A0D-83C1-D389D6140FEF}.Release|x64.ActiveCfg = Release|x64 + {7BDBB7E8-E0C9-4A0D-83C1-D389D6140FEF}.Release|x64.Build.0 = Release|x64 + {7BDBB7E8-E0C9-4A0D-83C1-D389D6140FEF}.SDL-Debug|Win32.ActiveCfg = Debug|Win32 + {7BDBB7E8-E0C9-4A0D-83C1-D389D6140FEF}.SDL-Debug|Win32.Build.0 = Debug|Win32 + {7BDBB7E8-E0C9-4A0D-83C1-D389D6140FEF}.SDL-Debug|x64.ActiveCfg = Debug|x64 + {7BDBB7E8-E0C9-4A0D-83C1-D389D6140FEF}.SDL-Debug|x64.Build.0 = Debug|x64 + {7BDBB7E8-E0C9-4A0D-83C1-D389D6140FEF}.Static lib - Debug|Win32.ActiveCfg = Debug|Win32 + {7BDBB7E8-E0C9-4A0D-83C1-D389D6140FEF}.Static lib - Debug|Win32.Build.0 = Debug|Win32 + {7BDBB7E8-E0C9-4A0D-83C1-D389D6140FEF}.Static lib - Debug|x64.ActiveCfg = Debug|x64 + {7BDBB7E8-E0C9-4A0D-83C1-D389D6140FEF}.Static lib - Debug|x64.Build.0 = Debug|x64 + {7BDBB7E8-E0C9-4A0D-83C1-D389D6140FEF}.Static lib - Release - Fast FPU|Win32.ActiveCfg = Release|Win32 + {7BDBB7E8-E0C9-4A0D-83C1-D389D6140FEF}.Static lib - Release - Fast FPU|Win32.Build.0 = Release|Win32 + {7BDBB7E8-E0C9-4A0D-83C1-D389D6140FEF}.Static lib - Release - Fast FPU|x64.ActiveCfg = Release|x64 + {7BDBB7E8-E0C9-4A0D-83C1-D389D6140FEF}.Static lib - Release - Fast FPU|x64.Build.0 = Release|x64 + {7BDBB7E8-E0C9-4A0D-83C1-D389D6140FEF}.Static lib - Release|Win32.ActiveCfg = Release|Win32 + {7BDBB7E8-E0C9-4A0D-83C1-D389D6140FEF}.Static lib - Release|Win32.Build.0 = Release|Win32 + {7BDBB7E8-E0C9-4A0D-83C1-D389D6140FEF}.Static lib - Release|x64.ActiveCfg = Release|x64 + {7BDBB7E8-E0C9-4A0D-83C1-D389D6140FEF}.Static lib - Release|x64.Build.0 = Release|x64 + {622C9DD7-0391-49FF-AF53-24F9D5A8EC53}.Debug|Win32.ActiveCfg = Debug|Win32 + {622C9DD7-0391-49FF-AF53-24F9D5A8EC53}.Debug|Win32.Build.0 = Debug|Win32 + {622C9DD7-0391-49FF-AF53-24F9D5A8EC53}.Debug|x64.ActiveCfg = Debug|x64 + {622C9DD7-0391-49FF-AF53-24F9D5A8EC53}.Debug|x64.Build.0 = Debug|x64 + {622C9DD7-0391-49FF-AF53-24F9D5A8EC53}.Release - Fast FPU|Win32.ActiveCfg = Release|Win32 + {622C9DD7-0391-49FF-AF53-24F9D5A8EC53}.Release - Fast FPU|Win32.Build.0 = Release|Win32 + {622C9DD7-0391-49FF-AF53-24F9D5A8EC53}.Release - Fast FPU|x64.ActiveCfg = Release|x64 + {622C9DD7-0391-49FF-AF53-24F9D5A8EC53}.Release - Fast FPU|x64.Build.0 = Release|x64 + {622C9DD7-0391-49FF-AF53-24F9D5A8EC53}.Release|Win32.ActiveCfg = Release|Win32 + {622C9DD7-0391-49FF-AF53-24F9D5A8EC53}.Release|Win32.Build.0 = Release|Win32 + {622C9DD7-0391-49FF-AF53-24F9D5A8EC53}.Release|x64.ActiveCfg = Release|x64 + {622C9DD7-0391-49FF-AF53-24F9D5A8EC53}.Release|x64.Build.0 = Release|x64 + {622C9DD7-0391-49FF-AF53-24F9D5A8EC53}.SDL-Debug|Win32.ActiveCfg = Debug|Win32 + {622C9DD7-0391-49FF-AF53-24F9D5A8EC53}.SDL-Debug|Win32.Build.0 = Debug|Win32 + {622C9DD7-0391-49FF-AF53-24F9D5A8EC53}.SDL-Debug|x64.ActiveCfg = Debug|x64 + {622C9DD7-0391-49FF-AF53-24F9D5A8EC53}.SDL-Debug|x64.Build.0 = Debug|x64 + {622C9DD7-0391-49FF-AF53-24F9D5A8EC53}.Static lib - Debug|Win32.ActiveCfg = Debug|Win32 + {622C9DD7-0391-49FF-AF53-24F9D5A8EC53}.Static lib - Debug|Win32.Build.0 = Debug|Win32 + {622C9DD7-0391-49FF-AF53-24F9D5A8EC53}.Static lib - Debug|x64.ActiveCfg = Debug|x64 + {622C9DD7-0391-49FF-AF53-24F9D5A8EC53}.Static lib - Debug|x64.Build.0 = Debug|x64 + {622C9DD7-0391-49FF-AF53-24F9D5A8EC53}.Static lib - Release - Fast FPU|Win32.ActiveCfg = Release|Win32 + {622C9DD7-0391-49FF-AF53-24F9D5A8EC53}.Static lib - Release - Fast FPU|Win32.Build.0 = Release|Win32 + {622C9DD7-0391-49FF-AF53-24F9D5A8EC53}.Static lib - Release - Fast FPU|x64.ActiveCfg = Release|x64 + {622C9DD7-0391-49FF-AF53-24F9D5A8EC53}.Static lib - Release - Fast FPU|x64.Build.0 = Release|x64 + {622C9DD7-0391-49FF-AF53-24F9D5A8EC53}.Static lib - Release|Win32.ActiveCfg = Release|Win32 + {622C9DD7-0391-49FF-AF53-24F9D5A8EC53}.Static lib - Release|Win32.Build.0 = Release|Win32 + {622C9DD7-0391-49FF-AF53-24F9D5A8EC53}.Static lib - Release|x64.ActiveCfg = Release|x64 + {622C9DD7-0391-49FF-AF53-24F9D5A8EC53}.Static lib - Release|x64.Build.0 = Release|x64 + {E71B6F18-10DC-4101-A541-F6D33F71B2BD}.Debug|Win32.ActiveCfg = Debug|Win32 + {E71B6F18-10DC-4101-A541-F6D33F71B2BD}.Debug|Win32.Build.0 = Debug|Win32 + {E71B6F18-10DC-4101-A541-F6D33F71B2BD}.Debug|x64.ActiveCfg = Debug|x64 + {E71B6F18-10DC-4101-A541-F6D33F71B2BD}.Debug|x64.Build.0 = Debug|x64 + {E71B6F18-10DC-4101-A541-F6D33F71B2BD}.Release - Fast FPU|Win32.ActiveCfg = Release|Win32 + {E71B6F18-10DC-4101-A541-F6D33F71B2BD}.Release - Fast FPU|Win32.Build.0 = Release|Win32 + {E71B6F18-10DC-4101-A541-F6D33F71B2BD}.Release - Fast FPU|x64.ActiveCfg = Release|x64 + {E71B6F18-10DC-4101-A541-F6D33F71B2BD}.Release - Fast FPU|x64.Build.0 = Release|x64 + {E71B6F18-10DC-4101-A541-F6D33F71B2BD}.Release|Win32.ActiveCfg = Release|Win32 + {E71B6F18-10DC-4101-A541-F6D33F71B2BD}.Release|Win32.Build.0 = Release|Win32 + {E71B6F18-10DC-4101-A541-F6D33F71B2BD}.Release|x64.ActiveCfg = Release|x64 + {E71B6F18-10DC-4101-A541-F6D33F71B2BD}.Release|x64.Build.0 = Release|x64 + {E71B6F18-10DC-4101-A541-F6D33F71B2BD}.SDL-Debug|Win32.ActiveCfg = Debug|Win32 + {E71B6F18-10DC-4101-A541-F6D33F71B2BD}.SDL-Debug|Win32.Build.0 = Debug|Win32 + {E71B6F18-10DC-4101-A541-F6D33F71B2BD}.SDL-Debug|x64.ActiveCfg = Debug|x64 + {E71B6F18-10DC-4101-A541-F6D33F71B2BD}.SDL-Debug|x64.Build.0 = Debug|x64 + {E71B6F18-10DC-4101-A541-F6D33F71B2BD}.Static lib - Debug|Win32.ActiveCfg = Debug|Win32 + {E71B6F18-10DC-4101-A541-F6D33F71B2BD}.Static lib - Debug|Win32.Build.0 = Debug|Win32 + {E71B6F18-10DC-4101-A541-F6D33F71B2BD}.Static lib - Debug|x64.ActiveCfg = Debug|x64 + {E71B6F18-10DC-4101-A541-F6D33F71B2BD}.Static lib - Debug|x64.Build.0 = Debug|x64 + {E71B6F18-10DC-4101-A541-F6D33F71B2BD}.Static lib - Release - Fast FPU|Win32.ActiveCfg = Release|Win32 + {E71B6F18-10DC-4101-A541-F6D33F71B2BD}.Static lib - Release - Fast FPU|Win32.Build.0 = Release|Win32 + {E71B6F18-10DC-4101-A541-F6D33F71B2BD}.Static lib - Release - Fast FPU|x64.ActiveCfg = Release|x64 + {E71B6F18-10DC-4101-A541-F6D33F71B2BD}.Static lib - Release - Fast FPU|x64.Build.0 = Release|x64 + {E71B6F18-10DC-4101-A541-F6D33F71B2BD}.Static lib - Release|Win32.ActiveCfg = Release|Win32 + {E71B6F18-10DC-4101-A541-F6D33F71B2BD}.Static lib - Release|Win32.Build.0 = Release|Win32 + {E71B6F18-10DC-4101-A541-F6D33F71B2BD}.Static lib - Release|x64.ActiveCfg = Release|x64 + {E71B6F18-10DC-4101-A541-F6D33F71B2BD}.Static lib - Release|x64.Build.0 = Release|x64 + {3E30297B-5BE3-4A5C-B31E-08A28ADDB29E}.Debug|Win32.ActiveCfg = Debug|Win32 + {3E30297B-5BE3-4A5C-B31E-08A28ADDB29E}.Debug|Win32.Build.0 = Debug|Win32 + {3E30297B-5BE3-4A5C-B31E-08A28ADDB29E}.Debug|x64.ActiveCfg = Debug|x64 + {3E30297B-5BE3-4A5C-B31E-08A28ADDB29E}.Debug|x64.Build.0 = Debug|x64 + {3E30297B-5BE3-4A5C-B31E-08A28ADDB29E}.Release - Fast FPU|Win32.ActiveCfg = Release|Win32 + {3E30297B-5BE3-4A5C-B31E-08A28ADDB29E}.Release - Fast FPU|Win32.Build.0 = Release|Win32 + {3E30297B-5BE3-4A5C-B31E-08A28ADDB29E}.Release - Fast FPU|x64.ActiveCfg = Release|x64 + {3E30297B-5BE3-4A5C-B31E-08A28ADDB29E}.Release - Fast FPU|x64.Build.0 = Release|x64 + {3E30297B-5BE3-4A5C-B31E-08A28ADDB29E}.Release|Win32.ActiveCfg = Release|Win32 + {3E30297B-5BE3-4A5C-B31E-08A28ADDB29E}.Release|Win32.Build.0 = Release|Win32 + {3E30297B-5BE3-4A5C-B31E-08A28ADDB29E}.Release|x64.ActiveCfg = Release|x64 + {3E30297B-5BE3-4A5C-B31E-08A28ADDB29E}.Release|x64.Build.0 = Release|x64 + {3E30297B-5BE3-4A5C-B31E-08A28ADDB29E}.SDL-Debug|Win32.ActiveCfg = Debug|Win32 + {3E30297B-5BE3-4A5C-B31E-08A28ADDB29E}.SDL-Debug|Win32.Build.0 = Debug|Win32 + {3E30297B-5BE3-4A5C-B31E-08A28ADDB29E}.SDL-Debug|x64.ActiveCfg = Debug|x64 + {3E30297B-5BE3-4A5C-B31E-08A28ADDB29E}.SDL-Debug|x64.Build.0 = Debug|x64 + {3E30297B-5BE3-4A5C-B31E-08A28ADDB29E}.Static lib - Debug|Win32.ActiveCfg = Debug|Win32 + {3E30297B-5BE3-4A5C-B31E-08A28ADDB29E}.Static lib - Debug|Win32.Build.0 = Debug|Win32 + {3E30297B-5BE3-4A5C-B31E-08A28ADDB29E}.Static lib - Debug|x64.ActiveCfg = Debug|x64 + {3E30297B-5BE3-4A5C-B31E-08A28ADDB29E}.Static lib - Debug|x64.Build.0 = Debug|x64 + {3E30297B-5BE3-4A5C-B31E-08A28ADDB29E}.Static lib - Release - Fast FPU|Win32.ActiveCfg = Release|Win32 + {3E30297B-5BE3-4A5C-B31E-08A28ADDB29E}.Static lib - Release - Fast FPU|Win32.Build.0 = Release|Win32 + {3E30297B-5BE3-4A5C-B31E-08A28ADDB29E}.Static lib - Release - Fast FPU|x64.ActiveCfg = Release|x64 + {3E30297B-5BE3-4A5C-B31E-08A28ADDB29E}.Static lib - Release - Fast FPU|x64.Build.0 = Release|x64 + {3E30297B-5BE3-4A5C-B31E-08A28ADDB29E}.Static lib - Release|Win32.ActiveCfg = Release|Win32 + {3E30297B-5BE3-4A5C-B31E-08A28ADDB29E}.Static lib - Release|Win32.Build.0 = Release|Win32 + {3E30297B-5BE3-4A5C-B31E-08A28ADDB29E}.Static lib - Release|x64.ActiveCfg = Release|x64 + {3E30297B-5BE3-4A5C-B31E-08A28ADDB29E}.Static lib - Release|x64.Build.0 = Release|x64 + {C869BF55-B9D6-4980-BC92-60FA0CF8411A}.Debug|Win32.ActiveCfg = Debug|Win32 + {C869BF55-B9D6-4980-BC92-60FA0CF8411A}.Debug|Win32.Build.0 = Debug|Win32 + {C869BF55-B9D6-4980-BC92-60FA0CF8411A}.Debug|x64.ActiveCfg = Debug|x64 + {C869BF55-B9D6-4980-BC92-60FA0CF8411A}.Debug|x64.Build.0 = Debug|x64 + {C869BF55-B9D6-4980-BC92-60FA0CF8411A}.Release - Fast FPU|Win32.ActiveCfg = Release|Win32 + {C869BF55-B9D6-4980-BC92-60FA0CF8411A}.Release - Fast FPU|Win32.Build.0 = Release|Win32 + {C869BF55-B9D6-4980-BC92-60FA0CF8411A}.Release - Fast FPU|x64.ActiveCfg = Release|x64 + {C869BF55-B9D6-4980-BC92-60FA0CF8411A}.Release - Fast FPU|x64.Build.0 = Release|x64 + {C869BF55-B9D6-4980-BC92-60FA0CF8411A}.Release|Win32.ActiveCfg = Release|Win32 + {C869BF55-B9D6-4980-BC92-60FA0CF8411A}.Release|Win32.Build.0 = Release|Win32 + {C869BF55-B9D6-4980-BC92-60FA0CF8411A}.Release|x64.ActiveCfg = Release|x64 + {C869BF55-B9D6-4980-BC92-60FA0CF8411A}.Release|x64.Build.0 = Release|x64 + {C869BF55-B9D6-4980-BC92-60FA0CF8411A}.SDL-Debug|Win32.ActiveCfg = Debug|Win32 + {C869BF55-B9D6-4980-BC92-60FA0CF8411A}.SDL-Debug|Win32.Build.0 = Debug|Win32 + {C869BF55-B9D6-4980-BC92-60FA0CF8411A}.SDL-Debug|x64.ActiveCfg = Debug|x64 + {C869BF55-B9D6-4980-BC92-60FA0CF8411A}.SDL-Debug|x64.Build.0 = Debug|x64 + {C869BF55-B9D6-4980-BC92-60FA0CF8411A}.Static lib - Debug|Win32.ActiveCfg = Debug|Win32 + {C869BF55-B9D6-4980-BC92-60FA0CF8411A}.Static lib - Debug|Win32.Build.0 = Debug|Win32 + {C869BF55-B9D6-4980-BC92-60FA0CF8411A}.Static lib - Debug|x64.ActiveCfg = Debug|x64 + {C869BF55-B9D6-4980-BC92-60FA0CF8411A}.Static lib - Debug|x64.Build.0 = Debug|x64 + {C869BF55-B9D6-4980-BC92-60FA0CF8411A}.Static lib - Release - Fast FPU|Win32.ActiveCfg = Release|Win32 + {C869BF55-B9D6-4980-BC92-60FA0CF8411A}.Static lib - Release - Fast FPU|Win32.Build.0 = Release|Win32 + {C869BF55-B9D6-4980-BC92-60FA0CF8411A}.Static lib - Release - Fast FPU|x64.ActiveCfg = Release|x64 + {C869BF55-B9D6-4980-BC92-60FA0CF8411A}.Static lib - Release - Fast FPU|x64.Build.0 = Release|x64 + {C869BF55-B9D6-4980-BC92-60FA0CF8411A}.Static lib - Release|Win32.ActiveCfg = Release|Win32 + {C869BF55-B9D6-4980-BC92-60FA0CF8411A}.Static lib - Release|Win32.Build.0 = Release|Win32 + {C869BF55-B9D6-4980-BC92-60FA0CF8411A}.Static lib - Release|x64.ActiveCfg = Release|x64 + {C869BF55-B9D6-4980-BC92-60FA0CF8411A}.Static lib - Release|x64.Build.0 = Release|x64 + {2AE24484-22FC-481B-9A40-7CD0DA5C8E06}.Debug|Win32.ActiveCfg = Debug|Win32 + {2AE24484-22FC-481B-9A40-7CD0DA5C8E06}.Debug|Win32.Build.0 = Debug|Win32 + {2AE24484-22FC-481B-9A40-7CD0DA5C8E06}.Debug|x64.ActiveCfg = Debug|x64 + {2AE24484-22FC-481B-9A40-7CD0DA5C8E06}.Debug|x64.Build.0 = Debug|x64 + {2AE24484-22FC-481B-9A40-7CD0DA5C8E06}.Release - Fast FPU|Win32.ActiveCfg = Release|Win32 + {2AE24484-22FC-481B-9A40-7CD0DA5C8E06}.Release - Fast FPU|Win32.Build.0 = Release|Win32 + {2AE24484-22FC-481B-9A40-7CD0DA5C8E06}.Release - Fast FPU|x64.ActiveCfg = Release|x64 + {2AE24484-22FC-481B-9A40-7CD0DA5C8E06}.Release - Fast FPU|x64.Build.0 = Release|x64 + {2AE24484-22FC-481B-9A40-7CD0DA5C8E06}.Release|Win32.ActiveCfg = Release|Win32 + {2AE24484-22FC-481B-9A40-7CD0DA5C8E06}.Release|Win32.Build.0 = Release|Win32 + {2AE24484-22FC-481B-9A40-7CD0DA5C8E06}.Release|x64.ActiveCfg = Release|x64 + {2AE24484-22FC-481B-9A40-7CD0DA5C8E06}.Release|x64.Build.0 = Release|x64 + {2AE24484-22FC-481B-9A40-7CD0DA5C8E06}.SDL-Debug|Win32.ActiveCfg = Debug|Win32 + {2AE24484-22FC-481B-9A40-7CD0DA5C8E06}.SDL-Debug|Win32.Build.0 = Debug|Win32 + {2AE24484-22FC-481B-9A40-7CD0DA5C8E06}.SDL-Debug|x64.ActiveCfg = Debug|x64 + {2AE24484-22FC-481B-9A40-7CD0DA5C8E06}.SDL-Debug|x64.Build.0 = Debug|x64 + {2AE24484-22FC-481B-9A40-7CD0DA5C8E06}.Static lib - Debug|Win32.ActiveCfg = Debug|Win32 + {2AE24484-22FC-481B-9A40-7CD0DA5C8E06}.Static lib - Debug|Win32.Build.0 = Debug|Win32 + {2AE24484-22FC-481B-9A40-7CD0DA5C8E06}.Static lib - Debug|x64.ActiveCfg = Debug|x64 + {2AE24484-22FC-481B-9A40-7CD0DA5C8E06}.Static lib - Debug|x64.Build.0 = Debug|x64 + {2AE24484-22FC-481B-9A40-7CD0DA5C8E06}.Static lib - Release - Fast FPU|Win32.ActiveCfg = Release|Win32 + {2AE24484-22FC-481B-9A40-7CD0DA5C8E06}.Static lib - Release - Fast FPU|Win32.Build.0 = Release|Win32 + {2AE24484-22FC-481B-9A40-7CD0DA5C8E06}.Static lib - Release - Fast FPU|x64.ActiveCfg = Release|x64 + {2AE24484-22FC-481B-9A40-7CD0DA5C8E06}.Static lib - Release - Fast FPU|x64.Build.0 = Release|x64 + {2AE24484-22FC-481B-9A40-7CD0DA5C8E06}.Static lib - Release|Win32.ActiveCfg = Release|Win32 + {2AE24484-22FC-481B-9A40-7CD0DA5C8E06}.Static lib - Release|Win32.Build.0 = Release|Win32 + {2AE24484-22FC-481B-9A40-7CD0DA5C8E06}.Static lib - Release|x64.ActiveCfg = Release|x64 + {2AE24484-22FC-481B-9A40-7CD0DA5C8E06}.Static lib - Release|x64.Build.0 = Release|x64 + {27158C82-CD15-4A9B-9848-35E7065B209F}.Debug|Win32.ActiveCfg = Debug|Win32 + {27158C82-CD15-4A9B-9848-35E7065B209F}.Debug|Win32.Build.0 = Debug|Win32 + {27158C82-CD15-4A9B-9848-35E7065B209F}.Debug|x64.ActiveCfg = Debug|x64 + {27158C82-CD15-4A9B-9848-35E7065B209F}.Debug|x64.Build.0 = Debug|x64 + {27158C82-CD15-4A9B-9848-35E7065B209F}.Release - Fast FPU|Win32.ActiveCfg = Release|Win32 + {27158C82-CD15-4A9B-9848-35E7065B209F}.Release - Fast FPU|Win32.Build.0 = Release|Win32 + {27158C82-CD15-4A9B-9848-35E7065B209F}.Release - Fast FPU|x64.ActiveCfg = Release|x64 + {27158C82-CD15-4A9B-9848-35E7065B209F}.Release - Fast FPU|x64.Build.0 = Release|x64 + {27158C82-CD15-4A9B-9848-35E7065B209F}.Release|Win32.ActiveCfg = Release|Win32 + {27158C82-CD15-4A9B-9848-35E7065B209F}.Release|Win32.Build.0 = Release|Win32 + {27158C82-CD15-4A9B-9848-35E7065B209F}.Release|x64.ActiveCfg = Release|x64 + {27158C82-CD15-4A9B-9848-35E7065B209F}.Release|x64.Build.0 = Release|x64 + {27158C82-CD15-4A9B-9848-35E7065B209F}.SDL-Debug|Win32.ActiveCfg = Debug|Win32 + {27158C82-CD15-4A9B-9848-35E7065B209F}.SDL-Debug|Win32.Build.0 = Debug|Win32 + {27158C82-CD15-4A9B-9848-35E7065B209F}.SDL-Debug|x64.ActiveCfg = Debug|x64 + {27158C82-CD15-4A9B-9848-35E7065B209F}.SDL-Debug|x64.Build.0 = Debug|x64 + {27158C82-CD15-4A9B-9848-35E7065B209F}.Static lib - Debug|Win32.ActiveCfg = Debug|Win32 + {27158C82-CD15-4A9B-9848-35E7065B209F}.Static lib - Debug|Win32.Build.0 = Debug|Win32 + {27158C82-CD15-4A9B-9848-35E7065B209F}.Static lib - Debug|x64.ActiveCfg = Debug|x64 + {27158C82-CD15-4A9B-9848-35E7065B209F}.Static lib - Debug|x64.Build.0 = Debug|x64 + {27158C82-CD15-4A9B-9848-35E7065B209F}.Static lib - Release - Fast FPU|Win32.ActiveCfg = Release|Win32 + {27158C82-CD15-4A9B-9848-35E7065B209F}.Static lib - Release - Fast FPU|Win32.Build.0 = Release|Win32 + {27158C82-CD15-4A9B-9848-35E7065B209F}.Static lib - Release - Fast FPU|x64.ActiveCfg = Release|x64 + {27158C82-CD15-4A9B-9848-35E7065B209F}.Static lib - Release - Fast FPU|x64.Build.0 = Release|x64 + {27158C82-CD15-4A9B-9848-35E7065B209F}.Static lib - Release|Win32.ActiveCfg = Release|Win32 + {27158C82-CD15-4A9B-9848-35E7065B209F}.Static lib - Release|Win32.Build.0 = Release|Win32 + {27158C82-CD15-4A9B-9848-35E7065B209F}.Static lib - Release|x64.ActiveCfg = Release|x64 + {27158C82-CD15-4A9B-9848-35E7065B209F}.Static lib - Release|x64.Build.0 = Release|x64 + {C4B42409-542D-4EFC-9E6B-44713FD47A33}.Debug|Win32.ActiveCfg = Debug|Win32 + {C4B42409-542D-4EFC-9E6B-44713FD47A33}.Debug|Win32.Build.0 = Debug|Win32 + {C4B42409-542D-4EFC-9E6B-44713FD47A33}.Debug|x64.ActiveCfg = Debug|x64 + {C4B42409-542D-4EFC-9E6B-44713FD47A33}.Debug|x64.Build.0 = Debug|x64 + {C4B42409-542D-4EFC-9E6B-44713FD47A33}.Release - Fast FPU|Win32.ActiveCfg = Release|Win32 + {C4B42409-542D-4EFC-9E6B-44713FD47A33}.Release - Fast FPU|Win32.Build.0 = Release|Win32 + {C4B42409-542D-4EFC-9E6B-44713FD47A33}.Release - Fast FPU|x64.ActiveCfg = Release|x64 + {C4B42409-542D-4EFC-9E6B-44713FD47A33}.Release - Fast FPU|x64.Build.0 = Release|x64 + {C4B42409-542D-4EFC-9E6B-44713FD47A33}.Release|Win32.ActiveCfg = Release|Win32 + {C4B42409-542D-4EFC-9E6B-44713FD47A33}.Release|Win32.Build.0 = Release|Win32 + {C4B42409-542D-4EFC-9E6B-44713FD47A33}.Release|x64.ActiveCfg = Release|x64 + {C4B42409-542D-4EFC-9E6B-44713FD47A33}.Release|x64.Build.0 = Release|x64 + {C4B42409-542D-4EFC-9E6B-44713FD47A33}.SDL-Debug|Win32.ActiveCfg = Debug|Win32 + {C4B42409-542D-4EFC-9E6B-44713FD47A33}.SDL-Debug|Win32.Build.0 = Debug|Win32 + {C4B42409-542D-4EFC-9E6B-44713FD47A33}.SDL-Debug|x64.ActiveCfg = Debug|x64 + {C4B42409-542D-4EFC-9E6B-44713FD47A33}.SDL-Debug|x64.Build.0 = Debug|x64 + {C4B42409-542D-4EFC-9E6B-44713FD47A33}.Static lib - Debug|Win32.ActiveCfg = Debug|Win32 + {C4B42409-542D-4EFC-9E6B-44713FD47A33}.Static lib - Debug|Win32.Build.0 = Debug|Win32 + {C4B42409-542D-4EFC-9E6B-44713FD47A33}.Static lib - Debug|x64.ActiveCfg = Debug|x64 + {C4B42409-542D-4EFC-9E6B-44713FD47A33}.Static lib - Debug|x64.Build.0 = Debug|x64 + {C4B42409-542D-4EFC-9E6B-44713FD47A33}.Static lib - Release - Fast FPU|Win32.ActiveCfg = Release|Win32 + {C4B42409-542D-4EFC-9E6B-44713FD47A33}.Static lib - Release - Fast FPU|Win32.Build.0 = Release|Win32 + {C4B42409-542D-4EFC-9E6B-44713FD47A33}.Static lib - Release - Fast FPU|x64.ActiveCfg = Release|x64 + {C4B42409-542D-4EFC-9E6B-44713FD47A33}.Static lib - Release - Fast FPU|x64.Build.0 = Release|x64 + {C4B42409-542D-4EFC-9E6B-44713FD47A33}.Static lib - Release|Win32.ActiveCfg = Release|Win32 + {C4B42409-542D-4EFC-9E6B-44713FD47A33}.Static lib - Release|Win32.Build.0 = Release|Win32 + {C4B42409-542D-4EFC-9E6B-44713FD47A33}.Static lib - Release|x64.ActiveCfg = Release|x64 + {C4B42409-542D-4EFC-9E6B-44713FD47A33}.Static lib - Release|x64.Build.0 = Release|x64 + {3A5B74E5-6390-43B0-A459-2793B81FFD31}.Debug|Win32.ActiveCfg = Debug|Win32 + {3A5B74E5-6390-43B0-A459-2793B81FFD31}.Debug|Win32.Build.0 = Debug|Win32 + {3A5B74E5-6390-43B0-A459-2793B81FFD31}.Debug|x64.ActiveCfg = Debug|x64 + {3A5B74E5-6390-43B0-A459-2793B81FFD31}.Debug|x64.Build.0 = Debug|x64 + {3A5B74E5-6390-43B0-A459-2793B81FFD31}.Release - Fast FPU|Win32.ActiveCfg = Release|Win32 + {3A5B74E5-6390-43B0-A459-2793B81FFD31}.Release - Fast FPU|Win32.Build.0 = Release|Win32 + {3A5B74E5-6390-43B0-A459-2793B81FFD31}.Release - Fast FPU|x64.ActiveCfg = Release|x64 + {3A5B74E5-6390-43B0-A459-2793B81FFD31}.Release - Fast FPU|x64.Build.0 = Release|x64 + {3A5B74E5-6390-43B0-A459-2793B81FFD31}.Release|Win32.ActiveCfg = Release|Win32 + {3A5B74E5-6390-43B0-A459-2793B81FFD31}.Release|Win32.Build.0 = Release|Win32 + {3A5B74E5-6390-43B0-A459-2793B81FFD31}.Release|x64.ActiveCfg = Release|x64 + {3A5B74E5-6390-43B0-A459-2793B81FFD31}.Release|x64.Build.0 = Release|x64 + {3A5B74E5-6390-43B0-A459-2793B81FFD31}.SDL-Debug|Win32.ActiveCfg = Debug|Win32 + {3A5B74E5-6390-43B0-A459-2793B81FFD31}.SDL-Debug|Win32.Build.0 = Debug|Win32 + {3A5B74E5-6390-43B0-A459-2793B81FFD31}.SDL-Debug|x64.ActiveCfg = Debug|x64 + {3A5B74E5-6390-43B0-A459-2793B81FFD31}.SDL-Debug|x64.Build.0 = Debug|x64 + {3A5B74E5-6390-43B0-A459-2793B81FFD31}.Static lib - Debug|Win32.ActiveCfg = Debug|Win32 + {3A5B74E5-6390-43B0-A459-2793B81FFD31}.Static lib - Debug|Win32.Build.0 = Debug|Win32 + {3A5B74E5-6390-43B0-A459-2793B81FFD31}.Static lib - Debug|x64.ActiveCfg = Debug|x64 + {3A5B74E5-6390-43B0-A459-2793B81FFD31}.Static lib - Debug|x64.Build.0 = Debug|x64 + {3A5B74E5-6390-43B0-A459-2793B81FFD31}.Static lib - Release - Fast FPU|Win32.ActiveCfg = Release|Win32 + {3A5B74E5-6390-43B0-A459-2793B81FFD31}.Static lib - Release - Fast FPU|Win32.Build.0 = Release|Win32 + {3A5B74E5-6390-43B0-A459-2793B81FFD31}.Static lib - Release - Fast FPU|x64.ActiveCfg = Release|x64 + {3A5B74E5-6390-43B0-A459-2793B81FFD31}.Static lib - Release - Fast FPU|x64.Build.0 = Release|x64 + {3A5B74E5-6390-43B0-A459-2793B81FFD31}.Static lib - Release|Win32.ActiveCfg = Release|Win32 + {3A5B74E5-6390-43B0-A459-2793B81FFD31}.Static lib - Release|Win32.Build.0 = Release|Win32 + {3A5B74E5-6390-43B0-A459-2793B81FFD31}.Static lib - Release|x64.ActiveCfg = Release|x64 + {3A5B74E5-6390-43B0-A459-2793B81FFD31}.Static lib - Release|x64.Build.0 = Release|x64 + {0914E5C8-5352-467B-8421-C9EB35BD5596}.Debug|Win32.ActiveCfg = Debug|Win32 + {0914E5C8-5352-467B-8421-C9EB35BD5596}.Debug|Win32.Build.0 = Debug|Win32 + {0914E5C8-5352-467B-8421-C9EB35BD5596}.Debug|x64.ActiveCfg = Debug|x64 + {0914E5C8-5352-467B-8421-C9EB35BD5596}.Debug|x64.Build.0 = Debug|x64 + {0914E5C8-5352-467B-8421-C9EB35BD5596}.Release - Fast FPU|Win32.ActiveCfg = Release|Win32 + {0914E5C8-5352-467B-8421-C9EB35BD5596}.Release - Fast FPU|Win32.Build.0 = Release|Win32 + {0914E5C8-5352-467B-8421-C9EB35BD5596}.Release - Fast FPU|x64.ActiveCfg = Release|x64 + {0914E5C8-5352-467B-8421-C9EB35BD5596}.Release - Fast FPU|x64.Build.0 = Release|x64 + {0914E5C8-5352-467B-8421-C9EB35BD5596}.Release|Win32.ActiveCfg = Release|Win32 + {0914E5C8-5352-467B-8421-C9EB35BD5596}.Release|Win32.Build.0 = Release|Win32 + {0914E5C8-5352-467B-8421-C9EB35BD5596}.Release|x64.ActiveCfg = Release|x64 + {0914E5C8-5352-467B-8421-C9EB35BD5596}.Release|x64.Build.0 = Release|x64 + {0914E5C8-5352-467B-8421-C9EB35BD5596}.SDL-Debug|Win32.ActiveCfg = Debug|Win32 + {0914E5C8-5352-467B-8421-C9EB35BD5596}.SDL-Debug|Win32.Build.0 = Debug|Win32 + {0914E5C8-5352-467B-8421-C9EB35BD5596}.SDL-Debug|x64.ActiveCfg = Debug|x64 + {0914E5C8-5352-467B-8421-C9EB35BD5596}.SDL-Debug|x64.Build.0 = Debug|x64 + {0914E5C8-5352-467B-8421-C9EB35BD5596}.Static lib - Debug|Win32.ActiveCfg = Debug|Win32 + {0914E5C8-5352-467B-8421-C9EB35BD5596}.Static lib - Debug|Win32.Build.0 = Debug|Win32 + {0914E5C8-5352-467B-8421-C9EB35BD5596}.Static lib - Debug|x64.ActiveCfg = Debug|x64 + {0914E5C8-5352-467B-8421-C9EB35BD5596}.Static lib - Debug|x64.Build.0 = Debug|x64 + {0914E5C8-5352-467B-8421-C9EB35BD5596}.Static lib - Release - Fast FPU|Win32.ActiveCfg = Release|Win32 + {0914E5C8-5352-467B-8421-C9EB35BD5596}.Static lib - Release - Fast FPU|Win32.Build.0 = Release|Win32 + {0914E5C8-5352-467B-8421-C9EB35BD5596}.Static lib - Release - Fast FPU|x64.ActiveCfg = Release|x64 + {0914E5C8-5352-467B-8421-C9EB35BD5596}.Static lib - Release - Fast FPU|x64.Build.0 = Release|x64 + {0914E5C8-5352-467B-8421-C9EB35BD5596}.Static lib - Release|Win32.ActiveCfg = Release|Win32 + {0914E5C8-5352-467B-8421-C9EB35BD5596}.Static lib - Release|Win32.Build.0 = Release|Win32 + {0914E5C8-5352-467B-8421-C9EB35BD5596}.Static lib - Release|x64.ActiveCfg = Release|x64 + {0914E5C8-5352-467B-8421-C9EB35BD5596}.Static lib - Release|x64.Build.0 = Release|x64 + {772FBE05-D05A-467B-9842-BEC409EEA8D0}.Debug|Win32.ActiveCfg = Debug|Win32 + {772FBE05-D05A-467B-9842-BEC409EEA8D0}.Debug|Win32.Build.0 = Debug|Win32 + {772FBE05-D05A-467B-9842-BEC409EEA8D0}.Debug|x64.ActiveCfg = Debug|x64 + {772FBE05-D05A-467B-9842-BEC409EEA8D0}.Debug|x64.Build.0 = Debug|x64 + {772FBE05-D05A-467B-9842-BEC409EEA8D0}.Release - Fast FPU|Win32.ActiveCfg = Release|Win32 + {772FBE05-D05A-467B-9842-BEC409EEA8D0}.Release - Fast FPU|Win32.Build.0 = Release|Win32 + {772FBE05-D05A-467B-9842-BEC409EEA8D0}.Release - Fast FPU|x64.ActiveCfg = Release|x64 + {772FBE05-D05A-467B-9842-BEC409EEA8D0}.Release - Fast FPU|x64.Build.0 = Release|x64 + {772FBE05-D05A-467B-9842-BEC409EEA8D0}.Release|Win32.ActiveCfg = Release|Win32 + {772FBE05-D05A-467B-9842-BEC409EEA8D0}.Release|Win32.Build.0 = Release|Win32 + {772FBE05-D05A-467B-9842-BEC409EEA8D0}.Release|x64.ActiveCfg = Release|x64 + {772FBE05-D05A-467B-9842-BEC409EEA8D0}.Release|x64.Build.0 = Release|x64 + {772FBE05-D05A-467B-9842-BEC409EEA8D0}.SDL-Debug|Win32.ActiveCfg = Debug|Win32 + {772FBE05-D05A-467B-9842-BEC409EEA8D0}.SDL-Debug|Win32.Build.0 = Debug|Win32 + {772FBE05-D05A-467B-9842-BEC409EEA8D0}.SDL-Debug|x64.ActiveCfg = Debug|x64 + {772FBE05-D05A-467B-9842-BEC409EEA8D0}.SDL-Debug|x64.Build.0 = Debug|x64 + {772FBE05-D05A-467B-9842-BEC409EEA8D0}.Static lib - Debug|Win32.ActiveCfg = Debug|Win32 + {772FBE05-D05A-467B-9842-BEC409EEA8D0}.Static lib - Debug|Win32.Build.0 = Debug|Win32 + {772FBE05-D05A-467B-9842-BEC409EEA8D0}.Static lib - Debug|x64.ActiveCfg = Debug|x64 + {772FBE05-D05A-467B-9842-BEC409EEA8D0}.Static lib - Debug|x64.Build.0 = Debug|x64 + {772FBE05-D05A-467B-9842-BEC409EEA8D0}.Static lib - Release - Fast FPU|Win32.ActiveCfg = Release|Win32 + {772FBE05-D05A-467B-9842-BEC409EEA8D0}.Static lib - Release - Fast FPU|Win32.Build.0 = Release|Win32 + {772FBE05-D05A-467B-9842-BEC409EEA8D0}.Static lib - Release - Fast FPU|x64.ActiveCfg = Release|x64 + {772FBE05-D05A-467B-9842-BEC409EEA8D0}.Static lib - Release - Fast FPU|x64.Build.0 = Release|x64 + {772FBE05-D05A-467B-9842-BEC409EEA8D0}.Static lib - Release|Win32.ActiveCfg = Release|Win32 + {772FBE05-D05A-467B-9842-BEC409EEA8D0}.Static lib - Release|Win32.Build.0 = Release|Win32 + {772FBE05-D05A-467B-9842-BEC409EEA8D0}.Static lib - Release|x64.ActiveCfg = Release|x64 + {772FBE05-D05A-467B-9842-BEC409EEA8D0}.Static lib - Release|x64.Build.0 = Release|x64 + {78C9F424-523C-49AC-94B7-823AA4A26BF9}.Debug|Win32.ActiveCfg = Debug|Win32 + {78C9F424-523C-49AC-94B7-823AA4A26BF9}.Debug|Win32.Build.0 = Debug|Win32 + {78C9F424-523C-49AC-94B7-823AA4A26BF9}.Debug|x64.ActiveCfg = Debug|x64 + {78C9F424-523C-49AC-94B7-823AA4A26BF9}.Debug|x64.Build.0 = Debug|x64 + {78C9F424-523C-49AC-94B7-823AA4A26BF9}.Release - Fast FPU|Win32.ActiveCfg = Release|Win32 + {78C9F424-523C-49AC-94B7-823AA4A26BF9}.Release - Fast FPU|Win32.Build.0 = Release|Win32 + {78C9F424-523C-49AC-94B7-823AA4A26BF9}.Release - Fast FPU|x64.ActiveCfg = Release|x64 + {78C9F424-523C-49AC-94B7-823AA4A26BF9}.Release - Fast FPU|x64.Build.0 = Release|x64 + {78C9F424-523C-49AC-94B7-823AA4A26BF9}.Release|Win32.ActiveCfg = Release|Win32 + {78C9F424-523C-49AC-94B7-823AA4A26BF9}.Release|Win32.Build.0 = Release|Win32 + {78C9F424-523C-49AC-94B7-823AA4A26BF9}.Release|x64.ActiveCfg = Release|x64 + {78C9F424-523C-49AC-94B7-823AA4A26BF9}.Release|x64.Build.0 = Release|x64 + {78C9F424-523C-49AC-94B7-823AA4A26BF9}.SDL-Debug|Win32.ActiveCfg = Debug|Win32 + {78C9F424-523C-49AC-94B7-823AA4A26BF9}.SDL-Debug|Win32.Build.0 = Debug|Win32 + {78C9F424-523C-49AC-94B7-823AA4A26BF9}.SDL-Debug|x64.ActiveCfg = Debug|x64 + {78C9F424-523C-49AC-94B7-823AA4A26BF9}.SDL-Debug|x64.Build.0 = Debug|x64 + {78C9F424-523C-49AC-94B7-823AA4A26BF9}.Static lib - Debug|Win32.ActiveCfg = Debug|Win32 + {78C9F424-523C-49AC-94B7-823AA4A26BF9}.Static lib - Debug|Win32.Build.0 = Debug|Win32 + {78C9F424-523C-49AC-94B7-823AA4A26BF9}.Static lib - Debug|x64.ActiveCfg = Debug|x64 + {78C9F424-523C-49AC-94B7-823AA4A26BF9}.Static lib - Debug|x64.Build.0 = Debug|x64 + {78C9F424-523C-49AC-94B7-823AA4A26BF9}.Static lib - Release - Fast FPU|Win32.ActiveCfg = Release|Win32 + {78C9F424-523C-49AC-94B7-823AA4A26BF9}.Static lib - Release - Fast FPU|Win32.Build.0 = Release|Win32 + {78C9F424-523C-49AC-94B7-823AA4A26BF9}.Static lib - Release - Fast FPU|x64.ActiveCfg = Release|x64 + {78C9F424-523C-49AC-94B7-823AA4A26BF9}.Static lib - Release - Fast FPU|x64.Build.0 = Release|x64 + {78C9F424-523C-49AC-94B7-823AA4A26BF9}.Static lib - Release|Win32.ActiveCfg = Release|Win32 + {78C9F424-523C-49AC-94B7-823AA4A26BF9}.Static lib - Release|Win32.Build.0 = Release|Win32 + {78C9F424-523C-49AC-94B7-823AA4A26BF9}.Static lib - Release|x64.ActiveCfg = Release|x64 + {78C9F424-523C-49AC-94B7-823AA4A26BF9}.Static lib - Release|x64.Build.0 = Release|x64 + {EB3B38EA-5CE7-4983-845B-880661E69D09}.Debug|Win32.ActiveCfg = Debug|Win32 + {EB3B38EA-5CE7-4983-845B-880661E69D09}.Debug|Win32.Build.0 = Debug|Win32 + {EB3B38EA-5CE7-4983-845B-880661E69D09}.Debug|x64.ActiveCfg = Debug|x64 + {EB3B38EA-5CE7-4983-845B-880661E69D09}.Debug|x64.Build.0 = Debug|x64 + {EB3B38EA-5CE7-4983-845B-880661E69D09}.Release - Fast FPU|Win32.ActiveCfg = Release|Win32 + {EB3B38EA-5CE7-4983-845B-880661E69D09}.Release - Fast FPU|Win32.Build.0 = Release|Win32 + {EB3B38EA-5CE7-4983-845B-880661E69D09}.Release - Fast FPU|x64.ActiveCfg = Release|x64 + {EB3B38EA-5CE7-4983-845B-880661E69D09}.Release - Fast FPU|x64.Build.0 = Release|x64 + {EB3B38EA-5CE7-4983-845B-880661E69D09}.Release|Win32.ActiveCfg = Release|Win32 + {EB3B38EA-5CE7-4983-845B-880661E69D09}.Release|Win32.Build.0 = Release|Win32 + {EB3B38EA-5CE7-4983-845B-880661E69D09}.Release|x64.ActiveCfg = Release|x64 + {EB3B38EA-5CE7-4983-845B-880661E69D09}.Release|x64.Build.0 = Release|x64 + {EB3B38EA-5CE7-4983-845B-880661E69D09}.SDL-Debug|Win32.ActiveCfg = Debug|Win32 + {EB3B38EA-5CE7-4983-845B-880661E69D09}.SDL-Debug|Win32.Build.0 = Debug|Win32 + {EB3B38EA-5CE7-4983-845B-880661E69D09}.SDL-Debug|x64.ActiveCfg = Debug|x64 + {EB3B38EA-5CE7-4983-845B-880661E69D09}.SDL-Debug|x64.Build.0 = Debug|x64 + {EB3B38EA-5CE7-4983-845B-880661E69D09}.Static lib - Debug|Win32.ActiveCfg = Debug|Win32 + {EB3B38EA-5CE7-4983-845B-880661E69D09}.Static lib - Debug|Win32.Build.0 = Debug|Win32 + {EB3B38EA-5CE7-4983-845B-880661E69D09}.Static lib - Debug|x64.ActiveCfg = Debug|x64 + {EB3B38EA-5CE7-4983-845B-880661E69D09}.Static lib - Debug|x64.Build.0 = Debug|x64 + {EB3B38EA-5CE7-4983-845B-880661E69D09}.Static lib - Release - Fast FPU|Win32.ActiveCfg = Release|Win32 + {EB3B38EA-5CE7-4983-845B-880661E69D09}.Static lib - Release - Fast FPU|Win32.Build.0 = Release|Win32 + {EB3B38EA-5CE7-4983-845B-880661E69D09}.Static lib - Release - Fast FPU|x64.ActiveCfg = Release|x64 + {EB3B38EA-5CE7-4983-845B-880661E69D09}.Static lib - Release - Fast FPU|x64.Build.0 = Release|x64 + {EB3B38EA-5CE7-4983-845B-880661E69D09}.Static lib - Release|Win32.ActiveCfg = Release|Win32 + {EB3B38EA-5CE7-4983-845B-880661E69D09}.Static lib - Release|Win32.Build.0 = Release|Win32 + {EB3B38EA-5CE7-4983-845B-880661E69D09}.Static lib - Release|x64.ActiveCfg = Release|x64 + {EB3B38EA-5CE7-4983-845B-880661E69D09}.Static lib - Release|x64.Build.0 = Release|x64 + {1AB9413E-4F53-42A3-8CB2-CB4BE22336D0}.Debug|Win32.ActiveCfg = Debug|Win32 + {1AB9413E-4F53-42A3-8CB2-CB4BE22336D0}.Debug|Win32.Build.0 = Debug|Win32 + {1AB9413E-4F53-42A3-8CB2-CB4BE22336D0}.Debug|x64.ActiveCfg = Debug|x64 + {1AB9413E-4F53-42A3-8CB2-CB4BE22336D0}.Debug|x64.Build.0 = Debug|x64 + {1AB9413E-4F53-42A3-8CB2-CB4BE22336D0}.Release - Fast FPU|Win32.ActiveCfg = Release|Win32 + {1AB9413E-4F53-42A3-8CB2-CB4BE22336D0}.Release - Fast FPU|Win32.Build.0 = Release|Win32 + {1AB9413E-4F53-42A3-8CB2-CB4BE22336D0}.Release - Fast FPU|x64.ActiveCfg = Release|x64 + {1AB9413E-4F53-42A3-8CB2-CB4BE22336D0}.Release - Fast FPU|x64.Build.0 = Release|x64 + {1AB9413E-4F53-42A3-8CB2-CB4BE22336D0}.Release|Win32.ActiveCfg = Release|Win32 + {1AB9413E-4F53-42A3-8CB2-CB4BE22336D0}.Release|Win32.Build.0 = Release|Win32 + {1AB9413E-4F53-42A3-8CB2-CB4BE22336D0}.Release|x64.ActiveCfg = Release|x64 + {1AB9413E-4F53-42A3-8CB2-CB4BE22336D0}.Release|x64.Build.0 = Release|x64 + {1AB9413E-4F53-42A3-8CB2-CB4BE22336D0}.SDL-Debug|Win32.ActiveCfg = Debug|Win32 + {1AB9413E-4F53-42A3-8CB2-CB4BE22336D0}.SDL-Debug|Win32.Build.0 = Debug|Win32 + {1AB9413E-4F53-42A3-8CB2-CB4BE22336D0}.SDL-Debug|x64.ActiveCfg = Debug|x64 + {1AB9413E-4F53-42A3-8CB2-CB4BE22336D0}.SDL-Debug|x64.Build.0 = Debug|x64 + {1AB9413E-4F53-42A3-8CB2-CB4BE22336D0}.Static lib - Debug|Win32.ActiveCfg = Debug|Win32 + {1AB9413E-4F53-42A3-8CB2-CB4BE22336D0}.Static lib - Debug|Win32.Build.0 = Debug|Win32 + {1AB9413E-4F53-42A3-8CB2-CB4BE22336D0}.Static lib - Debug|x64.ActiveCfg = Debug|x64 + {1AB9413E-4F53-42A3-8CB2-CB4BE22336D0}.Static lib - Debug|x64.Build.0 = Debug|x64 + {1AB9413E-4F53-42A3-8CB2-CB4BE22336D0}.Static lib - Release - Fast FPU|Win32.ActiveCfg = Release|Win32 + {1AB9413E-4F53-42A3-8CB2-CB4BE22336D0}.Static lib - Release - Fast FPU|Win32.Build.0 = Release|Win32 + {1AB9413E-4F53-42A3-8CB2-CB4BE22336D0}.Static lib - Release - Fast FPU|x64.ActiveCfg = Release|x64 + {1AB9413E-4F53-42A3-8CB2-CB4BE22336D0}.Static lib - Release - Fast FPU|x64.Build.0 = Release|x64 + {1AB9413E-4F53-42A3-8CB2-CB4BE22336D0}.Static lib - Release|Win32.ActiveCfg = Release|Win32 + {1AB9413E-4F53-42A3-8CB2-CB4BE22336D0}.Static lib - Release|Win32.Build.0 = Release|Win32 + {1AB9413E-4F53-42A3-8CB2-CB4BE22336D0}.Static lib - Release|x64.ActiveCfg = Release|x64 + {1AB9413E-4F53-42A3-8CB2-CB4BE22336D0}.Static lib - Release|x64.Build.0 = Release|x64 + {FE853A36-E0D1-4AC5-A792-B643E70D2953}.Debug|Win32.ActiveCfg = Debug|Win32 + {FE853A36-E0D1-4AC5-A792-B643E70D2953}.Debug|Win32.Build.0 = Debug|Win32 + {FE853A36-E0D1-4AC5-A792-B643E70D2953}.Debug|x64.ActiveCfg = Debug|x64 + {FE853A36-E0D1-4AC5-A792-B643E70D2953}.Debug|x64.Build.0 = Debug|x64 + {FE853A36-E0D1-4AC5-A792-B643E70D2953}.Release - Fast FPU|Win32.ActiveCfg = Release|Win32 + {FE853A36-E0D1-4AC5-A792-B643E70D2953}.Release - Fast FPU|Win32.Build.0 = Release|Win32 + {FE853A36-E0D1-4AC5-A792-B643E70D2953}.Release - Fast FPU|x64.ActiveCfg = Release|x64 + {FE853A36-E0D1-4AC5-A792-B643E70D2953}.Release - Fast FPU|x64.Build.0 = Release|x64 + {FE853A36-E0D1-4AC5-A792-B643E70D2953}.Release|Win32.ActiveCfg = Release|Win32 + {FE853A36-E0D1-4AC5-A792-B643E70D2953}.Release|Win32.Build.0 = Release|Win32 + {FE853A36-E0D1-4AC5-A792-B643E70D2953}.Release|x64.ActiveCfg = Release|x64 + {FE853A36-E0D1-4AC5-A792-B643E70D2953}.Release|x64.Build.0 = Release|x64 + {FE853A36-E0D1-4AC5-A792-B643E70D2953}.SDL-Debug|Win32.ActiveCfg = Debug|Win32 + {FE853A36-E0D1-4AC5-A792-B643E70D2953}.SDL-Debug|Win32.Build.0 = Debug|Win32 + {FE853A36-E0D1-4AC5-A792-B643E70D2953}.SDL-Debug|x64.ActiveCfg = Debug|x64 + {FE853A36-E0D1-4AC5-A792-B643E70D2953}.SDL-Debug|x64.Build.0 = Debug|x64 + {FE853A36-E0D1-4AC5-A792-B643E70D2953}.Static lib - Debug|Win32.ActiveCfg = Debug|Win32 + {FE853A36-E0D1-4AC5-A792-B643E70D2953}.Static lib - Debug|Win32.Build.0 = Debug|Win32 + {FE853A36-E0D1-4AC5-A792-B643E70D2953}.Static lib - Debug|x64.ActiveCfg = Debug|x64 + {FE853A36-E0D1-4AC5-A792-B643E70D2953}.Static lib - Debug|x64.Build.0 = Debug|x64 + {FE853A36-E0D1-4AC5-A792-B643E70D2953}.Static lib - Release - Fast FPU|Win32.ActiveCfg = Release|Win32 + {FE853A36-E0D1-4AC5-A792-B643E70D2953}.Static lib - Release - Fast FPU|Win32.Build.0 = Release|Win32 + {FE853A36-E0D1-4AC5-A792-B643E70D2953}.Static lib - Release - Fast FPU|x64.ActiveCfg = Release|x64 + {FE853A36-E0D1-4AC5-A792-B643E70D2953}.Static lib - Release - Fast FPU|x64.Build.0 = Release|x64 + {FE853A36-E0D1-4AC5-A792-B643E70D2953}.Static lib - Release|Win32.ActiveCfg = Release|Win32 + {FE853A36-E0D1-4AC5-A792-B643E70D2953}.Static lib - Release|Win32.Build.0 = Release|Win32 + {FE853A36-E0D1-4AC5-A792-B643E70D2953}.Static lib - Release|x64.ActiveCfg = Release|x64 + {FE853A36-E0D1-4AC5-A792-B643E70D2953}.Static lib - Release|x64.Build.0 = Release|x64 + {16007FE2-142B-47F8-93E1-519BA3F39E71}.Debug|Win32.ActiveCfg = Debug|Win32 + {16007FE2-142B-47F8-93E1-519BA3F39E71}.Debug|Win32.Build.0 = Debug|Win32 + {16007FE2-142B-47F8-93E1-519BA3F39E71}.Debug|x64.ActiveCfg = Debug|x64 + {16007FE2-142B-47F8-93E1-519BA3F39E71}.Debug|x64.Build.0 = Debug|x64 + {16007FE2-142B-47F8-93E1-519BA3F39E71}.Release - Fast FPU|Win32.ActiveCfg = Release|Win32 + {16007FE2-142B-47F8-93E1-519BA3F39E71}.Release - Fast FPU|Win32.Build.0 = Release|Win32 + {16007FE2-142B-47F8-93E1-519BA3F39E71}.Release - Fast FPU|x64.ActiveCfg = Release|x64 + {16007FE2-142B-47F8-93E1-519BA3F39E71}.Release - Fast FPU|x64.Build.0 = Release|x64 + {16007FE2-142B-47F8-93E1-519BA3F39E71}.Release|Win32.ActiveCfg = Release|Win32 + {16007FE2-142B-47F8-93E1-519BA3F39E71}.Release|Win32.Build.0 = Release|Win32 + {16007FE2-142B-47F8-93E1-519BA3F39E71}.Release|x64.ActiveCfg = Release|x64 + {16007FE2-142B-47F8-93E1-519BA3F39E71}.Release|x64.Build.0 = Release|x64 + {16007FE2-142B-47F8-93E1-519BA3F39E71}.SDL-Debug|Win32.ActiveCfg = Debug|Win32 + {16007FE2-142B-47F8-93E1-519BA3F39E71}.SDL-Debug|Win32.Build.0 = Debug|Win32 + {16007FE2-142B-47F8-93E1-519BA3F39E71}.SDL-Debug|x64.ActiveCfg = Debug|x64 + {16007FE2-142B-47F8-93E1-519BA3F39E71}.SDL-Debug|x64.Build.0 = Debug|x64 + {16007FE2-142B-47F8-93E1-519BA3F39E71}.Static lib - Debug|Win32.ActiveCfg = Debug|Win32 + {16007FE2-142B-47F8-93E1-519BA3F39E71}.Static lib - Debug|Win32.Build.0 = Debug|Win32 + {16007FE2-142B-47F8-93E1-519BA3F39E71}.Static lib - Debug|x64.ActiveCfg = Debug|x64 + {16007FE2-142B-47F8-93E1-519BA3F39E71}.Static lib - Debug|x64.Build.0 = Debug|x64 + {16007FE2-142B-47F8-93E1-519BA3F39E71}.Static lib - Release - Fast FPU|Win32.ActiveCfg = Release|Win32 + {16007FE2-142B-47F8-93E1-519BA3F39E71}.Static lib - Release - Fast FPU|Win32.Build.0 = Release|Win32 + {16007FE2-142B-47F8-93E1-519BA3F39E71}.Static lib - Release - Fast FPU|x64.ActiveCfg = Release|x64 + {16007FE2-142B-47F8-93E1-519BA3F39E71}.Static lib - Release - Fast FPU|x64.Build.0 = Release|x64 + {16007FE2-142B-47F8-93E1-519BA3F39E71}.Static lib - Release|Win32.ActiveCfg = Release|Win32 + {16007FE2-142B-47F8-93E1-519BA3F39E71}.Static lib - Release|Win32.Build.0 = Release|Win32 + {16007FE2-142B-47F8-93E1-519BA3F39E71}.Static lib - Release|x64.ActiveCfg = Release|x64 + {16007FE2-142B-47F8-93E1-519BA3F39E71}.Static lib - Release|x64.Build.0 = Release|x64 + {CDC4AAA9-72E1-4FFA-A04D-7EF59D8B97CD}.Debug|Win32.ActiveCfg = Debug|Win32 + {CDC4AAA9-72E1-4FFA-A04D-7EF59D8B97CD}.Debug|Win32.Build.0 = Debug|Win32 + {CDC4AAA9-72E1-4FFA-A04D-7EF59D8B97CD}.Debug|x64.ActiveCfg = Debug|x64 + {CDC4AAA9-72E1-4FFA-A04D-7EF59D8B97CD}.Debug|x64.Build.0 = Debug|x64 + {CDC4AAA9-72E1-4FFA-A04D-7EF59D8B97CD}.Release - Fast FPU|Win32.ActiveCfg = Release|Win32 + {CDC4AAA9-72E1-4FFA-A04D-7EF59D8B97CD}.Release - Fast FPU|Win32.Build.0 = Release|Win32 + {CDC4AAA9-72E1-4FFA-A04D-7EF59D8B97CD}.Release - Fast FPU|x64.ActiveCfg = Release|x64 + {CDC4AAA9-72E1-4FFA-A04D-7EF59D8B97CD}.Release - Fast FPU|x64.Build.0 = Release|x64 + {CDC4AAA9-72E1-4FFA-A04D-7EF59D8B97CD}.Release|Win32.ActiveCfg = Release|Win32 + {CDC4AAA9-72E1-4FFA-A04D-7EF59D8B97CD}.Release|Win32.Build.0 = Release|Win32 + {CDC4AAA9-72E1-4FFA-A04D-7EF59D8B97CD}.Release|x64.ActiveCfg = Release|x64 + {CDC4AAA9-72E1-4FFA-A04D-7EF59D8B97CD}.Release|x64.Build.0 = Release|x64 + {CDC4AAA9-72E1-4FFA-A04D-7EF59D8B97CD}.SDL-Debug|Win32.ActiveCfg = Debug|Win32 + {CDC4AAA9-72E1-4FFA-A04D-7EF59D8B97CD}.SDL-Debug|Win32.Build.0 = Debug|Win32 + {CDC4AAA9-72E1-4FFA-A04D-7EF59D8B97CD}.SDL-Debug|x64.ActiveCfg = Debug|x64 + {CDC4AAA9-72E1-4FFA-A04D-7EF59D8B97CD}.SDL-Debug|x64.Build.0 = Debug|x64 + {CDC4AAA9-72E1-4FFA-A04D-7EF59D8B97CD}.Static lib - Debug|Win32.ActiveCfg = Debug|Win32 + {CDC4AAA9-72E1-4FFA-A04D-7EF59D8B97CD}.Static lib - Debug|Win32.Build.0 = Debug|Win32 + {CDC4AAA9-72E1-4FFA-A04D-7EF59D8B97CD}.Static lib - Debug|x64.ActiveCfg = Debug|x64 + {CDC4AAA9-72E1-4FFA-A04D-7EF59D8B97CD}.Static lib - Debug|x64.Build.0 = Debug|x64 + {CDC4AAA9-72E1-4FFA-A04D-7EF59D8B97CD}.Static lib - Release - Fast FPU|Win32.ActiveCfg = Release|Win32 + {CDC4AAA9-72E1-4FFA-A04D-7EF59D8B97CD}.Static lib - Release - Fast FPU|Win32.Build.0 = Release|Win32 + {CDC4AAA9-72E1-4FFA-A04D-7EF59D8B97CD}.Static lib - Release - Fast FPU|x64.ActiveCfg = Release|x64 + {CDC4AAA9-72E1-4FFA-A04D-7EF59D8B97CD}.Static lib - Release - Fast FPU|x64.Build.0 = Release|x64 + {CDC4AAA9-72E1-4FFA-A04D-7EF59D8B97CD}.Static lib - Release|Win32.ActiveCfg = Release|Win32 + {CDC4AAA9-72E1-4FFA-A04D-7EF59D8B97CD}.Static lib - Release|Win32.Build.0 = Release|Win32 + {CDC4AAA9-72E1-4FFA-A04D-7EF59D8B97CD}.Static lib - Release|x64.ActiveCfg = Release|x64 + {CDC4AAA9-72E1-4FFA-A04D-7EF59D8B97CD}.Static lib - Release|x64.Build.0 = Release|x64 + {4E6C2F8D-BA92-4C5B-96FD-72D4FE8BD7FA}.Debug|Win32.ActiveCfg = Debug|Win32 + {4E6C2F8D-BA92-4C5B-96FD-72D4FE8BD7FA}.Debug|Win32.Build.0 = Debug|Win32 + {4E6C2F8D-BA92-4C5B-96FD-72D4FE8BD7FA}.Debug|x64.ActiveCfg = Debug|x64 + {4E6C2F8D-BA92-4C5B-96FD-72D4FE8BD7FA}.Debug|x64.Build.0 = Debug|x64 + {4E6C2F8D-BA92-4C5B-96FD-72D4FE8BD7FA}.Release - Fast FPU|Win32.ActiveCfg = Release|Win32 + {4E6C2F8D-BA92-4C5B-96FD-72D4FE8BD7FA}.Release - Fast FPU|Win32.Build.0 = Release|Win32 + {4E6C2F8D-BA92-4C5B-96FD-72D4FE8BD7FA}.Release - Fast FPU|x64.ActiveCfg = Release|x64 + {4E6C2F8D-BA92-4C5B-96FD-72D4FE8BD7FA}.Release - Fast FPU|x64.Build.0 = Release|x64 + {4E6C2F8D-BA92-4C5B-96FD-72D4FE8BD7FA}.Release|Win32.ActiveCfg = Release|Win32 + {4E6C2F8D-BA92-4C5B-96FD-72D4FE8BD7FA}.Release|Win32.Build.0 = Release|Win32 + {4E6C2F8D-BA92-4C5B-96FD-72D4FE8BD7FA}.Release|x64.ActiveCfg = Release|x64 + {4E6C2F8D-BA92-4C5B-96FD-72D4FE8BD7FA}.Release|x64.Build.0 = Release|x64 + {4E6C2F8D-BA92-4C5B-96FD-72D4FE8BD7FA}.SDL-Debug|Win32.ActiveCfg = Debug|Win32 + {4E6C2F8D-BA92-4C5B-96FD-72D4FE8BD7FA}.SDL-Debug|Win32.Build.0 = Debug|Win32 + {4E6C2F8D-BA92-4C5B-96FD-72D4FE8BD7FA}.SDL-Debug|x64.ActiveCfg = Debug|x64 + {4E6C2F8D-BA92-4C5B-96FD-72D4FE8BD7FA}.SDL-Debug|x64.Build.0 = Debug|x64 + {4E6C2F8D-BA92-4C5B-96FD-72D4FE8BD7FA}.Static lib - Debug|Win32.ActiveCfg = Debug|Win32 + {4E6C2F8D-BA92-4C5B-96FD-72D4FE8BD7FA}.Static lib - Debug|Win32.Build.0 = Debug|Win32 + {4E6C2F8D-BA92-4C5B-96FD-72D4FE8BD7FA}.Static lib - Debug|x64.ActiveCfg = Debug|x64 + {4E6C2F8D-BA92-4C5B-96FD-72D4FE8BD7FA}.Static lib - Debug|x64.Build.0 = Debug|x64 + {4E6C2F8D-BA92-4C5B-96FD-72D4FE8BD7FA}.Static lib - Release - Fast FPU|Win32.ActiveCfg = Release|Win32 + {4E6C2F8D-BA92-4C5B-96FD-72D4FE8BD7FA}.Static lib - Release - Fast FPU|Win32.Build.0 = Release|Win32 + {4E6C2F8D-BA92-4C5B-96FD-72D4FE8BD7FA}.Static lib - Release - Fast FPU|x64.ActiveCfg = Release|x64 + {4E6C2F8D-BA92-4C5B-96FD-72D4FE8BD7FA}.Static lib - Release - Fast FPU|x64.Build.0 = Release|x64 + {4E6C2F8D-BA92-4C5B-96FD-72D4FE8BD7FA}.Static lib - Release|Win32.ActiveCfg = Release|Win32 + {4E6C2F8D-BA92-4C5B-96FD-72D4FE8BD7FA}.Static lib - Release|Win32.Build.0 = Release|Win32 + {4E6C2F8D-BA92-4C5B-96FD-72D4FE8BD7FA}.Static lib - Release|x64.ActiveCfg = Release|x64 + {4E6C2F8D-BA92-4C5B-96FD-72D4FE8BD7FA}.Static lib - Release|x64.Build.0 = Release|x64 + {6AEC2AA2-C9FF-4B7D-B07A-94A9D34B41D7}.Debug|Win32.ActiveCfg = Debug|Win32 + {6AEC2AA2-C9FF-4B7D-B07A-94A9D34B41D7}.Debug|Win32.Build.0 = Debug|Win32 + {6AEC2AA2-C9FF-4B7D-B07A-94A9D34B41D7}.Debug|x64.ActiveCfg = Debug|x64 + {6AEC2AA2-C9FF-4B7D-B07A-94A9D34B41D7}.Debug|x64.Build.0 = Debug|x64 + {6AEC2AA2-C9FF-4B7D-B07A-94A9D34B41D7}.Release - Fast FPU|Win32.ActiveCfg = Release|Win32 + {6AEC2AA2-C9FF-4B7D-B07A-94A9D34B41D7}.Release - Fast FPU|Win32.Build.0 = Release|Win32 + {6AEC2AA2-C9FF-4B7D-B07A-94A9D34B41D7}.Release - Fast FPU|x64.ActiveCfg = Release|x64 + {6AEC2AA2-C9FF-4B7D-B07A-94A9D34B41D7}.Release - Fast FPU|x64.Build.0 = Release|x64 + {6AEC2AA2-C9FF-4B7D-B07A-94A9D34B41D7}.Release|Win32.ActiveCfg = Release|Win32 + {6AEC2AA2-C9FF-4B7D-B07A-94A9D34B41D7}.Release|Win32.Build.0 = Release|Win32 + {6AEC2AA2-C9FF-4B7D-B07A-94A9D34B41D7}.Release|x64.ActiveCfg = Release|x64 + {6AEC2AA2-C9FF-4B7D-B07A-94A9D34B41D7}.Release|x64.Build.0 = Release|x64 + {6AEC2AA2-C9FF-4B7D-B07A-94A9D34B41D7}.SDL-Debug|Win32.ActiveCfg = Debug|Win32 + {6AEC2AA2-C9FF-4B7D-B07A-94A9D34B41D7}.SDL-Debug|Win32.Build.0 = Debug|Win32 + {6AEC2AA2-C9FF-4B7D-B07A-94A9D34B41D7}.SDL-Debug|x64.ActiveCfg = Debug|x64 + {6AEC2AA2-C9FF-4B7D-B07A-94A9D34B41D7}.SDL-Debug|x64.Build.0 = Debug|x64 + {6AEC2AA2-C9FF-4B7D-B07A-94A9D34B41D7}.Static lib - Debug|Win32.ActiveCfg = Debug|Win32 + {6AEC2AA2-C9FF-4B7D-B07A-94A9D34B41D7}.Static lib - Debug|Win32.Build.0 = Debug|Win32 + {6AEC2AA2-C9FF-4B7D-B07A-94A9D34B41D7}.Static lib - Debug|x64.ActiveCfg = Debug|x64 + {6AEC2AA2-C9FF-4B7D-B07A-94A9D34B41D7}.Static lib - Debug|x64.Build.0 = Debug|x64 + {6AEC2AA2-C9FF-4B7D-B07A-94A9D34B41D7}.Static lib - Release - Fast FPU|Win32.ActiveCfg = Release|Win32 + {6AEC2AA2-C9FF-4B7D-B07A-94A9D34B41D7}.Static lib - Release - Fast FPU|Win32.Build.0 = Release|Win32 + {6AEC2AA2-C9FF-4B7D-B07A-94A9D34B41D7}.Static lib - Release - Fast FPU|x64.ActiveCfg = Release|x64 + {6AEC2AA2-C9FF-4B7D-B07A-94A9D34B41D7}.Static lib - Release - Fast FPU|x64.Build.0 = Release|x64 + {6AEC2AA2-C9FF-4B7D-B07A-94A9D34B41D7}.Static lib - Release|Win32.ActiveCfg = Release|Win32 + {6AEC2AA2-C9FF-4B7D-B07A-94A9D34B41D7}.Static lib - Release|Win32.Build.0 = Release|Win32 + {6AEC2AA2-C9FF-4B7D-B07A-94A9D34B41D7}.Static lib - Release|x64.ActiveCfg = Release|x64 + {6AEC2AA2-C9FF-4B7D-B07A-94A9D34B41D7}.Static lib - Release|x64.Build.0 = Release|x64 + {02B67A37-50E1-49DB-BECF-905BC029C2FE}.Debug|Win32.ActiveCfg = Debug|Win32 + {02B67A37-50E1-49DB-BECF-905BC029C2FE}.Debug|Win32.Build.0 = Debug|Win32 + {02B67A37-50E1-49DB-BECF-905BC029C2FE}.Debug|x64.ActiveCfg = Debug|x64 + {02B67A37-50E1-49DB-BECF-905BC029C2FE}.Debug|x64.Build.0 = Debug|x64 + {02B67A37-50E1-49DB-BECF-905BC029C2FE}.Release - Fast FPU|Win32.ActiveCfg = Release|Win32 + {02B67A37-50E1-49DB-BECF-905BC029C2FE}.Release - Fast FPU|Win32.Build.0 = Release|Win32 + {02B67A37-50E1-49DB-BECF-905BC029C2FE}.Release - Fast FPU|x64.ActiveCfg = Release|x64 + {02B67A37-50E1-49DB-BECF-905BC029C2FE}.Release - Fast FPU|x64.Build.0 = Release|x64 + {02B67A37-50E1-49DB-BECF-905BC029C2FE}.Release|Win32.ActiveCfg = Release|Win32 + {02B67A37-50E1-49DB-BECF-905BC029C2FE}.Release|Win32.Build.0 = Release|Win32 + {02B67A37-50E1-49DB-BECF-905BC029C2FE}.Release|x64.ActiveCfg = Release|x64 + {02B67A37-50E1-49DB-BECF-905BC029C2FE}.Release|x64.Build.0 = Release|x64 + {02B67A37-50E1-49DB-BECF-905BC029C2FE}.SDL-Debug|Win32.ActiveCfg = Debug|Win32 + {02B67A37-50E1-49DB-BECF-905BC029C2FE}.SDL-Debug|Win32.Build.0 = Debug|Win32 + {02B67A37-50E1-49DB-BECF-905BC029C2FE}.SDL-Debug|x64.ActiveCfg = Debug|x64 + {02B67A37-50E1-49DB-BECF-905BC029C2FE}.SDL-Debug|x64.Build.0 = Debug|x64 + {02B67A37-50E1-49DB-BECF-905BC029C2FE}.Static lib - Debug|Win32.ActiveCfg = Debug|Win32 + {02B67A37-50E1-49DB-BECF-905BC029C2FE}.Static lib - Debug|Win32.Build.0 = Debug|Win32 + {02B67A37-50E1-49DB-BECF-905BC029C2FE}.Static lib - Debug|x64.ActiveCfg = Debug|x64 + {02B67A37-50E1-49DB-BECF-905BC029C2FE}.Static lib - Debug|x64.Build.0 = Debug|x64 + {02B67A37-50E1-49DB-BECF-905BC029C2FE}.Static lib - Release - Fast FPU|Win32.ActiveCfg = Release|Win32 + {02B67A37-50E1-49DB-BECF-905BC029C2FE}.Static lib - Release - Fast FPU|Win32.Build.0 = Release|Win32 + {02B67A37-50E1-49DB-BECF-905BC029C2FE}.Static lib - Release - Fast FPU|x64.ActiveCfg = Release|x64 + {02B67A37-50E1-49DB-BECF-905BC029C2FE}.Static lib - Release - Fast FPU|x64.Build.0 = Release|x64 + {02B67A37-50E1-49DB-BECF-905BC029C2FE}.Static lib - Release|Win32.ActiveCfg = Release|Win32 + {02B67A37-50E1-49DB-BECF-905BC029C2FE}.Static lib - Release|Win32.Build.0 = Release|Win32 + {02B67A37-50E1-49DB-BECF-905BC029C2FE}.Static lib - Release|x64.ActiveCfg = Release|x64 + {02B67A37-50E1-49DB-BECF-905BC029C2FE}.Static lib - Release|x64.Build.0 = Release|x64 + {8FDA260E-EF27-4F8C-8720-7AF707DD0D9E}.Debug|Win32.ActiveCfg = Debug|Win32 + {8FDA260E-EF27-4F8C-8720-7AF707DD0D9E}.Debug|Win32.Build.0 = Debug|Win32 + {8FDA260E-EF27-4F8C-8720-7AF707DD0D9E}.Debug|x64.ActiveCfg = Debug|x64 + {8FDA260E-EF27-4F8C-8720-7AF707DD0D9E}.Debug|x64.Build.0 = Debug|x64 + {8FDA260E-EF27-4F8C-8720-7AF707DD0D9E}.Release - Fast FPU|Win32.ActiveCfg = Release|Win32 + {8FDA260E-EF27-4F8C-8720-7AF707DD0D9E}.Release - Fast FPU|Win32.Build.0 = Release|Win32 + {8FDA260E-EF27-4F8C-8720-7AF707DD0D9E}.Release - Fast FPU|x64.ActiveCfg = Release|x64 + {8FDA260E-EF27-4F8C-8720-7AF707DD0D9E}.Release - Fast FPU|x64.Build.0 = Release|x64 + {8FDA260E-EF27-4F8C-8720-7AF707DD0D9E}.Release|Win32.ActiveCfg = Release|Win32 + {8FDA260E-EF27-4F8C-8720-7AF707DD0D9E}.Release|Win32.Build.0 = Release|Win32 + {8FDA260E-EF27-4F8C-8720-7AF707DD0D9E}.Release|x64.ActiveCfg = Release|x64 + {8FDA260E-EF27-4F8C-8720-7AF707DD0D9E}.Release|x64.Build.0 = Release|x64 + {8FDA260E-EF27-4F8C-8720-7AF707DD0D9E}.SDL-Debug|Win32.ActiveCfg = Debug|Win32 + {8FDA260E-EF27-4F8C-8720-7AF707DD0D9E}.SDL-Debug|Win32.Build.0 = Debug|Win32 + {8FDA260E-EF27-4F8C-8720-7AF707DD0D9E}.SDL-Debug|x64.ActiveCfg = Debug|x64 + {8FDA260E-EF27-4F8C-8720-7AF707DD0D9E}.SDL-Debug|x64.Build.0 = Debug|x64 + {8FDA260E-EF27-4F8C-8720-7AF707DD0D9E}.Static lib - Debug|Win32.ActiveCfg = Debug|Win32 + {8FDA260E-EF27-4F8C-8720-7AF707DD0D9E}.Static lib - Debug|Win32.Build.0 = Debug|Win32 + {8FDA260E-EF27-4F8C-8720-7AF707DD0D9E}.Static lib - Debug|x64.ActiveCfg = Debug|x64 + {8FDA260E-EF27-4F8C-8720-7AF707DD0D9E}.Static lib - Debug|x64.Build.0 = Debug|x64 + {8FDA260E-EF27-4F8C-8720-7AF707DD0D9E}.Static lib - Release - Fast FPU|Win32.ActiveCfg = Release|Win32 + {8FDA260E-EF27-4F8C-8720-7AF707DD0D9E}.Static lib - Release - Fast FPU|Win32.Build.0 = Release|Win32 + {8FDA260E-EF27-4F8C-8720-7AF707DD0D9E}.Static lib - Release - Fast FPU|x64.ActiveCfg = Release|x64 + {8FDA260E-EF27-4F8C-8720-7AF707DD0D9E}.Static lib - Release - Fast FPU|x64.Build.0 = Release|x64 + {8FDA260E-EF27-4F8C-8720-7AF707DD0D9E}.Static lib - Release|Win32.ActiveCfg = Release|Win32 + {8FDA260E-EF27-4F8C-8720-7AF707DD0D9E}.Static lib - Release|Win32.Build.0 = Release|Win32 + {8FDA260E-EF27-4F8C-8720-7AF707DD0D9E}.Static lib - Release|x64.ActiveCfg = Release|x64 + {8FDA260E-EF27-4F8C-8720-7AF707DD0D9E}.Static lib - Release|x64.Build.0 = Release|x64 + {5CE0E2E7-879D-4152-B61D-24E7D0707B45}.Debug|Win32.ActiveCfg = Debug|Win32 + {5CE0E2E7-879D-4152-B61D-24E7D0707B45}.Debug|Win32.Build.0 = Debug|Win32 + {5CE0E2E7-879D-4152-B61D-24E7D0707B45}.Debug|x64.ActiveCfg = Debug|x64 + {5CE0E2E7-879D-4152-B61D-24E7D0707B45}.Debug|x64.Build.0 = Debug|x64 + {5CE0E2E7-879D-4152-B61D-24E7D0707B45}.Release - Fast FPU|Win32.ActiveCfg = Release|Win32 + {5CE0E2E7-879D-4152-B61D-24E7D0707B45}.Release - Fast FPU|Win32.Build.0 = Release|Win32 + {5CE0E2E7-879D-4152-B61D-24E7D0707B45}.Release - Fast FPU|x64.ActiveCfg = Release|x64 + {5CE0E2E7-879D-4152-B61D-24E7D0707B45}.Release - Fast FPU|x64.Build.0 = Release|x64 + {5CE0E2E7-879D-4152-B61D-24E7D0707B45}.Release|Win32.ActiveCfg = Release|Win32 + {5CE0E2E7-879D-4152-B61D-24E7D0707B45}.Release|Win32.Build.0 = Release|Win32 + {5CE0E2E7-879D-4152-B61D-24E7D0707B45}.Release|x64.ActiveCfg = Release|x64 + {5CE0E2E7-879D-4152-B61D-24E7D0707B45}.Release|x64.Build.0 = Release|x64 + {5CE0E2E7-879D-4152-B61D-24E7D0707B45}.SDL-Debug|Win32.ActiveCfg = Debug|Win32 + {5CE0E2E7-879D-4152-B61D-24E7D0707B45}.SDL-Debug|Win32.Build.0 = Debug|Win32 + {5CE0E2E7-879D-4152-B61D-24E7D0707B45}.SDL-Debug|x64.ActiveCfg = Debug|x64 + {5CE0E2E7-879D-4152-B61D-24E7D0707B45}.SDL-Debug|x64.Build.0 = Debug|x64 + {5CE0E2E7-879D-4152-B61D-24E7D0707B45}.Static lib - Debug|Win32.ActiveCfg = Debug|Win32 + {5CE0E2E7-879D-4152-B61D-24E7D0707B45}.Static lib - Debug|Win32.Build.0 = Debug|Win32 + {5CE0E2E7-879D-4152-B61D-24E7D0707B45}.Static lib - Debug|x64.ActiveCfg = Debug|x64 + {5CE0E2E7-879D-4152-B61D-24E7D0707B45}.Static lib - Debug|x64.Build.0 = Debug|x64 + {5CE0E2E7-879D-4152-B61D-24E7D0707B45}.Static lib - Release - Fast FPU|Win32.ActiveCfg = Release|Win32 + {5CE0E2E7-879D-4152-B61D-24E7D0707B45}.Static lib - Release - Fast FPU|Win32.Build.0 = Release|Win32 + {5CE0E2E7-879D-4152-B61D-24E7D0707B45}.Static lib - Release - Fast FPU|x64.ActiveCfg = Release|x64 + {5CE0E2E7-879D-4152-B61D-24E7D0707B45}.Static lib - Release - Fast FPU|x64.Build.0 = Release|x64 + {5CE0E2E7-879D-4152-B61D-24E7D0707B45}.Static lib - Release|Win32.ActiveCfg = Release|Win32 + {5CE0E2E7-879D-4152-B61D-24E7D0707B45}.Static lib - Release|Win32.Build.0 = Release|Win32 + {5CE0E2E7-879D-4152-B61D-24E7D0707B45}.Static lib - Release|x64.ActiveCfg = Release|x64 + {5CE0E2E7-879D-4152-B61D-24E7D0707B45}.Static lib - Release|x64.Build.0 = Release|x64 + {65D9DE2E-B73E-4ADF-96D1-BF4A8B7F4F97}.Debug|Win32.ActiveCfg = Debug|Win32 + {65D9DE2E-B73E-4ADF-96D1-BF4A8B7F4F97}.Debug|Win32.Build.0 = Debug|Win32 + {65D9DE2E-B73E-4ADF-96D1-BF4A8B7F4F97}.Debug|x64.ActiveCfg = Debug|x64 + {65D9DE2E-B73E-4ADF-96D1-BF4A8B7F4F97}.Debug|x64.Build.0 = Debug|x64 + {65D9DE2E-B73E-4ADF-96D1-BF4A8B7F4F97}.Release - Fast FPU|Win32.ActiveCfg = Release|Win32 + {65D9DE2E-B73E-4ADF-96D1-BF4A8B7F4F97}.Release - Fast FPU|Win32.Build.0 = Release|Win32 + {65D9DE2E-B73E-4ADF-96D1-BF4A8B7F4F97}.Release - Fast FPU|x64.ActiveCfg = Release|x64 + {65D9DE2E-B73E-4ADF-96D1-BF4A8B7F4F97}.Release - Fast FPU|x64.Build.0 = Release|x64 + {65D9DE2E-B73E-4ADF-96D1-BF4A8B7F4F97}.Release|Win32.ActiveCfg = Release|Win32 + {65D9DE2E-B73E-4ADF-96D1-BF4A8B7F4F97}.Release|Win32.Build.0 = Release|Win32 + {65D9DE2E-B73E-4ADF-96D1-BF4A8B7F4F97}.Release|x64.ActiveCfg = Release|x64 + {65D9DE2E-B73E-4ADF-96D1-BF4A8B7F4F97}.Release|x64.Build.0 = Release|x64 + {65D9DE2E-B73E-4ADF-96D1-BF4A8B7F4F97}.SDL-Debug|Win32.ActiveCfg = Debug|Win32 + {65D9DE2E-B73E-4ADF-96D1-BF4A8B7F4F97}.SDL-Debug|Win32.Build.0 = Debug|Win32 + {65D9DE2E-B73E-4ADF-96D1-BF4A8B7F4F97}.SDL-Debug|x64.ActiveCfg = Debug|x64 + {65D9DE2E-B73E-4ADF-96D1-BF4A8B7F4F97}.SDL-Debug|x64.Build.0 = Debug|x64 + {65D9DE2E-B73E-4ADF-96D1-BF4A8B7F4F97}.Static lib - Debug|Win32.ActiveCfg = Debug|Win32 + {65D9DE2E-B73E-4ADF-96D1-BF4A8B7F4F97}.Static lib - Debug|Win32.Build.0 = Debug|Win32 + {65D9DE2E-B73E-4ADF-96D1-BF4A8B7F4F97}.Static lib - Debug|x64.ActiveCfg = Debug|x64 + {65D9DE2E-B73E-4ADF-96D1-BF4A8B7F4F97}.Static lib - Debug|x64.Build.0 = Debug|x64 + {65D9DE2E-B73E-4ADF-96D1-BF4A8B7F4F97}.Static lib - Release - Fast FPU|Win32.ActiveCfg = Release|Win32 + {65D9DE2E-B73E-4ADF-96D1-BF4A8B7F4F97}.Static lib - Release - Fast FPU|Win32.Build.0 = Release|Win32 + {65D9DE2E-B73E-4ADF-96D1-BF4A8B7F4F97}.Static lib - Release - Fast FPU|x64.ActiveCfg = Release|x64 + {65D9DE2E-B73E-4ADF-96D1-BF4A8B7F4F97}.Static lib - Release - Fast FPU|x64.Build.0 = Release|x64 + {65D9DE2E-B73E-4ADF-96D1-BF4A8B7F4F97}.Static lib - Release|Win32.ActiveCfg = Release|Win32 + {65D9DE2E-B73E-4ADF-96D1-BF4A8B7F4F97}.Static lib - Release|Win32.Build.0 = Release|Win32 + {65D9DE2E-B73E-4ADF-96D1-BF4A8B7F4F97}.Static lib - Release|x64.ActiveCfg = Release|x64 + {65D9DE2E-B73E-4ADF-96D1-BF4A8B7F4F97}.Static lib - Release|x64.Build.0 = Release|x64 + {853A396E-C031-4C26-A716-5B4E176BE11D}.Debug|Win32.ActiveCfg = Debug|Win32 + {853A396E-C031-4C26-A716-5B4E176BE11D}.Debug|Win32.Build.0 = Debug|Win32 + {853A396E-C031-4C26-A716-5B4E176BE11D}.Debug|x64.ActiveCfg = Debug|x64 + {853A396E-C031-4C26-A716-5B4E176BE11D}.Debug|x64.Build.0 = Debug|x64 + {853A396E-C031-4C26-A716-5B4E176BE11D}.Release - Fast FPU|Win32.ActiveCfg = Release|Win32 + {853A396E-C031-4C26-A716-5B4E176BE11D}.Release - Fast FPU|Win32.Build.0 = Release|Win32 + {853A396E-C031-4C26-A716-5B4E176BE11D}.Release - Fast FPU|x64.ActiveCfg = Release|x64 + {853A396E-C031-4C26-A716-5B4E176BE11D}.Release - Fast FPU|x64.Build.0 = Release|x64 + {853A396E-C031-4C26-A716-5B4E176BE11D}.Release|Win32.ActiveCfg = Release|Win32 + {853A396E-C031-4C26-A716-5B4E176BE11D}.Release|Win32.Build.0 = Release|Win32 + {853A396E-C031-4C26-A716-5B4E176BE11D}.Release|x64.ActiveCfg = Release|x64 + {853A396E-C031-4C26-A716-5B4E176BE11D}.Release|x64.Build.0 = Release|x64 + {853A396E-C031-4C26-A716-5B4E176BE11D}.SDL-Debug|Win32.ActiveCfg = Debug|Win32 + {853A396E-C031-4C26-A716-5B4E176BE11D}.SDL-Debug|Win32.Build.0 = Debug|Win32 + {853A396E-C031-4C26-A716-5B4E176BE11D}.SDL-Debug|x64.ActiveCfg = Debug|x64 + {853A396E-C031-4C26-A716-5B4E176BE11D}.SDL-Debug|x64.Build.0 = Debug|x64 + {853A396E-C031-4C26-A716-5B4E176BE11D}.Static lib - Debug|Win32.ActiveCfg = Debug|Win32 + {853A396E-C031-4C26-A716-5B4E176BE11D}.Static lib - Debug|Win32.Build.0 = Debug|Win32 + {853A396E-C031-4C26-A716-5B4E176BE11D}.Static lib - Debug|x64.ActiveCfg = Debug|x64 + {853A396E-C031-4C26-A716-5B4E176BE11D}.Static lib - Debug|x64.Build.0 = Debug|x64 + {853A396E-C031-4C26-A716-5B4E176BE11D}.Static lib - Release - Fast FPU|Win32.ActiveCfg = Release|Win32 + {853A396E-C031-4C26-A716-5B4E176BE11D}.Static lib - Release - Fast FPU|Win32.Build.0 = Release|Win32 + {853A396E-C031-4C26-A716-5B4E176BE11D}.Static lib - Release - Fast FPU|x64.ActiveCfg = Release|x64 + {853A396E-C031-4C26-A716-5B4E176BE11D}.Static lib - Release - Fast FPU|x64.Build.0 = Release|x64 + {853A396E-C031-4C26-A716-5B4E176BE11D}.Static lib - Release|Win32.ActiveCfg = Release|Win32 + {853A396E-C031-4C26-A716-5B4E176BE11D}.Static lib - Release|Win32.Build.0 = Release|Win32 + {853A396E-C031-4C26-A716-5B4E176BE11D}.Static lib - Release|x64.ActiveCfg = Release|x64 + {853A396E-C031-4C26-A716-5B4E176BE11D}.Static lib - Release|x64.Build.0 = Release|x64 + {4D53E40F-37E3-42B1-8848-F4C6F8313A17}.Debug|Win32.ActiveCfg = Debug|Win32 + {4D53E40F-37E3-42B1-8848-F4C6F8313A17}.Debug|Win32.Build.0 = Debug|Win32 + {4D53E40F-37E3-42B1-8848-F4C6F8313A17}.Debug|x64.ActiveCfg = Debug|x64 + {4D53E40F-37E3-42B1-8848-F4C6F8313A17}.Debug|x64.Build.0 = Debug|x64 + {4D53E40F-37E3-42B1-8848-F4C6F8313A17}.Release - Fast FPU|Win32.ActiveCfg = Release|Win32 + {4D53E40F-37E3-42B1-8848-F4C6F8313A17}.Release - Fast FPU|Win32.Build.0 = Release|Win32 + {4D53E40F-37E3-42B1-8848-F4C6F8313A17}.Release - Fast FPU|x64.ActiveCfg = Release|x64 + {4D53E40F-37E3-42B1-8848-F4C6F8313A17}.Release - Fast FPU|x64.Build.0 = Release|x64 + {4D53E40F-37E3-42B1-8848-F4C6F8313A17}.Release|Win32.ActiveCfg = Release|Win32 + {4D53E40F-37E3-42B1-8848-F4C6F8313A17}.Release|Win32.Build.0 = Release|Win32 + {4D53E40F-37E3-42B1-8848-F4C6F8313A17}.Release|x64.ActiveCfg = Release|x64 + {4D53E40F-37E3-42B1-8848-F4C6F8313A17}.Release|x64.Build.0 = Release|x64 + {4D53E40F-37E3-42B1-8848-F4C6F8313A17}.SDL-Debug|Win32.ActiveCfg = Debug|Win32 + {4D53E40F-37E3-42B1-8848-F4C6F8313A17}.SDL-Debug|Win32.Build.0 = Debug|Win32 + {4D53E40F-37E3-42B1-8848-F4C6F8313A17}.SDL-Debug|x64.ActiveCfg = Debug|x64 + {4D53E40F-37E3-42B1-8848-F4C6F8313A17}.SDL-Debug|x64.Build.0 = Debug|x64 + {4D53E40F-37E3-42B1-8848-F4C6F8313A17}.Static lib - Debug|Win32.ActiveCfg = Debug|Win32 + {4D53E40F-37E3-42B1-8848-F4C6F8313A17}.Static lib - Debug|Win32.Build.0 = Debug|Win32 + {4D53E40F-37E3-42B1-8848-F4C6F8313A17}.Static lib - Debug|x64.ActiveCfg = Debug|x64 + {4D53E40F-37E3-42B1-8848-F4C6F8313A17}.Static lib - Debug|x64.Build.0 = Debug|x64 + {4D53E40F-37E3-42B1-8848-F4C6F8313A17}.Static lib - Release - Fast FPU|Win32.ActiveCfg = Release|Win32 + {4D53E40F-37E3-42B1-8848-F4C6F8313A17}.Static lib - Release - Fast FPU|Win32.Build.0 = Release|Win32 + {4D53E40F-37E3-42B1-8848-F4C6F8313A17}.Static lib - Release - Fast FPU|x64.ActiveCfg = Release|x64 + {4D53E40F-37E3-42B1-8848-F4C6F8313A17}.Static lib - Release - Fast FPU|x64.Build.0 = Release|x64 + {4D53E40F-37E3-42B1-8848-F4C6F8313A17}.Static lib - Release|Win32.ActiveCfg = Release|Win32 + {4D53E40F-37E3-42B1-8848-F4C6F8313A17}.Static lib - Release|Win32.Build.0 = Release|Win32 + {4D53E40F-37E3-42B1-8848-F4C6F8313A17}.Static lib - Release|x64.ActiveCfg = Release|x64 + {4D53E40F-37E3-42B1-8848-F4C6F8313A17}.Static lib - Release|x64.Build.0 = Release|x64 + {E72B637E-4AA6-46F3-885F-AC67B4B470ED}.Debug|Win32.ActiveCfg = Debug|Win32 + {E72B637E-4AA6-46F3-885F-AC67B4B470ED}.Debug|Win32.Build.0 = Debug|Win32 + {E72B637E-4AA6-46F3-885F-AC67B4B470ED}.Debug|x64.ActiveCfg = Debug|x64 + {E72B637E-4AA6-46F3-885F-AC67B4B470ED}.Debug|x64.Build.0 = Debug|x64 + {E72B637E-4AA6-46F3-885F-AC67B4B470ED}.Release - Fast FPU|Win32.ActiveCfg = Release|Win32 + {E72B637E-4AA6-46F3-885F-AC67B4B470ED}.Release - Fast FPU|Win32.Build.0 = Release|Win32 + {E72B637E-4AA6-46F3-885F-AC67B4B470ED}.Release - Fast FPU|x64.ActiveCfg = Release|x64 + {E72B637E-4AA6-46F3-885F-AC67B4B470ED}.Release - Fast FPU|x64.Build.0 = Release|x64 + {E72B637E-4AA6-46F3-885F-AC67B4B470ED}.Release|Win32.ActiveCfg = Release|Win32 + {E72B637E-4AA6-46F3-885F-AC67B4B470ED}.Release|Win32.Build.0 = Release|Win32 + {E72B637E-4AA6-46F3-885F-AC67B4B470ED}.Release|x64.ActiveCfg = Release|x64 + {E72B637E-4AA6-46F3-885F-AC67B4B470ED}.Release|x64.Build.0 = Release|x64 + {E72B637E-4AA6-46F3-885F-AC67B4B470ED}.SDL-Debug|Win32.ActiveCfg = Debug|Win32 + {E72B637E-4AA6-46F3-885F-AC67B4B470ED}.SDL-Debug|Win32.Build.0 = Debug|Win32 + {E72B637E-4AA6-46F3-885F-AC67B4B470ED}.SDL-Debug|x64.ActiveCfg = Debug|x64 + {E72B637E-4AA6-46F3-885F-AC67B4B470ED}.SDL-Debug|x64.Build.0 = Debug|x64 + {E72B637E-4AA6-46F3-885F-AC67B4B470ED}.Static lib - Debug|Win32.ActiveCfg = Debug|Win32 + {E72B637E-4AA6-46F3-885F-AC67B4B470ED}.Static lib - Debug|Win32.Build.0 = Debug|Win32 + {E72B637E-4AA6-46F3-885F-AC67B4B470ED}.Static lib - Debug|x64.ActiveCfg = Debug|x64 + {E72B637E-4AA6-46F3-885F-AC67B4B470ED}.Static lib - Debug|x64.Build.0 = Debug|x64 + {E72B637E-4AA6-46F3-885F-AC67B4B470ED}.Static lib - Release - Fast FPU|Win32.ActiveCfg = Release|Win32 + {E72B637E-4AA6-46F3-885F-AC67B4B470ED}.Static lib - Release - Fast FPU|Win32.Build.0 = Release|Win32 + {E72B637E-4AA6-46F3-885F-AC67B4B470ED}.Static lib - Release - Fast FPU|x64.ActiveCfg = Release|x64 + {E72B637E-4AA6-46F3-885F-AC67B4B470ED}.Static lib - Release - Fast FPU|x64.Build.0 = Release|x64 + {E72B637E-4AA6-46F3-885F-AC67B4B470ED}.Static lib - Release|Win32.ActiveCfg = Release|Win32 + {E72B637E-4AA6-46F3-885F-AC67B4B470ED}.Static lib - Release|Win32.Build.0 = Release|Win32 + {E72B637E-4AA6-46F3-885F-AC67B4B470ED}.Static lib - Release|x64.ActiveCfg = Release|x64 + {E72B637E-4AA6-46F3-885F-AC67B4B470ED}.Static lib - Release|x64.Build.0 = Release|x64 + {6F076455-D955-45D4-9C68-4AD4E45F2D47}.Debug|Win32.ActiveCfg = Debug|Win32 + {6F076455-D955-45D4-9C68-4AD4E45F2D47}.Debug|Win32.Build.0 = Debug|Win32 + {6F076455-D955-45D4-9C68-4AD4E45F2D47}.Debug|x64.ActiveCfg = Debug|x64 + {6F076455-D955-45D4-9C68-4AD4E45F2D47}.Debug|x64.Build.0 = Debug|x64 + {6F076455-D955-45D4-9C68-4AD4E45F2D47}.Release - Fast FPU|Win32.ActiveCfg = Release|Win32 + {6F076455-D955-45D4-9C68-4AD4E45F2D47}.Release - Fast FPU|Win32.Build.0 = Release|Win32 + {6F076455-D955-45D4-9C68-4AD4E45F2D47}.Release - Fast FPU|x64.ActiveCfg = Release|x64 + {6F076455-D955-45D4-9C68-4AD4E45F2D47}.Release - Fast FPU|x64.Build.0 = Release|x64 + {6F076455-D955-45D4-9C68-4AD4E45F2D47}.Release|Win32.ActiveCfg = Release|Win32 + {6F076455-D955-45D4-9C68-4AD4E45F2D47}.Release|Win32.Build.0 = Release|Win32 + {6F076455-D955-45D4-9C68-4AD4E45F2D47}.Release|x64.ActiveCfg = Release|x64 + {6F076455-D955-45D4-9C68-4AD4E45F2D47}.Release|x64.Build.0 = Release|x64 + {6F076455-D955-45D4-9C68-4AD4E45F2D47}.SDL-Debug|Win32.ActiveCfg = Debug|Win32 + {6F076455-D955-45D4-9C68-4AD4E45F2D47}.SDL-Debug|Win32.Build.0 = Debug|Win32 + {6F076455-D955-45D4-9C68-4AD4E45F2D47}.SDL-Debug|x64.ActiveCfg = Debug|x64 + {6F076455-D955-45D4-9C68-4AD4E45F2D47}.SDL-Debug|x64.Build.0 = Debug|x64 + {6F076455-D955-45D4-9C68-4AD4E45F2D47}.Static lib - Debug|Win32.ActiveCfg = Debug|Win32 + {6F076455-D955-45D4-9C68-4AD4E45F2D47}.Static lib - Debug|Win32.Build.0 = Debug|Win32 + {6F076455-D955-45D4-9C68-4AD4E45F2D47}.Static lib - Debug|x64.ActiveCfg = Debug|x64 + {6F076455-D955-45D4-9C68-4AD4E45F2D47}.Static lib - Debug|x64.Build.0 = Debug|x64 + {6F076455-D955-45D4-9C68-4AD4E45F2D47}.Static lib - Release - Fast FPU|Win32.ActiveCfg = Release|Win32 + {6F076455-D955-45D4-9C68-4AD4E45F2D47}.Static lib - Release - Fast FPU|Win32.Build.0 = Release|Win32 + {6F076455-D955-45D4-9C68-4AD4E45F2D47}.Static lib - Release - Fast FPU|x64.ActiveCfg = Release|x64 + {6F076455-D955-45D4-9C68-4AD4E45F2D47}.Static lib - Release - Fast FPU|x64.Build.0 = Release|x64 + {6F076455-D955-45D4-9C68-4AD4E45F2D47}.Static lib - Release|Win32.ActiveCfg = Release|Win32 + {6F076455-D955-45D4-9C68-4AD4E45F2D47}.Static lib - Release|Win32.Build.0 = Release|Win32 + {6F076455-D955-45D4-9C68-4AD4E45F2D47}.Static lib - Release|x64.ActiveCfg = Release|x64 + {6F076455-D955-45D4-9C68-4AD4E45F2D47}.Static lib - Release|x64.Build.0 = Release|x64 + {E08E042A-6C45-411B-92BE-3CC31331019F}.Debug|Win32.ActiveCfg = Debug|Win32 + {E08E042A-6C45-411B-92BE-3CC31331019F}.Debug|Win32.Build.0 = Debug|Win32 + {E08E042A-6C45-411B-92BE-3CC31331019F}.Debug|x64.ActiveCfg = Debug|x64 + {E08E042A-6C45-411B-92BE-3CC31331019F}.Debug|x64.Build.0 = Debug|x64 + {E08E042A-6C45-411B-92BE-3CC31331019F}.Release - Fast FPU|Win32.ActiveCfg = Release - Fast FPU|Win32 + {E08E042A-6C45-411B-92BE-3CC31331019F}.Release - Fast FPU|Win32.Build.0 = Release - Fast FPU|Win32 + {E08E042A-6C45-411B-92BE-3CC31331019F}.Release - Fast FPU|x64.ActiveCfg = Release - Fast FPU|x64 + {E08E042A-6C45-411B-92BE-3CC31331019F}.Release - Fast FPU|x64.Build.0 = Release - Fast FPU|x64 + {E08E042A-6C45-411B-92BE-3CC31331019F}.Release|Win32.ActiveCfg = Release|Win32 + {E08E042A-6C45-411B-92BE-3CC31331019F}.Release|Win32.Build.0 = Release|Win32 + {E08E042A-6C45-411B-92BE-3CC31331019F}.Release|x64.ActiveCfg = Release|x64 + {E08E042A-6C45-411B-92BE-3CC31331019F}.Release|x64.Build.0 = Release|x64 + {E08E042A-6C45-411B-92BE-3CC31331019F}.SDL-Debug|Win32.ActiveCfg = SDL-Debug|Win32 + {E08E042A-6C45-411B-92BE-3CC31331019F}.SDL-Debug|Win32.Build.0 = SDL-Debug|Win32 + {E08E042A-6C45-411B-92BE-3CC31331019F}.SDL-Debug|x64.ActiveCfg = SDL-Debug|x64 + {E08E042A-6C45-411B-92BE-3CC31331019F}.SDL-Debug|x64.Build.0 = SDL-Debug|x64 + {E08E042A-6C45-411B-92BE-3CC31331019F}.Static lib - Debug|Win32.ActiveCfg = Static lib - Debug|Win32 + {E08E042A-6C45-411B-92BE-3CC31331019F}.Static lib - Debug|Win32.Build.0 = Static lib - Debug|Win32 + {E08E042A-6C45-411B-92BE-3CC31331019F}.Static lib - Debug|x64.ActiveCfg = Static lib - Debug|x64 + {E08E042A-6C45-411B-92BE-3CC31331019F}.Static lib - Debug|x64.Build.0 = Static lib - Debug|x64 + {E08E042A-6C45-411B-92BE-3CC31331019F}.Static lib - Release - Fast FPU|Win32.ActiveCfg = Static lib - Release - Fast FPU|Win32 + {E08E042A-6C45-411B-92BE-3CC31331019F}.Static lib - Release - Fast FPU|Win32.Build.0 = Static lib - Release - Fast FPU|Win32 + {E08E042A-6C45-411B-92BE-3CC31331019F}.Static lib - Release - Fast FPU|x64.ActiveCfg = Static lib - Release - Fast FPU|x64 + {E08E042A-6C45-411B-92BE-3CC31331019F}.Static lib - Release - Fast FPU|x64.Build.0 = Static lib - Release - Fast FPU|x64 + {E08E042A-6C45-411B-92BE-3CC31331019F}.Static lib - Release|Win32.ActiveCfg = Static lib - Release|Win32 + {E08E042A-6C45-411B-92BE-3CC31331019F}.Static lib - Release|Win32.Build.0 = Static lib - Release|Win32 + {E08E042A-6C45-411B-92BE-3CC31331019F}.Static lib - Release|x64.ActiveCfg = Static lib - Release|x64 + {E08E042A-6C45-411B-92BE-3CC31331019F}.Static lib - Release|x64.Build.0 = Static lib - Release|x64 + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection +EndGlobal diff --git a/examples/Demo/CDemo.cpp b/examples/Demo/CDemo.cpp index 82400257..e9babcdf 100644 --- a/examples/Demo/CDemo.cpp +++ b/examples/Demo/CDemo.cpp @@ -2,6 +2,7 @@ // This file is not documented. #include "CDemo.h" +#include "exampleHelper.h" CDemo::CDemo(bool f, bool m, bool s, bool a, bool v, bool fsaa, video::E_DRIVER_TYPE d) : fullscreen(f), music(m), shadows(s), additive(a), vsync(v), aa(fsaa), @@ -59,14 +60,16 @@ void CDemo::run() if (!device) return; + const io::path mediaPath = getExampleMediaPath(); + if (device->getFileSystem()->existFile("irrlicht.dat")) device->getFileSystem()->addFileArchive("irrlicht.dat"); else - device->getFileSystem()->addFileArchive("../../media/irrlicht.dat"); + device->getFileSystem()->addFileArchive(mediaPath + "irrlicht.dat"); if (device->getFileSystem()->existFile("map-20kdm2.pk3")) device->getFileSystem()->addFileArchive("map-20kdm2.pk3"); else - device->getFileSystem()->addFileArchive("../../media/map-20kdm2.pk3"); + device->getFileSystem()->addFileArchive(mediaPath + "map-20kdm2.pk3"); video::IVideoDriver* driver = device->getVideoDriver(); scene::ISceneManager* smgr = device->getSceneManager(); @@ -102,7 +105,12 @@ void CDemo::run() createParticleImpacts(); - driver->beginScene(timeForThisScene != -1, true, backColor); + u16 clearFlag = video::ECBF_DEPTH; + + if (timeForThisScene != -1) + clearFlag |= video::ECBF_COLOR; + + driver->beginScene(clearFlag, backColor); smgr->drawAll(); guienv->drawAll(); @@ -111,7 +119,7 @@ void CDemo::run() // write statistics const s32 nowfps = driver->getFPS(); - swprintf(tmp, 255, L"%ls fps:%3d triangles:%0.3f mio/s", + swprintf_irr(tmp, 255, L"%ls fps:%3d triangles:%0.3f mio/s", driver->getName(), driver->getFPS(), driver->getPrimitiveCountDrawn(1) * (1.f / 1000000.f)); @@ -405,16 +413,18 @@ void CDemo::loadSceneData() } } + const io::path mediaPath = getExampleMediaPath(); + // load sydney model and create 2 instances scene::IAnimatedMesh* mesh = 0; - mesh = sm->getMesh("../../media/sydney.md2"); + mesh = sm->getMesh(mediaPath + "sydney.md2"); if (mesh) { model1 = sm->addAnimatedMeshSceneNode(mesh); if (model1) { - model1->setMaterialTexture(0, driver->getTexture("../../media/spheremap.jpg")); + model1->setMaterialTexture(0, driver->getTexture(mediaPath + "spheremap.jpg")); model1->setPosition(core::vector3df(100,40,-80)); model1->setScale(core::vector3df(2,2,2)); model1->setMD2Animation(scene::EMAT_STAND); @@ -430,7 +440,7 @@ void CDemo::loadSceneData() model2->setPosition(core::vector3df(180,15,-60)); model2->setScale(core::vector3df(2,2,2)); model2->setMD2Animation(scene::EMAT_RUN); - model2->setMaterialTexture(0, device->getVideoDriver()->getTexture("../../media/sydney.bmp")); + model2->setMaterialTexture(0, device->getVideoDriver()->getTexture(mediaPath + "sydney.bmp")); model2->setMaterialFlag(video::EMF_LIGHTING, true); model2->setMaterialFlag(video::EMF_NORMALIZE_NORMALS, true); model2->addShadowVolumeSceneNode(); @@ -442,12 +452,12 @@ void CDemo::loadSceneData() // create sky box driver->setTextureCreationFlag(video::ETCF_CREATE_MIP_MAPS, false); skyboxNode = sm->addSkyBoxSceneNode( - driver->getTexture("../../media/irrlicht2_up.jpg"), - driver->getTexture("../../media/irrlicht2_dn.jpg"), - driver->getTexture("../../media/irrlicht2_lf.jpg"), - driver->getTexture("../../media/irrlicht2_rt.jpg"), - driver->getTexture("../../media/irrlicht2_ft.jpg"), - driver->getTexture("../../media/irrlicht2_bk.jpg")); + driver->getTexture(mediaPath + "irrlicht2_up.jpg"), + driver->getTexture(mediaPath + "irrlicht2_dn.jpg"), + driver->getTexture(mediaPath + "irrlicht2_lf.jpg"), + driver->getTexture(mediaPath + "irrlicht2_rt.jpg"), + driver->getTexture(mediaPath + "irrlicht2_ft.jpg"), + driver->getTexture(mediaPath + "irrlicht2_bk.jpg")); driver->setTextureCreationFlag(video::ETCF_CREATE_MIP_MAPS, true); // create walk-between-portals animation @@ -469,7 +479,7 @@ void CDemo::loadSceneData() core::array textures; for (s32 g=1; g<8; ++g) { - core::stringc tmp("../../media/portal"); + core::stringc tmp(mediaPath + "portal"); tmp += g; tmp += ".bmp"; video::ITexture* t = driver->getTexture( tmp ); @@ -487,7 +497,7 @@ void CDemo::loadSceneData() bill = sm->addBillboardSceneNode(0, core::dimension2d(100,100), waypoint[r]+ core::vector3df(0,20,0)); bill->setMaterialFlag(video::EMF_LIGHTING, false); - bill->setMaterialTexture(0, driver->getTexture("../../media/portal1.bmp")); + bill->setMaterialTexture(0, driver->getTexture(mediaPath + "portal1.bmp")); bill->setMaterialType(video::EMT_TRANSPARENT_ADD_COLOR); bill->addAnimator(anim); } @@ -510,7 +520,7 @@ void CDemo::loadSceneData() bill = device->getSceneManager()->addBillboardSceneNode( light, core::dimension2d(40,40)); bill->setMaterialFlag(video::EMF_LIGHTING, false); - bill->setMaterialTexture(0, driver->getTexture("../../media/particlewhite.bmp")); + bill->setMaterialTexture(0, driver->getTexture(mediaPath + "particlewhite.bmp")); bill->setMaterialType(video::EMT_TRANSPARENT_ADD_COLOR); // create meta triangle selector with all triangles selectors in it. @@ -539,7 +549,7 @@ void CDemo::loadSceneData() campFire->setMaterialFlag(video::EMF_LIGHTING, false); campFire->setMaterialFlag(video::EMF_ZWRITE_ENABLE, false); - campFire->setMaterialTexture(0, driver->getTexture("../../media/fireball.bmp")); + campFire->setMaterialTexture(0, driver->getTexture(mediaPath + "fireball.bmp")); campFire->setMaterialType(video::EMT_TRANSPARENT_ADD_COLOR); // load music @@ -570,8 +580,10 @@ void CDemo::createLoadingScreen() inOutFader = device->getGUIEnvironment()->addInOutFader(); inOutFader->setColor(backColor, video::SColor ( 0, 230, 230, 230 )); + const io::path mediaPath = getExampleMediaPath(); + // irrlicht logo - device->getGUIEnvironment()->addImage(device->getVideoDriver()->getTexture("../../media/irrlichtlogo2.png"), + device->getGUIEnvironment()->addImage(device->getVideoDriver()->getTexture(mediaPath + "irrlichtlogo2.png"), core::position2d(5,5)); // loading text @@ -588,7 +600,7 @@ void CDemo::createLoadingScreen() // load bigger font device->getGUIEnvironment()->getSkin()->setFont( - device->getGUIEnvironment()->getFont("../../media/fonthaettenschweiler.bmp")); + device->getGUIEnvironment()->getFont(mediaPath + "fonthaettenschweiler.bmp")); // set new font color @@ -649,7 +661,7 @@ void CDemo::shoot() core::dimension2d(25,25), start); node->setMaterialFlag(video::EMF_LIGHTING, false); - node->setMaterialTexture(0, device->getVideoDriver()->getTexture("../../media/fireball.bmp")); + node->setMaterialTexture(0, device->getVideoDriver()->getTexture(getExampleMediaPath() + "fireball.bmp")); node->setMaterialType(video::EMT_TRANSPARENT_ADD_COLOR); f32 length = (f32)(end - start).getLength(); @@ -716,7 +728,7 @@ void CDemo::createParticleImpacts() pas->setMaterialFlag(video::EMF_LIGHTING, false); pas->setMaterialFlag(video::EMF_ZWRITE_ENABLE, false); - pas->setMaterialTexture(0, device->getVideoDriver()->getTexture("../../media/smoke.bmp")); + pas->setMaterialTexture(0, device->getVideoDriver()->getTexture(getExampleMediaPath() + "smoke.bmp")); pas->setMaterialType(video::EMT_TRANSPARENT_ADD_COLOR); scene::ISceneNodeAnimator* anim = sm->createDeleteAnimator(2000); @@ -759,9 +771,11 @@ void CDemo::startIrrKlang() if (!irrKlang) return; + const io::path mediaPath = getExampleMediaPath(); + // play music - irrklang::ISound* snd = irrKlang->play2D("../../media/IrrlichtTheme.ogg", true, false, true); + irrklang::ISound* snd = irrKlang->play2D((mediaPath + "IrrlichtTheme.ogg").c_str(), true, false, true); if ( !snd ) snd = irrKlang->play2D("IrrlichtTheme.ogg", true, false, true); @@ -773,8 +787,8 @@ void CDemo::startIrrKlang() // preload both sound effects - ballSound = irrKlang->getSoundSource("../../media/ball.wav"); - impactSound = irrKlang->getSoundSource("../../media/impact.wav"); + ballSound = irrKlang->getSoundSource(mediaPath + "ball.wav"); + impactSound = irrKlang->getSoundSource(mediaPath + "impact.wav"); } #endif @@ -791,12 +805,14 @@ void CDemo::startSound() if (Mix_OpenAudio(22050, AUDIO_S16, 2, 128)) return; - stream = Mix_LoadMUS("../../media/IrrlichtTheme.ogg"); + const io::path mediaPath = getExampleMediaPath(); + + stream = Mix_LoadMUS((mediaPath + "IrrlichtTheme.ogg").c_str()); if (stream) Mix_PlayMusic(stream, -1); - ballSound = Mix_LoadWAV("../../media/ball.wav"); - impactSound = Mix_LoadWAV("../../media/impact.wav"); + ballSound = Mix_LoadWAV(mediaPath + "ball.wav"); + impactSound = Mix_LoadWAV(mediaPath + "impact.wav"); } void CDemo::playSound(Mix_Chunk *sample) diff --git a/examples/Demo/CDemo.h b/examples/Demo/CDemo.h index e2c564dc..0b2ca39c 100644 --- a/examples/Demo/CDemo.h +++ b/examples/Demo/CDemo.h @@ -21,7 +21,7 @@ using namespace irr; #include // problem here? go to http://www.ambiera.com/irrklang and download // the irrKlang library or undefine USE_IRRKLANG at the beginning // of this file. - #ifdef _IRR_WINDOWS_ + #ifdef _MSC_VER #pragma comment (lib, "irrKlang.lib") #endif #endif diff --git a/examples/Demo/CMainMenu.cpp b/examples/Demo/CMainMenu.cpp index b66d42b2..eca73895 100644 --- a/examples/Demo/CMainMenu.cpp +++ b/examples/Demo/CMainMenu.cpp @@ -2,6 +2,7 @@ // This file is not documented. #include "CMainMenu.h" +#include "exampleHelper.h" @@ -26,10 +27,12 @@ bool CMainMenu::run(bool& outFullscreen, bool& outMusic, bool& outShadows, MenuDevice = createDevice(driverType, core::dimension2d(512, 384), 16, false, false, false, this); + const io::path mediaPath = getExampleMediaPath(); + if (MenuDevice->getFileSystem()->existFile("irrlicht.dat")) MenuDevice->getFileSystem()->addFileArchive("irrlicht.dat"); else - MenuDevice->getFileSystem()->addFileArchive("../../media/irrlicht.dat"); + MenuDevice->getFileSystem()->addFileArchive(mediaPath + "irrlicht.dat"); video::IVideoDriver* driver = MenuDevice->getVideoDriver(); scene::ISceneManager* smgr = MenuDevice->getSceneManager(); @@ -45,7 +48,7 @@ bool CMainMenu::run(bool& outFullscreen, bool& outMusic, bool& outShadows, newskin->drop(); // load font - gui::IGUIFont* font = guienv->getFont("../../media/fonthaettenschweiler.bmp"); + gui::IGUIFont* font = guienv->getFont(mediaPath + "fonthaettenschweiler.bmp"); if (font) guienv->getSkin()->setFont(font); @@ -62,10 +65,11 @@ bool CMainMenu::run(bool& outFullscreen, bool& outMusic, bool& outShadows, // add list box gui::IGUIListBox* box = guienv->addListBox(core::rect(10,10,220,120), optTab, 1); + const wchar_t* const names[] = {L"Software Renderer", L"Burning's Video", - L"Direct3D 8", L"Direct3D 9", - L"OpenGL 1.x-4.x", L"OpenGL-ES 1.x", L"OpenGL-ES 2.x"}; + L"Direct3D 9", L"OpenGL 1.x-4.x", + L"OpenGL-ES 1.x", L"OpenGL-ES 2.x"}; for (u32 i=1; igetMesh("../../media/faerie.md2"); + scene::IAnimatedMesh* mesh = smgr->getMesh(mediaPath + "faerie.md2"); scene::IAnimatedMeshSceneNode* modelNode = smgr->addAnimatedMeshSceneNode(mesh); if (modelNode) { modelNode->setPosition( core::vector3df(0.f, 0.f, -5.f) ); - modelNode->setMaterialTexture(0, driver->getTexture("../../media/faerie2.bmp")); + modelNode->setMaterialTexture(0, driver->getTexture(mediaPath + "faerie2.bmp")); modelNode->setMaterialFlag(video::EMF_LIGHTING, true); modelNode->getMaterial(0).Shininess = 50.f; modelNode->getMaterial(0).NormalizeNormals = true; @@ -176,7 +180,7 @@ bool CMainMenu::run(bool& outFullscreen, bool& outMusic, bool& outShadows, { bill->setMaterialFlag(video::EMF_LIGHTING, false); bill->setMaterialType(video::EMT_TRANSPARENT_ADD_COLOR); - bill->setMaterialTexture(0, driver->getTexture("../../media/particlered.bmp")); + bill->setMaterialTexture(0, driver->getTexture(mediaPath + "particlered.bmp")); } // add fly circle animator to the light anim = smgr->createFlyCircleAnimator(core::vector3df(0.f,0.f,-5.f),20.f, @@ -194,7 +198,7 @@ bool CMainMenu::run(bool& outFullscreen, bool& outMusic, bool& outShadows, { bill->setMaterialFlag(video::EMF_LIGHTING, false); bill->setMaterialType(video::EMT_TRANSPARENT_ADD_COLOR); - bill->setMaterialTexture(0, driver->getTexture("../../media/portal1.bmp")); + bill->setMaterialTexture(0, driver->getTexture(mediaPath + "portal1.bmp")); } // add fly circle animator to the light anim = smgr->createFlyCircleAnimator(core::vector3df(0.f,0.f,-5.f),20.f, @@ -217,10 +221,10 @@ bool CMainMenu::run(bool& outFullscreen, bool& outMusic, bool& outShadows, bool oldMipMapState = driver->getTextureCreationFlag(video::ETCF_CREATE_MIP_MAPS); driver->setTextureCreationFlag(video::ETCF_CREATE_MIP_MAPS, false); - guienv->addImage(driver->getTexture("../../media/irrlichtlogo3.png"), + guienv->addImage(driver->getTexture(mediaPath + "irrlichtlogo3.png"), core::position2d(5,5)); - video::ITexture* irrlichtBack = driver->getTexture("../../media/demoback.jpg"); + video::ITexture* irrlichtBack = driver->getTexture(mediaPath + "demoback.jpg"); driver->setTextureCreationFlag(video::ETCF_CREATE_MIP_MAPS, oldMipMapState); @@ -236,7 +240,7 @@ bool CMainMenu::run(bool& outFullscreen, bool& outMusic, bool& outShadows, { if (MenuDevice->isWindowActive()) { - driver->beginScene(false, true, video::SColor(0,0,0,0)); + driver->beginScene(video::ECBF_DEPTH, video::SColor(0,0,0,0)); if (irrlichtBack) driver->draw2DImage(irrlichtBack, diff --git a/examples/Demo/Demo_vc10.vcxproj b/examples/Demo/Demo_vc10.vcxproj index 73b5a2f4..c6d213fe 100644 --- a/examples/Demo/Demo_vc10.vcxproj +++ b/examples/Demo/Demo_vc10.vcxproj @@ -26,18 +26,22 @@ Application MultiByte + Windows7.1SDK Application MultiByte + Windows7.1SDK Application MultiByte + Windows7.1SDK Application MultiByte + Windows7.1SDK @@ -110,7 +114,7 @@ 0x0c07 - ..\..\bin\Win32-VisualStudio\Demo.exe + ..\..\bin\Win64-VisualStudio\Demo.exe ..\..\lib\Win32-visualstudio;%(AdditionalLibraryDirectories) Windows @@ -144,7 +148,7 @@ 0x0c07 - ..\..\bin\Win32-VisualStudio\Demo.exe + $(OutDir)$(TargetName)$(TargetExt) ..\..\lib\Win64-visualstudio;%(AdditionalLibraryDirectories) Windows diff --git a/examples/Demo/Demo_vc11.vcxproj b/examples/Demo/Demo_vc11.vcxproj index ecb5f330..f1db13d6 100644 --- a/examples/Demo/Demo_vc11.vcxproj +++ b/examples/Demo/Demo_vc11.vcxproj @@ -26,22 +26,22 @@ Application MultiByte - v110 + Windows7.1SDK Application MultiByte - v110 + Windows7.1SDK Application MultiByte - v110 + Windows7.1SDK Application MultiByte - v110 + Windows7.1SDK diff --git a/examples/Demo/Demo_vc12.vcxproj b/examples/Demo/Demo_vc12.vcxproj new file mode 100644 index 00000000..320adde3 --- /dev/null +++ b/examples/Demo/Demo_vc12.vcxproj @@ -0,0 +1,283 @@ + + + + + Debug + Win32 + + + Debug + x64 + + + Release + Win32 + + + Release + x64 + + + + {6F076455-D955-45D4-9C68-4AD4E45F2D47} + Demo + + + + Application + MultiByte + Windows7.1SDK + + + Application + MultiByte + Windows7.1SDK + + + Application + MultiByte + Windows7.1SDK + + + Application + MultiByte + Windows7.1SDK + + + + + + + + + + + + + + + + + + + + + + + <_ProjectFileVersion>10.0.30319.1 + ..\..\bin\Win32-VisualStudio\ + ..\..\bin\Win64-VisualStudio\ + + + ..\..\bin\Win32-VisualStudio\ + ..\..\bin\Win64-VisualStudio\ + + + AllRules.ruleset + AllRules.ruleset + + + + + AllRules.ruleset + AllRules.ruleset + + + + + + + + NDEBUG;%(PreprocessorDefinitions) + true + true + Win32 + .\Release/Demo.tlb + + + + + MaxSpeed + Default + false + ..\..\include;%(AdditionalIncludeDirectories) + WIN32;NDEBUG;_WINDOWS;%(PreprocessorDefinitions) + true + MultiThreaded + true + + + Level3 + + + NDEBUG;%(PreprocessorDefinitions) + 0x0c07 + + + ..\..\bin\Win32-VisualStudio\Demo.exe + ..\..\lib\Win32-visualstudio;%(AdditionalLibraryDirectories) + Windows + + + + + + + NDEBUG;%(PreprocessorDefinitions) + true + true + .\Release/Demo.tlb + + + + + MaxSpeed + Default + false + ..\..\include;%(AdditionalIncludeDirectories) + WIN32;WIN64;NDEBUG;_WINDOWS;%(PreprocessorDefinitions) + true + MultiThreaded + true + + + Level3 + + + NDEBUG;%(PreprocessorDefinitions) + 0x0c07 + + + $(OutDir)$(TargetName)$(TargetExt) + ..\..\lib\Win64-visualstudio;%(AdditionalLibraryDirectories) + Windows + + + + + + + _DEBUG;%(PreprocessorDefinitions) + true + true + Win32 + .\Debug/Demo.tlb + + + + + Disabled + ..\..\include;%(AdditionalIncludeDirectories) + WIN32;_DEBUG;_WINDOWS;%(PreprocessorDefinitions) + EnableFastChecks + MultiThreadedDebug + + + Level3 + EditAndContinue + + + _DEBUG;%(PreprocessorDefinitions) + 0x0c07 + + + ..\..\lib\Win32-visualstudio;%(AdditionalLibraryDirectories) + true + Windows + + + + + + + _DEBUG;%(PreprocessorDefinitions) + true + true + .\Debug/Demo.tlb + + + + + Disabled + ..\..\include;%(AdditionalIncludeDirectories) + WIN32;WIN64;_DEBUG;_WINDOWS;%(PreprocessorDefinitions) + EnableFastChecks + MultiThreadedDebug + + + Level3 + ProgramDatabase + + + _DEBUG;%(PreprocessorDefinitions) + 0x0c07 + + + ..\..\lib\Win64-visualstudio;%(AdditionalLibraryDirectories) + true + Windows + + + + + + + Disabled + Disabled + %(AdditionalIncludeDirectories) + %(AdditionalIncludeDirectories) + %(PreprocessorDefinitions) + %(PreprocessorDefinitions) + EnableFastChecks + EnableFastChecks + MaxSpeed + MaxSpeed + %(AdditionalIncludeDirectories) + %(AdditionalIncludeDirectories) + %(PreprocessorDefinitions) + %(PreprocessorDefinitions) + + + Disabled + Disabled + %(AdditionalIncludeDirectories) + %(AdditionalIncludeDirectories) + %(PreprocessorDefinitions) + %(PreprocessorDefinitions) + EnableFastChecks + EnableFastChecks + MaxSpeed + MaxSpeed + %(AdditionalIncludeDirectories) + %(AdditionalIncludeDirectories) + %(PreprocessorDefinitions) + %(PreprocessorDefinitions) + + + Disabled + Disabled + %(AdditionalIncludeDirectories) + %(AdditionalIncludeDirectories) + %(PreprocessorDefinitions) + %(PreprocessorDefinitions) + EnableFastChecks + EnableFastChecks + MaxSpeed + MaxSpeed + %(AdditionalIncludeDirectories) + %(AdditionalIncludeDirectories) + %(PreprocessorDefinitions) + %(PreprocessorDefinitions) + + + + + + + + + + + + + \ No newline at end of file diff --git a/examples/Demo/Demo_vc14.vcxproj b/examples/Demo/Demo_vc14.vcxproj new file mode 100644 index 00000000..cb85feb3 --- /dev/null +++ b/examples/Demo/Demo_vc14.vcxproj @@ -0,0 +1,283 @@ + + + + + Debug + Win32 + + + Debug + x64 + + + Release + Win32 + + + Release + x64 + + + + {6F076455-D955-45D4-9C68-4AD4E45F2D47} + Demo + + + + Application + MultiByte + v140 + + + Application + MultiByte + v140 + + + Application + MultiByte + v140 + + + Application + MultiByte + v140 + + + + + + + + + + + + + + + + + + + + + + + <_ProjectFileVersion>10.0.30319.1 + ..\..\bin\Win32-VisualStudio\ + ..\..\bin\Win64-VisualStudio\ + + + ..\..\bin\Win32-VisualStudio\ + ..\..\bin\Win64-VisualStudio\ + + + AllRules.ruleset + AllRules.ruleset + + + + + AllRules.ruleset + AllRules.ruleset + + + + + + + + NDEBUG;%(PreprocessorDefinitions) + true + true + Win32 + .\Release/Demo.tlb + + + + + MaxSpeed + Default + false + ..\..\include;%(AdditionalIncludeDirectories) + WIN32;NDEBUG;_WINDOWS;%(PreprocessorDefinitions) + true + MultiThreaded + true + + + Level3 + + + NDEBUG;%(PreprocessorDefinitions) + 0x0c07 + + + ..\..\bin\Win32-VisualStudio\Demo.exe + ..\..\lib\Win32-visualstudio;%(AdditionalLibraryDirectories) + Windows + + + + + + + NDEBUG;%(PreprocessorDefinitions) + true + true + .\Release/Demo.tlb + + + + + MaxSpeed + Default + false + ..\..\include;%(AdditionalIncludeDirectories) + WIN32;WIN64;NDEBUG;_WINDOWS;%(PreprocessorDefinitions) + true + MultiThreaded + true + + + Level3 + + + NDEBUG;%(PreprocessorDefinitions) + 0x0c07 + + + $(OutDir)$(TargetName)$(TargetExt) + ..\..\lib\Win64-visualstudio;%(AdditionalLibraryDirectories) + Windows + + + + + + + _DEBUG;%(PreprocessorDefinitions) + true + true + Win32 + .\Debug/Demo.tlb + + + + + Disabled + ..\..\include;%(AdditionalIncludeDirectories) + WIN32;_DEBUG;_WINDOWS;%(PreprocessorDefinitions) + EnableFastChecks + MultiThreadedDebug + + + Level3 + EditAndContinue + + + _DEBUG;%(PreprocessorDefinitions) + 0x0c07 + + + ..\..\lib\Win32-visualstudio;%(AdditionalLibraryDirectories) + true + Windows + + + + + + + _DEBUG;%(PreprocessorDefinitions) + true + true + .\Debug/Demo.tlb + + + + + Disabled + ..\..\include;%(AdditionalIncludeDirectories) + WIN32;WIN64;_DEBUG;_WINDOWS;%(PreprocessorDefinitions) + EnableFastChecks + MultiThreadedDebug + + + Level3 + ProgramDatabase + + + _DEBUG;%(PreprocessorDefinitions) + 0x0c07 + + + ..\..\lib\Win64-visualstudio;%(AdditionalLibraryDirectories) + true + Windows + + + + + + + Disabled + Disabled + %(AdditionalIncludeDirectories) + %(AdditionalIncludeDirectories) + %(PreprocessorDefinitions) + %(PreprocessorDefinitions) + EnableFastChecks + EnableFastChecks + MaxSpeed + MaxSpeed + %(AdditionalIncludeDirectories) + %(AdditionalIncludeDirectories) + %(PreprocessorDefinitions) + %(PreprocessorDefinitions) + + + Disabled + Disabled + %(AdditionalIncludeDirectories) + %(AdditionalIncludeDirectories) + %(PreprocessorDefinitions) + %(PreprocessorDefinitions) + EnableFastChecks + EnableFastChecks + MaxSpeed + MaxSpeed + %(AdditionalIncludeDirectories) + %(AdditionalIncludeDirectories) + %(PreprocessorDefinitions) + %(PreprocessorDefinitions) + + + Disabled + Disabled + %(AdditionalIncludeDirectories) + %(AdditionalIncludeDirectories) + %(PreprocessorDefinitions) + %(PreprocessorDefinitions) + EnableFastChecks + EnableFastChecks + MaxSpeed + MaxSpeed + %(AdditionalIncludeDirectories) + %(AdditionalIncludeDirectories) + %(PreprocessorDefinitions) + %(PreprocessorDefinitions) + + + + + + + + + + + + + \ No newline at end of file diff --git a/examples/Demo/Demo_vc8.vcproj b/examples/Demo/Demo_vc8.vcproj deleted file mode 100644 index 55043108..00000000 --- a/examples/Demo/Demo_vc8.vcproj +++ /dev/null @@ -1,300 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/examples/Demo/Demo_vc9.vcproj b/examples/Demo/Demo_vc9.vcproj deleted file mode 100644 index e0052aae..00000000 --- a/examples/Demo/Demo_vc9.vcproj +++ /dev/null @@ -1,300 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/examples/Demo/demo.dev b/examples/Demo/demo.dev deleted file mode 100644 index 9e1b4c09..00000000 --- a/examples/Demo/demo.dev +++ /dev/null @@ -1,99 +0,0 @@ -[Project] -FileName=demo.dev -Name=Irrlicht Tech Demo -UnitCount=5 -Type=1 -Ver=1 -ObjFiles= -Includes=..\..\include -Libs= -PrivateResource= -ResourceIncludes= -MakeIncludes= -Compiler= -CppCompiler= -Linker=../../lib/Win32-gcc/libIrrlicht.a_@@_ -IsCpp=1 -Icon= -ExeOutput=../../bin/Win32-gcc -ObjectOutput=obj -OverrideOutput=1 -OverrideOutputName=Demo.exe -HostApplication= -Folders= -CommandLine= -IncludeVersionInfo=0 -SupportXPThemes=0 -CompilerSet=0 -CompilerSettings=0000000000000000000000 -UseCustomMakefile=0 -CustomMakefile= - -[Unit1] -FileName=main.cpp -CompileCpp=1 -Folder=Projekt1 -Compile=1 -Link=1 -Priority=1000 -OverrideBuildCmd=0 -BuildCmd= - -[VersionInfo] -Major=0 -Minor=1 -Release=1 -Build=1 -LanguageID=1033 -CharsetID=1252 -CompanyName= -FileVersion= -FileDescription=Irrlicht Engine example compiled using DevCpp and gcc -InternalName= -LegalCopyright= -LegalTrademarks= -OriginalFilename= -ProductName= -ProductVersion= -AutoIncBuildNr=0 - -[Unit2] -FileName=CDemo.h -CompileCpp=1 -Folder=Irrlicht Tech Demo -Compile=1 -Link=1 -Priority=1000 -OverrideBuildCmd=0 -BuildCmd= - -[Unit3] -FileName=CMainMenu.cpp -CompileCpp=1 -Folder=Irrlicht Tech Demo -Compile=1 -Link=1 -Priority=1000 -OverrideBuildCmd=0 -BuildCmd= - -[Unit4] -FileName=CMainMenu.h -CompileCpp=1 -Folder=Irrlicht Tech Demo -Compile=1 -Link=1 -Priority=1000 -OverrideBuildCmd=0 -BuildCmd= - -[Unit5] -FileName=CDemo.cpp -CompileCpp=1 -Folder=Irrlicht Tech Demo -Compile=1 -Link=1 -Priority=1000 -OverrideBuildCmd=0 -BuildCmd= - diff --git a/examples/Demo/main.cpp b/examples/Demo/main.cpp index 3d269990..711910d8 100644 --- a/examples/Demo/main.cpp +++ b/examples/Demo/main.cpp @@ -13,7 +13,7 @@ using namespace irr; -#ifdef _WIN32 +#ifdef _MSC_VER #pragma comment(lib, "Irrlicht.lib") INT WINAPI WinMain( HINSTANCE hInst, HINSTANCE, LPSTR strCmdLine, INT ) diff --git a/include/CMeshBuffer.h b/include/CMeshBuffer.h index 7512a38f..4ab79683 100644 --- a/include/CMeshBuffer.h +++ b/include/CMeshBuffer.h @@ -21,7 +21,7 @@ namespace scene CMeshBuffer():ChangedID_Vertex(1),ChangedID_Index(1),MappingHint_Vertex(EHM_NEVER), MappingHint_Index(EHM_NEVER) { #ifdef _DEBUG - setDebugName("SMeshBuffer"); + setDebugName("CMeshBuffer"); #endif } diff --git a/include/EDriverTypes.h b/include/EDriverTypes.h index 3a92f4f0..f22f7646 100644 --- a/include/EDriverTypes.h +++ b/include/EDriverTypes.h @@ -39,10 +39,8 @@ namespace video contribution. */ EDT_BURNINGSVIDEO, - //! Direct3D8 device, only available on Win32 platforms. - /** Performs hardware accelerated rendering of 3D and 2D - primitives. */ - EDT_DIRECT3D8, + //! Direct3D8 device is longer supported in Irrlicht. You have to go back to Irrlicht 1.8 if you still need that. + DEPRECATED_EDT_DIRECT3D8_NO_LONGER_EXISTS, // keep enum to avoid breaking enumeration order (might be used in ini-files, serialization, etc) //! Direct3D 9 device, only available on Win32 platforms. /** Performs hardware accelerated rendering of 3D and 2D @@ -77,7 +75,17 @@ namespace video "OpenGL ES2", 0 }; - + + const c8* const DRIVER_TYPE_NAMES_SHORT[] = + { + "null", + "software", + "burning", + "d3d8", + "d3d9", + "opengl", + 0 + }; } // end namespace video } // end namespace irr diff --git a/include/EMeshWriterEnums.h b/include/EMeshWriterEnums.h index fb2cfa4b..11f2e299 100644 --- a/include/EMeshWriterEnums.h +++ b/include/EMeshWriterEnums.h @@ -31,7 +31,10 @@ namespace scene EMWT_OBJ = MAKE_IRR_ID('o','b','j',0), //! PLY mesh writer for .ply files - EMWT_PLY = MAKE_IRR_ID('p','l','y',0) + EMWT_PLY = MAKE_IRR_ID('p','l','y',0), + + //! B3D mesh writer, for static .b3d files + EMWT_B3D = MAKE_IRR_ID('b', '3', 'd', 0) }; diff --git a/include/IAnimatedMesh.h b/include/IAnimatedMesh.h index 3e08528d..d7dd77fe 100644 --- a/include/IAnimatedMesh.h +++ b/include/IAnimatedMesh.h @@ -12,48 +12,6 @@ namespace irr { namespace scene { - //! Possible types of (animated) meshes. - enum E_ANIMATED_MESH_TYPE - { - //! Unknown animated mesh type. - EAMT_UNKNOWN = 0, - - //! Quake 2 MD2 model file - EAMT_MD2, - - //! Quake 3 MD3 model file - EAMT_MD3, - - //! Maya .obj static model - EAMT_OBJ, - - //! Quake 3 .bsp static Map - EAMT_BSP, - - //! 3D Studio .3ds file - EAMT_3DS, - - //! My3D Mesh, the file format by Zhuck Dimitry - EAMT_MY3D, - - //! Pulsar LMTools .lmts file. This Irrlicht loader was written by Jonas Petersen - EAMT_LMTS, - - //! Cartography Shop .csm file. This loader was created by Saurav Mohapatra. - EAMT_CSM, - - //! .oct file for Paul Nette's FSRad or from Murphy McCauley's Blender .oct exporter. - /** The oct file format contains 3D geometry and lightmaps and - can be loaded directly by Irrlicht */ - EAMT_OCT, - - //! Halflife MDL model file - EAMT_MDL_HALFLIFE, - - //! generic skinned mesh - EAMT_SKINNED - }; - //! Interface for an animated mesh. /** There are already simple implementations of this interface available so you don't have to implement this interface on your own if you need to: @@ -64,8 +22,9 @@ namespace scene public: //! Gets the frame count of the animated mesh. - /** \return The amount of frames. If the amount is 1, - it is a static, non animated mesh. */ + /** Note that the play-time is usually getFrameCount()-1 as it stops as soon as the last frame-key is reached. + \return The amount of frames. If the amount is 1, + it is a static, non animated mesh. */ virtual u32 getFrameCount() const = 0; //! Gets the animation speed of the animated mesh. diff --git a/include/IAnimatedMeshSceneNode.h b/include/IAnimatedMeshSceneNode.h index 84d25a2a..3ccd52dd 100644 --- a/include/IAnimatedMeshSceneNode.h +++ b/include/IAnimatedMeshSceneNode.h @@ -72,7 +72,11 @@ namespace scene virtual void setCurrentFrame(f32 frame) = 0; //! Sets the frame numbers between the animation is looped. - /** The default is 0 - MaximalFrameCount of the mesh. + /** The default is 0 to getFrameCount()-1 of the mesh. + Number of played frames is end-start. + It interpolates toward the last frame but stops when it is reached. + It does not interpolate back to start even when looping. + Looping animations should ensure last and first frame-key are identical. \param begin: Start frame number of the loop. \param end: End frame number of the loop. \return True if successful, false if not. */ diff --git a/include/ICameraSceneNode.h b/include/ICameraSceneNode.h index 213e6ead..e576256a 100644 --- a/include/ICameraSceneNode.h +++ b/include/ICameraSceneNode.h @@ -14,9 +14,9 @@ namespace scene { struct SViewFrustum; - //! Scene Node which is a (controlable) camera. + //! Scene Node which is a (controllable) camera. /** The whole scene will be rendered from the cameras point of view. - Because the ICameraScenNode is a SceneNode, it can be attached to any + Because the ICameraSceneNode is a SceneNode, it can be attached to any other scene node, and will follow its parents movement, rotation and so on. */ @@ -135,8 +135,7 @@ namespace scene virtual void setFOV(f32 fovy) =0; //! Get the view frustum. - /** Needed sometimes by bspTree or LOD render nodes. - \return The current view frustum. */ + /** \return The current view frustum. */ virtual const SViewFrustum* getViewFrustum() const =0; //! Disables or enables the camera to get key or mouse inputs. @@ -150,7 +149,6 @@ namespace scene //! Checks if a camera is orthogonal. virtual bool isOrthogonal() const { - _IRR_IMPLEMENT_MANAGED_MARSHALLING_BUGFIX; return IsOrthogonal; } @@ -161,7 +159,7 @@ namespace scene point at the target point. FPS camera use this binding by default; other cameras do not. \param bound True to bind the camera's scene node rotation - and targetting, false to unbind them. + and targeting, false to unbind them. @see getTargetAndRotationBinding() */ virtual void bindTargetAndRotation(bool bound) =0; diff --git a/include/IEventReceiver.h b/include/IEventReceiver.h index ae40457c..11809102 100644 --- a/include/IEventReceiver.h +++ b/include/IEventReceiver.h @@ -455,7 +455,7 @@ struct SEvent AXIS_R, // e.g. rudder, or analog 2 stick 2 top to bottom AXIS_U, AXIS_V, - NUMBER_OF_AXES + NUMBER_OF_AXES=18 // (please tell Irrlicht maintainers if you absolutely need more axes) }; /** A bitmap of button states. You can use IsButtonPressed() to diff --git a/include/IGUIElement.h b/include/IGUIElement.h index 66fe895c..3b1316a6 100644 --- a/include/IGUIElement.h +++ b/include/IGUIElement.h @@ -342,7 +342,6 @@ public: //! Returns true if element is visible. virtual bool isVisible() const { - _IRR_IMPLEMENT_MANAGED_MARSHALLING_BUGFIX; return IsVisible; } @@ -351,7 +350,6 @@ public: false if this or any parent element is invisible. */ virtual bool isTrulyVisible() const { - _IRR_IMPLEMENT_MANAGED_MARSHALLING_BUGFIX; if(!IsVisible) return false; @@ -371,7 +369,6 @@ public: //! Returns true if this element was created as part of its parent control virtual bool isSubElement() const { - _IRR_IMPLEMENT_MANAGED_MARSHALLING_BUGFIX; return IsSubElement; } @@ -397,7 +394,6 @@ public: //! Returns true if this element can be focused by navigating with the tab key bool isTabStop() const { - _IRR_IMPLEMENT_MANAGED_MARSHALLING_BUGFIX; return IsTabStop; } @@ -451,7 +447,6 @@ public: //! Returns true if this element is a tab group. bool isTabGroup() const { - _IRR_IMPLEMENT_MANAGED_MARSHALLING_BUGFIX; return IsTabGroup; } @@ -478,7 +473,6 @@ public: if ( isSubElement() && IsEnabled && getParent() ) return getParent()->isEnabled(); - _IRR_IMPLEMENT_MANAGED_MARSHALLING_BUGFIX; return IsEnabled; } @@ -554,7 +548,6 @@ public: } } - _IRR_IMPLEMENT_MANAGED_MARSHALLING_BUGFIX; return false; } @@ -576,7 +569,6 @@ public: } } - _IRR_IMPLEMENT_MANAGED_MARSHALLING_BUGFIX; return false; } @@ -628,7 +620,7 @@ public: } while (child->Parent && child != this); - _IRR_IMPLEMENT_MANAGED_MARSHALLING_BUGFIX; + return child == this; } @@ -711,13 +703,11 @@ public: // search within children if ((*it)->getNextElement(startOrder, reverse, group, first, closest)) { - _IRR_IMPLEMENT_MANAGED_MARSHALLING_BUGFIX; return true; } } ++it; } - _IRR_IMPLEMENT_MANAGED_MARSHALLING_BUGFIX; return false; } diff --git a/include/IGUITreeView.h b/include/IGUITreeView.h index 95bf5857..e28cead9 100644 --- a/include/IGUITreeView.h +++ b/include/IGUITreeView.h @@ -253,6 +253,19 @@ namespace gui */ virtual void setIconFont( IGUIFont* font ) = 0; + //! Sets a skin independent font. + /** \param font: New font to set or 0 to use the skin-font. */ + virtual void setOverrideFont(IGUIFont* font=0) = 0; + + //! Gets the override font (if any) + /** \return The override font (may be 0) */ + virtual IGUIFont* getOverrideFont(void) const = 0; + + //! Get the font which is used for drawing + /** This is the override font when one is set and the + font of the skin otherwise. */ + virtual IGUIFont* getActiveFont() const = 0; + //! Sets the image list which should be used for the image and selected image of every node. /** The default is 0 (no images). */ virtual void setImageList( IGUIImageList* imageList ) = 0; diff --git a/include/IImage.h b/include/IImage.h index eb30a916..2031fa5e 100644 --- a/include/IImage.h +++ b/include/IImage.h @@ -9,6 +9,7 @@ #include "position2d.h" #include "rect.h" #include "SColor.h" +#include namespace irr { @@ -23,33 +24,215 @@ class IImage : public virtual IReferenceCounted { public: + //! constructor + IImage(ECOLOR_FORMAT format, const core::dimension2d& size, bool deleteMemory) : + Format(format), Size(size), Data(0), MipMapsData(0), BytesPerPixel(0), Pitch(0), + DeleteMemory(deleteMemory), DeleteMipMapsMemory(false) + { + BytesPerPixel = getBitsPerPixelFromFormat(Format) / 8; + Pitch = BytesPerPixel * Size.Width; + } + + //! destructor + virtual ~IImage() + { + if (DeleteMemory) + delete[] Data; + + if (DeleteMipMapsMemory) + delete[] MipMapsData; + } + + //! Returns the color format + ECOLOR_FORMAT getColorFormat() const + { + return Format; + } + + //! Returns width and height of image data. + const core::dimension2d& getDimension() const + { + return Size; + } + + //! Returns bits per pixel. + u32 getBitsPerPixel() const + { + + return getBitsPerPixelFromFormat(Format); + } + + //! Returns bytes per pixel + u32 getBytesPerPixel() const + { + return BytesPerPixel; + } + + //! Returns image data size in bytes + u32 getImageDataSizeInBytes() const + { + return getDataSizeFromFormat(Format, Size.Width, Size.Height); + } + + //! Returns image data size in pixels + u32 getImageDataSizeInPixels() const + { + return Size.Width * Size.Height; + } + + //! Returns pitch of image + u32 getPitch() const + { + return Pitch; + } + + //! Returns mask for red value of a pixel + u32 getRedMask() const + { + switch (Format) + { + case ECF_A1R5G5B5: + return 0x1F << 10; + case ECF_R5G6B5: + return 0x1F << 11; + case ECF_R8G8B8: + return 0x00FF0000; + case ECF_A8R8G8B8: + return 0x00FF0000; + default: + return 0x0; + } + } + + //! Returns mask for green value of a pixel + u32 getGreenMask() const + { + switch (Format) + { + case ECF_A1R5G5B5: + return 0x1F << 5; + case ECF_R5G6B5: + return 0x3F << 5; + case ECF_R8G8B8: + return 0x0000FF00; + case ECF_A8R8G8B8: + return 0x0000FF00; + default: + return 0x0; + } + } + + //! Returns mask for blue value of a pixel + u32 getBlueMask() const + { + switch (Format) + { + case ECF_A1R5G5B5: + return 0x1F; + case ECF_R5G6B5: + return 0x1F; + case ECF_R8G8B8: + return 0x000000FF; + case ECF_A8R8G8B8: + return 0x000000FF; + default: + return 0x0; + } + } + + //! Returns mask for alpha value of a pixel + u32 getAlphaMask() const + { + switch (Format) + { + case ECF_A1R5G5B5: + return 0x1 << 15; + case ECF_R5G6B5: + return 0x0; + case ECF_R8G8B8: + return 0x0; + case ECF_A8R8G8B8: + return 0xFF000000; + default: + return 0x0; + } + } + + //! Use this to get a pointer to the image data. + void* getData() const + { + return Data; + } + //! Lock function. Use this to get a pointer to the image data. /** After you don't need the pointer anymore, you must call unlock(). \return Pointer to the image data. What type of data is pointed to depends on the color format of the image. For example if the color format is ECF_A8R8G8B8, it is of u32. Be sure to call unlock() after you don't need the pointer any more. */ - virtual void* lock() = 0; + _IRR_DEPRECATED_ void* lock() + { + return getData(); + } //! Unlock function. /** Should be called after the pointer received by lock() is not needed anymore. */ - virtual void unlock() = 0; + _IRR_DEPRECATED_ void unlock() + { + } - //! Returns width and height of image data. - virtual const core::dimension2d& getDimension() const = 0; + //! Get mipmaps data. + void* getMipMapsData() const + { + return MipMapsData; + } - //! Returns bits per pixel. - virtual u32 getBitsPerPixel() const = 0; + //! Set mipmaps data. + /** This method allows you to put custom mipmaps data for + image. + \param data A byte array with pixel color information + \param ownForeignMemory If true, the image will use the data + pointer directly and own it afterwards. If false, the memory + will by copied internally. + \param deleteMemory Whether the memory is deallocated upon + destruction. */ + void setMipMapsData(void* data, bool ownForeignMemory, bool deleteMemory) + { + if (DeleteMipMapsMemory && data != MipMapsData) + delete[] MipMapsData; - //! Returns bytes per pixel - virtual u32 getBytesPerPixel() const = 0; + if (data) + { + if (ownForeignMemory) + { + DeleteMipMapsMemory = deleteMemory; + MipMapsData = static_cast(data); + } + else + { + u32 dataSize = 0; + u32 width = Size.Width; + u32 height = Size.Height; - //! Returns image data size in bytes - virtual u32 getImageDataSizeInBytes() const = 0; + do + { + if (width > 1) + width >>= 1; - //! Returns image data size in pixels - virtual u32 getImageDataSizeInPixels() const = 0; + if (height > 1) + height >>= 1; + + dataSize += getDataSizeFromFormat(Format, width, height); + } + while (width != 1 || height != 1); + + DeleteMipMapsMemory = true; + MipMapsData = new u8[dataSize]; + memcpy(MipMapsData, data, dataSize); + } + } + } //! Returns a pixel virtual SColor getPixel(u32 x, u32 y) const = 0; @@ -57,24 +240,6 @@ public: //! Sets a pixel virtual void setPixel(u32 x, u32 y, const SColor &color, bool blend = false ) = 0; - //! Returns the color format - virtual ECOLOR_FORMAT getColorFormat() const = 0; - - //! Returns mask for red value of a pixel - virtual u32 getRedMask() const = 0; - - //! Returns mask for green value of a pixel - virtual u32 getGreenMask() const = 0; - - //! Returns mask for blue value of a pixel - virtual u32 getBlueMask() const = 0; - - //! Returns mask for alpha value of a pixel - virtual u32 getAlphaMask() const = 0; - - //! Returns pitch of image - virtual u32 getPitch() const =0; - //! Copies the image into the target, scaling the image to fit virtual void copyToScaling(void* target, u32 width, u32 height, ECOLOR_FORMAT format=ECF_A8R8G8B8, u32 pitch=0) =0; @@ -99,11 +264,17 @@ public: virtual void fill(const SColor &color) =0; //! Inform whether the image is compressed - virtual bool isCompressed() const = 0; + _IRR_DEPRECATED_ bool isCompressed() const + { + return IImage::isCompressedFormat(Format); + } //! Check whether the image has MipMaps /** \return True if image has MipMaps, else false. */ - virtual bool hasMipMaps() const = 0; + _IRR_DEPRECATED_ bool hasMipMaps() const + { + return (getMipMapsData() != 0); + } //! get the amount of Bits per Pixel of the given color format static u32 getBitsPerPixelFromFormat(const ECOLOR_FORMAT format) @@ -152,57 +323,70 @@ public: return 64; case ECF_A32B32G32R32F: return 128; + case ECF_R8: + return 8; + case ECF_R8G8: + return 16; + case ECF_R16: + return 16; + case ECF_R16G16: + return 32; + case ECF_D16: + return 16; + case ECF_D32: + return 32; + case ECF_D24S8: + return 32; default: return 0; } } - //! calculate compressed image size for selected width and height. - static u32 getCompressedImageSize(ECOLOR_FORMAT format, u32 width, u32 height) + //! calculate image data size in bytes for selected format, width and height. + static u32 getDataSizeFromFormat(ECOLOR_FORMAT format, u32 width, u32 height) { - if (!isCompressedFormat(format)) - return 0; - - u32 compressedImageSize = 0; + u32 imageSize = 0; switch (format) { - case ECF_DXT1: - compressedImageSize = ((width + 3) / 4) * ((height + 3) / 4) * 8; - break; - case ECF_DXT2: - case ECF_DXT3: - case ECF_DXT4: - case ECF_DXT5: - compressedImageSize = ((width + 3) / 4) * ((height + 3) / 4) * 16; - break; - case ECF_PVRTC_RGB2: - case ECF_PVRTC_ARGB2: - compressedImageSize = (core::max_(width, 16) * core::max_(height, 8) * 2 + 7) / 8; - break; - case ECF_PVRTC_RGB4: - case ECF_PVRTC_ARGB4: - compressedImageSize = (core::max_(width, 8) * core::max_(height, 8) * 4 + 7) / 8; - break; - case ECF_PVRTC2_ARGB2: - compressedImageSize = core::ceil32(width / 8.0f) * core::ceil32(height / 4.0f) * 8; - break; - case ECF_PVRTC2_ARGB4: - case ECF_ETC1: - case ECF_ETC2_RGB: - compressedImageSize = core::ceil32(width / 4.0f) * core::ceil32(height / 4.0f) * 8; - break; - case ECF_ETC2_ARGB: - compressedImageSize = core::ceil32(width / 4.0f) * core::ceil32(height / 4.0f) * 16; - break; - default: - break; + case ECF_DXT1: + imageSize = ((width + 3) / 4) * ((height + 3) / 4) * 8; + break; + case ECF_DXT2: + case ECF_DXT3: + case ECF_DXT4: + case ECF_DXT5: + imageSize = ((width + 3) / 4) * ((height + 3) / 4) * 16; + break; + case ECF_PVRTC_RGB2: + case ECF_PVRTC_ARGB2: + imageSize = (core::max_(width, 16) * core::max_(height, 8) * 2 + 7) / 8; + break; + case ECF_PVRTC_RGB4: + case ECF_PVRTC_ARGB4: + imageSize = (core::max_(width, 8) * core::max_(height, 8) * 4 + 7) / 8; + break; + case ECF_PVRTC2_ARGB2: + imageSize = core::ceil32(width / 8.0f) * core::ceil32(height / 4.0f) * 8; + break; + case ECF_PVRTC2_ARGB4: + case ECF_ETC1: + case ECF_ETC2_RGB: + imageSize = core::ceil32(width / 4.0f) * core::ceil32(height / 4.0f) * 8; + break; + case ECF_ETC2_ARGB: + imageSize = core::ceil32(width / 4.0f) * core::ceil32(height / 4.0f) * 16; + break; + default: // uncompressed formats + imageSize = getBitsPerPixelFromFormat(format) / 8 * width; + imageSize *= height; + break; } - return compressedImageSize; + return imageSize; } - //! test if this is compressed color format + //! check if this is compressed color format static bool isCompressedFormat(const ECOLOR_FORMAT format) { switch(format) @@ -227,7 +411,21 @@ public: } } - //! test if the color format is only viable for RenderTarget textures + //! check if the color format is only viable for depth/stencil textures + static bool isDepthFormat(const ECOLOR_FORMAT format) + { + switch(format) + { + case ECF_D16: + case ECF_D32: + case ECF_D24S8: + return true; + default: + return false; + } + } + + //! check if the color format is only viable for RenderTarget textures /** Since we don't have support for e.g. floating point IImage formats one should test if the color format can be used for arbitrary usage, or if it is restricted to RTTs. */ @@ -242,12 +440,29 @@ public: case ECF_R5G6B5: case ECF_R8G8B8: case ECF_A8R8G8B8: + case ECF_DXT1: + case ECF_DXT2: + case ECF_DXT3: + case ECF_DXT4: + case ECF_DXT5: return false; default: return true; } } +protected: + ECOLOR_FORMAT Format; + core::dimension2d Size; + + u8* Data; + u8* MipMapsData; + + u32 BytesPerPixel; + u32 Pitch; + + bool DeleteMemory; + bool DeleteMipMapsMemory; }; } // end namespace video diff --git a/include/IMaterialRenderer.h b/include/IMaterialRenderer.h index 1828a712..145782a0 100644 --- a/include/IMaterialRenderer.h +++ b/include/IMaterialRenderer.h @@ -66,7 +66,7 @@ public: \return Returns true if everything is ok, and false if nothing should be rendered. The material renderer can choose to return false for example if he doesn't support the specified vertex type. This is - actually done in D3D8 and D3D9 when using a normal mapped material with + actually done in D3D9 when using a normal mapped material with a vertex type other than EVT_TANGENTS. */ virtual bool OnRender(IMaterialRendererServices* service, E_VERTEX_TYPE vtxtype) { return true; } diff --git a/include/IMesh.h b/include/IMesh.h index 8e0bcc2d..1650e595 100644 --- a/include/IMesh.h +++ b/include/IMesh.h @@ -13,6 +13,54 @@ namespace irr { namespace scene { + //! Possible types of meshes. + // Note: Was previously only used in IAnimatedMesh so it still has the "animated" in the name. + // But can now be used for all mesh-types as we need those casts as well. + enum E_ANIMATED_MESH_TYPE + { + //! Unknown animated mesh type. + EAMT_UNKNOWN = 0, + + //! Quake 2 MD2 model file + EAMT_MD2, + + //! Quake 3 MD3 model file + EAMT_MD3, + + //! Maya .obj static model + EAMT_OBJ, + + //! Quake 3 .bsp static Map + EAMT_BSP, + + //! 3D Studio .3ds file + EAMT_3DS, + + //! My3D Mesh, the file format by Zhuck Dimitry + EAMT_MY3D, + + //! Pulsar LMTools .lmts file. This Irrlicht loader was written by Jonas Petersen + EAMT_LMTS, + + //! Cartography Shop .csm file. This loader was created by Saurav Mohapatra. + EAMT_CSM, + + //! .oct file for Paul Nette's FSRad or from Murphy McCauley's Blender .oct exporter. + /** The oct file format contains 3D geometry and lightmaps and + can be loaded directly by Irrlicht */ + EAMT_OCT, + + //! Halflife MDL model file + EAMT_MDL_HALFLIFE, + + //! generic skinned mesh + EAMT_SKINNED, + + //! generig non-animated mesh + EAMT_STATIC + }; + + class IMeshBuffer; //! Class which holds the geometry of an object. @@ -66,6 +114,17 @@ namespace scene indices have changed. Otherwise, changes won't be updated on the GPU in the next render cycle. */ virtual void setDirty(E_BUFFER_TYPE buffer=EBT_VERTEX_AND_INDEX) = 0; + + //! Returns the type of the meshes. + /** This is useful for making a safe downcast. For example, + if getMeshType() returns EAMT_MD2 it's safe to cast the + IMesh to IAnimatedMeshMD2. + Note: It's no longer just about animated meshes, that name has just historical reasons. + \returns Type of the mesh */ + virtual E_ANIMATED_MESH_TYPE getMeshType() const + { + return EAMT_STATIC; + } }; } // end namespace scene diff --git a/include/IMeshWriter.h b/include/IMeshWriter.h index 555a7988..f7c1820a 100644 --- a/include/IMeshWriter.h +++ b/include/IMeshWriter.h @@ -43,7 +43,7 @@ namespace scene s32 flags=EMWF_NONE) = 0; // Writes an animated mesh - // for future use, no writer is able to write animated meshes currently + // for future use, only b3d writer is able to write animated meshes currently and that was implemented using the writeMesh above. /* \return Returns true if sucessful */ //virtual bool writeAnimatedMesh(io::IWriteFile* file, // scene::IAnimatedMesh* mesh, diff --git a/include/IRenderTarget.h b/include/IRenderTarget.h new file mode 100644 index 00000000..7850e0ac --- /dev/null +++ b/include/IRenderTarget.h @@ -0,0 +1,65 @@ +// Copyright (C) 2015 Patryk Nadrowski +// This file is part of the "Irrlicht Engine". +// For conditions of distribution and use, see copyright notice in irrlicht.h + +#ifndef __I_RENDER_TARGET_H_INCLUDED__ +#define __I_RENDER_TARGET_H_INCLUDED__ + +#include "IReferenceCounted.h" +#include "EDriverTypes.h" +#include "irrArray.h" + +namespace irr +{ +namespace video +{ + class ITexture; + + //! Interface of a Render Target. + class IRenderTarget : public virtual IReferenceCounted + { + public: + + //! constructor + IRenderTarget() : DepthStencil(0), DriverType(EDT_NULL) + { + } + + //! Set multiple textures. + /** Set multiple textures for the render target. + \param texture Array of texture objects. These textures are used for a color outputs. + \param depthStencil Depth or packed depth-stencil texture. This texture is used as depth + or depth-stencil buffer. */ + virtual void setTexture(const core::array& texture, ITexture* depthStencil) = 0; + + //! Set one texture. + void setTexture(ITexture* texture, ITexture* depthStencil) + { + core::array textureArray(1); + textureArray.push_back(texture); + + setTexture(textureArray, depthStencil); + } + + //! Get driver type of render target. + E_DRIVER_TYPE getDriverType() const + { + return DriverType; + } + + protected: + + //! Textures assigned to render target. + core::array Texture; + + //! Depth or packed depth-stencil texture assigned to render target. + ITexture* DepthStencil; + + //! Driver type of render target. + E_DRIVER_TYPE DriverType; + }; + +} +} + +#endif diff --git a/include/ISceneNode.h b/include/ISceneNode.h index 04764eeb..1e903857 100644 --- a/include/ISceneNode.h +++ b/include/ISceneNode.h @@ -242,7 +242,6 @@ namespace scene visible (if all parents are also visible). */ virtual bool isVisible() const { - _IRR_IMPLEMENT_MANAGED_MARSHALLING_BUGFIX; return IsVisible; } @@ -251,7 +250,6 @@ namespace scene false if this or any parent node is invisible. */ virtual bool isTrulyVisible() const { - _IRR_IMPLEMENT_MANAGED_MARSHALLING_BUGFIX; if(!IsVisible) return false; @@ -328,7 +326,6 @@ namespace scene return true; } - _IRR_IMPLEMENT_MANAGED_MARSHALLING_BUGFIX; return false; } @@ -595,7 +592,6 @@ namespace scene \return If this node is a debug object, true is returned. */ bool isDebugObject() const { - _IRR_IMPLEMENT_MANAGED_MARSHALLING_BUGFIX; return IsDebugObject; } @@ -735,7 +731,7 @@ namespace scene setPosition(in->getAttributeAsVector3d("Position", RelativeTranslation)); setRotation(in->getAttributeAsVector3d("Rotation", RelativeRotation)); - setScale(in->getAttributeAsVector3d("Scale", RelativeRotation)); + setScale(in->getAttributeAsVector3d("Scale", RelativeScale)); IsVisible = in->getAttributeAsBool("Visible", IsVisible); if (in->existsAttribute("AutomaticCulling")) diff --git a/include/ISceneNodeAnimator.h b/include/ISceneNodeAnimator.h index 6a727d4e..307e23be 100644 --- a/include/ISceneNodeAnimator.h +++ b/include/ISceneNodeAnimator.h @@ -55,7 +55,7 @@ namespace scene } //! Event receiver, override this function for camera controlling animators - virtual bool OnEvent(const SEvent& event) + virtual bool OnEvent(const SEvent& event) _IRR_OVERRIDE_ { return false; } diff --git a/include/ISceneNodeAnimatorCameraMaya.h b/include/ISceneNodeAnimatorCameraMaya.h index 94bd2e57..333e7137 100644 --- a/include/ISceneNodeAnimatorCameraMaya.h +++ b/include/ISceneNodeAnimatorCameraMaya.h @@ -49,6 +49,13 @@ namespace scene //! Set the distance virtual void setDistance(f32 distance) = 0; + + //! Set the minimal distance to the camera target for zoom + virtual void setTargetMinDistance(f32 minDistance) = 0; + + //! Returns the minimal distance to the camera target for zoom + virtual f32 getTargetMinDistance() const = 0; + }; } // end namespace scene diff --git a/include/ITexture.h b/include/ITexture.h index 8e16bc8a..b9f4b8fd 100644 --- a/include/ITexture.h +++ b/include/ITexture.h @@ -151,7 +151,8 @@ class ITexture : public virtual IReferenceCounted public: //! constructor - ITexture(const io::path& name, E_TEXTURE_TYPE type = ETT_2D) : NamedPath(name), Source(ETS_UNKNOWN), Type(type) + ITexture(const io::path& name, E_TEXTURE_TYPE type = ETT_2D) : NamedPath(name), DriverType(EDT_NULL), OriginalColorFormat(ECF_UNKNOWN), + ColorFormat(ECF_UNKNOWN), Pitch(0), HasMipMaps(false), IsRenderTarget(false), Source(ETS_UNKNOWN), Type(type) { } @@ -182,6 +183,15 @@ public: The last locked mip level will be unlocked. */ virtual void unlock() = 0; + //! Regenerates the mip map levels of the texture. + /** Required after modifying the texture, usually after calling unlock(). + \param mipmapData Optional parameter to pass in image data which will be + used instead of the previously stored or automatically generated mipmap + data. The data has to be a continuous pixel data for all mipmaps until + 1x1 pixel. Each mipmap has to be half the width and height of the previous + level. At least one pixel will be always kept.*/ + virtual void regenerateMipMapLevels(void* mipmapData = 0) = 0; + //! Get original size of the texture. /** The texture is usually scaled, if it was created with an unoptimal size. For example if the size was not a power of two. This method @@ -190,53 +200,39 @@ public: exact size of the original texture. Use ITexture::getSize() if you want to know the real size it has now stored in the system. \return The original size of the texture. */ - virtual const core::dimension2d& getOriginalSize() const = 0; + const core::dimension2d& getOriginalSize() const { return OriginalSize; }; //! Get dimension (=size) of the texture. /** \return The size of the texture. */ - virtual const core::dimension2d& getSize() const = 0; + const core::dimension2d& getSize() const { return Size; }; //! Get driver type of texture. /** This is the driver, which created the texture. This method is used internally by the video devices, to check, if they may use a texture because textures may be incompatible between different devices. \return Driver type of texture. */ - virtual E_DRIVER_TYPE getDriverType() const = 0; + E_DRIVER_TYPE getDriverType() const { return DriverType; }; //! Get the color format of texture. /** \return The color format of texture. */ - virtual ECOLOR_FORMAT getColorFormat() const = 0; + ECOLOR_FORMAT getColorFormat() const { return ColorFormat; }; //! Get pitch of the main texture (in bytes). /** The pitch is the amount of bytes used for a row of pixels in a texture. \return Pitch of texture in bytes. */ - virtual u32 getPitch() const = 0; + u32 getPitch() const { return Pitch; }; //! Check whether the texture has MipMaps /** \return True if texture has MipMaps, else false. */ - virtual bool hasMipMaps() const { return false; } - - //! Returns if the texture has an alpha channel - virtual bool hasAlpha() const { - return getColorFormat () == video::ECF_A8R8G8B8 || getColorFormat () == video::ECF_A1R5G5B5; - } - - //! Regenerates the mip map levels of the texture. - /** Required after modifying the texture, usually after calling unlock(). - \param mipmapData Optional parameter to pass in image data which will be - used instead of the previously stored or automatically generated mipmap - data. The data has to be a continuous pixel data for all mipmaps until - 1x1 pixel. Each mipmap has to be half the width and height of the previous - level. At least one pixel will be always kept.*/ - virtual void regenerateMipMapLevels(void* mipmapData=0) = 0; + bool hasMipMaps() const { return HasMipMaps; } //! Check whether the texture is a render target /** Render targets can be set as such in the video driver, in order to render a scene into the texture. Once unbound as render target, they can be used just as usual textures again. \return True if this is a render target, otherwise false. */ - virtual bool isRenderTarget() const { return false; } + bool isRenderTarget() const { return IsRenderTarget; } //! Get name of texture (in most cases this is the filename) const io::SNamedPath& getName() const { return NamedPath; } @@ -250,6 +246,31 @@ public: //! Used internally by the engine to update Source status on IVideoDriver::getTexture calls. void updateSource(E_TEXTURE_SOURCE source) { Source = source; } + //! Returns if the texture has an alpha channel + bool hasAlpha() const + { + bool status = false; + + switch (ColorFormat) + { + case ECF_A8R8G8B8: + case ECF_A1R5G5B5: + case ECF_DXT1: + case ECF_DXT2: + case ECF_DXT3: + case ECF_DXT4: + case ECF_DXT5: + case ECF_A16B16G16R16F: + case ECF_A32B32G32R32F: + status = true; + break; + default: + break; + } + + return status; + } + protected: //! Helper function, helps to get the desired texture creation format from the flags. @@ -269,6 +290,14 @@ protected: } io::SNamedPath NamedPath; + core::dimension2d OriginalSize; + core::dimension2d Size; + E_DRIVER_TYPE DriverType; + ECOLOR_FORMAT OriginalColorFormat; + ECOLOR_FORMAT ColorFormat; + u32 Pitch; + bool HasMipMaps; + bool IsRenderTarget; E_TEXTURE_SOURCE Source; E_TEXTURE_TYPE Type; }; diff --git a/include/IVideoDriver.h b/include/IVideoDriver.h index aec35615..d41f47a3 100644 --- a/include/IVideoDriver.h +++ b/include/IVideoDriver.h @@ -47,6 +47,7 @@ namespace video class IImageWriter; class IMaterialRenderer; class IGPUProgrammingServices; + class IRenderTarget; //! enumeration for geometry transformation states enum E_TRANSFORMATION_STATE @@ -129,6 +130,15 @@ namespace video ERT_AUX_BUFFER4 }; + //! Enum for the flags of clear buffer + enum E_CLEAR_BUFFER_FLAG + { + ECBF_NONE = 0, + ECBF_COLOR = 1, + ECBF_DEPTH = 2, + ECBF_STENCIL = 4 + }; + //! Enum for the types of fog distributions to choose from enum E_FOG_TYPE { @@ -209,43 +219,6 @@ namespace video }; - struct IRenderTarget - { - IRenderTarget(ITexture* texture, - E_COLOR_PLANE colorMask=ECP_ALL, - E_BLEND_FACTOR blendFuncSrc=EBF_ONE, - E_BLEND_FACTOR blendFuncDst=EBF_ONE_MINUS_SRC_ALPHA, - E_BLEND_OPERATION blendOp=EBO_NONE) : - RenderTexture(texture), - TargetType(ERT_RENDER_TEXTURE), ColorMask(colorMask), - BlendFuncSrc(blendFuncSrc), BlendFuncDst(blendFuncDst), - BlendOp(blendOp) {} - IRenderTarget(E_RENDER_TARGET target, - E_COLOR_PLANE colorMask=ECP_ALL, - E_BLEND_FACTOR blendFuncSrc=EBF_ONE, - E_BLEND_FACTOR blendFuncDst=EBF_ONE_MINUS_SRC_ALPHA, - E_BLEND_OPERATION blendOp=EBO_NONE) : - RenderTexture(0), - TargetType(target), ColorMask(colorMask), - BlendFuncSrc(blendFuncSrc), BlendFuncDst(blendFuncDst), - BlendOp(blendOp) {} - bool operator!=(const IRenderTarget& other) const - { - return ((RenderTexture != other.RenderTexture) || - (TargetType != other.TargetType) || - (ColorMask != other.ColorMask) || - (BlendFuncSrc != other.BlendFuncSrc) || - (BlendFuncDst != other.BlendFuncDst) || - (BlendOp != other.BlendOp)); - } - ITexture* RenderTexture; - E_RENDER_TARGET TargetType:8; - E_COLOR_PLANE ColorMask:8; - E_BLEND_FACTOR BlendFuncSrc:4; - E_BLEND_FACTOR BlendFuncDst:4; - E_BLEND_OPERATION BlendOp:4; - }; - //! Interface to driver which is able to perform 2d and 3d graphics functions. /** This interface is one of the most important interfaces of the Irrlicht Engine: All rendering and texture manipulation is done with @@ -260,14 +233,10 @@ namespace video //! Applications must call this method before performing any rendering. /** This method can clear the back- and the z-buffer. - \param backBuffer Specifies if the back buffer should be - cleared, which means that the screen is filled with the color - specified. If this parameter is false, the back buffer will - not be cleared and the color parameter is ignored. - \param zBuffer Specifies if the depth buffer (z buffer) should - be cleared. It is not nesesarry to do so if only 2d drawing is - used. - \param color The color used for back buffer clearing + \param clearFlag The clear flags. + \param clearColor The clear color for the color buffer. + \param clearDepth The clear value for the depth buffer. + \param clearStencil The clear value for the stencil buffer. \param videoData Handle of another window, if you want the bitmap to be displayed on another window. If this is an empty element, everything will be displayed in the default window. @@ -276,16 +245,28 @@ namespace video rectangle of the area to be presented. Set to null to present everything. Note: not implemented in all devices. \return False if failed. */ - virtual bool beginScene(bool backBuffer=true, bool zBuffer=true, - SColor color=SColor(255,0,0,0), - const SExposedVideoData& videoData=SExposedVideoData(), - core::rect* sourceRect=0) =0; + virtual bool beginScene(u16 clearFlag, SColor clearColor = SColor(255,0,0,0), f32 clearDepth = 1.f, u8 clearStencil = 0, + const SExposedVideoData& videoData=SExposedVideoData(), core::rect* sourceRect = 0) = 0; + + _IRR_DEPRECATED_ bool beginScene(bool backBuffer = true, bool zBuffer = true, SColor color = SColor(255,0,0,0), + const SExposedVideoData& videoData = SExposedVideoData(), core::rect* sourceRect = 0) + { + u16 flag = 0; + + if (backBuffer) + flag |= ECBF_COLOR; + + if (zBuffer) + flag |= ECBF_DEPTH; + + return beginScene(flag, color, 1.f, 0, videoData, sourceRect); + } //! Presents the rendered image to the screen. /** Applications must call this method after performing any rendering. \return False if failed and true if succeeded. */ - virtual bool endScene() =0; + virtual bool endScene() = 0; //! Queries the features of the driver. /** Returns true if a feature is available @@ -420,15 +401,28 @@ namespace video /** \param name A name for the texture. Later calls of getTexture() with this name will return this texture \param image Image the texture is created from. - \param mipmapData Optional pointer to a set of images which - build up the whole mipmap set. Must be images of the same color - type as image. If this parameter is not given, the mipmaps are - derived from image. + \param mipmapData Optional pointer to a mipmaps data. + If this parameter is not given, the mipmaps are derived from image. \return Pointer to the newly created texture. This pointer should not be dropped. See IReferenceCounted::drop() for more information. */ - virtual ITexture* addTexture(const io::path& name, IImage* image, void* mipmapData=0) = 0; + _IRR_DEPRECATED_ ITexture* addTexture(const io::path& name, IImage* image, void* mipmapData) + { + if (image) + image->setMipMapsData(mipmapData, false, true); + return addTexture(name, image); + } + + //! Creates a texture from an IImage. + /** \param name A name for the texture. Later calls of + getTexture() with this name will return this texture + \param image Image the texture is created from. + \return Pointer to the newly created texture. This pointer + should not be dropped. See IReferenceCounted::drop() for more + information. */ + virtual ITexture* addTexture(const io::path& name, IImage* image) = 0; + //! Creates a cube texture from loaded IImages. /** \param name A name for the texture. Later calls of getTexture() with this name will return this texture @@ -519,6 +513,15 @@ namespace video actual value of pixels. */ virtual u32 getOcclusionQueryResult(scene::ISceneNode* node) const =0; + //! Create render target. + virtual IRenderTarget* addRenderTarget() = 0; + + //! Remove render target. + virtual void removeRenderTarget(IRenderTarget* renderTarget) = 0; + + //! Remove all render targets. + virtual void removeAllRenderTargets() = 0; + //! Sets a boolean alpha channel on the texture based on a color key. /** This makes the texture fully transparent at the texels where this color key can be found when using for example draw2DImage @@ -567,6 +570,23 @@ namespace video information is multiplied.*/ virtual void makeNormalMapTexture(video::ITexture* texture, f32 amplitude=1.0f) const =0; + //! Set a render target. + /** This will only work if the driver supports the + EVDF_RENDER_TO_TARGET feature, which can be queried with + queryFeature(). Please note that you cannot render 3D or 2D + geometry with a render target as texture on it when you are rendering + the scene into this render target at the same time. It is usually only + possible to render into a texture between the + IVideoDriver::beginScene() and endScene() method calls. + \param target Render target object. + \param clearFlag The clear flags. + \param clearColor The clear color for the color buffer. + \param clearDepth The clear value for the depth buffer. + \param clearStencil The clear value for the stencil buffer. + \return True if sucessful and false if not. */ + virtual bool setRenderTarget(IRenderTarget* target, u16 clearFlag, SColor clearColor = SColor(255,0,0,0), + f32 clearDepth = 1.f, u8 clearStencil = 0) = 0; + //! Sets a new render target. /** This will only work if the driver supports the EVDF_RENDER_TO_TARGET feature, which can be queried with @@ -591,38 +611,27 @@ namespace video IVideoDriver::addRenderTargetTexture(). If set to 0, it sets the previous render target which was set before the last setRenderTarget() call. - \param clearBackBuffer Clears the backbuffer of the render - target with the color parameter - \param clearZBuffer Clears the zBuffer of the rendertarget. - Note that because the frame buffer may share the zbuffer with - the rendertarget, its zbuffer might be partially cleared too - by this. - \param color The background color for the render target. + \param clearFlag The clear flags. + \param clearColor The clear color for the color buffer. + \param clearDepth The clear value for the depth buffer. + \param clearStencil The clear value for the stencil buffer. \return True if sucessful and false if not. */ - virtual bool setRenderTarget(video::ITexture* texture, - bool clearBackBuffer=true, bool clearZBuffer=true, - SColor color=video::SColor(0,0,0,0)) =0; + virtual bool setRenderTarget(ITexture* texture, u16 clearFlag, SColor clearColor = SColor(255,0,0,0), + f32 clearDepth = 1.f, u8 clearStencil = 0) = 0; - //! set or reset special render targets - /** This method enables access to special color buffers such as - stereoscopic buffers or auxiliary buffers. - \param target Enum value for the render target - \param clearTarget Clears the target buffer with the color - parameter - \param clearZBuffer Clears the zBuffer of the rendertarget. - Note that because the main frame buffer may share the zbuffer with - the rendertarget, its zbuffer might be partially cleared too - by this. - \param color The background color for the render target. - \return True if sucessful and false if not. */ - virtual bool setRenderTarget(E_RENDER_TARGET target, bool clearTarget=true, - bool clearZBuffer=true, - SColor color=video::SColor(0,0,0,0)) =0; + _IRR_DEPRECATED_ bool setRenderTarget(ITexture* texture, bool clearBackBuffer = true, + bool clearZBuffer = true, SColor color = SColor(255,0,0,0)) + { + u16 flag = 0; - //! Sets new multiple render targets. - virtual bool setRenderTarget(const core::array& texture, - bool clearBackBuffer=true, bool clearZBuffer=true, - SColor color=video::SColor(0,0,0,0)) =0; + if (clearBackBuffer) + flag |= ECBF_COLOR; + + if (clearZBuffer) + flag |= ECBF_DEPTH; + + return setRenderTarget(texture, flag, color); + } //! Sets a new viewport. /** Every rendering operation is done into this new area. @@ -1230,9 +1239,8 @@ namespace video If you no longer need the image, you should call IImage::drop(). See IReferenceCounted::drop() for more information. */ virtual IImage* createImageFromData(ECOLOR_FORMAT format, - const core::dimension2d& size, void *data, - bool ownForeignMemory=false, - bool deleteMemory = true) =0; + const core::dimension2d& size, void *data, bool ownForeignMemory = false, + bool deleteMemory = true) = 0; //! Creates an empty software image. /** @@ -1376,6 +1384,26 @@ namespace video //! Returns a pointer to the mesh manipulator. virtual scene::IMeshManipulator* getMeshManipulator() =0; + //! Clear the color, depth and/or stencil buffers. + virtual void clearBuffers(u16 flag, SColor color = SColor(255,0,0,0), f32 depth = 1.f, u8 stencil = 0) = 0; + + //! Clear the color, depth and/or stencil buffers. + _IRR_DEPRECATED_ void clearBuffers(bool backBuffer, bool depthBuffer, bool stencilBuffer, SColor color) + { + u16 flag = 0; + + if (backBuffer) + flag |= ECBF_COLOR; + + if (depthBuffer) + flag |= ECBF_DEPTH; + + if (stencilBuffer) + flag |= ECBF_STENCIL; + + clearBuffers(flag, color); + } + //! Clears the ZBuffer. /** Note that you usually need not to call this method, as it is automatically done in IVideoDriver::beginScene() or @@ -1383,7 +1411,10 @@ namespace video you have to render some special things, you can clear the zbuffer during the rendering process with this method any time. */ - virtual void clearZBuffer() =0; + _IRR_DEPRECATED_ void clearZBuffer() + { + clearBuffers(ECBF_DEPTH, SColor(255,0,0,0), 1.f, 0); + } //! Make a screenshot of the last rendered frame. /** \return An image created from the last rendered frame. */ diff --git a/include/IVideoModeList.h b/include/IVideoModeList.h index 4fe2e69a..cc87b2e2 100644 --- a/include/IVideoModeList.h +++ b/include/IVideoModeList.h @@ -14,12 +14,8 @@ namespace video { //! A list of all available video modes. - /** You can get a list via IrrlichtDevice::getVideoModeList(). If you are confused - now, because you think you have to create an Irrlicht Device with a video - mode before being able to get the video mode list, let me tell you that - there is no need to start up an Irrlicht Device with EDT_DIRECT3D8, EDT_OPENGL or - EDT_SOFTWARE: For this (and for lots of other reasons) the null device, - EDT_NULL exists.*/ + /** You can get a list via IrrlichtDevice::getVideoModeList(). + You only need the null device (EDT_NULL) to get the video-modes. */ class IVideoModeList : public virtual IReferenceCounted { public: diff --git a/include/IWriteFile.h b/include/IWriteFile.h index 2a07585f..ddc147df 100644 --- a/include/IWriteFile.h +++ b/include/IWriteFile.h @@ -38,6 +38,10 @@ namespace io //! Get name of file. /** \return File name as zero terminated character string. */ virtual const path& getFileName() const = 0; + + //! Flush the content of the buffer in the file + /** \return True if successful, otherwise false. */ + virtual bool flush() = 0; }; } // end namespace io diff --git a/include/IrrCompileConfig.h b/include/IrrCompileConfig.h index 820b97c9..2eec61dc 100644 --- a/include/IrrCompileConfig.h +++ b/include/IrrCompileConfig.h @@ -17,9 +17,7 @@ #include // TODO: Although included elsewhere this is required at least for mingw //! The defines for different operating system are: -//! _IRR_XBOX_PLATFORM_ for XBox //! _IRR_WINDOWS_ for all irrlicht supported Windows versions -//! _IRR_WINDOWS_CE_PLATFORM_ for Windows CE //! _IRR_WINDOWS_API_ for Windows or XBox //! _IRR_LINUX_PLATFORM_ for Linux (it is defined here if no other os is defined) //! _IRR_SOLARIS_PLATFORM_ for Solaris @@ -32,7 +30,6 @@ //! DEVICE is the windowing system used, several PLATFORMs support more than one DEVICE //! Irrlicht can be compiled with more than one device //! _IRR_COMPILE_WITH_WINDOWS_DEVICE_ for Windows API based device -//! _IRR_COMPILE_WITH_WINDOWS_CE_DEVICE_ for Windows CE API based device //! _IRR_COMPILE_WITH_OSX_DEVICE_ for Cocoa native windowing on OSX //! _IRR_COMPILE_WITH_X11_DEVICE_ for Linux X11 based device //! _IRR_COMPILE_WITH_SDL_DEVICE_ for platform independent SDL framework @@ -66,22 +63,14 @@ #define _IRR_COMPILE_WITH_WINDOWS_DEVICE_ #endif -//! WINCE is a very restricted environment for mobile devices -#if defined(_WIN32_WCE) -#define _IRR_WINDOWS_ -#define _IRR_WINDOWS_API_ -#define _IRR_WINDOWS_CE_PLATFORM_ -#define _IRR_COMPILE_WITH_WINDOWS_CE_DEVICE_ +#if defined(_MSC_VER) && (_MSC_VER < 1500) +# error "Only Microsoft Visual Studio 9.0 and later are supported." #endif -#if defined(_MSC_VER) && (_MSC_VER < 1300) -# error "Only Microsoft Visual Studio 7.0 and later are supported." -#endif - -// XBox only suppots the native Window stuff +// XBox is deprecated (as DX8 is removed). Use Irrlicht 1.8 if you still want to work on this. #if defined(_XBOX) #undef _IRR_WINDOWS_ - #define _IRR_XBOX_PLATFORM_ + #define _IRR_XBOX_PLATFORM_ // deprecated #define _IRR_WINDOWS_API_ //#define _IRR_COMPILE_WITH_WINDOWS_DEVICE_ #undef _IRR_COMPILE_WITH_WINDOWS_DEVICE_ @@ -165,20 +154,14 @@ while it runs and enabling it will slow down the engine. */ #undef _IRR_COMPILE_WITH_PROFILING_ #endif -//! Define _IRR_COMPILE_WITH_DIRECT3D_8_ and _IRR_COMPILE_WITH_DIRECT3D_9_ to -//! compile the Irrlicht engine with Direct3D8 and/or DIRECT3D9. +//! Define _IRR_COMPILE_WITH_DIRECT3D_9_ to compile the Irrlicht engine with DIRECT3D9. /** If you only want to use the software device or opengl you can disable those defines. This switch is mostly disabled because people do not get the g++ compiler compile directX header files, and directX is only available on Windows platforms. If you are using Dev-Cpp, and want to compile this using a DX dev pack, you can define _IRR_COMPILE_WITH_DX9_DEV_PACK_. So you simply need to add something like this to the compiler settings: -DIRR_COMPILE_WITH_DX9_DEV_PACK -and this to the linker settings: -ld3dx9 -ld3dx8 - -Microsoft have chosen to remove D3D8 headers from their recent DXSDKs, and -so D3D8 support is now disabled by default. If you really want to build -with D3D8 support, then you will have to source a DXSDK with the appropriate -headers, e.g. Summer 2004. This is a Microsoft issue, not an Irrlicht one. +and this to the linker settings: -ld3dx9 */ #if defined(_IRR_WINDOWS_API_) && (!defined(__GNUC__) || defined(IRR_COMPILE_WITH_DX9_DEV_PACK)) @@ -194,13 +177,8 @@ If not defined, Windows Multimedia library is used, which offers also broad supp #undef _IRR_COMPILE_WITH_DIRECTINPUT_JOYSTICK_ #endif -//! Only define _IRR_COMPILE_WITH_DIRECT3D_8_ if you have an appropriate DXSDK, e.g. Summer 2004 -// #define _IRR_COMPILE_WITH_DIRECT3D_8_ +//! enabled Direct3D 9 #define _IRR_COMPILE_WITH_DIRECT3D_9_ - -#ifdef NO_IRR_COMPILE_WITH_DIRECT3D_8_ -#undef _IRR_COMPILE_WITH_DIRECT3D_8_ -#endif #ifdef NO_IRR_COMPILE_WITH_DIRECT3D_9_ #undef _IRR_COMPILE_WITH_DIRECT3D_9_ #endif @@ -230,7 +208,7 @@ define out. */ it should be usually the only HW accelerated one. OpenGL is currently disabled if using this driver, to avoid problems with the ogl-es emulators. */ -#define _IRR_COMPILE_WITH_OGLES1_ +// #define _IRR_COMPILE_WITH_OGLES1_ #ifdef NO_IRR_COMPILE_WITH_OGLES1_ #undef _IRR_COMPILE_WITH_OGLES1_ #endif @@ -405,15 +383,6 @@ to provide the user with the proper DLL. That's why it's disabled by default. */ #undef _IRR_D3D_USE_LEGACY_HLSL_COMPILER #endif -//! Define _IRR_COMPILE_WITH_CG_ to enable Cg Shading Language support -//#define _IRR_COMPILE_WITH_CG_ -#ifdef NO_IRR_COMPILE_WITH_CG_ -#undef _IRR_COMPILE_WITH_CG_ -#endif -#if !defined(_IRR_COMPILE_WITH_OPENGL_) && !defined(_IRR_COMPILE_WITH_DIRECT3D_9_) -#undef _IRR_COMPILE_WITH_CG_ -#endif - //! Define _IRR_USE_NVIDIA_PERFHUD_ to opt-in to using the nVidia PerHUD tool /** Enable, by opting-in, to use the nVidia PerfHUD performance analysis driver tool . */ @@ -594,6 +563,11 @@ B3D, MS3D or X meshes */ #ifdef NO_IRR_COMPILE_WITH_PLY_WRITER_ #undef _IRR_COMPILE_WITH_PLY_WRITER_ #endif +//! Define _IRR_COMPILE_WITH_B3D_WRITER_ if you want to write .b3d files +#define _IRR_COMPILE_WITH_B3D_WRITER_ +#ifdef NO_IRR_COMPILE_WITH_B3D_WRITER_ +#undef _IRR_COMPILE_WITH_B3D_WRITER_ +#endif //! Define _IRR_COMPILE_WITH_BMP_LOADER_ if you want to load .bmp files //! Disabling this loader will also disable the built-in font @@ -834,75 +808,6 @@ precision will be lower but speed higher. currently X86 only #endif // _IRR_WINDOWS_API_ -// We need to disable DIRECT3D9 support for Visual Studio 6.0 because -// those $%&$!! disabled support for it since Dec. 2004 and users are complaining -// about linker errors. Comment this out only if you are knowing what you are -// doing. (Which means you have an old DX9 SDK and VisualStudio6). -#ifdef _MSC_VER -#if (_MSC_VER < 1300 && !defined(__GNUC__)) -#undef _IRR_COMPILE_WITH_DIRECT3D_9_ -#pragma message("Compiling Irrlicht with Visual Studio 6.0, support for DX9 is disabled.") -#endif -#endif - -// XBox does not have OpenGL or DirectX9 -#if defined(_IRR_XBOX_PLATFORM_) - #undef _IRR_COMPILE_WITH_OPENGL_ - #undef _IRR_COMPILE_WITH_DIRECT3D_9_ -#endif - -//! WinCE does not have OpenGL or DirectX9. use minimal loaders -#if defined(_WIN32_WCE) - #undef _IRR_COMPILE_WITH_OPENGL_ - #undef _IRR_COMPILE_WITH_DIRECT3D_8_ - #undef _IRR_COMPILE_WITH_DIRECT3D_9_ - - #undef BURNINGVIDEO_RENDERER_BEAUTIFUL - #undef BURNINGVIDEO_RENDERER_FAST - #undef BURNINGVIDEO_RENDERER_ULTRA_FAST - #define BURNINGVIDEO_RENDERER_CE - - #undef _IRR_COMPILE_WITH_WINDOWS_DEVICE_ - #define _IRR_COMPILE_WITH_WINDOWS_CE_DEVICE_ - //#define _IRR_WCHAR_FILESYSTEM - - #undef _IRR_COMPILE_WITH_IRR_MESH_LOADER_ - //#undef _IRR_COMPILE_WITH_MD2_LOADER_ - #undef _IRR_COMPILE_WITH_MD3_LOADER_ - #undef _IRR_COMPILE_WITH_3DS_LOADER_ - #undef _IRR_COMPILE_WITH_COLLADA_LOADER_ - #undef _IRR_COMPILE_WITH_CSM_LOADER_ - #undef _IRR_COMPILE_WITH_BSP_LOADER_ - #undef _IRR_COMPILE_WITH_DMF_LOADER_ - #undef _IRR_COMPILE_WITH_LMTS_LOADER_ - #undef _IRR_COMPILE_WITH_MY3D_LOADER_ - #undef _IRR_COMPILE_WITH_OBJ_LOADER_ - #undef _IRR_COMPILE_WITH_OCT_LOADER_ - #undef _IRR_COMPILE_WITH_OGRE_LOADER_ - #undef _IRR_COMPILE_WITH_LWO_LOADER_ - #undef _IRR_COMPILE_WITH_STL_LOADER_ - #undef _IRR_COMPILE_WITH_IRR_WRITER_ - #undef _IRR_COMPILE_WITH_COLLADA_WRITER_ - #undef _IRR_COMPILE_WITH_STL_WRITER_ - #undef _IRR_COMPILE_WITH_OBJ_WRITER_ - //#undef _IRR_COMPILE_WITH_BMP_LOADER_ - //#undef _IRR_COMPILE_WITH_JPG_LOADER_ - #undef _IRR_COMPILE_WITH_PCX_LOADER_ - //#undef _IRR_COMPILE_WITH_PNG_LOADER_ - #undef _IRR_COMPILE_WITH_PPM_LOADER_ - #undef _IRR_COMPILE_WITH_PSD_LOADER_ - //#undef _IRR_COMPILE_WITH_TGA_LOADER_ - #undef _IRR_COMPILE_WITH_WAL_LOADER_ - #undef _IRR_COMPILE_WITH_BMP_WRITER_ - #undef _IRR_COMPILE_WITH_JPG_WRITER_ - #undef _IRR_COMPILE_WITH_PCX_WRITER_ - #undef _IRR_COMPILE_WITH_PNG_WRITER_ - #undef _IRR_COMPILE_WITH_PPM_WRITER_ - #undef _IRR_COMPILE_WITH_PSD_WRITER_ - #undef _IRR_COMPILE_WITH_TGA_WRITER_ - -#endif - #ifndef _IRR_WINDOWS_API_ #undef _IRR_WCHAR_FILESYSTEM #endif diff --git a/include/IrrlichtDevice.h b/include/IrrlichtDevice.h index db7ef555..63e51abd 100644 --- a/include/IrrlichtDevice.h +++ b/include/IrrlichtDevice.h @@ -112,12 +112,9 @@ namespace irr virtual ILogger* getLogger() = 0; //! Gets a list with all video modes available. - /** If you are confused now, because you think you have to - create an Irrlicht Device with a video mode before being able - to get the video mode list, let me tell you that there is no - need to start up an Irrlicht Device with EDT_DIRECT3D8, - EDT_OPENGL or EDT_SOFTWARE: For this (and for lots of other - reasons) the null driver, EDT_NULL exists. + /** You only need a null driver (ED_NULL) to access + those video modes. So you can get the available modes + before starting any other video driver. \return Pointer to a list with all video modes supported by the gfx adapter. */ virtual video::IVideoModeList* getVideoModeList() = 0; @@ -356,12 +353,6 @@ namespace irr return true; #else return false; -#endif - case video::EDT_DIRECT3D8: -#ifdef _IRR_COMPILE_WITH_DIRECT3D_8_ - return true; -#else - return false; #endif case video::EDT_DIRECT3D9: #ifdef _IRR_COMPILE_WITH_DIRECT3D_9_ diff --git a/include/SColor.h b/include/SColor.h index 6270c516..28973d41 100644 --- a/include/SColor.h +++ b/include/SColor.h @@ -13,7 +13,10 @@ namespace irr namespace video { //! An enum for the color format of textures used by the Irrlicht Engine. - /** A color format specifies how color information is stored. */ + /** A color format specifies how color information is stored. + NOTE: Byte order in memory is usually flipped (it's probably correct in bitmap files, but flipped on reading). + So for example ECF_A8R8G8B8 is BGRA in memory same as in DX9's D3DFMT_A8R8G8B8 format. + */ enum ECOLOR_FORMAT { //! 16 bit color format used by the software driver. @@ -75,26 +78,53 @@ namespace video //! ETC2 ARGB. ECF_ETC2_ARGB, - /** Floating Point formats. The following formats may only be used for render target textures. */ + /** The following formats may only be used for render target textures. */ - //! 16 bit floating point format using 16 bits for the red channel. + /** Floating point formats. */ + + //! 16 bit format using 16 bits for the red channel. ECF_R16F, - //! 32 bit floating point format using 16 bits for the red channel and 16 bits for the green channel. + //! 32 bit format using 16 bits for the red and green channels. ECF_G16R16F, - //! 64 bit floating point format 16 bits are used for the red, green, blue and alpha channels. + //! 64 bit format using 16 bits for the red, green, blue and alpha channels. ECF_A16B16G16R16F, - //! 32 bit floating point format using 32 bits for the red channel. + //! 32 bit format using 32 bits for the red channel. ECF_R32F, - //! 64 bit floating point format using 32 bits for the red channel and 32 bits for the green channel. + //! 64 bit format using 32 bits for the red and green channels. ECF_G32R32F, - //! 128 bit floating point format. 32 bits are used for the red, green, blue and alpha channels. + //! 128 bit format using 32 bits for the red, green, blue and alpha channels. ECF_A32B32G32R32F, + /** Unsigned normalized integer formats. */ + + //! 8 bit format using 8 bits for the red channel. + ECF_R8, + + //! 16 bit format using 8 bits for the red and green channels. + ECF_R8G8, + + //! 16 bit format using 16 bits for the red channel. + ECF_R16, + + //! 32 bit format using 16 bits for the red and green channels. + ECF_R16G16, + + /** Depth and stencil formats. */ + + //! 16 bit format using 16 bits for depth. + ECF_D16, + + //! 32 bit format using 32 bits for depth. + ECF_D32, + + //! 32 bit format using 24 bits for depth and 8 bits for stencil. + ECF_D24S8, + //! Unknown color format: ECF_UNKNOWN }; @@ -448,7 +478,7 @@ namespace video /** \param data: target to write the color. Must contain sufficiently large memory to receive the number of bytes neede for format \param format: tells the format used to write the color into data */ - void getData(void *data, ECOLOR_FORMAT format) + void getData(void *data, ECOLOR_FORMAT format) const { switch(format) { diff --git a/include/SExposedVideoData.h b/include/SExposedVideoData.h index 0b52e20e..25142ebf 100644 --- a/include/SExposedVideoData.h +++ b/include/SExposedVideoData.h @@ -40,19 +40,6 @@ struct SExposedVideoData void* HWnd; }; - struct SD3D8 - { - //! Pointer to the IDirect3D8 interface - IDirect3D8* D3D8; - - //! Pointer to the IDirect3DDevice8 interface - IDirect3DDevice8* D3DDev8; - - //! Window handle. - /** Get with for example with: HWND h = reinterpret_cast(exposedData.D3D8.HWnd) */ - void* HWnd; - }; - struct SOpenGLWin32 { //! Private GDI Device Context. @@ -79,7 +66,6 @@ struct SExposedVideoData union { SD3D9 D3D9; - SD3D8 D3D8; SOpenGLWin32 OpenGLWin32; SOpenGLLinux OpenGLLinux; diff --git a/include/SIrrCreationParameters.h b/include/SIrrCreationParameters.h index 2a00af6b..08e40c5d 100644 --- a/include/SIrrCreationParameters.h +++ b/include/SIrrCreationParameters.h @@ -27,10 +27,10 @@ namespace irr DriverType(video::EDT_BURNINGSVIDEO), WindowSize(core::dimension2d(800, 600)), WindowPosition(core::position2di(-1,-1)), - Bits(16), - ZBufferBits(16), + Bits(32), + ZBufferBits(24), Fullscreen(false), - Stencilbuffer(false), + Stencilbuffer(true), Vsync(false), AntiAlias(0), HandleSRGB(false), @@ -109,9 +109,8 @@ namespace irr //! Type of video driver used to render graphics. /** This can currently be video::EDT_NULL, video::EDT_SOFTWARE, - video::EDT_BURNINGSVIDEO, video::EDT_DIRECT3D8, - video::EDT_DIRECT3D9, and video::EDT_OPENGL. - Default: Software. */ + video::EDT_BURNINGSVIDEO, video::EDT_DIRECT3D9, and video::EDT_OPENGL. + Default: EDT_BURNINGSVIDEO. */ video::E_DRIVER_TYPE DriverType; //! Size of the window or the video mode in fullscreen mode. Default: 800x600 @@ -120,10 +119,10 @@ namespace irr //! Position of the window on-screen. Default: (-1, -1) or centered. core::position2di WindowPosition; - //! Minimum Bits per pixel of the color buffer in fullscreen mode. Ignored if windowed mode. Default: 16. + //! Minimum Bits per pixel of the color buffer in fullscreen mode. Ignored if windowed mode. Default: 32. u8 Bits; - //! Minimum Bits per pixel of the depth buffer. Default: 16. + //! Minimum Bits per pixel of the depth buffer. Default: 24. u8 ZBufferBits; //! Should be set to true if the device should run in fullscreen. @@ -135,7 +134,7 @@ namespace irr stencil buffer shadows. Note that not all drivers are able to use the stencil buffer, hence it can be ignored during device creation. Without the stencil buffer no shadows will be drawn. - Default: false. */ + Default: true. */ bool Stencilbuffer; //! Specifies vertical syncronisation. @@ -235,7 +234,7 @@ namespace irr \code while (device->run()) { - driver->beginScene(true, true, 0); + driver->beginScene(video::ECBF_COLOR | video::ECBF_DEPTH, 0); smgr->drawAll(); driver->endScene(); } @@ -267,7 +266,7 @@ namespace irr device->getTimer()->tick(); // draw engine picture - driver->beginScene(true, true, 0); + driver->beginScene(video::ECBF_COLOR | video::ECBF_DEPTH, 0); smgr->drawAll(); driver->endScene(); } diff --git a/include/SMaterial.h b/include/SMaterial.h index 44e49487..81c80ee1 100644 --- a/include/SMaterial.h +++ b/include/SMaterial.h @@ -192,6 +192,7 @@ namespace video //! High-quality anti-aliasing, not always supported, automatically enables SIMPLE mode EAAM_QUALITY=3, //! Line smoothing + //! Careful, enabling this can lead to software emulation under OpenGL EAAM_LINE_SMOOTH=4, //! point smoothing, often in software and slow, only with OpenGL EAAM_POINT_SMOOTH=8, @@ -246,6 +247,16 @@ namespace video 0 }; + //! Fine-tuning for SMaterial.ZWriteFineControl + enum E_ZWRITE_FINE_CONTROL + { + //! Default. Only write zbuffer when When SMaterial::ZBuffer is true and SMaterial::isTransparent() returns false. + EZI_ONLY_NON_TRANSPARENT, + //! Writing will just be based on SMaterial::ZBuffer value, transparency is ignored. + //! Needed mostly for certain shader materials as SMaterial::isTransparent will always return false for those. + EZI_ZBUFFER_FLAG + }; + //! Maximum number of texture an SMaterial can have. const u32 MATERIAL_MAX_TEXTURES = _IRR_MATERIAL_MAX_TEXTURES_; @@ -264,7 +275,8 @@ namespace video PolygonOffsetFactor(0), PolygonOffsetDirection(EPO_FRONT), Wireframe(false), PointCloud(false), GouraudShading(true), Lighting(true), ZWriteEnable(true), BackfaceCulling(true), FrontfaceCulling(false), - FogEnable(false), NormalizeNormals(false), UseMipMaps(true) + FogEnable(false), NormalizeNormals(false), UseMipMaps(true), + ZWriteFineControl(EZI_ONLY_NON_TRANSPARENT) { } //! Copy constructor @@ -318,6 +330,7 @@ namespace video PolygonOffsetFactor = other.PolygonOffsetFactor; PolygonOffsetDirection = other.PolygonOffsetDirection; UseMipMaps = other.UseMipMaps; + ZWriteFineControl = other.ZWriteFineControl; return *this; } @@ -398,8 +411,7 @@ namespace video //! Sets the antialiasing mode /** Values are chosen from E_ANTI_ALIASING_MODE. Default is - EAAM_SIMPLE|EAAM_LINE_SMOOTH, i.e. simple multi-sample - anti-aliasing and lime smoothing is enabled. */ + EAAM_SIMPLE, i.e. simple multi-sample anti-aliasing. */ u8 AntiAliasing; //! Defines the enabled color planes @@ -475,6 +487,11 @@ namespace video /** Sometimes, disabling mipmap usage can be useful. Default: true */ bool UseMipMaps:1; + //! Give more control how the ZWriteEnable flag is interpreted + /** Note that there is also the global flag AllowZWriteOnTransparent + which when set acts like all materials have set EZI_ALLOW_ON_TRANSPARENT. */ + E_ZWRITE_FINE_CONTROL ZWriteFineControl; + //! Gets the texture transformation matrix for level i /** \param i The desired level. Must not be larger than MATERIAL_MAX_TEXTURES. \return Texture matrix for texture level i. */ @@ -695,7 +712,9 @@ namespace video BlendFactor != b.BlendFactor || PolygonOffsetFactor != b.PolygonOffsetFactor || PolygonOffsetDirection != b.PolygonOffsetDirection || - UseMipMaps != b.UseMipMaps; + UseMipMaps != b.UseMipMaps || + ZWriteFineControl != b.ZWriteFineControl; + ; for (u32 i=0; (i0; --i) { - if (allDrivers || (irr::IrrlichtDevice::isDriverSupported(irr::video::E_DRIVER_TYPE(i-1)))) + irr::video::E_DRIVER_TYPE driverType = irr::video::E_DRIVER_TYPE(i-1); + if ( driverType == irr::video::DEPRECATED_EDT_DIRECT3D8_NO_LONGER_EXISTS ) + continue; + if (allDrivers || irr::IrrlichtDevice::isDriverSupported(driverType) ) printf(" (%c) %s\n", 'a'+irr::video::EDT_COUNT-i, irr::video::DRIVER_TYPE_NAMES[i-1]); } diff --git a/include/exampleHelper.h b/include/exampleHelper.h new file mode 100755 index 00000000..867073a9 --- /dev/null +++ b/include/exampleHelper.h @@ -0,0 +1,25 @@ +// Copyright (C) 2015 Patryk Nadrowski +// This file is part of the "Irrlicht Engine". +// For conditions of distribution and use, see copyright notice in irrlicht.h + +#ifndef __EXAMPLE_HELPER_H_INCLUDED__ +#define __EXAMPLE_HELPER_H_INCLUDED__ + +#include "IrrCompileConfig.h" +#include "path.h" + +namespace irr +{ + +static io::path getExampleMediaPath() +{ +#if defined (_IRR_IPHONE_PLATFORM_) || defined (_IRR_ANDROID_PLATFORM_) || defined (_IRR_OSX_PLATFORM_) + return io::path("media/"); +#else + return io::path("../../media/"); +#endif +} + +} // end namespace irr + +#endif diff --git a/include/irrArray.h b/include/irrArray.h index 52b89b02..99c87c7b 100644 --- a/include/irrArray.h +++ b/include/irrArray.h @@ -33,7 +33,7 @@ public: //! Constructs an array and allocates an initial chunk of memory. /** \param start_count Amount of elements to pre-allocate. */ - array(u32 start_count) : data(0), allocated(0), used(0), + explicit array(u32 start_count) : data(0), allocated(0), used(0), strategy(ALLOC_STRATEGY_DOUBLE), free_when_destroyed(true), is_sorted(true) { diff --git a/include/irrList.h b/include/irrList.h index f04119b1..706cc61d 100644 --- a/include/irrList.h +++ b/include/irrList.h @@ -67,10 +67,6 @@ public: bool operator ==(const ConstIterator& other) const { return Current == other.Current; } bool operator !=(const ConstIterator& other) const { return Current != other.Current; } - #if defined (_MSC_VER) && (_MSC_VER < 1300) - #pragma warning(disable:4284) // infix notation problem when using iterator operator -> - #endif - T & operator * () { return Current->Element; } T * operator ->() { return &Current->Element; } diff --git a/include/irrMap.h b/include/irrMap.h index 28a7c9e4..3297f49f 100644 --- a/include/irrMap.h +++ b/include/irrMap.h @@ -54,43 +54,36 @@ class map const ValueTypeRB& getValue() const { - _IRR_IMPLEMENT_MANAGED_MARSHALLING_BUGFIX; return Value; } ValueTypeRB& getValue() { - _IRR_IMPLEMENT_MANAGED_MARSHALLING_BUGFIX; return Value; } const KeyTypeRB& getKey() const { - _IRR_IMPLEMENT_MANAGED_MARSHALLING_BUGFIX; return Key; } bool isRoot() const { - _IRR_IMPLEMENT_MANAGED_MARSHALLING_BUGFIX; return Parent==0; } bool isLeftChild() const { - _IRR_IMPLEMENT_MANAGED_MARSHALLING_BUGFIX; return (Parent != 0) && (Parent->getLeftChild()==this); } bool isRightChild() const { - _IRR_IMPLEMENT_MANAGED_MARSHALLING_BUGFIX; return (Parent!=0) && (Parent->getRightChild()==this); } bool isLeaf() const { - _IRR_IMPLEMENT_MANAGED_MARSHALLING_BUGFIX; return (LeftChild==0) && (RightChild==0); } @@ -105,13 +98,11 @@ class map bool isRed() const { - _IRR_IMPLEMENT_MANAGED_MARSHALLING_BUGFIX; return IsRed; } bool isBlack() const { - _IRR_IMPLEMENT_MANAGED_MARSHALLING_BUGFIX; return !IsRed; } @@ -162,7 +153,6 @@ class map bool atEnd() const { - _IRR_IMPLEMENT_MANAGED_MARSHALLING_BUGFIX; return Cur==0; } @@ -311,7 +301,6 @@ class map bool atEnd() const { - _IRR_IMPLEMENT_MANAGED_MARSHALLING_BUGFIX; return Cur==0; } @@ -456,7 +445,6 @@ class map bool atEnd() const { - _IRR_IMPLEMENT_MANAGED_MARSHALLING_BUGFIX; return Cur==0; } @@ -556,7 +544,6 @@ class map bool atEnd() const { - _IRR_IMPLEMENT_MANAGED_MARSHALLING_BUGFIX; return Cur==0; } @@ -654,7 +641,6 @@ class map // Not found _IRR_DEBUG_BREAK_IF(node==0) // access violation - _IRR_IMPLEMENT_MANAGED_MARSHALLING_BUGFIX; return node->getValue(); } @@ -693,7 +679,6 @@ class map if (!insert(newNode)) { delete newNode; - _IRR_IMPLEMENT_MANAGED_MARSHALLING_BUGFIX; return false; } @@ -832,7 +817,6 @@ class map { if (p == 0) { - _IRR_IMPLEMENT_MANAGED_MARSHALLING_BUGFIX; return false; } @@ -888,7 +872,6 @@ class map //! \return Returns true if empty, false if not bool empty() const { - _IRR_IMPLEMENT_MANAGED_MARSHALLING_BUGFIX; return Root == 0; } @@ -1073,7 +1056,6 @@ class map ++Size; } - _IRR_IMPLEMENT_MANAGED_MARSHALLING_BUGFIX; return result; } diff --git a/include/irrString.h b/include/irrString.h index 82f6a9be..16e60dc6 100644 --- a/include/irrString.h +++ b/include/irrString.h @@ -121,7 +121,7 @@ public: : array(0), allocated(0), used(0) { c8 tmpbuf[255]; - snprintf(tmpbuf, 255, "%0.6f", number); + snprintf_irr(tmpbuf, 255, "%0.6f", number); *this = tmpbuf; } diff --git a/include/irrTypes.h b/include/irrTypes.h index ce549089..b7a4d23f 100644 --- a/include/irrTypes.h +++ b/include/irrTypes.h @@ -113,16 +113,16 @@ typedef double f64; #include #ifdef _IRR_WINDOWS_API_ -//! Defines for s{w,n}printf because these methods do not match the ISO C -//! standard on Windows platforms, but it does on all others. -//! These should be int snprintf(char *str, size_t size, const char *format, ...); -//! and int swprintf(wchar_t *wcs, size_t maxlen, const wchar_t *format, ...); +//! Defines for s{w,n}printf_irr because s{w,n}printf methods do not match the ISO C +//! standard on Windows platforms. +//! We want int snprintf_irr(char *str, size_t size, const char *format, ...); +//! and int swprintf_irr(wchar_t *wcs, size_t maxlen, const wchar_t *format, ...); #if defined(_MSC_VER) && _MSC_VER > 1310 && !defined (_WIN32_WCE) -#define swprintf swprintf_s -#define snprintf sprintf_s +#define swprintf_irr swprintf_s +#define snprintf_irr sprintf_s #elif !defined(__CYGWIN__) -#define swprintf _snwprintf -#define snprintf _snprintf +#define swprintf_irr _snwprintf +#define snprintf_irr _snprintf #endif // define the wchar_t type if not already built in. @@ -140,6 +140,9 @@ typedef unsigned short wchar_t; #define _WCHAR_T_DEFINED #endif // wchar is not defined #endif // microsoft compiler +#else +#define swprintf_irr swprintf +#define snprintf_irr snprintf #endif // _IRR_WINDOWS_API_ namespace irr @@ -199,7 +202,7 @@ For functions: template _IRR_DEPRECATED_ void test4(void) {} /** Usage in a derived class: virtual void somefunc() _IRR_OVERRIDE_; */ -#if (__GNUC__ >= 4 && __GNUC_MINOR__ >= 7 && (defined(__GXX_EXPERIMENTAL_CXX0X) || __cplusplus >= 201103L) ) +#if ( ((__GNUC__ > 4 ) || ((__GNUC__ == 4 ) && (__GNUC_MINOR__ >= 7))) && (defined(__GXX_EXPERIMENTAL_CXX0X) || __cplusplus >= 201103L) ) #define _IRR_OVERRIDE_ override #elif (_MSC_VER >= 1600 ) /* supported since MSVC 2010 */ #define _IRR_OVERRIDE_ override @@ -209,19 +212,6 @@ virtual void somefunc() _IRR_OVERRIDE_; #define _IRR_OVERRIDE_ #endif -//! Defines a small statement to work around a microsoft compiler bug. -/** The microsoft compiler 7.0 - 7.1 has a bug: -When you call unmanaged code that returns a bool type value of false from managed code, -the return value may appear as true. See -http://support.microsoft.com/default.aspx?kbid=823071 for details. -Compiler version defines: VC6.0 : 1200, VC7.0 : 1300, VC7.1 : 1310, VC8.0 : 1400*/ -#if defined(_IRR_WINDOWS_API_) && defined(_MSC_VER) && (_MSC_VER > 1299) && (_MSC_VER < 1400) -#define _IRR_IMPLEMENT_MANAGED_MARSHALLING_BUGFIX __asm mov eax,100 -#else -#define _IRR_IMPLEMENT_MANAGED_MARSHALLING_BUGFIX -#endif // _IRR_MANAGED_MARSHALLING_BUGFIX - - // memory debugging #if defined(_DEBUG) && defined(IRRLICHT_EXPORTS) && defined(_MSC_VER) && \ (_MSC_VER > 1299) && !defined(_IRR_DONT_DO_MEMORY_DEBUGGING_HERE) && !defined(_WIN32_WCE) @@ -234,12 +224,6 @@ Compiler version defines: VC6.0 : 1200, VC7.0 : 1300, VC7.1 : 1310, VC8.0 : 1400 #define new DEBUG_CLIENTBLOCK #endif -// disable truncated debug information warning in visual studio 6 by default -#if defined(_MSC_VER) && (_MSC_VER < 1300 ) -#pragma warning( disable: 4786) -#endif // _MSC - - //! ignore VC8 warning deprecated /** The microsoft compiler */ #if defined(_IRR_WINDOWS_API_) && defined(_MSC_VER) && (_MSC_VER >= 1400) diff --git a/include/irrlicht.h b/include/irrlicht.h index f82ff80c..f5e8882e 100644 --- a/include/irrlicht.h +++ b/include/irrlicht.h @@ -125,6 +125,7 @@ #include "IReferenceCounted.h" #include "irrArray.h" #include "IRandomizer.h" +#include "IRenderTarget.h" #include "IrrlichtDevice.h" #include "irrList.h" #include "irrMap.h" @@ -231,7 +232,7 @@ * int main() * { * // start up the engine - * IrrlichtDevice *device = createDevice(video::EDT_DIRECT3D8, + * IrrlichtDevice *device = createDevice(video::EDT_OPENGL, * core::dimension2d(640,480)); * * video::IVideoDriver* driver = device->getVideoDriver(); @@ -256,7 +257,7 @@ * // draw everything * while(device->run() && driver) * { - * driver->beginScene(true, true, video::SColor(255,0,0,255)); + * driver->beginScene(video::ECBF_COLOR | video::ECBF_DEPTH, video::SColor(255,0,0,255)); * scenemgr->drawAll(); * driver->endScene(); * } @@ -310,7 +311,7 @@ namespace irr /** If you need more parameters to be passed to the creation of the Irrlicht Engine device, use the createDeviceEx() function. \param deviceType: Type of the device. This can currently be video::EDT_NULL, - video::EDT_SOFTWARE, video::EDT_BURNINGSVIDEO, video::EDT_DIRECT3D8, video::EDT_DIRECT3D9 and video::EDT_OPENGL. + video::EDT_SOFTWARE, video::EDT_BURNINGSVIDEO, video::EDT_DIRECT3D9 and video::EDT_OPENGL. \param windowSize: Size of the window or the video mode in fullscreen mode. \param bits: Bits per pixel in fullscreen mode. Ignored if windowed mode. \param fullscreen: Should be set to true if the device should run in fullscreen. Otherwise @@ -328,9 +329,9 @@ namespace irr video::E_DRIVER_TYPE deviceType = video::EDT_SOFTWARE, // parantheses are necessary for some compilers const core::dimension2d& windowSize = (core::dimension2d(640,480)), - u32 bits = 16, + u32 bits = 32, bool fullscreen = false, - bool stencilbuffer = false, + bool stencilbuffer = true, bool vsync = false, IEventReceiver* receiver = 0); diff --git a/include/irrpack.h b/include/irrpack.h index 3cf643f8..ff922d06 100644 --- a/include/irrpack.h +++ b/include/irrpack.h @@ -26,7 +26,7 @@ // it started to be necessary with gcc 4.7 on mingw unless compiled with -mno-ms-bitfields. // And I found some hints on the web that older gcc versions on the other hand had sometimes // trouble with pragma pack while they worked with __attribute__((packed)). -# if (__GNUC__ >= 4 ) && (__GNUC_MINOR__ >= 7) +# if (__GNUC__ > 4 ) || ((__GNUC__ == 4 ) && (__GNUC_MINOR__ >= 7)) # pragma pack( push, packing ) # pragma pack( 1 ) # define PACK_STRUCT diff --git a/include/irrunpack.h b/include/irrunpack.h index b42398da..ba478278 100644 --- a/include/irrunpack.h +++ b/include/irrunpack.h @@ -11,7 +11,7 @@ #elif defined (__DMC__) # pragma pack( pop ) #elif defined( __GNUC__ ) -# if (__GNUC__ >= 4 ) && (__GNUC_MINOR__ >= 7) +# if (__GNUC__ > 4 ) || ((__GNUC__ == 4 ) && (__GNUC_MINOR__ >= 7)) # pragma pack( pop, packing ) # endif #endif diff --git a/include/matrix4.h b/include/matrix4.h index 6f9228ed..ff0de4a0 100644 --- a/include/matrix4.h +++ b/include/matrix4.h @@ -372,6 +372,11 @@ namespace core \return Altered matrix */ CMatrix4& setTextureTranslate( f32 x, f32 y ); + //! Get texture transformation translation + /** \param x returns offset on x axis + \param y returns offset on y axis */ + void getTextureTranslate( f32& x, f32& y ) const; + //! Set texture transformation translation, using a transposed representation /** Doesn't clear other elements than those affected. \param x Offset on x axis @@ -386,6 +391,11 @@ namespace core \return Altered matrix. */ CMatrix4& setTextureScale( f32 sx, f32 sy ); + //! Get texture transformation scale + /** \param sx Returns x axis scale factor + \param sy Returns y axis scale factor */ + void getTextureScale( f32& sx, f32& sy ) const; + //! Set texture transformation scale, and recenter at (0.5,0.5) /** Doesn't clear other elements than those affected. \param sx Scale factor on x axis @@ -862,8 +872,8 @@ namespace core //! Returns a rotation that is equivalent to that set by setRotationDegrees(). /** This code was sent in by Chev. Note that it does not necessarily return the *same* Euler angles as those set by setRotationDegrees(), but the rotation will - be equivalent, i.e. will have the same result when used to rotate a vector or node. - This code was orginally written by by Chev. + be equivalent, i.e. will have the same result when used to rotate a vector or node. + This code was orginally written by by Chev. */ template inline core::vector3d CMatrix4::getRotationDegrees(const vector3d& scale_) const @@ -923,7 +933,7 @@ namespace core //! Returns a rotation that is equivalent to that set by setRotationDegrees(). /** This code was sent in by Chev. Note that it does not necessarily return the *same* Euler angles as those set by setRotationDegrees(), but the rotation will - be equivalent, i.e. will have the same result when used to rotate a vector or node. + be equivalent, i.e. will have the same result when used to rotate a vector or node. This code was orginally written by by Chev. */ template inline core::vector3d CMatrix4::getRotationDegrees() const @@ -2150,6 +2160,12 @@ namespace core return *this; } + template + inline void CMatrix4::getTextureTranslate(f32& x, f32& y) const + { + x = (f32)M[8]; + y = (f32)M[9]; + } template inline CMatrix4& CMatrix4::setTextureTranslateTransposed ( f32 x, f32 y ) @@ -2174,6 +2190,12 @@ namespace core return *this; } + template + inline void CMatrix4::getTextureScale ( f32& sx, f32& sy ) const + { + sx = (f32)M[0]; + sy = (f32)M[5]; + } template inline CMatrix4& CMatrix4::setTextureScaleCenter( f32 sx, f32 sy ) diff --git a/include/quaternion.h b/include/quaternion.h index a7392c70..fa0c7634 100644 --- a/include/quaternion.h +++ b/include/quaternion.h @@ -10,10 +10,15 @@ #include "matrix4.h" #include "vector3d.h" -// Between Irrlicht 1.7 and Irrlicht 1.8 the quaternion-matrix conversions got fixed. -// This define disables all involved functions completely to allow finding all places -// where the wrong conversions had been in use. -#define IRR_TEST_BROKEN_QUATERNION_USE 0 +// NOTE: You *only* need this when updating an application from Irrlicht before 1.8 to Irrlicht 1.8 or later. +// Between Irrlicht 1.7 and Irrlicht 1.8 the quaternion-matrix conversions changed. +// Before the fix they had mixed left- and right-handed rotations. +// To test if your code was affected by the change enable IRR_TEST_BROKEN_QUATERNION_USE and try to compile your application. +// This defines removes those functions so you get compile errors anywhere you use them in your code. +// For every line with a compile-errors you have to change the corresponding lines like that: +// - When you pass the matrix to the quaternion constructor then replace the matrix by the transposed matrix. +// - For uses of getMatrix() you have to use quaternion::getMatrix_transposed instead. +// #define IRR_TEST_BROKEN_QUATERNION_USE namespace irr { @@ -39,7 +44,7 @@ class quaternion //! Constructor which converts euler angles (radians) to a quaternion quaternion(const vector3df& vec); -#if !IRR_TEST_BROKEN_QUATERNION_USE +#ifndef IRR_TEST_BROKEN_QUATERNION_USE //! Constructor which converts a matrix to a quaternion quaternion(const matrix4& mat); #endif @@ -53,7 +58,7 @@ class quaternion //! Assignment operator inline quaternion& operator=(const quaternion& other); -#if !IRR_TEST_BROKEN_QUATERNION_USE +#ifndef IRR_TEST_BROKEN_QUATERNION_USE //! Matrix assignment operator inline quaternion& operator=(const matrix4& other); #endif @@ -62,6 +67,7 @@ class quaternion quaternion operator+(const quaternion& other) const; //! Multiplication operator + //! Be careful, unfortunately the operator order here is opposite of that in CMatrix4::operator* quaternion operator*(const quaternion& other) const; //! Multiplication operator with scalar @@ -98,7 +104,7 @@ class quaternion //! Normalizes the quaternion inline quaternion& normalize(); -#if !IRR_TEST_BROKEN_QUATERNION_USE +#ifndef IRR_TEST_BROKEN_QUATERNION_USE //! Creates a matrix from this quaternion matrix4 getMatrix() const; #endif @@ -196,7 +202,7 @@ inline quaternion::quaternion(const vector3df& vec) set(vec.X,vec.Y,vec.Z); } -#if !IRR_TEST_BROKEN_QUATERNION_USE +#ifndef IRR_TEST_BROKEN_QUATERNION_USE // Constructor which converts a matrix to a quaternion inline quaternion::quaternion(const matrix4& mat) { @@ -229,7 +235,7 @@ inline quaternion& quaternion::operator=(const quaternion& other) return *this; } -#if !IRR_TEST_BROKEN_QUATERNION_USE +#ifndef IRR_TEST_BROKEN_QUATERNION_USE // matrix assignment operator inline quaternion& quaternion::operator=(const matrix4& m) { @@ -333,7 +339,7 @@ inline quaternion quaternion::operator+(const quaternion& b) const return quaternion(X+b.X, Y+b.Y, Z+b.Z, W+b.W); } -#if !IRR_TEST_BROKEN_QUATERNION_USE +#ifndef IRR_TEST_BROKEN_QUATERNION_USE // Creates a matrix from this quaternion inline matrix4 quaternion::getMatrix() const { @@ -547,7 +553,7 @@ inline quaternion& quaternion::slerp(quaternion q1, quaternion q2, f32 time, f32 const f32 invscale = sinf(theta * time) * invsintheta; return (*this = (q1*scale) + (q2*invscale)); } - else // linear interploation + else // linear interpolation return lerp(q1,q2,time); } diff --git a/include/rect.h b/include/rect.h index 3f3883ea..aeb9cc5f 100644 --- a/include/rect.h +++ b/include/rect.h @@ -43,6 +43,11 @@ namespace core rect(const position2d& pos, const dimension2d& size) : UpperLeftCorner(pos), LowerRightCorner(pos.X + size.Width, pos.Y + size.Height) {} + //! Constructor with upper left at 0,0 and lower right using dimension + template + explicit rect(const dimension2d& size) + : UpperLeftCorner(0,0), LowerRightCorner(size.Width, size.Height) {} + //! move right by given numbers rect operator+(const position2d& pos) const { diff --git a/media/d3d8.psh b/media/d3d8.psh deleted file mode 100644 index d38a3d61..00000000 --- a/media/d3d8.psh +++ /dev/null @@ -1,10 +0,0 @@ -; part of the Irrlicht Engine Shader example. -; This simple Direct3D9 pixel shader will be loaded by the engine. -; Please note that these example shaders don't do anything really useful. -; They only demonstrate that shaders can be used in Irrlicht. - -ps.1.1 - -tex t0 ; sample color map -mul_x2 t0, t0, v0 ; mulitply with color -add r0, t0, t0 ; make it brighter and store result diff --git a/media/d3d8.vsh b/media/d3d8.vsh deleted file mode 100644 index e0c24f70..00000000 --- a/media/d3d8.vsh +++ /dev/null @@ -1,37 +0,0 @@ -; part of the Irrlicht Engine Shader example. -; This Direct3D9 vertex shader will be loaded by the engine. -; Please note that these example shaders don't do anything really useful. -; They only demonstrate that shaders can be used in Irrlicht. - -vs.1.1 - -; transpose and transform position to clip space -mul r0, v0.x, c4 -mad r0, v0.y, c5, r0 -mad r0, v0.z, c6, r0 -add oPos, c7, r0 - -; transform normal -dp3 r1.x, v1, c0 -dp3 r1.y, v1, c1 -dp3 r1.z, v1, c2 - -; renormalize normal -dp3 r1.w, r1, r1 -rsq r1.w, r1.w -mul r1, r1, r1.w - -; calculate light vector -m4x4 r6, v0, c10 ; vertex into world position -add r2, c8, -r6 ; vtxpos - lightpos - -; normalize light vector -dp3 r2.w, r2, r2 -rsq r2.w, r2.w -mul r2, r2, r2.w - -; calculate light color -dp3 r3, r1, r2 ; dp3 with negative light vector -lit r5, r3 ; clamp to zero if r3 < 0, r5 has diffuce component in r5.y -mul oD0, r5.y, c9 ; ouput diffuse color -mov oT0, v3 ; store texture coordinates diff --git a/source/Irrlicht/CAnimatedMeshHalfLife.cpp b/source/Irrlicht/CAnimatedMeshHalfLife.cpp index 51a7d611..f655f361 100644 --- a/source/Irrlicht/CAnimatedMeshHalfLife.cpp +++ b/source/Irrlicht/CAnimatedMeshHalfLife.cpp @@ -1034,8 +1034,7 @@ SHalflifeHeader* CAnimatedMeshHalfLife::loadModel(io::IReadFile* file, const io: IImage* image = SceneManager->getVideoDriver()->createImage(ECF_R8G8B8, core::dimension2d(tex[i].width, tex[i].height)); - CColorConverter::convert8BitTo24Bit(src, (u8*)image->lock(), tex[i].width, tex[i].height, (u8*) palette, 0, false); - image->unlock(); + CColorConverter::convert8BitTo24Bit(src, (u8*)image->getData(), tex[i].width, tex[i].height, (u8*) palette, 0, false); #ifdef HL_TEXTURE_ATLAS TextureAtlas.addSource ( tex[i].name, image ); @@ -1166,7 +1165,7 @@ bool CAnimatedMeshHalfLife::postLoadModel( const io::path &filename ) c8 seq[8]; for (u32 i = 1; i < Header->numseqgroups; i++) { - snprintf( seq, 8, "%02d.mdl", i ); + snprintf_irr( seq, 8, "%02u.mdl", i ); submodel = path + texname + seq; AnimationHeader[i] = loadModel(0, submodel); @@ -1190,11 +1189,11 @@ void CAnimatedMeshHalfLife::dumpModelInfo(u32 level) const if (level == 0) { printf ( - "Bones: %d\n" - "Bone Controllers: %d\n" - "Hit Boxes: %d\n" - "Sequences: %d\n" - "Sequence Groups: %d\n", + "Bones: %u\n" + "Bone Controllers: %u\n" + "Hit Boxes: %u\n" + "Sequences: %u\n" + "Sequence Groups: %u\n", hdr->numbones, hdr->numbonecontrollers, hdr->numhitboxes, @@ -1202,10 +1201,10 @@ void CAnimatedMeshHalfLife::dumpModelInfo(u32 level) const hdr->numseqgroups ); printf ( - "Textures: %d\n" - "Skin Families: %d\n" - "Bodyparts: %d\n" - "Attachments: %d\n" + "Textures: %u\n" + "Skin Families: %u\n" + "Bodyparts: %u\n" + "Attachments: %u\n" "Transitions: %d\n", hdr->numtextures, hdr->numskinfamilies, @@ -1228,91 +1227,91 @@ void CAnimatedMeshHalfLife::dumpModelInfo(u32 level) const printf("flags: %d\n\n", hdr->flags); - printf("numbones: %d\n", hdr->numbones); + printf("numbones: %u\n", hdr->numbones); for (i = 0; i < hdr->numbones; i++) { const SHalflifeBone *bone = (const SHalflifeBone *) (phdr + hdr->boneindex); - printf("bone %d.name: \"%s\"\n", i + 1, bone[i].name); - printf("bone %d.parent: %d\n", i + 1, bone[i].parent); - printf("bone %d.flags: %d\n", i + 1, bone[i].flags); - printf("bone %d.bonecontroller: %d %d %d %d %d %d\n", i + 1, bone[i].bonecontroller[0], bone[i].bonecontroller[1], bone[i].bonecontroller[2], bone[i].bonecontroller[3], bone[i].bonecontroller[4], bone[i].bonecontroller[5]); - printf("bone %d.value: %f %f %f %f %f %f\n", i + 1, bone[i].value[0], bone[i].value[1], bone[i].value[2], bone[i].value[3], bone[i].value[4], bone[i].value[5]); - printf("bone %d.scale: %f %f %f %f %f %f\n", i + 1, bone[i].scale[0], bone[i].scale[1], bone[i].scale[2], bone[i].scale[3], bone[i].scale[4], bone[i].scale[5]); + printf("bone %u.name: \"%s\"\n", i + 1, bone[i].name); + printf("bone %u.parent: %d\n", i + 1, bone[i].parent); + printf("bone %u.flags: %d\n", i + 1, bone[i].flags); + printf("bone %u.bonecontroller: %d %d %d %d %d %d\n", i + 1, bone[i].bonecontroller[0], bone[i].bonecontroller[1], bone[i].bonecontroller[2], bone[i].bonecontroller[3], bone[i].bonecontroller[4], bone[i].bonecontroller[5]); + printf("bone %u.value: %f %f %f %f %f %f\n", i + 1, bone[i].value[0], bone[i].value[1], bone[i].value[2], bone[i].value[3], bone[i].value[4], bone[i].value[5]); + printf("bone %u.scale: %f %f %f %f %f %f\n", i + 1, bone[i].scale[0], bone[i].scale[1], bone[i].scale[2], bone[i].scale[3], bone[i].scale[4], bone[i].scale[5]); } - printf("\nnumbonecontrollers: %d\n", hdr->numbonecontrollers); + printf("\nnumbonecontrollers: %u\n", hdr->numbonecontrollers); const SHalflifeBoneController *bonecontrollers = (const SHalflifeBoneController *) (phdr + hdr->bonecontrollerindex); for (i = 0; i < hdr->numbonecontrollers; i++) { - printf("bonecontroller %d.bone: %d\n", i + 1, bonecontrollers[i].bone); - printf("bonecontroller %d.type: %d\n", i + 1, bonecontrollers[i].type); - printf("bonecontroller %d.start: %f\n", i + 1, bonecontrollers[i].start); - printf("bonecontroller %d.end: %f\n", i + 1, bonecontrollers[i].end); - printf("bonecontroller %d.rest: %d\n", i + 1, bonecontrollers[i].rest); - printf("bonecontroller %d.index: %d\n", i + 1, bonecontrollers[i].index); + printf("bonecontroller %u.bone: %d\n", i + 1, bonecontrollers[i].bone); + printf("bonecontroller %u.type: %d\n", i + 1, bonecontrollers[i].type); + printf("bonecontroller %u.start: %f\n", i + 1, bonecontrollers[i].start); + printf("bonecontroller %u.end: %f\n", i + 1, bonecontrollers[i].end); + printf("bonecontroller %u.rest: %d\n", i + 1, bonecontrollers[i].rest); + printf("bonecontroller %u.index: %d\n", i + 1, bonecontrollers[i].index); } - printf("\nnumhitboxes: %d\n", hdr->numhitboxes); + printf("\nnumhitboxes: %u\n", hdr->numhitboxes); const SHalflifeBBox *box = (const SHalflifeBBox *) (phdr + hdr->hitboxindex); for (i = 0; i < hdr->numhitboxes; i++) { - printf("hitbox %d.bone: %d\n", i + 1, box[i].bone); - printf("hitbox %d.group: %d\n", i + 1, box[i].group); - printf("hitbox %d.bbmin: %f %f %f\n", i + 1, box[i].bbmin[0], box[i].bbmin[1], box[i].bbmin[2]); - printf("hitbox %d.bbmax: %f %f %f\n", i + 1, box[i].bbmax[0], box[i].bbmax[1], box[i].bbmax[2]); + printf("hitbox %u.bone: %d\n", i + 1, box[i].bone); + printf("hitbox %u.group: %d\n", i + 1, box[i].group); + printf("hitbox %u.bbmin: %f %f %f\n", i + 1, box[i].bbmin[0], box[i].bbmin[1], box[i].bbmin[2]); + printf("hitbox %u.bbmax: %f %f %f\n", i + 1, box[i].bbmax[0], box[i].bbmax[1], box[i].bbmax[2]); } - printf("\nnumseq: %d\n", hdr->numseq); + printf("\nnumseq: %u\n", hdr->numseq); const SHalflifeSequence *seq = (const SHalflifeSequence *) (phdr + hdr->seqindex); for (i = 0; i < hdr->numseq; i++) { - printf("seqdesc %d.label: \"%s\"\n", i + 1, seq[i].label); - printf("seqdesc %d.fps: %f\n", i + 1, seq[i].fps); - printf("seqdesc %d.flags: %d\n", i + 1, seq[i].flags); + printf("seqdesc %u.label: \"%s\"\n", i + 1, seq[i].label); + printf("seqdesc %u.fps: %f\n", i + 1, seq[i].fps); + printf("seqdesc %u.flags: %d\n", i + 1, seq[i].flags); printf("<...>\n"); } - printf("\nnumseqgroups: %d\n", hdr->numseqgroups); + printf("\nnumseqgroups: %u\n", hdr->numseqgroups); for (i = 0; i < hdr->numseqgroups; i++) { const SHalflifeSequenceGroup *group = (const SHalflifeSequenceGroup *) (phdr + hdr->seqgroupindex); - printf("\nseqgroup %d.label: \"%s\"\n", i + 1, group[i].label); - printf("\nseqgroup %d.namel: \"%s\"\n", i + 1, group[i].name); - printf("\nseqgroup %d.data: %d\n", i + 1, group[i].data); + printf("\nseqgroup %u.label: \"%s\"\n", i + 1, group[i].label); + printf("\nseqgroup %u.namel: \"%s\"\n", i + 1, group[i].name); + printf("\nseqgroup %u.data: %d\n", i + 1, group[i].data); } - printf("\nnumskinref: %d\n", hdr->numskinref); - printf("numskinfamilies: %d\n", hdr->numskinfamilies); + printf("\nnumskinref: %u\n", hdr->numskinref); + printf("numskinfamilies: %u\n", hdr->numskinfamilies); - printf("\nnumbodyparts: %d\n", hdr->numbodyparts); + printf("\nnumbodyparts: %u\n", hdr->numbodyparts); const SHalflifeBody *pbodyparts = (const SHalflifeBody*) ((const u8*) hdr + hdr->bodypartindex); for (i = 0; i < hdr->numbodyparts; i++) { - printf("bodypart %d.name: \"%s\"\n", i + 1, pbodyparts[i].name); - printf("bodypart %d.nummodels: %d\n", i + 1, pbodyparts[i].nummodels); - printf("bodypart %d.base: %d\n", i + 1, pbodyparts[i].base); - printf("bodypart %d.modelindex: %d\n", i + 1, pbodyparts[i].modelindex); + printf("bodypart %u.name: \"%s\"\n", i + 1, pbodyparts[i].name); + printf("bodypart %u.nummodels: %u\n", i + 1, pbodyparts[i].nummodels); + printf("bodypart %u.base: %u\n", i + 1, pbodyparts[i].base); + printf("bodypart %d.modelindex: %u\n", i + 1, pbodyparts[i].modelindex); } - printf("\nnumattachments: %d\n", hdr->numattachments); + printf("\nnumattachments: %u\n", hdr->numattachments); for (i = 0; i < hdr->numattachments; i++) { const SHalflifeAttachment *attach = (const SHalflifeAttachment *) ((const u8*) hdr + hdr->attachmentindex); - printf("attachment %d.name: \"%s\"\n", i + 1, attach[i].name); + printf("attachment %u.name: \"%s\"\n", i + 1, attach[i].name); } hdr = TextureHeader; - printf("\nnumtextures: %d\n", hdr->numtextures); - printf("textureindex: %d\n", hdr->textureindex); - printf("texturedataindex: %d\n", hdr->texturedataindex); + printf("\nnumtextures: %u\n", hdr->numtextures); + printf("textureindex: %u\n", hdr->textureindex); + printf("texturedataindex: %u\n", hdr->texturedataindex); const SHalflifeTexture *ptextures = (const SHalflifeTexture *) ((const u8*) hdr + hdr->textureindex); for (i = 0; i < hdr->numtextures; i++) { - printf("texture %d.name: \"%s\"\n", i + 1, ptextures[i].name); - printf("texture %d.flags: %d\n", i + 1, ptextures[i].flags); - printf("texture %d.width: %d\n", i + 1, ptextures[i].width); - printf("texture %d.height: %d\n", i + 1, ptextures[i].height); - printf("texture %d.index: %d\n", i + 1, ptextures[i].index); + printf("texture %u.name: \"%s\"\n", i + 1, ptextures[i].name); + printf("texture %u.flags: %d\n", i + 1, ptextures[i].flags); + printf("texture %u.width: %d\n", i + 1, ptextures[i].width); + printf("texture %u.height: %d\n", i + 1, ptextures[i].height); + printf("texture %u.index: %d\n", i + 1, ptextures[i].index); } } diff --git a/source/Irrlicht/CAnimatedMeshSceneNode.cpp b/source/Irrlicht/CAnimatedMeshSceneNode.cpp index 04e99d55..43e0b4ba 100644 --- a/source/Irrlicht/CAnimatedMeshSceneNode.cpp +++ b/source/Irrlicht/CAnimatedMeshSceneNode.cpp @@ -849,8 +849,8 @@ void CAnimatedMeshSceneNode::setMesh(IAnimatedMesh* mesh) } // get start and begin time -// setAnimationSpeed(Mesh->getAnimationSpeed()); - setFrameLoop(0, Mesh->getFrameCount()); + setAnimationSpeed(Mesh->getAnimationSpeed()); // NOTE: This had been commented out (but not removed!) in r3526. Which caused meshloader-values for speed to be ignored unless users specified explicitly. Missing a test-case where this could go wrong so I put the code back in. + setFrameLoop(0, Mesh->getFrameCount()-1); } diff --git a/source/Irrlicht/CAnimatedMeshSceneNode.h b/source/Irrlicht/CAnimatedMeshSceneNode.h index 1419814b..37acf699 100644 --- a/source/Irrlicht/CAnimatedMeshSceneNode.h +++ b/source/Irrlicht/CAnimatedMeshSceneNode.h @@ -47,6 +47,7 @@ namespace scene //! sets the frames between the animation is looped. //! the default is 0 - MaximalFrameCount of the mesh. + //! NOTE: setMesh will also change this value and set it to the full range of animations of the mesh virtual bool setFrameLoop(s32 begin, s32 end) _IRR_OVERRIDE_; //! Sets looping mode which is on by default. If set to false, @@ -61,6 +62,7 @@ namespace scene virtual void setAnimationEndCallback(IAnimationEndCallBack* callback=0) _IRR_OVERRIDE_; //! sets the speed with which the animation is played + //! NOTE: setMesh will also change this value and set it to the default speed of the mesh virtual void setAnimationSpeed(f32 framesPerSecond) _IRR_OVERRIDE_; //! gets the speed with which the animation is played diff --git a/source/Irrlicht/CAttributeImpl.h b/source/Irrlicht/CAttributeImpl.h index 1b0bb2ce..bea24204 100644 --- a/source/Irrlicht/CAttributeImpl.h +++ b/source/Irrlicht/CAttributeImpl.h @@ -2041,7 +2041,7 @@ public: virtual core::stringw getStringW() _IRR_OVERRIDE_ { wchar_t buf[32]; - swprintf(buf, 32, L"%p", Value); + swprintf_irr(buf, 32, L"%p", Value); return core::stringw(buf); } diff --git a/source/Irrlicht/CAttributes.cpp b/source/Irrlicht/CAttributes.cpp index 26ded3be..f04e3ff3 100644 --- a/source/Irrlicht/CAttributes.cpp +++ b/source/Irrlicht/CAttributes.cpp @@ -645,7 +645,6 @@ bool CAttributes::getAttributeAsBool(s32 index) if ((u32)index < Attributes.size()) ret = Attributes[index]->getBool(); - _IRR_IMPLEMENT_MANAGED_MARSHALLING_BUGFIX; return ret; } diff --git a/source/Irrlicht/CB3DMeshFileLoader.cpp b/source/Irrlicht/CB3DMeshFileLoader.cpp index 04d1ccff..eb95dcb8 100644 --- a/source/Irrlicht/CB3DMeshFileLoader.cpp +++ b/source/Irrlicht/CB3DMeshFileLoader.cpp @@ -730,6 +730,7 @@ bool CB3DMeshFileLoader::readChunkKEYS(CSkinnedMesh::SJoint *inJoint) oldRotKey=AnimatedMesh->addRotationKey(inJoint); oldRotKey->frame = (f32)frame-1; oldRot[1].set(oldRotKey->rotation.set(data[1], data[2], data[3], data[0])); + oldRot[1].normalize(); } } else if (oldRotKey==0 && isFirst[2]) @@ -738,6 +739,7 @@ bool CB3DMeshFileLoader::readChunkKEYS(CSkinnedMesh::SJoint *inJoint) oldRotKey->frame = (f32)frame-1; // meant to be in this order since b3d stores W first oldRot[0].set(oldRotKey->rotation.set(data[1], data[2], data[3], data[0])); + oldRot[0].normalize(); oldRotKey=0; isFirst[2]=false; } @@ -749,6 +751,7 @@ bool CB3DMeshFileLoader::readChunkKEYS(CSkinnedMesh::SJoint *inJoint) oldRotKey->frame = (f32)frame-1; // meant to be in this order since b3d stores W first oldRot[1].set(oldRotKey->rotation.set(data[1], data[2], data[3], data[0])); + oldRot[1].normalize(); } } } diff --git a/source/Irrlicht/CB3DMeshFileLoader.h b/source/Irrlicht/CB3DMeshFileLoader.h index dba44d79..ea78e532 100644 --- a/source/Irrlicht/CB3DMeshFileLoader.h +++ b/source/Irrlicht/CB3DMeshFileLoader.h @@ -14,6 +14,7 @@ #include "IMeshLoader.h" #include "ISceneManager.h" #include "CSkinnedMesh.h" +#include "SB3DStructs.h" #include "IReadFile.h" namespace irr @@ -42,56 +43,6 @@ public: private: - struct SB3dChunkHeader - { - c8 name[4]; - s32 size; - }; - - struct SB3dChunk - { - SB3dChunk(const SB3dChunkHeader& header, long sp) - : length(header.size+8), startposition(sp) - { - name[0]=header.name[0]; - name[1]=header.name[1]; - name[2]=header.name[2]; - name[3]=header.name[3]; - } - - c8 name[4]; - s32 length; - long startposition; - }; - - struct SB3dTexture - { - core::stringc TextureName; - s32 Flags; - s32 Blend; - f32 Xpos; - f32 Ypos; - f32 Xscale; - f32 Yscale; - f32 Angle; - }; - - struct SB3dMaterial - { - SB3dMaterial() : red(1.0f), green(1.0f), - blue(1.0f), alpha(1.0f), shininess(0.0f), blend(1), - fx(0) - { - for (u32 i=0; iwrite("BB3D", 4); + file->write(&Size, sizeof(u32)); // Updated later once known. + + int version = 1; + write(file, &version, sizeof(int)); + + // + + const u32 numBeshBuffers = mesh->getMeshBufferCount(); + array texs; + map tex2id; // TODO: texture pointer as key not sufficient as same texture can have several id's + u32 texsizes = 0; + for (u32 i = 0; i < numBeshBuffers; i++) + { + const IMeshBuffer * const mb = mesh->getMeshBuffer(i); + const SMaterial &mat = mb->getMaterial(); + + for (u32 j = 0; j < MATERIAL_MAX_TEXTURES; j++) + { + if (mat.getTexture(j)) + { + SB3dTexture t; + t.TextureName = core::stringc(mat.getTexture(j)->getName().getPath()); + + // TODO: need some description of Blitz3D texture-flags to figure this out. But Blend should likely depend on material-type. + t.Flags = j == 2 ? 65536 : 1; + t.Blend = 2; + + // TODO: evaluate texture matrix + t.Xpos = 0; + t.Ypos = 0; + t.Xscale = 1; + t.Yscale = 1; + t.Angle = 0; + + texs.push_back(t); + texsizes += 7*4 + t.TextureName.size() + 1; + tex2id[mat.getTexture(j)] = texs.size() - 1; + } + } + } + + write(file, "TEXS", 4); + write(file, &texsizes, 4); + + u32 numTexture = texs.size(); + for (u32 i = 0; i < numTexture; i++) + { + write(file, texs[i].TextureName.c_str(), texs[i].TextureName.size() + 1); + write(file, &texs[i].Flags, 7*4); + } + + // + + const u32 brushsize = (7 * 4 + 1) * numBeshBuffers + numBeshBuffers * 4 * MATERIAL_MAX_TEXTURES + 4; + write(file, "BRUS", 4); + write(file, &brushsize, 4); + u32 brushcheck = Size; + const u32 usedtex = MATERIAL_MAX_TEXTURES; + write(file, &usedtex, 4); + + for (u32 i = 0; i < numBeshBuffers; i++) + { + const IMeshBuffer * const mb = mesh->getMeshBuffer(i); + const SMaterial &mat = mb->getMaterial(); + + write(file, "", 1); + + float f = 1; + write(file, &f, 4); + write(file, &f, 4); + write(file, &f, 4); + write(file, &f, 4); + + f = 0; + write(file, &f, 4); + + u32 tmp = 1; + write(file, &tmp, 4); + tmp = 0; + write(file, &tmp, 4); + + for (u32 j = 0; j < MATERIAL_MAX_TEXTURES; j++) + { + if (mat.getTexture(j)) + { + const u32 id = tex2id[mat.getTexture(j)]; + write(file, &id, 4); + } + else + { + const int id = -1; + write(file, &id, 4); + } + } + } + + // Check brushsize + brushcheck = Size - brushcheck; + if (brushcheck != brushsize) + { + printf("Failed in brush size calculation, size %u advanced %u\n", + brushsize, brushcheck); + } + + write(file, "NODE", 4); + + // Calculate node size + u32 nodesize = 41 + 8 + 4 + 8; + u32 bonesSize = 0; + + if(ISkinnedMesh *skinnedMesh = getSkinned(mesh)) + { + if (!skinnedMesh->isStatic()) + { + bonesSize += 20; + } + + const core::array rootJoints = getRootJoints(skinnedMesh); + for (u32 i = 0; i < rootJoints.size(); i++) + { + bonesSize += getJointChunkSize(skinnedMesh, rootJoints[i]); + } + nodesize += bonesSize; + + // ------------------- + + } + + // VERT data + nodesize += 12; + + const u32 texcoords = getUVlayerCount(mesh); + for (u32 i = 0; i < numBeshBuffers; i++) + { + nodesize += 8 + 4; + const IMeshBuffer * const mb = mesh->getMeshBuffer(i); + + nodesize += mb->getVertexCount() * 10 * 4; + + nodesize += mb->getVertexCount() * texcoords * 2 * 4; + nodesize += mb->getIndexCount() * 4; + } + write(file, &nodesize, 4); + u32 nodecheck = Size; + + // Node + write(file, "", 1); + float f = 0; + write(file, &f, 4); + write(file, &f, 4); + write(file, &f, 4); + + f = 1; + write(file, &f, 4); + write(file, &f, 4); + write(file, &f, 4); + + write(file, &f, 4); + f = 0; + write(file, &f, 4); + write(file, &f, 4); + write(file, &f, 4); + + // Mesh + write(file, "MESH", 4); + const u32 meshsize = nodesize - 41 - 8 - bonesSize; + write(file, &meshsize, 4); + s32 brushID = -1; + write(file, &brushID, 4); + + + + // Verts + write(file, "VRTS", 4); + u32 vertsize = 12; + + for (u32 i = 0; i < numBeshBuffers; i++) + { + const IMeshBuffer * const mb = mesh->getMeshBuffer(i); + + vertsize += mb->getVertexCount() * 10 * 4 + + mb->getVertexCount() * texcoords * 2 * 4; + } + write(file, &vertsize, 4); + u32 vertcheck = Size; + + int flagsB3D = 3; + write(file, &flagsB3D, 4); + + write(file, &texcoords, 4); + flagsB3D = 2; + write(file, &flagsB3D, 4); + + for (u32 i = 0; i < numBeshBuffers; i++) + { + const IMeshBuffer * const mb = mesh->getMeshBuffer(i); + irr::u32 numVertices = mb->getVertexCount(); + for (u32 j = 0; j < numVertices; j++) + { + const vector3df &pos = mb->getPosition(j); + write(file, &pos.X, 4); + write(file, &pos.Y, 4); + write(file, &pos.Z, 4); + + const vector3df &n = mb->getNormal(j); + write(file, &n.X, 4); + write(file, &n.Y, 4); + write(file, &n.Z, 4); + + const u32 zero = 0; + switch (mb->getVertexType()) + { + case EVT_STANDARD: + { + S3DVertex *v = (S3DVertex *) mb->getVertices(); + const SColorf col(v[j].Color); + write(file, &col.r, 4); + write(file, &col.g, 4); + write(file, &col.b, 4); + write(file, &col.a, 4); + + write(file, &v[j].TCoords.X, 4); + write(file, &v[j].TCoords.Y, 4); + if (texcoords == 2) + { + write(file, &zero, 4); + write(file, &zero, 4); + } + } + break; + case EVT_2TCOORDS: + { + S3DVertex2TCoords *v = (S3DVertex2TCoords *) mb->getVertices(); + const SColorf col(v[j].Color); + write(file, &col.r, 4); + write(file, &col.g, 4); + write(file, &col.b, 4); + write(file, &col.a, 4); + + write(file, &v[j].TCoords.X, 4); + write(file, &v[j].TCoords.Y, 4); + write(file, &v[j].TCoords2.X, 4); + write(file, &v[j].TCoords2.Y, 4); + } + break; + case EVT_TANGENTS: + { + S3DVertexTangents *v = (S3DVertexTangents *) mb->getVertices(); + const SColorf col(v[j].Color); + write(file, &col.r, 4); + write(file, &col.g, 4); + write(file, &col.b, 4); + write(file, &col.a, 4); + + write(file, &v[j].TCoords.X, 4); + write(file, &v[j].TCoords.Y, 4); + if (texcoords == 2) + { + write(file, &zero, 4); + write(file, &zero, 4); + } + } + break; + } + } + } + // Check vertsize + vertcheck = Size - vertcheck; + if (vertcheck != vertsize) + { + printf("Failed in vertex size calculation, size %u advanced %u\n", + vertsize, vertcheck); + } + + u32 currentMeshBufferIndex = 0; + // Tris + for (u32 i = 0; i < numBeshBuffers; i++) + { + const IMeshBuffer * const mb = mesh->getMeshBuffer(i); + write(file, "TRIS", 4); + const u32 trisize = 4 + mb->getIndexCount() * 4; + write(file, &trisize, 4); + + u32 tricheck = Size; + + write(file, &i, 4); + + u32 numIndices = mb->getIndexCount(); + const u16 * const idx = (u16 *) mb->getIndices(); + for (u32 j = 0; j < numIndices; j += 3) + { + u32 tmp = idx[j] + currentMeshBufferIndex; + write(file, &tmp, sizeof(u32)); + + tmp = idx[j + 1] + currentMeshBufferIndex; + write(file, &tmp, sizeof(u32)); + + tmp = idx[j + 2] + currentMeshBufferIndex; + write(file, &tmp, sizeof(u32)); + } + + // Check that tris calculation was ok + tricheck = Size - tricheck; + if (tricheck != trisize) + { + printf("Failed in tris size calculation, size %u advanced %u\n", + trisize, tricheck); + } + + currentMeshBufferIndex += mb->getVertexCount(); + } + + if(ISkinnedMesh *skinnedMesh = getSkinned(mesh)) + { + // Write animation data + if (!skinnedMesh->isStatic()) + { + write(file, "ANIM", 4); + + const u32 animsize = 12; + write(file, &animsize, 4); + + const u32 flags = 0; + const u32 frames = skinnedMesh->getFrameCount(); + const f32 fps = skinnedMesh->getAnimationSpeed(); + + write(file, &flags, 4); + write(file, &frames, 4); + write(file, &fps, 4); + } + + // Write joints + core::array rootJoints = getRootJoints(skinnedMesh); + + for (u32 i = 0; i < rootJoints.size(); i++) + { + writeJointChunk(file, skinnedMesh, rootJoints[i]); + } + } + + // Check that node calculation was ok + nodecheck = Size - nodecheck; + if (nodecheck != nodesize) + { + printf("Failed in node size calculation, size %u advanced %u\n", + nodesize, nodecheck); + } + file->seek(4); + file->write(&Size, 4); + + return true; +} + + + +void CB3DMeshWriter::writeJointChunk(io::IWriteFile* file, ISkinnedMesh* mesh , ISkinnedMesh::SJoint* joint) +{ + // Node + write(file, "NODE", 4); + + // Calculate node size + u32 nodesize = getJointChunkSize(mesh, joint); + nodesize -= 8; // The declaration + size of THIS chunk shouldn't be added to the size + + write(file, &nodesize, 4); + + + core::stringc name = joint->Name; + write(file, name.c_str(), name.size()); + write(file, "", 1); + + core::vector3df pos = joint->Animatedposition; + // Position + write(file, &pos.X, 4); + write(file, &pos.Y, 4); + write(file, &pos.Z, 4); + + // Scale + core::vector3df scale = joint->Animatedscale; + if (scale == core::vector3df(0, 0, 0)) + scale = core::vector3df(1, 1, 1); + + write(file, &scale.X, 4); + write(file, &scale.Y, 4); + write(file, &scale.Z, 4); + + // Rotation + core::quaternion quat = joint->Animatedrotation; + write(file, &quat.W, 4); + write(file, &quat.X, 4); + write(file, &quat.Y, 4); + write(file, &quat.Z, 4); + + // Bone + write(file, "BONE", 4); + u32 bonesize = 8 * joint->Weights.size(); + write(file, &bonesize, 4); + + // Skinning ------------------ + for (u32 i = 0; i < joint->Weights.size(); i++) + { + const u32 vertexID = joint->Weights[i].vertex_id; + const u32 bufferID = joint->Weights[i].buffer_id; + const f32 weight = joint->Weights[i].strength; + + u32 b3dVertexID = vertexID; + for (u32 j = 0; j < bufferID; j++) + { + b3dVertexID += mesh->getMeshBuffer(j)->getVertexCount(); + } + + write(file, &b3dVertexID, 4); + write(file, &weight, 4); + } + // --------------------------- + + // Animation keys + if (joint->PositionKeys.size()) + { + write(file, "KEYS", 4); + u32 keysSize = 4 * joint->PositionKeys.size() * 4; // X, Y and Z pos + frame + keysSize += 4; // Flag to define the type of the key + write(file, &keysSize, 4); + + u32 flag = 1; // 1 = flag for position keys + write(file, &flag, 4); + + for (u32 i = 0; i < joint->PositionKeys.size(); i++) + { + const s32 frame = static_cast(joint->PositionKeys[i].frame); + const core::vector3df pos = joint->PositionKeys[i].position; + + write (file, &frame, 4); + + write (file, &pos.X, 4); + write (file, &pos.Y, 4); + write (file, &pos.Z, 4); + + } + } + if (joint->RotationKeys.size()) + { + write(file, "KEYS", 4); + u32 keysSize = 4 * joint->RotationKeys.size() * 5; // W, X, Y and Z rot + frame + keysSize += 4; // Flag + write(file, &keysSize, 4); + + u32 flag = 4; + write(file, &flag, 4); + + for (u32 i = 0; i < joint->RotationKeys.size(); i++) + { + const s32 frame = static_cast(joint->RotationKeys[i].frame); + const core::quaternion rot = joint->RotationKeys[i].rotation; + + write (file, &frame, 4); + + write (file, &rot.W, 4); + write (file, &rot.X, 4); + write (file, &rot.Y, 4); + write (file, &rot.Z, 4); + } + } + if (joint->ScaleKeys.size()) + { + write(file, "KEYS", 4); + u32 keysSize = 4 * joint->ScaleKeys.size() * 4; // X, Y and Z scale + frame + keysSize += 4; // Flag + write(file, &keysSize, 4); + + u32 flag = 2; + write(file, &flag, 4); + + for (u32 i = 0; i < joint->ScaleKeys.size(); i++) + { + const s32 frame = static_cast(joint->ScaleKeys[i].frame); + const core::vector3df scale = joint->ScaleKeys[i].scale; + + write (file, &frame, 4); + + write (file, &scale.X, 4); + write (file, &scale.Y, 4); + write (file, &scale.Z, 4); + } + } + + for (u32 i = 0; i < joint->Children.size(); i++) + { + writeJointChunk(file, mesh, joint->Children[i]); + } +} + + +ISkinnedMesh* CB3DMeshWriter::getSkinned (IMesh *mesh) +{ + if (mesh->getMeshType() == EAMT_SKINNED) + { + return static_cast(mesh); + } + return 0; +} + +u32 CB3DMeshWriter::getJointChunkSize(const ISkinnedMesh* mesh, ISkinnedMesh::SJoint* joint) +{ + u32 chunkSize = 8 + 40; // Chunk declaration + chunk data + chunkSize += joint->Name.size() + 1; // the NULL character at the end of the string + + u32 boneSize = joint->Weights.size() * 8; // vertex_id + weight = 8 bits per weight block + boneSize += 8; // declaration + size of he BONE chunk + + u32 keysSize = 0; + if (joint->PositionKeys.size() != 0) + { + keysSize += 8; // KEYS + chunk size + keysSize += 4; // flags + + keysSize += (joint->PositionKeys.size() * 16); + } + if (joint->RotationKeys.size() != 0) + { + keysSize += 8; // KEYS + chunk size + keysSize += 4; // flags + + keysSize += (joint->RotationKeys.size() * 20); + } + if (joint->ScaleKeys.size() != 0) + { + keysSize += 8; // KEYS + chunk size + keysSize += 4; // flags + + keysSize += (joint->ScaleKeys.size() * 16); + } + + chunkSize += boneSize; + chunkSize += keysSize; + + for (u32 i = 0; i < joint->Children.size(); ++i) + { + chunkSize += (getJointChunkSize(mesh, joint->Children[i])); + } + return chunkSize; +} + +core::array CB3DMeshWriter::getRootJoints(const ISkinnedMesh* mesh) +{ + core::array roots; + + core::array allJoints = mesh->getAllJoints(); + for (u32 i = 0; i < allJoints.size(); i++) + { + bool isRoot = true; + ISkinnedMesh::SJoint* testedJoint = allJoints[i]; + for (u32 j = 0; j < allJoints.size(); j++) + { + ISkinnedMesh::SJoint* testedJoint2 = allJoints[j]; + for (u32 k = 0; k < testedJoint2->Children.size(); k++) + { + if (testedJoint == testedJoint2->Children[k]) + isRoot = false; + } + } + if (isRoot) + roots.push_back(testedJoint); + } + + return roots; +} + +u32 CB3DMeshWriter::getUVlayerCount(IMesh* mesh) +{ + const u32 numBeshBuffers = mesh->getMeshBufferCount(); + for (u32 i = 0; i < numBeshBuffers; i++) + { + const IMeshBuffer * const mb = mesh->getMeshBuffer(i); + + if (mb->getVertexType() == EVT_2TCOORDS) + { + return 2; + } + } + return 1; +} + +void CB3DMeshWriter::write(io::IWriteFile* file, const void *ptr, const u32 bytes) +{ + file->write(ptr, bytes); + Size += bytes; +} + +} // end namespace +} // end namespace + +#endif // _IRR_COMPILE_WITH_B3D_WRITER_ + diff --git a/source/Irrlicht/CB3DMeshWriter.h b/source/Irrlicht/CB3DMeshWriter.h new file mode 100644 index 00000000..d4653afd --- /dev/null +++ b/source/Irrlicht/CB3DMeshWriter.h @@ -0,0 +1,53 @@ +// Copyright (C) 2014 Lauri Kasanen +// This file is part of the "Irrlicht Engine". +// For conditions of distribution and use, see copyright notice in irrlicht.h + +// Modified version with rigging/skinning support + +#ifndef __IRR_B3D_MESH_WRITER_H_INCLUDED__ +#define __IRR_B3D_MESH_WRITER_H_INCLUDED__ + +#include "IMeshWriter.h" +#include "IFileSystem.h" +#include "SB3DStructs.h" +#include "ISkinnedMesh.h" + + + +namespace irr +{ +namespace scene +{ + +//! class to write B3D mesh files +class CB3DMeshWriter : public IMeshWriter +{ +public: + + CB3DMeshWriter(io::IFileSystem *fs); + + //! Returns the type of the mesh writer + virtual EMESH_WRITER_TYPE getType() const; + + //! writes a mesh + virtual bool writeMesh(io::IWriteFile* file, scene::IMesh* mesh, s32 flags=EMWF_NONE); + +private: + io::IFileSystem *FileSystem; + u32 Size; + + void writeJointChunk(io::IWriteFile* file, ISkinnedMesh* mesh , ISkinnedMesh::SJoint* joint); + u32 getJointChunkSize(const ISkinnedMesh* mesh, ISkinnedMesh::SJoint* joint); + core::array getRootJoints(const ISkinnedMesh* mesh); + + u32 getUVlayerCount(IMesh *mesh); + ISkinnedMesh* getSkinned (IMesh *mesh); + + void write(io::IWriteFile* file, const void *ptr, const u32 bytes); + +}; + +} // end namespace +} // end namespace + +#endif diff --git a/source/Irrlicht/CBlit.h b/source/Irrlicht/CBlit.h index ba8c129b..3fb6f0de 100644 --- a/source/Irrlicht/CBlit.h +++ b/source/Irrlicht/CBlit.h @@ -237,7 +237,7 @@ static void RenderLine32_Decal(video::IImage *t, } u32 *dst; - dst = (u32*) ( (u8*) t->lock() + ( p0.Y * t->getPitch() ) + ( p0.X << 2 ) ); + dst = (u32*) ( (u8*) t->getData() + ( p0.Y * t->getPitch() ) + ( p0.X << 2 ) ); if ( dy > dx ) { @@ -267,8 +267,6 @@ static void RenderLine32_Decal(video::IImage *t, } run -= 1; } while (run>=0); - - t->unlock(); } @@ -303,7 +301,7 @@ static void RenderLine32_Blend(video::IImage *t, } u32 *dst; - dst = (u32*) ( (u8*) t->lock() + ( p0.Y * t->getPitch() ) + ( p0.X << 2 ) ); + dst = (u32*) ( (u8*) t->getData() + ( p0.Y * t->getPitch() ) + ( p0.X << 2 ) ); if ( dy > dx ) { @@ -334,8 +332,6 @@ static void RenderLine32_Blend(video::IImage *t, } run -= 1; } while (run>=0); - - t->unlock(); } /* @@ -369,7 +365,7 @@ static void RenderLine16_Decal(video::IImage *t, } u16 *dst; - dst = (u16*) ( (u8*) t->lock() + ( p0.Y * t->getPitch() ) + ( p0.X << 1 ) ); + dst = (u16*) ( (u8*) t->getData() + ( p0.Y * t->getPitch() ) + ( p0.X << 1 ) ); if ( dy > dx ) { @@ -399,8 +395,6 @@ static void RenderLine16_Decal(video::IImage *t, } run -= 1; } while (run>=0); - - t->unlock(); } /* @@ -435,7 +429,7 @@ static void RenderLine16_Blend(video::IImage *t, } u16 *dst; - dst = (u16*) ( (u8*) t->lock() + ( p0.Y * t->getPitch() ) + ( p0.X << 1 ) ); + dst = (u16*) ( (u8*) t->getData() + ( p0.Y * t->getPitch() ) + ( p0.X << 1 ) ); if ( dy > dx ) { @@ -466,8 +460,6 @@ static void RenderLine16_Blend(video::IImage *t, } run -= 1; } while (run>=0); - - t->unlock(); } @@ -1139,7 +1131,7 @@ static s32 Blit(eBlitter operation, { job.srcPitch = source->getPitch(); job.srcPixelMul = source->getBytesPerPixel(); - job.src = (void*) ( (u8*) source->lock() + ( job.Source.y0 * job.srcPitch ) + ( job.Source.x0 * job.srcPixelMul ) ); + job.src = (void*) ( (u8*) source->getData() + ( job.Source.y0 * job.srcPitch ) + ( job.Source.x0 * job.srcPixelMul ) ); } else { @@ -1149,16 +1141,10 @@ static s32 Blit(eBlitter operation, job.dstPitch = dest->getPitch(); job.dstPixelMul = dest->getBytesPerPixel(); - job.dst = (void*) ( (u8*) dest->lock() + ( job.Dest.y0 * job.dstPitch ) + ( job.Dest.x0 * job.dstPixelMul ) ); + job.dst = (void*) ( (u8*) dest->getData() + ( job.Dest.y0 * job.dstPitch ) + ( job.Dest.x0 * job.dstPixelMul ) ); blitter( &job ); - if ( source ) - source->unlock(); - - if ( dest ) - dest->unlock(); - return 1; } @@ -1193,7 +1179,7 @@ static s32 StretchBlit(eBlitter operation, { job.srcPitch = source->getPitch(); job.srcPixelMul = source->getBytesPerPixel(); - job.src = (void*) ( (u8*) source->lock() + ( job.Source.y0 * job.srcPitch ) + ( job.Source.x0 * job.srcPixelMul ) ); + job.src = (void*) ( (u8*) source->getData() + ( job.Source.y0 * job.srcPitch ) + ( job.Source.x0 * job.srcPixelMul ) ); } else { @@ -1203,16 +1189,10 @@ static s32 StretchBlit(eBlitter operation, job.dstPitch = dest->getPitch(); job.dstPixelMul = dest->getBytesPerPixel(); - job.dst = (void*) ( (u8*) dest->lock() + ( job.Dest.y0 * job.dstPitch ) + ( job.Dest.x0 * job.dstPixelMul ) ); + job.dst = (void*) ( (u8*) dest->getData() + ( job.Dest.y0 * job.dstPitch ) + ( job.Dest.x0 * job.dstPixelMul ) ); blitter( &job ); - if ( source ) - source->unlock(); - - if ( dest ) - dest->unlock(); - return 1; } diff --git a/source/Irrlicht/CBurningShader_Raster_Reference.cpp b/source/Irrlicht/CBurningShader_Raster_Reference.cpp index c392e9e3..c0ea0397 100644 --- a/source/Irrlicht/CBurningShader_Raster_Reference.cpp +++ b/source/Irrlicht/CBurningShader_Raster_Reference.cpp @@ -721,7 +721,7 @@ REALINLINE void CBurningShader_Raster_Reference::scanline2() line.t[i][0] += line.t[i][1] * subPixel; } - pShader.dst = (tVideoSample*) ( (u8*) RenderTarget->lock() + ( line.y * RenderTarget->getPitch() ) + ( pShader.xStart << VIDEO_SAMPLE_GRANULARITY ) ); + pShader.dst = (tVideoSample*) ( (u8*) RenderTarget->getData() + ( line.y * RenderTarget->getPitch() ) + ( pShader.xStart << VIDEO_SAMPLE_GRANULARITY ) ); pShader.z = (fp24*) ( (u8*) DepthBuffer->lock() + ( line.y * DepthBuffer->getPitch() ) + ( pShader.xStart << VIDEO_SAMPLE_GRANULARITY ) ); for ( pShader.i = 0; pShader.i <= pShader.dx; ++pShader.i ) @@ -803,7 +803,7 @@ REALINLINE void CBurningShader_Raster_Reference::scanline () line.w[0] = a; line.w[1] = b; - pShader.dst = (tVideoSample*) ( (u8*) RenderTarget->lock() + ( line.y * RenderTarget->getPitch() ) + ( pShader.xStart << VIDEO_SAMPLE_GRANULARITY ) ); + pShader.dst = (tVideoSample*) ( (u8*) RenderTarget->getData() + ( line.y * RenderTarget->getPitch() ) + ( pShader.xStart << VIDEO_SAMPLE_GRANULARITY ) ); a = (f32) pShader.i + subPixel; diff --git a/source/Irrlicht/CCameraSceneNode.cpp b/source/Irrlicht/CCameraSceneNode.cpp index 3f9bc891..ea8b6911 100644 --- a/source/Irrlicht/CCameraSceneNode.cpp +++ b/source/Irrlicht/CCameraSceneNode.cpp @@ -17,6 +17,7 @@ namespace scene CCameraSceneNode::CCameraSceneNode(ISceneNode* parent, ISceneManager* mgr, s32 id, const core::vector3df& position, const core::vector3df& lookat) : ICameraSceneNode(parent, mgr, id, position), + BoundingBox(core::vector3df(0, 0, 0)), // Camera has no size. Still not sure if FLT_MAX might be the better variant Target(lookat), UpVector(0.0f, 1.0f, 0.0f), ZNear(1.0f), ZFar(3000.0f), InputReceiverEnabled(true), TargetAndRotationAreBound(false) { @@ -34,9 +35,9 @@ CCameraSceneNode::CCameraSceneNode(ISceneNode* parent, ISceneManager* mgr, s32 i else Aspect = 4.0f / 3.0f; // Aspect ratio. + ViewArea.setFarNearDistance(ZFar - ZNear); recalculateProjectionMatrix(); recalculateViewArea(); - ViewArea.setFarNearDistance(ZFar - ZNear); } @@ -50,7 +51,6 @@ void CCameraSceneNode::setInputReceiverEnabled(bool enabled) //! Returns if the input receiver of the camera is currently enabled. bool CCameraSceneNode::isInputReceiverEnabled() const { - _IRR_IMPLEMENT_MANAGED_MARSHALLING_BUGFIX; return InputReceiverEnabled; } @@ -284,11 +284,14 @@ void CCameraSceneNode::updateMatrices() //! returns the axis aligned bounding box of this node const core::aabbox3d& CCameraSceneNode::getBoundingBox() const { - return ViewArea.getBoundingBox(); + // NOTE: We deliberately don't return the boundingbox of the ViewArea. People can access that already. + // We want to prevent cameras from having their bounding box colliding in the SceneCollisionManager. + // If another boundingbox is ever necessary then please move BoundingBox to ICameraSceneNode and make it accessible (via a setter or an enum with options). + return BoundingBox; } -//! returns the view frustum. needed sometimes by bsp or lod render nodes. +//! returns the view frustum. const SViewFrustum* CCameraSceneNode::getViewFrustum() const { return &ViewArea; diff --git a/source/Irrlicht/CCameraSceneNode.h b/source/Irrlicht/CCameraSceneNode.h index 6fdc6f55..b1cd13c8 100644 --- a/source/Irrlicht/CCameraSceneNode.h +++ b/source/Irrlicht/CCameraSceneNode.h @@ -119,7 +119,7 @@ namespace scene //! Returns the axis aligned bounding box of this node virtual const core::aabbox3d& getBoundingBox() const _IRR_OVERRIDE_; - //! Returns the view area. Sometimes needed by bsp or lod render nodes. + //! Returns the view area. virtual const SViewFrustum* getViewFrustum() const _IRR_OVERRIDE_; //! Disables or enables the camera to get key or mouse inputs. @@ -153,6 +153,8 @@ namespace scene void recalculateProjectionMatrix(); void recalculateViewArea(); + core::aabbox3d BoundingBox; + core::vector3df Target; core::vector3df UpVector; diff --git a/source/Irrlicht/CCgMaterialRenderer.cpp b/source/Irrlicht/CCgMaterialRenderer.cpp deleted file mode 100644 index 06b9cd26..00000000 --- a/source/Irrlicht/CCgMaterialRenderer.cpp +++ /dev/null @@ -1,334 +0,0 @@ -// Copyright (C) 2012 Patryk Nadrowski -// This file is part of the "Irrlicht Engine". -// For conditions of distribution and use, see copyright notice in irrlicht.h - -#include "IrrCompileConfig.h" -#ifdef _IRR_COMPILE_WITH_CG_ - -#include "CCgMaterialRenderer.h" - -namespace irr -{ -namespace video -{ - -CCgUniform::CCgUniform(const CGparameter& parameter, bool global) : Parameter(parameter), Type(CG_UNKNOWN_TYPE) -{ - Name = cgGetParameterName(Parameter); - - if(global) - Space = CG_GLOBAL; - else - Space = CG_PROGRAM; -} - -CCgUniform::~CCgUniform() -{ -} - -const core::stringc& CCgUniform::getName() const -{ - return Name; -} - -const CGparameter& CCgUniform::getParameter() const -{ - return Parameter; -} - -CGenum CCgUniform::getSpace() const -{ - return Space; -} - -CGtype CCgUniform::getType() const -{ - return Type; -} - -CCgUniform1f::CCgUniform1f(const CGparameter& parameter, bool global) : CCgUniform(parameter, global) -{ - Type = CG_FLOAT; -} - -void CCgUniform1f::update(const void* data, const SMaterial& material) const -{ - f32* Data = (f32*)data; - cgSetParameter1f(Parameter, *Data); -} - -CCgUniform2f::CCgUniform2f(const CGparameter& parameter, bool global) : CCgUniform(parameter, global) -{ - Type = CG_FLOAT2; -} - -void CCgUniform2f::update(const void* data, const SMaterial& material) const -{ - f32* Data = (f32*)data; - cgSetParameter2f(Parameter, *Data, *(Data+1)); -} - -CCgUniform3f::CCgUniform3f(const CGparameter& parameter, bool global) : CCgUniform(parameter, global) -{ - Type = CG_FLOAT3; -} - -void CCgUniform3f::update(const void* data, const SMaterial& material) const -{ - f32* Data = (f32*)data; - cgSetParameter3f(Parameter, *Data, *(Data+1), *(Data+2)); -} - -CCgUniform4f::CCgUniform4f(const CGparameter& parameter, bool global) : CCgUniform(parameter, global) -{ - Type = CG_FLOAT4; -} - -void CCgUniform4f::update(const void* data, const SMaterial& material) const -{ - f32* Data = (f32*)data; - cgSetParameter4f(Parameter, *Data, *(Data+1), *(Data+2), *(Data+3)); -} - -CCgUniform1i::CCgUniform1i(const CGparameter& parameter, bool global) : CCgUniform(parameter, global) -{ - Type = CG_INT; -} - -void CCgUniform1i::update(const void* data, const SMaterial& material) const -{ - s32* Data = (s32*)data; - cgSetParameter1i(Parameter, *Data); -} - -CCgUniform2i::CCgUniform2i(const CGparameter& parameter, bool global) : CCgUniform(parameter, global) -{ - Type = CG_INT2; -} - -void CCgUniform2i::update(const void* data, const SMaterial& material) const -{ - s32* Data = (s32*)data; - cgSetParameter2i(Parameter, *Data, *(Data+1)); -} - -CCgUniform3i::CCgUniform3i(const CGparameter& parameter, bool global) : CCgUniform(parameter, global) -{ - Type = CG_INT3; -} - -void CCgUniform3i::update(const void* data, const SMaterial& material) const -{ - s32* Data = (s32*)data; - cgSetParameter3i(Parameter, *Data, *(Data+1), *(Data+2)); -} - -CCgUniform4i::CCgUniform4i(const CGparameter& parameter, bool global) : CCgUniform(parameter, global) -{ - Type = CG_INT4; -} - -void CCgUniform4i::update(const void* data, const SMaterial& material) const -{ - s32* Data = (s32*)data; - cgSetParameter4i(Parameter, *Data, *(Data+1), *(Data+2), *(Data+3)); -} - -CCgUniform4x4f::CCgUniform4x4f(const CGparameter& parameter, bool global) : CCgUniform(parameter, global) -{ - Type = CG_FLOAT4x4; -} - -void CCgUniform4x4f::update(const void* data, const SMaterial& material) const -{ - f32* Data = (f32*)data; - cgSetMatrixParameterfr(Parameter, Data); -} - -CCgUniformSampler2D::CCgUniformSampler2D(const CGparameter& parameter, bool global) : CCgUniform(parameter, global) -{ - Type = CG_SAMPLER2D; -} - -void CCgUniformSampler2D::update(const void* data, const SMaterial& material) const -{ -} - -CCgMaterialRenderer::CCgMaterialRenderer(IShaderConstantSetCallBack* callback, s32 userData) : - CallBack(callback), UserData(userData), - VertexProgram(0), FragmentProgram(0), GeometryProgram(0), VertexProfile(CG_PROFILE_UNKNOWN), FragmentProfile(CG_PROFILE_UNKNOWN), GeometryProfile(CG_PROFILE_UNKNOWN), - Material(IdentityMaterial), Error(CG_NO_ERROR) -{ - #ifdef _DEBUG - setDebugName("CCgMaterialRenderer"); - #endif - - if(CallBack) - CallBack->grab(); -} - -CCgMaterialRenderer::~CCgMaterialRenderer() -{ - if(CallBack) - CallBack->drop(); - - for(unsigned int i = 0; i < UniformInfo.size(); ++i) - delete UniformInfo[i]; - - UniformInfo.clear(); -} - -s32 CCgMaterialRenderer::getVertexShaderConstantID(const c8* name) -{ - return getPixelShaderConstantID(name); -} - -s32 CCgMaterialRenderer::getPixelShaderConstantID(const c8* name) -{ - for(u32 i = 0; i < UniformInfo.size(); ++i) - { - if(UniformInfo[i]->getName() == name) - return i; - } - - return -1; -} - -void CCgMaterialRenderer::setVertexShaderConstant(const f32* data, s32 startRegister, s32 constantAmount) -{ - os::Printer::log("Cannot set constant, please use high level shader call instead.", ELL_WARNING); -} - -void CCgMaterialRenderer::setPixelShaderConstant(const f32* data, s32 startRegister, s32 constantAmount) -{ - os::Printer::log("Cannot set constant, please use high level shader call instead.", ELL_WARNING); -} - -bool CCgMaterialRenderer::setVertexShaderConstant(s32 index, const f32* floats, int count) -{ - return setPixelShaderConstant(index, floats, count); -} - -bool CCgMaterialRenderer::setVertexShaderConstant(s32 index, const s32* ints, int count) -{ - return setPixelShaderConstant(index, ints, count); -} - -bool CCgMaterialRenderer::setPixelShaderConstant(s32 index, const f32* floats, int count) -{ - if(index < 0) - return false; - - UniformInfo[index]->update(floats, Material); - - return true; -} - -bool CCgMaterialRenderer::setPixelShaderConstant(s32 index, const s32* ints, int count) -{ - if(index < 0) - return false; - - UniformInfo[index]->update(ints, Material); - - return true; -} - -void CCgMaterialRenderer::getUniformList() -{ - for(unsigned int i = 0; i < UniformInfo.size(); ++i) - delete UniformInfo[i]; - - UniformInfo.clear(); - - for(unsigned int i = 0; i < 2; ++i) - { - CGenum Space = CG_GLOBAL; - bool IsGlobal = 1; - - if(i == 1) - { - Space = CG_PROGRAM; - IsGlobal = 0; - } - - for(unsigned int j = 0; j < 3; ++j) - { - CGprogram* Program = 0; - - switch(j) - { - case 0: - Program = &VertexProgram; - break; - case 1: - Program = &FragmentProgram; - break; - case 2: - Program = &GeometryProgram; - break; - } - - if(*Program) - { - CGparameter Parameter = cgGetFirstParameter(*Program, Space); - - while(Parameter) - { - if(cgGetParameterVariability(Parameter) == CG_UNIFORM && cgGetParameterDirection(Parameter) == CG_IN) - { - CCgUniform* Uniform = 0; - - CGtype Type = cgGetParameterType(Parameter); - - switch(Type) - { - case CG_FLOAT: - case CG_FLOAT1: - Uniform = new CCgUniform1f(Parameter, IsGlobal); - break; - case CG_FLOAT2: - Uniform = new CCgUniform2f(Parameter, IsGlobal); - break; - case CG_FLOAT3: - Uniform = new CCgUniform3f(Parameter, IsGlobal); - break; - case CG_FLOAT4: - Uniform = new CCgUniform4f(Parameter, IsGlobal); - break; - case CG_INT: - case CG_INT1: - Uniform = new CCgUniform1i(Parameter, IsGlobal); - break; - case CG_INT2: - Uniform = new CCgUniform2i(Parameter, IsGlobal); - break; - case CG_INT3: - Uniform = new CCgUniform3i(Parameter, IsGlobal); - break; - case CG_INT4: - Uniform = new CCgUniform4i(Parameter, IsGlobal); - break; - case CG_FLOAT4x4: - Uniform = new CCgUniform4x4f(Parameter, IsGlobal); - break; - case CG_SAMPLER2D: - Uniform = new CCgUniformSampler2D(Parameter, IsGlobal); - break; - } - - if(Uniform) - UniformInfo.push_back(Uniform); - } - - Parameter = cgGetNextParameter(Parameter); - } - } - } - } -} - -} -} - -#endif diff --git a/source/Irrlicht/CCgMaterialRenderer.h b/source/Irrlicht/CCgMaterialRenderer.h deleted file mode 100644 index 6e0d93c7..00000000 --- a/source/Irrlicht/CCgMaterialRenderer.h +++ /dev/null @@ -1,170 +0,0 @@ -// Copyright (C) 2012 Patryk Nadrowski -// This file is part of the "Irrlicht Engine". -// For conditions of distribution and use, see copyright notice in irrlicht.h - -#ifndef __C_CG_MATERIAL_RENDERER_H_INCLUDED__ -#define __C_CG_MATERIAL_RENDERER_H_INCLUDED__ - -#include "IrrCompileConfig.h" -#ifdef _IRR_COMPILE_WITH_CG_ - -#include "IMaterialRenderer.h" -#include "IMaterialRendererServices.h" -#include "IShaderConstantSetCallBack.h" -#include "IGPUProgrammingServices.h" -#include "irrArray.h" -#include "irrString.h" -#include "IVideoDriver.h" -#include "os.h" -#include "Cg/cg.h" - -#ifdef _MSC_VER - #pragma comment(lib, "cg.lib") -#endif - -namespace irr -{ -namespace video -{ - -class CCgUniform -{ -public: - CCgUniform(const CGparameter& parameter, bool global); - virtual ~CCgUniform(); - - const core::stringc& getName() const; - const CGparameter& getParameter() const; - CGenum getSpace() const; - CGtype getType() const; - - virtual void update(const void* data, const SMaterial& material) const = 0; - -protected: - core::stringc Name; - CGparameter Parameter; - CGenum Space; - CGtype Type; -}; - -class CCgUniform1f : public CCgUniform -{ -public: - CCgUniform1f(const CGparameter& parameter, bool global); - - virtual void update(const void* data, const SMaterial& material) const _IRR_OVERRIDE_; -}; - -class CCgUniform2f : public CCgUniform -{ -public: - CCgUniform2f(const CGparameter& parameter, bool global); - - virtual void update(const void* data, const SMaterial& material) const _IRR_OVERRIDE_; -}; - -class CCgUniform3f : public CCgUniform -{ -public: - CCgUniform3f(const CGparameter& parameter, bool global); - - virtual void update(const void* data, const SMaterial& material) const _IRR_OVERRIDE_; -}; - -class CCgUniform4f : public CCgUniform -{ -public: - CCgUniform4f(const CGparameter& parameter, bool global); - - virtual void update(const void* data, const SMaterial& material) const _IRR_OVERRIDE_; -}; - -class CCgUniform1i : public CCgUniform -{ -public: - CCgUniform1i(const CGparameter& parameter, bool global); - - virtual void update(const void* data, const SMaterial& material) const _IRR_OVERRIDE_; -}; - -class CCgUniform2i : public CCgUniform -{ -public: - CCgUniform2i(const CGparameter& parameter, bool global); - - virtual void update(const void* data, const SMaterial& material) const _IRR_OVERRIDE_; -}; - -class CCgUniform3i : public CCgUniform -{ -public: - CCgUniform3i(const CGparameter& parameter, bool global); - - virtual void update(const void* data, const SMaterial& material) const _IRR_OVERRIDE_; -}; - -class CCgUniform4i : public CCgUniform -{ -public: - CCgUniform4i(const CGparameter& parameter, bool global); - - virtual void update(const void* data, const SMaterial& material) const _IRR_OVERRIDE_; -}; - -class CCgUniform4x4f : public CCgUniform -{ -public: - CCgUniform4x4f(const CGparameter& parameter, bool global); - - virtual void update(const void* data, const SMaterial& material) const _IRR_OVERRIDE_; -}; - -class CCgUniformSampler2D : public CCgUniform -{ -public: - CCgUniformSampler2D(const CGparameter& parameter, bool global); - - virtual void update(const void* data, const SMaterial& material) const _IRR_OVERRIDE_; -}; - -class CCgMaterialRenderer : public IMaterialRenderer, public IMaterialRendererServices -{ -public: - CCgMaterialRenderer(IShaderConstantSetCallBack* callback = 0, s32 userData = 0); - virtual ~CCgMaterialRenderer(); - - virtual bool isTransparent() const = 0; - - virtual s32 getVertexShaderConstantID(const c8* name) _IRR_OVERRIDE_; - virtual s32 getPixelShaderConstantID(const c8* name) _IRR_OVERRIDE_; - virtual void setVertexShaderConstant(const f32* data, s32 startRegister, s32 constantAmount=1) _IRR_OVERRIDE_; - virtual void setPixelShaderConstant(const f32* data, s32 startRegister, s32 constantAmount=1) _IRR_OVERRIDE_; - virtual bool setVertexShaderConstant(s32 index, const f32* floats, int count) _IRR_OVERRIDE_; - virtual bool setVertexShaderConstant(s32 index, const s32* ints, int count) _IRR_OVERRIDE_; - virtual bool setPixelShaderConstant(s32 index, const f32* floats, int count) _IRR_OVERRIDE_; - virtual bool setPixelShaderConstant(s32 index, const s32* ints, int count) _IRR_OVERRIDE_; - -protected: - void getUniformList(); - - IShaderConstantSetCallBack* CallBack; - s32 UserData; - - core::array UniformInfo; - - CGprogram VertexProgram; - CGprogram FragmentProgram; - CGprogram GeometryProgram; - CGprofile VertexProfile; - CGprofile FragmentProfile; - CGprofile GeometryProfile; - - SMaterial Material; - CGerror Error; -}; - -} -} - -#endif -#endif diff --git a/source/Irrlicht/CColladaMeshWriter.cpp b/source/Irrlicht/CColladaMeshWriter.cpp index d4befb64..54503aed 100644 --- a/source/Irrlicht/CColladaMeshWriter.cpp +++ b/source/Irrlicht/CColladaMeshWriter.cpp @@ -211,7 +211,7 @@ irr::core::stringw CColladaMeshWriterNames::nameForMaterial(const video::SMateri irr::core::stringw CColladaMeshWriterNames::nameForPtr(const void* ptr) const { wchar_t buf[32]; - swprintf(buf, 32, L"%p", ptr); + swprintf_irr(buf, 32, L"%p", ptr); return irr::core::stringw(buf); } @@ -763,11 +763,15 @@ void CColladaMeshWriter::writeSceneNode(irr::scene::ISceneNode * node ) } else { - irr::core::vector3df rot(node->getRotation()); writeTranslateElement( node->getPosition() ); - writeRotateElement( irr::core::vector3df(1.f, 0.f, 0.f), rot.X ); - writeRotateElement( irr::core::vector3df(0.f, 1.f, 0.f), rot.Y ); - writeRotateElement( irr::core::vector3df(0.f, 0.f, 1.f), rot.Z ); + + irr::core::vector3df rot(node->getRotation()); + core::quaternion quat(rot*core::DEGTORAD); + f32 angle; + core::vector3df axis; + quat.toAngleAxis(angle, axis); + writeRotateElement( axis, angle*core::RADTODEG ); + writeScaleElement( node->getScale() ); } @@ -980,7 +984,7 @@ bool CColladaMeshWriter::hasSecondTextureCoordinates(video::E_VERTEX_TYPE type) void CColladaMeshWriter::writeVector(const irr::core::vector3df& vec) { wchar_t tmpbuf[255]; - swprintf(tmpbuf, 255, L"%f %f %f", vec.X, vec.Y, vec.Z); + swprintf_irr(tmpbuf, 255, L"%f %f %f", vec.X, vec.Y, vec.Z); Writer->writeText(tmpbuf); } @@ -989,7 +993,7 @@ void CColladaMeshWriter::writeUv(const irr::core::vector2df& vec) { // change handedness wchar_t tmpbuf[255]; - swprintf(tmpbuf, 255, L"%f %f", vec.X, 1.f-vec.Y); + swprintf_irr(tmpbuf, 255, L"%f %f", vec.X, 1.f-vec.Y); Writer->writeText(tmpbuf); } @@ -997,7 +1001,7 @@ void CColladaMeshWriter::writeUv(const irr::core::vector2df& vec) void CColladaMeshWriter::writeVector(const irr::core::vector2df& vec) { wchar_t tmpbuf[255]; - swprintf(tmpbuf, 255, L"%f %f", vec.X, vec.Y); + swprintf_irr(tmpbuf, 255, L"%f %f", vec.X, vec.Y); Writer->writeText(tmpbuf); } @@ -1006,9 +1010,9 @@ void CColladaMeshWriter::writeColor(const irr::video::SColorf& colorf, bool writ { wchar_t tmpbuf[255]; if ( writeAlpha ) - swprintf(tmpbuf, 255, L"%f %f %f %f", colorf.getRed(), colorf.getGreen(), colorf.getBlue(), colorf.getAlpha()); + swprintf_irr(tmpbuf, 255, L"%f %f %f %f", colorf.getRed(), colorf.getGreen(), colorf.getBlue(), colorf.getAlpha()); else - swprintf(tmpbuf, 255, L"%f %f %f", colorf.getRed(), colorf.getGreen(), colorf.getBlue()); + swprintf_irr(tmpbuf, 255, L"%f %f %f", colorf.getRed(), colorf.getGreen(), colorf.getBlue()); Writer->writeText(tmpbuf); } @@ -1117,7 +1121,7 @@ irr::core::stringw CColladaMeshWriter::nameForMaterial(const video::SMaterial & irr::core::stringw CColladaMeshWriter::nameForMaterialSymbol(const scene::IMesh* mesh, int materialId) const { wchar_t buf[100]; - swprintf(buf, 100, L"mat_symb_%p_%d", mesh, materialId); + swprintf_irr(buf, 100, L"mat_symb_%p_%d", mesh, materialId); return irr::core::stringw(buf); } @@ -2248,7 +2252,7 @@ void CColladaMeshWriter::writeLookAtElement(const irr::core::vector3df& eyePos, Writer->writeElement(L"lookat", false); wchar_t tmpbuf[255]; - swprintf(tmpbuf, 255, L"%f %f %f %f %f %f %f %f %f", eyePos.X, eyePos.Y, eyePos.Z, targetPos.X, targetPos.Y, targetPos.Z, upVector.X, upVector.Y, upVector.Z); + swprintf_irr(tmpbuf, 255, L"%f %f %f %f %f %f %f %f %f", eyePos.X, eyePos.Y, eyePos.Z, targetPos.X, targetPos.Y, targetPos.Z, upVector.X, upVector.Y, upVector.Z); Writer->writeText(tmpbuf); Writer->writeClosingTag(L"lookat"); diff --git a/source/Irrlicht/CColorConverter.h b/source/Irrlicht/CColorConverter.h index 07e05615..e77ad5fe 100644 --- a/source/Irrlicht/CColorConverter.h +++ b/source/Irrlicht/CColorConverter.h @@ -48,8 +48,10 @@ public: static void convert32BitTo32Bit(const s32* in, s32* out, s32 width, s32 height, s32 linepad, bool flip=false); - //! functions for converting one image format to another efficiently + //! Functions for converting one image format to another efficiently //! and hopefully correctly. + //! Note that the format descriptions refer to the ECOLOR_FORMAT's and not to memory layout. + //! Reasons for that go back to DX9 naming which tended to flip 32-bit and 16-bit byte orders so ARGB usually means BGRA. //! //! \param sP pointer to source pixel data //! \param sN number of source pixels to copy diff --git a/source/Irrlicht/CD3D8Driver.cpp b/source/Irrlicht/CD3D8Driver.cpp deleted file mode 100644 index 3dd41e74..00000000 --- a/source/Irrlicht/CD3D8Driver.cpp +++ /dev/null @@ -1,2576 +0,0 @@ -// Copyright (C) 2002-2012 Nikolaus Gebhardt -// This file is part of the "Irrlicht Engine". -// For conditions of distribution and use, see copyright notice in irrlicht.h - -#include "IrrCompileConfig.h" - -#define _IRR_DONT_DO_MEMORY_DEBUGGING_HERE -#include "CD3D8Driver.h" - -#ifdef _IRR_COMPILE_WITH_DIRECT3D_8_ - -#include "os.h" -#include "S3DVertex.h" -#include "CD3D8Texture.h" -#include "CD3D8MaterialRenderer.h" -#include "CD3D8ShaderMaterialRenderer.h" -#include "CD3D8NormalMapRenderer.h" -#include "CD3D8ParallaxMapRenderer.h" -#include "SIrrCreationParameters.h" - -namespace irr -{ -namespace video -{ - - -//! constructor -CD3D8Driver::CD3D8Driver(const SIrrlichtCreationParameters& params, io::IFileSystem* io) - : CNullDriver(io, params.WindowSize), BridgeCalls(0), CurrentRenderMode(ERM_NONE), - ResetRenderStates(true), Transformation3DChanged(false), - D3DLibrary(0), pID3D(0), pID3DDevice(0), PrevRenderTarget(0), - WindowId(0), SceneSourceRect(0), - LastVertexType((video::E_VERTEX_TYPE)-1), - MaxTextureUnits(0), MaxUserClipPlanes(0), - MaxLightDistance(0), LastSetLight(-1), DeviceLost(false), - DriverWasReset(true), Params(params) -{ - #ifdef _DEBUG - setDebugName("CD3D8Driver"); - #endif - - printVersion(); - - for (u32 i=0; iRelease(); - - if (pID3D) - pID3D->Release(); -} - - -void CD3D8Driver::createMaterialRenderers() -{ - // create D3D8 material renderers - - addAndDropMaterialRenderer(new CD3D8MaterialRenderer_SOLID(pID3DDevice, this)); - addAndDropMaterialRenderer(new CD3D8MaterialRenderer_SOLID_2_LAYER(pID3DDevice, this)); - - // add the same renderer for all lightmap types - CD3D8MaterialRenderer_LIGHTMAP* lmr = new CD3D8MaterialRenderer_LIGHTMAP(pID3DDevice, this); - addMaterialRenderer(lmr); // for EMT_LIGHTMAP: - addMaterialRenderer(lmr); // for EMT_LIGHTMAP_ADD: - addMaterialRenderer(lmr); // for EMT_LIGHTMAP_M2: - addMaterialRenderer(lmr); // for EMT_LIGHTMAP_M4: - addMaterialRenderer(lmr); // for EMT_LIGHTMAP_LIGHTING: - addMaterialRenderer(lmr); // for EMT_LIGHTMAP_LIGHTING_M2: - addMaterialRenderer(lmr); // for EMT_LIGHTMAP_LIGHTING_M4: - lmr->drop(); - - // add remaining material renderers - addAndDropMaterialRenderer(new CD3D8MaterialRenderer_DETAIL_MAP(pID3DDevice, this)); - addAndDropMaterialRenderer(new CD3D8MaterialRenderer_SPHERE_MAP(pID3DDevice, this)); - addAndDropMaterialRenderer(new CD3D8MaterialRenderer_REFLECTION_2_LAYER(pID3DDevice, this)); - addAndDropMaterialRenderer(new CD3D8MaterialRenderer_TRANSPARENT_ADD_COLOR(pID3DDevice, this)); - addAndDropMaterialRenderer(new CD3D8MaterialRenderer_TRANSPARENT_ALPHA_CHANNEL(pID3DDevice, this)); - addAndDropMaterialRenderer(new CD3D8MaterialRenderer_TRANSPARENT_ALPHA_CHANNEL_REF(pID3DDevice, this)); - addAndDropMaterialRenderer(new CD3D8MaterialRenderer_TRANSPARENT_VERTEX_ALPHA(pID3DDevice, this)); - addAndDropMaterialRenderer(new CD3D8MaterialRenderer_TRANSPARENT_REFLECTION_2_LAYER(pID3DDevice, this)); - - // add normal map renderers - s32 tmp = 0; - video::IMaterialRenderer* renderer = 0; - - renderer = new CD3D8NormalMapRenderer(pID3DDevice, this, tmp, - MaterialRenderers[EMT_SOLID].Renderer); - renderer->drop(); - - renderer = new CD3D8NormalMapRenderer(pID3DDevice, this, tmp, - MaterialRenderers[EMT_TRANSPARENT_ADD_COLOR].Renderer); - renderer->drop(); - - renderer = new CD3D8NormalMapRenderer(pID3DDevice, this, tmp, - MaterialRenderers[EMT_TRANSPARENT_VERTEX_ALPHA].Renderer); - renderer->drop(); - - // add parallax map renderers - - renderer = new CD3D8ParallaxMapRenderer(pID3DDevice, this, tmp, - MaterialRenderers[EMT_SOLID].Renderer); - renderer->drop(); - - renderer = new CD3D8ParallaxMapRenderer(pID3DDevice, this, tmp, - MaterialRenderers[EMT_TRANSPARENT_ADD_COLOR].Renderer); - renderer->drop(); - - renderer = new CD3D8ParallaxMapRenderer(pID3DDevice, this, tmp, - MaterialRenderers[EMT_TRANSPARENT_VERTEX_ALPHA].Renderer); - renderer->drop(); - - // add basic 1 texture blending - addAndDropMaterialRenderer(new CD3D8MaterialRenderer_ONETEXTURE_BLEND(pID3DDevice, this)); -} - - -//! initialises the Direct3D API -bool CD3D8Driver::initDriver(HWND hwnd, bool pureSoftware) -{ - HRESULT hr; - typedef IDirect3D8 * (__stdcall *D3DCREATETYPE)(UINT); - -#if defined( _IRR_XBOX_PLATFORM_) - D3DCREATETYPE d3dCreate = (D3DCREATETYPE) &Direct3DCreate8; -#else - D3DLibrary = LoadLibrary( __TEXT("d3d8.dll") ); - - if (!D3DLibrary) - { - os::Printer::log("Error, could not load d3d8.dll.", ELL_ERROR); - return false; - } - - D3DCREATETYPE d3dCreate = (D3DCREATETYPE) GetProcAddress(D3DLibrary, "Direct3DCreate8"); - - if (!d3dCreate) - { - os::Printer::log("Error, could not get proc adress of Direct3DCreate8.", ELL_ERROR); - return false; - } -#endif - - //just like pID3D = Direct3DCreate8(D3D_SDK_VERSION); - pID3D = (*d3dCreate)(D3D_SDK_VERSION); - - if (!pID3D) - { - os::Printer::log("Error initializing D3D.", ELL_ERROR); - return false; - } - - // print device information - D3DADAPTER_IDENTIFIER8 dai; - if (!FAILED(pID3D->GetAdapterIdentifier(Params.DisplayAdapter, D3DENUM_NO_WHQL_LEVEL, &dai))) - { - char tmp[512]; - - s32 Product = HIWORD(dai.DriverVersion.HighPart); - s32 Version = LOWORD(dai.DriverVersion.HighPart); - s32 SubVersion = HIWORD(dai.DriverVersion.LowPart); - s32 Build = LOWORD(dai.DriverVersion.LowPart); - - sprintf(tmp, "%s %s %d.%d.%d.%d", dai.Description, dai.Driver, Product, Version, - SubVersion, Build); - os::Printer::log(tmp, ELL_INFORMATION); - } - - D3DDISPLAYMODE d3ddm; - hr = pID3D->GetAdapterDisplayMode(Params.DisplayAdapter, &d3ddm); - if (FAILED(hr)) - { - os::Printer::log("Error: Could not get Adapter Display mode.", ELL_ERROR); - return false; - } - - ZeroMemory(&present, sizeof(present)); - - present.SwapEffect = D3DSWAPEFFECT_DISCARD; - present.Windowed = TRUE; - present.BackBufferFormat = d3ddm.Format; - present.EnableAutoDepthStencil = TRUE; - - if (Params.Fullscreen) - { - present.SwapEffect = D3DSWAPEFFECT_FLIP; - present.Windowed = FALSE; - present.BackBufferWidth = Params.WindowSize.Width; - present.BackBufferHeight = Params.WindowSize.Height; - present.FullScreen_RefreshRateInHz = D3DPRESENT_RATE_DEFAULT; - - if (Params.Vsync) - present.FullScreen_PresentationInterval = D3DPRESENT_INTERVAL_ONE; - else - present.FullScreen_PresentationInterval = D3DPRESENT_INTERVAL_IMMEDIATE; - - if (Params.Bits == 32) - present.BackBufferFormat = D3DFMT_X8R8G8B8; - else - present.BackBufferFormat = D3DFMT_R5G6B5; - } - - D3DDEVTYPE devtype = D3DDEVTYPE_HAL; - #ifndef _IRR_D3D_NO_SHADER_DEBUGGING - devtype = D3DDEVTYPE_REF; - #endif - - // enable anti alias if possible and whished - if (Params.AntiAlias > 0) - { - if(Params.AntiAlias > 16) - Params.AntiAlias = 16; - - while(Params.AntiAlias > 0) - { - if(!FAILED(pID3D->CheckDeviceMultiSampleType(Params.DisplayAdapter, - devtype , present.BackBufferFormat, !Params.Fullscreen, - (D3DMULTISAMPLE_TYPE)Params.AntiAlias))) - { - present.MultiSampleType = (D3DMULTISAMPLE_TYPE)Params.AntiAlias; - present.SwapEffect = D3DSWAPEFFECT_DISCARD; - break; - } - --Params.AntiAlias; - } - - if(Params.AntiAlias==0) - os::Printer::log("Anti aliasing disabled because hardware/driver lacks necessary caps.", ELL_WARNING); - } - - // check stencil buffer compatibility - if (Params.Stencilbuffer) - { - present.AutoDepthStencilFormat = D3DFMT_D24S8; - if(FAILED(pID3D->CheckDeviceFormat(Params.DisplayAdapter, devtype, - present.BackBufferFormat, D3DUSAGE_DEPTHSTENCIL, - D3DRTYPE_SURFACE, present.AutoDepthStencilFormat))) - { -#if !defined( _IRR_XBOX_PLATFORM_) - present.AutoDepthStencilFormat = D3DFMT_D24X4S4; - if(FAILED(pID3D->CheckDeviceFormat(Params.DisplayAdapter, devtype, - present.BackBufferFormat, D3DUSAGE_DEPTHSTENCIL, - D3DRTYPE_SURFACE, present.AutoDepthStencilFormat))) - { - present.AutoDepthStencilFormat = D3DFMT_D15S1; - if(FAILED(pID3D->CheckDeviceFormat(Params.DisplayAdapter, devtype, - present.BackBufferFormat, D3DUSAGE_DEPTHSTENCIL, - D3DRTYPE_SURFACE, present.AutoDepthStencilFormat))) - { - os::Printer::log("Device does not support stencilbuffer, disabling stencil buffer.", ELL_WARNING); - Params.Stencilbuffer = false; - } - } -#endif - } - else - if(FAILED(pID3D->CheckDepthStencilMatch(Params.DisplayAdapter, devtype, - present.BackBufferFormat, present.BackBufferFormat, present.AutoDepthStencilFormat))) - { - os::Printer::log("Depth-stencil format is not compatible with display format, disabling stencil buffer.", ELL_WARNING); - Params.Stencilbuffer = false; - } - } - // do not use else here to cope with flag change in previous block - if (!Params.Stencilbuffer) - { -#if !defined( _IRR_XBOX_PLATFORM_) - present.AutoDepthStencilFormat = D3DFMT_D32; - if(FAILED(pID3D->CheckDeviceFormat(Params.DisplayAdapter, devtype, - present.BackBufferFormat, D3DUSAGE_DEPTHSTENCIL, - D3DRTYPE_SURFACE, present.AutoDepthStencilFormat))) - { - present.AutoDepthStencilFormat = D3DFMT_D24X8; - if(FAILED(pID3D->CheckDeviceFormat(Params.DisplayAdapter, devtype, - present.BackBufferFormat, D3DUSAGE_DEPTHSTENCIL, - D3DRTYPE_SURFACE, present.AutoDepthStencilFormat))) - { - present.AutoDepthStencilFormat = D3DFMT_D16; - if(FAILED(pID3D->CheckDeviceFormat(Params.DisplayAdapter, devtype, - present.BackBufferFormat, D3DUSAGE_DEPTHSTENCIL, - D3DRTYPE_SURFACE, present.AutoDepthStencilFormat))) - { - os::Printer::log("Device does not support required depth buffer.", ELL_WARNING); - return false; - } - } - } -#else - present.AutoDepthStencilFormat = D3DFMT_D16; - if(FAILED(pID3D->CheckDeviceFormat(Params.DisplayAdapter, devtype, - present.BackBufferFormat, D3DUSAGE_DEPTHSTENCIL, - D3DRTYPE_SURFACE, present.AutoDepthStencilFormat))) - { - os::Printer::log("Device does not support required depth buffer.", ELL_WARNING); - return false; - } -#endif - } - - // create device -#if defined( _IRR_XBOX_PLATFORM_) - DWORD fpuPrecision = 0; -#else - DWORD fpuPrecision = Params.HighPrecisionFPU ? D3DCREATE_FPU_PRESERVE : 0; - DWORD multithreaded = Params.DriverMultithreaded ? D3DCREATE_MULTITHREADED : 0; -#endif - if (pureSoftware) - { - hr = pID3D->CreateDevice(Params.DisplayAdapter, D3DDEVTYPE_REF, hwnd, - fpuPrecision | multithreaded | D3DCREATE_SOFTWARE_VERTEXPROCESSING, &present, &pID3DDevice); - - if (FAILED(hr)) - os::Printer::log("Was not able to create Direct3D8 software device.", ELL_ERROR); - } - else - { - hr = pID3D->CreateDevice(Params.DisplayAdapter, devtype, hwnd, - fpuPrecision | multithreaded | D3DCREATE_HARDWARE_VERTEXPROCESSING, &present, &pID3DDevice); - - if(FAILED(hr)) - hr = pID3D->CreateDevice(Params.DisplayAdapter, devtype, hwnd, - fpuPrecision | multithreaded | D3DCREATE_MIXED_VERTEXPROCESSING , &present, &pID3DDevice); - if(FAILED(hr)) - hr = pID3D->CreateDevice(Params.DisplayAdapter, devtype, hwnd, - fpuPrecision | multithreaded | D3DCREATE_SOFTWARE_VERTEXPROCESSING, &present, &pID3DDevice); - if (FAILED(hr)) - os::Printer::log("Was not able to create Direct3D8 device.", ELL_ERROR); - } - - if (!pID3DDevice) - { - os::Printer::log("Was not able to create Direct3D8 device.", ELL_ERROR); - return false; - } - - // get caps - pID3DDevice->GetDeviceCaps(&Caps); - - if (Params.Stencilbuffer && - (!(Caps.StencilCaps & D3DSTENCILCAPS_DECRSAT) || - !(Caps.StencilCaps & D3DSTENCILCAPS_INCRSAT) || - !(Caps.StencilCaps & D3DSTENCILCAPS_KEEP))) - { - os::Printer::log("Device not able to use stencil buffer, disabling stencil buffer.", ELL_WARNING); - Params.Stencilbuffer = false; - } - - if (!BridgeCalls) - BridgeCalls = new CD3D8CallBridge(pID3DDevice); - - // set default vertex shader - setVertexShader(EVT_STANDARD); - - // enable antialiasing - if (Params.AntiAlias>0) - pID3DDevice->SetRenderState(D3DRS_MULTISAMPLEANTIALIAS, TRUE); - - // set fog mode - setFog(FogColor, FogType, FogStart, FogEnd, FogDensity, PixelFog, RangeFog); - - // set exposed data - ExposedData.D3D8.D3D8 = pID3D; - ExposedData.D3D8.D3DDev8 = pID3DDevice; - ExposedData.D3D8.HWnd = hwnd; - - ResetRenderStates = true; - - // create materials - createMaterialRenderers(); - - MaxTextureUnits = core::min_((u32)Caps.MaxSimultaneousTextures, MATERIAL_MAX_TEXTURES); - MaxUserClipPlanes = (u32)Caps.MaxUserClipPlanes; - - DriverAttributes->setAttribute("MaxTextures", (s32)MaxTextureUnits); - DriverAttributes->setAttribute("MaxSupportedTextures", (s32)Caps.MaxSimultaneousTextures); - DriverAttributes->setAttribute("MaxLights", (s32)Caps.MaxActiveLights); - DriverAttributes->setAttribute("MaxAnisotropy", (s32)Caps.MaxAnisotropy); - DriverAttributes->setAttribute("MaxUserClipPlanes", (s32)Caps.MaxUserClipPlanes); - DriverAttributes->setAttribute("MaxIndices", (s32)Caps.MaxVertexIndex); - DriverAttributes->setAttribute("MaxTextureSize", (s32)core::min_(Caps.MaxTextureHeight,Caps.MaxTextureWidth)); - DriverAttributes->setAttribute("MaxTextureLODBias", 16.f); - DriverAttributes->setAttribute("Version", 800); - DriverAttributes->setAttribute("ShaderLanguageVersion", (s32)Caps.VertexShaderVersion*100); - DriverAttributes->setAttribute("AntiAlias", Params.AntiAlias); - - // set the renderstates - setRenderStates3DMode(); - - // so far so good. - return true; -} - - -//! applications must call this method before performing any rendering. returns false if failed. -bool CD3D8Driver::beginScene(bool backBuffer, bool zBuffer, SColor color, - const SExposedVideoData& videoData, core::rect* sourceRect) -{ - CNullDriver::beginScene(backBuffer, zBuffer, color, videoData, sourceRect); - WindowId = (HWND)videoData.D3D8.HWnd; - SceneSourceRect = sourceRect; - - if (!pID3DDevice) - return false; - - HRESULT hr; - if (DeviceLost) - { -#ifndef _IRR_XBOX_PLATFORM_ - if(FAILED(hr = pID3DDevice->TestCooperativeLevel())) - { - if (hr == D3DERR_DEVICELOST) - { - Sleep(100); - hr = pID3DDevice->TestCooperativeLevel(); - if (hr == D3DERR_DEVICELOST) - return false; - } - - if ((hr == D3DERR_DEVICENOTRESET) && !reset()) - return false; - } -#endif - } - - DWORD flags = 0; - - if (backBuffer) - flags |= D3DCLEAR_TARGET; - - if (zBuffer) - flags |= D3DCLEAR_ZBUFFER; - - if (Params.Stencilbuffer) - flags |= D3DCLEAR_STENCIL; - - if (flags) - { - hr = pID3DDevice->Clear( 0, NULL, flags, color.color, 1.0, 0); - if (FAILED(hr)) - os::Printer::log("Direct3D8 clear failed.", ELL_WARNING); - } - - hr = pID3DDevice->BeginScene(); - if (FAILED(hr)) - { - os::Printer::log("Direct3D8 begin scene failed.", ELL_WARNING); - return false; - } - - return true; -} - - -//! applications must call this method after performing any rendering. returns false if failed. -bool CD3D8Driver::endScene() -{ - CNullDriver::endScene(); - DriverWasReset=false; - - HRESULT hr = pID3DDevice->EndScene(); - if (FAILED(hr)) - { - os::Printer::log("DIRECT3D8 end scene failed.", ELL_WARNING); - return false; - } - - RECT* srcRct = 0; - RECT sourceRectData; - if ( SceneSourceRect) - { - srcRct = &sourceRectData; - sourceRectData.left = SceneSourceRect->UpperLeftCorner.X; - sourceRectData.top = SceneSourceRect->UpperLeftCorner.Y; - sourceRectData.right = SceneSourceRect->LowerRightCorner.X; - sourceRectData.bottom = SceneSourceRect->LowerRightCorner.Y; - } - - hr = pID3DDevice->Present(srcRct, NULL, WindowId, NULL); - - if (SUCCEEDED(hr)) - return true; - - if (hr == D3DERR_DEVICELOST) - { - DeviceLost = true; - os::Printer::log("DIRECT3D8 device lost.", ELL_WARNING); - } - else - os::Printer::log("DIRECT3D8 present failed.", ELL_WARNING); - return false; -} - - -//! resets the device -bool CD3D8Driver::reset() -{ - u32 i; - os::Printer::log("Resetting D3D8 device.", ELL_INFORMATION); - - for (i=0; iisRenderTarget()) - { - IDirect3DTexture8* tex = ((CD3D8Texture*)(Textures[i].Surface))->getDX8Texture(); - if (tex) - tex->Release(); - } - } - DriverWasReset=true; - - HRESULT hr = pID3DDevice->Reset(&present); - - for (i=0; iisRenderTarget()) - ((CD3D8Texture*)(Textures[i].Surface))->createRenderTarget(); - } - - if (FAILED(hr)) - { - if (hr == D3DERR_DEVICELOST) - { - DeviceLost = true; - os::Printer::log("Resetting failed due to device lost.", ELL_WARNING); - } - else - os::Printer::log("Resetting failed.", ELL_WARNING); - return false; - } - - DeviceLost = false; - ResetRenderStates = true; - LastVertexType = (E_VERTEX_TYPE)-1; - - for (i=0; i= D3DVS_VERSION(1,1); - case EVDF_VERTEX_SHADER_2_0: - return Caps.VertexShaderVersion >= D3DVS_VERSION(2,0); - case EVDF_VERTEX_SHADER_3_0: - return Caps.VertexShaderVersion >= D3DVS_VERSION(3,0); - case EVDF_PIXEL_SHADER_1_1: - return Caps.PixelShaderVersion >= D3DPS_VERSION(1,1); - case EVDF_PIXEL_SHADER_1_2: - return Caps.PixelShaderVersion >= D3DPS_VERSION(1,2); - case EVDF_PIXEL_SHADER_1_3: - return Caps.PixelShaderVersion >= D3DPS_VERSION(1,3); - case EVDF_PIXEL_SHADER_1_4: - return Caps.PixelShaderVersion >= D3DPS_VERSION(1,4); - case EVDF_PIXEL_SHADER_2_0: - return Caps.PixelShaderVersion >= D3DPS_VERSION(2,0); - case EVDF_PIXEL_SHADER_3_0: - return Caps.PixelShaderVersion >= D3DPS_VERSION(3,0); - case EVDF_TEXTURE_NSQUARE: - return (Caps.TextureCaps & D3DPTEXTURECAPS_SQUAREONLY) == 0; - case EVDF_TEXTURE_NPOT: - return (Caps.TextureCaps & D3DPTEXTURECAPS_POW2) == 0; - case EVDF_COLOR_MASK: - return (Caps.PrimitiveMiscCaps & D3DPMISCCAPS_COLORWRITEENABLE) != 0; - case EVDF_BLEND_OPERATIONS: - return true; - case EVDF_BLEND_SEPARATE: - return false; - case EVDF_TEXTURE_MATRIX: - return true; - default: - return false; - }; -} - - -//! sets transformation -void CD3D8Driver::setTransform(E_TRANSFORMATION_STATE state, - const core::matrix4& mat) -{ - switch(state) - { - case ETS_VIEW: - pID3DDevice->SetTransform(D3DTS_VIEW, (D3DMATRIX*)((void*)mat.pointer())); - Transformation3DChanged = true; - break; - case ETS_WORLD: - pID3DDevice->SetTransform(D3DTS_WORLD, (D3DMATRIX*)((void*)mat.pointer())); - Transformation3DChanged = true; - break; - case ETS_PROJECTION: - pID3DDevice->SetTransform( D3DTS_PROJECTION, (D3DMATRIX*)((void*)mat.pointer())); - Transformation3DChanged = true; - break; - case ETS_COUNT: - return; - default: - if (state-ETS_TEXTURE_0 < MATERIAL_MAX_TEXTURES) - { - pID3DDevice->SetTextureStageState( state - ETS_TEXTURE_0, D3DTSS_TEXTURETRANSFORMFLAGS, D3DTTFF_COUNT2 ); - pID3DDevice->SetTransform((D3DTRANSFORMSTATETYPE)(D3DTS_TEXTURE0+ ( state - ETS_TEXTURE_0 )), - (D3DMATRIX*)((void*)mat.pointer())); - } - break; - } - - Matrices[state] = mat; -} - - -//! sets the current Texture -bool CD3D8Driver::setActiveTexture(u32 stage, const video::ITexture* texture) -{ - if (CurrentTexture[stage] == texture) - return true; - - if (texture && (texture->getDriverType() != EDT_DIRECT3D8)) - { - os::Printer::log("Fatal Error: Tried to set a texture not owned by this driver.", ELL_ERROR); - return false; - } - - CurrentTexture[stage] = texture; - - if (!texture) - { - pID3DDevice->SetTexture(stage, 0); - pID3DDevice->SetTextureStageState( stage, D3DTSS_TEXTURETRANSFORMFLAGS, D3DTTFF_DISABLE ); - } - else - { - pID3DDevice->SetTexture(stage, ((const CD3D8Texture*)texture)->getDX8Texture()); - } - return true; -} - - -//! sets a material -void CD3D8Driver::setMaterial(const SMaterial& material) -{ - Material = material; - OverrideMaterial.apply(Material); - - for (u32 i=0; igetColorFormat(), surface->getDimension())) - texture = new CD3D8Texture(surface, this, TextureCreationFlags, name, mipmapData); - - return texture; -} - - -//! Enables or disables a texture creation flag. -void CD3D8Driver::setTextureCreationFlag(E_TEXTURE_CREATION_FLAG flag, - bool enabled) -{ - if (flag == video::ETCF_CREATE_MIP_MAPS && !queryFeature(EVDF_MIP_MAP)) - enabled = false; - - CNullDriver::setTextureCreationFlag(flag, enabled); -} - - -//! sets a render target -bool CD3D8Driver::setRenderTarget(video::ITexture* texture, - bool clearBackBuffer, bool clearZBuffer, SColor color) -{ - // check for right driver type - - if (texture && texture->getDriverType() != EDT_DIRECT3D8) - { - os::Printer::log("Fatal Error: Tried to set a texture not owned by this driver.", ELL_ERROR); - return false; - } - - // check for valid render target - - CD3D8Texture* tex = (CD3D8Texture*)texture; - - if (texture && !tex->isRenderTarget()) - { - os::Printer::log("Fatal Error: Tried to set a non render target texture as render target.", ELL_ERROR); - return false; - } - - if (texture && (tex->getSize().Width > ScreenSize.Width || - tex->getSize().Height > ScreenSize.Height )) - { - os::Printer::log("Error: Tried to set a render target texture which is bigger than the screen.", ELL_ERROR); - return false; - } - - // check if we should set the previous RT back - - bool ret = true; - - if (tex == 0) - { - if (PrevRenderTarget) - { - IDirect3DSurface8* dss = 0; - pID3DDevice->GetDepthStencilSurface(&dss); - - if (FAILED(pID3DDevice->SetRenderTarget(PrevRenderTarget, dss))) - { - os::Printer::log("Error: Could not set back to previous render target.", ELL_ERROR); - ret = false; - } - - if (dss) - dss->Release(); - - CurrentRendertargetSize = core::dimension2d(0,0); - PrevRenderTarget->Release(); - PrevRenderTarget = 0; - } - } - else - { - // we want to set a new target. so do this. - - // store previous target - - if (!PrevRenderTarget && (FAILED(pID3DDevice->GetRenderTarget(&PrevRenderTarget)))) - { - os::Printer::log("Could not get previous render target.", ELL_ERROR); - return false; - } - - // set new render target - - IDirect3DSurface8* dss = 0; - pID3DDevice->GetDepthStencilSurface(&dss); - - if (FAILED(pID3DDevice->SetRenderTarget(tex->getRenderTargetSurface(), dss))) - { - os::Printer::log("Error: Could not set render target.", ELL_ERROR); - ret = false; - } - - if (dss) - dss->Release(); - - CurrentRendertargetSize = tex->getSize(); - } - Transformation3DChanged = true; - - if (clearBackBuffer || clearZBuffer) - { - DWORD flags = 0; - - if (clearBackBuffer) - flags |= D3DCLEAR_TARGET; - - if (clearZBuffer) - flags |= D3DCLEAR_ZBUFFER; - - pID3DDevice->Clear(0, NULL, flags, color.color, 1.0f, 0); - } - - return ret; -} - - -//! Creates a render target texture. -ITexture* CD3D8Driver::addRenderTargetTexture( - const core::dimension2d& size, const io::path& name, - const ECOLOR_FORMAT format) -{ - CD3D8Texture* tex = new CD3D8Texture(this, size, name); - if (tex) - { - if (!tex->Texture) - { - tex->drop(); - return 0; - } - addTexture(tex); - tex->drop(); - } - return tex; -} - - -//! sets a viewport -void CD3D8Driver::setViewPort(const core::rect& area) -{ - core::rect vp(area); - core::rect rendert(0,0, ScreenSize.Width, ScreenSize.Height); - vp.clipAgainst(rendert); - - D3DVIEWPORT8 viewPort; - viewPort.X = vp.UpperLeftCorner.X; - viewPort.Y = vp.UpperLeftCorner.Y; - viewPort.Width = vp.getWidth(); - viewPort.Height = vp.getHeight(); - viewPort.MinZ = 0.0f; - viewPort.MaxZ = 1.0f; - - HRESULT hr = D3DERR_INVALIDCALL; - if (vp.getHeight()>0 && vp.getWidth()>0) - hr = pID3DDevice->SetViewport(&viewPort); - - if (FAILED(hr)) - os::Printer::log("Failed setting the viewport.", ELL_WARNING); - - ViewPort = vp; -} - - -//! gets the area of the current viewport -const core::rect& CD3D8Driver::getViewPort() const -{ - return ViewPort; -} - - -//! draws a vertex primitive list -void CD3D8Driver::drawVertexPrimitiveList(const void* vertices, - u32 vertexCount, const void* indexList, u32 primitiveCount, - E_VERTEX_TYPE vType, scene::E_PRIMITIVE_TYPE pType, - E_INDEX_TYPE iType) -{ - if (!checkPrimitiveCount(primitiveCount)) - return; - - CNullDriver::drawVertexPrimitiveList(vertices, vertexCount, indexList, primitiveCount, vType, pType,iType); - - if (!vertexCount || !primitiveCount) - return; - - draw2D3DVertexPrimitiveList(vertices, vertexCount, indexList, primitiveCount, - vType, pType, iType, true); -} - - -//! draws a vertex primitive list in 2d -void CD3D8Driver::draw2DVertexPrimitiveList(const void* vertices, - u32 vertexCount, const void* indexList, u32 primitiveCount, - E_VERTEX_TYPE vType, scene::E_PRIMITIVE_TYPE pType, - E_INDEX_TYPE iType) -{ - if (!checkPrimitiveCount(primitiveCount)) - return; - - CNullDriver::draw2DVertexPrimitiveList(vertices, vertexCount, indexList, primitiveCount, vType, pType,iType); - - if (!vertexCount || !primitiveCount) - return; - - draw2D3DVertexPrimitiveList(vertices, vertexCount, indexList, primitiveCount, - vType, pType, iType, false); -} - - -void CD3D8Driver::draw2D3DVertexPrimitiveList(const void* vertices, - u32 vertexCount, const void* indexList, u32 primitiveCount, - E_VERTEX_TYPE vType, scene::E_PRIMITIVE_TYPE pType, - E_INDEX_TYPE iType, bool is3D) -{ - setVertexShader(vType); - - const u32 stride = getVertexPitchFromType(vType); - - D3DFORMAT indexType=D3DFMT_UNKNOWN; - switch (iType) - { - case (EIT_16BIT): - { - indexType=D3DFMT_INDEX16; - break; - } - case (EIT_32BIT): - { - indexType=D3DFMT_INDEX32; - break; - } - } - - if (is3D) - { - if (!setRenderStates3DMode()) - return; - } - else - { - if (Material.MaterialType==EMT_ONETEXTURE_BLEND) - { - E_BLEND_FACTOR srcFact; - E_BLEND_FACTOR dstFact; - E_MODULATE_FUNC modulo; - u32 alphaSource; - unpack_textureBlendFunc ( srcFact, dstFact, modulo, alphaSource, Material.MaterialTypeParam); - setRenderStates2DMode(alphaSource&video::EAS_VERTEX_COLOR, (Material.getTexture(0) != 0), (alphaSource&video::EAS_TEXTURE) != 0); - } - else - setRenderStates2DMode(Material.MaterialType==EMT_TRANSPARENT_VERTEX_ALPHA, (Material.getTexture(0) != 0), Material.MaterialType==EMT_TRANSPARENT_ALPHA_CHANNEL); - } - - switch (pType) - { - case scene::EPT_POINT_SPRITES: - case scene::EPT_POINTS: - { - f32 tmp=Material.Thickness/getScreenSize().Height; - if (pType==scene::EPT_POINT_SPRITES) - pID3DDevice->SetRenderState(D3DRS_POINTSPRITEENABLE, TRUE); - pID3DDevice->SetRenderState(D3DRS_POINTSCALEENABLE, TRUE); - pID3DDevice->SetRenderState(D3DRS_POINTSIZE, *(DWORD*)(&tmp)); - tmp=1.0f; - pID3DDevice->SetRenderState(D3DRS_POINTSCALE_A, *(DWORD*)(&tmp)); - pID3DDevice->SetRenderState(D3DRS_POINTSCALE_B, *(DWORD*)(&tmp)); - pID3DDevice->SetRenderState(D3DRS_POINTSIZE_MIN, *(DWORD*)(&tmp)); - tmp=0.0f; - pID3DDevice->SetRenderState(D3DRS_POINTSCALE_C, *(DWORD*)(&tmp)); - pID3DDevice->DrawIndexedPrimitiveUP(D3DPT_POINTLIST, 0, vertexCount, - primitiveCount, indexList, indexType, vertices, stride); - pID3DDevice->SetRenderState(D3DRS_POINTSCALEENABLE, FALSE); - if (pType==scene::EPT_POINT_SPRITES) - pID3DDevice->SetRenderState(D3DRS_POINTSPRITEENABLE, FALSE); - } - break; - case scene::EPT_LINE_STRIP: - pID3DDevice->DrawIndexedPrimitiveUP(D3DPT_LINESTRIP, 0, vertexCount, - primitiveCount, indexList, indexType, vertices, stride); - break; - case scene::EPT_LINE_LOOP: - { - pID3DDevice->DrawIndexedPrimitiveUP(D3DPT_LINESTRIP, 0, vertexCount, - primitiveCount - 1, indexList, indexType, vertices, stride); - u16 tmpIndices[] = {primitiveCount - 1, 0}; - pID3DDevice->DrawIndexedPrimitiveUP(D3DPT_LINELIST, 0, vertexCount, - 1, tmpIndices, indexType, vertices, stride); - } - break; - case scene::EPT_LINES: - pID3DDevice->DrawIndexedPrimitiveUP(D3DPT_LINELIST, 0, vertexCount, - primitiveCount, indexList, indexType, vertices, stride); - break; - case scene::EPT_TRIANGLE_STRIP: - pID3DDevice->DrawIndexedPrimitiveUP(D3DPT_TRIANGLESTRIP, 0, vertexCount, - primitiveCount, indexList, indexType, vertices, stride); - break; - case scene::EPT_TRIANGLE_FAN: - pID3DDevice->DrawIndexedPrimitiveUP(D3DPT_TRIANGLEFAN, 0, vertexCount, - primitiveCount, indexList, indexType, vertices, stride); - break; - case scene::EPT_TRIANGLES: - pID3DDevice->DrawIndexedPrimitiveUP(D3DPT_TRIANGLELIST, 0, vertexCount, - primitiveCount, indexList, indexType, vertices, stride); - break; - } -} - - -//! draws an 2d image, using a color (if color is other then Color(255,255,255,255)) and the alpha channel of the texture if wanted. -void CD3D8Driver::draw2DImage(const video::ITexture* texture, - const core::position2d& pos, - const core::rect& sourceRect, - const core::rect* clipRect, SColor color, - bool useAlphaChannelOfTexture) -{ - if (!texture) - return; - - if (!sourceRect.isValid()) - return; - - if (!setActiveTexture(0, texture)) - return; - - core::position2d targetPos = pos; - core::position2d sourcePos = sourceRect.UpperLeftCorner; - // This needs to be signed as it may go negative. - core::dimension2d sourceSize(sourceRect.getSize()); - const core::dimension2d& renderTargetSize = getCurrentRenderTargetSize(); - - if (clipRect) - { - if (targetPos.X < clipRect->UpperLeftCorner.X) - { - sourceSize.Width += targetPos.X - clipRect->UpperLeftCorner.X; - if (sourceSize.Width <= 0) - return; - - sourcePos.X -= targetPos.X - clipRect->UpperLeftCorner.X; - targetPos.X = clipRect->UpperLeftCorner.X; - } - - if (targetPos.X + (s32)sourceSize.Width > clipRect->LowerRightCorner.X) - { - sourceSize.Width -= (targetPos.X + sourceSize.Width) - clipRect->LowerRightCorner.X; - if (sourceSize.Width <= 0) - return; - } - - if (targetPos.Y < clipRect->UpperLeftCorner.Y) - { - sourceSize.Height += targetPos.Y - clipRect->UpperLeftCorner.Y; - if (sourceSize.Height <= 0) - return; - - sourcePos.Y -= targetPos.Y - clipRect->UpperLeftCorner.Y; - targetPos.Y = clipRect->UpperLeftCorner.Y; - } - - if (targetPos.Y + (s32)sourceSize.Height > clipRect->LowerRightCorner.Y) - { - sourceSize.Height -= (targetPos.Y + sourceSize.Height) - clipRect->LowerRightCorner.Y; - if (sourceSize.Height <= 0) - return; - } - } - - // clip these coordinates - - if (targetPos.X<0) - { - sourceSize.Width += targetPos.X; - if (sourceSize.Width <= 0) - return; - - sourcePos.X -= targetPos.X; - targetPos.X = 0; - } - - if (targetPos.X + sourceSize.Width > (s32)renderTargetSize.Width) - { - sourceSize.Width -= (targetPos.X + sourceSize.Width) - renderTargetSize.Width; - if (sourceSize.Width <= 0) - return; - } - - if (targetPos.Y<0) - { - sourceSize.Height += targetPos.Y; - if (sourceSize.Height <= 0) - return; - - sourcePos.Y -= targetPos.Y; - targetPos.Y = 0; - } - - if (targetPos.Y + sourceSize.Height > (s32)renderTargetSize.Height) - { - sourceSize.Height -= (targetPos.Y + sourceSize.Height) - renderTargetSize.Height; - if (sourceSize.Height <= 0) - return; - } - - // ok, we've clipped everything. - // now draw it. - - core::rect tcoords; - tcoords.UpperLeftCorner.X = (f32)sourcePos.X / texture->getOriginalSize().Width ; - tcoords.UpperLeftCorner.Y = (f32)sourcePos.Y / texture->getOriginalSize().Height; - tcoords.LowerRightCorner.X = tcoords.UpperLeftCorner.X + (f32)sourceSize.Width / texture->getOriginalSize().Width; - tcoords.LowerRightCorner.Y = tcoords.UpperLeftCorner.Y + (f32)sourceSize.Height / texture->getOriginalSize().Height; - - const core::rect poss(targetPos, sourceSize); - - setRenderStates2DMode(color.getAlpha()<255, true, useAlphaChannelOfTexture); - - S3DVertex vtx[4]; - vtx[0] = S3DVertex((f32)poss.UpperLeftCorner.X, - (f32)poss.UpperLeftCorner.Y, 0.0f, - 0.0f, 0.0f, 0.0f, color, - tcoords.UpperLeftCorner.X, tcoords.UpperLeftCorner.Y); - vtx[1] = S3DVertex((f32)poss.LowerRightCorner.X, - (f32)poss.UpperLeftCorner.Y, 0.0f, - 0.0f, 0.0f, 0.0f, color, - tcoords.LowerRightCorner.X, tcoords.UpperLeftCorner.Y); - vtx[2] = S3DVertex((f32)poss.LowerRightCorner.X, - (f32)poss.LowerRightCorner.Y, 0.0f, - 0.0f, 0.0f, 0.0f, color, - tcoords.LowerRightCorner.X, tcoords.LowerRightCorner.Y); - vtx[3] = S3DVertex((f32)poss.UpperLeftCorner.X, - (f32)poss.LowerRightCorner.Y, 0.0f, - 0.0f, 0.0f, 0.0f, color, - tcoords.UpperLeftCorner.X, tcoords.LowerRightCorner.Y); - - const s16 indices[6] = {0,1,2,0,2,3}; - - setVertexShader(EVT_STANDARD); - - pID3DDevice->DrawIndexedPrimitiveUP(D3DPT_TRIANGLELIST, 0, 4, 2, &indices[0], - D3DFMT_INDEX16, &vtx[0], sizeof(S3DVertex)); -} - - -void CD3D8Driver::draw2DImage(const video::ITexture* texture, - const core::rect& destRect, - const core::rect& sourceRect, - const core::rect* clipRect, - const video::SColor* const colors, - bool useAlphaChannelOfTexture) -{ - if(!texture) - return; - - const core::dimension2d& ss = texture->getOriginalSize(); - core::rect tcoords; - tcoords.UpperLeftCorner.X = (f32)sourceRect.UpperLeftCorner.X / (f32)ss.Width; - tcoords.UpperLeftCorner.Y = (f32)sourceRect.UpperLeftCorner.Y / (f32)ss.Height; - tcoords.LowerRightCorner.X = (f32)sourceRect.LowerRightCorner.X / (f32)ss.Width; - tcoords.LowerRightCorner.Y = (f32)sourceRect.LowerRightCorner.Y / (f32)ss.Height; - - core::rect clippedRect(destRect); - if (clipRect) - { - clippedRect.clipAgainst(*clipRect); - - //tcoords must be clipped by the same factors - const f32 tcWidth = tcoords.getWidth(); - const f32 tcHeight = tcoords.getHeight(); - - const f32 invDestRectWidth = 1.f / (f32)(destRect.getWidth()); - f32 scale = (f32)(clippedRect.UpperLeftCorner.X - destRect.UpperLeftCorner.X) * invDestRectWidth; - tcoords.UpperLeftCorner.X += scale * tcWidth; - scale = (f32)(destRect.LowerRightCorner.X - clippedRect.LowerRightCorner.X) * invDestRectWidth; - tcoords.LowerRightCorner.X -= scale * tcWidth; - - const f32 invDestRectHeight = 1.f / (f32)(destRect.getHeight()); - scale = (f32)(clippedRect.UpperLeftCorner.Y - destRect.UpperLeftCorner.Y) * invDestRectHeight; - tcoords.UpperLeftCorner.Y += scale * tcHeight; - scale = (f32)(destRect.LowerRightCorner.Y - clippedRect.LowerRightCorner.Y) * invDestRectHeight; - tcoords.LowerRightCorner.Y -= scale * tcHeight; - } - - const video::SColor temp[4] = - { - 0xFFFFFFFF, - 0xFFFFFFFF, - 0xFFFFFFFF, - 0xFFFFFFFF - }; - - const video::SColor* const useColor = colors ? colors : temp; - - S3DVertex vtx[4]; // clock wise - vtx[0] = S3DVertex((f32)clippedRect.UpperLeftCorner.X, (f32)clippedRect.UpperLeftCorner.Y, 0.0f, - 0.0f, 0.0f, 0.0f, useColor[0], - tcoords.UpperLeftCorner.X, tcoords.UpperLeftCorner.Y); - vtx[1] = S3DVertex((f32)clippedRect.LowerRightCorner.X, (f32)clippedRect.UpperLeftCorner.Y, 0.0f, - 0.0f, 0.0f, 0.0f, useColor[3], - tcoords.LowerRightCorner.X, tcoords.UpperLeftCorner.Y); - vtx[2] = S3DVertex((f32)clippedRect.LowerRightCorner.X, (f32)clippedRect.LowerRightCorner.Y, 0.0f, - 0.0f, 0.0f, 0.0f, useColor[2], - tcoords.LowerRightCorner.X, tcoords.LowerRightCorner.Y); - vtx[3] = S3DVertex((f32)clippedRect.UpperLeftCorner.X, (f32)clippedRect.LowerRightCorner.Y, 0.0f, - 0.0f, 0.0f, 0.0f, useColor[1], - tcoords.UpperLeftCorner.X, tcoords.LowerRightCorner.Y); - - const s16 indices[6] = {0,1,2,0,2,3}; - - setRenderStates2DMode(useColor[0].getAlpha()<255 || useColor[1].getAlpha()<255 || - useColor[2].getAlpha()<255 || useColor[3].getAlpha()<255, - true, useAlphaChannelOfTexture); - - setActiveTexture(0, texture); - - setVertexShader(EVT_STANDARD); - - pID3DDevice->DrawIndexedPrimitiveUP(D3DPT_TRIANGLELIST, 0, 4, 2, &indices[0], - D3DFMT_INDEX16, &vtx[0], sizeof(S3DVertex)); -} - - -//!Draws an 2d rectangle with a gradient. -void CD3D8Driver::draw2DRectangle(const core::rect& position, - SColor colorLeftUp, SColor colorRightUp, SColor colorLeftDown, - SColor colorRightDown, const core::rect* clip) -{ - core::rect pos(position); - - if (clip) - pos.clipAgainst(*clip); - - if (!pos.isValid()) - return; - - S3DVertex vtx[4]; - vtx[0] = S3DVertex((f32)pos.UpperLeftCorner.X, (f32)pos.UpperLeftCorner.Y, 0.0f, - 0.0f, 0.0f, 0.0f, colorLeftUp, 0.0f, 0.0f); - vtx[1] = S3DVertex((f32)pos.LowerRightCorner.X, (f32)pos.UpperLeftCorner.Y, 0.0f, - 0.0f, 0.0f, 0.0f, colorRightUp, 0.0f, 1.0f); - vtx[2] = S3DVertex((f32)pos.LowerRightCorner.X, (f32)pos.LowerRightCorner.Y, 0.0f, - 0.0f, 0.0f, 0.0f, colorRightDown, 1.0f, 0.0f); - vtx[3] = S3DVertex((f32)pos.UpperLeftCorner.X, (f32)pos.LowerRightCorner.Y, 0.0f, - 0.0f, 0.0f, 0.0f, colorLeftDown, 1.0f, 1.0f); - - const s16 indices[6] = {0,1,2,0,2,3}; - - setRenderStates2DMode( - colorLeftUp.getAlpha() < 255 || - colorRightUp.getAlpha() < 255 || - colorLeftDown.getAlpha() < 255 || - colorRightDown.getAlpha() < 255, false, false); - - setActiveTexture(0,0); - - setVertexShader(EVT_STANDARD); - - pID3DDevice->DrawIndexedPrimitiveUP(D3DPT_TRIANGLELIST, 0, 4, 2, &indices[0], - D3DFMT_INDEX16, &vtx[0], sizeof(S3DVertex)); -} - - -//! Draws a 2d line. -void CD3D8Driver::draw2DLine(const core::position2d& start, - const core::position2d& end, - SColor color) -{ - if (start==end) - drawPixel(start.X, start.Y, color); - else - { - // thanks to Vash TheStampede who sent in his implementation - S3DVertex vtx[2]; - vtx[0] = S3DVertex((f32)start.X+0.375f, (f32)start.Y+0.375f, 0.0f, - 0.0f, 0.0f, 0.0f, // normal - color, 0.0f, 0.0f); // texture - - vtx[1] = S3DVertex((f32)end.X+0.375f, (f32)end.Y+0.375f, 0.0f, - 0.0f, 0.0f, 0.0f, - color, 0.0f, 0.0f); - - setRenderStates2DMode(color.getAlpha() < 255, false, false); - setActiveTexture(0,0); - - setVertexShader(EVT_STANDARD); - - pID3DDevice->DrawPrimitiveUP(D3DPT_LINELIST, 1, &vtx[0], sizeof(S3DVertex)); - } -} - - -//! Draws a pixel -void CD3D8Driver::drawPixel(u32 x, u32 y, const SColor & color) -{ - const core::dimension2d& renderTargetSize = getCurrentRenderTargetSize(); - if (x > (u32)renderTargetSize.Width || y > (u32)renderTargetSize.Height) - return; - - setRenderStates2DMode(color.getAlpha() < 255, false, false); - setActiveTexture(0,0); - - setVertexShader(EVT_STANDARD); - - S3DVertex vertex((f32)x+0.375f, (f32)y+0.375f, 0.f, 0.f, 0.f, 0.f, color, 0.f, 0.f); - - pID3DDevice->DrawPrimitiveUP(D3DPT_POINTLIST, 1, &vertex, sizeof(vertex)); -} - - -//! sets right vertex shader -void CD3D8Driver::setVertexShader(E_VERTEX_TYPE newType) -{ - // Because we don't know if a vertex shader was set in a material instead of a - // fvf, this call cannot be prevented in D3D8. - //if (newType != LastVertexType) - { - LastVertexType = newType; - HRESULT hr = 0; - - switch(newType) - { - case EVT_STANDARD: - hr = pID3DDevice->SetVertexShader(D3DFVF_XYZ | D3DFVF_NORMAL | D3DFVF_DIFFUSE | D3DFVF_TEX1); - break; - case EVT_2TCOORDS: - hr = pID3DDevice->SetVertexShader(D3DFVF_XYZ | D3DFVF_NORMAL | D3DFVF_DIFFUSE | D3DFVF_TEX2); - break; - case EVT_TANGENTS: - hr = pID3DDevice->SetVertexShader(D3DFVF_XYZ | D3DFVF_NORMAL | D3DFVF_DIFFUSE | D3DFVF_TEX3 | - D3DFVF_TEXCOORDSIZE2(0) | // real texture coord - D3DFVF_TEXCOORDSIZE3(1) | // misuse texture coord 2 for tangent - D3DFVF_TEXCOORDSIZE3(2) // misuse texture coord 3 for binormal - ); - break; - } - - if (FAILED(hr)) - { - os::Printer::log("Could not set vertex Shader.", ELL_ERROR); - return; - } - } -} - - -//! sets the needed renderstates -bool CD3D8Driver::setRenderStates3DMode() -{ - if (!pID3DDevice) - return false; - - if (CurrentRenderMode != ERM_3D) - { - // switch back the matrices - pID3DDevice->SetTransform(D3DTS_VIEW, (D3DMATRIX*)((void*)&Matrices[ETS_VIEW])); - pID3DDevice->SetTransform(D3DTS_WORLD, (D3DMATRIX*)((void*)&Matrices[ETS_WORLD])); - pID3DDevice->SetTransform(D3DTS_PROJECTION, (D3DMATRIX*)((void*)&Matrices[ETS_PROJECTION])); - - pID3DDevice->SetRenderState(D3DRS_STENCILENABLE, FALSE); - - ResetRenderStates = true; - } - - if (ResetRenderStates || LastMaterial != Material) - { - // unset old material - - if (CurrentRenderMode == ERM_3D && - LastMaterial.MaterialType != Material.MaterialType && - LastMaterial.MaterialType >= 0 && LastMaterial.MaterialType < (s32)MaterialRenderers.size()) - MaterialRenderers[LastMaterial.MaterialType].Renderer->OnUnsetMaterial(); - - // set new material. - - if (Material.MaterialType >= 0 && Material.MaterialType < (s32)MaterialRenderers.size()) - MaterialRenderers[Material.MaterialType].Renderer->OnSetMaterial( - Material, LastMaterial, ResetRenderStates, this); - } - - bool shaderOK = true; - - if (Material.MaterialType >= 0 && Material.MaterialType < (s32)MaterialRenderers.size()) - shaderOK = MaterialRenderers[Material.MaterialType].Renderer->OnRender(this, LastVertexType); - - LastMaterial = Material; - - ResetRenderStates = false; - - CurrentRenderMode = ERM_3D; - - return shaderOK; -} - - -//! Map Irrlicht texture wrap mode to native values -D3DTEXTUREADDRESS CD3D8Driver::getTextureWrapMode(const u8 clamp) -{ - switch (clamp) - { - case ETC_REPEAT: - if (Caps.TextureAddressCaps & D3DPTADDRESSCAPS_WRAP) - return D3DTADDRESS_WRAP; - case ETC_CLAMP: - case ETC_CLAMP_TO_EDGE: - if (Caps.TextureAddressCaps & D3DPTADDRESSCAPS_CLAMP) - return D3DTADDRESS_CLAMP; - case ETC_MIRROR: - if (Caps.TextureAddressCaps & D3DPTADDRESSCAPS_MIRROR) - return D3DTADDRESS_MIRROR; - case ETC_CLAMP_TO_BORDER: - if (Caps.TextureAddressCaps & D3DPTADDRESSCAPS_BORDER) - return D3DTADDRESS_BORDER; - else - return D3DTADDRESS_CLAMP; - case ETC_MIRROR_CLAMP: - case ETC_MIRROR_CLAMP_TO_EDGE: - case ETC_MIRROR_CLAMP_TO_BORDER: - if (Caps.TextureAddressCaps & D3DPTADDRESSCAPS_MIRRORONCE) - return D3DTADDRESS_MIRRORONCE; - else - return D3DTADDRESS_CLAMP; - default: - return D3DTADDRESS_WRAP; - } -} - - -//! Can be called by an IMaterialRenderer to make its work easier. -void CD3D8Driver::setBasicRenderStates(const SMaterial& material, const SMaterial& lastmaterial, - bool resetAllRenderstates) -{ - if (resetAllRenderstates || - lastmaterial.AmbientColor != material.AmbientColor || - lastmaterial.DiffuseColor != material.DiffuseColor || - lastmaterial.SpecularColor != material.SpecularColor || - lastmaterial.EmissiveColor != material.EmissiveColor || - lastmaterial.Shininess != material.Shininess) - { - D3DMATERIAL8 mat; - mat.Diffuse = colorToD3D(material.DiffuseColor); - mat.Ambient = colorToD3D(material.AmbientColor); - mat.Specular = colorToD3D(material.SpecularColor); - mat.Emissive = colorToD3D(material.EmissiveColor); - mat.Power = material.Shininess; - pID3DDevice->SetMaterial(&mat); - } - - if (lastmaterial.ColorMaterial != material.ColorMaterial) - { - pID3DDevice->SetRenderState(D3DRS_COLORVERTEX, (material.ColorMaterial != ECM_NONE)); - pID3DDevice->SetRenderState(D3DRS_DIFFUSEMATERIALSOURCE, - ((material.ColorMaterial == ECM_DIFFUSE)|| - (material.ColorMaterial == ECM_DIFFUSE_AND_AMBIENT))?D3DMCS_COLOR1:D3DMCS_MATERIAL); - pID3DDevice->SetRenderState(D3DRS_AMBIENTMATERIALSOURCE, - ((material.ColorMaterial == ECM_AMBIENT)|| - (material.ColorMaterial == ECM_DIFFUSE_AND_AMBIENT))?D3DMCS_COLOR1:D3DMCS_MATERIAL); - pID3DDevice->SetRenderState(D3DRS_EMISSIVEMATERIALSOURCE, - (material.ColorMaterial == ECM_EMISSIVE)?D3DMCS_COLOR1:D3DMCS_MATERIAL); - pID3DDevice->SetRenderState(D3DRS_SPECULARMATERIALSOURCE, - (material.ColorMaterial == ECM_SPECULAR)?D3DMCS_COLOR1:D3DMCS_MATERIAL); - } - - // fillmode - if (resetAllRenderstates || lastmaterial.Wireframe != material.Wireframe || lastmaterial.PointCloud != material.PointCloud) - { - if (material.Wireframe) - pID3DDevice->SetRenderState(D3DRS_FILLMODE, D3DFILL_WIREFRAME); - else - if (material.PointCloud) - pID3DDevice->SetRenderState(D3DRS_FILLMODE, D3DFILL_POINT); - else - pID3DDevice->SetRenderState(D3DRS_FILLMODE, D3DFILL_SOLID); - } - - // shademode - if (resetAllRenderstates || lastmaterial.GouraudShading != material.GouraudShading) - { - if (material.GouraudShading) - pID3DDevice->SetRenderState(D3DRS_SHADEMODE, D3DSHADE_GOURAUD); - else - pID3DDevice->SetRenderState(D3DRS_SHADEMODE, D3DSHADE_FLAT); - } - - // lighting - if (resetAllRenderstates || lastmaterial.Lighting != material.Lighting) - { - if (material.Lighting) - pID3DDevice->SetRenderState(D3DRS_LIGHTING, TRUE); - else - pID3DDevice->SetRenderState(D3DRS_LIGHTING, FALSE); - } - - // zbuffer - if (resetAllRenderstates || lastmaterial.ZBuffer != material.ZBuffer) - { - switch (material.ZBuffer) - { - case ECFN_DISABLED: - pID3DDevice->SetRenderState(D3DRS_ZENABLE, FALSE); - break; - case ECFN_LESSEQUAL: - pID3DDevice->SetRenderState(D3DRS_ZENABLE, TRUE); - pID3DDevice->SetRenderState(D3DRS_ZFUNC, D3DCMP_LESSEQUAL); - break; - case ECFN_EQUAL: - pID3DDevice->SetRenderState(D3DRS_ZENABLE, TRUE); - pID3DDevice->SetRenderState(D3DRS_ZFUNC, D3DCMP_EQUAL); - break; - case ECFN_LESS: - pID3DDevice->SetRenderState(D3DRS_ZENABLE, TRUE); - pID3DDevice->SetRenderState(D3DRS_ZFUNC, D3DCMP_LESS); - break; - case ECFN_NOTEQUAL: - pID3DDevice->SetRenderState(D3DRS_ZENABLE, TRUE); - pID3DDevice->SetRenderState(D3DRS_ZFUNC, D3DCMP_NOTEQUAL); - break; - case ECFN_GREATEREQUAL: - pID3DDevice->SetRenderState(D3DRS_ZENABLE, TRUE); - pID3DDevice->SetRenderState(D3DRS_ZFUNC, D3DCMP_GREATEREQUAL); - break; - case ECFN_GREATER: - pID3DDevice->SetRenderState(D3DRS_ZENABLE, TRUE); - pID3DDevice->SetRenderState(D3DRS_ZFUNC, D3DCMP_GREATER); - break; - case ECFN_ALWAYS: - pID3DDevice->SetRenderState(D3DRS_ZENABLE, TRUE); - pID3DDevice->SetRenderState(D3DRS_ZFUNC, D3DCMP_ALWAYS); - break; - case ECFN_NEVER: - pID3DDevice->SetRenderState(D3DRS_ZENABLE, TRUE); - pID3DDevice->SetRenderState(D3DRS_ZFUNC, D3DCMP_NEVER); - break; - } - } - - // zwrite -// if (resetAllRenderstates || lastmaterial.ZWriteEnable != material.ZWriteEnable) - { - if (material.ZWriteEnable && (AllowZWriteOnTransparent || (!material.isTransparent() && - !MaterialRenderers[material.MaterialType].Renderer->isTransparent()))) - { - pID3DDevice->SetRenderState( D3DRS_ZWRITEENABLE, TRUE); - } - else - pID3DDevice->SetRenderState( D3DRS_ZWRITEENABLE, FALSE); - } - - // back face culling - if (resetAllRenderstates || (lastmaterial.FrontfaceCulling != material.FrontfaceCulling) || (lastmaterial.BackfaceCulling != material.BackfaceCulling)) - { -// if (material.FrontfaceCulling && material.BackfaceCulling) -// pID3DDevice->SetRenderState(D3DRS_CULLMODE, D3DCULL_CW|D3DCULL_CCW); -// else - if (material.FrontfaceCulling) - pID3DDevice->SetRenderState(D3DRS_CULLMODE, D3DCULL_CW); - else - if (material.BackfaceCulling) - pID3DDevice->SetRenderState(D3DRS_CULLMODE, D3DCULL_CCW); - else - pID3DDevice->SetRenderState(D3DRS_CULLMODE, D3DCULL_NONE); - } - - // fog - if (resetAllRenderstates || lastmaterial.FogEnable != material.FogEnable) - { - pID3DDevice->SetRenderState(D3DRS_FOGENABLE, material.FogEnable); - } - - // specular highlights - if (resetAllRenderstates || !core::equals(lastmaterial.Shininess, material.Shininess)) - { - bool enable = (material.Shininess!=0); - pID3DDevice->SetRenderState(D3DRS_SPECULARENABLE, enable); - pID3DDevice->SetRenderState(D3DRS_NORMALIZENORMALS, enable); - pID3DDevice->SetRenderState(D3DRS_SPECULARMATERIALSOURCE, D3DMCS_MATERIAL); - } - - // normalization - if (resetAllRenderstates || lastmaterial.NormalizeNormals != material.NormalizeNormals) - { - pID3DDevice->SetRenderState(D3DRS_NORMALIZENORMALS, material.NormalizeNormals); - } - - // Color Mask - if (queryFeature(EVDF_COLOR_MASK) && - (resetAllRenderstates || lastmaterial.ColorMask != material.ColorMask)) - { - const DWORD flag = - ((material.ColorMask & ECP_RED)?D3DCOLORWRITEENABLE_RED:0) | - ((material.ColorMask & ECP_GREEN)?D3DCOLORWRITEENABLE_GREEN:0) | - ((material.ColorMask & ECP_BLUE)?D3DCOLORWRITEENABLE_BLUE:0) | - ((material.ColorMask & ECP_ALPHA)?D3DCOLORWRITEENABLE_ALPHA:0); - pID3DDevice->SetRenderState(D3DRS_COLORWRITEENABLE, flag); - } - - // Blend Operation - if (material.BlendOperation == EBO_NONE) - BridgeCalls->setBlend(false); - else - { - BridgeCalls->setBlend(true); - - if (queryFeature(EVDF_BLEND_OPERATIONS)) - { - switch (material.BlendOperation) - { - case EBO_MAX: - case EBO_MAX_FACTOR: - case EBO_MAX_ALPHA: - BridgeCalls->setBlendOperation(D3DBLENDOP_MAX); - break; - case EBO_MIN: - case EBO_MIN_FACTOR: - case EBO_MIN_ALPHA: - BridgeCalls->setBlendOperation(D3DBLENDOP_MIN); - break; - case EBO_SUBTRACT: - BridgeCalls->setBlendOperation(D3DBLENDOP_SUBTRACT); - break; - case EBO_REVSUBTRACT: - BridgeCalls->setBlendOperation(D3DBLENDOP_REVSUBTRACT); - break; - default: - BridgeCalls->setBlendOperation(D3DBLENDOP_ADD); - break; - } - } - } - - // Blend Factor - if (IR(material.BlendFactor) & 0xFFFFFFFF) - { - E_BLEND_FACTOR srcFact = EBF_ZERO; - E_BLEND_FACTOR dstFact = EBF_ZERO; - E_MODULATE_FUNC modulo = EMFN_MODULATE_1X; - u32 alphaSource = 0; - - unpack_textureBlendFunc(srcFact, dstFact, modulo, alphaSource, material.BlendFactor); - - BridgeCalls->setBlendFunc(getD3DBlend(srcFact), getD3DBlend(dstFact)); - } - - // Polygon offset - if (queryFeature(EVDF_POLYGON_OFFSET) && (resetAllRenderstates || - lastmaterial.PolygonOffsetDirection != material.PolygonOffsetDirection || - lastmaterial.PolygonOffsetFactor != material.PolygonOffsetFactor)) - { - pID3DDevice->SetRenderState(D3DRS_ZBIAS, material.PolygonOffsetFactor); - } - - // thickness - if (resetAllRenderstates || lastmaterial.Thickness != material.Thickness) - { - pID3DDevice->SetRenderState(D3DRS_POINTSIZE, *((DWORD*)&material.Thickness)); - } - - // texture address mode - for (u32 st=0; stSetTextureStageState(st, D3DTSS_MIPMAPLODBIAS, *(DWORD*)(&tmp)); - } - - if (resetAllRenderstates || lastmaterial.TextureLayer[st].TextureWrapU != material.TextureLayer[st].TextureWrapU) - pID3DDevice->SetTextureStageState(st, D3DTSS_ADDRESSU, getTextureWrapMode(material.TextureLayer[st].TextureWrapU)); - // If separate UV not supported reuse U for V - if (!(Caps.TextureAddressCaps & D3DPTADDRESSCAPS_INDEPENDENTUV)) - pID3DDevice->SetTextureStageState(st, D3DTSS_ADDRESSV, getTextureWrapMode(material.TextureLayer[st].TextureWrapU)); - else if (resetAllRenderstates || lastmaterial.TextureLayer[st].TextureWrapV != material.TextureLayer[st].TextureWrapV) - pID3DDevice->SetTextureStageState(st, D3DTSS_ADDRESSV, getTextureWrapMode(material.TextureLayer[st].TextureWrapV)); - - // Bilinear and/or trilinear - if (resetAllRenderstates || - lastmaterial.TextureLayer[st].BilinearFilter != material.TextureLayer[st].BilinearFilter || - lastmaterial.TextureLayer[st].TrilinearFilter != material.TextureLayer[st].TrilinearFilter || - lastmaterial.TextureLayer[st].AnisotropicFilter != material.TextureLayer[st].AnisotropicFilter || - lastmaterial.UseMipMaps != material.UseMipMaps) - { - if (material.TextureLayer[st].BilinearFilter || material.TextureLayer[st].TrilinearFilter || material.TextureLayer[st].AnisotropicFilter>1) - { - const D3DTEXTUREFILTERTYPE tftMag = ((Caps.TextureFilterCaps & D3DPTFILTERCAPS_MAGFANISOTROPIC) && - material.TextureLayer[st].AnisotropicFilter) ? D3DTEXF_ANISOTROPIC : D3DTEXF_LINEAR; - const D3DTEXTUREFILTERTYPE tftMin = ((Caps.TextureFilterCaps & D3DPTFILTERCAPS_MINFANISOTROPIC) && - material.TextureLayer[st].AnisotropicFilter) ? D3DTEXF_ANISOTROPIC : D3DTEXF_LINEAR; - const D3DTEXTUREFILTERTYPE tftMip = material.UseMipMaps? (material.TextureLayer[st].TrilinearFilter ? D3DTEXF_LINEAR : D3DTEXF_POINT) : D3DTEXF_NONE; - - if (tftMag==D3DTEXF_ANISOTROPIC || tftMin == D3DTEXF_ANISOTROPIC) - pID3DDevice->SetTextureStageState(st, D3DTSS_MAXANISOTROPY, core::min_((DWORD)material.TextureLayer[st].AnisotropicFilter, Caps.MaxAnisotropy)); - pID3DDevice->SetTextureStageState(st, D3DTSS_MAGFILTER, tftMag); - pID3DDevice->SetTextureStageState(st, D3DTSS_MINFILTER, tftMin); - pID3DDevice->SetTextureStageState(st, D3DTSS_MIPFILTER, tftMip); - } - else - { - pID3DDevice->SetTextureStageState(st, D3DTSS_MINFILTER, D3DTEXF_POINT); - pID3DDevice->SetTextureStageState(st, D3DTSS_MIPFILTER, D3DTEXF_NONE); - pID3DDevice->SetTextureStageState(st, D3DTSS_MAGFILTER, D3DTEXF_POINT); - } - } - } -} - - -//! sets the needed renderstates -void CD3D8Driver::setRenderStatesStencilShadowMode(bool zfail, u32 debugDataVisible) -{ - if ((CurrentRenderMode != ERM_SHADOW_VOLUME_ZFAIL && - CurrentRenderMode != ERM_SHADOW_VOLUME_ZPASS) || - Transformation3DChanged) - { - // unset last 3d material - if (CurrentRenderMode == ERM_3D && - static_cast(Material.MaterialType) < MaterialRenderers.size()) - { - MaterialRenderers[Material.MaterialType].Renderer->OnUnsetMaterial(); - ResetRenderStates = true; - } - // switch back the matrices - pID3DDevice->SetTransform(D3DTS_VIEW, (D3DMATRIX*)((void*)&Matrices[ETS_VIEW])); - pID3DDevice->SetTransform(D3DTS_WORLD, (D3DMATRIX*)((void*)&Matrices[ETS_WORLD])); - pID3DDevice->SetTransform(D3DTS_PROJECTION, (D3DMATRIX*)((void*)&Matrices[ETS_PROJECTION])); - - Transformation3DChanged = false; - - setActiveTexture(0,0); - setActiveTexture(1,0); - setActiveTexture(2,0); - setActiveTexture(3,0); - - pID3DDevice->SetTextureStageState(0, D3DTSS_COLOROP, D3DTOP_DISABLE); - - pID3DDevice->SetVertexShader(D3DFVF_XYZ); - LastVertexType = (video::E_VERTEX_TYPE)(-1); - - pID3DDevice->SetRenderState(D3DRS_ZWRITEENABLE, FALSE); - pID3DDevice->SetRenderState(D3DRS_STENCILENABLE, TRUE); - pID3DDevice->SetRenderState(D3DRS_SHADEMODE, D3DSHADE_FLAT); - //pID3DDevice->SetRenderState(D3DRS_FOGENABLE, FALSE); - //pID3DDevice->SetRenderState(D3DRS_ALPHATESTENABLE, FALSE); - - pID3DDevice->SetRenderState(D3DRS_STENCILFUNC, D3DCMP_ALWAYS); - pID3DDevice->SetRenderState(D3DRS_STENCILREF, 0x0); - pID3DDevice->SetRenderState(D3DRS_STENCILMASK, 0xffffffff); - pID3DDevice->SetRenderState(D3DRS_STENCILWRITEMASK, 0xffffffff); - if (!(debugDataVisible & (scene::EDS_SKELETON|scene::EDS_MESH_WIRE_OVERLAY))) - pID3DDevice->SetRenderState(D3DRS_COLORWRITEENABLE, 0); - if ((debugDataVisible & scene::EDS_MESH_WIRE_OVERLAY)) - pID3DDevice->SetRenderState(D3DRS_FILLMODE, D3DFILL_WIREFRAME); - } - - if (CurrentRenderMode != ERM_SHADOW_VOLUME_ZPASS && !zfail) - { - // USE THE ZPASS METHOD - pID3DDevice->SetRenderState(D3DRS_STENCILFAIL, D3DSTENCILOP_KEEP); - pID3DDevice->SetRenderState(D3DRS_STENCILZFAIL, D3DSTENCILOP_KEEP); - pID3DDevice->SetRenderState(D3DRS_STENCILPASS, D3DSTENCILOP_INCR); - } - else - if (CurrentRenderMode != ERM_SHADOW_VOLUME_ZFAIL && zfail) - { - // USE THE ZFAIL METHOD - pID3DDevice->SetRenderState(D3DRS_STENCILFAIL, D3DSTENCILOP_KEEP); - pID3DDevice->SetRenderState(D3DRS_STENCILZFAIL, D3DSTENCILOP_INCR); - pID3DDevice->SetRenderState(D3DRS_STENCILPASS, D3DSTENCILOP_KEEP); - } - - CurrentRenderMode = zfail ? ERM_SHADOW_VOLUME_ZFAIL : ERM_SHADOW_VOLUME_ZPASS; -} - - -//! sets the needed renderstates -void CD3D8Driver::setRenderStatesStencilFillMode(bool alpha) -{ - if (CurrentRenderMode != ERM_STENCIL_FILL || Transformation3DChanged) - { - pID3DDevice->SetTransform(D3DTS_VIEW, &UnitMatrixD3D8); - pID3DDevice->SetTransform(D3DTS_WORLD, &UnitMatrixD3D8); - pID3DDevice->SetTransform(D3DTS_PROJECTION, &UnitMatrixD3D8); - - pID3DDevice->SetRenderState(D3DRS_ZENABLE, FALSE); - pID3DDevice->SetRenderState(D3DRS_LIGHTING, FALSE); - pID3DDevice->SetRenderState(D3DRS_FOGENABLE, FALSE); - - pID3DDevice->SetTextureStageState(1, D3DTSS_COLOROP, D3DTOP_DISABLE); - pID3DDevice->SetTextureStageState(1, D3DTSS_ALPHAOP, D3DTOP_DISABLE); - pID3DDevice->SetTextureStageState(2, D3DTSS_COLOROP, D3DTOP_DISABLE); - pID3DDevice->SetTextureStageState(2, D3DTSS_ALPHAOP, D3DTOP_DISABLE); - pID3DDevice->SetTextureStageState(3, D3DTSS_COLOROP, D3DTOP_DISABLE); - pID3DDevice->SetTextureStageState(3, D3DTSS_ALPHAOP, D3DTOP_DISABLE); - - pID3DDevice->SetRenderState(D3DRS_STENCILREF, 0x1 ); - pID3DDevice->SetRenderState(D3DRS_STENCILFUNC, D3DCMP_LESSEQUAL); - //pID3DDevice->SetRenderState(D3DRS_STENCILFUNC, D3DCMP_GREATEREQUAL); - pID3DDevice->SetRenderState(D3DRS_STENCILPASS, D3DSTENCILOP_KEEP ); - pID3DDevice->SetRenderState( D3DRS_STENCILZFAIL, D3DSTENCILOP_KEEP ); - pID3DDevice->SetRenderState( D3DRS_STENCILMASK, 0xffffffff ); - pID3DDevice->SetRenderState( D3DRS_STENCILWRITEMASK, 0xffffffff ); - - pID3DDevice->SetRenderState( D3DRS_CULLMODE, D3DCULL_CCW); - - Transformation3DChanged = false; - - if (alpha) - { - pID3DDevice->SetTextureStageState(0, D3DTSS_COLOROP, D3DTOP_MODULATE ); - pID3DDevice->SetTextureStageState(0, D3DTSS_COLORARG1, D3DTA_TEXTURE ); - pID3DDevice->SetTextureStageState(0, D3DTSS_COLORARG2, D3DTA_DIFFUSE ); - pID3DDevice->SetTextureStageState(0, D3DTSS_ALPHAOP, D3DTOP_SELECTARG1); - pID3DDevice->SetTextureStageState(0, D3DTSS_ALPHAARG1, D3DTA_DIFFUSE ); - BridgeCalls->setBlend(true); - BridgeCalls->setBlendFunc(D3DBLEND_SRCALPHA, D3DBLEND_INVSRCALPHA); - } - else - { - pID3DDevice->SetTextureStageState(0, D3DTSS_COLOROP, D3DTOP_MODULATE ); - pID3DDevice->SetTextureStageState(0, D3DTSS_COLORARG1, D3DTA_TEXTURE ); - pID3DDevice->SetTextureStageState(0, D3DTSS_COLORARG2, D3DTA_DIFFUSE ); - pID3DDevice->SetTextureStageState(0, D3DTSS_ALPHAOP, D3DTOP_DISABLE); - BridgeCalls->setBlend(false); - } - } - - CurrentRenderMode = ERM_STENCIL_FILL; -} - - -//! sets the needed renderstates -void CD3D8Driver::setRenderStates2DMode(bool alpha, bool texture, bool alphaChannel) -{ - if (!pID3DDevice) - return; - - if (CurrentRenderMode != ERM_2D || Transformation3DChanged) - { - // unset last 3d material - if (CurrentRenderMode == ERM_3D) - { - if (static_cast(LastMaterial.MaterialType) < MaterialRenderers.size()) - MaterialRenderers[LastMaterial.MaterialType].Renderer->OnUnsetMaterial(); - } - if (!OverrideMaterial2DEnabled) - { - setBasicRenderStates(InitMaterial2D, LastMaterial, true); - LastMaterial=InitMaterial2D; - - // fix everything that is wrongly set by SMaterial default - pID3DDevice->SetTextureStageState(1, D3DTSS_COLOROP, D3DTOP_DISABLE); - pID3DDevice->SetTextureStageState(1, D3DTSS_ALPHAOP, D3DTOP_DISABLE ); - pID3DDevice->SetTextureStageState(2, D3DTSS_COLOROP, D3DTOP_DISABLE); - pID3DDevice->SetTextureStageState(2, D3DTSS_ALPHAOP, D3DTOP_DISABLE ); - pID3DDevice->SetTextureStageState(3, D3DTSS_COLOROP, D3DTOP_DISABLE); - pID3DDevice->SetTextureStageState(3, D3DTSS_ALPHAOP, D3DTOP_DISABLE ); - - pID3DDevice->SetRenderState( D3DRS_STENCILENABLE, FALSE ); - - } - pID3DDevice->SetTransform(D3DTS_WORLD, &UnitMatrixD3D8); - core::matrix4 m; - m.setTranslation(core::vector3df(-0.5f,-0.5f,0)); - pID3DDevice->SetTransform(D3DTS_VIEW, (D3DMATRIX*)((void*)m.pointer())); - - const core::dimension2d& renderTargetSize = getCurrentRenderTargetSize(); - m.buildProjectionMatrixOrthoLH(f32(renderTargetSize.Width), f32(-(s32)(renderTargetSize.Height)), -1.0, 1.0); - m.setTranslation(core::vector3df(-1,1,0)); - pID3DDevice->SetTransform(D3DTS_PROJECTION, (D3DMATRIX*)((void*)m.pointer())); - - Transformation3DChanged = false; - } - if (OverrideMaterial2DEnabled) - { - OverrideMaterial2D.Lighting=false; - setBasicRenderStates(OverrideMaterial2D, LastMaterial, false); - LastMaterial = OverrideMaterial2D; - } - - // no alphaChannel without texture - alphaChannel &= texture; - - if (alpha || alphaChannel) - { - BridgeCalls->setBlend(true); - BridgeCalls->setBlendFunc(D3DBLEND_SRCALPHA, D3DBLEND_INVSRCALPHA); - } - else - BridgeCalls->setBlend(false); - pID3DDevice->SetTextureStageState(0, D3DTSS_COLOROP, D3DTOP_MODULATE); - pID3DDevice->SetTextureStageState(0, D3DTSS_COLORARG1, D3DTA_TEXTURE); - pID3DDevice->SetTextureStageState(0, D3DTSS_COLORARG2, D3DTA_DIFFUSE); - if (texture) - { - setTransform(ETS_TEXTURE_0, core::IdentityMatrix); - // Due to the transformation change, the previous line would call a reset each frame - // but we can safely reset the variable as it was false before - Transformation3DChanged=false; - } - if (alphaChannel) - { - pID3DDevice->SetTextureStageState(0, D3DTSS_ALPHAARG1, D3DTA_TEXTURE); - - if (alpha) - { - pID3DDevice->SetTextureStageState(0, D3DTSS_ALPHAOP, D3DTOP_MODULATE); - pID3DDevice->SetTextureStageState(0, D3DTSS_ALPHAARG2, D3DTA_DIFFUSE); - } - else - { - pID3DDevice->SetTextureStageState(0, D3DTSS_ALPHAOP, D3DTOP_SELECTARG1); - } - - } - else - { - pID3DDevice->SetTextureStageState(0, D3DTSS_ALPHAARG2, D3DTA_DIFFUSE ); - if (alpha) - { - pID3DDevice->SetTextureStageState(0, D3DTSS_ALPHAOP, D3DTOP_SELECTARG2); - } - else - { - pID3DDevice->SetTextureStageState(0, D3DTSS_ALPHAARG1, D3DTA_TEXTURE); - pID3DDevice->SetTextureStageState(0, D3DTSS_ALPHAOP, D3DTOP_MODULATE); - } - } - - CurrentRenderMode = ERM_2D; -} - - -//! deletes all dynamic lights there are -void CD3D8Driver::deleteAllDynamicLights() -{ - for (s32 i=0; iLightEnable(i, false); - - LastSetLight = -1; - - CNullDriver::deleteAllDynamicLights(); -} - - -//! adds a dynamic light -s32 CD3D8Driver::addDynamicLight(const SLight& dl) -{ - CNullDriver::addDynamicLight(dl); - - D3DLIGHT8 light; - - switch (dl.Type) - { - case ELT_POINT: - light.Type = D3DLIGHT_POINT; - break; - case ELT_SPOT: - light.Type = D3DLIGHT_SPOT; - break; - case ELT_DIRECTIONAL: - light.Type = D3DLIGHT_DIRECTIONAL; - break; - } - - light.Position = *(D3DVECTOR*)((void*)(&dl.Position)); - light.Direction = *(D3DVECTOR*)((void*)(&dl.Direction)); - - light.Range = core::min_(dl.Radius, MaxLightDistance); - light.Falloff = dl.Falloff; - - light.Diffuse = *(D3DCOLORVALUE*)((void*)(&dl.DiffuseColor)); - light.Specular = *(D3DCOLORVALUE*)((void*)(&dl.SpecularColor)); - light.Ambient = *(D3DCOLORVALUE*)((void*)(&dl.AmbientColor)); - - light.Attenuation0 = dl.Attenuation.X; - light.Attenuation1 = dl.Attenuation.Y; - light.Attenuation2 = dl.Attenuation.Z; - - light.Theta = dl.InnerCone * 2.0f * core::DEGTORAD; - light.Phi = dl.OuterCone * 2.0f * core::DEGTORAD; - - ++LastSetLight; - - if(D3D_OK == pID3DDevice->SetLight(LastSetLight, &light)) - { - // I don't care if this succeeds - (void)pID3DDevice->LightEnable(LastSetLight, true); - return LastSetLight; - } - - return -1; -} - - -void CD3D8Driver::turnLightOn(s32 lightIndex, bool turnOn) -{ - if(lightIndex < 0 || lightIndex > LastSetLight) - return; - - (void)pID3DDevice->LightEnable(lightIndex, turnOn); -} - - -//! returns the maximal amount of dynamic lights the device can handle -u32 CD3D8Driver::getMaximalDynamicLightAmount() const -{ - return Caps.MaxActiveLights; -} - - -//! Sets the dynamic ambient light color. The default color is -//! (0,0,0,0) which means it is dark. -//! \param color: New color of the ambient light. -void CD3D8Driver::setAmbientLight(const SColorf& color) -{ - CNullDriver::setAmbientLight(color); - - if (!pID3DDevice) - return; - - D3DCOLOR col = color.toSColor().color; - pID3DDevice->SetRenderState(D3DRS_AMBIENT, col); -} - - -//! \return Returns the name of the video driver. Example: In case of the DIRECT3D8 -//! driver, it would return "Direct3D8.1". -const wchar_t* CD3D8Driver::getName() const -{ - return L"Direct3D 8.1"; -} - - -//! Draws a shadow volume into the stencil buffer. To draw a stencil shadow, do -//! this: First, draw all geometry. Then use this method, to draw the shadow -//! volume. Then, use IVideoDriver::drawStencilShadow() to visualize the shadow. -void CD3D8Driver::drawStencilShadowVolume(const core::array& triangles, bool zfail, u32 debugDataVisible) -{ - const u32 count = triangles.size(); - if (!Params.Stencilbuffer || !count) - return; - - setRenderStatesStencilShadowMode(zfail, debugDataVisible); - - if (!zfail) - { - // ZPASS Method - - // Draw front-side of shadow volume in stencil only - pID3DDevice->SetRenderState(D3DRS_CULLMODE, D3DCULL_CCW ); - pID3DDevice->SetRenderState(D3DRS_STENCILPASS, D3DSTENCILOP_INCRSAT); - pID3DDevice->DrawPrimitiveUP(D3DPT_TRIANGLELIST, count / 3, triangles.const_pointer(), sizeof(core::vector3df)); - - // Now reverse cull order so front sides of shadow volume are written. - pID3DDevice->SetRenderState( D3DRS_CULLMODE, D3DCULL_CW ); - pID3DDevice->SetRenderState( D3DRS_STENCILPASS, D3DSTENCILOP_DECRSAT); - pID3DDevice->DrawPrimitiveUP(D3DPT_TRIANGLELIST, count / 3, triangles.const_pointer(), sizeof(core::vector3df)); - } - else - { - // ZFAIL Method - - // Draw front-side of shadow volume in stencil only - pID3DDevice->SetRenderState(D3DRS_CULLMODE, D3DCULL_CW ); - pID3DDevice->SetRenderState(D3DRS_STENCILZFAIL, D3DSTENCILOP_INCRSAT ); - pID3DDevice->DrawPrimitiveUP(D3DPT_TRIANGLELIST, count / 3, triangles.const_pointer(), sizeof(core::vector3df)); - - // Now reverse cull order so front sides of shadow volume are written. - pID3DDevice->SetRenderState( D3DRS_CULLMODE, D3DCULL_CCW ); - pID3DDevice->SetRenderState( D3DRS_STENCILZFAIL, D3DSTENCILOP_DECRSAT ); - pID3DDevice->DrawPrimitiveUP(D3DPT_TRIANGLELIST, count / 3, triangles.const_pointer(), sizeof(core::vector3df)); - } -} - - -//! Fills the stencil shadow with color. After the shadow volume has been drawn -//! into the stencil buffer using IVideoDriver::drawStencilShadowVolume(), use this -//! to draw the color of the shadow. -void CD3D8Driver::drawStencilShadow(bool clearStencilBuffer, video::SColor leftUpEdge, - video::SColor rightUpEdge, video::SColor leftDownEdge, video::SColor rightDownEdge) -{ - if (!Params.Stencilbuffer) - return; - - S3DVertex vtx[4]; - vtx[0] = S3DVertex(1.0f, 1.0f, 0.0f, 0.0f, 0.0f, 0.0f, leftUpEdge, 0.0f, 0.0f); - vtx[1] = S3DVertex(1.0f, -1.0f, 0.0f, 0.0f, 0.0f, 0.0f, rightUpEdge, 0.0f, 1.0f); - vtx[2] = S3DVertex(-1.0f, 1.0f, 0.0f, 0.0f, 0.0f, 0.0f, leftDownEdge, 1.0f, 0.0f); - vtx[3] = S3DVertex(-1.0f, -1.0f, 0.0f, 0.0f, 0.0f, 0.0f, rightDownEdge, 1.0f, 1.0f); - - const s16 indices[6] = {0,1,2,1,3,2}; - - setRenderStatesStencilFillMode( - leftUpEdge.getAlpha() < 255 || - rightUpEdge.getAlpha() < 255 || - leftDownEdge.getAlpha() < 255 || - rightDownEdge.getAlpha() < 255); - - setActiveTexture(0,0); - - setVertexShader(EVT_STANDARD); - - pID3DDevice->DrawIndexedPrimitiveUP(D3DPT_TRIANGLELIST, 0, 4, 2, &indices[0], - D3DFMT_INDEX16, &vtx[0], sizeof(S3DVertex)); - - if (clearStencilBuffer) - pID3DDevice->Clear(0, NULL, D3DCLEAR_STENCIL,0, 1.0, 0); -} - - -//! Returns the maximum amount of primitives (mostly vertices) which -//! the device is able to render with one drawIndexedTriangleList -//! call. -u32 CD3D8Driver::getMaximalPrimitiveCount() const -{ - return Caps.MaxPrimitiveCount; -} - - -//! Sets the fog mode. -void CD3D8Driver::setFog(SColor color, E_FOG_TYPE fogType, f32 start, - f32 end, f32 density, bool pixelFog, bool rangeFog) -{ - CNullDriver::setFog(color, fogType, start, end, density, pixelFog, rangeFog); - - if (!pID3DDevice) - return; - - pID3DDevice->SetRenderState(D3DRS_FOGCOLOR, color.color); - - pID3DDevice->SetRenderState( -#if defined( _IRR_XBOX_PLATFORM_) - D3DRS_FOGTABLEMODE, -#else - pixelFog ? D3DRS_FOGTABLEMODE : D3DRS_FOGVERTEXMODE, -#endif - (fogType==EFT_FOG_LINEAR)? D3DFOG_LINEAR : (fogType==EFT_FOG_EXP)?D3DFOG_EXP:D3DFOG_EXP2); - - if (fogType==EFT_FOG_LINEAR) - { - pID3DDevice->SetRenderState(D3DRS_FOGSTART, *(DWORD*)(&start)); - pID3DDevice->SetRenderState(D3DRS_FOGEND, *(DWORD*)(&end)); - } - else - pID3DDevice->SetRenderState(D3DRS_FOGDENSITY, *(DWORD*)(&density)); - - if(!pixelFog) - pID3DDevice->SetRenderState(D3DRS_RANGEFOGENABLE, rangeFog); -} - - -//! Draws a 3d line. -void CD3D8Driver::draw3DLine(const core::vector3df& start, - const core::vector3df& end, SColor color) -{ - setVertexShader(EVT_STANDARD); - setRenderStates3DMode(); - video::S3DVertex v[2]; - v[0].Color = color; - v[1].Color = color; - v[0].Pos = start; - v[1].Pos = end; - - pID3DDevice->DrawPrimitiveUP(D3DPT_LINELIST, 1, v, sizeof(S3DVertex)); -} - - -void CD3D8Driver::OnResize(const core::dimension2d& size) -{ - if (!pID3DDevice) - return; - - CNullDriver::OnResize(size); - reset(); -} - - -//! Returns type of video driver -E_DRIVER_TYPE CD3D8Driver::getDriverType() const -{ - return EDT_DIRECT3D8; -} - - -//! Returns the transformation set by setTransform -const core::matrix4& CD3D8Driver::getTransform(E_TRANSFORMATION_STATE state) const -{ - return Matrices[state]; -} - -//! Get a vertex shader constant index. -s32 CD3D8Driver::getVertexShaderConstantID(const c8* name) -{ - os::Printer::log("Cannot get constant index, no HLSL supported in D3D8"); - return -1; -} - -//! Get a pixel shader constant index. -s32 CD3D8Driver::getPixelShaderConstantID(const c8* name) -{ - os::Printer::log("Cannot get constant index, no HLSL supported in D3D8"); - return -1; -} - - -//! Sets a vertex shader constant. -void CD3D8Driver::setVertexShaderConstant(const f32* data, s32 startRegister, s32 constantAmount) -{ - if (data) - pID3DDevice->SetVertexShaderConstant(startRegister, data, constantAmount); -} - - -//! Sets a pixel shader constant. -void CD3D8Driver::setPixelShaderConstant(const f32* data, s32 startRegister, s32 constantAmount) -{ - if (data) - pID3DDevice->SetPixelShaderConstant(startRegister, data, constantAmount); -} - - -//! Sets a constant for the vertex shader based on an index. -bool CD3D8Driver::setVertexShaderConstant(s32 index, const f32* floats, int count) -{ - os::Printer::log("Cannot set constant, no HLSL supported in D3D8"); - return false; -} - - -//! Int interface for the above. -bool CD3D8Driver::setVertexShaderConstant(s32 index, const s32* ints, int count) -{ - os::Printer::log("Cannot set constant, no HLSL supported in D3D8"); - return false; -} - - -//! Sets a constant for the pixel shader based on an index. -bool CD3D8Driver::setPixelShaderConstant(s32 index, const f32* floats, int count) -{ - os::Printer::log("Cannot set constant, no HLSL supported in D3D8"); - return false; -} - - -//! Int interface for the above. -bool CD3D8Driver::setPixelShaderConstant(s32 index, const s32* ints, int count) -{ - os::Printer::log("Cannot set constant, no HLSL supported in D3D8"); - return false; -} - - -//! Adds a new material renderer to the VideoDriver, using pixel and/or -//! vertex shaders to render geometry. -s32 CD3D8Driver::addShaderMaterial(const c8* vertexShaderProgram, - const c8* pixelShaderProgram, - IShaderConstantSetCallBack* callback, - E_MATERIAL_TYPE baseMaterial, s32 userData) -{ - s32 nr = -1; - CD3D8ShaderMaterialRenderer* r = new CD3D8ShaderMaterialRenderer( - pID3DDevice, this, nr, vertexShaderProgram, pixelShaderProgram, - callback, getMaterialRenderer(baseMaterial), userData); - - r->drop(); - return nr; -} - - -//! Returns a pointer to the IVideoDriver interface. (Implementation for -//! IMaterialRendererServices) -IVideoDriver* CD3D8Driver::getVideoDriver() -{ - return this; -} - - -//! Clears the ZBuffer. -void CD3D8Driver::clearZBuffer() -{ - const HRESULT hr = pID3DDevice->Clear( 0, NULL, D3DCLEAR_ZBUFFER, 0, 1.0, 0); - - if (FAILED(hr)) - os::Printer::log("CD3D8Driver clearZBuffer() failed.", ELL_WARNING); -} - - -//! Returns an image created from the last rendered frame. -IImage* CD3D8Driver::createScreenShot(video::ECOLOR_FORMAT format, video::E_RENDER_TARGET target) -{ -#if defined( _IRR_XBOX_PLATFORM_) - return 0; -#else - if (target != video::ERT_FRAME_BUFFER) - return 0; - - // query the screen dimensions of the current adapter - D3DDISPLAYMODE displayMode; - pID3DDevice->GetDisplayMode(&displayMode); - - if (format==video::ECF_UNKNOWN) - format=video::ECF_A8R8G8B8; - - // create the image surface to store the front buffer image [always A8R8G8B8] - HRESULT hr; - LPDIRECT3DSURFACE8 lpSurface; - if (FAILED(hr = pID3DDevice->CreateImageSurface(displayMode.Width, displayMode.Height, D3DFMT_A8R8G8B8, &lpSurface))) - return 0; - - // read the front buffer into the image surface - if (FAILED(hr = pID3DDevice->GetFrontBuffer(lpSurface))) - { - lpSurface->Release(); - return 0; - } - - RECT clientRect; - { - POINT clientPoint; - clientPoint.x = 0; - clientPoint.y = 0; - - ClientToScreen( (HWND)getExposedVideoData().D3D8.HWnd, &clientPoint ); - - clientRect.left = clientPoint.x; - clientRect.top = clientPoint.y; - clientRect.right = clientRect.left + ScreenSize.Width; - clientRect.bottom = clientRect.top + ScreenSize.Height; - - // window can be off-screen partly, we can't take screenshots from that - clientRect.left = core::max_(clientRect.left, 0l); - clientRect.top = core::max_(clientRect.top, 0l); - clientRect.right = core::min_(clientRect.right, (long)displayMode.Width); - clientRect.bottom = core::min_(clientRect.bottom, (long)displayMode.Height ); - } - - // lock our area of the surface - D3DLOCKED_RECT lockedRect; - if (FAILED(lpSurface->LockRect(&lockedRect, &clientRect, D3DLOCK_READONLY))) - { - lpSurface->Release(); - return 0; - } - - irr::core::dimension2d shotSize; - shotSize.Width = core::min_( ScreenSize.Width, (u32)(clientRect.right-clientRect.left) ); - shotSize.Height = core::min_( ScreenSize.Height, (u32)(clientRect.bottom-clientRect.top) ); - - // this could throw, but we aren't going to worry about that case very much - IImage* newImage = createImage(format, shotSize); - - if (newImage) - { - // d3d pads the image, so we need to copy the correct number of bytes - u32* dP = (u32*)newImage->lock(); - u8 * sP = (u8 *)lockedRect.pBits; - - // If the display mode format doesn't promise anything about the Alpha value - // and it appears that it's not presenting 255, then we should manually - // set each pixel alpha value to 255. - if(D3DFMT_X8R8G8B8 == displayMode.Format && (0xFF000000 != (*dP & 0xFF000000))) - { - for (u32 y = 0; y < shotSize.Height; ++y) - { - for(u32 x = 0; x < shotSize.Width; ++x) - { - newImage->setPixel(x,y,*((u32*)sP) | 0xFF000000); - sP += 4; - } - - sP += lockedRect.Pitch - (4 * shotSize.Width); - } - } - else - { - for (u32 y = 0; y < shotSize.Height; ++y) - { - convertColor(sP, video::ECF_A8R8G8B8, shotSize.Width, dP, format); - sP += lockedRect.Pitch; - dP += shotSize.Width; - } - } - - newImage->unlock(); - } - - // we can unlock and release the surface - lpSurface->UnlockRect(); - - // release the image surface - lpSurface->Release(); - - // return status of save operation to caller - return newImage; -#endif -} - - -// returns the current size of the screen or rendertarget -const core::dimension2d& CD3D8Driver::getCurrentRenderTargetSize() const -{ - if ( CurrentRendertargetSize.Width == 0 ) - return ScreenSize; - else - return CurrentRendertargetSize; -} - - -// Set/unset a clipping plane. -bool CD3D8Driver::setClipPlane(u32 index, const core::plane3df& plane, bool enable) -{ -#if defined( _IRR_XBOX_PLATFORM_) - return false; -#else - if (index >= MaxUserClipPlanes) - return false; - pID3DDevice->SetClipPlane(index, (const float*)&plane); - enableClipPlane(index, enable); - return true; -#endif -} - - -// Enable/disable a clipping plane. -void CD3D8Driver::enableClipPlane(u32 index, bool enable) -{ -#if defined( _IRR_XBOX_PLATFORM_) - return; -#else - if (index >= MaxUserClipPlanes) - return; - DWORD renderstate; - pID3DDevice->GetRenderState(D3DRS_CLIPPLANEENABLE, &renderstate); - if (enable) - renderstate |= (1 << index); - else - renderstate &= ~(1 << index); - pID3DDevice->SetRenderState(D3DRS_CLIPPLANEENABLE, renderstate); -#endif -} - - -core::dimension2du CD3D8Driver::getMaxTextureSize() const -{ - return core::dimension2du(Caps.MaxTextureWidth, Caps.MaxTextureHeight); -} - - -u32 CD3D8Driver::getD3DBlend(E_BLEND_FACTOR factor) const -{ - u32 r = 0; - switch ( factor ) - { - case EBF_ZERO: r = D3DBLEND_ZERO; break; - case EBF_ONE: r = D3DBLEND_ONE; break; - case EBF_DST_COLOR: r = D3DBLEND_DESTCOLOR; break; - case EBF_ONE_MINUS_DST_COLOR: r = D3DBLEND_INVDESTCOLOR; break; - case EBF_SRC_COLOR: r = D3DBLEND_SRCCOLOR; break; - case EBF_ONE_MINUS_SRC_COLOR: r = D3DBLEND_INVSRCCOLOR; break; - case EBF_SRC_ALPHA: r = D3DBLEND_SRCALPHA; break; - case EBF_ONE_MINUS_SRC_ALPHA: r = D3DBLEND_INVSRCALPHA; break; - case EBF_DST_ALPHA: r = D3DBLEND_DESTALPHA; break; - case EBF_ONE_MINUS_DST_ALPHA: r = D3DBLEND_INVDESTALPHA; break; - case EBF_SRC_ALPHA_SATURATE: r = D3DBLEND_SRCALPHASAT; break; - } - return r; -} - - -u32 CD3D8Driver::getD3DModulate(E_MODULATE_FUNC func) const -{ - u32 r = D3DTOP_MODULATE; - switch ( func ) - { - case EMFN_MODULATE_1X: r = D3DTOP_MODULATE; break; - case EMFN_MODULATE_2X: r = D3DTOP_MODULATE2X; break; - case EMFN_MODULATE_4X: r = D3DTOP_MODULATE4X; break; - } - return r; -} - - -CD3D8CallBridge* CD3D8Driver::getBridgeCalls() const -{ - return BridgeCalls; -} - - -CD3D8CallBridge::CD3D8CallBridge(IDirect3DDevice8* p) : pID3DDevice(p), - BlendOperation(D3DBLENDOP_ADD), BlendSource(D3DBLEND_ONE), BlendDestination(D3DBLEND_ZERO), Blend(false) -{ - pID3DDevice->SetRenderState(D3DRS_BLENDOP, D3DBLENDOP_ADD); - pID3DDevice->SetRenderState(D3DRS_SRCBLEND, D3DBLEND_ONE); - pID3DDevice->SetRenderState(D3DRS_DESTBLEND, D3DBLEND_ZERO); - pID3DDevice->SetRenderState(D3DRS_ALPHABLENDENABLE, FALSE); -} - -void CD3D8CallBridge::setBlendOperation(DWORD mode) -{ - if (BlendOperation != mode) - { - pID3DDevice->SetRenderState(D3DRS_BLENDOP, mode); - - BlendOperation = mode; - } -} - -void CD3D8CallBridge::setBlendFunc(DWORD source, DWORD destination) -{ - if (BlendSource != source) - { - pID3DDevice->SetRenderState(D3DRS_SRCBLEND, source); - - BlendSource = source; - } - - if (BlendDestination != destination) - { - pID3DDevice->SetRenderState(D3DRS_DESTBLEND, destination); - - BlendDestination = destination; - } -} - -void CD3D8CallBridge::setBlend(bool enable) -{ - if (Blend != enable) - { - if (enable) - pID3DDevice->SetRenderState(D3DRS_ALPHABLENDENABLE, TRUE); - else - pID3DDevice->SetRenderState(D3DRS_ALPHABLENDENABLE, FALSE); - - Blend = enable; - } -} - - -} // end namespace video -} // end namespace irr - -#endif // _IRR_COMPILE_WITH_DIRECT3D_8_ - - -namespace irr -{ -namespace video -{ - -#ifdef _IRR_COMPILE_WITH_DIRECT3D_8_ -//! creates a video driver -IVideoDriver* createDirectX8Driver(const SIrrlichtCreationParameters& params, - io::IFileSystem* io, HWND window) -{ - const bool pureSoftware = false; - CD3D8Driver* dx8 = new CD3D8Driver(params, io); - - if (!dx8->initDriver(window, pureSoftware)) - { - dx8->drop(); - dx8 = 0; - } - - return dx8; -} -#endif // _IRR_COMPILE_WITH_DIRECT3D_8_ - -} // end namespace video -} // end namespace irr diff --git a/source/Irrlicht/CD3D8Driver.h b/source/Irrlicht/CD3D8Driver.h deleted file mode 100644 index a5117145..00000000 --- a/source/Irrlicht/CD3D8Driver.h +++ /dev/null @@ -1,379 +0,0 @@ -// Copyright (C) 2002-2012 Nikolaus Gebhardt -// This file is part of the "Irrlicht Engine". -// For conditions of distribution and use, see copyright notice in irrlicht.h - -#ifndef __C_VIDEO_DIRECTX_8_H_INCLUDED__ -#define __C_VIDEO_DIRECTX_8_H_INCLUDED__ - -#include "IrrCompileConfig.h" - -#ifdef _IRR_COMPILE_WITH_DIRECT3D_8_ - -#ifdef _IRR_WINDOWS_ - #define WIN32_LEAN_AND_MEAN - #include -#endif - -#include "SIrrCreationParameters.h" -// always included for static createDriver function -#include "CNullDriver.h" -#include "IMaterialRendererServices.h" - -#include - -namespace irr -{ -namespace video -{ - class CD3D8CallBridge; - - class CD3D8Driver : public CNullDriver, IMaterialRendererServices - { - friend class CD3D8CallBridge; - friend class CD3D8Texture; - - public: - - //! constructor - CD3D8Driver(const SIrrlichtCreationParameters& params, io::IFileSystem* io); - - //! destructor - virtual ~CD3D8Driver(); - - //! applications must call this method before performing any rendering. returns false if failed. - virtual bool beginScene(bool backBuffer=true, bool zBuffer=true, - SColor color=SColor(255,0,0,0), - const SExposedVideoData& videoData=SExposedVideoData(), - core::rect* sourceRect=0) _IRR_OVERRIDE_; - - //! applications must call this method after performing any rendering. returns false if failed. - virtual bool endScene() _IRR_OVERRIDE_; - - //! queries the features of the driver, returns true if feature is available - virtual bool queryFeature(E_VIDEO_DRIVER_FEATURE feature) const _IRR_OVERRIDE_; - - //! sets transformation - virtual void setTransform(E_TRANSFORMATION_STATE state, const core::matrix4& mat) _IRR_OVERRIDE_; - - //! sets a material - virtual void setMaterial(const SMaterial& material) _IRR_OVERRIDE_; - - //! sets a render target - virtual bool setRenderTarget(video::ITexture* texture, - bool clearBackBuffer=true, bool clearZBuffer=true, - SColor color=video::SColor(0,0,0,0)) _IRR_OVERRIDE_; - - //! sets a viewport - virtual void setViewPort(const core::rect& area) _IRR_OVERRIDE_; - - //! gets the area of the current viewport - virtual const core::rect& getViewPort() const _IRR_OVERRIDE_; - - //! draws a vertex primitive list - virtual void drawVertexPrimitiveList(const void* vertices, u32 vertexCount, - const void* indexList, u32 primitiveCount, - E_VERTEX_TYPE vType, scene::E_PRIMITIVE_TYPE pType, - E_INDEX_TYPE iType) _IRR_OVERRIDE_; - - //! draws a vertex primitive list in 2d - virtual void draw2DVertexPrimitiveList(const void* vertices, u32 vertexCount, - const void* indexList, u32 primitiveCount, - E_VERTEX_TYPE vType, scene::E_PRIMITIVE_TYPE pType, - E_INDEX_TYPE iType) _IRR_OVERRIDE_; - - //! draws an 2d image, using a color (if color is other then Color(255,255,255,255)) and the alpha channel of the texture if wanted. - virtual void draw2DImage(const video::ITexture* texture, const core::position2d& destPos, - const core::rect& sourceRect, const core::rect* clipRect = 0, - SColor color=SColor(255,255,255,255), bool useAlphaChannelOfTexture=false) _IRR_OVERRIDE_; - - //! Draws a part of the texture into the rectangle. - virtual void draw2DImage(const video::ITexture* texture, const core::rect& destRect, - const core::rect& sourceRect, const core::rect* clipRect = 0, - const video::SColor* const colors=0, bool useAlphaChannelOfTexture=false) _IRR_OVERRIDE_; - - //!Draws an 2d rectangle with a gradient. - virtual void draw2DRectangle(const core::rect& pos, - SColor colorLeftUp, SColor colorRightUp, SColor colorLeftDown, SColor colorRightDown, - const core::rect* clip = 0) _IRR_OVERRIDE_; - - //! Draws a 2d line. - virtual void draw2DLine(const core::position2d& start, - const core::position2d& end, - SColor color=SColor(255,255,255,255)) _IRR_OVERRIDE_; - - //! Draws a pixel. - virtual void drawPixel(u32 x, u32 y, const SColor & color) _IRR_OVERRIDE_; - - //! Draws a 3d line. - virtual void draw3DLine(const core::vector3df& start, - const core::vector3df& end, SColor color = SColor(255,255,255,255)) _IRR_OVERRIDE_; - - //! initialises the Direct3D API - bool initDriver(HWND hwnd, bool pureSoftware); - - //! \return Returns the name of the video driver. Example: In case of the DIRECT3D8 - //! driver, it would return "Direct3D8.1". - virtual const wchar_t* getName() const _IRR_OVERRIDE_; - - //! deletes all dynamic lights there are - virtual void deleteAllDynamicLights() _IRR_OVERRIDE_; - - //! adds a dynamic light, returning an index to the light - //! \param light: the light data to use to create the light - //! \return An index to the light, or -1 if an error occurs - virtual s32 addDynamicLight(const SLight& light) _IRR_OVERRIDE_; - - //! Turns a dynamic light on or off - //! \param lightIndex: the index returned by addDynamicLight - //! \param turnOn: true to turn the light on, false to turn it off - virtual void turnLightOn(s32 lightIndex, bool turnOn) _IRR_OVERRIDE_; - - //! returns the maximal amount of dynamic lights the device can handle - virtual u32 getMaximalDynamicLightAmount() const _IRR_OVERRIDE_; - - //! Sets the dynamic ambient light color. The default color is - //! (0,0,0,0) which means it is dark. - //! \param color: New color of the ambient light. - virtual void setAmbientLight(const SColorf& color) _IRR_OVERRIDE_; - - //! Draws a shadow volume into the stencil buffer. To draw a stencil shadow, do - //! this: Frist, draw all geometry. Then use this method, to draw the shadow - //! volume. Then, use IVideoDriver::drawStencilShadow() to visualize the shadow. - virtual void drawStencilShadowVolume(const core::array& triangles, bool zfail=true, u32 debugDataVisible=0) _IRR_OVERRIDE_; - - //! Fills the stencil shadow with color. After the shadow volume has been drawn - //! into the stencil buffer using IVideoDriver::drawStencilShadowVolume(), use this - //! to draw the color of the shadow. - virtual void drawStencilShadow(bool clearStencilBuffer=false, - video::SColor leftUpEdge = video::SColor(0,0,0,0), - video::SColor rightUpEdge = video::SColor(0,0,0,0), - video::SColor leftDownEdge = video::SColor(0,0,0,0), - video::SColor rightDownEdge = video::SColor(0,0,0,0)) _IRR_OVERRIDE_; - - //! Returns the maximum amount of primitives (mostly vertices) which - //! the device is able to render with one drawIndexedTriangleList - //! call. - virtual u32 getMaximalPrimitiveCount() const _IRR_OVERRIDE_; - - //! Enables or disables a texture creation flag. - virtual void setTextureCreationFlag(E_TEXTURE_CREATION_FLAG flag, bool enabled) _IRR_OVERRIDE_; - - //! Sets the fog mode. - virtual void setFog(SColor color, E_FOG_TYPE fogType, f32 start, - f32 end, f32 density, bool pixelFog, bool rangeFog) _IRR_OVERRIDE_; - - //! Only used by the internal engine. Used to notify the driver that - //! the window was resized. - virtual void OnResize(const core::dimension2d& size) _IRR_OVERRIDE_; - - //! Returns type of video driver - virtual E_DRIVER_TYPE getDriverType() const _IRR_OVERRIDE_; - - //! Returns the transformation set by setTransform - virtual const core::matrix4& getTransform(E_TRANSFORMATION_STATE state) const _IRR_OVERRIDE_; - - //! Can be called by an IMaterialRenderer to make its work easier. - virtual void setBasicRenderStates(const SMaterial& material, const SMaterial& lastMaterial, - bool resetAllRenderstates) _IRR_OVERRIDE_; - - //! Get a vertex shader constant index. - virtual s32 getVertexShaderConstantID(const c8* name) _IRR_OVERRIDE_; - - //! Get a pixel shader constant index. - virtual s32 getPixelShaderConstantID(const c8* name) _IRR_OVERRIDE_; - - //! Sets a vertex shader constant. - virtual void setVertexShaderConstant(const f32* data, s32 startRegister, s32 constantAmount=1) _IRR_OVERRIDE_; - - //! Sets a pixel shader constant. - virtual void setPixelShaderConstant(const f32* data, s32 startRegister, s32 constantAmount=1) _IRR_OVERRIDE_; - - //! Sets a constant for the vertex shader based on an index. - virtual bool setVertexShaderConstant(s32 index, const f32* floats, int count) _IRR_OVERRIDE_; - - //! Int interface for the above. - virtual bool setVertexShaderConstant(s32 index, const s32* ints, int count) _IRR_OVERRIDE_; - - //! Sets a constant for the pixel shader based on an index. - virtual bool setPixelShaderConstant(s32 index, const f32* floats, int count) _IRR_OVERRIDE_; - - //! Int interface for the above. - virtual bool setPixelShaderConstant(s32 index, const s32* ints, int count) _IRR_OVERRIDE_; - - //! Returns a pointer to the IVideoDriver interface. (Implementation for - //! IMaterialRendererServices) - virtual IVideoDriver* getVideoDriver() _IRR_OVERRIDE_; - - //! Creates a render target texture. - virtual ITexture* addRenderTargetTexture(const core::dimension2d& size, - const io::path& name, const ECOLOR_FORMAT format = ECF_UNKNOWN) _IRR_OVERRIDE_; - - //! Clears the ZBuffer. - virtual void clearZBuffer() _IRR_OVERRIDE_; - - //! Returns an image created from the last rendered frame. - virtual IImage* createScreenShot(video::ECOLOR_FORMAT format=video::ECF_UNKNOWN, video::E_RENDER_TARGET target=video::ERT_FRAME_BUFFER) _IRR_OVERRIDE_; - - //! Set/unset a clipping plane. - //! There are at least 6 clipping planes available for the user to set at will. - //! \param index: The plane index. Must be between 0 and MaxUserClipPlanes. - //! \param plane: The plane itself. - //! \param enable: If true, enable the clipping plane else disable it. - virtual bool setClipPlane(u32 index, const core::plane3df& plane, bool enable=false) _IRR_OVERRIDE_; - - //! Enable/disable a clipping plane. - //! There are at least 6 clipping planes available for the user to set at will. - //! \param index: The plane index. Must be between 0 and MaxUserClipPlanes. - //! \param enable: If true, enable the clipping plane else disable it. - virtual void enableClipPlane(u32 index, bool enable) _IRR_OVERRIDE_; - - //! Returns the maximum texture size supported. - virtual core::dimension2du getMaxTextureSize() const _IRR_OVERRIDE_; - - virtual bool checkDriverReset() _IRR_OVERRIDE_ {return DriverWasReset;} - - //! Get D3D blending factor. - u32 getD3DBlend(E_BLEND_FACTOR factor) const; - - //! Get D3D modulate. - u32 getD3DModulate(E_MODULATE_FUNC func) const; - - //! Get bridge calls. - CD3D8CallBridge* getBridgeCalls() const; - - private: - - // enumeration for rendering modes such as 2d and 3d for minizing the switching of renderStates. - enum E_RENDER_MODE - { - ERM_NONE = 0, // no render state has been set yet. - ERM_2D, // 2d drawing rendermode - ERM_3D, // 3d rendering mode - ERM_STENCIL_FILL, // stencil fill mode - ERM_SHADOW_VOLUME_ZFAIL, // stencil volume draw mode - ERM_SHADOW_VOLUME_ZPASS // stencil volume draw mode - }; - - //! sets right vertex shader - void setVertexShader(video::E_VERTEX_TYPE newType); - - //! sets the needed renderstates - bool setRenderStates3DMode(); - - //! sets the needed renderstates - void setRenderStates2DMode(bool alpha, bool texture, bool alphaChannel); - - //! sets the needed renderstates - void setRenderStatesStencilFillMode(bool alpha); - - //! sets the needed renderstates - void setRenderStatesStencilShadowMode(bool zfail, u32 debugDataVisible); - - //! sets the current Texture - bool setActiveTexture(u32 stage, const video::ITexture* texture); - - //! resets the device - bool reset(); - - //! returns a device dependent texture from a software surface (IImage) - //! THIS METHOD HAS TO BE OVERRIDDEN BY DERIVED DRIVERS WITH OWN TEXTURES - virtual video::ITexture* createDeviceDependentTexture(IImage* surface, const io::path& name, void* mipmapData=0) _IRR_OVERRIDE_; - - // returns the current size of the screen or rendertarget - virtual const core::dimension2d& getCurrentRenderTargetSize() const _IRR_OVERRIDE_; - - //! Adds a new material renderer to the VideoDriver, using pixel and/or - //! vertex shaders to render geometry. - s32 addShaderMaterial(const c8* vertexShaderProgram, const c8* pixelShaderProgram, - IShaderConstantSetCallBack* callback, - E_MATERIAL_TYPE baseMaterial, s32 userData); - - void createMaterialRenderers(); - - void draw2D3DVertexPrimitiveList(const void* vertices, - u32 vertexCount, const void* indexList, u32 primitiveCount, - E_VERTEX_TYPE vType, scene::E_PRIMITIVE_TYPE pType, - E_INDEX_TYPE iType, bool is3D); - - D3DTEXTUREADDRESS getTextureWrapMode(const u8 clamp); - - inline D3DCOLORVALUE colorToD3D(const SColor& col) - { - const f32 f = 1.0f / 255.0f; - D3DCOLORVALUE v; - v.r = col.getRed() * f; - v.g = col.getGreen() * f; - v.b = col.getBlue() * f; - v.a = col.getAlpha() * f; - return v; - } - - CD3D8CallBridge* BridgeCalls; - - E_RENDER_MODE CurrentRenderMode; - D3DPRESENT_PARAMETERS present; - - SMaterial Material, LastMaterial; - bool ResetRenderStates; // bool to make all renderstates be reseted if set. - bool Transformation3DChanged; - const ITexture* CurrentTexture[MATERIAL_MAX_TEXTURES]; - core::matrix4 Matrices[ETS_COUNT]; // matrices of the 3d mode we need to restore when we switch back from the 2d mode. - - HINSTANCE D3DLibrary; - IDirect3D8* pID3D; - IDirect3DDevice8* pID3DDevice; - - IDirect3DSurface8* PrevRenderTarget; - core::dimension2d CurrentRendertargetSize; - - HWND WindowId; - core::rect* SceneSourceRect; - - D3DCAPS8 Caps; - - E_VERTEX_TYPE LastVertexType; - - D3DMATRIX UnitMatrix; - - u32 MaxTextureUnits; - u32 MaxUserClipPlanes; - f32 MaxLightDistance; - s32 LastSetLight; - bool DeviceLost; - bool DriverWasReset; - - SIrrlichtCreationParameters Params; - }; - - //! This bridge between Irlicht pseudo D3D8 calls - //! and true D3D8 calls. - - class CD3D8CallBridge - { - public: - CD3D8CallBridge(IDirect3DDevice8* p); - - // Blending calls. - - void setBlendOperation(DWORD mode); - - void setBlendFunc(DWORD source, DWORD destination); - - void setBlend(bool enable); - - private: - IDirect3DDevice8* pID3DDevice; - - DWORD BlendOperation; - DWORD BlendSource; - DWORD BlendDestination; - bool Blend; - }; - -} // end namespace video -} // end namespace irr - -#endif // _IRR_COMPILE_WITH_DIRECT3D_8_ - -#endif // __C_VIDEO_DIRECTX_8_H_INCLUDED__ - diff --git a/source/Irrlicht/CD3D8MaterialRenderer.h b/source/Irrlicht/CD3D8MaterialRenderer.h deleted file mode 100644 index ac6ec0d0..00000000 --- a/source/Irrlicht/CD3D8MaterialRenderer.h +++ /dev/null @@ -1,545 +0,0 @@ -// Copyright (C) 2002-2012 Nikolaus Gebhardt -// This file is part of the "Irrlicht Engine". -// For conditions of distribution and use, see copyright notice in irrlicht.h - -#ifndef __C_D3D8_MATERIAL_RENDERER_H_INCLUDED__ -#define __C_D3D8_MATERIAL_RENDERER_H_INCLUDED__ - -#include "IrrCompileConfig.h" -#ifdef _IRR_WINDOWS_API_ - -#ifdef _IRR_COMPILE_WITH_DIRECT3D_8_ -#include - -#include "IMaterialRenderer.h" -#include "CD3D8Driver.h" - -namespace irr -{ -namespace video -{ - -namespace -{ -D3DMATRIX UnitMatrixD3D8; -D3DMATRIX SphereMapMatrixD3D8; -inline void setTextureColorStage(IDirect3DDevice8* dev, DWORD i, - DWORD arg1, DWORD op, DWORD arg2) -{ - dev->SetTextureStageState(i, D3DTSS_COLOROP, op); - dev->SetTextureStageState(i, D3DTSS_COLORARG1, arg1); - dev->SetTextureStageState(i, D3DTSS_COLORARG2, arg2); -} -inline void setTextureColorStage(IDirect3DDevice8* dev, DWORD i, DWORD arg1) -{ - dev->SetTextureStageState(i, D3DTSS_COLOROP, D3DTOP_SELECTARG1); - dev->SetTextureStageState(i, D3DTSS_COLORARG1, arg1); -} - -inline void setTextureAlphaStage(IDirect3DDevice8* dev, DWORD i, - DWORD arg1, DWORD op, DWORD arg2) -{ - dev->SetTextureStageState(i, D3DTSS_ALPHAOP, op); - dev->SetTextureStageState(i, D3DTSS_ALPHAARG1, arg1); - dev->SetTextureStageState(i, D3DTSS_ALPHAARG2, arg2); -} -inline void setTextureAlphaStage(IDirect3DDevice8* dev, DWORD i, DWORD arg1) -{ - dev->SetTextureStageState(i, D3DTSS_ALPHAOP, D3DTOP_SELECTARG1); - dev->SetTextureStageState(i, D3DTSS_ALPHAARG1, arg1); -} -} // anonymous namespace - -//! Base class for all internal D3D8 material renderers -class CD3D8MaterialRenderer : public IMaterialRenderer -{ -public: - - //! Constructor - CD3D8MaterialRenderer(IDirect3DDevice8* d3ddev, CD3D8Driver* driver) - : pID3DDevice(d3ddev), Driver(driver) - { - } - -protected: - - IDirect3DDevice8* pID3DDevice; - CD3D8Driver* Driver; -}; - - -//! Solid material renderer -class CD3D8MaterialRenderer_SOLID : public CD3D8MaterialRenderer -{ -public: - - CD3D8MaterialRenderer_SOLID(IDirect3DDevice8* p, CD3D8Driver* d) - : CD3D8MaterialRenderer(p, d) {} - - virtual void OnSetMaterial(const SMaterial& material, const SMaterial& lastMaterial, - bool resetAllRenderstates, IMaterialRendererServices* services) _IRR_OVERRIDE_ - { - services->setBasicRenderStates(material, lastMaterial, resetAllRenderstates); - - if (material.MaterialType != lastMaterial.MaterialType || resetAllRenderstates) - { - setTextureColorStage(pID3DDevice, 0, - D3DTA_TEXTURE, D3DTOP_MODULATE, D3DTA_DIFFUSE); - } - - pID3DDevice->SetTextureStageState(1, D3DTSS_COLOROP, D3DTOP_DISABLE); - } -}; - -//! Generic Texture Blend -class CD3D8MaterialRenderer_ONETEXTURE_BLEND : public CD3D8MaterialRenderer -{ -public: - - CD3D8MaterialRenderer_ONETEXTURE_BLEND(IDirect3DDevice8* p, CD3D8Driver* d) - : CD3D8MaterialRenderer(p, d) {} - - virtual void OnSetMaterial(const SMaterial& material, const SMaterial& lastMaterial, - bool resetAllRenderstates, IMaterialRendererServices* services) _IRR_OVERRIDE_ - { - services->setBasicRenderStates(material, lastMaterial, resetAllRenderstates); - -// if (material.MaterialType != lastMaterial.MaterialType || -// material.MaterialTypeParam != lastMaterial.MaterialTypeParam || -// resetAllRenderstates) - { - - E_BLEND_FACTOR srcFact,dstFact; - E_MODULATE_FUNC modulate; - u32 alphaSource; - unpack_textureBlendFunc ( srcFact, dstFact, modulate, alphaSource, material.MaterialTypeParam ); - - Driver->getBridgeCalls()->setBlend(true); - Driver->getBridgeCalls()->setBlendFunc(Driver->getD3DBlend(srcFact), Driver->getD3DBlend(dstFact)); - - setTextureColorStage(pID3DDevice, 0, - D3DTA_TEXTURE, Driver->getD3DModulate(modulate), D3DTA_DIFFUSE); - - if ( alphaSource && (textureBlendFunc_hasAlpha ( srcFact ) || textureBlendFunc_hasAlpha ( dstFact ) )) - { - if (alphaSource==EAS_VERTEX_COLOR) - { - setTextureAlphaStage(pID3DDevice, 0, D3DTA_DIFFUSE); - } - else if (alphaSource==EAS_TEXTURE) - { - setTextureAlphaStage(pID3DDevice, 0, D3DTA_TEXTURE); - } - else - { - setTextureAlphaStage(pID3DDevice, 0, - D3DTA_TEXTURE, D3DTOP_MODULATE, D3DTA_DIFFUSE); - } - } - - pID3DDevice->SetTextureStageState(1, D3DTSS_COLOROP, D3DTOP_DISABLE); - - } - } - - virtual void OnUnsetMaterial() _IRR_OVERRIDE_ - { - Driver->getBridgeCalls()->setBlend(false); - } - - //! Returns if the material is transparent. - /** The scene management needs to know this for being able to sort the - materials by opaque and transparent. - The return value could be optimized, but we'd need to know the - MaterialTypeParam for it. */ - virtual bool isTransparent() const _IRR_OVERRIDE_ - { - return true; - } -}; - - -//! Solid 2 layer material renderer -class CD3D8MaterialRenderer_SOLID_2_LAYER : public CD3D8MaterialRenderer -{ -public: - - CD3D8MaterialRenderer_SOLID_2_LAYER(IDirect3DDevice8* p, CD3D8Driver* d) - : CD3D8MaterialRenderer(p, d) {} - - virtual void OnSetMaterial(const SMaterial& material, const SMaterial& lastMaterial, - bool resetAllRenderstates, IMaterialRendererServices* services) _IRR_OVERRIDE_ - { - services->setBasicRenderStates(material, lastMaterial, resetAllRenderstates); - - if (material.MaterialType != lastMaterial.MaterialType || resetAllRenderstates) - { - setTextureColorStage(pID3DDevice, 0, D3DTA_TEXTURE); - - pID3DDevice->SetTextureStageState(1, D3DTSS_TEXCOORDINDEX, 0); - pID3DDevice->SetTextureStageState(1, D3DTSS_COLOROP, D3DTOP_BLENDDIFFUSEALPHA); - } - } -}; - - -//! Transparent add color material renderer -class CD3D8MaterialRenderer_TRANSPARENT_ADD_COLOR : public CD3D8MaterialRenderer -{ -public: - - CD3D8MaterialRenderer_TRANSPARENT_ADD_COLOR(IDirect3DDevice8* p, CD3D8Driver* d) - : CD3D8MaterialRenderer(p, d) {} - - virtual void OnSetMaterial(const SMaterial& material, const SMaterial& lastMaterial, - bool resetAllRenderstates, IMaterialRendererServices* services) _IRR_OVERRIDE_ - { - services->setBasicRenderStates(material, lastMaterial, resetAllRenderstates); - - Driver->getBridgeCalls()->setBlend(true); - Driver->getBridgeCalls()->setBlendFunc(D3DBLEND_ONE, D3DBLEND_INVSRCCOLOR); - - if (material.MaterialType != lastMaterial.MaterialType || resetAllRenderstates) - { - setTextureColorStage(pID3DDevice, 0, - D3DTA_TEXTURE, D3DTOP_MODULATE, D3DTA_DIFFUSE); - - pID3DDevice->SetTextureStageState(1, D3DTSS_COLOROP, D3DTOP_DISABLE); - } - } - - virtual void OnUnsetMaterial() _IRR_OVERRIDE_ - { - Driver->getBridgeCalls()->setBlend(false); - } - - //! Returns if the material is transparent. The scene management needs to know this - //! for being able to sort the materials by opaque and transparent. - virtual bool isTransparent() const _IRR_OVERRIDE_ - { - return true; - } -}; - - -//! Transparent vertex alpha material renderer -class CD3D8MaterialRenderer_TRANSPARENT_VERTEX_ALPHA : public CD3D8MaterialRenderer -{ -public: - - CD3D8MaterialRenderer_TRANSPARENT_VERTEX_ALPHA(IDirect3DDevice8* p, CD3D8Driver* d) - : CD3D8MaterialRenderer(p, d) {} - - virtual void OnSetMaterial(const SMaterial& material, const SMaterial& lastMaterial, - bool resetAllRenderstates, IMaterialRendererServices* services) _IRR_OVERRIDE_ - { - services->setBasicRenderStates(material, lastMaterial, resetAllRenderstates); - - Driver->getBridgeCalls()->setBlend(true); - Driver->getBridgeCalls()->setBlendFunc(D3DBLEND_SRCALPHA, D3DBLEND_INVSRCALPHA); - - if (material.MaterialType != lastMaterial.MaterialType || resetAllRenderstates) - { - setTextureColorStage(pID3DDevice, 0, - D3DTA_TEXTURE, D3DTOP_MODULATE, D3DTA_DIFFUSE); - setTextureAlphaStage(pID3DDevice, 0, D3DTA_DIFFUSE); - - pID3DDevice->SetTextureStageState(1, D3DTSS_COLOROP, D3DTOP_DISABLE); - } - } - - virtual void OnUnsetMaterial() _IRR_OVERRIDE_ - { - Driver->getBridgeCalls()->setBlend(false); - } - - //! Returns if the material is transparent. The scene managment needs to know this - //! for being able to sort the materials by opaque and transparent. - virtual bool isTransparent() const _IRR_OVERRIDE_ - { - return true; - } -}; - - -//! Transparent alpha channel material renderer -class CD3D8MaterialRenderer_TRANSPARENT_ALPHA_CHANNEL : public CD3D8MaterialRenderer -{ -public: - - CD3D8MaterialRenderer_TRANSPARENT_ALPHA_CHANNEL(IDirect3DDevice8* p, CD3D8Driver* d) - : CD3D8MaterialRenderer(p, d) {} - - virtual void OnSetMaterial(const SMaterial& material, const SMaterial& lastMaterial, - bool resetAllRenderstates, IMaterialRendererServices* services) _IRR_OVERRIDE_ - { - services->setBasicRenderStates(material, lastMaterial, resetAllRenderstates); - - Driver->getBridgeCalls()->setBlend(true); - Driver->getBridgeCalls()->setBlendFunc(D3DBLEND_SRCALPHA, D3DBLEND_INVSRCALPHA); - - if (material.MaterialType != lastMaterial.MaterialType || resetAllRenderstates - || material.MaterialTypeParam != lastMaterial.MaterialTypeParam ) - { - setTextureColorStage(pID3DDevice, 0, - D3DTA_TEXTURE, D3DTOP_MODULATE, D3DTA_CURRENT); - setTextureAlphaStage(pID3DDevice, 0, D3DTA_TEXTURE); - - pID3DDevice->SetTextureStageState(1, D3DTSS_COLOROP, D3DTOP_DISABLE); - - pID3DDevice->SetRenderState(D3DRS_ALPHAREF, core::floor32(material.MaterialTypeParam * 255.f)); - pID3DDevice->SetRenderState(D3DRS_ALPHAFUNC, D3DCMP_GREATEREQUAL); - pID3DDevice->SetRenderState(D3DRS_ALPHATESTENABLE, TRUE); - } - } - - virtual void OnUnsetMaterial() _IRR_OVERRIDE_ - { - pID3DDevice->SetRenderState(D3DRS_ALPHATESTENABLE, FALSE); - Driver->getBridgeCalls()->setBlend(false); - } - - //! Returns if the material is transparent. The scene managment needs to know this - //! for being able to sort the materials by opaque and transparent. - virtual bool isTransparent() const _IRR_OVERRIDE_ - { - return true; - } -}; - - -//! Transparent alpha channel material renderer -class CD3D8MaterialRenderer_TRANSPARENT_ALPHA_CHANNEL_REF : public CD3D8MaterialRenderer -{ -public: - - CD3D8MaterialRenderer_TRANSPARENT_ALPHA_CHANNEL_REF(IDirect3DDevice8* p, CD3D8Driver* d) - : CD3D8MaterialRenderer(p, d) {} - - virtual void OnSetMaterial(const SMaterial& material, const SMaterial& lastMaterial, - bool resetAllRenderstates, IMaterialRendererServices* services) _IRR_OVERRIDE_ - { - services->setBasicRenderStates(material, lastMaterial, resetAllRenderstates); - - if (material.MaterialType != lastMaterial.MaterialType || resetAllRenderstates) - { - setTextureColorStage(pID3DDevice, 0, - D3DTA_TEXTURE, D3DTOP_MODULATE, D3DTA_CURRENT); - setTextureAlphaStage(pID3DDevice, 0, D3DTA_TEXTURE); - - pID3DDevice->SetTextureStageState(1, D3DTSS_COLOROP, D3DTOP_DISABLE); - - // 127 is required by EMT_TRANSPARENT_ALPHA_CHANNEL_REF - pID3DDevice->SetRenderState(D3DRS_ALPHAREF, 127); - pID3DDevice->SetRenderState(D3DRS_ALPHAFUNC, D3DCMP_GREATEREQUAL); - pID3DDevice->SetRenderState(D3DRS_ALPHATESTENABLE, TRUE); - } - } - - virtual void OnUnsetMaterial() _IRR_OVERRIDE_ - { - pID3DDevice->SetRenderState(D3DRS_ALPHATESTENABLE, FALSE); - } - - //! Returns if the material is transparent. The scene managment needs to know this - //! for being able to sort the materials by opaque and transparent. - virtual bool isTransparent() const _IRR_OVERRIDE_ - { - return false; // this material is not really transparent because it does no blending. - } -}; - - -//! material renderer for all kinds of lightmaps -class CD3D8MaterialRenderer_LIGHTMAP : public CD3D8MaterialRenderer -{ -public: - - CD3D8MaterialRenderer_LIGHTMAP(IDirect3DDevice8* p, CD3D8Driver* d) - : CD3D8MaterialRenderer(p, d) {} - - virtual void OnSetMaterial(const SMaterial& material, const SMaterial& lastMaterial, - bool resetAllRenderstates, IMaterialRendererServices* services) _IRR_OVERRIDE_ - { - services->setBasicRenderStates(material, lastMaterial, resetAllRenderstates); - - if (material.MaterialType != lastMaterial.MaterialType || resetAllRenderstates) - { - if (material.MaterialType >= EMT_LIGHTMAP_LIGHTING) - { - // with lighting - setTextureColorStage(pID3DDevice, 0, - D3DTA_TEXTURE, D3DTOP_MODULATE, D3DTA_DIFFUSE); - } - else - { - setTextureColorStage(pID3DDevice, 0, D3DTA_TEXTURE); - } - - pID3DDevice->SetTextureStageState(1, D3DTSS_TEXCOORDINDEX, 1); - - setTextureColorStage(pID3DDevice, 1, - D3DTA_TEXTURE, - (material.MaterialType == EMT_LIGHTMAP_ADD)? - D3DTOP_ADD: - (material.MaterialType == EMT_LIGHTMAP_M4 || material.MaterialType == EMT_LIGHTMAP_LIGHTING_M4)? - D3DTOP_MODULATE4X: - (material.MaterialType == EMT_LIGHTMAP_M2 || material.MaterialType == EMT_LIGHTMAP_LIGHTING_M2)? - D3DTOP_MODULATE2X: - D3DTOP_MODULATE, - D3DTA_CURRENT); - } - } -}; - - -//! material renderer for detail maps -class CD3D8MaterialRenderer_DETAIL_MAP : public CD3D8MaterialRenderer -{ -public: - - CD3D8MaterialRenderer_DETAIL_MAP(IDirect3DDevice8* p, CD3D8Driver* d) - : CD3D8MaterialRenderer(p, d) {} - - virtual void OnSetMaterial(const SMaterial& material, const SMaterial& lastMaterial, - bool resetAllRenderstates, IMaterialRendererServices* services) _IRR_OVERRIDE_ - { - services->setBasicRenderStates(material, lastMaterial, resetAllRenderstates); - - if (material.MaterialType != lastMaterial.MaterialType || resetAllRenderstates) - { - setTextureColorStage(pID3DDevice, 0, - D3DTA_TEXTURE, D3DTOP_MODULATE, D3DTA_DIFFUSE); - setTextureColorStage(pID3DDevice, 1, - D3DTA_TEXTURE, D3DTOP_ADDSIGNED, D3DTA_CURRENT); - pID3DDevice->SetTextureStageState(1, D3DTSS_TEXCOORDINDEX, 1); - } - } -}; - - -//! sphere map material renderer -class CD3D8MaterialRenderer_SPHERE_MAP : public CD3D8MaterialRenderer -{ -public: - - CD3D8MaterialRenderer_SPHERE_MAP(IDirect3DDevice8* p, CD3D8Driver* d) - : CD3D8MaterialRenderer(p, d) {} - - virtual void OnSetMaterial(const SMaterial& material, const SMaterial& lastMaterial, - bool resetAllRenderstates, IMaterialRendererServices* services) _IRR_OVERRIDE_ - { - services->setBasicRenderStates(material, lastMaterial, resetAllRenderstates); - - if (material.MaterialType != lastMaterial.MaterialType || resetAllRenderstates) - { - setTextureColorStage(pID3DDevice, 0, - D3DTA_TEXTURE, D3DTOP_MODULATE, D3DTA_DIFFUSE); - - pID3DDevice->SetTextureStageState(1, D3DTSS_COLOROP, D3DTOP_DISABLE); - - pID3DDevice->SetTransform( D3DTS_TEXTURE0, &SphereMapMatrixD3D8 ); - pID3DDevice->SetTextureStageState( 0, D3DTSS_TEXTURETRANSFORMFLAGS, D3DTTFF_COUNT2 ); - pID3DDevice->SetTextureStageState( 0, D3DTSS_TEXCOORDINDEX, D3DTSS_TCI_CAMERASPACENORMAL ); - } - } - - virtual void OnUnsetMaterial() _IRR_OVERRIDE_ - { - pID3DDevice->SetTextureStageState( 0, D3DTSS_TEXTURETRANSFORMFLAGS, D3DTTFF_DISABLE ); - pID3DDevice->SetTextureStageState( 0, D3DTSS_TEXCOORDINDEX, 0); - pID3DDevice->SetTransform( D3DTS_TEXTURE0, &UnitMatrixD3D8 ); - } -}; - - -//! reflection 2 layer material renderer -class CD3D8MaterialRenderer_REFLECTION_2_LAYER : public CD3D8MaterialRenderer -{ -public: - - CD3D8MaterialRenderer_REFLECTION_2_LAYER(IDirect3DDevice8* p, CD3D8Driver* d) - : CD3D8MaterialRenderer(p, d) {} - - virtual void OnSetMaterial(const SMaterial& material, const SMaterial& lastMaterial, - bool resetAllRenderstates, IMaterialRendererServices* services) _IRR_OVERRIDE_ - { - services->setBasicRenderStates(material, lastMaterial, resetAllRenderstates); - - if (material.MaterialType != lastMaterial.MaterialType || resetAllRenderstates) - { - setTextureColorStage(pID3DDevice, 0, - D3DTA_TEXTURE, D3DTOP_MODULATE, D3DTA_DIFFUSE); - - setTextureColorStage(pID3DDevice, 1, - D3DTA_TEXTURE, D3DTOP_MODULATE, D3DTA_CURRENT); - - pID3DDevice->SetTransform( D3DTS_TEXTURE1, &SphereMapMatrixD3D8 ); - pID3DDevice->SetTextureStageState( 1, D3DTSS_TEXTURETRANSFORMFLAGS, D3DTTFF_COUNT2 ); - pID3DDevice->SetTextureStageState( 1, D3DTSS_TEXCOORDINDEX, D3DTSS_TCI_CAMERASPACEREFLECTIONVECTOR); - } - } - - virtual void OnUnsetMaterial() _IRR_OVERRIDE_ - { - pID3DDevice->SetTextureStageState( 1, D3DTSS_TEXTURETRANSFORMFLAGS, D3DTTFF_DISABLE ); - pID3DDevice->SetTextureStageState( 1, D3DTSS_TEXCOORDINDEX, 1); - pID3DDevice->SetTransform( D3DTS_TEXTURE1, &UnitMatrixD3D8 ); - } -}; - - -//! reflection 2 layer material renderer -class CD3D8MaterialRenderer_TRANSPARENT_REFLECTION_2_LAYER : public CD3D8MaterialRenderer -{ -public: - - CD3D8MaterialRenderer_TRANSPARENT_REFLECTION_2_LAYER(IDirect3DDevice8* p, CD3D8Driver* d) - : CD3D8MaterialRenderer(p, d) {} - - virtual void OnSetMaterial(const SMaterial& material, const SMaterial& lastMaterial, - bool resetAllRenderstates, IMaterialRendererServices* services) _IRR_OVERRIDE_ - { - services->setBasicRenderStates(material, lastMaterial, resetAllRenderstates); - - Driver->getBridgeCalls()->setBlend(true); - Driver->getBridgeCalls()->setBlendFunc(D3DBLEND_SRCALPHA, D3DBLEND_INVSRCALPHA); - - if (material.MaterialType != lastMaterial.MaterialType || resetAllRenderstates) - { - setTextureColorStage(pID3DDevice, 0, - D3DTA_TEXTURE, D3DTOP_MODULATE, D3DTA_DIFFUSE); - setTextureAlphaStage(pID3DDevice, 0, D3DTA_DIFFUSE); - setTextureColorStage(pID3DDevice, 1, - D3DTA_TEXTURE, D3DTOP_MODULATE, D3DTA_CURRENT); - setTextureAlphaStage(pID3DDevice, 1, D3DTA_CURRENT); - - pID3DDevice->SetTransform(D3DTS_TEXTURE1, &SphereMapMatrixD3D8 ); - pID3DDevice->SetTextureStageState(1, D3DTSS_TEXTURETRANSFORMFLAGS, D3DTTFF_COUNT2 ); - pID3DDevice->SetTextureStageState(1, D3DTSS_TEXCOORDINDEX, D3DTSS_TCI_CAMERASPACEREFLECTIONVECTOR); - } - } - - virtual void OnUnsetMaterial() _IRR_OVERRIDE_ - { - pID3DDevice->SetTextureStageState(1, D3DTSS_TEXTURETRANSFORMFLAGS, D3DTTFF_DISABLE); - pID3DDevice->SetTextureStageState(1, D3DTSS_TEXCOORDINDEX, 1); - pID3DDevice->SetTransform(D3DTS_TEXTURE1, &UnitMatrixD3D8); - Driver->getBridgeCalls()->setBlend(false); - } - - //! Returns if the material is transparent. The scene managment needs to know this - //! for being able to sort the materials by opaque and transparent. - virtual bool isTransparent() const _IRR_OVERRIDE_ - { - return true; - } -}; - -} // end namespace video -} // end namespace irr - -#endif -#endif -#endif - diff --git a/source/Irrlicht/CD3D8NormalMapRenderer.cpp b/source/Irrlicht/CD3D8NormalMapRenderer.cpp deleted file mode 100644 index 3cfb231c..00000000 --- a/source/Irrlicht/CD3D8NormalMapRenderer.cpp +++ /dev/null @@ -1,248 +0,0 @@ -// Copyright (C) 2002-2012 Nikolaus Gebhardt -// This file is part of the "Irrlicht Engine". -// For conditions of distribution and use, see copyright notice in irrlicht.h - -#include "IrrCompileConfig.h" -#ifdef _IRR_COMPILE_WITH_DIRECT3D_8_ - -#include "CD3D8NormalMapRenderer.h" -#include "IMaterialRendererServices.h" -#include "IVideoDriver.h" -#include "os.h" -#include "SLight.h" - -namespace irr -{ -namespace video -{ - - // 1.1 Shaders with two lights and vertex based attenuation - - // Irrlicht Engine D3D8 render path normal map vertex shader - const char D3D8_NORMAL_MAP_VSH[] = - ";Irrlicht Engine 0.8 D3D8 render path normal map vertex shader\n"\ - "; c0-3: Transposed world matrix \n"\ - "; c8-11: Transposed worldViewProj matrix (Projection * View * World) \n"\ - "; c12: Light01 position \n"\ - "; c13: x,y,z: Light01 color; .w: 1/LightRadius² \n"\ - "; c14: Light02 position \n"\ - "; c15: x,y,z: Light02 color; .w: 1/LightRadius² \n"\ - "\n"\ - "; v0 - position \n"\ - "; v1 - normal \n"\ - "; v2 - color \n"\ - "; v3 - texture coord \n"\ - "; v4 - tangent \n"\ - "; v5 - binormal \n"\ - "\n"\ - "vs.1.1\n"\ - "\n"\ - "m4x4 oPos, v0, c8 ; transform position to clip space with worldViewProj matrix\n"\ - "\n"\ - "m3x3 r5, v4, c0 ; transform tangent U\n"\ - "m3x3 r7, v1, c0 ; transform normal W\n"\ - "m3x3 r6, v5, c0 ; transform binormal V\n"\ - "\n"\ - "m4x4 r4, v0, c0 ; vertex into world position\n"\ - "add r2, c12, -r4 ; vtxpos - lightpos1\n"\ - "add r3, c14, -r4 ; vtxpos - lightpos2\n"\ - "\n"\ - "dp3 r8.x, r5, r2 ; transform the light vector 1 with U, V, W\n"\ - "dp3 r8.y, r6, r2 \n"\ - "dp3 r8.z, r7, r2 \n"\ - "dp3 r9.x, r5, r3 ; transform the light vector 2 with U, V, W\n"\ - "dp3 r9.y, r6, r3 \n"\ - "dp3 r9.z, r7, r3 \n"\ - "\n"\ - "dp3 r8.w, r8, r8 ; normalize light vector 1 (r8)\n"\ - "rsq r8.w, r8.w \n"\ - "mul r8, r8, r8.w \n"\ - "dp3 r9.w, r9, r9 ; normalize light vector 2 (r9)\n"\ - "rsq r9.w, r9.w \n"\ - "mul r9, r9, r9.w \n"\ - "\n"\ - "mad oT2.xyz, r8.xyz, c95, c95 ; move light vector 1 from -1..1 into 0..1 \n"\ - "mad oT3.xyz, r9.xyz, c95, c95 ; move light vector 2 from -1..1 into 0..1 \n"\ - "\n"\ - " ; calculate attenuation of light 1 \n"\ - "dp3 r2.x, r2.xyz, r2.xyz ; r2.x = r2.x² + r2.y² + r2.z² \n"\ - "mul r2.x, r2.x, c13.w ; r2.x * attenutation \n"\ - "rsq r2, r2.x ; r2.xyzw = 1/sqrt(r2.x * attenutation)\n"\ - "mul oD0, r2, c13 ; resulting light color = lightcolor * attenuation \n"\ - "\n"\ - " ; calculate attenuation of light 2 \n"\ - "dp3 r3.x, r3.xyz, r3.xyz ; r3.x = r3.x² + r3.y² + r3.z² \n"\ - "mul r3.x, r3.x, c15.w ; r2.x * attenutation \n"\ - "rsq r3, r3.x ; r2.xyzw = 1/sqrt(r2.x * attenutation)\n"\ - "mul oD1, r3, c15 ; resulting light color = lightcolor * attenuation \n"\ - "\n"\ - "mov oT0.xy, v3.xy ; move out texture coordinates 1\n"\ - "mov oT1.xy, v3.xy ; move out texture coordinates 2\n"\ - "mov oD0.a, v2.a ; move out original alpha value \n"\ - "\n"; - - // Irrlicht Engine D3D8 render path normal map pixel shader - const char D3D8_NORMAL_MAP_PSH[] = - ";Irrlicht Engine 0.8 D3D8 render path normal map pixel shader\n"\ - ";Input: \n"\ - ";t0: color map texture coord \n"\ - ";t1: normal map texture coords \n"\ - ";t2: light 1 vector in tangent space \n"\ - ";v0: light 1 color \n"\ - ";t3: light 2 vector in tangent space \n"\ - ";v1: light 2 color \n"\ - ";v0.a: vertex alpha value \n"\ - "ps.1.1 \n"\ - "tex t0 ; sample color map \n"\ - "tex t1 ; sample normal map\n"\ - "texcoord t2 ; fetch light vector 1\n"\ - "texcoord t3 ; fetch light vector 2\n"\ - "\n"\ - "dp3_sat r0, t1_bx2, t2_bx2 ; normal dot light 1 (_bx2 because moved into 0..1)\n"\ - "mul r0, r0, v0 ; luminance1 * light color 1 \n"\ - "\n"\ - "dp3_sat r1, t1_bx2, t3_bx2 ; normal dot light 2 (_bx2 because moved into 0..1)\n"\ - "mad r0, r1, v1, r0 ; (luminance2 * light color 2) + luminance 1 \n"\ - "\n"\ - "mul r0, t0, r0 ; total luminance * base color\n"\ - "mov r0.a, v0.a ; write interpolated vertex alpha value \n"\ - "\n"\ - ""; - - CD3D8NormalMapRenderer::CD3D8NormalMapRenderer( - IDirect3DDevice8* d3ddev, video::IVideoDriver* driver, - s32& outMaterialTypeNr, IMaterialRenderer* baseMaterial) - : CD3D8ShaderMaterialRenderer(d3ddev, driver, 0, baseMaterial), - CompiledShaders(true) - { - - #ifdef _DEBUG - setDebugName("CD3D8NormalMapRenderer"); - #endif - - // set this as callback. We could have done this in - // the initialization list, but some compilers don't like it. - - CallBack = this; - - // basicly, this thing simply compiles these hardcoded shaders if the - // hardware is able to do them, otherwise it maps to the base material - - if (!driver->queryFeature(video::EVDF_PIXEL_SHADER_1_1) || - !driver->queryFeature(video::EVDF_VERTEX_SHADER_1_1)) - { - // this hardware is not able to do shaders. Fall back to - // base material. - outMaterialTypeNr = driver->addMaterialRenderer(this); - return; - } - - // check if already compiled normal map shaders are there. - - video::IMaterialRenderer* renderer = driver->getMaterialRenderer(EMT_NORMAL_MAP_SOLID); - if (renderer) - { - // use the already compiled shaders - video::CD3D8NormalMapRenderer* nmr = (video::CD3D8NormalMapRenderer*)renderer; - CompiledShaders = false; - - VertexShader = nmr->VertexShader; - PixelShader = nmr->PixelShader; - - outMaterialTypeNr = driver->addMaterialRenderer(this); - } - else - { - // compile shaders on our own - init(outMaterialTypeNr, D3D8_NORMAL_MAP_VSH, D3D8_NORMAL_MAP_PSH, EVT_TANGENTS); - } - // something failed, use base material - if (-1==outMaterialTypeNr) - driver->addMaterialRenderer(this); - } - - - CD3D8NormalMapRenderer::~CD3D8NormalMapRenderer() - { - if (CallBack == this) - CallBack = 0; - - if (!CompiledShaders) - { - // prevent this from deleting shaders we did not create - VertexShader = 0; - PixelShader = 0; - } - } - - - bool CD3D8NormalMapRenderer::OnRender(IMaterialRendererServices* service, E_VERTEX_TYPE vtxtype) - { - if (vtxtype != video::EVT_TANGENTS) - { - os::Printer::log("Error: Normal map renderer only supports vertices of type EVT_TANGENTS", ELL_ERROR); - return false; - } - - return CD3D8ShaderMaterialRenderer::OnRender(service, vtxtype); - } - - //! Returns the render capability of the material. - s32 CD3D8NormalMapRenderer::getRenderCapability() const - { - if (Driver->queryFeature(video::EVDF_PIXEL_SHADER_1_1) && - Driver->queryFeature(video::EVDF_VERTEX_SHADER_1_1)) - return 0; - - return 1; - } - - - //! Called by the engine when the vertex and/or pixel shader constants for an - //! material renderer should be set. - void CD3D8NormalMapRenderer::OnSetConstants(IMaterialRendererServices* services, s32 userData) - { - video::IVideoDriver* driver = services->getVideoDriver(); - - // set transposed world matrix - services->setVertexShaderConstant(driver->getTransform(video::ETS_WORLD).getTransposed().pointer(), 0, 4); - - // set transposed worldViewProj matrix - core::matrix4 worldViewProj(driver->getTransform(video::ETS_PROJECTION)); - worldViewProj *= driver->getTransform(video::ETS_VIEW); - worldViewProj *= driver->getTransform(video::ETS_WORLD); - services->setVertexShaderConstant(worldViewProj.getTransposed().pointer(), 8, 4); - - // here we've got to fetch the fixed function lights from the - // driver and set them as constants - - u32 cnt = driver->getDynamicLightCount(); - - for (u32 i=0; i<2; ++i) - { - SLight light; - - if (igetDynamicLight(i); - else - { - light.DiffuseColor.set(0,0,0); // make light dark - light.Radius = 1.0f; - } - - light.DiffuseColor.a = 1.0f/(light.Radius*light.Radius); // set attenuation - - services->setVertexShaderConstant(reinterpret_cast(&light.Position), 12+(i*2), 1); - services->setVertexShaderConstant(reinterpret_cast(&light.DiffuseColor), 13+(i*2), 1); - } - - f32 c95[] = {0.5f, 0.5f, 0.5f, 0.5f}; - services->setVertexShaderConstant(c95, 95, 1); - } - - -} // end namespace video -} // end namespace irr - -#endif // _IRR_COMPILE_WITH_DIRECT3D_8_ - diff --git a/source/Irrlicht/CD3D8NormalMapRenderer.h b/source/Irrlicht/CD3D8NormalMapRenderer.h deleted file mode 100644 index 33ae8d9b..00000000 --- a/source/Irrlicht/CD3D8NormalMapRenderer.h +++ /dev/null @@ -1,56 +0,0 @@ -// Copyright (C) 2002-2012 Nikolaus Gebhardt -// This file is part of the "Irrlicht Engine". -// For conditions of distribution and use, see copyright notice in irrlicht.h - -#ifndef __C_D3D8_NORMAL_MAPMATERIAL_RENDERER_H_INCLUDED__ -#define __C_D3D8_NORMAL_MAPMATERIAL_RENDERER_H_INCLUDED__ - -#include "IrrCompileConfig.h" -#ifdef _IRR_WINDOWS_API_ - -#ifdef _IRR_COMPILE_WITH_DIRECT3D_8_ -#include - -#include "CD3D8ShaderMaterialRenderer.h" -#include "IShaderConstantSetCallBack.h" - -namespace irr -{ -namespace video -{ - -//! Renderer for normal maps -class CD3D8NormalMapRenderer : public CD3D8ShaderMaterialRenderer, IShaderConstantSetCallBack -{ -public: - - CD3D8NormalMapRenderer( - IDirect3DDevice8* d3ddev, video::IVideoDriver* driver, - s32& outMaterialTypeNr, IMaterialRenderer* baseMaterial); - ~CD3D8NormalMapRenderer(); - - //! Called by the engine when the vertex and/or pixel shader constants for an - //! material renderer should be set. - virtual void OnSetConstants(IMaterialRendererServices* services, s32 userData) _IRR_OVERRIDE_; - - bool OnRender(IMaterialRendererServices* service, E_VERTEX_TYPE vtxtype); - - //! Returns the render capability of the material. - virtual s32 getRenderCapability() const _IRR_OVERRIDE_; - -private: - - //! stores if this shader compiled the shaders and is - //! allowed to delete them again. D3D8 lacks reference counting - //! support for shaders. - bool CompiledShaders; - -}; - -} // end namespace video -} // end namespace irr - -#endif -#endif -#endif - diff --git a/source/Irrlicht/CD3D8ParallaxMapRenderer.cpp b/source/Irrlicht/CD3D8ParallaxMapRenderer.cpp deleted file mode 100644 index 800cb66a..00000000 --- a/source/Irrlicht/CD3D8ParallaxMapRenderer.cpp +++ /dev/null @@ -1,318 +0,0 @@ -// Copyright (C) 2002-2012 Nikolaus Gebhardt -// This file is part of the "Irrlicht Engine". -// For conditions of distribution and use, see copyright notice in irrlicht.h - -#include "IrrCompileConfig.h" -#ifdef _IRR_COMPILE_WITH_DIRECT3D_8_ - -#include "CD3D8ParallaxMapRenderer.h" -#include "IMaterialRendererServices.h" -#include "IVideoDriver.h" -#include "os.h" -#include "SLight.h" - -namespace irr -{ -namespace video -{ - // 1.1/1.4 Shaders with two lights and vertex based attenuation - - // Irrlicht Engine D3D8 render path normal map vertex shader - const char D3D8_PARALLAX_MAP_VSH[] = - ";Irrlicht Engine 0.10 D3D8 render path parallax mapping vertex shader\n"\ - "; c0-3: Transposed world matrix \n"\ - "; c4: Eye position \n"\ - "; c8-11: Transposed worldViewProj matrix (Projection * View * World) \n"\ - "; c12: Light01 position \n"\ - "; c13: x,y,z: Light01 color; .w: 1/LightRadius² \n"\ - "; c14: Light02 position \n"\ - "; c15: x,y,z: Light02 color; .w: 1/LightRadius² \n"\ - "vs.1.1\n"\ - "; v0 ; position \n"\ - "; v1 ; normal \n"\ - "; v2 ; color \n"\ - "; v3 ; texture coord \n"\ - "; v4 ; tangent \n"\ - "; v5 ; binormal \n"\ - "\n"\ - "def c95, 0.5, 0.5, 0.5, 0.5 ; used for moving light vector to ps \n"\ - "def c96, -1, 1, 1, 1 ; somewhere I've got a bug. flipping the vectors with this fixes it. \n"\ - "\n"\ - "m4x4 oPos, v0, c8 ; transform position to clip space with worldViewProj matrix\n"\ - "\n"\ - "m3x3 r5, v4, c0 ; transform tangent U\n"\ - "m3x3 r7, v1, c0 ; transform normal W\n"\ - "m3x3 r6, v5, c0 ; transform binormal V\n"\ - "\n"\ - "m4x4 r4, v0, c0 ; vertex into world position\n"\ - "add r2, c12, -r4 ; vtxpos - light1 pos\n"\ - "add r3, c14, -r4 ; vtxpos - light2 pos\n"\ - "add r1, -c4, r4 ; eye - vtxpos \n"\ - "\n"\ - "dp3 r8.x, r5, r2 ; transform the light1 vector with U, V, W\n"\ - "dp3 r8.y, r6, r2 \n"\ - "dp3 r8.z, r7, r2 \n"\ - "dp3 r9.x, r5, r3 ; transform the light2 vector with U, V, W\n"\ - "dp3 r9.y, r6, r3 \n"\ - "dp3 r9.z, r7, r3 \n"\ - "dp3 r10.x, r5, r1 ; transform the eye vector with U, V, W\n"\ - "dp3 r10.y, r6, r1 \n"\ - "dp3 r10.z, r7, r1 \n"\ - "\n"\ - "dp3 r8.w, r8, r8 ; normalize light vector 1 (r8)\n"\ - "rsq r8.w, r8.w \n"\ - "mul r8, r8, r8.w \n"\ - ";mul r8, r8, c96 \n"\ - "dp3 r9.w, r9, r9 ; normalize light vector 2 (r9)\n"\ - "rsq r9.w, r9.w \n"\ - "mul r9, r9, r9.w \n"\ - ";mul r9, r9, c96 \n"\ - "dp3 r10.w, r10, r10 ; normalize eye vector (r10)\n"\ - "rsq r10.w, r10.w \n"\ - "mul r10, r10, r10.w \n"\ - "mul r10, r10, c96 \n"\ - "\n"\ - "\n"\ - "mad oT2.xyz, r8.xyz, c95, c95 ; move light vector 1 from -1..1 into 0..1 \n"\ - "mad oT3.xyz, r9.xyz, c95, c95 ; move light vector 2 from -1..1 into 0..1 \n"\ - "mad oT4.xyz, r10.xyz, c95, c95 ; move eye vector from -1..1 into 0..1 \n"\ - "\n"\ - " ; calculate attenuation of light 1 \n"\ - "dp3 r2.x, r2.xyz, r2.xyz ; r2.x = r2.x² + r2.y² + r2.z² \n"\ - "mul r2.x, r2.x, c13.w ; r2.x * attenutation \n"\ - "rsq r2, r2.x ; r2.xyzw = 1/sqrt(r2.x * attenutation)\n"\ - "mul oD0, r2, c13 ; resulting light color = lightcolor * attenuation \n"\ - "\n"\ - " ; calculate attenuation of light 2 \n"\ - "dp3 r3.x, r3.xyz, r3.xyz ; r3.x = r3.x² + r3.y² + r3.z² \n"\ - "mul r3.x, r3.x, c15.w ; r2.x * attenutation \n"\ - "rsq r3, r3.x ; r2.xyzw = 1/sqrt(r2.x * attenutation)\n"\ - "mul oD1, r3, c15 ; resulting light color = lightcolor * attenuation \n"\ - "\n"\ - "mov oT0.xy, v3.xy ; move out texture coordinates 1\n"\ - "mov oT1.xy, v3.xy ; move out texture coordinates 2\n"\ - "mov oD0.a, v2.a ; move out original alpha value \n"\ - "\n"; - - - // Irrlicht Engine D3D8 render path normal map pixel shader version 1.4 - const char D3D8_PARALLAX_MAP_PSH[] = - ";Irrlicht Engine 0.10 D3D8 render path parallax mapping pixel shader \n"\ - ";Input: \n"\ - ";t0: color map texture coord \n"\ - ";t1: normal map texture coords \n"\ - ";t2: light 1 vector in tangent space \n"\ - ";t4: eye vector in tangent space \n"\ - ";v0: light 1 color \n"\ - ";t3: light 2 vector in tangent space \n"\ - ";v1: light 2 color \n"\ - ";v0.a: vertex alpha value \n"\ - " \n"\ - "ps.1.4 \n"\ - " \n"\ - ";def c6, 0.02f, 0.02f, 0.02f, 0.0f ; scale factor, now set in callback \n"\ - " \n"\ - "texld r1, t1 ; sample (normal.x, normal.y, normal.z, height) \n"\ - "texcrd r4.xyz, t4 ; fetch eye vector \n"\ - "texcrd r0.xyz, t0 ; color map \n"\ - " \n"\ - "; original parallax mapping: \n"\ - ";mul r3, r1_bx2.wwww, c6; ; r3 = (height, height, height) * scale \n"\ - ";mad r2.xyz, r3, r4_bx2, r0 ; newTexCoord = height * eye + oldTexCoord \n"\ - " \n"\ - "; modified parallax mapping to reduce swimming effect: \n"\ - "mul r3, r1_bx2.wwww, r1_bx2.zzzz ; (nh,nh,nh,nh) = (h,h,h,h) * (n.z,n.z,n.z,n.z,) \n"\ - "mul r3, r3, c6; ; r3 = (nh, nh, nh) * scale \n"\ - "mad r2.xyz, r3, r4_bx2, r0 ; newTexCoord = height * eye + oldTexCoord \n"\ - " \n"\ - "phase \n"\ - " \n"\ - "texld r0, r2 ; load diffuse texture with new tex coord \n"\ - "texld r1, r2 ; sample normal map \n"\ - "texcrd r2.xyz, t2 ; fetch light vector 1 \n"\ - "texcrd r3.xyz, t3 ; fetch light vector 2 \n"\ - " \n"\ - "dp3_sat r2, r1_bx2, r2_bx2 ; normal dot light 1 (_bx2 because moved into 0..1) \n"\ - "mul r2, r2, v0 ; luminance1 * light color 1 \n"\ - " \n"\ - "dp3_sat r3, r1_bx2, r3_bx2 ; normal dot light 2 (_bx2 because moved into 0..1) \n"\ - "mad r3, r3, v1, r2 ; (luminance2 * light color 2) + luminance1 \n"\ - " \n"\ - "mul r0.xyz, r0, r3 ; total luminance * base color \n"\ - "+mov r0.a, v0.a ; write original alpha value \n"\ - "\n"; - - - CD3D8ParallaxMapRenderer::CD3D8ParallaxMapRenderer( - IDirect3DDevice8* d3ddev, video::IVideoDriver* driver, - s32& outMaterialTypeNr, IMaterialRenderer* baseMaterial) - : CD3D8ShaderMaterialRenderer(d3ddev, driver, 0, baseMaterial), - CompiledShaders(true), CurrentScale(0.0f) - { - - #ifdef _DEBUG - setDebugName("CD3D8ParallaxMapRenderer"); - #endif - - // set this as callback. We could have done this in - // the initialization list, but some compilers don't like it. - - CallBack = this; - - // basicly, this thing simply compiles these hardcoded shaders if the - // hardware is able to do them, otherwise it maps to the base material - - if (!driver->queryFeature(video::EVDF_PIXEL_SHADER_1_4) || - !driver->queryFeature(video::EVDF_VERTEX_SHADER_1_1)) - { - // this hardware is not able to do shaders. Fall back to - // base material. - outMaterialTypeNr = driver->addMaterialRenderer(this); - return; - } - - // check if already compiled parallax map shaders are there. - - video::IMaterialRenderer* renderer = driver->getMaterialRenderer(EMT_PARALLAX_MAP_SOLID); - if (renderer) - { - // use the already compiled shaders - video::CD3D8ParallaxMapRenderer* nmr = (video::CD3D8ParallaxMapRenderer*)renderer; - CompiledShaders = false; - - VertexShader = nmr->VertexShader; - PixelShader = nmr->PixelShader; - - outMaterialTypeNr = driver->addMaterialRenderer(this); - } - else - { - // compile shaders on our own - init(outMaterialTypeNr, D3D8_PARALLAX_MAP_VSH, D3D8_PARALLAX_MAP_PSH, EVT_TANGENTS); - } - // something failed, use base material - if (-1==outMaterialTypeNr) - driver->addMaterialRenderer(this); - } - - - CD3D8ParallaxMapRenderer::~CD3D8ParallaxMapRenderer() - { - if (CallBack == this) - CallBack = 0; - - if (!CompiledShaders) - { - // prevent this from deleting shaders we did not create - VertexShader = 0; - PixelShader = 0; - } - } - - - bool CD3D8ParallaxMapRenderer::OnRender(IMaterialRendererServices* service, E_VERTEX_TYPE vtxtype) - { - if (vtxtype != video::EVT_TANGENTS) - { - os::Printer::log("Error: Normal map renderer only supports vertices of type EVT_TANGENTS", ELL_ERROR); - return false; - } - - return CD3D8ShaderMaterialRenderer::OnRender(service, vtxtype); - } - - - void CD3D8ParallaxMapRenderer::OnSetMaterial(const video::SMaterial& material, - const video::SMaterial& lastMaterial, - bool resetAllRenderstates, video::IMaterialRendererServices* services) - { - CD3D8ShaderMaterialRenderer::OnSetMaterial(material, lastMaterial, - resetAllRenderstates, services); - - CurrentScale = material.MaterialTypeParam; - } - - - //! Returns the render capability of the material. - s32 CD3D8ParallaxMapRenderer::getRenderCapability() const - { - if (Driver->queryFeature(video::EVDF_PIXEL_SHADER_1_4) && - Driver->queryFeature(video::EVDF_VERTEX_SHADER_1_1)) - return 0; - - return 1; - } - - - //! Called by the engine when the vertex and/or pixel shader constants - //! for an material renderer should be set. - void CD3D8ParallaxMapRenderer::OnSetConstants(IMaterialRendererServices* services, s32 userData) - { - video::IVideoDriver* driver = services->getVideoDriver(); - - // set transposed world matrix - services->setVertexShaderConstant(driver->getTransform(video::ETS_WORLD).getTransposed().pointer(), 0, 4); - - // set eye position - - // The viewpoint is at (0., 0., 0.) in eye space. - // Turning this into a vector [0 0 0 1] and multiply it by - // the inverse of the view matrix, the resulting vector is the - // object space location of the camera. - - f32 floats[4] = {0,0,0,1}; - core::matrix4 minv(driver->getTransform(video::ETS_VIEW)); - minv.makeInverse(); - minv.multiplyWith1x4Matrix(floats); - services->setVertexShaderConstant(floats, 4, 1); - - // set transposed worldViewProj matrix - core::matrix4 worldViewProj(driver->getTransform(video::ETS_PROJECTION)); - worldViewProj *= driver->getTransform(video::ETS_VIEW); - worldViewProj *= driver->getTransform(video::ETS_WORLD); - services->setVertexShaderConstant(worldViewProj.getTransposed().pointer(), 8, 4); - - // here we've got to fetch the fixed function lights from the driver - // and set them as constants - - const u32 cnt = driver->getDynamicLightCount(); - - for (u32 i=0; i<2; ++i) - { - SLight light; - - if (igetDynamicLight(i); - else - { - light.DiffuseColor.set(0,0,0); // make light dark - light.Radius = 1.0f; - } - - light.DiffuseColor.a = 1.0f/(light.Radius*light.Radius); // set attenuation - - services->setVertexShaderConstant(reinterpret_cast(&light.Position), 12+(i*2), 1); - services->setVertexShaderConstant(reinterpret_cast(&light.DiffuseColor), 13+(i*2), 1); - } - - // this is not really necessary in d3d9 (used a def instruction), but to be sure: - f32 c95[] = {0.5f, 0.5f, 0.5f, 0.5f}; - services->setVertexShaderConstant(c95, 95, 1); - f32 c96[] = {-1, 1, 1, 1}; - services->setVertexShaderConstant(c96, 96, 1); - - // set scale factor - f32 factor = 0.02f; // default value - if (CurrentScale != 0) - factor = CurrentScale; - - f32 c6[] = {factor, factor, factor, 0}; - services->setPixelShaderConstant(c6, 6, 1); - } - - -} // end namespace video -} // end namespace irr - -#endif // _IRR_COMPILE_WITH_DIRECT3D_8_ - diff --git a/source/Irrlicht/CD3D8ParallaxMapRenderer.h b/source/Irrlicht/CD3D8ParallaxMapRenderer.h deleted file mode 100644 index 0d28db57..00000000 --- a/source/Irrlicht/CD3D8ParallaxMapRenderer.h +++ /dev/null @@ -1,62 +0,0 @@ -// Copyright (C) 2002-2012 Nikolaus Gebhardt -// This file is part of the "Irrlicht Engine". -// For conditions of distribution and use, see copyright notice in irrlicht.h - -#ifndef __C_D3D8_PARALLAX_MAPMATERIAL_RENDERER_H_INCLUDED__ -#define __C_D3D8_PARALLAX_MAPMATERIAL_RENDERER_H_INCLUDED__ - -#include "IrrCompileConfig.h" -#ifdef _IRR_WINDOWS_API_ - -#ifdef _IRR_COMPILE_WITH_DIRECT3D_8_ -#include - -#include "CD3D8ShaderMaterialRenderer.h" -#include "IShaderConstantSetCallBack.h" - -namespace irr -{ -namespace video -{ - -//! Renderer for parallax maps -class CD3D8ParallaxMapRenderer : public CD3D8ShaderMaterialRenderer, IShaderConstantSetCallBack -{ -public: - - CD3D8ParallaxMapRenderer( - IDirect3DDevice8* d3ddev, video::IVideoDriver* driver, - s32& outMaterialTypeNr, IMaterialRenderer* baseMaterial); - ~CD3D8ParallaxMapRenderer(); - - //! Called by the engine when the vertex and/or pixel shader constants for an - //! material renderer should be set. - virtual void OnSetConstants(IMaterialRendererServices* services, s32 userData) _IRR_OVERRIDE_; - - virtual bool OnRender(IMaterialRendererServices* service, E_VERTEX_TYPE vtxtype) _IRR_OVERRIDE_; - - virtual void OnSetMaterial(const SMaterial& material) _IRR_OVERRIDE_ { } - virtual void OnSetMaterial(const video::SMaterial& material, - const video::SMaterial& lastMaterial, - bool resetAllRenderstates, video::IMaterialRendererServices* services) _IRR_OVERRIDE_; - - //! Returns the render capability of the material. - virtual s32 getRenderCapability() const _IRR_OVERRIDE_; - -private: - - //! stores if this shader compiled the shaders and is - //! allowed to delete them again. D3D8 lacks reference counting - //! support for shaders. - bool CompiledShaders; - - f32 CurrentScale; -}; - -} // end namespace video -} // end namespace irr - -#endif -#endif -#endif - diff --git a/source/Irrlicht/CD3D8ShaderMaterialRenderer.cpp b/source/Irrlicht/CD3D8ShaderMaterialRenderer.cpp deleted file mode 100644 index 8fe85f62..00000000 --- a/source/Irrlicht/CD3D8ShaderMaterialRenderer.cpp +++ /dev/null @@ -1,331 +0,0 @@ -// Copyright (C) 2002-2012 Nikolaus Gebhardt -// This file is part of the "Irrlicht Engine". -// For conditions of distribution and use, see copyright notice in irrlicht.h - -#include "CD3D8ShaderMaterialRenderer.h" - -#include "IrrCompileConfig.h" -#ifdef _IRR_COMPILE_WITH_DIRECT3D_8_ -#include -#include -#pragma comment (lib, "d3dx8.lib") - -#include "IShaderConstantSetCallBack.h" -#include "IMaterialRendererServices.h" -#include "IVideoDriver.h" -#include "os.h" - -#ifndef _IRR_D3D_NO_SHADER_DEBUGGING -#include -#endif - -namespace irr -{ -namespace video -{ - -//! Public constructor -CD3D8ShaderMaterialRenderer::CD3D8ShaderMaterialRenderer(IDirect3DDevice8* d3ddev, video::IVideoDriver* driver, - s32& outMaterialTypeNr, const c8* vertexShaderProgram, const c8* pixelShaderProgram, - IShaderConstantSetCallBack* callback, IMaterialRenderer* baseMaterial, s32 userData) -: pID3DDevice(d3ddev), Driver(driver), CallBack(callback), BaseMaterial(baseMaterial), - VertexShader(0), OldVertexShader(0), PixelShader(0), UserData(userData) -{ - - #ifdef _DEBUG - setDebugName("CD3D8ShaderMaterialRenderer"); - #endif - - if (BaseMaterial) - BaseMaterial->grab(); - - if (CallBack) - CallBack->grab(); - - init(outMaterialTypeNr, vertexShaderProgram, pixelShaderProgram, EVT_STANDARD); -} - -//! constructor only for use by derived classes who want to -//! create a fall back material for example. -CD3D8ShaderMaterialRenderer::CD3D8ShaderMaterialRenderer(IDirect3DDevice8* d3ddev, - video::IVideoDriver* driver, - IShaderConstantSetCallBack* callback, - IMaterialRenderer* baseMaterial, - s32 userData) -: pID3DDevice(d3ddev), Driver(driver), BaseMaterial(baseMaterial), CallBack(callback), - VertexShader(0), PixelShader(0), UserData(userData) -{ - if (BaseMaterial) - BaseMaterial->grab(); - - if (CallBack) - CallBack->grab(); -} - - - -//! Destructor -CD3D8ShaderMaterialRenderer::~CD3D8ShaderMaterialRenderer() -{ - if (CallBack) - CallBack->drop(); - - if (VertexShader) - pID3DDevice->DeleteVertexShader(VertexShader); - - if (PixelShader) - pID3DDevice->DeletePixelShader(PixelShader); - - if (BaseMaterial) - BaseMaterial->drop (); -} - - -void CD3D8ShaderMaterialRenderer::init(s32& outMaterialTypeNr, const c8* vertexShaderProgram, - const c8* pixelShaderProgram, E_VERTEX_TYPE type) -{ - outMaterialTypeNr = -1; - - // create vertex shader - if (!createVertexShader(vertexShaderProgram, type)) - return; - - // create pixel shader - if (!createPixelShader(pixelShaderProgram)) - return; - - // register myself as new material - outMaterialTypeNr = Driver->addMaterialRenderer(this); -} - - -bool CD3D8ShaderMaterialRenderer::OnRender(IMaterialRendererServices* service, E_VERTEX_TYPE vtxtype) -{ - // call callback to set shader constants - if (CallBack && (VertexShader || PixelShader)) - CallBack->OnSetConstants(service, UserData); - - return true; -} - - -void CD3D8ShaderMaterialRenderer::OnSetMaterial(const video::SMaterial& material, const video::SMaterial& lastMaterial, - bool resetAllRenderstates, video::IMaterialRendererServices* services) -{ - if (material.MaterialType != lastMaterial.MaterialType || resetAllRenderstates) - { - if (VertexShader) - { - // We do not need to save and reset the old vertex shader, because - // in D3D8, this is mixed up with the fvf, and this is set by the driver - // every time. - //pID3DDevice->GetVertexShader(&OldVertexShader); - - // set new vertex shader - if (FAILED(pID3DDevice->SetVertexShader(VertexShader))) - os::Printer::log("Could not set vertex shader.", ELL_ERROR); - } - - // set new pixel shader - if (PixelShader) - { - if (FAILED(pID3DDevice->SetPixelShader(PixelShader))) - os::Printer::log("Could not set pixel shader.", ELL_ERROR); - } - } - - services->setBasicRenderStates(material, lastMaterial, resetAllRenderstates); - - if (BaseMaterial) - BaseMaterial->OnSetMaterial(material, lastMaterial, resetAllRenderstates, services); - - if (CallBack) - CallBack->OnSetMaterial(material); -} - -void CD3D8ShaderMaterialRenderer::OnUnsetMaterial() -{ - // We do not need to save and reset the old vertex shader, because - // in D3D8, this is mixed up with the fvf, and this is set by the driver - // every time. - // if (VertexShader) - // pID3DDevice->SetVertexShader(OldVertexShader); - - if (PixelShader) - pID3DDevice->SetPixelShader(0); - - if (BaseMaterial) - BaseMaterial->OnUnsetMaterial(); -} - - -//! Returns if the material is transparent. The scene managment needs to know this -//! for being able to sort the materials by opaque and transparent. -bool CD3D8ShaderMaterialRenderer::isTransparent() const -{ - return BaseMaterial ? BaseMaterial->isTransparent() : false; -} - -bool CD3D8ShaderMaterialRenderer::createPixelShader(const c8* pxsh) -{ - if (!pxsh) - return true; - -#if defined( _IRR_XBOX_PLATFORM_) - return false; -#else - // compile shader - - LPD3DXBUFFER code = 0; - LPD3DXBUFFER errors = 0; - - #ifdef _IRR_D3D_NO_SHADER_DEBUGGING - - // compile shader without debug info - D3DXAssembleShader(pxsh, (UINT)strlen(pxsh), 0, 0, &code, &errors); - - #else - - // compile shader and emitt some debug informations to - // make it possible to debug the shader in visual studio - - static int irr_dbg_file_nr = 0; - ++irr_dbg_file_nr; - char tmp[32]; - sprintf(tmp, "irr_d3d8_dbg_shader_%d.psh", irr_dbg_file_nr); - - FILE* f = fopen(tmp, "wb"); - fwrite(pxsh, strlen(pxsh), 1, f); - fflush(f); - fclose(f); - - D3DXAssembleShaderFromFile(tmp, D3DXASM_DEBUG, 0, &code, &errors); - #endif - if (errors) - { - // print out compilation errors. - os::Printer::log("Pixel shader compilation failed:", ELL_ERROR); - os::Printer::log((c8*)errors->GetBufferPointer(), ELL_ERROR); - - if (code) - code->Release(); - - errors->Release(); - return false; - } - - if (FAILED(pID3DDevice->CreatePixelShader((DWORD*)code->GetBufferPointer(), &PixelShader))) - { - os::Printer::log("Could not create pixel shader.", ELL_ERROR); - code->Release(); - return false; - } - - code->Release(); - return true; -#endif - -} - - - -bool CD3D8ShaderMaterialRenderer::createVertexShader(const char* vtxsh, E_VERTEX_TYPE type) -{ - if (!vtxsh) - return true; - - // compile shader -#if defined( _IRR_XBOX_PLATFORM_) - return false; -#else - - LPD3DXBUFFER code = 0; - LPD3DXBUFFER errors = 0; - - #ifdef _IRR_D3D_NO_SHADER_DEBUGGING - - // compile shader without debug info - D3DXAssembleShader(vtxsh, (UINT)strlen(vtxsh), 0, 0, &code, &errors); - - #else - - // compile shader and emitt some debug informations to - // make it possible to debug the shader in visual studio - static int irr_dbg_file_nr = 0; - ++irr_dbg_file_nr; - char tmp[32]; - sprintf(tmp, "irr_d3d8_dbg_shader_%d.vsh", irr_dbg_file_nr); - - FILE* f = fopen(tmp, "wb"); - fwrite(vtxsh, strlen(vtxsh), 1, f); - fflush(f); - fclose(f); - - D3DXAssembleShaderFromFile(tmp, D3DXASM_DEBUG, 0, &code, &errors); - - #endif - - - if (errors) - { - // print out compilation errors. - os::Printer::log("Vertex shader compilation failed:", ELL_ERROR); - os::Printer::log((c8*)errors->GetBufferPointer(), ELL_ERROR); - - if (code) - code->Release(); - - errors->Release(); - return false; - } - - DWORD* decl = 0; - - DWORD dwStdDecl[] = - { - D3DVSD_STREAM(0), - D3DVSD_REG(0, D3DVSDT_FLOAT3), // position 0 - D3DVSD_REG(1, D3DVSDT_FLOAT3), // normal 1 - D3DVSD_REG(2, D3DVSDT_D3DCOLOR ),// color 2 - D3DVSD_REG(3, D3DVSDT_FLOAT2 ), // tex1 3 - D3DVSD_REG(4, D3DVSDT_FLOAT2 ), // tex2 4 - D3DVSD_END() - }; - - DWORD dwTngtDecl[] = - { - D3DVSD_STREAM(0), - D3DVSD_REG(0 , D3DVSDT_FLOAT3), // position 0 - D3DVSD_REG(1 , D3DVSDT_FLOAT3), // normal 1 - D3DVSD_REG(2 , D3DVSDT_D3DCOLOR ),// color 2 - D3DVSD_REG(3 , D3DVSDT_FLOAT2 ), // tex1 3 - D3DVSD_REG(4, D3DVSDT_FLOAT3 ), // tangent 4 - D3DVSD_REG(5, D3DVSDT_FLOAT3 ), // binormal 5 - D3DVSD_END() - }; - - if (type == EVT_TANGENTS) - decl = dwTngtDecl; - else - decl = dwStdDecl; - - if (FAILED(pID3DDevice->CreateVertexShader(decl, - (DWORD*)code->GetBufferPointer(), &VertexShader, 0))) - { - os::Printer::log("Could not create vertex shader.", ELL_ERROR); - code->Release(); - return false; - } - - code->Release(); - return true; -#endif -} - - - -} // end namespace video -} // end namespace irr - -#endif // _IRR_COMPILE_WITH_DIRECT3D_8_ - diff --git a/source/Irrlicht/CD3D8ShaderMaterialRenderer.h b/source/Irrlicht/CD3D8ShaderMaterialRenderer.h deleted file mode 100644 index f3a579fb..00000000 --- a/source/Irrlicht/CD3D8ShaderMaterialRenderer.h +++ /dev/null @@ -1,82 +0,0 @@ -// Copyright (C) 2002-2012 Nikolaus Gebhardt -// This file is part of the "Irrlicht Engine". -// For conditions of distribution and use, see copyright notice in irrlicht.h - -#ifndef __C_D3D8_SHADER_MATERIAL_RENDERER_H_INCLUDED__ -#define __C_D3D8_SHADER_MATERIAL_RENDERER_H_INCLUDED__ - -#include "IrrCompileConfig.h" -#ifdef _IRR_WINDOWS_API_ - -#ifdef _IRR_COMPILE_WITH_DIRECT3D_8_ -#include -#include - -#include "IMaterialRenderer.h" -#include "S3DVertex.h" - -namespace irr -{ -namespace video -{ - -class IVideoDriver; -class IShaderConstantSetCallBack; -class IMaterialRenderer; - -//! Class for using vertex and pixel shaders with D3D8 -class CD3D8ShaderMaterialRenderer : public IMaterialRenderer -{ -public: - - //! Public constructor - CD3D8ShaderMaterialRenderer(IDirect3DDevice8* d3ddev, video::IVideoDriver* driver, - s32& outMaterialTypeNr, const c8* vertexShaderProgram, const c8* pixelShaderProgram, - IShaderConstantSetCallBack* callback, IMaterialRenderer* baseMaterial, s32 userData); - - //! Destructor - ~CD3D8ShaderMaterialRenderer(); - - virtual void OnSetMaterial(const video::SMaterial& material, const video::SMaterial& lastMaterial, - bool resetAllRenderstates, video::IMaterialRendererServices* services) _IRR_OVERRIDE_; - - virtual void OnUnsetMaterial() _IRR_OVERRIDE_; - - virtual bool OnRender(IMaterialRendererServices* service, E_VERTEX_TYPE vtxtype) _IRR_OVERRIDE_; - - //! Returns if the material is transparent. - virtual bool isTransparent() const _IRR_OVERRIDE_; - -protected: - - //! constructor only for use by derived classes who want to - //! create a fall back material for example. - CD3D8ShaderMaterialRenderer(IDirect3DDevice8* d3ddev, - video::IVideoDriver* driver, - IShaderConstantSetCallBack* callback, - IMaterialRenderer* baseMaterial, s32 userData=0); - - void init(s32& outMaterialTypeNr, const c8* vertexShaderProgram, const c8* pixelShaderProgram, - E_VERTEX_TYPE type); - bool createPixelShader(const c8* pxsh); - bool createVertexShader(const char* vtxsh, E_VERTEX_TYPE type); - - IDirect3DDevice8* pID3DDevice; - video::IVideoDriver* Driver; - IShaderConstantSetCallBack* CallBack; - IMaterialRenderer* BaseMaterial; - - DWORD VertexShader; - DWORD OldVertexShader; - DWORD PixelShader; - s32 UserData; -}; - - -} // end namespace video -} // end namespace irr - -#endif -#endif -#endif - diff --git a/source/Irrlicht/CD3D8Texture.cpp b/source/Irrlicht/CD3D8Texture.cpp deleted file mode 100644 index 25ee12d5..00000000 --- a/source/Irrlicht/CD3D8Texture.cpp +++ /dev/null @@ -1,670 +0,0 @@ -// Copyright (C) 2002-2012 Nikolaus Gebhardt -// This file is part of the "Irrlicht Engine". -// For conditions of distribution and use, see copyright notice in irrlicht.h - -#include "IrrCompileConfig.h" -#ifdef _IRR_COMPILE_WITH_DIRECT3D_8_ - -#define _IRR_DONT_DO_MEMORY_DEBUGGING_HERE -#include "CD3D8Texture.h" -#include "CD3D8Driver.h" -#include "os.h" - - -#ifndef _IRR_COMPILE_WITH_DIRECT3D_9_ -// The D3DXFilterTexture function seems to get linked wrong when -// compiling with both D3D8 and 9, causing it not to work in the D3D9 device. -// So mipmapgeneration is replaced with my own bad generation in d3d 8 when -// compiling with both D3D 8 and 9. -//#define _IRR_USE_D3DXFilterTexture_ -#endif // _IRR_COMPILE_WITH_DIRECT3D_9_ - -#include - -#ifdef _IRR_USE_D3DXFilterTexture_ -#pragma comment (lib, "d3dx8.lib") -#endif // _IRR_USE_D3DXFilterTexture_ - -namespace irr -{ -namespace video -{ - -//! rendertarget constructor -CD3D8Texture::CD3D8Texture(CD3D8Driver* driver, const core::dimension2d& size, const io::path& name) -: ITexture(name), Texture(0), RTTSurface(0), Driver(driver), - TextureSize(size), ImageSize(size), Pitch(0), - HasMipMaps(false), IsRenderTarget(true) -{ - #ifdef _DEBUG - setDebugName("CD3D8Texture"); - #endif - - Device=driver->getExposedVideoData().D3D8.D3DDev8; - if (Device) - Device->AddRef(); - - createRenderTarget(); -} - - -//! constructor -CD3D8Texture::CD3D8Texture(IImage* image, CD3D8Driver* driver, - u32 flags, const io::path& name, void* mipmapData) -: ITexture(name), Texture(0), RTTSurface(0), Driver(driver), -TextureSize(0,0), ImageSize(0,0), Pitch(0), -HasMipMaps(false), IsRenderTarget(false) -{ - #ifdef _DEBUG - setDebugName("CD3D8Texture"); - #endif - - HasMipMaps = Driver->getTextureCreationFlag(video::ETCF_CREATE_MIP_MAPS); - - Device=driver->getExposedVideoData().D3D8.D3DDev8; - if (Device) - Device->AddRef(); - - if (createTexture(flags, image)) - { - if (copyTexture(image)) - { - regenerateMipMapLevels(mipmapData); - } - } - else - os::Printer::log("Could not create DIRECT3D8 Texture.", ELL_WARNING); -} - - -//! destructor -CD3D8Texture::~CD3D8Texture() -{ - if (Texture) - Texture->Release(); - - if (RTTSurface) - RTTSurface->Release(); - - if (Device) - Device->Release(); -} - - -//! creates the hardware texture -bool CD3D8Texture::createTexture(u32 flags, video::IImage* image) -{ - ImageSize = image->getDimension(); - - core::dimension2d optSize = ImageSize.getOptimalSize(!Driver->queryFeature(EVDF_TEXTURE_NPOT), !Driver->queryFeature(EVDF_TEXTURE_NSQUARE), true, Driver->Caps.MaxTextureWidth); - - D3DFORMAT format = D3DFMT_A1R5G5B5; - switch(getTextureFormatFromFlags(flags)) - { - case ETCF_ALWAYS_16_BIT: - format = D3DFMT_A1R5G5B5; break; - case ETCF_ALWAYS_32_BIT: - format = D3DFMT_A8R8G8B8; break; - case ETCF_OPTIMIZED_FOR_QUALITY: - { - switch(image->getColorFormat()) - { - case ECF_R8G8B8: - case ECF_A8R8G8B8: - format = D3DFMT_A8R8G8B8; break; - case ECF_A1R5G5B5: - case ECF_R5G6B5: - format = D3DFMT_A1R5G5B5; break; - } - } - break; - case ETCF_OPTIMIZED_FOR_SPEED: - format = D3DFMT_A1R5G5B5; break; - } - - if (Driver->getTextureCreationFlag(video::ETCF_NO_ALPHA_CHANNEL)) - { - if (format == D3DFMT_A8R8G8B8) - -#ifdef _IRR_XBOX_PLATFORM_ - format = D3DFMT_X8R8G8B8; -#else - format = D3DFMT_R8G8B8; -#endif - - else if (format == D3DFMT_A1R5G5B5) - format = D3DFMT_R5G6B5; - } - - const bool mipmaps = Driver->getTextureCreationFlag(video::ETCF_CREATE_MIP_MAPS); - - HRESULT hr = Device->CreateTexture(optSize.Width, optSize.Height, - mipmaps ? 0 : 1, // number of mipmaplevels (0 = automatic all) - 0, format, D3DPOOL_MANAGED, &Texture); - - if (FAILED(hr)) - { - // try brute force 16 bit - if (format == D3DFMT_A8R8G8B8) - format = D3DFMT_A1R5G5B5; -#ifdef _IRR_XBOX_PLATFORM_ - else if (format == D3DFMT_X8R8G8B8) - format = D3DFMT_R5G6B5; -#else - else if (format == D3DFMT_R8G8B8) - format = D3DFMT_R5G6B5; -#endif - else - return false; - - hr = Device->CreateTexture(optSize.Width, optSize.Height, - mipmaps ? 0 : 1, // number of mipmaplevels (0 = automatic all) - 0, format, D3DPOOL_MANAGED, &Texture); - } - - ColorFormat = getColorFormatFromD3DFormat(format); - return (SUCCEEDED(hr)); -} - - -//! copies the image to the texture -bool CD3D8Texture::copyTexture(video::IImage* image) -{ - if (Texture && image) - { - D3DSURFACE_DESC desc; - Texture->GetLevelDesc(0, &desc); - - TextureSize.Width = desc.Width; - TextureSize.Height = desc.Height; - - D3DLOCKED_RECT rect; - HRESULT hr = Texture->LockRect(0, &rect, 0, 0); - if (FAILED(hr)) - { - os::Printer::log("Could not lock D3D8 Texture.", ELL_ERROR); - return false; - } - - Pitch = rect.Pitch; - image->copyToScaling(rect.pBits, TextureSize.Width, TextureSize.Height, ColorFormat, Pitch); - - hr = Texture->UnlockRect(0); - if (FAILED(hr)) - { - os::Printer::log("Could not unlock D3D8 Texture.", ELL_ERROR); - return false; - } - } - - return true; -} - - -//! lock function -void* CD3D8Texture::lock(E_TEXTURE_LOCK_MODE mode, u32 mipmapLevel) -{ - if (!Texture) - return 0; - - MipLevelLocked=mipmapLevel; - HRESULT hr; - D3DLOCKED_RECT rect; - if(!IsRenderTarget) - { - hr = Texture->LockRect(mipmapLevel, &rect, 0, (mode==ETLM_READ_ONLY)?D3DLOCK_READONLY:0); - if (FAILED(hr)) - { - os::Printer::log("Could not lock DIRECT3D9 Texture.", ELL_ERROR); - return 0; - } - } - else - { - if (!RTTSurface) - { - // Make RTT surface large enough for all miplevels (including 0) - D3DSURFACE_DESC desc; - Texture->GetLevelDesc(0, &desc); - hr = Device->CreateImageSurface(desc.Width, desc.Height, desc.Format, &RTTSurface); - if (FAILED(hr)) - { - os::Printer::log("Could not lock DIRECT3D8 Texture.", ELL_ERROR); - return 0; - } - } - - IDirect3DSurface8 *surface = 0; - hr = Texture->GetSurfaceLevel(mipmapLevel, &surface); - if (FAILED(hr)) - { - os::Printer::log("Could not lock DIRECT3D8 Texture.", "Could not get surface.", ELL_ERROR); - return 0; - } - hr = Device->CopyRects(surface, 0, 0, RTTSurface, 0); - surface->Release(); - if(FAILED(hr)) - { - os::Printer::log("Could not lock DIRECT3D8 Texture.", "Data copy failed.", ELL_ERROR); - return 0; - } - hr = RTTSurface->LockRect(&rect, 0, (mode==ETLM_READ_ONLY)?D3DLOCK_READONLY:0); - if(FAILED(hr)) - { - os::Printer::log("Could not lock DIRECT3D8 Texture.", "LockRect failed.", ELL_ERROR); - return 0; - } - } - return rect.pBits; -} - - -//! unlock function -void CD3D8Texture::unlock() -{ - if (!Texture) - return; - - if (!IsRenderTarget) - Texture->UnlockRect(MipLevelLocked); - else if (RTTSurface) - RTTSurface->UnlockRect(); -} - - -//! Returns original size of the texture. -const core::dimension2d& CD3D8Texture::getOriginalSize() const -{ - return ImageSize; -} - - -//! Returns (=size) of the texture. -const core::dimension2d& CD3D8Texture::getSize() const -{ - return TextureSize; -} - - -//! returns driver type of texture (=the driver, who created the texture) -E_DRIVER_TYPE CD3D8Texture::getDriverType() const -{ - return EDT_DIRECT3D8; -} - - -//! returns color format of texture -ECOLOR_FORMAT CD3D8Texture::getColorFormat() const -{ - return ColorFormat; -} - - -//! returns pitch of texture (in bytes) -u32 CD3D8Texture::getPitch() const -{ - return Pitch; -} - - -//! returns the DIRECT3D8 Texture -IDirect3DTexture8* CD3D8Texture::getDX8Texture() const -{ - return Texture; -} - - -//! returns if texture has mipmap levels -bool CD3D8Texture::hasMipMaps() const -{ - return HasMipMaps; -} - - -// The D3DXFilterTexture function seems to get linked wrong when -// compiling with both D3D8 and 9, causing it not to work in the D3D9 device. -// So mipmapgeneration is replaced with my own bad generation in d3d 8 when -// compiling with both D3D 8 and 9. -bool CD3D8Texture::createMipMaps(u32 level) -{ - if (level==0) - return true; - - IDirect3DSurface8* upperSurface = 0; - IDirect3DSurface8* lowerSurface = 0; - - // get upper level - HRESULT hr = Texture->GetSurfaceLevel(level-1, &upperSurface); - if (FAILED(hr) || !upperSurface) - { - os::Printer::log("Could not get upper surface level for mip map generation", ELL_WARNING); - return false; - } - - // get lower level - hr = Texture->GetSurfaceLevel(level, &lowerSurface); - if (FAILED(hr) || !lowerSurface) - { - os::Printer::log("Could not get lower surface level for mip map generation", ELL_WARNING); - upperSurface->Release(); - return false; - } - - D3DSURFACE_DESC upperDesc, lowerDesc; - upperSurface->GetDesc(&upperDesc); - lowerSurface->GetDesc(&lowerDesc); - - D3DLOCKED_RECT upperlr; - D3DLOCKED_RECT lowerlr; - - // lock upper surface - if (FAILED(upperSurface->LockRect(&upperlr, NULL, 0))) - { - os::Printer::log("Could not lock upper texture for mip map generation", ELL_WARNING); - upperSurface->Release(); - lowerSurface->Release(); - return false; - } - - // lock lower surface - if (FAILED(lowerSurface->LockRect(&lowerlr, NULL, 0))) - { - os::Printer::log("Could not lock lower texture for mip map generation", ELL_WARNING); - upperSurface->UnlockRect(); - upperSurface->Release(); - lowerSurface->Release(); - return false; - } - - if (upperDesc.Format != lowerDesc.Format) - { - os::Printer::log("Cannot copy mip maps with different formats.", ELL_WARNING); - } - else - { - if (upperDesc.Format == D3DFMT_A1R5G5B5) - copy16BitMipMap((char*)upperlr.pBits, (char*)lowerlr.pBits, - upperDesc.Width, upperDesc.Height, - lowerDesc.Width, lowerDesc.Height, - upperlr.Pitch, lowerlr.Pitch); - else - if (upperDesc.Format == D3DFMT_A8R8G8B8) - copy32BitMipMap((char*)upperlr.pBits, (char*)lowerlr.pBits, - upperDesc.Width, upperDesc.Height, - lowerDesc.Width, lowerDesc.Height, - upperlr.Pitch, lowerlr.Pitch); - else - os::Printer::log("Unsupported mipmap format, cannot copy.", ELL_WARNING); - } - - bool result=true; - // unlock - if (FAILED(upperSurface->UnlockRect())) - result=false; - if (FAILED(lowerSurface->UnlockRect())) - result=false; - - // release - upperSurface->Release(); - lowerSurface->Release(); - - if (!result || upperDesc.Width < 3 || upperDesc.Height < 3) - return result; // stop generating levels - - // generate next level - return createMipMaps(level+1); -} - - -ECOLOR_FORMAT CD3D8Texture::getColorFormatFromD3DFormat(D3DFORMAT format) -{ - switch(format) - { - case D3DFMT_X1R5G5B5: - case D3DFMT_A1R5G5B5: - Pitch = TextureSize.Width * 2; - return ECF_A1R5G5B5; - break; - case D3DFMT_A8R8G8B8: - case D3DFMT_X8R8G8B8: - Pitch = TextureSize.Width * 4; - return ECF_A8R8G8B8; - break; - case D3DFMT_R5G6B5: - Pitch = TextureSize.Width * 2; - return ECF_R5G6B5; - break; - default: - return (ECOLOR_FORMAT)0; - }; -} - - - -void CD3D8Texture::copy16BitMipMap(char* src, char* tgt, - const s32 srcWidth, const s32 srcHeight, - const s32 width, const s32 height, - const s32 pitchsrc, const s32 pitchtgt) const -{ - const s32 dy_max = (srcHeight==1?1:2); - const s32 dx_max = (srcWidth==1?1:2); - const s32 blockcount= dx_max*dy_max; - for (s32 y=0; yqueryFeature(EVDF_TEXTURE_NPOT), !Driver->queryFeature(EVDF_TEXTURE_NSQUARE), true, Driver->Caps.MaxTextureWidth); - - // get backbuffer format to create the render target in the - // same format - - IDirect3DSurface8* bb; - D3DFORMAT d3DFormat = D3DFMT_A8R8G8B8; - - if (!FAILED(Device->GetBackBuffer(0, D3DBACKBUFFER_TYPE_MONO, &bb))) - { - D3DSURFACE_DESC desc; - bb->GetDesc(&desc); - d3DFormat = desc.Format; - - if (d3DFormat == D3DFMT_X8R8G8B8) - d3DFormat = D3DFMT_A8R8G8B8; - - bb->Release(); - } - else - { - os::Printer::log("Could not create RenderTarget texture: could not get BackBuffer.", - ELL_WARNING); - return; - } - - // create texture - HRESULT hr; - - hr = Device->CreateTexture( - TextureSize.Width, - TextureSize.Height, - 1, // mip map level count, we don't want mipmaps here - D3DUSAGE_RENDERTARGET, - d3DFormat, - D3DPOOL_DEFAULT, - &Texture); - - // get irrlicht format from D3D format - ColorFormat = getColorFormatFromD3DFormat(d3DFormat); - - if (FAILED(hr)) - os::Printer::log("Could not create render target texture"); -} - - -//! Regenerates the mip map levels of the texture. Useful after locking and -//! modifying the texture -void CD3D8Texture::regenerateMipMapLevels(void* mipmapData) -{ - if (mipmapData) - { - core::dimension2du size = TextureSize; - u32 level=0; - do - { - if (size.Width>1) - size.Width /=2; - if (size.Height>1) - size.Height /=2; - ++level; - IDirect3DSurface8* mipSurface = 0; - HRESULT hr = Texture->GetSurfaceLevel(level, &mipSurface); - if (FAILED(hr) || !mipSurface) - { - os::Printer::log("Could not get mipmap level", ELL_WARNING); - return; - } - D3DSURFACE_DESC mipDesc; - mipSurface->GetDesc(&mipDesc); - D3DLOCKED_RECT miplr; - - // lock mipmap surface - if (FAILED(mipSurface->LockRect(&miplr, NULL, 0))) - { - mipSurface->Release(); - os::Printer::log("Could not lock texture", ELL_WARNING); - return; - } - - memcpy(miplr.pBits, mipmapData, size.getArea()*getPitch()/TextureSize.Width); - mipmapData = (u8*)mipmapData+size.getArea()*getPitch()/TextureSize.Width; - // unlock - mipSurface->UnlockRect(); - // release - mipSurface->Release(); - } while (size.Width != 1 || size.Height != 1); - } - else if (HasMipMaps) - { - // create mip maps. -#ifndef _IRR_USE_D3DXFilterTexture_ - // The D3DXFilterTexture function seems to get linked wrong when - // compiling with both D3D8 and 9, causing it not to work in the D3D9 device. - // So mipmapgeneration is replaced with my own bad generation in d3d 8 when - // compiling with both D3D 8 and 9. - HRESULT hr = D3DXFilterTexture(Texture, NULL, D3DX_DEFAULT , D3DX_DEFAULT ); - if (FAILED(hr)) -#endif - createMipMaps(); - } -} - - -//! returns if it is a render target -bool CD3D8Texture::isRenderTarget() const -{ - return IsRenderTarget; -} - - -//! Returns pointer to the render target surface -IDirect3DSurface8* CD3D8Texture::getRenderTargetSurface() -{ - if (!IsRenderTarget) - return 0; - - IDirect3DSurface8 *pRTTSurface = 0; - if (Texture) - Texture->GetSurfaceLevel(0, &pRTTSurface); - - if (pRTTSurface) - pRTTSurface->Release(); - - return pRTTSurface; -} - - -} // end namespace video -} // end namespace irr - -#endif // _IRR_COMPILE_WITH_DIRECT3D_8_ - diff --git a/source/Irrlicht/CD3D8Texture.h b/source/Irrlicht/CD3D8Texture.h deleted file mode 100644 index 0a2d8b1b..00000000 --- a/source/Irrlicht/CD3D8Texture.h +++ /dev/null @@ -1,125 +0,0 @@ -// Copyright (C) 2002-2012 Nikolaus Gebhardt -// This file is part of the "Irrlicht Engine". -// For conditions of distribution and use, see copyright notice in irrlicht.h - -#ifndef __C_DIRECTX8_TEXTURE_H_INCLUDED__ -#define __C_DIRECTX8_TEXTURE_H_INCLUDED__ - -#include "IrrCompileConfig.h" -#ifdef _IRR_COMPILE_WITH_DIRECT3D_8_ - -#include "ITexture.h" -#include "IImage.h" - -#include - -namespace irr -{ -namespace video -{ - -class CD3D8Driver; - -/*! - interface for a Video Driver dependent Texture. -*/ -class CD3D8Texture : public ITexture -{ -public: - - //! constructor - CD3D8Texture(IImage* image, CD3D8Driver* driver, - u32 flags, const io::path& name, void* mipmapData=0); - - //! rendertarget constructor - CD3D8Texture(CD3D8Driver* driver, const core::dimension2d& size, const io::path& name); - - //! destructor - virtual ~CD3D8Texture(); - - //! lock function - virtual void* lock(E_TEXTURE_LOCK_MODE mode=ETLM_READ_WRITE, u32 mipmapLevel=0) _IRR_OVERRIDE_; - - //! unlock function - virtual void unlock() _IRR_OVERRIDE_; - - //! Returns original size of the texture. - virtual const core::dimension2d& getOriginalSize() const _IRR_OVERRIDE_; - - //! Returns (=size) of the texture. - virtual const core::dimension2d& getSize() const _IRR_OVERRIDE_; - - //! returns driver type of texture (=the driver, who created the texture) - virtual E_DRIVER_TYPE getDriverType() const _IRR_OVERRIDE_; - - //! returns color format of texture - virtual ECOLOR_FORMAT getColorFormat() const _IRR_OVERRIDE_; - - //! returns pitch of texture (in bytes) - virtual u32 getPitch() const _IRR_OVERRIDE_; - - //! returns the DIRECT3D8 Texture - IDirect3DTexture8* getDX8Texture() const; - - //! returns if texture has mipmap levels - bool hasMipMaps() const; - - //! Regenerates the mip map levels of the texture. Useful after locking and - //! modifying the texture - virtual void regenerateMipMapLevels(void* mipmapData=0) _IRR_OVERRIDE_; - - //! returns if it is a render target - virtual bool isRenderTarget() const _IRR_OVERRIDE_; - - //! Returns pointer to the render target surface - IDirect3DSurface8* getRenderTargetSurface(); - -private: - friend class CD3D8Driver; - - void createRenderTarget(); - - //! creates the hardware texture - bool createTexture(u32 flags, IImage* Image); - - //! copies the image to the texture - bool copyTexture(IImage* Image); - - //! convert color formats - ECOLOR_FORMAT getColorFormatFromD3DFormat(D3DFORMAT format); - - bool createMipMaps(u32 level=1); - - void copy16BitMipMap(char* src, char* tgt, - const s32 srcWidth, const s32 srcHeight, - const s32 width, const s32 height, - const s32 pitchsrc, const s32 pitchtgt) const; - - //! Helper function for mipmap generation. - void copy32BitMipMap(char* src, char* tgt, - const s32 srcWidth, const s32 srcHeight, - const s32 width, const s32 height, - const s32 pitchsrc, const s32 pitchtgt) const; - - IDirect3DDevice8* Device; - IDirect3DTexture8* Texture; - IDirect3DSurface8* RTTSurface; - CD3D8Driver* Driver; - core::dimension2d TextureSize; - core::dimension2d ImageSize; - s32 Pitch; - u32 MipLevelLocked; - ECOLOR_FORMAT ColorFormat; - - bool HasMipMaps; - bool IsRenderTarget; -}; - - -} // end namespace video -} // end namespace irr - -#endif // _IRR_COMPILE_WITH_DIRECT3D_8_ - -#endif // __C_DIRECTX8_TEXTURE_H_INCLUDED__ - diff --git a/source/Irrlicht/CD3D9CgMaterialRenderer.cpp b/source/Irrlicht/CD3D9CgMaterialRenderer.cpp deleted file mode 100644 index cc68ab05..00000000 --- a/source/Irrlicht/CD3D9CgMaterialRenderer.cpp +++ /dev/null @@ -1,225 +0,0 @@ -// Copyright (C) 2012-2012 Patryk Nadrowski -// This file is part of the "Irrlicht Engine". -// For conditions of distribution and use, see copyright notice in irrlicht.h - -#include "IrrCompileConfig.h" -#if defined(_IRR_COMPILE_WITH_DIRECT3D_9_) && defined(_IRR_COMPILE_WITH_CG_) - -#include "CD3D9CgMaterialRenderer.h" -#include "CD3D9Driver.h" -#include "CD3D9Texture.h" - -namespace irr -{ -namespace video -{ - -CD3D9CgUniformSampler2D::CD3D9CgUniformSampler2D(const CGparameter& parameter, bool global) : CCgUniform(parameter, global) -{ - Type = CG_SAMPLER2D; -} - -void CD3D9CgUniformSampler2D::update(const void* data, const SMaterial& material) const -{ - s32* Data = (s32*)data; - s32 LayerID = *Data; - - if (material.TextureLayer[LayerID].Texture) - { - IDirect3DBaseTexture9* Texture = reinterpret_cast(material.TextureLayer[LayerID].Texture)->getDX9Texture(); - - cgD3D9SetTextureParameter(Parameter, Texture); - } -} - -CD3D9CgMaterialRenderer::CD3D9CgMaterialRenderer(CD3D9Driver* driver, s32& materialType, - const c8* vertexProgram, const c8* vertexEntry, E_VERTEX_SHADER_TYPE vertexProfile, - const c8* fragmentProgram, const c8* fragmentEntry, E_PIXEL_SHADER_TYPE fragmentProfile, - const c8* geometryProgram, const c8* geometryEntry, E_GEOMETRY_SHADER_TYPE geometryProfile, - scene::E_PRIMITIVE_TYPE inType, scene::E_PRIMITIVE_TYPE outType, u32 vertices, - IShaderConstantSetCallBack* callback, IMaterialRenderer* baseMaterial, s32 userData) : - BaseMaterial(baseMaterial), Driver(driver), CCgMaterialRenderer(callback, userData) -{ - #ifdef _DEBUG - setDebugName("CD3D9CgMaterialRenderer"); - #endif - - if(BaseMaterial) - BaseMaterial->grab(); - - init(materialType, vertexProgram, vertexEntry, vertexProfile, fragmentProgram, fragmentEntry, fragmentProfile, - geometryProgram, geometryEntry, geometryProfile, inType, outType, vertices); -} - -CD3D9CgMaterialRenderer::~CD3D9CgMaterialRenderer() -{ - if(BaseMaterial) - BaseMaterial->drop(); - - if (VertexProgram) - { - cgD3D9UnloadProgram(VertexProgram); - cgDestroyProgram(VertexProgram); - } - if (FragmentProgram) - { - cgD3D9UnloadProgram(FragmentProgram); - cgDestroyProgram(FragmentProgram); - } -} - -bool CD3D9CgMaterialRenderer::isTransparent() const -{ - return BaseMaterial ? BaseMaterial->isTransparent() : false; -} - -void CD3D9CgMaterialRenderer::OnSetMaterial(const SMaterial& material, const SMaterial& lastMaterial, bool resetAllRenderstates, IMaterialRendererServices* services) -{ - if (material.MaterialType != lastMaterial.MaterialType || resetAllRenderstates) - { - if (VertexProgram) - cgD3D9BindProgram(VertexProgram); - - if (FragmentProgram) - cgD3D9BindProgram(FragmentProgram); - } - - Driver->setBasicRenderStates(material, lastMaterial, resetAllRenderstates); - - if (BaseMaterial) - BaseMaterial->OnSetMaterial(material, lastMaterial, resetAllRenderstates, this); - - if (CallBack) - CallBack->OnSetMaterial(material); - - Material = material; -} - -bool CD3D9CgMaterialRenderer::OnRender(IMaterialRendererServices* services, E_VERTEX_TYPE vtxtype) -{ - if (CallBack && (VertexProgram || FragmentProgram || GeometryProgram)) - CallBack->OnSetConstants(this, UserData); - - return true; -} - -void CD3D9CgMaterialRenderer::OnUnsetMaterial() -{ - if (VertexProgram) - cgD3D9UnbindProgram(VertexProgram); - if (FragmentProgram) - cgD3D9UnbindProgram(FragmentProgram); - /*if (GeometryProgram) - cgD3D9UnbindProgram(GeometryProgram);*/ - - if (BaseMaterial) - BaseMaterial->OnUnsetMaterial(); - - Material = IdentityMaterial; -} - -void CD3D9CgMaterialRenderer::setBasicRenderStates(const SMaterial& material, const SMaterial& lastMaterial, bool resetAllRenderstates) -{ - Driver->setBasicRenderStates(material, lastMaterial, resetAllRenderstates); -} - -IVideoDriver* CD3D9CgMaterialRenderer::getVideoDriver() -{ - return Driver; -} - -void CD3D9CgMaterialRenderer::init(s32& materialType, - const c8* vertexProgram, const c8* vertexEntry, E_VERTEX_SHADER_TYPE vertexProfile, - const c8* fragmentProgram, const c8* fragmentEntry, E_PIXEL_SHADER_TYPE fragmentProfile, - const c8* geometryProgram, const c8* geometryEntry, E_GEOMETRY_SHADER_TYPE geometryProfile, - scene::E_PRIMITIVE_TYPE inType, scene::E_PRIMITIVE_TYPE outType, u32 vertices) -{ - bool Status = true; - CGerror Error = CG_NO_ERROR; - materialType = -1; - - // TODO: add profile selection - - if (vertexProgram) - { - VertexProfile = cgD3D9GetLatestVertexProfile(); - - if (VertexProfile) - VertexProgram = cgCreateProgram(Driver->getCgContext(), CG_SOURCE, vertexProgram, VertexProfile, vertexEntry, 0); - - if (!VertexProgram) - { - Error = cgGetError(); - os::Printer::log("Cg vertex program failed to compile:", ELL_ERROR); - os::Printer::log(cgGetLastListing(Driver->getCgContext()), ELL_ERROR); - - Status = false; - } - else - cgD3D9LoadProgram(VertexProgram, 0, 0); - } - - if (fragmentProgram) - { - FragmentProfile = cgD3D9GetLatestPixelProfile(); - - if (FragmentProfile) - FragmentProgram = cgCreateProgram(Driver->getCgContext(), CG_SOURCE, fragmentProgram, FragmentProfile, fragmentEntry, 0); - - if (!FragmentProgram) - { - Error = cgGetError(); - os::Printer::log("Cg fragment program failed to compile:", ELL_ERROR); - os::Printer::log(cgGetLastListing(Driver->getCgContext()), ELL_ERROR); - - Status = false; - } - else - cgD3D9LoadProgram(FragmentProgram, 0, 0); - } - - /*if (geometryProgram) - { - GeometryProfile = cgD3D9GetLatestGeometryProfile(); - - if (GeometryProfile) - GeometryProgram = cgCreateProgram(Driver->getCgContext(), CG_SOURCE, geometryProgram, GeometryProfile, geometryEntry, 0); - - if (!GeometryProgram) - { - Error = cgGetError(); - os::Printer::log("Cg geometry program failed to compile:", ELL_ERROR); - os::Printer::log(cgGetLastListing(Driver->getCgContext()), ELL_ERROR); - - Status = false; - } - else - cgD3D9LoadProgram(GeometryProgram, 0, 0); - }*/ - - getUniformList(); - - // create D3D9 specifics sampler uniforms. - for(unsigned int i = 0; i < UniformInfo.size(); ++i) - { - if (UniformInfo[i]->getType() == CG_SAMPLER2D) - { - bool IsGlobal = true; - - if (UniformInfo[i]->getSpace() == CG_PROGRAM) - IsGlobal = false; - - CCgUniform* Uniform = new CD3D9CgUniformSampler2D(UniformInfo[i]->getParameter(), IsGlobal); - delete UniformInfo[i]; - UniformInfo[i] = Uniform; - } - } - - if (Status) - materialType = Driver->addMaterialRenderer(this); -} - -} -} - -#endif diff --git a/source/Irrlicht/CD3D9CgMaterialRenderer.h b/source/Irrlicht/CD3D9CgMaterialRenderer.h deleted file mode 100644 index 38d71d95..00000000 --- a/source/Irrlicht/CD3D9CgMaterialRenderer.h +++ /dev/null @@ -1,87 +0,0 @@ -// Copyright (C) 2012-2012 Patryk Nadrowski -// This file is part of the "Irrlicht Engine". -// For conditions of distribution and use, see copyright notice in irrlicht.h - -#ifndef __C_DIRECT3D_9_CG_MATERIAL_RENDERER_H_INCLUDED__ -#define __C_DIRECT3D_9_CG_MATERIAL_RENDERER_H_INCLUDED__ - -#include "IrrCompileConfig.h" -#if defined(_IRR_COMPILE_WITH_DIRECT3D_9_) && defined(_IRR_COMPILE_WITH_CG_) - -#define WIN32_LEAN_AND_MEAN - -#include -#include -#include -#include "CCgMaterialRenderer.h" -#include "Cg/cgD3D9.h" - -#ifdef _MSC_VER - #pragma comment(lib, "cgD3D9.lib") -#endif - -namespace irr -{ -namespace video -{ - -class CD3D9Driver; -class IShaderConstantSetCallBack; - -class CD3D9CgUniformSampler2D : public CCgUniform -{ -public: - CD3D9CgUniformSampler2D(const CGparameter& parameter, bool global); - - void update(const void* data, const SMaterial& material) const; -}; - -class CD3D9CgMaterialRenderer : public CCgMaterialRenderer -{ -public: - CD3D9CgMaterialRenderer(CD3D9Driver* driver, s32& materialType, - const c8* vertexProgram = 0, const c8* vertexEntry = "main", - E_VERTEX_SHADER_TYPE vertexProfile = video::EVST_VS_1_1, - const c8* fragmentProgram = 0, const c8* fragmentEntry = "main", - E_PIXEL_SHADER_TYPE fragmentProfile = video::EPST_PS_1_1, - const c8* geometryProgram = 0, const c8* geometryEntry = "main", - E_GEOMETRY_SHADER_TYPE geometryProfile = video::EGST_GS_4_0, - scene::E_PRIMITIVE_TYPE inType = scene::EPT_TRIANGLES, - scene::E_PRIMITIVE_TYPE outType = scene::EPT_TRIANGLE_STRIP, - u32 vertices = 0, IShaderConstantSetCallBack* callback = 0, - IMaterialRenderer* baseMaterial = 0, s32 userData = 0); - - virtual ~CD3D9CgMaterialRenderer(); - - virtual bool isTransparent() const _IRR_OVERRIDE_; - - virtual void OnSetMaterial(const SMaterial& material, const SMaterial& lastMaterial, bool resetAllRenderstates, IMaterialRendererServices* services) _IRR_OVERRIDE_; - virtual bool OnRender(IMaterialRendererServices* services, E_VERTEX_TYPE vtxtype) _IRR_OVERRIDE_; - virtual void OnUnsetMaterial() _IRR_OVERRIDE_; - - virtual void setBasicRenderStates(const SMaterial& material, const SMaterial& lastMaterial, bool resetAllRenderstates) _IRR_OVERRIDE_; - virtual IVideoDriver* getVideoDriver() _IRR_OVERRIDE_; - -protected: - void init(s32& materialType, - const c8* vertexProgram = 0, const c8* vertexEntry = "main", - E_VERTEX_SHADER_TYPE vertexProfile = video::EVST_VS_1_1, - const c8* fragmentProgram = 0, const c8* fragmentEntry = "main", - E_PIXEL_SHADER_TYPE fragmentProfile = video::EPST_PS_1_1, - const c8* geometryProgram = 0, const c8* geometryEntry = "main", - E_GEOMETRY_SHADER_TYPE geometryProfile = video::EGST_GS_4_0, - scene::E_PRIMITIVE_TYPE inType = scene::EPT_TRIANGLES, - scene::E_PRIMITIVE_TYPE outType = scene::EPT_TRIANGLE_STRIP, - u32 vertices = 0); - - IMaterialRenderer* BaseMaterial; - - CD3D9Driver* Driver; -}; - -} -} - -#endif -#endif - diff --git a/source/Irrlicht/CD3D9Driver.cpp b/source/Irrlicht/CD3D9Driver.cpp index fafcfc90..9cff5fff 100644 --- a/source/Irrlicht/CD3D9Driver.cpp +++ b/source/Irrlicht/CD3D9Driver.cpp @@ -10,12 +10,12 @@ #include "os.h" #include "S3DVertex.h" #include "CD3D9Texture.h" +#include "CD3D9RenderTarget.h" #include "CD3D9MaterialRenderer.h" #include "CD3D9ShaderMaterialRenderer.h" #include "CD3D9NormalMapRenderer.h" #include "CD3D9ParallaxMapRenderer.h" #include "CD3D9HLSLMaterialRenderer.h" -#include "CD3D9CgMaterialRenderer.h" #include "SIrrCreationParameters.h" namespace irr @@ -32,10 +32,10 @@ namespace CD3D9Driver::CD3D9Driver(const SIrrlichtCreationParameters& params, io::IFileSystem* io) : CNullDriver(io, params.WindowSize), BridgeCalls(0), CurrentRenderMode(ERM_NONE), ResetRenderStates(true), Transformation3DChanged(false), - D3DLibrary(0), pID3D(0), pID3DDevice(0), PrevRenderTarget(0), - WindowId(0), SceneSourceRect(0), + D3DLibrary(0), pID3D(0), pID3DDevice(0), BackBufferSurface(0), + DepthStencilSurface(0), WindowId(0), SceneSourceRect(0), LastVertexType((video::E_VERTEX_TYPE)-1), VendorID(0), - MaxTextureUnits(0), MaxUserClipPlanes(0), MaxMRTs(1), NumSetMRTs(1), + MaxTextureUnits(0), MaxUserClipPlanes(0), MaxLightDistance(0.f), LastSetLight(-1), ColorFormat(ECF_A8R8G8B8), DeviceLost(false), DriverWasReset(true), OcclusionQuerySupport(false), @@ -67,10 +67,6 @@ CD3D9Driver::CD3D9Driver(const SIrrlichtCreationParameters& params, io::IFileSys core::matrix4 mat; UnitMatrixD3D9 = *(D3DMATRIX*)((void*)mat.pointer()); - #ifdef _IRR_COMPILE_WITH_CG_ - CgContext = 0; - #endif - // init direct 3d is done in the factory function } @@ -82,11 +78,9 @@ CD3D9Driver::~CD3D9Driver() deleteAllTextures(); removeAllOcclusionQueries(); removeAllHardwareBuffers(); - for (u32 i=0; idrop(); - } - DepthBuffers.clear(); + + if (DepthStencilSurface) + DepthStencilSurface->Release(); delete BridgeCalls; @@ -97,15 +91,6 @@ CD3D9Driver::~CD3D9Driver() if (pID3D) pID3D->Release(); - - #ifdef _IRR_COMPILE_WITH_CG_ - cgD3D9SetDevice(0); - - if(CgContext) - { - cgDestroyContext(CgContext); - } - #endif } @@ -443,7 +428,6 @@ bool CD3D9Driver::initDriver(HWND hwnd, bool pureSoftware) MaxTextureUnits = core::min_((u32)Caps.MaxSimultaneousTextures, MATERIAL_MAX_TEXTURES); MaxUserClipPlanes = (u32)Caps.MaxUserClipPlanes; - MaxMRTs = (s32)Caps.NumSimultaneousRTs; OcclusionQuerySupport=(pID3DDevice->CreateQuery(D3DQUERYTYPE_OCCLUSION, NULL) == S_OK); if (VendorID==0x10DE)//NVidia @@ -474,13 +458,10 @@ bool CD3D9Driver::initDriver(HWND hwnd, bool pureSoftware) // set the renderstates setRenderStates3DMode(); - // store the screen's depth buffer - DepthBuffers.push_back(new SDepthSurface()); - if (SUCCEEDED(pID3DDevice->GetDepthStencilSurface(&(DepthBuffers[0]->Surface)))) + // store the screen's depth buffer descriptor + if (SUCCEEDED(pID3DDevice->GetDepthStencilSurface(&DepthStencilSurface))) { - D3DSURFACE_DESC desc; - DepthBuffers[0]->Surface->GetDesc(&desc); - DepthBuffers[0]->Size.set(desc.Width, desc.Height); + DepthStencilSurface->Release(); } else { @@ -489,7 +470,7 @@ bool CD3D9Driver::initDriver(HWND hwnd, bool pureSoftware) } D3DColorFormat = D3DFMT_A8R8G8B8; - IDirect3DSurface9* bb=0; + IDirect3DSurface9* bb = 0; if (SUCCEEDED(pID3DDevice->GetBackBuffer(0, 0, D3DBACKBUFFER_TYPE_MONO, &bb))) { D3DSURFACE_DESC desc; @@ -503,21 +484,18 @@ bool CD3D9Driver::initDriver(HWND hwnd, bool pureSoftware) } ColorFormat = getColorFormatFromD3DFormat(D3DColorFormat); - #ifdef _IRR_COMPILE_WITH_CG_ - CgContext = cgCreateContext(); - cgD3D9SetDevice(pID3DDevice); - #endif + ActiveRenderTarget.set_used((u32)Caps.NumSimultaneousRTs); + + for (u32 i = 0; i < ActiveRenderTarget.size(); ++i) + ActiveRenderTarget[i] = false; // so far so good. return true; } - -//! applications must call this method before performing any rendering. returns false if failed. -bool CD3D9Driver::beginScene(bool backBuffer, bool zBuffer, SColor color, - const SExposedVideoData& videoData, core::rect* sourceRect) +bool CD3D9Driver::beginScene(u16 clearFlag, SColor clearColor, f32 clearDepth, u8 clearStencil, const SExposedVideoData& videoData, core::rect* sourceRect) { - CNullDriver::beginScene(backBuffer, zBuffer, color, videoData, sourceRect); + CNullDriver::beginScene(clearFlag, clearColor, clearDepth, clearStencil, videoData, sourceRect); WindowId = (HWND)videoData.D3D9.HWnd; SceneSourceRect = sourceRect; @@ -542,23 +520,7 @@ bool CD3D9Driver::beginScene(bool backBuffer, bool zBuffer, SColor color, } } - DWORD flags = 0; - - if (backBuffer) - flags |= D3DCLEAR_TARGET; - - if (zBuffer) - flags |= D3DCLEAR_ZBUFFER; - - if (Params.Stencilbuffer) - flags |= D3DCLEAR_STENCIL; - - if (flags) - { - hr = pID3DDevice->Clear( 0, NULL, flags, color.color, 1.0, 0); - if (FAILED(hr)) - os::Printer::log("DIRECT3D9 clear failed.", ELL_WARNING); - } + clearBuffers(clearFlag, clearColor, clearDepth, clearStencil); hr = pID3DDevice->BeginScene(); if (FAILED(hr)) @@ -570,8 +532,6 @@ bool CD3D9Driver::beginScene(bool backBuffer, bool zBuffer, SColor color, return true; } - -//! applications must call this method after performing any rendering. returns false if failed. bool CD3D9Driver::endScene() { CNullDriver::endScene(); @@ -787,12 +747,12 @@ void CD3D9Driver::setMaterial(const SMaterial& material) //! returns a device dependent texture from a software surface (IImage) -video::ITexture* CD3D9Driver::createDeviceDependentTexture(IImage* surface,const io::path& name, void* mipmapData) +video::ITexture* CD3D9Driver::createDeviceDependentTexture(IImage* surface,const io::path& name) { CD3D9Texture* texture = 0; if (surface && checkColorFormat(surface->getColorFormat(), surface->getDimension())) - texture = new CD3D9Texture(surface, this, TextureCreationFlags, name, mipmapData); + texture = new CD3D9Texture(surface, this, TextureCreationFlags, name); return texture; } @@ -808,222 +768,119 @@ void CD3D9Driver::setTextureCreationFlag(E_TEXTURE_CREATION_FLAG flag, CNullDriver::setTextureCreationFlag(flag, enabled); } - -//! sets a render target -bool CD3D9Driver::setRenderTarget(video::ITexture* texture, - bool clearBackBuffer, bool clearZBuffer, SColor color) +bool CD3D9Driver::setRenderTarget(IRenderTarget* target, u16 clearFlag, SColor clearColor, f32 clearDepth, u8 clearStencil) { - // check for right driver type - - if (texture && texture->getDriverType() != EDT_DIRECT3D9) + if (target && target->getDriverType() != EDT_DIRECT3D9) { - os::Printer::log("Fatal Error: Tried to set a texture not owned by this driver.", ELL_ERROR); + os::Printer::log("Fatal Error: Tried to set a render target not owned by this driver.", ELL_ERROR); return false; } - // check for valid render target - - if (texture && !texture->isRenderTarget()) + if (target) { - os::Printer::log("Fatal Error: Tried to set a non render target texture as render target.", ELL_ERROR); - return false; - } + // Store main render target. - CD3D9Texture* tex = static_cast(texture); - - // check if we should set the previous RT back - - bool ret = true; - - for(u32 i = 1; i < NumSetMRTs; i++) - { - // First texture handled elsewhere - pID3DDevice->SetRenderTarget(i, NULL); - } - if (tex == 0) - { - if (PrevRenderTarget) + if (!BackBufferSurface) { - if (FAILED(pID3DDevice->SetRenderTarget(0, PrevRenderTarget))) + if (FAILED(pID3DDevice->GetRenderTarget(0, &BackBufferSurface))) { - os::Printer::log("Error: Could not set back to previous render target.", ELL_ERROR); - ret = false; - } - if (FAILED(pID3DDevice->SetDepthStencilSurface(DepthBuffers[0]->Surface))) - { - os::Printer::log("Error: Could not set main depth buffer.", ELL_ERROR); - } - - CurrentRendertargetSize = core::dimension2d(0,0); - PrevRenderTarget->Release(); - PrevRenderTarget = 0; - } - } - else - { - // we want to set a new target. so do this. - - // store previous target - - if (!PrevRenderTarget) - { - if (FAILED(pID3DDevice->GetRenderTarget(0, &PrevRenderTarget))) - { - os::Printer::log("Could not get previous render target.", ELL_ERROR); + os::Printer::log("Could not get main render target.", ELL_ERROR); return false; } } - // set new render target + // Set new color textures. - if (FAILED(pID3DDevice->SetRenderTarget(0, tex->getRenderTargetSurface()))) - { - os::Printer::log("Error: Could not set render target.", ELL_ERROR); - return false; - } - CurrentRendertargetSize = tex->getSize(); + CD3D9RenderTarget* renderTarget = static_cast(target); - if (FAILED(pID3DDevice->SetDepthStencilSurface(tex->DepthSurface->Surface))) + const u32 surfaceSize = core::min_(renderTarget->getSurfaceCount(), ActiveRenderTarget.size()); + + for (u32 i = 0; i < surfaceSize; ++i) { - os::Printer::log("Error: Could not set new depth buffer.", ELL_ERROR); + ActiveRenderTarget[i] = true; + + if (FAILED(pID3DDevice->SetRenderTarget(i, renderTarget->getSurface(i)))) + { + ActiveRenderTarget[i] = false; + + os::Printer::log("Error: Could not set render target.", ELL_ERROR); + } } + + // Reset other render target channels. + + for (u32 i = surfaceSize; i < ActiveRenderTarget.size(); ++i) + { + if (ActiveRenderTarget[i]) + { + pID3DDevice->SetRenderTarget(i, 0); + ActiveRenderTarget[i] = false; + } + } + + // Set depth stencil buffer. + + IDirect3DSurface9* depthStencilSurface = renderTarget->getDepthStencilSurface(); + + if (depthStencilSurface && FAILED(pID3DDevice->SetDepthStencilSurface(depthStencilSurface))) + { + os::Printer::log("Error: Could not set depth-stencil buffer.", ELL_ERROR); + } + + // Set other settings. + + CurrentRendertargetSize = renderTarget->getSize(); + Transformation3DChanged = true; } - Transformation3DChanged=true; - - if (clearBackBuffer || clearZBuffer) + else if (CurrentRenderTarget != target) { - DWORD flags = 0; + // Set main render target. - if (clearBackBuffer) - flags |= D3DCLEAR_TARGET; - - if (clearZBuffer) - flags |= D3DCLEAR_ZBUFFER; - - pID3DDevice->Clear(0, NULL, flags, color.color, 1.0f, 0); - } - - return ret; -} - - -//! Sets multiple render targets -bool CD3D9Driver::setRenderTarget(const core::array& targets, - bool clearBackBuffer, bool clearZBuffer, SColor color) -{ - if (targets.size()==0) - return setRenderTarget(0, clearBackBuffer, clearZBuffer, color); - - u32 maxMultipleRTTs = core::min_(MaxMRTs, targets.size()); - - for (u32 i = 0; i < maxMultipleRTTs; ++i) - { - if (targets[i].TargetType != ERT_RENDER_TEXTURE || !targets[i].RenderTexture) + if (BackBufferSurface) { - maxMultipleRTTs = i; - os::Printer::log("Missing texture for MRT.", ELL_WARNING); - break; + ActiveRenderTarget[0] = true; + + if (FAILED(pID3DDevice->SetRenderTarget(0, BackBufferSurface))) + { + os::Printer::log("Error: Could not set main render target.", ELL_ERROR); + ActiveRenderTarget[0] = false; + + return false; + } + + BackBufferSurface->Release(); + BackBufferSurface = 0; } - // check for right driver type + // Reset other render target channels. - if (targets[i].RenderTexture->getDriverType() != EDT_DIRECT3D9) + for (u32 i = 1; i < ActiveRenderTarget.size(); ++i) { - maxMultipleRTTs = i; - os::Printer::log("Tried to set a texture not owned by this driver.", ELL_WARNING); - break; + if (ActiveRenderTarget[i]) + { + pID3DDevice->SetRenderTarget(i, 0); + ActiveRenderTarget[i] = false; + } } - // check for valid render target + // Set main depth-stencil stencil buffer. - if (!targets[i].RenderTexture->isRenderTarget()) + if (FAILED(pID3DDevice->SetDepthStencilSurface(DepthStencilSurface))) { - maxMultipleRTTs = i; - os::Printer::log("Tried to set a non render target texture as render target.", ELL_WARNING); - break; + os::Printer::log("Error: Could not set main depth-stencil buffer.", ELL_ERROR); } - // check for valid size + // Set other settings. - if (targets[0].RenderTexture->getSize() != targets[i].RenderTexture->getSize()) - { - maxMultipleRTTs = i; - os::Printer::log("Render target texture has wrong size.", ELL_WARNING); - break; - } - } - if (maxMultipleRTTs==0) - { - os::Printer::log("Fatal Error: No valid MRT found.", ELL_ERROR); - return false; + CurrentRendertargetSize = core::dimension2d(0, 0); + Transformation3DChanged = true; } - CD3D9Texture* tex = static_cast(targets[0].RenderTexture); + CurrentRenderTarget = target; - // check if we should set the previous RT back + clearBuffers(clearFlag, clearColor, clearDepth, clearStencil); - bool ret = true; - - // we want to set a new target. so do this. - // store previous target - - if (!PrevRenderTarget) - { - if (FAILED(pID3DDevice->GetRenderTarget(0, &PrevRenderTarget))) - { - os::Printer::log("Could not get previous render target.", ELL_ERROR); - return false; - } - } - - // set new render target - - // In d3d9 we have at most 4 MRTs, so the following is enough - D3DRENDERSTATETYPE colorWrite[4]={D3DRS_COLORWRITEENABLE, D3DRS_COLORWRITEENABLE1, D3DRS_COLORWRITEENABLE2, D3DRS_COLORWRITEENABLE3}; - for (u32 i = 0; i < maxMultipleRTTs; ++i) - { - if (FAILED(pID3DDevice->SetRenderTarget(i, static_cast(targets[i].RenderTexture)->getRenderTargetSurface()))) - { - os::Printer::log("Error: Could not set render target.", ELL_ERROR); - return false; - } - if (i<4 && (i==0 || queryFeature(EVDF_MRT_COLOR_MASK))) - { - const DWORD flag = - ((targets[i].ColorMask & ECP_RED)?D3DCOLORWRITEENABLE_RED:0) | - ((targets[i].ColorMask & ECP_GREEN)?D3DCOLORWRITEENABLE_GREEN:0) | - ((targets[i].ColorMask & ECP_BLUE)?D3DCOLORWRITEENABLE_BLUE:0) | - ((targets[i].ColorMask & ECP_ALPHA)?D3DCOLORWRITEENABLE_ALPHA:0); - pID3DDevice->SetRenderState(colorWrite[i], flag); - } - } - for(u32 i = maxMultipleRTTs; i < NumSetMRTs; i++) - { - pID3DDevice->SetRenderTarget(i, NULL); - } - NumSetMRTs=maxMultipleRTTs; - - CurrentRendertargetSize = tex->getSize(); - - if (FAILED(pID3DDevice->SetDepthStencilSurface(tex->DepthSurface->Surface))) - { - os::Printer::log("Error: Could not set new depth buffer.", ELL_ERROR); - } - - if (clearBackBuffer || clearZBuffer) - { - DWORD flags = 0; - - if (clearBackBuffer) - flags |= D3DCLEAR_TARGET; - - if (clearZBuffer) - flags |= D3DCLEAR_ZBUFFER; - - pID3DDevice->Clear(0, NULL, flags, color.color, 1.0f, 0); - } - - return ret; + return true; } @@ -1412,6 +1269,16 @@ u32 CD3D9Driver::getOcclusionQueryResult(scene::ISceneNode* node) const } +//! Create render target. +IRenderTarget* CD3D9Driver::addRenderTarget() +{ + CD3D9RenderTarget* renderTarget = new CD3D9RenderTarget(this); + RenderTargets.push_back(renderTarget); + + return renderTarget; +} + + //! draws a vertex primitive list void CD3D9Driver::drawVertexPrimitiveList(const void* vertices, u32 vertexCount, const void* indexList, u32 primitiveCount, @@ -2260,15 +2127,13 @@ void CD3D9Driver::setBasicRenderStates(const SMaterial& material, const SMateria } // zwrite -// if (resetAllRenderstates || (lastmaterial.ZWriteEnable != material.ZWriteEnable)) + if (getWriteZBuffer(material)) { - if (material.ZWriteEnable && (AllowZWriteOnTransparent || (!material.isTransparent() && - !MaterialRenderers[material.MaterialType].Renderer->isTransparent()))) - { - pID3DDevice->SetRenderState( D3DRS_ZWRITEENABLE, TRUE); - } - else - pID3DDevice->SetRenderState( D3DRS_ZWRITEENABLE, FALSE); + pID3DDevice->SetRenderState( D3DRS_ZWRITEENABLE, TRUE); + } + else + { + pID3DDevice->SetRenderState(D3DRS_ZWRITEENABLE, FALSE); } // back face culling @@ -2965,20 +2830,20 @@ bool CD3D9Driver::reset() u32 i; os::Printer::log("Resetting D3D9 device.", ELL_INFORMATION); + for (i = 0; igetDriverType() == EDT_DIRECT3D9) + static_cast(RenderTargets[i])->releaseSurfaces(); + } for (i=0; iisRenderTarget()) { - IDirect3DBaseTexture9* tex = ((CD3D9Texture*)(Textures[i].Surface))->getDX9Texture(); + IDirect3DTexture9* tex = ((CD3D9Texture*)(Textures[i].Surface))->getDX9Texture(); if (tex) tex->Release(); } } - for (i=0; iSurface) - DepthBuffers[i]->Surface->Release(); - } for (i=0; iRelease(); + + if (BackBufferSurface) + { + BackBufferSurface->Release(); + BackBufferSurface = 0; + } + DriverWasReset=true; HRESULT hr = pID3DDevice->Reset(&present); + // reset bridge calls. + if (BridgeCalls) + BridgeCalls->reset(); + + // restore screen depthbuffer descriptor + if (SUCCEEDED(pID3DDevice->GetDepthStencilSurface(&DepthStencilSurface))) + DepthStencilSurface->Release(); + // restore RTTs for (i=0; iisRenderTarget()) ((CD3D9Texture*)(Textures[i].Surface))->createRenderTarget(); } - - // restore screen depthbuffer - pID3DDevice->GetDepthStencilSurface(&(DepthBuffers[0]->Surface)); - D3DSURFACE_DESC desc; - // restore other depth buffers - // depth format is taken from main depth buffer - DepthBuffers[0]->Surface->GetDesc(&desc); - // multisampling is taken from rendertarget - D3DSURFACE_DESC desc2; - for (i=1; iDepthSurface==DepthBuffers[i]) - { - ((CD3D9Texture*)(Textures[j].Surface))->Texture->GetLevelDesc(0,&desc2); - break; - } - } - - pID3DDevice->CreateDepthStencilSurface(DepthBuffers[i]->Size.Width, - DepthBuffers[i]->Size.Height, - desc.Format, - desc2.MultiSampleType, - desc2.MultiSampleQuality, - TRUE, - &(DepthBuffers[i]->Surface), - NULL); + if (RenderTargets[i]->getDriverType() == EDT_DIRECT3D9) + static_cast(RenderTargets[i])->generateSurfaces(); } + + // restore occlusion queries for (i=0; iCreateQuery(D3DQUERYTYPE_OCCLUSION, reinterpret_cast(&OcclusionQueries[i].PID)); @@ -3245,23 +3107,7 @@ s32 CD3D9Driver::addHighLevelShaderMaterial( { s32 nr = -1; - #ifdef _IRR_COMPILE_WITH_CG_ - if(shadingLang == EGSL_CG) - { - CD3D9CgMaterialRenderer* r = new CD3D9CgMaterialRenderer( - this, nr, - vertexShaderProgram, vertexShaderEntryPointName, vsCompileTarget, - pixelShaderProgram, pixelShaderEntryPointName, psCompileTarget, - geometryShaderProgram, geometryShaderEntryPointName, gsCompileTarget, - inType, outType, verticesOut, - callback,getMaterialRenderer(baseMaterial), userData); - - r->drop(); - } - else - #endif - { - CD3D9HLSLMaterialRenderer* r = new CD3D9HLSLMaterialRenderer( + CD3D9HLSLMaterialRenderer* r = new CD3D9HLSLMaterialRenderer( pID3DDevice, this, nr, vertexShaderProgram, vertexShaderEntryPointName, @@ -3273,8 +3119,7 @@ s32 CD3D9Driver::addHighLevelShaderMaterial( getMaterialRenderer(baseMaterial), userData); - r->drop(); - } + r->drop(); return nr; } @@ -3301,21 +3146,33 @@ ITexture* CD3D9Driver::addRenderTargetTexture(const core::dimension2d& size tex->drop(); return 0; } - checkDepthBuffer(tex); + addTexture(tex); tex->drop(); } return tex; } - -//! Clears the ZBuffer. -void CD3D9Driver::clearZBuffer() +void CD3D9Driver::clearBuffers(u16 flag, SColor color, f32 depth, u8 stencil) { - HRESULT hr = pID3DDevice->Clear( 0, NULL, D3DCLEAR_ZBUFFER, 0, 1.0, 0); + DWORD internalFlag = 0; - if (FAILED(hr)) - os::Printer::log("CD3D9Driver clearZBuffer() failed.", ELL_WARNING); + if (flag & ECBF_COLOR) + internalFlag |= D3DCLEAR_TARGET; + + if (flag & ECBF_DEPTH) + internalFlag |= D3DCLEAR_ZBUFFER; + + if (flag & ECBF_STENCIL) + internalFlag |= D3DCLEAR_STENCIL; + + if (internalFlag) + { + HRESULT hr = pID3DDevice->Clear(0, NULL, internalFlag, color.color, depth, stencil); + + if (FAILED(hr)) + os::Printer::log("DIRECT3D9 clear failed.", ELL_WARNING); + } } @@ -3325,13 +3182,16 @@ IImage* CD3D9Driver::createScreenShot(video::ECOLOR_FORMAT format, video::E_REND if (target != video::ERT_FRAME_BUFFER) return 0; + if (format==video::ECF_UNKNOWN) + format=getColorFormat(); + + if (IImage::isRenderTargetOnlyFormat(format) || IImage::isCompressedFormat(format) || IImage::isDepthFormat(format)) + return 0; + // query the screen dimensions of the current adapter D3DDISPLAYMODE displayMode; pID3DDevice->GetDisplayMode(0, &displayMode); - if (format==video::ECF_UNKNOWN) - format=video::ECF_A8R8G8B8; - // create the image surface to store the front buffer image [always A8R8G8B8] HRESULT hr; LPDIRECT3DSURFACE9 lpSurface; @@ -3493,8 +3353,6 @@ D3DFORMAT CD3D9Driver::getD3DFormatFromColorFormat(ECOLOR_FORMAT format) const return D3DFMT_R8G8B8; case ECF_A8R8G8B8: return D3DFMT_A8R8G8B8; - - // Floating Point formats. Thanks to Patryk "Nadro" Nadrowski. case ECF_R16F: return D3DFMT_R16F; case ECF_G16R16F: @@ -3507,6 +3365,12 @@ D3DFORMAT CD3D9Driver::getD3DFormatFromColorFormat(ECOLOR_FORMAT format) const return D3DFMT_G32R32F; case ECF_A32B32G32R32F: return D3DFMT_A32B32G32R32F; + case ECF_D16: + return D3DFMT_D16; + case ECF_D24S8: + return D3DFMT_D24S8; + case ECF_D32: + return D3DFMT_D32; } return D3DFMT_UNKNOWN; } @@ -3547,85 +3411,6 @@ ECOLOR_FORMAT CD3D9Driver::getColorFormatFromD3DFormat(D3DFORMAT format) const } -void CD3D9Driver::checkDepthBuffer(ITexture* tex) -{ - if (!tex) - return; - const core::dimension2du optSize = tex->getSize().getOptimalSize( - !queryFeature(EVDF_TEXTURE_NPOT), - !queryFeature(EVDF_TEXTURE_NSQUARE), true); - SDepthSurface* depth=0; - core::dimension2du destSize(0x7fffffff, 0x7fffffff); - for (u32 i=0; iSize.Width>=optSize.Width) && - (DepthBuffers[i]->Size.Height>=optSize.Height)) - { - if ((DepthBuffers[i]->Size.WidthSize.HeightSize; - } - } - } - if (!depth) - { - D3DSURFACE_DESC desc; - DepthBuffers[0]->Surface->GetDesc(&desc); - // the multisampling needs to match the RTT - D3DSURFACE_DESC desc2; - ((CD3D9Texture*)tex)->Texture->GetLevelDesc(0,&desc2); - DepthBuffers.push_back(new SDepthSurface()); - HRESULT hr=pID3DDevice->CreateDepthStencilSurface(optSize.Width, - optSize.Height, - desc.Format, - desc2.MultiSampleType, - desc2.MultiSampleQuality, - TRUE, - &(DepthBuffers.getLast()->Surface), - NULL); - if (SUCCEEDED(hr)) - { - depth=DepthBuffers.getLast(); - depth->Surface->GetDesc(&desc); - depth->Size.set(desc.Width, desc.Height); - } - else - { - if (hr == D3DERR_OUTOFVIDEOMEMORY) - os::Printer::log("Could not create DepthBuffer","out of video memory",ELL_ERROR); - else if( hr == E_OUTOFMEMORY ) - os::Printer::log("Could not create DepthBuffer","out of memory",ELL_ERROR); - else - { - char buffer[128]; - sprintf(buffer,"Could not create DepthBuffer of %ix%i",optSize.Width,optSize.Height); - os::Printer::log(buffer,ELL_ERROR); - } - DepthBuffers.erase(DepthBuffers.size()-1); - } - } - else - depth->grab(); - - static_cast(tex)->DepthSurface=depth; -} - - -void CD3D9Driver::removeDepthSurface(SDepthSurface* depth) -{ - for (u32 i=0; iqueryFeature(EVDF_BLEND_SEPARATE); + FeatureBlendSeparate = driver->queryFeature(EVDF_BLEND_SEPARATE); - pID3DDevice->SetRenderState(D3DRS_BLENDOP, D3DBLENDOP_ADD); - pID3DDevice->SetRenderState(D3DRS_SRCBLEND, D3DBLEND_ONE); - pID3DDevice->SetRenderState(D3DRS_DESTBLEND, D3DBLEND_ZERO); + reset(); +} + +void CD3D9CallBridge::reset() +{ + BlendOperation = D3DBLENDOP_ADD; + + BlendSourceRGB = D3DBLEND_ONE; + BlendDestinationRGB = D3DBLEND_ZERO; + BlendSourceAlpha = D3DBLEND_ONE; + BlendDestinationAlpha = D3DBLEND_ZERO; + + Blend = false; + BlendSeparate = false; + + pID3DDevice->SetRenderState(D3DRS_BLENDOP, D3DBLENDOP_ADD); + pID3DDevice->SetRenderState(D3DRS_SRCBLEND, D3DBLEND_ONE); + pID3DDevice->SetRenderState(D3DRS_DESTBLEND, D3DBLEND_ZERO); pID3DDevice->SetRenderState(D3DRS_ALPHABLENDENABLE, FALSE); if (FeatureBlendSeparate) { - pID3DDevice->SetRenderState(D3DRS_SRCBLENDALPHA, D3DBLEND_ONE); - pID3DDevice->SetRenderState(D3DRS_DESTBLENDALPHA, D3DBLEND_ZERO); - pID3DDevice->SetRenderState(D3DRS_SEPARATEALPHABLENDENABLE, FALSE); + pID3DDevice->SetRenderState(D3DRS_SRCBLENDALPHA, D3DBLEND_ONE); + pID3DDevice->SetRenderState(D3DRS_DESTBLENDALPHA, D3DBLEND_ZERO); + pID3DDevice->SetRenderState(D3DRS_SEPARATEALPHABLENDENABLE, FALSE); } } diff --git a/source/Irrlicht/CD3D9Driver.h b/source/Irrlicht/CD3D9Driver.h index 15a959a7..0a2d6b2a 100644 --- a/source/Irrlicht/CD3D9Driver.h +++ b/source/Irrlicht/CD3D9Driver.h @@ -22,40 +22,20 @@ #endif #include -#ifdef _IRR_COMPILE_WITH_CG_ -#include "Cg/cg.h" -#include "Cg/cgD3D9.h" -#endif - namespace irr { namespace video { class CD3D9CallBridge; - - struct SDepthSurface : public IReferenceCounted - { - SDepthSurface() : Surface(0) - { - #ifdef _DEBUG - setDebugName("SDepthSurface"); - #endif - } - virtual ~SDepthSurface() - { - if (Surface) - Surface->Release(); - } - - IDirect3DSurface9* Surface; - core::dimension2du Size; - }; + class CD3D9RenderTarget; + class CD3D9Texture; class CD3D9Driver : public CNullDriver, IMaterialRendererServices { public: friend class CD3D9CallBridge; + friend class CD3D9RenderTarget; friend class CD3D9Texture; //! constructor @@ -64,13 +44,9 @@ namespace video //! destructor virtual ~CD3D9Driver(); - //! applications must call this method before performing any rendering. returns false if failed. - virtual bool beginScene(bool backBuffer=true, bool zBuffer=true, - SColor color=SColor(255,0,0,0), - const SExposedVideoData& videoData=SExposedVideoData(), - core::rect* sourceRect=0) _IRR_OVERRIDE_; + virtual bool beginScene(u16 clearFlag, SColor clearColor = SColor(255,0,0,0), f32 clearDepth = 1.f, u8 clearStencil = 0, + const SExposedVideoData& videoData = SExposedVideoData(), core::rect* sourceRect = 0) _IRR_OVERRIDE_; - //! applications must call this method after performing any rendering. returns false if failed. virtual bool endScene() _IRR_OVERRIDE_; //! queries the features of the driver, returns true if feature is available @@ -82,15 +58,8 @@ namespace video //! sets a material virtual void setMaterial(const SMaterial& material) _IRR_OVERRIDE_; - //! sets a render target - virtual bool setRenderTarget(video::ITexture* texture, - bool clearBackBuffer=true, bool clearZBuffer=true, - SColor color=video::SColor(0,0,0,0)) _IRR_OVERRIDE_; - - //! Sets multiple render targets - virtual bool setRenderTarget(const core::array& texture, - bool clearBackBuffer=true, bool clearZBuffer=true, - SColor color=video::SColor(0,0,0,0)) _IRR_OVERRIDE_; + virtual bool setRenderTarget(IRenderTarget* target, u16 clearFlag, SColor clearColor = SColor(255,0,0,0), + f32 clearDepth = 1.f, u8 clearStencil = 0) _IRR_OVERRIDE_; //! sets a viewport virtual void setViewPort(const core::rect& area) _IRR_OVERRIDE_; @@ -151,6 +120,9 @@ namespace video actual value of pixels. */ virtual u32 getOcclusionQueryResult(scene::ISceneNode* node) const _IRR_OVERRIDE_; + //! Create render target. + virtual IRenderTarget* addRenderTarget() _IRR_OVERRIDE_; + //! draws a vertex primitive list virtual void drawVertexPrimitiveList(const void* vertices, u32 vertexCount, const void* indexList, u32 primitiveCount, @@ -294,8 +266,7 @@ namespace video virtual ITexture* addRenderTargetTexture(const core::dimension2d& size, const io::path& name, const ECOLOR_FORMAT format = ECF_UNKNOWN) _IRR_OVERRIDE_; - //! Clears the ZBuffer. - virtual void clearZBuffer() _IRR_OVERRIDE_; + virtual void clearBuffers(u16 flag, SColor color = SColor(255,0,0,0), f32 depth = 1.f, u8 stencil = 0) _IRR_OVERRIDE_; //! Returns an image created from the last rendered frame. virtual IImage* createScreenShot(video::ECOLOR_FORMAT format=video::ECF_UNKNOWN, video::E_RENDER_TARGET target=video::ERT_FRAME_BUFFER) _IRR_OVERRIDE_; @@ -315,9 +286,6 @@ namespace video //! Check if the driver was recently reset. virtual bool checkDriverReset() _IRR_OVERRIDE_ {return DriverWasReset;} - // removes the depth struct from the DepthSurface array - void removeDepthSurface(SDepthSurface* depth); - //! Get the current color format of the color buffer /** \return Color format of the color buffer. */ virtual ECOLOR_FORMAT getColorFormat() const _IRR_OVERRIDE_; @@ -344,11 +312,6 @@ namespace video //! Get bridge calls. CD3D9CallBridge* getBridgeCalls() const; - //! Get Cg context - #ifdef _IRR_COMPILE_WITH_CG_ - const CGcontext& getCgContext(); - #endif - private: //! enumeration for rendering modes such as 2d and 3d for minizing the switching of renderStates. @@ -385,14 +348,11 @@ namespace video //! returns a device dependent texture from a software surface (IImage) //! THIS METHOD HAS TO BE OVERRIDDEN BY DERIVED DRIVERS WITH OWN TEXTURES - virtual video::ITexture* createDeviceDependentTexture(IImage* surface, const io::path& name, void* mipmapData=0) _IRR_OVERRIDE_; + virtual video::ITexture* createDeviceDependentTexture(IImage* surface, const io::path& name) _IRR_OVERRIDE_; //! returns the current size of the screen or rendertarget virtual const core::dimension2d& getCurrentRenderTargetSize() const _IRR_OVERRIDE_; - //! Check if a proper depth buffer for the RTT is available, otherwise create it. - void checkDepthBuffer(ITexture* tex); - //! Adds a new material renderer to the VideoDriver, using pixel and/or //! vertex shaders to render geometry. s32 addShaderMaterial(const c8* vertexShaderProgram, const c8* pixelShaderProgram, @@ -455,8 +415,11 @@ namespace video IDirect3D9* pID3D; IDirect3DDevice9* pID3DDevice; - IDirect3DSurface9* PrevRenderTarget; + IDirect3DSurface9* BackBufferSurface; + IDirect3DSurface9* DepthStencilSurface; + core::dimension2d CurrentRendertargetSize; + core::array ActiveRenderTarget; HWND WindowId; core::rect* SceneSourceRect; @@ -470,12 +433,8 @@ namespace video core::stringc VendorName; u16 VendorID; - core::array DepthBuffers; - u32 MaxTextureUnits; u32 MaxUserClipPlanes; - u32 MaxMRTs; - u32 NumSetMRTs; f32 MaxLightDistance; s32 LastSetLight; @@ -492,20 +451,20 @@ namespace video bool DriverWasReset; bool OcclusionQuerySupport; bool AlphaToCoverageSupport; - - #ifdef _IRR_COMPILE_WITH_CG_ - CGcontext CgContext; - #endif }; - //! This bridge between Irlicht pseudo D3D8 calls - //! and true D3D8 calls. + //! This bridge between Irlicht pseudo D3D9 calls + //! and true D3D9 calls. class CD3D9CallBridge { public: CD3D9CallBridge(IDirect3DDevice9* p, CD3D9Driver* driver); + // Reset to default state. + + void reset(); + // Blending calls. void setBlendOperation(DWORD mode); diff --git a/source/Irrlicht/CD3D9RenderTarget.cpp b/source/Irrlicht/CD3D9RenderTarget.cpp new file mode 100644 index 00000000..2d22ca8a --- /dev/null +++ b/source/Irrlicht/CD3D9RenderTarget.cpp @@ -0,0 +1,239 @@ +// Copyright (C) 2015 Patryk Nadrowski +// This file is part of the "Irrlicht Engine". +// For conditions of distribution and use, see copyright notice in irrlicht.h + +#include "CD3D9RenderTarget.h" + +#ifdef _IRR_COMPILE_WITH_DIRECT3D_9_ + +#include "IImage.h" +#include "irrMath.h" +#include "irrString.h" + +#include "CD3D9Driver.h" +#include "CD3D9Texture.h" + +namespace irr +{ + namespace video + { + + CD3D9RenderTarget::CD3D9RenderTarget(CD3D9Driver* driver) : DepthStencilSurface(0), Driver(driver) + { +#ifdef _DEBUG + setDebugName("CD3D9RenderTarget"); +#endif + + DriverType = EDT_DIRECT3D9; + Size = Driver->getScreenSize(); + } + + CD3D9RenderTarget::~CD3D9RenderTarget() + { + for (u32 i = 0; i < Surface.size(); ++i) + { + if (Surface[i]) + Surface[i]->Release(); + } + + if (DepthStencilSurface) + DepthStencilSurface->Release(); + + for (u32 i = 0; i < Texture.size(); ++i) + { + if (Texture[i]) + Texture[i]->drop(); + } + + if (DepthStencil) + DepthStencil->drop(); + } + + void CD3D9RenderTarget::setTexture(const core::array& texture, ITexture* depthStencil) + { + bool textureUpdate = (Texture != texture) ? true : false; + bool depthStencilUpdate = (DepthStencil != depthStencil) ? true : false; + + if (textureUpdate || depthStencilUpdate) + { + // Set color attachments. + + if (textureUpdate) + { + if (texture.size() > Driver->ActiveRenderTarget.size()) + { + core::stringc message = "This GPU supports up to "; + message += Driver->ActiveRenderTarget.size(); + message += " textures per render target."; + + os::Printer::log(message.c_str(), ELL_WARNING); + } + + const u32 size = core::min_(texture.size(), static_cast(Driver->ActiveRenderTarget.size())); + + for (u32 i = 0; i < Surface.size(); ++i) + { + if (Surface[i]) + Surface[i]->Release(); + } + + Surface.set_used(size); + + for (u32 i = 0; i < Texture.size(); ++i) + { + if (Texture[i]) + Texture[i]->drop(); + } + + Texture.set_used(size); + + for (u32 i = 0; i < size; ++i) + { + IDirect3DTexture9* currentTexture = (texture[i] && texture[i]->getDriverType() == EDT_DIRECT3D9) ? + static_cast(texture[i])->getDX9Texture() : 0; + + if (currentTexture) + { + Texture[i] = texture[i]; + Texture[i]->grab(); + + IDirect3DSurface9* currentSurface = 0; + currentTexture->GetSurfaceLevel(0, ¤tSurface); + + Surface[i] = currentSurface; + } + else + { + Surface[i] = 0; + Texture[i] = 0; + } + } + } + + // Set depth and stencil attachments. + + if (depthStencilUpdate) + { + if (DepthStencilSurface) + { + DepthStencilSurface->Release(); + DepthStencilSurface = 0; + } + + if (DepthStencil) + { + DepthStencil->drop(); + DepthStencil = 0; + + DepthStencilSurface = 0; + } + + IDirect3DTexture9* currentTexture = (depthStencil && depthStencil->getDriverType() == EDT_DIRECT3D9) ? + static_cast(depthStencil)->getDX9Texture() : 0; + + const ECOLOR_FORMAT textureFormat = (depthStencil) ? depthStencil->getColorFormat() : ECF_UNKNOWN; + + if (IImage::isDepthFormat(textureFormat)) + { + DepthStencil = depthStencil; + DepthStencil->grab(); + + IDirect3DSurface9* currentSurface = 0; + currentTexture->GetSurfaceLevel(0, ¤tSurface); + + DepthStencilSurface = currentSurface; + } + } + + // Set size required for a viewport. + + bool sizeDetected = false; + + for (u32 i = 0; i < Texture.size(); ++i) + { + if (Texture[i]) + { + Size = Texture[i]->getSize(); + sizeDetected = true; + + break; + } + } + + if (!sizeDetected) + { + if (DepthStencil) + Size = DepthStencil->getSize(); + else + Size = Driver->getScreenSize(); + } + } + } + + const core::dimension2d& CD3D9RenderTarget::getSize() const + { + return Size; + } + + IDirect3DSurface9* CD3D9RenderTarget::getSurface(u32 id) const + { + return (id < Surface.size()) ? Surface[id] : 0; + } + + u32 CD3D9RenderTarget::getSurfaceCount() const + { + return Surface.size(); + } + + IDirect3DSurface9* CD3D9RenderTarget::getDepthStencilSurface() const + { + return DepthStencilSurface; + } + + void CD3D9RenderTarget::releaseSurfaces() + { + for (u32 i = 0; i < Surface.size(); ++i) + { + if (Surface[i]) + { + Surface[i]->Release(); + Surface[i] = 0; + } + } + + if (DepthStencilSurface) + { + DepthStencilSurface->Release(); + DepthStencilSurface = 0; + } + } + + void CD3D9RenderTarget::generateSurfaces() + { + for (u32 i = 0; i < Surface.size(); ++i) + { + if (!Surface[i] && Texture[i]) + { + IDirect3DTexture9* currentTexture = static_cast(Texture[i])->getDX9Texture(); + + IDirect3DSurface9* currentSurface = 0; + currentTexture->GetSurfaceLevel(0, ¤tSurface); + + Surface[i] = currentSurface; + } + } + + if (!DepthStencilSurface && DepthStencil) + { + IDirect3DTexture9* currentTexture = static_cast(DepthStencil)->getDX9Texture(); + + IDirect3DSurface9* currentSurface = 0; + currentTexture->GetSurfaceLevel(0, ¤tSurface); + + DepthStencilSurface = currentSurface; + } + } + } +} + +#endif diff --git a/source/Irrlicht/CD3D9RenderTarget.h b/source/Irrlicht/CD3D9RenderTarget.h new file mode 100644 index 00000000..2d076b39 --- /dev/null +++ b/source/Irrlicht/CD3D9RenderTarget.h @@ -0,0 +1,60 @@ +// Copyright (C) 2015 Patryk Nadrowski +// This file is part of the "Irrlicht Engine". +// For conditions of distribution and use, see copyright notice in irrlicht.h + +#ifndef __C_OPEN_GL_RENDER_TARGET_H_INCLUDED__ +#define __C_OPEN_GL_RENDER_TARGET_H_INCLUDED__ + +#include "IrrCompileConfig.h" + +#ifdef _IRR_COMPILE_WITH_DIRECT3D_9_ + +#include "IRenderTarget.h" + +#include "dimension2d.h" +#include "os.h" + +#include + +namespace irr +{ + namespace video + { + + class CD3D9Driver; + + class CD3D9RenderTarget : public IRenderTarget + { + public: + CD3D9RenderTarget(CD3D9Driver* driver); + virtual ~CD3D9RenderTarget(); + + virtual void setTexture(const core::array& texture, ITexture* depthStencil) _IRR_OVERRIDE_; + + const core::dimension2d& getSize() const; + + IDirect3DSurface9* getSurface(u32 id) const; + + u32 getSurfaceCount() const; + + IDirect3DSurface9* getDepthStencilSurface() const; + + void releaseSurfaces(); + + void generateSurfaces(); + + protected: + core::dimension2d Size; + + core::array Surface; + + IDirect3DSurface9* DepthStencilSurface; + + CD3D9Driver* Driver; + }; + + } +} + +#endif +#endif diff --git a/source/Irrlicht/CD3D9Texture.cpp b/source/Irrlicht/CD3D9Texture.cpp index 2d4a8c43..6844e149 100644 --- a/source/Irrlicht/CD3D9Texture.cpp +++ b/source/Irrlicht/CD3D9Texture.cpp @@ -12,85 +12,71 @@ #include -#ifndef _IRR_COMPILE_WITH_DIRECT3D_8_ -// The D3DXFilterTexture function seems to get linked wrong when -// compiling with both D3D8 and 9, causing it not to work in the D3D9 device. -// So mipmapgeneration is replaced with my own bad generation in d3d 8 when -// compiling with both D3D 8 and 9. -// #define _IRR_USE_D3DXFilterTexture_ -#endif // _IRR_COMPILE_WITH_DIRECT3D_8_ - -#ifdef _IRR_USE_D3DXFilterTexture_ -#pragma comment(lib, "d3dx9.lib") -#endif - namespace irr { namespace video { //! rendertarget constructor -CD3D9Texture::CD3D9Texture(CD3D9Driver* driver, const core::dimension2d& size, - const io::path& name, const ECOLOR_FORMAT format) -: ITexture(name), Texture(0), RTTSurface(0), Driver(driver), DepthSurface(0), - TextureSize(size), ImageSize(size), Pitch(0), ColorFormat(ECF_UNKNOWN), - HasMipMaps(false), HardwareMipMaps(false), IsRenderTarget(true), IsCompressed(false) +CD3D9Texture::CD3D9Texture(CD3D9Driver* driver, const core::dimension2d& size, const io::path& name, const ECOLOR_FORMAT format) + : ITexture(name), Texture(0), RTTSurface(0), Driver(driver), HardwareMipMaps(false), IsCompressed(false) { - #ifdef _DEBUG +#ifdef _DEBUG setDebugName("CD3D9Texture"); - #endif +#endif Device=driver->getExposedVideoData().D3D9.D3DDev9; if (Device) Device->AddRef(); + DriverType = EDT_DIRECT3D9; + OriginalSize = size; + Size = size; + IsRenderTarget = true; + createRenderTarget(format); } //! constructor -CD3D9Texture::CD3D9Texture(IImage* image, CD3D9Driver* driver, - u32 flags, const io::path& name, void* mipmapData) -: ITexture(name), Texture(0), RTTSurface(0), Driver(driver), DepthSurface(0), - TextureSize(0,0), ImageSize(0,0), Pitch(0), ColorFormat(ECF_UNKNOWN), - HasMipMaps(false), HardwareMipMaps(false), IsRenderTarget(false), IsCompressed(false) +CD3D9Texture::CD3D9Texture(IImage* image, CD3D9Driver* driver, u32 flags, const io::path& name) + : ITexture(name), Texture(0), RTTSurface(0), Driver(driver), HardwareMipMaps(false), IsCompressed(false) { - #ifdef _DEBUG +#ifdef _DEBUG setDebugName("CD3D9Texture"); - #endif +#endif + DriverType = EDT_DIRECT3D9; HasMipMaps = Driver->getTextureCreationFlag(video::ETCF_CREATE_MIP_MAPS); Device=driver->getExposedVideoData().D3D9.D3DDev9; if (Device) Device->AddRef(); - IsCompressed = IImage::isCompressedFormat(image->getColorFormat()); - - if (createTexture(flags, image)) + if (image) { - if (copyTexture(image)) + if (IImage::isCompressedFormat(image->getColorFormat())) { - if (IsCompressed && !mipmapData) - if (HasMipMaps && image->hasMipMaps()) - { - u32 compressedDataSize = 0; + if(!Driver->queryFeature(EVDF_TEXTURE_COMPRESSED_DXT)) + { + os::Printer::log("DXT texture compression not available.", ELL_ERROR); + return; + } + } - if(ColorFormat == ECF_DXT1) - compressedDataSize = ((image->getDimension().Width + 3) / 4) * ((image->getDimension().Height + 3) / 4) * 8; - else if (ColorFormat == ECF_DXT2 || ColorFormat == ECF_DXT3 || ColorFormat == ECF_DXT4 || ColorFormat == ECF_DXT5) - compressedDataSize = ((image->getDimension().Width + 3) / 4) * ((image->getDimension().Height + 3) / 4) * 16; - - mipmapData = static_cast(image->lock())+compressedDataSize; - } - else + if (createTexture(flags, image)) + { + if (copyTexture(image)) + { + if (IsCompressed && !image->getMipMapsData()) HasMipMaps = false; - regenerateMipMapLevels(mipmapData); + regenerateMipMapLevels(image->getMipMapsData()); + } } + else + os::Printer::log("Could not create DIRECT3D9 Texture.", ELL_WARNING); } - else - os::Printer::log("Could not create DIRECT3D9 Texture.", ELL_WARNING); } @@ -103,15 +89,6 @@ CD3D9Texture::~CD3D9Texture() if (RTTSurface) RTTSurface->Release(); - // if this texture was the last one using the depth buffer - // we can release the surface. We only use the value of the pointer - // hence it is safe to use the dropped pointer... - if (DepthSurface) - { - if (DepthSurface->drop()) - Driver->removeDepthSurface(DepthSurface); - } - if (Device) Device->Release(); } @@ -122,10 +99,11 @@ void CD3D9Texture::createRenderTarget(const ECOLOR_FORMAT format) // are texture size restrictions there ? if(!Driver->queryFeature(EVDF_TEXTURE_NPOT)) { - if (TextureSize != ImageSize) + if (Size != OriginalSize) os::Printer::log("RenderTarget size has to be a power of two", ELL_INFORMATION); } - TextureSize = TextureSize.getOptimalSize(!Driver->queryFeature(EVDF_TEXTURE_NPOT), !Driver->queryFeature(EVDF_TEXTURE_NSQUARE), true, Driver->Caps.MaxTextureWidth); + + Size = Size.getOptimalSize(!Driver->queryFeature(EVDF_TEXTURE_NPOT), !Driver->queryFeature(EVDF_TEXTURE_NSQUARE), true, Driver->Caps.MaxTextureWidth); D3DFORMAT d3dformat = Driver->getD3DColorFormat(); @@ -150,17 +128,9 @@ void CD3D9Texture::createRenderTarget(const ECOLOR_FORMAT format) } // create texture - HRESULT hr; + DWORD usage = (IImage::isDepthFormat(ColorFormat)) ? D3DUSAGE_DEPTHSTENCIL : D3DUSAGE_RENDERTARGET; - hr = Device->CreateTexture( - TextureSize.Width, - TextureSize.Height, - 1, // mip map level count, we don't want mipmaps here - D3DUSAGE_RENDERTARGET, - d3dformat, - D3DPOOL_DEFAULT, - &Texture, - NULL); + HRESULT hr = Device->CreateTexture(Size.Width, Size.Height, 1, usage, d3dformat, D3DPOOL_DEFAULT, &Texture, NULL); if (FAILED(hr)) { @@ -280,9 +250,9 @@ bool CD3D9Texture::createMipMaps(u32 level) //! creates the hardware texture bool CD3D9Texture::createTexture(u32 flags, IImage * image) { - ImageSize = image->getDimension(); + OriginalSize = image->getDimension(); - core::dimension2d optSize = ImageSize.getOptimalSize(!Driver->queryFeature(EVDF_TEXTURE_NPOT), !Driver->queryFeature(EVDF_TEXTURE_NSQUARE), true, Driver->Caps.MaxTextureWidth); + core::dimension2d optSize = OriginalSize.getOptimalSize(!Driver->queryFeature(EVDF_TEXTURE_NPOT), !Driver->queryFeature(EVDF_TEXTURE_NSQUARE), true, Driver->Caps.MaxTextureWidth); D3DFORMAT format = D3DFMT_A1R5G5B5; @@ -319,7 +289,7 @@ bool CD3D9Texture::createTexture(u32 flags, IImage * image) format = D3DFMT_R5G6B5; } - if(image->getColorFormat() == ECF_DXT1 || image->getColorFormat() == ECF_DXT2 || image->getColorFormat() == ECF_DXT3 || image->getColorFormat() == ECF_DXT4 || image->getColorFormat() == ECF_DXT5) + if (IImage::isCompressedFormat(image->getColorFormat())) { ColorFormat = image->getColorFormat(); @@ -406,8 +376,8 @@ bool CD3D9Texture::copyTexture(IImage * image) D3DSURFACE_DESC desc; Texture->GetLevelDesc(0, &desc); - TextureSize.Width = desc.Width; - TextureSize.Height = desc.Height; + Size.Width = desc.Width; + Size.Height = desc.Height; D3DLOCKED_RECT rect; HRESULT hr = Texture->LockRect(0, &rect, 0, 0); @@ -419,13 +389,13 @@ bool CD3D9Texture::copyTexture(IImage * image) if (IsCompressed) { - u32 compressedDataSize = IImage::getCompressedImageSize(ColorFormat, TextureSize.Width, TextureSize.Height); + u32 compressedDataSize = IImage::getDataSizeFromFormat(ColorFormat, Size.Width, Size.Height); memcpy(rect.pBits, image->lock(), compressedDataSize); } else { Pitch = rect.Pitch; - image->copyToScaling(rect.pBits, TextureSize.Width, TextureSize.Height, ColorFormat, Pitch); + image->copyToScaling(rect.pBits, Size.Width, Size.Height, ColorFormat, Pitch); } hr = Texture->UnlockRect(0); @@ -517,55 +487,13 @@ void CD3D9Texture::unlock() } -//! Returns original size of the texture. -const core::dimension2d& CD3D9Texture::getOriginalSize() const -{ - return ImageSize; -} - - -//! Returns (=size) of the texture. -const core::dimension2d& CD3D9Texture::getSize() const -{ - return TextureSize; -} - - -//! returns driver type of texture (=the driver, who created the texture) -E_DRIVER_TYPE CD3D9Texture::getDriverType() const -{ - return EDT_DIRECT3D9; -} - - -//! returns color format of texture -ECOLOR_FORMAT CD3D9Texture::getColorFormat() const -{ - return ColorFormat; -} - - -//! returns pitch of texture (in bytes) -u32 CD3D9Texture::getPitch() const -{ - return Pitch; -} - - //! returns the DIRECT3D9 Texture -IDirect3DBaseTexture9* CD3D9Texture::getDX9Texture() const +IDirect3DTexture9* CD3D9Texture::getDX9Texture() const { return Texture; } -//! returns if texture has mipmap levels -bool CD3D9Texture::hasMipMaps() const -{ - return HasMipMaps; -} - - void CD3D9Texture::copy16BitMipMap(char* src, char* tgt, const s32 srcWidth, const s32 srcHeight, const s32 width, const s32 height, @@ -671,7 +599,7 @@ void CD3D9Texture::regenerateMipMapLevels(void* mipmapData) if (mipmapData) { u32 compressedDataSize = 0; - core::dimension2du size = TextureSize; + core::dimension2du size = Size; u32 level=0; do { @@ -712,8 +640,8 @@ void CD3D9Texture::regenerateMipMapLevels(void* mipmapData) } else { - memcpy(miplr.pBits, mipmapData, size.getArea()*getPitch()/TextureSize.Width); - mipmapData = (u8*)mipmapData+size.getArea()*getPitch()/TextureSize.Width; + memcpy(miplr.pBits, mipmapData, size.getArea()*getPitch() / Size.Width); + mipmapData = (u8*)mipmapData + size.getArea()*getPitch() / Size.Width; } // unlock @@ -724,70 +652,38 @@ void CD3D9Texture::regenerateMipMapLevels(void* mipmapData) } else if (HasMipMaps) { - // create mip maps. -#ifdef _IRR_USE_D3DXFilterTexture_ - // The D3DXFilterTexture function seems to get linked wrong when - // compiling with both D3D8 and 9, causing it not to work in the D3D9 device. - // So mipmapgeneration is replaced with my own bad generation - HRESULT hr = D3DXFilterTexture(Texture, NULL, D3DX_DEFAULT, D3DX_DEFAULT); - if (FAILED(hr)) -#endif createMipMaps(); } } -//! returns if it is a render target -bool CD3D9Texture::isRenderTarget() const -{ - return IsRenderTarget; -} - - -//! Returns pointer to the render target surface -IDirect3DSurface9* CD3D9Texture::getRenderTargetSurface() -{ - if (!IsRenderTarget) - return 0; - - IDirect3DSurface9 *pRTTSurface = 0; - if (Texture) - Texture->GetSurfaceLevel(0, &pRTTSurface); - - if (pRTTSurface) - pRTTSurface->Release(); - - return pRTTSurface; -} - - void CD3D9Texture::setPitch(D3DFORMAT d3dformat) { switch(d3dformat) { case D3DFMT_X1R5G5B5: case D3DFMT_A1R5G5B5: - Pitch = TextureSize.Width * 2; + Pitch = Size.Width * 2; break; case D3DFMT_A8B8G8R8: case D3DFMT_A8R8G8B8: case D3DFMT_X8R8G8B8: - Pitch = TextureSize.Width * 4; + Pitch = Size.Width * 4; break; case D3DFMT_R5G6B5: - Pitch = TextureSize.Width * 2; + Pitch = Size.Width * 2; break; case D3DFMT_R8G8B8: - Pitch = TextureSize.Width * 3; + Pitch = Size.Width * 3; break; case D3DFMT_DXT1: - Pitch = TextureSize.Width * 2; + Pitch = Size.Width * 2; break; case D3DFMT_DXT2: case D3DFMT_DXT3: case D3DFMT_DXT4: case D3DFMT_DXT5: - Pitch = TextureSize.Width * 4; + Pitch = Size.Width * 4; default: Pitch = 0; }; diff --git a/source/Irrlicht/CD3D9Texture.h b/source/Irrlicht/CD3D9Texture.h index 40f8767e..e1f69c0e 100644 --- a/source/Irrlicht/CD3D9Texture.h +++ b/source/Irrlicht/CD3D9Texture.h @@ -32,7 +32,7 @@ public: //! constructor CD3D9Texture(IImage* image, CD3D9Driver* driver, - u32 flags, const io::path& name, void* mipmapData=0); + u32 flags, const io::path& name); //! rendertarget constructor CD3D9Texture(CD3D9Driver* driver, const core::dimension2d& size, const io::path& name, @@ -47,36 +47,12 @@ public: //! unlock function virtual void unlock() _IRR_OVERRIDE_; - //! Returns original size of the texture. - virtual const core::dimension2d& getOriginalSize() const _IRR_OVERRIDE_; - - //! Returns (=size) of the texture. - virtual const core::dimension2d& getSize() const _IRR_OVERRIDE_; - - //! returns driver type of texture (=the driver, who created the texture) - virtual E_DRIVER_TYPE getDriverType() const _IRR_OVERRIDE_; - - //! returns color format of texture - virtual ECOLOR_FORMAT getColorFormat() const _IRR_OVERRIDE_; - - //! returns pitch of texture (in bytes) - virtual u32 getPitch() const _IRR_OVERRIDE_; - - //! returns the DIRECT3D9 Texture - IDirect3DBaseTexture9* getDX9Texture() const; - - //! returns if texture has mipmap levels - bool hasMipMaps() const; - //! Regenerates the mip map levels of the texture. Useful after locking and //! modifying the texture - virtual void regenerateMipMapLevels(void* mipmapData=0) _IRR_OVERRIDE_; + virtual void regenerateMipMapLevels(void* mipmapData = 0) _IRR_OVERRIDE_; - //! returns if it is a render target - virtual bool isRenderTarget() const _IRR_OVERRIDE_; - - //! Returns pointer to the render target surface - IDirect3DSurface9* getRenderTargetSurface(); + //! returns the DIRECT3D9 Texture + IDirect3DTexture9* getDX9Texture() const; private: friend class CD3D9Driver; @@ -111,16 +87,9 @@ private: IDirect3DTexture9* Texture; IDirect3DSurface9* RTTSurface; CD3D9Driver* Driver; - SDepthSurface* DepthSurface; - core::dimension2d TextureSize; - core::dimension2d ImageSize; - s32 Pitch; u32 MipLevelLocked; - ECOLOR_FORMAT ColorFormat; - bool HasMipMaps; bool HardwareMipMaps; - bool IsRenderTarget; bool IsCompressed; }; diff --git a/source/Irrlicht/CDepthBuffer.cpp b/source/Irrlicht/CDepthBuffer.cpp index 86581056..e9126bda 100644 --- a/source/Irrlicht/CDepthBuffer.cpp +++ b/source/Irrlicht/CDepthBuffer.cpp @@ -30,8 +30,7 @@ CDepthBuffer::CDepthBuffer(const core::dimension2d& size) //! destructor CDepthBuffer::~CDepthBuffer() { - if (Buffer) - delete [] Buffer; + delete [] Buffer; } @@ -62,8 +61,7 @@ void CDepthBuffer::setSize(const core::dimension2d& size) Size = size; - if (Buffer) - delete [] Buffer; + delete [] Buffer; Pitch = size.Width * sizeof ( fp24 ); TotalSize = Pitch * size.Height; @@ -97,8 +95,7 @@ CStencilBuffer::CStencilBuffer(const core::dimension2d& size) //! destructor CStencilBuffer::~CStencilBuffer() { - if (Buffer) - delete [] Buffer; + delete [] Buffer; } @@ -119,8 +116,7 @@ void CStencilBuffer::setSize(const core::dimension2d& size) Size = size; - if (Buffer) - delete [] Buffer; + delete [] Buffer; Pitch = size.Width * sizeof ( u32 ); TotalSize = Pitch * size.Height; diff --git a/source/Irrlicht/CEGLManager.h b/source/Irrlicht/CEGLManager.h index 5a117b24..856de137 100755 --- a/source/Irrlicht/CEGLManager.h +++ b/source/Irrlicht/CEGLManager.h @@ -9,7 +9,7 @@ #ifdef _IRR_COMPILE_WITH_EGL_MANAGER_ -#if defined(_IRR_COMPILE_WITH_ANDROID_DEVICE_) || defined(_IRR_COMPILE_WITH_FB_DEVICE_) +#if defined(_IRR_COMPILE_WITH_ANDROID_DEVICE_) || defined(_IRR_COMPILE_WITH_FB_DEVICE_) || defined(_IRR_COMPILE_WITH_WINDOWS_DEVICE_) #include #else #include diff --git a/source/Irrlicht/CFileList.cpp b/source/Irrlicht/CFileList.cpp index 18940d42..15d5410e 100644 --- a/source/Irrlicht/CFileList.cpp +++ b/source/Irrlicht/CFileList.cpp @@ -107,7 +107,6 @@ bool CFileList::isDirectory(u32 index) const if (index < Files.size()) ret = Files[index].IsDirectory; - _IRR_IMPLEMENT_MANAGED_MARSHALLING_BUGFIX; return ret; } @@ -117,7 +116,6 @@ u32 CFileList::getFileSize(u32 index) const return index < Files.size() ? Files[index].Size : 0; } -//! Returns the size of a file u32 CFileList::getFileOffset(u32 index) const { return index < Files.size() ? Files[index].Offset : 0; diff --git a/source/Irrlicht/CFileList.h b/source/Irrlicht/CFileList.h index d3536ad6..228f231b 100644 --- a/source/Irrlicht/CFileList.h +++ b/source/Irrlicht/CFileList.h @@ -105,7 +105,7 @@ public: //! Returns the size of a file virtual u32 getFileSize(u32 index) const _IRR_OVERRIDE_; - //! Returns the offest of a file + //! Returns the offset of a file virtual u32 getFileOffset(u32 index) const _IRR_OVERRIDE_; //! Searches for a file or folder within the list, returns the index diff --git a/source/Irrlicht/CFileSystem.cpp b/source/Irrlicht/CFileSystem.cpp index 9ed40862..da89bc30 100644 --- a/source/Irrlicht/CFileSystem.cpp +++ b/source/Irrlicht/CFileSystem.cpp @@ -315,7 +315,6 @@ bool CFileSystem::addFileArchive(const io::path& filename, bool ignoreCase, os::Printer::log("Could not create archive for", filename, ELL_ERROR); } - _IRR_IMPLEMENT_MANAGED_MARSHALLING_BUGFIX; return ret; } @@ -429,22 +428,14 @@ bool CFileSystem::addFileArchive(IReadFile* file, bool ignoreCase, //! Adds an archive to the file system. bool CFileSystem::addFileArchive(IFileArchive* archive) { - if ( !archive ) - { - _IRR_IMPLEMENT_MANAGED_MARSHALLING_BUGFIX; - return false; - } - for (u32 i=0; i < FileArchives.size(); ++i) + for (u32 i = 0; i < FileArchives.size(); ++i) { if (archive == FileArchives[i]) { - _IRR_IMPLEMENT_MANAGED_MARSHALLING_BUGFIX; return false; } } - archive->grab(); FileArchives.push_back(archive); - _IRR_IMPLEMENT_MANAGED_MARSHALLING_BUGFIX; return true; } @@ -459,7 +450,6 @@ bool CFileSystem::removeFileArchive(u32 index) FileArchives.erase(index); ret = true; } - _IRR_IMPLEMENT_MANAGED_MARSHALLING_BUGFIX; return ret; } @@ -473,7 +463,6 @@ bool CFileSystem::removeFileArchive(const io::path& filename) if (absPath == FileArchives[i]->getFileList()->getPath()) return removeFileArchive(i); } - _IRR_IMPLEMENT_MANAGED_MARSHALLING_BUGFIX; return false; } @@ -485,11 +474,9 @@ bool CFileSystem::removeFileArchive(const IFileArchive* archive) { if (archive == FileArchives[i]) { - _IRR_IMPLEMENT_MANAGED_MARSHALLING_BUGFIX; return removeFileArchive(i); } } - _IRR_IMPLEMENT_MANAGED_MARSHALLING_BUGFIX; return false; } @@ -518,9 +505,7 @@ const io::path& CFileSystem::getWorkingDirectory() } else { - #if defined(_IRR_WINDOWS_CE_PLATFORM_) - // does not need this - #elif defined(_IRR_WINDOWS_API_) + #if defined(_IRR_WINDOWS_API_) fschar_t tmp[_MAX_PATH]; #if defined(_IRR_WCHAR_FILESYSTEM ) _wgetcwd(tmp, _MAX_PATH); @@ -593,9 +578,7 @@ bool CFileSystem::changeWorkingDirectoryTo(const io::path& newDirectory) { WorkingDirectory[FILESYSTEM_NATIVE] = newDirectory; -#if defined(_IRR_WINDOWS_CE_PLATFORM_) - success = true; -#elif defined(_MSC_VER) +#if defined(_MSC_VER) #if defined(_IRR_WCHAR_FILESYSTEM) success = (_wchdir(newDirectory.c_str()) == 0); #else @@ -616,9 +599,7 @@ bool CFileSystem::changeWorkingDirectoryTo(const io::path& newDirectory) io::path CFileSystem::getAbsolutePath(const io::path& filename) const { -#if defined(_IRR_WINDOWS_CE_PLATFORM_) - return filename; -#elif defined(_IRR_WINDOWS_API_) +#if defined(_IRR_WINDOWS_API_) fschar_t *p=0; fschar_t fpath[_MAX_PATH]; #if defined(_IRR_WCHAR_FILESYSTEM ) @@ -966,21 +947,6 @@ bool CFileSystem::existFile(const io::path& filename) const if (FileArchives[i]->getFileList()->findFile(filename)!=-1) return true; -#if defined(_IRR_WINDOWS_CE_PLATFORM_) -#if defined(_IRR_WCHAR_FILESYSTEM) - HANDLE hFile = CreateFileW(filename.c_str(), GENERIC_READ, FILE_SHARE_READ, NULL, OPEN_EXISTING, 0, NULL); -#else - HANDLE hFile = CreateFileW(core::stringw(filename).c_str(), GENERIC_READ, FILE_SHARE_READ, NULL, OPEN_EXISTING, 0, NULL); -#endif - if (hFile == INVALID_HANDLE_VALUE) - return false; - else - { - CloseHandle(hFile); - return true; - } -#else - _IRR_IMPLEMENT_MANAGED_MARSHALLING_BUGFIX; #if defined(_MSC_VER) #if defined(_IRR_WCHAR_FILESYSTEM) return (_waccess(filename.c_str(), 0) != -1); @@ -996,7 +962,6 @@ bool CFileSystem::existFile(const io::path& filename) const #else return (access(filename.c_str(), 0) != -1); #endif -#endif } diff --git a/source/Irrlicht/CGUIButton.cpp b/source/Irrlicht/CGUIButton.cpp index ba26bdf9..7b5c944e 100644 --- a/source/Irrlicht/CGUIButton.cpp +++ b/source/Irrlicht/CGUIButton.cpp @@ -57,7 +57,6 @@ void CGUIButton::setScaleImage(bool scaleImage) //! Returns whether the button scale the used images bool CGUIButton::isScalingImage() const { - _IRR_IMPLEMENT_MANAGED_MARSHALLING_BUGFIX; return ScaleImage; } @@ -476,7 +475,6 @@ void CGUIButton::setIsPushButton(bool isPushButton) //! Returns if the button is currently pressed bool CGUIButton::isPressed() const { - _IRR_IMPLEMENT_MANAGED_MARSHALLING_BUGFIX; return Pressed; } @@ -495,7 +493,6 @@ void CGUIButton::setPressed(bool pressed) //! Returns whether the button is a push button bool CGUIButton::isPushButton() const { - _IRR_IMPLEMENT_MANAGED_MARSHALLING_BUGFIX; return IsPushButton; } @@ -510,14 +507,12 @@ void CGUIButton::setUseAlphaChannel(bool useAlphaChannel) //! Returns if the alpha channel should be used for drawing images on the button bool CGUIButton::isAlphaChannelUsed() const { - _IRR_IMPLEMENT_MANAGED_MARSHALLING_BUGFIX; return UseAlphaChannel; } bool CGUIButton::isDrawingBorder() const { - _IRR_IMPLEMENT_MANAGED_MARSHALLING_BUGFIX; return DrawBorder; } diff --git a/source/Irrlicht/CGUICheckBox.cpp b/source/Irrlicht/CGUICheckBox.cpp index 98aad3a2..9fc6dc79 100644 --- a/source/Irrlicht/CGUICheckBox.cpp +++ b/source/Irrlicht/CGUICheckBox.cpp @@ -197,7 +197,6 @@ void CGUICheckBox::setChecked(bool checked) //! returns if box is checked bool CGUICheckBox::isChecked() const { - _IRR_IMPLEMENT_MANAGED_MARSHALLING_BUGFIX; return Checked; } diff --git a/source/Irrlicht/CGUIColorSelectDialog.cpp b/source/Irrlicht/CGUIColorSelectDialog.cpp index 9e1afb2c..29c5482d 100644 --- a/source/Irrlicht/CGUIColorSelectDialog.cpp +++ b/source/Irrlicht/CGUIColorSelectDialog.cpp @@ -267,8 +267,6 @@ void CGUIColorSelectDialog::buildColorRing( const core::dimension2d & dim, } } - RawTexture->unlock (); - if ( supersample > 1 ) { video::IImage * filter = driver->createImage(video::ECF_A8R8G8B8, dim ); diff --git a/source/Irrlicht/CGUIComboBox.cpp b/source/Irrlicht/CGUIComboBox.cpp index 44d92e44..1c46b9eb 100644 --- a/source/Irrlicht/CGUIComboBox.cpp +++ b/source/Irrlicht/CGUIComboBox.cpp @@ -24,7 +24,8 @@ CGUIComboBox::CGUIComboBox(IGUIEnvironment* environment, IGUIElement* parent, s32 id, core::rect rectangle) : IGUIComboBox(environment, parent, id, rectangle), ListButton(0), SelectedText(0), ListBox(0), LastFocus(0), - Selected(-1), HAlign(EGUIA_UPPERLEFT), VAlign(EGUIA_CENTER), MaxSelectionRows(5), HasFocus(false) + Selected(-1), HAlign(EGUIA_UPPERLEFT), VAlign(EGUIA_CENTER), MaxSelectionRows(5), HasFocus(false), + ActiveFont(0) { #ifdef _DEBUG setDebugName("CGUIComboBox"); @@ -384,6 +385,16 @@ void CGUIComboBox::draw() return; IGUISkin* skin = Environment->getSkin(); + + // font changed while the listbox is open? + if ( ActiveFont != skin->getFont() && ListBox ) + { + // close and re-open to use new font-size + openCloseMenu(); + openCloseMenu(); + } + + IGUIElement *currentFocus = Environment->getFocus(); if (currentFocus != LastFocus) { @@ -441,9 +452,9 @@ void CGUIComboBox::openCloseMenu() if (h == 0) h = 1; - IGUIFont* font = skin->getFont(); - if (font) - h *= (font->getDimension(L"A").Height + 4); + ActiveFont = skin->getFont(); + if (ActiveFont) + h *= (ActiveFont->getDimension(L"A").Height + 4); // open list box core::rect r(0, AbsoluteRect.getHeight(), diff --git a/source/Irrlicht/CGUIComboBox.h b/source/Irrlicht/CGUIComboBox.h index a930c6dd..f113f2a8 100644 --- a/source/Irrlicht/CGUIComboBox.h +++ b/source/Irrlicht/CGUIComboBox.h @@ -105,6 +105,7 @@ namespace gui EGUI_ALIGNMENT HAlign, VAlign; u32 MaxSelectionRows; bool HasFocus; + IGUIFont* ActiveFont; }; diff --git a/source/Irrlicht/CGUIContextMenu.cpp b/source/Irrlicht/CGUIContextMenu.cpp index 67631e78..bbc003ac 100644 --- a/source/Irrlicht/CGUIContextMenu.cpp +++ b/source/Irrlicht/CGUIContextMenu.cpp @@ -201,11 +201,9 @@ bool CGUIContextMenu::isItemEnabled(u32 idx) const { if (idx >= Items.size()) { - _IRR_IMPLEMENT_MANAGED_MARSHALLING_BUGFIX; return false; } - _IRR_IMPLEMENT_MANAGED_MARSHALLING_BUGFIX; return Items[idx].Enabled; } @@ -215,11 +213,9 @@ bool CGUIContextMenu::isItemChecked(u32 idx) const { if (idx >= Items.size()) { - _IRR_IMPLEMENT_MANAGED_MARSHALLING_BUGFIX; return false; } - _IRR_IMPLEMENT_MANAGED_MARSHALLING_BUGFIX; return Items[idx].Checked; } diff --git a/source/Irrlicht/CGUIEditBox.cpp b/source/Irrlicht/CGUIEditBox.cpp index 97418ee4..381301e9 100644 --- a/source/Irrlicht/CGUIEditBox.cpp +++ b/source/Irrlicht/CGUIEditBox.cpp @@ -153,7 +153,6 @@ void CGUIEditBox::enableOverrideColor(bool enable) bool CGUIEditBox::isOverrideColorEnabled() const { - _IRR_IMPLEMENT_MANAGED_MARSHALLING_BUGFIX; return OverrideColorEnabled; } @@ -181,7 +180,6 @@ void CGUIEditBox::updateAbsolutePosition() //! Checks if word wrap is enabled bool CGUIEditBox::isWordWrapEnabled() const { - _IRR_IMPLEMENT_MANAGED_MARSHALLING_BUGFIX; return WordWrap; } @@ -197,7 +195,6 @@ void CGUIEditBox::setMultiLine(bool enable) //! Checks if multi line editing is enabled bool CGUIEditBox::isMultiLineEnabled() const { - _IRR_IMPLEMENT_MANAGED_MARSHALLING_BUGFIX; return MultiLine; } @@ -217,7 +214,6 @@ void CGUIEditBox::setPasswordBox(bool passwordBox, wchar_t passwordChar) bool CGUIEditBox::isPasswordBox() const { - _IRR_IMPLEMENT_MANAGED_MARSHALLING_BUGFIX; return PasswordBox; } @@ -1014,7 +1010,6 @@ void CGUIEditBox::setAutoScroll(bool enable) //! \return true if automatic scrolling is enabled, false if not bool CGUIEditBox::isAutoScrollEnabled() const { - _IRR_IMPLEMENT_MANAGED_MARSHALLING_BUGFIX; return AutoScroll; } diff --git a/source/Irrlicht/CGUIEnvironment.cpp b/source/Irrlicht/CGUIEnvironment.cpp index 6898cacb..eb07cfac 100644 --- a/source/Irrlicht/CGUIEnvironment.cpp +++ b/source/Irrlicht/CGUIEnvironment.cpp @@ -57,7 +57,7 @@ const io::path CGUIEnvironment::DefaultFontName = "#DefaultFont"; //! constructor CGUIEnvironment::CGUIEnvironment(io::IFileSystem* fs, video::IVideoDriver* driver, IOSOperator* op) -: IGUIElement(EGUIET_ROOT, 0, 0, 0, core::rect(core::position2d(0,0), driver ? core::dimension2d(driver->getScreenSize()) : core::dimension2d(0,0))), +: IGUIElement(EGUIET_ROOT, 0, 0, 0, core::rect(driver ? core::dimension2d(driver->getScreenSize()) : core::dimension2d(0,0))), Driver(driver), Hovered(0), HoveredNoSubelement(0), Focus(0), LastHoveredMousePos(0,0), CurrentSkin(0), FileSystem(fs), UserReceiver(0), Operator(op), FocusFlags(EFF_SET_ON_LMOUSE_DOWN|EFF_SET_ON_TAB) { @@ -221,7 +221,6 @@ bool CGUIEnvironment::setFocus(IGUIElement* element) { if (Focus == element) { - _IRR_IMPLEMENT_MANAGED_MARSHALLING_BUGFIX; return false; } @@ -249,7 +248,6 @@ bool CGUIEnvironment::setFocus(IGUIElement* element) if (element) element->drop(); currentFocus->drop(); - _IRR_IMPLEMENT_MANAGED_MARSHALLING_BUGFIX; return false; } currentFocus->drop(); @@ -274,7 +272,6 @@ bool CGUIEnvironment::setFocus(IGUIElement* element) element->drop(); if (currentFocus) currentFocus->drop(); - _IRR_IMPLEMENT_MANAGED_MARSHALLING_BUGFIX; return false; } } @@ -317,7 +314,6 @@ bool CGUIEnvironment::removeFocus(IGUIElement* element) e.GUIEvent.EventType = EGET_ELEMENT_FOCUS_LOST; if (Focus->OnEvent(e)) { - _IRR_IMPLEMENT_MANAGED_MARSHALLING_BUGFIX; return false; } } @@ -334,7 +330,6 @@ bool CGUIEnvironment::removeFocus(IGUIElement* element) //! Returns whether the element has focus bool CGUIEnvironment::hasFocus(const IGUIElement* element, bool checkSubElements) const { - _IRR_IMPLEMENT_MANAGED_MARSHALLING_BUGFIX; if (element == Focus) return true; @@ -414,7 +409,6 @@ bool CGUIEnvironment::OnEvent(const SEvent& event) ret = UserReceiver->OnEvent(event); } - _IRR_IMPLEMENT_MANAGED_MARSHALLING_BUGFIX; return ret; } @@ -608,7 +602,6 @@ bool CGUIEnvironment::postEventFromUser(const SEvent& event) // focus could have died in last call if (!Focus && Hovered) { - _IRR_IMPLEMENT_MANAGED_MARSHALLING_BUGFIX; return Hovered->OnEvent(event); } @@ -638,7 +631,6 @@ bool CGUIEnvironment::postEventFromUser(const SEvent& event) break; } // end switch - _IRR_IMPLEMENT_MANAGED_MARSHALLING_BUGFIX; return false; } @@ -751,13 +743,11 @@ bool CGUIEnvironment::saveGUI(const io::path& filename, IGUIElement* start) io::IWriteFile* file = FileSystem->createAndWriteFile(filename); if (!file) { - _IRR_IMPLEMENT_MANAGED_MARSHALLING_BUGFIX; return false; } bool ret = saveGUI(file, start); file->drop(); - _IRR_IMPLEMENT_MANAGED_MARSHALLING_BUGFIX; return ret; } @@ -767,14 +757,12 @@ bool CGUIEnvironment::saveGUI(io::IWriteFile* file, IGUIElement* start) { if (!file) { - _IRR_IMPLEMENT_MANAGED_MARSHALLING_BUGFIX; return false; } io::IXMLWriter* writer = FileSystem->createXMLWriter(file); if (!writer) { - _IRR_IMPLEMENT_MANAGED_MARSHALLING_BUGFIX; return false; } @@ -794,14 +782,12 @@ bool CGUIEnvironment::loadGUI(const io::path& filename, IGUIElement* parent) if (!read) { os::Printer::log("Unable to open gui file", filename, ELL_ERROR); - _IRR_IMPLEMENT_MANAGED_MARSHALLING_BUGFIX; return false; } bool ret = loadGUI(read, parent); read->drop(); - _IRR_IMPLEMENT_MANAGED_MARSHALLING_BUGFIX; return ret; } @@ -812,7 +798,6 @@ bool CGUIEnvironment::loadGUI(io::IReadFile* file, IGUIElement* parent) if (!file) { os::Printer::log("Unable to open GUI file", ELL_ERROR); - _IRR_IMPLEMENT_MANAGED_MARSHALLING_BUGFIX; return false; } @@ -820,7 +805,6 @@ bool CGUIEnvironment::loadGUI(io::IReadFile* file, IGUIElement* parent) if (!reader) { os::Printer::log("GUI is not a valid XML file", file->getFileName(), ELL_ERROR); - _IRR_IMPLEMENT_MANAGED_MARSHALLING_BUGFIX; return false; } @@ -1016,8 +1000,7 @@ void CGUIEnvironment::deserializeAttributes(io::IAttributes* in, io::SAttributeR } RelativeRect = AbsoluteRect = - core::rect(core::position2d(0,0), - Driver ? core::dimension2di(Driver->getScreenSize()) : core::dimension2d(0,0)); + core::rect(Driver ? core::dimension2di(Driver->getScreenSize()) : core::dimension2d(0,0)); } @@ -1399,7 +1382,7 @@ IGUIInOutFader* CGUIEnvironment::addInOutFader(const core::rect* rectangle, if (rectangle) rect = *rectangle; else if (Driver) - rect = core::rect(core::position2d(0,0), core::dimension2di(Driver->getScreenSize())); + rect = core::rect(core::dimension2di(Driver->getScreenSize())); if (!parent) parent = this; diff --git a/source/Irrlicht/CGUIFileOpenDialog.cpp b/source/Irrlicht/CGUIFileOpenDialog.cpp index c0fb8f05..d1c9ff21 100644 --- a/source/Irrlicht/CGUIFileOpenDialog.cpp +++ b/source/Irrlicht/CGUIFileOpenDialog.cpp @@ -375,9 +375,7 @@ void CGUIFileOpenDialog::fillListBox() FileList = FileSystem->createFileList(); core::stringw s; -#if !defined(_IRR_WINDOWS_CE_PLATFORM_) setlocale(LC_ALL,""); -#endif if (FileList) { @@ -385,8 +383,9 @@ void CGUIFileOpenDialog::fillListBox() { #ifndef _IRR_WCHAR_FILESYSTEM const c8 *cs = (const c8 *)FileList->getFileName(i).c_str(); - wchar_t *ws = new wchar_t[strlen(cs) + 1]; - int len = mbstowcs(ws,cs,strlen(cs)); + size_t lencs = strlen(cs); + wchar_t *ws = new wchar_t[lencs + 1]; + size_t len = mbstowcs(ws, cs, lencs); ws[len] = 0; s = ws; delete [] ws; @@ -401,8 +400,9 @@ void CGUIFileOpenDialog::fillListBox() { #ifndef _IRR_WCHAR_FILESYSTEM const c8 *cs = (const c8 *)FileSystem->getWorkingDirectory().c_str(); - wchar_t *ws = new wchar_t[strlen(cs) + 1]; - int len = mbstowcs(ws,cs,strlen(cs)); + size_t lencs = strlen(cs); + wchar_t *ws = new wchar_t[lencs + 1]; + size_t len = mbstowcs(ws, cs, lencs); ws[len] = 0; s = ws; delete [] ws; diff --git a/source/Irrlicht/CGUIFont.cpp b/source/Irrlicht/CGUIFont.cpp index f5bdd90e..b5297537 100644 --- a/source/Irrlicht/CGUIFont.cpp +++ b/source/Irrlicht/CGUIFont.cpp @@ -98,7 +98,6 @@ bool CGUIFont::load(io::IXMLReader* xml, const io::path& directory) if (!SpriteBank->getTexture(i)) { os::Printer::log("Unable to load all textures in the font, aborting", ELL_ERROR); - _IRR_IMPLEMENT_MANAGED_MARSHALLING_BUGFIX; return false; } else diff --git a/source/Irrlicht/CGUIImage.cpp b/source/Irrlicht/CGUIImage.cpp index 8d8daba4..40057756 100644 --- a/source/Irrlicht/CGUIImage.cpp +++ b/source/Irrlicht/CGUIImage.cpp @@ -81,7 +81,7 @@ void CGUIImage::draw() core::rect sourceRect(SourceRect); if (sourceRect.getWidth() == 0 || sourceRect.getHeight() == 0) { - sourceRect = core::rect(core::position2d(0,0), core::dimension2di(Texture->getOriginalSize())); + sourceRect = core::rect(core::dimension2di(Texture->getSize())); } if (ScaleImage) @@ -133,14 +133,12 @@ void CGUIImage::setScaleImage(bool scale) //! Returns true if the image is scaled to fit, false if not bool CGUIImage::isImageScaled() const { - _IRR_IMPLEMENT_MANAGED_MARSHALLING_BUGFIX; return ScaleImage; } //! Returns true if the image is using the alpha channel, false if not bool CGUIImage::isAlphaChannelUsed() const { - _IRR_IMPLEMENT_MANAGED_MARSHALLING_BUGFIX; return UseAlphaChannel; } diff --git a/source/Irrlicht/CGUIInOutFader.cpp b/source/Irrlicht/CGUIInOutFader.cpp index 3f636622..0239db1c 100644 --- a/source/Irrlicht/CGUIInOutFader.cpp +++ b/source/Irrlicht/CGUIInOutFader.cpp @@ -126,7 +126,6 @@ bool CGUIInOutFader::isReady() const { u32 now = os::Timer::getTime(); bool ret = (now > EndTime); - _IRR_IMPLEMENT_MANAGED_MARSHALLING_BUGFIX; return ret; } diff --git a/source/Irrlicht/CGUIListBox.cpp b/source/Irrlicht/CGUIListBox.cpp index e6668cd7..1e534cc3 100644 --- a/source/Irrlicht/CGUIListBox.cpp +++ b/source/Irrlicht/CGUIListBox.cpp @@ -649,7 +649,6 @@ void CGUIListBox::setAutoScrollEnabled(bool scroll) bool CGUIListBox::isAutoScrollEnabled() const { - _IRR_IMPLEMENT_MANAGED_MARSHALLING_BUGFIX; return AutoScroll; } diff --git a/source/Irrlicht/CGUISpinBox.cpp b/source/Irrlicht/CGUISpinBox.cpp index 77d68d20..db9c5bff 100644 --- a/source/Irrlicht/CGUISpinBox.cpp +++ b/source/Irrlicht/CGUISpinBox.cpp @@ -105,7 +105,7 @@ void CGUISpinBox::setValue(f32 val) { wchar_t str[100]; - swprintf(str, 99, FormatString.c_str(), val); + swprintf_irr(str, 99, FormatString.c_str(), val); EditBox->setText(str); verifyValueRange(); } @@ -130,9 +130,9 @@ void CGUISpinBox::setRange(f32 min, f32 max) // we have to round the range - otherwise we can get into an infinte setValue/verifyValueRange cycle. wchar_t str[100]; - swprintf(str, 99, FormatString.c_str(), RangeMin); + swprintf_irr(str, 99, FormatString.c_str(), RangeMin); RangeMin = core::fast_atof(core::stringc(str).c_str()); - swprintf(str, 99, FormatString.c_str(), RangeMax); + swprintf_irr(str, 99, FormatString.c_str(), RangeMax); RangeMax = core::fast_atof(core::stringc(str).c_str()); verifyValueRange(); diff --git a/source/Irrlicht/CGUIStaticText.cpp b/source/Irrlicht/CGUIStaticText.cpp index 94e7fa7c..434f9257 100644 --- a/source/Irrlicht/CGUIStaticText.cpp +++ b/source/Irrlicht/CGUIStaticText.cpp @@ -211,7 +211,6 @@ video::SColor CGUIStaticText::getBackgroundColor() const //! Checks if background drawing is enabled bool CGUIStaticText::isDrawBackgroundEnabled() const { - _IRR_IMPLEMENT_MANAGED_MARSHALLING_BUGFIX; return Background; } @@ -226,7 +225,6 @@ void CGUIStaticText::setDrawBorder(bool draw) //! Checks if border drawing is enabled bool CGUIStaticText::isDrawBorderEnabled() const { - _IRR_IMPLEMENT_MANAGED_MARSHALLING_BUGFIX; return Border; } @@ -266,7 +264,6 @@ void CGUIStaticText::enableOverrideColor(bool enable) bool CGUIStaticText::isOverrideColorEnabled() const { - _IRR_IMPLEMENT_MANAGED_MARSHALLING_BUGFIX; return OverrideColorEnabled; } @@ -282,7 +279,6 @@ void CGUIStaticText::setWordWrap(bool enable) bool CGUIStaticText::isWordWrapEnabled() const { - _IRR_IMPLEMENT_MANAGED_MARSHALLING_BUGFIX; return WordWrap; } diff --git a/source/Irrlicht/CGUITabControl.cpp b/source/Irrlicht/CGUITabControl.cpp index a931d924..6bfc531b 100644 --- a/source/Irrlicht/CGUITabControl.cpp +++ b/source/Irrlicht/CGUITabControl.cpp @@ -108,7 +108,6 @@ video::SColor CGUITab::getTextColor() const //! returns true if the tab is drawing its background, false if not bool CGUITab::isDrawingBackground() const { - _IRR_IMPLEMENT_MANAGED_MARSHALLING_BUGFIX; return DrawBackground; } diff --git a/source/Irrlicht/CGUITreeView.cpp b/source/Irrlicht/CGUITreeView.cpp index ee0a505e..b12904d4 100644 --- a/source/Irrlicht/CGUITreeView.cpp +++ b/source/Irrlicht/CGUITreeView.cpp @@ -433,6 +433,7 @@ CGUITreeView::CGUITreeView(IGUIEnvironment* environment, IGUIElement* parent, TotalItemHeight( 0 ), TotalItemWidth ( 0 ), Font( 0 ), + OverrideFont( 0 ), IconFont( 0 ), ScrollBarH( 0 ), ScrollBarV( 0 ), @@ -522,19 +523,50 @@ CGUITreeView::~CGUITreeView() } } +//! Sets another skin independent font. +void CGUITreeView::setOverrideFont(IGUIFont* font) +{ + if (OverrideFont == font) + return; + + if (OverrideFont) + OverrideFont->drop(); + + OverrideFont = font; + + if (OverrideFont) + OverrideFont->grab(); + + recalculateItemHeight(); +} + +//! Gets the override font (if any) +IGUIFont * CGUITreeView::getOverrideFont() const +{ + return OverrideFont; +} + +//! Get the font which is used right now for drawing +IGUIFont* CGUITreeView::getActiveFont() const +{ + if ( OverrideFont ) + return OverrideFont; + IGUISkin* skin = Environment->getSkin(); + if (skin) + return skin->getFont(); + return 0; +} + void CGUITreeView::recalculateItemHeight() { - IGUISkin* skin = Environment->getSkin(); - IGUITreeViewNode* node; - - if( Font != skin->getFont() ) + if( Font != getActiveFont() ) { if( Font ) { Font->drop(); } - Font = skin->getFont(); + Font = getActiveFont(); ItemHeight = 0; if( Font ) @@ -579,7 +611,7 @@ void CGUITreeView::recalculateItemHeight() TotalItemHeight = 0; TotalItemWidth = AbsoluteRect.getWidth() * 2; - node = Root->getFirstChild(); + IGUITreeViewNode* node = Root->getFirstChild(); while( node ) { TotalItemHeight += ItemHeight; diff --git a/source/Irrlicht/CGUITreeView.h b/source/Irrlicht/CGUITreeView.h index 0408a911..65cb21a1 100644 --- a/source/Irrlicht/CGUITreeView.h +++ b/source/Irrlicht/CGUITreeView.h @@ -277,6 +277,19 @@ namespace gui //! Irrlicht engine as icon font, the icon strings defined in GUIIcons.h can be used. virtual void setIconFont( IGUIFont* font ) _IRR_OVERRIDE_; + //! Sets a skin independent font. + /** \param font: New font to set or 0 to use the skin-font. */ + virtual void setOverrideFont(IGUIFont* font=0) _IRR_OVERRIDE_; + + //! Gets the override font (if any) + /** \return The override font (may be 0) */ + virtual IGUIFont* getOverrideFont(void) const _IRR_OVERRIDE_; + + //! Get the font which is used for drawing + /** This is the override font when one is set and the + font of the skin otherwise. */ + virtual IGUIFont* getActiveFont() const _IRR_OVERRIDE_; + //! Sets the image list which should be used for the image and selected image of every node. //! The default is 0 (no images). virtual void setImageList( IGUIImageList* imageList ) _IRR_OVERRIDE_; @@ -317,6 +330,7 @@ namespace gui s32 TotalItemHeight; s32 TotalItemWidth; IGUIFont* Font; + gui::IGUIFont* OverrideFont; IGUIFont* IconFont; IGUIScrollBar* ScrollBarH; IGUIScrollBar* ScrollBarV; diff --git a/source/Irrlicht/CGeometryCreator.cpp b/source/Irrlicht/CGeometryCreator.cpp index eb43c03d..b13a9163 100644 --- a/source/Irrlicht/CGeometryCreator.cpp +++ b/source/Irrlicht/CGeometryCreator.cpp @@ -372,7 +372,7 @@ IMesh* CGeometryCreator::createTerrainMesh(video::IImage* texture, if (buffer->Material.getTexture(0)) { c8 tmp[255]; - sprintf(tmp, "Generated terrain texture (%dx%d): %s", + sprintf(tmp, "Generated terrain texture (%ux%u): %s", buffer->Material.getTexture(0)->getSize().Width, buffer->Material.getTexture(0)->getSize().Height, textureName); diff --git a/source/Irrlicht/CImage.cpp b/source/Irrlicht/CImage.cpp index ad79f509..992ed600 100644 --- a/source/Irrlicht/CImage.cpp +++ b/source/Irrlicht/CImage.cpp @@ -13,18 +13,10 @@ namespace irr namespace video { -//! Constructor of empty image -CImage::CImage(ECOLOR_FORMAT format, const core::dimension2d& size) -:Data(0), Size(size), Format(format), IsCompressed(false), HasMipMaps(false), DeleteMemory(true) -{ - initData(); -} - - //! Constructor from raw data CImage::CImage(ECOLOR_FORMAT format, const core::dimension2d& size, void* data, - bool ownForeignMemory, bool deleteForeignMemory, bool compressed, bool mipMaps) -: Data(0), Size(size), Format(format), IsCompressed(compressed), HasMipMaps(mipMaps), DeleteMemory(deleteForeignMemory) + bool ownForeignMemory, bool deleteMemory) + : IImage(format, size, deleteMemory) { if (ownForeignMemory) { @@ -36,145 +28,30 @@ CImage::CImage(ECOLOR_FORMAT format, const core::dimension2d& size, void* d { Data = 0; initData(); - memcpy(Data, data, Size.Height * Pitch); + memcpy(Data, data, getDataSizeFromFormat(Format, Size.Width, Size.Height)); } } +//! Constructor of empty image +CImage::CImage(ECOLOR_FORMAT format, const core::dimension2d& size) + : IImage(format, size, true) +{ + initData(); +} + + //! assumes format and size has been set and creates the rest void CImage::initData() { #ifdef _DEBUG setDebugName("CImage"); #endif - BytesPerPixel = getBitsPerPixelFromFormat(Format) / 8; - - // Pitch should be aligned... - Pitch = BytesPerPixel * Size.Width; if (!Data) { - DeleteMemory=true; - Data = new u8[Size.Height * Pitch]; - } -} - - -//! destructor -CImage::~CImage() -{ - if ( DeleteMemory ) - delete [] Data; -} - - -//! Returns width and height of image data. -const core::dimension2d& CImage::getDimension() const -{ - return Size; -} - - -//! Returns bits per pixel. -u32 CImage::getBitsPerPixel() const -{ - return getBitsPerPixelFromFormat(Format); -} - - -//! Returns bytes per pixel -u32 CImage::getBytesPerPixel() const -{ - return BytesPerPixel; -} - - -//! Returns image data size in bytes -u32 CImage::getImageDataSizeInBytes() const -{ - return Pitch * Size.Height; -} - - -//! Returns image data size in pixels -u32 CImage::getImageDataSizeInPixels() const -{ - return Size.Width * Size.Height; -} - - -//! returns mask for red value of a pixel -u32 CImage::getRedMask() const -{ - switch(Format) - { - case ECF_A1R5G5B5: - return 0x1F<<10; - case ECF_R5G6B5: - return 0x1F<<11; - case ECF_R8G8B8: - return 0x00FF0000; - case ECF_A8R8G8B8: - return 0x00FF0000; - default: - return 0x0; - } -} - - -//! returns mask for green value of a pixel -u32 CImage::getGreenMask() const -{ - switch(Format) - { - case ECF_A1R5G5B5: - return 0x1F<<5; - case ECF_R5G6B5: - return 0x3F<<5; - case ECF_R8G8B8: - return 0x0000FF00; - case ECF_A8R8G8B8: - return 0x0000FF00; - default: - return 0x0; - } -} - - -//! returns mask for blue value of a pixel -u32 CImage::getBlueMask() const -{ - switch(Format) - { - case ECF_A1R5G5B5: - return 0x1F; - case ECF_R5G6B5: - return 0x1F; - case ECF_R8G8B8: - return 0x000000FF; - case ECF_A8R8G8B8: - return 0x000000FF; - default: - return 0x0; - } -} - - -//! returns mask for alpha value of a pixel -u32 CImage::getAlphaMask() const -{ - switch(Format) - { - case ECF_A1R5G5B5: - return 0x1<<15; - case ECF_R5G6B5: - return 0x0; - case ECF_R8G8B8: - return 0x0; - case ECF_A8R8G8B8: - return 0xFF000000; - default: - return 0x0; + DeleteMemory = true; + Data = new u8[getDataSizeFromFormat(Format, Size.Width, Size.Height)]; } } @@ -182,7 +59,7 @@ u32 CImage::getAlphaMask() const //! sets a pixel void CImage::setPixel(u32 x, u32 y, const SColor &color, bool blend) { - if (IsCompressed) + if (IImage::isCompressedFormat(Format)) { os::Printer::log("IImage::setPixel method doesn't work with compressed images.", ELL_WARNING); return; @@ -227,7 +104,7 @@ void CImage::setPixel(u32 x, u32 y, const SColor &color, bool blend) //! returns a pixel SColor CImage::getPixel(u32 x, u32 y) const { - if (IsCompressed) + if (IImage::isCompressedFormat(Format)) { os::Printer::log("IImage::getPixel method doesn't work with compressed images.", ELL_WARNING); return SColor(0); @@ -257,17 +134,10 @@ SColor CImage::getPixel(u32 x, u32 y) const } -//! returns the color format -ECOLOR_FORMAT CImage::getColorFormat() const -{ - return Format; -} - - //! copies this surface into another at given position void CImage::copyTo(IImage* target, const core::position2d& pos) { - if (IsCompressed) + if (IImage::isCompressedFormat(Format)) { os::Printer::log("IImage::copyTo method doesn't work with compressed images.", ELL_WARNING); return; @@ -280,7 +150,7 @@ void CImage::copyTo(IImage* target, const core::position2d& pos) //! copies this surface partially into another at given position void CImage::copyTo(IImage* target, const core::position2d& pos, const core::rect& sourceRect, const core::rect* clipRect) { - if (IsCompressed) + if (IImage::isCompressedFormat(Format)) { os::Printer::log("IImage::copyTo method doesn't work with compressed images.", ELL_WARNING); return; @@ -293,7 +163,7 @@ void CImage::copyTo(IImage* target, const core::position2d& pos, const core //! copies this surface into another, using the alpha mask, a cliprect and a color to add with void CImage::copyToWithAlpha(IImage* target, const core::position2d& pos, const core::rect& sourceRect, const SColor &color, const core::rect* clipRect) { - if (IsCompressed) + if (IImage::isCompressedFormat(Format)) { os::Printer::log("IImage::copyToWithAlpha method doesn't work with compressed images.", ELL_WARNING); return; @@ -309,7 +179,7 @@ void CImage::copyToWithAlpha(IImage* target, const core::position2d& pos, c // note: this is very very slow. void CImage::copyToScaling(void* target, u32 width, u32 height, ECOLOR_FORMAT format, u32 pitch) { - if (IsCompressed) + if (IImage::isCompressedFormat(Format)) { os::Printer::log("IImage::copyToScaling method doesn't work with compressed images.", ELL_WARNING); return; @@ -371,7 +241,7 @@ void CImage::copyToScaling(void* target, u32 width, u32 height, ECOLOR_FORMAT fo // note: this is very very slow. void CImage::copyToScaling(IImage* target) { - if (IsCompressed) + if (IImage::isCompressedFormat(Format)) { os::Printer::log("IImage::copyToScaling method doesn't work with compressed images.", ELL_WARNING); return; @@ -388,15 +258,14 @@ void CImage::copyToScaling(IImage* target) return; } - copyToScaling(target->lock(), targetSize.Width, targetSize.Height, target->getColorFormat()); - target->unlock(); + copyToScaling(target->getData(), targetSize.Width, targetSize.Height, target->getColorFormat()); } //! copies this surface into another, scaling it to fit it. void CImage::copyToScalingBoxFilter(IImage* target, s32 bias, bool blend) { - if (IsCompressed) + if (IImage::isCompressedFormat(Format)) { os::Printer::log("IImage::copyToScalingBoxFilter method doesn't work with compressed images.", ELL_WARNING); return; @@ -407,7 +276,7 @@ void CImage::copyToScalingBoxFilter(IImage* target, s32 bias, bool blend) const f32 sourceXStep = (f32) Size.Width / (f32) destSize.Width; const f32 sourceYStep = (f32) Size.Height / (f32) destSize.Height; - target->lock(); + target->getData(); s32 fx = core::ceil32( sourceXStep ); s32 fy = core::ceil32( sourceYStep ); @@ -426,15 +295,13 @@ void CImage::copyToScalingBoxFilter(IImage* target, s32 bias, bool blend) } sy += sourceYStep; } - - target->unlock(); } //! fills the surface with given color void CImage::fill(const SColor &color) { - if (IsCompressed) + if (IImage::isCompressedFormat(Format)) { os::Printer::log("IImage::fill method doesn't work with compressed images.", ELL_WARNING); return; @@ -475,24 +342,10 @@ void CImage::fill(const SColor &color) } -//! Inform whether the image is compressed -bool CImage::isCompressed() const -{ - return IsCompressed; -} - - -//! Check whether the image has MipMaps -bool CImage::hasMipMaps() const -{ - return HasMipMaps; -} - - //! get a filtered pixel inline SColor CImage::getPixelBox( s32 x, s32 y, s32 fx, s32 fy, s32 bias ) const { - if (IsCompressed) + if (IImage::isCompressedFormat(Format)) { os::Printer::log("IImage::getPixelBox method doesn't work with compressed images.", ELL_WARNING); return SColor(0); diff --git a/source/Irrlicht/CImage.h b/source/Irrlicht/CImage.h index dc593983..4b6d3966 100644 --- a/source/Irrlicht/CImage.h +++ b/source/Irrlicht/CImage.h @@ -23,64 +23,18 @@ public: /** \param useForeignMemory: If true, the image will use the data pointer directly and own it from now on, which means it will also try to delete [] the data when the image will be destructed. If false, the memory will by copied. */ - CImage(ECOLOR_FORMAT format, const core::dimension2d& size, - void* data, bool ownForeignMemory=true, bool deleteMemory = true, - bool compressed = false, bool mipMaps = false); + CImage(ECOLOR_FORMAT format, const core::dimension2d& size, void* data, + bool ownForeignMemory = true, bool deleteMemory = true); //! constructor for empty image CImage(ECOLOR_FORMAT format, const core::dimension2d& size); - //! destructor - virtual ~CImage(); - - //! Lock function. - virtual void* lock() _IRR_OVERRIDE_ - { - return Data; - } - - //! Unlock function. - virtual void unlock() _IRR_OVERRIDE_ {} - - //! Returns width and height of image data. - virtual const core::dimension2d& getDimension() const _IRR_OVERRIDE_; - - //! Returns bits per pixel. - virtual u32 getBitsPerPixel() const _IRR_OVERRIDE_; - - //! Returns bytes per pixel - virtual u32 getBytesPerPixel() const _IRR_OVERRIDE_; - - //! Returns image data size in bytes - virtual u32 getImageDataSizeInBytes() const _IRR_OVERRIDE_; - - //! Returns image data size in pixels - virtual u32 getImageDataSizeInPixels() const _IRR_OVERRIDE_; - - //! returns mask for red value of a pixel - virtual u32 getRedMask() const _IRR_OVERRIDE_; - - //! returns mask for green value of a pixel - virtual u32 getGreenMask() const _IRR_OVERRIDE_; - - //! returns mask for blue value of a pixel - virtual u32 getBlueMask() const _IRR_OVERRIDE_; - - //! returns mask for alpha value of a pixel - virtual u32 getAlphaMask() const _IRR_OVERRIDE_; - //! returns a pixel virtual SColor getPixel(u32 x, u32 y) const _IRR_OVERRIDE_; //! sets a pixel virtual void setPixel(u32 x, u32 y, const SColor &color, bool blend = false ) _IRR_OVERRIDE_; - //! returns the color format - virtual ECOLOR_FORMAT getColorFormat() const _IRR_OVERRIDE_; - - //! returns pitch of image - virtual u32 getPitch() const _IRR_OVERRIDE_ { return Pitch; } - //! copies this surface into another, scaling it to fit. virtual void copyToScaling(void* target, u32 width, u32 height, ECOLOR_FORMAT format, u32 pitch=0) _IRR_OVERRIDE_; @@ -104,30 +58,12 @@ public: //! fills the surface with given color virtual void fill(const SColor &color) _IRR_OVERRIDE_; - //! Inform whether the image is compressed - virtual bool isCompressed() const _IRR_OVERRIDE_; - - //! Check whether the image has MipMaps - /** \return True if image has MipMaps, else false. */ - virtual bool hasMipMaps() const _IRR_OVERRIDE_; - private: //! assumes format and size has been set and creates the rest void initData(); inline SColor getPixelBox ( s32 x, s32 y, s32 fx, s32 fy, s32 bias ) const; - - u8* Data; - core::dimension2d Size; - u32 BytesPerPixel; - u32 Pitch; - ECOLOR_FORMAT Format; - - bool IsCompressed; - bool HasMipMaps; - - bool DeleteMemory; }; } // end namespace video diff --git a/source/Irrlicht/CImageLoaderBMP.cpp b/source/Irrlicht/CImageLoaderBMP.cpp index 2ccb64cc..675212b1 100644 --- a/source/Irrlicht/CImageLoaderBMP.cpp +++ b/source/Irrlicht/CImageLoaderBMP.cpp @@ -318,36 +318,34 @@ IImage* CImageLoaderBMP::loadImage(io::IReadFile* file) const case 1: image = new CImage(ECF_A1R5G5B5, dim); if (image) - CColorConverter::convert1BitTo16Bit(bmpData, (s16*)image->lock(), header.Width, header.Height, pitch, true); + CColorConverter::convert1BitTo16Bit(bmpData, (s16*)image->getData(), header.Width, header.Height, pitch, true); break; case 4: image = new CImage(ECF_A1R5G5B5, dim); if (image) - CColorConverter::convert4BitTo16Bit(bmpData, (s16*)image->lock(), header.Width, header.Height, paletteData, pitch, true); + CColorConverter::convert4BitTo16Bit(bmpData, (s16*)image->getData(), header.Width, header.Height, paletteData, pitch, true); break; case 8: image = new CImage(ECF_A1R5G5B5, dim); if (image) - CColorConverter::convert8BitTo16Bit(bmpData, (s16*)image->lock(), header.Width, header.Height, paletteData, pitch, true); + CColorConverter::convert8BitTo16Bit(bmpData, (s16*)image->getData(), header.Width, header.Height, paletteData, pitch, true); break; case 16: image = new CImage(ECF_A1R5G5B5, dim); if (image) - CColorConverter::convert16BitTo16Bit((s16*)bmpData, (s16*)image->lock(), header.Width, header.Height, pitch, true); + CColorConverter::convert16BitTo16Bit((s16*)bmpData, (s16*)image->getData(), header.Width, header.Height, pitch, true); break; case 24: image = new CImage(ECF_R8G8B8, dim); if (image) - CColorConverter::convert24BitTo24Bit(bmpData, (u8*)image->lock(), header.Width, header.Height, pitch, true, true); + CColorConverter::convert24BitTo24Bit(bmpData, (u8*)image->getData(), header.Width, header.Height, pitch, true, true); break; case 32: // thx to Reinhard Ostermeier image = new CImage(ECF_A8R8G8B8, dim); if (image) - CColorConverter::convert32BitTo32Bit((s32*)bmpData, (s32*)image->lock(), header.Width, header.Height, pitch, true); + CColorConverter::convert32BitTo32Bit((s32*)bmpData, (s32*)image->getData(), header.Width, header.Height, pitch, true); break; }; - if (image) - image->unlock(); // clean up diff --git a/source/Irrlicht/CImageLoaderDDS.cpp b/source/Irrlicht/CImageLoaderDDS.cpp index 059ff243..8fcee934 100644 --- a/source/Irrlicht/CImageLoaderDDS.cpp +++ b/source/Irrlicht/CImageLoaderDDS.cpp @@ -694,6 +694,7 @@ IImage* CImageLoaderDDS::loadImage(io::IReadFile* file) const eDDSPixelFormat pixelFormat; ECOLOR_FORMAT format = ECF_UNKNOWN; u32 dataSize = 0; + u32 mipMapsDataSize = 0; bool is3D = false; bool useAlpha = false; u32 mipMapCount = 0; @@ -796,7 +797,7 @@ IImage* CImageLoaderDDS::loadImage(io::IReadFile* file) const { if (!is3D) // Currently 3D textures are unsupported. { - image = new CImage(format, core::dimension2d(header.Width, header.Height ), data, true, true, false); + image = new CImage(format, core::dimension2d(header.Width, header.Height), data, true, true); } } else @@ -809,47 +810,57 @@ IImage* CImageLoaderDDS::loadImage(io::IReadFile* file) const switch(pixelFormat) { case DDS_PF_DXT1: + { format = ECF_DXT1; break; + } case DDS_PF_DXT2: case DDS_PF_DXT3: + { format = ECF_DXT3; break; + } case DDS_PF_DXT4: case DDS_PF_DXT5: + { format = ECF_DXT5; break; + } } - if (format != ECF_UNKNOWN) + if( format != ECF_UNKNOWN ) { - // Calculate image data size. - u32 curWidth = header.Width; - u32 curHeight = header.Height; - - dataSize = IImage::getCompressedImageSize(format, curWidth, curHeight); - - do + if (!is3D) // Currently 3D textures are unsupported. { - if (curWidth > 1) - curWidth >>= 1; + dataSize = IImage::getDataSizeFromFormat(format, header.Width, header.Height); - if (curHeight > 1) - curHeight >>= 1; - - dataSize += IImage::getCompressedImageSize(format, curWidth, curHeight); - } - while (curWidth != 1 || curWidth != 1); - - // Currently 3D textures are unsupported. - if (!is3D) - { u8* data = new u8[dataSize]; file->read(data, dataSize); - bool hasMipMap = (mipMapCount > 0) ? true : false; + image = new CImage(format, core::dimension2d(header.Width, header.Height), data, true, true); - image = new CImage(format, core::dimension2d(header.Width, header.Height), data, true, true, true, hasMipMap); + if (mipMapCount > 0) + { + u32 tmpWidth = header.Width; + u32 tmpHeight = header.Height; + + do + { + if (tmpWidth > 1) + tmpWidth >>= 1; + + if (tmpHeight > 1) + tmpHeight >>= 1; + + mipMapsDataSize = IImage::getDataSizeFromFormat(format, tmpWidth, tmpHeight); + } + while (tmpWidth != 1 || tmpHeight != 1); + + u8* mipMapsData = new u8[mipMapsDataSize]; + file->read(mipMapsData, mipMapsDataSize); + + image->setMipMapsData(mipMapsData, true, true); + } } } } diff --git a/source/Irrlicht/CImageLoaderJPG.cpp b/source/Irrlicht/CImageLoaderJPG.cpp index 1811f31d..80190776 100644 --- a/source/Irrlicht/CImageLoaderJPG.cpp +++ b/source/Irrlicht/CImageLoaderJPG.cpp @@ -16,8 +16,10 @@ namespace irr namespace video { +#ifdef _IRR_COMPILE_WITH_LIBJPEG_ // Static members io::path CImageLoaderJPG::Filename; +#endif //! constructor CImageLoaderJPG::CImageLoaderJPG() @@ -175,9 +177,7 @@ IImage* CImageLoaderJPG::loadImage(io::IReadFile* file) const jpeg_destroy_decompress(&cinfo); delete [] input; - // if the row pointer was created, we delete it. - if (rowPtr) - delete [] rowPtr; + delete [] rowPtr; // return null pointer return 0; @@ -263,7 +263,7 @@ IImage* CImageLoaderJPG::loadImage(io::IReadFile* file) const image = new CImage(ECF_R8G8B8, core::dimension2d(width, height)); const u32 size = 3*width*height; - u8* data = (u8*)image->lock(); + u8* data = (u8*)image->getData(); if (data) { for (u32 i=0,j=0; iunlock(); delete [] output; } else diff --git a/source/Irrlicht/CImageLoaderPCX.cpp b/source/Irrlicht/CImageLoaderPCX.cpp index 50ddf6e0..1c594472 100644 --- a/source/Irrlicht/CImageLoaderPCX.cpp +++ b/source/Irrlicht/CImageLoaderPCX.cpp @@ -171,12 +171,12 @@ IImage* CImageLoaderPCX::loadImage(io::IReadFile* file) const case 1: image = new CImage(ECF_A1R5G5B5, core::dimension2d(width, height)); if (image) - CColorConverter::convert8BitTo16Bit(PCXData, (s16*)image->lock(), width, height, paletteData, pad); + CColorConverter::convert8BitTo16Bit(PCXData, (s16*)image->getData(), width, height, paletteData, pad); break; case 3: image = new CImage(ECF_R8G8B8, core::dimension2d(width, height)); if (image) - CColorConverter::convert24BitTo24Bit(PCXData, (u8*)image->lock(), width, height, pad); + CColorConverter::convert24BitTo24Bit(PCXData, (u8*)image->getData(), width, height, pad); break; } } @@ -186,7 +186,7 @@ IImage* CImageLoaderPCX::loadImage(io::IReadFile* file) const { image = new CImage(ECF_A1R5G5B5, core::dimension2d(width, height)); if (image) - CColorConverter::convert4BitTo16Bit(PCXData, (s16*)image->lock(), width, height, paletteData, pad); + CColorConverter::convert4BitTo16Bit(PCXData, (s16*)image->getData(), width, height, paletteData, pad); } } else if (header.BitsPerPixel==1) @@ -195,17 +195,15 @@ IImage* CImageLoaderPCX::loadImage(io::IReadFile* file) const { image = new CImage(ECF_A1R5G5B5, core::dimension2d(width, height)); if (image) - CColorConverter::convert4BitTo16Bit(PCXData, (s16*)image->lock(), width, height, paletteData, pad); + CColorConverter::convert4BitTo16Bit(PCXData, (s16*)image->getData(), width, height, paletteData, pad); } else if (header.Planes==1) { image = new CImage(ECF_A1R5G5B5, core::dimension2d(width, height)); if (image) - CColorConverter::convert1BitTo16Bit(PCXData, (s16*)image->lock(), width, height, pad); + CColorConverter::convert1BitTo16Bit(PCXData, (s16*)image->getData(), width, height, pad); } } - if (image) - image->unlock(); // clean up diff --git a/source/Irrlicht/CImageLoaderPNG.cpp b/source/Irrlicht/CImageLoaderPNG.cpp index e612330c..23bb5517 100644 --- a/source/Irrlicht/CImageLoaderPNG.cpp +++ b/source/Irrlicht/CImageLoaderPNG.cpp @@ -133,8 +133,7 @@ IImage* CImageLoaderPng::loadImage(io::IReadFile* file) const if (setjmp(png_jmpbuf(png_ptr))) { png_destroy_read_struct(&png_ptr, &info_ptr, NULL); - if (RowPointers) - delete [] RowPointers; + delete [] RowPointers; return 0; } @@ -245,7 +244,7 @@ IImage* CImageLoaderPng::loadImage(io::IReadFile* file) const } // Fill array of pointers to rows in image data - unsigned char* data = (unsigned char*)image->lock(); + unsigned char* data = (unsigned char*)image->getData(); for (u32 i=0; iunlock(); delete image; return 0; } @@ -267,7 +265,6 @@ IImage* CImageLoaderPng::loadImage(io::IReadFile* file) const png_read_end(png_ptr, NULL); delete [] RowPointers; - image->unlock(); png_destroy_read_struct(&png_ptr,&info_ptr, 0); // Clean up memory return image; diff --git a/source/Irrlicht/CImageLoaderPPM.cpp b/source/Irrlicht/CImageLoaderPPM.cpp index a0776fa1..7ebf6955 100644 --- a/source/Irrlicht/CImageLoaderPPM.cpp +++ b/source/Irrlicht/CImageLoaderPPM.cpp @@ -101,7 +101,7 @@ IImage* CImageLoaderPPM::loadImage(io::IReadFile* file) const } image = new CImage(ECF_A1R5G5B5, core::dimension2d(width, height)); if (image) - CColorConverter::convert1BitTo16Bit(data, (s16*)image->lock(), width, height); + CColorConverter::convert1BitTo16Bit(data, (s16*)image->getData(), width, height); } else { @@ -123,7 +123,7 @@ IImage* CImageLoaderPPM::loadImage(io::IReadFile* file) const image = new CImage(ECF_A8R8G8B8, core::dimension2d(width, height)); if (image) { - u8* ptr = (u8*)image->lock(); + u8* ptr = (u8*)image->getData(); for (u32 i=0; i(width, height)); if (image) { - u8* ptr = (u8*)image->lock(); + u8* ptr = (u8*)image->getData(); for (u32 i=0; i(width, height)); if (image) { - u8* ptr = (u8*)image->lock(); + u8* ptr = (u8*)image->getData(); for (u32 i=0; i(width, height)); if (image) { - u8* ptr = (u8*)image->lock(); + u8* ptr = (u8*)image->getData(); for (u32 i=0; iunlock(); - delete [] data; return image; diff --git a/source/Irrlicht/CImageLoaderPVR.cpp b/source/Irrlicht/CImageLoaderPVR.cpp index b6a2c9a0..6700b6b3 100644 --- a/source/Irrlicht/CImageLoaderPVR.cpp +++ b/source/Irrlicht/CImageLoaderPVR.cpp @@ -55,6 +55,7 @@ IImage* CImageLoaderPVR::loadImage(io::IReadFile* file) const IImage* image = 0; ECOLOR_FORMAT format = ECF_UNKNOWN; u32 dataSize = 0; + u32 mipMapsDataSize = 0; file->seek(0); file->read(&header, sizeof(SPVRHeader)); @@ -139,33 +140,38 @@ IImage* CImageLoaderPVR::loadImage(io::IReadFile* file) const if (format != ECF_UNKNOWN) { - // Calculate image data size. - u32 curWidth = header.Width; - u32 curHeight = header.Height; - - dataSize = IImage::getCompressedImageSize(format, curWidth, curHeight); - - do - { - if (curWidth > 1) - curWidth >>= 1; - - if (curHeight > 1) - curHeight >>= 1; - - dataSize += IImage::getCompressedImageSize(format, curWidth, curHeight); - } - while (curWidth != 1 || curWidth != 1); - // 3D textures, texture arrays, cube maps textures aren't currently supported if (header.Depth < 2 && header.NumSurfaces < 2 && header.NumFaces < 2) { + dataSize = IImage::getDataSizeFromFormat(format, header.Width, header.Height); + u8* data = new u8[dataSize]; file->read(data, dataSize); - bool hasMipMap = (header.MipMapCount > 0) ? true : false; + image = new CImage(format, core::dimension2d(header.Width, header.Height), data, true, true); - image = new CImage(format, core::dimension2d(header.Width, header.Height), data, true, true, true, hasMipMap); + if (header.MipMapCount > 0) + { + u32 tmpWidth = header.Width; + u32 tmpHeight = header.Height; + + do + { + if (tmpWidth > 1) + tmpWidth >>= 1; + + if (tmpHeight > 1) + tmpHeight >>= 1; + + mipMapsDataSize = IImage::getDataSizeFromFormat(format, tmpWidth, tmpHeight); + } + while (tmpWidth != 1 || tmpHeight != 1); + + u8* mipMapsData = new u8[mipMapsDataSize]; + file->read(mipMapsData, mipMapsDataSize); + + image->setMipMapsData(mipMapsData, true, true); + } } } } diff --git a/source/Irrlicht/CImageLoaderRGB.cpp b/source/Irrlicht/CImageLoaderRGB.cpp index 4699dc0a..1f0b141e 100644 --- a/source/Irrlicht/CImageLoaderRGB.cpp +++ b/source/Irrlicht/CImageLoaderRGB.cpp @@ -236,14 +236,14 @@ IImage* CImageLoaderRGB::loadImage(io::IReadFile* file) const image = new CImage(ECF_A1R5G5B5, core::dimension2d(rgb.Header.Xsize, rgb.Header.Ysize)); if (image) - CColorConverter::convert8BitTo16Bit(rgb.rgbData, (s16*)image->lock(), rgb.Header.Xsize, rgb.Header.Ysize, paletteData, 0, true); + CColorConverter::convert8BitTo16Bit(rgb.rgbData, (s16*)image->getData(), rgb.Header.Xsize, rgb.Header.Ysize, paletteData, 0, true); break; case 3: // RGB image // one byte per COLOR VALUE, eg, 24bpp image = new CImage(ECF_R8G8B8, core::dimension2d(rgb.Header.Xsize, rgb.Header.Ysize)); if (image) - CColorConverter::convert24BitTo24Bit(rgb.rgbData, (u8*)image->lock(), rgb.Header.Xsize, rgb.Header.Ysize, 0, true, false); + CColorConverter::convert24BitTo24Bit(rgb.rgbData, (u8*)image->getData(), rgb.Header.Xsize, rgb.Header.Ysize, 0, true, false); break; case 4: // RGBa image with one alpha channel (32bpp) @@ -253,16 +253,13 @@ IImage* CImageLoaderRGB::loadImage(io::IReadFile* file) const image = new CImage(ECF_A8R8G8B8, core::dimension2d(rgb.Header.Xsize, rgb.Header.Ysize)); if (image) - CColorConverter::convert32BitTo32Bit((s32*)rgb.rgbData, (s32*)image->lock(), rgb.Header.Xsize, rgb.Header.Ysize, 0, true); + CColorConverter::convert32BitTo32Bit((s32*)rgb.rgbData, (s32*)image->getData(), rgb.Header.Xsize, rgb.Header.Ysize, 0, true); break; default: // Format unknown os::Printer::log("Unsupported pixel format in RGB file", file->getFileName(), ELL_ERROR); } - - if (image) - image->unlock(); } } diff --git a/source/Irrlicht/CImageLoaderTGA.cpp b/source/Irrlicht/CImageLoaderTGA.cpp index 5f2549bf..c9b3a9d5 100644 --- a/source/Irrlicht/CImageLoaderTGA.cpp +++ b/source/Irrlicht/CImageLoaderTGA.cpp @@ -173,7 +173,7 @@ IImage* CImageLoaderTGA::loadImage(io::IReadFile* file) const core::dimension2d(header.ImageWidth, header.ImageHeight)); if (image) CColorConverter::convert8BitTo24Bit((u8*)data, - (u8*)image->lock(), + (u8*)image->getData(), header.ImageWidth,header.ImageHeight, 0, 0, (header.ImageDescriptor&0x20)==0); } @@ -183,7 +183,7 @@ IImage* CImageLoaderTGA::loadImage(io::IReadFile* file) const core::dimension2d(header.ImageWidth, header.ImageHeight)); if (image) CColorConverter::convert8BitTo16Bit((u8*)data, - (s16*)image->lock(), + (s16*)image->getData(), header.ImageWidth,header.ImageHeight, (s32*) palette, 0, (header.ImageDescriptor&0x20)==0); @@ -195,28 +195,26 @@ IImage* CImageLoaderTGA::loadImage(io::IReadFile* file) const core::dimension2d(header.ImageWidth, header.ImageHeight)); if (image) CColorConverter::convert16BitTo16Bit((s16*)data, - (s16*)image->lock(), header.ImageWidth, header.ImageHeight, 0, (header.ImageDescriptor&0x20)==0); + (s16*)image->getData(), header.ImageWidth, header.ImageHeight, 0, (header.ImageDescriptor&0x20)==0); break; case 24: image = new CImage(ECF_R8G8B8, core::dimension2d(header.ImageWidth, header.ImageHeight)); if (image) CColorConverter::convert24BitTo24Bit( - (u8*)data, (u8*)image->lock(), header.ImageWidth, header.ImageHeight, 0, (header.ImageDescriptor&0x20)==0, true); + (u8*)data, (u8*)image->getData(), header.ImageWidth, header.ImageHeight, 0, (header.ImageDescriptor&0x20)==0, true); break; case 32: image = new CImage(ECF_A8R8G8B8, core::dimension2d(header.ImageWidth, header.ImageHeight)); if (image) CColorConverter::convert32BitTo32Bit((s32*)data, - (s32*)image->lock(), header.ImageWidth, header.ImageHeight, 0, (header.ImageDescriptor&0x20)==0); + (s32*)image->getData(), header.ImageWidth, header.ImageHeight, 0, (header.ImageDescriptor&0x20)==0); break; default: os::Printer::log("Unsupported TGA format", file->getFileName(), ELL_ERROR); break; } - if (image) - image->unlock(); delete [] data; delete [] palette; diff --git a/source/Irrlicht/CImageLoaderWAL.cpp b/source/Irrlicht/CImageLoaderWAL.cpp index 0465646a..3081c02a 100644 --- a/source/Irrlicht/CImageLoaderWAL.cpp +++ b/source/Irrlicht/CImageLoaderWAL.cpp @@ -89,8 +89,7 @@ IImage* CImageLoaderLMP::loadImage(irr::io::IReadFile* file) const IImage* image = new CImage(ECF_A8R8G8B8, core::dimension2d(header.width, header.height)); - CColorConverter::convert8BitTo32Bit(rawtex, (u8*)image->lock(), header.width, header.height, (u8*) colormap_h, 0, false); - image->unlock(); + CColorConverter::convert8BitTo32Bit(rawtex, (u8*)image->getData(), header.width, header.height, (u8*) colormap_h, 0, false); delete [] rawtex; @@ -209,17 +208,15 @@ IImage* CImageLoaderWAL2::loadImage(irr::io::IReadFile* file) const switch ( format ) { case ECF_R8G8B8: - CColorConverter::convert8BitTo24Bit(rawtex, (u8*)image->lock(), header.width, header.height, (u8*) pal + 768, 0, false); + CColorConverter::convert8BitTo24Bit(rawtex, (u8*)image->getData(), header.width, header.height, (u8*) pal + 768, 0, false); break; case ECF_A8R8G8B8: - CColorConverter::convert8BitTo32Bit(rawtex, (u8*)image->lock(), header.width, header.height, (u8*) pal + 768, 0, false); + CColorConverter::convert8BitTo32Bit(rawtex, (u8*)image->getData(), header.width, header.height, (u8*) pal + 768, 0, false); break; default: break; } - image->unlock(); - delete [] rawtex; delete [] pal; @@ -262,8 +259,7 @@ IImage* CImageLoaderWAL::loadImage(irr::io::IReadFile* file) const IImage* image = new CImage(ECF_A8R8G8B8, core::dimension2d(header.width, header.height)); - CColorConverter::convert8BitTo32Bit(rawtex, (u8*)image->lock(), header.width, header.height, (u8*) colormap_pcx, 0, false); - image->unlock(); + CColorConverter::convert8BitTo32Bit(rawtex, (u8*)image->getData(), header.width, header.height, (u8*) colormap_pcx, 0, false); delete [] rawtex; diff --git a/source/Irrlicht/CImageWriterBMP.cpp b/source/Irrlicht/CImageWriterBMP.cpp index c1676188..636664af 100644 --- a/source/Irrlicht/CImageWriterBMP.cpp +++ b/source/Irrlicht/CImageWriterBMP.cpp @@ -92,7 +92,7 @@ bool CImageWriterBMP::writeImage(io::IWriteFile* file, IImage* image, u32 param) if (file->write(&imageHeader, sizeof(imageHeader)) != sizeof(imageHeader)) return false; - u8* scan_lines = (u8*)image->lock(); + u8* scan_lines = (u8*)image->getData(); if (!scan_lines) return false; @@ -125,9 +125,6 @@ bool CImageWriterBMP::writeImage(io::IWriteFile* file, IImage* image, u32 param) // clean up our scratch area delete [] row_pointer; - // give back image handle - image->unlock(); - return y < 0; } diff --git a/source/Irrlicht/CImageWriterJPG.cpp b/source/Irrlicht/CImageWriterJPG.cpp index ea7aa819..c42615ac 100644 --- a/source/Irrlicht/CImageWriterJPG.cpp +++ b/source/Irrlicht/CImageWriterJPG.cpp @@ -158,7 +158,7 @@ static bool writeJPEGFile(io::IWriteFile* file, IImage* image, u32 quality) JSAMPROW row_pointer[1]; /* pointer to JSAMPLE row[s] */ row_pointer[0] = dest; - u8* src = (u8*)image->lock(); + u8* src = (u8*)image->getData(); while (cinfo.next_scanline < cinfo.image_height) { @@ -167,7 +167,6 @@ static bool writeJPEGFile(io::IWriteFile* file, IImage* image, u32 quality) src += pitch; jpeg_write_scanlines(&cinfo, row_pointer, 1); } - image->unlock(); delete [] dest; diff --git a/source/Irrlicht/CImageWriterPNG.cpp b/source/Irrlicht/CImageWriterPNG.cpp index 29f10fc8..5c2ead81 100644 --- a/source/Irrlicht/CImageWriterPNG.cpp +++ b/source/Irrlicht/CImageWriterPNG.cpp @@ -146,7 +146,7 @@ bool CImageWriterPNG::writeImage(io::IWriteFile* file, IImage* image,u32 param) return false; } - u8* data = (u8*)image->lock(); + u8* data = (u8*)image->getData(); switch(image->getColorFormat()) { case ECF_R8G8B8: @@ -165,7 +165,6 @@ bool CImageWriterPNG::writeImage(io::IWriteFile* file, IImage* image,u32 param) default: break; } - image->unlock(); // Create array of pointers to rows in image data diff --git a/source/Irrlicht/CImageWriterPPM.cpp b/source/Irrlicht/CImageWriterPPM.cpp index 3bc17379..aa821891 100644 --- a/source/Irrlicht/CImageWriterPPM.cpp +++ b/source/Irrlicht/CImageWriterPPM.cpp @@ -47,18 +47,18 @@ bool CImageWriterPPM::writeImage(io::IWriteFile *file, IImage *image, u32 param) const bool binary = false; if (binary) - size = snprintf(cache, 70, "P6\n"); + size = snprintf_irr(cache, 70, "P6\n"); else - size = snprintf(cache, 70, "P3\n"); + size = snprintf_irr(cache, 70, "P3\n"); if (file->write(cache, size) != size) return false; - size = snprintf(cache, 70, "%d %d\n", imageSize.Width, imageSize.Height); + size = snprintf_irr(cache, 70, "%u %u\n", imageSize.Width, imageSize.Height); if (file->write(cache, size) != size) return false; - size = snprintf(cache, 70, "255\n"); + size = snprintf_irr(cache, 70, "255\n"); if (file->write(cache, size) != size) return false; @@ -87,7 +87,7 @@ bool CImageWriterPPM::writeImage(io::IWriteFile *file, IImage *image, u32 param) for (u32 c = 0; c < imageSize.Width; ++c, ++n) { const video::SColor& pixel = image->getPixel(c, h); - size = snprintf(cache, 70, "%.3u %.3u %.3u%s", pixel.getRed(), pixel.getGreen(), pixel.getBlue(), n % 5 == 4 ? "\n" : " "); + size = snprintf_irr(cache, 70, "%.3u %.3u %.3u%s", pixel.getRed(), pixel.getGreen(), pixel.getBlue(), n % 5 == 4 ? "\n" : " "); if (file->write(cache, size) != size) return false; } diff --git a/source/Irrlicht/CImageWriterTGA.cpp b/source/Irrlicht/CImageWriterTGA.cpp index 2a1af539..34198cb1 100644 --- a/source/Irrlicht/CImageWriterTGA.cpp +++ b/source/Irrlicht/CImageWriterTGA.cpp @@ -95,7 +95,7 @@ bool CImageWriterTGA::writeImage(io::IWriteFile *file, IImage *image,u32 param) if (file->write(&imageHeader, sizeof(imageHeader)) != sizeof(imageHeader)) return false; - u8* scan_lines = (u8*)image->lock(); + u8* scan_lines = (u8*)image->getData(); if (!scan_lines) return false; @@ -125,8 +125,6 @@ bool CImageWriterTGA::writeImage(io::IWriteFile *file, IImage *image,u32 param) delete [] row_pointer; - image->unlock(); - STGAFooter imageFooter; imageFooter.ExtensionOffset = 0; imageFooter.DeveloperOffset = 0; diff --git a/source/Irrlicht/CIrrDeviceConsole.cpp b/source/Irrlicht/CIrrDeviceConsole.cpp index 53892ee5..d067fa01 100644 --- a/source/Irrlicht/CIrrDeviceConsole.cpp +++ b/source/Irrlicht/CIrrDeviceConsole.cpp @@ -133,7 +133,6 @@ CIrrDeviceConsole::CIrrDeviceConsole(const SIrrlichtCreationParameters& params) #endif break; - case video::EDT_DIRECT3D8: case video::EDT_DIRECT3D9: case video::EDT_OPENGL: os::Printer::log("The console device cannot use hardware drivers yet.", ELL_ERROR); @@ -142,6 +141,7 @@ CIrrDeviceConsole::CIrrDeviceConsole(const SIrrlichtCreationParameters& params) VideoDriver = video::createNullDriver(FileSystem, CreationParams.WindowSize); break; default: + os::Printer::log("Unsupported device.", ELL_ERROR); break; } diff --git a/source/Irrlicht/CIrrDeviceFB.cpp b/source/Irrlicht/CIrrDeviceFB.cpp index d7eba090..d60f8410 100644 --- a/source/Irrlicht/CIrrDeviceFB.cpp +++ b/source/Irrlicht/CIrrDeviceFB.cpp @@ -150,7 +150,7 @@ bool CIrrDeviceFB::createWindow(const core::dimension2d& windowSize, u32 bi // make format settings ioctl(Framebuffer, FBIOGET_FSCREENINFO, &fbfixscreeninfo); ioctl(Framebuffer, FBIOGET_VSCREENINFO, &oldscreeninfo); -snprintf(buf, 256, "Original resolution: %d x %d\nARGB%d%d%d%d\n",oldscreeninfo.xres,oldscreeninfo.yres, + snprintf_irr(buf, 256, "Original resolution: %d x %d\nARGB%d%d%d%d\n",oldscreeninfo.xres,oldscreeninfo.yres, oldscreeninfo.transp.length,oldscreeninfo.red.length,oldscreeninfo.green.length,oldscreeninfo.blue.length); os::Printer::log(buf); memcpy(&fbscreeninfo, &oldscreeninfo, sizeof(struct fb_var_screeninfo)); @@ -170,7 +170,7 @@ snprintf(buf, 256, "Original resolution: %d x %d\nARGB%d%d%d%d\n",oldscreeninfo. ioctl(Framebuffer, FBIOPUT_VSCREENINFO, &fbscreeninfo); ioctl(Framebuffer, FBIOGET_VSCREENINFO, &fbscreeninfo); -snprintf(buf, 256, "New resolution: %d x %d (%d x %d)\nARGB%d%d%d%d\n",fbscreeninfo.xres,fbscreeninfo.yres,fbscreeninfo.xres_virtual,fbscreeninfo.yres_virtual, + snprintf_irr(buf, 256, "New resolution: %d x %d (%d x %d)\nARGB%d%d%d%d\n",fbscreeninfo.xres,fbscreeninfo.yres,fbscreeninfo.xres_virtual,fbscreeninfo.yres_virtual, fbscreeninfo.transp.length,fbscreeninfo.red.length,fbscreeninfo.green.length,fbscreeninfo.blue.length); os::Printer::log(buf); @@ -259,8 +259,8 @@ void CIrrDeviceFB::createDriver() #endif break; + case DEPRECATED_EDT_DIRECT3D8_NO_LONGER_EXISTS: case video::EDT_OPENGL: - case video::EDT_DIRECT3D8: case video::EDT_DIRECT3D9: os::Printer::log("This driver is not available in FB. Try Software renderer.", ELL_WARNING); diff --git a/source/Irrlicht/CIrrDeviceLinux.cpp b/source/Irrlicht/CIrrDeviceLinux.cpp index 843c8dd3..30262c25 100644 --- a/source/Irrlicht/CIrrDeviceLinux.cpp +++ b/source/Irrlicht/CIrrDeviceLinux.cpp @@ -36,7 +36,7 @@ #include #include -#ifdef __FREE_BSD_ +#ifdef __FreeBSD__ #include #else @@ -236,7 +236,7 @@ int IrrPrintXError(Display *display, XErrorEvent *event) char msg[256]; char msg2[256]; - snprintf(msg, 256, "%d", event->request_code); + snprintf_irr(msg, 256, "%d", event->request_code); XGetErrorDatabaseText(display, "XRequest", msg, "unknown", msg2, 256); XGetErrorText(display, event->error_code, msg, 256); os::Printer::log("X Error", msg, ELL_WARNING); @@ -637,7 +637,7 @@ void CIrrDeviceLinux::createDriver() #endif break; - case video::EDT_DIRECT3D8: + case video::DEPRECATED_EDT_DIRECT3D8_NO_LONGER_EXISTS: case video::EDT_DIRECT3D9: os::Printer::log("This driver is not available in Linux. Try OpenGL or Software renderer.", ELL_ERROR); @@ -1252,7 +1252,6 @@ void CIrrDeviceLinux::setResizable(bool resize) if (CreationParams.DriverType == video::EDT_NULL || CreationParams.Fullscreen ) return; - XUnmapWindow(XDisplay, XWindow); if ( !resize ) { // Must be heap memory because data size depends on X Server @@ -1267,7 +1266,6 @@ void CIrrDeviceLinux::setResizable(bool resize) { XSetWMNormalHints(XDisplay, XWindow, StdHints); } - XMapWindow(XDisplay, XWindow); XFlush(XDisplay); #endif // #ifdef _IRR_COMPILE_WITH_X11_ } @@ -1442,7 +1440,7 @@ void CIrrDeviceLinux::createKeyMap() // Search for missing numbers in keysymdef.h #ifdef _IRR_COMPILE_WITH_X11_ - KeyMap.reallocate(84); + KeyMap.reallocate(190); KeyMap.push_back(SKeyMap(XK_BackSpace, KEY_BACK)); KeyMap.push_back(SKeyMap(XK_Tab, KEY_TAB)); KeyMap.push_back(SKeyMap(XK_ISO_Left_Tab, KEY_TAB)); @@ -1495,16 +1493,16 @@ void CIrrDeviceLinux::createKeyMap() KeyMap.push_back(SKeyMap(XK_KP_Subtract, KEY_SUBTRACT)); KeyMap.push_back(SKeyMap(XK_KP_Decimal, KEY_DECIMAL)); KeyMap.push_back(SKeyMap(XK_KP_Divide, KEY_DIVIDE)); - KeyMap.push_back(SKeyMap(XK_KP_0, KEY_KEY_0)); - KeyMap.push_back(SKeyMap(XK_KP_1, KEY_KEY_1)); - KeyMap.push_back(SKeyMap(XK_KP_2, KEY_KEY_2)); - KeyMap.push_back(SKeyMap(XK_KP_3, KEY_KEY_3)); - KeyMap.push_back(SKeyMap(XK_KP_4, KEY_KEY_4)); - KeyMap.push_back(SKeyMap(XK_KP_5, KEY_KEY_5)); - KeyMap.push_back(SKeyMap(XK_KP_6, KEY_KEY_6)); - KeyMap.push_back(SKeyMap(XK_KP_7, KEY_KEY_7)); - KeyMap.push_back(SKeyMap(XK_KP_8, KEY_KEY_8)); - KeyMap.push_back(SKeyMap(XK_KP_9, KEY_KEY_9)); + KeyMap.push_back(SKeyMap(XK_KP_0, KEY_NUMPAD0)); + KeyMap.push_back(SKeyMap(XK_KP_1, KEY_NUMPAD1)); + KeyMap.push_back(SKeyMap(XK_KP_2, KEY_NUMPAD2)); + KeyMap.push_back(SKeyMap(XK_KP_3, KEY_NUMPAD3)); + KeyMap.push_back(SKeyMap(XK_KP_4, KEY_NUMPAD4)); + KeyMap.push_back(SKeyMap(XK_KP_5, KEY_NUMPAD5)); + KeyMap.push_back(SKeyMap(XK_KP_6, KEY_NUMPAD6)); + KeyMap.push_back(SKeyMap(XK_KP_7, KEY_NUMPAD7)); + KeyMap.push_back(SKeyMap(XK_KP_8, KEY_NUMPAD8)); + KeyMap.push_back(SKeyMap(XK_KP_9, KEY_NUMPAD9)); KeyMap.push_back(SKeyMap(XK_F1, KEY_F1)); KeyMap.push_back(SKeyMap(XK_F2, KEY_F2)); KeyMap.push_back(SKeyMap(XK_F3, KEY_F3)); @@ -1675,7 +1673,7 @@ bool CIrrDeviceLinux::activateJoysticks(core::array & joystickInf if (-1 == info.fd) continue; -#ifdef __FREE_BSD_ +#ifdef __FreeBSD__ info.axes=2; info.buttons=2; #else @@ -1699,7 +1697,7 @@ bool CIrrDeviceLinux::activateJoysticks(core::array & joystickInf returnInfo.Axes = info.axes; returnInfo.Buttons = info.buttons; -#ifndef __FREE_BSD_ +#ifndef __FreeBSD__ char name[80]; ioctl( info.fd, JSIOCGNAME(80), name); returnInfo.Name = name; @@ -1734,13 +1732,14 @@ void CIrrDeviceLinux::pollJoysticks() { JoystickInfo & info = ActiveJoysticks[j]; -#ifdef __FREE_BSD_ +#ifdef __FreeBSD__ struct joystick js; - if (read(info.fd, &js, JS_RETURN) == JS_RETURN) + if (read(info.fd, &js, sizeof(js)) == sizeof(js)) { - info.persistentData.JoystickEvent.ButtonStates = js.buttons; /* should be a two-bit field */ + info.persistentData.JoystickEvent.ButtonStates = js.b1 | (js.b2 << 1); /* should be a two-bit field */ info.persistentData.JoystickEvent.Axis[0] = js.x; /* X axis */ info.persistentData.JoystickEvent.Axis[1] = js.y; /* Y axis */ + } #else struct js_event event; while (sizeof(event) == read(info.fd, &event, sizeof(event))) @@ -2076,7 +2075,7 @@ Cursor CIrrDeviceLinux::TextureToARGBCursor(irr::video::ITexture * tex, const co u32 bytesLeftGap = sourceRect.UpperLeftCorner.X * bytesPerPixel; u32 bytesRightGap = tex->getPitch() - sourceRect.LowerRightCorner.X * bytesPerPixel; XcursorPixel* target = image->pixels; - const u8* data = (const u8*)tex->lock(ETLM_READ_ONLY, 0); + const u8* data = (const u8*)tex->lock(video::ETLM_READ_ONLY, 0); data += sourceRect.UpperLeftCorner.Y*tex->getPitch(); for ( s32 y = 0; y < sourceRect.getHeight(); ++y ) { diff --git a/source/Irrlicht/CIrrDeviceSDL.cpp b/source/Irrlicht/CIrrDeviceSDL.cpp index 37c7789d..d47e256f 100644 --- a/source/Irrlicht/CIrrDeviceSDL.cpp +++ b/source/Irrlicht/CIrrDeviceSDL.cpp @@ -28,12 +28,6 @@ namespace irr { namespace video { - - #ifdef _IRR_COMPILE_WITH_DIRECT3D_8_ - IVideoDriver* createDirectX8Driver(const irr::SIrrlichtCreationParameters& params, - io::IFileSystem* io, HWND window); - #endif - #ifdef _IRR_COMPILE_WITH_DIRECT3D_9_ IVideoDriver* createDirectX9Driver(const irr::SIrrlichtCreationParameters& params, io::IFileSystem* io, HWND window); @@ -218,18 +212,8 @@ void CIrrDeviceSDL::createDriver() { switch(CreationParams.DriverType) { - case video::EDT_DIRECT3D8: - #ifdef _IRR_COMPILE_WITH_DIRECT3D_8_ - - VideoDriver = video::createDirectX8Driver(CreationParams, FileSystem, HWnd); - if (!VideoDriver) - { - os::Printer::log("Could not create DIRECT3D8 Driver.", ELL_ERROR); - } - #else - os::Printer::log("DIRECT3D8 Driver was not compiled into this dll. Try another one.", ELL_ERROR); - #endif // _IRR_COMPILE_WITH_DIRECT3D_8_ - + case video::DEPRECATED_EDT_DIRECT3D8_NO_LONGER_EXISTS: + os::Printer::log("DIRECT3D8 Driver is no longer supported in Irrlicht. Try another one.", ELL_ERROR); break; case video::EDT_DIRECT3D9: diff --git a/source/Irrlicht/CIrrDeviceStub.cpp b/source/Irrlicht/CIrrDeviceStub.cpp index fe3768a8..70fa1332 100644 --- a/source/Irrlicht/CIrrDeviceStub.cpp +++ b/source/Irrlicht/CIrrDeviceStub.cpp @@ -185,7 +185,7 @@ bool CIrrDeviceStub::checkVersion(const char* version) w += version; w += "). This may cause problems."; os::Printer::log(w.c_str(), ELL_WARNING); - _IRR_IMPLEMENT_MANAGED_MARSHALLING_BUGFIX; + return false; } @@ -241,7 +241,6 @@ bool CIrrDeviceStub::postEventFromUser(const SEvent& event) if (!absorbed && inputReceiver) absorbed = inputReceiver->postEventFromUser(event); - _IRR_IMPLEMENT_MANAGED_MARSHALLING_BUGFIX; return absorbed; } diff --git a/source/Irrlicht/CIrrDeviceWin32.cpp b/source/Irrlicht/CIrrDeviceWin32.cpp index 0cd28279..b72e0135 100644 --- a/source/Irrlicht/CIrrDeviceWin32.cpp +++ b/source/Irrlicht/CIrrDeviceWin32.cpp @@ -19,6 +19,8 @@ #include #include "SExposedVideoData.h" #if defined(_IRR_COMPILE_WITH_JOYSTICK_EVENTS_) +#include +#include #ifdef _IRR_COMPILE_WITH_DIRECTINPUT_JOYSTICK_ #define DIRECTINPUT_VERSION 0x0800 #include @@ -43,11 +45,6 @@ namespace irr { namespace video { - #ifdef _IRR_COMPILE_WITH_DIRECT3D_8_ - IVideoDriver* createDirectX8Driver(const irr::SIrrlichtCreationParameters& params, - io::IFileSystem* io, HWND window); - #endif - #ifdef _IRR_COMPILE_WITH_DIRECT3D_9_ IVideoDriver* createDirectX9Driver(const irr::SIrrlichtCreationParameters& params, io::IFileSystem* io, HWND window); @@ -82,31 +79,45 @@ namespace irr namespace irr { -struct SJoystickWin32Control -{ - CIrrDeviceWin32* Device; + struct SJoystickWin32Control + { + CIrrDeviceWin32* Device; -#if defined(_IRR_COMPILE_WITH_JOYSTICK_EVENTS_) && defined(_IRR_COMPILE_WITH_DIRECTINPUT_JOYSTICK_) - IDirectInput8* DirectInputDevice; -#endif -#if defined(_IRR_COMPILE_WITH_JOYSTICK_EVENTS_) - struct JoystickInfo - { - u32 Index; -#ifdef _IRR_COMPILE_WITH_DIRECTINPUT_JOYSTICK_ - core::stringc Name; - GUID guid; - LPDIRECTINPUTDEVICE8 lpdijoy; - DIDEVCAPS devcaps; - u8 axisValid[8]; -#else - JOYCAPS Caps; -#endif - }; - core::array ActiveJoysticks; -#endif + #if defined(_IRR_COMPILE_WITH_JOYSTICK_EVENTS_) && defined(_IRR_COMPILE_WITH_DIRECTINPUT_JOYSTICK_) + IDirectInput8* DirectInputDevice; + #endif + #if defined(_IRR_COMPILE_WITH_JOYSTICK_EVENTS_) + struct JoystickInfo + { + u32 Index; + #ifdef _IRR_COMPILE_WITH_DIRECTINPUT_JOYSTICK_ + core::stringc Name; + GUID guid; + LPDIRECTINPUTDEVICE8 lpdijoy; + DIDEVCAPS devcaps; + u8 axisValid[8]; + #else + JOYCAPS Caps; + #endif + }; + core::array ActiveJoysticks; + #endif - SJoystickWin32Control(CIrrDeviceWin32* dev) : Device(dev) + SJoystickWin32Control(CIrrDeviceWin32* dev); + ~SJoystickWin32Control(); + + #if defined(_IRR_COMPILE_WITH_JOYSTICK_EVENTS_) && defined(_IRR_COMPILE_WITH_DIRECTINPUT_JOYSTICK_) + static BOOL CALLBACK EnumJoysticks(LPCDIDEVICEINSTANCE lpddi, LPVOID cp); + void directInputAddJoystick(LPCDIDEVICEINSTANCE lpddi); + #endif + + void pollJoysticks(); + bool activateJoysticks(core::array & joystickInfo); + irr::core::stringc findJoystickName(int index, const JOYCAPS &caps) const; + }; + + + SJoystickWin32Control::SJoystickWin32Control(CIrrDeviceWin32* dev) : Device(dev) { #if defined(_IRR_COMPILE_WITH_JOYSTICK_EVENTS_) && defined(_IRR_COMPILE_WITH_DIRECTINPUT_JOYSTICK_) DirectInputDevice=0; @@ -117,7 +128,8 @@ struct SJoystickWin32Control } #endif } - ~SJoystickWin32Control() + + SJoystickWin32Control::~SJoystickWin32Control() { #if defined(_IRR_COMPILE_WITH_JOYSTICK_EVENTS_) && defined(_IRR_COMPILE_WITH_DIRECTINPUT_JOYSTICK_) for(u32 joystick = 0; joystick < ActiveJoysticks.size(); ++joystick) @@ -136,13 +148,13 @@ struct SJoystickWin32Control } #if defined(_IRR_COMPILE_WITH_JOYSTICK_EVENTS_) && defined(_IRR_COMPILE_WITH_DIRECTINPUT_JOYSTICK_) - static BOOL CALLBACK EnumJoysticks(LPCDIDEVICEINSTANCE lpddi, LPVOID cp) + BOOL CALLBACK SJoystickWin32Control::EnumJoysticks(LPCDIDEVICEINSTANCE lpddi, LPVOID cp) { SJoystickWin32Control* p=(SJoystickWin32Control*)cp; p->directInputAddJoystick(lpddi); return DIENUM_CONTINUE; } - void directInputAddJoystick(LPCDIDEVICEINSTANCE lpddi) + void SJoystickWin32Control::directInputAddJoystick(LPCDIDEVICEINSTANCE lpddi) { //Get the GUID of the joystuck const GUID guid = lpddi->guidInstance; @@ -214,7 +226,7 @@ struct SJoystickWin32Control } #endif -void pollJoysticks() +void SJoystickWin32Control::pollJoysticks() { #if defined _IRR_COMPILE_WITH_JOYSTICK_EVENTS_ #ifdef _IRR_COMPILE_WITH_DIRECTINPUT_JOYSTICK_ @@ -386,7 +398,69 @@ void pollJoysticks() #endif // _IRR_COMPILE_WITH_JOYSTICK_EVENTS_ } -bool activateJoysticks(core::array & joystickInfo) +/** This function is ported from SDL and released under zlib-license: + * Copyright (C) 1997-2014 Sam Lantinga */ +irr::core::stringc SJoystickWin32Control::findJoystickName(int index, const JOYCAPS &caps) const +{ +#if defined _IRR_COMPILE_WITH_JOYSTICK_EVENTS_ + + // As a default use the name given in the joystick structure. + // It is always the same name, independent of joystick. + irr::core::stringc result(caps.szPname); + + core::stringc key = core::stringc(REGSTR_PATH_JOYCONFIG)+ "\\" + caps.szRegKey + "\\" + REGSTR_KEY_JOYCURR; + HKEY hTopKey = HKEY_LOCAL_MACHINE; + HKEY hKey; + long regresult = RegOpenKeyExA(hTopKey, key.c_str(), 0, KEY_READ, &hKey); + if (regresult != ERROR_SUCCESS) + { + hTopKey = HKEY_CURRENT_USER; + regresult = RegOpenKeyExA(hTopKey, key.c_str(), 0, KEY_READ, &hKey); + } + if (regresult != ERROR_SUCCESS) + return result; + + /* find the registry key name for the joystick's properties */ + char regname[256]; + DWORD regsize = sizeof(regname); + core::stringc regvalue = core::stringc("Joystick")+core::stringc(index+1) + REGSTR_VAL_JOYOEMNAME; + regresult = RegQueryValueExA(hKey, regvalue.c_str(), 0, 0, (LPBYTE)regname, ®size); + RegCloseKey(hKey); + if (regresult != ERROR_SUCCESS) + return result; + + /* open that registry key */ + core::stringc regkey = core::stringc(REGSTR_PATH_JOYOEM) + "\\" + regname; + regresult = RegOpenKeyExA(hTopKey, regkey.c_str(), 0, KEY_READ, &hKey); + if (regresult != ERROR_SUCCESS) + return result; + + /* find the size for the OEM name text */ + regsize = sizeof(regvalue); + regresult = RegQueryValueEx(hKey, REGSTR_VAL_JOYOEMNAME, 0, 0, + NULL, ®size); + if (regresult == ERROR_SUCCESS) + { + char *name; + /* allocate enough memory for the OEM name text ... */ + name = new char[regsize]; + if (name) + { + /* ... and read it from the registry */ + regresult = RegQueryValueEx(hKey, REGSTR_VAL_JOYOEMNAME, 0, 0, + (LPBYTE)name, ®size ); + result = name; + } + delete[] name; + } + RegCloseKey(hKey); + + return result; +#endif + return ""; +} + +bool SJoystickWin32Control::activateJoysticks(core::array & joystickInfo) { #if defined _IRR_COMPILE_WITH_JOYSTICK_EVENTS_ #ifdef _IRR_COMPILE_WITH_DIRECTINPUT_JOYSTICK_ @@ -438,7 +512,7 @@ bool activateJoysticks(core::array & joystickInfo) returnInfo.Joystick = (u8)joystick; returnInfo.Axes = activeJoystick.Caps.wNumAxes; returnInfo.Buttons = activeJoystick.Caps.wNumButtons; - returnInfo.Name = activeJoystick.Caps.szPname; + returnInfo.Name = findJoystickName(joystick, activeJoystick.Caps); returnInfo.PovHat = ((activeJoystick.Caps.wCaps & JOYCAPS_HASPOV) == JOYCAPS_HASPOV) ? SJoystickInfo::POV_HAT_PRESENT : SJoystickInfo::POV_HAT_ABSENT; @@ -461,7 +535,6 @@ bool activateJoysticks(core::array & joystickInfo) return false; #endif // _IRR_COMPILE_WITH_JOYSTICK_EVENTS_ } -}; } // end namespace irr // Get the codepage from the locale language id @@ -825,7 +898,7 @@ LRESULT CALLBACK WndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam) // Using ToUnicode instead would be shorter, but would to my knowledge not run on 95 and 98. WORD keyChars[2]; UINT scanCode = HIWORD(lParam); - int conversionResult = ToAsciiEx(wParam,scanCode,allKeys,keyChars,0,KEYBOARD_INPUT_HKL); + int conversionResult = ToAsciiEx(static_cast(wParam),scanCode,allKeys,keyChars,0,KEYBOARD_INPUT_HKL); if (conversionResult == 1) { WORD unicodeChar; @@ -1119,19 +1192,8 @@ void CIrrDeviceWin32::createDriver() { switch(CreationParams.DriverType) { - case video::EDT_DIRECT3D8: - #ifdef _IRR_COMPILE_WITH_DIRECT3D_8_ - - VideoDriver = video::createDirectX8Driver(CreationParams, FileSystem, HWnd); - - if (!VideoDriver) - { - os::Printer::log("Could not create DIRECT3D8 Driver.", ELL_ERROR); - } - #else - os::Printer::log("DIRECT3D8 Driver was not compiled into this dll. Try another one.", ELL_ERROR); - #endif // _IRR_COMPILE_WITH_DIRECT3D_8_ - + case video::DEPRECATED_EDT_DIRECT3D8_NO_LONGER_EXISTS: + os::Printer::log("DIRECT3D8 Driver is no longer supported in Irrlicht. Try another one.", ELL_ERROR); break; case video::EDT_DIRECT3D9: @@ -1252,7 +1314,6 @@ bool CIrrDeviceWin32::run() if(!Close && JoyControl) JoyControl->pollJoysticks(); - _IRR_IMPLEMENT_MANAGED_MARSHALLING_BUGFIX; return !Close; } @@ -1330,7 +1391,7 @@ bool CIrrDeviceWin32::present(video::IImage* image, void* windowId, core::rectlock(); + const void* memory = (const void *)image->getData(); BITMAPV4HEADER bi; ZeroMemory (&bi, sizeof(bi)); @@ -1359,8 +1420,6 @@ bool CIrrDeviceWin32::present(video::IImage* image, void* windowId, core::rectunlock(); - ReleaseDC(hwnd, dc); } return true; @@ -1388,7 +1447,6 @@ void CIrrDeviceWin32::closeDevice() //! returns if window is active. if not, nothing needs to be drawn bool CIrrDeviceWin32::isWindowActive() const { - _IRR_IMPLEMENT_MANAGED_MARSHALLING_BUGFIX; return (GetActiveWindow() == HWnd); } @@ -1397,7 +1455,6 @@ bool CIrrDeviceWin32::isWindowActive() const bool CIrrDeviceWin32::isWindowFocused() const { bool ret = (GetFocus() == HWnd); - _IRR_IMPLEMENT_MANAGED_MARSHALLING_BUGFIX; return ret; } @@ -1410,7 +1467,6 @@ bool CIrrDeviceWin32::isWindowMinimized() const bool ret=false; if (GetWindowPlacement(HWnd,&plc)) ret=(plc.showCmd & SW_SHOWMINIMIZED)!=0; - _IRR_IMPLEMENT_MANAGED_MARSHALLING_BUGFIX; return ret; } @@ -1476,7 +1532,6 @@ bool CIrrDeviceWin32::switchToFullScreen(bool reset) os::Printer::log("An unknown error occured while changing to fullscreen.", ELL_ERROR); break; } - _IRR_IMPLEMENT_MANAGED_MARSHALLING_BUGFIX; return ret; } @@ -1692,7 +1747,7 @@ void CIrrDeviceWin32::getWindowsVersion(core::stringc& out) if (osvi.dwMajorVersion <= 4 ) { - sprintf(tmp, "version %ld.%ld %s (Build %ld)", + sprintf(tmp, "version %lu.%lu %s (Build %lu)", osvi.dwMajorVersion, osvi.dwMinorVersion, irr::core::stringc(osvi.szCSDVersion).c_str(), @@ -1700,7 +1755,7 @@ void CIrrDeviceWin32::getWindowsVersion(core::stringc& out) } else { - sprintf(tmp, "%s (Build %ld)", irr::core::stringc(osvi.szCSDVersion).c_str(), + sprintf(tmp, "%s (Build %lu)", irr::core::stringc(osvi.szCSDVersion).c_str(), osvi.dwBuildNumber & 0xFFFF); } @@ -1747,8 +1802,8 @@ void CIrrDeviceWin32::setWindowSize(const irr::core::dimension2d& size) return; // get size of the window for the give size of the client area - LONG_PTR style = GetWindowLongPtr(HWnd, GWL_STYLE); - LONG_PTR exStyle = GetWindowLongPtr(HWnd, GWL_EXSTYLE); + DWORD style = static_cast(GetWindowLongPtr(HWnd, GWL_STYLE)); + DWORD exStyle = static_cast(GetWindowLongPtr(HWnd, GWL_EXSTYLE)); RECT clientSize; clientSize.top = 0; clientSize.left = 0; @@ -1784,7 +1839,7 @@ void CIrrDeviceWin32::setResizable(bool resize) clientSize.right = getVideoDriver()->getScreenSize().Width; clientSize.bottom = getVideoDriver()->getScreenSize().Height; - AdjustWindowRect(&clientSize, style, FALSE); + AdjustWindowRect(&clientSize, static_cast(style), FALSE); const s32 realWidth = clientSize.right - clientSize.left; const s32 realHeight = clientSize.bottom - clientSize.top; diff --git a/source/Irrlicht/CIrrDeviceWin32.h b/source/Irrlicht/CIrrDeviceWin32.h index 4912a0ce..e231d26e 100644 --- a/source/Irrlicht/CIrrDeviceWin32.h +++ b/source/Irrlicht/CIrrDeviceWin32.h @@ -177,7 +177,6 @@ namespace irr //! Returns if the cursor is currently visible. virtual bool isVisible() const _IRR_OVERRIDE_ { - _IRR_IMPLEMENT_MANAGED_MARSHALLING_BUGFIX; return IsVisible; } diff --git a/source/Irrlicht/CIrrDeviceWinCE.cpp b/source/Irrlicht/CIrrDeviceWinCE.cpp deleted file mode 100644 index e6eb27d3..00000000 --- a/source/Irrlicht/CIrrDeviceWinCE.cpp +++ /dev/null @@ -1,868 +0,0 @@ -// Copyright (C) 2002-2012 Nikolaus Gebhardt -// This file is part of the "Irrlicht Engine". -// For conditions of distribution and use, see copyright notice in irrlicht.h - -#include "IrrCompileConfig.h" - -#ifdef _IRR_COMPILE_WITH_WINDOWS_CE_DEVICE_ - -#include "CIrrDeviceWinCE.h" -#include "IEventReceiver.h" -#include "irrList.h" -#include "os.h" - -#include "CTimer.h" -#include "irrString.h" -#include "COSOperator.h" -#include "dimension2d.h" -#include -#include "irrlicht.h" - -#ifdef _MSC_VER - #pragma comment (lib, "aygshell.lib") -#endif - - -namespace irr -{ - namespace video - { - #ifdef _IRR_COMPILE_WITH_DIRECT3D_8_ - IVideoDriver* createDirectX8Driver(const irr::SIrrlichtCreationParameters& params, - io::IFileSystem* io, HWND window); - #endif - - #ifdef _IRR_COMPILE_WITH_DIRECT3D_9_ - IVideoDriver* createDirectX9Driver(const irr::SIrrlichtCreationParameters& params, - io::IFileSystem* io, HWND window); - #endif - - #ifdef _IRR_COMPILE_WITH_OPENGL_ - IVideoDriver* createOpenGLDriver(const irr::SIrrlichtCreationParameters& params, io::IFileSystem* io, this); - #endif - } -} // end namespace irr - - - -struct SEnvMapper -{ - HWND hWnd; - irr::CIrrDeviceWinCE* irrDev; -}; - -irr::core::list EnvMap; - -SEnvMapper* getEnvMapperFromHWnd(HWND hWnd) -{ - irr::core::list::Iterator it = EnvMap.begin(); - for (; it!= EnvMap.end(); ++it) - if ((*it).hWnd == hWnd) - return &(*it); - - return 0; -} - -irr::CIrrDeviceWinCE* getDeviceFromHWnd(HWND hWnd) -{ - irr::core::list::Iterator it = EnvMap.begin(); - for (; it!= EnvMap.end(); ++it) - if ((*it).hWnd == hWnd) - return (*it).irrDev; - - return 0; -} - - -LRESULT CALLBACK WndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam) -{ - #ifndef WM_MOUSEWHEEL - #define WM_MOUSEWHEEL 0x020A - #endif - #ifndef WHEEL_DELTA - #define WHEEL_DELTA 120 - #endif - - irr::CIrrDeviceWinCE* dev = 0; - irr::SEvent event; - SEnvMapper* envm = 0; - - //BYTE allKeys[256]; - - static irr::s32 ClickCount=0; - if (GetCapture() != hWnd && ClickCount > 0) - ClickCount = 0; - - switch (message) - { - case WM_PAINT: - { - PAINTSTRUCT ps; - BeginPaint(hWnd, &ps); - EndPaint(hWnd, &ps); - } - return 0; - - case WM_ERASEBKGND: - return 0; - - case WM_SETCURSOR: - envm = getEnvMapperFromHWnd(hWnd); - if (envm && !envm->irrDev->getWin32CursorControl()->isVisible()) - { - SetCursor(NULL); - return 0; - } - break; - - case WM_MOUSEWHEEL: - event.EventType = irr::EET_MOUSE_INPUT_EVENT; - event.MouseInput.Wheel = ((irr::f32)((short)HIWORD(wParam))) / (irr::f32)WHEEL_DELTA; - event.MouseInput.Event = irr::EMIE_MOUSE_WHEEL; - - POINT p; // fixed by jox - p.x = 0; p.y = 0; - ClientToScreen(hWnd, &p); - event.MouseInput.X = LOWORD(lParam) - p.x; - event.MouseInput.Y = HIWORD(lParam) - p.y; - event.MouseInput.Shift = ((LOWORD(wParam) & MK_SHIFT) != 0); - event.MouseInput.Control = ((LOWORD(wParam) & MK_CONTROL) != 0); - // left and right mouse buttons - event.MouseInput.ButtonStates = wParam & ( MK_LBUTTON | MK_RBUTTON); - // middle and extra buttons - if (wParam & MK_MBUTTON) - event.MouseInput.ButtonStates |= irr::EMBSM_MIDDLE; - - dev = getDeviceFromHWnd(hWnd); - if (dev) - dev->postEventFromUser(event); - break; - - case WM_LBUTTONDOWN: - ClickCount++; - SetCapture(hWnd); - event.EventType = irr::EET_MOUSE_INPUT_EVENT; - event.MouseInput.Event = irr::EMIE_LMOUSE_PRESSED_DOWN; - event.MouseInput.X = (short)LOWORD(lParam); - event.MouseInput.Y = (short)HIWORD(lParam); - event.MouseInput.Shift = ((LOWORD(wParam) & MK_SHIFT) != 0); - event.MouseInput.Control = ((LOWORD(wParam) & MK_CONTROL) != 0); - // left and right mouse buttons - event.MouseInput.ButtonStates = wParam & ( MK_LBUTTON | MK_RBUTTON); - // middle and extra buttons - if (wParam & MK_MBUTTON) - event.MouseInput.ButtonStates |= irr::EMBSM_MIDDLE; - - dev = getDeviceFromHWnd(hWnd); - if (dev) - dev->postEventFromUser(event); - return 0; - - case WM_LBUTTONUP: - ClickCount--; - if (ClickCount<1) - { - ClickCount=0; - ReleaseCapture(); - } - event.EventType = irr::EET_MOUSE_INPUT_EVENT; - event.MouseInput.Event = irr::EMIE_LMOUSE_LEFT_UP; - event.MouseInput.X = (short)LOWORD(lParam); - event.MouseInput.Y = (short)HIWORD(lParam); - event.MouseInput.Shift = ((LOWORD(wParam) & MK_SHIFT) != 0); - event.MouseInput.Control = ((LOWORD(wParam) & MK_CONTROL) != 0); - // left and right mouse buttons - event.MouseInput.ButtonStates = wParam & ( MK_LBUTTON | MK_RBUTTON); - // middle and extra buttons - if (wParam & MK_MBUTTON) - event.MouseInput.ButtonStates |= irr::EMBSM_MIDDLE; - - dev = getDeviceFromHWnd(hWnd); - if (dev) - dev->postEventFromUser(event); - return 0; - - case WM_RBUTTONDOWN: - ClickCount++; - SetCapture(hWnd); - event.EventType = irr::EET_MOUSE_INPUT_EVENT; - event.MouseInput.Event = irr::EMIE_RMOUSE_PRESSED_DOWN; - event.MouseInput.X = (short)LOWORD(lParam); - event.MouseInput.Y = (short)HIWORD(lParam); - event.MouseInput.Shift = ((LOWORD(wParam) & MK_SHIFT) != 0); - event.MouseInput.Control = ((LOWORD(wParam) & MK_CONTROL) != 0); - // left and right mouse buttons - event.MouseInput.ButtonStates = wParam & ( MK_LBUTTON | MK_RBUTTON); - // middle and extra buttons - if (wParam & MK_MBUTTON) - event.MouseInput.ButtonStates |= irr::EMBSM_MIDDLE; - - dev = getDeviceFromHWnd(hWnd); - if (dev) - dev->postEventFromUser(event); - return 0; - - case WM_RBUTTONUP: - ClickCount--; - if (ClickCount<1) - { - ClickCount=0; - ReleaseCapture(); - } - event.EventType = irr::EET_MOUSE_INPUT_EVENT; - event.MouseInput.Event = irr::EMIE_RMOUSE_LEFT_UP; - event.MouseInput.X = (short)LOWORD(lParam); - event.MouseInput.Y = (short)HIWORD(lParam); - event.MouseInput.Shift = ((LOWORD(wParam) & MK_SHIFT) != 0); - event.MouseInput.Control = ((LOWORD(wParam) & MK_CONTROL) != 0); - // left and right mouse buttons - event.MouseInput.ButtonStates = wParam & ( MK_LBUTTON | MK_RBUTTON); - // middle and extra buttons - if (wParam & MK_MBUTTON) - event.MouseInput.ButtonStates |= irr::EMBSM_MIDDLE; - - dev = getDeviceFromHWnd(hWnd); - if (dev) - dev->postEventFromUser(event); - return 0; - - case WM_MBUTTONDOWN: - ClickCount++; - SetCapture(hWnd); - event.EventType = irr::EET_MOUSE_INPUT_EVENT; - event.MouseInput.Event = irr::EMIE_MMOUSE_PRESSED_DOWN; - event.MouseInput.X = (short)LOWORD(lParam); - event.MouseInput.Y = (short)HIWORD(lParam); - event.MouseInput.Shift = ((LOWORD(wParam) & MK_SHIFT) != 0); - event.MouseInput.Control = ((LOWORD(wParam) & MK_CONTROL) != 0); - // left and right mouse buttons - event.MouseInput.ButtonStates = wParam & ( MK_LBUTTON | MK_RBUTTON); - // middle and extra buttons - if (wParam & MK_MBUTTON) - event.MouseInput.ButtonStates |= irr::EMBSM_MIDDLE; - - dev = getDeviceFromHWnd(hWnd); - if (dev) - dev->postEventFromUser(event); - return 0; - - case WM_MBUTTONUP: - ClickCount--; - if (ClickCount<1) - { - ClickCount=0; - ReleaseCapture(); - } - event.EventType = irr::EET_MOUSE_INPUT_EVENT; - event.MouseInput.Event = irr::EMIE_MMOUSE_LEFT_UP; - event.MouseInput.X = (short)LOWORD(lParam); - event.MouseInput.Y = (short)HIWORD(lParam); - event.MouseInput.Shift = ((LOWORD(wParam) & MK_SHIFT) != 0); - event.MouseInput.Control = ((LOWORD(wParam) & MK_CONTROL) != 0); - // left and right mouse buttons - event.MouseInput.ButtonStates = wParam & ( MK_LBUTTON | MK_RBUTTON); - // middle and extra buttons - if (wParam & MK_MBUTTON) - event.MouseInput.ButtonStates |= irr::EMBSM_MIDDLE; - - dev = getDeviceFromHWnd(hWnd); - if (dev) - dev->postEventFromUser(event); - return 0; - - case WM_MOUSEMOVE: - event.EventType = irr::EET_MOUSE_INPUT_EVENT; - event.MouseInput.Event = irr::EMIE_MOUSE_MOVED; - event.MouseInput.X = (short)LOWORD(lParam); - event.MouseInput.Y = (short)HIWORD(lParam); - event.MouseInput.Shift = ((LOWORD(wParam) & MK_SHIFT) != 0); - event.MouseInput.Control = ((LOWORD(wParam) & MK_CONTROL) != 0); - // left and right mouse buttons - event.MouseInput.ButtonStates = wParam & ( MK_LBUTTON | MK_RBUTTON); - // middle and extra buttons - if (wParam & MK_MBUTTON) - event.MouseInput.ButtonStates |= irr::EMBSM_MIDDLE; - - dev = getDeviceFromHWnd(hWnd); - if (dev) - dev->postEventFromUser(event); - - return 0; - - case WM_SYSKEYDOWN: - case WM_SYSKEYUP: - case WM_KEYDOWN: - case WM_KEYUP: - { - event.EventType = irr::EET_KEY_INPUT_EVENT; - event.KeyInput.Key = (irr::EKEY_CODE)wParam; - event.KeyInput.PressedDown = (message==WM_KEYDOWN || message == WM_SYSKEYDOWN); - dev = getDeviceFromHWnd(hWnd); -/* - WORD KeyAsc=0; - GetKeyboardState(allKeys); - ToAscii(wParam,lParam,allKeys,&KeyAsc,0); -*/ -// event.KeyInput.Shift = ((allKeys[VK_SHIFT] & 0x80)!=0); -// event.KeyInput.Control = ((allKeys[VK_CONTROL] & 0x80)!=0); -// event.KeyInput.Char = (KeyAsc & 0x00ff); //KeyAsc >= 0 ? KeyAsc : 0; - - if (dev) - dev->postEventFromUser(event); - - return 0; - } - - case WM_SIZE: - { - // resize - dev = getDeviceFromHWnd(hWnd); - if (dev) - dev->OnResized(); - } - return 0; - - case WM_DESTROY: - PostQuitMessage(0); - return 0; - - } - - return DefWindowProc(hWnd, message, wParam, lParam); -} - -namespace irr -{ - -//! constructor -CIrrDeviceWinCE::CIrrDeviceWinCE(const SIrrlichtCreationParameters& params) -: CIrrDeviceStub(params), HWnd(0), - Win32CursorControl(0), ChangedToFullScreen(false), Resized(false), - ExternalWindow(false) -{ - #ifdef _DEBUG - setDebugName("CIrrDeviceWinCE"); - #endif - - core::stringc winversion; - getWindowsVersion(winversion); - Operator = new COSOperator(winversion); - os::Printer::log(winversion.c_str(), ELL_INFORMATION); - - HINSTANCE hInstance = GetModuleHandle(0); - - // create the window only if we do not use the null device - if (!CreationParams.WindowId && (CreationParams.DriverType != video::EDT_NULL)) - { - const wchar_t* ClassName = L"CIrrDeviceWinCE"; - - // Register Class - WNDCLASS wc; - wc.style = CS_HREDRAW | CS_VREDRAW; - wc.lpfnWndProc = WndProc; - wc.cbClsExtra = 0; - wc.cbWndExtra = 0; - wc.hInstance = hInstance; - wc.hIcon = NULL; - wc.hCursor = LoadCursor(NULL, IDC_ARROW); - wc.hbrBackground = (HBRUSH)(COLOR_WINDOW+1); - wc.lpszMenuName = 0; - wc.lpszClassName = ClassName; - - // if there is an icon, load it - wc.hIcon = (HICON)LoadImageW(hInstance, L"irrlicht.ico", IMAGE_ICON, 0,0, 0); - - RegisterClass(&wc); - - // calculate client size - - RECT clientSize; - clientSize.top = 0; - clientSize.left = 0; - clientSize.right = CreationParams.WindowSize.Width; - clientSize.bottom = CreationParams.WindowSize.Height; - - DWORD style = WS_POPUP; - - if (!CreationParams.Fullscreen) - style = WS_SYSMENU | WS_BORDER | WS_CAPTION | WS_CLIPCHILDREN | WS_CLIPSIBLINGS; - - AdjustWindowRectEx(&clientSize, style, FALSE, 0); - - const s32 realWidth = clientSize.right - clientSize.left; - const s32 realHeight = clientSize.bottom - clientSize.top; - - const s32 windowLeft = core::s32_max ( 0, (GetSystemMetrics(SM_CXSCREEN) - realWidth) >> 1 ); - const s32 windowTop = core::s32_max ( 0, (GetSystemMetrics(SM_CYSCREEN) - realHeight) >> 1 ); - - // create window - - HWnd = CreateWindowW( ClassName, L"", style, windowLeft, windowTop, - realWidth, realHeight, NULL, NULL, hInstance, NULL); - - ShowWindow(HWnd , SW_SHOW); - UpdateWindow(HWnd); - - // fix ugly ATI driver bugs. Thanks to ariaci - MoveWindow(HWnd, windowLeft, windowTop, realWidth, realHeight, TRUE); - } - else if (CreationParams.WindowId) - { - // attach external window - HWnd = static_cast(CreationParams.WindowId); - RECT r; - GetWindowRect(HWnd, &r); - CreationParams.WindowSize.Width = r.right - r.left; - CreationParams.WindowSize.Height = r.bottom - r.top; - CreationParams.Fullscreen = false; - ExternalWindow = true; - } - - // create cursor control - - Win32CursorControl = new CCursorControl(CreationParams.WindowSize, HWnd, CreationParams.Fullscreen); - CursorControl = Win32CursorControl; - - // create driver - - createDriver(); - - if (VideoDriver) - createGUIAndScene(); - - // register environment - - SEnvMapper em; - em.irrDev = this; - em.hWnd = HWnd; - EnvMap.push_back(em); - - // set this as active window - SetActiveWindow(HWnd); - SetForegroundWindow(HWnd); -} - - -//! destructor -CIrrDeviceWinCE::~CIrrDeviceWinCE() -{ - // unregister environment - - if (ChangedToFullScreen) - SHFullScreen(HWnd, SHFS_SHOWTASKBAR | SHFS_SHOWSTARTICON | SHFS_SHOWSIPBUTTON); - - irr::core::list::Iterator it = EnvMap.begin(); - for (; it!= EnvMap.end(); ++it) - if ((*it).hWnd == HWnd) - { - EnvMap.erase(it); - break; - } -} - - -//! create the driver -void CIrrDeviceWinCE::createDriver() -{ - switch(CreationParams.DriverType) - { - case video::EDT_DIRECT3D8: - #ifdef _IRR_COMPILE_WITH_DIRECT3D_8_ - VideoDriver = video::createDirectX8Driver(CreationParams, FileSystem, HWnd); - if (!VideoDriver) - { - os::Printer::log("Could not create DIRECT3D8 Driver.", ELL_ERROR); - } - #else - os::Printer::log("DIRECT3D8 Driver was not compiled into this dll. Try another one.", ELL_ERROR); - #endif // _IRR_COMPILE_WITH_DIRECT3D_8_ - - break; - - case video::EDT_DIRECT3D9: - #ifdef _IRR_COMPILE_WITH_DIRECT3D_9_ - VideoDriver = video::createDirectX9Driver(CreationParams, FileSystem, HWnd); - if (!VideoDriver) - { - os::Printer::log("Could not create DIRECT3D9 Driver.", ELL_ERROR); - } - #else - os::Printer::log("DIRECT3D9 Driver was not compiled into this dll. Try another one.", ELL_ERROR); - #endif // _IRR_COMPILE_WITH_DIRECT3D_9_ - - break; - - case video::EDT_OPENGL: - - #ifdef _IRR_COMPILE_WITH_OPENGL_ - if (CreationParams.Fullscreen) - switchToFullScreen(); - VideoDriver = video::createOpenGLDriver(CreationParams, FileSystem); - if (!VideoDriver) - { - os::Printer::log("Could not create OpenGL driver.", ELL_ERROR); - } - #else - os::Printer::log("OpenGL driver was not compiled in.", ELL_ERROR); - #endif - break; - - case video::EDT_SOFTWARE: - - #ifdef _IRR_COMPILE_WITH_SOFTWARE_ - if (CreationParams.Fullscreen) - switchToFullScreen(); - VideoDriver = video::createSoftwareDriver(CreationParams.WindowSize, CreationParams.Fullscreen, FileSystem, this); - #else - os::Printer::log("Software driver was not compiled in.", ELL_ERROR); - #endif - - break; - - case video::EDT_BURNINGSVIDEO: - #ifdef _IRR_COMPILE_WITH_BURNINGSVIDEO_ - if (CreationParams.Fullscreen) - switchToFullScreen(); - VideoDriver = video::createBurningVideoDriver(CreationParams, FileSystem, this); - #else - os::Printer::log("Burning's Video driver was not compiled in.", ELL_ERROR); - #endif - break; - - case video::EDT_NULL: - // create null driver - VideoDriver = video::createNullDriver(FileSystem, CreationParams.WindowSize); - break; - - default: - os::Printer::log("Unable to create video driver of unknown type.", ELL_ERROR); - break; - } -} - - -//! runs the device. Returns false if device wants to be deleted -bool CIrrDeviceWinCE::run() -{ - os::Timer::tick(); - - MSG msg; - - while (PeekMessage(&msg, NULL, 0, 0, PM_REMOVE)) - { - TranslateMessage(&msg); - - if (ExternalWindow && msg.hwnd == HWnd) - WndProc(HWnd, msg.message, msg.wParam, msg.lParam); - else - DispatchMessage(&msg); - - if (msg.message == WM_QUIT) - Close = true; - } - - if (!Close) - resizeIfNecessary(); - - _IRR_IMPLEMENT_MANAGED_MARSHALLING_BUGFIX; - return !Close; -} - - -//! Pause the current process for the minimum time allowed only to allow other processes to execute -void CIrrDeviceWinCE::yield() -{ - Sleep(1); -} - - -//! Pause execution and let other processes to run for a specified amount of time. -void CIrrDeviceWinCE::sleep(u32 timeMs, bool pauseTimer) -{ - const bool wasStopped = Timer ? Timer->isStopped() : true; - if (pauseTimer && !wasStopped) - Timer->stop(); - - Sleep(timeMs); - - if (pauseTimer && !wasStopped) - Timer->start(); -} - - -void CIrrDeviceWinCE::resizeIfNecessary() -{ - if (!Resized) - return; - - RECT r; - GetClientRect(HWnd, &r); - - char tmp[255]; - - if (r.right < 2 || r.bottom < 2) - { - sprintf(tmp, "Ignoring resize operation to (%ld %ld)", r.right, r.bottom); - os::Printer::log(tmp); - } - else - { - sprintf(tmp, "Resizing window (%ld %ld)", r.right, r.bottom); - os::Printer::log(tmp); - - getVideoDriver()->OnResize(irr::core::dimension2d(r.right, r.bottom)); - getWin32CursorControl()->OnResize(getVideoDriver()->getScreenSize()); - } - - Resized = false; -} - - -//! sets the caption of the window -void CIrrDeviceWinCE::setWindowCaption(const wchar_t* text) -{ - SetWindowTextW(HWnd, text); -} - - -#if !defined(BITMAPV4HEADER) -typedef struct { - DWORD bV4Size; - LONG bV4Width; - LONG bV4Height; - WORD bV4Planes; - WORD bV4BitCount; - DWORD bV4V4Compression; - DWORD bV4SizeImage; - LONG bV4XPelsPerMeter; - LONG bV4YPelsPerMeter; - DWORD bV4ClrUsed; - DWORD bV4ClrImportant; - DWORD bV4RedMask; - DWORD bV4GreenMask; - DWORD bV4BlueMask; - DWORD bV4AlphaMask; - DWORD bV4CSType; - DWORD un[9]; -} BITMAPV4HEADER, *PBITMAPV4HEADER; -#endif - - -//! presents a surface in the client area -bool CIrrDeviceWinCE::present(video::IImage* image, void* windowId, core::rect* src) -{ - HWND hwnd = HWnd; - if ( windowId ) - hwnd = (HWND)windowId; - - HDC dc = GetDC(hwnd); - - if ( dc ) - { - RECT rect; - GetClientRect(hwnd, &rect); - const void* memory = (const void *)image->lock(); - - BITMAPV4HEADER bi; - memset (&bi, 0, sizeof(bi)); - bi.bV4Size = sizeof(BITMAPINFOHEADER); - bi.bV4BitCount = image->getBitsPerPixel(); - bi.bV4Planes = 1; - bi.bV4Width = image->getDimension().Width; - bi.bV4Height = 0 - image->getDimension().Height; - bi.bV4V4Compression = BI_BITFIELDS; - bi.bV4AlphaMask = image->getAlphaMask (); - bi.bV4RedMask = image->getRedMask (); - bi.bV4GreenMask = image->getGreenMask(); - bi.bV4BlueMask = image->getBlueMask(); - - int r = 0; - if ( src ) - { - r = StretchDIBits(dc, 0,0, rect.right, rect.bottom, - src->UpperLeftCorner.X, src->UpperLeftCorner.Y, - src->getWidth(), src->getHeight(), - memory, (const BITMAPINFO*)(&bi), DIB_RGB_COLORS, SRCCOPY); - } - else - { - r = StretchDIBits(dc, 0,0, rect.right, rect.bottom, - 0, 0, image->getDimension().Width, image->getDimension().Height, - memory, (const BITMAPINFO*)(&bi), DIB_RGB_COLORS, SRCCOPY); - } - - image->unlock(); - - ReleaseDC(hwnd, dc); - } - return true; -} - - -//! notifies the device that it should close itself -void CIrrDeviceWinCE::closeDevice() -{ - MSG msg; - PeekMessage(&msg, NULL, WM_QUIT, WM_QUIT, PM_REMOVE); - PostQuitMessage(0); - PeekMessage(&msg, NULL, WM_QUIT, WM_QUIT, PM_REMOVE); - if (!ExternalWindow) - { - DestroyWindow(HWnd); - const fschar_t* ClassName = __TEXT("CIrrDeviceWin32"); - HINSTANCE hInstance = GetModuleHandle(0); - UnregisterClass(ClassName, hInstance); - } - Close=true; -} - - -//! returns if window is active. if not, nothing need to be drawn -bool CIrrDeviceWinCE::isWindowActive() const -{ - bool ret = (GetActiveWindow() == HWnd); - _IRR_IMPLEMENT_MANAGED_MARSHALLING_BUGFIX; - return ret; -} - - -//! returns if window has focus -bool CIrrDeviceWinCE::isWindowFocused() const -{ - bool ret = (GetFocus() == HWnd); - _IRR_IMPLEMENT_MANAGED_MARSHALLING_BUGFIX; - return ret; -} - - -//! returns if window is minimized -bool CIrrDeviceWinCE::isWindowMinimized() const -{ -#if 0 - WINDOWPLACEMENT plc; - plc.length=sizeof(WINDOWPLACEMENT); - bool ret=false; - if (GetWindowPlacement(HWnd,&plc)) - ret=(plc.showCmd & SW_SHOWMINIMIZED); - _IRR_IMPLEMENT_MANAGED_MARSHALLING_BUGFIX; - return ret; -#endif - return false; -} - - -//! switches to fullscreen -bool CIrrDeviceWinCE::switchToFullScreen() -{ - ChangedToFullScreen = SHFullScreen(HWnd, SHFS_HIDESIPBUTTON | SHFS_HIDETASKBAR) != 0; - return ChangedToFullScreen; -} - - -//! returns the win32 cursor control -CIrrDeviceWinCE::CCursorControl* CIrrDeviceWinCE::getWin32CursorControl() -{ - return Win32CursorControl; -} - - -//! Return pointer to a list with all video modes supported by the gfx adapter. -/** \return Pointer to video modes list */ -video::IVideoModeList* CIrrDeviceWinCE::getVideoModeList() -{ - if (!VideoModeList->getVideoModeCount()) - { - // enumerate video modes. - DWORD i=0; - DEVMODE mode; - memset(&mode, 0, sizeof(mode)); - mode.dmSize = sizeof(mode); - - while (EnumDisplaySettings(NULL, i, &mode)) - { - VideoModeList->addMode(core::dimension2d(mode.dmPelsWidth, mode.dmPelsHeight), - mode.dmBitsPerPel); - - ++i; - } - - if (EnumDisplaySettings(NULL, ENUM_CURRENT_SETTINGS, &mode)) - VideoModeList->setDesktop(mode.dmBitsPerPel, core::dimension2d(mode.dmPelsWidth, mode.dmPelsHeight)); - } - - return VideoModeList; -} - - -void CIrrDeviceWinCE::getWindowsVersion(core::stringc& out) -{ - out = "WinCE"; -} - - -//! Notifies the device, that it has been resized -void CIrrDeviceWinCE::OnResized() -{ - Resized = true; -} - - -//! Sets if the window should be resizable in windowed mode. -void CIrrDeviceWinCE::setResizable(bool resize) -{ - if (ExternalWindow || !getVideoDriver() || CreationParams.Fullscreen) - return; - - LONG style = WS_POPUP; - - if (!resize) - style = WS_SYSMENU | WS_BORDER | WS_CAPTION | WS_CLIPCHILDREN | WS_CLIPSIBLINGS; - else - style = WS_THICKFRAME | WS_SYSMENU | WS_CAPTION | WS_CLIPCHILDREN | WS_CLIPSIBLINGS | WS_MAXIMIZEBOX; - - if (!SetWindowLong(HWnd, GWL_STYLE, style)) - os::Printer::log("Could not change window style."); - - RECT clientSize; - clientSize.top = 0; - clientSize.left = 0; - clientSize.right = getVideoDriver()->getScreenSize().Width; - clientSize.bottom = getVideoDriver()->getScreenSize().Height; - - AdjustWindowRectEx(&clientSize, style, FALSE, 0); - - const s32 realWidth = clientSize.right - clientSize.left; - const s32 realHeight = clientSize.bottom - clientSize.top; - - const s32 windowLeft = (GetSystemMetrics(SM_CXSCREEN) - realWidth) / 2; - const s32 windowTop = (GetSystemMetrics(SM_CYSCREEN) - realHeight) / 2; - - SetWindowPos(HWnd, HWND_TOP, windowLeft, windowTop, realWidth, realHeight, - SWP_FRAMECHANGED | SWP_NOMOVE | SWP_SHOWWINDOW); -} - - -//! Minimizes the window. -void CIrrDeviceWinCE::minimizeWindow() -{ - // do nothing -} - -//! Maximize window -void CIrrDeviceWinCE::maximizeWindow() -{ - // do nothing -} - - -//! Restore original window size -void CIrrDeviceWinCE::restoreWindow() -{ - // do nothing -} - - -} // end namespace - -#endif // _IRR_COMPILE_WITH_WINDOWS_CE_DEVICE_ - diff --git a/source/Irrlicht/CIrrDeviceWinCE.h b/source/Irrlicht/CIrrDeviceWinCE.h deleted file mode 100644 index 27d7db35..00000000 --- a/source/Irrlicht/CIrrDeviceWinCE.h +++ /dev/null @@ -1,302 +0,0 @@ -// Copyright (C) 2002-2012 Nikolaus Gebhardt -// This file is part of the "Irrlicht Engine". -// For conditions of distribution and use, see copyright notice in irrlicht.h - -#ifndef __C_IRR_DEVICE_WINCE_H_INCLUDED__ -#define __C_IRR_DEVICE_WINCE_H_INCLUDED__ - -#include "IrrCompileConfig.h" -#ifdef _IRR_COMPILE_WITH_WINDOWS_CE_DEVICE_ - -#include "CIrrDeviceStub.h" -#include "IrrlichtDevice.h" -#include "IImagePresenter.h" - -#include -#include -#include -#include -#include -#include - -namespace irr -{ - class CIrrDeviceWinCE : public CIrrDeviceStub, video::IImagePresenter - { - public: - - //! constructor - CIrrDeviceWinCE( const SIrrlichtCreationParameters& params); - - //! destructor - virtual ~CIrrDeviceWinCE(); - - //! runs the device. Returns false if device wants to be deleted - virtual bool run() _IRR_OVERRIDE_; - - //! Cause the device to temporarily pause execution and let other processes to run - // This should bring down processor usage without major performance loss for Irrlicht - virtual void yield() _IRR_OVERRIDE_; - - //! Pause execution and let other processes to run for a specified amount of time. - virtual void sleep(u32 timeMs, bool pauseTimer) _IRR_OVERRIDE_; - - //! sets the caption of the window - virtual void setWindowCaption(const wchar_t* text) _IRR_OVERRIDE_; - - //! returns if window is active. if not, nothing need to be drawn - virtual bool isWindowActive() const _IRR_OVERRIDE_; - - //! returns if window has focus - virtual bool isWindowFocused() const _IRR_OVERRIDE_; - - //! returns if window is minimized - virtual bool isWindowMinimized() const _IRR_OVERRIDE_; - - //! returns current window position (not supported for this device) - virtual core::position2di getWindowPosition() _IRR_OVERRIDE_ - { - return core::position2di(-1, -1); - } - - //! presents a surface in the client area - virtual bool present(video::IImage* surface, void* windowId = 0, core::rect* src=0 ) _IRR_OVERRIDE_; - - //! notifies the device that it should close itself - virtual void closeDevice() _IRR_OVERRIDE_; - - //! \return Returns a pointer to a list with all video modes - //! supported by the gfx adapter. - virtual video::IVideoModeList* getVideoModeList() _IRR_OVERRIDE_; - - //! Notifies the device, that it has been resized - void OnResized(); - - //! Sets if the window should be resizable in windowed mode. - virtual void setResizable(bool resize=false) _IRR_OVERRIDE_; - - //! Minimizes the window. - virtual void minimizeWindow() _IRR_OVERRIDE_; - - //! Maximizes the window. - virtual void maximizeWindow() _IRR_OVERRIDE_; - - //! Restores the window size. - virtual void restoreWindow() _IRR_OVERRIDE_; - - //! Get the device type - virtual E_DEVICE_TYPE getType() const _IRR_OVERRIDE_ - { - return EIDT_WINCE; - } - - //! Implementation of the win32 cursor control - class CCursorControl : public gui::ICursorControl - { - public: - - CCursorControl(const core::dimension2d& wsize, HWND hwnd, bool fullscreen) - : WindowSize(wsize), InvWindowSize(0.0f, 0.0f), - HWnd(hwnd), BorderX(0), BorderY(0), - UseReferenceRect(false), IsVisible(true) - { - if (WindowSize.Width!=0) - InvWindowSize.Width = 1.0f / WindowSize.Width; - - if (WindowSize.Height!=0) - InvWindowSize.Height = 1.0f / WindowSize.Height; - - if (!fullscreen) - { - BorderX = GetSystemMetrics(SM_CXDLGFRAME); - BorderY = GetSystemMetrics(SM_CYCAPTION) + GetSystemMetrics(SM_CYDLGFRAME); - } - } - - //! Changes the visible state of the mouse cursor. - virtual void setVisible(bool visible) _IRR_OVERRIDE_ - { - IsVisible = visible; - } - - //! Returns if the cursor is currently visible. - virtual bool isVisible() const _IRR_OVERRIDE_ - { - _IRR_IMPLEMENT_MANAGED_MARSHALLING_BUGFIX; - return IsVisible; - } - - //! Sets the new position of the cursor. - virtual void setPosition(const core::position2d &pos) _IRR_OVERRIDE_ - { - setPosition(pos.X, pos.Y); - } - - //! Sets the new position of the cursor. - virtual void setPosition(f32 x, f32 y) _IRR_OVERRIDE_ - { - if (!UseReferenceRect) - setPosition(core::round32(x*WindowSize.Width), core::round32(y*WindowSize.Height)); - else - setPosition(core::round32(x*ReferenceRect.getWidth()), core::round32(y*ReferenceRect.getHeight())); - } - - //! Sets the new position of the cursor. - virtual void setPosition(const core::position2d &pos) _IRR_OVERRIDE_ - { - setPosition(pos.X, pos.Y); - } - - //! Sets the new position of the cursor. - virtual void setPosition(s32 x, s32 y) _IRR_OVERRIDE_ - { - RECT rect; - - if (UseReferenceRect) - { - SetCursorPos(ReferenceRect.UpperLeftCorner.X + x, - ReferenceRect.UpperLeftCorner.Y + y); - } - else - { - if (GetWindowRect(HWnd, &rect)) - SetCursorPos(x + rect.left + BorderX, y + rect.top + BorderY); - } - - CursorPos.X = x; - CursorPos.Y = y; - } - - //! Returns the current position of the mouse cursor. - virtual const core::position2d& getPosition() _IRR_OVERRIDE_ - { - updateInternalCursorPosition(); - return CursorPos; - } - - //! Returns the current position of the mouse cursor. - virtual core::position2d getRelativePosition() _IRR_OVERRIDE_ - { - updateInternalCursorPosition(); - - if (!UseReferenceRect) - { - return core::position2d(CursorPos.X * InvWindowSize.Width, - CursorPos.Y * InvWindowSize.Height); - } - - return core::position2d(CursorPos.X / (f32)ReferenceRect.getWidth(), - CursorPos.Y / (f32)ReferenceRect.getHeight()); - } - - //! Sets an absolute reference rect for calculating the cursor position. - virtual void setReferenceRect(core::rect* rect=0) _IRR_OVERRIDE_ - { - if (rect) - { - ReferenceRect = *rect; - UseReferenceRect = true; - - // prevent division through zero and uneven sizes - - if (!ReferenceRect.getHeight() || ReferenceRect.getHeight()%2) - ReferenceRect.LowerRightCorner.Y += 1; - - if (!ReferenceRect.getWidth() || ReferenceRect.getWidth()%2) - ReferenceRect.LowerRightCorner.X += 1; - } - else - UseReferenceRect = false; - } - - /** Used to notify the cursor that the window was resized. */ - void OnResize(const core::dimension2d& size) - { - WindowSize = size; - if (size.Width!=0) - InvWindowSize.Width = 1.0f / size.Width; - else - InvWindowSize.Width = 0.f; - - if (size.Height!=0) - InvWindowSize.Height = 1.0f / size.Height; - else - InvWindowSize.Height = 0.f; - } - - private: - - //! Updates the internal cursor position - void updateInternalCursorPosition() - { - POINT p; - if (!GetCursorPos(&p)) - { - DWORD xy = GetMessagePos(); - p.x = GET_X_LPARAM(xy); - p.y = GET_Y_LPARAM(xy); - } - - if (UseReferenceRect) - { - CursorPos.X = p.x - ReferenceRect.UpperLeftCorner.X; - CursorPos.Y = p.y - ReferenceRect.UpperLeftCorner.Y; - } - else - { - RECT rect; - if (GetWindowRect(HWnd, &rect)) - { - CursorPos.X = p.x-rect.left-BorderX; - CursorPos.Y = p.y-rect.top-BorderY; - } - else - { - // window seems not to be existent, so set cursor to - // a negative value - CursorPos.X = -1; - CursorPos.Y = -1; - } - } - } - - core::position2d CursorPos; - core::dimension2d WindowSize; - core::dimension2d InvWindowSize; - HWND HWnd; - - s32 BorderX, BorderY; - core::rect ReferenceRect; - bool UseReferenceRect; - bool IsVisible; - }; - - - //! returns the win32 cursor control - CCursorControl* getWin32CursorControl(); - - private: - - //! create the driver - void createDriver(); - - //! switchs to fullscreen - bool switchToFullScreen(); - - void getWindowsVersion(core::stringc& version); - - void resizeIfNecessary(); - - HWND HWnd; - CCursorControl* Win32CursorControl; - - bool ChangedToFullScreen; - bool Resized; - bool ExternalWindow; - }; - - -} // end namespace irr - -#endif // _IRR_COMPILE_WITH_WINDOWS_CE_DEVICE_ -#endif // __C_IRR_DEVICE_WINCE_H_INCLUDED__ diff --git a/source/Irrlicht/CLightSceneNode.cpp b/source/Irrlicht/CLightSceneNode.cpp index 55b63373..7728ba82 100644 --- a/source/Irrlicht/CLightSceneNode.cpp +++ b/source/Irrlicht/CLightSceneNode.cpp @@ -34,7 +34,7 @@ CLightSceneNode::CLightSceneNode(ISceneNode* parent, ISceneManager* mgr, s32 id, //! pre render event void CLightSceneNode::OnRegisterSceneNode() { - doLightRecalc(); + doLightRecalc(); // TODO: since doLightRecalc has now been added to updateAbsolutePosition it might be possible to remove this one. if (IsVisible) SceneManager->registerNodeForRendering(this, ESNRP_LIGHT); @@ -201,6 +201,12 @@ void CLightSceneNode::doLightRecalc() } } +void CLightSceneNode::updateAbsolutePosition() +{ + ILightSceneNode::updateAbsolutePosition(); + doLightRecalc(); +} + //! Writes attributes of the scene node. void CLightSceneNode::serializeAttributes(io::IAttributes* out, io::SAttributeReadWriteOptions* options) const diff --git a/source/Irrlicht/CLightSceneNode.h b/source/Irrlicht/CLightSceneNode.h index f3752cee..a3c96c88 100644 --- a/source/Irrlicht/CLightSceneNode.h +++ b/source/Irrlicht/CLightSceneNode.h @@ -88,6 +88,10 @@ public: //! Check whether this light casts shadows. /** \return True if light would cast shadows, else false. */ virtual bool getCastShadow() const _IRR_OVERRIDE_; + + //! Updates the absolute position based on the relative and the parents position + virtual void updateAbsolutePosition() _IRR_OVERRIDE_; + private: video::SLight LightData; diff --git a/source/Irrlicht/CMD2MeshFileLoader.cpp b/source/Irrlicht/CMD2MeshFileLoader.cpp index 4fa26d52..f32e4e3a 100644 --- a/source/Irrlicht/CMD2MeshFileLoader.cpp +++ b/source/Irrlicht/CMD2MeshFileLoader.cpp @@ -161,8 +161,7 @@ bool CMD2MeshFileLoader::loadFile(io::IReadFile* file, CAnimatedMeshMD2* mesh) mesh->FrameTransforms.set_used(header.numFrames); // create vertex arrays for each keyframe - if (mesh->FrameList) - delete [] mesh->FrameList; + delete [] mesh->FrameList; mesh->FrameList = new core::array[header.numFrames]; // allocate space in vertex arrays diff --git a/source/Irrlicht/CMY3DMeshFileLoader.h b/source/Irrlicht/CMY3DMeshFileLoader.h index 387e2be9..0c29802e 100644 --- a/source/Irrlicht/CMY3DMeshFileLoader.h +++ b/source/Irrlicht/CMY3DMeshFileLoader.h @@ -24,9 +24,7 @@ #ifdef _MSC_VER -#if _MSC_VER > 1000 #pragma once -#endif // _MSC_VER > 1000 #endif diff --git a/source/Irrlicht/CMemoryFile.cpp b/source/Irrlicht/CMemoryFile.cpp index be2794f7..256f7841 100644 --- a/source/Irrlicht/CMemoryFile.cpp +++ b/source/Irrlicht/CMemoryFile.cpp @@ -163,6 +163,10 @@ const io::path& CMemoryWriteFile::getFileName() const return Filename; } +bool CMemoryWriteFile::flush() +{ + return true; // no buffering, so nothing to do +} IReadFile* createMemoryReadFile(const void* memory, long size, const io::path& fileName, bool deleteMemoryWhenDropped) { diff --git a/source/Irrlicht/CMemoryFile.h b/source/Irrlicht/CMemoryFile.h index 028e3e15..6da8894f 100644 --- a/source/Irrlicht/CMemoryFile.h +++ b/source/Irrlicht/CMemoryFile.h @@ -77,6 +77,8 @@ namespace io //! returns name of file virtual const io::path& getFileName() const _IRR_OVERRIDE_; + virtual bool flush() _IRR_OVERRIDE_; + private: void *Buffer; diff --git a/source/Irrlicht/CNullDriver.cpp b/source/Irrlicht/CNullDriver.cpp index d1aaa788..9fa1153c 100644 --- a/source/Irrlicht/CNullDriver.cpp +++ b/source/Irrlicht/CNullDriver.cpp @@ -15,6 +15,7 @@ #include "CMeshManipulator.h" #include "CColorConverter.h" #include "IAttributeExchangingObject.h" +#include "IRenderTarget.h" namespace irr @@ -85,9 +86,9 @@ IImageWriter* createImageWriterPPM(); //! constructor CNullDriver::CNullDriver(io::IFileSystem* io, const core::dimension2d& screenSize) -: FileSystem(io), MeshManipulator(0), ViewPort(0,0,0,0), ScreenSize(screenSize), - PrimitivesDrawn(0), MinVertexCountForVBO(500), TextureCreationFlags(0), - OverrideMaterial2DEnabled(false), AllowZWriteOnTransparent(false) + : SharedRenderTarget(0), CurrentRenderTarget(0), CurrentRenderTargetSize(0, 0), FileSystem(io), MeshManipulator(0), + ViewPort(0, 0, 0, 0), ScreenSize(screenSize), PrimitivesDrawn(0), MinVertexCountForVBO(500), + TextureCreationFlags(0), OverrideMaterial2DEnabled(false), AllowZWriteOnTransparent(false) { #ifdef _DEBUG setDebugName("CNullDriver"); @@ -217,6 +218,9 @@ CNullDriver::~CNullDriver() if (MeshManipulator) MeshManipulator->drop(); + + removeAllRenderTargets(); + deleteAllTextures(); u32 i; @@ -295,25 +299,28 @@ void CNullDriver::deleteAllTextures() // last set material member. Could be optimized to reduce state changes. setMaterial(SMaterial()); + // reset render targets. + + for (u32 i=0; isetTexture(0, 0); + + // remove textures. + for (u32 i=0; idrop(); Textures.clear(); + + SharedDepthTextures.clear(); } - - -//! applications must call this method before performing any rendering. returns false if failed. -bool CNullDriver::beginScene(bool backBuffer, bool zBuffer, SColor color, - const SExposedVideoData& videoData, core::rect* sourceRect) +bool CNullDriver::beginScene(u16 clearFlag, SColor clearColor, f32 clearDepth, u8 clearStencil, const SExposedVideoData& videoData, core::rect* sourceRect) { core::clearFPUException(); PrimitivesDrawn = 0; return true; } - -//! applications must call this method after performing any rendering. returns false if failed. bool CNullDriver::endScene() { FPSCounter.registerFrame(os::Timer::getRealTime(), PrimitivesDrawn); @@ -573,40 +580,13 @@ video::ITexture* CNullDriver::findTexture(const io::path& filename) } -//! creates a Texture -ITexture* CNullDriver::addTexture(const core::dimension2d& size, - const io::path& name, ECOLOR_FORMAT format) -{ - if(IImage::isRenderTargetOnlyFormat(format)) - { - os::Printer::log("Could not create ITexture, format only supported for render target textures.", ELL_WARNING); - return 0; - } - - if ( 0 == name.size () ) - return 0; - - IImage* image = new CImage(format, size); - ITexture* t = createDeviceDependentTexture(image, name); - image->drop(); - - if (t) - { - addTexture(t); - t->drop(); - } - - return t; -} - - //! Creates a texture from a loaded IImage. -ITexture* CNullDriver::addTexture(const io::path& name, IImage* image, void* mipmapData) +ITexture* CNullDriver::addTexture(const io::path& name, IImage* image) { if ( 0 == name.size() || !image) return 0; - ITexture* t = createDeviceDependentTexture(image, name, mipmapData); + ITexture* t = createDeviceDependentTexture(image, name); if (t) { addTexture(t); @@ -632,9 +612,35 @@ ITexture* CNullDriver::addTextureCube(const io::path& name, IImage* posXImage, I return t; } + +//! creates a Texture +ITexture* CNullDriver::addTexture(const core::dimension2d& size, + const io::path& name, ECOLOR_FORMAT format) +{ + if(IImage::isRenderTargetOnlyFormat(format)) + { + os::Printer::log("Could not create ITexture, format only supported for render target textures.", ELL_WARNING); + return 0; + } + + if ( 0 == name.size () ) + return 0; + + IImage* image = new CImage(format, size); + ITexture* t = createDeviceDependentTexture(image, name); + image->drop(); + addTexture(t); + + if (t) + t->drop(); + + return t; +} + + //! returns a device dependent texture from a software surface (IImage) //! THIS METHOD HAS TO BE OVERRIDDEN BY DERIVED DRIVERS WITH OWN TEXTURES -ITexture* CNullDriver::createDeviceDependentTexture(IImage* surface, const io::path& name, void* mipmapData) +ITexture* CNullDriver::createDeviceDependentTexture(IImage* surface, const io::path& name) { return new SDummyTexture(name); } @@ -648,33 +654,49 @@ ITexture* CNullDriver::createDeviceDependentTextureCube(const io::path& name, II return new SDummyTexture(name); } -//! set or reset special render targets -bool CNullDriver::setRenderTarget(video::E_RENDER_TARGET target, bool clearTarget, - bool clearZBuffer, SColor color) +bool CNullDriver::setRenderTarget(IRenderTarget* target, u16 clearFlag, SColor clearColor, f32 clearDepth, u8 clearStencil) { - if (ERT_FRAME_BUFFER==target) - return setRenderTarget(0,clearTarget, clearZBuffer, color); + return false; +} + +bool CNullDriver::setRenderTarget(ITexture* texture, u16 clearFlag, SColor clearColor, f32 clearDepth, u8 clearStencil) +{ + if (texture) + { + // create render target if require. + if (!SharedRenderTarget) + SharedRenderTarget = addRenderTarget(); + + ITexture* depthTexture = 0; + + // try to find available depth texture with require size. + for (u32 i = 0; i < SharedDepthTextures.size(); ++i) + { + if (SharedDepthTextures[i]->getSize() == texture->getSize()) + { + depthTexture = SharedDepthTextures[i]; + + break; + } + } + + // create depth texture if require. + if (!depthTexture) + { + depthTexture = addRenderTargetTexture(texture->getSize(), "IRR_DEPTH_STENCIL", video::ECF_D24S8); + SharedDepthTextures.push_back(depthTexture); + } + + SharedRenderTarget->setTexture(texture, depthTexture); + + return setRenderTarget(SharedRenderTarget, clearFlag, clearColor, clearDepth, clearStencil); + } else - return false; + { + return setRenderTarget((IRenderTarget*)0, clearFlag, clearColor, clearDepth, clearStencil); + } } - -//! sets a render target -bool CNullDriver::setRenderTarget(video::ITexture* texture, bool clearBackBuffer, - bool clearZBuffer, SColor color) -{ - return false; -} - - -//! Sets multiple render targets -bool CNullDriver::setRenderTarget(const core::array& texture, - bool clearBackBuffer, bool clearZBuffer, SColor color) -{ - return false; -} - - //! sets a viewport void CNullDriver::setViewPort(const core::rect& area) { @@ -914,6 +936,13 @@ const core::dimension2d& CNullDriver::getScreenSize() const } +//! get current render target +IRenderTarget* CNullDriver::getCurrentRenderTarget() const +{ + return CurrentRenderTarget; +} + + //! returns the current render target size, //! or the screen size if render targets are not implemented const core::dimension2d& CNullDriver::getCurrentRenderTargetSize() const @@ -1027,7 +1056,11 @@ const SLight& CNullDriver::getDynamicLight(u32 idx) const if ( idx < Lights.size() ) return Lights[idx]; else - return *((SLight*)0); + { + _IRR_DEBUG_BREAK_IF(true) + static const SLight dummy; + return dummy; + } } @@ -1315,6 +1348,87 @@ bool CNullDriver::checkPrimitiveCount(u32 prmCount) const return true; } +bool CNullDriver::checkColorFormat(ECOLOR_FORMAT format, const core::dimension2d& size) const +{ + bool status = true; + + switch (format) + { + case ECF_DXT1: + case ECF_DXT2: + case ECF_DXT3: + case ECF_DXT4: + case ECF_DXT5: + { + core::dimension2d sizePOT = size.getOptimalSize(true, false); + + if (!queryFeature(EVDF_TEXTURE_COMPRESSED_DXT)) + { + os::Printer::log("DXT texture compression not available.", ELL_ERROR); + status = false; + } + else if (sizePOT != size) + { + os::Printer::log("Invalid size of image for DXT texture, size of image must be power of two.", ELL_ERROR); + status = false; + } + } + break; + case ECF_PVRTC_RGB2: + case ECF_PVRTC_ARGB2: + case ECF_PVRTC_RGB4: + case ECF_PVRTC_ARGB4: + { + core::dimension2d sizePOT = size.getOptimalSize(true, true); + + if(!queryFeature(EVDF_TEXTURE_COMPRESSED_PVRTC)) + { + os::Printer::log("PVRTC texture compression not available.", ELL_ERROR); + status = false; + } + else if (sizePOT != size) + { + os::Printer::log("Invalid size of image for PVRTC compressed texture, size of image must be POT and squared.", ELL_ERROR); + status = false; + } + } + break; + case ECF_PVRTC2_ARGB2: + case ECF_PVRTC2_ARGB4: + { + if(!queryFeature(EVDF_TEXTURE_COMPRESSED_PVRTC2)) + { + os::Printer::log("PVRTC2 texture compression not available.", ELL_ERROR); + status = false; + } + } + break; + case ECF_ETC1: + { + if(!queryFeature(EVDF_TEXTURE_COMPRESSED_ETC1)) + { + os::Printer::log("ETC1 texture compression not available.", ELL_ERROR); + status = false; + } + } + break; + case ECF_ETC2_RGB: + case ECF_ETC2_ARGB: + { + if(!queryFeature(EVDF_TEXTURE_COMPRESSED_ETC2)) + { + os::Printer::log("ETC2 texture compression not available.", ELL_ERROR); + status = false; + } + } + break; + default: + break; + } + + return status; +} + //! Enables or disables a texture creation flag. void CNullDriver::setTextureCreationFlag(E_TEXTURE_CREATION_FLAG flag, bool enabled) { @@ -1437,9 +1551,8 @@ bool CNullDriver::writeImageToFile(IImage* image, io::IWriteFile * file, u32 par //! Creates a software image from a byte array. IImage* CNullDriver::createImageFromData(ECOLOR_FORMAT format, - const core::dimension2d& size, - void *data, bool ownForeignMemory, - bool deleteMemory) + const core::dimension2d& size, void *data, bool ownForeignMemory, + bool deleteMemory) { if(IImage::isRenderTargetOnlyFormat(format)) { @@ -1495,7 +1608,7 @@ IImage* CNullDriver::createImage(ITexture* texture, const core::position2d& { if ((pos==core::position2di(0,0)) && (size == texture->getSize())) { - IImage* image = new CImage(texture->getColorFormat(), size, texture->lock(ETLM_READ_ONLY), false); + IImage* image = new CImage(texture->getColorFormat(), size, texture->lock(ETLM_READ_ONLY), false, false); texture->unlock(); return image; } @@ -1799,6 +1912,44 @@ u32 CNullDriver::getOcclusionQueryResult(scene::ISceneNode* node) const } +//! Create render target. +IRenderTarget* CNullDriver::addRenderTarget() +{ + return 0; +} + + +//! Remove render target. +void CNullDriver::removeRenderTarget(IRenderTarget* renderTarget) +{ + if (!renderTarget) + return; + + for (u32 i = 0; i < RenderTargets.size(); ++i) + { + if (RenderTargets[i] == renderTarget) + { + RenderTargets[i]->drop(); + RenderTargets.erase(i); + + return; + } + } +} + + +//! Remove all render targets. +void CNullDriver::removeAllRenderTargets() +{ + for (u32 i = 0; i < RenderTargets.size(); ++i) + RenderTargets[i]->drop(); + + RenderTargets.clear(); + + SharedRenderTarget = 0; +} + + //! Only used by the internal engine. Used to notify the driver that //! the window was resized. void CNullDriver::OnResize(const core::dimension2d& size) @@ -2369,9 +2520,7 @@ ITexture* CNullDriver::addRenderTargetTexture(const core::dimension2d& size return 0; } - -//! Clears the ZBuffer. -void CNullDriver::clearZBuffer() +void CNullDriver::clearBuffers(u16 flag, SColor color, f32 depth, u8 stencil) { } @@ -2399,89 +2548,6 @@ void CNullDriver::printVersion() } -// Check support for compression texture format. -bool CNullDriver::checkColorFormat(ECOLOR_FORMAT format, const core::dimension2d& textureSize) const -{ - bool status = true; - - switch (format) - { - case ECF_DXT1: - case ECF_DXT2: - case ECF_DXT3: - case ECF_DXT4: - case ECF_DXT5: - { - core::dimension2d potSize = textureSize.getOptimalSize(true, false); - - if(!queryFeature(EVDF_TEXTURE_COMPRESSED_DXT)) - { - os::Printer::log("DXT texture compression not available.", ELL_ERROR); - status = false; - } - else if(potSize != textureSize) - { - os::Printer::log("Invalid size of image for DXT compressed texture, size of image must be POT.", ELL_ERROR); - status = false; - } - } - break; - case ECF_PVRTC_RGB2: - case ECF_PVRTC_ARGB2: - case ECF_PVRTC_RGB4: - case ECF_PVRTC_ARGB4: - { - core::dimension2d potSize = textureSize.getOptimalSize(true, true); - - if(!queryFeature(EVDF_TEXTURE_COMPRESSED_PVRTC)) - { - os::Printer::log("PVRTC texture compression not available.", ELL_ERROR); - status = false; - } - else if(potSize != textureSize) - { - os::Printer::log("Invalid size of image for PVRTC compressed texture, size of image must be POT and squared.", ELL_ERROR); - status = false; - } - } - break; - case ECF_PVRTC2_ARGB2: - case ECF_PVRTC2_ARGB4: - { - if(!queryFeature(EVDF_TEXTURE_COMPRESSED_PVRTC2)) - { - os::Printer::log("PVRTC2 texture compression not available.", ELL_ERROR); - status = false; - } - } - break; - case ECF_ETC1: - { - if(!queryFeature(EVDF_TEXTURE_COMPRESSED_ETC1)) - { - os::Printer::log("ETC1 texture compression not available.", ELL_ERROR); - status = false; - } - } - break; - case ECF_ETC2_RGB: - case ECF_ETC2_ARGB: - { - if(!queryFeature(EVDF_TEXTURE_COMPRESSED_ETC2)) - { - os::Printer::log("ETC2 texture compression not available.", ELL_ERROR); - status = false; - } - } - break; - default: - break; - } - - return status; -} - - // Check support for compression texture format. bool CNullDriver::checkTextureCube(IImage* posXImage, IImage* negXImage, IImage* posYImage, IImage* negYImage, IImage* posZImage, IImage* negZImage) const diff --git a/source/Irrlicht/CNullDriver.h b/source/Irrlicht/CNullDriver.h index b845236f..9b2ddcd4 100644 --- a/source/Irrlicht/CNullDriver.h +++ b/source/Irrlicht/CNullDriver.h @@ -48,10 +48,8 @@ namespace video //! destructor virtual ~CNullDriver(); - virtual bool beginScene(bool backBuffer=true, bool zBuffer=true, - SColor color=SColor(255,0,0,0), - const SExposedVideoData& videoData=SExposedVideoData(), - core::rect* sourceRect=0) _IRR_OVERRIDE_; + virtual bool beginScene(u16 clearFlag, SColor clearColor = SColor(255,0,0,0), f32 clearDepth = 1.f, u8 clearStencil = 0, + const SExposedVideoData& videoData = SExposedVideoData(), core::rect* sourceRect = 0) _IRR_OVERRIDE_; virtual bool endScene() _IRR_OVERRIDE_; @@ -100,24 +98,11 @@ namespace video //! creates a Texture virtual ITexture* addTexture(const core::dimension2d& size, const io::path& name, ECOLOR_FORMAT format = ECF_A8R8G8B8) _IRR_OVERRIDE_; - //! Creates a texture from a loaded IImage. - virtual ITexture* addTexture(const io::path& name, IImage* image, void* mipmapData=0) _IRR_OVERRIDE_; + virtual bool setRenderTarget(IRenderTarget* target, u16 clearFlag, SColor clearColor = SColor(255,0,0,0), + f32 clearDepth = 1.f, u8 clearStencil = 0) _IRR_OVERRIDE_; - //! Creates a cube texture from loaded IImages. - virtual ITexture* addTextureCube(const io::path& name, IImage* posXImage, IImage* negXImage, - IImage* posYImage, IImage* negYImage, IImage* posZImage, IImage* negZImage); - - //! sets a render target - virtual bool setRenderTarget(video::ITexture* texture, bool clearBackBuffer, - bool clearZBuffer, SColor color) _IRR_OVERRIDE_; - - //! set or reset special render targets - virtual bool setRenderTarget(video::E_RENDER_TARGET target, bool clearTarget, - bool clearZBuffer, SColor color) _IRR_OVERRIDE_; - - //! Sets multiple render targets - virtual bool setRenderTarget(const core::array& texture, - bool clearBackBuffer=true, bool clearZBuffer=true, SColor color=SColor(0,0,0,0)) _IRR_OVERRIDE_; + virtual bool setRenderTarget(ITexture* texture, u16 clearFlag, SColor clearColor = SColor(255,0,0,0), + f32 clearDepth = 1.f, u8 clearStencil = 0) _IRR_OVERRIDE_; //! sets a viewport virtual void setViewPort(const core::rect& area) _IRR_OVERRIDE_; @@ -249,6 +234,9 @@ namespace video //! get screen size virtual const core::dimension2d& getScreenSize() const _IRR_OVERRIDE_; + //! get current render target + IRenderTarget* getCurrentRenderTarget() const; + //! get render target size virtual const core::dimension2d& getCurrentRenderTargetSize() const _IRR_OVERRIDE_; @@ -363,8 +351,8 @@ namespace video directly and own it from now on, which means it will also try to delete [] the data when the image will be destructed. If false, the memory will by copied. */ virtual IImage* createImageFromData(ECOLOR_FORMAT format, - const core::dimension2d& size, void *data, - bool ownForeignMemory=true, bool deleteForeignMemory = true) _IRR_OVERRIDE_; + const core::dimension2d& size, void *data, bool ownForeignMemory = false, + bool deleteMemory = true) _IRR_OVERRIDE_; //! Creates an empty software image. virtual IImage* createImage(ECOLOR_FORMAT format, const core::dimension2d& size) _IRR_OVERRIDE_; @@ -481,6 +469,15 @@ namespace video actual value of pixels. */ virtual u32 getOcclusionQueryResult(scene::ISceneNode* node) const _IRR_OVERRIDE_; + //! Create render target. + virtual IRenderTarget* addRenderTarget() _IRR_OVERRIDE_; + + //! Remove render target. + virtual void removeRenderTarget(IRenderTarget* renderTarget) _IRR_OVERRIDE_; + + //! Remove all render targets. + virtual void removeAllRenderTargets() _IRR_OVERRIDE_; + //! Only used by the engine internally. /** Used to notify the driver that the window was resized. */ virtual void OnResize(const core::dimension2d& size) _IRR_OVERRIDE_; @@ -594,8 +591,7 @@ namespace video //! Returns a pointer to the mesh manipulator. virtual scene::IMeshManipulator* getMeshManipulator() _IRR_OVERRIDE_; - //! Clears the ZBuffer. - virtual void clearZBuffer() _IRR_OVERRIDE_; + virtual void clearBuffers(u16 flag, SColor color = SColor(255,0,0,0), f32 depth = 1.f, u8 stencil = 0) _IRR_OVERRIDE_; //! Returns an image created from the last rendered frame. virtual IImage* createScreenShot(video::ECOLOR_FORMAT format=video::ECF_UNKNOWN, video::E_RENDER_TARGET target=video::ERT_FRAME_BUFFER) _IRR_OVERRIDE_; @@ -686,10 +682,17 @@ namespace video //! adds a surface, not loaded or created by the Irrlicht Engine void addTexture(ITexture* surface); + + //! Creates a texture from a loaded IImage. + virtual ITexture* addTexture(const io::path& name, IImage* image) _IRR_OVERRIDE_; + + //! Creates a cube texture from loaded IImages. + virtual ITexture* addTextureCube(const io::path& name, IImage* posXImage, IImage* negXImage, + IImage* posYImage, IImage* negYImage, IImage* posZImage, IImage* negZImage); //! returns a device dependent texture from a software surface (IImage) //! THIS METHOD HAS TO BE OVERRIDDEN BY DERIVED DRIVERS WITH OWN TEXTURES - virtual ITexture* createDeviceDependentTexture(IImage* surface, const io::path& name, void* mipmapData=0); + virtual video::ITexture* createDeviceDependentTexture(IImage* surface, const io::path& name); //! returns a device dependent texture from a software surface (IImage) //! THIS METHOD HAS TO BE OVERRIDDEN BY DERIVED DRIVERS WITH OWN TEXTURES @@ -699,6 +702,8 @@ namespace video //! checks triangle count and print warning if wrong bool checkPrimitiveCount(u32 prmcnt) const; + bool checkColorFormat(ECOLOR_FORMAT format, const core::dimension2d& size) const; + // adds a material renderer and drops it afterwards. To be used for internal creation s32 addAndDropMaterialRenderer(IMaterialRenderer* m); @@ -708,9 +713,6 @@ namespace video // prints renderer version void printVersion(); - // Check support for compression texture format. - bool checkColorFormat(ECOLOR_FORMAT format, const core::dimension2d& textureSize) const; - // Check support for compression texture format. bool checkTextureCube(IImage* posXImage, IImage* negXImage, IImage* posYImage, IImage* negYImage, IImage* posZImage, IImage* negZImage) const; @@ -732,6 +734,26 @@ namespace video return (f32) getAverage ( p[(y * pitch) + x] ); } + inline bool getWriteZBuffer(const SMaterial&material) const + { + if (material.ZWriteEnable) + { + if (!AllowZWriteOnTransparent) + { + switch (material.ZWriteFineControl) + { + case EZI_ONLY_NON_TRANSPARENT: + return !material.isTransparent(); + case EZI_ZBUFFER_FLAG: + return true; + } + } + else + return true; + } + return false; + } + struct SSurface { video::ITexture* Surface; @@ -750,17 +772,11 @@ namespace video struct SDummyTexture : public ITexture { - SDummyTexture(const io::path& name) : ITexture(name), size(0,0) {}; + SDummyTexture(const io::path& name) : ITexture(name) {}; virtual void* lock(E_TEXTURE_LOCK_MODE mode=ETLM_READ_WRITE, u32 mipmapLevel=0) _IRR_OVERRIDE_ { return 0; } virtual void unlock()_IRR_OVERRIDE_ {} - virtual const core::dimension2d& getOriginalSize() const _IRR_OVERRIDE_ { return size; } - virtual const core::dimension2d& getSize() const _IRR_OVERRIDE_ { return size; } - virtual E_DRIVER_TYPE getDriverType() const _IRR_OVERRIDE_ { return video::EDT_NULL; } - virtual ECOLOR_FORMAT getColorFormat() const _IRR_OVERRIDE_ { return video::ECF_A1R5G5B5; } - virtual u32 getPitch() const _IRR_OVERRIDE_ { return 0; } virtual void regenerateMipMapLevels(void* mipmapData=0) _IRR_OVERRIDE_ {} - core::dimension2d size; }; core::array Textures; @@ -821,6 +837,15 @@ namespace video }; core::array OcclusionQueries; + core::array RenderTargets; + + // Shared objects used with simplified IVideoDriver::setRenderTarget method with ITexture* param. + IRenderTarget* SharedRenderTarget; + core::array SharedDepthTextures; + + IRenderTarget* CurrentRenderTarget; + core::dimension2d CurrentRenderTargetSize; + core::array SurfaceLoader; core::array SurfaceWriter; core::array Lights; diff --git a/source/Irrlicht/COBJMeshFileLoader.cpp b/source/Irrlicht/COBJMeshFileLoader.cpp index e35f0671..22ab12e0 100644 --- a/source/Irrlicht/COBJMeshFileLoader.cpp +++ b/source/Irrlicht/COBJMeshFileLoader.cpp @@ -225,18 +225,25 @@ IAnimatedMesh* COBJMeshFileLoader::createMesh(io::IReadFile* file) // sends the buffer sizes and gets the actual indices // if index not set returns -1 s32 Idx[3]; - Idx[1] = Idx[2] = -1; + Idx[0] = Idx[1] = Idx[2] = -1; // read in next vertex's data u32 wlength = copyWord(vertexWord, linePtr, WORD_BUFFER_LENGTH, endPtr); // this function will also convert obj's 1-based index to c++'s 0-based index retrieveVertexIndices(vertexWord, Idx, vertexWord+wlength+1, vertexBuffer.size(), textureCoordBuffer.size(), normalsBuffer.size()); - v.Pos = vertexBuffer[Idx[0]]; - if ( -1 != Idx[1] ) + if ( -1 != Idx[0] && Idx[0] < (irr::s32)vertexBuffer.size() ) + v.Pos = vertexBuffer[Idx[0]]; + else + { + os::Printer::log("Invalid vertex index in this line:", wordBuffer.c_str(), ELL_ERROR); + delete [] buf; + return 0; + } + if ( -1 != Idx[1] && Idx[1] < (irr::s32)textureCoordBuffer.size() ) v.TCoords = textureCoordBuffer[Idx[1]]; else v.TCoords.set(0.0f,0.0f); - if ( -1 != Idx[2] ) + if ( -1 != Idx[2] && Idx[2] < (irr::s32)normalsBuffer.size() ) v.Normal = normalsBuffer[Idx[2]]; else { @@ -346,6 +353,8 @@ const c8* COBJMeshFileLoader::readTextures(const c8* bufPtr, const c8* const buf f32 bumpiness = 6.0f; bool clamp = false; + core::vector3df tscale(1.f); //For map_Kd texture scaling + core::vector3df tpos(0.f); //For map_Kd texture translation // handle options while (textureNameBuf[0]=='-') { @@ -384,25 +393,35 @@ const c8* COBJMeshFileLoader::readTextures(const c8* bufPtr, const c8* const buf if (!strncmp(bufPtr,"-o",2)) // texture coord translation { bufPtr = goAndCopyNextWord(textureNameBuf, bufPtr, WORD_BUFFER_LENGTH, bufEnd); + if (core::isdigit(textureNameBuf[0]) || (textureNameBuf[0] == '-' && core::isdigit(textureNameBuf[1]))) + tpos.X = core::fast_atof(textureNameBuf); + // next parameters are optional, so skip rest of loop if no number is found bufPtr = goAndCopyNextWord(textureNameBuf, bufPtr, WORD_BUFFER_LENGTH, bufEnd); - if (!core::isdigit(textureNameBuf[0])) + if (!(core::isdigit(textureNameBuf[0]) || (textureNameBuf[0] == '-' && core::isdigit(textureNameBuf[1])))) continue; + tpos.Y = core::fast_atof(textureNameBuf); bufPtr = goAndCopyNextWord(textureNameBuf, bufPtr, WORD_BUFFER_LENGTH, bufEnd); - if (!core::isdigit(textureNameBuf[0])) + if (!(core::isdigit(textureNameBuf[0]) || (textureNameBuf[0] == '-' && core::isdigit(textureNameBuf[1])))) continue; + tpos.Z = core::fast_atof(textureNameBuf); } else if (!strncmp(bufPtr,"-s",2)) // texture coord scale { bufPtr = goAndCopyNextWord(textureNameBuf, bufPtr, WORD_BUFFER_LENGTH, bufEnd); + if (core::isdigit(textureNameBuf[0]) || (textureNameBuf[0] == '-' && core::isdigit(textureNameBuf[1]))) + tscale.X = core::fast_atof(textureNameBuf); + // next parameters are optional, so skip rest of loop if no number is found bufPtr = goAndCopyNextWord(textureNameBuf, bufPtr, WORD_BUFFER_LENGTH, bufEnd); - if (!core::isdigit(textureNameBuf[0])) + if (!(core::isdigit(textureNameBuf[0]) || (textureNameBuf[0] == '-' && core::isdigit(textureNameBuf[1])))) continue; + tscale.Y = core::fast_atof(textureNameBuf); bufPtr = goAndCopyNextWord(textureNameBuf, bufPtr, WORD_BUFFER_LENGTH, bufEnd); - if (!core::isdigit(textureNameBuf[0])) + if (!(core::isdigit(textureNameBuf[0]) || (textureNameBuf[0] == '-' && core::isdigit(textureNameBuf[1])))) continue; + tscale.Z = core::fast_atof(textureNameBuf); } else if (!strncmp(bufPtr,"-t",2)) @@ -410,10 +429,10 @@ const c8* COBJMeshFileLoader::readTextures(const c8* bufPtr, const c8* const buf bufPtr = goAndCopyNextWord(textureNameBuf, bufPtr, WORD_BUFFER_LENGTH, bufEnd); // next parameters are optional, so skip rest of loop if no number is found bufPtr = goAndCopyNextWord(textureNameBuf, bufPtr, WORD_BUFFER_LENGTH, bufEnd); - if (!core::isdigit(textureNameBuf[0])) + if (!(core::isdigit(textureNameBuf[0]) || (textureNameBuf[0] == '-' && core::isdigit(textureNameBuf[1])))) continue; bufPtr = goAndCopyNextWord(textureNameBuf, bufPtr, WORD_BUFFER_LENGTH, bufEnd); - if (!core::isdigit(textureNameBuf[0])) + if (!(core::isdigit(textureNameBuf[0]) || (textureNameBuf[0] == '-' && core::isdigit(textureNameBuf[1])))) continue; } // get next word @@ -435,7 +454,15 @@ const c8* COBJMeshFileLoader::readTextures(const c8* bufPtr, const c8* const buf if ( texture ) { if (type==0) + { currMaterial->Meshbuffer->Material.setTexture(0, texture); + bool needsTextureMatrix = tscale != core::vector3df(1.f) || tpos != core::vector3df(0.f); + if (needsTextureMatrix) + { + currMaterial->Meshbuffer->Material.getTextureMatrix(0).setTextureScale(tscale.X, tscale.Y); + currMaterial->Meshbuffer->Material.getTextureMatrix(0).setTextureTranslate(tpos.X, tpos.Y); + } + } else if (type==1) { if ( texture->getSource() == video::ETS_FROM_FILE) @@ -451,8 +478,8 @@ const c8* COBJMeshFileLoader::readTextures(const c8* bufPtr, const c8* const buf } else if (type==3) { - // currMaterial->Meshbuffer->Material.Textures[1] = texture; - // currMaterial->Meshbuffer->Material.MaterialType=video::EMT_REFLECTION_2_LAYER; + // currMaterial->Meshbuffer->Material.Textures[1] = texture; + // currMaterial->Meshbuffer->Material.MaterialType=video::EMT_REFLECTION_2_LAYER; } // Set diffuse material color to white so as not to affect texture color // Because Maya set diffuse color Kd to black when you use a diffuse color map diff --git a/source/Irrlicht/COBJMeshWriter.cpp b/source/Irrlicht/COBJMeshWriter.cpp index f2bc1e10..c784caf1 100644 --- a/source/Irrlicht/COBJMeshWriter.cpp +++ b/source/Irrlicht/COBJMeshWriter.cpp @@ -193,6 +193,39 @@ bool COBJMeshWriter::writeMesh(io::IWriteFile* file, scene::IMesh* mesh, s32 fla if (mat[i]->getTexture(0)) { file->write("map_Kd ", 7); + + f32 tposX, tposY, tscaleX, tscaleY; + const core::matrix4& textureMatrix = mat[i]->getTextureMatrix(0); + textureMatrix.getTextureTranslate(tposX, tposY); + textureMatrix.getTextureScale(tscaleX, tscaleY); + + //Write texture translation values + if ( !core::equals(tposX, 0.f) || !core::equals(tposY, 0.f) ) + { + file->write("-o ", 3); + core::stringc tx(tposX); + core::stringc ty(tposY); + + file->write(tx.c_str(), tx.size()); + file->write(" ", 1); + file->write(ty.c_str(), ty.size()); + file->write(" ", 1); + } + + //Write texture scaling values + if ( !core::equals(tscaleX, 1.f) || !core::equals(tscaleY, 1.f) ) + { + file->write("-s ", 3); + + core::stringc sx(tscaleX); + core::stringc sy(tscaleY); + + file->write(sx.c_str(), sx.size()); + file->write(" ", 1); + file->write(sy.c_str(), sy.size()); + file->write(" ", 1); + } + io::path tname = FileSystem->getRelativeFilename(mat[i]->getTexture(0)->getName(), FileSystem->getFileDir(file->getFileName())); // avoid blanks as .obj cannot handle strings with spaces diff --git a/source/Irrlicht/COGLCoreCacheHandler.h b/source/Irrlicht/COGLCoreCacheHandler.h new file mode 100644 index 00000000..483e47b2 --- /dev/null +++ b/source/Irrlicht/COGLCoreCacheHandler.h @@ -0,0 +1,567 @@ +// Copyright (C) 2015 Patryk Nadrowski +// This file is part of the "Irrlicht Engine". +// For conditions of distribution and use, see copyright notice in irrlicht.h + +#ifndef __C_OGLCORE_CACHE_HANDLER_H_INCLUDED__ +#define __C_OGLCORE_CACHE_HANDLER_H_INCLUDED__ + +#include "IrrCompileConfig.h" + +#if defined(_IRR_COMPILE_WITH_OPENGL_) || defined(_IRR_COMPILE_WITH_OGLES1_) || defined(_IRR_COMPILE_WITH_OGLES2_) + +#include "SMaterial.h" +#include "ITexture.h" + +namespace irr +{ +namespace video +{ + +template +class COGLCoreCacheHandler +{ + class STextureCache + { + public: + STextureCache(COGLCoreCacheHandler* cacheHandler, u32 textureCount) : + CacheHandler(cacheHandler), DriverType(cacheHandler->getDriverType()), TextureCount(textureCount) + { + for (u32 i = 0; i < MATERIAL_MAX_TEXTURES; ++i) + { + Texture[i] = 0; + } + } + + ~STextureCache() + { + clear(); + } + + const TOGLTexture* operator[](int index) const + { + if (static_cast(index) < MATERIAL_MAX_TEXTURES) + return Texture[static_cast(index)]; + + return 0; + } + + const TOGLTexture* get(u32 index) const + { + if (index < MATERIAL_MAX_TEXTURES) + return Texture[index]; + + return 0; + } + + bool set(u32 index, const ITexture* texture) + { + bool status = false; + + E_DRIVER_TYPE type = DriverType; + + if (index < MATERIAL_MAX_TEXTURES && index < TextureCount) + { + CacheHandler->setActiveTexture(GL_TEXTURE0 + index); + + const TOGLTexture* prevTexture = Texture[index]; + + if (texture != prevTexture) + { + if (texture) + { + type = texture->getDriverType(); + + if (type == DriverType) + { + texture->grab(); + +#if defined(IRR_OPENGL_VERSION) && IRR_OPENGL_VERSION < 20 + if (!prevTexture) + glEnable(GL_TEXTURE_2D); +#endif + + glBindTexture(GL_TEXTURE_2D, static_cast(texture)->getOpenGLTextureName()); + } + else + { + texture = 0; + + os::Printer::log("Fatal Error: Tried to set a texture not owned by this driver.", ELL_ERROR); + } + } + + if (!texture) + { + glBindTexture(GL_TEXTURE_2D, 0); + +#if defined(IRR_OPENGL_VERSION) && IRR_OPENGL_VERSION < 20 + if (prevTexture) + glDisable(GL_TEXTURE_2D); +#endif + } + + Texture[index] = static_cast(texture); + + if (prevTexture) + prevTexture->drop(); + } + + status = true; + } + + return (status && type == DriverType); + } + + void remove(ITexture* texture) + { + if (!texture) + return; + + for (u32 i = 0; i < MATERIAL_MAX_TEXTURES; ++i) + { + if (Texture[i] == texture) + { + Texture[i] = 0; + + texture->drop(); + } + } + } + + void clear() + { + for (u32 i = 0; i < MATERIAL_MAX_TEXTURES; ++i) + { + if (Texture[i]) + { + const TOGLTexture* prevTexture = Texture[i]; + + Texture[i] = 0; + + prevTexture->drop(); + } + } + } + + private: + COGLCoreCacheHandler* CacheHandler; + + E_DRIVER_TYPE DriverType; + + const TOGLTexture* Texture[MATERIAL_MAX_TEXTURES]; + u32 TextureCount; + }; + +public: + COGLCoreCacheHandler(TOGLDriver* driver) : + Driver(driver), TextureCache(STextureCache(this, Driver->getFeature().TextureUnit)), FrameBufferCount(0), + BlendEquation(0), BlendSourceRGB(0), BlendDestinationRGB(0), BlendSourceAlpha(0), BlendDestinationAlpha(0), + Blend(0), ColorMask(0), CullFaceMode(GL_BACK), CullFace(false), DepthFunc(GL_LESS), DepthMask(true), + DepthTest(false), FrameBufferID(0), ProgramID(0), ActiveTexture(GL_TEXTURE0), ViewportX(0), ViewportY(0) + { + const COGLCoreFeature& feature = Driver->getFeature(); + + FrameBufferCount = core::max_(static_cast(1), static_cast(feature.MultipleRenderTarget)); + + BlendEquation = new GLenum[FrameBufferCount]; + BlendSourceRGB = new GLenum[FrameBufferCount]; + BlendDestinationRGB = new GLenum[FrameBufferCount]; + BlendSourceAlpha = new GLenum[FrameBufferCount]; + BlendDestinationAlpha = new GLenum[FrameBufferCount]; + Blend = new bool[FrameBufferCount]; + + ColorMask = new bool[FrameBufferCount][4]; + + // Initial OpenGL values from specification. + + if (feature.BlendOperation) + { + Driver->irrGlBlendEquation(GL_FUNC_ADD); + } + + for (u32 i = 0; i < FrameBufferCount; ++i) + { + BlendEquation[i] = GL_FUNC_ADD; + + BlendSourceRGB[i] = GL_ONE; + BlendDestinationRGB[i] = GL_ZERO; + BlendSourceAlpha[i] = GL_ONE; + BlendDestinationAlpha[i] = GL_ZERO; + + Blend[i] = false; + + for (u32 j = 0; j < 4; ++j) + ColorMask[i][j] = true; + } + + glBlendFunc(GL_ONE, GL_ZERO); + glDisable(GL_BLEND); + + glColorMask(GL_TRUE, GL_TRUE, GL_TRUE, GL_TRUE); + + glCullFace(CullFaceMode); + glDisable(GL_CULL_FACE); + + glDepthFunc(DepthFunc); + glDepthMask(GL_TRUE); + glDisable(GL_DEPTH_TEST); + + Driver->irrGlActiveTexture(ActiveTexture); + +#if defined(IRR_OPENGL_VERSION) && IRR_OPENGL_VERSION < 20 + glDisable(GL_TEXTURE_2D); +#endif + + const core::dimension2d ScreenSize = Driver->getScreenSize(); + ViewportWidth = ScreenSize.Width; + ViewportHeight = ScreenSize.Height; + glViewport(ViewportX, ViewportY, ViewportWidth, ViewportHeight); + } + + virtual ~COGLCoreCacheHandler() + { + delete[] BlendEquation; + delete[] BlendSourceRGB; + delete[] BlendDestinationRGB; + delete[] BlendSourceAlpha; + delete[] BlendDestinationAlpha; + delete[] Blend; + + delete[] ColorMask; + } + + E_DRIVER_TYPE getDriverType() const + { + return Driver->getDriverType(); + } + + STextureCache& getTextureCache() + { + return TextureCache; + } + + // Blending calls. + + void setBlendEquation(GLenum mode) + { + if (BlendEquation[0] != mode) + { + Driver->irrGlBlendEquation(mode); + + for (GLuint i = 0; i < FrameBufferCount; ++i) + BlendEquation[i] = mode; + } + } + + void setBlendEquationIndexed(GLuint index, GLenum mode) + { + if (index < FrameBufferCount && BlendEquation[index] != mode) + { + Driver->irrGlBlendEquationIndexed(index, mode); + + BlendEquation[index] = mode; + } + } + + void setBlendFunc(GLenum source, GLenum destination) + { + if (BlendSourceRGB[0] != source || BlendDestinationRGB[0] != destination || + BlendSourceAlpha[0] != source || BlendDestinationAlpha[0] != destination) + { + glBlendFunc(source, destination); + + for (GLuint i = 0; i < FrameBufferCount; ++i) + { + BlendSourceRGB[i] = source; + BlendDestinationRGB[i] = destination; + BlendSourceAlpha[i] = source; + BlendDestinationAlpha[i] = destination; + } + } + } + + void setBlendFuncSeparate(GLenum sourceRGB, GLenum destinationRGB, GLenum sourceAlpha, GLenum destinationAlpha) + { + if (sourceRGB != sourceAlpha || destinationRGB != destinationAlpha) + { + if (BlendSourceRGB[0] != sourceRGB || BlendDestinationRGB[0] != destinationRGB || + BlendSourceAlpha[0] != sourceAlpha || BlendDestinationAlpha[0] != destinationAlpha) + { + Driver->irrGlBlendFuncSeparate(sourceRGB, destinationRGB, sourceAlpha, destinationAlpha); + + for (GLuint i = 0; i < FrameBufferCount; ++i) + { + BlendSourceRGB[i] = sourceRGB; + BlendDestinationRGB[i] = destinationRGB; + BlendSourceAlpha[i] = sourceAlpha; + BlendDestinationAlpha[i] = destinationAlpha; + } + } + } + else + { + setBlendFunc(sourceRGB, destinationRGB); + } + } + + void setBlendFuncIndexed(GLuint index, GLenum source, GLenum destination) + { + if (index < FrameBufferCount && (BlendSourceRGB[index] != source || BlendDestinationRGB[index] != destination || + BlendSourceAlpha[index] != source || BlendDestinationAlpha[index] != destination)) + { + Driver->irrGlBlendFuncIndexed(index, source, destination); + + BlendSourceRGB[index] = source; + BlendDestinationRGB[index] = destination; + BlendSourceAlpha[index] = source; + BlendDestinationAlpha[index] = destination; + } + } + + void setBlendFuncSeparateIndexed(GLuint index, GLenum sourceRGB, GLenum destinationRGB, GLenum sourceAlpha, GLenum destinationAlpha) + { + if (sourceRGB != sourceAlpha || destinationRGB != destinationAlpha) + { + if (index < FrameBufferCount && (BlendSourceRGB[index] != sourceRGB || BlendDestinationRGB[index] != destinationRGB || + BlendSourceAlpha[index] != sourceAlpha || BlendDestinationAlpha[index] != destinationAlpha)) + { + Driver->irrGlBlendFuncSeparateIndexed(index, sourceRGB, destinationRGB, sourceAlpha, destinationAlpha); + + BlendSourceRGB[index] = sourceRGB; + BlendDestinationRGB[index] = destinationRGB; + BlendSourceAlpha[index] = sourceAlpha; + BlendDestinationAlpha[index] = destinationAlpha; + } + } + else + { + setBlendFuncIndexed(index, sourceRGB, destinationRGB); + } + } + + void setBlend(bool enable) + { + if (Blend[0] != enable) + { + if (enable) + glEnable(GL_BLEND); + else + glDisable(GL_BLEND); + + for (GLuint i = 0; i < FrameBufferCount; ++i) + Blend[i] = enable; + } + } + + void setBlendIndexed(GLuint index, bool enable) + { + if (index < FrameBufferCount && Blend[index] != enable) + { + if (enable) + Driver->irrGlEnableIndexed(GL_BLEND, index); + else + Driver->irrGlDisableIndexed(GL_BLEND, index); + + Blend[index] = enable; + } + } + + // Color Mask. + + void setColorMask(bool red, bool green, bool blue, bool alpha) + { + if (ColorMask[0][0] != red || ColorMask[0][1] != green || ColorMask[0][2] != blue || ColorMask[0][3] != alpha) + { + glColorMask(red, green, blue, alpha); + + for (GLuint i = 0; i < FrameBufferCount; ++i) + { + ColorMask[i][0] = red; + ColorMask[i][1] = green; + ColorMask[i][2] = blue; + ColorMask[i][3] = alpha; + } + } + } + + void setColorMaskIndexed(GLuint index, bool red, bool green, bool blue, bool alpha) + { + if (index < FrameBufferCount && (ColorMask[index][0] != red || ColorMask[index][1] != green || ColorMask[index][2] != blue || ColorMask[index][3] != alpha)) + { + Driver->irrGlColorMaskIndexed(index, red, green, blue, alpha); + + ColorMask[index][0] = red; + ColorMask[index][1] = green; + ColorMask[index][2] = blue; + ColorMask[index][3] = alpha; + } + } + + // Cull face calls. + + void setCullFaceFunc(GLenum mode) + { + if (CullFaceMode != mode) + { + glCullFace(mode); + CullFaceMode = mode; + } + } + + void setCullFace(bool enable) + { + if (CullFace != enable) + { + if (enable) + glEnable(GL_CULL_FACE); + else + glDisable(GL_CULL_FACE); + CullFace = enable; + } + } + + // Depth calls. + + void setDepthFunc(GLenum mode) + { + if (DepthFunc != mode) + { + glDepthFunc(mode); + DepthFunc = mode; + } + } + + void setDepthMask(bool enable) + { + if (DepthMask != enable) + { + if (enable) + glDepthMask(GL_TRUE); + else + glDepthMask(GL_FALSE); + DepthMask = enable; + } + } + + void setDepthTest(bool enable) + { + if (DepthTest != enable) + { + if (enable) + glEnable(GL_DEPTH_TEST); + else + glDisable(GL_DEPTH_TEST); + DepthTest = enable; + } + } + + // FBO calls. + + void getFBO(GLuint& frameBufferID) const + { + frameBufferID = FrameBufferID; + } + + void setFBO(GLuint frameBufferID) + { + if (FrameBufferID != frameBufferID) + { + Driver->irrGlBindFramebuffer(GL_FRAMEBUFFER, frameBufferID); + FrameBufferID = frameBufferID; + } + } + + // Shaders calls. + + void getProgram(GLuint& programID) const + { + programID = ProgramID; + } + + void setProgram(GLuint programID) + { + if (ProgramID != programID) + { + Driver->irrGlUseProgram(programID); + ProgramID = programID; + } + } + + // Texture calls. + + void getActiveTexture(GLenum& texture) const + { + texture = ActiveTexture; + } + + void setActiveTexture(GLenum texture) + { + if (ActiveTexture != texture) + { + Driver->irrGlActiveTexture(texture); + ActiveTexture = texture; + } + } + + // Viewport calls. + + void getViewport(GLint& viewportX, GLint& viewportY, GLsizei& viewportWidth, GLsizei& viewportHeight) const + { + viewportX = ViewportX; + viewportY = ViewportY; + viewportWidth = ViewportWidth; + viewportHeight = ViewportHeight; + } + + void setViewport(GLint viewportX, GLint viewportY, GLsizei viewportWidth, GLsizei viewportHeight) + { + if (ViewportX != viewportX || ViewportY != viewportY || ViewportWidth != viewportWidth || ViewportHeight != viewportHeight) + { + glViewport(viewportX, viewportY, viewportWidth, viewportHeight); + ViewportX = viewportX; + ViewportY = viewportY; + ViewportWidth = viewportWidth; + ViewportHeight = viewportHeight; + } + } + +protected: + TOGLDriver* Driver; + + STextureCache TextureCache; + + GLuint FrameBufferCount; + + GLenum* BlendEquation; + GLenum* BlendSourceRGB; + GLenum* BlendDestinationRGB; + GLenum* BlendSourceAlpha; + GLenum* BlendDestinationAlpha; + bool* Blend; + + bool(*ColorMask)[4]; + + GLenum CullFaceMode; + bool CullFace; + + GLenum DepthFunc; + bool DepthMask; + bool DepthTest; + + GLuint FrameBufferID; + + GLuint ProgramID; + + GLenum ActiveTexture; + + GLint ViewportX; + GLint ViewportY; + GLsizei ViewportWidth; + GLsizei ViewportHeight; +}; + +} +} + +#endif +#endif diff --git a/source/Irrlicht/COGLCoreFeature.h b/source/Irrlicht/COGLCoreFeature.h new file mode 100644 index 00000000..48415b30 --- /dev/null +++ b/source/Irrlicht/COGLCoreFeature.h @@ -0,0 +1,41 @@ +// Copyright (C) 2015 Patryk Nadrowski +// This file is part of the "Irrlicht Engine". +// For conditions of distribution and use, see copyright notice in irrlicht.h + +#ifndef __C_OGLCORE_FEATURE_H_INCLUDED__ +#define __C_OGLCORE_FEATURE_H_INCLUDED__ + +#include "IrrCompileConfig.h" + +#if defined(_IRR_COMPILE_WITH_OPENGL_) || defined(_IRR_COMPILE_WITH_OGLES1_) || defined(_IRR_COMPILE_WITH_OGLES2_) + +#include "irrTypes.h" + +namespace irr +{ +namespace video +{ + +class COGLCoreFeature +{ +public: + COGLCoreFeature() : BlendOperation(false), ColorAttachment(0), MultipleRenderTarget(0), TextureUnit(1) + { + } + + virtual ~COGLCoreFeature() + { + } + + bool BlendOperation; + + u8 ColorAttachment; + u8 MultipleRenderTarget; + u8 TextureUnit; +}; + +} +} + +#endif +#endif diff --git a/source/Irrlicht/COGLCoreRenderTarget.h b/source/Irrlicht/COGLCoreRenderTarget.h new file mode 100644 index 00000000..2d214d50 --- /dev/null +++ b/source/Irrlicht/COGLCoreRenderTarget.h @@ -0,0 +1,340 @@ +// Copyright (C) 2015 Patryk Nadrowski +// This file is part of the "Irrlicht Engine". +// For conditions of distribution and use, see copyright notice in irrlicht.h + +#ifndef __C_OGLCORE_RENDER_TARGET_H_INCLUDED__ +#define __C_OGLCORE_RENDER_TARGET_H_INCLUDED__ + +#include "IrrCompileConfig.h" + +#if defined(_IRR_COMPILE_WITH_OPENGL_) || defined(_IRR_COMPILE_WITH_OGLES1_) || defined(_IRR_COMPILE_WITH_OGLES2_) + +#include "IRenderTarget.h" + +namespace irr +{ +namespace video +{ + +template +class COGLCoreRenderTarget : public IRenderTarget +{ +public: + COGLCoreRenderTarget(TOGLDriver* driver) : AssignedDepth(false), AssignedStencil(false), RequestTextureUpdate(false), RequestDepthStencilUpdate(false), + BufferID(0), ColorAttachment(0), MultipleRenderTarget(0), Driver(driver) + { +#ifdef _DEBUG + setDebugName("COGLCoreRenderTarget"); +#endif + + DriverType = Driver->getDriverType(); + + Size = Driver->getScreenSize(); + + ColorAttachment = Driver->getFeature().ColorAttachment; + MultipleRenderTarget = Driver->getFeature().MultipleRenderTarget; + + if (ColorAttachment > 0) + Driver->irrGlGenFramebuffers(1, &BufferID); + + AssignedTexture.set_used(static_cast(ColorAttachment)); + + for (u32 i = 0; i < AssignedTexture.size(); ++i) + AssignedTexture[i] = GL_NONE; + } + + virtual ~COGLCoreRenderTarget() + { + if (ColorAttachment > 0 && BufferID != 0) + Driver->irrGlDeleteFramebuffers(1, &BufferID); + + for (u32 i = 0; i < Texture.size(); ++i) + { + if (Texture[i]) + Texture[i]->drop(); + } + + if (DepthStencil) + DepthStencil->drop(); + } + + virtual void setTexture(const core::array& texture, ITexture* depthStencil) _IRR_OVERRIDE_ + { + bool textureUpdate = (Texture != texture) ? true : false; + bool depthStencilUpdate = (DepthStencil != depthStencil) ? true : false; + + if (textureUpdate || depthStencilUpdate) + { + // Set color attachments. + + if (textureUpdate) + { + for (u32 i = 0; i < Texture.size(); ++i) + { + if (Texture[i]) + Texture[i]->drop(); + } + + if (texture.size() > static_cast(ColorAttachment)) + { + core::stringc message = "This GPU supports up to "; + message += static_cast(ColorAttachment); + message += " textures per render target."; + + os::Printer::log(message.c_str(), ELL_WARNING); + } + + Texture.set_used(core::min_(texture.size(), static_cast(ColorAttachment))); + + for (u32 i = 0; i < Texture.size(); ++i) + { + GLuint textureID = (texture[i] && texture[i]->getDriverType() == DriverType) ? static_cast(texture[i])->getOpenGLTextureName() : 0; + + if (textureID != 0) + { + Texture[i] = texture[i]; + Texture[i]->grab(); + } + else + { + Texture[i] = 0; + } + } + + RequestTextureUpdate = true; + } + + // Set depth and stencil attachments. + + if (depthStencilUpdate) + { + GLuint textureID = (depthStencil && depthStencil->getDriverType() == DriverType) ? static_cast(depthStencil)->getOpenGLTextureName() : 0; + const ECOLOR_FORMAT textureFormat = (textureID != 0) ? depthStencil->getColorFormat() : ECF_UNKNOWN; + + if (IImage::isDepthFormat(textureFormat)) + { + DepthStencil = depthStencil; + DepthStencil->grab(); + } + else + { + if (DepthStencil) + DepthStencil->drop(); + + DepthStencil = 0; + } + + RequestDepthStencilUpdate = true; + } + + // Set size required for a viewport. + + ITexture* firstTexture = getTexture(); + + if (firstTexture) + Size = firstTexture->getSize(); + else + { + if (DepthStencil) + Size = DepthStencil->getSize(); + else + Size = Driver->getScreenSize(); + } + } + } + + void update() + { + if (RequestTextureUpdate || RequestDepthStencilUpdate) + { + // Set color attachments. + + if (RequestTextureUpdate) + { + // Set new color textures. + + const u32 textureSize = core::min_(Texture.size(), AssignedTexture.size()); + + for (u32 i = 0; i < textureSize; ++i) + { + GLuint textureID = (Texture[i]) ? static_cast(Texture[i])->getOpenGLTextureName() : 0; + + if (textureID != 0) + { + AssignedTexture[i] = GL_COLOR_ATTACHMENT0 + i; + Driver->irrGlFramebufferTexture2D(GL_FRAMEBUFFER, AssignedTexture[i], GL_TEXTURE_2D, textureID, 0); + } + else if (AssignedTexture[i] != GL_NONE) + { + AssignedTexture[i] = GL_NONE; + Driver->irrGlFramebufferTexture2D(GL_FRAMEBUFFER, AssignedTexture[i], GL_TEXTURE_2D, 0, 0); + + os::Printer::log("Error: Could not set render target.", ELL_ERROR); + } + } + + // Reset other render target channels. + + for (u32 i = textureSize; i < AssignedTexture.size(); ++i) + { + if (AssignedTexture[i] != GL_NONE) + { + Driver->irrGlFramebufferTexture2D(GL_FRAMEBUFFER, AssignedTexture[i], GL_TEXTURE_2D, 0, 0); + AssignedTexture[i] = GL_NONE; + } + } + + RequestTextureUpdate = false; + } + + // Set depth and stencil attachments. + + if (RequestDepthStencilUpdate) + { + const ECOLOR_FORMAT textureFormat = (DepthStencil) ? DepthStencil->getColorFormat() : ECF_UNKNOWN; + + if (IImage::isDepthFormat(textureFormat)) + { + GLuint textureID = static_cast(DepthStencil)->getOpenGLTextureName(); + + Driver->irrGlFramebufferTexture2D(GL_FRAMEBUFFER, GL_DEPTH_ATTACHMENT, GL_TEXTURE_2D, textureID, 0); + + if (textureFormat == ECF_D24S8) + { + Driver->irrGlFramebufferTexture2D(GL_FRAMEBUFFER, GL_STENCIL_ATTACHMENT, GL_TEXTURE_2D, textureID, 0); + + AssignedStencil = true; + } + else + { + if (AssignedStencil) + Driver->irrGlFramebufferTexture2D(GL_FRAMEBUFFER, GL_STENCIL_ATTACHMENT, GL_TEXTURE_2D, 0, 0); + + AssignedStencil = false; + } + + AssignedDepth = true; + } + else + { + if (AssignedDepth) + Driver->irrGlFramebufferTexture2D(GL_FRAMEBUFFER, GL_DEPTH_ATTACHMENT, GL_TEXTURE_2D, 0, 0); + + if (AssignedStencil) + Driver->irrGlFramebufferTexture2D(GL_FRAMEBUFFER, GL_STENCIL_ATTACHMENT, GL_TEXTURE_2D, 0, 0); + + AssignedDepth = false; + AssignedStencil = false; + } + + RequestDepthStencilUpdate = false; + } + + // Configure drawing operation. + + if (ColorAttachment > 0 && BufferID != 0) + { + const u32 textureSize = Texture.size(); + + if (textureSize == 0) + Driver->irrGlDrawBuffer(GL_NONE); + else if (textureSize == 1 || MultipleRenderTarget == 0) + Driver->irrGlDrawBuffer(GL_COLOR_ATTACHMENT0); + else + { + const u32 bufferCount = core::min_(MultipleRenderTarget, core::min_(textureSize, AssignedTexture.size())); + + Driver->irrGlDrawBuffers(bufferCount, AssignedTexture.pointer()); + } + } + +#ifdef _DEBUG + checkFBO(Driver); +#endif + } + } + + GLuint getBufferID() const + { + return BufferID; + } + + const core::dimension2d& getSize() const + { + return Size; + } + + ITexture* getTexture() const + { + for (u32 i = 0; i < Texture.size(); ++i) + { + if (Texture[i]) + return Texture[i]; + } + + return 0; + } + +protected: + bool checkFBO(TOGLDriver* driver) + { + if (ColorAttachment == 0) + return true; + + GLenum status = driver->irrGlCheckFramebufferStatus(GL_FRAMEBUFFER); + + switch (status) + { + case GL_FRAMEBUFFER_COMPLETE: + return true; + case GL_FRAMEBUFFER_INCOMPLETE_READ_BUFFER: + os::Printer::log("FBO has invalid read buffer", ELL_ERROR); + break; + case GL_FRAMEBUFFER_INCOMPLETE_DRAW_BUFFER: + os::Printer::log("FBO has invalid draw buffer", ELL_ERROR); + break; + case GL_FRAMEBUFFER_INCOMPLETE_ATTACHMENT: + os::Printer::log("FBO has one or several incomplete image attachments", ELL_ERROR); + break; + case GL_FRAMEBUFFER_INCOMPLETE_FORMATS: + os::Printer::log("FBO has one or several image attachments with different internal formats", ELL_ERROR); + break; + case GL_FRAMEBUFFER_INCOMPLETE_DIMENSIONS: + os::Printer::log("FBO has one or several image attachments with different dimensions", ELL_ERROR); + break; + case GL_FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT: + os::Printer::log("FBO missing an image attachment", ELL_ERROR); + break; + case GL_FRAMEBUFFER_UNSUPPORTED: + os::Printer::log("FBO format unsupported", ELL_ERROR); + break; + default: + os::Printer::log("FBO error", ELL_ERROR); + break; + } + + return false; + } + + core::array AssignedTexture; + bool AssignedDepth; + bool AssignedStencil; + + bool RequestTextureUpdate; + bool RequestDepthStencilUpdate; + + GLuint BufferID; + + core::dimension2d Size; + + u32 ColorAttachment; + u32 MultipleRenderTarget; + + TOGLDriver* Driver; +}; + +} +} + +#endif +#endif diff --git a/source/Irrlicht/COGLCoreTexture.h b/source/Irrlicht/COGLCoreTexture.h new file mode 100644 index 00000000..a4a3c6b5 --- /dev/null +++ b/source/Irrlicht/COGLCoreTexture.h @@ -0,0 +1,497 @@ +// Copyright (C) 2015 Patryk Nadrowski +// This file is part of the "Irrlicht Engine". +// For conditions of distribution and use, see copyright notice in irrlicht.h + +#ifndef __C_OGLCORE_TEXTURE_H_INCLUDED__ +#define __C_OGLCORE_TEXTURE_H_INCLUDED__ + +#include "IrrCompileConfig.h" + +#if defined(_IRR_COMPILE_WITH_OPENGL_) || defined(_IRR_COMPILE_WITH_OGLES1_) || defined(_IRR_COMPILE_WITH_OGLES2_) + +#include "irrArray.h" +#include "SMaterialLayer.h" +#include "ITexture.h" +#include "EDriverFeatures.h" +#include "os.h" +#include "CColorConverter.h" + +namespace irr +{ +namespace video +{ + +template +class COGLCoreTexture : public ITexture +{ +public: + struct SStatesCache + { + SStatesCache() : WrapU(ETC_REPEAT), WrapV(ETC_REPEAT), + LODBias(0), AnisotropicFilter(0), + BilinearFilter(false), TrilinearFilter(false), + MipMapStatus(false), IsCached(false) + { + } + + u8 WrapU; + u8 WrapV; + s8 LODBias; + u8 AnisotropicFilter; + bool BilinearFilter; + bool TrilinearFilter; + bool MipMapStatus; + bool IsCached; + }; + + COGLCoreTexture(const io::path& name, const core::array& image, TOGLDriver* driver) : ITexture(name), Driver(driver), TextureType(GL_TEXTURE_2D), + TextureName(0), InternalFormat(GL_RGBA), PixelFormat(GL_RGBA), PixelType(GL_UNSIGNED_BYTE), LockReadOnly(false), LockImage(0), LockLevel(0), KeepImage(false), + AutoGenerateMipMaps(false) + { + _IRR_DEBUG_BREAK_IF(image.size() == 0) + + DriverType = Driver->getDriverType(); + HasMipMaps = Driver->getTextureCreationFlag(ETCF_CREATE_MIP_MAPS); + AutoGenerateMipMaps = Driver->queryFeature(EVDF_MIP_MAP_AUTO_UPDATE); + KeepImage = Driver->getTextureCreationFlag(ETCF_ALLOW_MEMORY_COPY); + + getImageValues(image[0]); + + const core::array* tmpImage = ℑ + + if (KeepImage || OriginalSize != Size || OriginalColorFormat != ColorFormat) + { + Image.set_used(image.size()); + + for (u32 i = 0; i < image.size(); ++i) + { + Image[i] = Driver->createImage(ColorFormat, Size); + + if (image[i]->getDimension() == Size) + image[i]->copyTo(Image[i]); + else + image[i]->copyToScaling(Image[i]); + } + + tmpImage = &Image; + } + + Pitch = (*tmpImage)[0]->getPitch(); + + glGenTextures(1, &TextureName); + + const COGLCoreTexture* prevTexture = Driver->getCacheHandler()->getTextureCache().get(0); + Driver->getCacheHandler()->getTextureCache().set(0, this); + + if (HasMipMaps && AutoGenerateMipMaps) + { + if (Driver->getTextureCreationFlag(ETCF_OPTIMIZED_FOR_SPEED)) + glHint(GL_GENERATE_MIPMAP_HINT, GL_FASTEST); + else if (Driver->getTextureCreationFlag(ETCF_OPTIMIZED_FOR_QUALITY)) + glHint(GL_GENERATE_MIPMAP_HINT, GL_NICEST); + else + glHint(GL_GENERATE_MIPMAP_HINT, GL_DONT_CARE); + } + +#if defined(IRR_OPENGL_VERSION) && IRR_OPENGL_VERSION < 20 + if (HasMipMaps) + glTexParameteri(GL_TEXTURE_2D, GL_GENERATE_MIPMAP, (AutoGenerateMipMaps) ? GL_TRUE : GL_FALSE); +#endif + + uploadTexture(true, 0, (*tmpImage)[0]->getData()); + + Driver->getCacheHandler()->getTextureCache().set(0, prevTexture); + + regenerateMipMapLevels((*tmpImage)[0]->getMipMapsData()); + + if (!KeepImage) + { + for (u32 i = 0; i < Image.size(); ++i) + Image[i]->drop(); + + Image.clear(); + } + } + + COGLCoreTexture(const io::path& name, const core::dimension2d& size, ECOLOR_FORMAT format, TOGLDriver* driver) : ITexture(name), Driver(driver), TextureType(GL_TEXTURE_2D), + TextureName(0), InternalFormat(GL_RGBA), PixelFormat(GL_RGBA), PixelType(GL_UNSIGNED_BYTE), LockReadOnly(false), LockImage(0), LockLevel(0), KeepImage(false), + AutoGenerateMipMaps(false) + { + DriverType = Driver->getDriverType(); + HasMipMaps = false; + IsRenderTarget = true; + + OriginalColorFormat = format; + + if (ECF_UNKNOWN == OriginalColorFormat) + ColorFormat = getBestColorFormat(Driver->getColorFormat()); + else + ColorFormat = OriginalColorFormat; + + OriginalSize = size; + Size = OriginalSize; + + void(*converter)(const void*, s32, void*) = 0; + + Driver->getColorFormatParameters(ColorFormat, InternalFormat, PixelFormat, PixelType, &converter); + + glGenTextures(1, &TextureName); + + const COGLCoreTexture* prevTexture = Driver->getCacheHandler()->getTextureCache().get(0); + Driver->getCacheHandler()->getTextureCache().set(0, this); + + glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST); + glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST); + glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE); + glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE); + + StatesCache.WrapU = ETC_CLAMP_TO_EDGE; + StatesCache.WrapV = ETC_CLAMP_TO_EDGE; + + glTexImage2D(GL_TEXTURE_2D, 0, InternalFormat, Size.Width, Size.Height, 0, PixelFormat, PixelType, 0); + + Driver->getCacheHandler()->getTextureCache().set(0, prevTexture); + } + + virtual ~COGLCoreTexture() + { + Driver->getCacheHandler()->getTextureCache().remove(this); + + if (TextureName) + glDeleteTextures(1, &TextureName); + + if (LockImage) + LockImage->drop(); + + for (u32 i = 0; i < Image.size(); ++i) + Image[i]->drop(); + } + + virtual void* lock(E_TEXTURE_LOCK_MODE mode = ETLM_READ_WRITE, u32 mipmapLevel = 0) _IRR_OVERRIDE_ + { + // TO-DO - this method will be improved. + + if (IImage::isCompressedFormat(ColorFormat) || IsRenderTarget || mipmapLevel > 0) // TO-DO + return 0; + + LockReadOnly |= (mode == ETLM_READ_ONLY); + LockLevel = mipmapLevel; + + if (LockImage) + return LockImage->getData(); + + if (KeepImage && mipmapLevel == 0) + { + LockImage = Image[0]; + LockImage->grab(); + } + else + { + const core::dimension2d lockImageSize(Size.Width >> mipmapLevel, Size.Height >> mipmapLevel); + LockImage = Driver->createImage(ColorFormat, lockImageSize); + + if (LockImage && mode != ETLM_WRITE_ONLY) + { + COGLCoreTexture* tmpTexture = new COGLCoreTexture("OGL_CORE_LOCK_TEXTURE", lockImageSize, ColorFormat, Driver); + + GLuint tmpFBO = 0; + Driver->irrGlGenFramebuffers(1, &tmpFBO); + + GLint prevViewportX = 0; + GLint prevViewportY = 0; + GLsizei prevViewportWidth = 0; + GLsizei prevViewportHeight = 0; + Driver->getCacheHandler()->getViewport(prevViewportX, prevViewportY, prevViewportWidth, prevViewportHeight); + Driver->getCacheHandler()->setViewport(0, 0, lockImageSize.Width, lockImageSize.Height); + + GLuint prevFBO = 0; + Driver->getCacheHandler()->getFBO(prevFBO); + Driver->getCacheHandler()->setFBO(tmpFBO); + + Driver->irrGlFramebufferTexture2D(GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, GL_TEXTURE_2D, tmpTexture->getOpenGLTextureName(), 0); + + Driver->draw2DImage(this, true); + + IImage* tmpImage = Driver->createImage(ECF_A8R8G8B8, lockImageSize); + + glReadPixels(0, 0, lockImageSize.Width, lockImageSize.Height, GL_RGBA, GL_UNSIGNED_BYTE, tmpImage->getData()); + + Driver->getCacheHandler()->setFBO(prevFBO); + Driver->getCacheHandler()->setViewport(prevViewportX, prevViewportY, prevViewportWidth, prevViewportHeight); + + Driver->irrGlDeleteFramebuffers(1, &tmpFBO); + delete tmpTexture; + + void* src = tmpImage->getData(); + void* dest = LockImage->getData(); + + bool passed = true; + + switch (ColorFormat) + { + case ECF_A1R5G5B5: + CColorConverter::convert_A8R8G8B8toA1B5G5R5(src, tmpImage->getDimension().getArea(), dest); + break; + case ECF_R5G6B5: + CColorConverter::convert_A8R8G8B8toR5G6B5(src, tmpImage->getDimension().getArea(), dest); + break; + case ECF_R8G8B8: + CColorConverter::convert_A8R8G8B8toB8G8R8(src, tmpImage->getDimension().getArea(), dest); + break; + case ECF_A8R8G8B8: + CColorConverter::convert_A8R8G8B8toA8B8G8R8(src, tmpImage->getDimension().getArea(), dest); + break; + default: + passed = false; + break; + } + + tmpImage->drop(); + + if (!passed) + { + LockImage->drop(); + LockImage = 0; + } + } + } + + return (LockImage) ? LockImage->getData() : 0; + } + + virtual void unlock() _IRR_OVERRIDE_ + { + if (!LockImage) + return; + + if (!LockReadOnly) + { + const COGLCoreTexture* prevTexture = Driver->getCacheHandler()->getTextureCache().get(0); + Driver->getCacheHandler()->getTextureCache().set(0, this); + + uploadTexture(false, LockLevel, LockImage->getData()); + + Driver->getCacheHandler()->getTextureCache().set(0, prevTexture); + + if (LockLevel == 0) + regenerateMipMapLevels(LockImage->getMipMapsData()); + } + + LockImage->drop(); + + LockReadOnly = false; + LockImage = 0; + LockLevel = 0; + } + + virtual void regenerateMipMapLevels(void* mipMapsData = 0) _IRR_OVERRIDE_ + { + if (!HasMipMaps || (!mipMapsData && !AutoGenerateMipMaps) || (Size.Width <= 1 && Size.Height <= 1)) + return; + + const COGLCoreTexture* prevTexture = Driver->getCacheHandler()->getTextureCache().get(0); + Driver->getCacheHandler()->getTextureCache().set(0, this); + + if (mipMapsData) + { + u32 width = Size.Width; + u32 height = Size.Height; + u8* data = static_cast(mipMapsData); + u32 dataSize = 0; + u32 level = 0; + + do + { + if (width > 1) + width >>= 1; + + if (height > 1) + height >>= 1; + + dataSize = IImage::getDataSizeFromFormat(ColorFormat, width, height); + ++level; + + if (!IImage::isCompressedFormat(ColorFormat)) + glTexImage2D(GL_TEXTURE_2D, level, InternalFormat, width, height, 0, PixelFormat, PixelType, data); + else + Driver->irrGlCompressedTexImage2D(GL_TEXTURE_2D, level, InternalFormat, width, height, 0, dataSize, data); + + data += dataSize; + } + while (width != 1 || height != 1); + } + else + { +#if defined(IRR_OPENGL_VERSION) && IRR_OPENGL_VERSION >= 20 + Driver->irrGlGenerateMipmap(GL_TEXTURE_2D); +#endif + } + + Driver->getCacheHandler()->getTextureCache().set(0, prevTexture); + } + + GLenum getOpenGLTextureType() const + { + return TextureType; + } + + GLuint getOpenGLTextureName() const + { + return TextureName; + } + + SStatesCache& getStatesCache() const + { + return StatesCache; + } + +protected: + ECOLOR_FORMAT getBestColorFormat(ECOLOR_FORMAT format) + { + ECOLOR_FORMAT destFormat = (!IImage::isCompressedFormat(format)) ? ECF_A8R8G8B8 : format; + + switch (format) + { + case ECF_A1R5G5B5: + if (!Driver->getTextureCreationFlag(ETCF_ALWAYS_32_BIT)) + destFormat = ECF_A1R5G5B5; + break; + case ECF_R5G6B5: + if (!Driver->getTextureCreationFlag(ETCF_ALWAYS_32_BIT)) + destFormat = ECF_A1R5G5B5; + break; + case ECF_A8R8G8B8: + if (Driver->getTextureCreationFlag(ETCF_ALWAYS_16_BIT) || + Driver->getTextureCreationFlag(ETCF_OPTIMIZED_FOR_SPEED)) + destFormat = ECF_A1R5G5B5; + break; + case ECF_R8G8B8: + if (Driver->getTextureCreationFlag(ETCF_ALWAYS_16_BIT) || Driver->getTextureCreationFlag(ETCF_OPTIMIZED_FOR_SPEED)) + destFormat = ECF_A1R5G5B5; + default: + break; + } + + if (Driver->getTextureCreationFlag(ETCF_NO_ALPHA_CHANNEL)) + { + switch (destFormat) + { + case ECF_A1R5G5B5: + destFormat = ECF_R5G6B5; + break; + case ECF_A8R8G8B8: + destFormat = ECF_R8G8B8; + break; + default: + break; + } + } + + return destFormat; + } + + void getImageValues(const IImage* image) + { + OriginalColorFormat = image->getColorFormat(); + ColorFormat = getBestColorFormat(OriginalColorFormat); + + void(*converter)(const void*, s32, void*) = 0; + + Driver->getColorFormatParameters(ColorFormat, InternalFormat, PixelFormat, PixelType, &converter); + + if (IImage::isCompressedFormat(image->getColorFormat())) + { + KeepImage = false; + AutoGenerateMipMaps = false; + } + + OriginalSize = image->getDimension(); + Size = OriginalSize; + + if (Size.Width == 0 || Size.Height == 0) + { + os::Printer::log("Invalid size of image for texture.", ELL_ERROR); + return; + } + + const f32 ratio = (f32)Size.Width / (f32)Size.Height; + + if ((Size.Width > Driver->MaxTextureSize) && (ratio >= 1.f)) + { + Size.Width = Driver->MaxTextureSize; + Size.Height = (u32)(Driver->MaxTextureSize / ratio); + } + else if (Size.Height > Driver->MaxTextureSize) + { + Size.Height = Driver->MaxTextureSize; + Size.Width = (u32)(Driver->MaxTextureSize * ratio); + } + + Size = Size.getOptimalSize(!Driver->queryFeature(EVDF_TEXTURE_NPOT)); + } + + void uploadTexture(bool initTexture, u32 level, const void* data) + { + if (!data) + return; + + if (initTexture) + { + glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST); + glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST); + } + + u32 width = Size.Width >> level; + u32 height = Size.Height >> level; + + if (!IImage::isCompressedFormat(ColorFormat)) + { + if (initTexture) + { + glTexImage2D(GL_TEXTURE_2D, level, InternalFormat, width, height, 0, PixelFormat, PixelType, data); + } + else + { + glTexSubImage2D(GL_TEXTURE_2D, level, 0, 0, width, height, PixelFormat, PixelType, data); + } + } + else + { + u32 dataSize = IImage::getDataSizeFromFormat(ColorFormat, Size.Width, height); + + if (initTexture) + { + Driver->irrGlCompressedTexImage2D(GL_TEXTURE_2D, 0, InternalFormat, width, height, 0, dataSize, data); + } + else + { + Driver->irrGlCompressedTexSubImage2D(GL_TEXTURE_2D, level, 0, 0, width, height, PixelFormat, dataSize, data); + } + } + } + + TOGLDriver* Driver; + + GLenum TextureType; + GLuint TextureName; + GLint InternalFormat; + GLenum PixelFormat; + GLenum PixelType; + + bool LockReadOnly; + IImage* LockImage; + u32 LockLevel; + + bool KeepImage; + core::array Image; + + bool AutoGenerateMipMaps; + + mutable SStatesCache StatesCache; +}; + +} +} + +#endif +#endif diff --git a/source/Irrlicht/COGLES2Common.h b/source/Irrlicht/COGLES2Common.h new file mode 100644 index 00000000..dce3a7cc --- /dev/null +++ b/source/Irrlicht/COGLES2Common.h @@ -0,0 +1,67 @@ +// Copyright (C) 2015 Patryk Nadrowski +// This file is part of the "Irrlicht Engine". +// For conditions of distribution and use, see copyright notice in irrlicht.h + +#ifndef __C_OGLES2_COMMON_H_INCLUDED__ +#define __C_OGLES2_COMMON_H_INCLUDED__ + +#include "IrrCompileConfig.h" + +#ifdef _IRR_COMPILE_WITH_OGLES2_ + +#if defined(_IRR_COMPILE_WITH_IPHONE_DEVICE_) +#include +#include +#elif defined(_IRR_COMPILE_WITH_ANDROID_DEVICE_) +#include +#include +#else +#include +typedef char GLchar; +#if defined(_IRR_OGLES2_USE_EXTPOINTER_) +#include "gles2-ext.h" +#endif +#endif + +#ifndef GL_BGRA +#define GL_BGRA 0x80E1; +#endif + +// FBO definitions. + +#define GL_FRAMEBUFFER_INCOMPLETE_READ_BUFFER 1 +#define GL_FRAMEBUFFER_INCOMPLETE_DRAW_BUFFER 2 +#define GL_FRAMEBUFFER_INCOMPLETE_FORMATS 3 + +// Irrlicht's OpenGL version. + +#define IRR_OPENGL_VERSION 20 + +namespace irr +{ +namespace video +{ + + // Forward declarations. + + class COGLCoreFeature; + + template + class COGLCoreTexture; + + template + class COGLCoreRenderTarget; + + template + class COGLCoreCacheHandler; + + class COGLES2Driver; + typedef COGLCoreTexture COGLES2Texture; + typedef COGLCoreRenderTarget COGLES2RenderTarget; + typedef COGLCoreCacheHandler COGLES2CacheHandler; + +} +} + +#endif +#endif diff --git a/source/Irrlicht/COGLES2Driver.cpp b/source/Irrlicht/COGLES2Driver.cpp index 5bd91f5b..8338b1ef 100644 --- a/source/Irrlicht/COGLES2Driver.cpp +++ b/source/Irrlicht/COGLES2Driver.cpp @@ -1,14 +1,18 @@ // Copyright (C) 2014 Patryk Nadrowski +// Copyright (C) 2009-2010 Amundis // This file is part of the "Irrlicht Engine". // For conditions of distribution and use, see copyright notice in Irrlicht.h #include "COGLES2Driver.h" -// needed here also because of the create methods' parameters #include "CNullDriver.h" +#include "IContextManager.h" #ifdef _IRR_COMPILE_WITH_OGLES2_ -#include "COGLES2Texture.h" +#include "COGLCoreTexture.h" +#include "COGLCoreRenderTarget.h" +#include "COGLCoreCacheHandler.h" + #include "COGLES2MaterialRenderer.h" #include "COGLES2FixedPipelineRenderer.h" #include "COGLES2NormalMapRenderer.h" @@ -43,9 +47,9 @@ COGLES2Driver::COGLES2Driver(const SIrrlichtCreationParameters& params, , CIrrDeviceIPhone* device #endif ) : CNullDriver(io, params.WindowSize), COGLES2ExtensionHandler(), - CurrentRenderMode(ERM_NONE), ResetRenderStates(true), + CacheHandler(0), MaterialRenderer2D(0), CurrentRenderMode(ERM_NONE), ResetRenderStates(true), Transformation3DChanged(true), AntiAlias(params.AntiAlias), OGLES2ShaderPath(params.OGLES2ShaderPath), - RenderTargetTexture(0), CurrentRendertargetSize(0, 0), ColorFormat(ECF_R8G8B8), BridgeCalls(0) + CurrentRendertargetSize(0, 0), ColorFormat(ECF_R8G8B8), Params(params) #if defined(_IRR_COMPILE_WITH_X11_DEVICE_) || defined(_IRR_WINDOWS_API_) || defined(_IRR_COMPILE_WITH_ANDROID_DEVICE_) || defined(_IRR_COMPILE_WITH_FB_DEVICE_) , ContextManager(contextManager) #elif defined(_IRR_COMPILE_WITH_IPHONE_DEVICE_) @@ -130,21 +134,26 @@ COGLES2Driver::COGLES2Driver(const SIrrlichtCreationParameters& params, COGLES2Driver::~COGLES2Driver() { - if (BridgeCalls) - BridgeCalls->reset(); - RequestedLights.clear(); - deleteMaterialRenders(); - delete MaterialRenderer2D; - deleteAllTextures(); - delete BridgeCalls; + deleteMaterialRenders(); + + CacheHandler->getTextureCache().clear(); + // I get a blue screen on my laptop, when I do not delete the + // textures manually before releasing the dc. Oh how I love this. + removeAllRenderTargets(); + deleteAllTextures(); + removeAllOcclusionQueries(); + removeAllHardwareBuffers(); + + delete CacheHandler; #if defined(_IRR_COMPILE_WITH_X11_DEVICE_) || defined(_IRR_WINDOWS_API_) || defined(_IRR_COMPILE_WITH_ANDROID_DEVICE_) || defined(_IRR_COMPILE_WITH_FB_DEVICE_) if (ContextManager) { ContextManager->destroyContext(); ContextManager->destroySurface(); + ContextManager->terminate(); ContextManager->drop(); } #elif defined(_IRR_COMPILE_WITH_IPHONE_DEVICE_) @@ -180,17 +189,16 @@ COGLES2Driver::~COGLES2Driver() os::Printer::log(VendorName.c_str(), ELL_INFORMATION); // load extensions - initExtensions(this, stencilBuffer); + initExtensions(); - if (!BridgeCalls) - BridgeCalls = new COGLES2CallBridge(this); - else - BridgeCalls->reset(); + // reset cache handler + delete CacheHandler; + CacheHandler = new COGLES2CacheHandler(this); StencilBuffer = stencilBuffer; - DriverAttributes->setAttribute("MaxTextures", MaxTextureUnits); - DriverAttributes->setAttribute("MaxSupportedTextures", MaxSupportedTextures); + DriverAttributes->setAttribute("MaxTextures", (s32)Feature.TextureUnit); + DriverAttributes->setAttribute("MaxSupportedTextures", (s32)Feature.TextureUnit); // DriverAttributes->setAttribute("MaxLights", MaxLights); DriverAttributes->setAttribute("MaxAnisotropy", MaxAnisotropy); // DriverAttributes->setAttribute("MaxUserClipPlanes", MaxUserClipPlanes); @@ -204,9 +212,6 @@ COGLES2Driver::~COGLES2Driver() glPixelStorei(GL_PACK_ALIGNMENT, 1); - // Reset The Current Viewport - BridgeCalls->setViewport(core::rect(0, 0, screenSize.Width, screenSize.Height)); - UserClipPlane.reallocate(0); setAmbientLight(SColorf(0.0f, 0.0f, 0.0f, 0.0f)); @@ -476,59 +481,42 @@ COGLES2Driver::~COGLES2Driver() delete[] fs2DData; } - -//! presents the rendered scene on the screen, returns false if failed -bool COGLES2Driver::endScene() -{ - IRR_PROFILE(CProfileScope p1(EPID_ES2_END_SCENE);) - - CNullDriver::endScene(); - -#if defined(_IRR_COMPILE_WITH_X11_DEVICE_) || defined(_IRR_WINDOWS_API_) || defined(_IRR_COMPILE_WITH_ANDROID_DEVICE_) || defined(_IRR_COMPILE_WITH_FB_DEVICE_) - if (ContextManager) - ContextManager->swapBuffers(); -#elif defined(_IRR_COMPILE_WITH_IPHONE_DEVICE_) - glFlush(); - glBindRenderbuffer(GL_RENDERBUFFER, ViewRenderbuffer); - Device->displayEnd(); -#endif - - return true; -} - - - //! clears the zbuffer - bool COGLES2Driver::beginScene(bool backBuffer, bool zBuffer, SColor color, - const SExposedVideoData& videoData, core::rect* sourceRect) + bool COGLES2Driver::beginScene(u16 clearFlag, SColor clearColor, f32 clearDepth, u8 clearStencil, const SExposedVideoData& videoData, core::rect* sourceRect) { IRR_PROFILE(CProfileScope p1(EPID_ES2_BEGIN_SCENE);) - CNullDriver::beginScene(backBuffer, zBuffer, color); + CNullDriver::beginScene(clearFlag, clearColor, clearDepth, clearStencil, videoData, sourceRect); - GLbitfield mask = 0; + if (ContextManager) + ContextManager->activateContext(videoData); - if (backBuffer) - { - BridgeCalls->setColorMask(true, true, true, true); - - const f32 inv = 1.0f / 255.0f; - glClearColor(color.getRed() * inv, color.getGreen() * inv, - color.getBlue() * inv, color.getAlpha() * inv); - - mask |= GL_COLOR_BUFFER_BIT; - } - - if (zBuffer) - { - BridgeCalls->setDepthMask(true); - mask |= GL_DEPTH_BUFFER_BIT; - } - - glClear(mask); + clearBuffers(clearFlag, clearColor, clearDepth, clearStencil); return true; } + bool COGLES2Driver::endScene() + { + IRR_PROFILE(CProfileScope p1(EPID_ES2_END_SCENE);) + + CNullDriver::endScene(); + + glFlush(); + +#if defined(_IRR_COMPILE_WITH_X11_DEVICE_) || defined(_IRR_WINDOWS_API_) || defined(_IRR_COMPILE_WITH_ANDROID_DEVICE_) || defined(_IRR_COMPILE_WITH_FB_DEVICE_) + if (ContextManager) + return ContextManager->swapBuffers(); +#elif defined(_IRR_COMPILE_WITH_IPHONE_DEVICE_) + glFlush(); + glBindRenderbuffer(GL_RENDERBUFFER, ViewRenderbuffer); + Device->displayEnd(); + + return true; +#endif + + return false; + } + //! Returns the transformation set by setTransform const core::matrix4& COGLES2Driver::getTransform(E_TRANSFORMATION_STATE state) const @@ -791,6 +779,15 @@ bool COGLES2Driver::endScene() } + IRenderTarget* COGLES2Driver::addRenderTarget() + { + COGLES2RenderTarget* renderTarget = new COGLES2RenderTarget(this); + RenderTargets.push_back(renderTarget); + + return renderTarget; + } + + // small helper function to create vertex buffer object adress offsets static inline u8* buffer_offset(const long offset) { @@ -956,12 +953,9 @@ bool COGLES2Driver::endScene() } - //! draws a 2d image, using a color and the alpha channel of the texture - void COGLES2Driver::draw2DImage(const video::ITexture* texture, - const core::position2d& pos, - const core::rect& sourceRect, - const core::rect* clipRect, SColor color, - bool useAlphaChannelOfTexture) + void COGLES2Driver::draw2DImage(const video::ITexture* texture, const core::position2d& destPos, + const core::rect& sourceRect, const core::rect* clipRect, SColor color, + bool useAlphaChannelOfTexture) { if (!texture) return; @@ -971,7 +965,7 @@ bool COGLES2Driver::endScene() IRR_PROFILE(CProfileScope p1(EPID_ES2_DRAW_2DIMAGE);) - core::position2d targetPos(pos); + core::position2d targetPos(destPos); core::position2d sourcePos(sourceRect.UpperLeftCorner); core::dimension2d sourceSize(sourceRect.getSize()); if (clipRect) @@ -1067,6 +1061,8 @@ bool COGLES2Driver::endScene() chooseMaterial2D(); Material.TextureLayer[0].Texture = const_cast(texture); + if (!CacheHandler->getTextureCache().set(0, texture)) + return; setRenderStates2DMode(color.getAlpha() < 255, true, useAlphaChannelOfTexture); @@ -1095,6 +1091,130 @@ bool COGLES2Driver::endScene() } + void COGLES2Driver::draw2DImage(const video::ITexture* texture, const core::rect& destRect, + const core::rect& sourceRect, const core::rect* clipRect, + const video::SColor* const colors, bool useAlphaChannelOfTexture) + { + if (!texture) + return; + + IRR_PROFILE(CProfileScope p1(EPID_ES2_DRAW_2DIMAGE);) + + // texcoords need to be flipped horizontally for RTTs + const bool isRTT = texture->isRenderTarget(); + const core::dimension2du& ss = texture->getOriginalSize(); + const f32 invW = 1.f / static_cast(ss.Width); + const f32 invH = 1.f / static_cast(ss.Height); + const core::rect tcoords( + sourceRect.UpperLeftCorner.X * invW, + (isRTT ? sourceRect.LowerRightCorner.Y : sourceRect.UpperLeftCorner.Y) * invH, + sourceRect.LowerRightCorner.X * invW, + (isRTT ? sourceRect.UpperLeftCorner.Y : sourceRect.LowerRightCorner.Y) *invH); + + const video::SColor temp[4] = + { + 0xFFFFFFFF, + 0xFFFFFFFF, + 0xFFFFFFFF, + 0xFFFFFFFF + }; + + const video::SColor* const useColor = colors ? colors : temp; + + chooseMaterial2D(); + Material.TextureLayer[0].Texture = const_cast(texture); + if (!CacheHandler->getTextureCache().set(0, texture)) + return; + + setRenderStates2DMode(useColor[0].getAlpha() < 255 || useColor[1].getAlpha() < 255 || + useColor[2].getAlpha() < 255 || useColor[3].getAlpha() < 255, + true, useAlphaChannelOfTexture); + + const core::dimension2d& renderTargetSize = getCurrentRenderTargetSize(); + + if (clipRect) + { + if (!clipRect->isValid()) + return; + + glEnable(GL_SCISSOR_TEST); + glScissor(clipRect->UpperLeftCorner.X, renderTargetSize.Height - clipRect->LowerRightCorner.Y, + clipRect->getWidth(), clipRect->getHeight()); + } + + f32 left = (f32)destRect.UpperLeftCorner.X / (f32)renderTargetSize.Width * 2.f - 1.f; + f32 right = (f32)destRect.LowerRightCorner.X / (f32)renderTargetSize.Width * 2.f - 1.f; + f32 down = 2.f - (f32)destRect.LowerRightCorner.Y / (f32)renderTargetSize.Height * 2.f - 1.f; + f32 top = 2.f - (f32)destRect.UpperLeftCorner.Y / (f32)renderTargetSize.Height * 2.f - 1.f; + + u16 indices[] = { 0, 1, 2, 3 }; + S3DVertex vertices[4]; + vertices[0] = S3DVertex(left, top, 0, 0, 0, 1, useColor[0], tcoords.UpperLeftCorner.X, tcoords.UpperLeftCorner.Y); + vertices[1] = S3DVertex(right, top, 0, 0, 0, 1, useColor[3], tcoords.LowerRightCorner.X, tcoords.UpperLeftCorner.Y); + vertices[2] = S3DVertex(right, down, 0, 0, 0, 1, useColor[2], tcoords.LowerRightCorner.X, tcoords.LowerRightCorner.Y); + vertices[3] = S3DVertex(left, down, 0, 0, 0, 1, useColor[1], tcoords.UpperLeftCorner.X, tcoords.LowerRightCorner.Y); + + glEnableVertexAttribArray(EVA_POSITION); + glEnableVertexAttribArray(EVA_COLOR); + glEnableVertexAttribArray(EVA_TCOORD0); + glVertexAttribPointer(EVA_POSITION, 3, GL_FLOAT, false, sizeof(S3DVertex), &(static_cast(vertices))[0].Pos); + glVertexAttribPointer(EVA_COLOR, 4, GL_UNSIGNED_BYTE, true, sizeof(S3DVertex), &(static_cast(vertices))[0].Color); + glVertexAttribPointer(EVA_TCOORD0, 2, GL_FLOAT, false, sizeof(S3DVertex), &(static_cast(vertices))[0].TCoords); + glDrawElements(GL_TRIANGLE_FAN, 4, GL_UNSIGNED_SHORT, indices); + glDisableVertexAttribArray(EVA_TCOORD0); + glDisableVertexAttribArray(EVA_COLOR); + glDisableVertexAttribArray(EVA_POSITION); + + if (clipRect) + glDisable(GL_SCISSOR_TEST); + + testGLError(); + } + + + void COGLES2Driver::draw2DImage(const video::ITexture* texture, bool flip) + { + chooseMaterial2D(); + Material.TextureLayer[0].Texture = const_cast(texture); + + if (!texture || !CacheHandler->getTextureCache().set(0, texture)) + return; + + setRenderStates2DMode(false, true, true); + + u16 quad2DIndices[] = { 0, 1, 2, 3 }; + S3DVertex quad2DVertices[4]; + + quad2DVertices[0].Pos = core::vector3df(-1.f, 1.f, 0.f); + quad2DVertices[1].Pos = core::vector3df(1.f, 1.f, 0.f); + quad2DVertices[2].Pos = core::vector3df(1.f, -1.f, 0.f); + quad2DVertices[3].Pos = core::vector3df(-1.f, -1.f, 0.f); + + f32 modificator = (flip) ? 1.f : 0.f; + + quad2DVertices[0].TCoords = core::vector2df(0.f, 0.f + modificator); + quad2DVertices[1].TCoords = core::vector2df(1.f, 0.f + modificator); + quad2DVertices[2].TCoords = core::vector2df(1.f, 1.f - modificator); + quad2DVertices[3].TCoords = core::vector2df(0.f, 1.f - modificator); + + quad2DVertices[0].Color = SColor(0xFFFFFFFF); + quad2DVertices[1].Color = SColor(0xFFFFFFFF); + quad2DVertices[2].Color = SColor(0xFFFFFFFF); + quad2DVertices[3].Color = SColor(0xFFFFFFFF); + + glEnableVertexAttribArray(EVA_POSITION); + glEnableVertexAttribArray(EVA_COLOR); + glEnableVertexAttribArray(EVA_TCOORD0); + glVertexAttribPointer(EVA_POSITION, 3, GL_FLOAT, false, sizeof(S3DVertex), &(static_cast(quad2DVertices))[0].Pos); + glVertexAttribPointer(EVA_COLOR, 4, GL_UNSIGNED_BYTE, true, sizeof(S3DVertex), &(static_cast(quad2DVertices))[0].Color); + glVertexAttribPointer(EVA_TCOORD0, 2, GL_FLOAT, false, sizeof(S3DVertex), &(static_cast(quad2DVertices))[0].TCoords); + glDrawElements(GL_TRIANGLE_FAN, 4, GL_UNSIGNED_SHORT, quad2DIndices); + glDisableVertexAttribArray(EVA_TCOORD0); + glDisableVertexAttribArray(EVA_COLOR); + glDisableVertexAttribArray(EVA_POSITION); + } + + void COGLES2Driver::draw2DImageBatch(const video::ITexture* texture, const core::array >& positions, const core::array >& sourceRects, @@ -1206,6 +1326,8 @@ bool COGLES2Driver::endScene() chooseMaterial2D(); Material.TextureLayer[0].Texture = const_cast(texture); + if (!CacheHandler->getTextureCache().set(0, texture)) + return; setRenderStates2DMode(color.getAlpha() < 255, true, useAlphaChannelOfTexture); @@ -1253,87 +1375,6 @@ bool COGLES2Driver::endScene() } - //! The same, but with a four element array of colors, one for each vertex - void COGLES2Driver::draw2DImage(const video::ITexture* texture, - const core::rect& destRect, - const core::rect& sourceRect, const core::rect* clipRect, - const video::SColor* const colors, bool useAlphaChannelOfTexture) - { - if (!texture) - return; - - IRR_PROFILE(CProfileScope p1(EPID_ES2_DRAW_2DIMAGE);) - - // texcoords need to be flipped horizontally for RTTs - const bool isRTT = texture->isRenderTarget(); - const core::dimension2du& ss = texture->getOriginalSize(); - const f32 invW = 1.f / static_cast(ss.Width); - const f32 invH = 1.f / static_cast(ss.Height); - const core::rect tcoords( - sourceRect.UpperLeftCorner.X * invW, - (isRTT ? sourceRect.LowerRightCorner.Y : sourceRect.UpperLeftCorner.Y) * invH, - sourceRect.LowerRightCorner.X * invW, - (isRTT ? sourceRect.UpperLeftCorner.Y : sourceRect.LowerRightCorner.Y) *invH); - - const video::SColor temp[4] = - { - 0xFFFFFFFF, - 0xFFFFFFFF, - 0xFFFFFFFF, - 0xFFFFFFFF - }; - - const video::SColor* const useColor = colors ? colors : temp; - - chooseMaterial2D(); - Material.TextureLayer[0].Texture = const_cast(texture); - - setRenderStates2DMode(useColor[0].getAlpha() < 255 || useColor[1].getAlpha() < 255 || - useColor[2].getAlpha() < 255 || useColor[3].getAlpha() < 255, - true, useAlphaChannelOfTexture); - - const core::dimension2d& renderTargetSize = getCurrentRenderTargetSize(); - - if (clipRect) - { - if (!clipRect->isValid()) - return; - - glEnable(GL_SCISSOR_TEST); - glScissor(clipRect->UpperLeftCorner.X, renderTargetSize.Height - clipRect->LowerRightCorner.Y, - clipRect->getWidth(), clipRect->getHeight()); - } - - f32 left = (f32)destRect.UpperLeftCorner.X / (f32)renderTargetSize.Width * 2.f - 1.f; - f32 right = (f32)destRect.LowerRightCorner.X / (f32)renderTargetSize.Width * 2.f - 1.f; - f32 down = 2.f - (f32)destRect.LowerRightCorner.Y / (f32)renderTargetSize.Height * 2.f - 1.f; - f32 top = 2.f - (f32)destRect.UpperLeftCorner.Y / (f32)renderTargetSize.Height * 2.f - 1.f; - - u16 indices[] = {0, 1, 2, 3}; - S3DVertex vertices[4]; - vertices[0] = S3DVertex(left, top, 0, 0, 0, 1, useColor[0], tcoords.UpperLeftCorner.X, tcoords.UpperLeftCorner.Y); - vertices[1] = S3DVertex(right, top, 0, 0, 0, 1, useColor[3], tcoords.LowerRightCorner.X, tcoords.UpperLeftCorner.Y); - vertices[2] = S3DVertex(right, down, 0, 0, 0, 1, useColor[2], tcoords.LowerRightCorner.X, tcoords.LowerRightCorner.Y); - vertices[3] = S3DVertex(left, down, 0, 0, 0, 1, useColor[1], tcoords.UpperLeftCorner.X, tcoords.LowerRightCorner.Y); - - glEnableVertexAttribArray(EVA_POSITION); - glEnableVertexAttribArray(EVA_COLOR); - glEnableVertexAttribArray(EVA_TCOORD0); - glVertexAttribPointer(EVA_POSITION, 3, GL_FLOAT, false, sizeof(S3DVertex), &(static_cast(vertices))[0].Pos); - glVertexAttribPointer(EVA_COLOR, 4, GL_UNSIGNED_BYTE, true, sizeof(S3DVertex), &(static_cast(vertices))[0].Color); - glVertexAttribPointer(EVA_TCOORD0, 2, GL_FLOAT, false, sizeof(S3DVertex), &(static_cast(vertices))[0].TCoords); - glDrawElements(GL_TRIANGLE_FAN, 4, GL_UNSIGNED_SHORT, indices); - glDisableVertexAttribArray(EVA_TCOORD0); - glDisableVertexAttribArray(EVA_COLOR); - glDisableVertexAttribArray(EVA_POSITION); - - if (clipRect) - glDisable(GL_SCISSOR_TEST); - - testGLError(); - } - - //! draws a set of 2d images, using a color and the alpha channel void COGLES2Driver::draw2DImageBatch(const video::ITexture* texture, const core::position2d& pos, @@ -1349,6 +1390,8 @@ bool COGLES2Driver::endScene() chooseMaterial2D(); Material.TextureLayer[0].Texture = const_cast(texture); + if (!CacheHandler->getTextureCache().set(0, texture)) + return; setRenderStates2DMode(color.getAlpha() < 255, true, useAlphaChannelOfTexture); @@ -1440,6 +1483,7 @@ bool COGLES2Driver::endScene() chooseMaterial2D(); Material.TextureLayer[0].Texture = 0; + CacheHandler->getTextureCache().set(0, 0); setRenderStates2DMode(color.getAlpha() < 255, false, false); @@ -1493,6 +1537,7 @@ bool COGLES2Driver::endScene() chooseMaterial2D(); Material.TextureLayer[0].Texture = 0; + CacheHandler->getTextureCache().set(0, 0); setRenderStates2DMode(colorLeftUp.getAlpha() < 255 || colorRightUp.getAlpha() < 255 || @@ -1535,6 +1580,7 @@ bool COGLES2Driver::endScene() { chooseMaterial2D(); Material.TextureLayer[0].Texture = 0; + CacheHandler->getTextureCache().set(0, 0); setRenderStates2DMode(color.getAlpha() < 255, false, false); @@ -1570,6 +1616,7 @@ bool COGLES2Driver::endScene() chooseMaterial2D(); Material.TextureLayer[0].Texture = 0; + CacheHandler->getTextureCache().set(0, 0); setRenderStates2DMode(color.getAlpha() < 255, false, false); @@ -1590,12 +1637,17 @@ bool COGLES2Driver::endScene() //! returns a device dependent texture from a software surface (IImage) - ITexture* COGLES2Driver::createDeviceDependentTexture(IImage* surface, const io::path& name, void* mipmapData) + ITexture* COGLES2Driver::createDeviceDependentTexture(IImage* surface, const io::path& name) { COGLES2Texture* texture = 0; if (surface && checkColorFormat(surface->getColorFormat(), surface->getDimension())) - texture = new COGLES2Texture(surface, name, mipmapData, this); + { + core::array imageArray(1); + imageArray.push_back(surface); + + texture = new COGLES2Texture(name, imageArray, this); + } return texture; } @@ -1611,7 +1663,8 @@ bool COGLES2Driver::endScene() checkTextureCube(posXImage, negXImage, posYImage, negYImage, posZImage, negZImage) && checkColorFormat(posXImage->getColorFormat(), posXImage->getDimension())) { - texture = new COGLES2Texture(name, posXImage, negXImage, posYImage, negYImage, posZImage, negZImage, this); + // TO-DO + // texture = new COGLES2Texture(name, posXImage, negXImage, posYImage, negYImage, posZImage, negZImage, this); } return texture; @@ -1624,8 +1677,11 @@ bool COGLES2Driver::endScene() Material = material; OverrideMaterial.apply(Material); - for (u32 i = 0; i < MaxTextureUnits; ++i) + for (u32 i = 0; i < Feature.TextureUnit; ++i) + { + CacheHandler->getTextureCache().set(i, material.getTexture(i)); setTransform((E_TRANSFORMATION_STATE)(ETS_TEXTURE_0 + i), material.getTextureMatrix(i)); + } } //! prints error if an error happened. @@ -1722,8 +1778,8 @@ bool COGLES2Driver::endScene() if (CurrentRenderMode != ERM_3D) { // Reset Texture Stages - BridgeCalls->setBlend(false); - BridgeCalls->setBlendFunc(GL_ONE, GL_ONE_MINUS_SRC_COLOR); + CacheHandler->setBlend(false); + CacheHandler->setBlendFunc(GL_ONE, GL_ONE_MINUS_SRC_COLOR); ResetRenderStates = true; } @@ -1763,39 +1819,39 @@ bool COGLES2Driver::endScene() switch (material.ZBuffer) { case ECFN_DISABLED: - BridgeCalls->setDepthTest(false); + CacheHandler->setDepthTest(false); break; case ECFN_LESSEQUAL: - BridgeCalls->setDepthTest(true); - BridgeCalls->setDepthFunc(GL_LEQUAL); + CacheHandler->setDepthTest(true); + CacheHandler->setDepthFunc(GL_LEQUAL); break; case ECFN_EQUAL: - BridgeCalls->setDepthTest(true); - BridgeCalls->setDepthFunc(GL_EQUAL); + CacheHandler->setDepthTest(true); + CacheHandler->setDepthFunc(GL_EQUAL); break; case ECFN_LESS: - BridgeCalls->setDepthTest(true); - BridgeCalls->setDepthFunc(GL_LESS); + CacheHandler->setDepthTest(true); + CacheHandler->setDepthFunc(GL_LESS); break; case ECFN_NOTEQUAL: - BridgeCalls->setDepthTest(true); - BridgeCalls->setDepthFunc(GL_NOTEQUAL); + CacheHandler->setDepthTest(true); + CacheHandler->setDepthFunc(GL_NOTEQUAL); break; case ECFN_GREATEREQUAL: - BridgeCalls->setDepthTest(true); - BridgeCalls->setDepthFunc(GL_GEQUAL); + CacheHandler->setDepthTest(true); + CacheHandler->setDepthFunc(GL_GEQUAL); break; case ECFN_GREATER: - BridgeCalls->setDepthTest(true); - BridgeCalls->setDepthFunc(GL_GREATER); + CacheHandler->setDepthTest(true); + CacheHandler->setDepthFunc(GL_GREATER); break; case ECFN_ALWAYS: - BridgeCalls->setDepthTest(true); - BridgeCalls->setDepthFunc(GL_ALWAYS); + CacheHandler->setDepthTest(true); + CacheHandler->setDepthFunc(GL_ALWAYS); break; case ECFN_NEVER: - BridgeCalls->setDepthTest(true); - BridgeCalls->setDepthFunc(GL_NEVER); + CacheHandler->setDepthTest(true); + CacheHandler->setDepthFunc(GL_NEVER); break; default: break; @@ -1805,36 +1861,36 @@ bool COGLES2Driver::endScene() if (material.ZWriteEnable && (AllowZWriteOnTransparent || (material.BlendOperation == EBO_NONE && !MaterialRenderers[material.MaterialType].Renderer->isTransparent()))) { - BridgeCalls->setDepthMask(true); + CacheHandler->setDepthMask(true); } else { - BridgeCalls->setDepthMask(false); + CacheHandler->setDepthMask(false); } // Back face culling if ((material.FrontfaceCulling) && (material.BackfaceCulling)) { - BridgeCalls->setCullFaceFunc(GL_FRONT_AND_BACK); - BridgeCalls->setCullFace(true); + CacheHandler->setCullFaceFunc(GL_FRONT_AND_BACK); + CacheHandler->setCullFace(true); } else if (material.BackfaceCulling) { - BridgeCalls->setCullFaceFunc(GL_BACK); - BridgeCalls->setCullFace(true); + CacheHandler->setCullFaceFunc(GL_BACK); + CacheHandler->setCullFace(true); } else if (material.FrontfaceCulling) { - BridgeCalls->setCullFaceFunc(GL_FRONT); - BridgeCalls->setCullFace(true); + CacheHandler->setCullFaceFunc(GL_FRONT); + CacheHandler->setCullFace(true); } else { - BridgeCalls->setCullFace(false); + CacheHandler->setCullFace(false); } // Color Mask - BridgeCalls->setColorMask( + CacheHandler->setColorMask( (material.ColorMask & ECP_RED)?GL_TRUE:GL_FALSE, (material.ColorMask & ECP_GREEN)?GL_TRUE:GL_FALSE, (material.ColorMask & ECP_BLUE)?GL_TRUE:GL_FALSE, @@ -1842,21 +1898,21 @@ bool COGLES2Driver::endScene() // Blend Equation if (material.BlendOperation == EBO_NONE) - BridgeCalls->setBlend(false); + CacheHandler->setBlend(false); else { - BridgeCalls->setBlend(true); + CacheHandler->setBlend(true); switch (material.BlendOperation) { case EBO_ADD: - BridgeCalls->setBlendEquation(GL_FUNC_ADD); + CacheHandler->setBlendEquation(GL_FUNC_ADD); break; case EBO_SUBTRACT: - BridgeCalls->setBlendEquation(GL_FUNC_SUBTRACT); + CacheHandler->setBlendEquation(GL_FUNC_SUBTRACT); break; case EBO_REVSUBTRACT: - BridgeCalls->setBlendEquation(GL_FUNC_REVERSE_SUBTRACT); + CacheHandler->setBlendEquation(GL_FUNC_REVERSE_SUBTRACT); break; default: break; @@ -1875,7 +1931,7 @@ bool COGLES2Driver::endScene() unpack_textureBlendFuncSeparate(srcRGBFact, dstRGBFact, srcAlphaFact, dstAlphaFact, modulo, alphaSource, material.BlendFactor); - BridgeCalls->setBlendFuncSeparate(getGLBlend(srcRGBFact), getGLBlend(dstRGBFact), + CacheHandler->setBlendFuncSeparate(getGLBlend(srcRGBFact), getGLBlend(dstRGBFact), getGLBlend(srcAlphaFact), getGLBlend(dstAlphaFact)); } @@ -1902,18 +1958,17 @@ bool COGLES2Driver::endScene() // Set textures to TU/TIU and apply filters to them - for (s32 i = MaxTextureUnits-1; i>= 0; --i) + for (s32 i = Feature.TextureUnit - 1; i >= 0; --i) { - COGLES2Texture* tmpTexture = static_cast(material.TextureLayer[i].Texture); - - BridgeCalls->setActiveTexture(i); - BridgeCalls->setTexture(tmpTexture); + const COGLES2Texture* tmpTexture = CacheHandler->getTextureCache()[i]; if (!tmpTexture) continue; GLenum tmpTextureType = tmpTexture->getOpenGLTextureType(); + CacheHandler->setActiveTexture(GL_TEXTURE0 + i); + if (resetAllRenderstates) tmpTexture->getStatesCache().IsCached = false; @@ -2026,11 +2081,11 @@ bool COGLES2Driver::endScene() if (alphaChannel || alpha) { - BridgeCalls->setBlend(true); - BridgeCalls->setBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA); + CacheHandler->setBlend(true); + CacheHandler->setBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA); } else - BridgeCalls->setBlend(false); + CacheHandler->setBlend(false); MaterialRenderer2D->OnRender(this, video::EVT_STANDARD); } @@ -2099,7 +2154,6 @@ bool COGLES2Driver::endScene() return 8; } - // this code was sent in by Oliver Klems, thank you void COGLES2Driver::setViewPort(const core::rect& area) { core::rect vp = area; @@ -2107,10 +2161,9 @@ bool COGLES2Driver::endScene() vp.clipAgainst(rendert); if (vp.getHeight() > 0 && vp.getWidth() > 0) - BridgeCalls->setViewport(core::rect(vp.UpperLeftCorner.X, getCurrentRenderTargetSize().Height - vp.UpperLeftCorner.Y - vp.getHeight(), vp.getWidth(), vp.getHeight())); + CacheHandler->setViewport(vp.UpperLeftCorner.X, getCurrentRenderTargetSize().Height - vp.UpperLeftCorner.Y - vp.getHeight(), vp.getWidth(), vp.getHeight()); ViewPort = vp; - testGLError(); } @@ -2133,13 +2186,13 @@ bool COGLES2Driver::endScene() setRenderStates3DMode(); - BridgeCalls->setDepthTest(true); - BridgeCalls->setDepthFunc(GL_LESS); - BridgeCalls->setDepthMask(false); + CacheHandler->setDepthTest(true); + CacheHandler->setDepthFunc(GL_LESS); + CacheHandler->setDepthMask(false); if (!(debugDataVisible & (scene::EDS_SKELETON|scene::EDS_MESH_WIRE_OVERLAY))) { - BridgeCalls->setColorMask(false, false, false, false); + CacheHandler->setColorMask(false, false, false, false); glEnable(GL_STENCIL_TEST); } @@ -2160,25 +2213,25 @@ bool COGLES2Driver::endScene() } #endif - BridgeCalls->setCullFace(true); + CacheHandler->setCullFace(true); if (zfail) { - BridgeCalls->setCullFaceFunc(GL_FRONT); + CacheHandler->setCullFaceFunc(GL_FRONT); glStencilOp(GL_KEEP, incr, GL_KEEP); glDrawArrays(GL_TRIANGLES, 0, count); - BridgeCalls->setCullFaceFunc(GL_BACK); + CacheHandler->setCullFaceFunc(GL_BACK); glStencilOp(GL_KEEP, decr, GL_KEEP); glDrawArrays(GL_TRIANGLES, 0, count); } else // zpass { - BridgeCalls->setCullFaceFunc(GL_BACK); + CacheHandler->setCullFaceFunc(GL_BACK); glStencilOp(GL_KEEP, GL_KEEP, incr); glDrawArrays(GL_TRIANGLES, 0, count); - BridgeCalls->setCullFaceFunc(GL_FRONT); + CacheHandler->setCullFaceFunc(GL_FRONT); glStencilOp(GL_KEEP, GL_KEEP, decr); glDrawArrays(GL_TRIANGLES, 0, count); } @@ -2204,14 +2257,15 @@ bool COGLES2Driver::endScene() chooseMaterial2D(); Material.TextureLayer[0].Texture = 0; + CacheHandler->getTextureCache().set(0, 0); setRenderStates2DMode(true, false, false); - BridgeCalls->setDepthMask(false); - BridgeCalls->setColorMask(true, true, true, true); + CacheHandler->setDepthMask(false); + CacheHandler->setColorMask(true, true, true, true); - BridgeCalls->setBlend(true); - BridgeCalls->setBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA); + CacheHandler->setBlend(true); + CacheHandler->setBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA); glEnable(GL_STENCIL_TEST); glStencilFunc(GL_NOTEQUAL, 0, ~0); @@ -2267,8 +2321,8 @@ bool COGLES2Driver::endScene() void COGLES2Driver::OnResize(const core::dimension2d& size) { CNullDriver::OnResize(size); - BridgeCalls->setViewport(core::rect(0, 0, size.Width, size.Height)); - testGLError(); + CacheHandler->setViewport(0, 0, size.Width, size.Height); + Transformation3DChanged = true; } @@ -2393,45 +2447,21 @@ bool COGLES2Driver::endScene() return this; } - - ITexture* COGLES2Driver::addRenderTargetTexture( - const core::dimension2d& size, - const io::path& name, const ECOLOR_FORMAT format) + ITexture* COGLES2Driver::addRenderTargetTexture(const core::dimension2d& size, + const io::path& name, const ECOLOR_FORMAT format) { //disable mip-mapping - const bool generateMipLevels = getTextureCreationFlag(ETCF_CREATE_MIP_MAPS); + bool generateMipLevels = getTextureCreationFlag(ETCF_CREATE_MIP_MAPS); setTextureCreationFlag(ETCF_CREATE_MIP_MAPS, false); - video::ITexture* rtt = 0; - - rtt = new COGLES2FBOTexture(size, name, this, format); - if (rtt) - { - bool success = false; - addTexture(rtt); - - ITexture* tex = createDepthTexture(rtt); - if (tex) - { - success = static_cast(tex)->attach(rtt); - if (!success) - { - removeDepthTexture(tex); - } - tex->drop(); - } - rtt->drop(); - if (!success) - { - removeTexture(rtt); - rtt=0; - } - } + COGLES2Texture* renderTargetTexture = new COGLES2Texture(name, size, format, this); + addTexture(renderTargetTexture); + renderTargetTexture->drop(); //restore mip-mapping setTextureCreationFlag(ETCF_CREATE_MIP_MAPS, generateMipLevels); - return rtt; + return renderTargetTexture; } @@ -2441,62 +2471,46 @@ bool COGLES2Driver::endScene() return 65535; } - - //! set or reset render target - bool COGLES2Driver::setRenderTarget(video::ITexture* texture, bool clearBackBuffer, - bool clearZBuffer, SColor color) + bool COGLES2Driver::setRenderTarget(IRenderTarget* target, u16 clearFlag, SColor clearColor, f32 clearDepth, u8 clearStencil) { - // check for right driver type - - if (texture && texture->getDriverType() != EDT_OGLES2) + if (target && target->getDriverType() != EDT_OGLES2) { - os::Printer::log("Fatal Error: Tried to set a texture not owned by this driver.", ELL_ERROR); + os::Printer::log("Fatal Error: Tried to set a render target not owned by this driver.", ELL_ERROR); return false; } - // check if we should set the previous RT back + core::dimension2d destRenderTargetSize(0, 0); - ResetRenderStates = true; - if (RenderTargetTexture != 0) + if (target) { - RenderTargetTexture->unbindRTT(); - } + COGLES2RenderTarget* renderTarget = static_cast(target); - if (texture) - { - // we want to set a new target. so do this. - BridgeCalls->setViewport(core::rect(0, 0, texture->getSize().Width, texture->getSize().Height)); - RenderTargetTexture = static_cast(texture); - RenderTargetTexture->bindRTT(); - CurrentRendertargetSize = texture->getSize(); + CacheHandler->setFBO(renderTarget->getBufferID()); + renderTarget->update(); + + destRenderTargetSize = renderTarget->getSize(); + + CacheHandler->setViewport(0, 0, destRenderTargetSize.Width, destRenderTargetSize.Height); } else { - BridgeCalls->setViewport(core::rect(0, 0, ScreenSize.Width, ScreenSize.Height)); - RenderTargetTexture = 0; - CurrentRendertargetSize = core::dimension2d(0, 0); + CacheHandler->setFBO(0); + + destRenderTargetSize = core::dimension2d(0, 0); + + CacheHandler->setViewport(0, 0, ScreenSize.Width, ScreenSize.Height); } - GLbitfield mask = 0; - - if (clearBackBuffer) + if (CurrentRenderTargetSize != destRenderTargetSize) { - BridgeCalls->setColorMask(true, true, true, true); + CurrentRenderTargetSize = destRenderTargetSize; - const f32 inv = 1.0f / 255.0f; - glClearColor(color.getRed() * inv, color.getGreen() * inv, - color.getBlue() * inv, color.getAlpha() * inv); - - mask |= GL_COLOR_BUFFER_BIT; + Transformation3DChanged = true; } - if (clearZBuffer) - { - BridgeCalls->setDepthMask(true); - mask |= GL_DEPTH_BUFFER_BIT; - } + CurrentRenderTarget = target; - glClear(mask); + clearBuffers(clearFlag, clearColor, clearDepth, clearStencil); return true; } @@ -2511,18 +2525,36 @@ bool COGLES2Driver::endScene() return CurrentRendertargetSize; } - - ITexture* COGLES2Driver::getRenderTargetTexture() const + void COGLES2Driver::clearBuffers(u16 flag, SColor color, f32 depth, u8 stencil) { - return RenderTargetTexture; - } + GLbitfield mask = 0; + if (flag & ECBF_COLOR) + { + CacheHandler->setColorMask(true, true, true, true); - //! Clears the ZBuffer. - void COGLES2Driver::clearZBuffer() - { - BridgeCalls->setDepthMask(true); - glClear(GL_DEPTH_BUFFER_BIT); + const f32 inv = 1.0f / 255.0f; + glClearColor(color.getRed() * inv, color.getGreen() * inv, + color.getBlue() * inv, color.getAlpha() * inv); + + mask |= GL_COLOR_BUFFER_BIT; + } + + if (flag & ECBF_DEPTH) + { + CacheHandler->setDepthMask(true); + glClearDepthf(depth); + mask |= GL_DEPTH_BUFFER_BIT; + } + + if (flag & ECBF_STENCIL) + { + glClearStencil(stencil); + mask |= GL_STENCIL_BUFFER_BIT; + } + + if (mask) + glClear(mask); } @@ -2603,46 +2635,6 @@ bool COGLES2Driver::endScene() return newImage; } - - //! get depth texture for the given render target texture - ITexture* COGLES2Driver::createDepthTexture(ITexture* texture, bool shared) - { - if ((texture->getDriverType() != EDT_OGLES2) || (!texture->isRenderTarget())) - return 0; - COGLES2Texture* tex = static_cast(texture); - - if (!tex->isFrameBufferObject()) - return 0; - - if (shared) - { - for (u32 i = 0; i < DepthTextures.size(); ++i) - { - if (DepthTextures[i]->getSize() == texture->getSize()) - { - DepthTextures[i]->grab(); - return DepthTextures[i]; - } - } - DepthTextures.push_back(new COGLES2FBODepthTexture(texture->getSize(), "depth1", this)); - return DepthTextures.getLast(); - } - return (new COGLES2FBODepthTexture(texture->getSize(), "depth1", this)); - } - - - void COGLES2Driver::removeDepthTexture(ITexture* texture) - { - for (u32 i = 0; i < DepthTextures.size(); ++i) - { - if (texture == DepthTextures[i]) - { - DepthTextures.erase(i); - return; - } - } - } - void COGLES2Driver::removeTexture(ITexture* texture) { if (!texture) @@ -2651,16 +2643,6 @@ bool COGLES2Driver::endScene() CNullDriver::removeTexture(texture); } - void COGLES2Driver::deleteFramebuffers(s32 n, const u32 *framebuffers) - { - glDeleteFramebuffers(n, framebuffers); - } - - void COGLES2Driver::deleteRenderbuffers(s32 n, const u32 *renderbuffers) - { - glDeleteRenderbuffers(n, renderbuffers); - } - //! Set/unset a clipping plane. bool COGLES2Driver::setClipPlane(u32 index, const core::plane3df& plane, bool enable) { @@ -2723,333 +2705,233 @@ bool COGLES2Driver::endScene() GLenum COGLES2Driver::getZBufferBits() const { -/*#if defined(GL_OES_depth24) - if (Driver->queryOpenGLFeature(COGLES2ExtensionHandler::IRR_OES_depth24)) - InternalFormat = GL_DEPTH_COMPONENT24_OES; - else -#endif -#if defined(GL_OES_depth32) - if (Driver->queryOpenGLFeature(COGLES2ExtensionHandler::IRR_OES_depth32)) - InternalFormat = GL_DEPTH_COMPONENT32_OES; - else -#endif*/ - - GLenum bits = GL_DEPTH_COMPONENT16;//0; - /*switch (Params.ZBufferBits) + GLenum bits = 0; + switch (Params.ZBufferBits) { case 16: bits = GL_DEPTH_COMPONENT16; break; case 24: - bits = GL_DEPTH_COMPONENT24; +#if defined(GL_OES_depth24) + if (queryOpenGLFeature(COGLES2ExtensionHandler::IRR_OES_depth24)) + bits = GL_DEPTH_COMPONENT24_OES; + else +#endif + bits = GL_DEPTH_COMPONENT16; break; case 32: - bits = GL_DEPTH_COMPONENT32; +#if defined(GL_OES_depth32) + if (queryOpenGLFeature(COGLES2ExtensionHandler::IRR_OES_depth32)) + bits = GL_DEPTH_COMPONENT32_OES; + else +#endif + bits = GL_DEPTH_COMPONENT16; break; default: bits = GL_DEPTH_COMPONENT; break; - }*/ + } return bits; } + void COGLES2Driver::getColorFormatParameters(ECOLOR_FORMAT format, GLint& internalFormat, GLenum& pixelFormat, + GLenum& pixelType, void(**converter)(const void*, s32, void*)) + { + internalFormat = GL_RGBA; + pixelFormat = GL_RGBA; + pixelType = GL_UNSIGNED_BYTE; + *converter = 0; + + switch (format) + { + case ECF_A1R5G5B5: + internalFormat = GL_RGBA; + pixelFormat = GL_RGBA; + pixelType = GL_UNSIGNED_SHORT_5_5_5_1; + *converter = CColorConverter::convert_A1R5G5B5toR5G5B5A1; + break; + case ECF_R5G6B5: + internalFormat = GL_RGB; + pixelFormat = GL_RGB; + pixelType = GL_UNSIGNED_SHORT_5_6_5; + break; + case ECF_R8G8B8: + internalFormat = GL_RGB; + pixelFormat = GL_RGB; + pixelType = GL_UNSIGNED_BYTE; + break; + case ECF_A8R8G8B8: + internalFormat = GL_RGBA; + if (queryOpenGLFeature(COGLES2ExtensionHandler::IRR_IMG_texture_format_BGRA8888) || + queryOpenGLFeature(COGLES2ExtensionHandler::IRR_EXT_texture_format_BGRA8888) || + queryOpenGLFeature(COGLES2ExtensionHandler::IRR_APPLE_texture_format_BGRA8888)) + { + pixelFormat = GL_BGRA; + } + else + { + pixelFormat = GL_RGBA; + *converter = CColorConverter::convert_A8R8G8B8toA8B8G8R8; + } + pixelType = GL_UNSIGNED_BYTE; + break; +#ifdef GL_EXT_texture_compression_s3tc + case ECF_DXT1: + internalFormat = GL_COMPRESSED_RGBA_S3TC_DXT1_EXT; + pixelFormat = GL_RGBA; + pixelType = GL_COMPRESSED_RGBA_S3TC_DXT1_EXT; + break; +#endif +#ifdef GL_EXT_texture_compression_s3tc + case ECF_DXT2: + case ECF_DXT3: + internalFormat = GL_COMPRESSED_RGBA_S3TC_DXT3_EXT; + pixelFormat = GL_RGBA; + pixelType = GL_COMPRESSED_RGBA_S3TC_DXT3_EXT; + break; +#endif +#ifdef GL_EXT_texture_compression_s3tc + case ECF_DXT4: + case ECF_DXT5: + internalFormat = GL_COMPRESSED_RGBA_S3TC_DXT5_EXT; + pixelFormat = GL_RGBA; + pixelType = GL_COMPRESSED_RGBA_S3TC_DXT5_EXT; + break; +#endif +#ifdef GL_IMG_texture_compression_pvrtc + case ECF_PVRTC_RGB2: + internalFormat = GL_COMPRESSED_RGB_PVRTC_2BPPV1_IMG; + pixelFormat = GL_RGB; + pixelType = GL_COMPRESSED_RGB_PVRTC_2BPPV1_IMG; + break; +#endif +#ifdef GL_IMG_texture_compression_pvrtc + case ECF_PVRTC_ARGB2: + internalFormat = GL_COMPRESSED_RGBA_PVRTC_2BPPV1_IMG; + pixelFormat = GL_RGBA; + pixelType = GL_COMPRESSED_RGBA_PVRTC_2BPPV1_IMG; + break; +#endif +#ifdef GL_IMG_texture_compression_pvrtc + case ECF_PVRTC_RGB4: + internalFormat = GL_COMPRESSED_RGB_PVRTC_4BPPV1_IMG; + pixelFormat = GL_RGB; + pixelType = GL_COMPRESSED_RGB_PVRTC_4BPPV1_IMG; + break; +#endif +#ifdef GL_IMG_texture_compression_pvrtc + case ECF_PVRTC_ARGB4: + internalFormat = GL_COMPRESSED_RGBA_PVRTC_4BPPV1_IMG; + pixelFormat = GL_RGBA; + pixelType = GL_COMPRESSED_RGBA_PVRTC_4BPPV1_IMG; + break; +#endif +#ifdef GL_IMG_texture_compression_pvrtc2 + case ECF_PVRTC2_ARGB2: + internalFormat = GL_COMPRESSED_RGBA_PVRTC_2BPPV2_IMG; + pixelFormat = GL_RGBA; + pixelType = GL_COMPRESSED_RGBA_PVRTC_2BPPV2_IMG; + break; +#endif +#ifdef GL_IMG_texture_compression_pvrtc2 + case ECF_PVRTC2_ARGB4: + internalFormat = GL_COMPRESSED_RGBA_PVRTC_4BPPV2_IMG; + pixelFormat = GL_RGBA; + pixelType = GL_COMPRESSED_RGBA_PVRTC_4BPPV2_IMG; + break; +#endif +#ifdef GL_OES_compressed_ETC1_RGB8_texture + case ECF_ETC1: + internalFormat = GL_ETC1_RGB8_OES; + pixelFormat = GL_RGB; + pixelType = GL_ETC1_RGB8_OES; + break; +#endif +#ifdef GL_ES_VERSION_3_0 // TO-DO - fix when extension name will be available + case ECF_ETC2_RGB: + internalFormat = GL_COMPRESSED_RGB8_ETC2; + pixelFormat = GL_RGB; + pixelType = GL_COMPRESSED_RGB8_ETC2; + break; +#endif +#ifdef GL_ES_VERSION_3_0 // TO-DO - fix when extension name will be available + case ECF_ETC2_ARGB: + internalFormat = GL_COMPRESSED_RGBA8_ETC2_EAC; + pixelFormat = GL_RGBA; + pixelType = GL_COMPRESSED_RGBA8_ETC2_EAC; + break; +#endif + case ECF_D16: + internalFormat = GL_DEPTH_COMPONENT16; + pixelFormat = GL_DEPTH_COMPONENT; + pixelType = GL_UNSIGNED_BYTE; + break; + case ECF_D32: +#if defined(GL_OES_depth32) + if (queryOpenGLFeature(COGLES2ExtensionHandler::IRR_OES_depth32)) + internalFormat = GL_DEPTH_COMPONENT32_OES; + else +#endif + internalFormat = GL_DEPTH_COMPONENT16; + pixelFormat = GL_DEPTH_COMPONENT; + pixelType = GL_UNSIGNED_BYTE; + break; + case ECF_D24S8: +#ifdef GL_OES_packed_depth_stencil + if (queryOpenGLFeature(COGLES2ExtensionHandler::IRR_OES_packed_depth_stencil)) + { + internalFormat = GL_DEPTH24_STENCIL8_OES; + pixelFormat = GL_DEPTH_STENCIL_OES; + pixelType = GL_UNSIGNED_INT_24_8_OES; + } + else +#endif + os::Printer::log("ECF_D24S8 color format is not supported", ELL_ERROR); + break; + case ECF_R8: + os::Printer::log("ECF_R8 color format is not supported", ELL_ERROR); + break; + case ECF_R8G8: + os::Printer::log("ECF_R8G8 color format is not supported", ELL_ERROR); + break; + case ECF_R16: + os::Printer::log("ECF_R16 color format is not supported", ELL_ERROR); + break; + case ECF_R16G16: + os::Printer::log("ECF_R16G16 color format is not supported", ELL_ERROR); + break; + case ECF_R16F: + os::Printer::log("ECF_R16F color format is not supported", ELL_ERROR); + break; + case ECF_G16R16F: + os::Printer::log("ECF_G16R16F color format is not supported", ELL_ERROR); + break; + case ECF_A16B16G16R16F: + os::Printer::log("ECF_A16B16G16R16F color format is not supported", ELL_ERROR); + break; + case ECF_R32F: + os::Printer::log("ECF_R32F color format is not supported", ELL_ERROR); + break; + case ECF_G32R32F: + os::Printer::log("ECF_G32R32F color format is not supported", ELL_ERROR); + break; + case ECF_A32B32G32R32F: + os::Printer::log("ECF_A32B32G32R32F color format is not supported", ELL_ERROR); + break; + default: + os::Printer::log("Unsupported texture format", ELL_ERROR); + break; + } + } + const SMaterial& COGLES2Driver::getCurrentMaterial() const { return Material; } - COGLES2CallBridge* COGLES2Driver::getBridgeCalls() const + COGLES2CacheHandler* COGLES2Driver::getCacheHandler() const { - return BridgeCalls; - } - - COGLES2CallBridge::COGLES2CallBridge(COGLES2Driver* driver) : Driver(driver), - BlendEquation(GL_FUNC_ADD), BlendSourceRGB(GL_ONE), BlendDestinationRGB(GL_ZERO), - BlendSourceAlpha(GL_ONE), BlendDestinationAlpha(GL_ZERO), Blend(false), - CullFaceMode(GL_BACK), CullFace(false), - DepthFunc(GL_LESS), DepthMask(true), DepthTest(false), - Program(0), ActiveTextureID(0), Viewport(core::rect(0, 0, 0, 0)) - { - // Initial OpenGL values from specification. - - for (u32 i = 0; i < 4; ++i) - ColorMask[i] = true; - - for (u32 i = 0; i < MATERIAL_MAX_TEXTURES; ++i) - Texture[i] = 0; - - glBlendFunc(GL_ONE, GL_ZERO); - glDisable(GL_BLEND); - - glColorMask(GL_TRUE, GL_TRUE, GL_TRUE, GL_TRUE); - - glCullFace(GL_BACK); - glDisable(GL_CULL_FACE); - - glDepthFunc(GL_LESS); - glDepthMask(GL_TRUE); - glDisable(GL_DEPTH_TEST); - - glActiveTexture(GL_TEXTURE0); - } - - void COGLES2CallBridge::reset() - { - // Initial OpenGL values from specification. - - BlendEquation = GL_FUNC_ADD; - BlendSourceRGB = GL_ONE; - BlendDestinationRGB = GL_ZERO; - BlendSourceAlpha = GL_ONE; - BlendDestinationAlpha = GL_ZERO; - Blend = false; - - for (u32 i = 0; i < 4; ++i) - ColorMask[i] = true; - - CullFaceMode = GL_BACK; - CullFace = false; - - DepthFunc = GL_LESS; - DepthMask = true; - DepthTest = false; - - Program = 0; - - ActiveTextureID = 0; - - for (u32 i = 0; i < MATERIAL_MAX_TEXTURES; ++i) - { - if (Texture[i]) - Texture[i]->drop(); - - Texture[i] = 0; - } - - Viewport = core::rect(0, 0, 0, 0); - - glBlendFunc(GL_ONE, GL_ZERO); - glDisable(GL_BLEND); - - glColorMask(GL_TRUE, GL_TRUE, GL_TRUE, GL_TRUE); - - glCullFace(GL_BACK); - glDisable(GL_CULL_FACE); - - glDepthFunc(GL_LESS); - glDepthMask(GL_TRUE); - glDisable(GL_DEPTH_TEST); - - glActiveTexture(GL_TEXTURE0); - } - - void COGLES2CallBridge::setBlendEquation(GLenum mode) - { - if (BlendEquation != mode) - { - glBlendEquation(mode); - - BlendEquation = mode; - } - } - - void COGLES2CallBridge::setBlendFunc(GLenum source, GLenum destination) - { - if (BlendSourceRGB != source || BlendDestinationRGB != destination || - BlendSourceAlpha != source || BlendDestinationAlpha != destination) - { - glBlendFunc(source, destination); - - BlendSourceRGB = source; - BlendDestinationRGB = destination; - BlendSourceAlpha = source; - BlendDestinationAlpha = destination; - } - } - - void COGLES2CallBridge::setBlendFuncSeparate(GLenum sourceRGB, GLenum destinationRGB, GLenum sourceAlpha, GLenum destinationAlpha) - { - if (sourceRGB != sourceAlpha || destinationRGB != destinationAlpha) - { - if (BlendSourceRGB != sourceRGB || BlendDestinationRGB != destinationRGB || - BlendSourceAlpha != sourceAlpha || BlendDestinationAlpha != destinationAlpha) - { - glBlendFuncSeparate(sourceRGB, destinationRGB, sourceAlpha, destinationAlpha); - - BlendSourceRGB = sourceRGB; - BlendDestinationRGB = destinationRGB; - BlendSourceAlpha = sourceAlpha; - BlendDestinationAlpha = destinationAlpha; - } - } - else - { - setBlendFunc(sourceRGB, destinationRGB); - } - } - - void COGLES2CallBridge::setBlend(bool enable) - { - if (Blend != enable) - { - if (enable) - glEnable(GL_BLEND); - else - glDisable(GL_BLEND); - - Blend = enable; - } - } - - void COGLES2CallBridge::setColorMask(bool red, bool green, bool blue, bool alpha) - { - if (ColorMask[0] != red || ColorMask[1] != green || ColorMask[2] != blue || ColorMask[3] != alpha) - { - glColorMask(red, green, blue, alpha); - - ColorMask[0] = red; - ColorMask[1] = green; - ColorMask[2] = blue; - ColorMask[3] = alpha; - } - } - - void COGLES2CallBridge::setCullFaceFunc(GLenum mode) - { - if (CullFaceMode != mode) - { - glCullFace(mode); - - CullFaceMode = mode; - } - } - - void COGLES2CallBridge::setCullFace(bool enable) - { - if (CullFace != enable) - { - if (enable) - glEnable(GL_CULL_FACE); - else - glDisable(GL_CULL_FACE); - - CullFace = enable; - } - } - - void COGLES2CallBridge::setDepthFunc(GLenum mode) - { - if (DepthFunc != mode) - { - glDepthFunc(mode); - - DepthFunc = mode; - } - } - - void COGLES2CallBridge::setDepthMask(bool enable) - { - if (DepthMask != enable) - { - if (enable) - glDepthMask(GL_TRUE); - else - glDepthMask(GL_FALSE); - - DepthMask = enable; - } - } - - void COGLES2CallBridge::setDepthTest(bool enable) - { - if (DepthTest != enable) - { - if (enable) - glEnable(GL_DEPTH_TEST); - else - glDisable(GL_DEPTH_TEST); - - DepthTest = enable; - } - } - - void COGLES2CallBridge::setProgram(GLuint program) - { - if (Program != program) - { - glUseProgram(program); - Program = program; - } - } - - GLuint COGLES2CallBridge::getActiveTexture() const - { - return ActiveTextureID; - } - - void COGLES2CallBridge::setActiveTexture(GLuint id) - { - if (ActiveTextureID != id && id < MATERIAL_MAX_TEXTURES) - { - glActiveTexture(GL_TEXTURE0 + id); - - ActiveTextureID = id; - } - } - - void COGLES2CallBridge::getTexture(GLenum& type, GLuint& name) const - { - if (Texture[ActiveTextureID]) - { - type = Texture[ActiveTextureID]->getOpenGLTextureType(); - name = Texture[ActiveTextureID]->getOpenGLTextureName(); - } - else - { - type = GL_TEXTURE_2D; - name = 0; - } - } - - COGLES2Texture* COGLES2CallBridge::getTexture() const - { - return Texture[ActiveTextureID]; - } - - void COGLES2CallBridge::setTexture(COGLES2Texture* texture) - { - if (Texture[ActiveTextureID] != texture) - { - if (texture) - { - texture->grab(); - - glBindTexture(texture->getOpenGLTextureType(), texture->getOpenGLTextureName()); - } - else - { - glBindTexture(Texture[ActiveTextureID]->getOpenGLTextureType(), 0); - } - - if (Texture[ActiveTextureID]) - Texture[ActiveTextureID]->drop(); - - Texture[ActiveTextureID] = texture; - } - } - - const core::rect& COGLES2CallBridge::getViewport() const - { - return Viewport; - } - - void COGLES2CallBridge::setViewport(const core::rect& viewport) - { - if (Viewport != viewport) - { - glViewport(viewport.UpperLeftCorner.X, viewport.UpperLeftCorner.Y, viewport.LowerRightCorner.X, viewport.LowerRightCorner.Y); - Viewport = viewport; - } + return CacheHandler; } diff --git a/source/Irrlicht/COGLES2Driver.h b/source/Irrlicht/COGLES2Driver.h index fb5c51ad..9be3ae3c 100644 --- a/source/Irrlicht/COGLES2Driver.h +++ b/source/Irrlicht/COGLES2Driver.h @@ -1,4 +1,5 @@ // Copyright (C) 2014 Patryk Nadrowski +// Copyright (C) 2009-2010 Amundis // This file is part of the "Irrlicht Engine". // For conditions of distribution and use, see copyright notice in Irrlicht.h @@ -36,17 +37,16 @@ namespace irr { namespace video { - class COGLES2CallBridge; - class COGLES2Texture; + class COGLES2FixedPipelineRenderer; - class COGLES2Renderer2D; class COGLES2NormalMapRenderer; class COGLES2ParallaxMapRenderer; + class COGLES2Renderer2D; class COGLES2Driver : public CNullDriver, public IMaterialRendererServices, public COGLES2ExtensionHandler { - friend class COGLES2CallBridge; - friend class COGLES2Texture; + friend COGLES2CacheHandler; + friend COGLES2Texture; public: //! constructor @@ -62,13 +62,9 @@ namespace video //! destructor virtual ~COGLES2Driver(); - //! clears the zbuffer - virtual bool beginScene(bool backBuffer=true, bool zBuffer=true, - SColor color=SColor(255, 0, 0, 0), - const SExposedVideoData& videoData=SExposedVideoData(), - core::rect* sourceRect=0) _IRR_OVERRIDE_; + virtual bool beginScene(u16 clearFlag, SColor clearColor = SColor(255, 0, 0, 0), f32 clearDepth = 1.f, u8 clearStencil = 0, + const SExposedVideoData& videoData = SExposedVideoData(), core::rect* sourceRect = 0) _IRR_OVERRIDE_; - //! presents the rendered scene on the screen, returns false if failed virtual bool endScene() _IRR_OVERRIDE_; //! sets transformation @@ -103,6 +99,8 @@ namespace video //! Draw hardware buffer virtual void drawHardwareBuffer(SHWBufferLink *HWBuffer) _IRR_OVERRIDE_; + virtual IRenderTarget* addRenderTarget() _IRR_OVERRIDE_; + //! draws a vertex primitive list virtual void drawVertexPrimitiveList(const void* vertices, u32 vertexCount, const void* indexList, u32 primitiveCount, @@ -117,12 +115,17 @@ namespace video //! Sets a material. virtual void setMaterial(const SMaterial& material) _IRR_OVERRIDE_; - //! draws an 2d image, using a color (if color is other then Color(255,255,255,255)) and the alpha channel of the texture if wanted. virtual void draw2DImage(const video::ITexture* texture, const core::position2d& destPos, const core::rect& sourceRect, const core::rect* clipRect = 0, SColor color = SColor(255, 255, 255, 255), bool useAlphaChannelOfTexture = false) _IRR_OVERRIDE_; + virtual void draw2DImage(const video::ITexture* texture, const core::rect& destRect, + const core::rect& sourceRect, const core::rect* clipRect = 0, + const video::SColor* const colors = 0, bool useAlphaChannelOfTexture = false) _IRR_OVERRIDE_; + + virtual void draw2DImage(const video::ITexture* texture, bool flip); + //! draws a set of 2d images virtual void draw2DImageBatch(const video::ITexture* texture, const core::position2d& pos, @@ -132,11 +135,6 @@ namespace video SColor color = SColor(255, 255, 255, 255), bool useAlphaChannelOfTexture = false) _IRR_OVERRIDE_; - //! Draws a part of the texture into the rectangle. - virtual void draw2DImage(const video::ITexture* texture, const core::rect& destRect, - const core::rect& sourceRect, const core::rect* clipRect = 0, - const video::SColor* const colors = 0, bool useAlphaChannelOfTexture = false) _IRR_OVERRIDE_; - void draw2DImageBatch(const video::ITexture* texture, const core::array >& positions, const core::array >& sourceRects, @@ -279,19 +277,10 @@ namespace video virtual ITexture* addRenderTargetTexture(const core::dimension2d& size, const io::path& name, const ECOLOR_FORMAT format = ECF_UNKNOWN) _IRR_OVERRIDE_; - virtual bool setRenderTarget(video::ITexture* texture, bool clearBackBuffer, - bool clearZBuffer, SColor color) _IRR_OVERRIDE_; + virtual bool setRenderTarget(IRenderTarget* target, u16 clearFlag, SColor clearColor = SColor(255, 0, 0, 0), + f32 clearDepth = 1.f, u8 clearStencil = 0) _IRR_OVERRIDE_; - //! set or reset special render targets -// virtual bool setRenderTarget(video::E_RENDER_TARGET target, bool clearTarget, -// bool clearZBuffer, SColor color) _IRR_OVERRIDE_; - - //! Sets multiple render targets -// virtual bool setRenderTarget(const core::array& texture, -// bool clearBackBuffer=true, bool clearZBuffer=true, SColor color=SColor(0,0,0,0)) _IRR_OVERRIDE_; - - //! Clears the ZBuffer. - virtual void clearZBuffer() _IRR_OVERRIDE_; + virtual void clearBuffers(u16 flag, SColor color = SColor(255, 0, 0, 0), f32 depth = 1.f, u8 stencil = 0) _IRR_OVERRIDE_; //! Returns an image created from the last rendered frame. virtual IImage* createScreenShot(video::ECOLOR_FORMAT format=video::ECF_UNKNOWN, video::E_RENDER_TARGET target=video::ERT_FRAME_BUFFER) _IRR_OVERRIDE_; @@ -320,37 +309,31 @@ namespace video return VendorName; }; - ITexture* createDepthTexture(ITexture* texture, bool shared = true); - void removeDepthTexture(ITexture* texture); - void removeTexture(ITexture* texture); - void deleteFramebuffers(s32 n, const u32 *framebuffers); - void deleteRenderbuffers(s32 n, const u32 *renderbuffers); - // returns the current size of the screen or rendertarget virtual const core::dimension2d& getCurrentRenderTargetSize() const _IRR_OVERRIDE_; - ITexture* getRenderTargetTexture() const; - //! Convert E_BLEND_FACTOR to OpenGL equivalent GLenum getGLBlend(E_BLEND_FACTOR factor) const; //! Get ZBuffer bits. GLenum getZBufferBits() const; + void getColorFormatParameters(ECOLOR_FORMAT format, GLint& internalFormat, GLenum& pixelFormat, + GLenum& pixelType, void(**converter)(const void*, s32, void*)); + //! Get current material. const SMaterial& getCurrentMaterial() const; - //! Get bridge calls. - COGLES2CallBridge* getBridgeCalls() const; + COGLES2CacheHandler* getCacheHandler() const; private: //! inits the opengl-es driver bool genericDriverInit(const core::dimension2d& screenSize, bool stencilBuffer); //! returns a device dependent texture from a software surface (IImage) - virtual ITexture* createDeviceDependentTexture(IImage* surface, const io::path& name, void* mipmapData) _IRR_OVERRIDE_; + virtual ITexture* createDeviceDependentTexture(IImage* surface, const io::path& name) _IRR_OVERRIDE_; //! returns a device dependent texture from a software surface (IImage) virtual ITexture* createDeviceDependentTextureCube(const io::path& name, IImage* posXImage, IImage* negXImage, @@ -371,6 +354,9 @@ namespace video void loadShaderData(const io::path& vertexShaderName, const io::path& fragmentShaderName, c8** vertexShaderData, c8** fragmentShaderData); + COGLES2CacheHandler* CacheHandler; + COGLES2Renderer2D* MaterialRenderer2D; + core::stringw Name; core::matrix4 Matrices[ETS_COUNT]; @@ -390,8 +376,6 @@ namespace video irr::io::path OGLES2ShaderPath; SMaterial Material, LastMaterial; - COGLES2Texture* RenderTargetTexture; - core::array DepthTextures; struct SUserClipPlane { @@ -410,6 +394,8 @@ namespace video //! Color buffer format ECOLOR_FORMAT ColorFormat; + SIrrlichtCreationParameters Params; + //! All the lights that have been requested; a hardware limited //! number of them will be used at once. struct RequestedLight @@ -423,10 +409,6 @@ namespace video core::array RequestedLights; - COGLES2Renderer2D* MaterialRenderer2D; - - COGLES2CallBridge* BridgeCalls; - #if defined(_IRR_COMPILE_WITH_IPHONE_DEVICE_) CIrrDeviceIPhone* Device; GLuint ViewFramebuffer; @@ -437,95 +419,6 @@ namespace video #endif }; - //! This bridge between Irrlicht pseudo OpenGL calls - //! and true OpenGL calls. - - class COGLES2CallBridge - { - public: - COGLES2CallBridge(COGLES2Driver* driver); - - // Reset to default state. - - void reset(); - - // Blending calls. - - void setBlendEquation(GLenum mode); - - void setBlendFunc(GLenum source, GLenum destination); - - void setBlendFuncSeparate(GLenum sourceRGB, GLenum destinationRGB, GLenum sourceAlpha, GLenum destinationAlpha); - - void setBlend(bool enable); - - // Color Mask. - - void setColorMask(bool red, bool green, bool blue, bool alpha); - - // Cull face calls. - - void setCullFaceFunc(GLenum mode); - - void setCullFace(bool enable); - - // Depth calls. - - void setDepthFunc(GLenum mode); - - void setDepthMask(bool enable); - - void setDepthTest(bool enable); - - // Program calls. - - void setProgram(GLuint program); - - // Texture calls. - - GLuint getActiveTexture() const; - - void setActiveTexture(GLuint id); - - void getTexture(GLenum& type, GLuint& name) const; - - COGLES2Texture* getTexture() const; - - void setTexture(COGLES2Texture* texture); - - // Viewport calls. - - const core::rect& getViewport() const; - - void setViewport(const core::rect& viewport); - - private: - COGLES2Driver* Driver; - - GLenum BlendEquation; - GLenum BlendSourceRGB; - GLenum BlendDestinationRGB; - GLenum BlendSourceAlpha; - GLenum BlendDestinationAlpha; - bool Blend; - - bool ColorMask[4]; - - GLenum CullFaceMode; - bool CullFace; - - GLenum DepthFunc; - bool DepthMask; - bool DepthTest; - - GLuint Program; - - GLuint ActiveTextureID; - COGLES2Texture* Texture[MATERIAL_MAX_TEXTURES]; - - core::rect Viewport; - }; - } // end namespace video } // end namespace irr diff --git a/source/Irrlicht/COGLES2ExtensionHandler.cpp b/source/Irrlicht/COGLES2ExtensionHandler.cpp index 907502e2..c7a3ae77 100644 --- a/source/Irrlicht/COGLES2ExtensionHandler.cpp +++ b/source/Irrlicht/COGLES2ExtensionHandler.cpp @@ -1,6 +1,5 @@ +// Copyright (C) 2015 Patryk Nadrowski // Copyright (C) 2009-2010 Amundis -// Heavily based on the OpenGL driver implemented by Nikolaus Gebhardt -// and OpenGL ES driver implemented by Christian Stehno // This file is part of the "Irrlicht Engine". // For conditions of distribution and use, see copyright notice in Irrlicht.h @@ -160,8 +159,7 @@ namespace video COGLES2ExtensionHandler::COGLES2ExtensionHandler() : - Version(0), MaxTextureUnits(0), MaxSupportedTextures(0), - MaxAnisotropy(1), MaxIndices(0xffff), + Version(0), MaxAnisotropy(1), MaxIndices(0xffff), MaxTextureSize(1), MaxTextureLODBias(0.f), StencilBuffer(false) { @@ -177,7 +175,7 @@ namespace video } - void COGLES2ExtensionHandler::initExtensions(COGLES2Driver* driver, bool withStencil) + void COGLES2ExtensionHandler::initExtensions() { const core::stringc stringVer(glGetString(GL_VERSION)); const f32 ogl_ver = core::fast_atof(stringVer.c_str() + 10); @@ -220,7 +218,7 @@ namespace video GLint val=0; glGetIntegerv(GL_MAX_TEXTURE_IMAGE_UNITS, &val); - MaxSupportedTextures = core::min_(MATERIAL_MAX_TEXTURES, static_cast(val)); + Feature.TextureUnit = static_cast(val); #ifdef GL_EXT_texture_filter_anisotropic if (FeatureAvailable[IRR_EXT_texture_filter_anisotropic]) @@ -242,7 +240,13 @@ namespace video glGetFloatv(GL_ALIASED_LINE_WIDTH_RANGE, DimAliasedLine); glGetFloatv(GL_ALIASED_POINT_SIZE_RANGE, DimAliasedPoint); - MaxTextureUnits = core::min_(MaxSupportedTextures, static_cast(MATERIAL_MAX_TEXTURES)); + Feature.TextureUnit = core::min_(Feature.TextureUnit, static_cast(MATERIAL_MAX_TEXTURES)); + Feature.ColorAttachment = 1; + } + + const COGLCoreFeature& COGLES2ExtensionHandler::getFeature() const + { + return Feature; } } // end namespace video diff --git a/source/Irrlicht/COGLES2ExtensionHandler.h b/source/Irrlicht/COGLES2ExtensionHandler.h index 4d09e6f5..122ca73f 100644 --- a/source/Irrlicht/COGLES2ExtensionHandler.h +++ b/source/Irrlicht/COGLES2ExtensionHandler.h @@ -1,6 +1,5 @@ +// Copyright (C) 2015 Patryk Nadrowski // Copyright (C) 2009-2010 Amundis -// Heavily based on the OpenGL driver implemented by Nikolaus Gebhardt -// and OpenGL ES driver implemented by Christian Stehno // This file is part of the "Irrlicht Engine". // For conditions of distribution and use, see copyright notice in Irrlicht.h @@ -11,34 +10,17 @@ #ifdef _IRR_COMPILE_WITH_OGLES2_ -#if defined(_IRR_COMPILE_WITH_X11_DEVICE_) || defined(_IRR_WINDOWS_API_) || defined(_IRR_COMPILE_WITH_ANDROID_DEVICE_) -#include "CEGLManager.h" -#elif defined(_IRR_COMPILE_WITH_IPHONE_DEVICE_) -#include "iOS/CIrrDeviceiOS.h" -#endif - -#if defined(_IRR_COMPILE_WITH_IPHONE_DEVICE_) -#include -#include -#elif defined(_IRR_COMPILE_WITH_ANDROID_DEVICE_) -#include -#include -#else -#include -typedef char GLchar; -#if defined(_IRR_OGLES2_USE_EXTPOINTER_) -#include "gles2-ext.h" -#endif -#endif - -#include "os.h" #include "EDriverFeatures.h" +#include "irrTypes.h" +#include "os.h" +#include "COGLES2Common.h" +#include "COGLCoreFeature.h" namespace irr { namespace video { - class COGLES2Driver; + class COGLES2ExtensionHandler { public: @@ -184,16 +166,12 @@ namespace video IRR_OGLES2_Feature_Count }; - //! queries the features of the driver, returns true if feature is available - bool queryOpenGLFeature(EOGLES2Features feature) const - { - return FeatureAvailable[feature]; - } - - - protected: COGLES2ExtensionHandler(); + void initExtensions(); + + const COGLCoreFeature& getFeature() const; + bool queryFeature(video::E_VIDEO_DRIVER_FEATURE feature) const { switch (feature) @@ -248,14 +226,144 @@ namespace video }; } + bool queryOpenGLFeature(EOGLES2Features feature) const + { + return FeatureAvailable[feature]; + } + void dump() const; - void initExtensions(COGLES2Driver* driver, bool withStencil); + inline void irrGlActiveTexture(GLenum texture) + { + glActiveTexture(texture); + } + + inline void irrGlCompressedTexImage2D(GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLint border, + GLsizei imageSize, const void* data) + { + glCompressedTexImage2D(target, level, internalformat, width, height, border, imageSize, data); + } + + inline void irrGlCompressedTexSubImage2D(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, + GLenum format, GLsizei imageSize, const void* data) + { + glCompressedTexSubImage2D(target, level, xoffset, yoffset, width, height, format, imageSize, data); + } + + inline void irrGlUseProgram(GLuint prog) + { + glUseProgram(prog); + } + + inline void irrGlBindFramebuffer(GLenum target, GLuint framebuffer) + { + glBindFramebuffer(target, framebuffer); + } + + inline void irrGlDeleteFramebuffers(GLsizei n, const GLuint *framebuffers) + { + glDeleteFramebuffers(n, framebuffers); + } + + inline void irrGlGenFramebuffers(GLsizei n, GLuint *framebuffers) + { + glGenFramebuffers(n, framebuffers); + } + + inline GLenum irrGlCheckFramebufferStatus(GLenum target) + { + return glCheckFramebufferStatus(target); + } + + inline void irrGlFramebufferTexture2D(GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level) + { + glFramebufferTexture2D(target, attachment, textarget, texture, level); + } + + inline void irrGlBindRenderbuffer(GLenum target, GLuint renderbuffer) + { + glBindRenderbuffer(target, renderbuffer); + } + + inline void irrGlDeleteRenderbuffers(GLsizei n, const GLuint *renderbuffers) + { + glDeleteRenderbuffers(n, renderbuffers); + } + + inline void irrGlGenRenderbuffers(GLsizei n, GLuint *renderbuffers) + { + glGenRenderbuffers(n, renderbuffers); + } + + inline void irrGlRenderbufferStorage(GLenum target, GLenum internalformat, GLsizei width, GLsizei height) + { + glRenderbufferStorage(target, internalformat, width, height); + } + + inline void irrGlFramebufferRenderbuffer(GLenum target, GLenum attachment, GLenum renderbuffertarget, GLuint renderbuffer) + { + glFramebufferRenderbuffer(target, attachment, renderbuffertarget, renderbuffer); + } + + inline void irrGlGenerateMipmap(GLenum target) + { + glGenerateMipmap(target); + } + + inline void irrGlActiveStencilFace(GLenum face) + { + } + + inline void irrGlDrawBuffer(GLenum mode) + { + } + + inline void irrGlDrawBuffers(GLsizei n, const GLenum *bufs) + { + } + + inline void irrGlBlendFuncSeparate(GLenum sfactorRGB, GLenum dfactorRGB, GLenum sfactorAlpha, GLenum dfactorAlpha) + { + glBlendFuncSeparate(sfactorRGB, dfactorRGB, sfactorAlpha, dfactorAlpha); + } + + inline void irrGlBlendEquation(GLenum mode) + { + glBlendEquation(mode); + } + + inline void irrGlEnableIndexed(GLenum target, GLuint index) + { + } + + inline void irrGlDisableIndexed(GLenum target, GLuint index) + { + } + + inline void irrGlColorMaskIndexed(GLuint buf, GLboolean r, GLboolean g, GLboolean b, GLboolean a) + { + } + + inline void irrGlBlendFuncIndexed(GLuint buf, GLenum src, GLenum dst) + { + } + + inline void irrGlBlendFuncSeparateIndexed(GLuint buf, GLenum srcRGB, GLenum dstRGB, GLenum srcAlpha, GLenum dstAlpha) + { + } + + inline void irrGlBlendEquationIndexed(GLuint buf, GLenum mode) + { + } + + inline void irrGlBlendEquationSeparateIndexed(GLuint buf, GLenum modeRGB, GLenum modeAlpha) + { + } protected: + COGLCoreFeature Feature; + u16 Version; - u8 MaxTextureUnits; - u8 MaxSupportedTextures; u8 MaxAnisotropy; u32 MaxIndices; u32 MaxTextureSize; @@ -268,10 +376,8 @@ namespace video bool FeatureAvailable[IRR_OGLES2_Feature_Count]; }; -} // end namespace video -} // end namespace irr +} +} - -#endif // _IRR_COMPILE_WITH_OGLES2_ #endif - +#endif diff --git a/source/Irrlicht/COGLES2MaterialRenderer.cpp b/source/Irrlicht/COGLES2MaterialRenderer.cpp index f033a7b9..ab28138f 100644 --- a/source/Irrlicht/COGLES2MaterialRenderer.cpp +++ b/source/Irrlicht/COGLES2MaterialRenderer.cpp @@ -3,8 +3,14 @@ // For conditions of distribution and use, see copyright notice in irrlicht.h #include "IrrCompileConfig.h" + #ifdef _IRR_COMPILE_WITH_OGLES2_ +#include "COGLES2Common.h" + +#include "COGLCoreTexture.h" +#include "COGLCoreCacheHandler.h" + #include "COGLES2MaterialRenderer.h" #include "IGPUProgrammingServices.h" #include "IShaderConstantSetCallBack.h" @@ -161,21 +167,21 @@ void COGLES2MaterialRenderer::OnSetMaterial(const video::SMaterial& material, bool resetAllRenderstates, video::IMaterialRendererServices* services) { - COGLES2CallBridge* bridgeCalls = Driver->getBridgeCalls(); + COGLES2CacheHandler* cacheHandler = Driver->getCacheHandler(); - bridgeCalls->setProgram(Program); + cacheHandler->setProgram(Program); Driver->setBasicRenderStates(material, lastMaterial, resetAllRenderstates); if (Alpha) { - bridgeCalls->setBlend(true); - bridgeCalls->setBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA); + cacheHandler->setBlend(true); + cacheHandler->setBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA); } else if (FixedBlending) { - bridgeCalls->setBlendFunc(GL_ONE, GL_ONE_MINUS_SRC_COLOR); - bridgeCalls->setBlend(true); + cacheHandler->setBlendFunc(GL_ONE, GL_ONE_MINUS_SRC_COLOR); + cacheHandler->setBlend(true); } else if (Blending) { @@ -184,10 +190,10 @@ void COGLES2MaterialRenderer::OnSetMaterial(const video::SMaterial& material, u32 alphaSource; unpack_textureBlendFuncSeparate(srcRGBFact, dstRGBFact, srcAlphaFact, dstAlphaFact, modulate, alphaSource, material.MaterialTypeParam); - bridgeCalls->setBlendFuncSeparate(Driver->getGLBlend(srcRGBFact), Driver->getGLBlend(dstRGBFact), + cacheHandler->setBlendFuncSeparate(Driver->getGLBlend(srcRGBFact), Driver->getGLBlend(dstRGBFact), Driver->getGLBlend(srcAlphaFact), Driver->getGLBlend(dstAlphaFact)); - bridgeCalls->setBlend(true); + cacheHandler->setBlend(true); } if (CallBack) diff --git a/source/Irrlicht/COGLES2Renderer2D.cpp b/source/Irrlicht/COGLES2Renderer2D.cpp index 5513b8f7..24970c6e 100644 --- a/source/Irrlicht/COGLES2Renderer2D.cpp +++ b/source/Irrlicht/COGLES2Renderer2D.cpp @@ -6,6 +6,11 @@ #ifdef _IRR_COMPILE_WITH_OGLES2_ +#include "COGLES2Common.h" + +#include "COGLCoreTexture.h" +#include "COGLCoreCacheHandler.h" + #include "COGLES2Renderer2D.h" #include "IGPUProgrammingServices.h" #include "os.h" @@ -27,7 +32,9 @@ COGLES2Renderer2D::COGLES2Renderer2D(const c8* vertexShaderProgram, const c8* pi init(Temp, vertexShaderProgram, pixelShaderProgram, false); - Driver->getBridgeCalls()->setProgram(Program); + COGLES2CacheHandler* cacheHandler = Driver->getCacheHandler(); + + cacheHandler->setProgram(Program); // These states don't change later. @@ -38,7 +45,7 @@ COGLES2Renderer2D::COGLES2Renderer2D(const c8* vertexShaderProgram, const c8* pi s32 TextureUnit = 0; setPixelShaderConstant(TextureUnitID, &TextureUnit, 1); - Driver->getBridgeCalls()->setProgram(0); + cacheHandler->setProgram(0); } COGLES2Renderer2D::~COGLES2Renderer2D() @@ -50,7 +57,7 @@ void COGLES2Renderer2D::OnSetMaterial(const video::SMaterial& material, bool resetAllRenderstates, video::IMaterialRendererServices* services) { - Driver->getBridgeCalls()->setProgram(Program); + Driver->getCacheHandler()->setProgram(Program); Driver->setBasicRenderStates(material, lastMaterial, resetAllRenderstates); f32 Thickness = (material.Thickness > 0.f) ? material.Thickness : 1.f; diff --git a/source/Irrlicht/COGLES2Texture.cpp b/source/Irrlicht/COGLES2Texture.cpp deleted file mode 100644 index 035118a1..00000000 --- a/source/Irrlicht/COGLES2Texture.cpp +++ /dev/null @@ -1,1281 +0,0 @@ -// Copyright (C) 2014 Patryk Nadrowski -// This file is part of the "Irrlicht Engine". -// For conditions of distribution and use, see copyright notice in Irrlicht.h - -#include "IrrCompileConfig.h" - -#ifdef _IRR_COMPILE_WITH_OGLES2_ - -#include "irrTypes.h" -#include "COGLES2Texture.h" -#include "COGLES2Driver.h" -#include "os.h" -#include "CImage.h" -#include "CColorConverter.h" -#include "irrString.h" -#include "EVertexAttributes.h" - -#if !defined(_IRR_COMPILE_WITH_IPHONE_DEVICE_) -#include -#include -#include -#endif - -namespace -{ -#ifndef GL_BGRA -// we need to do this for the IMG_BGRA8888 extension -int GL_BGRA=GL_RGBA; -#endif -} - -namespace irr -{ -namespace video -{ - -//! constructor for usual textures -COGLES2Texture::COGLES2Texture(IImage* origImage, const io::path& name, void* mipmapData, COGLES2Driver* driver) - : ITexture(name, ETT_2D), Pitch(0), ColorFormat(ECF_A8R8G8B8), Driver(driver), Image(0), MipImage(0), - TextureName(0), TextureType(GL_TEXTURE_2D), InternalFormat(GL_RGBA), PixelFormat(GL_RGBA), - PixelType(GL_UNSIGNED_BYTE), MipLevelStored(0), - IsRenderTarget(false), IsCompressed(false), AutomaticMipmapUpdate(false), - ReadOnlyLock(false), KeepImage(true), LockImage(0) -{ - #ifdef _DEBUG - setDebugName("COGLES2Texture"); - #endif - -#ifndef GL_BGRA - // whoa, pretty badly implemented extension... - if (Driver->FeatureAvailable[COGLES2ExtensionHandler::IRR_IMG_texture_format_BGRA8888] || - Driver->FeatureAvailable[COGLES2ExtensionHandler::IRR_EXT_texture_format_BGRA8888] || - Driver->FeatureAvailable[COGLES2ExtensionHandler::IRR_APPLE_texture_format_BGRA8888]) - GL_BGRA = 0x80E1; - else - GL_BGRA = GL_RGBA; -#endif - - HasMipMaps = Driver->getTextureCreationFlag(ETCF_CREATE_MIP_MAPS); - getImageValues(origImage); - - if (IsCompressed) - { - Image.push_back(origImage); - Image[0]->grab(); - KeepImage = false; - } - else if (ImageSize==TextureSize) - { - Image.push_back(Driver->createImage(ColorFormat, ImageSize)); - origImage->copyTo(Image[0]); - } - else - { - Image.push_back(Driver->createImage(ColorFormat, TextureSize)); - origImage->copyToScaling(Image[0]); - } - - Pitch = Image[0]->getPitch(); - - glGenTextures(1, &TextureName); - uploadTexture(true, 0, true, mipmapData); - - if ( KeepImage ) - { - KeepImage = Driver->getTextureCreationFlag(ETCF_ALLOW_MEMORY_COPY); - if ( KeepImage ) - { - LockImage = Image[0]; - LockImage->grab(); - } - } - - Image[0]->drop(); - Image.clear(); -} - - -//! constructor for cube textures -COGLES2Texture::COGLES2Texture(const io::path& name, IImage* posXImage, IImage* negXImage, IImage* posYImage, - IImage* negYImage, IImage* posZImage, IImage* negZImage, COGLES2Driver* driver) - : ITexture(name, ETT_CUBE), Pitch(0), ColorFormat(ECF_A8R8G8B8), Driver(driver), Image(0), MipImage(0), - TextureName(0), TextureType(GL_TEXTURE_CUBE_MAP), InternalFormat(GL_RGBA), PixelFormat(GL_RGBA), - PixelType(GL_UNSIGNED_BYTE), MipLevelStored(0), IsRenderTarget(false), IsCompressed(false), - AutomaticMipmapUpdate(false), ReadOnlyLock(false), KeepImage(false), LockImage(0) -{ - #ifdef _DEBUG - setDebugName("COpenGLTexture"); - #endif - -#ifndef GL_BGRA - // whoa, pretty badly implemented extension... - if (Driver->FeatureAvailable[COGLES2ExtensionHandler::IRR_IMG_texture_format_BGRA8888] || - Driver->FeatureAvailable[COGLES2ExtensionHandler::IRR_EXT_texture_format_BGRA8888] || - Driver->FeatureAvailable[COGLES2ExtensionHandler::IRR_APPLE_texture_format_BGRA8888]) - GL_BGRA = 0x80E1; - else - GL_BGRA = GL_RGBA; -#endif - - HasMipMaps = Driver->getTextureCreationFlag(ETCF_CREATE_MIP_MAPS); - getImageValues(posXImage); - - if (IsCompressed) - { - Image.push_back(posXImage); - Image.push_back(negXImage); - Image.push_back(posYImage); - Image.push_back(negYImage); - Image.push_back(posZImage); - Image.push_back(negZImage); - - for (u32 i = 0; i < 6; ++i) - Image[i]->grab(); - } - else if (ImageSize==TextureSize) - { - for (u32 i = 0; i < 6; ++i) - Image.push_back(Driver->createImage(ColorFormat, ImageSize)); - - posXImage->copyTo(Image[0]); - negXImage->copyTo(Image[1]); - posYImage->copyTo(Image[2]); - negYImage->copyTo(Image[3]); - posZImage->copyTo(Image[4]); - negZImage->copyTo(Image[5]); - } - else - { - for (u32 i = 0; i < 6; ++i) - Image.push_back(Driver->createImage(ColorFormat, ImageSize)); - - posXImage->copyToScaling(Image[0]); - negXImage->copyToScaling(Image[1]); - posYImage->copyToScaling(Image[2]); - negYImage->copyToScaling(Image[3]); - posZImage->copyToScaling(Image[4]); - negZImage->copyToScaling(Image[5]); - } - - Pitch = Image[0]->getPitch(); - - glGenTextures(1, &TextureName); - - for (u32 i = 0; i < 5; ++i) - uploadTexture(true, i, false); - - uploadTexture(true, 5, true); - - for (u32 i = 0; i < Image.size(); ++i) - Image[i]->drop(); - - Image.clear(); -} - - -//! constructor for basic setup (only for derived classes) -COGLES2Texture::COGLES2Texture(const io::path& name, COGLES2Driver* driver) - : ITexture(name, ETT_2D), Pitch(0), ColorFormat(ECF_A8R8G8B8), Driver(driver), Image(0), MipImage(0), - TextureName(0), TextureType(GL_TEXTURE_2D), InternalFormat(GL_RGBA), PixelFormat(GL_RGBA), - PixelType(GL_UNSIGNED_BYTE), MipLevelStored(0), HasMipMaps(true), - IsRenderTarget(false), IsCompressed(false), AutomaticMipmapUpdate(false), - ReadOnlyLock(false), KeepImage(false), LockImage(0) -{ - #ifdef _DEBUG - setDebugName("COGLES2Texture"); - #endif -} - - -//! destructor -COGLES2Texture::~COGLES2Texture() -{ - if (TextureName) - glDeleteTextures(1, &TextureName); - - if (LockImage) - LockImage->drop(); -} - - -//! Choose best matching color format, based on texture creation flags -ECOLOR_FORMAT COGLES2Texture::getBestColorFormat(ECOLOR_FORMAT format) -{ - ECOLOR_FORMAT destFormat = ECF_A8R8G8B8; - - if (!IImage::isCompressedFormat(format)) - { - switch (format) - { - case ECF_A1R5G5B5: - if (!Driver->getTextureCreationFlag(ETCF_ALWAYS_32_BIT)) - destFormat = ECF_A1R5G5B5; - break; - case ECF_R5G6B5: - if (!Driver->getTextureCreationFlag(ETCF_ALWAYS_32_BIT)) - destFormat = ECF_A1R5G5B5; - break; - case ECF_A8R8G8B8: - if (Driver->getTextureCreationFlag(ETCF_ALWAYS_16_BIT) || - Driver->getTextureCreationFlag(ETCF_OPTIMIZED_FOR_SPEED)) - destFormat = ECF_A1R5G5B5; - break; - case ECF_R8G8B8: - if (Driver->getTextureCreationFlag(ETCF_ALWAYS_16_BIT) || - Driver->getTextureCreationFlag(ETCF_OPTIMIZED_FOR_SPEED)) - destFormat = ECF_A1R5G5B5; - break; - default: - break; - } - } - else - destFormat = format; - - if (Driver->getTextureCreationFlag(ETCF_NO_ALPHA_CHANNEL)) - { - switch (destFormat) - { - case ECF_A1R5G5B5: - destFormat = ECF_R5G6B5; - break; - case ECF_A8R8G8B8: - destFormat = ECF_R8G8B8; - break; - default: - break; - } - } - - return destFormat; -} - - -//! Get the OpenGL color format parameters based on the given Irrlicht color format -void COGLES2Texture::getFormatParameters(ECOLOR_FORMAT format, GLint& internalFormat, GLint& filtering, - GLenum& pixelFormat, GLenum& type, void(*&convert)(const void*, s32, void*)) -{ - switch(format) - { - case ECF_A1R5G5B5: - internalFormat = GL_RGBA; - filtering = GL_LINEAR; - pixelFormat = GL_RGBA; - type = GL_UNSIGNED_SHORT_5_5_5_1; - convert = CColorConverter::convert_A1R5G5B5toR5G5B5A1; - break; - case ECF_R5G6B5: - internalFormat = GL_RGB; - filtering = GL_LINEAR; - pixelFormat = GL_RGB; - type = GL_UNSIGNED_SHORT_5_6_5; - break; - case ECF_R8G8B8: - internalFormat = GL_RGB; - filtering = GL_LINEAR; - pixelFormat = GL_RGB; - type = GL_UNSIGNED_BYTE; - break; - case ECF_A8R8G8B8: - filtering = GL_LINEAR; - type = GL_UNSIGNED_BYTE; - if (!Driver->queryOpenGLFeature(COGLES2ExtensionHandler::IRR_IMG_texture_format_BGRA8888) && - !Driver->queryOpenGLFeature(COGLES2ExtensionHandler::IRR_EXT_texture_format_BGRA8888) && - !Driver->queryOpenGLFeature(COGLES2ExtensionHandler::IRR_APPLE_texture_format_BGRA8888)) - { - internalFormat = GL_RGBA; - pixelFormat = GL_RGBA; - convert = CColorConverter::convert_A8R8G8B8toA8B8G8R8; - } - else - { - internalFormat = GL_BGRA; - pixelFormat = GL_BGRA; - } - break; -#ifdef GL_EXT_texture_compression_s3tc - case ECF_DXT1: - internalFormat = GL_COMPRESSED_RGBA_S3TC_DXT1_EXT; - filtering = GL_LINEAR; - pixelFormat = GL_BGRA; - type = GL_COMPRESSED_RGBA_S3TC_DXT1_EXT; - break; -#endif -#ifdef GL_EXT_texture_compression_s3tc - case ECF_DXT2: - case ECF_DXT3: - internalFormat = GL_COMPRESSED_RGBA_S3TC_DXT3_EXT; - filtering = GL_LINEAR; - pixelFormat = GL_BGRA; - type = GL_COMPRESSED_RGBA_S3TC_DXT3_EXT; - break; -#endif -#ifdef GL_EXT_texture_compression_s3tc - case ECF_DXT4: - case ECF_DXT5: - internalFormat = GL_COMPRESSED_RGBA_S3TC_DXT5_EXT; - filtering = GL_LINEAR; - pixelFormat = GL_BGRA; - type = GL_COMPRESSED_RGBA_S3TC_DXT5_EXT; - break; -#endif -#ifdef GL_IMG_texture_compression_pvrtc - case ECF_PVRTC_RGB2: - internalFormat = GL_COMPRESSED_RGB_PVRTC_2BPPV1_IMG; - filtering = GL_LINEAR; - pixelFormat = GL_RGB; - type = GL_COMPRESSED_RGB_PVRTC_2BPPV1_IMG; - break; -#endif -#ifdef GL_IMG_texture_compression_pvrtc - case ECF_PVRTC_ARGB2: - internalFormat = GL_COMPRESSED_RGBA_PVRTC_2BPPV1_IMG; - filtering = GL_LINEAR; - pixelFormat = GL_RGBA; - type = GL_COMPRESSED_RGBA_PVRTC_2BPPV1_IMG; - break; -#endif -#ifdef GL_IMG_texture_compression_pvrtc - case ECF_PVRTC_RGB4: - internalFormat = GL_COMPRESSED_RGB_PVRTC_4BPPV1_IMG; - filtering = GL_LINEAR; - pixelFormat = GL_RGB; - type = GL_COMPRESSED_RGB_PVRTC_4BPPV1_IMG; - break; -#endif -#ifdef GL_IMG_texture_compression_pvrtc - case ECF_PVRTC_ARGB4: - internalFormat = GL_COMPRESSED_RGBA_PVRTC_4BPPV1_IMG; - filtering = GL_LINEAR; - pixelFormat = GL_RGBA; - type = GL_COMPRESSED_RGBA_PVRTC_4BPPV1_IMG; - break; -#endif -#ifdef GL_IMG_texture_compression_pvrtc2 - case ECF_PVRTC2_ARGB2: - internalFormat = GL_COMPRESSED_RGBA_PVRTC_2BPPV2_IMG; - filtering = GL_LINEAR; - pixelFormat = GL_RGBA; - type = GL_COMPRESSED_RGBA_PVRTC_2BPPV2_IMG; - break; -#endif -#ifdef GL_IMG_texture_compression_pvrtc2 - case ECF_PVRTC2_ARGB4: - internalFormat = GL_COMPRESSED_RGBA_PVRTC_4BPPV2_IMG; - filtering = GL_LINEAR; - pixelFormat = GL_RGBA; - type = GL_COMPRESSED_RGBA_PVRTC_4BPPV2_IMG; - break; -#endif -#ifdef GL_OES_compressed_ETC1_RGB8_texture - case ECF_ETC1: - internalFormat = GL_ETC1_RGB8_OES; - filtering = GL_LINEAR; - pixelFormat = GL_RGB; - type = GL_ETC1_RGB8_OES; - break; -#endif -#ifdef GL_ES_VERSION_3_0 // TO-DO - fix when extension name will be available - case ECF_ETC2_RGB: - internalFormat = GL_COMPRESSED_RGB8_ETC2; - filtering = GL_LINEAR; - pixelFormat = GL_RGB; - type = GL_COMPRESSED_RGB8_ETC2; - break; -#endif -#ifdef GL_ES_VERSION_3_0 // TO-DO - fix when extension name will be available - case ECF_ETC2_ARGB: - internalFormat = GL_COMPRESSED_RGBA8_ETC2_EAC; - filtering = GL_LINEAR; - pixelFormat = GL_RGBA; - type = GL_COMPRESSED_RGBA8_ETC2_EAC; - break; -#endif - default: - os::Printer::log("Unsupported texture format", ELL_ERROR); - break; - } - - // Hack for iPhone SDK, which requires a different InternalFormat -#ifdef _IRR_IPHONE_PLATFORM_ - if (internalFormat == GL_BGRA) - internalFormat = GL_RGBA; -#endif -} - - -// prepare values ImageSize, TextureSize, and ColorFormat based on image -void COGLES2Texture::getImageValues(IImage* image) -{ - if (!image) - { - os::Printer::log("No image for OpenGL ES2 texture.", ELL_ERROR); - return; - } - - ImageSize = image->getDimension(); - - if ( !ImageSize.Width || !ImageSize.Height) - { - os::Printer::log("Invalid size of image for OpenGL ES2 Texture.", ELL_ERROR); - return; - } - - const f32 ratio = (f32)ImageSize.Width/(f32)ImageSize.Height; - if ((ImageSize.Width>Driver->MaxTextureSize) && (ratio >= 1.0f)) - { - ImageSize.Width = Driver->MaxTextureSize; - ImageSize.Height = (u32)(Driver->MaxTextureSize/ratio); - } - else if (ImageSize.Height>Driver->MaxTextureSize) - { - ImageSize.Height = Driver->MaxTextureSize; - ImageSize.Width = (u32)(Driver->MaxTextureSize*ratio); - } - TextureSize=ImageSize.getOptimalSize(false); - - ColorFormat = getBestColorFormat(image->getColorFormat()); - - IsCompressed = IImage::isCompressedFormat(image->getColorFormat()); -} - - -//! copies the the texture into an open gl texture. -void COGLES2Texture::uploadTexture(bool newTexture, u32 imageNumber, bool regMipmap, void* mipmapData, u32 level) -{ - // check which image needs to be uploaded - IImage* image = LockImage?LockImage:level?MipImage:Image[imageNumber]; - - if (!image) - { - os::Printer::log("No image for OpenGL ES2 texture to upload", ELL_ERROR); - return; - } - - // get correct opengl color data values - GLint oldInternalFormat = InternalFormat; - GLint filtering = GL_LINEAR; - void(*convert)(const void*, s32, void*) = 0; - getFormatParameters(ColorFormat, InternalFormat, filtering, PixelFormat, PixelType, convert); - - // make sure we don't change the internal format of existing images - if (!newTexture) - InternalFormat = oldInternalFormat; - - GLenum origTextureType = GL_TEXTURE_2D; - GLuint origTextureName = 0; - - Driver->getBridgeCalls()->setActiveTexture(0); - Driver->getBridgeCalls()->getTexture(origTextureType, origTextureName); - - glBindTexture(TextureType, TextureName); - -#ifdef _DEBUG - if (Driver->testGLError()) - os::Printer::log("Could not bind Texture", ELL_ERROR); -#endif - - // mipmap handling for main texture - if (!level && newTexture) - { - // auto generate if possible and no mipmap data is given - if (!IsCompressed && HasMipMaps && !mipmapData && Driver->queryFeature(EVDF_MIP_MAP_AUTO_UPDATE) && regMipmap) - { - if (Driver->getTextureCreationFlag(ETCF_OPTIMIZED_FOR_SPEED)) - glHint(GL_GENERATE_MIPMAP_HINT, GL_FASTEST); - else if (Driver->getTextureCreationFlag(ETCF_OPTIMIZED_FOR_QUALITY)) - glHint(GL_GENERATE_MIPMAP_HINT, GL_NICEST); - else - glHint(GL_GENERATE_MIPMAP_HINT, GL_DONT_CARE); - - AutomaticMipmapUpdate=true; - } - - // enable bilinear filter without mipmaps - if (filtering == GL_LINEAR) - StatesCache.BilinearFilter = true; - else - StatesCache.BilinearFilter = false; - - StatesCache.TrilinearFilter = false; - StatesCache.MipMapStatus = false; - - glTexParameteri(TextureType, GL_TEXTURE_MIN_FILTER, filtering); - glTexParameteri(TextureType, GL_TEXTURE_MAG_FILTER, filtering); - } - - // get texture type - - GLenum tmpTextureType = GL_TEXTURE_2D; - - if (TextureType == GL_TEXTURE_CUBE_MAP) - { - switch(imageNumber) - { - case 0: - tmpTextureType = GL_TEXTURE_CUBE_MAP_POSITIVE_X; - break; - case 1: - tmpTextureType = GL_TEXTURE_CUBE_MAP_NEGATIVE_X; - break; - case 2: - tmpTextureType = GL_TEXTURE_CUBE_MAP_POSITIVE_Y; - break; - case 3: - tmpTextureType = GL_TEXTURE_CUBE_MAP_NEGATIVE_Y; - break; - case 4: - tmpTextureType = GL_TEXTURE_CUBE_MAP_POSITIVE_Z; - break; - case 5: - tmpTextureType = GL_TEXTURE_CUBE_MAP_NEGATIVE_Z; - break; - default: - break; - } - } - - // now get image data and upload to GPU - - u32 compressedImageSize = IImage::getCompressedImageSize(ColorFormat, image->getDimension().Width, image->getDimension().Height); - - void* source = image->lock(); - - IImage* tmpImage = 0; - - if (convert) - { - tmpImage = new CImage(image->getColorFormat(), image->getDimension()); - void* dest = tmpImage->lock(); - convert(source, image->getDimension().getArea(), dest); - image->unlock(); - source = dest; - } - - if (newTexture) - { - if (IsCompressed) - { - glCompressedTexImage2D(tmpTextureType, 0, InternalFormat, image->getDimension().Width, - image->getDimension().Height, 0, compressedImageSize, source); - } - else - glTexImage2D(tmpTextureType, level, InternalFormat, image->getDimension().Width, - image->getDimension().Height, 0, PixelFormat, PixelType, source); - } - else - { - if (IsCompressed) - { - glCompressedTexSubImage2D(tmpTextureType, 0, 0, 0, image->getDimension().Width, - image->getDimension().Height, PixelFormat, compressedImageSize, source); - } - else - glTexSubImage2D(tmpTextureType, level, 0, 0, image->getDimension().Width, - image->getDimension().Height, PixelFormat, PixelType, source); - } - - if (convert) - { - tmpImage->unlock(); - tmpImage->drop(); - } - else - image->unlock(); - - if (!level && newTexture && regMipmap) - { - if (IsCompressed && !mipmapData) - { - if (image->hasMipMaps()) - mipmapData = static_cast(image->lock())+compressedImageSize; - else - HasMipMaps = false; - } - - regenerateMipMapLevels(mipmapData); - - if (HasMipMaps) // might have changed in regenerateMipMapLevels - { - // enable bilinear mipmap filter - GLint filteringMipMaps = GL_LINEAR_MIPMAP_NEAREST; - - if (filtering == GL_LINEAR) - StatesCache.BilinearFilter = true; - else - { - StatesCache.BilinearFilter = false; - filteringMipMaps = GL_NEAREST_MIPMAP_NEAREST; - } - - StatesCache.TrilinearFilter = false; - StatesCache.MipMapStatus = false; - - glTexParameteri(TextureType, GL_TEXTURE_MIN_FILTER, filteringMipMaps); - glTexParameteri(TextureType, GL_TEXTURE_MAG_FILTER, filtering); - } - } - -#ifdef _DEBUG - if (Driver->testGLError()) - os::Printer::log("Could not glTexImage2D", ELL_ERROR); -#endif - - glBindTexture(origTextureType, origTextureName); -} - - -//! lock function -void* COGLES2Texture::lock(E_TEXTURE_LOCK_MODE mode, u32 mipmapLevel) -{ - if (IsCompressed || IsRenderTarget || Type != ETT_2D || mipmapLevel > 0) // TO-DO - return 0; - - ReadOnlyLock |= (mode==ETLM_READ_ONLY); - MipLevelStored = mipmapLevel; - - if (LockImage) - return LockImage->lock(); - - IImage* tmpImage = 0; - - if (mipmapLevel) - { - u32 i=0; - u32 width = TextureSize.Width; - u32 height = TextureSize.Height; - - do - { - if (width>1) - width>>=1; - if (height>1) - height>>=1; - - ++i; - } - while (i != mipmapLevel); - - LockImage = Driver->createImage(ColorFormat, core::dimension2du(width,height)); - } - else - { - LockImage = Driver->createImage(ColorFormat, ImageSize); - } - - if (!LockImage) - return 0; - - tmpImage = Driver->createImage(ECF_A8R8G8B8, LockImage->getDimension()); - - u8* pPixels = static_cast(tmpImage->lock()); - - if (!pPixels) - return 0; - - // Prepare FBO and texture. - - const core::dimension2d imageSize = LockImage->getDimension(); - - COGLES2Texture* origRT = static_cast(Driver->getRenderTargetTexture()); - core::rect origViewport = Driver->getBridgeCalls()->getViewport(); - - GLenum origTextureType = GL_TEXTURE_2D; - GLuint origTextureName = 0; - - Driver->getBridgeCalls()->setActiveTexture(0); - Driver->getBridgeCalls()->getTexture(origTextureType, origTextureName); - - GLuint tmpTexture = 0; - glGenTextures(1, &tmpTexture); - glBindTexture(GL_TEXTURE_2D, tmpTexture); - glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR); - glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE); - glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE); - glTexImage2D(GL_TEXTURE_2D, 0, PixelFormat, ImageSize.Width, ImageSize.Height, 0, PixelFormat, PixelType, 0); - glBindTexture(origTextureType, origTextureName); - - GLuint tmpFBO = 0; - glGenFramebuffers(1, &tmpFBO); - glBindFramebuffer(GL_FRAMEBUFFER, tmpFBO); - glFramebufferTexture2D(GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, GL_TEXTURE_2D, tmpTexture, 0); - - Driver->getBridgeCalls()->setViewport(core::rect(0, 0, imageSize.Width, imageSize.Height)); - - // Draw 2D image. - - Driver->chooseMaterial2D(); - Driver->Material.TextureLayer[0].Texture = this; - Driver->Material.TextureLayer[0].TextureWrapU = ETC_CLAMP_TO_EDGE; - Driver->Material.TextureLayer[0].TextureWrapV = ETC_CLAMP_TO_EDGE; - - Driver->setRenderStates2DMode(false, true, false); - - const core::vector3df normal(0.f, 0.f, 1.f); - const SColor color(255, 255, 255, 255); - - u16 indices[] = {0, 1, 2, 3}; - S3DVertex vertices[4]; - - vertices[0] = S3DVertex(-1.f, 1.f, 0.f, normal.X, normal.Y, normal.Z, color, 0.f, 1.f); - vertices[1] = S3DVertex(1.f, 1.f, 0.f, normal.X, normal.Y, normal.Z, color, 1.f, 1.f); - vertices[2] = S3DVertex(1.f, -1.f, 0.f, normal.X, normal.Y, normal.Z, color, 1.f, 0.f); - vertices[3] = S3DVertex(-1.f, -1.f, 0.f, normal.X, normal.Y, normal.Z, color, 0.f, 0.f); - - glEnableVertexAttribArray(EVA_POSITION); - glEnableVertexAttribArray(EVA_COLOR); - glEnableVertexAttribArray(EVA_TCOORD0); - glVertexAttribPointer(EVA_POSITION, 3, GL_FLOAT, false, sizeof(S3DVertex), &(static_cast(vertices))[0].Pos); - glVertexAttribPointer(EVA_COLOR, 4, GL_UNSIGNED_BYTE, true, sizeof(S3DVertex), &(static_cast(vertices))[0].Color); - glVertexAttribPointer(EVA_TCOORD0, 2, GL_FLOAT, false, sizeof(S3DVertex), &(static_cast(vertices))[0].TCoords); - glDrawElements(GL_TRIANGLE_FAN, 4, GL_UNSIGNED_SHORT, indices); - glDisableVertexAttribArray(EVA_TCOORD0); - glDisableVertexAttribArray(EVA_COLOR); - glDisableVertexAttribArray(EVA_POSITION); - - // Download data from FBO. - - glReadPixels(0, 0, imageSize.Width, imageSize.Height, GL_RGBA, GL_UNSIGNED_BYTE, pPixels); - -#ifdef _DEBUG - if (Driver->testGLError()) - os::Printer::log("Could not read pixels", ELL_ERROR); -#endif - - // Clean resources. - - glBindFramebuffer(GL_FRAMEBUFFER, 0); - glDeleteFramebuffers(1, &tmpFBO); - glDeleteTextures(1, &tmpTexture); - - Driver->getBridgeCalls()->setViewport(origViewport); - - if (origRT) - origRT->bindRTT(); - - tmpImage->unlock(); - - // convert from RGBA8. - - void* src = tmpImage->lock(); - void* dest = LockImage->lock(); - - bool passed = true; - - switch(ColorFormat) - { - case ECF_A1R5G5B5: - CColorConverter::convert_A8R8G8B8toA1B5G5R5(src, tmpImage->getDimension().getArea(), dest); - break; - case ECF_R5G6B5: - CColorConverter::convert_A8R8G8B8toR5G6B5(src, tmpImage->getDimension().getArea(), dest); - break; - case ECF_R8G8B8: - CColorConverter::convert_A8R8G8B8toB8G8R8(src, tmpImage->getDimension().getArea(), dest); - break; - case ECF_A8R8G8B8: - CColorConverter::convert_A8R8G8B8toA8B8G8R8(src, tmpImage->getDimension().getArea(), dest); - break; - default: - passed = false; - break; - } - - LockImage->unlock(); - tmpImage->unlock(); - - tmpImage->drop(); - - if (!passed) - { - LockImage->drop(); - LockImage = 0; - } - - return LockImage ? LockImage->lock() : 0; -} - - -//! unlock function -void COGLES2Texture::unlock() -{ - if (!LockImage) - return; - - LockImage->unlock(); - - if (!ReadOnlyLock) - uploadTexture(false, 0, true, 0, MipLevelStored); - - ReadOnlyLock = false; - - if ( !KeepImage ) - { - LockImage->drop(); - LockImage = 0; - } -} - - -//! Returns size of the original image. -const core::dimension2d& COGLES2Texture::getOriginalSize() const -{ - return ImageSize; -} - - -//! Returns size of the texture. -const core::dimension2d& COGLES2Texture::getSize() const -{ - return TextureSize; -} - - -//! returns driver type of texture, i.e. the driver, which created the texture -E_DRIVER_TYPE COGLES2Texture::getDriverType() const -{ - return EDT_OGLES2; -} - - -//! returns color format of texture -ECOLOR_FORMAT COGLES2Texture::getColorFormat() const -{ - return ColorFormat; -} - - -//! returns pitch of texture (in bytes) -u32 COGLES2Texture::getPitch() const -{ - return Pitch; -} - - -//! return open gl texture name -GLuint COGLES2Texture::getOpenGLTextureName() const -{ - return TextureName; -} - - -//! return open gl texture type -GLenum COGLES2Texture::getOpenGLTextureType() const -{ - return TextureType; -} - - -//! Returns whether this texture has mipmaps -bool COGLES2Texture::hasMipMaps() const -{ - return HasMipMaps; -} - - -//! Regenerates the mip map levels of the texture. Useful after locking and -//! modifying the texture -void COGLES2Texture::regenerateMipMapLevels(void* mipmapData) -{ - // texture require mipmaps? - if (!HasMipMaps) - return; - - // we don't use custom data for mipmaps. - if (!mipmapData) - { - // compressed textures require custom data for prepare mipmaps. - if (IsCompressed) - return; - - // hardware doesn't support generate mipmaps for certain texture but image data doesn't exist or is wrong. - if (!AutomaticMipmapUpdate && (Image.size() == 0 || (Image.size() > 0 && ((Image[0]->getDimension().Width==1) && (Image[0]->getDimension().Height==1))))) - return; - } - - // hardware moethods for generate mipmaps. - if (!mipmapData && AutomaticMipmapUpdate) - { - GLenum origTextureType = GL_TEXTURE_2D; - GLuint origTextureName = 0; - - Driver->getBridgeCalls()->setActiveTexture(0); - Driver->getBridgeCalls()->getTexture(origTextureType, origTextureName); - - glBindTexture(TextureType, TextureName); - glGenerateMipmap(TextureType); - - glBindTexture(origTextureType, origTextureName); - - return; - } - - // only 2D textures are supported in manual creation mipmaps process. - if (Type != ETT_2D) - return; - - GLenum origTextureType = GL_TEXTURE_2D; - GLuint origTextureName = 0; - - Driver->getBridgeCalls()->setActiveTexture(0); - Driver->getBridgeCalls()->getTexture(origTextureType, origTextureName); - - glBindTexture(TextureType, TextureName); - - // Manually create mipmaps or use prepared version - u32 compressedImageSize = 0; - u32 width=Image[0]->getDimension().Width; - u32 height=Image[0]->getDimension().Height; - u32 i=0; - u8* target = static_cast(mipmapData); - do - { - if (width>1) - width>>=1; - if (height>1) - height>>=1; - - ++i; - - if (!target) - target = new u8[width*height*Image[0]->getBytesPerPixel()]; - - // create scaled version if no mipdata available - if (!mipmapData) - Image[0]->copyToScaling(target, width, height, Image[0]->getColorFormat()); - - if (IsCompressed) - { - compressedImageSize = IImage::getCompressedImageSize(ColorFormat, width, height); - - glCompressedTexImage2D(TextureType, i, InternalFormat, width, - height, 0, compressedImageSize, target); - } - else - glTexImage2D(TextureType, i, InternalFormat, width, height, - 0, PixelFormat, PixelType, target); - - // get next prepared mipmap data if available - if (mipmapData) - { - if (IsCompressed) - mipmapData = static_cast(mipmapData)+compressedImageSize; - else - mipmapData = static_cast(mipmapData)+width*height*Image[0]->getBytesPerPixel(); - - target = static_cast(mipmapData); - } - } - while (width!=1 || height!=1); - // cleanup - if (!mipmapData) - delete [] target; - - glBindTexture(origTextureType, origTextureName); -} - - -bool COGLES2Texture::isRenderTarget() const -{ - return IsRenderTarget; -} - - -void COGLES2Texture::setIsRenderTarget(bool isTarget) -{ - IsRenderTarget = isTarget; -} - - -bool COGLES2Texture::isFrameBufferObject() const -{ - return false; -} - - -//! Bind Render Target Texture -void COGLES2Texture::bindRTT() -{ -} - - -//! Unbind Render Target Texture -void COGLES2Texture::unbindRTT() -{ -} - - -//! Get an access to texture states cache. -COGLES2Texture::SStatesCache& COGLES2Texture::getStatesCache() const -{ - return StatesCache; -} - - -/* FBO Textures */ - -// helper function for render to texture -static bool checkOGLES2FBOStatus(COGLES2Driver* Driver); - -//! RTT ColorFrameBuffer constructor -COGLES2FBOTexture::COGLES2FBOTexture(const core::dimension2d& size, - const io::path& name, COGLES2Driver* driver, - ECOLOR_FORMAT format) - : COGLES2Texture(name, driver), DepthTexture(0), ColorFrameBuffer(0) -{ - #ifdef _DEBUG - setDebugName("COGLES2Texture_FBO"); - #endif - - ImageSize = size; - TextureSize = size; - HasMipMaps = false; - IsRenderTarget = true; - ColorFormat = getBestColorFormat(format); - - switch (ColorFormat) - { - case ECF_A8R8G8B8: - InternalFormat = GL_RGBA; - PixelFormat = GL_RGBA; - PixelType = GL_UNSIGNED_BYTE; - break; - case ECF_R8G8B8: - InternalFormat = GL_RGB; - PixelFormat = GL_RGB; - PixelType = GL_UNSIGNED_BYTE; - break; - case ECF_A1R5G5B5: - InternalFormat = GL_RGBA; - PixelFormat = GL_RGBA; - PixelType = GL_UNSIGNED_SHORT_5_5_5_1; - break; - case ECF_R5G6B5: - InternalFormat = GL_RGB; - PixelFormat = GL_RGB; - PixelType = GL_UNSIGNED_SHORT_5_6_5; - break; - default: - os::Printer::log( "color format not handled", ELL_WARNING ); - break; - } - - // generate frame buffer - glGenFramebuffers(1, &ColorFrameBuffer); - bindRTT(); - - // generate color texture - glGenTextures(1, &TextureName); - - GLenum origTextureType = GL_TEXTURE_2D; - GLuint origTextureName = 0; - - Driver->getBridgeCalls()->setActiveTexture(0); - Driver->getBridgeCalls()->getTexture(origTextureType, origTextureName); - - glBindTexture(TextureType, TextureName); - - glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR); - glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE); - glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE); - - StatesCache.BilinearFilter = true; - StatesCache.WrapU = ETC_CLAMP_TO_EDGE; - StatesCache.WrapV = ETC_CLAMP_TO_EDGE; - - glTexImage2D(GL_TEXTURE_2D, 0, InternalFormat, ImageSize.Width, ImageSize.Height, 0, PixelFormat, PixelType, 0); - -#ifdef _DEBUG - Driver->testGLError(); -#endif - - // attach color texture to frame buffer - glFramebufferTexture2D(GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, GL_TEXTURE_2D, TextureName, 0); -#ifdef _DEBUG - checkOGLES2FBOStatus(Driver); -#endif - - glBindTexture(origTextureType, origTextureName); - - unbindRTT(); -} - - -//! destructor -COGLES2FBOTexture::~COGLES2FBOTexture() -{ - if (DepthTexture) - if (DepthTexture->drop()) - Driver->removeDepthTexture(DepthTexture); - if (ColorFrameBuffer) - glDeleteFramebuffers(1, &ColorFrameBuffer); -} - - -bool COGLES2FBOTexture::isFrameBufferObject() const -{ - return true; -} - - -//! Bind Render Target Texture -void COGLES2FBOTexture::bindRTT() -{ - if (ColorFrameBuffer != 0) - glBindFramebuffer(GL_FRAMEBUFFER, ColorFrameBuffer); -} - - -//! Unbind Render Target Texture -void COGLES2FBOTexture::unbindRTT() -{ - if (ColorFrameBuffer != 0) - glBindFramebuffer(GL_FRAMEBUFFER, 0); -} - - -/* FBO Depth Textures */ - -//! RTT DepthBuffer constructor -COGLES2FBODepthTexture::COGLES2FBODepthTexture( - const core::dimension2d& size, - const io::path& name, - COGLES2Driver* driver, - bool useStencil) - : COGLES2Texture(name, driver), DepthRenderBuffer(0), - StencilRenderBuffer(0), UseStencil(useStencil) -{ -#ifdef _DEBUG - setDebugName("COGLES2TextureFBO_Depth"); -#endif - - ImageSize = size; - TextureSize = size; - InternalFormat = GL_RGBA; - PixelFormat = GL_RGBA; - PixelType = GL_UNSIGNED_BYTE; - HasMipMaps = false; - - if (useStencil) - { - glGenRenderbuffers(1, &DepthRenderBuffer); - glBindRenderbuffer(GL_RENDERBUFFER, DepthRenderBuffer); -#ifdef GL_OES_packed_depth_stencil - if (Driver->queryOpenGLFeature(COGLES2ExtensionHandler::IRR_OES_packed_depth_stencil)) - { - // generate packed depth stencil buffer - glRenderbufferStorage(GL_RENDERBUFFER, GL_DEPTH24_STENCIL8_OES, ImageSize.Width, ImageSize.Height); - StencilRenderBuffer = DepthRenderBuffer; // stencil is packed with depth - } - else // generate separate stencil and depth textures -#endif - { - glRenderbufferStorage(GL_RENDERBUFFER, Driver->getZBufferBits(), ImageSize.Width, ImageSize.Height); - - glGenRenderbuffers(1, &StencilRenderBuffer); - glBindRenderbuffer(GL_RENDERBUFFER, StencilRenderBuffer); - glRenderbufferStorage(GL_RENDERBUFFER, GL_STENCIL_INDEX8, ImageSize.Width, ImageSize.Height); - } - } - else - { - // generate depth buffer - glGenRenderbuffers(1, &DepthRenderBuffer); - glBindRenderbuffer(GL_RENDERBUFFER, DepthRenderBuffer); - glRenderbufferStorage(GL_RENDERBUFFER, Driver->getZBufferBits(), ImageSize.Width, ImageSize.Height); - } -} - - -//! destructor -COGLES2FBODepthTexture::~COGLES2FBODepthTexture() -{ - if (DepthRenderBuffer) - glDeleteRenderbuffers(1, &DepthRenderBuffer); - - if (StencilRenderBuffer && StencilRenderBuffer != DepthRenderBuffer) - glDeleteRenderbuffers(1, &StencilRenderBuffer); -} - - -//combine depth texture and rtt -bool COGLES2FBODepthTexture::attach(ITexture* renderTex) -{ - if (!renderTex) - return false; - COGLES2FBOTexture* rtt = static_cast(renderTex); - rtt->bindRTT(); - - // attach stencil texture to stencil buffer - if (UseStencil) - glFramebufferRenderbuffer(GL_FRAMEBUFFER, GL_STENCIL_ATTACHMENT, GL_RENDERBUFFER, StencilRenderBuffer); - - // attach depth renderbuffer to depth buffer - glFramebufferRenderbuffer(GL_FRAMEBUFFER, GL_DEPTH_ATTACHMENT, GL_RENDERBUFFER, DepthRenderBuffer); - - // check the status - if (!checkOGLES2FBOStatus(Driver)) - { - os::Printer::log("FBO incomplete"); - return false; - } - rtt->DepthTexture=this; - grab(); // grab the depth buffer, not the RTT - rtt->unbindRTT(); - return true; -} - - -//! Bind Render Target Texture -void COGLES2FBODepthTexture::bindRTT() -{ -} - - -//! Unbind Render Target Texture -void COGLES2FBODepthTexture::unbindRTT() -{ -} - - -bool checkOGLES2FBOStatus(COGLES2Driver* Driver) -{ - GLenum status = glCheckFramebufferStatus(GL_FRAMEBUFFER); - - switch (status) - { - case GL_FRAMEBUFFER_COMPLETE: - return true; - - case GL_FRAMEBUFFER_INCOMPLETE_ATTACHMENT: - os::Printer::log("FBO has one or several incomplete image attachments", ELL_ERROR); - break; - - case GL_FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT: - os::Printer::log("FBO missing an image attachment", ELL_ERROR); - break; - - case GL_FRAMEBUFFER_INCOMPLETE_DIMENSIONS: - os::Printer::log("FBO has one or several image attachments with different dimensions", ELL_ERROR); - break; - - case GL_FRAMEBUFFER_UNSUPPORTED: - os::Printer::log("FBO format unsupported", ELL_ERROR); - break; - - default: - break; - } - - os::Printer::log("FBO error", ELL_ERROR); - - return false; -} - - -} // end namespace video -} // end namespace irr - -#endif // _IRR_COMPILE_WITH_OGLES2_ - diff --git a/source/Irrlicht/COGLES2Texture.h b/source/Irrlicht/COGLES2Texture.h deleted file mode 100644 index f02867a3..00000000 --- a/source/Irrlicht/COGLES2Texture.h +++ /dev/null @@ -1,223 +0,0 @@ -// Copyright (C) 2014 Patryk Nadrowski -// This file is part of the "Irrlicht Engine". -// For conditions of distribution and use, see copyright notice in Irrlicht.h - -#ifndef __C_OGLES2_TEXTURE_H_INCLUDED__ -#define __C_OGLES2_TEXTURE_H_INCLUDED__ - -#include "IrrCompileConfig.h" - -#ifdef _IRR_COMPILE_WITH_OGLES2_ - -#if defined(_IRR_COMPILE_WITH_IPHONE_DEVICE_) -#include -#else -#include -#endif - -#include "ITexture.h" -#include "IImage.h" -#include "SMaterialLayer.h" -#include "irrArray.h" - -namespace irr -{ -namespace video -{ - -class COGLES2Driver; - -//! OpenGL ES 2.0 texture. -class COGLES2Texture : public ITexture -{ -public: - - //! Cache structure. - struct SStatesCache - { - SStatesCache() : WrapU(ETC_REPEAT), WrapV(ETC_REPEAT), BilinearFilter(false), - TrilinearFilter(false), AnisotropicFilter(0), MipMapStatus(false), LODBias(0), IsCached(false) - { - } - - u8 WrapU; - u8 WrapV; - bool BilinearFilter; - bool TrilinearFilter; - u8 AnisotropicFilter; - bool MipMapStatus; - s8 LODBias; - - bool IsCached; - }; - - //! constructor - COGLES2Texture(IImage* surface, const io::path& name, void* mipmapData=0, COGLES2Driver* driver=0); - - //! constructor - COGLES2Texture(const io::path& name, IImage* posXImage, IImage* negXImage, IImage* posYImage, - IImage* negYImage, IImage* posZImage, IImage* negZImage, COGLES2Driver* driver=0); - - //! destructor - virtual ~COGLES2Texture(); - - //! lock function - virtual void* lock(E_TEXTURE_LOCK_MODE mode=ETLM_READ_WRITE, u32 mipmapLevel=0); - - //! unlock function - virtual void unlock(); - - //! Returns original size of the texture (image). - virtual const core::dimension2d& getOriginalSize() const; - - //! Returns size of the texture. - virtual const core::dimension2d& getSize() const; - - //! returns driver type of texture (=the driver, that created it) - virtual E_DRIVER_TYPE getDriverType() const; - - //! returns color format of texture - virtual ECOLOR_FORMAT getColorFormat() const; - - //! returns pitch of texture (in bytes) - virtual u32 getPitch() const; - - //! return open gl texture name - GLuint getOpenGLTextureName() const; - - //! return open gl texture type - GLenum getOpenGLTextureType() const; - - //! return whether this texture has mipmaps - virtual bool hasMipMaps() const; - - //! Regenerates the mip map levels of the texture. - /** Useful after locking and modifying the texture - \param mipmapData Pointer to raw mipmap data, including all necessary mip levels, in the same format as the main texture image. If not set the mipmaps are derived from the main image. */ - virtual void regenerateMipMapLevels(void* mipmapData=0); - - //! Is it a render target? - virtual bool isRenderTarget() const; - - //! Is it a FrameBufferObject? - virtual bool isFrameBufferObject() const; - - //! Bind RenderTargetTexture - virtual void bindRTT(); - - //! Unbind RenderTargetTexture - virtual void unbindRTT(); - - //! sets whether this texture is intended to be used as a render target. - void setIsRenderTarget(bool isTarget); - - //! Get an access to texture states cache. - SStatesCache& getStatesCache() const; - -protected: - - //! protected constructor with basic setup, no GL texture name created, for derived classes - COGLES2Texture(const io::path& name, COGLES2Driver* driver); - - //! get the desired color format based on texture creation flags and the input format. - ECOLOR_FORMAT getBestColorFormat(ECOLOR_FORMAT format); - - //! Get the OpenGL color format parameters based on the given Irrlicht color format - void getFormatParameters(ECOLOR_FORMAT format, GLint& internalFormat, GLint& filtering, - GLenum& pixelFormat, GLenum& type, void(*&convert)(const void*, s32, void*)); - - //! get important numbers of the image and hw texture - void getImageValues(IImage* image); - - //! copies the texture into an OpenGL texture. - /** \param newTexture True if method is called for a newly created texture for the first time. Otherwise call with false to improve memory handling. - \param imageNumber Inform which image should be used for upload. - \param regMipmap Inform if regenerate mipmap should be call. - \param mipmapData Pointer to raw mipmap data, including all necessary mip levels, in the same format as the main texture image. - \param mipLevel If set to non-zero, only that specific miplevel is updated, using the MipImage member. */ - void uploadTexture(bool newTexture=false, u32 imageNumber=0, bool regMipmap = false, void* mipmapData=0, u32 mipLevel=0); - - core::dimension2d ImageSize; - core::dimension2d TextureSize; - u32 Pitch; - ECOLOR_FORMAT ColorFormat; - COGLES2Driver* Driver; - core::array Image; - IImage* MipImage; - - GLuint TextureName; - GLenum TextureType; - GLint InternalFormat; - GLenum PixelFormat; - GLenum PixelType; - - u8 MipLevelStored; - bool HasMipMaps; - bool IsRenderTarget; - bool IsCompressed; - bool AutomaticMipmapUpdate; - bool ReadOnlyLock; - bool KeepImage; - IImage* LockImage; - - mutable SStatesCache StatesCache; -}; - -//! OpenGL ES 2.0 FBO texture. -class COGLES2FBOTexture : public COGLES2Texture -{ -public: - - //! FrameBufferObject constructor - COGLES2FBOTexture(const core::dimension2d& size, const io::path& name, - COGLES2Driver* driver = 0, const ECOLOR_FORMAT format = ECF_UNKNOWN); - - //! destructor - virtual ~COGLES2FBOTexture(); - - //! Is it a FrameBufferObject? - virtual bool isFrameBufferObject() const; - - //! Bind RenderTargetTexture - virtual void bindRTT(); - - //! Unbind RenderTargetTexture - virtual void unbindRTT(); - - ITexture* DepthTexture; -protected: - GLuint ColorFrameBuffer; -}; - - -//! OpenGL ES 2.0 FBO depth texture. -class COGLES2FBODepthTexture : public COGLES2Texture -{ -public: - //! FrameBufferObject depth constructor - COGLES2FBODepthTexture(const core::dimension2d& size, const io::path& name, COGLES2Driver* driver=0, bool useStencil=false); - - //! destructor - virtual ~COGLES2FBODepthTexture(); - - //! Bind RenderTargetTexture - virtual void bindRTT(); - - //! Unbind RenderTargetTexture - virtual void unbindRTT(); - - bool attach(ITexture*); - -protected: - GLuint DepthRenderBuffer; - GLuint StencilRenderBuffer; - bool UseStencil; -}; - - -} // end namespace video -} // end namespace irr - -#endif -#endif // _IRR_COMPILE_WITH_OGLES2_ - diff --git a/source/Irrlicht/COGLESCommon.h b/source/Irrlicht/COGLESCommon.h new file mode 100644 index 00000000..650442c5 --- /dev/null +++ b/source/Irrlicht/COGLESCommon.h @@ -0,0 +1,175 @@ +// Copyright (C) 2015 Patryk Nadrowski +// This file is part of the "Irrlicht Engine". +// For conditions of distribution and use, see copyright notice in irrlicht.h + +#ifndef __C_OGLES_COMMON_H_INCLUDED__ +#define __C_OGLES_COMMON_H_INCLUDED__ + +#include "IrrCompileConfig.h" + +#ifdef _IRR_COMPILE_WITH_OGLES1_ + +#if defined(_IRR_WINDOWS_API_) + #define WIN32_LEAN_AND_MEAN + #include + #if defined(_IRR_OPENGL_USE_EXTPOINTER_) + #define GL_GLEXT_LEGACY 1 + #endif + #include + #if defined(_IRR_OPENGL_USE_EXTPOINTER_) + #include "glext.h" + #endif + #include "wglext.h" + + #ifdef _MSC_VER + #pragma comment(lib, "OpenGL32.lib") + #endif + +#elif defined(_IRR_COMPILE_WITH_OSX_DEVICE_) + #if defined(_IRR_OPENGL_USE_EXTPOINTER_) + #define GL_GLEXT_LEGACY 1 + #endif + #include + #if defined(_IRR_OPENGL_USE_EXTPOINTER_) + #include "glext.h" + #endif +#elif defined(_IRR_COMPILE_WITH_SDL_DEVICE_) && !defined(_IRR_COMPILE_WITH_X11_DEVICE_) + #if defined(_IRR_OPENGL_USE_EXTPOINTER_) + #define GL_GLEXT_LEGACY 1 + #define GLX_GLXEXT_LEGACY 1 + #else + #define GL_GLEXT_PROTOTYPES 1 + #define GLX_GLXEXT_PROTOTYPES 1 + #endif + #define NO_SDL_GLEXT + #include + #include + #include "glext.h" +#else + #if defined(_IRR_OPENGL_USE_EXTPOINTER_) + #define GL_GLEXT_LEGACY 1 + #define GLX_GLXEXT_LEGACY 1 + #else + #define GL_GLEXT_PROTOTYPES 1 + #define GLX_GLXEXT_PROTOTYPES 1 + #endif + #include + #include + #if defined(_IRR_OPENGL_USE_EXTPOINTER_) + #include "glext.h" + #undef GLX_ARB_get_proc_address + #include "glxext.h" + #endif +#endif + +#ifndef GL_ARB_shader_objects +typedef char GLcharARB; +typedef unsigned int GLhandleARB; +#endif + +#ifndef GL_VERSION_2_0 +typedef char GLchar; +#endif + +// Blending definitions. + +#if !defined(GL_VERSION_1_4) +#if defined(GL_EXT_blend_subtract) || defined(GL_EXT_blend_minmax) || defined(GL_EXT_blend_logic_op) +#define GL_FUNC_ADD GL_FUNC_ADD_EXT +#else +#define GL_FUNC_ADD 0 +#endif +#endif + +// FBO definitions. + +#if !defined(GL_VERSION_3_0) && !defined(GL_ARB_framebuffer_object) +#ifdef GL_EXT_framebuffer_object +#define GL_FRAMEBUFFER GL_FRAMEBUFFER_EXT +#define GL_COLOR_ATTACHMENT0 GL_COLOR_ATTACHMENT0_EXT +#define GL_DEPTH_ATTACHMENT GL_DEPTH_ATTACHMENT_EXT +#define GL_STENCIL_ATTACHMENT GL_STENCIL_ATTACHMENT_EXT +#define GL_FRAMEBUFFER_COMPLETE GL_FRAMEBUFFER_COMPLETE_EXT +#define GL_FRAMEBUFFER_INCOMPLETE_READ_BUFFER GL_FRAMEBUFFER_INCOMPLETE_READ_BUFFER_EXT +#define GL_FRAMEBUFFER_INCOMPLETE_DRAW_BUFFER GL_FRAMEBUFFER_INCOMPLETE_DRAW_BUFFER_EXT +#define GL_FRAMEBUFFER_INCOMPLETE_ATTACHMENT GL_FRAMEBUFFER_INCOMPLETE_ATTACHMENT_EXT +#define GL_FRAMEBUFFER_INCOMPLETE_FORMATS GL_FRAMEBUFFER_INCOMPLETE_FORMATS_EXT +#define GL_FRAMEBUFFER_INCOMPLETE_DIMENSIONS GL_FRAMEBUFFER_INCOMPLETE_DIMENSIONS_EXT +#define GL_FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT GL_FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT_EXT +#define GL_FRAMEBUFFER_UNSUPPORTED GL_FRAMEBUFFER_UNSUPPORTED_EXT +#else +#define GL_FRAMEBUFFER 0 +#define GL_COLOR_ATTACHMENT0 0 +#define GL_DEPTH_ATTACHMENT 0 +#define GL_STENCIL_ATTACHMENT 0 +#define GL_FRAMEBUFFER_COMPLETE 0 +#define GL_FRAMEBUFFER_INCOMPLETE_READ_BUFFER 1 +#define GL_FRAMEBUFFER_INCOMPLETE_DRAW_BUFFER 2 +#define GL_FRAMEBUFFER_INCOMPLETE_ATTACHMENT 3 +#define GL_FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT 4 +#define GL_FRAMEBUFFER_UNSUPPORTED 5 +#endif +#endif + +#ifdef GL_EXT_framebuffer_object +#define GL_FRAMEBUFFER_INCOMPLETE_FORMATS GL_FRAMEBUFFER_INCOMPLETE_FORMATS_EXT +#define GL_FRAMEBUFFER_INCOMPLETE_DIMENSIONS GL_FRAMEBUFFER_INCOMPLETE_DIMENSIONS_EXT +#else +#define GL_FRAMEBUFFER_INCOMPLETE_FORMATS 6 +#define GL_FRAMEBUFFER_INCOMPLETE_DIMENSIONS 7 +#endif + +// MipMaps definitions. + +#if !defined(GL_VERSION_1_4) +#ifdef GL_SGIS_generate_mipmap +#define GL_GENERATE_MIPMAP GL_GENERATE_MIPMAP_SGIS +#define GL_GENERATE_MIPMAP_HINT GL_GENERATE_MIPMAP_HINT_SGIS +#else +#define GL_GENERATE_MIPMAP 0 +#define GL_GENERATE_MIPMAP_HINT 0 +#endif +#endif + +// Texture definitions. + +#if !defined(GL_VERSION_1_3) +#ifdef GL_ARB_multitexture +#define GL_TEXTURE0 GL_TEXTURE0_ARB +#else +#define GL_TEXTURE0 0 +#endif +#endif + +// Irrlicht's OpenGL version. + +#define IRR_OPENGL_VERSION 14 + +namespace irr +{ +namespace video +{ + + // Forward declarations. + + class COGLCoreFeature; + + template + class COGLCoreTexture; + + template + class COGLCoreRenderTarget; + + template + class COGLCoreCacheHandler; + + class COpenGLDriver; + typedef COGLCoreTexture COpenGLTexture; + typedef COGLCoreRenderTarget COpenGLRenderTarget; + class COpenGLCacheHandler; + +} +} + +#endif +#endif diff --git a/source/Irrlicht/COGLESTexture.cpp b/source/Irrlicht/COGLESTexture.cpp deleted file mode 100644 index 4a3e34ab..00000000 --- a/source/Irrlicht/COGLESTexture.cpp +++ /dev/null @@ -1,1030 +0,0 @@ -// Copyright (C) 2002-2008 Nikolaus Gebhardt -// This file is part of the "Irrlicht Engine". -// For conditions of distribution and use, see copyright notice in irrlicht.h - -#include "IrrCompileConfig.h" - -#ifdef _IRR_COMPILE_WITH_OGLES1_ - -#include "irrTypes.h" -#include "COGLESTexture.h" -#include "COGLESDriver.h" -#include "os.h" -#include "CImage.h" -#include "CColorConverter.h" - -#include "irrString.h" - -namespace -{ -#ifndef GL_BGRA -// we need to do this for the IMG_BGRA8888 extension -int GL_BGRA=GL_RGBA; -#endif -} - -namespace irr -{ -namespace video -{ - -//! constructor for usual textures -COGLES1Texture::COGLES1Texture(IImage* origImage, const io::path& name, COGLES1Driver* driver, void* mipmapData) - : ITexture(name), Driver(driver), Image(0), MipImage(0), - TextureName(0), InternalFormat(GL_RGBA), PixelFormat(GL_RGBA), - // TODO ogl-es - // PixelFormat(GL_BGRA), - PixelType(GL_UNSIGNED_BYTE), MipLevelStored(0), - HasMipMaps(true), IsRenderTarget(false), IsCompressed(false), AutomaticMipmapUpdate(false), - UseStencil(false), ReadOnlyLock(false), KeepImage(true) -{ - #ifdef _DEBUG - setDebugName("COGLES1Texture"); - #endif - -#ifndef GL_BGRA - // whoa, pretty badly implemented extension... - if (Driver->FeatureAvailable[COGLES1ExtensionHandler::IRR_IMG_texture_format_BGRA8888] || - Driver->FeatureAvailable[COGLES1ExtensionHandler::IRR_EXT_texture_format_BGRA8888] || - Driver->FeatureAvailable[COGLES1ExtensionHandler::IRR_APPLE_texture_format_BGRA8888]) - GL_BGRA = 0x80E1; - else - GL_BGRA = GL_RGBA; -#endif - - HasMipMaps = Driver->getTextureCreationFlag(ETCF_CREATE_MIP_MAPS); - getImageValues(origImage); - - if (IsCompressed) - { - Image = origImage; - Image->grab(); - KeepImage = false; - } - else if (ImageSize==TextureSize) - { - Image = Driver->createImage(ColorFormat, ImageSize); - origImage->copyTo(Image); - } - else - { - Image = Driver->createImage(ColorFormat, TextureSize); - origImage->copyToScaling(Image); - } - - glGenTextures(1, &TextureName); - uploadTexture(true, mipmapData); - - if (!KeepImage) - { - Image->drop(); - Image=0; - } -} - - -//! constructor for basic setup (only for derived classes) -COGLES1Texture::COGLES1Texture(const io::path& name, COGLES1Driver* driver) - : ITexture(name), Driver(driver), Image(0), MipImage(0), - TextureName(0), InternalFormat(GL_RGBA), PixelFormat(GL_RGBA), - PixelType(GL_UNSIGNED_BYTE), MipLevelStored(0), - HasMipMaps(true), IsRenderTarget(false), IsCompressed(false), AutomaticMipmapUpdate(false), - ReadOnlyLock(false), KeepImage(true) -{ - #ifdef _DEBUG - setDebugName("COGLES1Texture"); - #endif -} - - -//! destructor -COGLES1Texture::~COGLES1Texture() -{ - if (TextureName) - glDeleteTextures(1, &TextureName); - if (Image) - Image->drop(); -} - - -//! Choose best matching color format, based on texture creation flags -ECOLOR_FORMAT COGLES1Texture::getBestColorFormat(ECOLOR_FORMAT format) -{ - ECOLOR_FORMAT destFormat = ECF_A8R8G8B8; - - if (!IImage::isCompressedFormat(format)) - { - switch (format) - { - case ECF_A1R5G5B5: - if (!Driver->getTextureCreationFlag(ETCF_ALWAYS_32_BIT)) - destFormat = ECF_A1R5G5B5; - break; - case ECF_R5G6B5: - if (!Driver->getTextureCreationFlag(ETCF_ALWAYS_32_BIT)) - destFormat = ECF_A1R5G5B5; - break; - case ECF_A8R8G8B8: - if (Driver->getTextureCreationFlag(ETCF_ALWAYS_16_BIT) || - Driver->getTextureCreationFlag(ETCF_OPTIMIZED_FOR_SPEED)) - destFormat = ECF_A1R5G5B5; - break; - case ECF_R8G8B8: - if (Driver->getTextureCreationFlag(ETCF_ALWAYS_16_BIT) || - Driver->getTextureCreationFlag(ETCF_OPTIMIZED_FOR_SPEED)) - destFormat = ECF_A1R5G5B5; - break; - default: - break; - } - } - else - destFormat = format; - - if (Driver->getTextureCreationFlag(ETCF_NO_ALPHA_CHANNEL)) - { - switch (destFormat) - { - case ECF_A1R5G5B5: - destFormat = ECF_R5G6B5; - break; - case ECF_A8R8G8B8: - destFormat = ECF_R8G8B8; - break; - default: - break; - } - } - - return destFormat; -} - - -//! Get the OpenGL color format parameters based on the given Irrlicht color format -void COGLES1Texture::getFormatParameters(ECOLOR_FORMAT format, GLint& internalFormat, GLint& filtering, - GLenum& pixelFormat, GLenum& type, void(*&convert)(const void*, s32, void*)) -{ - switch(format) - { - case ECF_A1R5G5B5: - internalFormat = GL_RGBA; - filtering = GL_LINEAR; - pixelFormat = GL_RGBA; - type = GL_UNSIGNED_SHORT_5_5_5_1; - convert = CColorConverter::convert_A1R5G5B5toR5G5B5A1; - break; - case ECF_R5G6B5: - internalFormat = GL_RGB; - filtering = GL_LINEAR; - pixelFormat = GL_RGB; - type = GL_UNSIGNED_SHORT_5_6_5; - break; - case ECF_R8G8B8: - internalFormat = GL_RGB; - filtering = GL_LINEAR; - pixelFormat = GL_RGB; - type = GL_UNSIGNED_BYTE; - break; - case ECF_A8R8G8B8: - filtering = GL_LINEAR; - type = GL_UNSIGNED_BYTE; - if (!Driver->queryOpenGLFeature(COGLES1ExtensionHandler::IRR_IMG_texture_format_BGRA8888) && - !Driver->queryOpenGLFeature(COGLES1ExtensionHandler::IRR_EXT_texture_format_BGRA8888) && - !Driver->queryOpenGLFeature(COGLES1ExtensionHandler::IRR_APPLE_texture_format_BGRA8888)) - { - internalFormat = GL_RGBA; - pixelFormat = GL_RGBA; - convert = CColorConverter::convert_A8R8G8B8toA8B8G8R8; - } - else - { - internalFormat = GL_BGRA; - pixelFormat = GL_BGRA; - } - break; -#ifdef GL_EXT_texture_compression_s3tc - case ECF_DXT1: - internalFormat = GL_COMPRESSED_RGBA_S3TC_DXT1_EXT; - filtering = GL_LINEAR; - pixelFormat = GL_BGRA; - type = GL_COMPRESSED_RGBA_S3TC_DXT1_EXT; - break; -#endif -#ifdef GL_EXT_texture_compression_s3tc - case ECF_DXT2: - case ECF_DXT3: - internalFormat = GL_COMPRESSED_RGBA_S3TC_DXT3_EXT; - filtering = GL_LINEAR; - pixelFormat = GL_BGRA; - type = GL_COMPRESSED_RGBA_S3TC_DXT3_EXT; - break; -#endif -#ifdef GL_EXT_texture_compression_s3tc - case ECF_DXT4: - case ECF_DXT5: - internalFormat = GL_COMPRESSED_RGBA_S3TC_DXT5_EXT; - filtering = GL_LINEAR; - pixelFormat = GL_BGRA; - type = GL_COMPRESSED_RGBA_S3TC_DXT5_EXT; - break; -#endif -#ifdef GL_IMG_texture_compression_pvrtc - case ECF_PVRTC_RGB2: - internalFormat = GL_COMPRESSED_RGB_PVRTC_2BPPV1_IMG; - filtering = GL_LINEAR; - pixelFormat = GL_RGB; - type = GL_COMPRESSED_RGB_PVRTC_2BPPV1_IMG; - break; -#endif -#ifdef GL_IMG_texture_compression_pvrtc - case ECF_PVRTC_ARGB2: - internalFormat = GL_COMPRESSED_RGBA_PVRTC_2BPPV1_IMG; - filtering = GL_LINEAR; - pixelFormat = GL_RGBA; - type = GL_COMPRESSED_RGBA_PVRTC_2BPPV1_IMG; - break; -#endif -#ifdef GL_IMG_texture_compression_pvrtc - case ECF_PVRTC_RGB4: - internalFormat = GL_COMPRESSED_RGB_PVRTC_4BPPV1_IMG; - filtering = GL_LINEAR; - pixelFormat = GL_RGB; - type = GL_COMPRESSED_RGB_PVRTC_4BPPV1_IMG; - break; -#endif -#ifdef GL_IMG_texture_compression_pvrtc - case ECF_PVRTC_ARGB4: - internalFormat = GL_COMPRESSED_RGBA_PVRTC_4BPPV1_IMG; - filtering = GL_LINEAR; - pixelFormat = GL_RGBA; - type = GL_COMPRESSED_RGBA_PVRTC_4BPPV1_IMG; - break; -#endif -#ifdef GL_IMG_texture_compression_pvrtc2 - case ECF_PVRTC2_ARGB2: - internalFormat = GL_COMPRESSED_RGBA_PVRTC_2BPPV2_IMG; - filtering = GL_LINEAR; - pixelFormat = GL_RGBA; - type = GL_COMPRESSED_RGBA_PVRTC_2BPPV2_IMG; - break; -#endif -#ifdef GL_IMG_texture_compression_pvrtc2 - case ECF_PVRTC2_ARGB4: - internalFormat = GL_COMPRESSED_RGBA_PVRTC_4BPPV2_IMG; - filtering = GL_LINEAR; - pixelFormat = GL_RGBA; - type = GL_COMPRESSED_RGBA_PVRTC_4BPPV2_IMG; - break; -#endif -#ifdef GL_OES_compressed_ETC1_RGB8_texture - case ECF_ETC1: - internalFormat = GL_ETC1_RGB8_OES; - filtering = GL_LINEAR; - pixelFormat = GL_RGB; - type = GL_ETC1_RGB8_OES; - break; -#endif -#ifdef GL_ES_VERSION_3_0 // TO-DO - fix when extension name will be available - case ECF_ETC2_RGB: - internalFormat = GL_COMPRESSED_RGB8_ETC2; - filtering = GL_LINEAR; - pixelFormat = GL_RGB; - type = GL_COMPRESSED_RGB8_ETC2; - break; -#endif -#ifdef GL_ES_VERSION_3_0 // TO-DO - fix when extension name will be available - case ECF_ETC2_ARGB: - internalFormat = GL_COMPRESSED_RGBA8_ETC2_EAC; - filtering = GL_LINEAR; - pixelFormat = GL_RGBA; - type = GL_COMPRESSED_RGBA8_ETC2_EAC; - break; -#endif - default: - os::Printer::log("Unsupported texture format", ELL_ERROR); - break; - } - - // Hack for iPhone SDK, which requires a different InternalFormat -#ifdef _IRR_IPHONE_PLATFORM_ - if (internalFormat == GL_BGRA) - internalFormat = GL_RGBA; -#endif -} - - -void COGLES1Texture::getImageValues(IImage* image) -{ - if (!image) - { - os::Printer::log("No image for OpenGL ES1 texture.", ELL_ERROR); - return; - } - - ImageSize = image->getDimension(); - - if ( !ImageSize.Width || !ImageSize.Height) - { - os::Printer::log("Invalid size of image for OpenGL ES1 Texture.", ELL_ERROR); - return; - } - - const f32 ratio = (f32)ImageSize.Width/(f32)ImageSize.Height; - if ((ImageSize.Width>Driver->MaxTextureSize) && (ratio >= 1.0f)) - { - ImageSize.Width = Driver->MaxTextureSize; - ImageSize.Height = (u32)(Driver->MaxTextureSize/ratio); - } - else if (ImageSize.Height>Driver->MaxTextureSize) - { - ImageSize.Height = Driver->MaxTextureSize; - ImageSize.Width = (u32)(Driver->MaxTextureSize*ratio); - } - TextureSize=ImageSize.getOptimalSize(!Driver->queryFeature(EVDF_TEXTURE_NPOT)); - - ColorFormat = getBestColorFormat(image->getColorFormat()); - - IsCompressed = IImage::isCompressedFormat(image->getColorFormat()); -} - - -//! copies the the texture into an open gl texture. -void COGLES1Texture::uploadTexture(bool newTexture, void* mipmapData, u32 level) -{ - // check which image needs to be uploaded - IImage* image = level?MipImage:Image; - if (!image) - { - os::Printer::log("No image for OpenGL ES1 texture to upload", ELL_ERROR); - return; - } - - // get correct opengl color data values - GLint oldInternalFormat = InternalFormat; - GLint filtering = GL_LINEAR; - void(*convert)(const void*, s32, void*) = 0; - getFormatParameters(ColorFormat, InternalFormat, filtering, PixelFormat, PixelType, convert); - - // make sure we don't change the internal format of existing images - if (!newTexture) - InternalFormat = oldInternalFormat; - - Driver->setActiveTexture(0, this); - - if (Driver->testGLError()) - os::Printer::log("Could not bind Texture", ELL_ERROR); - - // mipmap handling for main texture - if (!level && newTexture) - { - // auto generate if possible and no mipmap data is given - if (!IsCompressed && HasMipMaps && !mipmapData && Driver->queryFeature(EVDF_MIP_MAP_AUTO_UPDATE)) - { - if (Driver->getTextureCreationFlag(ETCF_OPTIMIZED_FOR_SPEED)) - glHint(GL_GENERATE_MIPMAP_HINT, GL_FASTEST); - else if (Driver->getTextureCreationFlag(ETCF_OPTIMIZED_FOR_QUALITY)) - glHint(GL_GENERATE_MIPMAP_HINT, GL_NICEST); - else - glHint(GL_GENERATE_MIPMAP_HINT, GL_DONT_CARE); - - glTexParameteri(GL_TEXTURE_2D, GL_GENERATE_MIPMAP, GL_TRUE); - AutomaticMipmapUpdate=true; - } - - // enable bilinear filter without mipmaps - glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, filtering); - glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, filtering); - } - - // now get image data and upload to GPU - - u32 compressedImageSize = IImage::getCompressedImageSize(ColorFormat, image->getDimension().Width, image->getDimension().Height); - - void* source = image->lock(); - - IImage* tmpImage = 0; - - if (convert) - { - tmpImage = new CImage(image->getColorFormat(), image->getDimension()); - void* dest = tmpImage->lock(); - convert(source, image->getDimension().getArea(), dest); - image->unlock(); - source = dest; - } - - if (newTexture) - { - if (IsCompressed) - { - glCompressedTexImage2D(GL_TEXTURE_2D, 0, InternalFormat, image->getDimension().Width, - image->getDimension().Height, 0, compressedImageSize, source); - } - else - glTexImage2D(GL_TEXTURE_2D, level, InternalFormat, image->getDimension().Width, - image->getDimension().Height, 0, PixelFormat, PixelType, source); - } - else - { - if (IsCompressed) - { - glCompressedTexSubImage2D(GL_TEXTURE_2D, level, 0, 0, image->getDimension().Width, - image->getDimension().Height, PixelFormat, compressedImageSize, source); - } - else - glTexSubImage2D(GL_TEXTURE_2D, level, 0, 0, image->getDimension().Width, - image->getDimension().Height, PixelFormat, PixelType, source); - } - - if (convert) - { - tmpImage->unlock(); - tmpImage->drop(); - } - else - image->unlock(); - - if (!level && newTexture) - { - if (IsCompressed && !mipmapData) - { - if (image->hasMipMaps()) - mipmapData = static_cast(image->lock())+compressedImageSize; - else - HasMipMaps = false; - } - - regenerateMipMapLevels(mipmapData); - - if (HasMipMaps) // might have changed in regenerateMipMapLevels - { - // enable bilinear mipmap filter - GLint filteringMipMaps = GL_LINEAR_MIPMAP_NEAREST; - - if (filtering != GL_LINEAR) - filteringMipMaps = GL_NEAREST_MIPMAP_NEAREST; - - glTexParameteri( GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, filteringMipMaps); - glTexParameteri( GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, filtering); - } - } - - if (Driver->testGLError()) - os::Printer::log("Could not glTexImage2D", ELL_ERROR); -} - - -//! lock function -void* COGLES1Texture::lock(E_TEXTURE_LOCK_MODE mode, u32 mipmapLevel) -{ - if ( mipmapLevel > 0 ) // TODO: this does not yet seem to be supported for ES1, so quit. - return 0; - - // store info about which image is locked - IImage* image = (mipmapLevel==0)?Image:MipImage; - - ReadOnlyLock |= (mode==ETLM_READ_ONLY); - MipLevelStored = mipmapLevel; - - if (!Image) - Image = new CImage(ECF_A8R8G8B8, ImageSize); - if (IsRenderTarget) - { - u8* pPixels = static_cast(Image->lock()); - if (!pPixels) - { - return 0; - } - // we need to keep the correct texture bound... - GLint tmpTexture; - glGetIntegerv(GL_TEXTURE_BINDING_2D, &tmpTexture); - glBindTexture(GL_TEXTURE_2D, TextureName); - - // TODO ogl-es - // glGetTexImage(GL_TEXTURE_2D, 0, GL_BGRA, GL_UNSIGNED_BYTE, pPixels); - - // opengl images are horizontally flipped, so we have to fix that here. - const u32 pitch=Image->getPitch(); - u8* p2 = pPixels + (ImageSize.Height - 1) * pitch; - u8* tmpBuffer = new u8[pitch]; - for (u32 i=0; i < ImageSize.Height; i += 2) - { - memcpy(tmpBuffer, pPixels, pitch); - memcpy(pPixels, p2, pitch); - memcpy(p2, tmpBuffer, pitch); - pPixels += pitch; - p2 -= pitch; - } - delete [] tmpBuffer; - Image->unlock(); - - //reset old bound texture - glBindTexture(GL_TEXTURE_2D, tmpTexture); - } - return Image->lock(); -} - - -//! unlock function -void COGLES1Texture::unlock() -{ - if ( Image ) - { - Image->unlock(); - if (!ReadOnlyLock) - uploadTexture(false); - } - ReadOnlyLock = false; -} - - -//! Returns size of the original image. -const core::dimension2d& COGLES1Texture::getOriginalSize() const -{ - return ImageSize; -} - - -//! Returns size of the texture. -const core::dimension2d& COGLES1Texture::getSize() const -{ - if (Image) - return Image->getDimension(); - else - return ImageSize; -} - - -//! returns driver type of texture, i.e. the driver, which created the texture -E_DRIVER_TYPE COGLES1Texture::getDriverType() const -{ - return EDT_OGLES1; -} - - -//! returns color format of texture -ECOLOR_FORMAT COGLES1Texture::getColorFormat() const -{ - if (Image) - return Image->getColorFormat(); - else - return ECF_A8R8G8B8; -} - - -//! returns pitch of texture (in bytes) -u32 COGLES1Texture::getPitch() const -{ - if (Image) - return Image->getPitch(); - else - return 0; -} - - -//! return open gl texture name -GLuint COGLES1Texture::getOGLES1TextureName() const -{ - return TextureName; -} - - -//! Returns whether this texture has mipmaps -bool COGLES1Texture::hasMipMaps() const -{ - return HasMipMaps; -} - - -//! Regenerates the mip map levels of the texture. -void COGLES1Texture::regenerateMipMapLevels(void* mipmapData) -{ - // texture require mipmaps? - if (!HasMipMaps || AutomaticMipmapUpdate) - return; - - // we don't use custom data for mipmaps. - if (!mipmapData) - { - // compressed textures require custom data for prepare mipmaps. - if (IsCompressed) - return; - - // hardware doesn't support generate mipmaps for certain texture but image data doesn't exist or is wrong. - if (!Image || (Image && ((Image->getDimension().Width==1) && (Image->getDimension().Height==1)))) - return; - } - - // Manually create mipmaps or use prepared version - u32 compressedImageSize = 0; - u32 width=Image->getDimension().Width; - u32 height=Image->getDimension().Height; - u32 i=0; - u8* target = static_cast(mipmapData); - do - { - if (width>1) - width>>=1; - if (height>1) - height>>=1; - - ++i; - - if (!target) - target = new u8[width*height*Image->getBytesPerPixel()]; - - // create scaled version if no mipdata available - if (!mipmapData) - Image->copyToScaling(target, width, height, Image->getColorFormat()); - - if (IsCompressed) - { - compressedImageSize = IImage::getCompressedImageSize(ColorFormat, width, height); - - glCompressedTexImage2D(GL_TEXTURE_2D, i, InternalFormat, width, - height, 0, compressedImageSize, target); - } - else - glTexImage2D(GL_TEXTURE_2D, i, InternalFormat, width, height, - 0, PixelFormat, PixelType, target); - - // get next prepared mipmap data if available - if (mipmapData) - { - if (IsCompressed) - mipmapData = static_cast(mipmapData)+compressedImageSize; - else - mipmapData = static_cast(mipmapData)+width*height*Image->getBytesPerPixel(); - - target = static_cast(mipmapData); - } - } - while (width!=1 || height!=1); - // cleanup - if (!mipmapData) - delete [] target; -} - - -bool COGLES1Texture::isRenderTarget() const -{ - return IsRenderTarget; -} - - -bool COGLES1Texture::isFrameBufferObject() const -{ - return false; -} - - -void COGLES1Texture::setIsRenderTarget(bool isTarget) -{ - IsRenderTarget = isTarget; -} - - -//! Bind Render Target Texture -void COGLES1Texture::bindRTT() -{ - glViewport(0, 0, getSize().Width, getSize().Height); -} - - -//! Unbind Render Target Texture -void COGLES1Texture::unbindRTT() -{ - glBindTexture(GL_TEXTURE_2D, getOGLES1TextureName()); - - // Copy Our ViewPort To The Texture - glCopyTexSubImage2D(GL_TEXTURE_2D, 0, 0, 0, 0, 0, getSize().Width, getSize().Height); -} - -/* FBO Textures */ - -#ifdef GL_OES_framebuffer_object -// helper function for render to texture -static bool checkOGLES1FBOStatus(COGLES1Driver* Driver); -#endif - - -//! RTT ColorFrameBuffer constructor -COGLES1FBOTexture::COGLES1FBOTexture(const core::dimension2d& size, - const io::path& name, COGLES1Driver* driver, - ECOLOR_FORMAT format) - : COGLES1Texture(name, driver), DepthTexture(0), ColorFrameBuffer(0) -{ - #ifdef _DEBUG - setDebugName("COGLES1Texture_FBO"); - #endif - - ImageSize = size; - TextureSize = size; - HasMipMaps = false; - IsRenderTarget = true; - ColorFormat = getBestColorFormat(format); - - switch (ColorFormat) - { - case ECF_A8R8G8B8: - InternalFormat = GL_RGBA; - PixelFormat = GL_RGBA; - PixelType = GL_UNSIGNED_BYTE; - break; - case ECF_R8G8B8: - InternalFormat = GL_RGB; - PixelFormat = GL_RGB; - PixelType = GL_UNSIGNED_BYTE; - break; - case ECF_A1R5G5B5: - InternalFormat = GL_RGBA; - PixelFormat = GL_RGBA; - PixelType = GL_UNSIGNED_SHORT_5_5_5_1; - break; - case ECF_R5G6B5: - InternalFormat = GL_RGB; - PixelFormat = GL_RGB; - PixelType = GL_UNSIGNED_SHORT_5_6_5; - break; - default: - os::Printer::log( "color format not handled", ELL_WARNING ); - break; - } - -#ifdef GL_OES_framebuffer_object - // generate frame buffer - Driver->extGlGenFramebuffers(1, &ColorFrameBuffer); - bindRTT(); - - // generate color texture - glGenTextures(1, &TextureName); - glBindTexture(GL_TEXTURE_2D, TextureName); - glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR); - glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE); - glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE); - glTexImage2D(GL_TEXTURE_2D, 0, InternalFormat, ImageSize.Width, ImageSize.Height, 0, PixelFormat, PixelType, 0); - -#ifdef _DEBUG - Driver->testGLError(); -#endif - - // attach color texture to frame buffer - Driver->extGlFramebufferTexture2D(GL_FRAMEBUFFER_OES, GL_COLOR_ATTACHMENT0_OES, GL_TEXTURE_2D, TextureName, 0); -#ifdef _DEBUG - checkOGLES1FBOStatus(Driver); -#endif - - glBindTexture(GL_TEXTURE_2D, TextureName); - unbindRTT(); -#endif -} - - -//! destructor -COGLES1FBOTexture::~COGLES1FBOTexture() -{ - if (DepthTexture) - if (DepthTexture->drop()) - Driver->removeDepthTexture(DepthTexture); -#ifdef GL_OES_framebuffer_object - if (ColorFrameBuffer) - Driver->extGlDeleteFramebuffers(1, &ColorFrameBuffer); -#endif -} - - -bool COGLES1FBOTexture::isFrameBufferObject() const -{ - return true; -} - - -//! Bind Render Target Texture -void COGLES1FBOTexture::bindRTT() -{ -#ifdef GL_OES_framebuffer_object - if (ColorFrameBuffer != 0) - Driver->extGlBindFramebuffer(GL_FRAMEBUFFER_OES, ColorFrameBuffer); -#endif -} - - -//! Unbind Render Target Texture -void COGLES1FBOTexture::unbindRTT() -{ -#ifdef GL_OES_framebuffer_object - if (ColorFrameBuffer != 0) - Driver->extGlBindFramebuffer(GL_FRAMEBUFFER_OES, 0); -#endif -} - - -/* FBO Depth Textures */ - -//! RTT DepthBuffer constructor -COGLES1FBODepthTexture::COGLES1FBODepthTexture( - const core::dimension2d& size, - const io::path& name, - COGLES1Driver* driver, - bool useStencil) - : COGLES1Texture(name, driver), DepthRenderBuffer(0), - StencilRenderBuffer(0), UseStencil(useStencil) -{ -#ifdef _DEBUG - setDebugName("COGLES1TextureFBO_Depth"); -#endif - - ImageSize = size; - TextureSize = size; - InternalFormat = GL_RGBA; - PixelFormat = GL_RGBA; - PixelType = GL_UNSIGNED_BYTE; - HasMipMaps = false; - -#if defined(GL_OES_framebuffer_object) - GLenum internalFormatDepth = GL_DEPTH_COMPONENT16_OES; - -#if defined(GL_OES_depth24) - if (Driver->queryOpenGLFeature(COGLES1ExtensionHandler::IRR_OES_depth24)) - internalFormatDepth = GL_DEPTH_COMPONENT24_OES; -#endif - - bool stencilSupported = true; - GLenum internalFormatStencil = 0; - -#if defined(GL_OES_packed_depth_stencil) - if (Driver->queryOpenGLFeature(COGLES1ExtensionHandler::IRR_OES_packed_depth_stencil)) - internalFormatStencil = GL_DEPTH24_STENCIL8_OES; - else -#endif -#if defined(GL_OES_stencil8) - if (Driver->queryOpenGLFeature(COGLES1ExtensionHandler::IRR_OES_stencil8)) - internalFormatStencil = GL_OES_stencil8; - else -#endif -#if defined(GL_OES_stencil4) - if (Driver->queryOpenGLFeature(COGLES1ExtensionHandler::IRR_OES_stencil4)) - internalFormatStencil = GL_OES_stencil4; - else -#endif -#if defined(GL_OES_stencil1) - if (Driver->queryOpenGLFeature(COGLES1ExtensionHandler::IRR_OES_stencil1)) - internalFormatStencil = GL_OES_stencil1; - else -#endif - stencilSupported = false; - - if (useStencil && stencilSupported) - { - Driver->extGlGenRenderbuffers(1, &DepthRenderBuffer); - Driver->extGlBindRenderbuffer(GL_RENDERBUFFER_OES, DepthRenderBuffer); -#if defined(GL_OES_packed_depth_stencil) - if (Driver->queryOpenGLFeature(COGLES1ExtensionHandler::IRR_OES_packed_depth_stencil)) - { - // generate packed depth stencil buffer - Driver->extGlRenderbufferStorage(GL_RENDERBUFFER_OES, internalFormatStencil, ImageSize.Width, ImageSize.Height); - StencilRenderBuffer = DepthRenderBuffer; // stencil is packed with depth - } - else // generate separate stencil and depth textures -#endif - { - Driver->extGlRenderbufferStorage(GL_RENDERBUFFER_OES, internalFormatDepth, ImageSize.Width, ImageSize.Height); - - Driver->extGlGenRenderbuffers(1, &StencilRenderBuffer); - Driver->extGlBindRenderbuffer(GL_RENDERBUFFER_OES, StencilRenderBuffer); - Driver->extGlRenderbufferStorage(GL_RENDERBUFFER_OES, internalFormatStencil, ImageSize.Width, ImageSize.Height); - } - } - else - { - // generate depth buffer - Driver->extGlGenRenderbuffers(1, &DepthRenderBuffer); - Driver->extGlBindRenderbuffer(GL_RENDERBUFFER_OES, DepthRenderBuffer); - Driver->extGlRenderbufferStorage(GL_RENDERBUFFER_OES, internalFormatDepth, ImageSize.Width, ImageSize.Height); - } -#endif -} - - -//! destructor -COGLES1FBODepthTexture::~COGLES1FBODepthTexture() -{ -#ifdef GL_OES_framebuffer_object - if (DepthRenderBuffer) - Driver->extGlDeleteRenderbuffers(1, &DepthRenderBuffer); - - if (StencilRenderBuffer && StencilRenderBuffer != DepthRenderBuffer) - Driver->extGlDeleteRenderbuffers(1, &StencilRenderBuffer); -#endif -} - - -//combine depth texture and rtt -bool COGLES1FBODepthTexture::attach(ITexture* renderTex) -{ -#ifdef GL_OES_framebuffer_object - if (!renderTex) - return false; - COGLES1FBOTexture* rtt = static_cast(renderTex); - rtt->bindRTT(); - - // attach stencil texture to stencil buffer - if (UseStencil) - Driver->extGlFramebufferRenderbuffer(GL_FRAMEBUFFER_OES, GL_STENCIL_ATTACHMENT_OES, GL_RENDERBUFFER_OES, StencilRenderBuffer); - - // attach depth renderbuffer to depth buffer - Driver->extGlFramebufferRenderbuffer(GL_FRAMEBUFFER_OES, GL_DEPTH_ATTACHMENT_OES, GL_RENDERBUFFER_OES, DepthRenderBuffer); - - // check the status - if (!checkOGLES1FBOStatus(Driver)) - { - os::Printer::log("FBO incomplete"); - return false; - } - rtt->DepthTexture=this; - grab(); // grab the depth buffer, not the RTT - rtt->unbindRTT(); - return true; -#else - return false; -#endif -} - - -//! Bind Render Target Texture -void COGLES1FBODepthTexture::bindRTT() -{ -} - - -//! Unbind Render Target Texture -void COGLES1FBODepthTexture::unbindRTT() -{ -} - - -#ifdef GL_OES_framebuffer_object -bool checkOGLES1FBOStatus(COGLES1Driver* Driver) -{ - GLenum status = Driver->extGlCheckFramebufferStatus(GL_FRAMEBUFFER_OES); - - switch (status) - { - //Our FBO is perfect, return true - case GL_FRAMEBUFFER_COMPLETE_OES: - return true; - - case GL_FRAMEBUFFER_INCOMPLETE_ATTACHMENT_OES: - os::Printer::log("FBO has one or several incomplete image attachments", ELL_ERROR); - break; - - case GL_FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT_OES: - os::Printer::log("FBO missing an image attachment", ELL_ERROR); - break; - - case GL_FRAMEBUFFER_INCOMPLETE_DIMENSIONS_OES: - os::Printer::log("FBO has one or several image attachments with different dimensions", ELL_ERROR); - break; - - case GL_FRAMEBUFFER_INCOMPLETE_FORMATS_OES: - os::Printer::log("FBO has one or several image attachments with different internal formats", ELL_ERROR); - break; - -// not part of all implementations -#ifdef GL_FRAMEBUFFER_INCOMPLETE_DRAW_BUFFER_OES - case GL_FRAMEBUFFER_INCOMPLETE_DRAW_BUFFER_OES: - os::Printer::log("FBO has invalid draw buffer", ELL_ERROR); - break; -#endif - -// not part of all implementations -#ifdef GL_FRAMEBUFFER_INCOMPLETE_READ_BUFFER_OES - case GL_FRAMEBUFFER_INCOMPLETE_READ_BUFFER_OES: - os::Printer::log("FBO has invalid read buffer", ELL_ERROR); - break; -#endif - -// not part of fbo_object anymore, but won't harm as it is just a return value -#ifdef GL_FRAMEBUFFER_INCOMPLETE_DUPLICATE_ATTACHMENT_OES - case GL_FRAMEBUFFER_INCOMPLETE_DUPLICATE_ATTACHMENT_OES: - os::Printer::log("FBO has a duplicate image attachment", ELL_ERROR); - break; -#endif - - case GL_FRAMEBUFFER_UNSUPPORTED_OES: - os::Printer::log("FBO format unsupported", ELL_ERROR); - break; - - default: - break; - } - os::Printer::log("FBO error", ELL_ERROR); - return false; -} -#endif - -} // end namespace video -} // end namespace irr - -#endif // _IRR_COMPILE_WITH_OGLES1_ - diff --git a/source/Irrlicht/COGLESTexture.h b/source/Irrlicht/COGLESTexture.h deleted file mode 100644 index 2ff56fec..00000000 --- a/source/Irrlicht/COGLESTexture.h +++ /dev/null @@ -1,182 +0,0 @@ -// Copyright (C) 2002-2008 Nikolaus Gebhardt -// This file is part of the "Irrlicht Engine". -// For conditions of distribution and use, see copyright notice in irrlicht.h - -#ifndef __C_OGLES1_TEXTURE_H_INCLUDED__ -#define __C_OGLES1_TEXTURE_H_INCLUDED__ - -#include "ITexture.h" -#include "IImage.h" - -#include "IrrCompileConfig.h" -#if defined(_IRR_COMPILE_WITH_OGLES1_) - -#if defined(_IRR_COMPILE_WITH_IPHONE_DEVICE_) -#include -#include -#elif defined(_IRR_ANDROID_PLATFORM_) -#include -#include -#else -#include -#endif - -namespace irr -{ -namespace video -{ - -class COGLES1Driver; -//! OGLES1 texture. -class COGLES1Texture : public ITexture -{ -public: - - //! constructor - COGLES1Texture(IImage* surface, const io::path& name, COGLES1Driver* driver=0, void* mipmapData=0); - - //! destructor - virtual ~COGLES1Texture(); - - //! lock function - virtual void* lock(E_TEXTURE_LOCK_MODE mode=ETLM_READ_WRITE, u32 mipmapLevel=0); - - //! unlock function - virtual void unlock(); - - //! Returns original size of the texture (image). - virtual const core::dimension2d& getOriginalSize() const; - - //! Returns size of the texture. - virtual const core::dimension2d& getSize() const; - - //! returns driver type of texture (=the driver, that created it) - virtual E_DRIVER_TYPE getDriverType() const; - - //! returns color format of texture - virtual ECOLOR_FORMAT getColorFormat() const; - - //! returns pitch of texture (in bytes) - virtual u32 getPitch() const; - - //! return open gl texture name - GLuint getOGLES1TextureName() const; - - //! return whether this texture has mipmaps - virtual bool hasMipMaps() const; - - //! Regenerates the mip map levels of the texture. - virtual void regenerateMipMapLevels(void* mipmapData=0); - - //! Is it a render target? - virtual bool isRenderTarget() const; - - //! Is it a FrameBufferObject? - virtual bool isFrameBufferObject() const; - - //! Bind RenderTargetTexture - void bindRTT(); - - //! Unbind RenderTargetTexture - void unbindRTT(); - - //! sets whether this texture is intended to be used as a render target. - void setIsRenderTarget(bool isTarget); - -protected: - - //! protected constructor with basic setup, no GL texture name created, for derived classes - COGLES1Texture(const io::path& name, COGLES1Driver* driver); - - //! get the desired color format based on texture creation flags and the input format. - ECOLOR_FORMAT getBestColorFormat(ECOLOR_FORMAT format); - - //! Get the OpenGL color format parameters based on the given Irrlicht color format - void getFormatParameters(ECOLOR_FORMAT format, GLint& internalFormat, GLint& filtering, - GLenum& pixelFormat, GLenum& type, void(*&convert)(const void*, s32, void*)); - - //! convert the image into an internal image with better properties for this driver. - void getImageValues(IImage* image); - - //! copies the the texture into an open gl texture. - void uploadTexture(bool newTexture=true, void* mipmapData=0, u32 mipLevel=0); - - core::dimension2d ImageSize; - core::dimension2d TextureSize; - ECOLOR_FORMAT ColorFormat; - COGLES1Driver* Driver; - IImage* Image; - IImage* MipImage; - - GLuint TextureName; - GLint InternalFormat; - GLenum PixelFormat; - GLenum PixelType; - u32 MipLevelStored; - - bool HasMipMaps; - bool IsRenderTarget; - bool IsCompressed; - bool AutomaticMipmapUpdate; - bool UseStencil; - bool ReadOnlyLock; - bool KeepImage; -}; - - -//! OGLES1 FBO texture. -class COGLES1FBOTexture : public COGLES1Texture -{ -public: - - //! FrameBufferObject constructor - COGLES1FBOTexture(const core::dimension2d& size, const io::path& name, COGLES1Driver* driver=0, ECOLOR_FORMAT format = ECF_UNKNOWN); - - //! destructor - virtual ~COGLES1FBOTexture(); - - //! Is it a FrameBufferObject? - virtual bool isFrameBufferObject() const; - - //! Bind RenderTargetTexture - virtual void bindRTT(); - - //! Unbind RenderTargetTexture - virtual void unbindRTT(); - - ITexture* DepthTexture; -protected: - GLuint ColorFrameBuffer; -}; - - -//! OGLES1 FBO depth texture. -class COGLES1FBODepthTexture : public COGLES1Texture -{ -public: - //! FrameBufferObject depth constructor - COGLES1FBODepthTexture(const core::dimension2d& size, const io::path& name, COGLES1Driver* driver=0, bool useStencil=false); - - //! destructor - virtual ~COGLES1FBODepthTexture(); - - //! Bind RenderTargetTexture - virtual void bindRTT(); - - //! Unbind RenderTargetTexture - virtual void unbindRTT(); - - bool attach(ITexture*); - -protected: - GLuint DepthRenderBuffer; - GLuint StencilRenderBuffer; - bool UseStencil; -}; - - -} // end namespace video -} // end namespace irr - -#endif -#endif // _IRR_COMPILE_WITH_OGLES1_ diff --git a/source/Irrlicht/COpenGLCacheHandler.cpp b/source/Irrlicht/COpenGLCacheHandler.cpp new file mode 100644 index 00000000..5d257934 --- /dev/null +++ b/source/Irrlicht/COpenGLCacheHandler.cpp @@ -0,0 +1,133 @@ +// Copyright (C) 2015 Patryk Nadrowski +// This file is part of the "Irrlicht Engine". +// For conditions of distribution and use, see copyright notice in Irrlicht.h + +#include "COpenGLCacheHandler.h" + +#ifdef _IRR_COMPILE_WITH_OPENGL_ + +#include "COpenGLDriver.h" + +namespace irr +{ +namespace video +{ + +/* COpenGLCacheHandler */ + +COpenGLCacheHandler::COpenGLCacheHandler(COpenGLDriver* driver) : + COGLCoreCacheHandler(driver), AlphaMode(GL_ALWAYS), AlphaRef(0.f), AlphaTest(false), + MatrixMode(GL_MODELVIEW), ClientActiveTexture(GL_TEXTURE0), ClientStateVertex(false), + ClientStateNormal(false), ClientStateColor(false), ClientStateTexCoord0(false) +{ + // Initial OpenGL values from specification. + + glAlphaFunc(AlphaMode, AlphaRef); + glDisable(GL_ALPHA_TEST); + + + + glMatrixMode(MatrixMode); + + Driver->irrGlClientActiveTexture(ClientActiveTexture); + + glDisableClientState(GL_VERTEX_ARRAY); + glDisableClientState(GL_NORMAL_ARRAY); + glDisableClientState(GL_COLOR_ARRAY); + glDisableClientState(GL_TEXTURE_COORD_ARRAY); +} + +COpenGLCacheHandler::~COpenGLCacheHandler() +{ +} + +void COpenGLCacheHandler::setAlphaFunc(GLenum mode, GLclampf ref) +{ + if (AlphaMode != mode || AlphaRef != ref) + { + glAlphaFunc(mode, ref); + + AlphaMode = mode; + AlphaRef = ref; + } +} + +void COpenGLCacheHandler::setAlphaTest(bool enable) +{ + if (AlphaTest != enable) + { + if (enable) + glEnable(GL_ALPHA_TEST); + else + glDisable(GL_ALPHA_TEST); + AlphaTest = enable; + } +} + +void COpenGLCacheHandler::setClientState(bool vertex, bool normal, bool color, bool texCoord0) +{ + if (ClientStateVertex != vertex) + { + if (vertex) + glEnableClientState(GL_VERTEX_ARRAY); + else + glDisableClientState(GL_VERTEX_ARRAY); + + ClientStateVertex = vertex; + } + + if (ClientStateNormal != normal) + { + if (normal) + glEnableClientState(GL_NORMAL_ARRAY); + else + glDisableClientState(GL_NORMAL_ARRAY); + + ClientStateNormal = normal; + } + + if (ClientStateColor != color) + { + if (color) + glEnableClientState(GL_COLOR_ARRAY); + else + glDisableClientState(GL_COLOR_ARRAY); + + ClientStateColor = color; + } + + if (ClientStateTexCoord0 != texCoord0) + { + setClientActiveTexture(GL_TEXTURE0_ARB); + + if (texCoord0) + glEnableClientState(GL_TEXTURE_COORD_ARRAY); + else + glDisableClientState(GL_TEXTURE_COORD_ARRAY); + + ClientStateTexCoord0 = texCoord0; + } +} + +void COpenGLCacheHandler::setMatrixMode(GLenum mode) +{ + if (MatrixMode != mode) + { + glMatrixMode(mode); + MatrixMode = mode; + } +} + +void COpenGLCacheHandler::setClientActiveTexture(GLenum texture) +{ + if (ClientActiveTexture != texture) + { + Driver->irrGlClientActiveTexture(texture); + ClientActiveTexture = texture; + } +} + +} // end namespace +} // end namespace + +#endif // _IRR_COMPILE_WITH_OPENGL_ diff --git a/source/Irrlicht/COpenGLCacheHandler.h b/source/Irrlicht/COpenGLCacheHandler.h new file mode 100644 index 00000000..6f9b17f9 --- /dev/null +++ b/source/Irrlicht/COpenGLCacheHandler.h @@ -0,0 +1,65 @@ +// Copyright (C) 2015 Patryk Nadrowski +// This file is part of the "Irrlicht Engine". +// For conditions of distribution and use, see copyright notice in Irrlicht.h + +#ifndef __C_OPENGL_CACHE_HANDLER_H_INCLUDED__ +#define __C_OPENGL_CACHE_HANDLER_H_INCLUDED__ + +#include "IrrCompileConfig.h" + +#ifdef _IRR_COMPILE_WITH_OPENGL_ + +#include "COpenGLCommon.h" +#include "COGLCoreFeature.h" +#include "COGLCoreTexture.h" +#include "COGLCoreCacheHandler.h" + +namespace irr +{ +namespace video +{ + + class COpenGLCacheHandler : public COGLCoreCacheHandler + { + public: + COpenGLCacheHandler(COpenGLDriver* driver); + virtual ~COpenGLCacheHandler(); + + // Alpha calls. + + void setAlphaFunc(GLenum mode, GLclampf ref); + + void setAlphaTest(bool enable); + + // Client state calls. + + void setClientState(bool vertex, bool normal, bool color, bool texCoord0); + + // Matrix calls. + + void setMatrixMode(GLenum mode); + + // Texture calls. + + void setClientActiveTexture(GLenum texture); + + protected: + GLenum AlphaMode; + GLclampf AlphaRef; + bool AlphaTest; + + GLenum MatrixMode; + + GLenum ClientActiveTexture; + + bool ClientStateVertex; + bool ClientStateNormal; + bool ClientStateColor; + bool ClientStateTexCoord0; + }; + +} // end namespace video +} // end namespace irr + +#endif // _IRR_COMPILE_WITH_OPENGL_ +#endif diff --git a/source/Irrlicht/COpenGLCgMaterialRenderer.cpp b/source/Irrlicht/COpenGLCgMaterialRenderer.cpp deleted file mode 100644 index e0a83c5c..00000000 --- a/source/Irrlicht/COpenGLCgMaterialRenderer.cpp +++ /dev/null @@ -1,266 +0,0 @@ -// Copyright (C) 2012-2012 Patryk Nadrowski -// This file is part of the "Irrlicht Engine". -// For conditions of distribution and use, see copyright notice in irrlicht.h - -#include "IrrCompileConfig.h" -#if defined(_IRR_COMPILE_WITH_OPENGL_) && defined(_IRR_COMPILE_WITH_CG_) - -#include "COpenGLCgMaterialRenderer.h" -#include "COpenGLDriver.h" -#include "COpenGLTexture.h" -#include "COpenGLMaterialRenderer.h" - -namespace irr -{ -namespace video -{ - -COpenGLCgUniformSampler2D::COpenGLCgUniformSampler2D(const CGparameter& parameter, bool global) : CCgUniform(parameter, global) -{ - Type = CG_SAMPLER2D; -} - -void COpenGLCgUniformSampler2D::update(const void* data, const SMaterial& material) const -{ - s32* Data = (s32*)data; - s32 LayerID = *Data; - - if (material.TextureLayer[LayerID].Texture) - { - int TextureID = reinterpret_cast(material.TextureLayer[LayerID].Texture)->getOpenGLTextureName(); - - cgGLSetTextureParameter(Parameter, TextureID); - cgGLEnableTextureParameter(Parameter); - } -} - -COpenGLCgMaterialRenderer::COpenGLCgMaterialRenderer(COpenGLDriver* driver, s32& materialType, - const c8* vertexProgram, const c8* vertexEntry, E_VERTEX_SHADER_TYPE vertexProfile, - const c8* fragmentProgram, const c8* fragmentEntry, E_PIXEL_SHADER_TYPE fragmentProfile, - const c8* geometryProgram, const c8* geometryEntry, E_GEOMETRY_SHADER_TYPE geometryProfile, - scene::E_PRIMITIVE_TYPE inType, scene::E_PRIMITIVE_TYPE outType, u32 vertices, - IShaderConstantSetCallBack* callback, E_MATERIAL_TYPE baseMaterial, s32 userData) : - BaseMaterial(0), Driver(driver), CCgMaterialRenderer(callback, userData) -{ - #ifdef _DEBUG - setDebugName("COpenGLCgMaterialRenderer"); - #endif - - if (baseMaterial == EMT_ONETEXTURE_BLEND || baseMaterial == EMT_TRANSPARENT_ADD_COLOR || baseMaterial == EMT_TRANSPARENT_VERTEX_ALPHA || - baseMaterial == EMT_TRANSPARENT_ALPHA_CHANNEL || baseMaterial == EMT_TRANSPARENT_ALPHA_CHANNEL_REF) - { - BaseMaterial = static_cast(Driver->getMaterialRenderer(baseMaterial)); - } - - if (BaseMaterial) - BaseMaterial->grab(); - - init(materialType, vertexProgram, vertexEntry, vertexProfile, fragmentProgram, fragmentEntry, fragmentProfile, - geometryProgram, geometryEntry, geometryProfile, inType, outType, vertices); -} - -COpenGLCgMaterialRenderer::~COpenGLCgMaterialRenderer() -{ - if(BaseMaterial) - BaseMaterial->drop(); - - if (VertexProgram) - { - cgGLUnloadProgram(VertexProgram); - cgDestroyProgram(VertexProgram); - } - if (FragmentProgram) - { - cgGLUnloadProgram(FragmentProgram); - cgDestroyProgram(FragmentProgram); - } - if (GeometryProgram) - { - cgGLUnloadProgram(GeometryProgram); - cgDestroyProgram(GeometryProgram); - } -} - -bool COpenGLCgMaterialRenderer::isTransparent() const -{ - return BaseMaterial ? BaseMaterial->isTransparent() : false; -} - -void COpenGLCgMaterialRenderer::OnSetMaterial(const SMaterial& material, const SMaterial& lastMaterial, bool resetAllRenderstates, IMaterialRendererServices* services) -{ - if (Driver->getFixedPipelineState() == COpenGLDriver::EOFPS_ENABLE) - Driver->setFixedPipelineState(COpenGLDriver::EOFPS_ENABLE_TO_DISABLE); - else - Driver->setFixedPipelineState(COpenGLDriver::EOFPS_DISABLE); - - if (material.MaterialType != lastMaterial.MaterialType || resetAllRenderstates) - { - if (VertexProgram) - { - cgGLEnableProfile(VertexProfile); - cgGLBindProgram(VertexProgram); - } - - if (FragmentProgram) - { - cgGLEnableProfile(FragmentProfile); - cgGLBindProgram(FragmentProgram); - } - - if (GeometryProgram) - { - cgGLEnableProfile(GeometryProfile); - cgGLBindProgram(GeometryProgram); - } - } - - Driver->setBasicRenderStates(material, lastMaterial, resetAllRenderstates); - - if (BaseMaterial) - BaseMaterial->OnSetBaseMaterial(material); - - if (CallBack) - CallBack->OnSetMaterial(material); - - Material = material; -} - -bool COpenGLCgMaterialRenderer::OnRender(IMaterialRendererServices* services, E_VERTEX_TYPE vtxtype) -{ - Driver->setTextureRenderStates(Driver->getCurrentMaterial(), false); - - if (CallBack && (VertexProgram || FragmentProgram || GeometryProgram)) - CallBack->OnSetConstants(this, UserData); - - return true; -} - -void COpenGLCgMaterialRenderer::OnUnsetMaterial() -{ - if (VertexProgram) - { - cgGLUnbindProgram(VertexProfile); - cgGLDisableProfile(VertexProfile); - } - if (FragmentProgram) - { - cgGLUnbindProgram(FragmentProfile); - cgGLDisableProfile(FragmentProfile); - } - if (GeometryProgram) - { - cgGLUnbindProgram(GeometryProfile); - cgGLDisableProfile(GeometryProfile); - } - - if (BaseMaterial) - BaseMaterial->OnUnsetBaseMaterial(); - - Material = IdentityMaterial; -} - -void COpenGLCgMaterialRenderer::setBasicRenderStates(const SMaterial& material, const SMaterial& lastMaterial, bool resetAllRenderstates) -{ - Driver->setBasicRenderStates(material, lastMaterial, resetAllRenderstates); -} - -IVideoDriver* COpenGLCgMaterialRenderer::getVideoDriver() -{ - return Driver; -} - -void COpenGLCgMaterialRenderer::init(s32& materialType, - const c8* vertexProgram, const c8* vertexEntry, E_VERTEX_SHADER_TYPE vertexProfile, - const c8* fragmentProgram, const c8* fragmentEntry, E_PIXEL_SHADER_TYPE fragmentProfile, - const c8* geometryProgram, const c8* geometryEntry, E_GEOMETRY_SHADER_TYPE geometryProfile, - scene::E_PRIMITIVE_TYPE inType, scene::E_PRIMITIVE_TYPE outType, u32 vertices) -{ - bool shaderStatus = true; - CGerror Error = CG_NO_ERROR; - materialType = -1; - - // TODO: add profile selection - - if (vertexProgram) - { - VertexProfile = cgGLGetLatestProfile(CG_GL_VERTEX); - - if (VertexProfile) - VertexProgram = cgCreateProgram(Driver->getCgContext(), CG_SOURCE, vertexProgram, VertexProfile, vertexEntry, 0); - - if (!VertexProgram) - { - Error = cgGetError(); - os::Printer::log("Cg vertex program failed to compile:", ELL_ERROR); - os::Printer::log(cgGetLastListing(Driver->getCgContext()), ELL_ERROR); - - shaderStatus = false; - } - else - cgGLLoadProgram(VertexProgram); - } - - if (fragmentProgram) - { - FragmentProfile = cgGLGetLatestProfile(CG_GL_FRAGMENT); - - if (FragmentProfile) - FragmentProgram = cgCreateProgram(Driver->getCgContext(), CG_SOURCE, fragmentProgram, FragmentProfile, fragmentEntry, 0); - - if (!FragmentProgram) - { - Error = cgGetError(); - os::Printer::log("Cg fragment program failed to compile:", ELL_ERROR); - os::Printer::log(cgGetLastListing(Driver->getCgContext()), ELL_ERROR); - - shaderStatus = false; - } - else - cgGLLoadProgram(FragmentProgram); - } - - if (geometryProgram) - { - GeometryProfile = cgGLGetLatestProfile(CG_GL_GEOMETRY); - - if (GeometryProfile) - GeometryProgram = cgCreateProgram(Driver->getCgContext(), CG_SOURCE, geometryProgram, GeometryProfile, geometryEntry, 0); - - if (!GeometryProgram) - { - Error = cgGetError(); - os::Printer::log("Cg geometry program failed to compile:", ELL_ERROR); - os::Printer::log(cgGetLastListing(Driver->getCgContext()), ELL_ERROR); - - shaderStatus = false; - } - else - cgGLLoadProgram(GeometryProgram); - } - - getUniformList(); - - // create OpenGL specifics sampler uniforms. - for (unsigned int i = 0; i < UniformInfo.size(); ++i) - { - if (UniformInfo[i]->getType() == CG_SAMPLER2D) - { - bool IsGlobal = true; - - if (UniformInfo[i]->getSpace() == CG_PROGRAM) - IsGlobal = false; - - CCgUniform* Uniform = new COpenGLCgUniformSampler2D(UniformInfo[i]->getParameter(), IsGlobal); - delete UniformInfo[i]; - UniformInfo[i] = Uniform; - } - } - - if (shaderStatus) - materialType = Driver->addMaterialRenderer(this); -} - -} -} - -#endif diff --git a/source/Irrlicht/COpenGLCgMaterialRenderer.h b/source/Irrlicht/COpenGLCgMaterialRenderer.h deleted file mode 100644 index daf3f4fc..00000000 --- a/source/Irrlicht/COpenGLCgMaterialRenderer.h +++ /dev/null @@ -1,104 +0,0 @@ -// Copyright (C) 2012-2012 Patryk Nadrowski -// This file is part of the "Irrlicht Engine". -// For conditions of distribution and use, see copyright notice in irrlicht.h - -#ifndef __C_OPENGL_CG_MATERIAL_RENDERER_H_INCLUDED__ -#define __C_OPENGL_CG_MATERIAL_RENDERER_H_INCLUDED__ - -#include "IrrCompileConfig.h" -#if defined(_IRR_COMPILE_WITH_OPENGL_) && defined(_IRR_COMPILE_WITH_CG_) - -#ifdef _IRR_WINDOWS_API_ - #define WIN32_LEAN_AND_MEAN - #include - #include - #include "glext.h" -#else -#if defined(_IRR_OPENGL_USE_EXTPOINTER_) - #define GL_GLEXT_LEGACY 1 -#else - #define GL_GLEXT_PROTOTYPES 1 -#endif -#if defined(_IRR_OSX_PLATFORM_) - #include -#else - #include -#endif -#if defined(_IRR_OPENGL_USE_EXTPOINTER_) - #include "glext.h" -#endif -#endif - -#include "CCgMaterialRenderer.h" -#include "Cg/cgGL.h" - -#ifdef _MSC_VER - #pragma comment(lib, "cgGL.lib") -#endif - -namespace irr -{ -namespace video -{ - -class COpenGLDriver; -class COpenGLMaterialRenderer; -class IShaderConstantSetCallBack; - -class COpenGLCgUniformSampler2D : public CCgUniform -{ -public: - COpenGLCgUniformSampler2D(const CGparameter& parameter, bool global); - - void update(const void* data, const SMaterial& material) const; -}; - -class COpenGLCgMaterialRenderer : public CCgMaterialRenderer -{ -public: - COpenGLCgMaterialRenderer(COpenGLDriver* driver, s32& materialType, - const c8* vertexProgram = 0, const c8* vertexEntry = "main", - E_VERTEX_SHADER_TYPE vertexProfile = video::EVST_VS_1_1, - const c8* fragmentProgram = 0, const c8* fragmentEntry = "main", - E_PIXEL_SHADER_TYPE fragmentProfile = video::EPST_PS_1_1, - const c8* geometryProgram = 0, const c8* geometryEntry = "main", - E_GEOMETRY_SHADER_TYPE geometryProfile = video::EGST_GS_4_0, - scene::E_PRIMITIVE_TYPE inType = scene::EPT_TRIANGLES, - scene::E_PRIMITIVE_TYPE outType = scene::EPT_TRIANGLE_STRIP, - u32 vertices = 0, IShaderConstantSetCallBack* callback = 0, - E_MATERIAL_TYPE baseMaterial = EMT_SOLID, s32 userData = 0); - - virtual ~COpenGLCgMaterialRenderer(); - - virtual bool isTransparent() const _IRR_OVERRIDE_; - - virtual void OnSetMaterial(const SMaterial& material, const SMaterial& lastMaterial, bool resetAllRenderstates, IMaterialRendererServices* services) _IRR_OVERRIDE_; - virtual bool OnRender(IMaterialRendererServices* services, E_VERTEX_TYPE vtxtype) _IRR_OVERRIDE_; - virtual void OnUnsetMaterial() _IRR_OVERRIDE_; - - virtual void setBasicRenderStates(const SMaterial& material, const SMaterial& lastMaterial, bool resetAllRenderstates) _IRR_OVERRIDE_; - virtual IVideoDriver* getVideoDriver() _IRR_OVERRIDE_; - -protected: - void init(s32& materialType, - const c8* vertexProgram = 0, const c8* vertexEntry = "main", - E_VERTEX_SHADER_TYPE vertexProfile = video::EVST_VS_1_1, - const c8* fragmentProgram = 0, const c8* fragmentEntry = "main", - E_PIXEL_SHADER_TYPE fragmentProfile = video::EPST_PS_1_1, - const c8* geometryProgram = 0, const c8* geometryEntry = "main", - E_GEOMETRY_SHADER_TYPE geometryProfile = video::EGST_GS_4_0, - scene::E_PRIMITIVE_TYPE inType = scene::EPT_TRIANGLES, - scene::E_PRIMITIVE_TYPE outType = scene::EPT_TRIANGLE_STRIP, - u32 vertices = 0); - - COpenGLMaterialRenderer* BaseMaterial; - - COpenGLDriver* Driver; -}; - -} -} - -#endif -#endif - diff --git a/source/Irrlicht/COpenGLCommon.h b/source/Irrlicht/COpenGLCommon.h new file mode 100644 index 00000000..a2791238 --- /dev/null +++ b/source/Irrlicht/COpenGLCommon.h @@ -0,0 +1,175 @@ +// Copyright (C) 2015 Patryk Nadrowski +// This file is part of the "Irrlicht Engine". +// For conditions of distribution and use, see copyright notice in irrlicht.h + +#ifndef __C_OPENGL_COMMON_H_INCLUDED__ +#define __C_OPENGL_COMMON_H_INCLUDED__ + +#include "IrrCompileConfig.h" + +#ifdef _IRR_COMPILE_WITH_OPENGL_ + +#if defined(_IRR_WINDOWS_API_) + #define WIN32_LEAN_AND_MEAN + #include + #if defined(_IRR_OPENGL_USE_EXTPOINTER_) + #define GL_GLEXT_LEGACY 1 + #endif + #include + #if defined(_IRR_OPENGL_USE_EXTPOINTER_) + #include "glext.h" + #endif + #include "wglext.h" + + #ifdef _MSC_VER + #pragma comment(lib, "OpenGL32.lib") + #endif + +#elif defined(_IRR_COMPILE_WITH_OSX_DEVICE_) + #if defined(_IRR_OPENGL_USE_EXTPOINTER_) + #define GL_GLEXT_LEGACY 1 + #endif + #include + #if defined(_IRR_OPENGL_USE_EXTPOINTER_) + #include "glext.h" + #endif +#elif defined(_IRR_COMPILE_WITH_SDL_DEVICE_) && !defined(_IRR_COMPILE_WITH_X11_DEVICE_) + #if defined(_IRR_OPENGL_USE_EXTPOINTER_) + #define GL_GLEXT_LEGACY 1 + #define GLX_GLXEXT_LEGACY 1 + #else + #define GL_GLEXT_PROTOTYPES 1 + #define GLX_GLXEXT_PROTOTYPES 1 + #endif + #define NO_SDL_GLEXT + #include + #include + #include "glext.h" +#else + #if defined(_IRR_OPENGL_USE_EXTPOINTER_) + #define GL_GLEXT_LEGACY 1 + #define GLX_GLXEXT_LEGACY 1 + #else + #define GL_GLEXT_PROTOTYPES 1 + #define GLX_GLXEXT_PROTOTYPES 1 + #endif + #include + #include + #if defined(_IRR_OPENGL_USE_EXTPOINTER_) + #include "glext.h" + #undef GLX_ARB_get_proc_address + #include "glxext.h" + #endif +#endif + +#ifndef GL_ARB_shader_objects +typedef char GLcharARB; +typedef unsigned int GLhandleARB; +#endif + +#ifndef GL_VERSION_2_0 +typedef char GLchar; +#endif + +// Blending definitions. + +#if !defined(GL_VERSION_1_4) +#if defined(GL_EXT_blend_subtract) || defined(GL_EXT_blend_minmax) || defined(GL_EXT_blend_logic_op) +#define GL_FUNC_ADD GL_FUNC_ADD_EXT +#else +#define GL_FUNC_ADD 0 +#endif +#endif + +// FBO definitions. + +#if !defined(GL_VERSION_3_0) && !defined(GL_ARB_framebuffer_object) +#ifdef GL_EXT_framebuffer_object +#define GL_FRAMEBUFFER GL_FRAMEBUFFER_EXT +#define GL_COLOR_ATTACHMENT0 GL_COLOR_ATTACHMENT0_EXT +#define GL_DEPTH_ATTACHMENT GL_DEPTH_ATTACHMENT_EXT +#define GL_STENCIL_ATTACHMENT GL_STENCIL_ATTACHMENT_EXT +#define GL_FRAMEBUFFER_COMPLETE GL_FRAMEBUFFER_COMPLETE_EXT +#define GL_FRAMEBUFFER_INCOMPLETE_READ_BUFFER GL_FRAMEBUFFER_INCOMPLETE_READ_BUFFER_EXT +#define GL_FRAMEBUFFER_INCOMPLETE_DRAW_BUFFER GL_FRAMEBUFFER_INCOMPLETE_DRAW_BUFFER_EXT +#define GL_FRAMEBUFFER_INCOMPLETE_ATTACHMENT GL_FRAMEBUFFER_INCOMPLETE_ATTACHMENT_EXT +#define GL_FRAMEBUFFER_INCOMPLETE_FORMATS GL_FRAMEBUFFER_INCOMPLETE_FORMATS_EXT +#define GL_FRAMEBUFFER_INCOMPLETE_DIMENSIONS GL_FRAMEBUFFER_INCOMPLETE_DIMENSIONS_EXT +#define GL_FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT GL_FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT_EXT +#define GL_FRAMEBUFFER_UNSUPPORTED GL_FRAMEBUFFER_UNSUPPORTED_EXT +#else +#define GL_FRAMEBUFFER 0 +#define GL_COLOR_ATTACHMENT0 0 +#define GL_DEPTH_ATTACHMENT 0 +#define GL_STENCIL_ATTACHMENT 0 +#define GL_FRAMEBUFFER_COMPLETE 0 +#define GL_FRAMEBUFFER_INCOMPLETE_READ_BUFFER 1 +#define GL_FRAMEBUFFER_INCOMPLETE_DRAW_BUFFER 2 +#define GL_FRAMEBUFFER_INCOMPLETE_ATTACHMENT 3 +#define GL_FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT 4 +#define GL_FRAMEBUFFER_UNSUPPORTED 5 +#endif +#endif + +#ifdef GL_EXT_framebuffer_object +#define GL_FRAMEBUFFER_INCOMPLETE_FORMATS GL_FRAMEBUFFER_INCOMPLETE_FORMATS_EXT +#define GL_FRAMEBUFFER_INCOMPLETE_DIMENSIONS GL_FRAMEBUFFER_INCOMPLETE_DIMENSIONS_EXT +#else +#define GL_FRAMEBUFFER_INCOMPLETE_FORMATS 6 +#define GL_FRAMEBUFFER_INCOMPLETE_DIMENSIONS 7 +#endif + +// MipMaps definitions. + +#if !defined(GL_VERSION_1_4) +#ifdef GL_SGIS_generate_mipmap +#define GL_GENERATE_MIPMAP GL_GENERATE_MIPMAP_SGIS +#define GL_GENERATE_MIPMAP_HINT GL_GENERATE_MIPMAP_HINT_SGIS +#else +#define GL_GENERATE_MIPMAP 0 +#define GL_GENERATE_MIPMAP_HINT 0 +#endif +#endif + +// Texture definitions. + +#if !defined(GL_VERSION_1_3) +#ifdef GL_ARB_multitexture +#define GL_TEXTURE0 GL_TEXTURE0_ARB +#else +#define GL_TEXTURE0 0 +#endif +#endif + +// Irrlicht's OpenGL version. + +#define IRR_OPENGL_VERSION 14 + +namespace irr +{ +namespace video +{ + + // Forward declarations. + + class COGLCoreFeature; + + template + class COGLCoreTexture; + + template + class COGLCoreRenderTarget; + + template + class COGLCoreCacheHandler; + + class COpenGLDriver; + typedef COGLCoreTexture COpenGLTexture; + typedef COGLCoreRenderTarget COpenGLRenderTarget; + class COpenGLCacheHandler; + +} +} + +#endif +#endif diff --git a/source/Irrlicht/COpenGLDriver.cpp b/source/Irrlicht/COpenGLDriver.cpp index 8ca9eba6..ad8b5836 100644 --- a/source/Irrlicht/COpenGLDriver.cpp +++ b/source/Irrlicht/COpenGLDriver.cpp @@ -9,11 +9,13 @@ #ifdef _IRR_COMPILE_WITH_OPENGL_ -#include "COpenGLTexture.h" +#include "COGLCoreTexture.h" +#include "COGLCoreRenderTarget.h" + +#include "COpenGLCacheHandler.h" #include "COpenGLMaterialRenderer.h" #include "COpenGLShaderMaterialRenderer.h" #include "COpenGLSLMaterialRenderer.h" -#include "COpenGLCgMaterialRenderer.h" #include "COpenGLNormalMapRenderer.h" #include "COpenGLParallaxMapRenderer.h" #include "os.h" @@ -38,23 +40,15 @@ const u16 COpenGLDriver::Quad2DIndices[4] = { 0, 1, 2, 3 }; #include "CWGLManager.h" //! Windows constructor and init code -COpenGLDriver::COpenGLDriver(const ::irr::SIrrlichtCreationParameters& params, - io::IFileSystem* io, IContextManager* contextManager) -: CNullDriver(io, params.WindowSize), COpenGLExtensionHandler(), BridgeCalls(0), +COpenGLDriver::COpenGLDriver(const SIrrlichtCreationParameters& params, io::IFileSystem* io, IContextManager* contextManager) + : CNullDriver(io, params.WindowSize), COpenGLExtensionHandler(), CacheHandler(0), CurrentRenderMode(ERM_NONE), ResetRenderStates(true), Transformation3DChanged(true), - AntiAlias(params.AntiAlias), RenderTargetTexture(0), - CurrentRendertargetSize(0,0), ColorFormat(ECF_R8G8B8), - FixedPipelineState(EOFPS_ENABLE), - CurrentTarget(ERT_FRAME_BUFFER), Params(params), - ContextManager(contextManager), DeviceType(EIDT_WIN32) + AntiAlias(params.AntiAlias), ColorFormat(ECF_R8G8B8), FixedPipelineState(EOFPS_ENABLE), + Params(params), ContextManager(contextManager), DeviceType(EIDT_WIN32) { #ifdef _DEBUG setDebugName("COpenGLDriver"); #endif - - #ifdef _IRR_COMPILE_WITH_CG_ - CgContext = 0; - #endif } @@ -78,26 +72,19 @@ bool COpenGLDriver::initDriver(CIrrDeviceWin32* device) // MacOSX CONSTRUCTOR // ----------------------------------------------------------------------- #ifdef _IRR_COMPILE_WITH_OSX_DEVICE_ -COpenGLDriver::COpenGLDriver(const SIrrlichtCreationParameters& params, - io::IFileSystem* io, IContextManager* contextManager) -: CNullDriver(io, params.WindowSize), COpenGLExtensionHandler(), +//! OSX constructor and init code +COpenGLDriver::COpenGLDriver(const SIrrlichtCreationParameters& params, io::IFileSystem* io, IContextManager* contextManager) + : CNullDriver(io, params.WindowSize), COpenGLExtensionHandler(), CacheHandler(0), CurrentRenderMode(ERM_NONE), ResetRenderStates(true), Transformation3DChanged(true), - AntiAlias(params.AntiAlias), RenderTargetTexture(0), - CurrentRendertargetSize(0,0), ColorFormat(ECF_R8G8B8), - FixedPipelineState(EOFPS_ENABLE), - CurrentTarget(ERT_FRAME_BUFFER), Params(params), BridgeCalls(0), - ContextManager(contextManager), DeviceType(EIDT_OSX) + AntiAlias(params.AntiAlias), ColorFormat(ECF_R8G8B8), FixedPipelineState(EOFPS_ENABLE), + Params(params), ContextManager(contextManager), DeviceType(EIDT_OSX) { #ifdef _DEBUG setDebugName("COpenGLDriver"); #endif - - #ifdef _IRR_COMPILE_WITH_CG_ - CgContext = 0; - #endif } - //! inits the open gl driver +//! inits the open gl driver bool COpenGLDriver::initDriver() { ContextManager->generateSurface(); @@ -110,30 +97,22 @@ bool COpenGLDriver::initDriver() return true; } -#endif +#endif // _IRR_COMPILE_WITH_OSX_DEVICE_ // ----------------------------------------------------------------------- // LINUX CONSTRUCTOR // ----------------------------------------------------------------------- #ifdef _IRR_COMPILE_WITH_X11_DEVICE_ //! Linux constructor and init code -COpenGLDriver::COpenGLDriver(const SIrrlichtCreationParameters& params, - io::IFileSystem* io, IContextManager* contextManager) -: CNullDriver(io, params.WindowSize), COpenGLExtensionHandler(), - BridgeCalls(0), CurrentRenderMode(ERM_NONE), ResetRenderStates(true), - Transformation3DChanged(true), AntiAlias(params.AntiAlias), - RenderTargetTexture(0), CurrentRendertargetSize(0,0), - ColorFormat(ECF_R8G8B8), FixedPipelineState(EOFPS_ENABLE), - CurrentTarget(ERT_FRAME_BUFFER), Params(params), - ContextManager(contextManager), DeviceType(EIDT_X11) +COpenGLDriver::COpenGLDriver(const SIrrlichtCreationParameters& params, io::IFileSystem* io, IContextManager* contextManager) + : CNullDriver(io, params.WindowSize), COpenGLExtensionHandler(), CacheHandler(0), + CurrentRenderMode(ERM_NONE), ResetRenderStates(true), Transformation3DChanged(true), + AntiAlias(params.AntiAlias), ColorFormat(ECF_R8G8B8), FixedPipelineState(EOFPS_ENABLE), + Params(params), ContextManager(contextManager), DeviceType(EIDT_X11) { #ifdef _DEBUG setDebugName("COpenGLDriver"); #endif - - #ifdef _IRR_COMPILE_WITH_CG_ - CgContext = 0; - #endif } @@ -159,24 +138,16 @@ bool COpenGLDriver::initDriver(CIrrDeviceLinux* device) // ----------------------------------------------------------------------- #ifdef _IRR_COMPILE_WITH_SDL_DEVICE_ //! SDL constructor and init code -COpenGLDriver::COpenGLDriver(const SIrrlichtCreationParameters& params, - io::IFileSystem* io, CIrrDeviceSDL* device) -: CNullDriver(io, params.WindowSize), COpenGLExtensionHandler(), - CurrentRenderMode(ERM_NONE), ResetRenderStates(true), - Transformation3DChanged(true), AntiAlias(params.AntiAlias), - RenderTargetTexture(0), CurrentRendertargetSize(0,0), - ColorFormat(ECF_R8G8B8), FixedPipelineState(EOFPS_ENABLE), - CurrentTarget(ERT_FRAME_BUFFER), Params(params), - BridgeCalls(0), SDLDevice(device), DeviceType(EIDT_SDL) +COpenGLDriver::COpenGLDriver(const SIrrlichtCreationParameters& params, io::IFileSystem* io, CIrrDeviceSDL* device) + : CNullDriver(io, params.WindowSize), COpenGLExtensionHandler(), CacheHandler(0), + CurrentRenderMode(ERM_NONE), ResetRenderStates(true), Transformation3DChanged(true), + AntiAlias(params.AntiAlias), ColorFormat(ECF_R8G8B8), FixedPipelineState(EOFPS_ENABLE), + Params(params), SDLDevice(device), DeviceType(EIDT_SDL) { #ifdef _DEBUG setDebugName("COpenGLDriver"); #endif - #ifdef _IRR_COMPILE_WITH_CG_ - CgContext = 0; - #endif - genericDriverInit(); } @@ -186,23 +157,19 @@ COpenGLDriver::COpenGLDriver(const SIrrlichtCreationParameters& params, //! destructor COpenGLDriver::~COpenGLDriver() { - #ifdef _IRR_COMPILE_WITH_CG_ - if (CgContext) - cgDestroyContext(CgContext); - #endif - RequestedLights.clear(); deleteMaterialRenders(); - CurrentTexture.clear(); + CacheHandler->getTextureCache().clear(); // I get a blue screen on my laptop, when I do not delete the // textures manually before releasing the dc. Oh how I love this. + removeAllRenderTargets(); deleteAllTextures(); removeAllOcclusionQueries(); removeAllHardwareBuffers(); - delete BridgeCalls; + delete CacheHandler; if (ContextManager) { @@ -238,29 +205,30 @@ bool COpenGLDriver::genericDriverInit() } u32 i; - CurrentTexture.clear(); + // load extensions initExtensions(Params.Stencilbuffer); - if (!BridgeCalls) - BridgeCalls = new COpenGLCallBridge(this); + // reset cache handler + delete CacheHandler; + CacheHandler = new COpenGLCacheHandler(this); if (queryFeature(EVDF_ARB_GLSL)) { char buf[32]; const u32 maj = ShaderLanguageVersion/100; - snprintf(buf, 32, "%u.%u", maj, ShaderLanguageVersion-maj*100); + snprintf_irr(buf, 32, "%u.%u", maj, ShaderLanguageVersion-maj*100); os::Printer::log("GLSL version", buf, ELL_INFORMATION); } else os::Printer::log("GLSL not available.", ELL_INFORMATION); - DriverAttributes->setAttribute("MaxTextures", MaxTextureUnits); - DriverAttributes->setAttribute("MaxSupportedTextures", MaxSupportedTextures); + DriverAttributes->setAttribute("MaxTextures", (s32)Feature.TextureUnit); + DriverAttributes->setAttribute("MaxSupportedTextures", (s32)Feature.TextureUnit); DriverAttributes->setAttribute("MaxLights", MaxLights); DriverAttributes->setAttribute("MaxAnisotropy", MaxAnisotropy); DriverAttributes->setAttribute("MaxUserClipPlanes", MaxUserClipPlanes); DriverAttributes->setAttribute("MaxAuxBuffers", MaxAuxBuffers); - DriverAttributes->setAttribute("MaxMultipleRenderTargets", MaxMultipleRenderTargets); + DriverAttributes->setAttribute("MaxMultipleRenderTargets", (s32)Feature.MultipleRenderTarget); DriverAttributes->setAttribute("MaxIndices", (s32)MaxIndices); DriverAttributes->setAttribute("MaxTextureSize", (s32)MaxTextureSize); DriverAttributes->setAttribute("MaxGeometryVerticesOut", (s32)MaxGeometryVerticesOut); @@ -331,10 +299,6 @@ bool COpenGLDriver::genericDriverInit() // This fixes problems with intermediate changes to the material during texture load. ResetRenderStates = true; - #ifdef _IRR_COMPILE_WITH_CG_ - CgContext = cgCreateContext(); - #endif - return true; } @@ -389,8 +353,25 @@ void COpenGLDriver::createMaterialRenderers() addAndDropMaterialRenderer(new COpenGLMaterialRenderer_ONETEXTURE_BLEND(this)); } +bool COpenGLDriver::beginScene(u16 clearFlag, SColor clearColor, f32 clearDepth, u8 clearStencil, const SExposedVideoData& videoData, core::rect* sourceRect) +{ + CNullDriver::beginScene(clearFlag, clearColor, clearDepth, clearStencil, videoData, sourceRect); + + ContextManager->activateContext(videoData); + +#if defined(_IRR_COMPILE_WITH_SDL_DEVICE_) + if (DeviceType == EIDT_SDL) + { + // todo: SDL sets glFrontFace(GL_CCW) after driver creation, + // it would be better if this was fixed elsewhere. + glFrontFace(GL_CW); + } +#endif + + clearBuffers(clearFlag, clearColor, clearDepth, clearStencil); + return true; +} -//! presents the rendered scene on the screen, returns false if failed bool COpenGLDriver::endScene() { CNullDriver::endScene(); @@ -432,59 +413,6 @@ bool COpenGLDriver::endScene() } -//! clears the zbuffer and color buffer -void COpenGLDriver::clearBuffers(bool backBuffer, bool zBuffer, bool stencilBuffer, SColor color) -{ - GLbitfield mask = 0; - if (backBuffer) - { - glColorMask(GL_TRUE, GL_TRUE, GL_TRUE, GL_TRUE); - Material.ColorMask = ECP_ALL; - - const f32 inv = 1.0f / 255.0f; - glClearColor(color.getRed() * inv, color.getGreen() * inv, - color.getBlue() * inv, color.getAlpha() * inv); - - mask |= GL_COLOR_BUFFER_BIT; - } - - if (zBuffer) - { - BridgeCalls->setDepthMask(true); - Material.ZWriteEnable = true; - - mask |= GL_DEPTH_BUFFER_BIT; - } - - if (stencilBuffer) - mask |= GL_STENCIL_BUFFER_BIT; - - if (mask) - glClear(mask); -} - - -//! init call for rendering start -bool COpenGLDriver::beginScene(bool backBuffer, bool zBuffer, SColor color, - const SExposedVideoData& videoData, core::rect* sourceRect) -{ - CNullDriver::beginScene(backBuffer, zBuffer, color, videoData, sourceRect); - ContextManager->activateContext(videoData); - -#if defined(_IRR_COMPILE_WITH_SDL_DEVICE_) - if (DeviceType == EIDT_SDL) - { - // todo: SDL sets glFrontFace(GL_CCW) after driver creation, - // it would be better if this was fixed elsewhere. - glFrontFace(GL_CW); - } -#endif - - clearBuffers(backBuffer, zBuffer, false, color); - return true; -} - - //! Returns the transformation set by setTransform const core::matrix4& COpenGLDriver::getTransform(E_TRANSFORMATION_STATE state) const { @@ -504,7 +432,7 @@ void COpenGLDriver::setTransform(E_TRANSFORMATION_STATE state, const core::matri case ETS_WORLD: { // OpenGL only has a model matrix, view and world is not existent. so lets fake these two. - BridgeCalls->setMatrixMode(GL_MODELVIEW); + CacheHandler->setMatrixMode(GL_MODELVIEW); // first load the viewing transformation for user clip planes glLoadMatrixf((Matrices[ETS_VIEW]).pointer()); @@ -520,36 +448,12 @@ void COpenGLDriver::setTransform(E_TRANSFORMATION_STATE state, const core::matri break; case ETS_PROJECTION: { - BridgeCalls->setMatrixMode(GL_PROJECTION); + CacheHandler->setMatrixMode(GL_PROJECTION); glLoadMatrixf(mat.pointer()); } break; - case ETS_COUNT: - return; default: - { - const u32 i = state - ETS_TEXTURE_0; - if (i >= MATERIAL_MAX_TEXTURES) - break; - - const bool isRTT = Material.getTexture(i) && Material.getTexture(i)->isRenderTarget(); - - BridgeCalls->setActiveTexture(GL_TEXTURE0_ARB + i); - - BridgeCalls->setMatrixMode(GL_TEXTURE); - if (!isRTT && mat.isIdentity() ) - glLoadIdentity(); - else - { - GLfloat glmat[16]; - if (isRTT) - getGLTextureMatrix(glmat, mat * TextureFlipMatrix); - else - getGLTextureMatrix(glmat, mat); - glLoadMatrixf(glmat); - } - break; - } + break; } } @@ -991,6 +895,16 @@ u32 COpenGLDriver::getOcclusionQueryResult(scene::ISceneNode* node) const } +//! Create render target. +IRenderTarget* COpenGLDriver::addRenderTarget() +{ + COpenGLRenderTarget* renderTarget = new COpenGLRenderTarget(this); + RenderTargets.push_back(renderTarget); + + return renderTarget; +} + + // small helper function to create vertex buffer object adress offsets static inline u8* buffer_offset(const long offset) { @@ -1018,9 +932,9 @@ void COpenGLDriver::drawVertexPrimitiveList(const void* vertices, u32 vertexCoun setRenderStates3DMode(); if ((pType!=scene::EPT_POINTS) && (pType!=scene::EPT_POINT_SPRITES)) - BridgeCalls->setClientState(true, true, true, true); + CacheHandler->setClientState(true, true, true, true); else - BridgeCalls->setClientState(true, false, true, false); + CacheHandler->setClientState(true, false, true, false); //due to missing defines in OSX headers, we have to be more specific with this check //#if defined(GL_ARB_vertex_array_bgra) || defined(GL_EXT_vertex_array_bgra) @@ -1071,9 +985,9 @@ void COpenGLDriver::drawVertexPrimitiveList(const void* vertices, u32 vertexCoun glVertexPointer(3, GL_FLOAT, sizeof(S3DVertex), 0); } - if (MultiTextureExtension && CurrentTexture[1]) + if (Feature.TextureUnit > 0 && CacheHandler->getTextureCache()[1]) { - BridgeCalls->setClientActiveTexture(GL_TEXTURE1_ARB); + CacheHandler->setClientActiveTexture(GL_TEXTURE0 + 1); glEnableClientState(GL_TEXTURE_COORD_ARRAY); if (vertices) glTexCoordPointer(2, GL_FLOAT, sizeof(S3DVertex), &(static_cast(vertices))[0].TCoords); @@ -1097,9 +1011,9 @@ void COpenGLDriver::drawVertexPrimitiveList(const void* vertices, u32 vertexCoun } - if (MultiTextureExtension) + if (Feature.TextureUnit > 0) { - BridgeCalls->setClientActiveTexture(GL_TEXTURE1_ARB); + CacheHandler->setClientActiveTexture(GL_TEXTURE0 + 1); glEnableClientState(GL_TEXTURE_COORD_ARRAY); if (vertices) glTexCoordPointer(2, GL_FLOAT, sizeof(S3DVertex2TCoords), &(static_cast(vertices))[0].TCoords2); @@ -1122,16 +1036,16 @@ void COpenGLDriver::drawVertexPrimitiveList(const void* vertices, u32 vertexCoun glVertexPointer(3, GL_FLOAT, sizeof(S3DVertexTangents), buffer_offset(0)); } - if (MultiTextureExtension) + if (Feature.TextureUnit > 0) { - BridgeCalls->setClientActiveTexture(GL_TEXTURE1_ARB); + CacheHandler->setClientActiveTexture(GL_TEXTURE0 + 1); glEnableClientState(GL_TEXTURE_COORD_ARRAY); if (vertices) glTexCoordPointer(3, GL_FLOAT, sizeof(S3DVertexTangents), &(static_cast(vertices))[0].Tangent); else glTexCoordPointer(3, GL_FLOAT, sizeof(S3DVertexTangents), buffer_offset(36)); - BridgeCalls->setClientActiveTexture(GL_TEXTURE2_ARB); + CacheHandler->setClientActiveTexture(GL_TEXTURE0 + 2); glEnableClientState(GL_TEXTURE_COORD_ARRAY); if (vertices) glTexCoordPointer(3, GL_FLOAT, sizeof(S3DVertexTangents), &(static_cast(vertices))[0].Binormal); @@ -1143,19 +1057,19 @@ void COpenGLDriver::drawVertexPrimitiveList(const void* vertices, u32 vertexCoun renderArray(indexList, primitiveCount, pType, iType); - if (MultiTextureExtension) + if (Feature.TextureUnit > 0) { if (vType==EVT_TANGENTS) { - BridgeCalls->setClientActiveTexture(GL_TEXTURE2_ARB); + CacheHandler->setClientActiveTexture(GL_TEXTURE0 + 2); glDisableClientState(GL_TEXTURE_COORD_ARRAY); } - if ((vType!=EVT_STANDARD) || CurrentTexture[1]) + if ((vType!=EVT_STANDARD) || CacheHandler->getTextureCache()[1]) { - BridgeCalls->setClientActiveTexture(GL_TEXTURE1_ARB); + CacheHandler->setClientActiveTexture(GL_TEXTURE0 + 1); glDisableClientState(GL_TEXTURE_COORD_ARRAY); } - BridgeCalls->setClientActiveTexture(GL_TEXTURE0_ARB); + CacheHandler->setClientActiveTexture(GL_TEXTURE0); } } @@ -1326,7 +1240,7 @@ void COpenGLDriver::draw2DVertexPrimitiveList(const void* vertices, u32 vertexCo getColorBuffer(vertices, vertexCount, vType); // draw everything - this->setActiveTexture(0, Material.getTexture(0)); + CacheHandler->getTextureCache().set(0, Material.getTexture(0)); if (Material.MaterialType==EMT_ONETEXTURE_BLEND) { E_BLEND_FACTOR srcFact; @@ -1340,9 +1254,9 @@ void COpenGLDriver::draw2DVertexPrimitiveList(const void* vertices, u32 vertexCo setRenderStates2DMode(Material.MaterialType==EMT_TRANSPARENT_VERTEX_ALPHA, (Material.getTexture(0) != 0), Material.MaterialType==EMT_TRANSPARENT_ALPHA_CHANNEL); if ((pType!=scene::EPT_POINTS) && (pType!=scene::EPT_POINT_SPRITES)) - BridgeCalls->setClientState(true, false, true, true); + CacheHandler->setClientState(true, false, true, true); else - BridgeCalls->setClientState(true, false, true, false); + CacheHandler->setClientState(true, false, true, false); //due to missing defines in OSX headers, we have to be more specific with this check //#if defined(GL_ARB_vertex_array_bgra) || defined(GL_EXT_vertex_array_bgra) @@ -1391,9 +1305,9 @@ void COpenGLDriver::draw2DVertexPrimitiveList(const void* vertices, u32 vertexCo glVertexPointer(2, GL_FLOAT, sizeof(S3DVertex), 0); } - if (MultiTextureExtension && CurrentTexture[1]) + if (Feature.TextureUnit > 0 && CacheHandler->getTextureCache()[1]) { - BridgeCalls->setClientActiveTexture(GL_TEXTURE1_ARB); + CacheHandler->setClientActiveTexture(GL_TEXTURE0 + 1); glEnableClientState(GL_TEXTURE_COORD_ARRAY); if (vertices) glTexCoordPointer(2, GL_FLOAT, sizeof(S3DVertex), &(static_cast(vertices))[0].TCoords); @@ -1414,9 +1328,9 @@ void COpenGLDriver::draw2DVertexPrimitiveList(const void* vertices, u32 vertexCo glVertexPointer(2, GL_FLOAT, sizeof(S3DVertex2TCoords), buffer_offset(0)); } - if (MultiTextureExtension) + if (Feature.TextureUnit > 0) { - BridgeCalls->setClientActiveTexture(GL_TEXTURE1_ARB); + CacheHandler->setClientActiveTexture(GL_TEXTURE0 + 1); glEnableClientState(GL_TEXTURE_COORD_ARRAY); if (vertices) glTexCoordPointer(2, GL_FLOAT, sizeof(S3DVertex2TCoords), &(static_cast(vertices))[0].TCoords2); @@ -1442,18 +1356,290 @@ void COpenGLDriver::draw2DVertexPrimitiveList(const void* vertices, u32 vertexCo renderArray(indexList, primitiveCount, pType, iType); - if (MultiTextureExtension) + if (Feature.TextureUnit > 0) { - if ((vType!=EVT_STANDARD) || CurrentTexture[1]) + if ((vType!=EVT_STANDARD) || CacheHandler->getTextureCache()[1]) { - BridgeCalls->setClientActiveTexture(GL_TEXTURE1_ARB); + CacheHandler->setClientActiveTexture(GL_TEXTURE0 + 1); glDisableClientState(GL_TEXTURE_COORD_ARRAY); } - BridgeCalls->setClientActiveTexture(GL_TEXTURE0_ARB); + CacheHandler->setClientActiveTexture(GL_TEXTURE0); } } +void COpenGLDriver::draw2DImage(const video::ITexture* texture, const core::position2d& destPos, + const core::rect& sourceRect, const core::rect* clipRect, SColor color, + bool useAlphaChannelOfTexture) +{ + if (!texture) + return; + + if (!sourceRect.isValid()) + return; + + core::position2d targetPos(destPos); + core::position2d sourcePos(sourceRect.UpperLeftCorner); + // This needs to be signed as it may go negative. + core::dimension2d sourceSize(sourceRect.getSize()); + if (clipRect) + { + if (targetPos.X < clipRect->UpperLeftCorner.X) + { + sourceSize.Width += targetPos.X - clipRect->UpperLeftCorner.X; + if (sourceSize.Width <= 0) + return; + + sourcePos.X -= targetPos.X - clipRect->UpperLeftCorner.X; + targetPos.X = clipRect->UpperLeftCorner.X; + } + + if (targetPos.X + sourceSize.Width > clipRect->LowerRightCorner.X) + { + sourceSize.Width -= (targetPos.X + sourceSize.Width) - clipRect->LowerRightCorner.X; + if (sourceSize.Width <= 0) + return; + } + + if (targetPos.Y < clipRect->UpperLeftCorner.Y) + { + sourceSize.Height += targetPos.Y - clipRect->UpperLeftCorner.Y; + if (sourceSize.Height <= 0) + return; + + sourcePos.Y -= targetPos.Y - clipRect->UpperLeftCorner.Y; + targetPos.Y = clipRect->UpperLeftCorner.Y; + } + + if (targetPos.Y + sourceSize.Height > clipRect->LowerRightCorner.Y) + { + sourceSize.Height -= (targetPos.Y + sourceSize.Height) - clipRect->LowerRightCorner.Y; + if (sourceSize.Height <= 0) + return; + } + } + + // clip these coordinates + + if (targetPos.X<0) + { + sourceSize.Width += targetPos.X; + if (sourceSize.Width <= 0) + return; + + sourcePos.X -= targetPos.X; + targetPos.X = 0; + } + + const core::dimension2d& renderTargetSize = getCurrentRenderTargetSize(); + + if (targetPos.X + sourceSize.Width > (s32)renderTargetSize.Width) + { + sourceSize.Width -= (targetPos.X + sourceSize.Width) - renderTargetSize.Width; + if (sourceSize.Width <= 0) + return; + } + + if (targetPos.Y<0) + { + sourceSize.Height += targetPos.Y; + if (sourceSize.Height <= 0) + return; + + sourcePos.Y -= targetPos.Y; + targetPos.Y = 0; + } + + if (targetPos.Y + sourceSize.Height >(s32)renderTargetSize.Height) + { + sourceSize.Height -= (targetPos.Y + sourceSize.Height) - renderTargetSize.Height; + if (sourceSize.Height <= 0) + return; + } + + // ok, we've clipped everything. + // now draw it. + + const core::dimension2d& ss = texture->getOriginalSize(); + const f32 invW = 1.f / static_cast(ss.Width); + const f32 invH = 1.f / static_cast(ss.Height); + const core::rect tcoords( + sourcePos.X * invW, + sourcePos.Y * invH, + (sourcePos.X + sourceSize.Width) * invW, + (sourcePos.Y + sourceSize.Height) * invH); + + const core::rect poss(targetPos, sourceSize); + + disableTextures(1); + if (!CacheHandler->getTextureCache().set(0, texture)) + return; + setRenderStates2DMode(color.getAlpha()<255, true, useAlphaChannelOfTexture); + + Quad2DVertices[0].Color = color; + Quad2DVertices[1].Color = color; + Quad2DVertices[2].Color = color; + Quad2DVertices[3].Color = color; + + Quad2DVertices[0].Pos = core::vector3df((f32)poss.UpperLeftCorner.X, (f32)poss.UpperLeftCorner.Y, 0.0f); + Quad2DVertices[1].Pos = core::vector3df((f32)poss.LowerRightCorner.X, (f32)poss.UpperLeftCorner.Y, 0.0f); + Quad2DVertices[2].Pos = core::vector3df((f32)poss.LowerRightCorner.X, (f32)poss.LowerRightCorner.Y, 0.0f); + Quad2DVertices[3].Pos = core::vector3df((f32)poss.UpperLeftCorner.X, (f32)poss.LowerRightCorner.Y, 0.0f); + + Quad2DVertices[0].TCoords = core::vector2df(tcoords.UpperLeftCorner.X, tcoords.UpperLeftCorner.Y); + Quad2DVertices[1].TCoords = core::vector2df(tcoords.LowerRightCorner.X, tcoords.UpperLeftCorner.Y); + Quad2DVertices[2].TCoords = core::vector2df(tcoords.LowerRightCorner.X, tcoords.LowerRightCorner.Y); + Quad2DVertices[3].TCoords = core::vector2df(tcoords.UpperLeftCorner.X, tcoords.LowerRightCorner.Y); + + if (!FeatureAvailable[IRR_ARB_vertex_array_bgra] && !FeatureAvailable[IRR_EXT_vertex_array_bgra]) + getColorBuffer(Quad2DVertices, 4, EVT_STANDARD); + + CacheHandler->setClientState(true, false, true, true); + + glTexCoordPointer(2, GL_FLOAT, sizeof(S3DVertex), &(static_cast(Quad2DVertices))[0].TCoords); + glVertexPointer(2, GL_FLOAT, sizeof(S3DVertex), &(static_cast(Quad2DVertices))[0].Pos); + +#ifdef GL_BGRA + const GLint colorSize = (FeatureAvailable[IRR_ARB_vertex_array_bgra] || FeatureAvailable[IRR_EXT_vertex_array_bgra]) ? GL_BGRA : 4; +#else + const GLint colorSize = 4; +#endif + if (FeatureAvailable[IRR_ARB_vertex_array_bgra] || FeatureAvailable[IRR_EXT_vertex_array_bgra]) + glColorPointer(colorSize, GL_UNSIGNED_BYTE, sizeof(S3DVertex), &(static_cast(Quad2DVertices))[0].Color); + else + { + _IRR_DEBUG_BREAK_IF(ColorBuffer.size() == 0); + glColorPointer(colorSize, GL_UNSIGNED_BYTE, 0, &ColorBuffer[0]); + } + + glDrawElements(GL_TRIANGLE_FAN, 4, GL_UNSIGNED_SHORT, Quad2DIndices); +} + + +void COpenGLDriver::draw2DImage(const video::ITexture* texture, const core::rect& destRect, + const core::rect& sourceRect, const core::rect* clipRect, + const video::SColor* const colors, bool useAlphaChannelOfTexture) +{ + if (!texture) + return; + + const core::dimension2d& ss = texture->getOriginalSize(); + const f32 invW = 1.f / static_cast(ss.Width); + const f32 invH = 1.f / static_cast(ss.Height); + const core::rect tcoords( + sourceRect.UpperLeftCorner.X * invW, + sourceRect.UpperLeftCorner.Y * invH, + sourceRect.LowerRightCorner.X * invW, + sourceRect.LowerRightCorner.Y *invH); + + const video::SColor temp[4] = + { + 0xFFFFFFFF, + 0xFFFFFFFF, + 0xFFFFFFFF, + 0xFFFFFFFF + }; + + const video::SColor* const useColor = colors ? colors : temp; + + disableTextures(1); + if (!CacheHandler->getTextureCache().set(0, texture)) + return; + setRenderStates2DMode(useColor[0].getAlpha()<255 || useColor[1].getAlpha()<255 || + useColor[2].getAlpha()<255 || useColor[3].getAlpha()<255, + true, useAlphaChannelOfTexture); + + if (clipRect) + { + if (!clipRect->isValid()) + return; + + glEnable(GL_SCISSOR_TEST); + const core::dimension2d& renderTargetSize = getCurrentRenderTargetSize(); + glScissor(clipRect->UpperLeftCorner.X, renderTargetSize.Height - clipRect->LowerRightCorner.Y, + clipRect->getWidth(), clipRect->getHeight()); + } + + Quad2DVertices[0].Color = useColor[0]; + Quad2DVertices[1].Color = useColor[3]; + Quad2DVertices[2].Color = useColor[2]; + Quad2DVertices[3].Color = useColor[1]; + + Quad2DVertices[0].Pos = core::vector3df((f32)destRect.UpperLeftCorner.X, (f32)destRect.UpperLeftCorner.Y, 0.0f); + Quad2DVertices[1].Pos = core::vector3df((f32)destRect.LowerRightCorner.X, (f32)destRect.UpperLeftCorner.Y, 0.0f); + Quad2DVertices[2].Pos = core::vector3df((f32)destRect.LowerRightCorner.X, (f32)destRect.LowerRightCorner.Y, 0.0f); + Quad2DVertices[3].Pos = core::vector3df((f32)destRect.UpperLeftCorner.X, (f32)destRect.LowerRightCorner.Y, 0.0f); + + Quad2DVertices[0].TCoords = core::vector2df(tcoords.UpperLeftCorner.X, tcoords.UpperLeftCorner.Y); + Quad2DVertices[1].TCoords = core::vector2df(tcoords.LowerRightCorner.X, tcoords.UpperLeftCorner.Y); + Quad2DVertices[2].TCoords = core::vector2df(tcoords.LowerRightCorner.X, tcoords.LowerRightCorner.Y); + Quad2DVertices[3].TCoords = core::vector2df(tcoords.UpperLeftCorner.X, tcoords.LowerRightCorner.Y); + + if (!FeatureAvailable[IRR_ARB_vertex_array_bgra] && !FeatureAvailable[IRR_EXT_vertex_array_bgra]) + getColorBuffer(Quad2DVertices, 4, EVT_STANDARD); + + CacheHandler->setClientState(true, false, true, true); + + glTexCoordPointer(2, GL_FLOAT, sizeof(S3DVertex), &(static_cast(Quad2DVertices))[0].TCoords); + glVertexPointer(2, GL_FLOAT, sizeof(S3DVertex), &(static_cast(Quad2DVertices))[0].Pos); + +#ifdef GL_BGRA + const GLint colorSize = (FeatureAvailable[IRR_ARB_vertex_array_bgra] || FeatureAvailable[IRR_EXT_vertex_array_bgra]) ? GL_BGRA : 4; +#else + const GLint colorSize = 4; +#endif + if (FeatureAvailable[IRR_ARB_vertex_array_bgra] || FeatureAvailable[IRR_EXT_vertex_array_bgra]) + glColorPointer(colorSize, GL_UNSIGNED_BYTE, sizeof(S3DVertex), &(static_cast(Quad2DVertices))[0].Color); + else + { + _IRR_DEBUG_BREAK_IF(ColorBuffer.size() == 0); + glColorPointer(colorSize, GL_UNSIGNED_BYTE, 0, &ColorBuffer[0]); + } + + glDrawElements(GL_TRIANGLE_FAN, 4, GL_UNSIGNED_SHORT, Quad2DIndices); + + if (clipRect) + glDisable(GL_SCISSOR_TEST); +} + + +void COpenGLDriver::draw2DImage(const video::ITexture* texture, bool flip) +{ + if (!texture || !CacheHandler->getTextureCache().set(0, texture)) + return; + + disableTextures(1); + + setRenderStates2DMode(false, true, true); + + CacheHandler->setMatrixMode(GL_PROJECTION); + glLoadIdentity(); + CacheHandler->setMatrixMode(GL_MODELVIEW); + glLoadIdentity(); + + Transformation3DChanged = true; + + Quad2DVertices[0].Pos = core::vector3df(-1.f, 1.f, 0.f); + Quad2DVertices[1].Pos = core::vector3df(1.f, 1.f, 0.f); + Quad2DVertices[2].Pos = core::vector3df(1.f, -1.f, 0.f); + Quad2DVertices[3].Pos = core::vector3df(-1.f, -1.f, 0.f); + + f32 modificator = (flip) ? 1.f : 0.f; + + Quad2DVertices[0].TCoords = core::vector2df(0.f, 0.f + modificator); + Quad2DVertices[1].TCoords = core::vector2df(1.f, 0.f + modificator); + Quad2DVertices[2].TCoords = core::vector2df(1.f, 1.f - modificator); + Quad2DVertices[3].TCoords = core::vector2df(0.f, 1.f - modificator); + + CacheHandler->setClientState(true, false, false, true); + + glTexCoordPointer(2, GL_FLOAT, sizeof(S3DVertex), &(static_cast(Quad2DVertices))[0].TCoords); + glVertexPointer(2, GL_FLOAT, sizeof(S3DVertex), &(static_cast(Quad2DVertices))[0].Pos); + + glDrawElements(GL_TRIANGLE_FAN, 4, GL_UNSIGNED_SHORT, Quad2DIndices); +} + + //! draws a set of 2d images, using a color and the alpha channel of the //! texture if desired. void COpenGLDriver::draw2DImageBatch(const video::ITexture* texture, @@ -1474,7 +1660,7 @@ void COpenGLDriver::draw2DImageBatch(const video::ITexture* texture, const core::dimension2d& renderTargetSize = getCurrentRenderTargetSize(); disableTextures(1); - if (!setActiveTexture(0, texture)) + if (!CacheHandler->getTextureCache().set(0, texture)) return; setRenderStates2DMode(color.getAlpha()<255, true, useAlphaChannelOfTexture); @@ -1486,7 +1672,7 @@ void COpenGLDriver::draw2DImageBatch(const video::ITexture* texture, if (!FeatureAvailable[IRR_ARB_vertex_array_bgra] && !FeatureAvailable[IRR_EXT_vertex_array_bgra]) getColorBuffer(Quad2DVertices, 4, EVT_STANDARD); - BridgeCalls->setClientState(true, false, true, true); + CacheHandler->setClientState(true, false, true, true); glTexCoordPointer(2, GL_FLOAT, sizeof(S3DVertex), &(static_cast(Quad2DVertices))[0].TCoords); glVertexPointer(2, GL_FLOAT, sizeof(S3DVertex), &(static_cast(Quad2DVertices))[0].Pos); @@ -1612,247 +1798,6 @@ void COpenGLDriver::draw2DImageBatch(const video::ITexture* texture, } -//! draws a 2d image, using a color and the alpha channel of the texture if -//! desired. The image is drawn at pos, clipped against clipRect (if != 0). -//! Only the subtexture defined by sourceRect is used. -void COpenGLDriver::draw2DImage(const video::ITexture* texture, - const core::position2d& pos, - const core::rect& sourceRect, - const core::rect* clipRect, SColor color, - bool useAlphaChannelOfTexture) -{ - if (!texture) - return; - - if (!sourceRect.isValid()) - return; - - core::position2d targetPos(pos); - core::position2d sourcePos(sourceRect.UpperLeftCorner); - // This needs to be signed as it may go negative. - core::dimension2d sourceSize(sourceRect.getSize()); - if (clipRect) - { - if (targetPos.X < clipRect->UpperLeftCorner.X) - { - sourceSize.Width += targetPos.X - clipRect->UpperLeftCorner.X; - if (sourceSize.Width <= 0) - return; - - sourcePos.X -= targetPos.X - clipRect->UpperLeftCorner.X; - targetPos.X = clipRect->UpperLeftCorner.X; - } - - if (targetPos.X + sourceSize.Width > clipRect->LowerRightCorner.X) - { - sourceSize.Width -= (targetPos.X + sourceSize.Width) - clipRect->LowerRightCorner.X; - if (sourceSize.Width <= 0) - return; - } - - if (targetPos.Y < clipRect->UpperLeftCorner.Y) - { - sourceSize.Height += targetPos.Y - clipRect->UpperLeftCorner.Y; - if (sourceSize.Height <= 0) - return; - - sourcePos.Y -= targetPos.Y - clipRect->UpperLeftCorner.Y; - targetPos.Y = clipRect->UpperLeftCorner.Y; - } - - if (targetPos.Y + sourceSize.Height > clipRect->LowerRightCorner.Y) - { - sourceSize.Height -= (targetPos.Y + sourceSize.Height) - clipRect->LowerRightCorner.Y; - if (sourceSize.Height <= 0) - return; - } - } - - // clip these coordinates - - if (targetPos.X<0) - { - sourceSize.Width += targetPos.X; - if (sourceSize.Width <= 0) - return; - - sourcePos.X -= targetPos.X; - targetPos.X = 0; - } - - const core::dimension2d& renderTargetSize = getCurrentRenderTargetSize(); - - if (targetPos.X + sourceSize.Width > (s32)renderTargetSize.Width) - { - sourceSize.Width -= (targetPos.X + sourceSize.Width) - renderTargetSize.Width; - if (sourceSize.Width <= 0) - return; - } - - if (targetPos.Y<0) - { - sourceSize.Height += targetPos.Y; - if (sourceSize.Height <= 0) - return; - - sourcePos.Y -= targetPos.Y; - targetPos.Y = 0; - } - - if (targetPos.Y + sourceSize.Height > (s32)renderTargetSize.Height) - { - sourceSize.Height -= (targetPos.Y + sourceSize.Height) - renderTargetSize.Height; - if (sourceSize.Height <= 0) - return; - } - - // ok, we've clipped everything. - // now draw it. - - const core::dimension2d& ss = texture->getOriginalSize(); - const f32 invW = 1.f / static_cast(ss.Width); - const f32 invH = 1.f / static_cast(ss.Height); - const core::rect tcoords( - sourcePos.X * invW, - sourcePos.Y * invH, - (sourcePos.X + sourceSize.Width) * invW, - (sourcePos.Y + sourceSize.Height) * invH); - - const core::rect poss(targetPos, sourceSize); - - disableTextures(1); - if (!setActiveTexture(0, texture)) - return; - setRenderStates2DMode(color.getAlpha()<255, true, useAlphaChannelOfTexture); - - Quad2DVertices[0].Color = color; - Quad2DVertices[1].Color = color; - Quad2DVertices[2].Color = color; - Quad2DVertices[3].Color = color; - - Quad2DVertices[0].Pos = core::vector3df((f32)poss.UpperLeftCorner.X, (f32)poss.UpperLeftCorner.Y, 0.0f); - Quad2DVertices[1].Pos = core::vector3df((f32)poss.LowerRightCorner.X, (f32)poss.UpperLeftCorner.Y, 0.0f); - Quad2DVertices[2].Pos = core::vector3df((f32)poss.LowerRightCorner.X, (f32)poss.LowerRightCorner.Y, 0.0f); - Quad2DVertices[3].Pos = core::vector3df((f32)poss.UpperLeftCorner.X, (f32)poss.LowerRightCorner.Y, 0.0f); - - Quad2DVertices[0].TCoords = core::vector2df(tcoords.UpperLeftCorner.X, tcoords.UpperLeftCorner.Y); - Quad2DVertices[1].TCoords = core::vector2df(tcoords.LowerRightCorner.X, tcoords.UpperLeftCorner.Y); - Quad2DVertices[2].TCoords = core::vector2df(tcoords.LowerRightCorner.X, tcoords.LowerRightCorner.Y); - Quad2DVertices[3].TCoords = core::vector2df(tcoords.UpperLeftCorner.X, tcoords.LowerRightCorner.Y); - - if (!FeatureAvailable[IRR_ARB_vertex_array_bgra] && !FeatureAvailable[IRR_EXT_vertex_array_bgra]) - getColorBuffer(Quad2DVertices, 4, EVT_STANDARD); - - BridgeCalls->setClientState(true, false, true, true); - - glTexCoordPointer(2, GL_FLOAT, sizeof(S3DVertex), &(static_cast(Quad2DVertices))[0].TCoords); - glVertexPointer(2, GL_FLOAT, sizeof(S3DVertex), &(static_cast(Quad2DVertices))[0].Pos); - -#ifdef GL_BGRA - const GLint colorSize=(FeatureAvailable[IRR_ARB_vertex_array_bgra] || FeatureAvailable[IRR_EXT_vertex_array_bgra])?GL_BGRA:4; -#else - const GLint colorSize=4; -#endif - if (FeatureAvailable[IRR_ARB_vertex_array_bgra] || FeatureAvailable[IRR_EXT_vertex_array_bgra]) - glColorPointer(colorSize, GL_UNSIGNED_BYTE, sizeof(S3DVertex), &(static_cast(Quad2DVertices))[0].Color); - else - { - _IRR_DEBUG_BREAK_IF(ColorBuffer.size()==0); - glColorPointer(colorSize, GL_UNSIGNED_BYTE, 0, &ColorBuffer[0]); - } - - glDrawElements(GL_TRIANGLE_FAN, 4, GL_UNSIGNED_SHORT, Quad2DIndices); -} - - -//! The same, but with a four element array of colors, one for each vertex -void COpenGLDriver::draw2DImage(const video::ITexture* texture, const core::rect& destRect, - const core::rect& sourceRect, const core::rect* clipRect, - const video::SColor* const colors, bool useAlphaChannelOfTexture) -{ - if (!texture) - return; - - const core::dimension2d& ss = texture->getOriginalSize(); - const f32 invW = 1.f / static_cast(ss.Width); - const f32 invH = 1.f / static_cast(ss.Height); - const core::rect tcoords( - sourceRect.UpperLeftCorner.X * invW, - sourceRect.UpperLeftCorner.Y * invH, - sourceRect.LowerRightCorner.X * invW, - sourceRect.LowerRightCorner.Y *invH); - - const video::SColor temp[4] = - { - 0xFFFFFFFF, - 0xFFFFFFFF, - 0xFFFFFFFF, - 0xFFFFFFFF - }; - - const video::SColor* const useColor = colors ? colors : temp; - - disableTextures(1); - if (!setActiveTexture(0, texture)) - return; - setRenderStates2DMode(useColor[0].getAlpha()<255 || useColor[1].getAlpha()<255 || - useColor[2].getAlpha()<255 || useColor[3].getAlpha()<255, - true, useAlphaChannelOfTexture); - - if (clipRect) - { - if (!clipRect->isValid()) - return; - - glEnable(GL_SCISSOR_TEST); - const core::dimension2d& renderTargetSize = getCurrentRenderTargetSize(); - glScissor(clipRect->UpperLeftCorner.X, renderTargetSize.Height-clipRect->LowerRightCorner.Y, - clipRect->getWidth(), clipRect->getHeight()); - } - - Quad2DVertices[0].Color = useColor[0]; - Quad2DVertices[1].Color = useColor[3]; - Quad2DVertices[2].Color = useColor[2]; - Quad2DVertices[3].Color = useColor[1]; - - Quad2DVertices[0].Pos = core::vector3df((f32)destRect.UpperLeftCorner.X, (f32)destRect.UpperLeftCorner.Y, 0.0f); - Quad2DVertices[1].Pos = core::vector3df((f32)destRect.LowerRightCorner.X, (f32)destRect.UpperLeftCorner.Y, 0.0f); - Quad2DVertices[2].Pos = core::vector3df((f32)destRect.LowerRightCorner.X, (f32)destRect.LowerRightCorner.Y, 0.0f); - Quad2DVertices[3].Pos = core::vector3df((f32)destRect.UpperLeftCorner.X, (f32)destRect.LowerRightCorner.Y, 0.0f); - - Quad2DVertices[0].TCoords = core::vector2df(tcoords.UpperLeftCorner.X, tcoords.UpperLeftCorner.Y); - Quad2DVertices[1].TCoords = core::vector2df(tcoords.LowerRightCorner.X, tcoords.UpperLeftCorner.Y); - Quad2DVertices[2].TCoords = core::vector2df(tcoords.LowerRightCorner.X, tcoords.LowerRightCorner.Y); - Quad2DVertices[3].TCoords = core::vector2df(tcoords.UpperLeftCorner.X, tcoords.LowerRightCorner.Y); - - if (!FeatureAvailable[IRR_ARB_vertex_array_bgra] && !FeatureAvailable[IRR_EXT_vertex_array_bgra]) - getColorBuffer(Quad2DVertices, 4, EVT_STANDARD); - - BridgeCalls->setClientState(true, false, true, true); - - glTexCoordPointer(2, GL_FLOAT, sizeof(S3DVertex), &(static_cast(Quad2DVertices))[0].TCoords); - glVertexPointer(2, GL_FLOAT, sizeof(S3DVertex), &(static_cast(Quad2DVertices))[0].Pos); - -#ifdef GL_BGRA - const GLint colorSize=(FeatureAvailable[IRR_ARB_vertex_array_bgra] || FeatureAvailable[IRR_EXT_vertex_array_bgra])?GL_BGRA:4; -#else - const GLint colorSize=4; -#endif - if (FeatureAvailable[IRR_ARB_vertex_array_bgra] || FeatureAvailable[IRR_EXT_vertex_array_bgra]) - glColorPointer(colorSize, GL_UNSIGNED_BYTE, sizeof(S3DVertex), &(static_cast(Quad2DVertices))[0].Color); - else - { - _IRR_DEBUG_BREAK_IF(ColorBuffer.size()==0); - glColorPointer(colorSize, GL_UNSIGNED_BYTE, 0, &ColorBuffer[0]); - } - - glDrawElements(GL_TRIANGLE_FAN, 4, GL_UNSIGNED_SHORT, Quad2DIndices); - - if (clipRect) - glDisable(GL_SCISSOR_TEST); -} - - //! draws a set of 2d images, using a color and the alpha channel of the //! texture if desired. The images are drawn beginning at pos and concatenated //! in one line. All drawings are clipped against clipRect (if != 0). @@ -1870,7 +1815,7 @@ void COpenGLDriver::draw2DImageBatch(const video::ITexture* texture, return; disableTextures(1); - if (!setActiveTexture(0, texture)) + if (!CacheHandler->getTextureCache().set(0, texture)) return; setRenderStates2DMode(color.getAlpha()<255, true, useAlphaChannelOfTexture); @@ -1898,7 +1843,7 @@ void COpenGLDriver::draw2DImageBatch(const video::ITexture* texture, if (!FeatureAvailable[IRR_ARB_vertex_array_bgra] && !FeatureAvailable[IRR_EXT_vertex_array_bgra]) getColorBuffer(Quad2DVertices, 4, EVT_STANDARD); - BridgeCalls->setClientState(true, false, true, true); + CacheHandler->setClientState(true, false, true, true); glTexCoordPointer(2, GL_FLOAT, sizeof(S3DVertex), &(static_cast(Quad2DVertices))[0].TCoords); glVertexPointer(2, GL_FLOAT, sizeof(S3DVertex), &(static_cast(Quad2DVertices))[0].Pos); @@ -2004,7 +1949,7 @@ void COpenGLDriver::draw2DRectangle(const core::rect& position, if (!FeatureAvailable[IRR_ARB_vertex_array_bgra] && !FeatureAvailable[IRR_EXT_vertex_array_bgra]) getColorBuffer(Quad2DVertices, 4, EVT_STANDARD); - BridgeCalls->setClientState(true, false, true, false); + CacheHandler->setClientState(true, false, true, false); glVertexPointer(2, GL_FLOAT, sizeof(S3DVertex), &(static_cast(Quad2DVertices))[0].Pos); @@ -2045,7 +1990,7 @@ void COpenGLDriver::draw2DLine(const core::position2d& start, if (!FeatureAvailable[IRR_ARB_vertex_array_bgra] && !FeatureAvailable[IRR_EXT_vertex_array_bgra]) getColorBuffer(Quad2DVertices, 2, EVT_STANDARD); - BridgeCalls->setClientState(true, false, true, false); + CacheHandler->setClientState(true, false, true, false); glVertexPointer(2, GL_FLOAT, sizeof(S3DVertex), &(static_cast(Quad2DVertices))[0].Pos); @@ -2083,7 +2028,7 @@ void COpenGLDriver::drawPixel(u32 x, u32 y, const SColor &color) if (!FeatureAvailable[IRR_ARB_vertex_array_bgra] && !FeatureAvailable[IRR_EXT_vertex_array_bgra]) getColorBuffer(Quad2DVertices, 1, EVT_STANDARD); - BridgeCalls->setClientState(true, false, true, false); + CacheHandler->setClientState(true, false, true, false); glVertexPointer(2, GL_FLOAT, sizeof(S3DVertex), &(static_cast(Quad2DVertices))[0].Pos); @@ -2103,38 +2048,14 @@ void COpenGLDriver::drawPixel(u32 x, u32 y, const SColor &color) glDrawArrays(GL_POINTS, 0, 1); } -bool COpenGLDriver::setActiveTexture(u32 stage, const video::ITexture* texture) -{ - if (stage >= MaxSupportedTextures) - return false; - - if (CurrentTexture[stage]==texture) - return true; - - CurrentTexture.set(stage,texture); - - if (!texture) - return true; - else if (texture->getDriverType() != EDT_OPENGL) - { - CurrentTexture.set(stage, 0); - os::Printer::log("Fatal Error: Tried to set a texture not owned by this driver.", ELL_ERROR); - return false; - } - - return true; -} - - //! disables all textures beginning with the optional fromStage parameter. Otherwise all texture stages are disabled. //! Returns whether disabling was successful or not. bool COpenGLDriver::disableTextures(u32 fromStage) { bool result=true; - for (u32 i=fromStage; isetTexture(i, GL_TEXTURE_2D, true); + result &= CacheHandler->getTextureCache().set(i, 0); } return result; } @@ -2173,12 +2094,17 @@ inline void COpenGLDriver::getGLTextureMatrix(GLfloat *o, const core::matrix4& m //! returns a device dependent texture from a software surface (IImage) -ITexture* COpenGLDriver::createDeviceDependentTexture(IImage* surface, const io::path& name, void* mipmapData) +video::ITexture* COpenGLDriver::createDeviceDependentTexture(IImage* surface, const io::path& name) { COpenGLTexture* texture = 0; if (surface && checkColorFormat(surface->getColorFormat(), surface->getDimension())) - texture = new COpenGLTexture(surface, name, mipmapData, this); + { + core::array imageArray(1); + imageArray.push_back(surface); + + texture = new COpenGLTexture(name, imageArray, this); + } return texture; } @@ -2194,7 +2120,8 @@ ITexture* COpenGLDriver::createDeviceDependentTextureCube(const io::path& name, checkTextureCube(posXImage, negXImage, posYImage, negYImage, posZImage, negZImage) && checkColorFormat(posXImage->getColorFormat(), posXImage->getDimension())) { - texture = new COpenGLTexture(name, posXImage, negXImage, posYImage, negYImage, posZImage, negZImage, this); + // TO-DO + // texture = new COpenGLTexture(name, posXImage, negXImage, posYImage, negYImage, posZImage, negZImage, this); } return texture; @@ -2207,9 +2134,9 @@ void COpenGLDriver::setMaterial(const SMaterial& material) Material = material; OverrideMaterial.apply(Material); - for (u32 i = 0; i < MaxTextureUnits; ++i) + for (u32 i = 0; i < Feature.TextureUnit; ++i) { - setActiveTexture(i, material.getTexture(i)); + CacheHandler->getTextureCache().set(i, material.getTexture(i)); setTransform((E_TRANSFORMATION_STATE)(ETS_TEXTURE_0 + i), material.getTextureMatrix(i)); } } @@ -2257,15 +2184,15 @@ void COpenGLDriver::setRenderStates3DMode() if (CurrentRenderMode != ERM_3D) { // Reset Texture Stages - BridgeCalls->setBlend(false); - BridgeCalls->setAlphaTest(false); - BridgeCalls->setBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA); + CacheHandler->setBlend(false); + CacheHandler->setAlphaTest(false); + CacheHandler->setBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA); // switch back the matrices - BridgeCalls->setMatrixMode(GL_MODELVIEW); + CacheHandler->setMatrixMode(GL_MODELVIEW); glLoadMatrixf((Matrices[ETS_VIEW] * Matrices[ETS_WORLD]).pointer()); - BridgeCalls->setMatrixMode(GL_PROJECTION); + CacheHandler->setMatrixMode(GL_PROJECTION); glLoadMatrixf(Matrices[ETS_PROJECTION].pointer()); ResetRenderStates = true; @@ -2569,101 +2496,92 @@ void COpenGLDriver::setBasicRenderStates(const SMaterial& material, const SMater if (resetAllRenderStates || (lastmaterial.Wireframe != material.Wireframe) || (lastmaterial.PointCloud != material.PointCloud)) glPolygonMode(GL_FRONT_AND_BACK, material.Wireframe ? GL_LINE : material.PointCloud? GL_POINT : GL_FILL); - // zbuffer - if (resetAllRenderStates || lastmaterial.ZBuffer != material.ZBuffer) + // ZBuffer + switch (material.ZBuffer) { - switch (material.ZBuffer) - { - case ECFN_DISABLED: - BridgeCalls->setDepthTest(false); - break; - case ECFN_LESSEQUAL: - BridgeCalls->setDepthTest(true); - BridgeCalls->setDepthFunc(GL_LEQUAL); - break; - case ECFN_EQUAL: - BridgeCalls->setDepthTest(true); - BridgeCalls->setDepthFunc(GL_EQUAL); - break; - case ECFN_LESS: - BridgeCalls->setDepthTest(true); - BridgeCalls->setDepthFunc(GL_LESS); - break; - case ECFN_NOTEQUAL: - BridgeCalls->setDepthTest(true); - BridgeCalls->setDepthFunc(GL_NOTEQUAL); - break; - case ECFN_GREATEREQUAL: - BridgeCalls->setDepthTest(true); - BridgeCalls->setDepthFunc(GL_GEQUAL); - break; - case ECFN_GREATER: - BridgeCalls->setDepthTest(true); - BridgeCalls->setDepthFunc(GL_GREATER); - break; - case ECFN_ALWAYS: - BridgeCalls->setDepthTest(true); - BridgeCalls->setDepthFunc(GL_ALWAYS); - break; - case ECFN_NEVER: - BridgeCalls->setDepthTest(true); - BridgeCalls->setDepthFunc(GL_NEVER); - break; - } + case ECFN_DISABLED: + CacheHandler->setDepthTest(false); + break; + case ECFN_LESSEQUAL: + CacheHandler->setDepthTest(true); + CacheHandler->setDepthFunc(GL_LEQUAL); + break; + case ECFN_EQUAL: + CacheHandler->setDepthTest(true); + CacheHandler->setDepthFunc(GL_EQUAL); + break; + case ECFN_LESS: + CacheHandler->setDepthTest(true); + CacheHandler->setDepthFunc(GL_LESS); + break; + case ECFN_NOTEQUAL: + CacheHandler->setDepthTest(true); + CacheHandler->setDepthFunc(GL_NOTEQUAL); + break; + case ECFN_GREATEREQUAL: + CacheHandler->setDepthTest(true); + CacheHandler->setDepthFunc(GL_GEQUAL); + break; + case ECFN_GREATER: + CacheHandler->setDepthTest(true); + CacheHandler->setDepthFunc(GL_GREATER); + break; + case ECFN_ALWAYS: + CacheHandler->setDepthTest(true); + CacheHandler->setDepthFunc(GL_ALWAYS); + break; + case ECFN_NEVER: + CacheHandler->setDepthTest(true); + CacheHandler->setDepthFunc(GL_NEVER); + break; + default: + break; } - // zwrite -// if (resetAllRenderStates || lastmaterial.ZWriteEnable != material.ZWriteEnable) + // ZWrite + if (getWriteZBuffer(material)) { - if (material.ZWriteEnable && (AllowZWriteOnTransparent || (!material.isTransparent() && - !MaterialRenderers[material.MaterialType].Renderer->isTransparent()))) - { - BridgeCalls->setDepthMask(true); - } - else - BridgeCalls->setDepthMask(false); + CacheHandler->setDepthMask(true); + } + else + { + CacheHandler->setDepthMask(false); } - // back face culling - if (resetAllRenderStates || (lastmaterial.FrontfaceCulling != material.FrontfaceCulling) || (lastmaterial.BackfaceCulling != material.BackfaceCulling)) + // Back face culling + if ((material.FrontfaceCulling) && (material.BackfaceCulling)) { - if ((material.FrontfaceCulling) && (material.BackfaceCulling)) - { - BridgeCalls->setCullFaceFunc(GL_FRONT_AND_BACK); - BridgeCalls->setCullFace(true); - } - else - if (material.BackfaceCulling) - { - BridgeCalls->setCullFaceFunc(GL_BACK); - BridgeCalls->setCullFace(true); - } - else - if (material.FrontfaceCulling) - { - BridgeCalls->setCullFaceFunc(GL_FRONT); - BridgeCalls->setCullFace(true); - } - else - BridgeCalls->setCullFace(false); + CacheHandler->setCullFaceFunc(GL_FRONT_AND_BACK); + CacheHandler->setCullFace(true); + } + else if (material.BackfaceCulling) + { + CacheHandler->setCullFaceFunc(GL_BACK); + CacheHandler->setCullFace(true); + } + else if (material.FrontfaceCulling) + { + CacheHandler->setCullFaceFunc(GL_FRONT); + CacheHandler->setCullFace(true); + } + else + { + CacheHandler->setCullFace(false); } // Color Mask - if (resetAllRenderStates || lastmaterial.ColorMask != material.ColorMask) - { - glColorMask( - (material.ColorMask & ECP_RED)?GL_TRUE:GL_FALSE, - (material.ColorMask & ECP_GREEN)?GL_TRUE:GL_FALSE, - (material.ColorMask & ECP_BLUE)?GL_TRUE:GL_FALSE, - (material.ColorMask & ECP_ALPHA)?GL_TRUE:GL_FALSE); - } + CacheHandler->setColorMask( + (material.ColorMask & ECP_RED)?GL_TRUE:GL_FALSE, + (material.ColorMask & ECP_GREEN)?GL_TRUE:GL_FALSE, + (material.ColorMask & ECP_BLUE)?GL_TRUE:GL_FALSE, + (material.ColorMask & ECP_ALPHA)?GL_TRUE:GL_FALSE); // Blend Equation if (material.BlendOperation == EBO_NONE) - BridgeCalls->setBlend(false); + CacheHandler->setBlend(false); else { - BridgeCalls->setBlend(true); + CacheHandler->setBlend(true); #if defined(GL_EXT_blend_subtract) || defined(GL_EXT_blend_minmax) || defined(GL_EXT_blend_logic_op) || defined(GL_VERSION_1_4) if (queryFeature(EVDF_BLEND_OPERATIONS)) @@ -2672,83 +2590,83 @@ void COpenGLDriver::setBasicRenderStates(const SMaterial& material, const SMater { case EBO_SUBTRACT: #if defined(GL_VERSION_1_4) - BridgeCalls->setBlendEquation(GL_FUNC_SUBTRACT); + CacheHandler->setBlendEquation(GL_FUNC_SUBTRACT); #elif defined(GL_EXT_blend_subtract) - BridgeCalls->setBlendEquation(GL_FUNC_SUBTRACT_EXT); + CacheHandler->setBlendEquation(GL_FUNC_SUBTRACT_EXT); #endif break; case EBO_REVSUBTRACT: #if defined(GL_VERSION_1_4) - BridgeCalls->setBlendEquation(GL_FUNC_REVERSE_SUBTRACT); + CacheHandler->setBlendEquation(GL_FUNC_REVERSE_SUBTRACT); #elif defined(GL_EXT_blend_subtract) - BridgeCalls->setBlendEquation(GL_FUNC_REVERSE_SUBTRACT_EXT); + CacheHandler->setBlendEquation(GL_FUNC_REVERSE_SUBTRACT_EXT); #endif break; case EBO_MIN: #if defined(GL_VERSION_1_4) - BridgeCalls->setBlendEquation(GL_MIN); + CacheHandler->setBlendEquation(GL_MIN); #elif defined(GL_EXT_blend_minmax) - BridgeCalls->setBlendEquation(GL_MIN_EXT); + CacheHandler->setBlendEquation(GL_MIN_EXT); #endif break; case EBO_MAX: #if defined(GL_VERSION_1_4) - BridgeCalls->setBlendEquation(GL_MAX); + CacheHandler->setBlendEquation(GL_MAX); #elif defined(GL_EXT_blend_minmax) - BridgeCalls->setBlendEquation(GL_MAX_EXT); + CacheHandler->setBlendEquation(GL_MAX_EXT); #endif break; case EBO_MIN_FACTOR: #if defined(GL_AMD_blend_minmax_factor) if (FeatureAvailable[IRR_AMD_blend_minmax_factor]) - BridgeCalls->setBlendEquation(GL_FACTOR_MIN_AMD); + CacheHandler->setBlendEquation(GL_FACTOR_MIN_AMD); #endif // fallback in case of missing extension #if defined(GL_VERSION_1_4) #if defined(GL_AMD_blend_minmax_factor) else #endif - BridgeCalls->setBlendEquation(GL_MIN); + CacheHandler->setBlendEquation(GL_MIN); #endif break; case EBO_MAX_FACTOR: #if defined(GL_AMD_blend_minmax_factor) if (FeatureAvailable[IRR_AMD_blend_minmax_factor]) - BridgeCalls->setBlendEquation(GL_FACTOR_MAX_AMD); + CacheHandler->setBlendEquation(GL_FACTOR_MAX_AMD); #endif // fallback in case of missing extension #if defined(GL_VERSION_1_4) #if defined(GL_AMD_blend_minmax_factor) else #endif - BridgeCalls->setBlendEquation(GL_MAX); + CacheHandler->setBlendEquation(GL_MAX); #endif break; case EBO_MIN_ALPHA: #if defined(GL_SGIX_blend_alpha_minmax) if (FeatureAvailable[IRR_SGIX_blend_alpha_minmax]) - BridgeCalls->setBlendEquation(GL_ALPHA_MIN_SGIX); + CacheHandler->setBlendEquation(GL_ALPHA_MIN_SGIX); // fallback in case of missing extension else if (FeatureAvailable[IRR_EXT_blend_minmax]) - BridgeCalls->setBlendEquation(GL_MIN_EXT); + CacheHandler->setBlendEquation(GL_MIN_EXT); #endif break; case EBO_MAX_ALPHA: #if defined(GL_SGIX_blend_alpha_minmax) if (FeatureAvailable[IRR_SGIX_blend_alpha_minmax]) - BridgeCalls->setBlendEquation(GL_ALPHA_MAX_SGIX); + CacheHandler->setBlendEquation(GL_ALPHA_MAX_SGIX); // fallback in case of missing extension else if (FeatureAvailable[IRR_EXT_blend_minmax]) - BridgeCalls->setBlendEquation(GL_MAX_EXT); + CacheHandler->setBlendEquation(GL_MAX_EXT); #endif break; default: #if defined(GL_VERSION_1_4) - BridgeCalls->setBlendEquation(GL_FUNC_ADD); + CacheHandler->setBlendEquation(GL_FUNC_ADD); #elif defined(GL_EXT_blend_subtract) || defined(GL_EXT_blend_minmax) || defined(GL_EXT_blend_logic_op) - BridgeCalls->setBlendEquation(GL_FUNC_ADD_EXT); + CacheHandler->setBlendEquation(GL_FUNC_ADD_EXT); #endif break; } @@ -2770,12 +2688,12 @@ void COpenGLDriver::setBasicRenderStates(const SMaterial& material, const SMater if (queryFeature(EVDF_BLEND_SEPARATE)) { - BridgeCalls->setBlendFuncSeparate(getGLBlend(srcRGBFact), getGLBlend(dstRGBFact), + CacheHandler->setBlendFuncSeparate(getGLBlend(srcRGBFact), getGLBlend(dstRGBFact), getGLBlend(srcAlphaFact), getGLBlend(dstAlphaFact)); } else { - BridgeCalls->setBlendFunc(getGLBlend(srcRGBFact), getGLBlend(dstRGBFact)); + CacheHandler->setBlendFunc(getGLBlend(srcRGBFact), getGLBlend(dstRGBFact)); } } @@ -2856,6 +2774,7 @@ void COpenGLDriver::setBasicRenderStates(const SMaterial& material, const SMater } } + // Texture parameters setTextureRenderStates(material, resetAllRenderStates); // set current fixed pipeline state @@ -2867,33 +2786,50 @@ void COpenGLDriver::setTextureRenderStates(const SMaterial& material, bool reset { // Set textures to TU/TIU and apply filters to them - for (s32 i = MaxTextureUnits-1; i>= 0; --i) + for (s32 i = Feature.TextureUnit - 1; i>= 0; --i) { - const COpenGLTexture* tmpTexture = static_cast(CurrentTexture[i]); - GLenum tmpTextureType = (tmpTexture) ? tmpTexture->getOpenGLTextureType() : GL_TEXTURE_2D; - bool fixedPipeline = false; - if(FixedPipelineState == EOFPS_ENABLE || FixedPipelineState == EOFPS_DISABLE_TO_ENABLE) - { - if (i>0 && !MultiTextureExtension) - break; - + if (FixedPipelineState == EOFPS_ENABLE || FixedPipelineState == EOFPS_DISABLE_TO_ENABLE) fixedPipeline = true; + + const COpenGLTexture* tmpTexture = CacheHandler->getTextureCache().get(i); + + if (!tmpTexture) + continue; + + GLenum tmpTextureType = tmpTexture->getOpenGLTextureType(); + + CacheHandler->setActiveTexture(GL_TEXTURE0 + i); + + if (fixedPipeline) + { + const bool isRTT = tmpTexture->isRenderTarget(); + + CacheHandler->setMatrixMode(GL_TEXTURE); + + if (!isRTT && Matrices[ETS_TEXTURE_0 + i].isIdentity()) + glLoadIdentity(); + else + { + GLfloat glmat[16]; + if (isRTT) + getGLTextureMatrix(glmat, Matrices[ETS_TEXTURE_0 + i] * TextureFlipMatrix); + else + getGLTextureMatrix(glmat, Matrices[ETS_TEXTURE_0 + i]); + glLoadMatrixf(glmat); + } } - BridgeCalls->setTexture(i, tmpTextureType, fixedPipeline); + COpenGLTexture::SStatesCache& statesCache = tmpTexture->getStatesCache(); - if (!CurrentTexture[i]) - continue; - - if(resetAllRenderstates) - tmpTexture->getStatesCache().IsCached = false; + if (resetAllRenderstates) + statesCache.IsCached = false; #ifdef GL_VERSION_2_1 if (Version>=210) { - if(!tmpTexture->getStatesCache().IsCached || material.TextureLayer[i].LODBias != tmpTexture->getStatesCache().LODBias) + if(!statesCache.IsCached || material.TextureLayer[i].LODBias != statesCache.LODBias) { if (material.TextureLayer[i].LODBias) { @@ -2903,7 +2839,7 @@ void COpenGLDriver::setTextureRenderStates(const SMaterial& material, bool reset else glTexParameterf(tmpTextureType, GL_TEXTURE_LOD_BIAS, 0.f); - tmpTexture->getStatesCache().LODBias = material.TextureLayer[i].LODBias; + statesCache.LODBias = material.TextureLayer[i].LODBias; } } else if (FeatureAvailable[IRR_EXT_texture_lod_bias]) @@ -2929,73 +2865,73 @@ void COpenGLDriver::setTextureRenderStates(const SMaterial& material, bool reset } #endif - if(!tmpTexture->getStatesCache().IsCached || material.TextureLayer[i].BilinearFilter != tmpTexture->getStatesCache().BilinearFilter || - material.TextureLayer[i].TrilinearFilter != tmpTexture->getStatesCache().TrilinearFilter) + if(!statesCache.IsCached || material.TextureLayer[i].BilinearFilter != statesCache.BilinearFilter || + material.TextureLayer[i].TrilinearFilter != statesCache.TrilinearFilter) { glTexParameteri(tmpTextureType, GL_TEXTURE_MAG_FILTER, (material.TextureLayer[i].BilinearFilter || material.TextureLayer[i].TrilinearFilter) ? GL_LINEAR : GL_NEAREST); - tmpTexture->getStatesCache().BilinearFilter = material.TextureLayer[i].BilinearFilter; - tmpTexture->getStatesCache().TrilinearFilter = material.TextureLayer[i].TrilinearFilter; + statesCache.BilinearFilter = material.TextureLayer[i].BilinearFilter; + statesCache.TrilinearFilter = material.TextureLayer[i].TrilinearFilter; } - if (material.UseMipMaps && CurrentTexture[i]->hasMipMaps()) + if (material.UseMipMaps && tmpTexture->hasMipMaps()) { - if(!tmpTexture->getStatesCache().IsCached || material.TextureLayer[i].BilinearFilter != tmpTexture->getStatesCache().BilinearFilter || - material.TextureLayer[i].TrilinearFilter != tmpTexture->getStatesCache().TrilinearFilter || !tmpTexture->getStatesCache().MipMapStatus) + if(!statesCache.IsCached || material.TextureLayer[i].BilinearFilter != statesCache.BilinearFilter || + material.TextureLayer[i].TrilinearFilter != statesCache.TrilinearFilter || !statesCache.MipMapStatus) { glTexParameteri(tmpTextureType, GL_TEXTURE_MIN_FILTER, material.TextureLayer[i].TrilinearFilter ? GL_LINEAR_MIPMAP_LINEAR : material.TextureLayer[i].BilinearFilter ? GL_LINEAR_MIPMAP_NEAREST : GL_NEAREST_MIPMAP_NEAREST); - tmpTexture->getStatesCache().BilinearFilter = material.TextureLayer[i].BilinearFilter; - tmpTexture->getStatesCache().TrilinearFilter = material.TextureLayer[i].TrilinearFilter; - tmpTexture->getStatesCache().MipMapStatus = true; + statesCache.BilinearFilter = material.TextureLayer[i].BilinearFilter; + statesCache.TrilinearFilter = material.TextureLayer[i].TrilinearFilter; + statesCache.MipMapStatus = true; } } else { - if(!tmpTexture->getStatesCache().IsCached || material.TextureLayer[i].BilinearFilter != tmpTexture->getStatesCache().BilinearFilter || - material.TextureLayer[i].TrilinearFilter != tmpTexture->getStatesCache().TrilinearFilter || tmpTexture->getStatesCache().MipMapStatus) + if(!statesCache.IsCached || material.TextureLayer[i].BilinearFilter != statesCache.BilinearFilter || + material.TextureLayer[i].TrilinearFilter != statesCache.TrilinearFilter || statesCache.MipMapStatus) { glTexParameteri(tmpTextureType, GL_TEXTURE_MIN_FILTER, (material.TextureLayer[i].BilinearFilter || material.TextureLayer[i].TrilinearFilter) ? GL_LINEAR : GL_NEAREST); - tmpTexture->getStatesCache().BilinearFilter = material.TextureLayer[i].BilinearFilter; - tmpTexture->getStatesCache().TrilinearFilter = material.TextureLayer[i].TrilinearFilter; - tmpTexture->getStatesCache().MipMapStatus = false; + statesCache.BilinearFilter = material.TextureLayer[i].BilinearFilter; + statesCache.TrilinearFilter = material.TextureLayer[i].TrilinearFilter; + statesCache.MipMapStatus = false; } } #ifdef GL_EXT_texture_filter_anisotropic if (FeatureAvailable[IRR_EXT_texture_filter_anisotropic] && - (!tmpTexture->getStatesCache().IsCached || material.TextureLayer[i].AnisotropicFilter != tmpTexture->getStatesCache().AnisotropicFilter)) + (!statesCache.IsCached || material.TextureLayer[i].AnisotropicFilter != statesCache.AnisotropicFilter)) { glTexParameteri(tmpTextureType, GL_TEXTURE_MAX_ANISOTROPY_EXT, material.TextureLayer[i].AnisotropicFilter>1 ? core::min_(MaxAnisotropy, material.TextureLayer[i].AnisotropicFilter) : 1); - tmpTexture->getStatesCache().AnisotropicFilter = material.TextureLayer[i].AnisotropicFilter; + statesCache.AnisotropicFilter = material.TextureLayer[i].AnisotropicFilter; } #endif - if(!tmpTexture->getStatesCache().IsCached || material.TextureLayer[i].TextureWrapU != tmpTexture->getStatesCache().WrapU) + if(!statesCache.IsCached || material.TextureLayer[i].TextureWrapU != statesCache.WrapU) { glTexParameteri(tmpTextureType, GL_TEXTURE_WRAP_S, getTextureWrapMode(material.TextureLayer[i].TextureWrapU)); - tmpTexture->getStatesCache().WrapU = material.TextureLayer[i].TextureWrapU; + statesCache.WrapU = material.TextureLayer[i].TextureWrapU; } - if(!tmpTexture->getStatesCache().IsCached || material.TextureLayer[i].TextureWrapV != tmpTexture->getStatesCache().WrapV) + if(!statesCache.IsCached || material.TextureLayer[i].TextureWrapV != statesCache.WrapV) { glTexParameteri(tmpTextureType, GL_TEXTURE_WRAP_T, getTextureWrapMode(material.TextureLayer[i].TextureWrapV)); - tmpTexture->getStatesCache().WrapV = material.TextureLayer[i].TextureWrapV; + statesCache.WrapV = material.TextureLayer[i].TextureWrapV; } - tmpTexture->getStatesCache().IsCached = true; + statesCache.IsCached = true; } // be sure to leave in texture stage 0 - BridgeCalls->setActiveTexture(GL_TEXTURE0_ARB); + CacheHandler->setActiveTexture(GL_TEXTURE0); } @@ -3027,7 +2963,7 @@ void COpenGLDriver::setRenderStates2DMode(bool alpha, bool texture, bool alphaCh } if (Transformation3DChanged) { - BridgeCalls->setMatrixMode(GL_PROJECTION); + CacheHandler->setMatrixMode(GL_PROJECTION); const core::dimension2d& renderTargetSize = getCurrentRenderTargetSize(); core::matrix4 m(core::matrix4::EM4CONST_NOTHING); @@ -3035,12 +2971,11 @@ void COpenGLDriver::setRenderStates2DMode(bool alpha, bool texture, bool alphaCh m.setTranslation(core::vector3df(-1,1,0)); glLoadMatrixf(m.pointer()); - BridgeCalls->setMatrixMode(GL_MODELVIEW); + CacheHandler->setMatrixMode(GL_MODELVIEW); glLoadIdentity(); - glTranslatef(0.375f, 0.375f, 0.0f); // Make sure we set first texture matrix - BridgeCalls->setActiveTexture(GL_TEXTURE0_ARB); + CacheHandler->setActiveTexture(GL_TEXTURE0); Transformation3DChanged = false; } @@ -3049,7 +2984,7 @@ void COpenGLDriver::setRenderStates2DMode(bool alpha, bool texture, bool alphaCh setBasicRenderStates(InitMaterial2D, LastMaterial, true); LastMaterial = InitMaterial2D; } - BridgeCalls->setBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA); + CacheHandler->setBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA); #ifdef GL_EXT_clip_volume_hint if (FeatureAvailable[IRR_EXT_clip_volume_hint]) glHint(GL_CLIP_VOLUME_CLIPPING_HINT_EXT, GL_FASTEST); @@ -3068,14 +3003,14 @@ void COpenGLDriver::setRenderStates2DMode(bool alpha, bool texture, bool alphaCh if (alphaChannel || alpha) { - BridgeCalls->setBlend(true); - BridgeCalls->setAlphaTest(true); - BridgeCalls->setAlphaFunc(GL_GREATER, 0.f); + CacheHandler->setBlend(true); + CacheHandler->setAlphaTest(true); + CacheHandler->setAlphaFunc(GL_GREATER, 0.f); } else { - BridgeCalls->setBlend(false); - BridgeCalls->setAlphaTest(false); + CacheHandler->setBlend(false); + CacheHandler->setAlphaTest(false); } if (texture) @@ -3085,7 +3020,7 @@ void COpenGLDriver::setRenderStates2DMode(bool alpha, bool texture, bool alphaCh else setTextureRenderStates(InitMaterial2D, false); - Material.setTexture(0, const_cast(CurrentTexture[0])); + Material.setTexture(0, const_cast(CacheHandler->getTextureCache()[0])); setTransform(ETS_TEXTURE_0, core::IdentityMatrix); // Due to the transformation change, the previous line would call a reset each frame // but we can safely reset the variable as it was false before @@ -3364,7 +3299,7 @@ void COpenGLDriver::setViewPort(const core::rect& area) vp.clipAgainst(rendert); if (vp.getHeight() > 0 && vp.getWidth() > 0) - BridgeCalls->setViewport(vp.UpperLeftCorner.X, getCurrentRenderTargetSize().Height - vp.UpperLeftCorner.Y - vp.getHeight(), vp.getWidth(), vp.getHeight()); + CacheHandler->setViewport(vp.UpperLeftCorner.X, getCurrentRenderTargetSize().Height - vp.UpperLeftCorner.Y - vp.getHeight(), vp.getWidth(), vp.getHeight()); ViewPort = vp; } @@ -3405,7 +3340,7 @@ void COpenGLDriver::drawStencilShadowVolume(const core::array& glEnable(GL_STENCIL_TEST); } - BridgeCalls->setClientState(true, false, false, false); + CacheHandler->setClientState(true, false, false, false); glVertexPointer(3,GL_FLOAT,sizeof(core::vector3df),triangles.const_pointer()); glStencilMask(~0); glStencilFunc(GL_ALWAYS, 0, ~0); @@ -3538,10 +3473,10 @@ void COpenGLDriver::drawStencilShadow(bool clearStencilBuffer, video::SColor lef glStencilOp(GL_KEEP, GL_KEEP, GL_KEEP); // draw a shadow rectangle covering the entire screen using stencil buffer - BridgeCalls->setMatrixMode(GL_MODELVIEW); + CacheHandler->setMatrixMode(GL_MODELVIEW); glPushMatrix(); glLoadIdentity(); - BridgeCalls->setMatrixMode(GL_PROJECTION); + CacheHandler->setMatrixMode(GL_PROJECTION); glPushMatrix(); glLoadIdentity(); @@ -3558,7 +3493,7 @@ void COpenGLDriver::drawStencilShadow(bool clearStencilBuffer, video::SColor lef if (!FeatureAvailable[IRR_ARB_vertex_array_bgra] && !FeatureAvailable[IRR_EXT_vertex_array_bgra]) getColorBuffer(Quad2DVertices, 4, EVT_STANDARD); - BridgeCalls->setClientState(true, false, true, false); + CacheHandler->setClientState(true, false, true, false); glVertexPointer(3, GL_FLOAT, sizeof(S3DVertex), &(static_cast(Quad2DVertices))[0].Pos); @@ -3577,11 +3512,12 @@ void COpenGLDriver::drawStencilShadow(bool clearStencilBuffer, video::SColor lef glDrawElements(GL_TRIANGLE_FAN, 4, GL_UNSIGNED_SHORT, Quad2DIndices); - clearBuffers(false, false, clearStencilBuffer, 0x0); + if (clearStencilBuffer) + glClear(GL_STENCIL_BUFFER_BIT); // restore settings glPopMatrix(); - BridgeCalls->setMatrixMode(GL_MODELVIEW); + CacheHandler->setMatrixMode(GL_MODELVIEW); glPopMatrix(); glPopAttrib(); } @@ -3643,7 +3579,7 @@ void COpenGLDriver::draw3DLine(const core::vector3df& start, if (!FeatureAvailable[IRR_ARB_vertex_array_bgra] && !FeatureAvailable[IRR_EXT_vertex_array_bgra]) getColorBuffer(Quad2DVertices, 2, EVT_STANDARD); - BridgeCalls->setClientState(true, false, true, false); + CacheHandler->setClientState(true, false, true, false); glVertexPointer(3, GL_FLOAT, sizeof(S3DVertex), &(static_cast(Quad2DVertices))[0].Pos); @@ -3671,9 +3607,6 @@ void COpenGLDriver::removeTexture(ITexture* texture) return; CNullDriver::removeTexture(texture); - - // Remove this texture from CurrentTexture as well - CurrentTexture.remove(texture); } @@ -3682,7 +3615,7 @@ void COpenGLDriver::removeTexture(ITexture* texture) void COpenGLDriver::OnResize(const core::dimension2d& size) { CNullDriver::OnResize(size); - BridgeCalls->setViewport(0, 0, size.Width, size.Height); + CacheHandler->setViewport(0, 0, size.Width, size.Height); Transformation3DChanged = true; } @@ -3797,10 +3730,7 @@ s32 COpenGLDriver::addHighLevelShaderMaterial( { s32 nr = -1; - #ifdef _IRR_COMPILE_WITH_CG_ - if (shadingLang == EGSL_CG) - { - COpenGLCgMaterialRenderer* r = new COpenGLCgMaterialRenderer( + COpenGLSLMaterialRenderer* r = new COpenGLSLMaterialRenderer( this, nr, vertexShaderProgram, vertexShaderEntryPointName, vsCompileTarget, pixelShaderProgram, pixelShaderEntryPointName, psCompileTarget, @@ -3808,21 +3738,7 @@ s32 COpenGLDriver::addHighLevelShaderMaterial( inType, outType, verticesOut, callback,baseMaterial, userData); - r->drop(); - } - else - #endif - { - COpenGLSLMaterialRenderer* r = new COpenGLSLMaterialRenderer( - this, nr, - vertexShaderProgram, vertexShaderEntryPointName, vsCompileTarget, - pixelShaderProgram, pixelShaderEntryPointName, psCompileTarget, - geometryShaderProgram, geometryShaderEntryPointName, gsCompileTarget, - inType, outType, verticesOut, - callback,baseMaterial, userData); - - r->drop(); - } + r->drop(); return nr; } @@ -3837,59 +3753,34 @@ IVideoDriver* COpenGLDriver::getVideoDriver() ITexture* COpenGLDriver::addRenderTargetTexture(const core::dimension2d& size, - const io::path& name, - const ECOLOR_FORMAT format) + const io::path& name, const ECOLOR_FORMAT format) { //disable mip-mapping bool generateMipLevels = getTextureCreationFlag(ETCF_CREATE_MIP_MAPS); setTextureCreationFlag(ETCF_CREATE_MIP_MAPS, false); - video::ITexture* rtt = 0; -#if defined(GL_EXT_framebuffer_object) - // if driver supports FrameBufferObjects, use them - if (queryFeature(EVDF_FRAMEBUFFER_OBJECT)) - { - rtt = new COpenGLFBOTexture(size, name, this, format); - if (rtt) - { - bool success = false; - addTexture(rtt); - ITexture* tex = createDepthTexture(rtt); - if (tex) - { - success = static_cast(tex)->attach(rtt); - if ( !success ) - { - removeDepthTexture(tex); - } - tex->drop(); - } - rtt->drop(); - if (!success) - { - removeTexture(rtt); - rtt=0; - } - } - } - else + bool supportForFBO = false; + +#if defined(GL_VERSION_3_0) || defined(GL_ARB_framebuffer_object) || defined(GL_EXT_framebuffer_object) + supportForFBO = FeatureAvailable[IRR_EXT_framebuffer_object] || FeatureAvailable[IRR_ARB_framebuffer_object]; #endif + + core::dimension2du destSize(size); + + if (!supportForFBO) { - // the simple texture is only possible for size <= screensize - // we try to find an optimal size with the original constraints - core::dimension2du destSize(core::min_(size.Width,ScreenSize.Width), core::min_(size.Height,ScreenSize.Height)); - destSize = destSize.getOptimalSize((size==size.getOptimalSize()), false, false); - rtt = addTexture(destSize, name, ECF_A8R8G8B8); - if (rtt) - { - static_cast(rtt)->setIsRenderTarget(true); - } + destSize = core::dimension2d(core::min_(size.Width, ScreenSize.Width), core::min_(size.Height, ScreenSize.Height)); + destSize = destSize.getOptimalSize((size == size.getOptimalSize()), false, false); } + COpenGLTexture* renderTargetTexture = new COpenGLTexture(name, size, format, this); + addTexture(renderTargetTexture); + renderTargetTexture->drop(); + //restore mip-mapping setTextureCreationFlag(ETCF_CREATE_MIP_MAPS, generateMipLevels); - return rtt; + return renderTargetTexture; } @@ -3901,316 +3792,76 @@ u32 COpenGLDriver::getMaximalPrimitiveCount() const return 0x7fffffff; } - -//! set or reset render target -bool COpenGLDriver::setRenderTarget(video::E_RENDER_TARGET target, bool clearTarget, - bool clearZBuffer, SColor color) +bool COpenGLDriver::setRenderTarget(IRenderTarget* target, u16 clearFlag, SColor clearColor, f32 clearDepth, u8 clearStencil) { - if (target != CurrentTarget) - setRenderTarget(0, false, false, 0x0); - - if (ERT_RENDER_TEXTURE == target) + if (target && target->getDriverType() != EDT_OPENGL) { - os::Printer::log("For render textures call setRenderTarget with the actual texture as first parameter.", ELL_ERROR); - return false; - } - if (ERT_MULTI_RENDER_TEXTURES == target) - { - os::Printer::log("For multiple render textures call setRenderTarget with the texture array as first parameter.", ELL_ERROR); + os::Printer::log("Fatal Error: Tried to set a render target not owned by this driver.", ELL_ERROR); return false; } - if (Params.Stereobuffer && (ERT_STEREO_RIGHT_BUFFER == target)) + bool supportForFBO = (Feature.ColorAttachment > 0); + + core::dimension2d destRenderTargetSize(0, 0); + + if (target) { - if (Params.Doublebuffer) - glDrawBuffer(GL_BACK_RIGHT); - else - glDrawBuffer(GL_FRONT_RIGHT); - } - else if (Params.Stereobuffer && ERT_STEREO_BOTH_BUFFERS == target) - { - if (Params.Doublebuffer) - glDrawBuffer(GL_BACK); - else - glDrawBuffer(GL_FRONT); - } - else if ((target >= ERT_AUX_BUFFER0) && (target-ERT_AUX_BUFFER0 < MaxAuxBuffers)) - { - glDrawBuffer(GL_AUX0+target-ERT_AUX_BUFFER0); + COpenGLRenderTarget* renderTarget = static_cast(target); + + if (supportForFBO) + { + CacheHandler->setFBO(renderTarget->getBufferID()); + renderTarget->update(); + } + + destRenderTargetSize = renderTarget->getSize(); + + CacheHandler->setViewport(0, 0, destRenderTargetSize.Width, destRenderTargetSize.Height); } else { - if (Params.Doublebuffer) - glDrawBuffer(GL_BACK_LEFT); - else - glDrawBuffer(GL_FRONT_LEFT); - // exit with false, but also with working color buffer - if (target != ERT_FRAME_BUFFER) - return false; - } - CurrentTarget=target; - clearBuffers(clearTarget, clearZBuffer, false, color); - return true; -} - - -//! set or reset render target -bool COpenGLDriver::setRenderTarget(video::ITexture* texture, bool clearBackBuffer, - bool clearZBuffer, SColor color) -{ - // check for right driver type - - if (texture && texture->getDriverType() != EDT_OPENGL) - { - os::Printer::log("Fatal Error: Tried to set a texture not owned by this driver.", ELL_ERROR); - return false; - } - -#if defined(GL_EXT_framebuffer_object) - if (CurrentTarget==ERT_MULTI_RENDER_TEXTURES) - { - for (u32 i=0; isetActiveTexture(GL_TEXTURE0_ARB); - ResetRenderStates=true; - if (RenderTargetTexture!=0) - { - RenderTargetTexture->unbindRTT(); - } - - if (texture) - { - // we want to set a new target. so do this. - BridgeCalls->setViewport(0, 0, texture->getSize().Width, texture->getSize().Height); - RenderTargetTexture = static_cast(texture); - // calls glDrawBuffer as well - RenderTargetTexture->bindRTT(); - CurrentRendertargetSize = texture->getSize(); - CurrentTarget=ERT_RENDER_TEXTURE; - } + if (supportForFBO) + CacheHandler->setFBO(0); else { - BridgeCalls->setViewport(0, 0, ScreenSize.Width, ScreenSize.Height); - RenderTargetTexture = 0; - CurrentRendertargetSize = core::dimension2d(0,0); - CurrentTarget=ERT_FRAME_BUFFER; - glDrawBuffer(Params.Doublebuffer?GL_BACK_LEFT:GL_FRONT_LEFT); - } - // we need to update the matrices due to the rendersize change. - Transformation3DChanged=true; - } + COpenGLRenderTarget* prevRenderTarget = static_cast(CurrentRenderTarget); + COpenGLTexture* renderTargetTexture = static_cast(prevRenderTarget->getTexture()); - clearBuffers(clearBackBuffer, clearZBuffer, false, color); - - return true; -} - - -//! Sets multiple render targets -bool COpenGLDriver::setRenderTarget(const core::array& targets, - bool clearBackBuffer, bool clearZBuffer, SColor color) -{ - // if simply disabling the MRT via array call - if (targets.size()==0) - return setRenderTarget(0, clearBackBuffer, clearZBuffer, color); - // if disabling old MRT, but enabling new one as well - if ((MRTargets.size()!=0) && (targets != MRTargets)) - setRenderTarget(0, clearBackBuffer, clearZBuffer, color); - // if no change, simply clear buffers - else if (targets == MRTargets) - { - clearBuffers(clearBackBuffer, clearZBuffer, false, color); - return true; - } - - // copy to storage for correct disabling - MRTargets=targets; - - u32 maxMultipleRTTs = core::min_(static_cast(MaxMultipleRenderTargets), targets.size()); - - // determine common size - core::dimension2du rttSize = CurrentRendertargetSize; - if (targets[0].TargetType==ERT_RENDER_TEXTURE) - { - if (!targets[0].RenderTexture) - { - os::Printer::log("Missing render texture for MRT.", ELL_ERROR); - return false; - } - rttSize=targets[0].RenderTexture->getSize(); - } - - for (u32 i = 0; i < maxMultipleRTTs; ++i) - { - // check for right driver type - if (targets[i].TargetType==ERT_RENDER_TEXTURE) - { - if (!targets[i].RenderTexture) + if (renderTargetTexture) { - maxMultipleRTTs=i; - os::Printer::log("Missing render texture for MRT.", ELL_WARNING); - break; - } - if (targets[i].RenderTexture->getDriverType() != EDT_OPENGL) - { - maxMultipleRTTs=i; - os::Printer::log("Tried to set a texture not owned by this driver.", ELL_WARNING); - break; - } + const COpenGLTexture* prevTexture = CacheHandler->getTextureCache()[0]; - // check for valid render target - if (!targets[i].RenderTexture->isRenderTarget() || !static_cast(targets[i].RenderTexture)->isFrameBufferObject()) - { - maxMultipleRTTs=i; - os::Printer::log("Tried to set a non FBO-RTT as render target.", ELL_WARNING); - break; - } + CacheHandler->getTextureCache().set(0, renderTargetTexture); - // check for valid size - if (rttSize != targets[i].RenderTexture->getSize()) - { - maxMultipleRTTs=i; - os::Printer::log("Render target texture has wrong size.", ELL_WARNING); - break; - } - } - } - if (maxMultipleRTTs==0) - { - os::Printer::log("No valid MRTs.", ELL_ERROR); - return false; - } + const core::dimension2d size = renderTargetTexture->getSize(); + glCopyTexSubImage2D(GL_TEXTURE_2D, 0, 0, 0, 0, 0, size.Width, size.Height); - // init FBO, if any - for (u32 i=0; i 1) - { - CurrentTarget=ERT_MULTI_RENDER_TEXTURES; - core::array MRTs; - MRTs.set_used(maxMultipleRTTs); - for(u32 i = 0; i < maxMultipleRTTs; i++) - { - if (FeatureAvailable[IRR_EXT_draw_buffers2]) - { - extGlColorMaskIndexed(i, - (targets[i].ColorMask & ECP_RED)?GL_TRUE:GL_FALSE, - (targets[i].ColorMask & ECP_GREEN)?GL_TRUE:GL_FALSE, - (targets[i].ColorMask & ECP_BLUE)?GL_TRUE:GL_FALSE, - (targets[i].ColorMask & ECP_ALPHA)?GL_TRUE:GL_FALSE); - if (targets[i].BlendOp==EBO_NONE) - BridgeCalls->setBlendIndexed(i, false); - else - BridgeCalls->setBlendIndexed(i, true); - } -#if defined(GL_AMD_draw_buffers_blend) || defined(GL_ARB_draw_buffers_blend) - if (FeatureAvailable[IRR_AMD_draw_buffers_blend] || FeatureAvailable[IRR_ARB_draw_buffers_blend]) - { - BridgeCalls->setBlendFuncIndexed(i, getGLBlend(targets[i].BlendFuncSrc), getGLBlend(targets[i].BlendFuncDst)); - switch(targets[i].BlendOp) - { - case EBO_SUBTRACT: - BridgeCalls->setBlendEquationIndexed(i, GL_FUNC_SUBTRACT); - break; - case EBO_REVSUBTRACT: - BridgeCalls->setBlendEquationIndexed(i, GL_FUNC_REVERSE_SUBTRACT); - break; - case EBO_MIN: - BridgeCalls->setBlendEquationIndexed(i, GL_MIN); - break; - case EBO_MAX: - BridgeCalls->setBlendEquationIndexed(i, GL_MAX); - break; - case EBO_MIN_FACTOR: - case EBO_MIN_ALPHA: -#if defined(GL_AMD_blend_minmax_factor) - if (FeatureAvailable[IRR_AMD_blend_minmax_factor]) - BridgeCalls->setBlendEquationIndexed(i, GL_FACTOR_MIN_AMD); - // fallback in case of missing extension - else -#endif - BridgeCalls->setBlendEquationIndexed(i, GL_MIN); - break; - case EBO_MAX_FACTOR: - case EBO_MAX_ALPHA: -#if defined(GL_AMD_blend_minmax_factor) - if (FeatureAvailable[IRR_AMD_blend_minmax_factor]) - BridgeCalls->setBlendEquationIndexed(i, GL_FACTOR_MAX_AMD); - // fallback in case of missing extension - else -#endif - BridgeCalls->setBlendEquationIndexed(i, GL_MAX); - break; - default: - BridgeCalls->setBlendEquationIndexed(i, GL_FUNC_ADD); - break; - } - } -#endif - if (targets[i].TargetType==ERT_RENDER_TEXTURE) - { - GLenum attachment = GL_NONE; -#ifdef GL_EXT_framebuffer_object - // attach texture to FrameBuffer Object on Color [i] - attachment = GL_COLOR_ATTACHMENT0_EXT+i; - if ((i != 0) && (targets[i].RenderTexture != RenderTargetTexture)) - extGlFramebufferTexture2D(GL_FRAMEBUFFER_EXT, attachment, GL_TEXTURE_2D, static_cast(targets[i].RenderTexture)->getOpenGLTextureName(), 0); -#endif - MRTs[i]=attachment; - } - else - { - switch(targets[i].TargetType) - { - case ERT_FRAME_BUFFER: - MRTs[i]=GL_BACK_LEFT; - break; - case ERT_STEREO_BOTH_BUFFERS: - MRTs[i]=GL_BACK; - break; - case ERT_STEREO_RIGHT_BUFFER: - MRTs[i]=GL_BACK_RIGHT; - break; - case ERT_STEREO_LEFT_BUFFER: - MRTs[i]=GL_BACK_LEFT; - break; - default: - MRTs[i]=GL_AUX0+(targets[i].TargetType-ERT_AUX_BUFFER0); - break; - } + CacheHandler->getTextureCache().set(0, prevTexture); } } - extGlDrawBuffers(maxMultipleRTTs, MRTs.const_pointer()); + destRenderTargetSize = core::dimension2d(0, 0); + + CacheHandler->setViewport(0, 0, ScreenSize.Width, ScreenSize.Height); } - clearBuffers(clearBackBuffer, clearZBuffer, false, color); + if (CurrentRenderTargetSize != destRenderTargetSize) + { + CurrentRenderTargetSize = destRenderTargetSize; + + Transformation3DChanged = true; + } + + CurrentRenderTarget = target; + + if (!supportForFBO) + { + clearFlag |= ECBF_COLOR; + clearFlag |= ECBF_DEPTH; + } + + clearBuffers(clearFlag, clearColor, clearDepth, clearStencil); + return true; } @@ -4218,24 +3869,55 @@ bool COpenGLDriver::setRenderTarget(const core::array& tar // returns the current size of the screen or rendertarget const core::dimension2d& COpenGLDriver::getCurrentRenderTargetSize() const { - if (CurrentRendertargetSize.Width == 0) + if (CurrentRenderTargetSize.Width == 0) return ScreenSize; else - return CurrentRendertargetSize; + return CurrentRenderTargetSize; } - -//! Clears the ZBuffer. -void COpenGLDriver::clearZBuffer() +void COpenGLDriver::clearBuffers(u16 flag, SColor color, f32 depth, u8 stencil) { - clearBuffers(false, true, false, 0x0); + GLbitfield mask = 0; + + if (flag & ECBF_COLOR) + { + CacheHandler->setColorMask(true, true, true, true); + + const f32 inv = 1.0f / 255.0f; + glClearColor(color.getRed() * inv, color.getGreen() * inv, + color.getBlue() * inv, color.getAlpha() * inv); + + mask |= GL_COLOR_BUFFER_BIT; + } + + if (flag & ECBF_DEPTH) + { + CacheHandler->setDepthMask(true); + glClearDepth(depth); + mask |= GL_DEPTH_BUFFER_BIT; + } + + if (flag & ECBF_STENCIL) + { + glClearStencil(stencil); + mask |= GL_STENCIL_BUFFER_BIT; + } + + if (mask) + glClear(mask); } //! Returns an image created from the last rendered frame. IImage* COpenGLDriver::createScreenShot(video::ECOLOR_FORMAT format, video::E_RENDER_TARGET target) { - if (target==video::ERT_MULTI_RENDER_TEXTURES || target==video::ERT_RENDER_TEXTURE || target==video::ERT_STEREO_BOTH_BUFFERS) + if (target != video::ERT_FRAME_BUFFER) + return 0; + + if (format==video::ECF_UNKNOWN) + format=getColorFormat(); + + if (IImage::isRenderTargetOnlyFormat(format) || IImage::isCompressedFormat(format) || IImage::isDepthFormat(format)) return 0; // allows to read pixels in top-to-bottom order @@ -4244,10 +3926,9 @@ IImage* COpenGLDriver::createScreenShot(video::ECOLOR_FORMAT format, video::E_RE glPixelStorei(GL_PACK_INVERT_MESA, GL_TRUE); #endif - if (format==video::ECF_UNKNOWN) - format=getColorFormat(); GLenum fmt; GLenum type; + switch (format) { case ECF_A1R5G5B5: @@ -4269,70 +3950,6 @@ IImage* COpenGLDriver::createScreenShot(video::ECOLOR_FORMAT format, video::E_RE else type = GL_UNSIGNED_BYTE; break; - case ECF_R16F: - if (FeatureAvailable[IRR_ARB_texture_rg]) - fmt = GL_RED; - else - fmt = GL_LUMINANCE; -#ifdef GL_ARB_half_float_pixel - if (FeatureAvailable[IRR_ARB_half_float_pixel]) - type = GL_HALF_FLOAT_ARB; - else -#endif - { - type = GL_FLOAT; - format = ECF_R32F; - } - break; - case ECF_G16R16F: -#ifdef GL_ARB_texture_rg - if (FeatureAvailable[IRR_ARB_texture_rg]) - fmt = GL_RG; - else -#endif - fmt = GL_LUMINANCE_ALPHA; -#ifdef GL_ARB_half_float_pixel - if (FeatureAvailable[IRR_ARB_half_float_pixel]) - type = GL_HALF_FLOAT_ARB; - else -#endif - { - type = GL_FLOAT; - format = ECF_G32R32F; - } - break; - case ECF_A16B16G16R16F: - fmt = GL_BGRA; -#ifdef GL_ARB_half_float_pixel - if (FeatureAvailable[IRR_ARB_half_float_pixel]) - type = GL_HALF_FLOAT_ARB; - else -#endif - { - type = GL_FLOAT; - format = ECF_A32B32G32R32F; - } - break; - case ECF_R32F: - if (FeatureAvailable[IRR_ARB_texture_rg]) - fmt = GL_RED; - else - fmt = GL_LUMINANCE; - type = GL_FLOAT; - break; - case ECF_G32R32F: -#ifdef GL_ARB_texture_rg - if (FeatureAvailable[IRR_ARB_texture_rg]) - fmt = GL_RG; - else -#endif - fmt = GL_LUMINANCE_ALPHA; - type = GL_FLOAT; - break; - case ECF_A32B32G32R32F: - fmt = GL_BGRA; - type = GL_FLOAT; - break; default: fmt = GL_BGRA; type = GL_UNSIGNED_BYTE; @@ -4416,7 +4033,7 @@ IImage* COpenGLDriver::createScreenShot(video::ECOLOR_FORMAT format, video::E_RE //! get depth texture for the given render target texture ITexture* COpenGLDriver::createDepthTexture(ITexture* texture, bool shared) { - if ((texture->getDriverType() != EDT_OPENGL) || (!texture->isRenderTarget())) + /*if ((texture->getDriverType() != EDT_OPENGL) || (!texture->isRenderTarget())) return 0; COpenGLTexture* tex = static_cast(texture); @@ -4433,23 +4050,24 @@ ITexture* COpenGLDriver::createDepthTexture(ITexture* texture, bool shared) return DepthTextures[i]; } } - DepthTextures.push_back(new COpenGLFBODepthTexture(texture->getSize(), "depth1", this)); + DepthTextures.push_back(new COpenGLRenderBuffer(texture->getSize(), "depth1", this)); return DepthTextures.getLast(); } - return (new COpenGLFBODepthTexture(texture->getSize(), "depth1", this)); + return (new COpenGLRenderBuffer(texture->getSize(), "depth1", this));*/ + return 0; } void COpenGLDriver::removeDepthTexture(ITexture* texture) { - for (u32 i=0; i 101) + pixelType = GL_UNSIGNED_INT_8_8_8_8_REV; + break; + case ECF_DXT1: + internalFormat = GL_COMPRESSED_RGBA_S3TC_DXT1_EXT; + pixelFormat = GL_BGRA_EXT; + pixelType = GL_COMPRESSED_RGBA_S3TC_DXT1_EXT; + break; + case ECF_DXT2: + case ECF_DXT3: + internalFormat = GL_COMPRESSED_RGBA_S3TC_DXT3_EXT; + pixelFormat = GL_BGRA_EXT; + pixelType = GL_COMPRESSED_RGBA_S3TC_DXT3_EXT; + break; + case ECF_DXT4: + case ECF_DXT5: + internalFormat = GL_COMPRESSED_RGBA_S3TC_DXT5_EXT; + pixelFormat = GL_BGRA_EXT; + pixelType = GL_COMPRESSED_RGBA_S3TC_DXT5_EXT; + break; + case ECF_D16: + internalFormat = GL_DEPTH_COMPONENT16; + pixelFormat = GL_DEPTH_COMPONENT; + pixelType = GL_UNSIGNED_BYTE; + break; + case ECF_D32: + internalFormat = GL_DEPTH_COMPONENT32; + pixelFormat = GL_DEPTH_COMPONENT; + pixelType = GL_UNSIGNED_BYTE; + break; + case ECF_D24S8: +#ifdef GL_EXT_packed_depth_stencil + if (queryOpenGLFeature(COpenGLExtensionHandler::IRR_EXT_packed_depth_stencil)) + { + internalFormat = GL_DEPTH_STENCIL_EXT; + pixelFormat = GL_DEPTH_STENCIL_EXT; + pixelType = GL_UNSIGNED_INT_24_8_EXT; + } + else +#endif + os::Printer::log("ECF_D24S8 color format is not supported", ELL_ERROR); + break; + case ECF_R8: + if (queryOpenGLFeature(COpenGLExtensionHandler::IRR_ARB_texture_rg)) + { + internalFormat = GL_R8; + pixelFormat = GL_RED; + pixelType = GL_UNSIGNED_BYTE; + } + else + os::Printer::log("ECF_R8 color format is not supported", ELL_ERROR); + break; + case ECF_R8G8: + if (queryOpenGLFeature(COpenGLExtensionHandler::IRR_ARB_texture_rg)) + { + internalFormat = GL_RG8; + pixelFormat = GL_RG; + pixelType = GL_UNSIGNED_BYTE; + } + else + os::Printer::log("ECF_R8G8 color format is not supported", ELL_ERROR); + break; + case ECF_R16: + if (queryOpenGLFeature(COpenGLExtensionHandler::IRR_ARB_texture_rg)) + { + internalFormat = GL_R16; + pixelFormat = GL_RED; + pixelType = GL_UNSIGNED_SHORT; + } + else + os::Printer::log("ECF_R16 color format is not supported", ELL_ERROR); + break; + case ECF_R16G16: + if (queryOpenGLFeature(COpenGLExtensionHandler::IRR_ARB_texture_rg)) + { + internalFormat = GL_RG16; + pixelFormat = GL_RG; + pixelType = GL_UNSIGNED_SHORT; + } + else + os::Printer::log("ECF_R16G16 color format is not supported", ELL_ERROR); + break; + case ECF_R16F: + if (queryOpenGLFeature(COpenGLExtensionHandler::IRR_ARB_texture_rg)) + { + internalFormat = GL_R16F; + pixelFormat = GL_RED; +#ifdef GL_ARB_half_float_pixel + if (queryOpenGLFeature(COpenGLExtensionHandler::IRR_ARB_half_float_pixel)) + pixelType = GL_HALF_FLOAT_ARB; + else +#endif + pixelType = GL_FLOAT; + } + else + os::Printer::log("ECF_R16F color format is not supported", ELL_ERROR); + break; + case ECF_G16R16F: + if (queryOpenGLFeature(COpenGLExtensionHandler::IRR_ARB_texture_rg)) + { + internalFormat = GL_RG16F; + pixelFormat = GL_RG; +#ifdef GL_ARB_half_float_pixel + if (queryOpenGLFeature(COpenGLExtensionHandler::IRR_ARB_half_float_pixel)) + pixelType = GL_HALF_FLOAT_ARB; + else +#endif + pixelType = GL_FLOAT; + } + else + os::Printer::log("ECF_G16R16F color format is not supported", ELL_ERROR); + break; + case ECF_A16B16G16R16F: + if (queryOpenGLFeature(COpenGLExtensionHandler::IRR_ARB_texture_float)) + { + internalFormat = GL_RGBA16F_ARB; + pixelFormat = GL_RGBA; +#ifdef GL_ARB_half_float_pixel + if (queryOpenGLFeature(COpenGLExtensionHandler::IRR_ARB_half_float_pixel)) + pixelType = GL_HALF_FLOAT_ARB; + else +#endif + pixelType = GL_FLOAT; + } + else + os::Printer::log("ECF_A16B16G16R16F color format is not supported", ELL_ERROR); + break; + case ECF_R32F: + if (queryOpenGLFeature(COpenGLExtensionHandler::IRR_ARB_texture_rg)) + { + internalFormat = GL_R32F; + pixelFormat = GL_RED; + pixelType = GL_FLOAT; + } + else + os::Printer::log("ECF_R32F color format is not supported", ELL_ERROR); + break; + case ECF_G32R32F: + if (queryOpenGLFeature(COpenGLExtensionHandler::IRR_ARB_texture_rg)) + { + internalFormat = GL_RG32F; + pixelFormat = GL_RG; + pixelType = GL_FLOAT; + } + else + os::Printer::log("ECF_G32R32F color format is not supported", ELL_ERROR); + break; + case ECF_A32B32G32R32F: + if (queryOpenGLFeature(COpenGLExtensionHandler::IRR_ARB_texture_float)) + { + internalFormat = GL_RGBA32F_ARB; + pixelFormat = GL_RGBA; + pixelType = GL_FLOAT; + } + else + os::Printer::log("ECF_A32B32G32R32F color format is not supported", ELL_ERROR); + break; + default: + os::Printer::log("Unsupported texture format", ELL_ERROR); + break; + } + +#if defined(GL_ARB_framebuffer_sRGB) || defined(GL_EXT_framebuffer_sRGB) + if (Params.HandleSRGB) + { + if (internalFormat == GL_RGBA) + internalFormat = GL_SRGB_ALPHA_EXT; + else if (internalFormat == GL_RGB) + internalFormat = GL_SRGB_EXT; + } +#endif +} + COpenGLDriver::E_OPENGL_FIXED_PIPELINE_STATE COpenGLDriver::getFixedPipelineState() const { return FixedPipelineState; @@ -4595,454 +4413,9 @@ const SMaterial& COpenGLDriver::getCurrentMaterial() const return Material; } -COpenGLCallBridge* COpenGLDriver::getBridgeCalls() const +COpenGLCacheHandler* COpenGLDriver::getCacheHandler() const { - return BridgeCalls; -} - -#ifdef _IRR_COMPILE_WITH_CG_ -const CGcontext& COpenGLDriver::getCgContext() -{ - return CgContext; -} -#endif - -COpenGLCallBridge::COpenGLCallBridge(COpenGLDriver* driver) : Driver(driver), - AlphaMode(GL_ALWAYS), AlphaRef(0.0f), AlphaTest(false), - ClientStateVertex(false), ClientStateNormal(false), ClientStateColor(false), ClientStateTexCoord0(false), - CullFaceMode(GL_BACK), CullFace(false), - DepthFunc(GL_LESS), DepthMask(true), DepthTest(false), MatrixMode(GL_MODELVIEW), - ActiveTexture(GL_TEXTURE0_ARB), ClientActiveTexture(GL_TEXTURE0_ARB), ViewportX(0), ViewportY(0) -{ - BlendIndexCount = core::max_(static_cast(1), static_cast(Driver->MaxMultipleRenderTargets)); - - BlendEquation = new GLenum[BlendIndexCount]; - BlendSourceRGB = new GLenum[BlendIndexCount]; - BlendDestinationRGB = new GLenum[BlendIndexCount]; - BlendSourceAlpha = new GLenum[BlendIndexCount]; - BlendDestinationAlpha = new GLenum[BlendIndexCount]; - Blend = new bool[BlendIndexCount]; - - for (u32 i = 0; i < BlendIndexCount; ++i) - { -#if defined(GL_VERSION_1_4) - BlendEquation[i] = GL_FUNC_ADD; -#elif defined(GL_EXT_blend_subtract) || defined(GL_EXT_blend_minmax) || defined(GL_EXT_blend_logic_op) - BlendEquation[i] = GL_FUNC_ADD_EXT; -#endif - - BlendSourceRGB[i] = GL_ONE; - BlendDestinationRGB[i] = GL_ZERO; - BlendSourceAlpha[i] = GL_ONE; - BlendDestinationAlpha[i] = GL_ZERO; - - Blend[i] = false; - } - - for (u32 i = 0; i < MATERIAL_MAX_TEXTURES; ++i) - { - Texture[i] = 0; - TextureType[i] = GL_TEXTURE_2D; - TextureFixedPipeline[i] = true; - } - - // Initial OpenGL values from specification. - - glAlphaFunc(GL_ALWAYS, 0.0f); - glDisable(GL_ALPHA_TEST); - - if (Driver->queryFeature(EVDF_BLEND_OPERATIONS)) - { -#if defined(GL_VERSION_1_4) - Driver->extGlBlendEquation(GL_FUNC_ADD); -#elif defined(GL_EXT_blend_subtract) || defined(GL_EXT_blend_minmax) || defined(GL_EXT_blend_logic_op) - Driver->extGlBlendEquation(GL_FUNC_ADD_EXT); -#endif - } - - glBlendFunc(GL_ONE, GL_ZERO); - glDisable(GL_BLEND); - - glCullFace(GL_BACK); - glDisable(GL_CULL_FACE); - glDepthFunc(GL_LESS); - glDepthMask(GL_TRUE); - glDisable(GL_DEPTH_TEST); - - glMatrixMode(GL_MODELVIEW); - - if(Driver->MultiTextureExtension) - { - Driver->extGlActiveTexture(GL_TEXTURE0_ARB); - Driver->extGlClientActiveTexture(GL_TEXTURE0_ARB); - } - - glDisable(GL_TEXTURE_2D); - - glDisableClientState(GL_VERTEX_ARRAY); - glDisableClientState(GL_NORMAL_ARRAY); - glDisableClientState(GL_COLOR_ARRAY); - glDisableClientState(GL_TEXTURE_COORD_ARRAY); - - const core::dimension2d ScreenSize = Driver->getScreenSize(); - ViewportWidth = ScreenSize.Width; - ViewportHeight = ScreenSize.Height; - glViewport(ViewportX, ViewportY, ViewportWidth, ViewportHeight); -} - -COpenGLCallBridge::~COpenGLCallBridge() -{ - delete[] BlendEquation; - delete[] BlendSourceRGB; - delete[] BlendDestinationRGB; - delete[] BlendSourceAlpha; - delete[] BlendDestinationAlpha; - delete[] Blend; -} - -void COpenGLCallBridge::setAlphaFunc(GLenum mode, GLclampf ref) -{ - if(AlphaMode != mode || AlphaRef != ref) - { - glAlphaFunc(mode, ref); - - AlphaMode = mode; - AlphaRef = ref; - } -} - -void COpenGLCallBridge::setAlphaTest(bool enable) -{ - if(AlphaTest != enable) - { - if (enable) - glEnable(GL_ALPHA_TEST); - else - glDisable(GL_ALPHA_TEST); - AlphaTest = enable; - } -} - -void COpenGLCallBridge::setBlendEquation(GLenum mode) -{ - if (BlendEquation[0] != mode) - { - Driver->extGlBlendEquation(mode); - - for (GLuint i = 0; i < BlendIndexCount; ++i) - BlendEquation[i] = mode; - } -} - -void COpenGLCallBridge::setBlendEquationIndexed(GLuint index, GLenum mode) -{ - if (index < BlendIndexCount && BlendEquation[index] != mode) - { - Driver->extGlBlendEquationIndexed(index, mode); - - BlendEquation[index] = mode; - } -} - -void COpenGLCallBridge::setBlendFunc(GLenum source, GLenum destination) -{ - if (BlendSourceRGB[0] != source || BlendDestinationRGB[0] != destination || - BlendSourceAlpha[0] != source || BlendDestinationAlpha[0] != destination) - { - glBlendFunc(source, destination); - - for (GLuint i = 0; i < BlendIndexCount; ++i) - { - BlendSourceRGB[i] = source; - BlendDestinationRGB[i] = destination; - BlendSourceAlpha[i] = source; - BlendDestinationAlpha[i] = destination; - } - } -} - -void COpenGLCallBridge::setBlendFuncSeparate(GLenum sourceRGB, GLenum destinationRGB, GLenum sourceAlpha, GLenum destinationAlpha) -{ - if (sourceRGB != sourceAlpha || destinationRGB != destinationAlpha) - { - if (BlendSourceRGB[0] != sourceRGB || BlendDestinationRGB[0] != destinationRGB || - BlendSourceAlpha[0] != sourceAlpha || BlendDestinationAlpha[0] != destinationAlpha) - { - Driver->extGlBlendFuncSeparate(sourceRGB, destinationRGB, sourceAlpha, destinationAlpha); - - for (GLuint i = 0; i < BlendIndexCount; ++i) - { - BlendSourceRGB[i] = sourceRGB; - BlendDestinationRGB[i] = destinationRGB; - BlendSourceAlpha[i] = sourceAlpha; - BlendDestinationAlpha[i] = destinationAlpha; - } - } - } - else - { - setBlendFunc(sourceRGB, destinationRGB); - } -} - -void COpenGLCallBridge::setBlendFuncIndexed(GLuint index, GLenum source, GLenum destination) -{ - if (index < BlendIndexCount && (BlendSourceRGB[index] != source || BlendDestinationRGB[index] != destination || - BlendSourceAlpha[index] != source || BlendDestinationAlpha[index] != destination)) - { - Driver->extGlBlendFuncIndexed(index, source, destination); - - BlendSourceRGB[index] = source; - BlendDestinationRGB[index] = destination; - BlendSourceAlpha[index] = source; - BlendDestinationAlpha[index] = destination; - } -} - -void COpenGLCallBridge::setBlendFuncSeparateIndexed(GLuint index, GLenum sourceRGB, GLenum destinationRGB, GLenum sourceAlpha, GLenum destinationAlpha) -{ - if (sourceRGB != sourceAlpha || destinationRGB != destinationAlpha) - { - if (index < BlendIndexCount && (BlendSourceRGB[index] != sourceRGB || BlendDestinationRGB[index] != destinationRGB || - BlendSourceAlpha[index] != sourceAlpha || BlendDestinationAlpha[index] != destinationAlpha)) - { - Driver->extGlBlendFuncSeparateIndexed(index, sourceRGB, destinationRGB, sourceAlpha, destinationAlpha); - - BlendSourceRGB[index] = sourceRGB; - BlendDestinationRGB[index] = destinationRGB; - BlendSourceAlpha[index] = sourceAlpha; - BlendDestinationAlpha[index] = destinationAlpha; - } - } - else - { - setBlendFuncIndexed(index, sourceRGB, destinationRGB); - } -} - -void COpenGLCallBridge::setBlend(bool enable) -{ - if (Blend[0] != enable) - { - if (enable) - glEnable(GL_BLEND); - else - glDisable(GL_BLEND); - - for (GLuint i = 0; i < BlendIndexCount; ++i) - Blend[i] = enable; - } -} - -void COpenGLCallBridge::setBlendIndexed(GLuint index, bool enable) -{ - if (index < BlendIndexCount && Blend[index] != enable) - { - if (enable) - Driver->extGlEnableIndexed(GL_BLEND, index); - else - Driver->extGlDisableIndexed(GL_BLEND, index); - - Blend[index] = enable; - } -} - -void COpenGLCallBridge::setClientState(bool vertex, bool normal, bool color, bool texCoord0) -{ - if(ClientStateVertex != vertex) - { - if(vertex) - glEnableClientState(GL_VERTEX_ARRAY); - else - glDisableClientState(GL_VERTEX_ARRAY); - - ClientStateVertex = vertex; - } - - if(ClientStateNormal != normal) - { - if(normal) - glEnableClientState(GL_NORMAL_ARRAY); - else - glDisableClientState(GL_NORMAL_ARRAY); - - ClientStateNormal = normal; - } - - if(ClientStateColor != color) - { - if(color) - glEnableClientState(GL_COLOR_ARRAY); - else - glDisableClientState(GL_COLOR_ARRAY); - - ClientStateColor = color; - } - - if(ClientStateTexCoord0 != texCoord0) - { - setClientActiveTexture(GL_TEXTURE0_ARB); - - if(texCoord0) - glEnableClientState(GL_TEXTURE_COORD_ARRAY); - else - glDisableClientState(GL_TEXTURE_COORD_ARRAY); - - ClientStateTexCoord0 = texCoord0; - } -} - -void COpenGLCallBridge::setCullFaceFunc(GLenum mode) -{ - if(CullFaceMode != mode) - { - glCullFace(mode); - CullFaceMode = mode; - } -} - -void COpenGLCallBridge::setCullFace(bool enable) -{ - if(CullFace != enable) - { - if (enable) - glEnable(GL_CULL_FACE); - else - glDisable(GL_CULL_FACE); - CullFace = enable; - } -} - -void COpenGLCallBridge::setDepthFunc(GLenum mode) -{ - if(DepthFunc != mode) - { - glDepthFunc(mode); - DepthFunc = mode; - } -} - -void COpenGLCallBridge::setDepthMask(bool enable) -{ - if(DepthMask != enable) - { - if (enable) - glDepthMask(GL_TRUE); - else - glDepthMask(GL_FALSE); - DepthMask = enable; - } -} - -void COpenGLCallBridge::setDepthTest(bool enable) -{ - if(DepthTest != enable) - { - if (enable) - glEnable(GL_DEPTH_TEST); - else - glDisable(GL_DEPTH_TEST); - DepthTest = enable; - } -} - -void COpenGLCallBridge::setMatrixMode(GLenum mode) -{ - if (MatrixMode != mode) - { - glMatrixMode(mode); - MatrixMode = mode; - } -} - -void COpenGLCallBridge::resetTexture(const ITexture* texture) -{ - for (u32 i = 0; i < MATERIAL_MAX_TEXTURES; ++i) - { - if (Texture[i] == texture) - { - if (Driver->MultiTextureExtension) - Driver->extGlActiveTexture(GL_TEXTURE0 + i); - - glBindTexture(GL_TEXTURE_2D, 0); - - Texture[i] = 0; - TextureType[i] = GL_TEXTURE_2D; - } - } -} - -void COpenGLCallBridge::setActiveTexture(GLenum texture) -{ - if (Driver->MultiTextureExtension && ActiveTexture != texture) - { - Driver->extGlActiveTexture(texture); - ActiveTexture = texture; - } -} - -void COpenGLCallBridge::setClientActiveTexture(GLenum texture) -{ - if (Driver->MultiTextureExtension && ClientActiveTexture != texture) - { - Driver->extGlClientActiveTexture(texture); - ClientActiveTexture = texture; - } -} - -void COpenGLCallBridge::getTexture(GLuint stage, GLenum& type, bool& fixedPipeline) -{ - if (stage < MATERIAL_MAX_TEXTURES) - { - type = TextureType[stage]; - fixedPipeline = TextureFixedPipeline[stage]; - } -} - -void COpenGLCallBridge::setTexture(GLuint stage, GLenum type, bool fixedPipeline) -{ - if (stage < MATERIAL_MAX_TEXTURES) - { - if((fixedPipeline && TextureFixedPipeline[stage] != fixedPipeline) || Texture[stage] != Driver->CurrentTexture[stage] || type != TextureType[stage]) - { - setActiveTexture(GL_TEXTURE0_ARB + stage); - - if (Driver->CurrentTexture[stage]) - { - if(fixedPipeline) - { - glDisable(TextureType[stage]); - glEnable(type); - } - - glBindTexture(type, static_cast(Driver->CurrentTexture[stage])->getOpenGLTextureName()); - - TextureType[stage] = type; - } - else - { - glBindTexture(TextureType[stage], 0); - - if (fixedPipeline) - glDisable(TextureType[stage]); - } - - TextureFixedPipeline[stage] = fixedPipeline; - Texture[stage] = Driver->CurrentTexture[stage]; - } - } -} - -void COpenGLCallBridge::setViewport(GLint viewportX, GLint viewportY, GLsizei viewportWidth, GLsizei viewportHeight) -{ - if (ViewportX != viewportX || ViewportY != viewportY || ViewportWidth != viewportWidth || ViewportHeight != viewportHeight) - { - glViewport(viewportX, viewportY, viewportWidth, viewportHeight); - ViewportX = viewportX; - ViewportY = viewportY; - ViewportWidth = viewportWidth; - ViewportHeight = viewportHeight; - } + return CacheHandler; } diff --git a/source/Irrlicht/COpenGLDriver.h b/source/Irrlicht/COpenGLDriver.h index 842f901f..c8deda03 100644 --- a/source/Irrlicht/COpenGLDriver.h +++ b/source/Irrlicht/COpenGLDriver.h @@ -21,26 +21,19 @@ namespace irr #include "CNullDriver.h" #include "IMaterialRendererServices.h" -// also includes the OpenGL stuff +#include "COpenGLCommon.h" #include "COpenGLExtensionHandler.h" #include "IContextManager.h" -#ifdef _IRR_COMPILE_WITH_CG_ -#include "Cg/cg.h" -#endif - namespace irr { namespace video { - class COpenGLCallBridge; - class COpenGLTexture; - class COpenGLDriver : public CNullDriver, public IMaterialRendererServices, public COpenGLExtensionHandler { - friend class COpenGLCallBridge; - friend class COpenGLTexture; + friend COpenGLCacheHandler; + friend COpenGLTexture; public: // Information about state of fixed pipeline activity. enum E_OPENGL_FIXED_PIPELINE_STATE @@ -75,13 +68,9 @@ namespace video //! destructor virtual ~COpenGLDriver(); - //! clears the zbuffer - virtual bool beginScene(bool backBuffer=true, bool zBuffer=true, - SColor color=SColor(255,0,0,0), - const SExposedVideoData& videoData=SExposedVideoData(), - core::rect* sourceRect=0) _IRR_OVERRIDE_; + virtual bool beginScene(u16 clearFlag, SColor clearColor = SColor(255,0,0,0), f32 clearDepth = 1.f, u8 clearStencil = 0, + const SExposedVideoData& videoData = SExposedVideoData(), core::rect* sourceRect = 0) _IRR_OVERRIDE_; - //! presents the rendered scene on the screen, returns false if failed virtual bool endScene() _IRR_OVERRIDE_; //! sets transformation @@ -135,6 +124,9 @@ namespace video actual value of pixels. */ virtual u32 getOcclusionQueryResult(scene::ISceneNode* node) const _IRR_OVERRIDE_; + //! Create render target. + virtual IRenderTarget* addRenderTarget() _IRR_OVERRIDE_; + //! draws a vertex primitive list virtual void drawVertexPrimitiveList(const void* vertices, u32 vertexCount, const void* indexList, u32 primitiveCount, @@ -156,6 +148,16 @@ namespace video //! \param material: Material to be used from now on. virtual void setMaterial(const SMaterial& material) _IRR_OVERRIDE_; + virtual void draw2DImage(const video::ITexture* texture, const core::position2d& destPos, + const core::rect& sourceRect, const core::rect* clipRect = 0, + SColor color = SColor(255, 255, 255, 255), bool useAlphaChannelOfTexture = false) _IRR_OVERRIDE_; + + virtual void draw2DImage(const video::ITexture* texture, const core::rect& destRect, + const core::rect& sourceRect, const core::rect* clipRect = 0, + const video::SColor* const colors = 0, bool useAlphaChannelOfTexture = false) _IRR_OVERRIDE_; + + virtual void draw2DImage(const video::ITexture* texture, bool flip); + //! draws a set of 2d images, using a color and the alpha channel of the //! texture if desired. void draw2DImageBatch(const video::ITexture* texture, @@ -165,11 +167,6 @@ namespace video SColor color, bool useAlphaChannelOfTexture) _IRR_OVERRIDE_; - //! draws an 2d image, using a color (if color is other then Color(255,255,255,255)) and the alpha channel of the texture if wanted. - virtual void draw2DImage(const video::ITexture* texture, const core::position2d& destPos, - const core::rect& sourceRect, const core::rect* clipRect = 0, - SColor color=SColor(255,255,255,255), bool useAlphaChannelOfTexture=false) _IRR_OVERRIDE_; - //! draws a set of 2d images, using a color and the alpha /** channel of the texture if desired. The images are drawn beginning at pos and concatenated in one line. All drawings @@ -195,11 +192,6 @@ namespace video SColor color=SColor(255,255,255,255), bool useAlphaChannelOfTexture=false) _IRR_OVERRIDE_; - //! Draws a part of the texture into the rectangle. - virtual void draw2DImage(const video::ITexture* texture, const core::rect& destRect, - const core::rect& sourceRect, const core::rect* clipRect = 0, - const video::SColor* const colors=0, bool useAlphaChannelOfTexture=false) _IRR_OVERRIDE_; - //! draw an 2d rectangle virtual void draw2DRectangle(SColor color, const core::rect& pos, const core::rect* clip = 0) _IRR_OVERRIDE_; @@ -312,10 +304,6 @@ namespace video //! Int interface for the above. virtual bool setPixelShaderConstant(s32 index, const s32* ints, int count) _IRR_OVERRIDE_; - //! sets the current Texture - //! Returns whether setting was a success or not. - bool setActiveTexture(u32 stage, const video::ITexture* texture); - //! disables all textures beginning with the optional fromStage parameter. Otherwise all texture stages are disabled. //! Returns whether disabling was successful or not. bool disableTextures(u32 fromStage=0); @@ -357,20 +345,10 @@ namespace video virtual ITexture* addRenderTargetTexture(const core::dimension2d& size, const io::path& name, const ECOLOR_FORMAT format = ECF_UNKNOWN) _IRR_OVERRIDE_; - //! set or reset render target - virtual bool setRenderTarget(video::E_RENDER_TARGET target, bool clearTarget, - bool clearZBuffer, SColor color) _IRR_OVERRIDE_; + virtual bool setRenderTarget(IRenderTarget* target, u16 clearFlag, SColor clearColor = SColor(255,0,0,0), + f32 clearDepth = 1.f, u8 clearStencil = 0) _IRR_OVERRIDE_; - //! set or reset render target texture - virtual bool setRenderTarget(video::ITexture* texture, bool clearBackBuffer, - bool clearZBuffer, SColor color) _IRR_OVERRIDE_; - - //! Sets multiple render targets - virtual bool setRenderTarget(const core::array& texture, - bool clearBackBuffer=true, bool clearZBuffer=true, SColor color=SColor(0,0,0,0)) _IRR_OVERRIDE_; - - //! Clears the ZBuffer. - virtual void clearZBuffer() _IRR_OVERRIDE_; + virtual void clearBuffers(u16 flag, SColor color = SColor(255,0,0,0), f32 depth = 1.f, u8 stencil = 0) _IRR_OVERRIDE_; //! Returns an image created from the last rendered frame. virtual IImage* createScreenShot(video::ECOLOR_FORMAT format=video::ECF_UNKNOWN, video::E_RENDER_TARGET target=video::ERT_FRAME_BUFFER) _IRR_OVERRIDE_; @@ -416,6 +394,9 @@ namespace video //! Get ZBuffer bits. GLenum getZBufferBits() const; + void getColorFormatParameters(ECOLOR_FORMAT format, GLint& internalFormat, GLenum& pixelFormat, + GLenum& pixelType, void(**converter)(const void*, s32, void*)); + //! Return info about fixed pipeline state. E_OPENGL_FIXED_PIPELINE_STATE getFixedPipelineState() const; @@ -425,19 +406,10 @@ namespace video //! Get current material. const SMaterial& getCurrentMaterial() const; - //! Get bridge calls. - COpenGLCallBridge* getBridgeCalls() const; - - //! Get Cg context - #ifdef _IRR_COMPILE_WITH_CG_ - const CGcontext& getCgContext(); - #endif + COpenGLCacheHandler* getCacheHandler() const; private: - //! clears the zbuffer and color buffer - void clearBuffers(bool backBuffer, bool zBuffer, bool stencilBuffer, SColor color); - bool updateVertexHardwareBuffer(SHWBufferLink_opengl *HWBuffer); bool updateIndexHardwareBuffer(SHWBufferLink_opengl *HWBuffer); @@ -447,7 +419,7 @@ namespace video bool genericDriverInit(); //! returns a device dependent texture from a software surface (IImage) - virtual ITexture* createDeviceDependentTexture(IImage* surface, const io::path& name, void* mipmapData) _IRR_OVERRIDE_; + virtual video::ITexture* createDeviceDependentTexture(IImage* surface, const io::path& name) _IRR_OVERRIDE_; //! returns a device dependent texture from a software surface (IImage) virtual ITexture* createDeviceDependentTextureCube(const io::path& name, IImage* posXImage, IImage* negXImage, @@ -483,8 +455,7 @@ namespace video void renderArray(const void* indexList, u32 primitiveCount, scene::E_PRIMITIVE_TYPE pType, E_INDEX_TYPE iType); - // Bridge calls. - COpenGLCallBridge* BridgeCalls; + COpenGLCacheHandler* CacheHandler; core::stringw Name; core::matrix4 Matrices[ETS_COUNT]; @@ -505,75 +476,7 @@ namespace video u8 AntiAlias; SMaterial Material, LastMaterial; - COpenGLTexture* RenderTargetTexture; - core::array MRTargets; - class STextureStageCache - { - const ITexture* CurrentTexture[MATERIAL_MAX_TEXTURES]; - public: - STextureStageCache() - { - for (u32 i=0; igrab(); - CurrentTexture[stage]=tex; - if (oldTexture) - oldTexture->drop(); - } - } - - const ITexture* operator[](int stage) const - { - if ((u32)stage= 0; --i) - { - if (CurrentTexture[i] == tex) - { - tex->drop(); - CurrentTexture[i] = 0; - } - } - } - - void clear() - { - // Drop all the CurrentTexture handles - for (u32 i=0; idrop(); - CurrentTexture[i] = 0; - } - } - } - }; - STextureStageCache CurrentTexture; - - core::array DepthTextures; struct SUserClipPlane { SUserClipPlane() : Enabled(false) {} @@ -582,8 +485,6 @@ namespace video }; core::array UserClipPlanes; - core::dimension2d CurrentRendertargetSize; - core::stringc VendorName; core::matrix4 TextureFlipMatrix; @@ -593,9 +494,6 @@ namespace video E_OPENGL_FIXED_PIPELINE_STATE FixedPipelineState; - //! Render target type for render operations - E_RENDER_TARGET CurrentTarget; - SIrrlichtCreationParameters Params; //! All the lights that have been requested; a hardware limited @@ -618,127 +516,11 @@ namespace video #ifdef _IRR_COMPILE_WITH_SDL_DEVICE_ CIrrDeviceSDL *SDLDevice; #endif - #ifdef _IRR_COMPILE_WITH_CG_ - CGcontext CgContext; - #endif IContextManager* ContextManager; E_DEVICE_TYPE DeviceType; }; - //! This bridge between Irlicht pseudo OpenGL calls - //! and true OpenGL calls. - - class COpenGLCallBridge - { - public: - COpenGLCallBridge(COpenGLDriver* driver); - ~COpenGLCallBridge(); - - // Alpha calls. - - void setAlphaFunc(GLenum mode, GLclampf ref); - - void setAlphaTest(bool enable); - - // Blending calls. - - void setBlendEquation(GLenum mode); - - void setBlendEquationIndexed(GLuint index, GLenum mode); - - void setBlendFunc(GLenum source, GLenum destination); - - void setBlendFuncSeparate(GLenum sourceRGB, GLenum destinationRGB, GLenum sourceAlpha, GLenum destinationAlpha); - - void setBlendFuncIndexed(GLuint index, GLenum source, GLenum destination); - - void setBlendFuncSeparateIndexed(GLuint index, GLenum sourceRGB, GLenum destinationRGB, GLenum sourceAlpha, GLenum destinationAlpha); - - void setBlend(bool enable); - - void setBlendIndexed(GLuint index, bool enable); - - // Client state calls. - - void setClientState(bool vertex, bool normal, bool color, bool texCoord0); - - // Cull face calls. - - void setCullFaceFunc(GLenum mode); - - void setCullFace(bool enable); - - // Depth calls. - - void setDepthFunc(GLenum mode); - - void setDepthMask(bool enable); - - void setDepthTest(bool enable); - - // Matrix calls. - - void setMatrixMode(GLenum mode); - - // Texture calls. - - void resetTexture(const ITexture* texture); - - void setActiveTexture(GLenum texture); - - void setClientActiveTexture(GLenum texture); - - void getTexture(GLuint stage, GLenum& type, bool& fixedPipeline); - - void setTexture(GLuint stage, GLenum type, bool fixedPipeline); - - // Viewport calls. - - void setViewport(GLint viewportX, GLint viewportY, GLsizei viewportWidth, GLsizei viewportHeight); - - private: - COpenGLDriver* Driver; - - GLenum AlphaMode; - GLclampf AlphaRef; - bool AlphaTest; - - GLenum* BlendEquation; - GLenum* BlendSourceRGB; - GLenum* BlendDestinationRGB; - GLenum* BlendSourceAlpha; - GLenum* BlendDestinationAlpha; - bool* Blend; - GLuint BlendIndexCount; - - bool ClientStateVertex; - bool ClientStateNormal; - bool ClientStateColor; - bool ClientStateTexCoord0; - - GLenum CullFaceMode; - bool CullFace; - - GLenum DepthFunc; - bool DepthMask; - bool DepthTest; - - GLenum MatrixMode; - - GLenum ActiveTexture; - GLenum ClientActiveTexture; - - const ITexture* Texture[MATERIAL_MAX_TEXTURES]; - GLenum TextureType[MATERIAL_MAX_TEXTURES]; - bool TextureFixedPipeline[MATERIAL_MAX_TEXTURES]; - - GLint ViewportX; - GLint ViewportY; - GLsizei ViewportWidth; - GLsizei ViewportHeight; - }; - } // end namespace video } // end namespace irr diff --git a/source/Irrlicht/COpenGLExtensionHandler.cpp b/source/Irrlicht/COpenGLExtensionHandler.cpp index c9a892cf..e22d6e4e 100644 --- a/source/Irrlicht/COpenGLExtensionHandler.cpp +++ b/source/Irrlicht/COpenGLExtensionHandler.cpp @@ -17,11 +17,8 @@ namespace video { COpenGLExtensionHandler::COpenGLExtensionHandler() : - StencilBuffer(false), MultiTextureExtension(false), - TextureCompressionExtension(false), - MaxSupportedTextures(1), MaxTextureUnits(1), MaxLights(1), - MaxAnisotropy(1), MaxUserClipPlanes(0), MaxAuxBuffers(0), - MaxMultipleRenderTargets(1), MaxIndices(65535), + StencilBuffer(false), TextureCompressionExtension(false), MaxLights(1), + MaxAnisotropy(1), MaxUserClipPlanes(0), MaxAuxBuffers(0), MaxIndices(65535), MaxTextureSize(1), MaxGeometryVerticesOut(0), MaxTextureLODBias(0.f), Version(0), ShaderLanguageVersion(0), OcclusionQuerySupport(false) @@ -374,7 +371,6 @@ void COpenGLExtensionHandler::initExtensions(bool stencilBuffer) delete [] str; } - MultiTextureExtension = FeatureAvailable[IRR_ARB_multitexture]; TextureCompressionExtension = FeatureAvailable[IRR_ARB_texture_compression]; StencilBuffer=stencilBuffer; @@ -587,7 +583,7 @@ void COpenGLExtensionHandler::initExtensions(bool stencilBuffer) #elif defined(GL_MAX_TEXTURE_UNITS_ARB) glGetIntegerv(GL_MAX_TEXTURE_UNITS_ARB, &num); #endif - MaxSupportedTextures=static_cast(num); + Feature.TextureUnit=static_cast(num); } #endif #if defined(GL_ARB_vertex_shader) || defined(GL_VERSION_2_0) @@ -599,7 +595,7 @@ void COpenGLExtensionHandler::initExtensions(bool stencilBuffer) #elif defined(GL_MAX_COMBINED_TEXTURE_IMAGE_UNITS_ARB) glGetIntegerv(GL_MAX_COMBINED_TEXTURE_IMAGE_UNITS_ARB, &num); #endif - MaxSupportedTextures=core::max_(MaxSupportedTextures,static_cast(num)); + Feature.TextureUnit =core::max_(Feature.TextureUnit,static_cast(num)); } #endif glGetIntegerv(GL_MAX_LIGHTS, &num); @@ -642,7 +638,7 @@ void COpenGLExtensionHandler::initExtensions(bool stencilBuffer) if (FeatureAvailable[IRR_ARB_draw_buffers]) { glGetIntegerv(GL_MAX_DRAW_BUFFERS_ARB, &num); - MaxMultipleRenderTargets = static_cast(num); + Feature.MultipleRenderTarget = static_cast(num); } #endif #if defined(GL_ATI_draw_buffers) @@ -652,9 +648,27 @@ void COpenGLExtensionHandler::initExtensions(bool stencilBuffer) if (FeatureAvailable[IRR_ATI_draw_buffers]) { glGetIntegerv(GL_MAX_DRAW_BUFFERS_ATI, &num); - MaxMultipleRenderTargets = static_cast(num); + Feature.MultipleRenderTarget = static_cast(num); } #endif +#ifdef GL_ARB_framebuffer_object + if (FeatureAvailable[IRR_ARB_framebuffer_object]) + { + glGetIntegerv(GL_MAX_COLOR_ATTACHMENTS, &num); + Feature.ColorAttachment = static_cast(num); + } +#endif +#if defined(GL_EXT_framebuffer_object) +#ifdef GL_ARB_framebuffer_object + else +#endif + if (FeatureAvailable[IRR_EXT_framebuffer_object]) + { + glGetIntegerv(GL_MAX_COLOR_ATTACHMENTS_EXT, &num); + Feature.ColorAttachment = static_cast(num); + } +#endif + glGetFloatv(GL_ALIASED_LINE_WIDTH_RANGE, DimAliasedLine); glGetFloatv(GL_ALIASED_POINT_SIZE_RANGE, DimAliasedPoint); glGetFloatv(GL_SMOOTH_LINE_WIDTH_RANGE, DimSmoothedLine); @@ -681,17 +695,12 @@ void COpenGLExtensionHandler::initExtensions(bool stencilBuffer) #ifdef _IRR_OPENGL_USE_EXTPOINTER_ if (!pGlActiveTextureARB || !pGlClientActiveTextureARB) { - MultiTextureExtension = false; + Feature.TextureUnit = 1; os::Printer::log("Failed to load OpenGL's multitexture extension, proceeding without.", ELL_WARNING); } else #endif - MaxTextureUnits = core::min_(MaxSupportedTextures, static_cast(MATERIAL_MAX_TEXTURES)); - if (MaxTextureUnits < 2) - { - MultiTextureExtension = false; - os::Printer::log("Warning: OpenGL device only has one texture unit. Disabling multitexturing.", ELL_WARNING); - } + Feature.TextureUnit = core::min_(Feature.TextureUnit, static_cast(MATERIAL_MAX_TEXTURES)); #ifdef GL_ARB_occlusion_query if (FeatureAvailable[IRR_ARB_occlusion_query]) @@ -712,6 +721,9 @@ void COpenGLExtensionHandler::initExtensions(bool stencilBuffer) #endif OcclusionQuerySupport=false; + Feature.BlendOperation = (Version >= 140) || FeatureAvailable[IRR_EXT_blend_minmax] || FeatureAvailable[IRR_EXT_blend_subtract] || + FeatureAvailable[IRR_EXT_blend_logic_op]; + #ifdef _DEBUG if (FeatureAvailable[IRR_NVX_gpu_memory_info]) { @@ -739,6 +751,11 @@ void COpenGLExtensionHandler::initExtensions(bool stencilBuffer) #endif } +const COGLCoreFeature& COpenGLExtensionHandler::getFeature() const +{ + return Feature; +} + bool COpenGLExtensionHandler::queryFeature(E_VIDEO_DRIVER_FEATURE feature) const { switch (feature) @@ -748,7 +765,7 @@ bool COpenGLExtensionHandler::queryFeature(E_VIDEO_DRIVER_FEATURE feature) const case EVDF_HARDWARE_TL: return true; // we cannot tell other things case EVDF_MULTITEXTURE: - return MultiTextureExtension; + return Feature.TextureUnit > 1; case EVDF_BILINEAR_FILTER: return true; case EVDF_MIP_MAP: @@ -799,8 +816,7 @@ bool COpenGLExtensionHandler::queryFeature(E_VIDEO_DRIVER_FEATURE feature) const // both features supported with OpenGL 1.1 return Version>=110; case EVDF_BLEND_OPERATIONS: - return (Version>=140) || FeatureAvailable[IRR_EXT_blend_minmax] || - FeatureAvailable[IRR_EXT_blend_subtract] || FeatureAvailable[IRR_EXT_blend_logic_op]; + return Feature.BlendOperation; case EVDF_BLEND_SEPARATE: return (Version>=140) || FeatureAvailable[IRR_EXT_blend_func_separate]; case EVDF_TEXTURE_MATRIX: diff --git a/source/Irrlicht/COpenGLExtensionHandler.h b/source/Irrlicht/COpenGLExtensionHandler.h index 84946519..73ba0cc9 100644 --- a/source/Irrlicht/COpenGLExtensionHandler.h +++ b/source/Irrlicht/COpenGLExtensionHandler.h @@ -6,77 +6,14 @@ #define __C_OPEN_GL_FEATURE_MAP_H_INCLUDED__ #include "IrrCompileConfig.h" + #ifdef _IRR_COMPILE_WITH_OPENGL_ #include "EDriverFeatures.h" #include "irrTypes.h" #include "os.h" - -#if defined(_IRR_WINDOWS_API_) - // include windows headers for HWND - #define WIN32_LEAN_AND_MEAN - #include - #if defined(_IRR_OPENGL_USE_EXTPOINTER_) - #define GL_GLEXT_LEGACY 1 - #endif - #include - #if defined(_IRR_OPENGL_USE_EXTPOINTER_) - #include "glext.h" - #endif - #include "wglext.h" - - #ifdef _MSC_VER - #pragma comment(lib, "OpenGL32.lib") - #endif - -#elif defined(_IRR_COMPILE_WITH_OSX_DEVICE_) - #if defined(_IRR_OPENGL_USE_EXTPOINTER_) - #define GL_GLEXT_LEGACY 1 - #endif - #include - #if defined(_IRR_OPENGL_USE_EXTPOINTER_) - #include "glext.h" - #endif -#elif defined(_IRR_COMPILE_WITH_SDL_DEVICE_) && !defined(_IRR_COMPILE_WITH_X11_DEVICE_) - #if defined(_IRR_OPENGL_USE_EXTPOINTER_) - #define GL_GLEXT_LEGACY 1 - #define GLX_GLXEXT_LEGACY 1 - #else - #define GL_GLEXT_PROTOTYPES 1 - #define GLX_GLXEXT_PROTOTYPES 1 - #endif - #define NO_SDL_GLEXT - #include - #include - #include "glext.h" -#else - #if defined(_IRR_OPENGL_USE_EXTPOINTER_) - #define GL_GLEXT_LEGACY 1 - #define GLX_GLXEXT_LEGACY 1 - #else - #define GL_GLEXT_PROTOTYPES 1 - #define GLX_GLXEXT_PROTOTYPES 1 - #endif - #include - #include - #if defined(_IRR_OPENGL_USE_EXTPOINTER_) - #include "glext.h" - #undef GLX_ARB_get_proc_address // avoid problems with local glxext.h - #include "glxext.h" - #endif -#endif - -#ifndef GL_ARB_shader_objects -/* GL types for program/shader text and shader object handles */ -typedef char GLcharARB; -typedef unsigned int GLhandleARB; -#endif - -#ifndef GL_VERSION_2_0 -/* GL type for program/shader text */ -typedef char GLchar; -#endif - +#include "COpenGLCommon.h" +#include "COGLCoreFeature.h" namespace irr { @@ -1058,6 +995,8 @@ class COpenGLExtensionHandler // deferred initialization void initExtensions(bool stencilBuffer); + const COGLCoreFeature& getFeature() const; + //! queries the features of the driver, returns true if feature is available bool queryFeature(E_VIDEO_DRIVER_FEATURE feature) const; @@ -1074,14 +1013,9 @@ class COpenGLExtensionHandler // Some variables for properties bool StencilBuffer; - bool MultiTextureExtension; bool TextureCompressionExtension; // Some non-boolean properties - //! Maxmimum texture layers supported by the fixed pipeline - u8 MaxSupportedTextures; - //! Maxmimum texture layers supported by the engine - u8 MaxTextureUnits; //! Maximum hardware lights supported u8 MaxLights; //! Maximal Anisotropy @@ -1090,8 +1024,6 @@ class COpenGLExtensionHandler u8 MaxUserClipPlanes; //! Number of auxiliary buffers u8 MaxAuxBuffers; - //! Number of rendertargets available as MRTs - u8 MaxMultipleRenderTargets; //! Optimal number of indices per meshbuffer u32 MaxIndices; //! Maximal texture dimension @@ -1118,16 +1050,16 @@ class COpenGLExtensionHandler // public access to the (loaded) extensions. // general functions - void extGlActiveTexture(GLenum texture); - void extGlClientActiveTexture(GLenum texture); + void irrGlActiveTexture(GLenum texture); + void irrGlClientActiveTexture(GLenum texture); void extGlPointParameterf(GLint loc, GLfloat f); void extGlPointParameterfv(GLint loc, const GLfloat *v); void extGlStencilFuncSeparate (GLenum frontfunc, GLenum backfunc, GLint ref, GLuint mask); void extGlStencilOpSeparate (GLenum face, GLenum fail, GLenum zfail, GLenum zpass); - void extGlCompressedTexImage2D(GLenum target, GLint level, + void irrGlCompressedTexImage2D(GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLint border, GLsizei imageSize, const void* data); - void extGlCompressedTexSubImage2D(GLenum target, GLint level, + void irrGlCompressedTexSubImage2D(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLsizei imageSize, const void* data); @@ -1160,7 +1092,7 @@ class COpenGLExtensionHandler // that handleARB and uint are the same type void extGlLinkProgram(GLuint program); void extGlUseProgramObject(GLhandleARB prog); - void extGlUseProgram(GLuint prog); + void irrGlUseProgram(GLuint prog); void extGlDeleteObject(GLhandleARB object); void extGlDeleteProgram(GLuint object); void extGlDeleteShader(GLuint shader); @@ -1193,19 +1125,20 @@ class COpenGLExtensionHandler void extGlGetActiveUniform(GLuint program, GLuint index, GLsizei maxlength, GLsizei *length, GLint *size, GLenum *type, GLchar *name); // framebuffer objects - void extGlBindFramebuffer(GLenum target, GLuint framebuffer); - void extGlDeleteFramebuffers(GLsizei n, const GLuint *framebuffers); - void extGlGenFramebuffers(GLsizei n, GLuint *framebuffers); - GLenum extGlCheckFramebufferStatus(GLenum target); - void extGlFramebufferTexture2D(GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level); - void extGlBindRenderbuffer(GLenum target, GLuint renderbuffer); - void extGlDeleteRenderbuffers(GLsizei n, const GLuint *renderbuffers); - void extGlGenRenderbuffers(GLsizei n, GLuint *renderbuffers); - void extGlRenderbufferStorage(GLenum target, GLenum internalformat, GLsizei width, GLsizei height); - void extGlFramebufferRenderbuffer(GLenum target, GLenum attachment, GLenum renderbuffertarget, GLuint renderbuffer); - void extGlGenerateMipmap(GLenum target); - void extGlActiveStencilFace(GLenum face); - void extGlDrawBuffers(GLsizei n, const GLenum *bufs); + void irrGlBindFramebuffer(GLenum target, GLuint framebuffer); + void irrGlDeleteFramebuffers(GLsizei n, const GLuint *framebuffers); + void irrGlGenFramebuffers(GLsizei n, GLuint *framebuffers); + GLenum irrGlCheckFramebufferStatus(GLenum target); + void irrGlFramebufferTexture2D(GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level); + void irrGlBindRenderbuffer(GLenum target, GLuint renderbuffer); + void irrGlDeleteRenderbuffers(GLsizei n, const GLuint *renderbuffers); + void irrGlGenRenderbuffers(GLsizei n, GLuint *renderbuffers); + void irrGlRenderbufferStorage(GLenum target, GLenum internalformat, GLsizei width, GLsizei height); + void irrGlFramebufferRenderbuffer(GLenum target, GLenum attachment, GLenum renderbuffertarget, GLuint renderbuffer); + void irrGlGenerateMipmap(GLenum target); + void irrGlActiveStencilFace(GLenum face); + void irrGlDrawBuffer(GLenum mode); + void irrGlDrawBuffers(GLsizei n, const GLenum *bufs); // vertex buffer object void extGlGenBuffers(GLsizei n, GLuint *buffers); @@ -1233,17 +1166,17 @@ class COpenGLExtensionHandler void extGlGetQueryObjectuiv(GLuint id, GLenum pname, GLuint *params); // blend - void extGlBlendFuncSeparate(GLenum sfactorRGB, GLenum dfactorRGB, GLenum sfactorAlpha, GLenum dfactorAlpha); - void extGlBlendEquation(GLenum mode); + void irrGlBlendFuncSeparate(GLenum sfactorRGB, GLenum dfactorRGB, GLenum sfactorAlpha, GLenum dfactorAlpha); + void irrGlBlendEquation(GLenum mode); // indexed - void extGlEnableIndexed(GLenum target, GLuint index); - void extGlDisableIndexed(GLenum target, GLuint index); - void extGlColorMaskIndexed(GLuint buf, GLboolean r, GLboolean g, GLboolean b, GLboolean a); - void extGlBlendFuncIndexed(GLuint buf, GLenum src, GLenum dst); - void extGlBlendFuncSeparateIndexed(GLuint buf, GLenum srcRGB, GLenum dstRGB, GLenum srcAlpha, GLenum dstAlpha); - void extGlBlendEquationIndexed(GLuint buf, GLenum mode); - void extGlBlendEquationSeparateIndexed(GLuint buf, GLenum modeRGB, GLenum modeAlpha); + void irrGlEnableIndexed(GLenum target, GLuint index); + void irrGlDisableIndexed(GLenum target, GLuint index); + void irrGlColorMaskIndexed(GLuint buf, GLboolean r, GLboolean g, GLboolean b, GLboolean a); + void irrGlBlendFuncIndexed(GLuint buf, GLenum src, GLenum dst); + void irrGlBlendFuncSeparateIndexed(GLuint buf, GLenum srcRGB, GLenum dstRGB, GLenum srcAlpha, GLenum dstAlpha); + void irrGlBlendEquationIndexed(GLuint buf, GLenum mode); + void irrGlBlendEquationSeparateIndexed(GLuint buf, GLenum modeRGB, GLenum modeAlpha); // generic vsync setting method for several extensions void extGlSwapInterval(int interval); @@ -1252,6 +1185,8 @@ class COpenGLExtensionHandler bool FeatureAvailable[IRR_OpenGL_Feature_Count]; protected: + COGLCoreFeature Feature; + #if defined(_IRR_OPENGL_USE_EXTPOINTER_) PFNGLACTIVETEXTUREARBPROC pGlActiveTextureARB; PFNGLCLIENTACTIVETEXTUREARBPROC pGlClientActiveTextureARB; @@ -1403,13 +1338,12 @@ class COpenGLExtensionHandler #endif }; -inline void COpenGLExtensionHandler::extGlActiveTexture(GLenum texture) +inline void COpenGLExtensionHandler::irrGlActiveTexture(GLenum texture) { #ifdef _IRR_OPENGL_USE_EXTPOINTER_ - if (MultiTextureExtension && pGlActiveTextureARB) + if (pGlActiveTextureARB) pGlActiveTextureARB(texture); #else - if (MultiTextureExtension) #ifdef GL_ARB_multitexture glActiveTextureARB(texture); #else @@ -1418,14 +1352,13 @@ inline void COpenGLExtensionHandler::extGlActiveTexture(GLenum texture) #endif } -inline void COpenGLExtensionHandler::extGlClientActiveTexture(GLenum texture) +inline void COpenGLExtensionHandler::irrGlClientActiveTexture(GLenum texture) { #ifdef _IRR_OPENGL_USE_EXTPOINTER_ - if (MultiTextureExtension && pGlClientActiveTextureARB) + if (pGlClientActiveTextureARB) pGlClientActiveTextureARB(texture); #else - if (MultiTextureExtension) - glClientActiveTextureARB(texture); + glClientActiveTextureARB(texture); #endif } @@ -1675,7 +1608,7 @@ inline void COpenGLExtensionHandler::extGlUseProgramObject(GLhandleARB prog) #endif } -inline void COpenGLExtensionHandler::extGlUseProgram(GLuint prog) +inline void COpenGLExtensionHandler::irrGlUseProgram(GLuint prog) { #ifdef _IRR_OPENGL_USE_EXTPOINTER_ if (pGlUseProgram) @@ -2075,7 +2008,7 @@ inline void COpenGLExtensionHandler::extGlStencilOpSeparate (GLenum face, GLenum #endif } -inline void COpenGLExtensionHandler::extGlCompressedTexImage2D (GLenum target, GLint level, GLenum internalformat, GLsizei width, +inline void COpenGLExtensionHandler::irrGlCompressedTexImage2D (GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLint border, GLsizei imageSize, const void* data) { #ifdef _IRR_OPENGL_USE_EXTPOINTER_ @@ -2088,7 +2021,7 @@ inline void COpenGLExtensionHandler::extGlCompressedTexImage2D (GLenum target, G #endif } -inline void COpenGLExtensionHandler::extGlCompressedTexSubImage2D(GLenum target, GLint level, GLint xoffset, GLint yoffset, +inline void COpenGLExtensionHandler::irrGlCompressedTexSubImage2D(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLsizei imageSize, const void* data) { #ifdef _IRR_OPENGL_USE_EXTPOINTER_ @@ -2101,7 +2034,7 @@ inline void COpenGLExtensionHandler::extGlCompressedTexSubImage2D(GLenum target, #endif } -inline void COpenGLExtensionHandler::extGlBindFramebuffer(GLenum target, GLuint framebuffer) +inline void COpenGLExtensionHandler::irrGlBindFramebuffer(GLenum target, GLuint framebuffer) { #ifdef _IRR_OPENGL_USE_EXTPOINTER_ if (pGlBindFramebuffer) @@ -2117,7 +2050,7 @@ inline void COpenGLExtensionHandler::extGlBindFramebuffer(GLenum target, GLuint #endif } -inline void COpenGLExtensionHandler::extGlDeleteFramebuffers(GLsizei n, const GLuint *framebuffers) +inline void COpenGLExtensionHandler::irrGlDeleteFramebuffers(GLsizei n, const GLuint *framebuffers) { #ifdef _IRR_OPENGL_USE_EXTPOINTER_ if (pGlDeleteFramebuffers) @@ -2133,7 +2066,7 @@ inline void COpenGLExtensionHandler::extGlDeleteFramebuffers(GLsizei n, const GL #endif } -inline void COpenGLExtensionHandler::extGlGenFramebuffers(GLsizei n, GLuint *framebuffers) +inline void COpenGLExtensionHandler::irrGlGenFramebuffers(GLsizei n, GLuint *framebuffers) { if (framebuffers) memset(framebuffers,0,n*sizeof(GLuint)); @@ -2151,7 +2084,7 @@ inline void COpenGLExtensionHandler::extGlGenFramebuffers(GLsizei n, GLuint *fra #endif } -inline GLenum COpenGLExtensionHandler::extGlCheckFramebufferStatus(GLenum target) +inline GLenum COpenGLExtensionHandler::irrGlCheckFramebufferStatus(GLenum target) { #ifdef _IRR_OPENGL_USE_EXTPOINTER_ if (pGlCheckFramebufferStatus) @@ -2170,7 +2103,7 @@ inline GLenum COpenGLExtensionHandler::extGlCheckFramebufferStatus(GLenum target #endif } -inline void COpenGLExtensionHandler::extGlFramebufferTexture2D(GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level) +inline void COpenGLExtensionHandler::irrGlFramebufferTexture2D(GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level) { #ifdef _IRR_OPENGL_USE_EXTPOINTER_ if (pGlFramebufferTexture2D) @@ -2186,7 +2119,7 @@ inline void COpenGLExtensionHandler::extGlFramebufferTexture2D(GLenum target, GL #endif } -inline void COpenGLExtensionHandler::extGlBindRenderbuffer(GLenum target, GLuint renderbuffer) +inline void COpenGLExtensionHandler::irrGlBindRenderbuffer(GLenum target, GLuint renderbuffer) { #ifdef _IRR_OPENGL_USE_EXTPOINTER_ if (pGlBindRenderbuffer) @@ -2202,7 +2135,7 @@ inline void COpenGLExtensionHandler::extGlBindRenderbuffer(GLenum target, GLuint #endif } -inline void COpenGLExtensionHandler::extGlDeleteRenderbuffers(GLsizei n, const GLuint *renderbuffers) +inline void COpenGLExtensionHandler::irrGlDeleteRenderbuffers(GLsizei n, const GLuint *renderbuffers) { #ifdef _IRR_OPENGL_USE_EXTPOINTER_ if (pGlDeleteRenderbuffers) @@ -2218,7 +2151,7 @@ inline void COpenGLExtensionHandler::extGlDeleteRenderbuffers(GLsizei n, const G #endif } -inline void COpenGLExtensionHandler::extGlGenRenderbuffers(GLsizei n, GLuint *renderbuffers) +inline void COpenGLExtensionHandler::irrGlGenRenderbuffers(GLsizei n, GLuint *renderbuffers) { if (renderbuffers) memset(renderbuffers,0,n*sizeof(GLuint)); @@ -2236,7 +2169,7 @@ inline void COpenGLExtensionHandler::extGlGenRenderbuffers(GLsizei n, GLuint *re #endif } -inline void COpenGLExtensionHandler::extGlRenderbufferStorage(GLenum target, GLenum internalformat, GLsizei width, GLsizei height) +inline void COpenGLExtensionHandler::irrGlRenderbufferStorage(GLenum target, GLenum internalformat, GLsizei width, GLsizei height) { #ifdef _IRR_OPENGL_USE_EXTPOINTER_ if (pGlRenderbufferStorage) @@ -2252,7 +2185,7 @@ inline void COpenGLExtensionHandler::extGlRenderbufferStorage(GLenum target, GLe #endif } -inline void COpenGLExtensionHandler::extGlFramebufferRenderbuffer(GLenum target, GLenum attachment, GLenum renderbuffertarget, GLuint renderbuffer) +inline void COpenGLExtensionHandler::irrGlFramebufferRenderbuffer(GLenum target, GLenum attachment, GLenum renderbuffertarget, GLuint renderbuffer) { #ifdef _IRR_OPENGL_USE_EXTPOINTER_ if (pGlFramebufferRenderbuffer) @@ -2268,7 +2201,7 @@ inline void COpenGLExtensionHandler::extGlFramebufferRenderbuffer(GLenum target, #endif } -inline void COpenGLExtensionHandler::extGlGenerateMipmap(GLenum target) +inline void COpenGLExtensionHandler::irrGlGenerateMipmap(GLenum target) { #ifdef _IRR_OPENGL_USE_EXTPOINTER_ if (pGlGenerateMipmap) @@ -2284,7 +2217,7 @@ inline void COpenGLExtensionHandler::extGlGenerateMipmap(GLenum target) #endif } -inline void COpenGLExtensionHandler::extGlActiveStencilFace(GLenum face) +inline void COpenGLExtensionHandler::irrGlActiveStencilFace(GLenum face) { #ifdef _IRR_OPENGL_USE_EXTPOINTER_ if (pGlActiveStencilFaceEXT) @@ -2296,7 +2229,12 @@ inline void COpenGLExtensionHandler::extGlActiveStencilFace(GLenum face) #endif } -inline void COpenGLExtensionHandler::extGlDrawBuffers(GLsizei n, const GLenum *bufs) +inline void COpenGLExtensionHandler::irrGlDrawBuffer(GLenum mode) +{ + glDrawBuffer(mode); +} + +inline void COpenGLExtensionHandler::irrGlDrawBuffers(GLsizei n, const GLenum *bufs) { #ifdef _IRR_OPENGL_USE_EXTPOINTER_ if (pGlDrawBuffersARB) @@ -2616,7 +2554,7 @@ inline void COpenGLExtensionHandler::extGlGetQueryObjectuiv(GLuint id, GLenum pn #endif } -inline void COpenGLExtensionHandler::extGlBlendFuncSeparate(GLenum sfactorRGB, GLenum dfactorRGB, GLenum sfactorAlpha, GLenum dfactorAlpha) +inline void COpenGLExtensionHandler::irrGlBlendFuncSeparate(GLenum sfactorRGB, GLenum dfactorRGB, GLenum sfactorAlpha, GLenum dfactorAlpha) { #ifdef _IRR_OPENGL_USE_EXTPOINTER_ if (pGlBlendFuncSeparate) @@ -2632,7 +2570,7 @@ inline void COpenGLExtensionHandler::extGlBlendFuncSeparate(GLenum sfactorRGB, G #endif } -inline void COpenGLExtensionHandler::extGlBlendEquation(GLenum mode) +inline void COpenGLExtensionHandler::irrGlBlendEquation(GLenum mode) { #ifdef _IRR_OPENGL_USE_EXTPOINTER_ if (pGlBlendEquation) @@ -2648,7 +2586,7 @@ inline void COpenGLExtensionHandler::extGlBlendEquation(GLenum mode) #endif } -inline void COpenGLExtensionHandler::extGlEnableIndexed(GLenum target, GLuint index) +inline void COpenGLExtensionHandler::irrGlEnableIndexed(GLenum target, GLuint index) { #ifdef _IRR_OPENGL_USE_EXTPOINTER_ if (FeatureAvailable[IRR_EXT_draw_buffers2] && pGlEnableIndexedEXT) @@ -2660,7 +2598,7 @@ inline void COpenGLExtensionHandler::extGlEnableIndexed(GLenum target, GLuint in #endif } -inline void COpenGLExtensionHandler::extGlDisableIndexed(GLenum target, GLuint index) +inline void COpenGLExtensionHandler::irrGlDisableIndexed(GLenum target, GLuint index) { #ifdef _IRR_OPENGL_USE_EXTPOINTER_ if (FeatureAvailable[IRR_EXT_draw_buffers2] && pGlDisableIndexedEXT) @@ -2672,7 +2610,7 @@ inline void COpenGLExtensionHandler::extGlDisableIndexed(GLenum target, GLuint i #endif } -inline void COpenGLExtensionHandler::extGlColorMaskIndexed(GLuint buf, GLboolean r, GLboolean g, GLboolean b, GLboolean a) +inline void COpenGLExtensionHandler::irrGlColorMaskIndexed(GLuint buf, GLboolean r, GLboolean g, GLboolean b, GLboolean a) { #ifdef _IRR_OPENGL_USE_EXTPOINTER_ if (FeatureAvailable[IRR_EXT_draw_buffers2] && pGlColorMaskIndexedEXT) @@ -2684,7 +2622,7 @@ inline void COpenGLExtensionHandler::extGlColorMaskIndexed(GLuint buf, GLboolean #endif } -inline void COpenGLExtensionHandler::extGlBlendFuncIndexed(GLuint buf, GLenum src, GLenum dst) +inline void COpenGLExtensionHandler::irrGlBlendFuncIndexed(GLuint buf, GLenum src, GLenum dst) { #ifdef _IRR_OPENGL_USE_EXTPOINTER_ if (FeatureAvailable[IRR_ARB_draw_buffers_blend] && pGlBlendFunciARB) @@ -2700,7 +2638,7 @@ inline void COpenGLExtensionHandler::extGlBlendFuncIndexed(GLuint buf, GLenum sr #endif } -inline void COpenGLExtensionHandler::extGlBlendFuncSeparateIndexed(GLuint buf, GLenum srcRGB, GLenum dstRGB, GLenum srcAlpha, GLenum dstAlpha) +inline void COpenGLExtensionHandler::irrGlBlendFuncSeparateIndexed(GLuint buf, GLenum srcRGB, GLenum dstRGB, GLenum srcAlpha, GLenum dstAlpha) { #ifdef _IRR_OPENGL_USE_EXTPOINTER_ if (FeatureAvailable[IRR_ARB_draw_buffers_blend] && pGlBlendFuncSeparateiARB) @@ -2716,7 +2654,7 @@ inline void COpenGLExtensionHandler::extGlBlendFuncSeparateIndexed(GLuint buf, G #endif } -inline void COpenGLExtensionHandler::extGlBlendEquationIndexed(GLuint buf, GLenum mode) +inline void COpenGLExtensionHandler::irrGlBlendEquationIndexed(GLuint buf, GLenum mode) { #ifdef _IRR_OPENGL_USE_EXTPOINTER_ if (FeatureAvailable[IRR_ARB_draw_buffers_blend] && pGlBlendEquationiARB) @@ -2732,7 +2670,7 @@ inline void COpenGLExtensionHandler::extGlBlendEquationIndexed(GLuint buf, GLenu #endif } -inline void COpenGLExtensionHandler::extGlBlendEquationSeparateIndexed(GLuint buf, GLenum modeRGB, GLenum modeAlpha) +inline void COpenGLExtensionHandler::irrGlBlendEquationSeparateIndexed(GLuint buf, GLenum modeRGB, GLenum modeAlpha) { #ifdef _IRR_OPENGL_USE_EXTPOINTER_ if (FeatureAvailable[IRR_ARB_draw_buffers_blend] && pGlBlendEquationSeparateiARB) diff --git a/source/Irrlicht/COpenGLMaterialRenderer.h b/source/Irrlicht/COpenGLMaterialRenderer.h index 0d5de5a2..12f35e13 100644 --- a/source/Irrlicht/COpenGLMaterialRenderer.h +++ b/source/Irrlicht/COpenGLMaterialRenderer.h @@ -9,6 +9,7 @@ #ifdef _IRR_COMPILE_WITH_OPENGL_ #include "COpenGLDriver.h" +#include "COpenGLCacheHandler.h" #include "IMaterialRenderer.h" namespace irr @@ -16,45 +17,12 @@ namespace irr namespace video { -//! Base class for all internal OpenGL material renderers -class COpenGLMaterialRenderer : public IMaterialRenderer -{ -public: - - //! Constructor - COpenGLMaterialRenderer(video::COpenGLDriver* driver) : Driver(driver) - { - } - - //! On set material method for shader based materials - virtual void OnSetBaseMaterial(const SMaterial& material) - { - } - - //! On unset material method for shader based materials - virtual void OnUnsetBaseMaterial() - { - } - - virtual bool OnRender(IMaterialRendererServices* service, E_VERTEX_TYPE vtxtype) _IRR_OVERRIDE_ - { - Driver->setTextureRenderStates(Driver->getCurrentMaterial(), false); - return true; - } - -protected: - - video::COpenGLDriver* Driver; -}; - - //! Solid material renderer -class COpenGLMaterialRenderer_SOLID : public COpenGLMaterialRenderer +class COpenGLMaterialRenderer_SOLID : public IMaterialRenderer { public: - COpenGLMaterialRenderer_SOLID(video::COpenGLDriver* d) - : COpenGLMaterialRenderer(d) {} + COpenGLMaterialRenderer_SOLID(video::COpenGLDriver* d) : Driver(d) {} virtual void OnSetMaterial(const SMaterial& material, const SMaterial& lastMaterial, bool resetAllRenderstates, IMaterialRendererServices* services) _IRR_OVERRIDE_ @@ -74,16 +42,19 @@ public: glTexEnvi(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_MODULATE); } } + +protected: + + video::COpenGLDriver* Driver; }; //! Generic Texture Blend -class COpenGLMaterialRenderer_ONETEXTURE_BLEND : public COpenGLMaterialRenderer +class COpenGLMaterialRenderer_ONETEXTURE_BLEND : public IMaterialRenderer { public: - COpenGLMaterialRenderer_ONETEXTURE_BLEND(video::COpenGLDriver* d) - : COpenGLMaterialRenderer(d) {} + COpenGLMaterialRenderer_ONETEXTURE_BLEND(video::COpenGLDriver* d) : Driver(d) {} virtual void OnSetMaterial(const SMaterial& material, const SMaterial& lastMaterial, bool resetAllRenderstates, IMaterialRendererServices* services) _IRR_OVERRIDE_ @@ -105,16 +76,16 @@ public: u32 alphaSource; unpack_textureBlendFuncSeparate(srcRGBFact, dstRGBFact, srcAlphaFact, dstAlphaFact, modulate, alphaSource, material.MaterialTypeParam); - Driver->getBridgeCalls()->setBlend(true); + Driver->getCacheHandler()->setBlend(true); if (Driver->queryFeature(EVDF_BLEND_SEPARATE)) { - Driver->getBridgeCalls()->setBlendFuncSeparate(Driver->getGLBlend(srcRGBFact), Driver->getGLBlend(dstRGBFact), + Driver->getCacheHandler()->setBlendFuncSeparate(Driver->getGLBlend(srcRGBFact), Driver->getGLBlend(dstRGBFact), Driver->getGLBlend(srcAlphaFact), Driver->getGLBlend(dstAlphaFact)); } else { - Driver->getBridgeCalls()->setBlendFunc(Driver->getGLBlend(srcRGBFact), Driver->getGLBlend(dstRGBFact)); + Driver->getCacheHandler()->setBlendFunc(Driver->getGLBlend(srcRGBFact), Driver->getGLBlend(dstRGBFact)); } #ifdef GL_ARB_texture_env_combine @@ -170,26 +141,6 @@ public: } } - virtual void OnSetBaseMaterial(const SMaterial& material) _IRR_OVERRIDE_ - { - E_BLEND_FACTOR srcRGBFact,dstRGBFact,srcAlphaFact,dstAlphaFact; - E_MODULATE_FUNC modulate; - u32 alphaSource; - unpack_textureBlendFuncSeparate(srcRGBFact, dstRGBFact, srcAlphaFact, dstAlphaFact, modulate, alphaSource, material.MaterialTypeParam); - - Driver->getBridgeCalls()->setBlend(true); - - if (Driver->queryFeature(EVDF_BLEND_SEPARATE)) - { - Driver->getBridgeCalls()->setBlendFuncSeparate(Driver->getGLBlend(srcRGBFact), Driver->getGLBlend(dstRGBFact), - Driver->getGLBlend(srcAlphaFact), Driver->getGLBlend(dstAlphaFact)); - } - else - { - Driver->getBridgeCalls()->setBlendFunc(Driver->getGLBlend(srcRGBFact), Driver->getGLBlend(dstRGBFact)); - } - } - virtual void OnUnsetMaterial() _IRR_OVERRIDE_ { glTexEnvi(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_MODULATE); @@ -203,12 +154,7 @@ public: glTexEnvf(GL_TEXTURE_ENV, GL_SOURCE1_RGB_EXT, GL_PREVIOUS_EXT); #endif - Driver->getBridgeCalls()->setBlend(false); - } - - virtual void OnUnsetBaseMaterial() _IRR_OVERRIDE_ - { - Driver->getBridgeCalls()->setBlend(false); + Driver->getCacheHandler()->setBlend(false); } //! Returns if the material is transparent. @@ -217,16 +163,19 @@ public: { return true; } + +protected: + + video::COpenGLDriver* Driver; }; //! Solid 2 layer material renderer -class COpenGLMaterialRenderer_SOLID_2_LAYER : public COpenGLMaterialRenderer +class COpenGLMaterialRenderer_SOLID_2_LAYER : public IMaterialRenderer { public: - COpenGLMaterialRenderer_SOLID_2_LAYER(video::COpenGLDriver* d) - : COpenGLMaterialRenderer(d) {} + COpenGLMaterialRenderer_SOLID_2_LAYER(video::COpenGLDriver* d) : Driver(d) {} virtual void OnSetMaterial(const SMaterial& material, const SMaterial& lastMaterial, bool resetAllRenderstates, IMaterialRendererServices* services) _IRR_OVERRIDE_ @@ -243,7 +192,7 @@ public: { if (Driver->queryFeature(EVDF_MULTITEXTURE)) { - Driver->getBridgeCalls()->setActiveTexture(GL_TEXTURE1_ARB); + Driver->getCacheHandler()->setActiveTexture(GL_TEXTURE1_ARB); #ifdef GL_ARB_texture_env_combine glTexEnvf(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_COMBINE_ARB); glTexEnvf(GL_TEXTURE_ENV, GL_COMBINE_ALPHA_ARB, GL_REPLACE); @@ -271,26 +220,29 @@ public: { if (Driver->queryFeature(EVDF_MULTITEXTURE)) { - Driver->getBridgeCalls()->setActiveTexture(GL_TEXTURE1_ARB); + Driver->getCacheHandler()->setActiveTexture(GL_TEXTURE1_ARB); glTexEnvi(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_MODULATE); #ifdef GL_ARB_texture_env_combine glTexEnvf(GL_TEXTURE_ENV, GL_OPERAND2_RGB_ARB, GL_SRC_COLOR); #else glTexEnvf(GL_TEXTURE_ENV, GL_OPERAND2_RGB_EXT, GL_SRC_COLOR); #endif - Driver->getBridgeCalls()->setActiveTexture(GL_TEXTURE0_ARB); + Driver->getCacheHandler()->setActiveTexture(GL_TEXTURE0_ARB); } } + +protected: + + video::COpenGLDriver* Driver; }; //! Transparent add color material renderer -class COpenGLMaterialRenderer_TRANSPARENT_ADD_COLOR : public COpenGLMaterialRenderer +class COpenGLMaterialRenderer_TRANSPARENT_ADD_COLOR : public IMaterialRenderer { public: - COpenGLMaterialRenderer_TRANSPARENT_ADD_COLOR(video::COpenGLDriver* d) - : COpenGLMaterialRenderer(d) {} + COpenGLMaterialRenderer_TRANSPARENT_ADD_COLOR(video::COpenGLDriver* d) : Driver(d) {} virtual void OnSetMaterial(const SMaterial& material, const SMaterial& lastMaterial, bool resetAllRenderstates, IMaterialRendererServices* services) _IRR_OVERRIDE_ @@ -303,27 +255,16 @@ public: Driver->disableTextures(1); Driver->setBasicRenderStates(material, lastMaterial, resetAllRenderstates); - Driver->getBridgeCalls()->setBlendFunc(GL_ONE, GL_ONE_MINUS_SRC_COLOR); - Driver->getBridgeCalls()->setBlend(true); + Driver->getCacheHandler()->setBlendFunc(GL_ONE, GL_ONE_MINUS_SRC_COLOR); + Driver->getCacheHandler()->setBlend(true); if ((material.MaterialType != lastMaterial.MaterialType) || resetAllRenderstates) glTexEnvi(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_MODULATE); } - virtual void OnSetBaseMaterial(const SMaterial& material) _IRR_OVERRIDE_ - { - Driver->getBridgeCalls()->setBlendFunc(GL_ONE, GL_ONE_MINUS_SRC_COLOR); - Driver->getBridgeCalls()->setBlend(true); - } - virtual void OnUnsetMaterial() _IRR_OVERRIDE_ { - Driver->getBridgeCalls()->setBlend(false); - } - - virtual void OnUnsetBaseMaterial() _IRR_OVERRIDE_ - { - Driver->getBridgeCalls()->setBlend(false); + Driver->getCacheHandler()->setBlend(false); } //! Returns if the material is transparent. @@ -331,16 +272,19 @@ public: { return true; } + +protected: + + video::COpenGLDriver* Driver; }; //! Transparent vertex alpha material renderer -class COpenGLMaterialRenderer_TRANSPARENT_VERTEX_ALPHA : public COpenGLMaterialRenderer +class COpenGLMaterialRenderer_TRANSPARENT_VERTEX_ALPHA : public IMaterialRenderer { public: - COpenGLMaterialRenderer_TRANSPARENT_VERTEX_ALPHA(video::COpenGLDriver* d) - : COpenGLMaterialRenderer(d) {} + COpenGLMaterialRenderer_TRANSPARENT_VERTEX_ALPHA(video::COpenGLDriver* d) : Driver(d) {} virtual void OnSetMaterial(const SMaterial& material, const SMaterial& lastMaterial, bool resetAllRenderstates, IMaterialRendererServices* services) _IRR_OVERRIDE_ @@ -353,8 +297,8 @@ public: Driver->disableTextures(1); Driver->setBasicRenderStates(material, lastMaterial, resetAllRenderstates); - Driver->getBridgeCalls()->setBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA); - Driver->getBridgeCalls()->setBlend(true); + Driver->getCacheHandler()->setBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA); + Driver->getCacheHandler()->setBlend(true); if (material.MaterialType != lastMaterial.MaterialType || resetAllRenderstates) { @@ -376,12 +320,6 @@ public: } } - virtual void OnSetBaseMaterial(const SMaterial& material) _IRR_OVERRIDE_ - { - Driver->getBridgeCalls()->setBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA); - Driver->getBridgeCalls()->setBlend(true); - } - virtual void OnUnsetMaterial() _IRR_OVERRIDE_ { // default values @@ -393,12 +331,7 @@ public: glTexEnvf(GL_TEXTURE_ENV, GL_COMBINE_ALPHA_EXT, GL_MODULATE ); glTexEnvf(GL_TEXTURE_ENV, GL_SOURCE0_ALPHA_EXT, GL_TEXTURE ); #endif - Driver->getBridgeCalls()->setBlend(false); - } - - virtual void OnUnsetBaseMaterial() _IRR_OVERRIDE_ - { - Driver->getBridgeCalls()->setBlend(false); + Driver->getCacheHandler()->setBlend(false); } //! Returns if the material is transparent. @@ -406,16 +339,19 @@ public: { return true; } + +protected: + + video::COpenGLDriver* Driver; }; //! Transparent alpha channel material renderer -class COpenGLMaterialRenderer_TRANSPARENT_ALPHA_CHANNEL : public COpenGLMaterialRenderer +class COpenGLMaterialRenderer_TRANSPARENT_ALPHA_CHANNEL : public IMaterialRenderer { public: - COpenGLMaterialRenderer_TRANSPARENT_ALPHA_CHANNEL(video::COpenGLDriver* d) - : COpenGLMaterialRenderer(d) {} + COpenGLMaterialRenderer_TRANSPARENT_ALPHA_CHANNEL(video::COpenGLDriver* d) : Driver(d) {} virtual void OnSetMaterial(const SMaterial& material, const SMaterial& lastMaterial, bool resetAllRenderstates, IMaterialRendererServices* services) _IRR_OVERRIDE_ @@ -428,10 +364,10 @@ public: Driver->disableTextures(1); Driver->setBasicRenderStates(material, lastMaterial, resetAllRenderstates); - Driver->getBridgeCalls()->setBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA); - Driver->getBridgeCalls()->setBlend(true); - Driver->getBridgeCalls()->setAlphaTest(true); - Driver->getBridgeCalls()->setAlphaFunc(GL_GREATER, material.MaterialTypeParam); + Driver->getCacheHandler()->setBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA); + Driver->getCacheHandler()->setBlend(true); + Driver->getCacheHandler()->setAlphaTest(true); + Driver->getCacheHandler()->setAlphaFunc(GL_GREATER, material.MaterialTypeParam); if (material.MaterialType != lastMaterial.MaterialType || resetAllRenderstates || material.MaterialTypeParam != lastMaterial.MaterialTypeParam ) @@ -454,14 +390,6 @@ public: } } - virtual void OnSetBaseMaterial(const SMaterial& material) _IRR_OVERRIDE_ - { - Driver->getBridgeCalls()->setBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA); - Driver->getBridgeCalls()->setBlend(true); - Driver->getBridgeCalls()->setAlphaTest(true); - Driver->getBridgeCalls()->setAlphaFunc(GL_GREATER, material.MaterialTypeParam); - } - virtual void OnUnsetMaterial() _IRR_OVERRIDE_ { glTexEnvi(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_MODULATE); @@ -470,14 +398,8 @@ public: #else glTexEnvf(GL_TEXTURE_ENV, GL_COMBINE_ALPHA_EXT, GL_MODULATE ); #endif - Driver->getBridgeCalls()->setAlphaTest(false); - Driver->getBridgeCalls()->setBlend(false); - } - - virtual void OnUnsetBaseMaterial() _IRR_OVERRIDE_ - { - Driver->getBridgeCalls()->setBlend(false); - Driver->getBridgeCalls()->setAlphaTest(false); + Driver->getCacheHandler()->setAlphaTest(false); + Driver->getCacheHandler()->setBlend(false); } //! Returns if the material is transparent. @@ -485,16 +407,19 @@ public: { return true; } + +protected: + + video::COpenGLDriver* Driver; }; //! Transparent alpha channel material renderer -class COpenGLMaterialRenderer_TRANSPARENT_ALPHA_CHANNEL_REF : public COpenGLMaterialRenderer +class COpenGLMaterialRenderer_TRANSPARENT_ALPHA_CHANNEL_REF : public IMaterialRenderer { public: - COpenGLMaterialRenderer_TRANSPARENT_ALPHA_CHANNEL_REF(video::COpenGLDriver* d) - : COpenGLMaterialRenderer(d) {} + COpenGLMaterialRenderer_TRANSPARENT_ALPHA_CHANNEL_REF(video::COpenGLDriver* d) : Driver(d) {} virtual void OnSetMaterial(const SMaterial& material, const SMaterial& lastMaterial, bool resetAllRenderstates, IMaterialRendererServices* services) _IRR_OVERRIDE_ @@ -509,26 +434,15 @@ public: if (material.MaterialType != lastMaterial.MaterialType || resetAllRenderstates) { - Driver->getBridgeCalls()->setAlphaTest(true); - Driver->getBridgeCalls()->setAlphaFunc(GL_GREATER, 0.5f); + Driver->getCacheHandler()->setAlphaTest(true); + Driver->getCacheHandler()->setAlphaFunc(GL_GREATER, 0.5f); glTexEnvi(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_MODULATE); } } - virtual void OnSetBaseMaterial(const SMaterial& material) _IRR_OVERRIDE_ - { - Driver->getBridgeCalls()->setAlphaTest(true); - Driver->getBridgeCalls()->setAlphaFunc(GL_GREATER, 0.5f); - } - virtual void OnUnsetMaterial() _IRR_OVERRIDE_ { - Driver->getBridgeCalls()->setAlphaTest(false); - } - - virtual void OnUnsetBaseMaterial() _IRR_OVERRIDE_ - { - Driver->getBridgeCalls()->setAlphaTest(false); + Driver->getCacheHandler()->setAlphaTest(false); } //! Returns if the material is transparent. @@ -536,16 +450,19 @@ public: { return false; // this material is not really transparent because it does no blending. } + +protected: + + video::COpenGLDriver* Driver; }; //! material renderer for all kinds of lightmaps -class COpenGLMaterialRenderer_LIGHTMAP : public COpenGLMaterialRenderer +class COpenGLMaterialRenderer_LIGHTMAP : public IMaterialRenderer { public: - COpenGLMaterialRenderer_LIGHTMAP(video::COpenGLDriver* d) - : COpenGLMaterialRenderer(d) {} + COpenGLMaterialRenderer_LIGHTMAP(video::COpenGLDriver* d) : Driver(d) {} virtual void OnSetMaterial(const SMaterial& material, const SMaterial& lastMaterial, bool resetAllRenderstates, IMaterialRendererServices* services) _IRR_OVERRIDE_ @@ -582,7 +499,7 @@ public: { // lightmap - Driver->getBridgeCalls()->setActiveTexture(GL_TEXTURE1_ARB); + Driver->getCacheHandler()->setActiveTexture(GL_TEXTURE1_ARB); #ifdef GL_ARB_texture_env_combine glTexEnvi(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_COMBINE_ARB); @@ -636,7 +553,7 @@ public: glTexEnvf(GL_TEXTURE_ENV, GL_RGB_SCALE_EXT, 1.0f); #endif } - Driver->getBridgeCalls()->setActiveTexture(GL_TEXTURE0_ARB); + Driver->getCacheHandler()->setActiveTexture(GL_TEXTURE0_ARB); } } } @@ -645,28 +562,31 @@ public: { if (Driver->queryFeature(EVDF_MULTITEXTURE)) { - Driver->getBridgeCalls()->setActiveTexture(GL_TEXTURE1_ARB); + Driver->getCacheHandler()->setActiveTexture(GL_TEXTURE1_ARB); #ifdef GL_ARB_texture_env_combine glTexEnvf(GL_TEXTURE_ENV, GL_RGB_SCALE_ARB, 1.f ); #else glTexEnvf(GL_TEXTURE_ENV, GL_RGB_SCALE_EXT, 1.f ); #endif glTexEnvi(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_MODULATE); - Driver->getBridgeCalls()->setActiveTexture(GL_TEXTURE0_ARB); + Driver->getCacheHandler()->setActiveTexture(GL_TEXTURE0_ARB); glTexEnvi(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_MODULATE); } } + +protected: + + video::COpenGLDriver* Driver; }; //! detail map material renderer -class COpenGLMaterialRenderer_DETAIL_MAP : public COpenGLMaterialRenderer +class COpenGLMaterialRenderer_DETAIL_MAP : public IMaterialRenderer { public: - COpenGLMaterialRenderer_DETAIL_MAP(video::COpenGLDriver* d) - : COpenGLMaterialRenderer(d) {} + COpenGLMaterialRenderer_DETAIL_MAP(video::COpenGLDriver* d) : Driver(d) {} virtual void OnSetMaterial(const SMaterial& material, const SMaterial& lastMaterial, bool resetAllRenderstates, IMaterialRendererServices* services) _IRR_OVERRIDE_ @@ -686,7 +606,7 @@ public: // detail map on second layer if (Driver->queryFeature(EVDF_MULTITEXTURE)) { - Driver->getBridgeCalls()->setActiveTexture(GL_TEXTURE1_ARB); + Driver->getCacheHandler()->setActiveTexture(GL_TEXTURE1_ARB); #ifdef GL_ARB_texture_env_combine glTexEnvi(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_COMBINE_ARB); glTexEnvi(GL_TEXTURE_ENV, GL_COMBINE_RGB_ARB, GL_ADD_SIGNED_ARB); @@ -706,21 +626,24 @@ public: { if (Driver->queryFeature(EVDF_MULTITEXTURE)) { - Driver->getBridgeCalls()->setActiveTexture(GL_TEXTURE1_ARB); + Driver->getCacheHandler()->setActiveTexture(GL_TEXTURE1_ARB); glTexEnvi(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_MODULATE); - Driver->getBridgeCalls()->setActiveTexture(GL_TEXTURE0_ARB); + Driver->getCacheHandler()->setActiveTexture(GL_TEXTURE0_ARB); } } + +protected: + + video::COpenGLDriver* Driver; }; //! sphere map material renderer -class COpenGLMaterialRenderer_SPHERE_MAP : public COpenGLMaterialRenderer +class COpenGLMaterialRenderer_SPHERE_MAP : public IMaterialRenderer { public: - COpenGLMaterialRenderer_SPHERE_MAP(video::COpenGLDriver* d) - : COpenGLMaterialRenderer(d) {} + COpenGLMaterialRenderer_SPHERE_MAP(video::COpenGLDriver* d) : Driver(d) {} virtual void OnSetMaterial(const SMaterial& material, const SMaterial& lastMaterial, bool resetAllRenderstates, IMaterialRendererServices* services) _IRR_OVERRIDE_ @@ -752,16 +675,19 @@ public: glDisable(GL_TEXTURE_GEN_S); glDisable(GL_TEXTURE_GEN_T); } + +protected: + + video::COpenGLDriver* Driver; }; //! reflection 2 layer material renderer -class COpenGLMaterialRenderer_REFLECTION_2_LAYER : public COpenGLMaterialRenderer +class COpenGLMaterialRenderer_REFLECTION_2_LAYER : public IMaterialRenderer { public: - COpenGLMaterialRenderer_REFLECTION_2_LAYER(video::COpenGLDriver* d) - : COpenGLMaterialRenderer(d) {} + COpenGLMaterialRenderer_REFLECTION_2_LAYER(video::COpenGLDriver* d) : Driver(d) {} virtual void OnSetMaterial(const SMaterial& material, const SMaterial& lastMaterial, bool resetAllRenderstates, IMaterialRendererServices* services) _IRR_OVERRIDE_ @@ -778,7 +704,7 @@ public: { if (Driver->queryFeature(EVDF_MULTITEXTURE)) { - Driver->getBridgeCalls()->setActiveTexture(GL_TEXTURE1_ARB); + Driver->getCacheHandler()->setActiveTexture(GL_TEXTURE1_ARB); #ifdef GL_ARB_texture_env_combine glTexEnvi(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_COMBINE_ARB); glTexEnvi(GL_TEXTURE_ENV, GL_COMBINE_RGB_ARB, GL_MODULATE); @@ -802,26 +728,29 @@ public: { if (Driver->queryFeature(EVDF_MULTITEXTURE)) { - Driver->getBridgeCalls()->setActiveTexture(GL_TEXTURE1_ARB); + Driver->getCacheHandler()->setActiveTexture(GL_TEXTURE1_ARB); glTexEnvi(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_MODULATE); } glDisable(GL_TEXTURE_GEN_S); glDisable(GL_TEXTURE_GEN_T); if (Driver->queryFeature(EVDF_MULTITEXTURE)) { - Driver->getBridgeCalls()->setActiveTexture(GL_TEXTURE0_ARB); + Driver->getCacheHandler()->setActiveTexture(GL_TEXTURE0_ARB); } } + +protected: + + video::COpenGLDriver* Driver; }; //! reflection 2 layer material renderer -class COpenGLMaterialRenderer_TRANSPARENT_REFLECTION_2_LAYER : public COpenGLMaterialRenderer +class COpenGLMaterialRenderer_TRANSPARENT_REFLECTION_2_LAYER : public IMaterialRenderer { public: - COpenGLMaterialRenderer_TRANSPARENT_REFLECTION_2_LAYER(video::COpenGLDriver* d) - : COpenGLMaterialRenderer(d) {} + COpenGLMaterialRenderer_TRANSPARENT_REFLECTION_2_LAYER(video::COpenGLDriver* d) : Driver(d) {} virtual void OnSetMaterial(const SMaterial& material, const SMaterial& lastMaterial, bool resetAllRenderstates, IMaterialRendererServices* services) _IRR_OVERRIDE_ @@ -834,8 +763,8 @@ public: Driver->disableTextures(2); Driver->setBasicRenderStates(material, lastMaterial, resetAllRenderstates); - Driver->getBridgeCalls()->setBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA); - Driver->getBridgeCalls()->setBlend(true); + Driver->getCacheHandler()->setBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA); + Driver->getCacheHandler()->setBlend(true); if (material.MaterialType != lastMaterial.MaterialType || resetAllRenderstates) { @@ -856,7 +785,7 @@ public: #endif if (Driver->queryFeature(EVDF_MULTITEXTURE)) { - Driver->getBridgeCalls()->setActiveTexture(GL_TEXTURE1_ARB); + Driver->getCacheHandler()->setActiveTexture(GL_TEXTURE1_ARB); #ifdef GL_ARB_texture_env_combine glTexEnvi(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_COMBINE_ARB); glTexEnvi(GL_TEXTURE_ENV, GL_COMBINE_RGB_ARB, GL_MODULATE); @@ -884,16 +813,16 @@ public: { if (Driver->queryFeature(EVDF_MULTITEXTURE)) { - Driver->getBridgeCalls()->setActiveTexture(GL_TEXTURE1_ARB); + Driver->getCacheHandler()->setActiveTexture(GL_TEXTURE1_ARB); glTexEnvi(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_MODULATE); } glDisable(GL_TEXTURE_GEN_S); glDisable(GL_TEXTURE_GEN_T); if (Driver->queryFeature(EVDF_MULTITEXTURE)) { - Driver->getBridgeCalls()->setActiveTexture(GL_TEXTURE0_ARB); + Driver->getCacheHandler()->setActiveTexture(GL_TEXTURE0_ARB); } - Driver->getBridgeCalls()->setBlend(false); + Driver->getCacheHandler()->setBlend(false); } //! Returns if the material is transparent. @@ -901,6 +830,10 @@ public: { return true; } + +protected: + + video::COpenGLDriver* Driver; }; } // end namespace video diff --git a/source/Irrlicht/COpenGLSLMaterialRenderer.cpp b/source/Irrlicht/COpenGLSLMaterialRenderer.cpp index 677cac35..50927c07 100644 --- a/source/Irrlicht/COpenGLSLMaterialRenderer.cpp +++ b/source/Irrlicht/COpenGLSLMaterialRenderer.cpp @@ -20,6 +20,7 @@ #include "IVideoDriver.h" #include "os.h" #include "COpenGLDriver.h" +#include "COpenGLCacheHandler.h" #include "COpenGLMaterialRenderer.h" namespace irr @@ -44,25 +45,35 @@ COpenGLSLMaterialRenderer::COpenGLSLMaterialRenderer(video::COpenGLDriver* drive IShaderConstantSetCallBack* callback, E_MATERIAL_TYPE baseMaterial, s32 userData) - : Driver(driver), CallBack(callback), BaseMaterial(0), Program(0), Program2(0), UserData(userData) + : Driver(driver), CallBack(callback), Alpha(false), Blending(false), FixedBlending(false), AlphaTest(false), Program(0), Program2(0), UserData(userData) { #ifdef _DEBUG setDebugName("COpenGLSLMaterialRenderer"); #endif - //entry points must always be main, and the compile target isn't selectable - //it is fine to ignore what has been asked for, as the compiler should spot anything wrong - //just check that GLSL is available - - if (baseMaterial == EMT_ONETEXTURE_BLEND || baseMaterial == EMT_TRANSPARENT_ADD_COLOR || baseMaterial == EMT_TRANSPARENT_VERTEX_ALPHA || - baseMaterial == EMT_TRANSPARENT_ALPHA_CHANNEL || baseMaterial == EMT_TRANSPARENT_ALPHA_CHANNEL_REF) + switch (baseMaterial) { - BaseMaterial = static_cast(Driver->getMaterialRenderer(baseMaterial)); + case EMT_TRANSPARENT_VERTEX_ALPHA: + case EMT_TRANSPARENT_ALPHA_CHANNEL: + case EMT_NORMAL_MAP_TRANSPARENT_VERTEX_ALPHA: + case EMT_PARALLAX_MAP_TRANSPARENT_VERTEX_ALPHA: + Alpha = true; + break; + case EMT_TRANSPARENT_ADD_COLOR: + case EMT_NORMAL_MAP_TRANSPARENT_ADD_COLOR: + case EMT_PARALLAX_MAP_TRANSPARENT_ADD_COLOR: + FixedBlending = true; + break; + case EMT_ONETEXTURE_BLEND: + Blending = true; + break; + case EMT_TRANSPARENT_ALPHA_CHANNEL_REF: + AlphaTest = true; + break; + default: + break; } - if (BaseMaterial) - BaseMaterial->grab(); - if (CallBack) CallBack->grab(); @@ -78,17 +89,31 @@ COpenGLSLMaterialRenderer::COpenGLSLMaterialRenderer(video::COpenGLDriver* drive COpenGLSLMaterialRenderer::COpenGLSLMaterialRenderer(COpenGLDriver* driver, IShaderConstantSetCallBack* callback, E_MATERIAL_TYPE baseMaterial, s32 userData) -: Driver(driver), CallBack(callback), BaseMaterial(0), Program(0), Program2(0), UserData(userData) +: Driver(driver), CallBack(callback), Alpha(false), Blending(false), FixedBlending(false), AlphaTest(false), Program(0), Program2(0), UserData(userData) { - if (baseMaterial == EMT_ONETEXTURE_BLEND || baseMaterial == EMT_TRANSPARENT_ADD_COLOR || baseMaterial == EMT_TRANSPARENT_VERTEX_ALPHA || - baseMaterial == EMT_TRANSPARENT_ALPHA_CHANNEL || baseMaterial == EMT_TRANSPARENT_ALPHA_CHANNEL_REF) + switch (baseMaterial) { - BaseMaterial = static_cast(Driver->getMaterialRenderer(baseMaterial)); + case EMT_TRANSPARENT_VERTEX_ALPHA: + case EMT_TRANSPARENT_ALPHA_CHANNEL: + case EMT_NORMAL_MAP_TRANSPARENT_VERTEX_ALPHA: + case EMT_PARALLAX_MAP_TRANSPARENT_VERTEX_ALPHA: + Alpha = true; + break; + case EMT_TRANSPARENT_ADD_COLOR: + case EMT_NORMAL_MAP_TRANSPARENT_ADD_COLOR: + case EMT_PARALLAX_MAP_TRANSPARENT_ADD_COLOR: + FixedBlending = true; + break; + case EMT_ONETEXTURE_BLEND: + Blending = true; + break; + case EMT_TRANSPARENT_ALPHA_CHANNEL_REF: + AlphaTest = true; + break; + default: + break; } - if (BaseMaterial) - BaseMaterial->grab(); - if (CallBack) CallBack->grab(); } @@ -129,9 +154,6 @@ COpenGLSLMaterialRenderer::~COpenGLSLMaterialRenderer() } UniformInfo.clear(); - - if (BaseMaterial) - BaseMaterial->drop(); } @@ -192,8 +214,6 @@ void COpenGLSLMaterialRenderer::init(s32& outMaterialTypeNr, bool COpenGLSLMaterialRenderer::OnRender(IMaterialRendererServices* service, E_VERTEX_TYPE vtxtype) { - Driver->setTextureRenderStates(Driver->getCurrentMaterial(), false); - // call callback to set shader constants if (CallBack && (Program||Program2)) CallBack->OnSetConstants(this, UserData); @@ -212,18 +232,52 @@ void COpenGLSLMaterialRenderer::OnSetMaterial(const video::SMaterial& material, else Driver->setFixedPipelineState(COpenGLDriver::EOFPS_DISABLE); + COpenGLCacheHandler* cacheHandler = Driver->getCacheHandler(); + if (material.MaterialType != lastMaterial.MaterialType || resetAllRenderstates) { if (Program2) - Driver->extGlUseProgram(Program2); + Driver->irrGlUseProgram(Program2); else if (Program) Driver->extGlUseProgramObject(Program); } Driver->setBasicRenderStates(material, lastMaterial, resetAllRenderstates); - if (BaseMaterial) - BaseMaterial->OnSetBaseMaterial(material); + if (Alpha) + { + cacheHandler->setBlend(true); + cacheHandler->setBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA); + } + else if (FixedBlending) + { + cacheHandler->setBlendFunc(GL_ONE, GL_ONE_MINUS_SRC_COLOR); + cacheHandler->setBlend(true); + } + else if (Blending) + { + E_BLEND_FACTOR srcRGBFact,dstRGBFact,srcAlphaFact,dstAlphaFact; + E_MODULATE_FUNC modulate; + u32 alphaSource; + unpack_textureBlendFuncSeparate(srcRGBFact, dstRGBFact, srcAlphaFact, dstAlphaFact, modulate, alphaSource, material.MaterialTypeParam); + + if (Driver->queryFeature(EVDF_BLEND_SEPARATE)) + { + cacheHandler->setBlendFuncSeparate(Driver->getGLBlend(srcRGBFact), Driver->getGLBlend(dstRGBFact), + Driver->getGLBlend(srcAlphaFact), Driver->getGLBlend(dstAlphaFact)); + } + else + { + cacheHandler->setBlendFunc(Driver->getGLBlend(srcRGBFact), Driver->getGLBlend(dstRGBFact)); + } + + cacheHandler->setBlend(true); + } + else if (AlphaTest) + { + cacheHandler->setAlphaTest(true); + cacheHandler->setAlphaFunc(GL_GREATER, 0.5f); + } if (CallBack) CallBack->OnSetMaterial(material); @@ -235,17 +289,14 @@ void COpenGLSLMaterialRenderer::OnUnsetMaterial() if (Program) Driver->extGlUseProgramObject(0); if (Program2) - Driver->extGlUseProgram(0); - - if (BaseMaterial) - BaseMaterial->OnUnsetBaseMaterial(); + Driver->irrGlUseProgram(0); } //! Returns if the material is transparent. bool COpenGLSLMaterialRenderer::isTransparent() const { - return BaseMaterial ? BaseMaterial->isTransparent() : false; + return (Alpha || Blending || FixedBlending); } diff --git a/source/Irrlicht/COpenGLSLMaterialRenderer.h b/source/Irrlicht/COpenGLSLMaterialRenderer.h index fe3d7ab1..4f7d6cde 100644 --- a/source/Irrlicht/COpenGLSLMaterialRenderer.h +++ b/source/Irrlicht/COpenGLSLMaterialRenderer.h @@ -43,7 +43,6 @@ namespace video { class COpenGLDriver; -class COpenGLMaterialRenderer; class IShaderConstantSetCallBack; //! Class for using GLSL shaders with OpenGL @@ -120,7 +119,11 @@ protected: COpenGLDriver* Driver; IShaderConstantSetCallBack* CallBack; - COpenGLMaterialRenderer* BaseMaterial; + + bool Alpha; + bool Blending; + bool FixedBlending; + bool AlphaTest; struct SUniformInfo { diff --git a/source/Irrlicht/COpenGLShaderMaterialRenderer.cpp b/source/Irrlicht/COpenGLShaderMaterialRenderer.cpp index 26b81143..9d6aec5e 100644 --- a/source/Irrlicht/COpenGLShaderMaterialRenderer.cpp +++ b/source/Irrlicht/COpenGLShaderMaterialRenderer.cpp @@ -11,6 +11,7 @@ #include "IVideoDriver.h" #include "os.h" #include "COpenGLDriver.h" +#include "COpenGLCacheHandler.h" #include "COpenGLMaterialRenderer.h" namespace irr @@ -23,8 +24,8 @@ namespace video COpenGLShaderMaterialRenderer::COpenGLShaderMaterialRenderer(video::COpenGLDriver* driver, s32& outMaterialTypeNr, const c8* vertexShaderProgram, const c8* pixelShaderProgram, IShaderConstantSetCallBack* callback, E_MATERIAL_TYPE baseMaterial, s32 userData) - : Driver(driver), CallBack(callback), BaseMaterial(0), - VertexShader(0), UserData(userData) + : Driver(driver), CallBack(callback), Alpha(false), Blending(false), FixedBlending(false), + AlphaTest(false), VertexShader(0), UserData(userData) { #ifdef _DEBUG setDebugName("COpenGLShaderMaterialRenderer"); @@ -36,15 +37,29 @@ COpenGLShaderMaterialRenderer::COpenGLShaderMaterialRenderer(video::COpenGLDrive PixelShader[i]=0; } - if (baseMaterial == EMT_ONETEXTURE_BLEND || baseMaterial == EMT_TRANSPARENT_ADD_COLOR || baseMaterial == EMT_TRANSPARENT_VERTEX_ALPHA || - baseMaterial == EMT_TRANSPARENT_ALPHA_CHANNEL || baseMaterial == EMT_TRANSPARENT_ALPHA_CHANNEL_REF) + switch (baseMaterial) { - BaseMaterial = static_cast(Driver->getMaterialRenderer(baseMaterial)); + case EMT_TRANSPARENT_VERTEX_ALPHA: + case EMT_TRANSPARENT_ALPHA_CHANNEL: + case EMT_NORMAL_MAP_TRANSPARENT_VERTEX_ALPHA: + case EMT_PARALLAX_MAP_TRANSPARENT_VERTEX_ALPHA: + Alpha = true; + break; + case EMT_TRANSPARENT_ADD_COLOR: + case EMT_NORMAL_MAP_TRANSPARENT_ADD_COLOR: + case EMT_PARALLAX_MAP_TRANSPARENT_ADD_COLOR: + FixedBlending = true; + break; + case EMT_ONETEXTURE_BLEND: + Blending = true; + break; + case EMT_TRANSPARENT_ALPHA_CHANNEL_REF: + AlphaTest = true; + break; + default: + break; } - if (BaseMaterial) - BaseMaterial->grab(); - if (CallBack) CallBack->grab(); @@ -57,8 +72,8 @@ COpenGLShaderMaterialRenderer::COpenGLShaderMaterialRenderer(video::COpenGLDrive COpenGLShaderMaterialRenderer::COpenGLShaderMaterialRenderer(COpenGLDriver* driver, IShaderConstantSetCallBack* callback, E_MATERIAL_TYPE baseMaterial, s32 userData) -: Driver(driver), CallBack(callback), BaseMaterial(0), - VertexShader(0), UserData(userData) +: Driver(driver), CallBack(callback), Alpha(false), Blending(false), FixedBlending(false), + AlphaTest(false), VertexShader(0), UserData(userData) { PixelShader.set_used(4); for (u32 i=0; i<4; ++i) @@ -66,15 +81,29 @@ COpenGLShaderMaterialRenderer::COpenGLShaderMaterialRenderer(COpenGLDriver* driv PixelShader[i]=0; } - if (baseMaterial == EMT_ONETEXTURE_BLEND || baseMaterial == EMT_TRANSPARENT_ADD_COLOR || baseMaterial == EMT_TRANSPARENT_VERTEX_ALPHA || - baseMaterial == EMT_TRANSPARENT_ALPHA_CHANNEL || baseMaterial == EMT_TRANSPARENT_ALPHA_CHANNEL_REF) + switch (baseMaterial) { - BaseMaterial = static_cast(Driver->getMaterialRenderer(baseMaterial)); + case EMT_TRANSPARENT_VERTEX_ALPHA: + case EMT_TRANSPARENT_ALPHA_CHANNEL: + case EMT_NORMAL_MAP_TRANSPARENT_VERTEX_ALPHA: + case EMT_PARALLAX_MAP_TRANSPARENT_VERTEX_ALPHA: + Alpha = true; + break; + case EMT_TRANSPARENT_ADD_COLOR: + case EMT_NORMAL_MAP_TRANSPARENT_ADD_COLOR: + case EMT_PARALLAX_MAP_TRANSPARENT_ADD_COLOR: + FixedBlending = true; + break; + case EMT_ONETEXTURE_BLEND: + Blending = true; + break; + case EMT_TRANSPARENT_ALPHA_CHANNEL_REF: + AlphaTest = true; + break; + default: + break; } - if (BaseMaterial) - BaseMaterial->grab(); - if (CallBack) CallBack->grab(); } @@ -92,9 +121,6 @@ COpenGLShaderMaterialRenderer::~COpenGLShaderMaterialRenderer() for (u32 i=0; iextGlDeletePrograms(1, &PixelShader[i]); - - if (BaseMaterial) - BaseMaterial->drop(); } @@ -120,8 +146,6 @@ void COpenGLShaderMaterialRenderer::init(s32& outMaterialTypeNr, bool COpenGLShaderMaterialRenderer::OnRender(IMaterialRendererServices* service, E_VERTEX_TYPE vtxtype) { - Driver->setTextureRenderStates(Driver->getCurrentMaterial(), false); - // call callback to set shader constants if (CallBack && (VertexShader || PixelShader[0])) CallBack->OnSetConstants(service, UserData); @@ -138,6 +162,8 @@ void COpenGLShaderMaterialRenderer::OnSetMaterial(const video::SMaterial& materi else Driver->setFixedPipelineState(COpenGLDriver::EOFPS_DISABLE); + COpenGLCacheHandler* cacheHandler = Driver->getCacheHandler(); + if (material.MaterialType != lastMaterial.MaterialType || resetAllRenderstates) { if (VertexShader) @@ -181,8 +207,40 @@ void COpenGLShaderMaterialRenderer::OnSetMaterial(const video::SMaterial& materi Driver->setBasicRenderStates(material, lastMaterial, resetAllRenderstates); - if (BaseMaterial) - BaseMaterial->OnSetBaseMaterial(material); + if (Alpha) + { + cacheHandler->setBlend(true); + cacheHandler->setBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA); + } + else if (FixedBlending) + { + cacheHandler->setBlendFunc(GL_ONE, GL_ONE_MINUS_SRC_COLOR); + cacheHandler->setBlend(true); + } + else if (Blending) + { + E_BLEND_FACTOR srcRGBFact,dstRGBFact,srcAlphaFact,dstAlphaFact; + E_MODULATE_FUNC modulate; + u32 alphaSource; + unpack_textureBlendFuncSeparate(srcRGBFact, dstRGBFact, srcAlphaFact, dstAlphaFact, modulate, alphaSource, material.MaterialTypeParam); + + if (Driver->queryFeature(EVDF_BLEND_SEPARATE)) + { + cacheHandler->setBlendFuncSeparate(Driver->getGLBlend(srcRGBFact), Driver->getGLBlend(dstRGBFact), + Driver->getGLBlend(srcAlphaFact), Driver->getGLBlend(dstAlphaFact)); + } + else + { + cacheHandler->setBlendFunc(Driver->getGLBlend(srcRGBFact), Driver->getGLBlend(dstRGBFact)); + } + + cacheHandler->setBlend(true); + } + else if (AlphaTest) + { + cacheHandler->setAlphaTest(true); + cacheHandler->setAlphaFunc(GL_GREATER, 0.5f); + } if (CallBack) CallBack->OnSetMaterial(material); @@ -207,16 +265,13 @@ void COpenGLShaderMaterialRenderer::OnUnsetMaterial() if (PixelShader[0]) glDisable(GL_FRAGMENT_PROGRAM_NV); #endif - - if (BaseMaterial) - BaseMaterial->OnUnsetBaseMaterial(); } //! Returns if the material is transparent. bool COpenGLShaderMaterialRenderer::isTransparent() const { - return BaseMaterial ? BaseMaterial->isTransparent() : false; + return (Alpha || Blending || FixedBlending); } diff --git a/source/Irrlicht/COpenGLShaderMaterialRenderer.h b/source/Irrlicht/COpenGLShaderMaterialRenderer.h index 6734a84a..3aba3779 100644 --- a/source/Irrlicht/COpenGLShaderMaterialRenderer.h +++ b/source/Irrlicht/COpenGLShaderMaterialRenderer.h @@ -35,7 +35,6 @@ namespace video { class COpenGLDriver; -class COpenGLMaterialRenderer; class IShaderConstantSetCallBack; //! Class for using vertex and pixel shaders with OpenGL @@ -79,7 +78,11 @@ protected: COpenGLDriver* Driver; IShaderConstantSetCallBack* CallBack; - COpenGLMaterialRenderer* BaseMaterial; + + bool Alpha; + bool Blending; + bool FixedBlending; + bool AlphaTest; GLuint VertexShader; // We have 4 values here, [0] is the non-fog version, the other three are diff --git a/source/Irrlicht/COpenGLTexture.cpp b/source/Irrlicht/COpenGLTexture.cpp deleted file mode 100644 index a2968478..00000000 --- a/source/Irrlicht/COpenGLTexture.cpp +++ /dev/null @@ -1,1326 +0,0 @@ -// Copyright (C) 2002-2012 Nikolaus Gebhardt -// This file is part of the "Irrlicht Engine". -// For conditions of distribution and use, see copyright notice in irrlicht.h - -#include "IrrCompileConfig.h" - -#ifdef _IRR_COMPILE_WITH_OPENGL_ - -#include "irrTypes.h" -#include "COpenGLTexture.h" -#include "COpenGLDriver.h" -#include "os.h" -#include "CColorConverter.h" - -#include "irrString.h" - -namespace irr -{ -namespace video -{ - -//! constructor for usual textures -COpenGLTexture::COpenGLTexture(IImage* origImage, const io::path& name, void* mipmapData, COpenGLDriver* driver) - : ITexture(name, ETT_2D), ColorFormat(ECF_A8R8G8B8), Driver(driver), Image(0), MipImage(0), - TextureName(0), TextureType(GL_TEXTURE_2D), InternalFormat(GL_RGBA), PixelFormat(GL_BGRA_EXT), - PixelType(GL_UNSIGNED_BYTE), MipLevelStored(0), MipmapLegacyMode(true), - IsRenderTarget(false), IsCompressed(false), AutomaticMipmapUpdate(false), - ReadOnlyLock(false), KeepImage(true) -{ - #ifdef _DEBUG - setDebugName("COpenGLTexture"); - #endif - - HasMipMaps = Driver->getTextureCreationFlag(ETCF_CREATE_MIP_MAPS); - getImageValues(origImage); - - if (IsCompressed) - { - Image.push_back(origImage); - Image[0]->grab(); - KeepImage = false; - } - else if (ImageSize==TextureSize) - { - Image.push_back(Driver->createImage(ColorFormat, ImageSize)); - origImage->copyTo(Image[0]); - } - else - { - Image.push_back(Driver->createImage(ColorFormat, TextureSize)); - origImage->copyToScaling(Image[0]); - } - - glGenTextures(1, &TextureName); - uploadTexture(true, 0, true, mipmapData); - - if (!KeepImage) - { - Image[0]->drop(); - - Image.clear(); - } -} - - -//! constructor for cube textures -COpenGLTexture::COpenGLTexture(const io::path& name, IImage* posXImage, IImage* negXImage, IImage* posYImage, - IImage* negYImage, IImage* posZImage, IImage* negZImage, COpenGLDriver* driver) - : ITexture(name, ETT_CUBE), ColorFormat(ECF_A8R8G8B8), Driver(driver), Image(0), MipImage(0), - TextureName(0), TextureType(GL_TEXTURE_CUBE_MAP), InternalFormat(GL_RGBA), PixelFormat(GL_BGRA_EXT), - PixelType(GL_UNSIGNED_BYTE), MipLevelStored(0), MipmapLegacyMode(true), - IsRenderTarget(false), IsCompressed(false), AutomaticMipmapUpdate(false), - ReadOnlyLock(false), KeepImage(true) -{ - #ifdef _DEBUG - setDebugName("COpenGLTexture"); - #endif - - HasMipMaps = Driver->getTextureCreationFlag(ETCF_CREATE_MIP_MAPS); - getImageValues(posXImage); - - if (IsCompressed) - { - Image.push_back(posXImage); - Image.push_back(negXImage); - Image.push_back(posYImage); - Image.push_back(negYImage); - Image.push_back(posZImage); - Image.push_back(negZImage); - - for (u32 i = 0; i < 6; ++i) - Image[i]->grab(); - - KeepImage = false; - } - else if (ImageSize==TextureSize) - { - for (u32 i = 0; i < 6; ++i) - Image.push_back(Driver->createImage(ColorFormat, ImageSize)); - - posXImage->copyTo(Image[0]); - negXImage->copyTo(Image[1]); - posYImage->copyTo(Image[2]); - negYImage->copyTo(Image[3]); - posZImage->copyTo(Image[4]); - negZImage->copyTo(Image[5]); - } - else - { - for (u32 i = 0; i < 6; ++i) - Image.push_back(Driver->createImage(ColorFormat, ImageSize)); - - posXImage->copyToScaling(Image[0]); - negXImage->copyToScaling(Image[1]); - posYImage->copyToScaling(Image[2]); - negYImage->copyToScaling(Image[3]); - posZImage->copyToScaling(Image[4]); - negZImage->copyToScaling(Image[5]); - } - - glGenTextures(1, &TextureName); - - for (u32 i = 0; i < 5; ++i) - uploadTexture(true, i, false); - - uploadTexture(true, 5, true); - - if (!KeepImage) - { - for (u32 i = 0; i < Image.size(); ++i) - Image[i]->drop(); - - Image.clear(); - } -} - - -//! constructor for basic setup (only for derived classes) -COpenGLTexture::COpenGLTexture(const io::path& name, COpenGLDriver* driver) - : ITexture(name, ETT_2D), ColorFormat(ECF_A8R8G8B8), Driver(driver), Image(0), MipImage(0), - TextureName(0), TextureType(GL_TEXTURE_2D), InternalFormat(GL_RGBA), PixelFormat(GL_BGRA_EXT), - PixelType(GL_UNSIGNED_BYTE), MipLevelStored(0), HasMipMaps(true), - MipmapLegacyMode(true), IsRenderTarget(false), IsCompressed(false), - AutomaticMipmapUpdate(false), ReadOnlyLock(false), KeepImage(true) -{ - #ifdef _DEBUG - setDebugName("COpenGLTexture"); - #endif -} - - -//! destructor -COpenGLTexture::~COpenGLTexture() -{ - if (TextureName) - glDeleteTextures(1, &TextureName); - for (u32 i = 0; i < Image.size(); ++i) - Image[i]->drop(); - - Driver->getBridgeCalls()->resetTexture(this); -} - - -//! Choose best matching color format, based on texture creation flags -ECOLOR_FORMAT COpenGLTexture::getBestColorFormat(ECOLOR_FORMAT format) -{ - ECOLOR_FORMAT destFormat = ECF_A8R8G8B8; - - if (!IImage::isCompressedFormat(format)) - { - switch (format) - { - case ECF_A1R5G5B5: - if (!Driver->getTextureCreationFlag(ETCF_ALWAYS_32_BIT)) - destFormat = ECF_A1R5G5B5; - break; - case ECF_R5G6B5: - if (!Driver->getTextureCreationFlag(ETCF_ALWAYS_32_BIT)) - destFormat = ECF_A1R5G5B5; - break; - case ECF_A8R8G8B8: - if (Driver->getTextureCreationFlag(ETCF_ALWAYS_16_BIT) || - Driver->getTextureCreationFlag(ETCF_OPTIMIZED_FOR_SPEED)) - destFormat = ECF_A1R5G5B5; - break; - case ECF_R8G8B8: - if (Driver->getTextureCreationFlag(ETCF_ALWAYS_16_BIT) || - Driver->getTextureCreationFlag(ETCF_OPTIMIZED_FOR_SPEED)) - destFormat = ECF_A1R5G5B5; - break; - default: - break; - } - } - else - destFormat = format; - - if (Driver->getTextureCreationFlag(ETCF_NO_ALPHA_CHANNEL)) - { - switch (destFormat) - { - case ECF_A1R5G5B5: - destFormat = ECF_R5G6B5; - break; - case ECF_A8R8G8B8: - destFormat = ECF_R8G8B8; - break; - default: - break; - } - } - - return destFormat; -} - - -//! Get the OpenGL color format parameters based on the given Irrlicht color format -void COpenGLTexture::getFormatParameters(ECOLOR_FORMAT format, GLint& internalFormat, GLint& filtering, - GLenum& pixelFormat, GLenum& type) -{ - switch(format) - { - case ECF_A1R5G5B5: - internalFormat = GL_RGBA; - filtering = GL_LINEAR; - pixelFormat = GL_BGRA_EXT; - type = GL_UNSIGNED_SHORT_1_5_5_5_REV; - break; - case ECF_R5G6B5: - internalFormat = GL_RGB; - filtering = GL_LINEAR; - pixelFormat = GL_RGB; - type = GL_UNSIGNED_SHORT_5_6_5; - break; - case ECF_R8G8B8: - internalFormat = GL_RGB; - filtering = GL_LINEAR; - pixelFormat = GL_BGR; - type = GL_UNSIGNED_BYTE; - break; - case ECF_A8R8G8B8: - internalFormat = GL_RGBA; - filtering = GL_LINEAR; - pixelFormat = GL_BGRA_EXT; - if (Driver->Version > 101) - type = GL_UNSIGNED_INT_8_8_8_8_REV; - else - type = GL_UNSIGNED_BYTE; - break; -#ifdef GL_EXT_texture_compression_s3tc - case ECF_DXT1: - internalFormat = GL_COMPRESSED_RGBA_S3TC_DXT1_EXT; - filtering = GL_LINEAR; - pixelFormat = GL_BGRA_EXT; - type = GL_COMPRESSED_RGBA_S3TC_DXT1_EXT; - break; -#endif -#ifdef GL_EXT_texture_compression_s3tc - case ECF_DXT2: - case ECF_DXT3: - internalFormat = GL_COMPRESSED_RGBA_S3TC_DXT3_EXT; - filtering = GL_LINEAR; - pixelFormat = GL_BGRA_EXT; - type = GL_COMPRESSED_RGBA_S3TC_DXT3_EXT; - break; -#endif -#ifdef GL_EXT_texture_compression_s3tc - case ECF_DXT4: - case ECF_DXT5: - internalFormat = GL_COMPRESSED_RGBA_S3TC_DXT5_EXT; - filtering = GL_LINEAR; - pixelFormat = GL_BGRA_EXT; - type = GL_COMPRESSED_RGBA_S3TC_DXT5_EXT; - break; -#endif -#ifdef GL_IMG_texture_compression_pvrtc - case ECF_PVRTC_RGB2: - internalFormat = GL_COMPRESSED_RGB_PVRTC_2BPPV1_IMG; - filtering = GL_LINEAR; - pixelFormat = GL_RGB; - type = GL_COMPRESSED_RGB_PVRTC_2BPPV1_IMG; - break; -#endif -#ifdef GL_IMG_texture_compression_pvrtc - case ECF_PVRTC_ARGB2: - internalFormat = GL_COMPRESSED_RGBA_PVRTC_2BPPV1_IMG; - filtering = GL_LINEAR; - pixelFormat = GL_RGBA; - type = GL_COMPRESSED_RGBA_PVRTC_2BPPV1_IMG; - break; -#endif -#ifdef GL_IMG_texture_compression_pvrtc - case ECF_PVRTC_RGB4: - internalFormat = GL_COMPRESSED_RGB_PVRTC_4BPPV1_IMG; - filtering = GL_LINEAR; - pixelFormat = GL_RGB; - type = GL_COMPRESSED_RGB_PVRTC_4BPPV1_IMG; - break; -#endif -#ifdef GL_IMG_texture_compression_pvrtc - case ECF_PVRTC_ARGB4: - internalFormat = GL_COMPRESSED_RGBA_PVRTC_4BPPV1_IMG; - filtering = GL_LINEAR; - pixelFormat = GL_RGBA; - type = GL_COMPRESSED_RGBA_PVRTC_4BPPV1_IMG; - break; -#endif -#ifdef GL_IMG_texture_compression_pvrtc2 - case ECF_PVRTC2_ARGB2: - internalFormat = GL_COMPRESSED_RGBA_PVRTC_2BPPV2_IMG; - filtering = GL_LINEAR; - pixelFormat = GL_RGBA; - type = GL_COMPRESSED_RGBA_PVRTC_2BPPV2_IMG; - break; -#endif -#ifdef GL_IMG_texture_compression_pvrtc2 - case ECF_PVRTC2_ARGB4: - internalFormat = GL_COMPRESSED_RGBA_PVRTC_4BPPV2_IMG; - filtering = GL_LINEAR; - pixelFormat = GL_RGBA; - type = GL_COMPRESSED_RGBA_PVRTC_4BPPV2_IMG; - break; -#endif -#ifdef GL_OES_compressed_ETC1_RGB8_texture - case ECF_ETC1: - internalFormat = GL_ETC1_RGB8_OES; - filtering = GL_LINEAR; - pixelFormat = GL_RGB; - type = GL_ETC1_RGB8_OES; - break; -#endif -#ifdef GL_ARB_ES3_compatibility - case ECF_ETC2_RGB: - internalFormat = GL_COMPRESSED_RGB8_ETC2; - filtering = GL_LINEAR; - pixelFormat = GL_RGB; - type = GL_COMPRESSED_RGB8_ETC2; - break; -#endif -#ifdef GL_ARB_ES3_compatibility - case ECF_ETC2_ARGB: - internalFormat = GL_COMPRESSED_RGBA8_ETC2_EAC; - filtering = GL_LINEAR; - pixelFormat = GL_RGBA; - type = GL_COMPRESSED_RGBA8_ETC2_EAC; - break; -#endif -#ifdef GL_ARB_texture_rg - case ECF_R16F: - internalFormat = GL_R16F; - filtering = GL_NEAREST; - pixelFormat = GL_RED; - type = GL_FLOAT; - break; - case ECF_G16R16F: - internalFormat = GL_RG16F; - filtering = GL_NEAREST; - pixelFormat = GL_RG; - type = GL_FLOAT; - break; - case ECF_R32F: - internalFormat = GL_R32F; - filtering = GL_NEAREST; - pixelFormat = GL_RED; - type = GL_FLOAT; - break; - case ECF_G32R32F: - internalFormat = GL_RG32F; - filtering = GL_NEAREST; - pixelFormat = GL_RG; - type = GL_FLOAT; - break; -#endif -#ifdef GL_ARB_texture_float - case ECF_A16B16G16R16F: - internalFormat = GL_RGBA16F_ARB; - filtering = GL_NEAREST; - pixelFormat = GL_RGBA; - type = GL_FLOAT; - break; - case ECF_A32B32G32R32F: - internalFormat = GL_RGBA32F_ARB; - filtering = GL_NEAREST; - pixelFormat = GL_RGBA; - type = GL_FLOAT; - break; -#endif - default: - os::Printer::log("Unsupported texture format", ELL_ERROR); - break; - } - -#if defined(GL_ARB_framebuffer_sRGB) || defined(GL_EXT_framebuffer_sRGB) - if (Driver->Params.HandleSRGB) - { - if (internalFormat == GL_RGBA) - internalFormat = GL_SRGB_ALPHA_EXT; - else if (internalFormat == GL_RGB) - internalFormat = GL_SRGB_EXT; -#ifdef GL_ARB_ES3_compatibility - else if (internalFormat == GL_COMPRESSED_RGBA8_ETC2_EAC) - internalFormat = GL_COMPRESSED_SRGB8_ALPHA8_ETC2_EAC; - else if (internalFormat == GL_COMPRESSED_RGB8_ETC2) - internalFormat = GL_COMPRESSED_SRGB8_ETC2; -#endif - } -#endif -} - - -// prepare values ImageSize, TextureSize, and ColorFormat based on image -void COpenGLTexture::getImageValues(IImage* image) -{ - if (!image) - { - os::Printer::log("No image for OpenGL texture.", ELL_ERROR); - return; - } - - ImageSize = image->getDimension(); - - if ( !ImageSize.Width || !ImageSize.Height) - { - os::Printer::log("Invalid size of image for OpenGL Texture.", ELL_ERROR); - return; - } - - const f32 ratio = (f32)ImageSize.Width/(f32)ImageSize.Height; - if ((ImageSize.Width>Driver->MaxTextureSize) && (ratio >= 1.0f)) - { - ImageSize.Width = Driver->MaxTextureSize; - ImageSize.Height = (u32)(Driver->MaxTextureSize/ratio); - } - else if (ImageSize.Height>Driver->MaxTextureSize) - { - ImageSize.Height = Driver->MaxTextureSize; - ImageSize.Width = (u32)(Driver->MaxTextureSize*ratio); - } - TextureSize=ImageSize.getOptimalSize(!Driver->queryFeature(EVDF_TEXTURE_NPOT)); - - ColorFormat = getBestColorFormat(image->getColorFormat()); - - IsCompressed = IImage::isCompressedFormat(image->getColorFormat()); -} - - -//! copies the the texture into an open gl texture. -void COpenGLTexture::uploadTexture(bool newTexture, u32 imageNumber, bool regMipmap, void* mipmapData, u32 level) -{ - // check which image needs to be uploaded - IImage* image = level?MipImage:Image[imageNumber]; - if (!image) - { - os::Printer::log("No image for OpenGL texture to upload", ELL_ERROR); - return; - } - - // get correct opengl color data values - GLint oldInternalFormat = InternalFormat; - GLint filtering = GL_LINEAR; - getFormatParameters(ColorFormat, InternalFormat, filtering, PixelFormat, PixelType); - - // make sure we don't change the internal format of existing images - if (!newTexture) - InternalFormat = oldInternalFormat; - - Driver->setActiveTexture(0, this); - Driver->getBridgeCalls()->setTexture(0, TextureType, true); - - if (Driver->testGLError()) - { - os::Printer::log("Could not bind Texture", getName(), ELL_ERROR); - } - - // mipmap handling for main texture - if (!level && newTexture) - { - // auto generate if possible and no mipmap data is given - if (!IsCompressed && HasMipMaps && !mipmapData && Driver->queryFeature(EVDF_MIP_MAP_AUTO_UPDATE) && regMipmap) - { - if (!Driver->queryFeature(EVDF_FRAMEBUFFER_OBJECT)) - { -#ifdef GL_SGIS_generate_mipmap - if (Driver->getTextureCreationFlag(ETCF_OPTIMIZED_FOR_SPEED)) - glHint(GL_GENERATE_MIPMAP_HINT_SGIS, GL_FASTEST); - else if (Driver->getTextureCreationFlag(ETCF_OPTIMIZED_FOR_QUALITY)) - glHint(GL_GENERATE_MIPMAP_HINT_SGIS, GL_NICEST); - else - glHint(GL_GENERATE_MIPMAP_HINT_SGIS, GL_DONT_CARE); - - glTexParameteri(TextureType, GL_GENERATE_MIPMAP, GL_TRUE ); - MipmapLegacyMode=true; - AutomaticMipmapUpdate=true; -#endif - } - else - { - if (Driver->getTextureCreationFlag(ETCF_OPTIMIZED_FOR_SPEED)) - glHint(GL_GENERATE_MIPMAP_HINT, GL_FASTEST); - else if (Driver->getTextureCreationFlag(ETCF_OPTIMIZED_FOR_QUALITY)) - glHint(GL_GENERATE_MIPMAP_HINT, GL_NICEST); - else - glHint(GL_GENERATE_MIPMAP_HINT, GL_DONT_CARE); - - MipmapLegacyMode=false; - AutomaticMipmapUpdate=true; - } - } - - // enable bilinear filter without mipmaps - if (filtering == GL_LINEAR) - StatesCache.BilinearFilter = true; - else - StatesCache.BilinearFilter = false; - - StatesCache.TrilinearFilter = false; - StatesCache.MipMapStatus = false; - - glTexParameteri(TextureType, GL_TEXTURE_MIN_FILTER, filtering); - glTexParameteri(TextureType, GL_TEXTURE_MAG_FILTER, filtering); - } - - // get texture type - - GLenum tmpTextureType = GL_TEXTURE_2D; - - if (TextureType == GL_TEXTURE_CUBE_MAP) - { - switch(imageNumber) - { - case 0: - tmpTextureType = GL_TEXTURE_CUBE_MAP_POSITIVE_X; - break; - case 1: - tmpTextureType = GL_TEXTURE_CUBE_MAP_NEGATIVE_X; - break; - case 2: - tmpTextureType = GL_TEXTURE_CUBE_MAP_POSITIVE_Y; - break; - case 3: - tmpTextureType = GL_TEXTURE_CUBE_MAP_NEGATIVE_Y; - break; - case 4: - tmpTextureType = GL_TEXTURE_CUBE_MAP_POSITIVE_Z; - break; - case 5: - tmpTextureType = GL_TEXTURE_CUBE_MAP_NEGATIVE_Z; - break; - default: - break; - } - } - - // now get image data and upload to GPU - - u32 compressedImageSize = IImage::getCompressedImageSize(ColorFormat, image->getDimension().Width, image->getDimension().Height); - - void* source = image->lock(); - if (newTexture) - { - if (IsCompressed) - { - Driver->extGlCompressedTexImage2D(tmpTextureType, 0, InternalFormat, image->getDimension().Width, - image->getDimension().Height, 0, compressedImageSize, source); - } - else - glTexImage2D(tmpTextureType, level, InternalFormat, image->getDimension().Width, - image->getDimension().Height, 0, PixelFormat, PixelType, source); - } - else - { - if (IsCompressed) - { - Driver->extGlCompressedTexSubImage2D(tmpTextureType, 0, 0, 0, image->getDimension().Width, - image->getDimension().Height, PixelFormat, compressedImageSize, source); - } - else - glTexSubImage2D(tmpTextureType, level, 0, 0, image->getDimension().Width, - image->getDimension().Height, PixelFormat, PixelType, source); - } - image->unlock(); - - if (!level && newTexture && regMipmap) - { - if (IsCompressed && !mipmapData) - { - if (image->hasMipMaps()) - mipmapData = static_cast(image->lock())+compressedImageSize; - else - HasMipMaps = false; - } - - regenerateMipMapLevels(mipmapData); - - if (HasMipMaps) // might have changed in regenerateMipMapLevels - { - // enable bilinear mipmap filter - GLint filteringMipMaps = GL_LINEAR_MIPMAP_NEAREST; - - if (filtering == GL_LINEAR) - StatesCache.BilinearFilter = true; - else - { - StatesCache.BilinearFilter = false; - filteringMipMaps = GL_NEAREST_MIPMAP_NEAREST; - } - - StatesCache.TrilinearFilter = false; - StatesCache.MipMapStatus = false; - - glTexParameteri(TextureType, GL_TEXTURE_MIN_FILTER, filteringMipMaps); - glTexParameteri(TextureType, GL_TEXTURE_MAG_FILTER, filtering); - } - } - - if (Driver->testGLError()) - os::Printer::log("Could not glTexImage2D", ELL_ERROR); - - Driver->setActiveTexture(0, 0); - Driver->getBridgeCalls()->setTexture(0, TextureType, true); -} - - -//! lock function -void* COpenGLTexture::lock(E_TEXTURE_LOCK_MODE mode, u32 mipmapLevel) -{ - if (IsCompressed || Type != ETT_2D) // TO-DO - return 0; - - // store info about which image is locked - IImage* image = 0; - - if (mipmapLevel==0) - { - if (Image.size() > 0) - image = Image[0]; - } - else - { - image = MipImage; - } - - ReadOnlyLock |= (mode==ETLM_READ_ONLY); - MipLevelStored = mipmapLevel; - if (!ReadOnlyLock && mipmapLevel) - { -#ifdef GL_SGIS_generate_mipmap - if (Driver->queryFeature(EVDF_MIP_MAP_AUTO_UPDATE)) - { - // do not automatically generate and update mipmaps - glTexParameteri(TextureType, GL_GENERATE_MIPMAP, GL_FALSE); - } -#endif - AutomaticMipmapUpdate=false; - } - - // if data not available or might have changed on GPU download it - if (!image || IsRenderTarget) - { - // prepare the data storage if necessary - if (!image) - { - if (mipmapLevel) - { - u32 i=0; - u32 width = TextureSize.Width; - u32 height = TextureSize.Height; - do - { - if (width>1) - width>>=1; - if (height>1) - height>>=1; - ++i; - } - while (i != mipmapLevel); - MipImage = image = Driver->createImage(ECF_A8R8G8B8, core::dimension2du(width,height)); - } - else - { - image = Driver->createImage(ECF_A8R8G8B8, ImageSize); - - if (Image.size() == 0) - Image.push_back(image); - else - Image[0] = image; - } - ColorFormat = ECF_A8R8G8B8; - } - if (!image) - return 0; - - if (mode != ETLM_WRITE_ONLY) - { - u8* pixels = static_cast(image->lock()); - if (!pixels) - return 0; - - // we need to keep the correct texture bound later on - const COpenGLTexture* tmpTexture = static_cast(Driver->CurrentTexture[0]); - GLuint tmpTextureType = GL_TEXTURE_2D; - GLint tmpTextureName = (tmpTexture) ? tmpTexture->getOpenGLTextureName() : 0; - bool tmpFixedPipeline = false; - Driver->getBridgeCalls()->getTexture(0, tmpTextureType, tmpFixedPipeline); - glBindTexture(TextureType, TextureName); - - // we need to flip textures vertical - // however, it seems that this does not hold for mipmap - // textures, for unknown reasons. - - // allows to read pixels in top-to-bottom order -#ifdef GL_MESA_pack_invert - if (!mipmapLevel && Driver->queryOpenGLFeature(COpenGLExtensionHandler::IRR_MESA_pack_invert)) - glPixelStorei(GL_PACK_INVERT_MESA, GL_TRUE); -#endif - - // download GPU data as ARGB8 to pixels; - glGetTexImage(TextureType, mipmapLevel, GL_BGRA_EXT, GL_UNSIGNED_BYTE, pixels); - - if (!mipmapLevel) - { -#ifdef GL_MESA_pack_invert - if (Driver->queryOpenGLFeature(COpenGLExtensionHandler::IRR_MESA_pack_invert)) - glPixelStorei(GL_PACK_INVERT_MESA, GL_FALSE); - else -#endif - { - // opengl images are horizontally flipped, so we have to fix that here. - const s32 pitch=image->getPitch(); - u8* p2 = pixels + (image->getDimension().Height - 1) * pitch; - u8* tmpBuffer = new u8[pitch]; - for (u32 i=0; i < image->getDimension().Height; i += 2) - { - memcpy(tmpBuffer, pixels, pitch); - memcpy(pixels, p2, pitch); - memcpy(p2, tmpBuffer, pitch); - pixels += pitch; - p2 -= pitch; - } - delete [] tmpBuffer; - } - } - image->unlock(); - - //reset old bound texture - glBindTexture(tmpTextureType, tmpTextureName); - } - } - return image->lock(); -} - - -//! unlock function -void COpenGLTexture::unlock() -{ - if (IsCompressed || Type != ETT_2D) // TO-DO - return; - - // test if miplevel or main texture was locked - IImage* image = 0; - - if (!MipImage) - { - if (Image.size() > 0) - image = Image[0]; - } - else - { - image = MipImage; - } - - if (!image) - return; - // unlock image to see changes - image->unlock(); - // copy texture data to GPU - if (!ReadOnlyLock) - uploadTexture(false, 0, true, 0, MipLevelStored); - ReadOnlyLock = false; - // cleanup local image - if (MipImage) - { - MipImage->drop(); - MipImage=0; - } - else if (!KeepImage) - { - Image[0]->drop(); - Image.clear(); - } - // update information - if (Image.size() > 0) - ColorFormat=Image[0]->getColorFormat(); - else - ColorFormat=ECF_A8R8G8B8; -} - - -//! Returns size of the original image. -const core::dimension2d& COpenGLTexture::getOriginalSize() const -{ - return ImageSize; -} - - -//! Returns size of the texture. -const core::dimension2d& COpenGLTexture::getSize() const -{ - return TextureSize; -} - - -//! returns driver type of texture, i.e. the driver, which created the texture -E_DRIVER_TYPE COpenGLTexture::getDriverType() const -{ - return EDT_OPENGL; -} - - -//! returns color format of texture -ECOLOR_FORMAT COpenGLTexture::getColorFormat() const -{ - return ColorFormat; -} - - -//! returns pitch of texture (in bytes) -u32 COpenGLTexture::getPitch() const -{ - if (Image.size() > 0) - return Image[0]->getPitch(); - else - return 0; -} - - -//! return open gl texture name -GLuint COpenGLTexture::getOpenGLTextureName() const -{ - return TextureName; -} - - -//! return open gl texture type -GLenum COpenGLTexture::getOpenGLTextureType() const -{ - return TextureType; -} - - -//! Returns whether this texture has mipmaps -bool COpenGLTexture::hasMipMaps() const -{ - return HasMipMaps; -} - - -//! Regenerates the mip map levels of the texture. Useful after locking and -//! modifying the texture -void COpenGLTexture::regenerateMipMapLevels(void* mipmapData) -{ - // texture require mipmaps? - if (!HasMipMaps) - return; - - // we don't use custom data for mipmaps. - if (!mipmapData) - { - // compressed textures require custom data for prepare mipmaps. - if (IsCompressed) - return; - - // texture use legacy method for generate mipmaps? - if (AutomaticMipmapUpdate && MipmapLegacyMode) - return; - - // hardware doesn't support generate mipmaps for certain texture but image data doesn't exist or is wrong. - if (!AutomaticMipmapUpdate && (Image.size() == 0 || (Image.size() > 0 && ((Image[0]->getDimension().Width==1) && (Image[0]->getDimension().Height==1))))) - return; - } - - // hardware moethods for generate mipmaps. - if (!mipmapData && AutomaticMipmapUpdate && !MipmapLegacyMode) - { - glEnable(TextureType); - - const COpenGLTexture* tmpTexture = static_cast(Driver->CurrentTexture[0]); - GLuint tmpTextureType = GL_TEXTURE_2D; - GLint tmpTextureName = (tmpTexture) ? tmpTexture->getOpenGLTextureName() : 0; - bool tmpFixedPipeline = false; - Driver->getBridgeCalls()->getTexture(0, tmpTextureType, tmpFixedPipeline); - glBindTexture(TextureType, TextureName); - Driver->extGlGenerateMipmap(TextureType); - glBindTexture(tmpTextureType, tmpTextureName); - - return; - } - - // only 2D textures are supported in manual creation mipmaps process. - if (Type != ETT_2D) - return; - - const COpenGLTexture* tmpTexture = static_cast(Driver->CurrentTexture[0]); - GLuint tmpTextureType = GL_TEXTURE_2D; - GLint tmpTextureName = (tmpTexture) ? tmpTexture->getOpenGLTextureName() : 0; - bool tmpFixedPipeline = false; - Driver->getBridgeCalls()->getTexture(0, tmpTextureType, tmpFixedPipeline); - glBindTexture(TextureType, TextureName); - - // Manually create mipmaps or use prepared version - u32 compressedImageSize = 0; - u32 width=Image[0]->getDimension().Width; - u32 height=Image[0]->getDimension().Height; - u32 i=0; - u8* target = static_cast(mipmapData); - do - { - if (width>1) - width>>=1; - if (height>1) - height>>=1; - - ++i; - - if (!target) - target = new u8[width*height*Image[0]->getBytesPerPixel()]; - - // create scaled version if no mipdata available - if (!mipmapData) - Image[0]->copyToScaling(target, width, height, Image[0]->getColorFormat()); - - if (IsCompressed) - { - compressedImageSize = IImage::getCompressedImageSize(ColorFormat, width, height); - - Driver->extGlCompressedTexImage2D(TextureType, i, InternalFormat, width, - height, 0, compressedImageSize, target); - } - else - glTexImage2D(TextureType, i, InternalFormat, width, height, - 0, PixelFormat, PixelType, target); - - // get next prepared mipmap data if available - if (mipmapData) - { - if (IsCompressed) - mipmapData = static_cast(mipmapData)+compressedImageSize; - else - mipmapData = static_cast(mipmapData)+width*height*Image[0]->getBytesPerPixel(); - - target = static_cast(mipmapData); - } - } - while (width!=1 || height!=1); - // cleanup - if (!mipmapData) - delete [] target; - - glBindTexture(tmpTextureType, tmpTextureName); -} - - -bool COpenGLTexture::isRenderTarget() const -{ - return IsRenderTarget; -} - - -void COpenGLTexture::setIsRenderTarget(bool isTarget) -{ - IsRenderTarget = isTarget; -} - - -bool COpenGLTexture::isFrameBufferObject() const -{ - return false; -} - - -//! Bind Render Target Texture -void COpenGLTexture::bindRTT() -{ -} - - -//! Unbind Render Target Texture -void COpenGLTexture::unbindRTT() -{ - Driver->setActiveTexture(0, this); - Driver->getBridgeCalls()->setTexture(0, TextureType, true); - - // Copy Our ViewPort To The Texture - glCopyTexSubImage2D(TextureType, 0, 0, 0, 0, 0, getSize().Width, getSize().Height); - - Driver->setActiveTexture(0, 0); - Driver->getBridgeCalls()->setTexture(0, TextureType, true); -} - - -//! Get an access to texture states cache. -COpenGLTexture::SStatesCache& COpenGLTexture::getStatesCache() const -{ - return StatesCache; -} - - -/* FBO Textures */ - -// helper function for render to texture -static bool checkFBOStatus(COpenGLDriver* Driver); - -//! RTT ColorFrameBuffer constructor -COpenGLFBOTexture::COpenGLFBOTexture(const core::dimension2d& size, - const io::path& name, COpenGLDriver* driver, - ECOLOR_FORMAT format) - : COpenGLTexture(name, driver), DepthTexture(0), ColorFrameBuffer(0) -{ - #ifdef _DEBUG - setDebugName("COpenGLTexture_FBO"); - #endif - - ImageSize = size; - TextureSize = size; - - if (ECF_UNKNOWN == format) - format = getBestColorFormat(driver->getColorFormat()); - - ColorFormat = format; - - GLint filtering = GL_LINEAR; - getFormatParameters(format, InternalFormat, filtering, PixelFormat, PixelType); - - HasMipMaps = false; - IsRenderTarget = true; - -#ifdef GL_EXT_framebuffer_object - // generate frame buffer - Driver->extGlGenFramebuffers(1, &ColorFrameBuffer); - bindRTT(); - - // generate color texture - glGenTextures(1, &TextureName); - - Driver->setActiveTexture(0, this); - Driver->getBridgeCalls()->setTexture(0, TextureType, true); - - glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, filtering); - glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE); - glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE); - - if(filtering == GL_NEAREST) - StatesCache.BilinearFilter = false; - else - StatesCache.BilinearFilter = true; - - StatesCache.WrapU = ETC_CLAMP_TO_EDGE; - StatesCache.WrapV = ETC_CLAMP_TO_EDGE; - - glTexImage2D(GL_TEXTURE_2D, 0, InternalFormat, ImageSize.Width, - ImageSize.Height, 0, PixelFormat, PixelType, 0); -#ifdef _DEBUG - driver->testGLError(); -#endif - - // attach color texture to frame buffer - Driver->extGlFramebufferTexture2D(GL_FRAMEBUFFER_EXT, - GL_COLOR_ATTACHMENT0_EXT, - GL_TEXTURE_2D, - TextureName, - 0); -#ifdef _DEBUG - checkFBOStatus(Driver); -#endif - -#endif - unbindRTT(); - - Driver->setActiveTexture(0, 0); - Driver->getBridgeCalls()->setTexture(0, TextureType, true); -} - - -//! destructor -COpenGLFBOTexture::~COpenGLFBOTexture() -{ - if (DepthTexture) - if (DepthTexture->drop()) - Driver->removeDepthTexture(DepthTexture); - if (ColorFrameBuffer) - Driver->extGlDeleteFramebuffers(1, &ColorFrameBuffer); -} - - -bool COpenGLFBOTexture::isFrameBufferObject() const -{ - return true; -} - - -//! Bind Render Target Texture -void COpenGLFBOTexture::bindRTT() -{ -#ifdef GL_EXT_framebuffer_object - if (ColorFrameBuffer != 0) - Driver->extGlBindFramebuffer(GL_FRAMEBUFFER_EXT, ColorFrameBuffer); - glDrawBuffer(GL_COLOR_ATTACHMENT0_EXT); -#endif -} - - -//! Unbind Render Target Texture -void COpenGLFBOTexture::unbindRTT() -{ -#ifdef GL_EXT_framebuffer_object - if (ColorFrameBuffer != 0) - Driver->extGlBindFramebuffer(GL_FRAMEBUFFER_EXT, 0); -#endif -} - - -/* FBO Depth Textures */ - -//! RTT DepthBuffer constructor -COpenGLFBODepthTexture::COpenGLFBODepthTexture( - const core::dimension2d& size, - const io::path& name, - COpenGLDriver* driver, - bool useStencil) - : COpenGLTexture(name, driver), DepthRenderBuffer(0), - StencilRenderBuffer(0), UseStencil(useStencil) -{ -#ifdef _DEBUG - setDebugName("COpenGLTextureFBO_Depth"); -#endif - - ImageSize = size; - TextureSize = size; - InternalFormat = GL_RGBA; - PixelFormat = GL_RGBA; - PixelType = GL_UNSIGNED_BYTE; - HasMipMaps = false; - - if (useStencil) - { - glGenTextures(1, &DepthRenderBuffer); - glBindTexture(GL_TEXTURE_2D, DepthRenderBuffer); - glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR); - glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE); - glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE); -#ifdef GL_EXT_packed_depth_stencil - if (Driver->queryOpenGLFeature(COpenGLExtensionHandler::IRR_EXT_packed_depth_stencil)) - { - // generate packed depth stencil texture - glTexImage2D(GL_TEXTURE_2D, 0, GL_DEPTH_STENCIL_EXT, ImageSize.Width, - ImageSize.Height, 0, GL_DEPTH_STENCIL_EXT, GL_UNSIGNED_INT_24_8_EXT, 0); - StencilRenderBuffer = DepthRenderBuffer; // stencil is packed with depth - } - else // generate separate stencil and depth textures -#endif - { - // generate depth texture - glTexImage2D(GL_TEXTURE_2D, 0, Driver->getZBufferBits(), ImageSize.Width, - ImageSize.Height, 0, GL_DEPTH_COMPONENT, GL_UNSIGNED_BYTE, 0); - - // generate stencil texture - glGenTextures(1, &StencilRenderBuffer); - glBindTexture(GL_TEXTURE_2D, StencilRenderBuffer); - glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR); - glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE); - glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE); - glTexImage2D(GL_TEXTURE_2D, 0, GL_STENCIL_INDEX, ImageSize.Width, - ImageSize.Height, 0, GL_STENCIL_INDEX, GL_UNSIGNED_BYTE, 0); - } - } -#ifdef GL_EXT_framebuffer_object - else - { - // generate depth buffer - Driver->extGlGenRenderbuffers(1, &DepthRenderBuffer); - Driver->extGlBindRenderbuffer(GL_RENDERBUFFER_EXT, DepthRenderBuffer); - Driver->extGlRenderbufferStorage(GL_RENDERBUFFER_EXT, - Driver->getZBufferBits(), ImageSize.Width, - ImageSize.Height); - } -#endif -} - - -//! destructor -COpenGLFBODepthTexture::~COpenGLFBODepthTexture() -{ - if (DepthRenderBuffer && UseStencil) - glDeleteTextures(1, &DepthRenderBuffer); - else - Driver->extGlDeleteRenderbuffers(1, &DepthRenderBuffer); - if (StencilRenderBuffer && StencilRenderBuffer != DepthRenderBuffer) - glDeleteTextures(1, &StencilRenderBuffer); -} - - -//combine depth texture and rtt -bool COpenGLFBODepthTexture::attach(ITexture* renderTex) -{ - if (!renderTex) - return false; - video::COpenGLFBOTexture* rtt = static_cast(renderTex); - rtt->bindRTT(); -#ifdef GL_EXT_framebuffer_object - if (UseStencil) - { - // attach stencil texture to stencil buffer - Driver->extGlFramebufferTexture2D(GL_FRAMEBUFFER_EXT, - GL_STENCIL_ATTACHMENT_EXT, - GL_TEXTURE_2D, - StencilRenderBuffer, - 0); - - // attach depth texture to depth buffer - Driver->extGlFramebufferTexture2D(GL_FRAMEBUFFER_EXT, - GL_DEPTH_ATTACHMENT_EXT, - GL_TEXTURE_2D, - DepthRenderBuffer, - 0); - } - else - { - // attach depth renderbuffer to depth buffer - Driver->extGlFramebufferRenderbuffer(GL_FRAMEBUFFER_EXT, - GL_DEPTH_ATTACHMENT_EXT, - GL_RENDERBUFFER_EXT, - DepthRenderBuffer); - } -#endif - // check the status - if (!checkFBOStatus(Driver)) - { - os::Printer::log("FBO incomplete"); - return false; - } - rtt->DepthTexture=this; - grab(); // grab the depth buffer, not the RTT - rtt->unbindRTT(); - return true; -} - - -//! Bind Render Target Texture -void COpenGLFBODepthTexture::bindRTT() -{ -} - - -//! Unbind Render Target Texture -void COpenGLFBODepthTexture::unbindRTT() -{ -} - - -bool checkFBOStatus(COpenGLDriver* Driver) -{ -#ifdef GL_EXT_framebuffer_object - GLenum status = Driver->extGlCheckFramebufferStatus(GL_FRAMEBUFFER_EXT); - - switch (status) - { - //Our FBO is perfect, return true - case GL_FRAMEBUFFER_COMPLETE_EXT: - return true; - - case GL_FRAMEBUFFER_INCOMPLETE_READ_BUFFER_EXT: - os::Printer::log("FBO has invalid read buffer", ELL_ERROR); - break; - - case GL_FRAMEBUFFER_INCOMPLETE_DRAW_BUFFER_EXT: - os::Printer::log("FBO has invalid draw buffer", ELL_ERROR); - break; - - case GL_FRAMEBUFFER_INCOMPLETE_ATTACHMENT_EXT: - os::Printer::log("FBO has one or several incomplete image attachments", ELL_ERROR); - break; - - case GL_FRAMEBUFFER_INCOMPLETE_FORMATS_EXT: - os::Printer::log("FBO has one or several image attachments with different internal formats", ELL_ERROR); - break; - - case GL_FRAMEBUFFER_INCOMPLETE_DIMENSIONS_EXT: - os::Printer::log("FBO has one or several image attachments with different dimensions", ELL_ERROR); - break; - -// not part of fbo_object anymore, but won't harm as it is just a return value -#ifdef GL_FRAMEBUFFER_INCOMPLETE_DUPLICATE_ATTACHMENT_EXT - case GL_FRAMEBUFFER_INCOMPLETE_DUPLICATE_ATTACHMENT_EXT: - os::Printer::log("FBO has a duplicate image attachment", ELL_ERROR); - break; -#endif - - case GL_FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT_EXT: - os::Printer::log("FBO missing an image attachment", ELL_ERROR); - break; - -#ifdef GL_EXT_framebuffer_multisample - case GL_FRAMEBUFFER_INCOMPLETE_MULTISAMPLE_EXT: - os::Printer::log("FBO wrong multisample setup", ELL_ERROR); - break; -#endif - - case GL_FRAMEBUFFER_UNSUPPORTED_EXT: - os::Printer::log("FBO format unsupported", ELL_ERROR); - break; - - default: - break; - } -#endif - os::Printer::log("FBO error", ELL_ERROR); -// _IRR_DEBUG_BREAK_IF(true); - return false; -} - - -} // end namespace video -} // end namespace irr - -#endif // _IRR_COMPILE_WITH_OPENGL_ - diff --git a/source/Irrlicht/COpenGLTexture.h b/source/Irrlicht/COpenGLTexture.h deleted file mode 100644 index 3404f535..00000000 --- a/source/Irrlicht/COpenGLTexture.h +++ /dev/null @@ -1,244 +0,0 @@ -// Copyright (C) 2002-2012 Nikolaus Gebhardt -// This file is part of the "Irrlicht Engine". -// For conditions of distribution and use, see copyright notice in irrlicht.h - -#ifndef __C_OPEN_GL_TEXTURE_H_INCLUDED__ -#define __C_OPEN_GL_TEXTURE_H_INCLUDED__ - -#include "ITexture.h" -#include "IImage.h" -#include "SMaterialLayer.h" -#include "irrArray.h" - -#include "IrrCompileConfig.h" -#ifdef _IRR_COMPILE_WITH_OPENGL_ - -#if defined(_IRR_OPENGL_USE_EXTPOINTER_) - #define GL_GLEXT_LEGACY 1 -#else - #define GL_GLEXT_PROTOTYPES 1 -#endif -#ifdef _IRR_WINDOWS_API_ - // include windows headers for HWND - #define WIN32_LEAN_AND_MEAN - #include - #include -#ifdef _MSC_VER - #pragma comment(lib, "OpenGL32.lib") -#endif -#elif defined(_IRR_OSX_PLATFORM_) - #include -#elif defined(_IRR_COMPILE_WITH_SDL_DEVICE_) - #define NO_SDL_GLEXT - #include - #include -#else - #if defined(_IRR_OSX_PLATFORM_) - #include - #else - #include - #endif -#endif - - -namespace irr -{ -namespace video -{ - -class COpenGLDriver; - -//! OpenGL texture. -class COpenGLTexture : public ITexture -{ -public: - - //! Cache structure. - struct SStatesCache - { - SStatesCache() : WrapU(ETC_REPEAT), WrapV(ETC_REPEAT), - LODBias(0), AnisotropicFilter(0), - BilinearFilter(false), TrilinearFilter(false), - MipMapStatus(false), IsCached(false) - { - } - - u8 WrapU; - u8 WrapV; - s8 LODBias; - u8 AnisotropicFilter; - bool BilinearFilter; - bool TrilinearFilter; - bool MipMapStatus; - bool IsCached; - }; - - //! constructor - COpenGLTexture(IImage* surface, const io::path& name, void* mipmapData=0, COpenGLDriver* driver=0); - - //! constructor - COpenGLTexture(const io::path& name, IImage* posXImage, IImage* negXImage, IImage* posYImage, - IImage* negYImage, IImage* posZImage, IImage* negZImage, COpenGLDriver* driver=0); - - //! destructor - virtual ~COpenGLTexture(); - - //! lock function - virtual void* lock(E_TEXTURE_LOCK_MODE mode=ETLM_READ_WRITE, u32 mipmapLevel=0) _IRR_OVERRIDE_; - - //! unlock function - virtual void unlock() _IRR_OVERRIDE_; - - //! Returns original size of the texture (image). - virtual const core::dimension2d& getOriginalSize() const _IRR_OVERRIDE_; - - //! Returns size of the texture. - virtual const core::dimension2d& getSize() const _IRR_OVERRIDE_; - - //! returns driver type of texture (=the driver, that created it) - virtual E_DRIVER_TYPE getDriverType() const _IRR_OVERRIDE_; - - //! returns color format of texture - virtual ECOLOR_FORMAT getColorFormat() const _IRR_OVERRIDE_; - - //! returns pitch of texture (in bytes) - virtual u32 getPitch() const _IRR_OVERRIDE_; - - //! return open gl texture name - GLuint getOpenGLTextureName() const; - - //! return open gl texture type - GLenum getOpenGLTextureType() const; - - //! return whether this texture has mipmaps - virtual bool hasMipMaps() const _IRR_OVERRIDE_; - - //! Regenerates the mip map levels of the texture. - /** Useful after locking and modifying the texture - \param mipmapData Pointer to raw mipmap data, including all necessary mip levels, in the same format as the main texture image. If not set the mipmaps are derived from the main image. */ - virtual void regenerateMipMapLevels(void* mipmapData=0) _IRR_OVERRIDE_; - - //! Is it a render target? - virtual bool isRenderTarget() const _IRR_OVERRIDE_; - - //! Is it a FrameBufferObject? - virtual bool isFrameBufferObject() const; - - //! Bind RenderTargetTexture - virtual void bindRTT(); - - //! Unbind RenderTargetTexture - virtual void unbindRTT(); - - //! sets whether this texture is intended to be used as a render target. - void setIsRenderTarget(bool isTarget); - - //! Get an access to texture states cache. - SStatesCache& getStatesCache() const; - -protected: - - //! protected constructor with basic setup, no GL texture name created, for derived classes - COpenGLTexture(const io::path& name, COpenGLDriver* driver); - - //! get the desired color format based on texture creation flags and the input format. - ECOLOR_FORMAT getBestColorFormat(ECOLOR_FORMAT format); - - //! Get the OpenGL color format parameters based on the given Irrlicht color format - void getFormatParameters(ECOLOR_FORMAT format, GLint& internalFormat, GLint& filtering, - GLenum& pixelFormat, GLenum& type); - - //! get important numbers of the image and hw texture - void getImageValues(IImage* image); - - //! copies the texture into an OpenGL texture. - /** \param newTexture True if method is called for a newly created texture for the first time. Otherwise call with false to improve memory handling. - \param imageNumber Inform which image should be used for upload. - \param regMipmap Inform if regenerate mipmap should be call. - \param mipmapData Pointer to raw mipmap data, including all necessary mip levels, in the same format as the main texture image. - \param mipLevel If set to non-zero, only that specific miplevel is updated, using the MipImage member. */ - void uploadTexture(bool newTexture=false, u32 imageNumber=0, bool regMipmap = false, void* mipmapData=0, u32 mipLevel=0); - - core::dimension2d ImageSize; - core::dimension2d TextureSize; - ECOLOR_FORMAT ColorFormat; - COpenGLDriver* Driver; - core::array Image; - IImage* MipImage; - - GLuint TextureName; - GLenum TextureType; - GLint InternalFormat; - GLenum PixelFormat; - GLenum PixelType; - - u8 MipLevelStored; - bool HasMipMaps; - bool MipmapLegacyMode; - bool IsRenderTarget; - bool IsCompressed; - bool AutomaticMipmapUpdate; - bool ReadOnlyLock; - bool KeepImage; - - mutable SStatesCache StatesCache; -}; - -//! OpenGL FBO texture. -class COpenGLFBOTexture : public COpenGLTexture -{ -public: - - //! FrameBufferObject constructor - COpenGLFBOTexture(const core::dimension2d& size, const io::path& name, - COpenGLDriver* driver = 0, ECOLOR_FORMAT format = ECF_UNKNOWN); - - //! destructor - virtual ~COpenGLFBOTexture(); - - //! Is it a FrameBufferObject? - virtual bool isFrameBufferObject() const _IRR_OVERRIDE_; - - //! Bind RenderTargetTexture - virtual void bindRTT() _IRR_OVERRIDE_; - - //! Unbind RenderTargetTexture - virtual void unbindRTT() _IRR_OVERRIDE_; - - ITexture* DepthTexture; -protected: - GLuint ColorFrameBuffer; -}; - - -//! OpenGL FBO depth texture. -class COpenGLFBODepthTexture : public COpenGLTexture -{ -public: - //! FrameBufferObject depth constructor - COpenGLFBODepthTexture(const core::dimension2d& size, const io::path& name, COpenGLDriver* driver=0, bool useStencil=false); - - //! destructor - virtual ~COpenGLFBODepthTexture(); - - //! Bind RenderTargetTexture - virtual void bindRTT() _IRR_OVERRIDE_; - - //! Unbind RenderTargetTexture - virtual void unbindRTT() _IRR_OVERRIDE_; - - bool attach(ITexture*); - -protected: - GLuint DepthRenderBuffer; - GLuint StencilRenderBuffer; - bool UseStencil; -}; - - -} // end namespace video -} // end namespace irr - -#endif -#endif // _IRR_COMPILE_WITH_OPENGL_ - diff --git a/source/Irrlicht/CPLYMeshWriter.cpp b/source/Irrlicht/CPLYMeshWriter.cpp index 04216cba..9be0cdc2 100644 --- a/source/Irrlicht/CPLYMeshWriter.cpp +++ b/source/Irrlicht/CPLYMeshWriter.cpp @@ -120,7 +120,7 @@ bool CPLYMeshWriter::writeMesh(io::IWriteFile* file, scene::IMesh* mesh, s32 fla // video::SColor &col = ( (video::S3DVertex*)buf )->Color; // x y z nx ny nz red green blue alpha u v [u1 v1 | tx ty tz]\n - snprintf(outLine, 1024, + snprintf_irr(outLine, 1024, "%f %f %f %f %f %f\n",// %u %u %u %u %f %f\n", pos.X, pos.Z, pos.Y, // Y and Z are flipped n.X, n.Z, n.Y); @@ -161,7 +161,7 @@ bool CPLYMeshWriter::writeMesh(io::IWriteFile* file, scene::IMesh* mesh, s32 fla } // count a b c\n - snprintf(outLine, 1024, "3 %u %u %u\n", a, b, c); + snprintf_irr(outLine, 1024, "3 %u %u %u\n", a, b, c); // write the line file->write(outLine, strlen(outLine)); } diff --git a/source/Irrlicht/CQ3LevelMesh.cpp b/source/Irrlicht/CQ3LevelMesh.cpp index 0e0c05af..7d7ca779 100644 --- a/source/Irrlicht/CQ3LevelMesh.cpp +++ b/source/Irrlicht/CQ3LevelMesh.cpp @@ -1041,7 +1041,7 @@ void CQ3LevelMesh::constructMesh() if ( LoadParam.verbose > 1 ) { - snprintf( buf, sizeof ( buf ), + snprintf_irr( buf, sizeof ( buf ), "quake3::constructMesh start to create %d faces, %d vertices,%d mesh vertices", NumFaces, NumVertices, @@ -1082,8 +1082,8 @@ void CQ3LevelMesh::constructMesh() { LoadParam.endTime = os::Timer::getRealTime(); - snprintf( buf, sizeof ( buf ), - "quake3::constructMesh needed %04d ms to create %d faces, %d vertices,%d mesh vertices", + snprintf_irr( buf, sizeof ( buf ), + "quake3::constructMesh needed %04u ms to create %d faces, %d vertices,%d mesh vertices", LoadParam.endTime - LoadParam.startTime, NumFaces, NumVertices, @@ -1418,8 +1418,8 @@ void CQ3LevelMesh::createCurvedSurface_bezier(SMeshBufferLightMap* meshBuffer, { LoadParam.endTime = os::Timer::getRealTime(); - snprintf( buf, sizeof ( buf ), - "quake3::createCurvedSurface_bezier needed %04d ms to create bezier patch.(%dx%d)", + snprintf_irr( buf, sizeof ( buf ), + "quake3::createCurvedSurface_bezier needed %04u ms to create bezier patch.(%ux%u)", LoadParam.endTime - LoadParam.startTime, biquadWidth, biquadHeight @@ -1803,8 +1803,8 @@ void CQ3LevelMesh::cleanMesh(SMesh *m, const bool texture0important) LoadParam.startTime = os::Timer::getRealTime(); if ( LoadParam.verbose > 1 ) { - snprintf( buf, sizeof ( buf ), - "quake3::cleanMeshes start for %d meshes", + snprintf_irr( buf, sizeof ( buf ), + "quake3::cleanMeshes start for %u meshes", m->MeshBuffers.size() ); os::Printer::log(buf, ELL_INFORMATION); @@ -1846,7 +1846,7 @@ void CQ3LevelMesh::cleanMesh(SMesh *m, const bool texture0important) { if ( LoadParam.verbose > 1 ) { - snprintf( buf, sizeof ( buf ), + snprintf_irr( buf, sizeof ( buf ), "quake3::cleanMeshes cleaning mesh %d %d size", blockstart, blockcount @@ -1862,8 +1862,8 @@ void CQ3LevelMesh::cleanMesh(SMesh *m, const bool texture0important) if ( LoadParam.verbose > 0 ) { LoadParam.endTime = os::Timer::getRealTime(); - snprintf( buf, sizeof ( buf ), - "quake3::cleanMeshes needed %04d ms to clean %d of %d meshes", + snprintf_irr( buf, sizeof ( buf ), + "quake3::cleanMeshes needed %04u ms to clean %u of %u meshes", LoadParam.endTime - LoadParam.startTime, remove, run @@ -1882,7 +1882,7 @@ void CQ3LevelMesh::calcBoundingBoxes() if ( LoadParam.verbose > 1 ) { - snprintf( buf, sizeof ( buf ), + snprintf_irr( buf, sizeof ( buf ), "quake3::calcBoundingBoxes start create %d textures and %d lightmaps", NumTextures, NumLightMaps @@ -1922,8 +1922,8 @@ void CQ3LevelMesh::calcBoundingBoxes() { LoadParam.endTime = os::Timer::getRealTime(); - snprintf( buf, sizeof ( buf ), - "quake3::calcBoundingBoxes needed %04d ms to create %d textures and %d lightmaps", + snprintf_irr( buf, sizeof ( buf ), + "quake3::calcBoundingBoxes needed %04u ms to create %d textures and %d lightmaps", LoadParam.endTime - LoadParam.startTime, NumTextures, NumLightMaps @@ -1945,7 +1945,7 @@ void CQ3LevelMesh::loadTextures() if ( LoadParam.verbose > 1 ) { - snprintf( buf, sizeof ( buf ), + snprintf_irr( buf, sizeof ( buf ), "quake3::loadTextures start create %d textures and %d lightmaps", NumTextures, NumLightMaps @@ -2046,8 +2046,8 @@ void CQ3LevelMesh::loadTextures() { LoadParam.endTime = os::Timer::getRealTime(); - snprintf( buf, sizeof ( buf ), - "quake3::loadTextures needed %04d ms to create %d textures and %d lightmaps", + snprintf_irr( buf, sizeof ( buf ), + "quake3::loadTextures needed %04u ms to create %d textures and %d lightmaps", LoadParam.endTime - LoadParam.startTime, NumTextures, NumLightMaps diff --git a/source/Irrlicht/CQuake3ShaderSceneNode.cpp b/source/Irrlicht/CQuake3ShaderSceneNode.cpp index 70c59390..f62f64b0 100644 --- a/source/Irrlicht/CQuake3ShaderSceneNode.cpp +++ b/source/Irrlicht/CQuake3ShaderSceneNode.cpp @@ -262,7 +262,6 @@ E_SCENE_NODE_RENDER_PASS CQuake3ShaderSceneNode::getRenderStage() const else if ( strstr ( Shader->name.c_str(), "flame" ) || group->isDefined( "surfaceparm", "water" ) || - group->isDefined( "sort", "underwater" ) || group->isDefined( "sort", "underwater" ) ) { @@ -735,7 +734,7 @@ void CQuake3ShaderSceneNode::deformvertexes_bulge( f32 dt, SModifierFunction &fu function.count = 1; } - + /*! deformVertexes autosprite @@ -859,7 +858,7 @@ void CQuake3ShaderSceneNode::vertextransform_rgbgen( f32 dt, SModifierFunction & MeshBuffer->Vertices[i].Color.set(0xFF7F7F7F); break; - case EXACTVERTEX: + case EXACTVERTEX: // alphagen exactvertex TODO lighting case VERTEX: // rgbgen vertex @@ -905,7 +904,7 @@ void CQuake3ShaderSceneNode::vertextransform_alphagen( f32 dt, SModifierFunction MeshBuffer->Vertices[i].Color.setAlpha ( 0xFF ); break; - case EXACTVERTEX: + case EXACTVERTEX: // alphagen exactvertex TODO lighting case VERTEX: // alphagen vertex @@ -1283,7 +1282,7 @@ void CQuake3ShaderSceneNode::animate( u32 stage,core::matrix4 &texture ) default: break; } - + } break; case TEXTURE: case LIGHTMAP: @@ -1366,7 +1365,7 @@ video::SMaterial& CQuake3ShaderSceneNode::getMaterial(u32 i) if ( Q3Texture [ i ].TextureIndex ) m.setTexture(0, Q3Texture [ i ].Texture [ Q3Texture [ i ].TextureIndex ]); return m; -} +} } // end namespace scene diff --git a/source/Irrlicht/CSceneCollisionManager.cpp b/source/Irrlicht/CSceneCollisionManager.cpp index cdf14795..48b870d2 100644 --- a/source/Irrlicht/CSceneCollisionManager.cpp +++ b/source/Irrlicht/CSceneCollisionManager.cpp @@ -87,6 +87,11 @@ void CSceneCollisionManager::getPickedNodeBB(ISceneNode* root, if((noDebugObjects ? !current->isDebugObject() : true) && (bits==0 || (bits != 0 && (current->getID() & bits)))) { + // Assume that single-point bounding-boxes are not meant for collision + const core::aabbox3df & objectBox = current->getBoundingBox(); + if ( objectBox.isEmpty() ) + continue; + // get world to object space transform core::matrix4 worldToObject; if (!current->getAbsoluteTransformation().getInverse(worldToObject)) @@ -97,8 +102,6 @@ void CSceneCollisionManager::getPickedNodeBB(ISceneNode* root, worldToObject.transformVect(objectRay.start); worldToObject.transformVect(objectRay.end); - const core::aabbox3df & objectBox = current->getBoundingBox(); - // Do the initial intersection test in object space, since the // object space box test is more accurate. if(objectBox.isPointInside(objectRay.start)) @@ -354,7 +357,6 @@ bool CSceneCollisionManager::getCollisionPoint(const core::line3d& ray, { if (!selector) { - _IRR_IMPLEMENT_MANAGED_MARSHALLING_BUGFIX; return false; } @@ -413,7 +415,6 @@ bool CSceneCollisionManager::getCollisionPoint(const core::line3d& ray, } } - _IRR_IMPLEMENT_MANAGED_MARSHALLING_BUGFIX; return found; } diff --git a/source/Irrlicht/CSceneManager.cpp b/source/Irrlicht/CSceneManager.cpp index f1588a2a..f4a4e711 100644 --- a/source/Irrlicht/CSceneManager.cpp +++ b/source/Irrlicht/CSceneManager.cpp @@ -134,6 +134,10 @@ #include "CPLYMeshWriter.h" #endif +#ifdef _IRR_COMPILE_WITH_B3D_WRITER_ +#include "CB3DMeshWriter.h" +#endif + #include "CCubeSceneNode.h" #include "CSphereSceneNode.h" #include "CAnimatedMeshSceneNode.h" @@ -1170,10 +1174,10 @@ void CSceneManager::render() //! returns the axis aligned bounding box of this node const core::aabbox3d& CSceneManager::getBoundingBox() const { - _IRR_DEBUG_BREAK_IF(true) // Bounding Box of Scene Manager wanted. + _IRR_DEBUG_BREAK_IF(true) // Bounding Box of Scene Manager should never be used. - // should never be used. - return *((core::aabbox3d*)0); + static const core::aabbox3d dummy; + return dummy; } @@ -1183,7 +1187,6 @@ bool CSceneManager::isCulled(const ISceneNode* node) const const ICameraSceneNode* cam = getActiveCamera(); if (!cam) { - _IRR_IMPLEMENT_MANAGED_MARSHALLING_BUGFIX; return false; } bool result = false; @@ -1251,7 +1254,6 @@ bool CSceneManager::isCulled(const ISceneNode* node) const } } - _IRR_IMPLEMENT_MANAGED_MARSHALLING_BUGFIX; return result; } @@ -2027,7 +2029,6 @@ bool CSceneManager::postEventFromUser(const SEvent& event) if (cam) ret = cam->OnEvent(event); - _IRR_IMPLEMENT_MANAGED_MARSHALLING_BUGFIX; return ret; } @@ -2166,7 +2167,6 @@ bool CSceneManager::saveScene(const io::path& filename, ISceneUserDataSerializer else os::Printer::log("Unable to open file", filename, ELL_ERROR); - _IRR_IMPLEMENT_MANAGED_MARSHALLING_BUGFIX; return ret; } @@ -2549,6 +2549,13 @@ IMeshWriter* CSceneManager::createMeshWriter(EMESH_WRITER_TYPE type) #else return 0; #endif + + case EMWT_B3D: +#ifdef _IRR_COMPILE_WITH_B3D_WRITER_ + return new CB3DMeshWriter(FileSystem); +#else + return 0; +#endif } return 0; diff --git a/source/Irrlicht/CSceneNodeAnimatorCameraMaya.cpp b/source/Irrlicht/CSceneNodeAnimatorCameraMaya.cpp index e9722331..df52012b 100644 --- a/source/Irrlicht/CSceneNodeAnimatorCameraMaya.cpp +++ b/source/Irrlicht/CSceneNodeAnimatorCameraMaya.cpp @@ -17,6 +17,7 @@ namespace scene CSceneNodeAnimatorCameraMaya::CSceneNodeAnimatorCameraMaya(gui::ICursorControl* cursor, f32 rotateSpeed, f32 zoomSpeed, f32 translateSpeed, f32 distance) : CursorControl(cursor), OldCamera(0), MousePos(0.5f, 0.5f), + TargetMinDistance(0.f), ZoomSpeed(zoomSpeed), RotateSpeed(rotateSpeed), TranslateSpeed(translateSpeed), CurrentZoom(distance), RotX(0.0f), RotY(0.0f), Zooming(false), Rotating(false), Moving(false), Translating(false) @@ -138,11 +139,10 @@ void CSceneNodeAnimatorCameraMaya::animateNode(ISceneNode *node, u32 timeMs) } else { - const f32 targetMinDistance = 0.1f; nZoom += (ZoomStart.X - MousePos.X) * ZoomSpeed; - if (nZoom < targetMinDistance) // jox: fixed bug: bounce back when zooming to close - nZoom = targetMinDistance; + if (nZoom < TargetMinDistance+0.1f) // jox: fixed bug: bounce back when zooming too close + nZoom = TargetMinDistance+0.1f; } } else if (Zooming) @@ -151,7 +151,7 @@ void CSceneNodeAnimatorCameraMaya::animateNode(ISceneNode *node, u32 timeMs) CurrentZoom = CurrentZoom + (ZoomStart.X - MousePos.X ) * ZoomSpeed; nZoom = CurrentZoom; - if (nZoom < 0) + if (nZoom < TargetMinDistance) nZoom = CurrentZoom = old; Zooming = false; } @@ -309,6 +309,18 @@ f32 CSceneNodeAnimatorCameraMaya::getDistance() const return CurrentZoom; } +void CSceneNodeAnimatorCameraMaya::setTargetMinDistance(f32 minDistance) +{ + TargetMinDistance = minDistance; + if ( CurrentZoom < TargetMinDistance ) + CurrentZoom = TargetMinDistance; +} + +f32 CSceneNodeAnimatorCameraMaya::getTargetMinDistance() const +{ + return TargetMinDistance; +} + ISceneNodeAnimator* CSceneNodeAnimatorCameraMaya::createClone(ISceneNode* node, ISceneManager* newManager) { diff --git a/source/Irrlicht/CSceneNodeAnimatorCameraMaya.h b/source/Irrlicht/CSceneNodeAnimatorCameraMaya.h index e5773ca1..07674dac 100644 --- a/source/Irrlicht/CSceneNodeAnimatorCameraMaya.h +++ b/source/Irrlicht/CSceneNodeAnimatorCameraMaya.h @@ -64,6 +64,12 @@ namespace scene //! Set the distance virtual void setDistance(f32 distance) _IRR_OVERRIDE_; + //! Set the minimal distance to the camera target for zoom + virtual void setTargetMinDistance(f32 minDistance) _IRR_OVERRIDE_; + + //! Returns the minimal distance to the camera target for zoom + virtual f32 getTargetMinDistance() const _IRR_OVERRIDE_; + //! This animator will receive events when attached to the active camera virtual bool isEventReceiverEnabled() const _IRR_OVERRIDE_ { @@ -98,6 +104,7 @@ namespace scene core::position2df ZoomStart; core::position2df TranslateStart; core::position2df MousePos; + f32 TargetMinDistance; f32 ZoomSpeed; f32 RotateSpeed; f32 TranslateSpeed; diff --git a/source/Irrlicht/CSceneNodeAnimatorCollisionResponse.cpp b/source/Irrlicht/CSceneNodeAnimatorCollisionResponse.cpp index c6459764..64e57d00 100644 --- a/source/Irrlicht/CSceneNodeAnimatorCollisionResponse.cpp +++ b/source/Irrlicht/CSceneNodeAnimatorCollisionResponse.cpp @@ -54,7 +54,6 @@ CSceneNodeAnimatorCollisionResponse::~CSceneNodeAnimatorCollisionResponse() //! the gravity. bool CSceneNodeAnimatorCollisionResponse::isFalling() const { - _IRR_IMPLEMENT_MANAGED_MARSHALLING_BUGFIX; return Falling; } diff --git a/source/Irrlicht/CSkinnedMesh.cpp b/source/Irrlicht/CSkinnedMesh.cpp index 40aea5a8..4574c91b 100644 --- a/source/Irrlicht/CSkinnedMesh.cpp +++ b/source/Irrlicht/CSkinnedMesh.cpp @@ -23,7 +23,7 @@ namespace irr::u32 n=1; // new index for(irr::u32 j=1;j // Cmp = comparison for keys of type T @@ -55,7 +55,7 @@ namespace if ( j > s+1 ) // had there been identical keys? array[n++] = array[j-1]; // keep the last array[n++] = array[j]; // keep the new one - s = j; + s = j; } if ( array.size() > s+1 ) // identical keys at the array end? array[n++] = array[array.size()-1]; // keep the last @@ -67,21 +67,21 @@ namespace } return d; } - + bool identicalPos(const irr::scene::ISkinnedMesh::SPositionKey& a, const irr::scene::ISkinnedMesh::SPositionKey& b) { return a.position == b.position; - } - + } + bool identicalScale(const irr::scene::ISkinnedMesh::SScaleKey& a, const irr::scene::ISkinnedMesh::SScaleKey& b) { return a.scale == b.scale; - } + } bool identicalRotation(const irr::scene::ISkinnedMesh::SRotationKey& a, const irr::scene::ISkinnedMesh::SRotationKey& b) { return a.rotation == b.rotation; - } + } }; namespace irr @@ -92,7 +92,7 @@ namespace scene //! constructor CSkinnedMesh::CSkinnedMesh() -: SkinningBuffers(0), AnimationFrames(0.f), FramesPerSecond(25.f), +: SkinningBuffers(0), EndFrame(0.f), FramesPerSecond(25.f), LastAnimatedFrame(-1), SkinnedLastFrame(false), InterpolationMode(EIM_LINEAR), HasAnimation(false), PreparedForSkinning(false), @@ -124,7 +124,7 @@ CSkinnedMesh::~CSkinnedMesh() //! If the amount is 1, it is a static (=non animated) mesh. u32 CSkinnedMesh::getFrameCount() const { - return core::floor32(AnimationFrames); + return core::floor32(EndFrame+1.f); } @@ -878,22 +878,22 @@ void CSkinnedMesh::checkForAnimation() if (HasAnimation) { //--- Find the length of the animation --- - AnimationFrames=0; + EndFrame=0; for(i=0;iUseAnimationFrom) { if (AllJoints[i]->UseAnimationFrom->PositionKeys.size()) - if (AllJoints[i]->UseAnimationFrom->PositionKeys.getLast().frame > AnimationFrames) - AnimationFrames=AllJoints[i]->UseAnimationFrom->PositionKeys.getLast().frame; + if (AllJoints[i]->UseAnimationFrom->PositionKeys.getLast().frame > EndFrame) + EndFrame=AllJoints[i]->UseAnimationFrom->PositionKeys.getLast().frame; if (AllJoints[i]->UseAnimationFrom->ScaleKeys.size()) - if (AllJoints[i]->UseAnimationFrom->ScaleKeys.getLast().frame > AnimationFrames) - AnimationFrames=AllJoints[i]->UseAnimationFrom->ScaleKeys.getLast().frame; + if (AllJoints[i]->UseAnimationFrom->ScaleKeys.getLast().frame > EndFrame) + EndFrame=AllJoints[i]->UseAnimationFrom->ScaleKeys.getLast().frame; if (AllJoints[i]->UseAnimationFrom->RotationKeys.size()) - if (AllJoints[i]->UseAnimationFrom->RotationKeys.getLast().frame > AnimationFrames) - AnimationFrames=AllJoints[i]->UseAnimationFrom->RotationKeys.getLast().frame; + if (AllJoints[i]->UseAnimationFrom->RotationKeys.getLast().frame > EndFrame) + EndFrame=AllJoints[i]->UseAnimationFrom->RotationKeys.getLast().frame; } } } @@ -958,7 +958,7 @@ void CSkinnedMesh::checkForAnimation() //! called by loader after populating with mesh and bone data void CSkinnedMesh::finalize() { - os::Printer::log("Skinned Mesh - finalize", ELL_DEBUG); + os::Printer::log("Skinned Mesh - finalize", ELL_DEBUG); u32 i; // Make sure we recalc the next frame @@ -1023,7 +1023,7 @@ void CSkinnedMesh::finalize() irr::u32 unorderedScaleKeys = 0; irr::u32 redundantRotationKeys = 0; irr::u32 unorderedRotationKeys = 0; - + //--- optimize and check keyframes --- for(i=0;iframe!=AnimationFrames) + if (Key->frame!=EndFrame) { PositionKeys.push_back(*Key); Key=&PositionKeys.getLast(); - Key->frame=AnimationFrames; + Key->frame=EndFrame; } } @@ -1073,11 +1073,11 @@ void CSkinnedMesh::finalize() } Key=&ScaleKeys.getLast(); - if (Key->frame!=AnimationFrames) + if (Key->frame!=EndFrame) { ScaleKeys.push_back(*Key); Key=&ScaleKeys.getLast(); - Key->frame=AnimationFrames; + Key->frame=EndFrame; } } @@ -1093,11 +1093,11 @@ void CSkinnedMesh::finalize() } Key=&RotationKeys.getLast(); - if (Key->frame!=AnimationFrames) + if (Key->frame!=EndFrame) { RotationKeys.push_back(*Key); Key=&RotationKeys.getLast(); - Key->frame=AnimationFrames; + Key->frame=EndFrame; } } } @@ -1108,7 +1108,7 @@ void CSkinnedMesh::finalize() } if ( unorderedPosKeys > 0 ) { - irr::os::Printer::log("Skinned Mesh - unsorted position frames kicked:", irr::core::stringc(unorderedPosKeys).c_str(), irr::ELL_DEBUG); + irr::os::Printer::log("Skinned Mesh - unsorted position frames kicked:", irr::core::stringc(unorderedPosKeys).c_str(), irr::ELL_DEBUG); } if ( redundantScaleKeys > 0 ) { diff --git a/source/Irrlicht/CSkinnedMesh.h b/source/Irrlicht/CSkinnedMesh.h index bbe36917..6284a9aa 100644 --- a/source/Irrlicht/CSkinnedMesh.h +++ b/source/Irrlicht/CSkinnedMesh.h @@ -194,7 +194,7 @@ private: core::aabbox3d BoundingBox; - f32 AnimationFrames; + f32 EndFrame; f32 FramesPerSecond; f32 LastAnimatedFrame; diff --git a/source/Irrlicht/CSoftwareDriver.cpp b/source/Irrlicht/CSoftwareDriver.cpp index abd389fe..a0cdf991 100644 --- a/source/Irrlicht/CSoftwareDriver.cpp +++ b/source/Irrlicht/CSoftwareDriver.cpp @@ -174,6 +174,16 @@ bool CSoftwareDriver::queryFeature(E_VIDEO_DRIVER_FEATURE feature) const } +//! Create render target. +IRenderTarget* CSoftwareDriver::addRenderTarget() +{ + CSoftwareRenderTarget* renderTarget = new CSoftwareRenderTarget(this); + RenderTargets.push_back(renderTarget); + + return renderTarget; +} + + //! sets transformation void CSoftwareDriver::setTransform(E_TRANSFORMATION_STATE state, const core::matrix4& mat) { @@ -217,26 +227,17 @@ void CSoftwareDriver::setMaterial(const SMaterial& material) } } - -//! clears the zbuffer -bool CSoftwareDriver::beginScene(bool backBuffer, bool zBuffer, SColor color, - const SExposedVideoData& videoData, core::rect* sourceRect) +bool CSoftwareDriver::beginScene(u16 clearFlag, SColor clearColor, f32 clearDepth, u8 clearStencil, const SExposedVideoData& videoData, core::rect* sourceRect) { - CNullDriver::beginScene(backBuffer, zBuffer, color, videoData, sourceRect); + CNullDriver::beginScene(clearFlag, clearColor, clearDepth, clearStencil, videoData, sourceRect); WindowId=videoData.D3D9.HWnd; SceneSourceRect = sourceRect; - if (backBuffer && BackBuffer) - BackBuffer->fill(color); - - if (ZBuffer && zBuffer) - ZBuffer->clear(); + clearBuffers(clearFlag, clearColor, clearDepth, clearStencil); return true; } - -//! presents the rendered scene on the screen, returns false if failed bool CSoftwareDriver::endScene() { CNullDriver::endScene(); @@ -247,31 +248,29 @@ bool CSoftwareDriver::endScene() //! returns a device dependent texture from a software surface (IImage) //! THIS METHOD HAS TO BE OVERRIDDEN BY DERIVED DRIVERS WITH OWN TEXTURES -ITexture* CSoftwareDriver::createDeviceDependentTexture(IImage* surface, const io::path& name, void* mipmapData) +ITexture* CSoftwareDriver::createDeviceDependentTexture(IImage* surface, const io::path& name) { CSoftwareTexture* texture = 0; if (surface && checkColorFormat(surface->getColorFormat(), surface->getDimension())) - texture = new CSoftwareTexture(surface, name, false, mipmapData); + texture = new CSoftwareTexture(surface, name, false); return texture; } - -//! sets a render target -bool CSoftwareDriver::setRenderTarget(video::ITexture* texture, bool clearBackBuffer, - bool clearZBuffer, SColor color) +bool CSoftwareDriver::setRenderTarget(IRenderTarget* target, u16 clearFlag, SColor clearColor, f32 clearDepth, u8 clearStencil) { - if (texture && texture->getDriverType() != EDT_SOFTWARE) + if (target && target->getDriverType() != EDT_SOFTWARE) { - os::Printer::log("Fatal Error: Tried to set a texture not owned by this driver.", ELL_ERROR); + os::Printer::log("Fatal Error: Tried to set a render target not owned by this driver.", ELL_ERROR); return false; } if (RenderTargetTexture) RenderTargetTexture->drop(); - RenderTargetTexture = texture; + CSoftwareRenderTarget* renderTarget = static_cast(target); + RenderTargetTexture = (renderTarget) ? renderTarget->getTexture() : 0; if (RenderTargetTexture) { @@ -283,14 +282,7 @@ bool CSoftwareDriver::setRenderTarget(video::ITexture* texture, bool clearBackBu setRenderTarget(BackBuffer); } - if (RenderTargetSurface && (clearBackBuffer || clearZBuffer)) - { - if (clearZBuffer) - ZBuffer->clear(); - - if (clearBackBuffer) - RenderTargetSurface->fill(color); - } + clearBuffers(clearFlag, clearColor, clearDepth, clearStencil); return true; } @@ -917,11 +909,12 @@ ITexture* CSoftwareDriver::addRenderTargetTexture(const core::dimension2d& return tex; } - -//! Clears the ZBuffer. -void CSoftwareDriver::clearZBuffer() +void CSoftwareDriver::clearBuffers(u16 flag, SColor color, f32 depth, u8 stencil) { - if (ZBuffer) + if ((flag & ECBF_COLOR) && RenderTargetSurface) + RenderTargetSurface->fill(color); + + if ((flag & ECBF_DEPTH) && ZBuffer) ZBuffer->clear(); } diff --git a/source/Irrlicht/CSoftwareDriver.h b/source/Irrlicht/CSoftwareDriver.h index 1aeee085..4a964aa3 100644 --- a/source/Irrlicht/CSoftwareDriver.h +++ b/source/Irrlicht/CSoftwareDriver.h @@ -27,25 +27,24 @@ namespace video //! queries the features of the driver, returns true if feature is available virtual bool queryFeature(E_VIDEO_DRIVER_FEATURE feature) const _IRR_OVERRIDE_; + //! Create render target. + virtual IRenderTarget* addRenderTarget() _IRR_OVERRIDE_; + //! sets transformation virtual void setTransform(E_TRANSFORMATION_STATE state, const core::matrix4& mat) _IRR_OVERRIDE_; //! sets a material virtual void setMaterial(const SMaterial& material) _IRR_OVERRIDE_; - virtual bool setRenderTarget(video::ITexture* texture, bool clearBackBuffer, - bool clearZBuffer, SColor color) _IRR_OVERRIDE_; + virtual bool setRenderTarget(IRenderTarget* target, u16 clearFlag, SColor clearColor = SColor(255,0,0,0), + f32 clearDepth = 1.f, u8 clearStencil = 0) _IRR_OVERRIDE_; //! sets a viewport virtual void setViewPort(const core::rect& area) _IRR_OVERRIDE_; - //! clears the zbuffer - virtual bool beginScene(bool backBuffer=true, bool zBuffer=true, - SColor color=SColor(255,0,0,0), - const SExposedVideoData& videoData=SExposedVideoData(), - core::rect* sourceRect=0) _IRR_OVERRIDE_; + virtual bool beginScene(u16 clearFlag, SColor clearColor = SColor(255,0,0,0), f32 clearDepth = 1.f, u8 clearStencil = 0, + const SExposedVideoData& videoData = SExposedVideoData(), core::rect* sourceRect = 0) _IRR_OVERRIDE_; - //! presents the rendered scene on the screen, returns false if failed virtual bool endScene() _IRR_OVERRIDE_; //! Only used by the internal engine. Used to notify the driver that @@ -101,14 +100,13 @@ namespace video //! returns a device dependent texture from a software surface (IImage) //! THIS METHOD HAS TO BE OVERRIDDEN BY DERIVED DRIVERS WITH OWN TEXTURES - virtual video::ITexture* createDeviceDependentTexture(IImage* surface, const io::path& name, void* mipmapData=0) _IRR_OVERRIDE_; + virtual video::ITexture* createDeviceDependentTexture(IImage* surface, const io::path& name) _IRR_OVERRIDE_; //! Creates a render target texture. virtual ITexture* addRenderTargetTexture(const core::dimension2d& size, const io::path& name, const ECOLOR_FORMAT format = ECF_UNKNOWN) _IRR_OVERRIDE_; - //! Clears the ZBuffer. - virtual void clearZBuffer() _IRR_OVERRIDE_; + virtual void clearBuffers(u16 flag, SColor color = SColor(255,0,0,0), f32 depth = 1.f, u8 stencil = 0) _IRR_OVERRIDE_; //! Returns an image created from the last rendered frame. virtual IImage* createScreenShot(video::ECOLOR_FORMAT format=video::ECF_UNKNOWN, video::E_RENDER_TARGET target=video::ERT_FRAME_BUFFER) _IRR_OVERRIDE_; diff --git a/source/Irrlicht/CSoftwareDriver2.cpp b/source/Irrlicht/CSoftwareDriver2.cpp index 2871c95c..5c4b8f59 100644 --- a/source/Irrlicht/CSoftwareDriver2.cpp +++ b/source/Irrlicht/CSoftwareDriver2.cpp @@ -23,321 +23,13 @@ namespace irr namespace video { -namespace glsl -{ - -typedef sVec4 vec4; -typedef sVec3 vec3; -typedef sVec2 vec2; - -#define in -#define uniform -#define attribute -#define varying - -#ifdef _MSC_VER -#pragma warning(disable:4244) -#endif - -struct mat4{ - float m[4][4]; - - vec4 operator* ( const vec4 &in ) const - { - vec4 out; - return out; - } - -}; - -struct mat3{ - float m[3][3]; - - vec3 operator* ( const vec3 &in ) const - { - vec3 out; - return out; - } -}; - -const int gl_MaxLights = 8; - - -inline float dot (float x, float y) { return x * y; } -inline float dot ( const vec2 &x, const vec2 &y) { return x.x * y.x + x.y * y.y; } -inline float dot ( const vec3 &x, const vec3 &y) { return x.x * y.x + x.y * y.y + x.z * y.z; } -inline float dot ( const vec4 &x, const vec4 &y) { return x.x * y.x + x.y * y.y + x.z * y.z + x.w * y.w; } - -inline float reflect (float I, float N) { return I - 2.0 * dot (N, I) * N; } -inline vec2 reflect (const vec2 &I, const vec2 &N) { return I - N * 2.0 * dot (N, I); } -inline vec3 reflect (const vec3 &I, const vec3 &N) { return I - N * 2.0 * dot (N, I); } -inline vec4 reflect (const vec4 &I, const vec4 &N) { return I - N * 2.0 * dot (N, I); } - - -inline float refract (float I, float N, float eta){ - const float k = 1.0 - eta * eta * (1.0 - dot (N, I) * dot (N, I)); - if (k < 0.0) - return 0.0; - return eta * I - (eta * dot (N, I) + sqrt (k)) * N; -} - -inline vec2 refract (const vec2 &I, const vec2 &N, float eta){ - const float k = 1.0 - eta * eta * (1.0 - dot (N, I) * dot (N, I)); - if (k < 0.0) - return vec2 (0.0); - return I * eta - N * (eta * dot (N, I) + sqrt (k)); -} - -inline vec3 refract (const vec3 &I, const vec3 &N, float eta) { - const float k = 1.0 - eta * eta * (1.0 - dot (N, I) * dot (N, I)); - if (k < 0.0) - return vec3 (0.0); - return I * eta - N * (eta * dot (N, I) + sqrt (k)); -} - -inline vec4 refract (const vec4 &I, const vec4 &N, float eta) { - const float k = 1.0 - eta * eta * (1.0 - dot (N, I) * dot (N, I)); - if (k < 0.0) - return vec4 (0.0); - return I * eta - N * (eta * dot (N, I) + sqrt (k)); -} - - -inline float length ( const vec3 &v ) { return sqrtf ( v.x * v.x + v.y * v.y + v.z * v.z ); } -vec3 normalize ( const vec3 &v ) { float l = 1.f / length ( v ); return vec3 ( v.x * l, v.y * l, v.z * l ); } -float max ( float a, float b ) { return a > b ? a : b; } -float min ( float a, float b ) { return a < b ? a : b; } -vec4 clamp ( const vec4 &a, f32 low, f32 high ) { return vec4 ( min (max(a.x,low), high), min (max(a.y,low), high), min (max(a.z,low), high), min (max(a.w,low), high) ); } - - - -typedef int sampler2D; -sampler2D texUnit0; - -vec4 texture2D (sampler2D sampler, const vec2 &coord) { return vec4 (0.0); } - -struct gl_LightSourceParameters { - vec4 ambient; // Acli - vec4 diffuse; // Dcli - vec4 specular; // Scli - vec4 position; // Ppli - vec4 halfVector; // Derived: Hi - vec3 spotDirection; // Sdli - float spotExponent; // Srli - float spotCutoff; // Crli - // (range: [0.0,90.0], 180.0) - float spotCosCutoff; // Derived: cos(Crli) - // (range: [1.0,0.0],-1.0) - float constantAttenuation; // K0 - float linearAttenuation; // K1 - float quadraticAttenuation;// K2 -}; - -uniform gl_LightSourceParameters gl_LightSource[gl_MaxLights]; - -struct gl_LightModelParameters { - vec4 ambient; -}; -uniform gl_LightModelParameters gl_LightModel; - -struct gl_LightModelProducts { - vec4 sceneColor; -}; - -uniform gl_LightModelProducts gl_FrontLightModelProduct; -uniform gl_LightModelProducts gl_BackLightModelProduct; - -struct gl_LightProducts { - vec4 ambient; - vec4 diffuse; - vec4 specular; -}; - -uniform gl_LightProducts gl_FrontLightProduct[gl_MaxLights]; -uniform gl_LightProducts gl_BackLightProduct[gl_MaxLights]; - -struct gl_MaterialParameters -{ - vec4 emission; // Ecm - vec4 ambient; // Acm - vec4 diffuse; // Dcm - vec4 specular; // Scm - float shininess; // Srm -}; -uniform gl_MaterialParameters gl_FrontMaterial; -uniform gl_MaterialParameters gl_BackMaterial; - -// GLSL has some built-in attributes in a vertex shader: -attribute vec4 gl_Vertex; // 4D vector representing the vertex position -attribute vec3 gl_Normal; // 3D vector representing the vertex normal -attribute vec4 gl_Color; // 4D vector representing the vertex color -attribute vec4 gl_MultiTexCoord0; // 4D vector representing the texture coordinate of texture unit X -attribute vec4 gl_MultiTexCoord1; // 4D vector representing the texture coordinate of texture unit X - -uniform mat4 gl_ModelViewMatrix; //4x4 Matrix representing the model-view matrix. -uniform mat4 gl_ModelViewProjectionMatrix; //4x4 Matrix representing the model-view-projection matrix. -uniform mat3 gl_NormalMatrix; //3x3 Matrix representing the inverse transpose model-view matrix. This matrix is used for normal transformation. - - -varying vec4 gl_FrontColor; // 4D vector representing the primitives front color -varying vec4 gl_FrontSecondaryColor; // 4D vector representing the primitives second front color -varying vec4 gl_BackColor; // 4D vector representing the primitives back color -varying vec4 gl_TexCoord[4]; // 4D vector representing the Xth texture coordinate - -// shader output -varying vec4 gl_Position; // 4D vector representing the final processed vertex position. Only available in vertex shader. -varying vec4 gl_FragColor; // 4D vector representing the final color which is written in the frame buffer. Only available in fragment shader. -varying float gl_FragDepth; // float representing the depth which is written in the depth buffer. Only available in fragment shader. - -varying vec4 gl_SecondaryColor; -varying float gl_FogFragCoord; - - -vec4 ftransform(void) -{ - return gl_ModelViewProjectionMatrix * gl_Vertex; -} - -vec3 fnormal(void) -{ - //Compute the normal - vec3 normal = gl_NormalMatrix * gl_Normal; - normal = normalize(normal); - return normal; -} - - -struct program1 -{ - vec4 Ambient; - vec4 Diffuse; - vec4 Specular; - - void pointLight(in int i, in vec3 normal, in vec3 eye, in vec3 ecPosition3) - { - float nDotVP; // normal . light direction - float nDotHV; // normal . light half vector - float pf; // power factor - float attenuation; // computed attenuation factor - float d; // distance from surface to light source - vec3 VP; // direction from surface to light position - vec3 halfVector; // direction of maximum highlights - - // Compute vector from surface to light position - VP = vec3 (gl_LightSource[i].position) - ecPosition3; - - // Compute distance between surface and light position - d = length(VP); - - // Normalize the vector from surface to light position - VP = normalize(VP); - - // Compute attenuation - attenuation = 1.0 / (gl_LightSource[i].constantAttenuation + - gl_LightSource[i].linearAttenuation * d + - gl_LightSource[i].quadraticAttenuation * d * d); - - halfVector = normalize(VP + eye); - - nDotVP = max(0.0, dot(normal, VP)); - nDotHV = max(0.0, dot(normal, halfVector)); - - if (nDotVP == 0.0) - { - pf = 0.0; - } - else - { - pf = pow(nDotHV, gl_FrontMaterial.shininess); - - } - Ambient += gl_LightSource[i].ambient * attenuation; - Diffuse += gl_LightSource[i].diffuse * nDotVP * attenuation; - Specular += gl_LightSource[i].specular * pf * attenuation; - } - - vec3 fnormal(void) - { - //Compute the normal - vec3 normal = gl_NormalMatrix * gl_Normal; - normal = normalize(normal); - return normal; - } - - void ftexgen(in vec3 normal, in vec4 ecPosition) - { - - gl_TexCoord[0] = gl_MultiTexCoord0; - } - - void flight(in vec3 normal, in vec4 ecPosition, float alphaFade) - { - vec4 color; - vec3 ecPosition3; - vec3 eye; - - ecPosition3 = (vec3 (ecPosition)) / ecPosition.w; - eye = vec3 (0.0, 0.0, 1.0); - - // Clear the light intensity accumulators - Ambient = vec4 (0.0); - Diffuse = vec4 (0.0); - Specular = vec4 (0.0); - - pointLight(0, normal, eye, ecPosition3); - - pointLight(1, normal, eye, ecPosition3); - - color = gl_FrontLightModelProduct.sceneColor + - Ambient * gl_FrontMaterial.ambient + - Diffuse * gl_FrontMaterial.diffuse; - gl_FrontSecondaryColor = Specular * gl_FrontMaterial.specular; - color = clamp( color, 0.0, 1.0 ); - gl_FrontColor = color; - - gl_FrontColor.a *= alphaFade; - } - - - void vertexshader_main (void) - { - vec3 transformedNormal; - float alphaFade = 1.0; - - // Eye-coordinate position of vertex, needed in various calculations - vec4 ecPosition = gl_ModelViewMatrix * gl_Vertex; - - // Do fixed functionality vertex transform - gl_Position = ftransform(); - transformedNormal = fnormal(); - flight(transformedNormal, ecPosition, alphaFade); - ftexgen(transformedNormal, ecPosition); - } - - void fragmentshader_main (void) - { - vec4 color; - - color = gl_Color; - - color *= texture2D(texUnit0, vec2(gl_TexCoord[0].x, gl_TexCoord[0].y) ); - - color += gl_SecondaryColor; - color = clamp(color, 0.0, 1.0); - - gl_FragColor = color; - } -}; - -} - //! constructor CBurningVideoDriver::CBurningVideoDriver(const irr::SIrrlichtCreationParameters& params, io::IFileSystem* io, video::IImagePresenter* presenter) : CNullDriver(io, params.WindowSize), BackBuffer(0), Presenter(presenter), WindowId(0), SceneSourceRect(0), RenderTargetTexture(0), RenderTargetSurface(0), CurrentShader(0), DepthBuffer(0), StencilBuffer ( 0 ), - CurrentOut ( 12 * 2, 128 ), Temp ( 12 * 2, 128 ) + CurrentOut ( 16 * 2, 256 ), Temp ( 16 * 2, 256 ) { #ifdef _DEBUG setDebugName("CBurningVideoDriver"); @@ -360,10 +52,10 @@ CBurningVideoDriver::CBurningVideoDriver(const irr::SIrrlichtCreationParameters& DriverAttributes->setAttribute("MaxTextures", 2); DriverAttributes->setAttribute("MaxIndices", 1<<16); - DriverAttributes->setAttribute("MaxTextureSize", 1024); - DriverAttributes->setAttribute("MaxLights", glsl::gl_MaxLights); + DriverAttributes->setAttribute("MaxTextureSize", SOFTWARE_DRIVER_2_TEXTURE_MAXSIZE); + DriverAttributes->setAttribute("MaxLights", 1024 ); //glsl::gl_MaxLights); DriverAttributes->setAttribute("MaxTextureLODBias", 16.f); - DriverAttributes->setAttribute("Version", 47); + DriverAttributes->setAttribute("Version", 49); // create triangle renderers @@ -484,10 +176,9 @@ void CBurningVideoDriver::setCurrentShader() ITexture *texture0 = Material.org.getTexture(0); ITexture *texture1 = Material.org.getTexture(1); - bool zMaterialTest = Material.org.ZBuffer != ECFN_DISABLED && - Material.org.ZWriteEnable && - ( AllowZWriteOnTransparent || (!Material.org.isTransparent() && - !MaterialRenderers[Material.org.MaterialType].Renderer->isTransparent()) ); + bool zMaterialTest = Material.org.ZBuffer != ECFN_DISABLED && + Material.org.ZWriteEnable && + getWriteZBuffer(Material.org); EBurningFFShader shader = zMaterialTest ? ETR_TEXTURE_GOURAUD : ETR_TEXTURE_GOURAUD_NOZ; @@ -509,7 +200,11 @@ void CBurningVideoDriver::setCurrentShader() shader = zMaterialTest ? ETR_TEXTURE_GOURAUD_ALPHA : ETR_TEXTURE_GOURAUD_ALPHA_NOZ; break; } - // fall through + else + { + shader = ETR_TEXTURE_GOURAUD_VERTEX_ALPHA; + } + break; case EMT_TRANSPARENT_ADD_COLOR: shader = zMaterialTest ? ETR_TEXTURE_GOURAUD_ADD : ETR_TEXTURE_GOURAUD_ADD_NO_Z; @@ -624,6 +319,8 @@ bool CBurningVideoDriver::queryFeature(E_VIDEO_DRIVER_FEATURE feature) const return true; #endif case EVDF_STENCIL_BUFFER: + return StencilBuffer != 0; + case EVDF_RENDER_TO_TARGET: case EVDF_MULTITEXTURE: case EVDF_HARDWARE_TL: @@ -637,6 +334,17 @@ bool CBurningVideoDriver::queryFeature(E_VIDEO_DRIVER_FEATURE feature) const +//! Create render target. +IRenderTarget* CBurningVideoDriver::addRenderTarget() +{ + CSoftwareRenderTarget2* renderTarget = new CSoftwareRenderTarget2(this); + RenderTargets.push_back(renderTarget); + + return renderTarget; +} + + + //! sets transformation void CBurningVideoDriver::setTransform(E_TRANSFORMATION_STATE state, const core::matrix4& mat) { @@ -682,28 +390,18 @@ void CBurningVideoDriver::setTransform(E_TRANSFORMATION_STATE state, const core: } } - -//! clears the zbuffer -bool CBurningVideoDriver::beginScene(bool backBuffer, bool zBuffer, - SColor color, const SExposedVideoData& videoData, - core::rect* sourceRect) +bool CBurningVideoDriver::beginScene(u16 clearFlag, SColor clearColor, f32 clearDepth, u8 clearStencil, const SExposedVideoData& videoData, core::rect* sourceRect) { - CNullDriver::beginScene(backBuffer, zBuffer, color, videoData, sourceRect); + CNullDriver::beginScene(clearFlag, clearColor, clearDepth, clearStencil, videoData, sourceRect); WindowId = videoData.D3D9.HWnd; SceneSourceRect = sourceRect; - if (backBuffer && BackBuffer) - BackBuffer->fill(color); - - if (zBuffer && DepthBuffer) - DepthBuffer->clear(); + clearBuffers(clearFlag, clearColor, clearDepth, clearStencil); memset ( TransformationFlag, 0, sizeof ( TransformationFlag ) ); return true; } - -//! presents the rendered scene on the screen, returns false if failed bool CBurningVideoDriver::endScene() { CNullDriver::endScene(); @@ -711,21 +409,19 @@ bool CBurningVideoDriver::endScene() return Presenter->present(BackBuffer, WindowId, SceneSourceRect); } - -//! sets a render target -bool CBurningVideoDriver::setRenderTarget(video::ITexture* texture, bool clearBackBuffer, - bool clearZBuffer, SColor color) +bool CBurningVideoDriver::setRenderTarget(IRenderTarget* target, u16 clearFlag, SColor clearColor, f32 clearDepth, u8 clearStencil) { - if (texture && texture->getDriverType() != EDT_BURNINGSVIDEO) + if (target && target->getDriverType() != EDT_BURNINGSVIDEO) { - os::Printer::log("Fatal Error: Tried to set a texture not owned by this driver.", ELL_ERROR); + os::Printer::log("Fatal Error: Tried to set a render target not owned by this driver.", ELL_ERROR); return false; } if (RenderTargetTexture) RenderTargetTexture->drop(); - RenderTargetTexture = texture; + CSoftwareRenderTarget2* renderTarget = static_cast(target); + RenderTargetTexture = (renderTarget) ? renderTarget->getTexture() : 0; if (RenderTargetTexture) { @@ -737,14 +433,7 @@ bool CBurningVideoDriver::setRenderTarget(video::ITexture* texture, bool clearBa setRenderTarget(BackBuffer); } - if (RenderTargetSurface && (clearBackBuffer || clearZBuffer)) - { - if (clearZBuffer) - DepthBuffer->clear(); - - if (clearBackBuffer) - RenderTargetSurface->fill( color ); - } + clearBuffers(clearFlag, clearColor, clearDepth, clearStencil); return true; } @@ -874,6 +563,16 @@ REALINLINE u32 CBurningVideoDriver::clipToFrustumTest ( const s4DVertex * v ) c { u32 flag = 0; + flag |= v->Pos.z <= v->Pos.w ? 1 : 0; + flag |= -v->Pos.z <= v->Pos.w ? 2 : 0; + + flag |= v->Pos.x <= v->Pos.w ? 4 : 0; + flag |= -v->Pos.x <= v->Pos.w ? 8 : 0; + + flag |= v->Pos.y <= v->Pos.w ? 16 : 0; + flag |= -v->Pos.y <= v->Pos.w ? 32 : 0; + +/* if ( v->Pos.z <= v->Pos.w ) flag |= 1; if (-v->Pos.z <= v->Pos.w ) flag |= 2; @@ -882,7 +581,7 @@ REALINLINE u32 CBurningVideoDriver::clipToFrustumTest ( const s4DVertex * v ) c if ( v->Pos.y <= v->Pos.w ) flag |= 16; if (-v->Pos.y <= v->Pos.w ) flag |= 32; - +*/ /* for ( u32 i = 0; i!= 6; ++i ) { @@ -908,6 +607,7 @@ u32 CBurningVideoDriver::clipToHyperPlane ( s4DVertex * dest, const s4DVertex * for( u32 i = 1; i < inCount + 1; ++i) { + // i really have problem const s32 condition = i - inCount; const s32 index = (( ( condition >> 31 ) & ( i ^ condition ) ) ^ condition ) << 1; @@ -1748,7 +1448,7 @@ void CBurningVideoDriver::drawVertexPrimitiveList(const void* vertices, u32 vert // The vertex cache needs to be rewritten for these primitives. if (pType==scene::EPT_POINTS || pType==scene::EPT_LINE_STRIP || pType==scene::EPT_LINE_LOOP || pType==scene::EPT_LINES || - pType==scene::EPT_TRIANGLE_FAN || pType==scene::EPT_POLYGON || + pType==scene::EPT_POLYGON || pType==scene::EPT_POINT_SPRITES) return; @@ -1829,31 +1529,6 @@ void CBurningVideoDriver::drawVertexPrimitiveList(const void* vertices, u32 vert // to DC Space, project homogenous vertex ndc_2_dc_and_project ( CurrentOut.data + 1, CurrentOut.data, vOut ); -/* - // TODO: don't stick on 32 Bit Pointer - #define PointerAsValue(x) ( (u32) (u32*) (x) ) - - // if not complete inside clipping necessary - if ( ( test & VERTEX4D_INSIDE ) != VERTEX4D_INSIDE ) - { - u32 v[2] = { PointerAsValue ( Temp ) , PointerAsValue ( CurrentOut ) }; - for ( g = 0; g != 6; ++g ) - { - vOut = clipToHyperPlane ( (s4DVertex*) v[0], (s4DVertex*) v[1], vOut, NDCPlane[g] ); - if ( vOut < 3 ) - break; - - v[0] ^= v[1]; - v[1] ^= v[0]; - v[0] ^= v[1]; - } - - if ( vOut < 3 ) - continue; - - } -*/ - // check 2d backface culling on first dc_area = screenarea ( CurrentOut.data ); if ( Material.org.BackfaceCulling && F32_LOWER_EQUAL_0 ( dc_area ) ) @@ -2503,20 +2178,20 @@ void CBurningVideoDriver::draw3DLine(const core::vector3df& start, const wchar_t* CBurningVideoDriver::getName() const { #ifdef BURNINGVIDEO_RENDERER_BEAUTIFUL - return L"Burning's Video 0.47 beautiful"; + return L"Burning's Video 0.49 beautiful"; #elif defined ( BURNINGVIDEO_RENDERER_ULTRA_FAST ) - return L"Burning's Video 0.47 ultra fast"; + return L"Burning's Video 0.49 ultra fast"; #elif defined ( BURNINGVIDEO_RENDERER_FAST ) - return L"Burning's Video 0.47 fast"; + return L"Burning's Video 0.49 fast"; #else - return L"Burning's Video 0.47"; + return L"Burning's Video 0.49"; #endif } //! Returns the graphics card vendor name. core::stringc CBurningVideoDriver::getVendorInfo() { - return "Burning's Video: Ing. Thomas Alten (c) 2006-2012"; + return "Burning's Video: Ing. Thomas Alten (c) 2006-2015"; } @@ -2553,12 +2228,16 @@ ITexture* CBurningVideoDriver::addRenderTargetTexture(const core::dimension2dfill(color); + + if ((flag & ECBF_DEPTH) && DepthBuffer) DepthBuffer->clear(); + + if ((flag & ECBF_STENCIL) && StencilBuffer) + StencilBuffer->clear(); } @@ -2581,14 +2260,14 @@ IImage* CBurningVideoDriver::createScreenShot(video::ECOLOR_FORMAT format, video //! returns a device dependent texture from a software surface (IImage) //! THIS METHOD HAS TO BE OVERRIDDEN BY DERIVED DRIVERS WITH OWN TEXTURES -ITexture* CBurningVideoDriver::createDeviceDependentTexture(IImage* surface, const io::path& name, void* mipmapData) +ITexture* CBurningVideoDriver::createDeviceDependentTexture(IImage* surface, const io::path& name) { CSoftwareTexture2* texture = 0; if (surface && checkColorFormat(surface->getColorFormat(), surface->getDimension())) { texture = new CSoftwareTexture2( surface, name, (getTextureCreationFlag(ETCF_CREATE_MIP_MAPS) ? CSoftwareTexture2::GEN_MIPMAP : 0 ) | - (getTextureCreationFlag(ETCF_ALLOW_NON_POWER_2) ? 0 : CSoftwareTexture2::NP2_SIZE ), mipmapData); + (getTextureCreationFlag(ETCF_ALLOW_NON_POWER_2) ? 0 : CSoftwareTexture2::NP2_SIZE )); } return texture; @@ -2708,6 +2387,38 @@ core::dimension2du CBurningVideoDriver::getMaxTextureSize() const #endif // _IRR_COMPILE_WITH_BURNINGSVIDEO_ + +#if defined(_IRR_WINDOWS_) && defined(_IRR_COMPILE_WITH_BURNINGSVIDEO_) + #include + +struct dreadglobal +{ + DWORD dreadid; + HANDLE dread; + irr::video::CBurningVideoDriver *driver; + HANDLE sync; + + const irr::SIrrlichtCreationParameters* params; + irr::io::IFileSystem* io; + irr::video::IImagePresenter* presenter; +}; +dreadglobal b; + +DWORD WINAPI dreadFun( void *p) +{ + printf("Hi This is burning dread\n"); + b.driver = new irr::video::CBurningVideoDriver(*b.params, b.io, b.presenter); + + SetEvent ( b.sync ); + while ( 1 ) + { + Sleep ( 1000 ); + } + return 0; +} + +#endif + namespace irr { namespace video @@ -2717,7 +2428,19 @@ namespace video IVideoDriver* createBurningVideoDriver(const irr::SIrrlichtCreationParameters& params, io::IFileSystem* io, video::IImagePresenter* presenter) { #ifdef _IRR_COMPILE_WITH_BURNINGSVIDEO_ + + #ifdef _IRR_WINDOWS_ + b.sync = CreateEventA ( 0, 0, 0, "burnevent0" ); + b.params = ¶ms; + b.io = io; + b.presenter = presenter; + b.dread = CreateThread ( 0, 0, dreadFun, 0, 0, &b.dreadid ); + WaitForSingleObject ( b.sync, INFINITE ); + return b.driver; + #else return new CBurningVideoDriver(params, io, presenter); + #endif + #else return 0; #endif // _IRR_COMPILE_WITH_BURNINGSVIDEO_ diff --git a/source/Irrlicht/CSoftwareDriver2.h b/source/Irrlicht/CSoftwareDriver2.h index aec7d557..cc709762 100644 --- a/source/Irrlicht/CSoftwareDriver2.h +++ b/source/Irrlicht/CSoftwareDriver2.h @@ -30,25 +30,24 @@ namespace video //! queries the features of the driver, returns true if feature is available virtual bool queryFeature(E_VIDEO_DRIVER_FEATURE feature) const _IRR_OVERRIDE_; + //! Create render target. + virtual IRenderTarget* addRenderTarget() _IRR_OVERRIDE_; + //! sets transformation virtual void setTransform(E_TRANSFORMATION_STATE state, const core::matrix4& mat) _IRR_OVERRIDE_; //! sets a material virtual void setMaterial(const SMaterial& material) _IRR_OVERRIDE_; - virtual bool setRenderTarget(video::ITexture* texture, bool clearBackBuffer, - bool clearZBuffer, SColor color) _IRR_OVERRIDE_; + virtual bool setRenderTarget(IRenderTarget* target, u16 clearFlag, SColor clearColor = SColor(255,0,0,0), + f32 clearDepth = 1.f, u8 clearStencil = 0) _IRR_OVERRIDE_; //! sets a viewport virtual void setViewPort(const core::rect& area) _IRR_OVERRIDE_; - //! clears the zbuffer - virtual bool beginScene(bool backBuffer=true, bool zBuffer=true, - SColor color=SColor(255,0,0,0), - const SExposedVideoData& videoData=SExposedVideoData(), - core::rect* sourceRect=0) _IRR_OVERRIDE_; + virtual bool beginScene(u16 clearFlag, SColor clearColor = SColor(255,0,0,0), f32 clearDepth = 1.f, u8 clearStencil = 0, + const SExposedVideoData& videoData = SExposedVideoData(), core::rect* sourceRect = 0) _IRR_OVERRIDE_; - //! presents the rendered scene on the screen, returns false if failed virtual bool endScene() _IRR_OVERRIDE_; //! Only used by the internal engine. Used to notify the driver that @@ -132,8 +131,7 @@ namespace video virtual ITexture* addRenderTargetTexture(const core::dimension2d& size, const io::path& name, const ECOLOR_FORMAT format = ECF_UNKNOWN) _IRR_OVERRIDE_; - //! Clears the DepthBuffer. - virtual void clearZBuffer() _IRR_OVERRIDE_; + virtual void clearBuffers(u16 flag, SColor color = SColor(255,0,0,0), f32 depth = 1.f, u8 stencil = 0) _IRR_OVERRIDE_; //! Returns an image created from the last rendered frame. virtual IImage* createScreenShot(video::ECOLOR_FORMAT format=video::ECF_UNKNOWN, video::E_RENDER_TARGET target=video::ERT_FRAME_BUFFER) _IRR_OVERRIDE_; @@ -176,7 +174,7 @@ namespace video //! returns a device dependent texture from a software surface (IImage) //! THIS METHOD HAS TO BE OVERRIDDEN BY DERIVED DRIVERS WITH OWN TEXTURES - virtual video::ITexture* createDeviceDependentTexture(IImage* surface, const io::path& name, void* mipmapData=0) _IRR_OVERRIDE_; + virtual video::ITexture* createDeviceDependentTexture(IImage* surface, const io::path& name) _IRR_OVERRIDE_; video::CImage* BackBuffer; video::IImagePresenter* Presenter; diff --git a/source/Irrlicht/CSoftwareTexture.cpp b/source/Irrlicht/CSoftwareTexture.cpp index 02e37e1f..9236bd62 100644 --- a/source/Irrlicht/CSoftwareTexture.cpp +++ b/source/Irrlicht/CSoftwareTexture.cpp @@ -6,6 +6,7 @@ #ifdef _IRR_COMPILE_WITH_SOFTWARE_ #include "CSoftwareTexture.h" +#include "CSoftwareDriver.h" #include "os.h" namespace irr @@ -14,30 +15,49 @@ namespace video { //! constructor -CSoftwareTexture::CSoftwareTexture(IImage* image, const io::path& name, - bool renderTarget, void* mipmapData) -: ITexture(name), Texture(0), IsRenderTarget(renderTarget) +CSoftwareTexture::CSoftwareTexture(IImage* image, const io::path& name, bool renderTarget) + : ITexture(name), Texture(0) { #ifdef _DEBUG setDebugName("CSoftwareTexture"); #endif - OrigSize = image->getDimension(); - core::dimension2d optSize=OrigSize.getOptimalSize(); + DriverType = EDT_SOFTWARE; + ColorFormat = ECF_A1R5G5B5; + HasMipMaps = false; + IsRenderTarget = renderTarget; - Image = new CImage(ECF_A1R5G5B5, OrigSize); - - image->copyTo(Image); - - if (optSize == OrigSize) + if (image) { - Texture = Image; - Texture->grab(); - } - else - { - Texture = new CImage(ECF_A1R5G5B5, optSize); - Image->copyToScaling(Texture); + bool IsCompressed = false; + + if(IImage::isCompressedFormat(image->getColorFormat())) + { + os::Printer::log("Texture compression not available.", ELL_ERROR); + IsCompressed = true; + } + + OriginalSize = image->getDimension(); + core::dimension2d optSize = OriginalSize.getOptimalSize(); + + Image = new CImage(ECF_A1R5G5B5, OriginalSize); + + if (!IsCompressed) + image->copyTo(Image); + + if (optSize == OriginalSize) + { + Texture = Image; + Texture->grab(); + } + else + { + Texture = new CImage(ECF_A1R5G5B5, optSize); + Image->copyToScaling(Texture); + } + + Size = Texture->getDimension(); + Pitch = Texture->getDimension().Width * 2; } } @@ -76,20 +96,6 @@ void CSoftwareTexture::unlock() } -//! Returns original size of the texture. -const core::dimension2d& CSoftwareTexture::getOriginalSize() const -{ - return OrigSize; -} - - -//! Returns (=size) of the texture. -const core::dimension2d& CSoftwareTexture::getSize() const -{ - return Image->getDimension(); -} - - //! returns unoptimized surface CImage* CSoftwareTexture::getImage() { @@ -97,7 +103,6 @@ CImage* CSoftwareTexture::getImage() } - //! returns texture surface CImage* CSoftwareTexture::getTexture() { @@ -105,30 +110,6 @@ CImage* CSoftwareTexture::getTexture() } - -//! returns driver type of texture (=the driver, who created the texture) -E_DRIVER_TYPE CSoftwareTexture::getDriverType() const -{ - return EDT_SOFTWARE; -} - - - -//! returns color format of texture -ECOLOR_FORMAT CSoftwareTexture::getColorFormat() const -{ - return ECF_A1R5G5B5; -} - - - -//! returns pitch of texture (in bytes) -u32 CSoftwareTexture::getPitch() const -{ - return Image->getDimension().Width * 2; -} - - //! Regenerates the mip map levels of the texture. Useful after locking and //! modifying the texture void CSoftwareTexture::regenerateMipMapLevels(void* mipmapData) @@ -136,9 +117,52 @@ void CSoftwareTexture::regenerateMipMapLevels(void* mipmapData) // our software textures don't have mip maps } -bool CSoftwareTexture::isRenderTarget() const + +/* Software Render Target */ + +CSoftwareRenderTarget::CSoftwareRenderTarget(CSoftwareDriver* driver) : Driver(driver) { - return IsRenderTarget; + DriverType = EDT_SOFTWARE; + + Texture.set_used(1); + Texture[0] = 0; +} + +CSoftwareRenderTarget::~CSoftwareRenderTarget() +{ + if (Texture[0]) + Texture[0]->drop(); +} + +void CSoftwareRenderTarget::setTexture(const core::array& texture, ITexture* depthStencil) +{ + if (Texture != texture) + { + if (Texture[0]) + Texture[0]->drop(); + + bool textureDetected = false; + + for (u32 i = 0; i < texture.size(); ++i) + { + if (texture[i] && texture[i]->getDriverType() == EDT_SOFTWARE) + { + Texture[0] = texture[i]; + Texture[0]->grab(); + textureDetected = true; + + break; + } + } + + if (!textureDetected) + Texture[0] = 0; + } +} + +ITexture* CSoftwareRenderTarget::getTexture() const +{ + return Texture[0]; } diff --git a/source/Irrlicht/CSoftwareTexture.h b/source/Irrlicht/CSoftwareTexture.h index 1bccf1f9..a5d2906f 100644 --- a/source/Irrlicht/CSoftwareTexture.h +++ b/source/Irrlicht/CSoftwareTexture.h @@ -6,6 +6,7 @@ #define __C_SOFTWARE_TEXTURE_H_INCLUDED__ #include "ITexture.h" +#include "IRenderTarget.h" #include "CImage.h" namespace irr @@ -13,6 +14,8 @@ namespace irr namespace video { +class CSoftwareDriver; + /*! interface for a Video Driver dependent Texture. */ @@ -21,8 +24,7 @@ class CSoftwareTexture : public ITexture public: //! constructor - CSoftwareTexture(IImage* surface, const io::path& name, - bool renderTarget=false, void* mipmapData=0); + CSoftwareTexture(IImage* surface, const io::path& name, bool renderTarget=false); //! destructor virtual ~CSoftwareTexture(); @@ -33,39 +35,36 @@ public: //! unlock function virtual void unlock() _IRR_OVERRIDE_; - //! Returns original size of the texture. - virtual const core::dimension2d& getOriginalSize() const _IRR_OVERRIDE_; - - //! Returns (=size) of the texture. - virtual const core::dimension2d& getSize() const _IRR_OVERRIDE_; - //! returns unoptimized surface virtual CImage* getImage(); //! returns texture surface virtual CImage* getTexture(); - //! returns driver type of texture (=the driver, who created the texture) - virtual E_DRIVER_TYPE getDriverType() const _IRR_OVERRIDE_; - - //! returns color format of texture - virtual ECOLOR_FORMAT getColorFormat() const _IRR_OVERRIDE_; - - //! returns pitch of texture (in bytes) - virtual u32 getPitch() const _IRR_OVERRIDE_; - //! Regenerates the mip map levels of the texture. Useful after locking and //! modifying the texture virtual void regenerateMipMapLevels(void* mipmapData=0) _IRR_OVERRIDE_; - //! is it a render target? - virtual bool isRenderTarget() const _IRR_OVERRIDE_; - private: CImage* Image; CImage* Texture; - core::dimension2d OrigSize; - bool IsRenderTarget; +}; + +/*! + interface for a Video Driver dependent render target. +*/ +class CSoftwareRenderTarget : public IRenderTarget +{ +public: + CSoftwareRenderTarget(CSoftwareDriver* driver); + virtual ~CSoftwareRenderTarget(); + + virtual void setTexture(const core::array& texture, ITexture* depthStencil) _IRR_OVERRIDE_; + + ITexture* getTexture() const; + +protected: + CSoftwareDriver* Driver; }; diff --git a/source/Irrlicht/CSoftwareTexture2.cpp b/source/Irrlicht/CSoftwareTexture2.cpp index 9d37d415..059e8b47 100644 --- a/source/Irrlicht/CSoftwareTexture2.cpp +++ b/source/Irrlicht/CSoftwareTexture2.cpp @@ -8,6 +8,7 @@ #include "SoftwareDriver2_compile_config.h" #include "SoftwareDriver2_helper.h" #include "CSoftwareTexture2.h" +#include "CSoftwareDriver2.h" #include "os.h" namespace irr @@ -16,60 +17,75 @@ namespace video { //! constructor -CSoftwareTexture2::CSoftwareTexture2(IImage* image, const io::path& name, - u32 flags, void* mipmapData) - : ITexture(name), MipMapLOD(0), Flags ( flags ), OriginalFormat(video::ECF_UNKNOWN) +CSoftwareTexture2::CSoftwareTexture2(IImage* image, const io::path& name, u32 flags) + : ITexture(name), MipMapLOD(0), Flags ( flags ), OriginalFormat(video::ECF_UNKNOWN) { #ifdef _DEBUG setDebugName("CSoftwareTexture2"); #endif - #ifndef SOFTWARE_DRIVER_2_MIPMAPPING - Flags &= ~GEN_MIPMAP; - #endif +#ifndef SOFTWARE_DRIVER_2_MIPMAPPING + Flags &= ~GEN_MIPMAP; +#endif + DriverType = EDT_BURNINGSVIDEO; + ColorFormat = BURNINGSHADER_COLOR_FORMAT; + IsRenderTarget = (Flags & IS_RENDERTARGET) != 0; + memset32 ( MipMap, 0, sizeof ( MipMap ) ); - OrigSize = image->getDimension(); - OriginalFormat = image->getColorFormat(); - - core::setbit_cond(Flags, - image->getColorFormat () == video::ECF_A8R8G8B8 || - image->getColorFormat () == video::ECF_A1R5G5B5, - HAS_ALPHA); - - core::dimension2d optSize( - OrigSize.getOptimalSize( 0 != ( Flags & NP2_SIZE ), - false, false, - ( Flags & NP2_SIZE ) ? SOFTWARE_DRIVER_2_TEXTURE_MAXSIZE : 0) - ); - - if ( OrigSize == optSize ) + if (image) { - MipMap[0] = new CImage(BURNINGSHADER_COLOR_FORMAT, image->getDimension()); + bool IsCompressed = false; - image->copyTo(MipMap[0]); + if (IImage::isCompressedFormat(image->getColorFormat())) + { + os::Printer::log("Texture compression not available.", ELL_ERROR); + IsCompressed = true; + } + + OriginalSize = image->getDimension(); + OriginalFormat = image->getColorFormat(); + + core::dimension2d optSize( + OriginalSize.getOptimalSize(0 != (Flags & NP2_SIZE), + false, true, + SOFTWARE_DRIVER_2_TEXTURE_MAXSIZE) + ); + + if (OriginalSize == optSize) + { + MipMap[0] = new CImage(BURNINGSHADER_COLOR_FORMAT, image->getDimension()); + + if (!IsCompressed) + image->copyTo(MipMap[0]); + } + else + { + char buf[256]; + core::stringw showName ( name ); + snprintf_irr ( buf, 256, "Burningvideo: Warning Texture %ls reformat %dx%d -> %dx%d,%d", + showName.c_str(), + OriginalSize.Width, OriginalSize.Height, optSize.Width, optSize.Height, + BURNINGSHADER_COLOR_FORMAT + ); + + os::Printer::log ( buf, ELL_WARNING ); + MipMap[0] = new CImage(BURNINGSHADER_COLOR_FORMAT, optSize); + + if (!IsCompressed) + image->copyToScalingBoxFilter ( MipMap[0],0, false ); + } + + Size = MipMap[MipMapLOD]->getDimension(); + Pitch = MipMap[MipMapLOD]->getPitch(); + + OrigImageDataSizeInPixels = (f32) 0.3f * MipMap[0]->getImageDataSizeInPixels(); + + HasMipMaps = (Flags & GEN_MIPMAP) != 0; + + regenerateMipMapLevels(image->getMipMapsData()); } - else - { - char buf[256]; - core::stringw showName ( name ); - snprintf ( buf, 256, "Burningvideo: Warning Texture %ls reformat %dx%d -> %dx%d,%d", - showName.c_str(), - OrigSize.Width, OrigSize.Height, optSize.Width, optSize.Height, - BURNINGSHADER_COLOR_FORMAT - ); - - OrigSize = optSize; - os::Printer::log ( buf, ELL_WARNING ); - MipMap[0] = new CImage(BURNINGSHADER_COLOR_FORMAT, optSize); - - image->copyToScalingBoxFilter ( MipMap[0],0, false ); - } - - OrigImageDataSizeInPixels = (f32) 0.3f * MipMap[0]->getImageDataSizeInPixels(); - - regenerateMipMapLevels(mipmapData); } @@ -88,7 +104,7 @@ CSoftwareTexture2::~CSoftwareTexture2() //! modifying the texture void CSoftwareTexture2::regenerateMipMapLevels(void* mipmapData) { - if ( !hasMipMaps () ) + if (!hasMipMaps()) return; s32 i; @@ -101,7 +117,7 @@ void CSoftwareTexture2::regenerateMipMapLevels(void* mipmapData) } core::dimension2d newSize; - core::dimension2d origSize=OrigSize; + core::dimension2d origSize = Size; for (i=1; i < SOFTWARE_DRIVER_2_MIPMAPPING_MAX; ++i) { @@ -149,6 +165,54 @@ void CSoftwareTexture2::regenerateMipMapLevels(void* mipmapData) } +/* Software Render Target 2 */ + +CSoftwareRenderTarget2::CSoftwareRenderTarget2(CBurningVideoDriver* driver) : Driver(driver) +{ + DriverType = EDT_BURNINGSVIDEO; + + Texture.set_used(1); + Texture[0] = 0; +} + +CSoftwareRenderTarget2::~CSoftwareRenderTarget2() +{ + if (Texture[0]) + Texture[0]->drop(); +} + +void CSoftwareRenderTarget2::setTexture(const core::array& texture, ITexture* depthStencil) +{ + if (Texture != texture) + { + if (Texture[0]) + Texture[0]->drop(); + + bool textureDetected = false; + + for (u32 i = 0; i < texture.size(); ++i) + { + if (texture[i] && texture[i]->getDriverType() == EDT_BURNINGSVIDEO) + { + Texture[0] = texture[i]; + Texture[0]->grab(); + textureDetected = true; + + break; + } + } + + if (!textureDetected) + Texture[0] = 0; + } +} + +ITexture* CSoftwareRenderTarget2::getTexture() const +{ + return Texture[0]; +} + + } // end namespace video } // end namespace irr diff --git a/source/Irrlicht/CSoftwareTexture2.h b/source/Irrlicht/CSoftwareTexture2.h index b908c8ff..a39c94b4 100644 --- a/source/Irrlicht/CSoftwareTexture2.h +++ b/source/Irrlicht/CSoftwareTexture2.h @@ -8,6 +8,7 @@ #include "SoftwareDriver2_compile_config.h" #include "ITexture.h" +#include "IRenderTarget.h" #include "CImage.h" namespace irr @@ -15,6 +16,8 @@ namespace irr namespace video { +class CBurningVideoDriver; + /*! interface for a Video Driver dependent Texture. */ @@ -28,9 +31,8 @@ public: GEN_MIPMAP = 1, IS_RENDERTARGET = 2, NP2_SIZE = 4, - HAS_ALPHA = 8 }; - CSoftwareTexture2(IImage* surface, const io::path& name, u32 flags, void* mipmapData=0); + CSoftwareTexture2(IImage* surface, const io::path& name, u32 flags); //! destructor virtual ~CSoftwareTexture2(); @@ -39,21 +41,18 @@ public: virtual void* lock(E_TEXTURE_LOCK_MODE mode=ETLM_READ_WRITE, u32 mipmapLevel=0) _IRR_OVERRIDE_ { if (Flags & GEN_MIPMAP) - MipMapLOD=mipmapLevel; - return MipMap[MipMapLOD]->lock(); + { + MipMapLOD = mipmapLevel; + Size = MipMap[MipMapLOD]->getDimension(); + Pitch = MipMap[MipMapLOD]->getPitch(); + } + + return MipMap[MipMapLOD]->getData(); } //! unlock function virtual void unlock() _IRR_OVERRIDE_ { - MipMap[MipMapLOD]->unlock(); - } - - //! Returns original size of the texture. - virtual const core::dimension2d& getOriginalSize() const _IRR_OVERRIDE_ - { - //return MipMap[0]->getDimension(); - return OrigSize; } //! Returns the size of the largest mipmap. @@ -63,12 +62,6 @@ public: //return MipMap[0]->getImageDataSizeInPixels () * texArea; } - //! Returns (=size) of the texture. - virtual const core::dimension2d& getSize() const _IRR_OVERRIDE_ - { - return MipMap[MipMapLOD]->getDimension(); - } - //! returns unoptimized surface virtual CImage* getImage() const { @@ -81,50 +74,12 @@ public: return MipMap[MipMapLOD]; } - - //! returns driver type of texture (=the driver, who created the texture) - virtual E_DRIVER_TYPE getDriverType() const _IRR_OVERRIDE_ - { - return EDT_BURNINGSVIDEO; - } - - //! returns color format of texture - virtual ECOLOR_FORMAT getColorFormat() const _IRR_OVERRIDE_ - { - return BURNINGSHADER_COLOR_FORMAT; - } - - //! returns pitch of texture (in bytes) - virtual u32 getPitch() const - { - return MipMap[MipMapLOD]->getPitch(); - } - //! Regenerates the mip map levels of the texture. Useful after locking and //! modifying the texture virtual void regenerateMipMapLevels(void* mipmapData=0) _IRR_OVERRIDE_; - //! support mipmaps - virtual bool hasMipMaps() const _IRR_OVERRIDE_ - { - return (Flags & GEN_MIPMAP ) != 0; - } - - //! Returns if the texture has an alpha channel - virtual bool hasAlpha() const _IRR_OVERRIDE_ - { - return (Flags & HAS_ALPHA ) != 0; - } - - //! is a render target - virtual bool isRenderTarget() const _IRR_OVERRIDE_ - { - return (Flags & IS_RENDERTARGET) != 0; - } - private: f32 OrigImageDataSizeInPixels; - core::dimension2d OrigSize; CImage * MipMap[SOFTWARE_DRIVER_2_MIPMAPPING_MAX]; @@ -133,6 +88,23 @@ private: ECOLOR_FORMAT OriginalFormat; }; +/*! +interface for a Video Driver dependent render target. +*/ +class CSoftwareRenderTarget2 : public IRenderTarget +{ +public: + CSoftwareRenderTarget2(CBurningVideoDriver* driver); + virtual ~CSoftwareRenderTarget2(); + + virtual void setTexture(const core::array& texture, ITexture* depthStencil) _IRR_OVERRIDE_; + + ITexture* getTexture() const; + +protected: + CBurningVideoDriver* Driver; +}; + } // end namespace video } // end namespace irr diff --git a/source/Irrlicht/CTRFlat.cpp b/source/Irrlicht/CTRFlat.cpp index 0c0e866b..1693893b 100644 --- a/source/Irrlicht/CTRFlat.cpp +++ b/source/Irrlicht/CTRFlat.cpp @@ -48,7 +48,7 @@ public: s32 spanZValue, spanZStep; // ZValues when drawing a span TZBufferType* zTarget, *spanZTarget; // target of ZBuffer; - lockedSurface = (u16*)RenderTarget->lock(); + lockedSurface = (u16*)RenderTarget->getData(); lockedZBuffer = ZBuffer->lock(); for (s32 i=0; iunlock(); ZBuffer->unlock(); } }; diff --git a/source/Irrlicht/CTRFlatWire.cpp b/source/Irrlicht/CTRFlatWire.cpp index 200efd47..c967fc3d 100644 --- a/source/Irrlicht/CTRFlatWire.cpp +++ b/source/Irrlicht/CTRFlatWire.cpp @@ -46,7 +46,7 @@ public: s32 leftZStep, rightZStep; TZBufferType* zTarget; // target of ZBuffer; - lockedSurface = (u16*)RenderTarget->lock(); + lockedSurface = (u16*)RenderTarget->getData(); lockedZBuffer = ZBuffer->lock(); for (s32 i=0; iunlock(); ZBuffer->unlock(); } }; diff --git a/source/Irrlicht/CTRGouraud.cpp b/source/Irrlicht/CTRGouraud.cpp index 4f96069c..828d8eb6 100644 --- a/source/Irrlicht/CTRGouraud.cpp +++ b/source/Irrlicht/CTRGouraud.cpp @@ -53,7 +53,7 @@ public: s32 spanZValue, spanZStep; // ZValues when drawing a span TZBufferType* zTarget, *spanZTarget; // target of ZBuffer; - lockedSurface = (u16*)RenderTarget->lock(); + lockedSurface = (u16*)RenderTarget->getData(); lockedZBuffer = ZBuffer->lock(); for (s32 i=0; iunlock(); ZBuffer->unlock(); } diff --git a/source/Irrlicht/CTRGouraud2.cpp b/source/Irrlicht/CTRGouraud2.cpp index 35bc4514..3a65756c 100644 --- a/source/Irrlicht/CTRGouraud2.cpp +++ b/source/Irrlicht/CTRGouraud2.cpp @@ -182,7 +182,7 @@ void CTRGouraud2::scanline_bilinear () #endif #endif - dst = (tVideoSample*)RenderTarget->lock() + ( line.y * RenderTarget->getDimension().Width ) + xStart; + dst = (tVideoSample*)RenderTarget->getData() + ( line.y * RenderTarget->getDimension().Width ) + xStart; #ifdef USE_ZBUFFER z = (fp24*) DepthBuffer->lock() + ( line.y * RenderTarget->getDimension().Width ) + xStart; diff --git a/source/Irrlicht/CTRGouraudAlpha2.cpp b/source/Irrlicht/CTRGouraudAlpha2.cpp index 965471ec..8406b8d9 100644 --- a/source/Irrlicht/CTRGouraudAlpha2.cpp +++ b/source/Irrlicht/CTRGouraudAlpha2.cpp @@ -188,7 +188,7 @@ void CTRGouraudAlpha2::scanline_bilinear () #endif #endif - dst = (tVideoSample*)RenderTarget->lock() + ( line.y * RenderTarget->getDimension().Width ) + xStart; + dst = (tVideoSample*)RenderTarget->getData() + ( line.y * RenderTarget->getDimension().Width ) + xStart; #ifdef USE_ZBUFFER z = (fp24*) DepthBuffer->lock() + ( line.y * RenderTarget->getDimension().Width ) + xStart; diff --git a/source/Irrlicht/CTRGouraudAlphaNoZ2.cpp b/source/Irrlicht/CTRGouraudAlphaNoZ2.cpp index 9a879609..141ec912 100644 --- a/source/Irrlicht/CTRGouraudAlphaNoZ2.cpp +++ b/source/Irrlicht/CTRGouraudAlphaNoZ2.cpp @@ -184,7 +184,7 @@ void CTRGouraudAlphaNoZ2::scanline_bilinear () #endif #endif - dst = (tVideoSample*)RenderTarget->lock() + ( line.y * RenderTarget->getDimension().Width ) + xStart; + dst = (tVideoSample*)RenderTarget->getData() + ( line.y * RenderTarget->getDimension().Width ) + xStart; #ifdef USE_ZBUFFER z = (fp24*) DepthBuffer->lock() + ( line.y * RenderTarget->getDimension().Width ) + xStart; diff --git a/source/Irrlicht/CTRGouraudWire.cpp b/source/Irrlicht/CTRGouraudWire.cpp index a40e9c1b..9da653b3 100644 --- a/source/Irrlicht/CTRGouraudWire.cpp +++ b/source/Irrlicht/CTRGouraudWire.cpp @@ -49,7 +49,7 @@ public: s32 leftZStep, rightZStep; TZBufferType* zTarget; // target of ZBuffer; - lockedSurface = (u16*)RenderTarget->lock(); + lockedSurface = (u16*)RenderTarget->getData(); lockedZBuffer = ZBuffer->lock(); for (s32 i=0; iunlock(); ZBuffer->unlock(); } diff --git a/source/Irrlicht/CTRNormalMap.cpp b/source/Irrlicht/CTRNormalMap.cpp index b3fd35cc..7264e1ac 100644 --- a/source/Irrlicht/CTRNormalMap.cpp +++ b/source/Irrlicht/CTRNormalMap.cpp @@ -203,16 +203,14 @@ void CTRNormalMap::scanline_bilinear () #endif #endif - dst = (tVideoSample*)RenderTarget->lock() + ( line.y * RenderTarget->getDimension().Width ) + xStart; + dst = (tVideoSample*)RenderTarget->getData() + ( line.y * RenderTarget->getDimension().Width ) + xStart; #ifdef USE_ZBUFFER z = (fp24*) DepthBuffer->lock() + ( line.y * RenderTarget->getDimension().Width ) + xStart; #endif -#ifdef INVERSE_W f32 inversew; -#endif tFixPoint tx0, tx1; tFixPoint ty0, ty1; @@ -256,10 +254,11 @@ void CTRNormalMap::scanline_bilinear () #endif #else - tx0 = tofix ( line.t[0][0].x ); - ty0 = tofix ( line.t[0][0].y ); - tx1 = tofix ( line.t[1][0].x ); - ty1 = tofix ( line.t[1][0].y ); + inversew = FIX_POINT_F32_MUL; + tx0 = tofix(line.t[0][0].x, inversew); + ty0 = tofix(line.t[0][0].y, inversew); + tx1 = tofix(line.t[1][0].x, inversew); + ty1 = tofix(line.t[1][0].y, inversew); #ifdef IPOL_C0 r3 = tofix ( line.c[0][0].y ); diff --git a/source/Irrlicht/CTRStencilShadow.cpp b/source/Irrlicht/CTRStencilShadow.cpp index 4a425df2..1e5a059d 100644 --- a/source/Irrlicht/CTRStencilShadow.cpp +++ b/source/Irrlicht/CTRStencilShadow.cpp @@ -227,7 +227,7 @@ void CTRStencilShadow::fragment_zfail_decr () #endif #endif - //dst = (tVideoSample*)RenderTarget->lock() + ( line.y * RenderTarget->getDimension().Width ) + xStart; + //dst = (tVideoSample*)RenderTarget->getData() + ( line.y * RenderTarget->getDimension().Width ) + xStart; #ifdef USE_ZBUFFER z = (fp24*) DepthBuffer->lock() + ( line.y * RenderTarget->getDimension().Width ) + xStart; @@ -384,7 +384,7 @@ void CTRStencilShadow::fragment_zfail_incr() #endif #endif - //dst = (tVideoSample*)RenderTarget->lock() + ( line.y * RenderTarget->getDimension().Width ) + xStart; + //dst = (tVideoSample*)RenderTarget->getData() + ( line.y * RenderTarget->getDimension().Width ) + xStart; #ifdef USE_ZBUFFER z = (fp24*) DepthBuffer->lock() + ( line.y * RenderTarget->getDimension().Width ) + xStart; diff --git a/source/Irrlicht/CTRTextureBlend.cpp b/source/Irrlicht/CTRTextureBlend.cpp index 67bfca1b..bcd597fa 100644 --- a/source/Irrlicht/CTRTextureBlend.cpp +++ b/source/Irrlicht/CTRTextureBlend.cpp @@ -212,7 +212,7 @@ void CTRTextureBlend::setParam ( u32 index, f32 value) if ( showname && ( lsrcFact != srcFact || ldstFact != dstFact ) ) { char buf[128]; - snprintf ( buf, 128, "missing shader: %s %s",n[srcFact], n[dstFact] ); + snprintf_irr ( buf, 128, "missing shader: %s %s",n[srcFact], n[dstFact] ); os::Printer::log( buf, ELL_INFORMATION ); lsrcFact = srcFact; @@ -301,7 +301,7 @@ void CTRTextureBlend::fragment_dst_color_src_alpha () #endif #endif - dst = (tVideoSample*)RenderTarget->lock() + ( line.y * RenderTarget->getDimension().Width ) + xStart; + dst = (tVideoSample*)RenderTarget->getData() + ( line.y * RenderTarget->getDimension().Width ) + xStart; #ifdef USE_ZBUFFER z = (fp24*) DepthBuffer->lock() + ( line.y * RenderTarget->getDimension().Width ) + xStart; @@ -336,8 +336,8 @@ void CTRTextureBlend::fragment_dst_color_src_alpha () getSample_texture ( a0,r0,g0,b0, &IT[0], - tofix ( line.t[0][0].x,iw), - tofix ( line.t[0][0].y,iw) + tofix(line.t[0][0].x, iw), + tofix(line.t[0][0].y, iw) ); color_to_fix ( r1, g1, b1, dst[i] ); @@ -485,7 +485,7 @@ void CTRTextureBlend::fragment_src_color_src_alpha () #endif #endif - dst = (tVideoSample*)RenderTarget->lock() + ( line.y * RenderTarget->getDimension().Width ) + xStart; + dst = (tVideoSample*)RenderTarget->getData() + ( line.y * RenderTarget->getDimension().Width ) + xStart; #ifdef USE_ZBUFFER z = (fp24*) DepthBuffer->lock() + ( line.y * RenderTarget->getDimension().Width ) + xStart; @@ -665,7 +665,7 @@ void CTRTextureBlend::fragment_one_one_minus_src_alpha() #endif #endif - dst = (tVideoSample*)RenderTarget->lock() + ( line.y * RenderTarget->getDimension().Width ) + xStart; + dst = (tVideoSample*)RenderTarget->getData() + ( line.y * RenderTarget->getDimension().Width ) + xStart; #ifdef USE_ZBUFFER z = (fp24*) DepthBuffer->lock() + ( line.y * RenderTarget->getDimension().Width ) + xStart; @@ -862,7 +862,7 @@ void CTRTextureBlend::fragment_one_minus_dst_alpha_one () #endif #endif - dst = (tVideoSample*)RenderTarget->lock() + ( line.y * RenderTarget->getDimension().Width ) + xStart; + dst = (tVideoSample*)RenderTarget->getData() + ( line.y * RenderTarget->getDimension().Width ) + xStart; #ifdef USE_ZBUFFER z = (fp24*) DepthBuffer->lock() + ( line.y * RenderTarget->getDimension().Width ) + xStart; @@ -1058,7 +1058,7 @@ void CTRTextureBlend::fragment_src_alpha_one () #endif #endif - dst = (tVideoSample*)RenderTarget->lock() + ( line.y * RenderTarget->getDimension().Width ) + xStart; + dst = (tVideoSample*)RenderTarget->getData() + ( line.y * RenderTarget->getDimension().Width ) + xStart; #ifdef USE_ZBUFFER z = (fp24*) DepthBuffer->lock() + ( line.y * RenderTarget->getDimension().Width ) + xStart; @@ -1285,7 +1285,7 @@ void CTRTextureBlend::fragment_dst_color_one_minus_dst_alpha () #endif #endif - dst = (tVideoSample*)RenderTarget->lock() + ( line.y * RenderTarget->getDimension().Width ) + xStart; + dst = (tVideoSample*)RenderTarget->getData() + ( line.y * RenderTarget->getDimension().Width ) + xStart; #ifdef USE_ZBUFFER z = (fp24*) DepthBuffer->lock() + ( line.y * RenderTarget->getDimension().Width ) + xStart; @@ -1481,7 +1481,7 @@ void CTRTextureBlend::fragment_dst_color_zero () #endif #endif - dst = (tVideoSample*)RenderTarget->lock() + ( line.y * RenderTarget->getDimension().Width ) + xStart; + dst = (tVideoSample*)RenderTarget->getData() + ( line.y * RenderTarget->getDimension().Width ) + xStart; #ifdef USE_ZBUFFER z = (fp24*) DepthBuffer->lock() + ( line.y * RenderTarget->getDimension().Width ) + xStart; @@ -1675,7 +1675,7 @@ void CTRTextureBlend::fragment_dst_color_one () #endif #endif - dst = (tVideoSample*)RenderTarget->lock() + ( line.y * RenderTarget->getDimension().Width ) + xStart; + dst = (tVideoSample*)RenderTarget->getData() + ( line.y * RenderTarget->getDimension().Width ) + xStart; #ifdef USE_ZBUFFER z = (fp24*) DepthBuffer->lock() + ( line.y * RenderTarget->getDimension().Width ) + xStart; @@ -1872,7 +1872,7 @@ void CTRTextureBlend::fragment_zero_one_minus_scr_color () #endif #endif - dst = (tVideoSample*)RenderTarget->lock() + ( line.y * RenderTarget->getDimension().Width ) + xStart; + dst = (tVideoSample*)RenderTarget->getData() + ( line.y * RenderTarget->getDimension().Width ) + xStart; #ifdef USE_ZBUFFER z = (fp24*) DepthBuffer->lock() + ( line.y * RenderTarget->getDimension().Width ) + xStart; diff --git a/source/Irrlicht/CTRTextureDetailMap2.cpp b/source/Irrlicht/CTRTextureDetailMap2.cpp index 13b4a0fb..e26d5aaf 100644 --- a/source/Irrlicht/CTRTextureDetailMap2.cpp +++ b/source/Irrlicht/CTRTextureDetailMap2.cpp @@ -184,16 +184,14 @@ void CTRTextureDetailMap2::scanline_bilinear () #endif #endif - dst = (tVideoSample*)RenderTarget->lock() + ( line.y * RenderTarget->getDimension().Width ) + xStart; + dst = (tVideoSample*)RenderTarget->getData() + ( line.y * RenderTarget->getDimension().Width ) + xStart; #ifdef USE_ZBUFFER z = (fp24*) DepthBuffer->lock() + ( line.y * RenderTarget->getDimension().Width ) + xStart; #endif -#ifdef INVERSE_W - f32 inversew; -#endif + f32 inversew = FIX_POINT_F32_MUL; tFixPoint tx0, tx1; tFixPoint ty0, ty1; @@ -215,18 +213,12 @@ void CTRTextureDetailMap2::scanline_bilinear () { #ifdef INVERSE_W inversew = fix_inverse32 ( line.w[0] ); - +#endif tx0 = tofix ( line.t[0][0].x,inversew); ty0 = tofix ( line.t[0][0].y,inversew); tx1 = tofix ( line.t[1][0].x,inversew); ty1 = tofix ( line.t[1][0].y,inversew); -#else - tx0 = tofix ( line.t[0][0].x ); - ty0 = tofix ( line.t[0][0].y ); - tx1 = tofix ( line.t[1][0].x ); - ty1 = tofix ( line.t[1][0].y ); -#endif getSample_texture ( r0, g0, b0, &IT[0], tx0,ty0 ); getSample_texture ( r1, g1, b1, &IT[1], tx1,ty1 ); diff --git a/source/Irrlicht/CTRTextureFlat.cpp b/source/Irrlicht/CTRTextureFlat.cpp index 19618765..3f3498e5 100644 --- a/source/Irrlicht/CTRTextureFlat.cpp +++ b/source/Irrlicht/CTRTextureFlat.cpp @@ -50,9 +50,9 @@ public: s32 spanZValue, spanZStep; // ZValues when drawing a span TZBufferType* zTarget, *spanZTarget; // target of ZBuffer; - lockedSurface = (u16*)RenderTarget->lock(); + lockedSurface = (u16*)RenderTarget->getData(); lockedZBuffer = ZBuffer->lock(); - lockedTexture = (u16*)Texture->lock(); + lockedTexture = (u16*)Texture->getData(); for (s32 i=0; iunlock(); ZBuffer->unlock(); - Texture->unlock(); - } }; diff --git a/source/Irrlicht/CTRTextureFlatWire.cpp b/source/Irrlicht/CTRTextureFlatWire.cpp index edddd724..91323743 100644 --- a/source/Irrlicht/CTRTextureFlatWire.cpp +++ b/source/Irrlicht/CTRTextureFlatWire.cpp @@ -47,9 +47,9 @@ public: s32 leftZStep, rightZStep; TZBufferType* zTarget; // target of ZBuffer; - lockedSurface = (u16*)RenderTarget->lock(); + lockedSurface = (u16*)RenderTarget->getData(); lockedZBuffer = ZBuffer->lock(); - lockedTexture = (u16*)Texture->lock(); + lockedTexture = (u16*)Texture->getData(); for (s32 i=0; iunlock(); ZBuffer->unlock(); - Texture->unlock(); - } }; diff --git a/source/Irrlicht/CTRTextureGouraud.cpp b/source/Irrlicht/CTRTextureGouraud.cpp index 7176a1b7..74641a37 100644 --- a/source/Irrlicht/CTRTextureGouraud.cpp +++ b/source/Irrlicht/CTRTextureGouraud.cpp @@ -121,9 +121,9 @@ void CTRTextureGouraud::drawIndexedTriangleList(S2DVertex* vertices, s32 vertexC s32 spanZValue, spanZStep; // ZValues when drawing a span TZBufferType* zTarget, *spanZTarget; // target of ZBuffer; - lockedSurface = (u16*)RenderTarget->lock(); + lockedSurface = (u16*)RenderTarget->getData(); lockedZBuffer = ZBuffer->lock(); - lockedTexture = (u16*)Texture->lock(); + lockedTexture = (u16*)Texture->getData(); for (s32 i=0; iunlock(); ZBuffer->unlock(); - Texture->unlock(); } diff --git a/source/Irrlicht/CTRTextureGouraud2.cpp b/source/Irrlicht/CTRTextureGouraud2.cpp index 6ede55ab..eeb55d8a 100644 --- a/source/Irrlicht/CTRTextureGouraud2.cpp +++ b/source/Irrlicht/CTRTextureGouraud2.cpp @@ -183,16 +183,14 @@ void CTRTextureGouraud2::scanline_bilinear () #endif #endif - dst = (tVideoSample*)RenderTarget->lock() + ( line.y * RenderTarget->getDimension().Width ) + xStart; + dst = (tVideoSample*)RenderTarget->getData() + ( line.y * RenderTarget->getDimension().Width ) + xStart; #ifdef USE_ZBUFFER z = (fp24*) DepthBuffer->lock() + ( line.y * RenderTarget->getDimension().Width ) + xStart; #endif -#ifdef INVERSE_W - f32 inversew; -#endif + f32 inversew = FIX_POINT_F32_MUL; tFixPoint tx0; tFixPoint ty0; @@ -236,8 +234,8 @@ void CTRTextureGouraud2::scanline_bilinear () #endif #else - tx0 = tofix ( line.t[0][0].x ); - ty0 = tofix ( line.t[0][0].y ); + tx0 = tofix(line.t[0][0].x, inversew); + ty0 = tofix(line.t[0][0].y, inversew); #ifdef IPOL_C0 getTexel_plain2 ( r1, g1, b1, line.c[0][0] ); #endif diff --git a/source/Irrlicht/CTRTextureGouraudAdd.cpp b/source/Irrlicht/CTRTextureGouraudAdd.cpp index ffcea8a5..ec3da8ef 100644 --- a/source/Irrlicht/CTRTextureGouraudAdd.cpp +++ b/source/Irrlicht/CTRTextureGouraudAdd.cpp @@ -67,9 +67,9 @@ void CTRTextureGouraudAdd::drawIndexedTriangleList(S2DVertex* vertices, s32 vert s32 spanZValue, spanZStep; // ZValues when drawing a span TZBufferType* zTarget, *spanZTarget; // target of ZBuffer; - lockedSurface = (u16*)RenderTarget->lock(); + lockedSurface = (u16*)RenderTarget->getData(); lockedZBuffer = ZBuffer->lock(); - lockedTexture = (u16*)Texture->lock(); + lockedTexture = (u16*)Texture->getData(); for (s32 i=0; iunlock(); ZBuffer->unlock(); - Texture->unlock(); } } // end namespace video diff --git a/source/Irrlicht/CTRTextureGouraudAdd2.cpp b/source/Irrlicht/CTRTextureGouraudAdd2.cpp index 2f14a182..a9e89a67 100644 --- a/source/Irrlicht/CTRTextureGouraudAdd2.cpp +++ b/source/Irrlicht/CTRTextureGouraudAdd2.cpp @@ -183,16 +183,14 @@ void CTRTextureGouraudAdd2::scanline_bilinear () #endif #endif - dst = (tVideoSample*)RenderTarget->lock() + ( line.y * RenderTarget->getDimension().Width ) + xStart; + dst = (tVideoSample*)RenderTarget->getData() + ( line.y * RenderTarget->getDimension().Width ) + xStart; #ifdef USE_ZBUFFER z = (fp24*) DepthBuffer->lock() + ( line.y * RenderTarget->getDimension().Width ) + xStart; #endif -#ifdef INVERSE_W - f32 inversew; -#endif + f32 inversew = FIX_POINT_F32_MUL; #ifdef BURNINGVIDEO_RENDERER_FAST @@ -226,31 +224,19 @@ void CTRTextureGouraudAdd2::scanline_bilinear () #ifdef INVERSE_W inversew = fix_inverse32 ( line.w[0] ); - +#endif dst[i] = PixelAdd32 ( dst[i], getTexel_plain ( &IT[0], d + tofix ( line.t[0][0].x,inversew), d + tofix ( line.t[0][0].y,inversew) ) ); -#else - dst[i] = PixelAdd32 ( - dst[i], - getTexel_plain ( &IT[0], d + tofix ( line.t[0][0].x), - d + tofix ( line.t[0][0].y) ) - ); - -#endif #else #ifdef INVERSE_W inversew = fix_inverse32 ( line.w[0] ); - +#endif tx0 = tofix ( line.t[0][0].x,inversew); ty0 = tofix ( line.t[0][0].y,inversew); -#else - tx0 = tofix ( line.t[0][0].x ); - ty0 = tofix ( line.t[0][0].y ); -#endif getSample_texture ( r0, g0, b0, &IT[0], tx0,ty0 ); color_to_fix ( r1, g1, b1, dst[i] ); diff --git a/source/Irrlicht/CTRTextureGouraudAddNoZ2.cpp b/source/Irrlicht/CTRTextureGouraudAddNoZ2.cpp index b4b58f8d..e8cfadc3 100644 --- a/source/Irrlicht/CTRTextureGouraudAddNoZ2.cpp +++ b/source/Irrlicht/CTRTextureGouraudAddNoZ2.cpp @@ -183,16 +183,14 @@ void CTRTextureGouraudAddNoZ2::scanline_bilinear () #endif #endif - dst = (tVideoSample*)RenderTarget->lock() + ( line.y * RenderTarget->getDimension().Width ) + xStart; + dst = (tVideoSample*)RenderTarget->getData() + ( line.y * RenderTarget->getDimension().Width ) + xStart; #ifdef USE_ZBUFFER z = (fp24*) DepthBuffer->lock() + ( line.y * RenderTarget->getDimension().Width ) + xStart; #endif -#ifdef IPOL_W - f32 inversew; -#endif + f32 inversew = FIX_POINT_F32_MUL; tFixPoint tx0; tFixPoint ty0; @@ -211,13 +209,9 @@ void CTRTextureGouraudAddNoZ2::scanline_bilinear () { #ifdef IPOL_W inversew = fix_inverse32 ( line.w[0] ); - +#endif tx0 = tofix ( line.t[0][0].x,inversew); ty0 = tofix ( line.t[0][0].y,inversew); -#else - tx0 = tofix ( line.t[0][0].x ); - ty0 = tofix ( line.t[0][0].y ); -#endif getSample_texture ( r0, g0, b0, &IT[0], tx0,ty0 ); diff --git a/source/Irrlicht/CTRTextureGouraudAlpha.cpp b/source/Irrlicht/CTRTextureGouraudAlpha.cpp index 35d29ea6..8f46ea7c 100644 --- a/source/Irrlicht/CTRTextureGouraudAlpha.cpp +++ b/source/Irrlicht/CTRTextureGouraudAlpha.cpp @@ -200,16 +200,14 @@ void CTRTextureGouraudAlpha2::scanline_bilinear () #endif #endif - dst = (tVideoSample*)RenderTarget->lock() + ( line.y * RenderTarget->getDimension().Width ) + xStart; + dst = (tVideoSample*)RenderTarget->getData() + ( line.y * RenderTarget->getDimension().Width ) + xStart; #ifdef USE_ZBUFFER z = (fp24*) DepthBuffer->lock() + ( line.y * RenderTarget->getDimension().Width ) + xStart; #endif -#ifdef INVERSE_W - f32 inversew; -#endif + f32 inversew = FIX_POINT_F32_MUL; #ifdef BURNINGVIDEO_RENDERER_FAST u32 dIndex = ( line.y & 3 ) << 2; @@ -240,21 +238,13 @@ void CTRTextureGouraudAlpha2::scanline_bilinear () const tFixPointu d = dithermask [ dIndex | ( i ) & 3 ]; #ifdef INVERSE_W - inversew = fix_inverse32 ( line.w[0] ); +#endif u32 argb = getTexel_plain ( &IT[0], d + tofix ( line.t[0][0].x,inversew), d + tofix ( line.t[0][0].y,inversew) ); -#else - - u32 argb = getTexel_plain ( &IT[0], d + tofix ( line.t[0][0].x), - d + tofix ( line.t[0][0].y) - ); - -#endif - const u32 alpha = ( argb >> 24 ); if ( alpha > AlphaRef ) { diff --git a/source/Irrlicht/CTRTextureGouraudAlphaNoZ.cpp b/source/Irrlicht/CTRTextureGouraudAlphaNoZ.cpp index 597b32e0..c3986758 100644 --- a/source/Irrlicht/CTRTextureGouraudAlphaNoZ.cpp +++ b/source/Irrlicht/CTRTextureGouraudAlphaNoZ.cpp @@ -200,16 +200,14 @@ void CTRTextureGouraudAlphaNoZ::scanline_bilinear () #endif #endif - dst = (tVideoSample*)RenderTarget->lock() + ( line.y * RenderTarget->getDimension().Width ) + xStart; + dst = (tVideoSample*)RenderTarget->getData() + ( line.y * RenderTarget->getDimension().Width ) + xStart; #ifdef USE_ZBUFFER z = (fp24*) DepthBuffer->lock() + ( line.y * RenderTarget->getDimension().Width ) + xStart; #endif -#ifdef INVERSE_W - f32 inversew; -#endif + f32 inversew = FIX_POINT_F32_MUL; #ifdef BURNINGVIDEO_RENDERER_FAST u32 dIndex = ( line.y & 3 ) << 2; @@ -240,21 +238,12 @@ void CTRTextureGouraudAlphaNoZ::scanline_bilinear () const tFixPointu d = dithermask [ dIndex | ( i ) & 3 ]; #ifdef INVERSE_W - inversew = fix_inverse32 ( line.w[0] ); - +#endif u32 argb = getTexel_plain ( &IT[0], d + tofix ( line.t[0][0].x,inversew), d + tofix ( line.t[0][0].y,inversew) ); -#else - - u32 argb = getTexel_plain ( &IT[0], d + tofix ( line.t[0][0].x), - d + tofix ( line.t[0][0].y) - ); - -#endif - const u32 alpha = ( argb >> 24 ); if ( alpha > AlphaRef ) { diff --git a/source/Irrlicht/CTRTextureGouraudNoZ.cpp b/source/Irrlicht/CTRTextureGouraudNoZ.cpp index 7c43cf2b..4cc9c2b0 100644 --- a/source/Irrlicht/CTRTextureGouraudNoZ.cpp +++ b/source/Irrlicht/CTRTextureGouraudNoZ.cpp @@ -51,8 +51,8 @@ public: s32 spanTx, spanTy, spanTxStep, spanTyStep; // values of Texturecoords when drawing a span core::rect TriangleRect; - lockedSurface = (u16*)RenderTarget->lock(); - lockedTexture = (u16*)Texture->lock(); + lockedSurface = (u16*)RenderTarget->getData(); + lockedTexture = (u16*)Texture->getData(); for (s32 i=0; iunlock(); - Texture->unlock(); } }; diff --git a/source/Irrlicht/CTRTextureGouraudNoZ2.cpp b/source/Irrlicht/CTRTextureGouraudNoZ2.cpp index 0a30c4c9..3f549c39 100644 --- a/source/Irrlicht/CTRTextureGouraudNoZ2.cpp +++ b/source/Irrlicht/CTRTextureGouraudNoZ2.cpp @@ -188,16 +188,14 @@ void CTRTextureGouraudNoZ2::scanline_bilinear ( ) #endif #endif - dst = (tVideoSample*)RenderTarget->lock() + ( line.y * RenderTarget->getDimension().Width ) + xStart; + dst = (tVideoSample*)RenderTarget->getData() + ( line.y * RenderTarget->getDimension().Width ) + xStart; #ifdef USE_ZBUFFER z = (fp24*) DepthBuffer->lock() + ( line.y * RenderTarget->getDimension().Width ) + xStart; #endif -#ifdef INVERSE_W - f32 inversew; -#endif + f32 inversew = FIX_POINT_F32_MUL; tFixPoint tx0; tFixPoint ty0; @@ -215,13 +213,9 @@ void CTRTextureGouraudNoZ2::scanline_bilinear ( ) { #ifdef INVERSE_W inversew = fix_inverse32 ( line.w[0] ); - +#endif tx0 = tofix ( line.t[0][0].x,inversew); ty0 = tofix ( line.t[0][0].y,inversew); -#else - tx0 = tofix ( line.t[0][0].x ); - ty0 = tofix ( line.t[0][0].y ); -#endif dst[i] = getTexel_plain ( &IT[0], tx0, ty0 ); /* diff --git a/source/Irrlicht/CTRTextureGouraudVertexAlpha2.cpp b/source/Irrlicht/CTRTextureGouraudVertexAlpha2.cpp index 961c1738..40ef14fb 100644 --- a/source/Irrlicht/CTRTextureGouraudVertexAlpha2.cpp +++ b/source/Irrlicht/CTRTextureGouraudVertexAlpha2.cpp @@ -182,16 +182,14 @@ void CTRTextureVertexAlpha2::scanline_bilinear ( ) #endif #endif - dst = (tVideoSample*)RenderTarget->lock() + ( line.y * RenderTarget->getDimension().Width ) + xStart; + dst = (tVideoSample*)RenderTarget->getData() + ( line.y * RenderTarget->getDimension().Width ) + xStart; #ifdef USE_ZBUFFER z = (fp24*) DepthBuffer->lock() + ( line.y * RenderTarget->getDimension().Width ) + xStart; #endif -#ifdef INVERSE_W - f32 inversew; -#endif + f32 inversew = FIX_POINT_F32_MUL; //#define __TEST_THIS @@ -236,23 +234,12 @@ void CTRTextureVertexAlpha2::scanline_bilinear ( ) #ifdef INVERSE_W inversew = fix_inverse32 ( line.w[0] ); - +#endif tx0 = tofix ( line.t[0][0].x,inversew); ty0 = tofix ( line.t[0][0].y,inversew); #ifdef IPOL_C0 a3 = tofix ( line.c[0][0].y,inversew ); -#endif - -#else - tx0 = tofix ( line.t[0][0].x ); - ty0 = tofix ( line.t[0][0].y ); - -#ifdef IPOL_C0 - a3 = tofix ( line.c[0][0].y ); -#endif - - #endif getSample_texture ( r0, g0, b0, &IT[0], tx0, ty0 ); diff --git a/source/Irrlicht/CTRTextureGouraudWire.cpp b/source/Irrlicht/CTRTextureGouraudWire.cpp index 224fc718..c3ef92e9 100644 --- a/source/Irrlicht/CTRTextureGouraudWire.cpp +++ b/source/Irrlicht/CTRTextureGouraudWire.cpp @@ -51,9 +51,9 @@ public: s32 leftZStep, rightZStep; TZBufferType* zTarget;//, *spanZTarget; // target of ZBuffer; - lockedSurface = (u16*)RenderTarget->lock(); + lockedSurface = (u16*)RenderTarget->getData(); lockedZBuffer = ZBuffer->lock(); - lockedTexture = (u16*)Texture->lock(); + lockedTexture = (u16*)Texture->getData(); for (s32 i=0; iunlock(); ZBuffer->unlock(); - Texture->unlock(); } }; diff --git a/source/Irrlicht/CTRTextureLightMap2_Add.cpp b/source/Irrlicht/CTRTextureLightMap2_Add.cpp index e8043274..02e968fc 100644 --- a/source/Irrlicht/CTRTextureLightMap2_Add.cpp +++ b/source/Irrlicht/CTRTextureLightMap2_Add.cpp @@ -183,13 +183,14 @@ REALINLINE void CTRTextureLightMap2_Add::scanline_bilinear () #endif #endif - dst = (tVideoSample*)RenderTarget->lock() + ( line.y * RenderTarget->getDimension().Width ) + xStart; + dst = (tVideoSample*)RenderTarget->getData() + ( line.y * RenderTarget->getDimension().Width ) + xStart; #ifdef USE_ZBUFFER z = (fp24*) DepthBuffer->lock() + ( line.y * RenderTarget->getDimension().Width ) + xStart; #endif + f32 inversew = FIX_POINT_F32_MUL; #ifdef BURNINGVIDEO_RENDERER_FAST @@ -223,9 +224,8 @@ REALINLINE void CTRTextureLightMap2_Add::scanline_bilinear () #ifdef BURNINGVIDEO_RENDERER_FAST #ifdef INVERSE_W - - const f32 inversew = fix_inverse32 ( line.w[0] ); - + inversew = fix_inverse32 ( line.w[0] ); +#endif const tFixPointu d = dithermask [ dIndex | ( i ) & 3 ]; dst[i] = PixelAdd32 ( @@ -234,17 +234,6 @@ REALINLINE void CTRTextureLightMap2_Add::scanline_bilinear () getTexel_plain ( &IT[1], d + tofix ( line.t[1][0].x,inversew), d + tofix ( line.t[1][0].y,inversew) ) ); -#else - const tFixPointu d = dithermask [ dIndex | ( i ) & 3 ]; - - dst[i] = PixelAdd32 ( - getTexel_plain ( &IT[0], d + tofix ( line.t[0][0].x), - d + tofix ( line.t[0][0].y) ), - getTexel_plain ( &IT[1], d + tofix ( line.t[1][0].x), - d + tofix ( line.t[1][0].y) ) - ); - -#endif #else const f32 inversew = fix_inverse32 ( line.w[0] ); diff --git a/source/Irrlicht/CTRTextureLightMap2_M1.cpp b/source/Irrlicht/CTRTextureLightMap2_M1.cpp index 108362f6..32d600f1 100644 --- a/source/Irrlicht/CTRTextureLightMap2_M1.cpp +++ b/source/Irrlicht/CTRTextureLightMap2_M1.cpp @@ -170,7 +170,7 @@ REALINLINE void CTRTextureLightMap2_M1::scanline_bilinear2 () line.z[0] = a; line.z[1] = b; #endif - dst = (tVideoSample*)RenderTarget->lock() + ( line.y * RenderTarget->getDimension().Width ) + xStart; + dst = (tVideoSample*)RenderTarget->getData() + ( line.y * RenderTarget->getDimension().Width ) + xStart; a = (f32) i + subPixel; diff --git a/source/Irrlicht/CTRTextureLightMap2_M2.cpp b/source/Irrlicht/CTRTextureLightMap2_M2.cpp index 7c0e38a4..435f433e 100644 --- a/source/Irrlicht/CTRTextureLightMap2_M2.cpp +++ b/source/Irrlicht/CTRTextureLightMap2_M2.cpp @@ -170,7 +170,7 @@ REALINLINE void CTRTextureLightMap2_M2::scanline_bilinear2 () line.z[0] = a; line.z[1] = b; #endif - dst = (tVideoSample*)RenderTarget->lock() + ( line.y * RenderTarget->getDimension().Width ) + xStart; + dst = (tVideoSample*)RenderTarget->getData() + ( line.y * RenderTarget->getDimension().Width ) + xStart; a = (f32) i + subPixel; diff --git a/source/Irrlicht/CTRTextureLightMap2_M4.cpp b/source/Irrlicht/CTRTextureLightMap2_M4.cpp index 9573a902..a2200276 100644 --- a/source/Irrlicht/CTRTextureLightMap2_M4.cpp +++ b/source/Irrlicht/CTRTextureLightMap2_M4.cpp @@ -131,7 +131,7 @@ REALINLINE void CTRTextureLightMap2_M4::scanline_bilinear2_mag () // search z-buffer for first not occulled pixel i = ( line.y * RenderTarget->getDimension().Width ) + xStart; z = (fp24*) DepthBuffer->lock() + i; - dst = (tVideoSample*)RenderTarget->lock() + i; + dst = (tVideoSample*)RenderTarget->getData() + i; // subTexel const f32 subPixel = ( (f32) xStart ) - line.x[0]; @@ -315,7 +315,7 @@ REALINLINE void CTRTextureLightMap2_M4::scanline_bilinear2_min () line.z[0] = a; line.z[1] = b; #endif - dst = (tVideoSample*)RenderTarget->lock() + ( line.y * RenderTarget->getDimension().Width ) + xStart; + dst = (tVideoSample*)RenderTarget->getData() + ( line.y * RenderTarget->getDimension().Width ) + xStart; a = (f32) i + subPixel; diff --git a/source/Irrlicht/CTRTextureLightMapGouraud2_M4.cpp b/source/Irrlicht/CTRTextureLightMapGouraud2_M4.cpp index 969124b1..5fee88a7 100644 --- a/source/Irrlicht/CTRTextureLightMapGouraud2_M4.cpp +++ b/source/Irrlicht/CTRTextureLightMapGouraud2_M4.cpp @@ -183,16 +183,14 @@ void CTRGTextureLightMap2_M4::scanline_bilinear () #endif #endif - dst = (tVideoSample*)RenderTarget->lock() + ( line.y * RenderTarget->getDimension().Width ) + xStart; + dst = (tVideoSample*)RenderTarget->getData() + ( line.y * RenderTarget->getDimension().Width ) + xStart; #ifdef USE_ZBUFFER z = (fp24*) DepthBuffer->lock() + ( line.y * RenderTarget->getDimension().Width ) + xStart; #endif -#ifdef INVERSE_W - f32 inversew; -#endif + f32 inversew = FIX_POINT_F32_MUL; tFixPoint tx0, tx1; tFixPoint ty0, ty1; @@ -216,7 +214,7 @@ void CTRGTextureLightMap2_M4::scanline_bilinear () { #ifdef INVERSE_W inversew = fix_inverse32 ( line.w[0] ); - +#endif tx0 = tofix ( line.t[0][0].x,inversew); ty0 = tofix ( line.t[0][0].y,inversew); tx1 = tofix ( line.t[1][0].x,inversew); @@ -228,19 +226,6 @@ void CTRGTextureLightMap2_M4::scanline_bilinear () b3 = tofix ( line.c[0][0].w ,inversew ); #endif -#else - tx0 = tofix ( line.t[0][0].x ); - ty0 = tofix ( line.t[0][0].y ); - tx1 = tofix ( line.t[1][0].x ); - ty1 = tofix ( line.t[1][0].y ); - -#ifdef IPOL_C0 - r3 = tofix ( line.c[0][0].y ); - g3 = tofix ( line.c[0][0].z ); - b3 = tofix ( line.c[0][0].w ); -#endif - -#endif getSample_texture ( r0, g0, b0, &IT[0], tx0, ty0 ); getSample_texture ( r1, g1, b1, &IT[1], tx1, ty1 ); diff --git a/source/Irrlicht/CTRTextureWire2.cpp b/source/Irrlicht/CTRTextureWire2.cpp index a953e82d..3b687091 100644 --- a/source/Irrlicht/CTRTextureWire2.cpp +++ b/source/Irrlicht/CTRTextureWire2.cpp @@ -168,7 +168,7 @@ void CTRTextureWire2::renderLine ( const s4DVertex *a,const s4DVertex *b ) const if ( 0 == dx ) return; - dst = (tVideoSample*) ( (u8*) (tVideoSample*)RenderTarget->lock() + ( aposy * pitch0 ) + (aposx << VIDEO_SAMPLE_GRANULARITY ) ); + dst = (tVideoSample*) ( (u8*) (tVideoSample*)RenderTarget->getData() + ( aposy * pitch0 ) + (aposx << VIDEO_SAMPLE_GRANULARITY ) ); #ifdef USE_ZBUFFER z = (fp24*) ( (u8*) (fp24*) DepthBuffer->lock() + ( aposy * pitch1 ) + (aposx << 2 ) ); #endif diff --git a/source/Irrlicht/CTarReader.cpp b/source/Irrlicht/CTarReader.cpp index 85568613..6fd5ea7f 100644 --- a/source/Irrlicht/CTarReader.cpp +++ b/source/Irrlicht/CTarReader.cpp @@ -10,9 +10,7 @@ #include "CLimitReadFile.h" #include "os.h" #include "coreutil.h" -#if !defined(_IRR_WINDOWS_CE_PLATFORM_) #include "errno.h" -#endif namespace irr { @@ -205,10 +203,9 @@ u32 CTarReader::populateFileList() } u32 size = strtoul(sSize.c_str(), NULL, 8); -#if !defined(_IRR_WINDOWS_CE_PLATFORM_) + if (errno == ERANGE) os::Printer::log("File too large", fullPath, ELL_WARNING); -#endif // save start position u32 offset = pos + 512; diff --git a/source/Irrlicht/CTerrainSceneNode.cpp b/source/Irrlicht/CTerrainSceneNode.cpp index 35e9211f..4cc16e35 100644 --- a/source/Irrlicht/CTerrainSceneNode.cpp +++ b/source/Irrlicht/CTerrainSceneNode.cpp @@ -227,7 +227,7 @@ namespace scene const u32 endTime = os::Timer::getRealTime(); c8 tmp[255]; - snprintf(tmp, 255, "Generated terrain data (%dx%d) in %.4f seconds", + snprintf_irr(tmp, 255, "Generated terrain data (%dx%d) in %.4f seconds", TerrainData.Size, TerrainData.Size, (endTime - startTime) / 1000.0f ); os::Printer::log(tmp); @@ -463,7 +463,7 @@ namespace scene const u32 endTime = os::Timer::getTime(); c8 tmp[255]; - snprintf(tmp, 255, "Generated terrain data (%dx%d) in %.4f seconds", + snprintf_irr(tmp, 255, "Generated terrain data (%dx%d) in %.4f seconds", TerrainData.Size, TerrainData.Size, (endTime - startTime) / 1000.0f); os::Printer::log(tmp); @@ -776,7 +776,7 @@ namespace scene if (now - lastTime > 1000) { char buf[64]; - snprintf(buf, 64, "Count: %d, Visible: %d", count, visible); + snprintf_irr(buf, 64, "Count: %d, Visible: %d", count, visible); os::Printer::log(buf); lastTime = now; diff --git a/source/Irrlicht/CTimer.h b/source/Irrlicht/CTimer.h index 284dbb07..69f39bfd 100644 --- a/source/Irrlicht/CTimer.h +++ b/source/Irrlicht/CTimer.h @@ -88,7 +88,6 @@ namespace irr virtual bool isStopped() const _IRR_OVERRIDE_ { bool ret = os::Timer::isStopped(); - _IRR_IMPLEMENT_MANAGED_MARSHALLING_BUGFIX; return ret; } diff --git a/source/Irrlicht/CWADReader.cpp b/source/Irrlicht/CWADReader.cpp index a5368e5c..0d7b8f9e 100644 --- a/source/Irrlicht/CWADReader.cpp +++ b/source/Irrlicht/CWADReader.cpp @@ -115,7 +115,7 @@ CWADReader::CWADReader(IReadFile* file, bool ignoreCase, bool ignorePaths) { SWADFileEntry &e = FileList[i]; char buf[128]; - snprintf ( buf, 128, "c:\\h2\\%s", e.wadFileName.c_str() ); + snprintf_irr ( buf, 128, "c:\\h2\\%s", e.wadFileName.c_str() ); createDir ( buf ); FILE * f = fopen ( buf, "wb" ); @@ -200,7 +200,7 @@ bool CWADReader::scanLocalHeader() save.wadFileName += ".wal2"; break; default: - snprintf ( buf, 16, ".%02d", entry.type ); + snprintf_irr ( buf, 16, ".%02d", entry.type ); save.wadFileName += buf; break; } @@ -217,7 +217,7 @@ bool CWADReader::scanLocalHeader() case WAD_TYP_QPIC: save.wadFileName += ".qpic"; break; case WAD_TYP_FONT: save.wadFileName += ".font"; break; default: - snprintf ( buf, 16, ".%02d", entry.type ); + snprintf_irr ( buf, 16, ".%02d", entry.type ); save.wadFileName += buf; break; } diff --git a/source/Irrlicht/CWriteFile.cpp b/source/Irrlicht/CWriteFile.cpp index ba3c8c3f..3036fc0c 100644 --- a/source/Irrlicht/CWriteFile.cpp +++ b/source/Irrlicht/CWriteFile.cpp @@ -105,7 +105,14 @@ const io::path& CWriteFile::getFileName() const return Filename; } +//! Flush the content of the buffer in the file +bool CWriteFile::flush() +{ + if (!isOpen()) + return false; + return !(bool) fflush(File); +} IWriteFile* CWriteFile::createWriteFile(const io::path& fileName, bool append) { diff --git a/source/Irrlicht/CWriteFile.h b/source/Irrlicht/CWriteFile.h index 4cf6f572..54044fb8 100644 --- a/source/Irrlicht/CWriteFile.h +++ b/source/Irrlicht/CWriteFile.h @@ -38,6 +38,9 @@ namespace io //! Returns name of file. virtual const io::path& getFileName() const _IRR_OVERRIDE_; + //! Flush the content of the buffer in the file + virtual bool flush() _IRR_OVERRIDE_; + //! returns if file is open bool isOpen() const; diff --git a/source/Irrlicht/CXMLReaderImpl.h b/source/Irrlicht/CXMLReaderImpl.h index 22f454ea..83020a3f 100644 --- a/source/Irrlicht/CXMLReaderImpl.h +++ b/source/Irrlicht/CXMLReaderImpl.h @@ -74,7 +74,6 @@ public: return parseCurrentNode(); } - _IRR_IMPLEMENT_MANAGED_MARSHALLING_BUGFIX; return false; } diff --git a/source/Irrlicht/CXMeshFileLoader.cpp b/source/Irrlicht/CXMeshFileLoader.cpp index 59a1be52..89e0029d 100644 --- a/source/Irrlicht/CXMeshFileLoader.cpp +++ b/source/Irrlicht/CXMeshFileLoader.cpp @@ -520,6 +520,11 @@ bool CXMeshFileLoader::parseDataObject() return parseDataObjectAnimationSet(); } else + if (objectName == "AnimTicksPerSecond") + { + return parseDataObjectAnimationTicksPerSecond(); + } + else if (objectName == "Material") { // template materials now available thanks to joeWright @@ -878,6 +883,12 @@ bool CXMeshFileLoader::parseDataObjectMesh(SXMesh &mesh) else if (objectName == "DeclData") { + if (!readHeadOfDataObject()) + { + os::Printer::log("No starting brace in DeclData found.", ELL_WARNING); + os::Printer::log("Line", core::stringc(Line).c_str(), ELL_WARNING); + return false; + } // arbitrary vertex attributes // first comes the number of element definitions // then the vertex element type definitions @@ -1607,6 +1618,39 @@ bool CXMeshFileLoader::parseDataObjectAnimationSet() return true; } +bool CXMeshFileLoader::parseDataObjectAnimationTicksPerSecond() +{ +#ifdef _XREADER_DEBUG + os::Printer::log("CXFileReader: reading AnimationTicksPerSecond", ELL_DEBUG); +#endif + + if (!readHeadOfDataObject()) + { + os::Printer::log("No opening brace in Animation found in x file", ELL_WARNING); + os::Printer::log("Line", core::stringc(Line).c_str(), ELL_WARNING); + return false; + } + + const u32 ticks = readInt(); + + if (!checkForOneFollowingSemicolons()) + { + os::Printer::log("No closing semicolon in AnimationTicksPerSecond in x file", ELL_WARNING); + os::Printer::log("Line", core::stringc(Line).c_str(), ELL_WARNING); + return false; + } + + if (!checkForClosingBrace()) + { + os::Printer::log("No closing brace in AnimationTicksPerSecond in x file", ELL_WARNING); + os::Printer::log("Line", core::stringc(Line).c_str(), ELL_WARNING); + return false; + } + + AnimatedMesh->setAnimationSpeed(static_cast(ticks)); + + return true; +} bool CXMeshFileLoader::parseDataObjectAnimation() { @@ -1793,6 +1837,7 @@ bool CXMeshFileLoader::parseDataObjectAnimationKey(ISkinnedMesh::SJoint *joint) ISkinnedMesh::SRotationKey *key=AnimatedMesh->addRotationKey(joint); key->frame=time; key->rotation.set(X,Y,Z,W); + key->rotation.normalize(); } break; case 1: //scale diff --git a/source/Irrlicht/CXMeshFileLoader.h b/source/Irrlicht/CXMeshFileLoader.h index 794425b0..a4806d7b 100644 --- a/source/Irrlicht/CXMeshFileLoader.h +++ b/source/Irrlicht/CXMeshFileLoader.h @@ -118,6 +118,8 @@ private: bool parseDataObjectAnimationSet(); + bool parseDataObjectAnimationTicksPerSecond(); + bool parseDataObjectAnimation(); bool parseDataObjectAnimationKey(ISkinnedMesh::SJoint *joint); diff --git a/source/Irrlicht/CZipReader.cpp b/source/Irrlicht/CZipReader.cpp index 41bcce33..ef2422cf 100644 --- a/source/Irrlicht/CZipReader.cpp +++ b/source/Irrlicht/CZipReader.cpp @@ -620,7 +620,7 @@ IReadFile* CZipReader::createAndOpenFile(u32 index) c8* pBuf = new c8[ uncompressedSize ]; if (!pBuf) { - swprintf ( buf, 64, L"Not enough memory for decompressing %s", Files[index].FullName.c_str() ); + swprintf_irr ( buf, 64, L"Not enough memory for decompressing %s", core::stringw(Files[index].FullName).c_str() ); os::Printer::log( buf, ELL_ERROR); if (decrypted) decrypted->drop(); @@ -633,7 +633,7 @@ IReadFile* CZipReader::createAndOpenFile(u32 index) pcData = new u8[decryptedSize]; if (!pcData) { - swprintf ( buf, 64, L"Not enough memory for decompressing %s", Files[index].FullName.c_str() ); + swprintf_irr ( buf, 64, L"Not enough memory for decompressing %s", core::stringw(Files[index].FullName).c_str() ); os::Printer::log( buf, ELL_ERROR); delete [] pBuf; return 0; @@ -674,7 +674,7 @@ IReadFile* CZipReader::createAndOpenFile(u32 index) if (err != Z_OK) { - swprintf ( buf, 64, L"Error decompressing %s", Files[index].FullName.c_str() ); + swprintf_irr ( buf, 64, L"Error decompressing %s", core::stringw(Files[index].FullName).c_str() ); os::Printer::log( buf, ELL_ERROR); delete [] pBuf; return 0; @@ -694,7 +694,7 @@ IReadFile* CZipReader::createAndOpenFile(u32 index) c8* pBuf = new c8[ uncompressedSize ]; if (!pBuf) { - swprintf ( buf, 64, L"Not enough memory for decompressing %s", Files[index].FullName.c_str() ); + swprintf_irr ( buf, 64, L"Not enough memory for decompressing %s", core::stringw(Files[index].FullName).c_str() ); os::Printer::log( buf, ELL_ERROR); if (decrypted) decrypted->drop(); @@ -707,7 +707,7 @@ IReadFile* CZipReader::createAndOpenFile(u32 index) pcData = new u8[decryptedSize]; if (!pcData) { - swprintf ( buf, 64, L"Not enough memory for decompressing %s", Files[index].FullName.c_str() ); + swprintf_irr ( buf, 64, L"Not enough memory for decompressing %s", core::stringw(Files[index].FullName).c_str() ); os::Printer::log( buf, ELL_ERROR); delete [] pBuf; return 0; @@ -745,7 +745,7 @@ IReadFile* CZipReader::createAndOpenFile(u32 index) if (err != BZ_OK) { - swprintf ( buf, 64, L"Error decompressing %s", Files[index].FullName.c_str() ); + swprintf_irr ( buf, 64, L"Error decompressing %s", core::stringw(Files[index].FullName).c_str() ); os::Printer::log( buf, ELL_ERROR); delete [] pBuf; return 0; @@ -766,7 +766,7 @@ IReadFile* CZipReader::createAndOpenFile(u32 index) c8* pBuf = new c8[ uncompressedSize ]; if (!pBuf) { - swprintf ( buf, 64, L"Not enough memory for decompressing %s", Files[index].FullName.c_str() ); + swprintf_irr ( buf, 64, L"Not enough memory for decompressing %s", core::stringw(Files[index].FullName).c_str() ); os::Printer::log( buf, ELL_ERROR); if (decrypted) decrypted->drop(); @@ -779,7 +779,7 @@ IReadFile* CZipReader::createAndOpenFile(u32 index) pcData = new u8[decryptedSize]; if (!pcData) { - swprintf ( buf, 64, L"Not enough memory for decompressing %s", Files[index].FullName.c_str() ); + swprintf_irr ( buf, 64, L"Not enough memory for decompressing %s", core::stringw(Files[index].FullName).c_str() ); os::Printer::log( buf, ELL_ERROR); delete [] pBuf; return 0; @@ -826,7 +826,7 @@ IReadFile* CZipReader::createAndOpenFile(u32 index) os::Printer::log("Decryption support not enabled. File cannot be read.", ELL_ERROR); return 0; default: - swprintf ( buf, 64, L"file has unsupported compression method. %s", Files[index].FullName.c_str() ); + swprintf_irr ( buf, 64, L"file has unsupported compression method. %s", core::stringw(Files[index].FullName).c_str() ); os::Printer::log( buf, ELL_ERROR); return 0; }; diff --git a/source/Irrlicht/IBurningShader.cpp b/source/Irrlicht/IBurningShader.cpp index b4856b8b..5888d9cf 100644 --- a/source/Irrlicht/IBurningShader.cpp +++ b/source/Irrlicht/IBurningShader.cpp @@ -78,7 +78,6 @@ namespace video { RenderTarget->grab(); - //(tVideoSample*)RenderTarget->lock() = (tVideoSample*)RenderTarget->lock(); //(fp24*) DepthBuffer->lock() = DepthBuffer->lock(); } } diff --git a/source/Irrlicht/Irrlicht-gcc.cbp b/source/Irrlicht/Irrlicht-gcc.cbp index f0ca118a..c3f0c89a 100644 --- a/source/Irrlicht/Irrlicht-gcc.cbp +++ b/source/Irrlicht/Irrlicht-gcc.cbp @@ -416,193 +416,194 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -619,6 +620,8 @@ + + @@ -631,8 +634,6 @@ - - @@ -641,19 +642,6 @@ - - - - - - - - - - - - - @@ -663,6 +651,8 @@ + + @@ -797,8 +787,6 @@ - - @@ -877,8 +865,8 @@ - - + + @@ -892,8 +880,6 @@ - - @@ -1035,6 +1021,8 @@ + + @@ -1062,6 +1050,7 @@ + diff --git a/source/Irrlicht/Irrlicht.cpp b/source/Irrlicht/Irrlicht.cpp index 2ce3866d..1114a08c 100644 --- a/source/Irrlicht/Irrlicht.cpp +++ b/source/Irrlicht/Irrlicht.cpp @@ -22,10 +22,6 @@ static const char* const copyright = "Irrlicht Engine (c) 2002-2012 Nikolaus Geb #include "MacOSX/CIrrDeviceMacOSX.h" #endif -#ifdef _IRR_COMPILE_WITH_WINDOWS_CE_DEVICE_ -#include "CIrrDeviceWinCE.h" -#endif - #ifdef _IRR_COMPILE_WITH_X11_DEVICE_ #include "CIrrDeviceLinux.h" #endif @@ -85,11 +81,6 @@ namespace irr dev = new CIrrDeviceMacOSX(params); #endif -#ifdef _IRR_COMPILE_WITH_WINDOWS_CE_DEVICE_ - if (params.DeviceType == EIDT_WINCE || (!dev && params.DeviceType == EIDT_BEST)) - dev = new CIrrDeviceWinCE(params); -#endif - #ifdef _IRR_COMPILE_WITH_X11_DEVICE_ if (params.DeviceType == EIDT_X11 || (!dev && params.DeviceType == EIDT_BEST)) dev = new CIrrDeviceLinux(params); diff --git a/source/Irrlicht/Irrlicht10.0.vcxproj b/source/Irrlicht/Irrlicht10.0.vcxproj index ca4b2d4a..8f1488fc 100644 --- a/source/Irrlicht/Irrlicht10.0.vcxproj +++ b/source/Irrlicht/Irrlicht10.0.vcxproj @@ -67,6 +67,7 @@ DynamicLibrary NotSet + Windows7.1SDK DynamicLibrary @@ -77,6 +78,7 @@ StaticLibrary MultiByte true + Windows7.1SDK StaticLibrary @@ -88,6 +90,7 @@ StaticLibrary MultiByte true + Windows7.1SDK StaticLibrary @@ -98,6 +101,7 @@ StaticLibrary NotSet + Windows7.1SDK StaticLibrary @@ -108,6 +112,7 @@ DynamicLibrary MultiByte true + Windows7.1SDK DynamicLibrary @@ -119,6 +124,7 @@ DynamicLibrary MultiByte true + Windows7.1SDK DynamicLibrary @@ -129,6 +135,7 @@ DynamicLibrary NotSet + Windows7.1SDK DynamicLibrary @@ -271,39 +278,38 @@ - C:\Imagination Technologies\POWERVR SDK\OGLES2_WINDOWS_X86EMULATION_2.08.28.0634\Builds\OGLES2\Include;C:\Imagination Technologies\POWERVR SDK\OGLES_WINDOWS_X86EMULATION_2.08.28.0634\Builds\OGLES\Include;$(DXSDK_DIR)include;$(IncludePath) - $(DXSDK_DIR)include;$(IncludePath) + $(OGLES_SDK)include;$(DXSDK_DIR)include;$(IncludePath) + $(OGLES_SDK)include;$(DXSDK_DIR)include;$(IncludePath) obj\$(Configuration)\ obj\$(Configuration)64\ true true - $(DXSDK_DIR)include;$(IncludePath) - $(DXSDK_DIR)include;$(IncludePath) - $(DXSDK_DIR)include;$(IncludePath) - $(DXSDK_DIR)include;$(IncludePath) - $(DXSDK_DIR)include;$(IncludePath) - $(DXSDK_DIR)include;$(IncludePath) - $(DXSDK_DIR)include;$(IncludePath) - $(DXSDK_DIR)include;$(IncludePath) - $(DXSDK_DIR)include;$(IncludePath) - $(DXSDK_DIR)include;$(IncludePath) - $(DXSDK_DIR)include;$(IncludePath) - $(DXSDK_DIR)include;$(IncludePath) - C:\Imagination Technologies\POWERVR SDK\OGLES_WINDOWS_X86EMULATION_2.08.28.0634\Builds\OGLES\WindowsX86\Lib;C:\Imagination Technologies\POWERVR SDK\OGLES2_WINDOWS_PCEMULATION_2.07.27.0484\Builds\OGLES2\WindowsPC\Lib;$(ExecutablePath) - C:\Imagination Technologies\POWERVR SDK\OGLES2_WINDOWS_X86EMULATION_2.08.28.0634\Builds\OGLES2\WindowsX86\Lib;C:\Imagination Technologies\POWERVR SDK\OGLES_WINDOWS_X86EMULATION_2.08.28.0634\Builds\OGLES\WindowsX86\Lib;$(DXSDK_DIR)Lib\x86;$(LibraryPath) - $(DXSDK_DIR)Lib\x86;$(LibraryPath) - $(DXSDK_DIR)Lib\x86;$(LibraryPath) - $(DXSDK_DIR)Lib\x86;$(LibraryPath) - $(DXSDK_DIR)Lib\x86;$(LibraryPath) - $(DXSDK_DIR)Lib\x86;$(LibraryPath) - $(DXSDK_DIR)Lib\x86;$(LibraryPath) - $(DXSDK_DIR)Lib\x64;$(LibraryPath);$(VSInstallDir);$(VSInstallDir)lib\amd64 - $(DXSDK_DIR)Lib\x64;$(LibraryPath);$(VSInstallDir);$(VSInstallDir)lib\amd64 - $(DXSDK_DIR)Lib\x64;$(LibraryPath);$(VSInstallDir);$(VSInstallDir)lib\amd64 - $(DXSDK_DIR)Lib\x64;$(LibraryPath);$(VSInstallDir);$(VSInstallDir)lib\amd64 - $(DXSDK_DIR)Lib\x64;$(LibraryPath);$(VSInstallDir);$(VSInstallDir)lib\amd64 - $(DXSDK_DIR)Lib\x64;$(LibraryPath);$(VSInstallDir);$(VSInstallDir)lib\amd64 - $(DXSDK_DIR)Lib\x64;$(LibraryPath);$(VSInstallDir);$(VSInstallDir)lib\amd64 + $(OGLES_SDK)include;$(DXSDK_DIR)include;$(IncludePath) + $(OGLES_SDK)include;$(DXSDK_DIR)include;$(IncludePath) + $(OGLES_SDK)include;$(DXSDK_DIR)include;$(IncludePath) + $(OGLES_SDK)include;$(DXSDK_DIR)include;$(IncludePath) + $(OGLES_SDK)include;$(DXSDK_DIR)include;$(IncludePath) + $(OGLES_SDK)include;$(DXSDK_DIR)include;$(IncludePath) + $(OGLES_SDK)include;$(DXSDK_DIR)include;$(IncludePath) + $(OGLES_SDK)include;$(DXSDK_DIR)include;$(IncludePath) + $(OGLES_SDK)include;$(DXSDK_DIR)include;$(IncludePath) + $(OGLES_SDK)include;$(DXSDK_DIR)include;$(IncludePath) + $(OGLES_SDK)include;$(DXSDK_DIR)include;$(IncludePath) + $(OGLES_SDK)include;$(DXSDK_DIR)include;$(IncludePath) + $(OGLES_SDK)lib\x86;$(DXSDK_DIR)Lib\x86;$(LibraryPath) + $(OGLES_SDK)lib\x86;$(DXSDK_DIR)Lib\x86;$(LibraryPath) + $(OGLES_SDK)lib\x86;$(DXSDK_DIR)Lib\x86;$(LibraryPath) + $(OGLES_SDK)lib\x86;$(DXSDK_DIR)Lib\x86;$(LibraryPath) + $(OGLES_SDK)lib\x86;$(DXSDK_DIR)Lib\x86;$(LibraryPath) + $(OGLES_SDK)lib\x86;$(DXSDK_DIR)Lib\x86;$(LibraryPath) + $(OGLES_SDK)lib\x86;$(DXSDK_DIR)Lib\x86;$(LibraryPath) + $(OGLES_SDK)lib\x64;$(DXSDK_DIR)Lib\x64;$(LibraryPath);$(VSInstallDir);$(VSInstallDir)lib\amd64 + $(OGLES_SDK)lib\x64;$(DXSDK_DIR)Lib\x64;$(LibraryPath);$(VSInstallDir);$(VSInstallDir)lib\amd64 + $(OGLES_SDK)lib\x64;$(DXSDK_DIR)Lib\x64;$(LibraryPath);$(VSInstallDir);$(VSInstallDir)lib\amd64 + $(OGLES_SDK)lib\x64;$(DXSDK_DIR)Lib\x64;$(LibraryPath);$(VSInstallDir);$(VSInstallDir)lib\amd64 + $(OGLES_SDK)lib\x64;$(DXSDK_DIR)Lib\x64;$(LibraryPath);$(VSInstallDir);$(VSInstallDir)lib\amd64 + $(OGLES_SDK)lib\x64;$(DXSDK_DIR)Lib\x64;$(LibraryPath);$(VSInstallDir);$(VSInstallDir)lib\amd64 + $(OGLES_SDK)lib\x64;$(DXSDK_DIR)Lib\x64;$(LibraryPath);$(VSInstallDir);$(VSInstallDir)lib\amd64 @@ -335,7 +341,7 @@ /MACHINE:I386 %(AdditionalOptions) - %(AdditionalDependencies) + kernel32.lib;user32.lib;gdi32.lib;winspool.lib;comdlg32.lib;advapi32.lib;shell32.lib;ole32.lib;oleaut32.lib;uuid.lib;opengl32.lib;%(AdditionalDependencies) ..\..\bin\Win32-visualstudio\Irrlicht.dll %(AdditionalLibraryDirectories) libci.lib;%(IgnoreSpecificDefaultLibraries) @@ -413,7 +419,7 @@ /MACHINE:I386 %(AdditionalOptions) - kernel32.lib;user32.lib;gdi32.lib;%(AdditionalDependencies) + kernel32.lib;user32.lib;gdi32.lib;opengl32.lib;%(AdditionalDependencies) ..\..\bin\Win32-visualstudio\Irrlicht.dll libci.lib;%(IgnoreSpecificDefaultLibraries) false @@ -832,17 +838,16 @@ - - + @@ -996,27 +1001,39 @@ - - + + - - + + + + + + - + - + + + + + + + + + @@ -1111,22 +1128,7 @@ - - - - - - - - - - - - - - - - + @@ -1146,6 +1148,7 @@ + @@ -1209,7 +1212,6 @@ - @@ -1264,27 +1266,30 @@ - - + + - - + - - - + + + + + + + @@ -1380,18 +1385,6 @@ - - - - - - - - - - - - @@ -1410,6 +1403,7 @@ + @@ -1449,7 +1443,7 @@ - + @@ -1545,7 +1539,6 @@ - diff --git a/source/Irrlicht/Irrlicht10.0.vcxproj.filters b/source/Irrlicht/Irrlicht10.0.vcxproj.filters index d83b3bf8..372efdf5 100644 --- a/source/Irrlicht/Irrlicht10.0.vcxproj.filters +++ b/source/Irrlicht/Irrlicht10.0.vcxproj.filters @@ -55,9 +55,6 @@ {834213c7-9515-49de-aa27-8d3ed9c0c87a} - - {19838bc4-396f-4d23-ad1b-3bb652e33e6d} - {a9ca9d4d-7678-4687-b78b-15236c0dcf53} @@ -103,11 +100,14 @@ {da421793-4674-481c-be46-f7a44e78aee5} - - {f85fdc72-0905-4f0d-b663-da2c32c1c53e} + + {2c9c6ef7-5662-4f11-83cd-921c717d3ab0} - - {f5c11425-7060-4a40-8de9-5178c00ed4c0} + + {8fc81fd6-acd6-46be-adf7-31d8413fa51d} + + + {6372c29c-b69e-41e5-bee2-27ad7cf3872f} @@ -858,54 +858,6 @@ Irrlicht\video\Software - - Irrlicht\video\OpenGL - - - Irrlicht\video\OpenGL - - - Irrlicht\video\OpenGL - - - Irrlicht\video\OpenGL - - - Irrlicht\video\OpenGL - - - Irrlicht\video\OpenGL - - - Irrlicht\video\OpenGL - - - Irrlicht\video\OpenGL - - - Irrlicht\video\OpenGL - - - Irrlicht\video\OpenGL - - - Irrlicht\video\Direct3D8 - - - Irrlicht\video\Direct3D8 - - - Irrlicht\video\Direct3D8 - - - Irrlicht\video\Direct3D8 - - - Irrlicht\video\Direct3D8 - - - Irrlicht\video\Direct3D8 - Irrlicht\video\Null @@ -963,6 +915,9 @@ Irrlicht\video\Null\Loader + + Irrlicht\video\Null\Loader + Irrlicht\video\Null\Loader @@ -1152,9 +1107,6 @@ Irrlicht\irr\device - - Irrlicht\irr\device - Irrlicht\io @@ -1303,42 +1255,6 @@ include\scene - - Irrlicht\video\OpenGL-ES 1.x - - - Irrlicht\video\OpenGL-ES 1.x - - - Irrlicht\video\OpenGL-ES 1.x - - - Irrlicht\video\OpenGL-ES 1.x - - - Irrlicht\video\OpenGL-ES 2.x - - - Irrlicht\video\OpenGL-ES 2.x - - - Irrlicht\video\OpenGL-ES 2.x - - - Irrlicht\video\OpenGL-ES 2.x - - - Irrlicht\video\OpenGL-ES 2.x - - - Irrlicht\video\OpenGL-ES 2.x - - - Irrlicht\video\OpenGL-ES 2.x - - - include\video - Irrlicht\scene\loaders @@ -1357,36 +1273,108 @@ include\video - - Irrlicht\video\Direct3D9 - - - Irrlicht\video\OpenGL - - - Irrlicht\video - include\scene - - Irrlicht\video - - - Irrlicht\video\Null\Loader - - - Irrlicht\video - - - include\video - include Irrlicht\irr + + include\video + + + Irrlicht\video\Direct3D9 + + + Irrlicht\scene\writers + + + Irrlicht\scene + + + Irrlicht\video\OpenGL + + + Irrlicht\video\OpenGL + + + Irrlicht\video\OpenGL + + + Irrlicht\video\OpenGL + + + Irrlicht\video\OpenGL + + + Irrlicht\video\OpenGL + + + Irrlicht\video\OpenGL + + + Irrlicht\video\OpenGL + + + Irrlicht\video\OpenGL + + + Irrlicht\video\OpenGL Core + + + Irrlicht\video\OpenGL Core + + + Irrlicht\video\OpenGL Core + + + Irrlicht\video\OpenGL Core + + + Irrlicht\video + + + Irrlicht\video + + + Irrlicht\video\OpenGL ES2.x + + + Irrlicht\video\OpenGL ES2.x + + + Irrlicht\video\OpenGL ES2.x + + + Irrlicht\video\OpenGL ES2.x + + + Irrlicht\video\OpenGL ES2.x + + + Irrlicht\video\OpenGL ES2.x + + + Irrlicht\video\OpenGL ES2.x + + + Irrlicht\video\OpenGL ES2.x + + + Irrlicht\video\OpenGL ES1.x + + + Irrlicht\video\OpenGL ES1.x + + + Irrlicht\video\OpenGL ES1.x + + + Irrlicht\video\OpenGL ES1.x + @@ -1688,42 +1676,6 @@ Irrlicht\video\Software - - Irrlicht\video\OpenGL - - - Irrlicht\video\OpenGL - - - Irrlicht\video\OpenGL - - - Irrlicht\video\OpenGL - - - Irrlicht\video\OpenGL - - - Irrlicht\video\OpenGL - - - Irrlicht\video\OpenGL - - - Irrlicht\video\Direct3D8 - - - Irrlicht\video\Direct3D8 - - - Irrlicht\video\Direct3D8 - - - Irrlicht\video\Direct3D8 - - - Irrlicht\video\Direct3D8 - Irrlicht\video\Null @@ -1778,6 +1730,9 @@ Irrlicht\video\Null\Loader + + Irrlicht\video\Null\Loader + Irrlicht\video\Null\Loader @@ -2180,9 +2135,6 @@ Irrlicht\irr\device - - Irrlicht\irr\device - Irrlicht\io @@ -2318,66 +2270,75 @@ Irrlicht\gui - - Irrlicht\video\OpenGL-ES 1.x - - - Irrlicht\video\OpenGL-ES 1.x - - - Irrlicht\video\OpenGL-ES 1.x - - - Irrlicht\video\OpenGL-ES 2.x - - - Irrlicht\video\OpenGL-ES 2.x - - - Irrlicht\video\OpenGL-ES 2.x - - - Irrlicht\video\OpenGL-ES 2.x - - - Irrlicht\video\OpenGL-ES 2.x - - - Irrlicht\video\OpenGL-ES 2.x - - - Irrlicht\video\OpenGL-ES 2.x - - - Irrlicht\video\OpenGL-ES 2.x - Irrlicht\scene\loaders Irrlicht\scene\loaders - - Irrlicht\video\Direct3D9 - - - Irrlicht\video\OpenGL - - - Irrlicht\video - Irrlicht\irr + + Irrlicht\video\Direct3D9 + + + Irrlicht\scene\writers + + + Irrlicht\video\OpenGL + + + Irrlicht\video\OpenGL + + + Irrlicht\video\OpenGL + + + Irrlicht\video\OpenGL + + + Irrlicht\video\OpenGL + + + Irrlicht\video\OpenGL + + + Irrlicht\video\OpenGL + Irrlicht\video - - Irrlicht\video\Null\Loader - Irrlicht\video + + Irrlicht\video\OpenGL ES2.x + + + Irrlicht\video\OpenGL ES2.x + + + Irrlicht\video\OpenGL ES2.x + + + Irrlicht\video\OpenGL ES2.x + + + Irrlicht\video\OpenGL ES2.x + + + Irrlicht\video\OpenGL ES2.x + + + Irrlicht\video\OpenGL ES2.x + + + Irrlicht\video\OpenGL ES1.x + + + Irrlicht\video\OpenGL ES1.x + diff --git a/source/Irrlicht/Irrlicht11.0.vcxproj b/source/Irrlicht/Irrlicht11.0.vcxproj index a70fc618..235ff581 100644 --- a/source/Irrlicht/Irrlicht11.0.vcxproj +++ b/source/Irrlicht/Irrlicht11.0.vcxproj @@ -67,7 +67,7 @@ DynamicLibrary NotSet - v110 + Windows7.1SDK DynamicLibrary @@ -78,7 +78,7 @@ StaticLibrary MultiByte true - v110 + Windows7.1SDK StaticLibrary @@ -90,7 +90,7 @@ StaticLibrary MultiByte true - v110 + Windows7.1SDK StaticLibrary @@ -101,7 +101,7 @@ StaticLibrary NotSet - v110 + Windows7.1SDK StaticLibrary @@ -112,7 +112,7 @@ DynamicLibrary MultiByte true - v110 + Windows7.1SDK DynamicLibrary @@ -124,7 +124,7 @@ DynamicLibrary MultiByte true - v110 + Windows7.1SDK DynamicLibrary @@ -135,7 +135,7 @@ DynamicLibrary NotSet - v110 + Windows7.1SDK DynamicLibrary @@ -278,38 +278,38 @@ - $(IncludePath);$(DXSDK_DIR)include;$(CG_INC_PATH);$(PVRSDK_DIR)\OGLES2\Include - $(DXSDK_DIR)include;$(IncludePath) + $(OGLES_SDK)include;$(DXSDK_DIR)include;$(IncludePath) + $(OGLES_SDK)include;$(DXSDK_DIR)include;$(IncludePath) obj\$(Configuration)\ obj\$(Configuration)64\ true true - $(DXSDK_DIR)include;$(IncludePath) - $(DXSDK_DIR)include;$(IncludePath) - $(DXSDK_DIR)include;$(IncludePath) - $(DXSDK_DIR)include;$(IncludePath) - $(DXSDK_DIR)include;$(IncludePath) - $(DXSDK_DIR)include;$(IncludePath) - $(DXSDK_DIR)include;$(IncludePath) - $(DXSDK_DIR)include;$(IncludePath) - $(DXSDK_DIR)include;$(IncludePath) - $(DXSDK_DIR)include;$(IncludePath) - $(DXSDK_DIR)include;$(IncludePath) - $(DXSDK_DIR)include;$(IncludePath) - $(LibraryPath);$(DXSDK_DIR)Lib\x86;$(CG_LIB_PATH);$(PVRSDK_DIR)\OGLES2\Windows_x86_32\Lib - $(DXSDK_DIR)Lib\x86;$(LibraryPath) - $(DXSDK_DIR)Lib\x86;$(LibraryPath) - $(DXSDK_DIR)Lib\x86;$(LibraryPath) - $(DXSDK_DIR)Lib\x86;$(LibraryPath) - $(DXSDK_DIR)Lib\x86;$(LibraryPath) - $(DXSDK_DIR)Lib\x86;$(LibraryPath) - $(DXSDK_DIR)Lib\x64;$(LibraryPath);$(VSInstallDir);$(VSInstallDir)lib\amd64 - $(DXSDK_DIR)Lib\x64;$(LibraryPath);$(VSInstallDir);$(VSInstallDir)lib\amd64 - $(DXSDK_DIR)Lib\x64;$(LibraryPath);$(VSInstallDir);$(VSInstallDir)lib\amd64 - $(DXSDK_DIR)Lib\x64;$(LibraryPath);$(VSInstallDir);$(VSInstallDir)lib\amd64 - $(DXSDK_DIR)Lib\x64;$(LibraryPath);$(VSInstallDir);$(VSInstallDir)lib\amd64 - $(DXSDK_DIR)Lib\x64;$(LibraryPath);$(VSInstallDir);$(VSInstallDir)lib\amd64 - $(DXSDK_DIR)Lib\x64;$(LibraryPath);$(VSInstallDir);$(VSInstallDir)lib\amd64 + $(OGLES_SDK)include;$(DXSDK_DIR)include;$(IncludePath) + $(OGLES_SDK)include;$(DXSDK_DIR)include;$(IncludePath) + $(OGLES_SDK)include;$(DXSDK_DIR)include;$(IncludePath) + $(OGLES_SDK)include;$(DXSDK_DIR)include;$(IncludePath) + $(OGLES_SDK)include;$(DXSDK_DIR)include;$(IncludePath) + $(OGLES_SDK)include;$(DXSDK_DIR)include;$(IncludePath) + $(OGLES_SDK)include;$(DXSDK_DIR)include;$(IncludePath) + $(OGLES_SDK)include;$(DXSDK_DIR)include;$(IncludePath) + $(OGLES_SDK)include;$(DXSDK_DIR)include;$(IncludePath) + $(OGLES_SDK)include;$(DXSDK_DIR)include;$(IncludePath) + $(OGLES_SDK)include;$(DXSDK_DIR)include;$(IncludePath) + $(OGLES_SDK)include;$(DXSDK_DIR)include;$(IncludePath) + $(OGLES_SDK)lib\x86;$(DXSDK_DIR)Lib\x86;$(LibraryPath) + $(OGLES_SDK)lib\x86;$(DXSDK_DIR)Lib\x86;$(LibraryPath) + $(OGLES_SDK)lib\x86;$(DXSDK_DIR)Lib\x86;$(LibraryPath) + $(OGLES_SDK)lib\x86;$(DXSDK_DIR)Lib\x86;$(LibraryPath) + $(OGLES_SDK)lib\x86;$(DXSDK_DIR)Lib\x86;$(LibraryPath) + $(OGLES_SDK)lib\x86;$(DXSDK_DIR)Lib\x86;$(LibraryPath) + $(OGLES_SDK)lib\x86;$(DXSDK_DIR)Lib\x86;$(LibraryPath) + $(OGLES_SDK)lib\x64;$(DXSDK_DIR)Lib\x64;$(LibraryPath);$(VSInstallDir);$(VSInstallDir)lib\amd64 + $(OGLES_SDK)lib\x64;$(DXSDK_DIR)Lib\x64;$(LibraryPath);$(VSInstallDir);$(VSInstallDir)lib\amd64 + $(OGLES_SDK)lib\x64;$(DXSDK_DIR)Lib\x64;$(LibraryPath);$(VSInstallDir);$(VSInstallDir)lib\amd64 + $(OGLES_SDK)lib\x64;$(DXSDK_DIR)Lib\x64;$(LibraryPath);$(VSInstallDir);$(VSInstallDir)lib\amd64 + $(OGLES_SDK)lib\x64;$(DXSDK_DIR)Lib\x64;$(LibraryPath);$(VSInstallDir);$(VSInstallDir)lib\amd64 + $(OGLES_SDK)lib\x64;$(DXSDK_DIR)Lib\x64;$(LibraryPath);$(VSInstallDir);$(VSInstallDir)lib\amd64 + $(OGLES_SDK)lib\x64;$(DXSDK_DIR)Lib\x64;$(LibraryPath);$(VSInstallDir);$(VSInstallDir)lib\amd64 @@ -842,11 +842,12 @@ - + + @@ -927,7 +928,7 @@ - + @@ -973,7 +974,7 @@ - + @@ -990,7 +991,7 @@ - + @@ -1000,15 +1001,19 @@ - - + + - + + + + + @@ -1016,12 +1021,19 @@ - + - - + + + + + + + + + @@ -1040,7 +1052,7 @@ - + @@ -1115,22 +1127,7 @@ - - - - - - - - - - - - - - - - + @@ -1150,6 +1147,7 @@ + @@ -1173,8 +1171,8 @@ - - + + @@ -1214,7 +1212,6 @@ - @@ -1253,7 +1250,7 @@ - + @@ -1269,13 +1266,12 @@ - - + + - @@ -1285,11 +1281,15 @@ - - - + + + + + + + @@ -1306,7 +1306,7 @@ - + @@ -1385,18 +1385,6 @@ - - - - - - - - - - - - @@ -1415,6 +1403,7 @@ + @@ -1454,8 +1443,8 @@ - - + + @@ -1550,7 +1539,6 @@ - @@ -1586,7 +1574,7 @@ - + diff --git a/source/Irrlicht/Irrlicht11.0.vcxproj.filters b/source/Irrlicht/Irrlicht11.0.vcxproj.filters index 16f52b04..9a28d581 100644 --- a/source/Irrlicht/Irrlicht11.0.vcxproj.filters +++ b/source/Irrlicht/Irrlicht11.0.vcxproj.filters @@ -55,9 +55,6 @@ {834213c7-9515-49de-aa27-8d3ed9c0c87a} - - {19838bc4-396f-4d23-ad1b-3bb652e33e6d} - {a9ca9d4d-7678-4687-b78b-15236c0dcf53} @@ -103,18 +100,21 @@ {da421793-4674-481c-be46-f7a44e78aee5} - - {b9aa9ad0-40c0-441f-bd76-35f7605e56c7} + + {bc1d03a2-7534-4b2f-857f-be5e0ab41dde} - - {c2f0234a-9b9c-4e5c-84ab-4cee646fdb06} + + {7c6393e3-ff28-4ef8-9a82-6a1dc7e9b1fc} + + + {9386255e-8324-4ce1-864a-225390cee09e} include - + include @@ -366,7 +366,7 @@ include\scene - + include\scene @@ -501,7 +501,7 @@ include\gui - + include\gui @@ -552,7 +552,7 @@ include\gui - + include\gui @@ -645,7 +645,7 @@ Irrlicht\scene\loaders - + Irrlicht\scene\loaders @@ -864,54 +864,6 @@ Irrlicht\video\Software - - Irrlicht\video\OpenGL - - - Irrlicht\video\OpenGL - - - Irrlicht\video\OpenGL - - - Irrlicht\video\OpenGL - - - Irrlicht\video\OpenGL - - - Irrlicht\video\OpenGL - - - Irrlicht\video\OpenGL - - - Irrlicht\video\OpenGL - - - Irrlicht\video\OpenGL - - - Irrlicht\video\OpenGL - - - Irrlicht\video\Direct3D8 - - - Irrlicht\video\Direct3D8 - - - Irrlicht\video\Direct3D8 - - - Irrlicht\video\Direct3D8 - - - Irrlicht\video\Direct3D8 - - - Irrlicht\video\Direct3D8 - Irrlicht\video\Null @@ -969,6 +921,9 @@ Irrlicht\video\Null\Loader + + Irrlicht\video\Null\Loader + Irrlicht\video\Null\Loader @@ -1038,10 +993,10 @@ Irrlicht\irr - + Irrlicht\irr - + Irrlicht\irr @@ -1161,9 +1116,6 @@ Irrlicht\irr\device - - Irrlicht\irr\device - Irrlicht\io @@ -1278,7 +1230,7 @@ Irrlicht\gui - + Irrlicht\gui @@ -1330,56 +1282,99 @@ include\video - + + include\video + + Irrlicht\video\Direct3D9 - + + Irrlicht\scene\writers + + + Irrlicht\scene + + Irrlicht\video\OpenGL - + + Irrlicht\video\OpenGL + + + Irrlicht\video\OpenGL + + + Irrlicht\video\OpenGL + + + Irrlicht\video\OpenGL + + + Irrlicht\video\OpenGL + + + Irrlicht\video\OpenGL + + + Irrlicht\video\OpenGL + + + Irrlicht\video\OpenGL + + + Irrlicht\video\OpenGL Core + + + Irrlicht\video\OpenGL Core + + + Irrlicht\video\OpenGL Core + + + Irrlicht\video\OpenGL Core + + Irrlicht\video + + Irrlicht\video + + + Irrlicht\video\OpenGL ES2.x + - Irrlicht\video\OpenGL-ES 2.x + Irrlicht\video\OpenGL ES2.x - Irrlicht\video\OpenGL-ES 2.x + Irrlicht\video\OpenGL ES2.x - Irrlicht\video\OpenGL-ES 2.x + Irrlicht\video\OpenGL ES2.x - Irrlicht\video\OpenGL-ES 2.x + Irrlicht\video\OpenGL ES2.x - Irrlicht\video\OpenGL-ES 2.x + Irrlicht\video\OpenGL ES2.x - Irrlicht\video\OpenGL-ES 2.x + Irrlicht\video\OpenGL ES2.x - Irrlicht\video\OpenGL-ES 2.x + Irrlicht\video\OpenGL ES2.x - - Irrlicht\video\OpenGL-ES 2.x + + Irrlicht\video\OpenGL ES1.x - Irrlicht\video\OpenGL-ES 1.x + Irrlicht\video\OpenGL ES1.x - Irrlicht\video\OpenGL-ES 1.x + Irrlicht\video\OpenGL ES1.x - Irrlicht\video\OpenGL-ES 1.x + Irrlicht\video\OpenGL ES1.x - - Irrlicht\video\OpenGL-ES 1.x - - - Irrlicht\video\Null\Loader - - - @@ -1450,7 +1445,7 @@ Irrlicht\scene\loaders - + Irrlicht\scene\loaders @@ -1681,42 +1676,6 @@ Irrlicht\video\Software - - Irrlicht\video\OpenGL - - - Irrlicht\video\OpenGL - - - Irrlicht\video\OpenGL - - - Irrlicht\video\OpenGL - - - Irrlicht\video\OpenGL - - - Irrlicht\video\OpenGL - - - Irrlicht\video\OpenGL - - - Irrlicht\video\Direct3D8 - - - Irrlicht\video\Direct3D8 - - - Irrlicht\video\Direct3D8 - - - Irrlicht\video\Direct3D8 - - - Irrlicht\video\Direct3D8 - Irrlicht\video\Null @@ -1771,6 +1730,9 @@ Irrlicht\video\Null\Loader + + Irrlicht\video\Null\Loader + Irrlicht\video\Null\Loader @@ -1888,10 +1850,10 @@ Irrlicht\irr - + Irrlicht\irr - + Irrlicht\irr @@ -2176,9 +2138,6 @@ Irrlicht\irr\device - - Irrlicht\irr\device - Irrlicht\io @@ -2284,7 +2243,7 @@ Irrlicht\gui - + Irrlicht\gui @@ -2320,53 +2279,66 @@ Irrlicht\scene\loaders - + Irrlicht\video\Direct3D9 - + + Irrlicht\scene\writers + + Irrlicht\video\OpenGL - + + Irrlicht\video\OpenGL + + + Irrlicht\video\OpenGL + + + Irrlicht\video\OpenGL + + + Irrlicht\video\OpenGL + + + Irrlicht\video\OpenGL + + + Irrlicht\video\OpenGL + + + Irrlicht\video + + Irrlicht\video - Irrlicht\video\OpenGL-ES 2.x + Irrlicht\video\OpenGL ES2.x - Irrlicht\video\OpenGL-ES 2.x + Irrlicht\video\OpenGL ES2.x - Irrlicht\video\OpenGL-ES 2.x + Irrlicht\video\OpenGL ES2.x - Irrlicht\video\OpenGL-ES 2.x + Irrlicht\video\OpenGL ES2.x - Irrlicht\video\OpenGL-ES 2.x + Irrlicht\video\OpenGL ES2.x - Irrlicht\video\OpenGL-ES 2.x + Irrlicht\video\OpenGL ES2.x - Irrlicht\video\OpenGL-ES 2.x - - - Irrlicht\video\OpenGL-ES 2.x + Irrlicht\video\OpenGL ES2.x - Irrlicht\video\OpenGL-ES 1.x + Irrlicht\video\OpenGL ES1.x - Irrlicht\video\OpenGL-ES 1.x + Irrlicht\video\OpenGL ES1.x - - Irrlicht\video\OpenGL-ES 1.x - - - Irrlicht\video\Null\Loader - - - diff --git a/source/Irrlicht/Irrlicht12.0.sln b/source/Irrlicht/Irrlicht12.0.sln new file mode 100644 index 00000000..8a6714b4 --- /dev/null +++ b/source/Irrlicht/Irrlicht12.0.sln @@ -0,0 +1,58 @@ + +Microsoft Visual Studio Solution File, Format Version 12.00 +# Visual Studio Express 2013 for Windows Desktop +VisualStudioVersion = 12.0.30501.0 +MinimumVisualStudioVersion = 10.0.40219.1 +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Irrlicht", "Irrlicht12.0.vcxproj", "{E08E042A-6C45-411B-92BE-3CC31331019F}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Win32 = Debug|Win32 + Debug|x64 = Debug|x64 + Release - Fast FPU|Win32 = Release - Fast FPU|Win32 + Release - Fast FPU|x64 = Release - Fast FPU|x64 + Release|Win32 = Release|Win32 + Release|x64 = Release|x64 + SDL-Debug|Win32 = SDL-Debug|Win32 + SDL-Debug|x64 = SDL-Debug|x64 + Static lib - Debug|Win32 = Static lib - Debug|Win32 + Static lib - Debug|x64 = Static lib - Debug|x64 + Static lib - Release - Fast FPU|Win32 = Static lib - Release - Fast FPU|Win32 + Static lib - Release - Fast FPU|x64 = Static lib - Release - Fast FPU|x64 + Static lib - Release|Win32 = Static lib - Release|Win32 + Static lib - Release|x64 = Static lib - Release|x64 + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {E08E042A-6C45-411B-92BE-3CC31331019F}.Debug|Win32.ActiveCfg = Debug|Win32 + {E08E042A-6C45-411B-92BE-3CC31331019F}.Debug|Win32.Build.0 = Debug|Win32 + {E08E042A-6C45-411B-92BE-3CC31331019F}.Debug|x64.ActiveCfg = Debug|x64 + {E08E042A-6C45-411B-92BE-3CC31331019F}.Debug|x64.Build.0 = Debug|x64 + {E08E042A-6C45-411B-92BE-3CC31331019F}.Release - Fast FPU|Win32.ActiveCfg = Release - Fast FPU|Win32 + {E08E042A-6C45-411B-92BE-3CC31331019F}.Release - Fast FPU|Win32.Build.0 = Release - Fast FPU|Win32 + {E08E042A-6C45-411B-92BE-3CC31331019F}.Release - Fast FPU|x64.ActiveCfg = Release - Fast FPU|x64 + {E08E042A-6C45-411B-92BE-3CC31331019F}.Release - Fast FPU|x64.Build.0 = Release - Fast FPU|x64 + {E08E042A-6C45-411B-92BE-3CC31331019F}.Release|Win32.ActiveCfg = Release|Win32 + {E08E042A-6C45-411B-92BE-3CC31331019F}.Release|Win32.Build.0 = Release|Win32 + {E08E042A-6C45-411B-92BE-3CC31331019F}.Release|x64.ActiveCfg = Release|x64 + {E08E042A-6C45-411B-92BE-3CC31331019F}.Release|x64.Build.0 = Release|x64 + {E08E042A-6C45-411B-92BE-3CC31331019F}.SDL-Debug|Win32.ActiveCfg = SDL-Debug|Win32 + {E08E042A-6C45-411B-92BE-3CC31331019F}.SDL-Debug|Win32.Build.0 = SDL-Debug|Win32 + {E08E042A-6C45-411B-92BE-3CC31331019F}.SDL-Debug|x64.ActiveCfg = SDL-Debug|x64 + {E08E042A-6C45-411B-92BE-3CC31331019F}.SDL-Debug|x64.Build.0 = SDL-Debug|x64 + {E08E042A-6C45-411B-92BE-3CC31331019F}.Static lib - Debug|Win32.ActiveCfg = Static lib - Debug|Win32 + {E08E042A-6C45-411B-92BE-3CC31331019F}.Static lib - Debug|Win32.Build.0 = Static lib - Debug|Win32 + {E08E042A-6C45-411B-92BE-3CC31331019F}.Static lib - Debug|x64.ActiveCfg = Static lib - Debug|x64 + {E08E042A-6C45-411B-92BE-3CC31331019F}.Static lib - Debug|x64.Build.0 = Static lib - Debug|x64 + {E08E042A-6C45-411B-92BE-3CC31331019F}.Static lib - Release - Fast FPU|Win32.ActiveCfg = Static lib - Release - Fast FPU|Win32 + {E08E042A-6C45-411B-92BE-3CC31331019F}.Static lib - Release - Fast FPU|Win32.Build.0 = Static lib - Release - Fast FPU|Win32 + {E08E042A-6C45-411B-92BE-3CC31331019F}.Static lib - Release - Fast FPU|x64.ActiveCfg = Static lib - Release - Fast FPU|x64 + {E08E042A-6C45-411B-92BE-3CC31331019F}.Static lib - Release - Fast FPU|x64.Build.0 = Static lib - Release - Fast FPU|x64 + {E08E042A-6C45-411B-92BE-3CC31331019F}.Static lib - Release|Win32.ActiveCfg = Static lib - Release|Win32 + {E08E042A-6C45-411B-92BE-3CC31331019F}.Static lib - Release|Win32.Build.0 = Static lib - Release|Win32 + {E08E042A-6C45-411B-92BE-3CC31331019F}.Static lib - Release|x64.ActiveCfg = Static lib - Release|x64 + {E08E042A-6C45-411B-92BE-3CC31331019F}.Static lib - Release|x64.Build.0 = Static lib - Release|x64 + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection +EndGlobal diff --git a/source/Irrlicht/Irrlicht12.0.vcxproj b/source/Irrlicht/Irrlicht12.0.vcxproj new file mode 100644 index 00000000..1640ed60 --- /dev/null +++ b/source/Irrlicht/Irrlicht12.0.vcxproj @@ -0,0 +1,1594 @@ + + + + + Debug + Win32 + + + Debug + x64 + + + Release - Fast FPU + Win32 + + + Release - Fast FPU + x64 + + + Release + Win32 + + + Release + x64 + + + SDL-Debug + Win32 + + + SDL-Debug + x64 + + + Static lib - Debug + Win32 + + + Static lib - Debug + x64 + + + Static lib - Release - Fast FPU + Win32 + + + Static lib - Release - Fast FPU + x64 + + + Static lib - Release + Win32 + + + Static lib - Release + x64 + + + + Irrlicht + {E08E042A-6C45-411B-92BE-3CC31331019F} + Irrlicht + + + + DynamicLibrary + NotSet + Windows7.1SDK + + + DynamicLibrary + NotSet + Windows7.1SDK + + + StaticLibrary + MultiByte + true + Windows7.1SDK + + + StaticLibrary + MultiByte + true + Windows7.1SDK + + + StaticLibrary + MultiByte + true + Windows7.1SDK + + + StaticLibrary + MultiByte + true + Windows7.1SDK + + + StaticLibrary + NotSet + Windows7.1SDK + + + StaticLibrary + NotSet + Windows7.1SDK + + + DynamicLibrary + MultiByte + true + Windows7.1SDK + + + DynamicLibrary + MultiByte + true + Windows7.1SDK + + + DynamicLibrary + MultiByte + true + Windows7.1SDK + + + DynamicLibrary + MultiByte + true + Windows7.1SDK + + + DynamicLibrary + NotSet + Windows7.1SDK + + + DynamicLibrary + NotSet + Windows7.1SDK + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + <_ProjectFileVersion>10.0.30319.1 + ..\..\bin\Win32-VisualStudio\ + ..\..\bin\Win64-VisualStudio\ + ..\..\bin\Win32-VisualStudio\ + ..\..\bin\Win64-VisualStudio\ + obj\$(Configuration)\ + obj\$(Configuration)64\ + false + false + ..\..\bin\Win32-VisualStudio\ + ..\..\bin\Win64-VisualStudio\ + obj\$(Configuration)\ + obj\$(Configuration)64\ + false + false + ..\..\lib\Win32-VisualStudio\ + ..\..\lib\Win64-VisualStudio\ + obj\$(Configuration)\ + obj\$(Configuration)64\ + ..\..\lib\Win32-VisualStudio\ + ..\..\lib\Win64-VisualStudio\ + obj\$(Configuration)\ + obj\$(Configuration)64\ + ..\..\lib\Win32-VisualStudio\ + ..\..\lib\Win64-VisualStudio\ + obj\$(Configuration)\ + obj\$(Configuration)64\ + ..\..\bin\Win32-VisualStudio\ + ..\..\bin\Win64-VisualStudio\ + obj\$(Configuration)\ + obj\$(Configuration)64\ + true + true + AllRules.ruleset + AllRules.ruleset + + + + + AllRules.ruleset + AllRules.ruleset + + + + + AllRules.ruleset + AllRules.ruleset + + + + + AllRules.ruleset + AllRules.ruleset + + + + + AllRules.ruleset + AllRules.ruleset + + + + + AllRules.ruleset + AllRules.ruleset + + + + + AllRules.ruleset + AllRules.ruleset + + + + + $(OGLES_SDK)include;$(DXSDK_DIR)include;$(IncludePath) + $(OGLES_SDK)include;$(DXSDK_DIR)include;$(IncludePath) + obj\$(Configuration)\ + obj\$(Configuration)64\ + true + true + $(OGLES_SDK)include;$(DXSDK_DIR)include;$(IncludePath) + $(OGLES_SDK)include;$(DXSDK_DIR)include;$(IncludePath) + $(OGLES_SDK)include;$(DXSDK_DIR)include;$(IncludePath) + $(OGLES_SDK)include;$(DXSDK_DIR)include;$(IncludePath) + $(OGLES_SDK)include;$(DXSDK_DIR)include;$(IncludePath) + $(OGLES_SDK)include;$(DXSDK_DIR)include;$(IncludePath) + $(OGLES_SDK)include;$(DXSDK_DIR)include;$(IncludePath) + $(OGLES_SDK)include;$(DXSDK_DIR)include;$(IncludePath) + $(OGLES_SDK)include;$(DXSDK_DIR)include;$(IncludePath) + $(OGLES_SDK)include;$(DXSDK_DIR)include;$(IncludePath) + $(OGLES_SDK)include;$(DXSDK_DIR)include;$(IncludePath) + $(OGLES_SDK)include;$(DXSDK_DIR)include;$(IncludePath) + $(OGLES_SDK)lib\x86;$(DXSDK_DIR)Lib\x86;$(LibraryPath) + $(OGLES_SDK)lib\x86;$(DXSDK_DIR)Lib\x86;$(LibraryPath) + $(OGLES_SDK)lib\x86;$(DXSDK_DIR)Lib\x86;$(LibraryPath) + $(OGLES_SDK)lib\x86;$(DXSDK_DIR)Lib\x86;$(LibraryPath) + $(OGLES_SDK)lib\x86;$(DXSDK_DIR)Lib\x86;$(LibraryPath) + $(OGLES_SDK)lib\x86;$(DXSDK_DIR)Lib\x86;$(LibraryPath) + $(OGLES_SDK)lib\x86;$(DXSDK_DIR)Lib\x86;$(LibraryPath) + $(OGLES_SDK)lib\x64;$(DXSDK_DIR)Lib\x64;$(LibraryPath);$(VSInstallDir);$(VSInstallDir)lib\amd64 + $(OGLES_SDK)lib\x64;$(DXSDK_DIR)Lib\x64;$(LibraryPath);$(VSInstallDir);$(VSInstallDir)lib\amd64 + $(OGLES_SDK)lib\x64;$(DXSDK_DIR)Lib\x64;$(LibraryPath);$(VSInstallDir);$(VSInstallDir)lib\amd64 + $(OGLES_SDK)lib\x64;$(DXSDK_DIR)Lib\x64;$(LibraryPath);$(VSInstallDir);$(VSInstallDir)lib\amd64 + $(OGLES_SDK)lib\x64;$(DXSDK_DIR)Lib\x64;$(LibraryPath);$(VSInstallDir);$(VSInstallDir)lib\amd64 + $(OGLES_SDK)lib\x64;$(DXSDK_DIR)Lib\x64;$(LibraryPath);$(VSInstallDir);$(VSInstallDir)lib\amd64 + $(OGLES_SDK)lib\x64;$(DXSDK_DIR)Lib\x64;$(LibraryPath);$(VSInstallDir);$(VSInstallDir)lib\amd64 + + + + + _DEBUG;%(PreprocessorDefinitions) + true + true + Win32 + .\..\Debug/Irrlicht.tlb + + + ..\..\include;zlib;%(AdditionalIncludeDirectories) + WIN32;_DEBUG;_WINDOWS;_USRDLL;IRRLICHT_EXPORTS;_CRT_SECURE_NO_DEPRECATE;%(PreprocessorDefinitions); _ITERATOR_DEBUG_LEVEL=0 + + + EnableFastChecks + MultiThreadedDebug + false + false + Level3 + Disabled + + + _DEBUG;%(PreprocessorDefinitions) + 0x0c07 + + + true + + + /MACHINE:I386 %(AdditionalOptions) + kernel32.lib;user32.lib;gdi32.lib;winspool.lib;comdlg32.lib;advapi32.lib;shell32.lib;ole32.lib;oleaut32.lib;uuid.lib;opengl32.lib;%(AdditionalDependencies) + ..\..\bin\Win32-visualstudio\Irrlicht.dll + %(AdditionalLibraryDirectories) + libci.lib;%(IgnoreSpecificDefaultLibraries) + true + + + ..\..\lib\Win32-visualstudio\Irrlicht.lib + 1.9 + + + + + _DEBUG;%(PreprocessorDefinitions) + true + true + .\..\Debug/Irrlicht.tlb + + + ..\..\include;zlib;%(AdditionalIncludeDirectories) + WIN32;WIN64;_DEBUG;_WINDOWS;_USRDLL;IRRLICHT_EXPORTS;_CRT_SECURE_NO_DEPRECATE;%(PreprocessorDefinitions); _ITERATOR_DEBUG_LEVEL=0 + + + EnableFastChecks + MultiThreadedDebug + false + false + Level3 + Disabled + + + _DEBUG;%(PreprocessorDefinitions) + 0x0c07 + + + true + + + kernel32.lib;user32.lib;gdi32.lib;winspool.lib;comdlg32.lib;advapi32.lib;shell32.lib;ole32.lib;oleaut32.lib;uuid.lib;opengl32.lib;winmm.lib;%(AdditionalDependencies) + ..\..\bin\Win64-visualstudio\Irrlicht.dll + %(AdditionalLibraryDirectories) + libci.lib;%(IgnoreSpecificDefaultLibraries) + true + + + ..\..\lib\Win64-visualstudio\Irrlicht.lib + + + + + NDEBUG;%(PreprocessorDefinitions) + true + true + Win32 + .\..\Release/Irrlicht.tlb + + + MaxSpeed + OnlyExplicitInline + ..\..\include;zlib;%(AdditionalIncludeDirectories) + WIN32;NDEBUG;_WINDOWS;_USRDLL;IRRLICHT_EXPORTS;_CRT_SECURE_NO_DEPRECATE;%(PreprocessorDefinitions) + true + + + MultiThreaded + false + true + Level3 + + + Default + + + NDEBUG;%(PreprocessorDefinitions) + 0x0c07 + + + /MACHINE:I386 %(AdditionalOptions) + kernel32.lib;user32.lib;gdi32.lib;opengl32.lib;%(AdditionalDependencies) + ..\..\bin\Win32-visualstudio\Irrlicht.dll + libci.lib;%(IgnoreSpecificDefaultLibraries) + false + + + ..\..\lib\Win32-visualstudio\Irrlicht.lib + 1.9 + + + + + NDEBUG;%(PreprocessorDefinitions) + true + true + .\..\Release/Irrlicht.tlb + + + MaxSpeed + OnlyExplicitInline + ..\..\include;zlib;%(AdditionalIncludeDirectories) + WIN32;WIN64;NDEBUG;_WINDOWS;_USRDLL;IRRLICHT_EXPORTS;_CRT_SECURE_NO_DEPRECATE;%(PreprocessorDefinitions) + true + + + MultiThreaded + false + true + Level3 + + + Default + + + NDEBUG;%(PreprocessorDefinitions) + 0x0c07 + + + kernel32.lib;user32.lib;gdi32.lib;opengl32.lib;winmm.lib;%(AdditionalDependencies) + ..\..\bin\Win64-visualstudio\Irrlicht.dll + libci.lib;%(IgnoreSpecificDefaultLibraries) + false + + + ..\..\lib\Win64-visualstudio\Irrlicht.lib + + + + + NDEBUG;%(PreprocessorDefinitions) + true + true + Win32 + .\..\Release/Irrlicht.tlb + + + Full + AnySuitable + true + Speed + true + ..\..\include;zlib;%(AdditionalIncludeDirectories) + WIN32;NDEBUG;_WINDOWS;_USRDLL;IRRLICHT_EXPORTS;_CRT_SECURE_NO_DEPRECATE;%(PreprocessorDefinitions) + true + false + MultiThreaded + Default + false + false + StreamingSIMDExtensions2 + Fast + false + Level3 + + + + + NDEBUG;%(PreprocessorDefinitions) + 0x0c07 + + + /MACHINE:I386 %(AdditionalOptions) + kernel32.lib;user32.lib;gdi32.lib;winspool.lib;comdlg32.lib;advapi32.lib;shell32.lib;ole32.lib;oleaut32.lib;uuid.lib;opengl32.lib;%(AdditionalDependencies) + ..\..\bin\Win32-visualstudio\Irrlicht.dll + libci.lib;%(IgnoreSpecificDefaultLibraries) + false + true + + + ..\..\lib\Win32-visualstudio\Irrlicht.lib + Windows + 1.9 + + + + + NDEBUG;%(PreprocessorDefinitions) + true + true + .\..\Release/Irrlicht.tlb + + + Full + AnySuitable + true + Speed + true + ..\..\include;zlib;%(AdditionalIncludeDirectories) + WIN32;WIN64;NDEBUG;_WINDOWS;_USRDLL;IRRLICHT_EXPORTS;_CRT_SECURE_NO_DEPRECATE;%(PreprocessorDefinitions) + true + false + MultiThreaded + Default + false + false + StreamingSIMDExtensions2 + Fast + false + Level3 + + + + + NDEBUG;%(PreprocessorDefinitions) + 0x0c07 + + + kernel32.lib;user32.lib;gdi32.lib;winspool.lib;comdlg32.lib;advapi32.lib;shell32.lib;ole32.lib;oleaut32.lib;uuid.lib;opengl32.lib;winmm.lib;%(AdditionalDependencies) + ..\..\bin\Win64-visualstudio\Irrlicht.dll + libci.lib;%(IgnoreSpecificDefaultLibraries) + false + true + + + ..\..\lib\Win64-visualstudio\Irrlicht.lib + Windows + + + + + _DEBUG;%(PreprocessorDefinitions) + true + true + Win32 + .\..\Debug/Irrlicht.tlb + + + Disabled + ..\..\include;zlib;%(AdditionalIncludeDirectories) + WIN32;_DEBUG;_WINDOWS;_USRDLL;_IRR_STATIC_LIB_;_CRT_SECURE_NO_DEPRECATE;%(PreprocessorDefinitions); _ITERATOR_DEBUG_LEVEL=0 + + + EnableFastChecks + MultiThreadedDebug + false + false + Level3 + + + _DEBUG;%(PreprocessorDefinitions) + 0x0c07 + + + winmm.lib;%(AdditionalDependencies) + ..\..\lib\Win32-visualstudio\Irrlicht.lib + + + + + _DEBUG;%(PreprocessorDefinitions) + true + true + .\..\Debug/Irrlicht.tlb + + + Disabled + ..\..\include;zlib;%(AdditionalIncludeDirectories) + WIN32;WIN64;_DEBUG;_WINDOWS;_USRDLL;_IRR_STATIC_LIB_;_CRT_SECURE_NO_DEPRECATE;%(PreprocessorDefinitions); _ITERATOR_DEBUG_LEVEL=0 + + + EnableFastChecks + MultiThreadedDebug + false + false + Level3 + + + _DEBUG;%(PreprocessorDefinitions) + 0x0c07 + + + winmm.lib;%(AdditionalDependencies) + ..\..\lib\Win64-visualstudio\Irrlicht.lib + MachineX64 + + + + + NDEBUG;%(PreprocessorDefinitions) + true + true + Win32 + .\..\Release/Irrlicht.tlb + + + MaxSpeed + OnlyExplicitInline + false + false + ..\..\include;zlib;%(AdditionalIncludeDirectories) + WIN32;NDEBUG;_WINDOWS;_USRDLL;_IRR_STATIC_LIB_;_CRT_SECURE_NO_DEPRECATE;%(PreprocessorDefinitions) + true + + + MultiThreaded + false + true + Level3 + + + + + NDEBUG;%(PreprocessorDefinitions) + 0x0c07 + + + winmm.lib;%(AdditionalDependencies) + ..\..\lib\Win32-visualstudio\Irrlicht.lib + + + + + NDEBUG;%(PreprocessorDefinitions) + true + true + .\..\Release/Irrlicht.tlb + + + MaxSpeed + OnlyExplicitInline + false + false + ..\..\include;zlib;%(AdditionalIncludeDirectories) + WIN32;WIN64;NDEBUG;_WINDOWS;_USRDLL;_IRR_STATIC_LIB_;_CRT_SECURE_NO_DEPRECATE;%(PreprocessorDefinitions) + true + + + MultiThreaded + false + true + Level3 + + + + + NDEBUG;%(PreprocessorDefinitions) + 0x0c07 + + + winmm.lib;%(AdditionalDependencies) + ..\..\lib\Win64-visualstudio\Irrlicht.lib + MachineX64 + + + + + NDEBUG;%(PreprocessorDefinitions) + true + true + Win32 + .\..\Release/Irrlicht.tlb + + + Full + AnySuitable + true + Speed + true + ..\..\include;zlib;%(AdditionalIncludeDirectories) + WIN32;NDEBUG;_WINDOWS;_USRDLL;_IRR_STATIC_LIB_;_CRT_SECURE_NO_DEPRECATE;%(PreprocessorDefinitions) + true + + + MultiThreaded + false + true + Fast + false + Level3 + + + FastCall + + + NDEBUG;%(PreprocessorDefinitions) + 0x0c07 + + + winmm.lib;%(AdditionalDependencies) + ..\..\lib\Win32-visualstudio\Irrlicht.lib + MachineX86 + + + + + NDEBUG;%(PreprocessorDefinitions) + true + true + .\..\Release/Irrlicht.tlb + + + Full + AnySuitable + true + Speed + true + ..\..\include;zlib;%(AdditionalIncludeDirectories) + WIN32;WIN64;NDEBUG;_WINDOWS;_USRDLL;_IRR_STATIC_LIB_;_CRT_SECURE_NO_DEPRECATE;%(PreprocessorDefinitions) + true + + + MultiThreaded + false + true + Fast + false + Level3 + + + FastCall + + + NDEBUG;%(PreprocessorDefinitions) + 0x0c07 + + + winmm.lib;%(AdditionalDependencies) + ..\..\lib\Win64-visualstudio\Irrlicht.lib + MachineX64 + + + + + _DEBUG;%(PreprocessorDefinitions) + true + true + Win32 + .\..\Debug/Irrlicht.tlb + + + Disabled + ..\..\include;zlib;%(AdditionalIncludeDirectories) + WIN32;_DEBUG;_WINDOWS;_USRDLL;IRRLICHT_EXPORTS;_CRT_SECURE_NO_DEPRECATE;_IRR_USE_SDL_DEVICE_=1;%(PreprocessorDefinitions) + + + EnableFastChecks + MultiThreadedDebug + false + false + Level3 + + + _DEBUG;%(PreprocessorDefinitions) + 0x0c07 + + + true + + + /MACHINE:I386 %(AdditionalOptions) + kernel32.lib;user32.lib;gdi32.lib;winspool.lib;comdlg32.lib;advapi32.lib;shell32.lib;ole32.lib;oleaut32.lib;uuid.lib;opengl32.lib;%(AdditionalDependencies) + ..\..\bin\Win32-visualstudio\Irrlicht.dll + %(AdditionalLibraryDirectories) + libci.lib;%(IgnoreSpecificDefaultLibraries) + true + + + ..\..\lib\Win32-visualstudio\Irrlicht.lib + 1.9 + + + + + _DEBUG;%(PreprocessorDefinitions) + true + true + .\..\Debug/Irrlicht.tlb + + + Disabled + ..\..\include;zlib;%(AdditionalIncludeDirectories) + WIN32;WIN64;_DEBUG;_WINDOWS;_USRDLL;IRRLICHT_EXPORTS;_CRT_SECURE_NO_DEPRECATE;_IRR_USE_SDL_DEVICE_=1;%(PreprocessorDefinitions) + + + EnableFastChecks + MultiThreadedDebug + false + false + Level3 + + + _DEBUG;%(PreprocessorDefinitions) + 0x0c07 + + + true + + + kernel32.lib;user32.lib;gdi32.lib;winspool.lib;comdlg32.lib;advapi32.lib;shell32.lib;ole32.lib;oleaut32.lib;uuid.lib;opengl32.lib;winmm.lib;%(AdditionalDependencies) + ..\..\bin\Win64-visualstudio\Irrlicht.dll + %(AdditionalLibraryDirectories) + libci.lib;%(IgnoreSpecificDefaultLibraries) + true + + + ..\..\lib\Win64-visualstudio\Irrlicht.lib + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/source/Irrlicht/Irrlicht12.0.vcxproj.filters b/source/Irrlicht/Irrlicht12.0.vcxproj.filters new file mode 100644 index 00000000..4bb90e98 --- /dev/null +++ b/source/Irrlicht/Irrlicht12.0.vcxproj.filters @@ -0,0 +1,2346 @@ + + + + + {b5bde5d3-f9e4-4036-8c28-2f4e8cd03846} + + + {0b0937fb-2270-4e3e-a94f-f92bc0fa74ae} + + + {67300400-93d5-4a7e-8b59-7c0d7b1f6d75} + + + {feb206b9-81b6-45c0-b4e5-9e637fe060e7} + + + {af459bf5-2849-4a0e-9a21-91acbbf1c6b5} + + + {aa649d49-922d-4118-8574-f05c13d67706} + + + {a72cb2e5-a5c3-41bc-9c86-fdbdae8f7866} + + + {72c30315-bbc0-4109-9ccd-fb7107ba316a} + + + {1fcdc900-911d-4b7a-9328-afce5bbe44fa} + + + {41e16cbf-c3cb-4d74-8aef-c0416b6b9d7f} + + + {b84f01e5-ae3c-457b-8d96-b3e271800162} + + + {eca36d94-d8fb-477d-a0dc-b5498c9686d7} + + + {67826246-df05-4523-9191-5286f9157963} + + + {659a61d5-7ab3-4aa3-95ca-879780810b4e} + + + {f65e8d89-c715-4794-8c2d-22f2b57cffb0} + + + {3cb7865d-a5e9-4b22-8f54-dde759b88c51} + + + {919fcfa4-4277-4c88-8bfc-4bfcfcbb1b65} + + + {834213c7-9515-49de-aa27-8d3ed9c0c87a} + + + {a9ca9d4d-7678-4687-b78b-15236c0dcf53} + + + {d694e7b0-0fb0-4685-ace7-56d9ec65a3d0} + + + {e2571a61-945c-4509-b47c-daea464916ab} + + + {1354e9fa-cea6-461e-af7f-9940bb5f0a2f} + + + {ac7af7ba-0e6b-4da4-a695-a0070a4da974} + + + {1173499e-79e8-4c34-8046-abc325e2f2a9} + + + {ca095ff3-25e4-4852-ab55-af28c602cd8a} + + + {1c8bd90a-8361-4478-8942-a062450ef209} + + + {128cac28-b6f8-49e7-87f5-ee15951d0396} + + + {6f10ce97-ed8b-47bc-a189-f2262eb467e4} + + + {5d58bc55-284e-4880-9226-85083e65d660} + + + {064ee182-9f07-4026-ac22-c141ae2c7281} + + + {6e842906-e193-451d-8716-12eaafabd0d8} + + + {799f220e-3a58-4788-876b-88c175b69871} + + + {da421793-4674-481c-be46-f7a44e78aee5} + + + {d6b83fe4-204d-4a95-aeb7-5b8ebdec7e5d} + + + {27e98892-9346-44d4-87f7-ec6dac7b613f} + + + {8868062c-90fe-48c1-863f-daddd86dca3c} + + + + + include + + + include + + + include + + + include + + + include + + + include + + + include + + + include + + + include + + + include + + + include + + + include + + + include + + + include + + + include\video + + + include\video + + + include\video + + + include\video + + + include\video + + + include\video + + + include\video + + + include\video + + + include\video + + + include\video + + + include\video + + + include\video + + + include\video + + + include\video + + + include\video + + + include\video + + + include\video + + + include\core + + + include\core + + + include\core + + + include\core + + + include\core + + + include\core + + + include\core + + + include\core + + + include\core + + + include\core + + + include\core + + + include\core + + + include\core + + + include\core + + + include\core + + + include\core + + + include\core + + + include\core + + + include\core + + + include\core + + + include\io + + + include\io + + + include\io + + + include\io + + + include\io + + + include\io + + + include\io + + + include\io + + + include\io + + + include\io + + + include\io + + + include\scene + + + include\scene + + + include\scene + + + include\scene + + + include\scene + + + include\scene + + + include\scene + + + include\scene + + + include\scene + + + include\scene + + + include\scene + + + include\scene + + + include\scene + + + include\scene + + + include\scene + + + include\scene + + + include\scene + + + include\scene + + + include\scene + + + include\scene + + + include\scene + + + include\scene + + + include\scene + + + include\scene + + + include\scene + + + include\scene + + + include\scene + + + include\scene + + + include\scene + + + include\scene + + + include\scene + + + include\scene + + + include\scene + + + include\scene + + + include\scene + + + include\scene + + + include\scene + + + include\scene + + + include\scene + + + include\scene + + + include\scene + + + include\scene + + + include\scene + + + include\scene + + + include\scene + + + include\scene + + + include\scene + + + include\scene + + + include\scene + + + include\scene + + + include\scene + + + include\scene + + + include\scene + + + include\scene + + + include\scene + + + include\scene + + + include\scene + + + include\scene + + + include\scene + + + include\scene + + + include\scene + + + include\scene + + + include\scene + + + include\scene + + + include\scene + + + include\gui + + + include\gui + + + include\gui + + + include\gui + + + include\gui + + + include\gui + + + include\gui + + + include\gui + + + include\gui + + + include\gui + + + include\gui + + + include\gui + + + include\gui + + + include\gui + + + include\gui + + + include\gui + + + include\gui + + + include\gui + + + include\gui + + + include\gui + + + include\gui + + + include\gui + + + include\gui + + + include\gui + + + include\gui + + + include\gui + + + include\gui + + + include\gui + + + include\gui + + + include\gui + + + Irrlicht\scene + + + Irrlicht\scene + + + Irrlicht\scene + + + Irrlicht\scene + + + Irrlicht\scene + + + Irrlicht\scene + + + Irrlicht\scene + + + Irrlicht\scene\loaders + + + Irrlicht\scene\loaders + + + Irrlicht\scene\loaders + + + Irrlicht\scene\loaders + + + Irrlicht\scene\loaders + + + Irrlicht\scene\loaders + + + Irrlicht\scene\loaders + + + Irrlicht\scene\loaders + + + Irrlicht\scene\loaders + + + Irrlicht\scene\loaders + + + Irrlicht\scene\loaders + + + Irrlicht\scene\loaders + + + Irrlicht\scene\loaders + + + Irrlicht\scene\loaders + + + Irrlicht\scene\loaders + + + Irrlicht\scene\loaders + + + Irrlicht\scene\loaders + + + Irrlicht\scene\loaders + + + Irrlicht\scene\loaders + + + Irrlicht\scene\loaders + + + Irrlicht\scene\loaders + + + Irrlicht\scene\loaders + + + Irrlicht\scene\loaders + + + Irrlicht\scene\loaders + + + Irrlicht\scene\loaders + + + Irrlicht\scene\loaders + + + Irrlicht\scene\loaders + + + Irrlicht\scene\sceneNodes + + + Irrlicht\scene\sceneNodes + + + Irrlicht\scene\sceneNodes + + + Irrlicht\scene\sceneNodes + + + Irrlicht\scene\sceneNodes + + + Irrlicht\scene\sceneNodes + + + Irrlicht\scene\sceneNodes + + + Irrlicht\scene\sceneNodes + + + Irrlicht\scene\sceneNodes + + + Irrlicht\scene\sceneNodes + + + Irrlicht\scene\sceneNodes + + + Irrlicht\scene\sceneNodes + + + Irrlicht\scene\sceneNodes + + + Irrlicht\scene\sceneNodes + + + Irrlicht\scene\sceneNodes + + + Irrlicht\scene\sceneNodes + + + Irrlicht\scene\sceneNodes + + + Irrlicht\scene\sceneNodes + + + Irrlicht\scene\sceneNodes + + + Irrlicht\scene\particleSystem + + + Irrlicht\scene\particleSystem + + + Irrlicht\scene\particleSystem + + + Irrlicht\scene\particleSystem + + + Irrlicht\scene\particleSystem + + + Irrlicht\scene\particleSystem + + + Irrlicht\scene\particleSystem + + + Irrlicht\scene\particleSystem + + + Irrlicht\scene\particleSystem + + + Irrlicht\scene\particleSystem + + + Irrlicht\scene\particleSystem + + + Irrlicht\scene\particleSystem + + + Irrlicht\scene\particleSystem + + + Irrlicht\scene\collision + + + Irrlicht\scene\collision + + + Irrlicht\scene\collision + + + Irrlicht\scene\collision + + + Irrlicht\scene\collision + + + Irrlicht\scene\collision + + + Irrlicht\scene\animators + + + Irrlicht\scene\animators + + + Irrlicht\scene\animators + + + Irrlicht\scene\animators + + + Irrlicht\scene\animators + + + Irrlicht\scene\animators + + + Irrlicht\scene\animators + + + Irrlicht\scene\animators + + + Irrlicht\scene\animators + + + Irrlicht\scene\writers + + + Irrlicht\scene\writers + + + Irrlicht\scene\writers + + + Irrlicht\scene\writers + + + Irrlicht\scene\writers + + + Irrlicht\video + + + Irrlicht\video\Software + + + Irrlicht\video\Software + + + Irrlicht\video\Software + + + Irrlicht\video\Software + + + Irrlicht\video\Software + + + Irrlicht\video\Software + + + Irrlicht\video\Software + + + Irrlicht\video\Null + + + Irrlicht\video\Null + + + Irrlicht\video\Null + + + Irrlicht\video\Null + + + Irrlicht\video\Null + + + Irrlicht\video\Null\Writer + + + Irrlicht\video\Null\Writer + + + Irrlicht\video\Null\Writer + + + Irrlicht\video\Null\Writer + + + Irrlicht\video\Null\Writer + + + Irrlicht\video\Null\Writer + + + Irrlicht\video\Null\Writer + + + Irrlicht\video\Null\Loader + + + Irrlicht\video\Null\Loader + + + Irrlicht\video\Null\Loader + + + Irrlicht\video\Null\Loader + + + Irrlicht\video\Null\Loader + + + Irrlicht\video\Null\Loader + + + Irrlicht\video\Null\Loader + + + Irrlicht\video\Null\Loader + + + Irrlicht\video\Null\Loader + + + Irrlicht\video\Null\Loader + + + Irrlicht\video\Null\Loader + + + Irrlicht\video\Direct3D9 + + + Irrlicht\video\Direct3D9 + + + Irrlicht\video\Direct3D9 + + + Irrlicht\video\Direct3D9 + + + Irrlicht\video\Direct3D9 + + + Irrlicht\video\Direct3D9 + + + Irrlicht\video\Direct3D9 + + + Irrlicht\video\Burning Video + + + Irrlicht\video\Burning Video + + + Irrlicht\video\Burning Video + + + Irrlicht\video\Burning Video + + + Irrlicht\video\Burning Video + + + Irrlicht\video\Burning Video + + + Irrlicht\video\Burning Video + + + Irrlicht\video\Burning Video + + + Irrlicht\video\Burning Video + + + Irrlicht\irr + + + Irrlicht\irr + + + Irrlicht\irr + + + Irrlicht\irr + + + Irrlicht\irr + + + Irrlicht\irr + + + Irrlicht\irr\extern + + + Irrlicht\irr\extern + + + Irrlicht\irr\extern\zlib + + + Irrlicht\irr\extern\zlib + + + Irrlicht\irr\extern\zlib + + + Irrlicht\irr\extern\zlib + + + Irrlicht\irr\extern\zlib + + + Irrlicht\irr\extern\zlib + + + Irrlicht\irr\extern\zlib + + + Irrlicht\irr\extern\zlib + + + Irrlicht\irr\extern\zlib + + + Irrlicht\irr\extern\jpeglib + + + Irrlicht\irr\extern\jpeglib + + + Irrlicht\irr\extern\jpeglib + + + Irrlicht\irr\extern\jpeglib + + + Irrlicht\irr\extern\jpeglib + + + Irrlicht\irr\extern\jpeglib + + + Irrlicht\irr\extern\jpeglib + + + Irrlicht\irr\extern\jpeglib + + + Irrlicht\irr\extern\jpeglib + + + Irrlicht\irr\extern\jpeglib + + + Irrlicht\irr\extern\libpng + + + Irrlicht\irr\extern\libpng + + + Irrlicht\irr\extern\aesGladman + + + Irrlicht\irr\extern\aesGladman + + + Irrlicht\irr\extern\aesGladman + + + Irrlicht\irr\extern\aesGladman + + + Irrlicht\irr\extern\aesGladman + + + Irrlicht\irr\extern\aesGladman + + + Irrlicht\irr\extern\aesGladman + + + Irrlicht\irr\extern\aesGladman + + + Irrlicht\irr\extern\bzip2 + + + Irrlicht\irr\extern\bzip2 + + + Irrlicht\irr\device + + + Irrlicht\irr\device + + + Irrlicht\irr\device + + + Irrlicht\irr\device + + + Irrlicht\irr\device + + + Irrlicht\irr\device + + + Irrlicht\io + + + Irrlicht\io + + + Irrlicht\io + + + Irrlicht\io + + + Irrlicht\io + + + Irrlicht\io + + + Irrlicht\io + + + Irrlicht\io + + + Irrlicht\io + + + Irrlicht\io + + + Irrlicht\io + + + Irrlicht\io + + + Irrlicht\io + + + Irrlicht\io + + + Irrlicht\io + + + Irrlicht\io + + + Irrlicht\io + + + Irrlicht\io + + + Irrlicht\gui + + + Irrlicht\gui + + + Irrlicht\gui + + + Irrlicht\gui + + + Irrlicht\gui + + + Irrlicht\gui + + + Irrlicht\gui + + + Irrlicht\gui + + + Irrlicht\gui + + + Irrlicht\gui + + + Irrlicht\gui + + + Irrlicht\gui + + + Irrlicht\gui + + + Irrlicht\gui + + + Irrlicht\gui + + + Irrlicht\gui + + + Irrlicht\gui + + + Irrlicht\gui + + + Irrlicht\gui + + + Irrlicht\gui + + + Irrlicht\gui + + + Irrlicht\gui + + + Irrlicht\gui + + + Irrlicht\gui + + + Irrlicht\gui + + + Irrlicht\gui + + + Irrlicht\gui + + + Irrlicht\gui + + + Irrlicht\gui + + + Irrlicht\gui + + + include\scene + + + + Irrlicht\scene\loaders + + + include\scene + + + Irrlicht\scene\loaders + + + include\video + + + include + + + include\video + + + include\video + + + Irrlicht\video\Direct3D9 + + + Irrlicht\scene\writers + + + Irrlicht\scene + + + Irrlicht\video\OpenGL + + + Irrlicht\video\OpenGL + + + Irrlicht\video\OpenGL + + + Irrlicht\video\OpenGL + + + Irrlicht\video\OpenGL + + + Irrlicht\video\OpenGL + + + Irrlicht\video\OpenGL + + + Irrlicht\video\OpenGL + + + Irrlicht\video\OpenGL + + + Irrlicht\video\OpenGL Core + + + Irrlicht\video\OpenGL Core + + + Irrlicht\video\OpenGL Core + + + Irrlicht\video\OpenGL Core + + + Irrlicht\video + + + Irrlicht\video + + + Irrlicht\video\OpenGL ES2.x + + + Irrlicht\video\OpenGL ES2.x + + + Irrlicht\video\OpenGL ES2.x + + + Irrlicht\video\OpenGL ES2.x + + + Irrlicht\video\OpenGL ES2.x + + + Irrlicht\video\OpenGL ES2.x + + + Irrlicht\video\OpenGL ES2.x + + + Irrlicht\video\OpenGL ES2.x + + + Irrlicht\video\OpenGL ES1.x + + + Irrlicht\video\OpenGL ES1.x + + + Irrlicht\video\OpenGL ES1.x + + + Irrlicht\video\OpenGL ES1.x + + + + + doc + + + doc + + + + + Irrlicht\scene + + + Irrlicht\scene + + + Irrlicht\scene + + + Irrlicht\scene + + + Irrlicht\scene + + + Irrlicht\scene + + + Irrlicht\scene\loaders + + + Irrlicht\scene\loaders + + + Irrlicht\scene\loaders + + + Irrlicht\scene\loaders + + + Irrlicht\scene\loaders + + + Irrlicht\scene\loaders + + + Irrlicht\scene\loaders + + + Irrlicht\scene\loaders + + + Irrlicht\scene\loaders + + + Irrlicht\scene\loaders + + + Irrlicht\scene\loaders + + + Irrlicht\scene\loaders + + + Irrlicht\scene\loaders + + + Irrlicht\scene\loaders + + + Irrlicht\scene\loaders + + + Irrlicht\scene\loaders + + + Irrlicht\scene\loaders + + + Irrlicht\scene\loaders + + + Irrlicht\scene\loaders + + + Irrlicht\scene\loaders + + + Irrlicht\scene\loaders + + + Irrlicht\scene\loaders + + + Irrlicht\scene\loaders + + + Irrlicht\scene\loaders + + + Irrlicht\scene\loaders + + + Irrlicht\scene\sceneNodes + + + Irrlicht\scene\sceneNodes + + + Irrlicht\scene\sceneNodes + + + Irrlicht\scene\sceneNodes + + + Irrlicht\scene\sceneNodes + + + Irrlicht\scene\sceneNodes + + + Irrlicht\scene\sceneNodes + + + Irrlicht\scene\sceneNodes + + + Irrlicht\scene\sceneNodes + + + Irrlicht\scene\sceneNodes + + + Irrlicht\scene\sceneNodes + + + Irrlicht\scene\sceneNodes + + + Irrlicht\scene\sceneNodes + + + Irrlicht\scene\sceneNodes + + + Irrlicht\scene\sceneNodes + + + Irrlicht\scene\sceneNodes + + + Irrlicht\scene\sceneNodes + + + Irrlicht\scene\sceneNodes + + + Irrlicht\scene\sceneNodes + + + Irrlicht\scene\particleSystem + + + Irrlicht\scene\particleSystem + + + Irrlicht\scene\particleSystem + + + Irrlicht\scene\particleSystem + + + Irrlicht\scene\particleSystem + + + Irrlicht\scene\particleSystem + + + Irrlicht\scene\particleSystem + + + Irrlicht\scene\particleSystem + + + Irrlicht\scene\particleSystem + + + Irrlicht\scene\particleSystem + + + Irrlicht\scene\particleSystem + + + Irrlicht\scene\particleSystem + + + Irrlicht\scene\particleSystem + + + Irrlicht\scene\collision + + + Irrlicht\scene\collision + + + Irrlicht\scene\collision + + + Irrlicht\scene\collision + + + Irrlicht\scene\collision + + + Irrlicht\scene\collision + + + Irrlicht\scene\animators + + + Irrlicht\scene\animators + + + Irrlicht\scene\animators + + + Irrlicht\scene\animators + + + Irrlicht\scene\animators + + + Irrlicht\scene\animators + + + Irrlicht\scene\animators + + + Irrlicht\scene\animators + + + Irrlicht\scene\animators + + + Irrlicht\scene\writers + + + Irrlicht\scene\writers + + + Irrlicht\scene\writers + + + Irrlicht\scene\writers + + + Irrlicht\scene\writers + + + Irrlicht\video + + + Irrlicht\video\Software + + + Irrlicht\video\Software + + + Irrlicht\video\Software + + + Irrlicht\video\Software + + + Irrlicht\video\Software + + + Irrlicht\video\Software + + + Irrlicht\video\Software + + + Irrlicht\video\Software + + + Irrlicht\video\Software + + + Irrlicht\video\Software + + + Irrlicht\video\Software + + + Irrlicht\video\Software + + + Irrlicht\video\Software + + + Irrlicht\video\Null + + + Irrlicht\video\Null + + + Irrlicht\video\Null + + + Irrlicht\video\Null + + + Irrlicht\video\Null\Writer + + + Irrlicht\video\Null\Writer + + + Irrlicht\video\Null\Writer + + + Irrlicht\video\Null\Writer + + + Irrlicht\video\Null\Writer + + + Irrlicht\video\Null\Writer + + + Irrlicht\video\Null\Writer + + + Irrlicht\video\Null\Loader + + + Irrlicht\video\Null\Loader + + + Irrlicht\video\Null\Loader + + + Irrlicht\video\Null\Loader + + + Irrlicht\video\Null\Loader + + + Irrlicht\video\Null\Loader + + + Irrlicht\video\Null\Loader + + + Irrlicht\video\Null\Loader + + + Irrlicht\video\Null\Loader + + + Irrlicht\video\Null\Loader + + + Irrlicht\video\Null\Loader + + + Irrlicht\video\Direct3D9 + + + Irrlicht\video\Direct3D9 + + + Irrlicht\video\Direct3D9 + + + Irrlicht\video\Direct3D9 + + + Irrlicht\video\Direct3D9 + + + Irrlicht\video\Direct3D9 + + + Irrlicht\video\Burning Video + + + Irrlicht\video\Burning Video + + + Irrlicht\video\Burning Video + + + Irrlicht\video\Burning Video + + + Irrlicht\video\Burning Video + + + Irrlicht\video\Burning Video + + + Irrlicht\video\Burning Video + + + Irrlicht\video\Burning Video + + + Irrlicht\video\Burning Video + + + Irrlicht\video\Burning Video + + + Irrlicht\video\Burning Video + + + Irrlicht\video\Burning Video + + + Irrlicht\video\Burning Video + + + Irrlicht\video\Burning Video + + + Irrlicht\video\Burning Video + + + Irrlicht\video\Burning Video + + + Irrlicht\video\Burning Video + + + Irrlicht\video\Burning Video + + + Irrlicht\video\Burning Video + + + Irrlicht\video\Burning Video + + + Irrlicht\video\Burning Video + + + Irrlicht\video\Burning Video + + + Irrlicht\video\Burning Video + + + Irrlicht\video\Burning Video + + + Irrlicht\video\Burning Video + + + Irrlicht\irr + + + Irrlicht\irr + + + Irrlicht\irr + + + Irrlicht\irr + + + Irrlicht\irr + + + Irrlicht\irr + + + Irrlicht\irr + + + Irrlicht\irr\extern + + + Irrlicht\irr\extern\zlib + + + Irrlicht\irr\extern\zlib + + + Irrlicht\irr\extern\zlib + + + Irrlicht\irr\extern\zlib + + + Irrlicht\irr\extern\zlib + + + Irrlicht\irr\extern\zlib + + + Irrlicht\irr\extern\zlib + + + Irrlicht\irr\extern\zlib + + + Irrlicht\irr\extern\zlib + + + Irrlicht\irr\extern\zlib + + + Irrlicht\irr\extern\jpeglib + + + Irrlicht\irr\extern\jpeglib + + + Irrlicht\irr\extern\jpeglib + + + Irrlicht\irr\extern\jpeglib + + + Irrlicht\irr\extern\jpeglib + + + Irrlicht\irr\extern\jpeglib + + + Irrlicht\irr\extern\jpeglib + + + Irrlicht\irr\extern\jpeglib + + + Irrlicht\irr\extern\jpeglib + + + Irrlicht\irr\extern\jpeglib + + + Irrlicht\irr\extern\jpeglib + + + Irrlicht\irr\extern\jpeglib + + + Irrlicht\irr\extern\jpeglib + + + Irrlicht\irr\extern\jpeglib + + + Irrlicht\irr\extern\jpeglib + + + Irrlicht\irr\extern\jpeglib + + + Irrlicht\irr\extern\jpeglib + + + Irrlicht\irr\extern\jpeglib + + + Irrlicht\irr\extern\jpeglib + + + Irrlicht\irr\extern\jpeglib + + + Irrlicht\irr\extern\jpeglib + + + Irrlicht\irr\extern\jpeglib + + + Irrlicht\irr\extern\jpeglib + + + Irrlicht\irr\extern\jpeglib + + + Irrlicht\irr\extern\jpeglib + + + Irrlicht\irr\extern\jpeglib + + + Irrlicht\irr\extern\jpeglib + + + Irrlicht\irr\extern\jpeglib + + + Irrlicht\irr\extern\jpeglib + + + Irrlicht\irr\extern\jpeglib + + + Irrlicht\irr\extern\jpeglib + + + Irrlicht\irr\extern\jpeglib + + + Irrlicht\irr\extern\jpeglib + + + Irrlicht\irr\extern\jpeglib + + + Irrlicht\irr\extern\jpeglib + + + Irrlicht\irr\extern\jpeglib + + + Irrlicht\irr\extern\jpeglib + + + Irrlicht\irr\extern\jpeglib + + + Irrlicht\irr\extern\jpeglib + + + Irrlicht\irr\extern\jpeglib + + + Irrlicht\irr\extern\jpeglib + + + Irrlicht\irr\extern\jpeglib + + + Irrlicht\irr\extern\jpeglib + + + Irrlicht\irr\extern\jpeglib + + + Irrlicht\irr\extern\jpeglib + + + Irrlicht\irr\extern\jpeglib + + + Irrlicht\irr\extern\libpng + + + Irrlicht\irr\extern\libpng + + + Irrlicht\irr\extern\libpng + + + Irrlicht\irr\extern\libpng + + + Irrlicht\irr\extern\libpng + + + Irrlicht\irr\extern\libpng + + + Irrlicht\irr\extern\libpng + + + Irrlicht\irr\extern\libpng + + + Irrlicht\irr\extern\libpng + + + Irrlicht\irr\extern\libpng + + + Irrlicht\irr\extern\libpng + + + Irrlicht\irr\extern\libpng + + + Irrlicht\irr\extern\libpng + + + Irrlicht\irr\extern\libpng + + + Irrlicht\irr\extern\libpng + + + Irrlicht\irr\extern\aesGladman + + + Irrlicht\irr\extern\aesGladman + + + Irrlicht\irr\extern\aesGladman + + + Irrlicht\irr\extern\aesGladman + + + Irrlicht\irr\extern\aesGladman + + + Irrlicht\irr\extern\aesGladman + + + Irrlicht\irr\extern\aesGladman + + + Irrlicht\irr\extern\aesGladman + + + Irrlicht\irr\extern\aesGladman + + + Irrlicht\irr\extern\bzip2 + + + Irrlicht\irr\extern\bzip2 + + + Irrlicht\irr\extern\bzip2 + + + Irrlicht\irr\extern\bzip2 + + + Irrlicht\irr\extern\bzip2 + + + Irrlicht\irr\extern\bzip2 + + + Irrlicht\irr\extern\bzip2 + + + Irrlicht\irr\device + + + Irrlicht\irr\device + + + Irrlicht\irr\device + + + Irrlicht\irr\device + + + Irrlicht\irr\device + + + Irrlicht\irr\device + + + Irrlicht\io + + + Irrlicht\io + + + Irrlicht\io + + + Irrlicht\io + + + Irrlicht\io + + + Irrlicht\io + + + Irrlicht\io + + + Irrlicht\io + + + Irrlicht\io + + + Irrlicht\io + + + Irrlicht\io + + + Irrlicht\io + + + Irrlicht\io + + + Irrlicht\io + + + Irrlicht\io + + + Irrlicht\io + + + Irrlicht\gui + + + Irrlicht\gui + + + Irrlicht\gui + + + Irrlicht\gui + + + Irrlicht\gui + + + Irrlicht\gui + + + Irrlicht\gui + + + Irrlicht\gui + + + Irrlicht\gui + + + Irrlicht\gui + + + Irrlicht\gui + + + Irrlicht\gui + + + Irrlicht\gui + + + Irrlicht\gui + + + Irrlicht\gui + + + Irrlicht\gui + + + Irrlicht\gui + + + Irrlicht\gui + + + Irrlicht\gui + + + Irrlicht\gui + + + Irrlicht\gui + + + Irrlicht\gui + + + Irrlicht\gui + + + Irrlicht\gui + + + Irrlicht\gui + + + Irrlicht\gui + + + Irrlicht\gui + + + Irrlicht\gui + + + Irrlicht\gui + + + Irrlicht\scene\loaders + + + Irrlicht\scene\loaders + + + Irrlicht\video\Direct3D9 + + + Irrlicht\scene\writers + + + Irrlicht\video\OpenGL + + + Irrlicht\video\OpenGL + + + Irrlicht\video\OpenGL + + + Irrlicht\video\OpenGL + + + Irrlicht\video\OpenGL + + + Irrlicht\video\OpenGL + + + Irrlicht\video\OpenGL + + + Irrlicht\video + + + Irrlicht\video + + + Irrlicht\video\OpenGL ES2.x + + + Irrlicht\video\OpenGL ES2.x + + + Irrlicht\video\OpenGL ES2.x + + + Irrlicht\video\OpenGL ES2.x + + + Irrlicht\video\OpenGL ES2.x + + + Irrlicht\video\OpenGL ES2.x + + + Irrlicht\video\OpenGL ES2.x + + + Irrlicht\video\OpenGL ES1.x + + + Irrlicht\video\OpenGL ES1.x + + + + + + \ No newline at end of file diff --git a/source/Irrlicht/Irrlicht14.0.sln b/source/Irrlicht/Irrlicht14.0.sln new file mode 100644 index 00000000..84f8862a --- /dev/null +++ b/source/Irrlicht/Irrlicht14.0.sln @@ -0,0 +1,58 @@ + +Microsoft Visual Studio Solution File, Format Version 14.00 +# Visual Studio 14 +VisualStudioVersion = 14.0.23107.0 +MinimumVisualStudioVersion = 10.0.40219.1 +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Irrlicht", "Irrlicht14.0.vcxproj", "{E08E042A-6C45-411B-92BE-3CC31331019F}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Win32 = Debug|Win32 + Debug|x64 = Debug|x64 + Release - Fast FPU|Win32 = Release - Fast FPU|Win32 + Release - Fast FPU|x64 = Release - Fast FPU|x64 + Release|Win32 = Release|Win32 + Release|x64 = Release|x64 + SDL-Debug|Win32 = SDL-Debug|Win32 + SDL-Debug|x64 = SDL-Debug|x64 + Static lib - Debug|Win32 = Static lib - Debug|Win32 + Static lib - Debug|x64 = Static lib - Debug|x64 + Static lib - Release - Fast FPU|Win32 = Static lib - Release - Fast FPU|Win32 + Static lib - Release - Fast FPU|x64 = Static lib - Release - Fast FPU|x64 + Static lib - Release|Win32 = Static lib - Release|Win32 + Static lib - Release|x64 = Static lib - Release|x64 + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {E08E042A-6C45-411B-92BE-3CC31331019F}.Debug|Win32.ActiveCfg = Debug|Win32 + {E08E042A-6C45-411B-92BE-3CC31331019F}.Debug|Win32.Build.0 = Debug|Win32 + {E08E042A-6C45-411B-92BE-3CC31331019F}.Debug|x64.ActiveCfg = Debug|x64 + {E08E042A-6C45-411B-92BE-3CC31331019F}.Debug|x64.Build.0 = Debug|x64 + {E08E042A-6C45-411B-92BE-3CC31331019F}.Release - Fast FPU|Win32.ActiveCfg = Release - Fast FPU|Win32 + {E08E042A-6C45-411B-92BE-3CC31331019F}.Release - Fast FPU|Win32.Build.0 = Release - Fast FPU|Win32 + {E08E042A-6C45-411B-92BE-3CC31331019F}.Release - Fast FPU|x64.ActiveCfg = Release - Fast FPU|x64 + {E08E042A-6C45-411B-92BE-3CC31331019F}.Release - Fast FPU|x64.Build.0 = Release - Fast FPU|x64 + {E08E042A-6C45-411B-92BE-3CC31331019F}.Release|Win32.ActiveCfg = Release|Win32 + {E08E042A-6C45-411B-92BE-3CC31331019F}.Release|Win32.Build.0 = Release|Win32 + {E08E042A-6C45-411B-92BE-3CC31331019F}.Release|x64.ActiveCfg = Release|x64 + {E08E042A-6C45-411B-92BE-3CC31331019F}.Release|x64.Build.0 = Release|x64 + {E08E042A-6C45-411B-92BE-3CC31331019F}.SDL-Debug|Win32.ActiveCfg = SDL-Debug|Win32 + {E08E042A-6C45-411B-92BE-3CC31331019F}.SDL-Debug|Win32.Build.0 = SDL-Debug|Win32 + {E08E042A-6C45-411B-92BE-3CC31331019F}.SDL-Debug|x64.ActiveCfg = SDL-Debug|x64 + {E08E042A-6C45-411B-92BE-3CC31331019F}.SDL-Debug|x64.Build.0 = SDL-Debug|x64 + {E08E042A-6C45-411B-92BE-3CC31331019F}.Static lib - Debug|Win32.ActiveCfg = Static lib - Debug|Win32 + {E08E042A-6C45-411B-92BE-3CC31331019F}.Static lib - Debug|Win32.Build.0 = Static lib - Debug|Win32 + {E08E042A-6C45-411B-92BE-3CC31331019F}.Static lib - Debug|x64.ActiveCfg = Static lib - Debug|x64 + {E08E042A-6C45-411B-92BE-3CC31331019F}.Static lib - Debug|x64.Build.0 = Static lib - Debug|x64 + {E08E042A-6C45-411B-92BE-3CC31331019F}.Static lib - Release - Fast FPU|Win32.ActiveCfg = Static lib - Release - Fast FPU|Win32 + {E08E042A-6C45-411B-92BE-3CC31331019F}.Static lib - Release - Fast FPU|Win32.Build.0 = Static lib - Release - Fast FPU|Win32 + {E08E042A-6C45-411B-92BE-3CC31331019F}.Static lib - Release - Fast FPU|x64.ActiveCfg = Static lib - Release - Fast FPU|x64 + {E08E042A-6C45-411B-92BE-3CC31331019F}.Static lib - Release - Fast FPU|x64.Build.0 = Static lib - Release - Fast FPU|x64 + {E08E042A-6C45-411B-92BE-3CC31331019F}.Static lib - Release|Win32.ActiveCfg = Static lib - Release|Win32 + {E08E042A-6C45-411B-92BE-3CC31331019F}.Static lib - Release|Win32.Build.0 = Static lib - Release|Win32 + {E08E042A-6C45-411B-92BE-3CC31331019F}.Static lib - Release|x64.ActiveCfg = Static lib - Release|x64 + {E08E042A-6C45-411B-92BE-3CC31331019F}.Static lib - Release|x64.Build.0 = Static lib - Release|x64 + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection +EndGlobal diff --git a/source/Irrlicht/Irrlicht14.0.vcxproj b/source/Irrlicht/Irrlicht14.0.vcxproj new file mode 100644 index 00000000..89f9394e --- /dev/null +++ b/source/Irrlicht/Irrlicht14.0.vcxproj @@ -0,0 +1,1604 @@ + + + + + Debug + Win32 + + + Debug + x64 + + + Release - Fast FPU + Win32 + + + Release - Fast FPU + x64 + + + Release + Win32 + + + Release + x64 + + + SDL-Debug + Win32 + + + SDL-Debug + x64 + + + Static lib - Debug + Win32 + + + Static lib - Debug + x64 + + + Static lib - Release - Fast FPU + Win32 + + + Static lib - Release - Fast FPU + x64 + + + Static lib - Release + Win32 + + + Static lib - Release + x64 + + + + Irrlicht + {E08E042A-6C45-411B-92BE-3CC31331019F} + Irrlicht + + + + DynamicLibrary + NotSet + v140 + + + DynamicLibrary + NotSet + v140 + + + StaticLibrary + MultiByte + true + v140 + + + StaticLibrary + MultiByte + true + v140 + + + StaticLibrary + MultiByte + true + v140 + + + StaticLibrary + MultiByte + true + v140 + + + StaticLibrary + NotSet + v140 + + + StaticLibrary + NotSet + v140 + + + DynamicLibrary + MultiByte + true + v140 + + + DynamicLibrary + MultiByte + true + v140 + + + DynamicLibrary + MultiByte + true + v140 + + + DynamicLibrary + MultiByte + true + v140 + + + DynamicLibrary + NotSet + v140 + + + DynamicLibrary + NotSet + v140 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + <_ProjectFileVersion>10.0.30319.1 + ..\..\bin\Win32-VisualStudio\ + ..\..\bin\Win64-VisualStudio\ + ..\..\bin\Win32-VisualStudio\ + ..\..\bin\Win64-VisualStudio\ + obj\$(Configuration)\ + obj\$(Configuration)64\ + false + false + ..\..\bin\Win32-VisualStudio\ + ..\..\bin\Win64-VisualStudio\ + obj\$(Configuration)\ + obj\$(Configuration)64\ + false + false + ..\..\lib\Win32-VisualStudio\ + ..\..\lib\Win64-VisualStudio\ + obj\$(Configuration)\ + obj\$(Configuration)64\ + ..\..\lib\Win32-VisualStudio\ + ..\..\lib\Win64-VisualStudio\ + obj\$(Configuration)\ + obj\$(Configuration)64\ + ..\..\lib\Win32-VisualStudio\ + ..\..\lib\Win64-VisualStudio\ + obj\$(Configuration)\ + obj\$(Configuration)64\ + ..\..\bin\Win32-VisualStudio\ + ..\..\bin\Win64-VisualStudio\ + obj\$(Configuration)\ + obj\$(Configuration)64\ + true + true + AllRules.ruleset + AllRules.ruleset + + + + + AllRules.ruleset + AllRules.ruleset + + + + + AllRules.ruleset + AllRules.ruleset + + + + + AllRules.ruleset + AllRules.ruleset + + + + + AllRules.ruleset + AllRules.ruleset + + + + + AllRules.ruleset + AllRules.ruleset + + + + + AllRules.ruleset + AllRules.ruleset + + + + + $(OGLES_SDK)include;$(DXSDK_DIR)include;$(IncludePath) + $(OGLES_SDK)include;$(DXSDK_DIR)include;$(IncludePath) + obj\$(Configuration)\ + obj\$(Configuration)64\ + true + true + $(OGLES_SDK)include;$(DXSDK_DIR)include;$(IncludePath) + $(OGLES_SDK)include;$(DXSDK_DIR)include;$(IncludePath) + $(OGLES_SDK)include;$(DXSDK_DIR)include;$(IncludePath) + $(OGLES_SDK)include;$(DXSDK_DIR)include;$(IncludePath) + $(OGLES_SDK)include;$(DXSDK_DIR)include;$(IncludePath) + $(OGLES_SDK)include;$(DXSDK_DIR)include;$(IncludePath) + $(OGLES_SDK)include;$(DXSDK_DIR)include;$(IncludePath) + $(OGLES_SDK)include;$(DXSDK_DIR)include;$(IncludePath) + $(OGLES_SDK)include;$(DXSDK_DIR)include;$(IncludePath) + $(OGLES_SDK)include;$(DXSDK_DIR)include;$(IncludePath) + $(OGLES_SDK)include;$(DXSDK_DIR)include;$(IncludePath) + $(OGLES_SDK)include;$(DXSDK_DIR)include;$(IncludePath) + $(OGLES_SDK)lib\x86;$(DXSDK_DIR)Lib\x86;$(LibraryPath) + $(OGLES_SDK)lib\x86;$(DXSDK_DIR)Lib\x86;$(LibraryPath) + $(OGLES_SDK)lib\x86;$(DXSDK_DIR)Lib\x86;$(LibraryPath) + $(OGLES_SDK)lib\x86;$(DXSDK_DIR)Lib\x86;$(LibraryPath) + $(OGLES_SDK)lib\x86;$(DXSDK_DIR)Lib\x86;$(LibraryPath) + $(OGLES_SDK)lib\x86;$(DXSDK_DIR)Lib\x86;$(LibraryPath) + $(OGLES_SDK)lib\x86;$(DXSDK_DIR)Lib\x86;$(LibraryPath) + $(OGLES_SDK)lib\x64;$(DXSDK_DIR)Lib\x64;$(LibraryPath);$(VSInstallDir);$(VSInstallDir)lib\amd64 + $(OGLES_SDK)lib\x64;$(DXSDK_DIR)Lib\x64;$(LibraryPath);$(VSInstallDir);$(VSInstallDir)lib\amd64 + $(OGLES_SDK)lib\x64;$(DXSDK_DIR)Lib\x64;$(LibraryPath);$(VSInstallDir);$(VSInstallDir)lib\amd64 + $(OGLES_SDK)lib\x64;$(DXSDK_DIR)Lib\x64;$(LibraryPath);$(VSInstallDir);$(VSInstallDir)lib\amd64 + $(OGLES_SDK)lib\x64;$(DXSDK_DIR)Lib\x64;$(LibraryPath);$(VSInstallDir);$(VSInstallDir)lib\amd64 + $(OGLES_SDK)lib\x64;$(DXSDK_DIR)Lib\x64;$(LibraryPath);$(VSInstallDir);$(VSInstallDir)lib\amd64 + $(OGLES_SDK)lib\x64;$(DXSDK_DIR)Lib\x64;$(LibraryPath);$(VSInstallDir);$(VSInstallDir)lib\amd64 + + + + + _DEBUG;%(PreprocessorDefinitions) + true + true + Win32 + .\..\Debug/Irrlicht.tlb + + + ..\..\include;zlib;%(AdditionalIncludeDirectories) + WIN32;_DEBUG;_WINDOWS;_USRDLL;IRRLICHT_EXPORTS;_CRT_SECURE_NO_DEPRECATE;%(PreprocessorDefinitions); _ITERATOR_DEBUG_LEVEL=0 + false + EnableFastChecks + MultiThreadedDebug + false + false + Level3 + Disabled + 4577 + + + _DEBUG;%(PreprocessorDefinitions) + 0x0c07 + + + true + + + /MACHINE:I386 %(AdditionalOptions) + kernel32.lib;user32.lib;gdi32.lib;winspool.lib;comdlg32.lib;advapi32.lib;shell32.lib;ole32.lib;oleaut32.lib;uuid.lib;opengl32.lib;%(AdditionalDependencies) + ..\..\bin\Win32-visualstudio\Irrlicht.dll + %(AdditionalLibraryDirectories) + libci.lib;%(IgnoreSpecificDefaultLibraries) + true + + + ..\..\lib\Win32-visualstudio\Irrlicht.lib + 1.9 + + + + + _DEBUG;%(PreprocessorDefinitions) + true + true + .\..\Debug/Irrlicht.tlb + + + ..\..\include;zlib;%(AdditionalIncludeDirectories) + WIN32;WIN64;_DEBUG;_WINDOWS;_USRDLL;IRRLICHT_EXPORTS;_CRT_SECURE_NO_DEPRECATE;%(PreprocessorDefinitions); _ITERATOR_DEBUG_LEVEL=0 + false + EnableFastChecks + MultiThreadedDebug + false + false + Level3 + Disabled + 4577 + + + _DEBUG;%(PreprocessorDefinitions) + 0x0c07 + + + true + + + kernel32.lib;user32.lib;gdi32.lib;winspool.lib;comdlg32.lib;advapi32.lib;shell32.lib;ole32.lib;oleaut32.lib;uuid.lib;opengl32.lib;winmm.lib;%(AdditionalDependencies) + ..\..\bin\Win64-visualstudio\Irrlicht.dll + %(AdditionalLibraryDirectories) + libci.lib;%(IgnoreSpecificDefaultLibraries) + true + + + ..\..\lib\Win64-visualstudio\Irrlicht.lib + + + + + NDEBUG;%(PreprocessorDefinitions) + true + true + Win32 + .\..\Release/Irrlicht.tlb + + + MaxSpeed + OnlyExplicitInline + ..\..\include;zlib;%(AdditionalIncludeDirectories) + WIN32;NDEBUG;_WINDOWS;_USRDLL;IRRLICHT_EXPORTS;_CRT_SECURE_NO_DEPRECATE;%(PreprocessorDefinitions) + true + false + MultiThreaded + false + true + Level3 + + + Default + false + 4577 + + + NDEBUG;%(PreprocessorDefinitions) + 0x0c07 + + + /MACHINE:I386 %(AdditionalOptions) + kernel32.lib;user32.lib;gdi32.lib;opengl32.lib;%(AdditionalDependencies) + ..\..\bin\Win32-visualstudio\Irrlicht.dll + libci.lib;%(IgnoreSpecificDefaultLibraries) + false + + + ..\..\lib\Win32-visualstudio\Irrlicht.lib + 1.9 + + + + + NDEBUG;%(PreprocessorDefinitions) + true + true + .\..\Release/Irrlicht.tlb + + + MaxSpeed + OnlyExplicitInline + ..\..\include;zlib;%(AdditionalIncludeDirectories) + WIN32;WIN64;NDEBUG;_WINDOWS;_USRDLL;IRRLICHT_EXPORTS;_CRT_SECURE_NO_DEPRECATE;%(PreprocessorDefinitions) + true + false + MultiThreaded + false + true + Level3 + + + Default + false + 4577 + + + NDEBUG;%(PreprocessorDefinitions) + 0x0c07 + + + kernel32.lib;user32.lib;gdi32.lib;opengl32.lib;winmm.lib;%(AdditionalDependencies) + ..\..\bin\Win64-visualstudio\Irrlicht.dll + libci.lib;%(IgnoreSpecificDefaultLibraries) + false + + + ..\..\lib\Win64-visualstudio\Irrlicht.lib + + + + + NDEBUG;%(PreprocessorDefinitions) + true + true + Win32 + .\..\Release/Irrlicht.tlb + + + Full + AnySuitable + true + Speed + true + ..\..\include;zlib;%(AdditionalIncludeDirectories) + WIN32;NDEBUG;_WINDOWS;_USRDLL;IRRLICHT_EXPORTS;_CRT_SECURE_NO_DEPRECATE;%(PreprocessorDefinitions) + true + false + MultiThreaded + Default + false + false + StreamingSIMDExtensions2 + Fast + false + Level3 + + + false + 4577 + + + NDEBUG;%(PreprocessorDefinitions) + 0x0c07 + + + /MACHINE:I386 %(AdditionalOptions) + kernel32.lib;user32.lib;gdi32.lib;winspool.lib;comdlg32.lib;advapi32.lib;shell32.lib;ole32.lib;oleaut32.lib;uuid.lib;opengl32.lib;%(AdditionalDependencies) + ..\..\bin\Win32-visualstudio\Irrlicht.dll + libci.lib;%(IgnoreSpecificDefaultLibraries) + false + true + + + ..\..\lib\Win32-visualstudio\Irrlicht.lib + Windows + 1.9 + + + + + NDEBUG;%(PreprocessorDefinitions) + true + true + .\..\Release/Irrlicht.tlb + + + Full + AnySuitable + true + Speed + true + ..\..\include;zlib;%(AdditionalIncludeDirectories) + WIN32;WIN64;NDEBUG;_WINDOWS;_USRDLL;IRRLICHT_EXPORTS;_CRT_SECURE_NO_DEPRECATE;%(PreprocessorDefinitions) + true + false + MultiThreaded + Default + false + false + StreamingSIMDExtensions2 + Fast + false + Level3 + + + false + 4577 + + + NDEBUG;%(PreprocessorDefinitions) + 0x0c07 + + + kernel32.lib;user32.lib;gdi32.lib;winspool.lib;comdlg32.lib;advapi32.lib;shell32.lib;ole32.lib;oleaut32.lib;uuid.lib;opengl32.lib;winmm.lib;%(AdditionalDependencies) + ..\..\bin\Win64-visualstudio\Irrlicht.dll + libci.lib;%(IgnoreSpecificDefaultLibraries) + false + true + + + ..\..\lib\Win64-visualstudio\Irrlicht.lib + Windows + + + + + _DEBUG;%(PreprocessorDefinitions) + true + true + Win32 + .\..\Debug/Irrlicht.tlb + + + Disabled + ..\..\include;zlib;%(AdditionalIncludeDirectories) + WIN32;_DEBUG;_WINDOWS;_USRDLL;_IRR_STATIC_LIB_;_CRT_SECURE_NO_DEPRECATE;%(PreprocessorDefinitions); _ITERATOR_DEBUG_LEVEL=0 + false + EnableFastChecks + MultiThreadedDebug + false + false + Level3 + 4577 + + + _DEBUG;%(PreprocessorDefinitions) + 0x0c07 + + + winmm.lib;%(AdditionalDependencies) + ..\..\lib\Win32-visualstudio\Irrlicht.lib + + + + + _DEBUG;%(PreprocessorDefinitions) + true + true + .\..\Debug/Irrlicht.tlb + + + Disabled + ..\..\include;zlib;%(AdditionalIncludeDirectories) + WIN32;WIN64;_DEBUG;_WINDOWS;_USRDLL;_IRR_STATIC_LIB_;_CRT_SECURE_NO_DEPRECATE;%(PreprocessorDefinitions); _ITERATOR_DEBUG_LEVEL=0 + false + EnableFastChecks + MultiThreadedDebug + false + false + Level3 + 4577 + + + _DEBUG;%(PreprocessorDefinitions) + 0x0c07 + + + winmm.lib;%(AdditionalDependencies) + ..\..\lib\Win64-visualstudio\Irrlicht.lib + MachineX64 + + + + + NDEBUG;%(PreprocessorDefinitions) + true + true + Win32 + .\..\Release/Irrlicht.tlb + + + MaxSpeed + OnlyExplicitInline + false + false + ..\..\include;zlib;%(AdditionalIncludeDirectories) + WIN32;NDEBUG;_WINDOWS;_USRDLL;_IRR_STATIC_LIB_;_CRT_SECURE_NO_DEPRECATE;%(PreprocessorDefinitions) + true + false + MultiThreaded + false + true + Level3 + + + false + 4577 + + + NDEBUG;%(PreprocessorDefinitions) + 0x0c07 + + + winmm.lib;%(AdditionalDependencies) + ..\..\lib\Win32-visualstudio\Irrlicht.lib + + + + + NDEBUG;%(PreprocessorDefinitions) + true + true + .\..\Release/Irrlicht.tlb + + + MaxSpeed + OnlyExplicitInline + false + false + ..\..\include;zlib;%(AdditionalIncludeDirectories) + WIN32;WIN64;NDEBUG;_WINDOWS;_USRDLL;_IRR_STATIC_LIB_;_CRT_SECURE_NO_DEPRECATE;%(PreprocessorDefinitions) + true + false + MultiThreaded + false + true + Level3 + + + false + 4577 + + + NDEBUG;%(PreprocessorDefinitions) + 0x0c07 + + + winmm.lib;%(AdditionalDependencies) + ..\..\lib\Win64-visualstudio\Irrlicht.lib + MachineX64 + + + + + NDEBUG;%(PreprocessorDefinitions) + true + true + Win32 + .\..\Release/Irrlicht.tlb + + + Full + AnySuitable + true + Speed + true + ..\..\include;zlib;%(AdditionalIncludeDirectories) + WIN32;NDEBUG;_WINDOWS;_USRDLL;_IRR_STATIC_LIB_;_CRT_SECURE_NO_DEPRECATE;%(PreprocessorDefinitions) + true + false + MultiThreaded + false + true + Fast + false + Level3 + + + FastCall + false + 4577 + + + NDEBUG;%(PreprocessorDefinitions) + 0x0c07 + + + winmm.lib;%(AdditionalDependencies) + ..\..\lib\Win32-visualstudio\Irrlicht.lib + MachineX86 + + + + + NDEBUG;%(PreprocessorDefinitions) + true + true + .\..\Release/Irrlicht.tlb + + + Full + AnySuitable + true + Speed + true + ..\..\include;zlib;%(AdditionalIncludeDirectories) + WIN32;WIN64;NDEBUG;_WINDOWS;_USRDLL;_IRR_STATIC_LIB_;_CRT_SECURE_NO_DEPRECATE;%(PreprocessorDefinitions) + true + false + MultiThreaded + false + true + Fast + false + Level3 + + + FastCall + false + 4577 + + + NDEBUG;%(PreprocessorDefinitions) + 0x0c07 + + + winmm.lib;%(AdditionalDependencies) + ..\..\lib\Win64-visualstudio\Irrlicht.lib + MachineX64 + + + + + _DEBUG;%(PreprocessorDefinitions) + true + true + Win32 + .\..\Debug/Irrlicht.tlb + + + Disabled + ..\..\include;zlib;%(AdditionalIncludeDirectories) + WIN32;_DEBUG;_WINDOWS;_USRDLL;IRRLICHT_EXPORTS;_CRT_SECURE_NO_DEPRECATE;_IRR_USE_SDL_DEVICE_=1;%(PreprocessorDefinitions) + false + EnableFastChecks + MultiThreadedDebug + false + false + Level3 + 4577 + + + _DEBUG;%(PreprocessorDefinitions) + 0x0c07 + + + true + + + /MACHINE:I386 %(AdditionalOptions) + kernel32.lib;user32.lib;gdi32.lib;winspool.lib;comdlg32.lib;advapi32.lib;shell32.lib;ole32.lib;oleaut32.lib;uuid.lib;opengl32.lib;%(AdditionalDependencies) + ..\..\bin\Win32-visualstudio\Irrlicht.dll + %(AdditionalLibraryDirectories) + libci.lib;%(IgnoreSpecificDefaultLibraries) + true + + + ..\..\lib\Win32-visualstudio\Irrlicht.lib + 1.9 + + + + + _DEBUG;%(PreprocessorDefinitions) + true + true + .\..\Debug/Irrlicht.tlb + + + Disabled + ..\..\include;zlib;%(AdditionalIncludeDirectories) + WIN32;WIN64;_DEBUG;_WINDOWS;_USRDLL;IRRLICHT_EXPORTS;_CRT_SECURE_NO_DEPRECATE;_IRR_USE_SDL_DEVICE_=1;%(PreprocessorDefinitions) + false + EnableFastChecks + MultiThreadedDebug + false + false + Level3 + 4577 + + + _DEBUG;%(PreprocessorDefinitions) + 0x0c07 + + + true + + + kernel32.lib;user32.lib;gdi32.lib;winspool.lib;comdlg32.lib;advapi32.lib;shell32.lib;ole32.lib;oleaut32.lib;uuid.lib;opengl32.lib;winmm.lib;%(AdditionalDependencies) + ..\..\bin\Win64-visualstudio\Irrlicht.dll + %(AdditionalLibraryDirectories) + libci.lib;%(IgnoreSpecificDefaultLibraries) + true + + + ..\..\lib\Win64-visualstudio\Irrlicht.lib + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/source/Irrlicht/Irrlicht14.0.vcxproj.filters b/source/Irrlicht/Irrlicht14.0.vcxproj.filters new file mode 100644 index 00000000..fabc7ab1 --- /dev/null +++ b/source/Irrlicht/Irrlicht14.0.vcxproj.filters @@ -0,0 +1,2346 @@ + + + + + {b5bde5d3-f9e4-4036-8c28-2f4e8cd03846} + + + {0b0937fb-2270-4e3e-a94f-f92bc0fa74ae} + + + {67300400-93d5-4a7e-8b59-7c0d7b1f6d75} + + + {feb206b9-81b6-45c0-b4e5-9e637fe060e7} + + + {af459bf5-2849-4a0e-9a21-91acbbf1c6b5} + + + {aa649d49-922d-4118-8574-f05c13d67706} + + + {a72cb2e5-a5c3-41bc-9c86-fdbdae8f7866} + + + {72c30315-bbc0-4109-9ccd-fb7107ba316a} + + + {1fcdc900-911d-4b7a-9328-afce5bbe44fa} + + + {41e16cbf-c3cb-4d74-8aef-c0416b6b9d7f} + + + {b84f01e5-ae3c-457b-8d96-b3e271800162} + + + {eca36d94-d8fb-477d-a0dc-b5498c9686d7} + + + {67826246-df05-4523-9191-5286f9157963} + + + {659a61d5-7ab3-4aa3-95ca-879780810b4e} + + + {f65e8d89-c715-4794-8c2d-22f2b57cffb0} + + + {3cb7865d-a5e9-4b22-8f54-dde759b88c51} + + + {919fcfa4-4277-4c88-8bfc-4bfcfcbb1b65} + + + {834213c7-9515-49de-aa27-8d3ed9c0c87a} + + + {a9ca9d4d-7678-4687-b78b-15236c0dcf53} + + + {d694e7b0-0fb0-4685-ace7-56d9ec65a3d0} + + + {e2571a61-945c-4509-b47c-daea464916ab} + + + {1354e9fa-cea6-461e-af7f-9940bb5f0a2f} + + + {ac7af7ba-0e6b-4da4-a695-a0070a4da974} + + + {1173499e-79e8-4c34-8046-abc325e2f2a9} + + + {ca095ff3-25e4-4852-ab55-af28c602cd8a} + + + {1c8bd90a-8361-4478-8942-a062450ef209} + + + {128cac28-b6f8-49e7-87f5-ee15951d0396} + + + {6f10ce97-ed8b-47bc-a189-f2262eb467e4} + + + {5d58bc55-284e-4880-9226-85083e65d660} + + + {064ee182-9f07-4026-ac22-c141ae2c7281} + + + {6e842906-e193-451d-8716-12eaafabd0d8} + + + {799f220e-3a58-4788-876b-88c175b69871} + + + {da421793-4674-481c-be46-f7a44e78aee5} + + + {628de03e-6872-4682-b1f6-d3cc453c9d55} + + + {224208f8-92b4-4fee-8825-3313e2819e8c} + + + {fbd95ddd-9178-412e-942b-f1c94ab68240} + + + + + include + + + include + + + include + + + include + + + include + + + include + + + include + + + include + + + include + + + include + + + include + + + include + + + include + + + include + + + include\video + + + include\video + + + include\video + + + include\video + + + include\video + + + include\video + + + include\video + + + include\video + + + include\video + + + include\video + + + include\video + + + include\video + + + include\video + + + include\video + + + include\video + + + include\video + + + include\video + + + include\core + + + include\core + + + include\core + + + include\core + + + include\core + + + include\core + + + include\core + + + include\core + + + include\core + + + include\core + + + include\core + + + include\core + + + include\core + + + include\core + + + include\core + + + include\core + + + include\core + + + include\core + + + include\core + + + include\core + + + include\io + + + include\io + + + include\io + + + include\io + + + include\io + + + include\io + + + include\io + + + include\io + + + include\io + + + include\io + + + include\io + + + include\scene + + + include\scene + + + include\scene + + + include\scene + + + include\scene + + + include\scene + + + include\scene + + + include\scene + + + include\scene + + + include\scene + + + include\scene + + + include\scene + + + include\scene + + + include\scene + + + include\scene + + + include\scene + + + include\scene + + + include\scene + + + include\scene + + + include\scene + + + include\scene + + + include\scene + + + include\scene + + + include\scene + + + include\scene + + + include\scene + + + include\scene + + + include\scene + + + include\scene + + + include\scene + + + include\scene + + + include\scene + + + include\scene + + + include\scene + + + include\scene + + + include\scene + + + include\scene + + + include\scene + + + include\scene + + + include\scene + + + include\scene + + + include\scene + + + include\scene + + + include\scene + + + include\scene + + + include\scene + + + include\scene + + + include\scene + + + include\scene + + + include\scene + + + include\scene + + + include\scene + + + include\scene + + + include\scene + + + include\scene + + + include\scene + + + include\scene + + + include\scene + + + include\scene + + + include\scene + + + include\scene + + + include\scene + + + include\scene + + + include\scene + + + include\scene + + + include\gui + + + include\gui + + + include\gui + + + include\gui + + + include\gui + + + include\gui + + + include\gui + + + include\gui + + + include\gui + + + include\gui + + + include\gui + + + include\gui + + + include\gui + + + include\gui + + + include\gui + + + include\gui + + + include\gui + + + include\gui + + + include\gui + + + include\gui + + + include\gui + + + include\gui + + + include\gui + + + include\gui + + + include\gui + + + include\gui + + + include\gui + + + include\gui + + + include\gui + + + include\gui + + + Irrlicht\scene + + + Irrlicht\scene + + + Irrlicht\scene + + + Irrlicht\scene + + + Irrlicht\scene + + + Irrlicht\scene + + + Irrlicht\scene + + + Irrlicht\scene\loaders + + + Irrlicht\scene\loaders + + + Irrlicht\scene\loaders + + + Irrlicht\scene\loaders + + + Irrlicht\scene\loaders + + + Irrlicht\scene\loaders + + + Irrlicht\scene\loaders + + + Irrlicht\scene\loaders + + + Irrlicht\scene\loaders + + + Irrlicht\scene\loaders + + + Irrlicht\scene\loaders + + + Irrlicht\scene\loaders + + + Irrlicht\scene\loaders + + + Irrlicht\scene\loaders + + + Irrlicht\scene\loaders + + + Irrlicht\scene\loaders + + + Irrlicht\scene\loaders + + + Irrlicht\scene\loaders + + + Irrlicht\scene\loaders + + + Irrlicht\scene\loaders + + + Irrlicht\scene\loaders + + + Irrlicht\scene\loaders + + + Irrlicht\scene\loaders + + + Irrlicht\scene\loaders + + + Irrlicht\scene\loaders + + + Irrlicht\scene\loaders + + + Irrlicht\scene\loaders + + + Irrlicht\scene\sceneNodes + + + Irrlicht\scene\sceneNodes + + + Irrlicht\scene\sceneNodes + + + Irrlicht\scene\sceneNodes + + + Irrlicht\scene\sceneNodes + + + Irrlicht\scene\sceneNodes + + + Irrlicht\scene\sceneNodes + + + Irrlicht\scene\sceneNodes + + + Irrlicht\scene\sceneNodes + + + Irrlicht\scene\sceneNodes + + + Irrlicht\scene\sceneNodes + + + Irrlicht\scene\sceneNodes + + + Irrlicht\scene\sceneNodes + + + Irrlicht\scene\sceneNodes + + + Irrlicht\scene\sceneNodes + + + Irrlicht\scene\sceneNodes + + + Irrlicht\scene\sceneNodes + + + Irrlicht\scene\sceneNodes + + + Irrlicht\scene\sceneNodes + + + Irrlicht\scene\particleSystem + + + Irrlicht\scene\particleSystem + + + Irrlicht\scene\particleSystem + + + Irrlicht\scene\particleSystem + + + Irrlicht\scene\particleSystem + + + Irrlicht\scene\particleSystem + + + Irrlicht\scene\particleSystem + + + Irrlicht\scene\particleSystem + + + Irrlicht\scene\particleSystem + + + Irrlicht\scene\particleSystem + + + Irrlicht\scene\particleSystem + + + Irrlicht\scene\particleSystem + + + Irrlicht\scene\particleSystem + + + Irrlicht\scene\collision + + + Irrlicht\scene\collision + + + Irrlicht\scene\collision + + + Irrlicht\scene\collision + + + Irrlicht\scene\collision + + + Irrlicht\scene\collision + + + Irrlicht\scene\animators + + + Irrlicht\scene\animators + + + Irrlicht\scene\animators + + + Irrlicht\scene\animators + + + Irrlicht\scene\animators + + + Irrlicht\scene\animators + + + Irrlicht\scene\animators + + + Irrlicht\scene\animators + + + Irrlicht\scene\animators + + + Irrlicht\scene\writers + + + Irrlicht\scene\writers + + + Irrlicht\scene\writers + + + Irrlicht\scene\writers + + + Irrlicht\scene\writers + + + Irrlicht\video + + + Irrlicht\video\Software + + + Irrlicht\video\Software + + + Irrlicht\video\Software + + + Irrlicht\video\Software + + + Irrlicht\video\Software + + + Irrlicht\video\Software + + + Irrlicht\video\Software + + + Irrlicht\video\Null + + + Irrlicht\video\Null + + + Irrlicht\video\Null + + + Irrlicht\video\Null + + + Irrlicht\video\Null + + + Irrlicht\video\Null\Writer + + + Irrlicht\video\Null\Writer + + + Irrlicht\video\Null\Writer + + + Irrlicht\video\Null\Writer + + + Irrlicht\video\Null\Writer + + + Irrlicht\video\Null\Writer + + + Irrlicht\video\Null\Writer + + + Irrlicht\video\Null\Loader + + + Irrlicht\video\Null\Loader + + + Irrlicht\video\Null\Loader + + + Irrlicht\video\Null\Loader + + + Irrlicht\video\Null\Loader + + + Irrlicht\video\Null\Loader + + + Irrlicht\video\Null\Loader + + + Irrlicht\video\Null\Loader + + + Irrlicht\video\Null\Loader + + + Irrlicht\video\Null\Loader + + + Irrlicht\video\Null\Loader + + + Irrlicht\video\Direct3D9 + + + Irrlicht\video\Direct3D9 + + + Irrlicht\video\Direct3D9 + + + Irrlicht\video\Direct3D9 + + + Irrlicht\video\Direct3D9 + + + Irrlicht\video\Direct3D9 + + + Irrlicht\video\Direct3D9 + + + Irrlicht\video\Burning Video + + + Irrlicht\video\Burning Video + + + Irrlicht\video\Burning Video + + + Irrlicht\video\Burning Video + + + Irrlicht\video\Burning Video + + + Irrlicht\video\Burning Video + + + Irrlicht\video\Burning Video + + + Irrlicht\video\Burning Video + + + Irrlicht\video\Burning Video + + + Irrlicht\irr + + + Irrlicht\irr + + + Irrlicht\irr + + + Irrlicht\irr + + + Irrlicht\irr + + + Irrlicht\irr + + + Irrlicht\irr\extern + + + Irrlicht\irr\extern + + + Irrlicht\irr\extern\zlib + + + Irrlicht\irr\extern\zlib + + + Irrlicht\irr\extern\zlib + + + Irrlicht\irr\extern\zlib + + + Irrlicht\irr\extern\zlib + + + Irrlicht\irr\extern\zlib + + + Irrlicht\irr\extern\zlib + + + Irrlicht\irr\extern\zlib + + + Irrlicht\irr\extern\zlib + + + Irrlicht\irr\extern\jpeglib + + + Irrlicht\irr\extern\jpeglib + + + Irrlicht\irr\extern\jpeglib + + + Irrlicht\irr\extern\jpeglib + + + Irrlicht\irr\extern\jpeglib + + + Irrlicht\irr\extern\jpeglib + + + Irrlicht\irr\extern\jpeglib + + + Irrlicht\irr\extern\jpeglib + + + Irrlicht\irr\extern\jpeglib + + + Irrlicht\irr\extern\jpeglib + + + Irrlicht\irr\extern\libpng + + + Irrlicht\irr\extern\libpng + + + Irrlicht\irr\extern\aesGladman + + + Irrlicht\irr\extern\aesGladman + + + Irrlicht\irr\extern\aesGladman + + + Irrlicht\irr\extern\aesGladman + + + Irrlicht\irr\extern\aesGladman + + + Irrlicht\irr\extern\aesGladman + + + Irrlicht\irr\extern\aesGladman + + + Irrlicht\irr\extern\aesGladman + + + Irrlicht\irr\extern\bzip2 + + + Irrlicht\irr\extern\bzip2 + + + Irrlicht\irr\device + + + Irrlicht\irr\device + + + Irrlicht\irr\device + + + Irrlicht\irr\device + + + Irrlicht\irr\device + + + Irrlicht\irr\device + + + Irrlicht\io + + + Irrlicht\io + + + Irrlicht\io + + + Irrlicht\io + + + Irrlicht\io + + + Irrlicht\io + + + Irrlicht\io + + + Irrlicht\io + + + Irrlicht\io + + + Irrlicht\io + + + Irrlicht\io + + + Irrlicht\io + + + Irrlicht\io + + + Irrlicht\io + + + Irrlicht\io + + + Irrlicht\io + + + Irrlicht\io + + + Irrlicht\io + + + Irrlicht\gui + + + Irrlicht\gui + + + Irrlicht\gui + + + Irrlicht\gui + + + Irrlicht\gui + + + Irrlicht\gui + + + Irrlicht\gui + + + Irrlicht\gui + + + Irrlicht\gui + + + Irrlicht\gui + + + Irrlicht\gui + + + Irrlicht\gui + + + Irrlicht\gui + + + Irrlicht\gui + + + Irrlicht\gui + + + Irrlicht\gui + + + Irrlicht\gui + + + Irrlicht\gui + + + Irrlicht\gui + + + Irrlicht\gui + + + Irrlicht\gui + + + Irrlicht\gui + + + Irrlicht\gui + + + Irrlicht\gui + + + Irrlicht\gui + + + Irrlicht\gui + + + Irrlicht\gui + + + Irrlicht\gui + + + Irrlicht\gui + + + Irrlicht\gui + + + include\scene + + + + Irrlicht\scene\loaders + + + include\scene + + + Irrlicht\scene\loaders + + + include\video + + + include + + + include\video + + + include\video + + + Irrlicht\video\Direct3D9 + + + Irrlicht\scene\writers + + + Irrlicht\scene + + + Irrlicht\video\OpenGL + + + Irrlicht\video\OpenGL + + + Irrlicht\video\OpenGL + + + Irrlicht\video\OpenGL + + + Irrlicht\video\OpenGL + + + Irrlicht\video\OpenGL + + + Irrlicht\video\OpenGL + + + Irrlicht\video\OpenGL + + + Irrlicht\video\OpenGL + + + Irrlicht\video\OpenGL Core + + + Irrlicht\video\OpenGL Core + + + Irrlicht\video\OpenGL Core + + + Irrlicht\video\OpenGL Core + + + Irrlicht\video + + + Irrlicht\video + + + Irrlicht\video\OpenGL ES2.x + + + Irrlicht\video\OpenGL ES2.x + + + Irrlicht\video\OpenGL ES2.x + + + Irrlicht\video\OpenGL ES2.x + + + Irrlicht\video\OpenGL ES2.x + + + Irrlicht\video\OpenGL ES2.x + + + Irrlicht\video\OpenGL ES2.x + + + Irrlicht\video\OpenGL ES2.x + + + Irrlicht\video\OpenGL ES1.x + + + Irrlicht\video\OpenGL ES1.x + + + Irrlicht\video\OpenGL ES1.x + + + Irrlicht\video\OpenGL ES1.x + + + + + doc + + + doc + + + + + Irrlicht\scene + + + Irrlicht\scene + + + Irrlicht\scene + + + Irrlicht\scene + + + Irrlicht\scene + + + Irrlicht\scene + + + Irrlicht\scene\loaders + + + Irrlicht\scene\loaders + + + Irrlicht\scene\loaders + + + Irrlicht\scene\loaders + + + Irrlicht\scene\loaders + + + Irrlicht\scene\loaders + + + Irrlicht\scene\loaders + + + Irrlicht\scene\loaders + + + Irrlicht\scene\loaders + + + Irrlicht\scene\loaders + + + Irrlicht\scene\loaders + + + Irrlicht\scene\loaders + + + Irrlicht\scene\loaders + + + Irrlicht\scene\loaders + + + Irrlicht\scene\loaders + + + Irrlicht\scene\loaders + + + Irrlicht\scene\loaders + + + Irrlicht\scene\loaders + + + Irrlicht\scene\loaders + + + Irrlicht\scene\loaders + + + Irrlicht\scene\loaders + + + Irrlicht\scene\loaders + + + Irrlicht\scene\loaders + + + Irrlicht\scene\loaders + + + Irrlicht\scene\loaders + + + Irrlicht\scene\sceneNodes + + + Irrlicht\scene\sceneNodes + + + Irrlicht\scene\sceneNodes + + + Irrlicht\scene\sceneNodes + + + Irrlicht\scene\sceneNodes + + + Irrlicht\scene\sceneNodes + + + Irrlicht\scene\sceneNodes + + + Irrlicht\scene\sceneNodes + + + Irrlicht\scene\sceneNodes + + + Irrlicht\scene\sceneNodes + + + Irrlicht\scene\sceneNodes + + + Irrlicht\scene\sceneNodes + + + Irrlicht\scene\sceneNodes + + + Irrlicht\scene\sceneNodes + + + Irrlicht\scene\sceneNodes + + + Irrlicht\scene\sceneNodes + + + Irrlicht\scene\sceneNodes + + + Irrlicht\scene\sceneNodes + + + Irrlicht\scene\sceneNodes + + + Irrlicht\scene\particleSystem + + + Irrlicht\scene\particleSystem + + + Irrlicht\scene\particleSystem + + + Irrlicht\scene\particleSystem + + + Irrlicht\scene\particleSystem + + + Irrlicht\scene\particleSystem + + + Irrlicht\scene\particleSystem + + + Irrlicht\scene\particleSystem + + + Irrlicht\scene\particleSystem + + + Irrlicht\scene\particleSystem + + + Irrlicht\scene\particleSystem + + + Irrlicht\scene\particleSystem + + + Irrlicht\scene\particleSystem + + + Irrlicht\scene\collision + + + Irrlicht\scene\collision + + + Irrlicht\scene\collision + + + Irrlicht\scene\collision + + + Irrlicht\scene\collision + + + Irrlicht\scene\collision + + + Irrlicht\scene\animators + + + Irrlicht\scene\animators + + + Irrlicht\scene\animators + + + Irrlicht\scene\animators + + + Irrlicht\scene\animators + + + Irrlicht\scene\animators + + + Irrlicht\scene\animators + + + Irrlicht\scene\animators + + + Irrlicht\scene\animators + + + Irrlicht\scene\writers + + + Irrlicht\scene\writers + + + Irrlicht\scene\writers + + + Irrlicht\scene\writers + + + Irrlicht\scene\writers + + + Irrlicht\video + + + Irrlicht\video\Software + + + Irrlicht\video\Software + + + Irrlicht\video\Software + + + Irrlicht\video\Software + + + Irrlicht\video\Software + + + Irrlicht\video\Software + + + Irrlicht\video\Software + + + Irrlicht\video\Software + + + Irrlicht\video\Software + + + Irrlicht\video\Software + + + Irrlicht\video\Software + + + Irrlicht\video\Software + + + Irrlicht\video\Software + + + Irrlicht\video\Null + + + Irrlicht\video\Null + + + Irrlicht\video\Null + + + Irrlicht\video\Null + + + Irrlicht\video\Null\Writer + + + Irrlicht\video\Null\Writer + + + Irrlicht\video\Null\Writer + + + Irrlicht\video\Null\Writer + + + Irrlicht\video\Null\Writer + + + Irrlicht\video\Null\Writer + + + Irrlicht\video\Null\Writer + + + Irrlicht\video\Null\Loader + + + Irrlicht\video\Null\Loader + + + Irrlicht\video\Null\Loader + + + Irrlicht\video\Null\Loader + + + Irrlicht\video\Null\Loader + + + Irrlicht\video\Null\Loader + + + Irrlicht\video\Null\Loader + + + Irrlicht\video\Null\Loader + + + Irrlicht\video\Null\Loader + + + Irrlicht\video\Null\Loader + + + Irrlicht\video\Null\Loader + + + Irrlicht\video\Direct3D9 + + + Irrlicht\video\Direct3D9 + + + Irrlicht\video\Direct3D9 + + + Irrlicht\video\Direct3D9 + + + Irrlicht\video\Direct3D9 + + + Irrlicht\video\Direct3D9 + + + Irrlicht\video\Burning Video + + + Irrlicht\video\Burning Video + + + Irrlicht\video\Burning Video + + + Irrlicht\video\Burning Video + + + Irrlicht\video\Burning Video + + + Irrlicht\video\Burning Video + + + Irrlicht\video\Burning Video + + + Irrlicht\video\Burning Video + + + Irrlicht\video\Burning Video + + + Irrlicht\video\Burning Video + + + Irrlicht\video\Burning Video + + + Irrlicht\video\Burning Video + + + Irrlicht\video\Burning Video + + + Irrlicht\video\Burning Video + + + Irrlicht\video\Burning Video + + + Irrlicht\video\Burning Video + + + Irrlicht\video\Burning Video + + + Irrlicht\video\Burning Video + + + Irrlicht\video\Burning Video + + + Irrlicht\video\Burning Video + + + Irrlicht\video\Burning Video + + + Irrlicht\video\Burning Video + + + Irrlicht\video\Burning Video + + + Irrlicht\video\Burning Video + + + Irrlicht\video\Burning Video + + + Irrlicht\irr + + + Irrlicht\irr + + + Irrlicht\irr + + + Irrlicht\irr + + + Irrlicht\irr + + + Irrlicht\irr + + + Irrlicht\irr + + + Irrlicht\irr\extern + + + Irrlicht\irr\extern\zlib + + + Irrlicht\irr\extern\zlib + + + Irrlicht\irr\extern\zlib + + + Irrlicht\irr\extern\zlib + + + Irrlicht\irr\extern\zlib + + + Irrlicht\irr\extern\zlib + + + Irrlicht\irr\extern\zlib + + + Irrlicht\irr\extern\zlib + + + Irrlicht\irr\extern\zlib + + + Irrlicht\irr\extern\zlib + + + Irrlicht\irr\extern\jpeglib + + + Irrlicht\irr\extern\jpeglib + + + Irrlicht\irr\extern\jpeglib + + + Irrlicht\irr\extern\jpeglib + + + Irrlicht\irr\extern\jpeglib + + + Irrlicht\irr\extern\jpeglib + + + Irrlicht\irr\extern\jpeglib + + + Irrlicht\irr\extern\jpeglib + + + Irrlicht\irr\extern\jpeglib + + + Irrlicht\irr\extern\jpeglib + + + Irrlicht\irr\extern\jpeglib + + + Irrlicht\irr\extern\jpeglib + + + Irrlicht\irr\extern\jpeglib + + + Irrlicht\irr\extern\jpeglib + + + Irrlicht\irr\extern\jpeglib + + + Irrlicht\irr\extern\jpeglib + + + Irrlicht\irr\extern\jpeglib + + + Irrlicht\irr\extern\jpeglib + + + Irrlicht\irr\extern\jpeglib + + + Irrlicht\irr\extern\jpeglib + + + Irrlicht\irr\extern\jpeglib + + + Irrlicht\irr\extern\jpeglib + + + Irrlicht\irr\extern\jpeglib + + + Irrlicht\irr\extern\jpeglib + + + Irrlicht\irr\extern\jpeglib + + + Irrlicht\irr\extern\jpeglib + + + Irrlicht\irr\extern\jpeglib + + + Irrlicht\irr\extern\jpeglib + + + Irrlicht\irr\extern\jpeglib + + + Irrlicht\irr\extern\jpeglib + + + Irrlicht\irr\extern\jpeglib + + + Irrlicht\irr\extern\jpeglib + + + Irrlicht\irr\extern\jpeglib + + + Irrlicht\irr\extern\jpeglib + + + Irrlicht\irr\extern\jpeglib + + + Irrlicht\irr\extern\jpeglib + + + Irrlicht\irr\extern\jpeglib + + + Irrlicht\irr\extern\jpeglib + + + Irrlicht\irr\extern\jpeglib + + + Irrlicht\irr\extern\jpeglib + + + Irrlicht\irr\extern\jpeglib + + + Irrlicht\irr\extern\jpeglib + + + Irrlicht\irr\extern\jpeglib + + + Irrlicht\irr\extern\jpeglib + + + Irrlicht\irr\extern\jpeglib + + + Irrlicht\irr\extern\jpeglib + + + Irrlicht\irr\extern\libpng + + + Irrlicht\irr\extern\libpng + + + Irrlicht\irr\extern\libpng + + + Irrlicht\irr\extern\libpng + + + Irrlicht\irr\extern\libpng + + + Irrlicht\irr\extern\libpng + + + Irrlicht\irr\extern\libpng + + + Irrlicht\irr\extern\libpng + + + Irrlicht\irr\extern\libpng + + + Irrlicht\irr\extern\libpng + + + Irrlicht\irr\extern\libpng + + + Irrlicht\irr\extern\libpng + + + Irrlicht\irr\extern\libpng + + + Irrlicht\irr\extern\libpng + + + Irrlicht\irr\extern\libpng + + + Irrlicht\irr\extern\aesGladman + + + Irrlicht\irr\extern\aesGladman + + + Irrlicht\irr\extern\aesGladman + + + Irrlicht\irr\extern\aesGladman + + + Irrlicht\irr\extern\aesGladman + + + Irrlicht\irr\extern\aesGladman + + + Irrlicht\irr\extern\aesGladman + + + Irrlicht\irr\extern\aesGladman + + + Irrlicht\irr\extern\aesGladman + + + Irrlicht\irr\extern\bzip2 + + + Irrlicht\irr\extern\bzip2 + + + Irrlicht\irr\extern\bzip2 + + + Irrlicht\irr\extern\bzip2 + + + Irrlicht\irr\extern\bzip2 + + + Irrlicht\irr\extern\bzip2 + + + Irrlicht\irr\extern\bzip2 + + + Irrlicht\irr\device + + + Irrlicht\irr\device + + + Irrlicht\irr\device + + + Irrlicht\irr\device + + + Irrlicht\irr\device + + + Irrlicht\irr\device + + + Irrlicht\io + + + Irrlicht\io + + + Irrlicht\io + + + Irrlicht\io + + + Irrlicht\io + + + Irrlicht\io + + + Irrlicht\io + + + Irrlicht\io + + + Irrlicht\io + + + Irrlicht\io + + + Irrlicht\io + + + Irrlicht\io + + + Irrlicht\io + + + Irrlicht\io + + + Irrlicht\io + + + Irrlicht\io + + + Irrlicht\gui + + + Irrlicht\gui + + + Irrlicht\gui + + + Irrlicht\gui + + + Irrlicht\gui + + + Irrlicht\gui + + + Irrlicht\gui + + + Irrlicht\gui + + + Irrlicht\gui + + + Irrlicht\gui + + + Irrlicht\gui + + + Irrlicht\gui + + + Irrlicht\gui + + + Irrlicht\gui + + + Irrlicht\gui + + + Irrlicht\gui + + + Irrlicht\gui + + + Irrlicht\gui + + + Irrlicht\gui + + + Irrlicht\gui + + + Irrlicht\gui + + + Irrlicht\gui + + + Irrlicht\gui + + + Irrlicht\gui + + + Irrlicht\gui + + + Irrlicht\gui + + + Irrlicht\gui + + + Irrlicht\gui + + + Irrlicht\gui + + + Irrlicht\scene\loaders + + + Irrlicht\scene\loaders + + + Irrlicht\video\Direct3D9 + + + Irrlicht\scene\writers + + + Irrlicht\video\OpenGL + + + Irrlicht\video\OpenGL + + + Irrlicht\video\OpenGL + + + Irrlicht\video\OpenGL + + + Irrlicht\video\OpenGL + + + Irrlicht\video\OpenGL + + + Irrlicht\video\OpenGL + + + Irrlicht\video + + + Irrlicht\video + + + Irrlicht\video\OpenGL ES2.x + + + Irrlicht\video\OpenGL ES2.x + + + Irrlicht\video\OpenGL ES2.x + + + Irrlicht\video\OpenGL ES2.x + + + Irrlicht\video\OpenGL ES2.x + + + Irrlicht\video\OpenGL ES2.x + + + Irrlicht\video\OpenGL ES2.x + + + Irrlicht\video\OpenGL ES1.x + + + Irrlicht\video\OpenGL ES1.x + + + + + + \ No newline at end of file diff --git a/source/Irrlicht/Irrlicht8.0.sln b/source/Irrlicht/Irrlicht8.0.sln deleted file mode 100644 index e9759b20..00000000 --- a/source/Irrlicht/Irrlicht8.0.sln +++ /dev/null @@ -1,29 +0,0 @@ - -Microsoft Visual Studio Solution File, Format Version 9.00 -# Visual Studio 2005 -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Irrlicht", "Irrlicht8.0.vcproj", "{E08E042A-6C45-411B-92BE-3CC31331019F}" -EndProject -Global - GlobalSection(SolutionConfigurationPlatforms) = preSolution - Debug|Win32 = Debug|Win32 - Release|Win32 = Release|Win32 - Static lib - Debug|Win32 = Static lib - Debug|Win32 - Static lib - Release - Fast FPU|Win32 = Static lib - Release - Fast FPU|Win32 - Static lib - Release|Win32 = Static lib - Release|Win32 - EndGlobalSection - GlobalSection(ProjectConfigurationPlatforms) = postSolution - {E08E042A-6C45-411B-92BE-3CC31331019F}.Debug|Win32.ActiveCfg = Debug|Win32 - {E08E042A-6C45-411B-92BE-3CC31331019F}.Debug|Win32.Build.0 = Debug|Win32 - {E08E042A-6C45-411B-92BE-3CC31331019F}.Release|Win32.ActiveCfg = Release|Win32 - {E08E042A-6C45-411B-92BE-3CC31331019F}.Release|Win32.Build.0 = Release|Win32 - {E08E042A-6C45-411B-92BE-3CC31331019F}.Static lib - Debug|Win32.ActiveCfg = Static lib - Debug|Win32 - {E08E042A-6C45-411B-92BE-3CC31331019F}.Static lib - Debug|Win32.Build.0 = Static lib - Debug|Win32 - {E08E042A-6C45-411B-92BE-3CC31331019F}.Static lib - Release - Fast FPU|Win32.ActiveCfg = Static lib - Release - Fast FPU|Win32 - {E08E042A-6C45-411B-92BE-3CC31331019F}.Static lib - Release - Fast FPU|Win32.Build.0 = Static lib - Release - Fast FPU|Win32 - {E08E042A-6C45-411B-92BE-3CC31331019F}.Static lib - Release|Win32.ActiveCfg = Static lib - Release|Win32 - {E08E042A-6C45-411B-92BE-3CC31331019F}.Static lib - Release|Win32.Build.0 = Static lib - Release|Win32 - EndGlobalSection - GlobalSection(SolutionProperties) = preSolution - HideSolutionNode = FALSE - EndGlobalSection -EndGlobal diff --git a/source/Irrlicht/Irrlicht8.0.vcproj b/source/Irrlicht/Irrlicht8.0.vcproj deleted file mode 100644 index fee6d696..00000000 --- a/source/Irrlicht/Irrlicht8.0.vcproj +++ /dev/null @@ -1,3584 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/source/Irrlicht/Irrlicht9.0.sln b/source/Irrlicht/Irrlicht9.0.sln deleted file mode 100644 index 17f0dab2..00000000 --- a/source/Irrlicht/Irrlicht9.0.sln +++ /dev/null @@ -1,32 +0,0 @@ - -Microsoft Visual Studio Solution File, Format Version 10.00 -# Visual C++ Express 2008 -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Irrlicht", "Irrlicht9.0.vcproj", "{E08E042A-6C45-411B-92BE-3CC31331019F}" -EndProject -Global - GlobalSection(SolutionConfigurationPlatforms) = preSolution - Debug|Win32 = Debug|Win32 - Release - Fast FPU|Win32 = Release - Fast FPU|Win32 - Release|Win32 = Release|Win32 - Static lib - Debug|Win32 = Static lib - Debug|Win32 - Static lib - Release - Fast FPU|Win32 = Static lib - Release - Fast FPU|Win32 - Static lib - Release|Win32 = Static lib - Release|Win32 - EndGlobalSection - GlobalSection(ProjectConfigurationPlatforms) = postSolution - {E08E042A-6C45-411B-92BE-3CC31331019F}.Debug|Win32.ActiveCfg = Debug|Win32 - {E08E042A-6C45-411B-92BE-3CC31331019F}.Debug|Win32.Build.0 = Debug|Win32 - {E08E042A-6C45-411B-92BE-3CC31331019F}.Release - Fast FPU|Win32.ActiveCfg = Release - Fast FPU|Win32 - {E08E042A-6C45-411B-92BE-3CC31331019F}.Release - Fast FPU|Win32.Build.0 = Release - Fast FPU|Win32 - {E08E042A-6C45-411B-92BE-3CC31331019F}.Release|Win32.ActiveCfg = Release|Win32 - {E08E042A-6C45-411B-92BE-3CC31331019F}.Release|Win32.Build.0 = Release|Win32 - {E08E042A-6C45-411B-92BE-3CC31331019F}.Static lib - Debug|Win32.ActiveCfg = Static lib - Debug|Win32 - {E08E042A-6C45-411B-92BE-3CC31331019F}.Static lib - Debug|Win32.Build.0 = Static lib - Debug|Win32 - {E08E042A-6C45-411B-92BE-3CC31331019F}.Static lib - Release - Fast FPU|Win32.ActiveCfg = Static lib - Release - Fast FPU|Win32 - {E08E042A-6C45-411B-92BE-3CC31331019F}.Static lib - Release - Fast FPU|Win32.Build.0 = Static lib - Release - Fast FPU|Win32 - {E08E042A-6C45-411B-92BE-3CC31331019F}.Static lib - Release|Win32.ActiveCfg = Static lib - Release|Win32 - {E08E042A-6C45-411B-92BE-3CC31331019F}.Static lib - Release|Win32.Build.0 = Static lib - Release|Win32 - EndGlobalSection - GlobalSection(SolutionProperties) = preSolution - HideSolutionNode = FALSE - EndGlobalSection -EndGlobal diff --git a/source/Irrlicht/Irrlicht9.0.vcproj b/source/Irrlicht/Irrlicht9.0.vcproj deleted file mode 100644 index 8fc95348..00000000 --- a/source/Irrlicht/Irrlicht9.0.vcproj +++ /dev/null @@ -1,3847 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/source/Irrlicht/Irrlicht_mobile6.sln b/source/Irrlicht/Irrlicht_mobile6.sln deleted file mode 100644 index be319a34..00000000 --- a/source/Irrlicht/Irrlicht_mobile6.sln +++ /dev/null @@ -1,22 +0,0 @@ - -Microsoft Visual Studio Solution File, Format Version 9.00 -# Visual Studio 2005 -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Irrlicht", "Irrlicht_mobile6.vcproj", "{E08E042A-6C45-411B-92BE-3CC31331019F}" -EndProject -Global - GlobalSection(SolutionConfigurationPlatforms) = preSolution - Debug|Windows Mobile 6 Professional SDK (ARMV4I) = Debug|Windows Mobile 6 Professional SDK (ARMV4I) - Release|Windows Mobile 6 Professional SDK (ARMV4I) = Release|Windows Mobile 6 Professional SDK (ARMV4I) - EndGlobalSection - GlobalSection(ProjectConfigurationPlatforms) = postSolution - {E08E042A-6C45-411B-92BE-3CC31331019F}.Debug|Windows Mobile 6 Professional SDK (ARMV4I).ActiveCfg = Debug|Windows Mobile 6 Professional SDK (ARMV4I) - {E08E042A-6C45-411B-92BE-3CC31331019F}.Debug|Windows Mobile 6 Professional SDK (ARMV4I).Build.0 = Debug|Windows Mobile 6 Professional SDK (ARMV4I) - {E08E042A-6C45-411B-92BE-3CC31331019F}.Debug|Windows Mobile 6 Professional SDK (ARMV4I).Deploy.0 = Debug|Windows Mobile 6 Professional SDK (ARMV4I) - {E08E042A-6C45-411B-92BE-3CC31331019F}.Release|Windows Mobile 6 Professional SDK (ARMV4I).ActiveCfg = Release|Windows Mobile 6 Professional SDK (ARMV4I) - {E08E042A-6C45-411B-92BE-3CC31331019F}.Release|Windows Mobile 6 Professional SDK (ARMV4I).Build.0 = Release|Windows Mobile 6 Professional SDK (ARMV4I) - {E08E042A-6C45-411B-92BE-3CC31331019F}.Release|Windows Mobile 6 Professional SDK (ARMV4I).Deploy.0 = Release|Windows Mobile 6 Professional SDK (ARMV4I) - EndGlobalSection - GlobalSection(SolutionProperties) = preSolution - HideSolutionNode = FALSE - EndGlobalSection -EndGlobal diff --git a/source/Irrlicht/Irrlicht_mobile6.vcproj b/source/Irrlicht/Irrlicht_mobile6.vcproj deleted file mode 100644 index f9b5c6b0..00000000 --- a/source/Irrlicht/Irrlicht_mobile6.vcproj +++ /dev/null @@ -1,3137 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/source/Irrlicht/Irrlicht_xbox.sln b/source/Irrlicht/Irrlicht_xbox.sln deleted file mode 100644 index 1a358172..00000000 --- a/source/Irrlicht/Irrlicht_xbox.sln +++ /dev/null @@ -1,30 +0,0 @@ -Microsoft Visual Studio Solution File, Format Version 8.00 -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Irrlicht_xbox", "Irrlicht_xbox.vcproj", "{2440E601-7438-4C6B-B4AF-BBFE9735875E}" - ProjectSection(ProjectDependencies) = postProject - EndProjectSection -EndProject -Global - GlobalSection(SolutionConfiguration) = preSolution - Debug = Debug - Profile = Profile - Profile_FastCap = Profile_FastCap - Release = Release - Release_LTCG = Release_LTCG - EndGlobalSection - GlobalSection(ProjectConfiguration) = postSolution - {2440E601-7438-4C6B-B4AF-BBFE9735875E}.Debug.ActiveCfg = Debug|Xbox - {2440E601-7438-4C6B-B4AF-BBFE9735875E}.Debug.Build.0 = Debug|Xbox - {2440E601-7438-4C6B-B4AF-BBFE9735875E}.Profile.ActiveCfg = Profile|Xbox - {2440E601-7438-4C6B-B4AF-BBFE9735875E}.Profile.Build.0 = Profile|Xbox - {2440E601-7438-4C6B-B4AF-BBFE9735875E}.Profile_FastCap.ActiveCfg = Profile_FastCap|Xbox - {2440E601-7438-4C6B-B4AF-BBFE9735875E}.Profile_FastCap.Build.0 = Profile_FastCap|Xbox - {2440E601-7438-4C6B-B4AF-BBFE9735875E}.Release.ActiveCfg = Release|Xbox - {2440E601-7438-4C6B-B4AF-BBFE9735875E}.Release.Build.0 = Release|Xbox - {2440E601-7438-4C6B-B4AF-BBFE9735875E}.Release_LTCG.ActiveCfg = Release_LTCG|Xbox - {2440E601-7438-4C6B-B4AF-BBFE9735875E}.Release_LTCG.Build.0 = Release_LTCG|Xbox - EndGlobalSection - GlobalSection(ExtensibilityGlobals) = postSolution - EndGlobalSection - GlobalSection(ExtensibilityAddIns) = postSolution - EndGlobalSection -EndGlobal diff --git a/source/Irrlicht/Irrlicht_xbox.vcproj b/source/Irrlicht/Irrlicht_xbox.vcproj deleted file mode 100644 index 93852279..00000000 --- a/source/Irrlicht/Irrlicht_xbox.vcproj +++ /dev/null @@ -1,2026 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/source/Irrlicht/Makefile b/source/Irrlicht/Makefile index a5a6edc6..4436f5aa 100644 --- a/source/Irrlicht/Makefile +++ b/source/Irrlicht/Makefile @@ -30,7 +30,7 @@ VERSION_RELEASE = 0 #List of object files, separated based on engine architecture IRRMESHLOADER = CBSPMeshFileLoader.o CMD2MeshFileLoader.o CMD3MeshFileLoader.o CMS3DMeshFileLoader.o CB3DMeshFileLoader.o C3DSMeshFileLoader.o COgreMeshFileLoader.o COBJMeshFileLoader.o CColladaFileLoader.o CCSMLoader.o CDMFLoader.o CLMTSMeshFileLoader.o CMY3DMeshFileLoader.o COCTLoader.o CXMeshFileLoader.o CIrrMeshFileLoader.o CSTLMeshFileLoader.o CLWOMeshFileLoader.o CPLYMeshFileLoader.o CSMFMeshFileLoader.o CMeshTextureLoader.o -IRRMESHWRITER = CColladaMeshWriter.o CIrrMeshWriter.o CSTLMeshWriter.o COBJMeshWriter.o CPLYMeshWriter.o +IRRMESHWRITER = CColladaMeshWriter.o CIrrMeshWriter.o CSTLMeshWriter.o COBJMeshWriter.o CPLYMeshWriter.o CB3DMeshWriter.o IRRMESHOBJ = $(IRRMESHLOADER) $(IRRMESHWRITER) \ CSkinnedMesh.o CBoneSceneNode.o CMeshSceneNode.o \ CAnimatedMeshSceneNode.o CAnimatedMeshMD2.o CAnimatedMeshMD3.o \ @@ -38,7 +38,7 @@ IRRMESHOBJ = $(IRRMESHLOADER) $(IRRMESHWRITER) \ IRROBJ = CBillboardSceneNode.o CCameraSceneNode.o CDummyTransformationSceneNode.o CEmptySceneNode.o CGeometryCreator.o CLightSceneNode.o CMeshManipulator.o CMetaTriangleSelector.o COctreeSceneNode.o COctreeTriangleSelector.o CSceneCollisionManager.o CSceneManager.o CShadowVolumeSceneNode.o CSkyBoxSceneNode.o CSkyDomeSceneNode.o CTerrainSceneNode.o CTerrainTriangleSelector.o CVolumeLightSceneNode.o CCubeSceneNode.o CSphereSceneNode.o CTextSceneNode.o CTriangleBBSelector.o CTriangleSelector.o CWaterSurfaceSceneNode.o CMeshCache.o CDefaultSceneNodeAnimatorFactory.o CDefaultSceneNodeFactory.o CSceneLoaderIrr.o IRRPARTICLEOBJ = CParticleAnimatedMeshSceneNodeEmitter.o CParticleBoxEmitter.o CParticleCylinderEmitter.o CParticleMeshEmitter.o CParticlePointEmitter.o CParticleRingEmitter.o CParticleSphereEmitter.o CParticleAttractionAffector.o CParticleFadeOutAffector.o CParticleGravityAffector.o CParticleRotationAffector.o CParticleSystemSceneNode.o CParticleScaleAffector.o IRRANIMOBJ = CSceneNodeAnimatorCameraFPS.o CSceneNodeAnimatorCameraMaya.o CSceneNodeAnimatorCollisionResponse.o CSceneNodeAnimatorDelete.o CSceneNodeAnimatorFlyCircle.o CSceneNodeAnimatorFlyStraight.o CSceneNodeAnimatorFollowSpline.o CSceneNodeAnimatorRotation.o CSceneNodeAnimatorTexture.o -IRRDRVROBJ = CNullDriver.o CCgMaterialRenderer.o COpenGLCgMaterialRenderer.o COpenGLDriver.o COpenGLNormalMapRenderer.o COpenGLParallaxMapRenderer.o COpenGLShaderMaterialRenderer.o COpenGLTexture.o COpenGLSLMaterialRenderer.o COpenGLExtensionHandler.o CD3D8Driver.o CD3D8NormalMapRenderer.o CD3D8ParallaxMapRenderer.o CD3D8ShaderMaterialRenderer.o CD3D8Texture.o CD3D9Driver.o CD3D9HLSLMaterialRenderer.o CD3D9NormalMapRenderer.o CD3D9ParallaxMapRenderer.o CD3D9ShaderMaterialRenderer.o CD3D9Texture.o COGLESDriver.o COGLESTexture.o COGLESExtensionHandler.o COGLES2Driver.o COGLES2ExtensionHandler.o COGLES2FixedPipelineRenderer.o COGLES2MaterialRenderer.o COGLES2NormalMapRenderer.o COGLES2ParallaxMapRenderer.o COGLES2Renderer2D.o COGLES2Texture.o CEGLManager.o CEGLManager.o CWGLManager.o CGLXManager.o +IRRDRVROBJ = CNullDriver.o COpenGLCacheHandler.o COpenGLDriver.o COpenGLNormalMapRenderer.o COpenGLParallaxMapRenderer.o COpenGLShaderMaterialRenderer.o COpenGLSLMaterialRenderer.o COpenGLExtensionHandler.o CD3D9Driver.o CD3D9HLSLMaterialRenderer.o CD3D9NormalMapRenderer.o CD3D9ParallaxMapRenderer.o CD3D9ShaderMaterialRenderer.o CD3D9Texture.o COGLESDriver.o COGLESTexture.o COGLESExtensionHandler.o COGLES2Driver.o COGLES2ExtensionHandler.o COGLES2FixedPipelineRenderer.o COGLES2MaterialRenderer.o COGLES2NormalMapRenderer.o COGLES2ParallaxMapRenderer.o COGLES2Renderer2D.o COGLES2Texture.o CEGLManager.o CEGLManager.o CWGLManager.o CGLXManager.o IRRIMAGEOBJ = CColorConverter.o CImage.o CImageLoaderBMP.o CImageLoaderDDS.o CImageLoaderJPG.o CImageLoaderPCX.o CImageLoaderPNG.o CImageLoaderPSD.o CImageLoaderPVR.o CImageLoaderTGA.o CImageLoaderPPM.o CImageLoaderWAL.o CImageLoaderRGB.o \ CImageWriterBMP.o CImageWriterJPG.o CImageWriterPCX.o CImageWriterPNG.o CImageWriterPPM.o CImageWriterPSD.o CImageWriterTGA.o IRRVIDEOOBJ = CVideoModeList.o CFPSCounter.o $(IRRDRVROBJ) $(IRRIMAGEOBJ) diff --git a/source/Irrlicht/S4DVertex.h b/source/Irrlicht/S4DVertex.h index 49d4e87b..b0f0436a 100644 --- a/source/Irrlicht/S4DVertex.h +++ b/source/Irrlicht/S4DVertex.h @@ -644,9 +644,9 @@ inline void getTexel_plain2 ( tFixPoint &r, tFixPoint &g, tFixPoint &b, const sVec4 &v ) { - r = tofix ( v.y ); - g = tofix ( v.z ); - b = tofix ( v.w ); + r = tofix(v.y, FIX_POINT_F32_MUL); + g = tofix(v.z, FIX_POINT_F32_MUL); + b = tofix(v.w, FIX_POINT_F32_MUL); } /* @@ -656,7 +656,7 @@ inline void getSample_color ( tFixPoint &a, tFixPoint &r, tFixPoint &g, tFixPoin const sVec4 &v ) { - a = tofix ( v.x ); + a = tofix(v.x, FIX_POINT_F32_MUL); r = tofix ( v.y, COLOR_MAX * FIX_POINT_F32_MUL); g = tofix ( v.z, COLOR_MAX * FIX_POINT_F32_MUL); b = tofix ( v.w, COLOR_MAX * FIX_POINT_F32_MUL); diff --git a/source/Irrlicht/SB3DStructs.h b/source/Irrlicht/SB3DStructs.h new file mode 100644 index 00000000..8f88a850 --- /dev/null +++ b/source/Irrlicht/SB3DStructs.h @@ -0,0 +1,71 @@ +// Copyright (C) 2006-2012 Luke Hoschke +// This file is part of the "Irrlicht Engine". +// For conditions of distribution and use, see copyright notice in irrlicht.h + +// B3D Mesh loader +// File format designed by Mark Sibly for the Blitz3D engine and has been +// declared public domain + +#include "IrrCompileConfig.h" + +#ifndef SB3DSTRUCTS_H +#define SB3DSTRUCTS_H + +#include "SMaterial.h" + +namespace irr { +namespace scene { + +struct SB3dChunkHeader +{ + c8 name[4]; + s32 size; +}; + +struct SB3dChunk +{ + SB3dChunk(const SB3dChunkHeader& header, long sp) + : length(header.size+8), startposition(sp) + { + name[0]=header.name[0]; + name[1]=header.name[1]; + name[2]=header.name[2]; + name[3]=header.name[3]; + } + c8 name[4]; + s32 length; + long startposition; +}; + +struct SB3dTexture +{ + core::stringc TextureName; + s32 Flags; + s32 Blend; + f32 Xpos; + f32 Ypos; + f32 Xscale; + f32 Yscale; + f32 Angle; +}; + +struct SB3dMaterial +{ + SB3dMaterial() : red(1.0f), green(1.0f), + blue(1.0f), alpha(1.0f), shininess(0.0f), blend(1), + fx(0) + { + for (u32 i=0; igetMaterial2D().TextureLayer[0].BilinearFilter = true; { - driver->beginScene(true, true, video::SColor(255,120,102,136)); + driver->beginScene(video::ECBF_COLOR | video::ECBF_DEPTH, video::SColor(255,120,102,136)); driver->enableMaterial2D(); @@ -822,7 +822,7 @@ static bool addBlend2d(video::E_DRIVER_TYPE type) } material2D.AntiAliasing=video::EAAM_FULL_BASIC; - driver->beginScene(true, true, video::SColor(255,100,101,140)); + driver->beginScene(video::ECBF_COLOR | video::ECBF_DEPTH, video::SColor(255,100,101,140)); smgr->drawAll(); driver->enableMaterial2D(); env->drawAll(); @@ -871,7 +871,7 @@ static bool moreFilterTests(video::E_DRIVER_TYPE type) driver->getMaterial2D().TextureLayer[0].TrilinearFilter=true; { - driver->beginScene(true, true, irr::video::SColor(255,255,255,255)); + driver->beginScene(video::ECBF_COLOR | video::ECBF_DEPTH, irr::video::SColor(255,255,255,255)); // all three logos should be with filtering driver->enableMaterial2D(); diff --git a/tests/anti-aliasing.cpp b/tests/anti-aliasing.cpp index 09205be4..62446c5f 100644 --- a/tests/anti-aliasing.cpp +++ b/tests/anti-aliasing.cpp @@ -52,7 +52,7 @@ static bool testLineRendering(video::E_DRIVER_TYPE type) smgr->addCameraSceneNode(0, core::vector3df(0,30,-40), core::vector3df(0,5,0)); device->getTimer()->setTime(0); // scene has animations and current scene seems to be saved at that time - driver->beginScene(true, true, video::SColor(255,100,101,140)); + driver->beginScene(video::ECBF_COLOR | video::ECBF_DEPTH, video::SColor(255,100,101,140)); smgr->drawAll(); driver->draw3DBox(node->getBoundingBox(), video::SColor(0,255,0,0)); driver->draw2DLine(core::position2di(10,10), core::position2di(100,100), video::SColor(255,0,0,0)); diff --git a/tests/b3dAnimation.cpp b/tests/b3dAnimation.cpp index 50ec9df2..c0dbf3b5 100644 --- a/tests/b3dAnimation.cpp +++ b/tests/b3dAnimation.cpp @@ -52,7 +52,7 @@ bool b3dAnimation(void) // Just jump to the last frame since that's all we're interested in. device->run(); - driver->beginScene(true, true, video::SColor(255, 60, 60, 60)); + driver->beginScene(video::ECBF_COLOR | video::ECBF_DEPTH, video::SColor(255, 60, 60, 60)); smgr->drawAll(); driver->endScene(); @@ -73,7 +73,7 @@ bool b3dAnimation(void) // Simple render call device->run(); - driver->beginScene(true, true, video::SColor(255, 60, 60, 60)); + driver->beginScene(video::ECBF_COLOR | video::ECBF_DEPTH, video::SColor(255, 60, 60, 60)); smgr->drawAll(); driver->endScene(); diff --git a/tests/billboards.cpp b/tests/billboards.cpp index 20e0f861..2b1499b1 100644 --- a/tests/billboards.cpp +++ b/tests/billboards.cpp @@ -96,7 +96,7 @@ bool billboardSize(void) bool result = false; device->run(); - driver->beginScene(true, true, video::SColor(255, 60, 60, 60)); + driver->beginScene(video::ECBF_COLOR | video::ECBF_DEPTH, video::SColor(255, 60, 60, 60)); smgr->drawAll(); driver->endScene(); @@ -132,7 +132,7 @@ bool billboardOrientation(void) bool result = false; device->run(); - driver->beginScene(true, true, video::SColor(255, 60, 60, 60)); + driver->beginScene(video::ECBF_COLOR | video::ECBF_DEPTH, video::SColor(255, 60, 60, 60)); smgr->drawAll(); driver->endScene(); diff --git a/tests/burningsVideo.cpp b/tests/burningsVideo.cpp index 6271a640..665a4865 100644 --- a/tests/burningsVideo.cpp +++ b/tests/burningsVideo.cpp @@ -25,7 +25,7 @@ bool burningsVideo(void) bool result = false; device->run(); - if (driver->beginScene(true, true, video::SColor(0, 80, 80, 80))) + if (driver->beginScene(video::ECBF_COLOR | video::ECBF_DEPTH, video::SColor(0, 80, 80, 80))) { smgr->drawAll(); driver->endScene(); diff --git a/tests/createImage.cpp b/tests/createImage.cpp index 55cb57e0..91a20e56 100644 --- a/tests/createImage.cpp +++ b/tests/createImage.cpp @@ -42,7 +42,7 @@ bool testImageCreation() } } - driver->beginScene(true, true, video::SColor(255,255,0,255));//Backbuffer background is pink + driver->beginScene(video::ECBF_COLOR | video::ECBF_DEPTH, video::SColor(255,255,0,255));//Backbuffer background is pink driver->draw2DImage(tex, core::position2d(0,0), core::recti(0,0,32,32)); driver->draw2DImage(tex1, core::position2d(32,0)); @@ -69,7 +69,7 @@ bool testImageFormats() video::IVideoDriver* driver = device->getVideoDriver(); video::ITexture* tex=driver->getTexture("../media/water.jpg"); video::ITexture* tex1=driver->getTexture("media/grey.tga"); - driver->beginScene(true, true); + driver->beginScene(video::ECBF_COLOR | video::ECBF_DEPTH, video::SColor(255,0,0,0)); driver->draw2DImage(tex, core::position2d(0,0), core::recti(0,0,64,64)); driver->draw2DImage(tex1, core::position2d(0,64), core::recti(0,0,64,64)); diff --git a/tests/draw2DImage.cpp b/tests/draw2DImage.cpp index a6037459..4508f8c5 100644 --- a/tests/draw2DImage.cpp +++ b/tests/draw2DImage.cpp @@ -28,20 +28,26 @@ bool testWithRenderTarget(video::E_DRIVER_TYPE driverType) logTestString("Testing driver %ls\n", driver->getName()); - video::ITexture* RenderTarget=driver->addRenderTargetTexture(core::dimension2d(64,64), "BASEMAP"); + video::ITexture* renderTargetTex = driver->addRenderTargetTexture(core::dimension2d(64, 64), "BASEMAP"); + video::ITexture* renderTargetDepth = driver->addRenderTargetTexture(core::dimension2d(64, 64), "rtd", video::ECF_D16); - video::ITexture *tex=driver->getTexture("../media/water.jpg"); + video::IRenderTarget* renderTarget = driver->addRenderTarget(); + renderTarget->setTexture(renderTargetTex, renderTargetDepth); - driver->beginScene(true, true, video::SColor(255,255,0,255));//Backbuffer background is pink + video::ITexture* tex=driver->getTexture("../media/water.jpg"); + + driver->beginScene(video::ECBF_COLOR | video::ECBF_DEPTH, video::SColor(255,255,0,255));//Backbuffer background is pink //draw the 256x256 water image on the rendertarget: - driver->setRenderTarget(RenderTarget,true,true,video::SColor(255,0,0,255));//Rendertarget background is blue + + + driver->setRenderTarget(renderTarget,video::ECBF_COLOR|video::ECBF_DEPTH,video::SColor(255,0,0,255));//Rendertarget background is blue driver->draw2DImage(tex, core::position2d(0,0), core::recti(0,0,32,32)); - driver->setRenderTarget(0, false); + driver->setRenderTarget((video::IRenderTarget*)0, 0); //draw the rendertarget on screen: //this should normally draw a 64x64 image containing a 32x32 image in the top left corner - driver->draw2DImage(RenderTarget, core::position2d(0,0)); + driver->draw2DImage(renderTargetTex, core::position2d(0,0)); driver->endScene(); bool result = takeScreenshotAndCompareAgainstReference(driver, "-draw2DImageRTT.png"); @@ -70,7 +76,7 @@ bool testRectangles(video::E_DRIVER_TYPE driverType) video::ITexture *tex=driver->getTexture("../media/fireball.bmp"); - driver->beginScene(true, true, video::SColor(255,255,0,255));//Backbuffer background is pink + driver->beginScene(video::ECBF_COLOR | video::ECBF_DEPTH, video::SColor(255,255,0,255));//Backbuffer background is pink // draw normal, will be overdrwan in error case driver->draw2DImage(tex, core::recti(68,32,132,96), core::recti(0,0,64,64)); @@ -113,7 +119,7 @@ bool testWithPNG(video::E_DRIVER_TYPE driverType) video::ITexture *tex=driver->getTexture("media/RedbrushAlpha-0.25.png"); - driver->beginScene(true, true, video::SColor(255,40,40,255));//Backbuffer background is blue + driver->beginScene(video::ECBF_COLOR | video::ECBF_DEPTH, video::SColor(255,40,40,255));//Backbuffer background is blue driver->draw2DImage(tex, core::recti(0,0,160,120), core::recti(0,0,256,256), 0, 0, true); driver->endScene(); @@ -150,16 +156,21 @@ bool testExactPlacement(video::E_DRIVER_TYPE driverType) logTestString("Testing driver %ls\n", driver->getName()); - video::ITexture* rt=driver->addRenderTargetTexture(core::dimension2d(32,32), "rt1"); - video::ITexture *tex=driver->getTexture("../media/fireball.bmp"); + video::ITexture* renderTargetTex = driver->addRenderTargetTexture(core::dimension2d(32, 32), "rt1"); + video::ITexture* renderTargetDepth = driver->addRenderTargetTexture(core::dimension2d(32, 32), "rtd", video::ECF_D16); - driver->beginScene(true, true, video::SColor(255,40,40,255));//Backbuffer background is blue - driver->setRenderTarget(rt); + video::IRenderTarget* renderTarget = driver->addRenderTarget(); + renderTarget->setTexture(renderTargetTex, renderTargetDepth); + + video::ITexture* tex=driver->getTexture("../media/fireball.bmp"); + + driver->beginScene(video::ECBF_COLOR | video::ECBF_DEPTH, video::SColor(255,40,40,255));//Backbuffer background is blue + driver->setRenderTarget(renderTarget, 0, video::ECBF_COLOR | video::ECBF_DEPTH); driver->draw2DImage(tex, core::recti(0,0,32,32), core::recti(0,0,64,64)); - driver->setRenderTarget(0); + driver->setRenderTarget((video::IRenderTarget*)0, 0, 0); driver->endScene(); - video::IImage* img = driver->createImage(rt, core::vector2di(), rt->getSize()); + video::IImage* img = driver->createImage(renderTargetTex, core::vector2di(), renderTargetTex->getSize()); driver->writeImageToFile(img, "results/fireball.png"); img->drop(); bool result = fuzzyCompareImages(driver, "media/fireball.png", "results/fireball.png")>98.25f; diff --git a/tests/drawPixel.cpp b/tests/drawPixel.cpp index 6ae19b87..38a6baf6 100644 --- a/tests/drawPixel.cpp +++ b/tests/drawPixel.cpp @@ -34,7 +34,7 @@ static bool lineRender(E_DRIVER_TYPE driverType) cube->setMaterialFlag(video::EMF_LIGHTING, false); (void)smgr->addCameraSceneNode(); - driver->beginScene(true, true, SColor(255,100,101,140)); + driver->beginScene(video::ECBF_COLOR | video::ECBF_DEPTH, SColor(255,100,101,140)); smgr->drawAll(); // Test for benign handling of offscreen pixel values as well as onscreen ones. @@ -74,7 +74,7 @@ static bool pixelAccuracy(E_DRIVER_TYPE driverType) device->getSceneManager()->addCameraSceneNode(); - driver->beginScene(true, true, SColor(255,100,101,140)); + driver->beginScene(video::ECBF_COLOR | video::ECBF_DEPTH, SColor(255,100,101,140)); u32 start=0; for (u32 count=1; count<10; ++count) { @@ -136,7 +136,7 @@ static bool drawLine(E_DRIVER_TYPE driverType) device->getSceneManager()->addCameraSceneNode(); - driver->beginScene(true, true, SColor(255,100,101,140)); + driver->beginScene(video::ECBF_COLOR | video::ECBF_DEPTH, SColor(255,100,101,140)); // horizontal lines for (u32 i=0; i<20; ++i) { diff --git a/tests/drawRectOutline.cpp b/tests/drawRectOutline.cpp index 096fb7e1..6995e155 100644 --- a/tests/drawRectOutline.cpp +++ b/tests/drawRectOutline.cpp @@ -18,7 +18,7 @@ bool testWithDriver(video::E_DRIVER_TYPE driverType) logTestString("Testing driver %ls\n", driver->getName()); - driver->beginScene(true, true, video::SColor(255,100,101,140)); + driver->beginScene(video::ECBF_COLOR | video::ECBF_DEPTH, video::SColor(255,100,101,140)); core::recti r; r.UpperLeftCorner = core::position2di(1,1); diff --git a/tests/drawVertexPrimitive.cpp b/tests/drawVertexPrimitive.cpp index 70f6c6ff..e121f584 100644 --- a/tests/drawVertexPrimitive.cpp +++ b/tests/drawVertexPrimitive.cpp @@ -52,7 +52,7 @@ bool testWithDriver(video::E_DRIVER_TYPE driverType) bool result = true; for (u32 Type=scene::EPT_POINTS; Type <= scene::EPT_POINT_SPRITES; ++Type) { - driver->beginScene(true, true, video::SColor(255,100,101,140)); + driver->beginScene(video::ECBF_COLOR | video::ECBF_DEPTH, video::SColor(255,100,101,140)); smgr->drawAll(); u32 primCount = 0; switch (Type) @@ -85,7 +85,7 @@ bool testWithDriver(video::E_DRIVER_TYPE driverType) // we use character enumeration as we have more than 9 types name.append(Type-scene::EPT_POINTS+'a'); name.append(".png"); - result &= takeScreenshotAndCompareAgainstReference(driver, name.c_str()); + result &= takeScreenshotAndCompareAgainstReference(driver, name.c_str(), 97.f); } device->closeDevice(); diff --git a/tests/fast_atof.cpp b/tests/fast_atof.cpp index bab463cc..01599dda 100644 --- a/tests/fast_atof.cpp +++ b/tests/fast_atof.cpp @@ -91,7 +91,7 @@ static bool testCalculation_atof(const char * valueString) valueString, newFastValue, oldFastValue, atofValue); const f32 diffNew = fabs(newFastValue - atofValue) ; - const f32 diffOld = fabs(newFastValue - atofValue) ; + const f32 diffOld = fabs(oldFastValue - atofValue) ; bool accurate = diffNew <= diffOld || equalsByUlp(diffNew, diffOld, 1); if(!accurate) diff --git a/tests/flyCircleAnimator.cpp b/tests/flyCircleAnimator.cpp index 89f25377..272dd895 100644 --- a/tests/flyCircleAnimator.cpp +++ b/tests/flyCircleAnimator.cpp @@ -44,7 +44,7 @@ bool flyCircleAnimator(void) bool result = false; // Don't do device->run() since I need the time to remain at 0. - if (driver->beginScene(true, true, video::SColor(0, 80, 80, 80))) + if (driver->beginScene(video::ECBF_COLOR | video::ECBF_DEPTH, video::SColor(0, 80, 80, 80))) { smgr->drawAll(); driver->endScene(); diff --git a/tests/guiDisabledMenu.cpp b/tests/guiDisabledMenu.cpp index 5c1ee125..9ca2466f 100644 --- a/tests/guiDisabledMenu.cpp +++ b/tests/guiDisabledMenu.cpp @@ -44,7 +44,7 @@ bool guiDisabledMenu(void) (void)menu->OnEvent(event); device->run(); - driver->beginScene(true, true, video::SColor(150,50,50,50)); + driver->beginScene(video::ECBF_COLOR | video::ECBF_DEPTH, video::SColor(150,50,50,50)); env->drawAll(); driver->endScene(); diff --git a/tests/ioScene.cpp b/tests/ioScene.cpp index f7a3fa60..f36f33b1 100644 --- a/tests/ioScene.cpp +++ b/tests/ioScene.cpp @@ -91,7 +91,7 @@ static bool loadScene(void) bool result = false; device->run(); device->getTimer()->setTime(666); // scene has animations and current scene seems to be saved at that time ... really - best result with just that number :-) - if (driver->beginScene(true, true, video::SColor(0, 80, 80, 80))) + if (driver->beginScene(video::ECBF_COLOR | video::ECBF_DEPTH, video::SColor(0, 80, 80, 80))) { smgr->drawAll(); driver->endScene(); diff --git a/tests/lightMaps.cpp b/tests/lightMaps.cpp index 05e6c350..2e9273f2 100644 --- a/tests/lightMaps.cpp +++ b/tests/lightMaps.cpp @@ -48,7 +48,7 @@ static bool runTestWithDriver(E_DRIVER_TYPE driverType) (void)smgr->addCameraSceneNode(0, core::vector3df(0,0,0), core::vector3df(40,100,30)); - driver->beginScene(true, true, video::SColor(255,255,255,0)); + driver->beginScene(video::ECBF_COLOR | video::ECBF_DEPTH, video::SColor(255,255,255,0)); smgr->drawAll(); driver->endScene(); diff --git a/tests/lights.cpp b/tests/lights.cpp index 7913d4e9..5c0dce0d 100644 --- a/tests/lights.cpp +++ b/tests/lights.cpp @@ -48,7 +48,7 @@ static bool testLightTypes(video::E_DRIVER_TYPE driverType) light3->setLightType(video::ELT_DIRECTIONAL); light1->getLightData().DiffuseColor.set(0,1,0); - driver->beginScene (true, true, 0); + driver->beginScene(video::ECBF_COLOR | video::ECBF_DEPTH, video::SColor(0)); smgr->drawAll(); driver->endScene(); diff --git a/tests/makeColorKeyTexture.cpp b/tests/makeColorKeyTexture.cpp index 70482afb..288a4268 100644 --- a/tests/makeColorKeyTexture.cpp +++ b/tests/makeColorKeyTexture.cpp @@ -37,7 +37,7 @@ static bool doTestWith(E_DRIVER_TYPE driverType, zeroTexels); (void)smgr->addCameraSceneNode(); - driver->beginScene(true, true, SColor(255,100,101,140)); + driver->beginScene(video::ECBF_COLOR | video::ECBF_DEPTH, SColor(255,100,101,140)); smgr->drawAll(); driver->draw2DImage(Texture, @@ -49,7 +49,7 @@ static bool doTestWith(E_DRIVER_TYPE driverType, driver->endScene(); char screenshotName[256]; - (void)snprintf(screenshotName, 256, "-makeColorKeyTexture-%s.png", + (void)snprintf_irr(screenshotName, 256, "-makeColorKeyTexture-%s.png", zeroTexels? "old" : "new"); bool result = takeScreenshotAndCompareAgainstReference(driver, screenshotName); diff --git a/tests/material.cpp b/tests/material.cpp index 947c6152..cf44a612 100644 --- a/tests/material.cpp +++ b/tests/material.cpp @@ -46,7 +46,7 @@ static bool polygonOffset(video::E_DRIVER_TYPE type) plane->getMaterial(0).PolygonOffsetDirection=video::EPO_BACK; plane->getMaterial(0).PolygonOffsetFactor=7; - driver->beginScene(true, true, video::SColor(255,113,113,133)); + driver->beginScene(video::ECBF_COLOR | video::ECBF_DEPTH, video::SColor(255,113,113,133)); smgr->drawAll(); driver->endScene(); bool result = takeScreenshotAndCompareAgainstReference(driver, "-polygonBack.png"); @@ -56,7 +56,7 @@ static bool polygonOffset(video::E_DRIVER_TYPE type) // test front plane to front plane2->getMaterial(0).PolygonOffsetDirection=video::EPO_FRONT; plane2->getMaterial(0).PolygonOffsetFactor=7; - driver->beginScene(true, true, video::SColor(255,113,113,133)); + driver->beginScene(video::ECBF_COLOR | video::ECBF_DEPTH, video::SColor(255,113,113,133)); smgr->drawAll(); driver->endScene(); result &= takeScreenshotAndCompareAgainstReference(driver, "-polygonFront.png"); diff --git a/tests/md2Animation.cpp b/tests/md2Animation.cpp index 9feebd90..29013743 100644 --- a/tests/md2Animation.cpp +++ b/tests/md2Animation.cpp @@ -41,7 +41,7 @@ bool testLastFrame() node->setCurrentFrame((f32)(node->getEndFrame())); node->setAnimationSpeed(0); device->run(); - driver->beginScene(true, true, video::SColor(255, 255, 255, 0)); + driver->beginScene(video::ECBF_COLOR | video::ECBF_DEPTH, video::SColor(255, 255, 255, 0)); smgr->drawAll(); driver->endScene(); if (mesh->getBoundingBox() != mesh->getMesh(node->getEndFrame())->getBoundingBox()) @@ -103,7 +103,7 @@ bool testNormals() node->setMD2Animation(scene::EMAT_STAND); node->setAnimationSpeed(0); device->run(); - driver->beginScene(true, true, video::SColor(255, 255, 255, 0)); + driver->beginScene(video::ECBF_COLOR | video::ECBF_DEPTH, video::SColor(255, 255, 255, 0)); smgr->drawAll(); driver->endScene(); } diff --git a/tests/media/Burning's Video-2dmatFilter.png b/tests/media/Burning's Video-2dmatFilter.png index 489386c0..af1a9e0b 100644 Binary files a/tests/media/Burning's Video-2dmatFilter.png and b/tests/media/Burning's Video-2dmatFilter.png differ diff --git a/tests/media/Burning's Video-flyCircleAnimator.png b/tests/media/Burning's Video-flyCircleAnimator.png index b54b98e4..fbc2ecad 100644 Binary files a/tests/media/Burning's Video-flyCircleAnimator.png and b/tests/media/Burning's Video-flyCircleAnimator.png differ diff --git a/tests/media/Burning's Video-viewPortText.png b/tests/media/Burning's Video-viewPortText.png index 797cdaf0..7c9f7813 100644 Binary files a/tests/media/Burning's Video-viewPortText.png and b/tests/media/Burning's Video-viewPortText.png differ diff --git a/tests/media/Direct3D 8.1-addBlend2D.png b/tests/media/Direct3D 8.1-addBlend2D.png deleted file mode 100644 index 2c9bba58..00000000 Binary files a/tests/media/Direct3D 8.1-addBlend2D.png and /dev/null differ diff --git a/tests/media/Direct3D 8.1-drawPixel.png b/tests/media/Direct3D 8.1-drawPixel.png deleted file mode 100644 index c045fafd..00000000 Binary files a/tests/media/Direct3D 8.1-drawPixel.png and /dev/null differ diff --git a/tests/media/Direct3D 8.1-lightType.png b/tests/media/Direct3D 8.1-lightType.png deleted file mode 100644 index d8589532..00000000 Binary files a/tests/media/Direct3D 8.1-lightType.png and /dev/null differ diff --git a/tests/media/Direct3D 8.1-lightmaps.png b/tests/media/Direct3D 8.1-lightmaps.png deleted file mode 100644 index dd35dc8c..00000000 Binary files a/tests/media/Direct3D 8.1-lightmaps.png and /dev/null differ diff --git a/tests/media/Direct3D 8.1-orthoCam.png b/tests/media/Direct3D 8.1-orthoCam.png deleted file mode 100644 index 54d4118f..00000000 Binary files a/tests/media/Direct3D 8.1-orthoCam.png and /dev/null differ diff --git a/tests/media/Direct3D 8.1-rttWith2DImage.png b/tests/media/Direct3D 8.1-rttWith2DImage.png deleted file mode 100644 index 93cf6410..00000000 Binary files a/tests/media/Direct3D 8.1-rttWith2DImage.png and /dev/null differ diff --git a/tests/media/Direct3D 8.1-stencilSelfShadow.png b/tests/media/Direct3D 8.1-stencilSelfShadow.png deleted file mode 100644 index c816ef05..00000000 Binary files a/tests/media/Direct3D 8.1-stencilSelfShadow.png and /dev/null differ diff --git a/tests/media/Direct3D 8.1-stencilShadow.png b/tests/media/Direct3D 8.1-stencilShadow.png deleted file mode 100644 index 7b222b4b..00000000 Binary files a/tests/media/Direct3D 8.1-stencilShadow.png and /dev/null differ diff --git a/tests/media/Direct3D 8.1-textureMatrixInMixedScenes.png b/tests/media/Direct3D 8.1-textureMatrixInMixedScenes.png deleted file mode 100644 index 187d3b8e..00000000 Binary files a/tests/media/Direct3D 8.1-textureMatrixInMixedScenes.png and /dev/null differ diff --git a/tests/media/Direct3D 8.1-textureRenderStates.png b/tests/media/Direct3D 8.1-textureRenderStates.png deleted file mode 100644 index 98282fa1..00000000 Binary files a/tests/media/Direct3D 8.1-textureRenderStates.png and /dev/null differ diff --git a/tests/media/OpenGL-drawVPL_h.png b/tests/media/OpenGL-drawVPL_h.png index 1207bc01..7633958c 100644 Binary files a/tests/media/OpenGL-drawVPL_h.png and b/tests/media/OpenGL-drawVPL_h.png differ diff --git a/tests/meshTransform.cpp b/tests/meshTransform.cpp index aa15794c..e57bcb0b 100644 --- a/tests/meshTransform.cpp +++ b/tests/meshTransform.cpp @@ -58,7 +58,7 @@ bool meshTransform(void) // Just jump to the last frame since that's all we're interested in. device->run(); - driver->beginScene(true, true, SColor(255, 60, 60, 60)); + driver->beginScene(video::ECBF_COLOR | video::ECBF_DEPTH, SColor(255, 60, 60, 60)); smgr->drawAll(); driver->endScene(); @@ -74,7 +74,7 @@ bool meshTransform(void) // Just jump to the last frame since that's all we're interested in. device->run(); - driver->beginScene(true, true, SColor(255, 60, 60, 60)); + driver->beginScene(video::ECBF_COLOR | video::ECBF_DEPTH, SColor(255, 60, 60, 60)); smgr->drawAll(); driver->endScene(); diff --git a/tests/mrt.cpp b/tests/mrt.cpp index 28d91c6a..b13de27d 100644 --- a/tests/mrt.cpp +++ b/tests/mrt.cpp @@ -25,20 +25,25 @@ static bool testWithDriver(video::E_DRIVER_TYPE driverType) const char* const ps2="void main(void)\n {\n gl_FragData[0] = vec4(1.0,1.0,1.0,1.0);\n gl_FragData[1] = vec4(0.0,1.0,0.0,1.0);\n gl_FragData[2] = vec4(0.0,0.0,1.0,1.0);\n }"; // variable - video::ITexture* gbuffer[3]; - core::array gbufferlist; + video::IRenderTarget* renderTarget = 0; + core::array renderTargetTex; + video::ITexture* renderTargetDepth = 0; + const core::dimension2du texsize(64,64); bool result=true; s32 newMaterialType = -1; if (device->getVideoDriver()->getDriverAttributes().getAttributeAsInt("MaxMultipleRenderTargets") > 2) { - // allocate buffer - gbuffer[0] = driver->addRenderTargetTexture(texsize, "rta", video::ECF_A8R8G8B8); - gbuffer[1] = driver->addRenderTargetTexture(texsize, "rtb", video::ECF_A8R8G8B8); - gbuffer[2] = driver->addRenderTargetTexture(texsize, "rtc", video::ECF_A8R8G8B8); - for( u32 i = 0; i < 3; ++i ) - gbufferlist.push_back( video::IRenderTarget(gbuffer[i]) ); + renderTargetTex.set_used(3); + renderTargetTex[0] = driver->addRenderTargetTexture(texsize, "rta", video::ECF_A8R8G8B8); + renderTargetTex[1] = driver->addRenderTargetTexture(texsize, "rtb", video::ECF_A8R8G8B8); + renderTargetTex[2] = driver->addRenderTargetTexture(texsize, "rtc", video::ECF_A8R8G8B8); + + renderTargetDepth = driver->addRenderTargetTexture(texsize, "rtd", video::ECF_D16); + + renderTarget = driver->addRenderTarget(); + renderTarget->setTexture(renderTargetTex, renderTargetDepth); video::IGPUProgrammingServices* gpu = driver->getGPUProgrammingServices(); @@ -57,32 +62,32 @@ static bool testWithDriver(video::E_DRIVER_TYPE driverType) node->setMaterialType((video::E_MATERIAL_TYPE)newMaterialType); device->getSceneManager()->addCameraSceneNode(0, core::vector3df(0,0,-10)); - driver->beginScene (true, true, video::SColor (255, 200, 200, 200)); + driver->beginScene(video::ECBF_COLOR, video::SColor(255, 0, 0, 0)); // render - driver->setRenderTarget( gbufferlist ); + driver->setRenderTarget(renderTarget, video::ECBF_COLOR | video::ECBF_DEPTH, video::SColor(255,0,0,0)); device->getSceneManager()->drawAll(); - driver->setRenderTarget(0); + driver->setRenderTarget((video::IRenderTarget*)0, 0, video::SColor(255, 0, 0, 0)); // draw debug rt - driver->draw2DImage(gbuffer[0], core::position2d(0,0)); - driver->draw2DImage(gbuffer[1], core::position2d(64,0)); - driver->draw2DImage(gbuffer[2], core::position2d(128,0)); + driver->draw2DImage(renderTargetTex[0], core::position2d(0,0)); + driver->draw2DImage(renderTargetTex[1], core::position2d(64,0)); + driver->draw2DImage(renderTargetTex[2], core::position2d(128,0)); driver->endScene(); result = takeScreenshotAndCompareAgainstReference(driver, "-mrt.png"); - driver->beginScene (true, true, video::SColor (255, 200, 200, 200)); + driver->beginScene(video::ECBF_COLOR, video::SColor(255, 0, 0, 0)); // render device->getSceneManager()->getActiveCamera()->setPosition(core::vector3df(0,0,-15)); - driver->setRenderTarget( gbufferlist ); + driver->setRenderTarget(renderTarget, video::ECBF_COLOR | video::ECBF_DEPTH, video::SColor(255,0,0,0)); device->getSceneManager()->drawAll(); - driver->setRenderTarget(0); + driver->setRenderTarget((video::IRenderTarget*)0, 0, video::SColor(255,0,0,0)); // draw debug rt - driver->draw2DImage(gbuffer[0], core::position2d(0,0)); - driver->draw2DImage(gbuffer[1], core::position2d(64,0)); - driver->draw2DImage(gbuffer[2], core::position2d(128,0)); + driver->draw2DImage(renderTargetTex[0], core::position2d(0,0)); + driver->draw2DImage(renderTargetTex[1], core::position2d(64,0)); + driver->draw2DImage(renderTargetTex[2], core::position2d(128,0)); driver->endScene(); diff --git a/tests/orthoCam.cpp b/tests/orthoCam.cpp index cc395a98..e7feee4b 100644 --- a/tests/orthoCam.cpp +++ b/tests/orthoCam.cpp @@ -36,7 +36,7 @@ static bool testOrthoCam(video::E_DRIVER_TYPE driverType) light->setRadius(500.f); light->getLightData().DiffuseColor.set(0,1,1); - device->getVideoDriver()->beginScene (true, true, 0); + device->getVideoDriver()->beginScene(video::ECBF_COLOR | video::ECBF_DEPTH, video::SColor(0,0,0,0)); device->getSceneManager()->drawAll(); device->getVideoDriver()->endScene(); @@ -74,7 +74,7 @@ static bool testOrthoStencil(video::E_DRIVER_TYPE driverType) light->setRadius(500.f); light->getLightData().DiffuseColor.set(0,1,1); - device->getVideoDriver()->beginScene (true, true, 0); + device->getVideoDriver()->beginScene(video::ECBF_COLOR | video::ECBF_DEPTH, video::SColor(0,0,0,0)); device->getSceneManager()->drawAll(); device->getVideoDriver()->endScene(); @@ -96,7 +96,6 @@ bool orthoCam(void) // passed &= testOrthoCam(video::EDT_SOFTWARE); passed &= testOrthoCam(video::EDT_BURNINGSVIDEO); passed &= testOrthoCam(video::EDT_DIRECT3D9); - passed &= testOrthoCam(video::EDT_DIRECT3D8); passed &= testOrthoStencil(video::EDT_OPENGL); passed &= testOrthoStencil(video::EDT_DIRECT3D9); diff --git a/tests/planeMatrix.cpp b/tests/planeMatrix.cpp index 702cd3dd..1132a15b 100644 --- a/tests/planeMatrix.cpp +++ b/tests/planeMatrix.cpp @@ -72,7 +72,7 @@ static bool drawScaledOctree(void) (void)smgr->addCameraSceneNode(0, core::vector3df(0,0,0), core::vector3df(40,100,30)); - driver->beginScene(true, true, video::SColor(255,255,255,0)); + driver->beginScene(video::ECBF_COLOR | video::ECBF_DEPTH, video::SColor(255,255,255,0)); smgr->drawAll(); driver->endScene(); diff --git a/tests/projectionMatrix.cpp b/tests/projectionMatrix.cpp index 3c85bedc..0bdeaaf6 100644 --- a/tests/projectionMatrix.cpp +++ b/tests/projectionMatrix.cpp @@ -25,7 +25,7 @@ static bool runTestWithDriver(E_DRIVER_TYPE driverType) bool result = true; - driver->beginScene(true, false, SColor(255,0,0,0)); + driver->beginScene(video::ECBF_COLOR, SColor(255,0,0,0)); SMaterial mat; mat.MaterialType = EMT_SOLID; diff --git a/tests/renderTargetTexture.cpp b/tests/renderTargetTexture.cpp index 93bfed1c..1cc6d510 100644 --- a/tests/renderTargetTexture.cpp +++ b/tests/renderTargetTexture.cpp @@ -43,7 +43,7 @@ static bool testWith2DImage(video::E_DRIVER_TYPE driverType) video::SColor colors[4]={0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff}; //draw the image : - driver->beginScene (true, true, video::SColor (255, 200, 200, 200)); + driver->beginScene(video::ECBF_COLOR | video::ECBF_DEPTH, video::SColor (255, 200, 200, 200)); driver->draw2DImage (image, core::rect < s32 > (64 - image->getSize ().Width / 2, @@ -62,7 +62,7 @@ static bool testWith2DImage(video::E_DRIVER_TYPE driverType) scene::ISceneNode *modelNode = smgr->addMeshSceneNode(modelMesh); modelNode->setMaterialTexture (0, RTT_texture); - driver->beginScene (true, true, video::SColor (255, 200, 200, 200)); + driver->beginScene(video::ECBF_COLOR | video::ECBF_DEPTH, video::SColor (255, 200, 200, 200)); smgr->drawAll(); driver->endScene(); @@ -72,7 +72,7 @@ static bool testWith2DImage(video::E_DRIVER_TYPE driverType) //it's now fliped... for (u32 i=0; i<10; ++i) { - driver->beginScene (true, true, video::SColor (255, 200, 200, 200)); + driver->beginScene(video::ECBF_COLOR | video::ECBF_DEPTH, video::SColor (255, 200, 200, 200)); //draw img driver->draw2DImage (image, @@ -137,7 +137,12 @@ bool rttAndZBuffer(video::E_DRIVER_TYPE driverType) logTestString("Testing driver %ls\n", vd->getName()); - video::ITexture* rt = vd->addRenderTargetTexture(cp.WindowSize, "rt", video::ECF_A32B32G32R32F); + video::ITexture* renderTargetTex = vd->addRenderTargetTexture(cp.WindowSize, "rt", video::ECF_A32B32G32R32F); + video::ITexture* renderTargetDepth = vd->addRenderTargetTexture(cp.WindowSize, "rtd", video::ECF_D16); + + video::IRenderTarget* renderTarget = vd->addRenderTarget(); + renderTarget->setTexture(renderTargetTex, renderTargetDepth); + video::S3DVertex vertices[4]; vertices[0].Pos.Z = vertices[1].Pos.Z = vertices[2].Pos.Z = vertices[3].Pos.Z = 1.0f; vertices[0].Pos.Y = vertices[1].Pos.Y = 1.0f; @@ -184,14 +189,14 @@ bool rttAndZBuffer(video::E_DRIVER_TYPE driverType) mesh->drop(); { - vd->beginScene(true, true, video::SColor(255, 0, 0, 0)); - vd->setRenderTarget(rt); + vd->beginScene(video::ECBF_COLOR | video::ECBF_DEPTH, video::SColor(255, 0, 0, 0)); + vd->setRenderTarget(renderTarget, 0, video::ECBF_COLOR | video::ECBF_DEPTH); sm->drawAll(); - vd->setRenderTarget(NULL); + vd->setRenderTarget((video::IRenderTarget*)0, 0, 0); vd->setTransform(video::ETS_WORLD, core::IdentityMatrix); vd->setTransform(video::ETS_VIEW, core::IdentityMatrix); vd->setTransform(video::ETS_PROJECTION, core::IdentityMatrix); - rtMat.setTexture(0, rt); + rtMat.setTexture(0, renderTargetTex); vd->setMaterial(rtMat); vd->drawIndexedTriangleList(vertices, 4, indices, 2); vd->endScene(); @@ -228,36 +233,33 @@ bool rttAndText(video::E_DRIVER_TYPE driverType) logTestString("Testing driver %ls\n", driver->getName()); //RTT - video::ITexture* rt = driver->addRenderTargetTexture(core::dimension2d(256, 256), "rt"); - if (!rt) - { - device->closeDevice(); - device->run(); - device->drop(); - return false; - } + video::ITexture* renderTargetTex = driver->addRenderTargetTexture(core::dimension2d(256, 256), "rt"); + video::ITexture* renderTargetDepth = driver->addRenderTargetTexture(core::dimension2d(256, 256), "rtd", video::ECF_D16); + + video::IRenderTarget* renderTarget = driver->addRenderTarget(); + renderTarget->setTexture(renderTargetTex, renderTargetDepth); stabilizeScreenBackground(driver); - driver->beginScene(true, true, video::SColor(255,255, 255, 255)); - driver->setRenderTarget(rt, true, true, video::SColor(255,255,0,255)); - driver->draw2DImage(driver->getTexture("../media/fireball.bmp"), core::recti(0, 0,rt->getSize().Width,rt->getSize().Height), core::recti(0,0,64,64)); + driver->beginScene(video::ECBF_COLOR | video::ECBF_DEPTH, video::SColor(255,255, 255, 255)); + driver->setRenderTarget(renderTarget, video::ECBF_COLOR | video::ECBF_DEPTH, video::SColor(255,255,0,255)); + driver->draw2DImage(driver->getTexture("../media/fireball.bmp"), core::recti(0, 0, renderTargetTex->getSize().Width, renderTargetTex->getSize().Height), core::recti(0, 0, 64, 64)); guienv->getBuiltInFont()->draw(L"OMGGG =!", core::rect(120, 100, 256, 256), video::SColor(255, 0, 0, 255)); - driver->setRenderTarget(0); + driver->setRenderTarget((video::IRenderTarget*)0, 0, 0); driver->endScene(); scene::ISceneManager* smgr = device->getSceneManager(); scene::ISceneNode* cube = smgr->addCubeSceneNode(20); cube->setMaterialFlag(video::EMF_LIGHTING, false); - cube->setMaterialTexture(0, rt); // set material of cube to render target + cube->setMaterialTexture(0, renderTargetTex); // set material of cube to render target smgr->addCameraSceneNode(0, core::vector3df(0, 0, -30)); // create a long text to produce much difference in failing result pictures gui::IGUIStaticText* text = guienv->addStaticText(L"asdddddddoamgmoasmgom\nfoaomsodommogdd\nddddddddd", core::rect(10, 20, 100, 160)); - driver->beginScene(true, true, video::SColor(255,255, 255, 255)); + driver->beginScene(video::ECBF_COLOR | video::ECBF_DEPTH, video::SColor(255,255, 255, 255)); cube->setVisible(false); smgr->drawAll(); guienv->drawAll(); @@ -280,11 +282,11 @@ bool rttAndText(video::E_DRIVER_TYPE driverType) return result; } -static void Render(IrrlichtDevice* device, video::ITexture* rt, core::vector3df& pos1, +static void Render(IrrlichtDevice* device, video::IRenderTarget* rt, core::vector3df& pos1, core::vector3df& pos2, scene::IAnimatedMesh* sphereMesh, core::vector3df& pos3, core::vector3df& pos4) { video::IVideoDriver* driver = device->getVideoDriver(); - driver->setRenderTarget(rt); + driver->setRenderTarget(rt, 0, video::ECBF_COLOR | video::ECBF_DEPTH); device->getSceneManager()->drawAll(); video::SMaterial mat; @@ -369,25 +371,38 @@ bool rttAndAntiAliasing(video::E_DRIVER_TYPE driverType) core::dimension2du dim_txt = core::dimension2du(160/2, 120/2); - video::ITexture* rt1 = device->getVideoDriver()->addRenderTargetTexture(dim_txt, "rt1", device->getColorFormat()); - video::ITexture* rt2 = device->getVideoDriver()->addRenderTargetTexture(dim_txt, "rt2", device->getColorFormat()); - video::ITexture* rt3 = device->getVideoDriver()->addRenderTargetTexture(dim_txt, "rt3", video::ECF_A8R8G8B8); - video::ITexture* rt4 = device->getVideoDriver()->addRenderTargetTexture(dim_txt, "rt4", device->getColorFormat()); + video::ITexture* renderTargetTex1 = driver->addRenderTargetTexture(dim_txt, "rt1", device->getColorFormat()); + video::ITexture* renderTargetTex2 = driver->addRenderTargetTexture(dim_txt, "rt2", device->getColorFormat()); + video::ITexture* renderTargetTex3 = driver->addRenderTargetTexture(dim_txt, "rt3", video::ECF_A8R8G8B8); + video::ITexture* renderTargetTex4 = driver->addRenderTargetTexture(dim_txt, "rt4", device->getColorFormat()); + video::ITexture* renderTargetDepth = driver->addRenderTargetTexture(dim_txt, "rtd", video::ECF_D16); + + video::IRenderTarget* renderTarget1 = driver->addRenderTarget(); + renderTarget1->setTexture(renderTargetTex1, renderTargetDepth); + + video::IRenderTarget* renderTarget2 = driver->addRenderTarget(); + renderTarget2->setTexture(renderTargetTex2, renderTargetDepth); + + video::IRenderTarget* renderTarget3 = driver->addRenderTarget(); + renderTarget3->setTexture(renderTargetTex3, renderTargetDepth); + + video::IRenderTarget* renderTarget4 = driver->addRenderTarget(); + renderTarget4->setTexture(renderTargetTex4, renderTargetDepth); device->getSceneManager()->setActiveCamera(cam); - device->getVideoDriver()->beginScene(); + device->getVideoDriver()->beginScene(video::ECBF_COLOR | video::ECBF_DEPTH, video::SColor(255,0,0,0)); #if 1 st->setText(L"Texture Rendering"); - Render(device, rt1, pos1, pos2, sphereMesh, pos3, pos4); - Render(device, rt2, pos1, pos2, sphereMesh, pos3, pos4); - Render(device, rt3, pos1, pos2, sphereMesh, pos3, pos4); - Render(device, rt4, pos1, pos2, sphereMesh, pos3, pos4); + Render(device, renderTarget1, pos1, pos2, sphereMesh, pos3, pos4); + Render(device, renderTarget2, pos1, pos2, sphereMesh, pos3, pos4); + Render(device, renderTarget3, pos1, pos2, sphereMesh, pos3, pos4); + Render(device, renderTarget4, pos1, pos2, sphereMesh, pos3, pos4); - device->getVideoDriver()->setRenderTarget(0); - device->getVideoDriver()->draw2DImage(rt1, core::position2di(0,0)); - device->getVideoDriver()->draw2DImage(rt2, core::position2di(80,0)); - device->getVideoDriver()->draw2DImage(rt3, core::position2di(0,60)); - device->getVideoDriver()->draw2DImage(rt4, core::position2di(80,60)); + device->getVideoDriver()->setRenderTarget((video::IRenderTarget*)0, 0, 0); + device->getVideoDriver()->draw2DImage(renderTargetTex1, core::position2di(0, 0)); + device->getVideoDriver()->draw2DImage(renderTargetTex2, core::position2di(80, 0)); + device->getVideoDriver()->draw2DImage(renderTargetTex3, core::position2di(0, 60)); + device->getVideoDriver()->draw2DImage(renderTargetTex4, core::position2di(80, 60)); #else ITexture* rt0 = NULL; Render(device, rt0, pos1, pos2, sphereMesh, pos3, pos4); @@ -395,7 +410,7 @@ bool rttAndAntiAliasing(video::E_DRIVER_TYPE driverType) st->draw(); device->getVideoDriver()->endScene(); - bool result = takeScreenshotAndCompareAgainstReference(driver, "-rttAndAntiAlias.png"); + bool result = takeScreenshotAndCompareAgainstReference(driver, "-rttAndAntiAlias.png", 98.25f); device->closeDevice(); device->run(); diff --git a/tests/sceneCollisionManager.cpp b/tests/sceneCollisionManager.cpp index 65b3e3cd..b75ae75e 100644 --- a/tests/sceneCollisionManager.cpp +++ b/tests/sceneCollisionManager.cpp @@ -204,29 +204,15 @@ static bool testGetSceneNodeFromScreenCoordinatesBB(IrrlichtDevice * device, } - // Make cubeNode3 invisible and check that the camera node is hit (since it has a valid bounding box). - cubeNode3->setVisible(false); - hitNode = collMgr->getSceneNodeFromScreenCoordinatesBB(position2d(80, 60)); - if(hitNode != camera) - { - logTestString("Unexpected node hit. Expected the camera node.\n"); - result = false; - } - // Now verify bitmasking - camera->setID(0xAAAAAAAA); // == 101010101010101010101010101010 - hitNode = collMgr->getSceneNodeFromScreenCoordinatesBB(position2d(80, 60), 0x02); - if(hitNode != camera) - { - logTestString("Unexpected node hit. Expected the camera node.\n"); - result = false; - } // Test the 01010101010101010101010101010101 bitmask (0x55555555) + cubeNode1->setVisible(true); + cubeNode1->setID(0xAAAAAAAA); hitNode = collMgr->getSceneNodeFromScreenCoordinatesBB(position2d(80, 60), 0x55555555); - if(hitNode != 0) + if(hitNode != cubeNode2) { - logTestString("A node was hit when none was expected.\n"); + logTestString("Unexpected node hit. Expected cubeNode2.\n"); result = false; } assert_log(result); @@ -314,7 +300,7 @@ static bool checkBBoxIntersection(IrrlichtDevice * device, bool result=true; for (u32 round=0; round<2; ++round) { - driver->beginScene(true, true, video::SColor(100, 50, 50, 100)); + driver->beginScene(video::ECBF_COLOR | video::ECBF_DEPTH, video::SColor(100, 50, 50, 100)); smgr->drawAll(); driver->endScene(); @@ -378,7 +364,7 @@ static bool checkBBoxIntersection(IrrlichtDevice * device, u32 count=0; for (u32 i=0; i<30; ++i) { - driver->beginScene(true, true, video::SColor(100, 50, 50, 100)); + driver->beginScene(video::ECBF_COLOR | video::ECBF_DEPTH, video::SColor(100, 50, 50, 100)); smgr->drawAll(); driver->endScene(); @@ -416,7 +402,7 @@ static bool compareGetSceneNodeFromRayBBWithBBIntersectsWithLine(IrrlichtDevice // add a cube to pick scene::ISceneNode* cube = smgr->addCubeSceneNode(15); - driver->beginScene(true, true, video::SColor(100, 50, 50, 100)); + driver->beginScene(video::ECBF_COLOR | video::ECBF_DEPTH, video::SColor(100, 50, 50, 100)); smgr->drawAll(); driver->endScene(); diff --git a/tests/screenshot.cpp b/tests/screenshot.cpp index c674a17c..51f31489 100644 --- a/tests/screenshot.cpp +++ b/tests/screenshot.cpp @@ -42,7 +42,7 @@ bool testShots(video::E_DRIVER_TYPE type) node->setAnimationSpeed(0); device->run(); - driver->beginScene(true, true, video::SColor(255, 255, 255, 0)); + driver->beginScene(video::ECBF_COLOR | video::ECBF_DEPTH, video::SColor(255, 255, 255, 0)); smgr->drawAll(); driver->endScene(); diff --git a/tests/softwareDevice.cpp b/tests/softwareDevice.cpp index 9ed67a17..e9bace12 100644 --- a/tests/softwareDevice.cpp +++ b/tests/softwareDevice.cpp @@ -37,7 +37,7 @@ bool softwareDevice(void) (void)smgr->addCameraSceneNode(0, core::vector3df(0,0,-40), core::vector3df(0,0,0)); - driver->beginScene(true, true, video::SColor(255,255,255,0)); + driver->beginScene(video::ECBF_COLOR | video::ECBF_DEPTH, video::SColor(255,255,255,0)); smgr->drawAll(); driver->setMaterial(material); diff --git a/tests/stencilshadow.cpp b/tests/stencilshadow.cpp index 2b09b375..eb520e6d 100644 --- a/tests/stencilshadow.cpp +++ b/tests/stencilshadow.cpp @@ -31,7 +31,7 @@ static bool shadows(video::E_DRIVER_TYPE driverType) light->setRadius(500.f); light->getLightData().DiffuseColor.set(0,1,1); - device->getVideoDriver()->beginScene (true, true, 0); + device->getVideoDriver()->beginScene(video::ECBF_COLOR | video::ECBF_DEPTH, video::SColor(0,0,0,0)); device->getSceneManager()->drawAll(); device->getVideoDriver()->endScene(); @@ -48,7 +48,7 @@ static bool shadows(video::E_DRIVER_TYPE driverType) cam->setPosition(core::vector3df(0,55,-30)); cam->setTarget(core::vector3df(60,45,150)); - device->getVideoDriver()->beginScene (true, true, 0); + device->getVideoDriver()->beginScene(video::ECBF_COLOR | video::ECBF_DEPTH, video::SColor(0,0,0,0)); device->getSceneManager()->drawAll(); device->getVideoDriver()->endScene(); @@ -70,7 +70,6 @@ bool stencilShadow(void) // passed &= shadows(video::EDT_SOFTWARE); // passed &= shadows(video::EDT_BURNINGSVIDEO); passed &= shadows(video::EDT_DIRECT3D9); - passed &= shadows(video::EDT_DIRECT3D8); return passed; } diff --git a/tests/terrainSceneNode.cpp b/tests/terrainSceneNode.cpp index 181dc68d..7c336618 100644 --- a/tests/terrainSceneNode.cpp +++ b/tests/terrainSceneNode.cpp @@ -45,7 +45,7 @@ bool terrainRecalc(void) // This shouldn't cause a recalc camera->setUpVector(vector3df(1.f, 0.f, .01f).normalize()); device->run(); - driver->beginScene(true, true, video::SColor(255,100,101,140)); + driver->beginScene(video::ECBF_COLOR | video::ECBF_DEPTH, video::SColor(255,100,101,140)); smgr->drawAll(); driver->endScene(); @@ -59,7 +59,7 @@ bool terrainRecalc(void) // This is big enough to cause a recalc camera->setUpVector(vector3df(1.f, 0.f, .1f).normalize()); device->run(); - driver->beginScene(true, true, video::SColor(255,100,101,140)); + driver->beginScene(video::ECBF_COLOR | video::ECBF_DEPTH, video::SColor(255,100,101,140)); smgr->drawAll(); driver->endScene(); @@ -105,7 +105,7 @@ bool terrainGaps() terrain->setMaterialFlag(video::EMF_WIREFRAME, !terrain->getMaterial(0).Wireframe); } - irrVideo->beginScene(true, true, video::SColor(0,150,150,150)); + irrVideo->beginScene(video::ECBF_COLOR | video::ECBF_DEPTH, video::SColor(0,150,150,150)); irrScene->drawAll(); irrVideo->endScene(); diff --git a/tests/testGeometryCreator.cpp b/tests/testGeometryCreator.cpp index 58539225..9be0e33b 100644 --- a/tests/testGeometryCreator.cpp +++ b/tests/testGeometryCreator.cpp @@ -73,7 +73,7 @@ bool testGeometryCreator(void) bool result = false; device->run(); - if (driver->beginScene(true, true, video::SColor(0, 80, 80, 80))) + if (driver->beginScene(video::ECBF_COLOR | video::ECBF_DEPTH, video::SColor(0, 80, 80, 80))) { smgr->drawAll(); driver->endScene(); @@ -110,7 +110,7 @@ bool testGeometryCreator(void) anode->setPosition(core::vector3df(-5000,0,-5000)); } - driver->beginScene(); + driver->beginScene(video::ECBF_COLOR | video::ECBF_DEPTH, video::SColor(0)); smgr->drawAll(); driver->endScene(); diff --git a/tests/testUtils.cpp b/tests/testUtils.cpp index 74879f6a..59d0a587 100644 --- a/tests/testUtils.cpp +++ b/tests/testUtils.cpp @@ -336,9 +336,9 @@ float fuzzyCompareImages(irr::video::IVideoDriver * driver, void stabilizeScreenBackground(irr::video::IVideoDriver * driver, irr::video::SColor color) { - for(int i = 0; i < 100; ++i) // 100 - max checks + for(int i = 0; i < 10000; ++i) { - driver->beginScene(true, true, color); + driver->beginScene(video::ECBF_COLOR | video::ECBF_DEPTH, color); driver->endScene(); irr::video::IImage * screenshot = driver->createScreenShot(); @@ -382,6 +382,8 @@ void stabilizeScreenBackground(irr::video::IVideoDriver * driver, } screenshot->drop(); } + + logTestString("stabilizeScreenBackground failed\n"); } irr::core::stringc shortDriverName(irr::video::IVideoDriver * driver) diff --git a/tests/testUtils.h b/tests/testUtils.h index 9be69eb1..33928e56 100644 --- a/tests/testUtils.h +++ b/tests/testUtils.h @@ -7,11 +7,12 @@ #define TestWithAllDrivers(X) \ logTestString("Running test " #X "\n"); \ - for (u32 i=1; iApplication MultiByte true + Windows7.1SDK Application MultiByte true + Windows7.1SDK Application MultiByte + Windows7.1SDK Application MultiByte + Windows7.1SDK diff --git a/tests/tests_vc11.vcxproj b/tests/tests_vc11.vcxproj index 3f834b51..17817a4a 100644 --- a/tests/tests_vc11.vcxproj +++ b/tests/tests_vc11.vcxproj @@ -28,23 +28,23 @@ Application MultiByte true - v110 + Windows7.1SDK Application MultiByte true - v110 + Windows7.1SDK Application MultiByte - v110 + Windows7.1SDK Application MultiByte - v110 + Windows7.1SDK @@ -235,4 +235,4 @@ - + \ No newline at end of file diff --git a/tests/tests_vc12.sln b/tests/tests_vc12.sln new file mode 100644 index 00000000..098c24ea --- /dev/null +++ b/tests/tests_vc12.sln @@ -0,0 +1,88 @@ + +Microsoft Visual Studio Solution File, Format Version 12.00 +# Visual Studio Express 2013 for Windows Desktop +VisualStudioVersion = 12.0.30501.0 +MinimumVisualStudioVersion = 10.0.40219.1 +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Irrlicht", "..\source\Irrlicht\Irrlicht12.0.vcxproj", "{E08E042A-6C45-411B-92BE-3CC31331019F}" +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "tests", "tests_vc12.vcxproj", "{2A1DE18B-F678-4A94-A996-E848E20B2983}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Win32 = Debug|Win32 + Debug|x64 = Debug|x64 + Release - Fast FPU|Win32 = Release - Fast FPU|Win32 + Release - Fast FPU|x64 = Release - Fast FPU|x64 + Release|Win32 = Release|Win32 + Release|x64 = Release|x64 + SDL-Debug|Win32 = SDL-Debug|Win32 + SDL-Debug|x64 = SDL-Debug|x64 + Static lib - Debug|Win32 = Static lib - Debug|Win32 + Static lib - Debug|x64 = Static lib - Debug|x64 + Static lib - Release - Fast FPU|Win32 = Static lib - Release - Fast FPU|Win32 + Static lib - Release - Fast FPU|x64 = Static lib - Release - Fast FPU|x64 + Static lib - Release|Win32 = Static lib - Release|Win32 + Static lib - Release|x64 = Static lib - Release|x64 + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {E08E042A-6C45-411B-92BE-3CC31331019F}.Debug|Win32.ActiveCfg = Debug|Win32 + {E08E042A-6C45-411B-92BE-3CC31331019F}.Debug|Win32.Build.0 = Debug|Win32 + {E08E042A-6C45-411B-92BE-3CC31331019F}.Debug|x64.ActiveCfg = Debug|x64 + {E08E042A-6C45-411B-92BE-3CC31331019F}.Debug|x64.Build.0 = Debug|x64 + {E08E042A-6C45-411B-92BE-3CC31331019F}.Release - Fast FPU|Win32.ActiveCfg = Release - Fast FPU|Win32 + {E08E042A-6C45-411B-92BE-3CC31331019F}.Release - Fast FPU|Win32.Build.0 = Release - Fast FPU|Win32 + {E08E042A-6C45-411B-92BE-3CC31331019F}.Release - Fast FPU|x64.ActiveCfg = Release - Fast FPU|x64 + {E08E042A-6C45-411B-92BE-3CC31331019F}.Release - Fast FPU|x64.Build.0 = Release - Fast FPU|x64 + {E08E042A-6C45-411B-92BE-3CC31331019F}.Release|Win32.ActiveCfg = Release|Win32 + {E08E042A-6C45-411B-92BE-3CC31331019F}.Release|Win32.Build.0 = Release|Win32 + {E08E042A-6C45-411B-92BE-3CC31331019F}.Release|x64.ActiveCfg = Release|x64 + {E08E042A-6C45-411B-92BE-3CC31331019F}.Release|x64.Build.0 = Release|x64 + {E08E042A-6C45-411B-92BE-3CC31331019F}.SDL-Debug|Win32.ActiveCfg = SDL-Debug|Win32 + {E08E042A-6C45-411B-92BE-3CC31331019F}.SDL-Debug|Win32.Build.0 = SDL-Debug|Win32 + {E08E042A-6C45-411B-92BE-3CC31331019F}.SDL-Debug|x64.ActiveCfg = SDL-Debug|x64 + {E08E042A-6C45-411B-92BE-3CC31331019F}.SDL-Debug|x64.Build.0 = SDL-Debug|x64 + {E08E042A-6C45-411B-92BE-3CC31331019F}.Static lib - Debug|Win32.ActiveCfg = Static lib - Debug|Win32 + {E08E042A-6C45-411B-92BE-3CC31331019F}.Static lib - Debug|Win32.Build.0 = Static lib - Debug|Win32 + {E08E042A-6C45-411B-92BE-3CC31331019F}.Static lib - Debug|x64.ActiveCfg = Static lib - Debug|x64 + {E08E042A-6C45-411B-92BE-3CC31331019F}.Static lib - Debug|x64.Build.0 = Static lib - Debug|x64 + {E08E042A-6C45-411B-92BE-3CC31331019F}.Static lib - Release - Fast FPU|Win32.ActiveCfg = Static lib - Release - Fast FPU|Win32 + {E08E042A-6C45-411B-92BE-3CC31331019F}.Static lib - Release - Fast FPU|Win32.Build.0 = Static lib - Release - Fast FPU|Win32 + {E08E042A-6C45-411B-92BE-3CC31331019F}.Static lib - Release - Fast FPU|x64.ActiveCfg = Static lib - Release - Fast FPU|x64 + {E08E042A-6C45-411B-92BE-3CC31331019F}.Static lib - Release - Fast FPU|x64.Build.0 = Static lib - Release - Fast FPU|x64 + {E08E042A-6C45-411B-92BE-3CC31331019F}.Static lib - Release|Win32.ActiveCfg = Static lib - Release|Win32 + {E08E042A-6C45-411B-92BE-3CC31331019F}.Static lib - Release|Win32.Build.0 = Static lib - Release|Win32 + {E08E042A-6C45-411B-92BE-3CC31331019F}.Static lib - Release|x64.ActiveCfg = Static lib - Release|x64 + {E08E042A-6C45-411B-92BE-3CC31331019F}.Static lib - Release|x64.Build.0 = Static lib - Release|x64 + {2A1DE18B-F678-4A94-A996-E848E20B2983}.Debug|Win32.ActiveCfg = Debug|Win32 + {2A1DE18B-F678-4A94-A996-E848E20B2983}.Debug|Win32.Build.0 = Debug|Win32 + {2A1DE18B-F678-4A94-A996-E848E20B2983}.Debug|x64.ActiveCfg = Debug|x64 + {2A1DE18B-F678-4A94-A996-E848E20B2983}.Debug|x64.Build.0 = Debug|x64 + {2A1DE18B-F678-4A94-A996-E848E20B2983}.Release - Fast FPU|Win32.ActiveCfg = Release|Win32 + {2A1DE18B-F678-4A94-A996-E848E20B2983}.Release - Fast FPU|Win32.Build.0 = Release|Win32 + {2A1DE18B-F678-4A94-A996-E848E20B2983}.Release - Fast FPU|x64.ActiveCfg = Release|x64 + {2A1DE18B-F678-4A94-A996-E848E20B2983}.Release - Fast FPU|x64.Build.0 = Release|x64 + {2A1DE18B-F678-4A94-A996-E848E20B2983}.Release|Win32.ActiveCfg = Release|Win32 + {2A1DE18B-F678-4A94-A996-E848E20B2983}.Release|Win32.Build.0 = Release|Win32 + {2A1DE18B-F678-4A94-A996-E848E20B2983}.Release|x64.ActiveCfg = Release|x64 + {2A1DE18B-F678-4A94-A996-E848E20B2983}.Release|x64.Build.0 = Release|x64 + {2A1DE18B-F678-4A94-A996-E848E20B2983}.SDL-Debug|Win32.ActiveCfg = Debug|Win32 + {2A1DE18B-F678-4A94-A996-E848E20B2983}.SDL-Debug|Win32.Build.0 = Debug|Win32 + {2A1DE18B-F678-4A94-A996-E848E20B2983}.SDL-Debug|x64.ActiveCfg = Debug|x64 + {2A1DE18B-F678-4A94-A996-E848E20B2983}.SDL-Debug|x64.Build.0 = Debug|x64 + {2A1DE18B-F678-4A94-A996-E848E20B2983}.Static lib - Debug|Win32.ActiveCfg = Debug|Win32 + {2A1DE18B-F678-4A94-A996-E848E20B2983}.Static lib - Debug|Win32.Build.0 = Debug|Win32 + {2A1DE18B-F678-4A94-A996-E848E20B2983}.Static lib - Debug|x64.ActiveCfg = Debug|x64 + {2A1DE18B-F678-4A94-A996-E848E20B2983}.Static lib - Debug|x64.Build.0 = Debug|x64 + {2A1DE18B-F678-4A94-A996-E848E20B2983}.Static lib - Release - Fast FPU|Win32.ActiveCfg = Release|Win32 + {2A1DE18B-F678-4A94-A996-E848E20B2983}.Static lib - Release - Fast FPU|Win32.Build.0 = Release|Win32 + {2A1DE18B-F678-4A94-A996-E848E20B2983}.Static lib - Release - Fast FPU|x64.ActiveCfg = Release|x64 + {2A1DE18B-F678-4A94-A996-E848E20B2983}.Static lib - Release - Fast FPU|x64.Build.0 = Release|x64 + {2A1DE18B-F678-4A94-A996-E848E20B2983}.Static lib - Release|Win32.ActiveCfg = Release|Win32 + {2A1DE18B-F678-4A94-A996-E848E20B2983}.Static lib - Release|Win32.Build.0 = Release|Win32 + {2A1DE18B-F678-4A94-A996-E848E20B2983}.Static lib - Release|x64.ActiveCfg = Release|x64 + {2A1DE18B-F678-4A94-A996-E848E20B2983}.Static lib - Release|x64.Build.0 = Release|x64 + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection +EndGlobal diff --git a/tests/tests_vc12.vcxproj b/tests/tests_vc12.vcxproj new file mode 100644 index 00000000..a561f7f7 --- /dev/null +++ b/tests/tests_vc12.vcxproj @@ -0,0 +1,238 @@ + + + + + Debug + Win32 + + + Debug + x64 + + + Release + Win32 + + + Release + x64 + + + + tests + {2A1DE18B-F678-4A94-A996-E848E20B2983} + tests + + + + Application + MultiByte + true + Windows7.1SDK + + + Application + MultiByte + true + Windows7.1SDK + + + Application + MultiByte + Windows7.1SDK + + + Application + MultiByte + Windows7.1SDK + + + + + + + + + + + + + + + + + + + <_ProjectFileVersion>10.0.30319.1 + ..\bin\Win32-VisualStudio\ + ..\bin\Win64-VisualStudio\ + AllRules.ruleset + AllRules.ruleset + + + + + AllRules.ruleset + AllRules.ruleset + + + + + ..\bin\Win32-VisualStudio\ + ..\bin\Win64-VisualStudio\ + + + + Disabled + ..\include;%(AdditionalIncludeDirectories) + true + EnableFastChecks + MultiThreadedDebugDLL + Level3 + + + ..\lib\Win32-visualstudio\Irrlicht.lib;%(AdditionalDependencies) + true + + + + + + + Disabled + ..\include;%(AdditionalIncludeDirectories) + EnableFastChecks + MultiThreadedDebugDLL + Level3 + + + ..\lib\Win64-visualstudio\Irrlicht.lib;%(AdditionalDependencies) + true + + + + + + + MaxSpeed + true + ..\include;%(AdditionalIncludeDirectories) + MultiThreadedDLL + true + Level3 + + + ..\lib\Win32-visualstudio\Irrlicht.lib;%(AdditionalDependencies) + false + true + true + + + + + + + MaxSpeed + true + ..\include;%(AdditionalIncludeDirectories) + MultiThreadedDLL + true + Level3 + + + ..\lib\Win64-visualstudio\Irrlicht.lib;%(AdditionalDependencies) + false + true + true + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + {e08e042a-6c45-411b-92be-3cc31331019f} + false + + + + + + \ No newline at end of file diff --git a/tests/tests_vc14.sln b/tests/tests_vc14.sln new file mode 100644 index 00000000..ce31f9c4 --- /dev/null +++ b/tests/tests_vc14.sln @@ -0,0 +1,88 @@ + +Microsoft Visual Studio Solution File, Format Version 14.00 +# Visual Studio 14 +VisualStudioVersion = 14.0.23107.0 +MinimumVisualStudioVersion = 10.0.40219.1 +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Irrlicht", "..\source\Irrlicht\Irrlicht14.0.vcxproj", "{E08E042A-6C45-411B-92BE-3CC31331019F}" +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "tests", "tests_vc14.vcxproj", "{2A1DE18B-F678-4A94-A996-E848E20B2983}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Win32 = Debug|Win32 + Debug|x64 = Debug|x64 + Release - Fast FPU|Win32 = Release - Fast FPU|Win32 + Release - Fast FPU|x64 = Release - Fast FPU|x64 + Release|Win32 = Release|Win32 + Release|x64 = Release|x64 + SDL-Debug|Win32 = SDL-Debug|Win32 + SDL-Debug|x64 = SDL-Debug|x64 + Static lib - Debug|Win32 = Static lib - Debug|Win32 + Static lib - Debug|x64 = Static lib - Debug|x64 + Static lib - Release - Fast FPU|Win32 = Static lib - Release - Fast FPU|Win32 + Static lib - Release - Fast FPU|x64 = Static lib - Release - Fast FPU|x64 + Static lib - Release|Win32 = Static lib - Release|Win32 + Static lib - Release|x64 = Static lib - Release|x64 + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {E08E042A-6C45-411B-92BE-3CC31331019F}.Debug|Win32.ActiveCfg = Debug|Win32 + {E08E042A-6C45-411B-92BE-3CC31331019F}.Debug|Win32.Build.0 = Debug|Win32 + {E08E042A-6C45-411B-92BE-3CC31331019F}.Debug|x64.ActiveCfg = Debug|x64 + {E08E042A-6C45-411B-92BE-3CC31331019F}.Debug|x64.Build.0 = Debug|x64 + {E08E042A-6C45-411B-92BE-3CC31331019F}.Release - Fast FPU|Win32.ActiveCfg = Release - Fast FPU|Win32 + {E08E042A-6C45-411B-92BE-3CC31331019F}.Release - Fast FPU|Win32.Build.0 = Release - Fast FPU|Win32 + {E08E042A-6C45-411B-92BE-3CC31331019F}.Release - Fast FPU|x64.ActiveCfg = Release - Fast FPU|x64 + {E08E042A-6C45-411B-92BE-3CC31331019F}.Release - Fast FPU|x64.Build.0 = Release - Fast FPU|x64 + {E08E042A-6C45-411B-92BE-3CC31331019F}.Release|Win32.ActiveCfg = Release|Win32 + {E08E042A-6C45-411B-92BE-3CC31331019F}.Release|Win32.Build.0 = Release|Win32 + {E08E042A-6C45-411B-92BE-3CC31331019F}.Release|x64.ActiveCfg = Release|x64 + {E08E042A-6C45-411B-92BE-3CC31331019F}.Release|x64.Build.0 = Release|x64 + {E08E042A-6C45-411B-92BE-3CC31331019F}.SDL-Debug|Win32.ActiveCfg = SDL-Debug|Win32 + {E08E042A-6C45-411B-92BE-3CC31331019F}.SDL-Debug|Win32.Build.0 = SDL-Debug|Win32 + {E08E042A-6C45-411B-92BE-3CC31331019F}.SDL-Debug|x64.ActiveCfg = SDL-Debug|x64 + {E08E042A-6C45-411B-92BE-3CC31331019F}.SDL-Debug|x64.Build.0 = SDL-Debug|x64 + {E08E042A-6C45-411B-92BE-3CC31331019F}.Static lib - Debug|Win32.ActiveCfg = Static lib - Debug|Win32 + {E08E042A-6C45-411B-92BE-3CC31331019F}.Static lib - Debug|Win32.Build.0 = Static lib - Debug|Win32 + {E08E042A-6C45-411B-92BE-3CC31331019F}.Static lib - Debug|x64.ActiveCfg = Static lib - Debug|x64 + {E08E042A-6C45-411B-92BE-3CC31331019F}.Static lib - Debug|x64.Build.0 = Static lib - Debug|x64 + {E08E042A-6C45-411B-92BE-3CC31331019F}.Static lib - Release - Fast FPU|Win32.ActiveCfg = Static lib - Release - Fast FPU|Win32 + {E08E042A-6C45-411B-92BE-3CC31331019F}.Static lib - Release - Fast FPU|Win32.Build.0 = Static lib - Release - Fast FPU|Win32 + {E08E042A-6C45-411B-92BE-3CC31331019F}.Static lib - Release - Fast FPU|x64.ActiveCfg = Static lib - Release - Fast FPU|x64 + {E08E042A-6C45-411B-92BE-3CC31331019F}.Static lib - Release - Fast FPU|x64.Build.0 = Static lib - Release - Fast FPU|x64 + {E08E042A-6C45-411B-92BE-3CC31331019F}.Static lib - Release|Win32.ActiveCfg = Static lib - Release|Win32 + {E08E042A-6C45-411B-92BE-3CC31331019F}.Static lib - Release|Win32.Build.0 = Static lib - Release|Win32 + {E08E042A-6C45-411B-92BE-3CC31331019F}.Static lib - Release|x64.ActiveCfg = Static lib - Release|x64 + {E08E042A-6C45-411B-92BE-3CC31331019F}.Static lib - Release|x64.Build.0 = Static lib - Release|x64 + {2A1DE18B-F678-4A94-A996-E848E20B2983}.Debug|Win32.ActiveCfg = Debug|Win32 + {2A1DE18B-F678-4A94-A996-E848E20B2983}.Debug|Win32.Build.0 = Debug|Win32 + {2A1DE18B-F678-4A94-A996-E848E20B2983}.Debug|x64.ActiveCfg = Debug|x64 + {2A1DE18B-F678-4A94-A996-E848E20B2983}.Debug|x64.Build.0 = Debug|x64 + {2A1DE18B-F678-4A94-A996-E848E20B2983}.Release - Fast FPU|Win32.ActiveCfg = Release|Win32 + {2A1DE18B-F678-4A94-A996-E848E20B2983}.Release - Fast FPU|Win32.Build.0 = Release|Win32 + {2A1DE18B-F678-4A94-A996-E848E20B2983}.Release - Fast FPU|x64.ActiveCfg = Release|x64 + {2A1DE18B-F678-4A94-A996-E848E20B2983}.Release - Fast FPU|x64.Build.0 = Release|x64 + {2A1DE18B-F678-4A94-A996-E848E20B2983}.Release|Win32.ActiveCfg = Release|Win32 + {2A1DE18B-F678-4A94-A996-E848E20B2983}.Release|Win32.Build.0 = Release|Win32 + {2A1DE18B-F678-4A94-A996-E848E20B2983}.Release|x64.ActiveCfg = Release|x64 + {2A1DE18B-F678-4A94-A996-E848E20B2983}.Release|x64.Build.0 = Release|x64 + {2A1DE18B-F678-4A94-A996-E848E20B2983}.SDL-Debug|Win32.ActiveCfg = Debug|Win32 + {2A1DE18B-F678-4A94-A996-E848E20B2983}.SDL-Debug|Win32.Build.0 = Debug|Win32 + {2A1DE18B-F678-4A94-A996-E848E20B2983}.SDL-Debug|x64.ActiveCfg = Debug|x64 + {2A1DE18B-F678-4A94-A996-E848E20B2983}.SDL-Debug|x64.Build.0 = Debug|x64 + {2A1DE18B-F678-4A94-A996-E848E20B2983}.Static lib - Debug|Win32.ActiveCfg = Debug|Win32 + {2A1DE18B-F678-4A94-A996-E848E20B2983}.Static lib - Debug|Win32.Build.0 = Debug|Win32 + {2A1DE18B-F678-4A94-A996-E848E20B2983}.Static lib - Debug|x64.ActiveCfg = Debug|x64 + {2A1DE18B-F678-4A94-A996-E848E20B2983}.Static lib - Debug|x64.Build.0 = Debug|x64 + {2A1DE18B-F678-4A94-A996-E848E20B2983}.Static lib - Release - Fast FPU|Win32.ActiveCfg = Release|Win32 + {2A1DE18B-F678-4A94-A996-E848E20B2983}.Static lib - Release - Fast FPU|Win32.Build.0 = Release|Win32 + {2A1DE18B-F678-4A94-A996-E848E20B2983}.Static lib - Release - Fast FPU|x64.ActiveCfg = Release|x64 + {2A1DE18B-F678-4A94-A996-E848E20B2983}.Static lib - Release - Fast FPU|x64.Build.0 = Release|x64 + {2A1DE18B-F678-4A94-A996-E848E20B2983}.Static lib - Release|Win32.ActiveCfg = Release|Win32 + {2A1DE18B-F678-4A94-A996-E848E20B2983}.Static lib - Release|Win32.Build.0 = Release|Win32 + {2A1DE18B-F678-4A94-A996-E848E20B2983}.Static lib - Release|x64.ActiveCfg = Release|x64 + {2A1DE18B-F678-4A94-A996-E848E20B2983}.Static lib - Release|x64.Build.0 = Release|x64 + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection +EndGlobal diff --git a/tests/tests_vc14.vcxproj b/tests/tests_vc14.vcxproj new file mode 100644 index 00000000..70c2464d --- /dev/null +++ b/tests/tests_vc14.vcxproj @@ -0,0 +1,238 @@ + + + + + Debug + Win32 + + + Debug + x64 + + + Release + Win32 + + + Release + x64 + + + + tests + {2A1DE18B-F678-4A94-A996-E848E20B2983} + tests + + + + Application + MultiByte + true + v140 + + + Application + MultiByte + true + v140 + + + Application + MultiByte + v140 + + + Application + MultiByte + v140 + + + + + + + + + + + + + + + + + + + <_ProjectFileVersion>10.0.30319.1 + ..\bin\Win32-VisualStudio\ + ..\bin\Win64-VisualStudio\ + AllRules.ruleset + AllRules.ruleset + + + + + AllRules.ruleset + AllRules.ruleset + + + + + ..\bin\Win32-VisualStudio\ + ..\bin\Win64-VisualStudio\ + + + + Disabled + ..\include;%(AdditionalIncludeDirectories) + true + EnableFastChecks + MultiThreadedDebugDLL + Level3 + + + ..\lib\Win32-visualstudio\Irrlicht.lib;%(AdditionalDependencies) + true + + + + + + + Disabled + ..\include;%(AdditionalIncludeDirectories) + EnableFastChecks + MultiThreadedDebugDLL + Level3 + + + ..\lib\Win64-visualstudio\Irrlicht.lib;%(AdditionalDependencies) + true + + + + + + + MaxSpeed + true + ..\include;%(AdditionalIncludeDirectories) + MultiThreadedDLL + true + Level3 + + + ..\lib\Win32-visualstudio\Irrlicht.lib;%(AdditionalDependencies) + false + true + true + + + + + + + MaxSpeed + true + ..\include;%(AdditionalIncludeDirectories) + MultiThreadedDLL + true + Level3 + + + ..\lib\Win64-visualstudio\Irrlicht.lib;%(AdditionalDependencies) + false + true + true + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + {e08e042a-6c45-411b-92be-3cc31331019f} + false + + + + + + \ No newline at end of file diff --git a/tests/tests_vc8.sln b/tests/tests_vc8.sln deleted file mode 100644 index 7a15dbbe..00000000 --- a/tests/tests_vc8.sln +++ /dev/null @@ -1,49 +0,0 @@ - -Microsoft Visual Studio Solution File, Format Version 9.00 -# Visual Studio 2005 -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "tests", "tests_vc8.vcproj", "{2A1DE18B-F678-4A94-A996-E848E20B2983}" - ProjectSection(ProjectDependencies) = postProject - {E08E042A-6C45-411B-92BE-3CC31331019F} = {E08E042A-6C45-411B-92BE-3CC31331019F} - EndProjectSection -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Irrlicht", "..\source\Irrlicht\Irrlicht8.0.vcproj", "{E08E042A-6C45-411B-92BE-3CC31331019F}" -EndProject -Global - GlobalSection(SolutionConfigurationPlatforms) = preSolution - Debug|Win32 = Debug|Win32 - Release - Fast FPU|Win32 = Release - Fast FPU|Win32 - Release|Win32 = Release|Win32 - Static lib - Debug|Win32 = Static lib - Debug|Win32 - Static lib - Release - Fast FPU|Win32 = Static lib - Release - Fast FPU|Win32 - Static lib - Release|Win32 = Static lib - Release|Win32 - EndGlobalSection - GlobalSection(ProjectConfigurationPlatforms) = postSolution - {2A1DE18B-F678-4A94-A996-E848E20B2983}.Debug|Win32.ActiveCfg = Debug|Win32 - {2A1DE18B-F678-4A94-A996-E848E20B2983}.Debug|Win32.Build.0 = Debug|Win32 - {2A1DE18B-F678-4A94-A996-E848E20B2983}.Release - Fast FPU|Win32.ActiveCfg = Release|Win32 - {2A1DE18B-F678-4A94-A996-E848E20B2983}.Release - Fast FPU|Win32.Build.0 = Release|Win32 - {2A1DE18B-F678-4A94-A996-E848E20B2983}.Release|Win32.ActiveCfg = Release|Win32 - {2A1DE18B-F678-4A94-A996-E848E20B2983}.Release|Win32.Build.0 = Release|Win32 - {2A1DE18B-F678-4A94-A996-E848E20B2983}.Static lib - Debug|Win32.ActiveCfg = Debug|Win32 - {2A1DE18B-F678-4A94-A996-E848E20B2983}.Static lib - Debug|Win32.Build.0 = Debug|Win32 - {2A1DE18B-F678-4A94-A996-E848E20B2983}.Static lib - Release - Fast FPU|Win32.ActiveCfg = Release|Win32 - {2A1DE18B-F678-4A94-A996-E848E20B2983}.Static lib - Release - Fast FPU|Win32.Build.0 = Release|Win32 - {2A1DE18B-F678-4A94-A996-E848E20B2983}.Static lib - Release|Win32.ActiveCfg = Release|Win32 - {2A1DE18B-F678-4A94-A996-E848E20B2983}.Static lib - Release|Win32.Build.0 = Release|Win32 - {E08E042A-6C45-411B-92BE-3CC31331019F}.Debug|Win32.ActiveCfg = Debug|Win32 - {E08E042A-6C45-411B-92BE-3CC31331019F}.Debug|Win32.Build.0 = Debug|Win32 - {E08E042A-6C45-411B-92BE-3CC31331019F}.Release - Fast FPU|Win32.ActiveCfg = Release - Fast FPU|Win32 - {E08E042A-6C45-411B-92BE-3CC31331019F}.Release - Fast FPU|Win32.Build.0 = Release - Fast FPU|Win32 - {E08E042A-6C45-411B-92BE-3CC31331019F}.Release|Win32.ActiveCfg = Release|Win32 - {E08E042A-6C45-411B-92BE-3CC31331019F}.Release|Win32.Build.0 = Release|Win32 - {E08E042A-6C45-411B-92BE-3CC31331019F}.Static lib - Debug|Win32.ActiveCfg = Static lib - Debug|Win32 - {E08E042A-6C45-411B-92BE-3CC31331019F}.Static lib - Debug|Win32.Build.0 = Static lib - Debug|Win32 - {E08E042A-6C45-411B-92BE-3CC31331019F}.Static lib - Release - Fast FPU|Win32.ActiveCfg = Static lib - Release - Fast FPU|Win32 - {E08E042A-6C45-411B-92BE-3CC31331019F}.Static lib - Release - Fast FPU|Win32.Build.0 = Static lib - Release - Fast FPU|Win32 - {E08E042A-6C45-411B-92BE-3CC31331019F}.Static lib - Release|Win32.ActiveCfg = Static lib - Release|Win32 - {E08E042A-6C45-411B-92BE-3CC31331019F}.Static lib - Release|Win32.Build.0 = Static lib - Release|Win32 - EndGlobalSection - GlobalSection(SolutionProperties) = preSolution - HideSolutionNode = FALSE - EndGlobalSection -EndGlobal diff --git a/tests/tests_vc8.vcproj b/tests/tests_vc8.vcproj deleted file mode 100644 index a0d28915..00000000 --- a/tests/tests_vc8.vcproj +++ /dev/null @@ -1,483 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/tests/tests_vc9.sln b/tests/tests_vc9.sln deleted file mode 100644 index efbeaad1..00000000 --- a/tests/tests_vc9.sln +++ /dev/null @@ -1,49 +0,0 @@ - -Microsoft Visual Studio Solution File, Format Version 10.00 -# Visual C++ Express 2008 -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "tests", "tests_vc9.vcproj", "{2A1DE18B-F678-4A94-A996-E848E20B2983}" - ProjectSection(ProjectDependencies) = postProject - {E08E042A-6C45-411B-92BE-3CC31331019F} = {E08E042A-6C45-411B-92BE-3CC31331019F} - EndProjectSection -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Irrlicht", "..\source\Irrlicht\Irrlicht9.0.vcproj", "{E08E042A-6C45-411B-92BE-3CC31331019F}" -EndProject -Global - GlobalSection(SolutionConfigurationPlatforms) = preSolution - Debug|Win32 = Debug|Win32 - Release - Fast FPU|Win32 = Release - Fast FPU|Win32 - Release|Win32 = Release|Win32 - Static lib - Debug|Win32 = Static lib - Debug|Win32 - Static lib - Release - Fast FPU|Win32 = Static lib - Release - Fast FPU|Win32 - Static lib - Release|Win32 = Static lib - Release|Win32 - EndGlobalSection - GlobalSection(ProjectConfigurationPlatforms) = postSolution - {2A1DE18B-F678-4A94-A996-E848E20B2983}.Debug|Win32.ActiveCfg = Debug|Win32 - {2A1DE18B-F678-4A94-A996-E848E20B2983}.Debug|Win32.Build.0 = Debug|Win32 - {2A1DE18B-F678-4A94-A996-E848E20B2983}.Release - Fast FPU|Win32.ActiveCfg = Release|Win32 - {2A1DE18B-F678-4A94-A996-E848E20B2983}.Release - Fast FPU|Win32.Build.0 = Release|Win32 - {2A1DE18B-F678-4A94-A996-E848E20B2983}.Release|Win32.ActiveCfg = Release|Win32 - {2A1DE18B-F678-4A94-A996-E848E20B2983}.Release|Win32.Build.0 = Release|Win32 - {2A1DE18B-F678-4A94-A996-E848E20B2983}.Static lib - Debug|Win32.ActiveCfg = Debug|Win32 - {2A1DE18B-F678-4A94-A996-E848E20B2983}.Static lib - Debug|Win32.Build.0 = Debug|Win32 - {2A1DE18B-F678-4A94-A996-E848E20B2983}.Static lib - Release - Fast FPU|Win32.ActiveCfg = Release|Win32 - {2A1DE18B-F678-4A94-A996-E848E20B2983}.Static lib - Release - Fast FPU|Win32.Build.0 = Release|Win32 - {2A1DE18B-F678-4A94-A996-E848E20B2983}.Static lib - Release|Win32.ActiveCfg = Release|Win32 - {2A1DE18B-F678-4A94-A996-E848E20B2983}.Static lib - Release|Win32.Build.0 = Release|Win32 - {E08E042A-6C45-411B-92BE-3CC31331019F}.Debug|Win32.ActiveCfg = Debug|Win32 - {E08E042A-6C45-411B-92BE-3CC31331019F}.Debug|Win32.Build.0 = Debug|Win32 - {E08E042A-6C45-411B-92BE-3CC31331019F}.Release - Fast FPU|Win32.ActiveCfg = Release - Fast FPU|Win32 - {E08E042A-6C45-411B-92BE-3CC31331019F}.Release - Fast FPU|Win32.Build.0 = Release - Fast FPU|Win32 - {E08E042A-6C45-411B-92BE-3CC31331019F}.Release|Win32.ActiveCfg = Release|Win32 - {E08E042A-6C45-411B-92BE-3CC31331019F}.Release|Win32.Build.0 = Release|Win32 - {E08E042A-6C45-411B-92BE-3CC31331019F}.Static lib - Debug|Win32.ActiveCfg = Static lib - Debug|Win32 - {E08E042A-6C45-411B-92BE-3CC31331019F}.Static lib - Debug|Win32.Build.0 = Static lib - Debug|Win32 - {E08E042A-6C45-411B-92BE-3CC31331019F}.Static lib - Release - Fast FPU|Win32.ActiveCfg = Static lib - Release - Fast FPU|Win32 - {E08E042A-6C45-411B-92BE-3CC31331019F}.Static lib - Release - Fast FPU|Win32.Build.0 = Static lib - Release - Fast FPU|Win32 - {E08E042A-6C45-411B-92BE-3CC31331019F}.Static lib - Release|Win32.ActiveCfg = Static lib - Release|Win32 - {E08E042A-6C45-411B-92BE-3CC31331019F}.Static lib - Release|Win32.Build.0 = Static lib - Release|Win32 - EndGlobalSection - GlobalSection(SolutionProperties) = preSolution - HideSolutionNode = FALSE - EndGlobalSection -EndGlobal diff --git a/tests/tests_vc9.vcproj b/tests/tests_vc9.vcproj deleted file mode 100644 index bf29c142..00000000 --- a/tests/tests_vc9.vcproj +++ /dev/null @@ -1,480 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/tests/textureFeatures.cpp b/tests/textureFeatures.cpp index de7560ed..d1a51b50 100644 --- a/tests/textureFeatures.cpp +++ b/tests/textureFeatures.cpp @@ -69,7 +69,7 @@ bool renderMipLevels(video::E_DRIVER_TYPE driverType) (void)smgr->addCameraSceneNode(0, core::vector3df(10,0,-30)); - driver->beginScene(true, true, video::SColor(255,100,101,140)); + driver->beginScene(video::ECBF_COLOR | video::ECBF_DEPTH, video::SColor(255,100,101,140)); smgr->drawAll(); driver->endScene(); @@ -142,7 +142,7 @@ bool lockAllMipLevels(video::E_DRIVER_TYPE driverType) (void)smgr->addCameraSceneNode(); - driver->beginScene(true, true, video::SColor(255,100,101,140)); + driver->beginScene(video::ECBF_COLOR | video::ECBF_DEPTH, video::SColor(255,100,101,140)); smgr->drawAll(); driver->endScene(); @@ -247,7 +247,7 @@ bool lockWithAutoMipmap(video::E_DRIVER_TYPE driverType) } (void)smgr->addCameraSceneNode(); - driver->beginScene(true, true, video::SColor(255,100,101,140)); + driver->beginScene(video::ECBF_COLOR | video::ECBF_DEPTH, video::SColor(255,100,101,140)); smgr->drawAll(); driver->endScene(); diff --git a/tests/textureRenderStates.cpp b/tests/textureRenderStates.cpp index 77f7bb58..b0d965b2 100644 --- a/tests/textureRenderStates.cpp +++ b/tests/textureRenderStates.cpp @@ -47,7 +47,7 @@ static bool manyTextures(video::E_DRIVER_TYPE driverType) mesh->setDirty(); - driver->beginScene(true, true, video::SColor(255,100,101,140)); + driver->beginScene(video::ECBF_COLOR | video::ECBF_DEPTH, video::SColor(255,100,101,140)); // set camera smgr->drawAll(); // draw meshbuffer @@ -86,13 +86,13 @@ static bool renderAndLoad(video::E_DRIVER_TYPE driverType) (void)smgr->addCameraSceneNode(); - driver->beginScene(true, true, video::SColor(255,100,101,140)); + driver->beginScene(video::ECBF_COLOR | video::ECBF_DEPTH, video::SColor(255,100,101,140)); driver->draw2DImage(tex1, position2di(0,0)); driver->endScene(); driver->getTexture("../media/tools.png"); - driver->beginScene(true, true, video::SColor(255,100,101,140)); + driver->beginScene(video::ECBF_COLOR | video::ECBF_DEPTH, video::SColor(255,100,101,140)); driver->draw2DImage(tex1, position2di(0,0)); driver->endScene(); @@ -121,7 +121,7 @@ static bool renderAndRemove(video::E_DRIVER_TYPE driverType) logTestString("Testing driver %ls\n", driver->getName()); - driver->beginScene (true, true, video::SColor(255, 0, 255, 0)); + driver->beginScene(video::ECBF_COLOR | video::ECBF_DEPTH, video::SColor(255, 0, 255, 0)); smgr->drawAll(); driver->endScene(); @@ -130,14 +130,14 @@ static bool renderAndRemove(video::E_DRIVER_TYPE driverType) scene::ISceneNode * img = smgr->addCubeSceneNode(); img->setMaterialTexture(0, texture); - driver->beginScene (true, true, video::SColor (255, 0, 255, 0)); + driver->beginScene(video::ECBF_COLOR | video::ECBF_DEPTH, video::SColor (255, 0, 255, 0)); smgr->drawAll(); driver->endScene(); smgr->clear(); // Remove anything that used the texture driver->removeTexture(texture); - driver->beginScene(true, true, video::SColor(255,100,101,140)); + driver->beginScene(video::ECBF_COLOR | video::ECBF_DEPTH, video::SColor(255,100,101,140)); smgr->drawAll(); driver->endScene(); @@ -146,7 +146,7 @@ static bool renderAndRemove(video::E_DRIVER_TYPE driverType) img = smgr->addCubeSceneNode(); img->setMaterialTexture(0, texture); - driver->beginScene (true, true, irr::video::SColor (255, 0, 255, 0)); + driver->beginScene(video::ECBF_COLOR | video::ECBF_DEPTH, irr::video::SColor (255, 0, 255, 0)); smgr->drawAll(); driver->endScene(); @@ -201,7 +201,7 @@ static bool testTextureMatrixInMixedScenes(video::E_DRIVER_TYPE driverType) scene::IAnimatedMesh* pmesh = sceneManager->addHillPlaneMesh("testMesh",dimension2d(50,50),dimension2d(6,6),&mat); sceneManager->addAnimatedMeshSceneNode(pmesh); - driver->beginScene(true, true, video::SColor(255,100,101,140)); + driver->beginScene(video::ECBF_COLOR | video::ECBF_DEPTH, video::SColor(255,100,101,140)); sceneManager->drawAll(); gui->drawAll(); driver->endScene(); @@ -261,7 +261,7 @@ static bool textureMatrix(video::E_DRIVER_TYPE driverType) trans.X += 0.0005f; textureMatrix.buildTextureTransform(0.f, rcenter, trans, scale); - driver->beginScene(true, true, video::SColor(255,100,101,140)); + driver->beginScene(video::ECBF_COLOR | video::ECBF_DEPTH, video::SColor(255,100,101,140)); sceneManager->drawAll(); driver->endScene(); @@ -270,7 +270,7 @@ static bool textureMatrix(video::E_DRIVER_TYPE driverType) trans.X += 0.45f; textureMatrix.buildTextureTransform(0.f, rcenter, trans, scale); - driver->beginScene(true, true, video::SColor(255,100,101,140)); + driver->beginScene(video::ECBF_COLOR | video::ECBF_DEPTH, video::SColor(255,100,101,140)); sceneManager->drawAll(); driver->endScene(); @@ -325,7 +325,7 @@ bool danglingTexturePointer() device->run(); { - driver->beginScene(true, true, irr::video::SColor(255,100,101,140)); + driver->beginScene(video::ECBF_COLOR | video::ECBF_DEPTH, irr::video::SColor(255,100,101,140)); // This is required to trigger the white appearance (this unbinds the // texture, forcing draw2DImage to rebind the logo3 texture (#2)). diff --git a/tests/transparentMaterials.cpp b/tests/transparentMaterials.cpp index c6b757ee..e411b674 100644 --- a/tests/transparentMaterials.cpp +++ b/tests/transparentMaterials.cpp @@ -47,7 +47,7 @@ bool testTransparentAlphaChannelRef(video::E_DRIVER_TYPE driverType) (void)smgr->addCameraSceneNode(0, vector3df(0, 0, -15)); - driver->beginScene(true, true, video::SColor(255,113,113,133)); + driver->beginScene(video::ECBF_COLOR | video::ECBF_DEPTH, video::SColor(255,113,113,133)); smgr->drawAll(); driver->endScene(); @@ -99,7 +99,7 @@ bool testTransparentAlphaChannel(video::E_DRIVER_TYPE driverType) (void)smgr->addCameraSceneNode(0, vector3df(0, 0, -15)); - driver->beginScene(true, true, video::SColor(255,113,113,133)); + driver->beginScene(video::ECBF_COLOR | video::ECBF_DEPTH, video::SColor(255,113,113,133)); smgr->drawAll(); driver->endScene(); @@ -158,7 +158,7 @@ bool testTransparentVertexAlpha(video::E_DRIVER_TYPE driverType) (void)smgr->addCameraSceneNode(0, vector3df(0, 0, -15)); - driver->beginScene(true, true, video::SColor(255,113,113,133)); + driver->beginScene(video::ECBF_COLOR | video::ECBF_DEPTH, video::SColor(255,113,113,133)); smgr->drawAll(); driver->endScene(); @@ -220,7 +220,7 @@ bool testTransparentReflection2Layer(video::E_DRIVER_TYPE driverType) (void)smgr->addCameraSceneNode(0, vector3df(0, 0, -15)); - driver->beginScene(true, true, video::SColor(255,113,113,133)); + driver->beginScene(video::ECBF_COLOR | video::ECBF_DEPTH, video::SColor(255,113,113,133)); smgr->drawAll(); driver->endScene(); @@ -272,7 +272,7 @@ bool testTransparentAddColor(video::E_DRIVER_TYPE driverType) (void)smgr->addCameraSceneNode(0, vector3df(0, 0, -15)); - driver->beginScene(true, true, video::SColor(255,113,113,133)); + driver->beginScene(video::ECBF_COLOR | video::ECBF_DEPTH, video::SColor(255,113,113,133)); smgr->drawAll(); driver->endScene(); @@ -335,7 +335,7 @@ bool testTransparentVertexAlphaMore(E_DRIVER_TYPE driverType) smgr->addCameraSceneNode(0, vector3df(0,30,-40), vector3df(0,5,0)); - driver->beginScene(true, true, SColor(0,200,200,200)); + driver->beginScene(video::ECBF_COLOR | video::ECBF_DEPTH, SColor(0,200,200,200)); smgr->drawAll(); driver->endScene(); diff --git a/tests/triangleSelector.cpp b/tests/triangleSelector.cpp index 5c5c8361..e435a478 100644 --- a/tests/triangleSelector.cpp +++ b/tests/triangleSelector.cpp @@ -90,7 +90,7 @@ bool octree() bool result = true; { camera->setPosition(core::vector3df(-620,-20,550)); - driver->beginScene(true, true, 0); + driver->beginScene(video::ECBF_COLOR | video::ECBF_DEPTH, video::SColor(0)); smgr->drawAll(); core::aabbox3df box(boxPosition.X - BOX_SIZE1, boxPosition.Y - BOX_SIZE1, boxPosition.Z - BOX_SIZE1, @@ -114,7 +114,7 @@ bool octree() } { camera->setPosition(core::vector3df(120,40,50)); - driver->beginScene(true, true, 0); + driver->beginScene(video::ECBF_COLOR | video::ECBF_DEPTH, video::SColor(0)); smgr->drawAll(); core::aabbox3df box(boxPosition.X - BOX_SIZE2, boxPosition.Y - BOX_SIZE2, boxPosition.Z - BOX_SIZE2, @@ -203,7 +203,7 @@ bool triangle() bool result = true; { - driver->beginScene(true, true, 0xff00ffff); + driver->beginScene(video::ECBF_COLOR | video::ECBF_DEPTH, video::SColor(0xff00ffff)); smgr->drawAll(); core::aabbox3df box(boxPosition.X - BOX_SIZE, boxPosition.Y - BOX_SIZE, boxPosition.Z - BOX_SIZE, @@ -227,7 +227,7 @@ bool triangle() } { boxPosition.Z -= 10.f; - driver->beginScene(true, true, 0xff00ffff); + driver->beginScene(video::ECBF_COLOR | video::ECBF_DEPTH, video::SColor(0xff00ffff)); smgr->drawAll(); core::aabbox3df box(boxPosition.X - BOX_SIZE, boxPosition.Y - BOX_SIZE, boxPosition.Z - BOX_SIZE, @@ -251,7 +251,7 @@ bool triangle() } { boxPosition.Z -= 20.f; - driver->beginScene(true, true, 0xff00ffff); + driver->beginScene(video::ECBF_COLOR | video::ECBF_DEPTH, video::SColor(0xff00ffff)); smgr->drawAll(); core::aabbox3df box(boxPosition.X - BOX_SIZE, boxPosition.Y - BOX_SIZE, boxPosition.Z - BOX_SIZE, diff --git a/tests/userClipPlane.cpp b/tests/userClipPlane.cpp index 6e6347f7..ab87cfeb 100644 --- a/tests/userClipPlane.cpp +++ b/tests/userClipPlane.cpp @@ -36,7 +36,7 @@ static bool withSphere(video::E_DRIVER_TYPE type) device->run(); // while(device->run()) { - driver->beginScene(true, true, video::SColor(255,113,113,133)); + driver->beginScene(video::ECBF_COLOR | video::ECBF_DEPTH, video::SColor(255,113,113,133)); driver->setClipPlane(3, core::plane3df(core::vector3df(-8,0,0), core::vector3df(1,0,0)), true); driver->setClipPlane(4, core::plane3df(core::vector3df(0,0,8), core::vector3df(0,0,-1))); driver->setClipPlane(5, core::plane3df(core::vector3df(0,0,-8), core::vector3df(0,0,1))); diff --git a/tests/viewPort.cpp b/tests/viewPort.cpp index 9c1755d5..9afd9e27 100644 --- a/tests/viewPort.cpp +++ b/tests/viewPort.cpp @@ -43,7 +43,7 @@ static bool viewPortText(E_DRIVER_TYPE driverType) smgr->addCubeSceneNode(); smgr->addCameraSceneNode(0, vector3df(0,30,-40), vector3df(0,5,0)); - driver->beginScene(true, true, SColor(255,100,101,140)); + driver->beginScene(video::ECBF_COLOR | video::ECBF_DEPTH, SColor(255,100,101,140)); smgr->drawAll(); env->drawAll(); driver->setViewPort(rect(0,0,160/2,120/2)); diff --git a/tests/writeImageToFile.cpp b/tests/writeImageToFile.cpp index 36e719c0..22608ca7 100644 --- a/tests/writeImageToFile.cpp +++ b/tests/writeImageToFile.cpp @@ -30,7 +30,7 @@ bool writeImageToFile(void) cube->setMaterialFlag(video::EMF_LIGHTING, false); (void)smgr->addCameraSceneNode(); - driver->beginScene(true, true, SColor(255,100,101,140)); + driver->beginScene(video::ECBF_COLOR | video::ECBF_DEPTH, SColor(255,100,101,140)); smgr->drawAll(); // Test for benign handling of offscreen pixel values as well as onscreen ones. diff --git a/tools/GUIEditor/CMemoryReadWriteFile.cpp b/tools/GUIEditor/CMemoryReadWriteFile.cpp index 0a69587e..24534886 100644 --- a/tools/GUIEditor/CMemoryReadWriteFile.cpp +++ b/tools/GUIEditor/CMemoryReadWriteFile.cpp @@ -93,3 +93,7 @@ s32 CMemoryReadWriteFile::read(void* buffer, u32 sizeToRead) return sizeToRead; } +bool CMemoryReadWriteFile::flush() +{ + return true; // no buffering, nothing to do +} diff --git a/tools/GUIEditor/CMemoryReadWriteFile.h b/tools/GUIEditor/CMemoryReadWriteFile.h index de20ae7d..ffa1bde0 100644 --- a/tools/GUIEditor/CMemoryReadWriteFile.h +++ b/tools/GUIEditor/CMemoryReadWriteFile.h @@ -55,6 +55,9 @@ namespace io //! \return Returns the file name as zero terminated character string. virtual const io::path& getFileName() const; + //! Flush the content of the buffer in the file + virtual bool flush() _IRR_OVERRIDE_; + //! Returns file data as an array core::array& getData(); diff --git a/tools/GUIEditor/GUI Editor_v8.sln b/tools/GUIEditor/GUI Editor_v8.sln deleted file mode 100644 index 6f762697..00000000 --- a/tools/GUIEditor/GUI Editor_v8.sln +++ /dev/null @@ -1,20 +0,0 @@ - -Microsoft Visual Studio Solution File, Format Version 9.00 -# Visual C++ Express 2005 -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "GUI Editor", "GUI Editor.vcproj", "{853A396E-C031-4C26-A716-5B4E176BE11D}" -EndProject -Global - GlobalSection(SolutionConfigurationPlatforms) = preSolution - Debug|Win32 = Debug|Win32 - Release|Win32 = Release|Win32 - EndGlobalSection - GlobalSection(ProjectConfigurationPlatforms) = postSolution - {853A396E-C031-4C26-A716-5B4E176BE11D}.Debug|Win32.ActiveCfg = Debug|Win32 - {853A396E-C031-4C26-A716-5B4E176BE11D}.Debug|Win32.Build.0 = Debug|Win32 - {853A396E-C031-4C26-A716-5B4E176BE11D}.Release|Win32.ActiveCfg = Release|Win32 - {853A396E-C031-4C26-A716-5B4E176BE11D}.Release|Win32.Build.0 = Release|Win32 - EndGlobalSection - GlobalSection(SolutionProperties) = preSolution - HideSolutionNode = FALSE - EndGlobalSection -EndGlobal diff --git a/tools/GUIEditor/GUI Editor_v8.vcproj b/tools/GUIEditor/GUI Editor_v8.vcproj deleted file mode 100644 index 81c6fa90..00000000 --- a/tools/GUIEditor/GUI Editor_v8.vcproj +++ /dev/null @@ -1,295 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/tools/GUIEditor/GUI Editor_v9.sln b/tools/GUIEditor/GUI Editor_v9.sln deleted file mode 100644 index 0acf300a..00000000 --- a/tools/GUIEditor/GUI Editor_v9.sln +++ /dev/null @@ -1,20 +0,0 @@ - -Microsoft Visual Studio Solution File, Format Version 10.00 -# Visual C++ Express 2008 -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "GUI Editor_v9", "GUI Editor_v9.vcproj", "{853A396E-C031-4C26-A716-5B4E176BE11D}" -EndProject -Global - GlobalSection(SolutionConfigurationPlatforms) = preSolution - Debug|Win32 = Debug|Win32 - Release|Win32 = Release|Win32 - EndGlobalSection - GlobalSection(ProjectConfigurationPlatforms) = postSolution - {853A396E-C031-4C26-A716-5B4E176BE11D}.Debug|Win32.ActiveCfg = Debug|Win32 - {853A396E-C031-4C26-A716-5B4E176BE11D}.Debug|Win32.Build.0 = Debug|Win32 - {853A396E-C031-4C26-A716-5B4E176BE11D}.Release|Win32.ActiveCfg = Release|Win32 - {853A396E-C031-4C26-A716-5B4E176BE11D}.Release|Win32.Build.0 = Release|Win32 - EndGlobalSection - GlobalSection(SolutionProperties) = preSolution - HideSolutionNode = FALSE - EndGlobalSection -EndGlobal diff --git a/tools/GUIEditor/GUI Editor_v9.vcproj b/tools/GUIEditor/GUI Editor_v9.vcproj deleted file mode 100644 index 6d73d032..00000000 --- a/tools/GUIEditor/GUI Editor_v9.vcproj +++ /dev/null @@ -1,293 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/tools/GUIEditor/GUI Editor_vc10.vcxproj b/tools/GUIEditor/GUI Editor_vc10.vcxproj index 70228766..82c0fbb3 100644 --- a/tools/GUIEditor/GUI Editor_vc10.vcxproj +++ b/tools/GUIEditor/GUI Editor_vc10.vcxproj @@ -28,18 +28,22 @@ Application MultiByte + Windows7.1SDK Application MultiByte + Windows7.1SDK Application MultiByte + Windows7.1SDK Application MultiByte + Windows7.1SDK diff --git a/tools/GUIEditor/GUI Editor_vc11.vcxproj b/tools/GUIEditor/GUI Editor_vc11.vcxproj index 6c6f28bd..f90a1ac6 100644 --- a/tools/GUIEditor/GUI Editor_vc11.vcxproj +++ b/tools/GUIEditor/GUI Editor_vc11.vcxproj @@ -28,22 +28,22 @@ Application MultiByte - v110 + Windows7.1SDK Application MultiByte - v110 + Windows7.1SDK Application MultiByte - v110 + Windows7.1SDK Application MultiByte - v110 + Windows7.1SDK diff --git a/tools/GUIEditor/GUI Editor_vc12.vcxproj b/tools/GUIEditor/GUI Editor_vc12.vcxproj new file mode 100644 index 00000000..0b391be2 --- /dev/null +++ b/tools/GUIEditor/GUI Editor_vc12.vcxproj @@ -0,0 +1,217 @@ + + + + + Debug + Win32 + + + Debug + x64 + + + Release + Win32 + + + Release + x64 + + + + {853A396E-C031-4C26-A716-5B4E176BE11D} + GUI Editor + Win32Proj + GUIEditor + + + + Application + MultiByte + Windows7.1SDK + + + Application + MultiByte + Windows7.1SDK + + + Application + MultiByte + Windows7.1SDK + + + Application + MultiByte + Windows7.1SDK + + + + + + + + + + + + + + + + + + + + + + + <_ProjectFileVersion>10.0.30319.1 + ..\..\bin\Win32-VisualStudio\ + ..\..\bin\Win64-VisualStudio\ + true + true + ..\..\bin\Win32-VisualStudio\ + ..\..\bin\Win64-VisualStudio\ + false + false + AllRules.ruleset + AllRules.ruleset + + + + + AllRules.ruleset + AllRules.ruleset + + + + + + + + Disabled + Neither + false + ..\..\include;%(AdditionalIncludeDirectories) + WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions) + true + EnableFastChecks + MultiThreadedDebug + + + Level3 + EditAndContinue + + + kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib glu32.lib opengl32.lib %(AdditionalOptions) + ..\..\lib\Win32-visualstudio;%(AdditionalLibraryDirectories) + true + Console + + + + + + + Disabled + Neither + false + ..\..\include;%(AdditionalIncludeDirectories) + WIN32;WIN64;_DEBUG;_CONSOLE;%(PreprocessorDefinitions) + EnableFastChecks + MultiThreadedDebug + + + Level3 + ProgramDatabase + + + kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib glu32.lib opengl32.lib %(AdditionalOptions) + ..\..\lib\Win64-visualstudio;%(AdditionalLibraryDirectories) + true + Console + + + + + + + Full + ..\..\include;%(AdditionalIncludeDirectories) + WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions) + MultiThreaded + + + Level3 + ProgramDatabase + + + ../../bin/Win32-visualstudio/GUIEditor.exe + ..\..\lib\Win32-visualstudio;%(AdditionalLibraryDirectories) + true + Console + true + true + + + + + + + Full + ..\..\include;%(AdditionalIncludeDirectories) + WIN32;WIN64;NDEBUG;_CONSOLE;%(PreprocessorDefinitions) + MultiThreaded + + + Level3 + ProgramDatabase + + + ../../bin/Win32-visualstudio/GUIEditor.exe + ..\..\lib\Win64-visualstudio;%(AdditionalLibraryDirectories) + true + Console + true + true + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + {e08e042a-6c45-411b-92be-3cc31331019f} + false + + + + + + \ No newline at end of file diff --git a/tools/GUIEditor/GUI Editor_vc12.vcxproj.filters b/tools/GUIEditor/GUI Editor_vc12.vcxproj.filters new file mode 100644 index 00000000..1d06fa46 --- /dev/null +++ b/tools/GUIEditor/GUI Editor_vc12.vcxproj.filters @@ -0,0 +1,88 @@ + + + + + {f6ad9df9-ebaa-4c0f-997b-c8101c1fc669} + + + {7fd14cb1-d2e7-4fd0-85c1-68fc9d1249f7} + + + {ab2c3f3a-1d99-4619-b5df-47fdd9449f3f} + + + {740a4255-37cc-4ac4-94e9-f2f0970491a8} + + + {a28a0b21-3336-432f-9759-ff2dc064874a} + + + + + gui + + + gui + + + gui + + + gui + + + gui\GUIAttributes + + + gui\Useful GUI Elements + + + io + + + + + + gui + + + gui + + + gui + + + gui + + + gui\GUIAttributes + + + gui\GUIAttributes + + + gui\GUIAttributes + + + gui\GUIAttributes + + + gui\GUIAttributes + + + gui\GUIAttributes + + + gui\GUIAttributes + + + gui\Useful GUI Elements + + + gui\Element Editors + + + io + + + \ No newline at end of file diff --git a/tools/GUIEditor/GUI Editor_vc14.vcxproj b/tools/GUIEditor/GUI Editor_vc14.vcxproj new file mode 100644 index 00000000..e84a01b4 --- /dev/null +++ b/tools/GUIEditor/GUI Editor_vc14.vcxproj @@ -0,0 +1,217 @@ + + + + + Debug + Win32 + + + Debug + x64 + + + Release + Win32 + + + Release + x64 + + + + {853A396E-C031-4C26-A716-5B4E176BE11D} + GUI Editor + Win32Proj + GUIEditor + + + + Application + MultiByte + v140 + + + Application + MultiByte + v140 + + + Application + MultiByte + v140 + + + Application + MultiByte + v140 + + + + + + + + + + + + + + + + + + + + + + + <_ProjectFileVersion>10.0.30319.1 + ..\..\bin\Win32-VisualStudio\ + ..\..\bin\Win64-VisualStudio\ + true + true + ..\..\bin\Win32-VisualStudio\ + ..\..\bin\Win64-VisualStudio\ + false + false + AllRules.ruleset + AllRules.ruleset + + + + + AllRules.ruleset + AllRules.ruleset + + + + + + + + Disabled + Neither + false + ..\..\include;%(AdditionalIncludeDirectories) + WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions) + true + EnableFastChecks + MultiThreadedDebug + + + Level3 + EditAndContinue + + + kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib glu32.lib opengl32.lib %(AdditionalOptions) + ..\..\lib\Win32-visualstudio;%(AdditionalLibraryDirectories) + true + Console + + + + + + + Disabled + Neither + false + ..\..\include;%(AdditionalIncludeDirectories) + WIN32;WIN64;_DEBUG;_CONSOLE;%(PreprocessorDefinitions) + EnableFastChecks + MultiThreadedDebug + + + Level3 + ProgramDatabase + + + kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib glu32.lib opengl32.lib %(AdditionalOptions) + ..\..\lib\Win64-visualstudio;%(AdditionalLibraryDirectories) + true + Console + + + + + + + Full + ..\..\include;%(AdditionalIncludeDirectories) + WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions) + MultiThreaded + + + Level3 + ProgramDatabase + + + ../../bin/Win32-visualstudio/GUIEditor.exe + ..\..\lib\Win32-visualstudio;%(AdditionalLibraryDirectories) + true + Console + true + true + + + + + + + Full + ..\..\include;%(AdditionalIncludeDirectories) + WIN32;WIN64;NDEBUG;_CONSOLE;%(PreprocessorDefinitions) + MultiThreaded + + + Level3 + ProgramDatabase + + + ../../bin/Win32-visualstudio/GUIEditor.exe + ..\..\lib\Win64-visualstudio;%(AdditionalLibraryDirectories) + true + Console + true + true + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + {e08e042a-6c45-411b-92be-3cc31331019f} + false + + + + + + \ No newline at end of file diff --git a/tools/GUIEditor/GUI Editor_vc14.vcxproj.filters b/tools/GUIEditor/GUI Editor_vc14.vcxproj.filters new file mode 100644 index 00000000..1d06fa46 --- /dev/null +++ b/tools/GUIEditor/GUI Editor_vc14.vcxproj.filters @@ -0,0 +1,88 @@ + + + + + {f6ad9df9-ebaa-4c0f-997b-c8101c1fc669} + + + {7fd14cb1-d2e7-4fd0-85c1-68fc9d1249f7} + + + {ab2c3f3a-1d99-4619-b5df-47fdd9449f3f} + + + {740a4255-37cc-4ac4-94e9-f2f0970491a8} + + + {a28a0b21-3336-432f-9759-ff2dc064874a} + + + + + gui + + + gui + + + gui + + + gui + + + gui\GUIAttributes + + + gui\Useful GUI Elements + + + io + + + + + + gui + + + gui + + + gui + + + gui + + + gui\GUIAttributes + + + gui\GUIAttributes + + + gui\GUIAttributes + + + gui\GUIAttributes + + + gui\GUIAttributes + + + gui\GUIAttributes + + + gui\GUIAttributes + + + gui\Useful GUI Elements + + + gui\Element Editors + + + io + + + \ No newline at end of file diff --git a/tools/GUIEditor/main.cpp b/tools/GUIEditor/main.cpp index 7df42523..d591c147 100644 --- a/tools/GUIEditor/main.cpp +++ b/tools/GUIEditor/main.cpp @@ -63,9 +63,9 @@ int main() { const core::dimension2d& screenSize = driver->getScreenSize(); wchar_t caption[512]; - swprintf(caption, 512, L"screen (%4u/%4u)", screenSize.Width, screenSize.Height); + swprintf_irr(caption, 512, L"screen (%4u/%4u)", screenSize.Width, screenSize.Height); device->setWindowCaption(caption); - driver->beginScene(true, true, video::SColor(0,200,200,200)); + driver->beginScene(video::ECBF_COLOR | video::ECBF_DEPTH, video::SColor(0,200,200,200)); smgr->drawAll(); env->drawAll(); driver->endScene(); diff --git a/tools/IrrFontTool/newFontTool/CVectorFontTool.h b/tools/IrrFontTool/newFontTool/CVectorFontTool.h index 05a9c79a..aac5dbcc 100644 --- a/tools/IrrFontTool/newFontTool/CVectorFontTool.h +++ b/tools/IrrFontTool/newFontTool/CVectorFontTool.h @@ -347,7 +347,7 @@ public: //while(Device->getTimer()->getTime() < endt ) //{ Device->run(); - Device->getVideoDriver()->beginScene(true,true,video::SColor(0,0,0,0)); + Device->getVideoDriver()->beginScene(video::ECBF_COLOR | video::ECBF_DEPTH, video::SColor(0,0,0,0)); for (u32 v=0;vgetTimer()->getTime()-stt) % 500) / 500.0f; device->run(); - device->getVideoDriver()->beginScene(true,true,video::SColor(0,0,0,0)); + device->getVideoDriver()->beginScene(video::ECBF_COLOR | video::ECBF_DEPTH, video::SColor(0,0,0,0)); for (u32 g=0;ggetTimer()->getTime()-stt) % 500) / 500.0f; device->run(); - device->getVideoDriver()->beginScene(true,true,video::SColor(0,0,0,0)); + device->getVideoDriver()->beginScene(video::ECBF_COLOR | video::ECBF_DEPTH, video::SColor(0,0,0,0)); for (u32 g=0;ggetTimer()->getTime() < endt ) { device->run(); - device->getVideoDriver()->beginScene(true,true,video::SColor(0,0,0,0)); + device->getVideoDriver()->beginScene(video::ECBF_COLOR | video::ECBF_DEPTH, video::SColor(0,0,0,0)); for (u32 g=0;g - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/tools/IrrFontTool/newFontTool/irrFontTool_v9.sln b/tools/IrrFontTool/newFontTool/irrFontTool_v9.sln deleted file mode 100644 index be110b8c..00000000 --- a/tools/IrrFontTool/newFontTool/irrFontTool_v9.sln +++ /dev/null @@ -1,20 +0,0 @@ - -Microsoft Visual Studio Solution File, Format Version 10.00 -# Visual C++ Express 2008 -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Font Tool", "irrFontTool_v9.vcproj", "{853A396E-C031-4C26-A716-5B4E176BE11D}" -EndProject -Global - GlobalSection(SolutionConfigurationPlatforms) = preSolution - Debug|Win32 = Debug|Win32 - Release|Win32 = Release|Win32 - EndGlobalSection - GlobalSection(ProjectConfigurationPlatforms) = postSolution - {853A396E-C031-4C26-A716-5B4E176BE11D}.Debug|Win32.ActiveCfg = Debug|Win32 - {853A396E-C031-4C26-A716-5B4E176BE11D}.Debug|Win32.Build.0 = Debug|Win32 - {853A396E-C031-4C26-A716-5B4E176BE11D}.Release|Win32.ActiveCfg = Release|Win32 - {853A396E-C031-4C26-A716-5B4E176BE11D}.Release|Win32.Build.0 = Release|Win32 - EndGlobalSection - GlobalSection(SolutionProperties) = preSolution - HideSolutionNode = FALSE - EndGlobalSection -EndGlobal diff --git a/tools/IrrFontTool/newFontTool/irrFontTool_v9.vcproj b/tools/IrrFontTool/newFontTool/irrFontTool_v9.vcproj deleted file mode 100644 index 4fa1e4ba..00000000 --- a/tools/IrrFontTool/newFontTool/irrFontTool_v9.vcproj +++ /dev/null @@ -1,202 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/tools/IrrFontTool/newFontTool/irrFontTool_vc10.sln b/tools/IrrFontTool/newFontTool/irrFontTool_vc10.sln deleted file mode 100644 index 48651a8c..00000000 --- a/tools/IrrFontTool/newFontTool/irrFontTool_vc10.sln +++ /dev/null @@ -1,20 +0,0 @@ - -Microsoft Visual Studio Solution File, Format Version 11.00 -# Visual Studio 2010 -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Font Tool", "irrFontTool_vc10.vcxproj", "{4D53E40F-37E3-42B1-8848-F4C6F8313A17}" -EndProject -Global - GlobalSection(SolutionConfigurationPlatforms) = preSolution - Debug|Win32 = Debug|Win32 - Release|Win32 = Release|Win32 - EndGlobalSection - GlobalSection(ProjectConfigurationPlatforms) = postSolution - {4D53E40F-37E3-42B1-8848-F4C6F8313A17}.Debug|Win32.ActiveCfg = Debug|Win32 - {4D53E40F-37E3-42B1-8848-F4C6F8313A17}.Debug|Win32.Build.0 = Debug|Win32 - {4D53E40F-37E3-42B1-8848-F4C6F8313A17}.Release|Win32.ActiveCfg = Release|Win32 - {4D53E40F-37E3-42B1-8848-F4C6F8313A17}.Release|Win32.Build.0 = Release|Win32 - EndGlobalSection - GlobalSection(SolutionProperties) = preSolution - HideSolutionNode = FALSE - EndGlobalSection -EndGlobal diff --git a/tools/IrrFontTool/newFontTool/irrFontTool_vc10.vcxproj b/tools/IrrFontTool/newFontTool/irrFontTool_vc10.vcxproj index e1ee889d..d031deca 100644 --- a/tools/IrrFontTool/newFontTool/irrFontTool_vc10.vcxproj +++ b/tools/IrrFontTool/newFontTool/irrFontTool_vc10.vcxproj @@ -28,19 +28,23 @@ Application MultiByte true + Windows7.1SDK Application MultiByte true + Windows7.1SDK Application MultiByte + Windows7.1SDK Application MultiByte + Windows7.1SDK diff --git a/tools/IrrFontTool/newFontTool/irrFontTool_vc11.sln b/tools/IrrFontTool/newFontTool/irrFontTool_vc11.sln deleted file mode 100644 index 05b60adf..00000000 --- a/tools/IrrFontTool/newFontTool/irrFontTool_vc11.sln +++ /dev/null @@ -1,20 +0,0 @@ - -Microsoft Visual Studio Solution File, Format Version 11.00 -# Visual Studio 2012 -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Font Tool", "irrFontTool_vc11.vcxproj", "{4D53E40F-37E3-42B1-8848-F4C6F8313A17}" -EndProject -Global - GlobalSection(SolutionConfigurationPlatforms) = preSolution - Debug|Win32 = Debug|Win32 - Release|Win32 = Release|Win32 - EndGlobalSection - GlobalSection(ProjectConfigurationPlatforms) = postSolution - {4D53E40F-37E3-42B1-8848-F4C6F8313A17}.Debug|Win32.ActiveCfg = Debug|Win32 - {4D53E40F-37E3-42B1-8848-F4C6F8313A17}.Debug|Win32.Build.0 = Debug|Win32 - {4D53E40F-37E3-42B1-8848-F4C6F8313A17}.Release|Win32.ActiveCfg = Release|Win32 - {4D53E40F-37E3-42B1-8848-F4C6F8313A17}.Release|Win32.Build.0 = Release|Win32 - EndGlobalSection - GlobalSection(SolutionProperties) = preSolution - HideSolutionNode = FALSE - EndGlobalSection -EndGlobal diff --git a/tools/IrrFontTool/newFontTool/irrFontTool_vc11.vcxproj b/tools/IrrFontTool/newFontTool/irrFontTool_vc11.vcxproj index 4513cfac..dc2702b1 100644 --- a/tools/IrrFontTool/newFontTool/irrFontTool_vc11.vcxproj +++ b/tools/IrrFontTool/newFontTool/irrFontTool_vc11.vcxproj @@ -28,23 +28,23 @@ Application MultiByte true - v110 + Windows7.1SDK Application MultiByte true - v110 + Windows7.1SDK Application MultiByte - v110 + Windows7.1SDK Application MultiByte - v110 + Windows7.1SDK diff --git a/tools/IrrFontTool/newFontTool/irrFontTool_vc12.vcxproj b/tools/IrrFontTool/newFontTool/irrFontTool_vc12.vcxproj new file mode 100644 index 00000000..ca538409 --- /dev/null +++ b/tools/IrrFontTool/newFontTool/irrFontTool_vc12.vcxproj @@ -0,0 +1,207 @@ + + + + + Debug + Win32 + + + Debug + x64 + + + Release + Win32 + + + Release + x64 + + + + FontTool + {4D53E40F-37E3-42B1-8848-F4C6F8313A17} + Win32Proj + + + + Application + MultiByte + true + Windows7.1SDK + + + Application + MultiByte + true + Windows7.1SDK + + + Application + MultiByte + Windows7.1SDK + + + Application + MultiByte + Windows7.1SDK + + + + + + + + + + + + + + + + + + + + + + + <_ProjectFileVersion>10.0.30319.1 + ..\..\..\bin\Win32-VisualStudio\ + ..\..\..\bin\Win64-VisualStudio\ + true + true + ..\..\..\bin\Win32-VisualStudio\ + ..\..\..\bin\Win64-VisualStudio\ + + + AllRules.ruleset + AllRules.ruleset + + + + + AllRules.ruleset + AllRules.ruleset + + + + + + + + Disabled + ../../../include;%(AdditionalIncludeDirectories) + WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions) + true + EnableFastChecks + MultiThreadedDebug + + + Level3 + EditAndContinue + + + kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib glu32.lib opengl32.lib gdi32.lib %(AdditionalOptions) + ../../../bin/Win32-visualstudio/FontTool.exe + ../../../lib/Win32-visualstudio;%(AdditionalLibraryDirectories) + true + Console + + + + + + + Disabled + ../../../include;%(AdditionalIncludeDirectories) + WIN32;WIN64;_DEBUG;_CONSOLE;%(PreprocessorDefinitions) + EnableFastChecks + MultiThreadedDebug + + + Level3 + ProgramDatabase + + + kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib glu32.lib opengl32.lib gdi32.lib %(AdditionalOptions) + ../../../bin/Win64-visualstudio/FontTool.exe + ../../../lib/Win64-visualstudio;%(AdditionalLibraryDirectories) + true + Console + + + + + + + MaxSpeed + false + ../../../include;%(AdditionalIncludeDirectories) + WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions) + true + MultiThreaded + + + Level3 + ProgramDatabase + + + kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib glu32.lib opengl32.lib gdi32.lib %(AdditionalOptions) + ../../../bin/Win32-visualstudio/FontTool.exe + ../../../lib/Win32-visualstudio;%(AdditionalLibraryDirectories) + false + Console + true + true + + + + + + + + + MaxSpeed + false + ../../../include;%(AdditionalIncludeDirectories) + WIN32;WIN64;NDEBUG;_CONSOLE;%(PreprocessorDefinitions) + MultiThreaded + + + Level3 + ProgramDatabase + + + kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib glu32.lib opengl32.lib gdi32.lib %(AdditionalOptions) + ../../../bin/Win64-visualstudio/FontTool.exe + ../../../lib/Win64-visualstudio;%(AdditionalLibraryDirectories) + false + Console + true + true + + + + + + + + + + + + + + + + + {e08e042a-6c45-411b-92be-3cc31331019f} + false + + + + + + \ No newline at end of file diff --git a/tools/IrrFontTool/newFontTool/irrFontTool_vc14.vcxproj b/tools/IrrFontTool/newFontTool/irrFontTool_vc14.vcxproj new file mode 100644 index 00000000..a63ae48b --- /dev/null +++ b/tools/IrrFontTool/newFontTool/irrFontTool_vc14.vcxproj @@ -0,0 +1,207 @@ + + + + + Debug + Win32 + + + Debug + x64 + + + Release + Win32 + + + Release + x64 + + + + FontTool + {4D53E40F-37E3-42B1-8848-F4C6F8313A17} + Win32Proj + + + + Application + MultiByte + true + v140 + + + Application + MultiByte + true + v140 + + + Application + MultiByte + v140 + + + Application + MultiByte + v140 + + + + + + + + + + + + + + + + + + + + + + + <_ProjectFileVersion>10.0.30319.1 + ..\..\..\bin\Win32-VisualStudio\ + ..\..\..\bin\Win64-VisualStudio\ + true + true + ..\..\..\bin\Win32-VisualStudio\ + ..\..\..\bin\Win64-VisualStudio\ + + + AllRules.ruleset + AllRules.ruleset + + + + + AllRules.ruleset + AllRules.ruleset + + + + + + + + Disabled + ../../../include;%(AdditionalIncludeDirectories) + WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions) + true + EnableFastChecks + MultiThreadedDebug + + + Level3 + EditAndContinue + + + kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib glu32.lib opengl32.lib gdi32.lib %(AdditionalOptions) + ../../../bin/Win32-visualstudio/FontTool.exe + ../../../lib/Win32-visualstudio;%(AdditionalLibraryDirectories) + true + Console + + + + + + + Disabled + ../../../include;%(AdditionalIncludeDirectories) + WIN32;WIN64;_DEBUG;_CONSOLE;%(PreprocessorDefinitions) + EnableFastChecks + MultiThreadedDebug + + + Level3 + ProgramDatabase + + + kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib glu32.lib opengl32.lib gdi32.lib %(AdditionalOptions) + ../../../bin/Win64-visualstudio/FontTool.exe + ../../../lib/Win64-visualstudio;%(AdditionalLibraryDirectories) + true + Console + + + + + + + MaxSpeed + false + ../../../include;%(AdditionalIncludeDirectories) + WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions) + true + MultiThreaded + + + Level3 + ProgramDatabase + + + kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib glu32.lib opengl32.lib gdi32.lib %(AdditionalOptions) + ../../../bin/Win32-visualstudio/FontTool.exe + ../../../lib/Win32-visualstudio;%(AdditionalLibraryDirectories) + false + Console + true + true + + + + + + + + + MaxSpeed + false + ../../../include;%(AdditionalIncludeDirectories) + WIN32;WIN64;NDEBUG;_CONSOLE;%(PreprocessorDefinitions) + MultiThreaded + + + Level3 + ProgramDatabase + + + kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib glu32.lib opengl32.lib gdi32.lib %(AdditionalOptions) + ../../../bin/Win64-visualstudio/FontTool.exe + ../../../lib/Win64-visualstudio;%(AdditionalLibraryDirectories) + false + Console + true + true + + + + + + + + + + + + + + + + + {e08e042a-6c45-411b-92be-3cc31331019f} + false + + + + + + \ No newline at end of file diff --git a/tools/IrrFontTool/newFontTool/main.cpp b/tools/IrrFontTool/newFontTool/main.cpp index 9e9e87f1..b6f85d7e 100644 --- a/tools/IrrFontTool/newFontTool/main.cpp +++ b/tools/IrrFontTool/newFontTool/main.cpp @@ -476,7 +476,7 @@ int main() if (device->isWindowActive()) { - driver->beginScene(true, true, video::SColor(0,200,200,200)); + driver->beginScene(video::ECBF_COLOR | video::ECBF_DEPTH, video::SColor(0,200,200,200)); smgr->drawAll(); env->drawAll(); driver->endScene(); diff --git a/tools/MeshConverter/MeshConverter_v9.vcproj b/tools/MeshConverter/MeshConverter_v9.vcproj deleted file mode 100644 index 5747218d..00000000 --- a/tools/MeshConverter/MeshConverter_v9.vcproj +++ /dev/null @@ -1,187 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/tools/MeshConverter/MeshConverter_vc10.vcxproj b/tools/MeshConverter/MeshConverter_vc10.vcxproj index c996a938..e36439b3 100644 --- a/tools/MeshConverter/MeshConverter_vc10.vcxproj +++ b/tools/MeshConverter/MeshConverter_vc10.vcxproj @@ -28,18 +28,22 @@ Application MultiByte + Windows7.1SDK Application MultiByte + Windows7.1SDK Application MultiByte + Windows7.1SDK Application MultiByte + Windows7.1SDK diff --git a/tools/MeshConverter/MeshConverter_vc11.vcxproj b/tools/MeshConverter/MeshConverter_vc11.vcxproj index 6493206b..12aa4665 100644 --- a/tools/MeshConverter/MeshConverter_vc11.vcxproj +++ b/tools/MeshConverter/MeshConverter_vc11.vcxproj @@ -28,22 +28,22 @@ Application MultiByte - v110 + Windows7.1SDK Application MultiByte - v110 + Windows7.1SDK Application MultiByte - v110 + Windows7.1SDK Application MultiByte - v110 + Windows7.1SDK diff --git a/tools/MeshConverter/MeshConverter_vc12.vcxproj b/tools/MeshConverter/MeshConverter_vc12.vcxproj new file mode 100644 index 00000000..69030bf4 --- /dev/null +++ b/tools/MeshConverter/MeshConverter_vc12.vcxproj @@ -0,0 +1,196 @@ + + + + + Debug + Win32 + + + Debug + x64 + + + Release + Win32 + + + Release + x64 + + + + MeshConverter + {E72B637E-4AA6-46F3-885F-AC67B4B470ED} + GUI Editor + Win32Proj + + + + Application + MultiByte + Windows7.1SDK + + + Application + MultiByte + Windows7.1SDK + + + Application + MultiByte + Windows7.1SDK + + + Application + MultiByte + Windows7.1SDK + + + + + + + + + + + + + + + + + + + + + + + <_ProjectFileVersion>10.0.30319.1 + ..\..\bin\Win32-VisualStudio\ + ..\..\bin\Win64-VisualStudio\ + true + true + ..\..\bin\Win32-VisualStudio\ + ..\..\bin\Win64-VisualStudio\ + false + false + AllRules.ruleset + AllRules.ruleset + + + + + AllRules.ruleset + AllRules.ruleset + + + + + + + + Disabled + Neither + false + ..\..\include;%(AdditionalIncludeDirectories) + WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions) + true + EnableFastChecks + MultiThreadedDebug + + + Level3 + EditAndContinue + + + kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib glu32.lib opengl32.lib %(AdditionalOptions) + ../../bin/Win32-visualstudio/MeshConverter.exe + ..\..\lib\Win32-visualstudio;%(AdditionalLibraryDirectories) + true + $(OutDir)TestProject.pdb + Console + + + + + + + Disabled + Neither + false + ..\..\include;%(AdditionalIncludeDirectories) + WIN32;WIN64_DEBUG;_CONSOLE;%(PreprocessorDefinitions) + EnableFastChecks + MultiThreadedDebug + + + Level3 + ProgramDatabase + + + kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib glu32.lib opengl32.lib %(AdditionalOptions) + ../../bin/Win64-visualstudio/MeshConverter.exe + ..\..\lib\Win32-visualstudio;%(AdditionalLibraryDirectories) + true + $(OutDir)TestProject.pdb + Console + + + + + + + Full + false + ..\..\include;%(AdditionalIncludeDirectories) + WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions) + MultiThreaded + + + Level3 + + + ../../bin/Win32-visualstudio/MeshConverter.exe + true + Console + true + true + + + + + + + Full + false + ..\..\include;%(AdditionalIncludeDirectories) + WIN32;WIN64NDEBUG;_CONSOLE;%(PreprocessorDefinitions) + MultiThreaded + + + Level3 + + + ../../bin/Win64-visualstudio/MeshConverter.exe + true + Console + true + true + + + + + + + + + + {e08e042a-6c45-411b-92be-3cc31331019f} + false + + + + + + \ No newline at end of file diff --git a/tools/MeshConverter/MeshConverter_vc14.vcxproj b/tools/MeshConverter/MeshConverter_vc14.vcxproj new file mode 100644 index 00000000..31c87bd7 --- /dev/null +++ b/tools/MeshConverter/MeshConverter_vc14.vcxproj @@ -0,0 +1,196 @@ + + + + + Debug + Win32 + + + Debug + x64 + + + Release + Win32 + + + Release + x64 + + + + MeshConverter + {E72B637E-4AA6-46F3-885F-AC67B4B470ED} + GUI Editor + Win32Proj + + + + Application + MultiByte + v140 + + + Application + MultiByte + v140 + + + Application + MultiByte + v140 + + + Application + MultiByte + v140 + + + + + + + + + + + + + + + + + + + + + + + <_ProjectFileVersion>10.0.30319.1 + ..\..\bin\Win32-VisualStudio\ + ..\..\bin\Win64-VisualStudio\ + true + true + ..\..\bin\Win32-VisualStudio\ + ..\..\bin\Win64-VisualStudio\ + false + false + AllRules.ruleset + AllRules.ruleset + + + + + AllRules.ruleset + AllRules.ruleset + + + + + + + + Disabled + Neither + false + ..\..\include;%(AdditionalIncludeDirectories) + WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions) + true + EnableFastChecks + MultiThreadedDebug + + + Level3 + EditAndContinue + + + kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib glu32.lib opengl32.lib %(AdditionalOptions) + ../../bin/Win32-visualstudio/MeshConverter.exe + ..\..\lib\Win32-visualstudio;%(AdditionalLibraryDirectories) + true + $(OutDir)TestProject.pdb + Console + + + + + + + Disabled + Neither + false + ..\..\include;%(AdditionalIncludeDirectories) + WIN32;WIN64_DEBUG;_CONSOLE;%(PreprocessorDefinitions) + EnableFastChecks + MultiThreadedDebug + + + Level3 + ProgramDatabase + + + kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib glu32.lib opengl32.lib %(AdditionalOptions) + ../../bin/Win64-visualstudio/MeshConverter.exe + ..\..\lib\Win32-visualstudio;%(AdditionalLibraryDirectories) + true + $(OutDir)TestProject.pdb + Console + + + + + + + Full + false + ..\..\include;%(AdditionalIncludeDirectories) + WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions) + MultiThreaded + + + Level3 + + + ../../bin/Win32-visualstudio/MeshConverter.exe + true + Console + true + true + + + + + + + Full + false + ..\..\include;%(AdditionalIncludeDirectories) + WIN32;WIN64NDEBUG;_CONSOLE;%(PreprocessorDefinitions) + MultiThreaded + + + Level3 + + + ../../bin/Win64-visualstudio/MeshConverter.exe + true + Console + true + true + + + + + + + + + + {e08e042a-6c45-411b-92be-3cc31331019f} + false + + + + + + \ No newline at end of file diff --git a/tools/MeshConverter/main.cpp b/tools/MeshConverter/main.cpp index d6b878f6..b1031f06 100644 --- a/tools/MeshConverter/main.cpp +++ b/tools/MeshConverter/main.cpp @@ -9,7 +9,7 @@ using namespace video; using namespace io; using namespace gui; -#ifdef _IRR_WINDOWS_ +#ifdef _MSC_VER #pragma comment(lib, "Irrlicht.lib") #endif @@ -98,7 +98,7 @@ int main(int argc, char* argv[]) IMeshWriter* mw = device->getSceneManager()->createMeshWriter(type); IWriteFile* file = device->getFileSystem()->createAndWriteFile(argv[destmesh]); mw->writeMesh(file, mesh); - + file->drop(); mw->drop(); device->drop();