From f9158592e1478b2013afc7041d9ed041cf2d2f4a Mon Sep 17 00:00:00 2001 From: David Walter Seikel Date: Mon, 13 Jan 2014 19:47:58 +1000 Subject: Update Irrlicht to 1.8.1. Include actual change markers this time. lol --- .../examples/01.HelloWorld/HelloWorld.cbp | 55 + .../examples/01.HelloWorld/HelloWorld.dev | 59 + .../examples/01.HelloWorld/HelloWorld.vcproj | 163 ++ .../examples/01.HelloWorld/HelloWorld_vc10.vcxproj | 231 +++ .../examples/01.HelloWorld/HelloWorld_vc11.vcxproj | 235 +++ .../examples/01.HelloWorld/HelloWorld_vc8.vcproj | 231 +++ .../examples/01.HelloWorld/HelloWorld_vc9.vcproj | 230 ++ .../irrlicht-1.8.1/examples/01.HelloWorld/Makefile | 66 + .../irrlicht-1.8.1/examples/01.HelloWorld/main.cpp | 236 +++ .../examples/01.HelloWorld/tutorial.html | 394 ++++ .../irrlicht-1.8.1/examples/02.Quake3Map/Makefile | 40 + .../examples/02.Quake3Map/Quake3Map.cbp | 55 + .../examples/02.Quake3Map/Quake3Map.dev | 59 + .../examples/02.Quake3Map/Quake3Map.vcproj | 162 ++ .../examples/02.Quake3Map/Quake3Map_vc10.vcxproj | 231 +++ .../examples/02.Quake3Map/Quake3Map_vc11.vcxproj | 235 +++ .../examples/02.Quake3Map/Quake3Map_vc8.vcproj | 231 +++ .../examples/02.Quake3Map/Quake3Map_vc9.vcproj | 230 ++ .../irrlicht-1.8.1/examples/02.Quake3Map/main.cpp | 206 ++ .../examples/02.Quake3Map/tutorial.html | 181 ++ .../03.CustomSceneNode/CustomSceneNode.cbp | 58 + .../03.CustomSceneNode/CustomSceneNode.dev | 59 + .../03.CustomSceneNode/CustomSceneNode.vcproj | 163 ++ .../CustomSceneNode_vc10.vcxproj | 243 +++ .../CustomSceneNode_vc11.vcxproj | 247 +++ .../03.CustomSceneNode/CustomSceneNode_vc8.vcproj | 231 +++ .../03.CustomSceneNode/CustomSceneNode_vc9.vcproj | 230 ++ .../examples/03.CustomSceneNode/Makefile | 38 + .../examples/03.CustomSceneNode/main.cpp | 267 +++ .../examples/03.CustomSceneNode/tutorial.html | 222 ++ .../irrlicht-1.8.1/examples/04.Movement/Makefile | 39 + .../examples/04.Movement/Movement.cbp | 55 + .../examples/04.Movement/Movement.dev | 59 + .../examples/04.Movement/Movement.vcproj | 163 ++ .../examples/04.Movement/Movement_vc10.vcxproj | 231 +++ .../examples/04.Movement/Movement_vc11.vcxproj | 235 +++ .../examples/04.Movement/Movement_vc8.vcproj | 231 +++ .../examples/04.Movement/Movement_vc9.vcproj | 230 ++ .../irrlicht-1.8.1/examples/04.Movement/main.cpp | 258 +++ .../examples/04.Movement/tutorial.html | 188 ++ .../examples/05.UserInterface/Makefile | 38 + .../examples/05.UserInterface/UserInterface.cbp | 55 + .../examples/05.UserInterface/UserInterface.dev | 59 + .../examples/05.UserInterface/UserInterface.vcproj | 163 ++ .../05.UserInterface/UserInterface_vc10.vcxproj | 231 +++ .../05.UserInterface/UserInterface_vc11.vcxproj | 235 +++ .../05.UserInterface/UserInterface_vc8.vcproj | 231 +++ .../05.UserInterface/UserInterface_vc9.vcproj | 230 ++ .../examples/05.UserInterface/main.cpp | 291 +++ .../examples/05.UserInterface/tutorial.html | 225 ++ .../examples/06.2DGraphics/2DGraphics.cbp | 55 + .../examples/06.2DGraphics/2DGraphics.dev | 59 + .../examples/06.2DGraphics/2DGraphics.vcproj | 163 ++ .../examples/06.2DGraphics/2DGraphics_vc10.vcxproj | 231 +++ .../examples/06.2DGraphics/2DGraphics_vc11.vcxproj | 235 +++ .../examples/06.2DGraphics/2DGraphics_vc8.vcproj | 231 +++ .../examples/06.2DGraphics/2DGraphics_vc9.vcproj | 230 ++ .../irrlicht-1.8.1/examples/06.2DGraphics/Makefile | 38 + .../irrlicht-1.8.1/examples/06.2DGraphics/main.cpp | 166 ++ .../examples/06.2DGraphics/tutorial.html | 163 ++ .../examples/07.Collision/Collision.cbp | 55 + .../examples/07.Collision/Collision.dev | 59 + .../examples/07.Collision/Collision.vcproj | 163 ++ .../examples/07.Collision/Collision_vc10.vcxproj | 231 +++ .../examples/07.Collision/Collision_vc11.vcxproj | 235 +++ .../examples/07.Collision/Collision_vc8.vcproj | 231 +++ .../examples/07.Collision/Collision_vc9.vcproj | 230 ++ .../irrlicht-1.8.1/examples/07.Collision/Makefile | 38 + .../irrlicht-1.8.1/examples/07.Collision/main.cpp | 330 +++ .../examples/07.Collision/tutorial.html | 308 +++ .../irrlicht-1.8.1/examples/08.SpecialFX/Makefile | 38 + .../examples/08.SpecialFX/SpecialFX.cbp | 54 + .../examples/08.SpecialFX/SpecialFX.dev | 59 + .../examples/08.SpecialFX/SpecialFX.vcproj | 163 ++ .../examples/08.SpecialFX/SpecialFX_vc10.vcxproj | 231 +++ .../examples/08.SpecialFX/SpecialFX_vc11.vcxproj | 235 +++ .../examples/08.SpecialFX/SpecialFX_vc8.vcproj | 231 +++ .../examples/08.SpecialFX/SpecialFX_vc9.vcproj | 230 ++ .../irrlicht-1.8.1/examples/08.SpecialFX/main.cpp | 308 +++ .../examples/08.SpecialFX/tutorial.html | 278 +++ .../examples/09.Meshviewer/9.Meshviewer.rc | 84 + .../irrlicht-1.8.1/examples/09.Meshviewer/Makefile | 38 + .../examples/09.Meshviewer/MeshViewer.dev | 59 + .../examples/09.Meshviewer/Meshviewer.cbp | 55 + .../examples/09.Meshviewer/Meshviewer.vcproj | 163 ++ .../examples/09.Meshviewer/Meshviewer_vc10.vcxproj | 231 +++ .../examples/09.Meshviewer/Meshviewer_vc11.vcxproj | 235 +++ .../examples/09.Meshviewer/Meshviewer_vc8.vcproj | 231 +++ .../examples/09.Meshviewer/Meshviewer_vc9.vcproj | 230 ++ .../irrlicht-1.8.1/examples/09.Meshviewer/icon.ico | Bin 0 -> 2238 bytes .../irrlicht-1.8.1/examples/09.Meshviewer/main.cpp | 1042 ++++++++++ .../examples/09.Meshviewer/resource.h | 16 + .../examples/09.Meshviewer/tutorial.html | 182 ++ .../irrlicht-1.8.1/examples/10.Shaders/Makefile | 38 + .../irrlicht-1.8.1/examples/10.Shaders/Shaders.cbp | 56 + .../irrlicht-1.8.1/examples/10.Shaders/Shaders.dev | 59 + .../examples/10.Shaders/Shaders.vcproj | 163 ++ .../examples/10.Shaders/Shaders_vc10.vcxproj | 231 +++ .../examples/10.Shaders/Shaders_vc11.vcxproj | 235 +++ .../examples/10.Shaders/Shaders_vc8.vcproj | 231 +++ .../examples/10.Shaders/Shaders_vc9.vcproj | 230 ++ .../irrlicht-1.8.1/examples/10.Shaders/main.cpp | 443 ++++ .../examples/10.Shaders/tutorial.html | 566 +++++ .../examples/11.PerPixelLighting/Makefile | 38 + .../11.PerPixelLighting/PerPixelLighting.cbp | 56 + .../11.PerPixelLighting/PerPixelLighting.dev | 59 + .../11.PerPixelLighting/PerPixelLighting.vcproj | 163 ++ .../PerPixelLighting_vc10.vcxproj | 231 +++ .../PerPixelLighting_vc11.vcxproj | 235 +++ .../PerPixelLighting_vc8.vcproj | 231 +++ .../PerPixelLighting_vc9.vcproj | 230 ++ .../examples/11.PerPixelLighting/main.cpp | 487 +++++ .../examples/11.PerPixelLighting/tutorial.html | 502 +++++ .../examples/12.TerrainRendering/Makefile | 38 + .../12.TerrainRendering/TerrainRendering.cbp | 56 + .../12.TerrainRendering/TerrainRendering.dev | 59 + .../12.TerrainRendering/TerrainRendering.vcproj | 163 ++ .../TerrainRendering_vc10.vcxproj | 231 +++ .../TerrainRendering_vc11.vcxproj | 235 +++ .../TerrainRendering_vc8.vcproj | 231 +++ .../TerrainRendering_vc9.vcproj | 230 ++ .../examples/12.TerrainRendering/main.cpp | 285 +++ .../examples/12.TerrainRendering/tutorial.html | 122 ++ .../examples/13.RenderToTexture/Makefile | 38 + .../13.RenderToTexture/RenderToTexture.cbp | 55 + .../13.RenderToTexture/RenderToTexture.dev | 59 + .../13.RenderToTexture/RenderToTexture.vcproj | 163 ++ .../RenderToTexture_vc10.vcxproj | 231 +++ .../RenderToTexture_vc11.vcxproj | 235 +++ .../13.RenderToTexture/RenderToTexture_vc8.vcproj | 231 +++ .../13.RenderToTexture/RenderToTexture_vc9.vcproj | 230 ++ .../examples/13.RenderToTexture/main.cpp | 211 ++ .../examples/13.RenderToTexture/tutorial.html | 244 +++ .../examples/14.Win32Window/Makefile | 38 + .../examples/14.Win32Window/Win32Window.cbp | 43 + .../examples/14.Win32Window/Win32Window.dev | 59 + .../examples/14.Win32Window/Win32Window.vcproj | 165 ++ .../14.Win32Window/Win32Window_vc10.vcxproj | 235 +++ .../14.Win32Window/Win32Window_vc11.vcxproj | 239 +++ .../examples/14.Win32Window/Win32Window_vc8.vcproj | 232 +++ .../examples/14.Win32Window/Win32Window_vc9.vcproj | 232 +++ .../examples/14.Win32Window/main.cpp | 251 +++ .../examples/14.Win32Window/tutorial.html | 247 +++ .../examples/15.LoadIrrFile/LoadIrrFile.cbp | 54 + .../examples/15.LoadIrrFile/LoadIrrFile.dev | 59 + .../examples/15.LoadIrrFile/LoadIrrFile.vcproj | 162 ++ .../15.LoadIrrFile/LoadIrrFile_vc10.vcxproj | 231 +++ .../15.LoadIrrFile/LoadIrrFile_vc11.vcxproj | 235 +++ .../examples/15.LoadIrrFile/LoadIrrFile_vc8.vcproj | 231 +++ .../examples/15.LoadIrrFile/LoadIrrFile_vc9.vcproj | 230 ++ .../examples/15.LoadIrrFile/Makefile | 38 + .../examples/15.LoadIrrFile/main.cpp | 173 ++ .../examples/15.LoadIrrFile/tutorial.html | 129 ++ .../examples/16.Quake3MapShader/Makefile | 38 + .../16.Quake3MapShader/Quake3MapShader.cbp | 56 + .../16.Quake3MapShader/Quake3MapShader.dev | 59 + .../16.Quake3MapShader/Quake3MapShader.vcproj | 133 ++ .../Quake3MapShader_vc10.vcxproj | 190 ++ .../Quake3MapShader_vc11.vcxproj | 194 ++ .../16.Quake3MapShader/Quake3MapShader_vc8.vcproj | 190 ++ .../16.Quake3MapShader/Quake3MapShader_vc9.vcproj | 188 ++ .../examples/16.Quake3MapShader/main.cpp | 389 ++++ .... HelloWorld for Windows Mobile on PC_v8.vcproj | 185 ++ .... HelloWorld for Windows Mobile on PC_v9.vcproj | 184 ++ ...elloWorld for Windows Mobile on PC_vc10.vcxproj | 176 ++ ...elloWorld for Windows Mobile on PC_vc11.vcxproj | 180 ++ .../17.HelloWorld_Mobile/HelloWorld_mobile.sln | 33 + .../17.HelloWorld_Mobile/HelloWorld_mobile.vcproj | 198 ++ .../examples/17.HelloWorld_Mobile/main.cpp | 503 +++++ .../examples/18.SplitScreen/Makefile | 38 + .../examples/18.SplitScreen/SplitScreen.cbp | 55 + .../examples/18.SplitScreen/SplitScreen.dev | 59 + .../examples/18.SplitScreen/SplitScreen.vcproj | 132 ++ .../18.SplitScreen/SplitScreen_vc10.vcxproj | 190 ++ .../18.SplitScreen/SplitScreen_vc11.vcxproj | 194 ++ .../examples/18.SplitScreen/SplitScreen_vc8.vcproj | 189 ++ .../examples/18.SplitScreen/SplitScreen_vc9.vcproj | 188 ++ .../examples/18.SplitScreen/main.cpp | 244 +++ .../examples/19.MouseAndJoystick/Makefile | 39 + .../19.MouseAndJoystick/MouseAndJoystick.cbp | 56 + .../19.MouseAndJoystick/MouseAndJoystick.dev | 59 + .../19.MouseAndJoystick/MouseAndJoystick.vcproj | 162 ++ .../MouseAndJoystick_vc10.vcxproj | 227 ++ .../MouseAndJoystick_vc11.vcxproj | 231 +++ .../MouseAndJoystick_vc8.vcproj | 231 +++ .../MouseAndJoystick_vc9.vcproj | 230 ++ .../examples/19.MouseAndJoystick/main.cpp | 285 +++ .../examples/20.ManagedLights/Makefile | 39 + .../examples/20.ManagedLights/ManagedLights.cbp | 57 + .../examples/20.ManagedLights/ManagedLights.dev | 59 + .../examples/20.ManagedLights/ManagedLights.vcproj | 163 ++ .../20.ManagedLights/ManagedLights_vc10.vcxproj | 230 ++ .../20.ManagedLights/ManagedLights_vc11.vcxproj | 234 +++ .../20.ManagedLights/ManagedLights_vc8.vcproj | 231 +++ .../20.ManagedLights/ManagedLights_vc9.vcproj | 231 +++ .../examples/20.ManagedLights/main.cpp | 386 ++++ .../examples/21.Quake3Explorer/Makefile | 38 + .../examples/21.Quake3Explorer/Quake3Explorer.cbp | 59 + .../examples/21.Quake3Explorer/Quake3Explorer.dev | 99 + .../21.Quake3Explorer/Quake3Explorer.vcproj | 132 ++ .../21.Quake3Explorer/Quake3Explorer_vc10.vcxproj | 196 ++ .../21.Quake3Explorer/Quake3Explorer_vc11.vcxproj | 200 ++ .../21.Quake3Explorer/Quake3Explorer_vc8.vcproj | 210 ++ .../21.Quake3Explorer/Quake3Explorer_vc9.vcproj | 204 ++ .../examples/21.Quake3Explorer/main.cpp | 2188 ++++++++++++++++++++ .../examples/21.Quake3Explorer/q3factory.cpp | 824 ++++++++ .../examples/21.Quake3Explorer/q3factory.h | 149 ++ .../examples/21.Quake3Explorer/sound.cpp | 98 + .../examples/21.Quake3Explorer/sound.h | 18 + .../examples/22.MaterialViewer/Makefile | 38 + .../examples/22.MaterialViewer/MaterialViewer.cbp | 55 + .../examples/22.MaterialViewer/MaterialViewer.dev | 59 + .../22.MaterialViewer/MaterialViewer.vcproj | 229 ++ .../22.MaterialViewer/MaterialViewer_vc10.vcxproj | 231 +++ .../22.MaterialViewer/MaterialViewer_vc11.vcxproj | 235 +++ .../22.MaterialViewer/MaterialViewer_vc8.vcproj | 231 +++ .../22.MaterialViewer/MaterialViewer_vc9.vcproj | 230 ++ .../examples/22.MaterialViewer/main.cpp | 1057 ++++++++++ .../examples/23.SMeshHandling/Makefile | 38 + .../examples/23.SMeshHandling/SMeshHandling.cbp | 44 + .../examples/23.SMeshHandling/SMeshHandling.dev | 59 + .../examples/23.SMeshHandling/SMeshHandling.vcproj | 132 ++ .../23.SMeshHandling/SMeshHandling_vc10.vcxproj | 188 ++ .../23.SMeshHandling/SMeshHandling_vc11.vcxproj | 192 ++ .../23.SMeshHandling/SMeshHandling_vc8.vcproj | 190 ++ .../23.SMeshHandling/SMeshHandling_vc9.vcproj | 187 ++ .../examples/23.SMeshHandling/main.cpp | 426 ++++ .../examples/24.CursorControl/CursorControl.cbp | 56 + .../examples/24.CursorControl/CursorControl.vcproj | 132 ++ .../24.CursorControl/CursorControl_vc10.vcxproj | 184 ++ .../24.CursorControl/CursorControl_vc11.vcxproj | 188 ++ .../24.CursorControl/CursorControl_vc8.vcproj | 190 ++ .../24.CursorControl/CursorControl_vc9.vcproj | 185 ++ .../examples/24.CursorControl/Makefile | 66 + .../examples/24.CursorControl/main.cpp | 563 +++++ .../examples/25.XmlHandling/Makefile | 66 + .../examples/25.XmlHandling/XmlHandling.cbp | 55 + .../examples/25.XmlHandling/XmlHandling.vcproj | 195 ++ .../25.XmlHandling/XmlHandling_vc10.vcxproj | 178 ++ .../25.XmlHandling/XmlHandling_vc11.vcxproj | 182 ++ .../examples/25.XmlHandling/XmlHandling_vc8.vcproj | 190 ++ .../examples/25.XmlHandling/XmlHandling_vc9.vcproj | 185 ++ .../examples/25.XmlHandling/main.cpp | 505 +++++ .../examples/26.OcclusionQuery/Makefile | 39 + .../examples/26.OcclusionQuery/OcclusionQuery.cbp | 55 + .../examples/26.OcclusionQuery/OcclusionQuery.dev | 59 + .../26.OcclusionQuery/OcclusionQuery.vcproj | 163 ++ .../26.OcclusionQuery/OcclusionQuery_vc10.vcxproj | 231 +++ .../26.OcclusionQuery/OcclusionQuery_vc11.vcxproj | 235 +++ .../26.OcclusionQuery/OcclusionQuery_vc8.vcproj | 231 +++ .../26.OcclusionQuery/OcclusionQuery_vc9.vcproj | 230 ++ .../examples/26.OcclusionQuery/main.cpp | 213 ++ .../BuildAllExamples.MacOSX/DemoApp-Info.plist | 24 + .../examples/BuildAllExamples.workspace | 35 + .../examples/BuildAllExamples_v8.sln | 236 +++ .../examples/BuildAllExamples_v9.sln | 284 +++ .../examples/BuildAllExamples_vc10.sln | 409 ++++ .../examples/BuildAllExamples_vc11.sln | 409 ++++ libraries/irrlicht-1.8.1/examples/Demo/CDemo.cpp | 815 ++++++++ libraries/irrlicht-1.8.1/examples/Demo/CDemo.h | 110 + .../irrlicht-1.8.1/examples/Demo/CMainMenu.cpp | 378 ++++ libraries/irrlicht-1.8.1/examples/Demo/CMainMenu.h | 48 + libraries/irrlicht-1.8.1/examples/Demo/Demo.vcproj | 223 ++ .../irrlicht-1.8.1/examples/Demo/Demo_vc10.vcxproj | 279 +++ .../irrlicht-1.8.1/examples/Demo/Demo_vc11.vcxproj | 283 +++ .../irrlicht-1.8.1/examples/Demo/Demo_vc8.vcproj | 300 +++ .../irrlicht-1.8.1/examples/Demo/Demo_vc9.vcproj | 300 +++ libraries/irrlicht-1.8.1/examples/Demo/Makefile | 43 + libraries/irrlicht-1.8.1/examples/Demo/demo.cbp | 68 + libraries/irrlicht-1.8.1/examples/Demo/demo.dev | 99 + libraries/irrlicht-1.8.1/examples/Demo/icon.ico | Bin 0 -> 2238 bytes libraries/irrlicht-1.8.1/examples/Demo/main.cpp | 49 + libraries/irrlicht-1.8.1/examples/Demo/resource.h | 16 + .../irrlicht-1.8.1/examples/Demo/resscript.rc | 72 + libraries/irrlicht-1.8.1/examples/Makefile | 8 + .../irrlicht-1.8.1/examples/buildAllExamples.sh | 8 + .../examples/whereAreTheBinaries.txt | 7 + 277 files changed, 52343 insertions(+) create mode 100644 libraries/irrlicht-1.8.1/examples/01.HelloWorld/HelloWorld.cbp create mode 100644 libraries/irrlicht-1.8.1/examples/01.HelloWorld/HelloWorld.dev create mode 100644 libraries/irrlicht-1.8.1/examples/01.HelloWorld/HelloWorld.vcproj create mode 100644 libraries/irrlicht-1.8.1/examples/01.HelloWorld/HelloWorld_vc10.vcxproj create mode 100644 libraries/irrlicht-1.8.1/examples/01.HelloWorld/HelloWorld_vc11.vcxproj create mode 100644 libraries/irrlicht-1.8.1/examples/01.HelloWorld/HelloWorld_vc8.vcproj create mode 100644 libraries/irrlicht-1.8.1/examples/01.HelloWorld/HelloWorld_vc9.vcproj create mode 100644 libraries/irrlicht-1.8.1/examples/01.HelloWorld/Makefile create mode 100644 libraries/irrlicht-1.8.1/examples/01.HelloWorld/main.cpp create mode 100644 libraries/irrlicht-1.8.1/examples/01.HelloWorld/tutorial.html create mode 100644 libraries/irrlicht-1.8.1/examples/02.Quake3Map/Makefile create mode 100644 libraries/irrlicht-1.8.1/examples/02.Quake3Map/Quake3Map.cbp create mode 100644 libraries/irrlicht-1.8.1/examples/02.Quake3Map/Quake3Map.dev create mode 100644 libraries/irrlicht-1.8.1/examples/02.Quake3Map/Quake3Map.vcproj create mode 100644 libraries/irrlicht-1.8.1/examples/02.Quake3Map/Quake3Map_vc10.vcxproj create mode 100644 libraries/irrlicht-1.8.1/examples/02.Quake3Map/Quake3Map_vc11.vcxproj create mode 100644 libraries/irrlicht-1.8.1/examples/02.Quake3Map/Quake3Map_vc8.vcproj create mode 100644 libraries/irrlicht-1.8.1/examples/02.Quake3Map/Quake3Map_vc9.vcproj create mode 100644 libraries/irrlicht-1.8.1/examples/02.Quake3Map/main.cpp create mode 100644 libraries/irrlicht-1.8.1/examples/02.Quake3Map/tutorial.html create mode 100644 libraries/irrlicht-1.8.1/examples/03.CustomSceneNode/CustomSceneNode.cbp create mode 100644 libraries/irrlicht-1.8.1/examples/03.CustomSceneNode/CustomSceneNode.dev create mode 100644 libraries/irrlicht-1.8.1/examples/03.CustomSceneNode/CustomSceneNode.vcproj create mode 100644 libraries/irrlicht-1.8.1/examples/03.CustomSceneNode/CustomSceneNode_vc10.vcxproj create mode 100644 libraries/irrlicht-1.8.1/examples/03.CustomSceneNode/CustomSceneNode_vc11.vcxproj create mode 100644 libraries/irrlicht-1.8.1/examples/03.CustomSceneNode/CustomSceneNode_vc8.vcproj create mode 100644 libraries/irrlicht-1.8.1/examples/03.CustomSceneNode/CustomSceneNode_vc9.vcproj create mode 100644 libraries/irrlicht-1.8.1/examples/03.CustomSceneNode/Makefile create mode 100644 libraries/irrlicht-1.8.1/examples/03.CustomSceneNode/main.cpp create mode 100644 libraries/irrlicht-1.8.1/examples/03.CustomSceneNode/tutorial.html create mode 100644 libraries/irrlicht-1.8.1/examples/04.Movement/Makefile create mode 100644 libraries/irrlicht-1.8.1/examples/04.Movement/Movement.cbp create mode 100644 libraries/irrlicht-1.8.1/examples/04.Movement/Movement.dev create mode 100644 libraries/irrlicht-1.8.1/examples/04.Movement/Movement.vcproj create mode 100644 libraries/irrlicht-1.8.1/examples/04.Movement/Movement_vc10.vcxproj create mode 100644 libraries/irrlicht-1.8.1/examples/04.Movement/Movement_vc11.vcxproj create mode 100644 libraries/irrlicht-1.8.1/examples/04.Movement/Movement_vc8.vcproj create mode 100644 libraries/irrlicht-1.8.1/examples/04.Movement/Movement_vc9.vcproj create mode 100644 libraries/irrlicht-1.8.1/examples/04.Movement/main.cpp create mode 100644 libraries/irrlicht-1.8.1/examples/04.Movement/tutorial.html create mode 100644 libraries/irrlicht-1.8.1/examples/05.UserInterface/Makefile create mode 100644 libraries/irrlicht-1.8.1/examples/05.UserInterface/UserInterface.cbp create mode 100644 libraries/irrlicht-1.8.1/examples/05.UserInterface/UserInterface.dev create mode 100644 libraries/irrlicht-1.8.1/examples/05.UserInterface/UserInterface.vcproj create mode 100644 libraries/irrlicht-1.8.1/examples/05.UserInterface/UserInterface_vc10.vcxproj create mode 100644 libraries/irrlicht-1.8.1/examples/05.UserInterface/UserInterface_vc11.vcxproj create mode 100644 libraries/irrlicht-1.8.1/examples/05.UserInterface/UserInterface_vc8.vcproj create mode 100644 libraries/irrlicht-1.8.1/examples/05.UserInterface/UserInterface_vc9.vcproj create mode 100644 libraries/irrlicht-1.8.1/examples/05.UserInterface/main.cpp create mode 100644 libraries/irrlicht-1.8.1/examples/05.UserInterface/tutorial.html create mode 100644 libraries/irrlicht-1.8.1/examples/06.2DGraphics/2DGraphics.cbp create mode 100644 libraries/irrlicht-1.8.1/examples/06.2DGraphics/2DGraphics.dev create mode 100644 libraries/irrlicht-1.8.1/examples/06.2DGraphics/2DGraphics.vcproj create mode 100644 libraries/irrlicht-1.8.1/examples/06.2DGraphics/2DGraphics_vc10.vcxproj create mode 100644 libraries/irrlicht-1.8.1/examples/06.2DGraphics/2DGraphics_vc11.vcxproj create mode 100644 libraries/irrlicht-1.8.1/examples/06.2DGraphics/2DGraphics_vc8.vcproj create mode 100644 libraries/irrlicht-1.8.1/examples/06.2DGraphics/2DGraphics_vc9.vcproj create mode 100644 libraries/irrlicht-1.8.1/examples/06.2DGraphics/Makefile create mode 100644 libraries/irrlicht-1.8.1/examples/06.2DGraphics/main.cpp create mode 100644 libraries/irrlicht-1.8.1/examples/06.2DGraphics/tutorial.html create mode 100644 libraries/irrlicht-1.8.1/examples/07.Collision/Collision.cbp create mode 100644 libraries/irrlicht-1.8.1/examples/07.Collision/Collision.dev create mode 100644 libraries/irrlicht-1.8.1/examples/07.Collision/Collision.vcproj create mode 100644 libraries/irrlicht-1.8.1/examples/07.Collision/Collision_vc10.vcxproj create mode 100644 libraries/irrlicht-1.8.1/examples/07.Collision/Collision_vc11.vcxproj create mode 100644 libraries/irrlicht-1.8.1/examples/07.Collision/Collision_vc8.vcproj create mode 100644 libraries/irrlicht-1.8.1/examples/07.Collision/Collision_vc9.vcproj create mode 100644 libraries/irrlicht-1.8.1/examples/07.Collision/Makefile create mode 100644 libraries/irrlicht-1.8.1/examples/07.Collision/main.cpp create mode 100644 libraries/irrlicht-1.8.1/examples/07.Collision/tutorial.html create mode 100644 libraries/irrlicht-1.8.1/examples/08.SpecialFX/Makefile create mode 100644 libraries/irrlicht-1.8.1/examples/08.SpecialFX/SpecialFX.cbp create mode 100644 libraries/irrlicht-1.8.1/examples/08.SpecialFX/SpecialFX.dev create mode 100644 libraries/irrlicht-1.8.1/examples/08.SpecialFX/SpecialFX.vcproj create mode 100644 libraries/irrlicht-1.8.1/examples/08.SpecialFX/SpecialFX_vc10.vcxproj create mode 100644 libraries/irrlicht-1.8.1/examples/08.SpecialFX/SpecialFX_vc11.vcxproj create mode 100644 libraries/irrlicht-1.8.1/examples/08.SpecialFX/SpecialFX_vc8.vcproj create mode 100644 libraries/irrlicht-1.8.1/examples/08.SpecialFX/SpecialFX_vc9.vcproj create mode 100644 libraries/irrlicht-1.8.1/examples/08.SpecialFX/main.cpp create mode 100644 libraries/irrlicht-1.8.1/examples/08.SpecialFX/tutorial.html create mode 100644 libraries/irrlicht-1.8.1/examples/09.Meshviewer/9.Meshviewer.rc create mode 100644 libraries/irrlicht-1.8.1/examples/09.Meshviewer/Makefile create mode 100644 libraries/irrlicht-1.8.1/examples/09.Meshviewer/MeshViewer.dev create mode 100644 libraries/irrlicht-1.8.1/examples/09.Meshviewer/Meshviewer.cbp create mode 100644 libraries/irrlicht-1.8.1/examples/09.Meshviewer/Meshviewer.vcproj create mode 100644 libraries/irrlicht-1.8.1/examples/09.Meshviewer/Meshviewer_vc10.vcxproj create mode 100644 libraries/irrlicht-1.8.1/examples/09.Meshviewer/Meshviewer_vc11.vcxproj create mode 100644 libraries/irrlicht-1.8.1/examples/09.Meshviewer/Meshviewer_vc8.vcproj create mode 100644 libraries/irrlicht-1.8.1/examples/09.Meshviewer/Meshviewer_vc9.vcproj create mode 100644 libraries/irrlicht-1.8.1/examples/09.Meshviewer/icon.ico create mode 100644 libraries/irrlicht-1.8.1/examples/09.Meshviewer/main.cpp create mode 100644 libraries/irrlicht-1.8.1/examples/09.Meshviewer/resource.h create mode 100644 libraries/irrlicht-1.8.1/examples/09.Meshviewer/tutorial.html create mode 100644 libraries/irrlicht-1.8.1/examples/10.Shaders/Makefile create mode 100644 libraries/irrlicht-1.8.1/examples/10.Shaders/Shaders.cbp create mode 100644 libraries/irrlicht-1.8.1/examples/10.Shaders/Shaders.dev create mode 100644 libraries/irrlicht-1.8.1/examples/10.Shaders/Shaders.vcproj create mode 100644 libraries/irrlicht-1.8.1/examples/10.Shaders/Shaders_vc10.vcxproj create mode 100644 libraries/irrlicht-1.8.1/examples/10.Shaders/Shaders_vc11.vcxproj create mode 100644 libraries/irrlicht-1.8.1/examples/10.Shaders/Shaders_vc8.vcproj create mode 100644 libraries/irrlicht-1.8.1/examples/10.Shaders/Shaders_vc9.vcproj create mode 100644 libraries/irrlicht-1.8.1/examples/10.Shaders/main.cpp create mode 100644 libraries/irrlicht-1.8.1/examples/10.Shaders/tutorial.html create mode 100644 libraries/irrlicht-1.8.1/examples/11.PerPixelLighting/Makefile create mode 100644 libraries/irrlicht-1.8.1/examples/11.PerPixelLighting/PerPixelLighting.cbp create mode 100644 libraries/irrlicht-1.8.1/examples/11.PerPixelLighting/PerPixelLighting.dev create mode 100644 libraries/irrlicht-1.8.1/examples/11.PerPixelLighting/PerPixelLighting.vcproj create mode 100644 libraries/irrlicht-1.8.1/examples/11.PerPixelLighting/PerPixelLighting_vc10.vcxproj create mode 100644 libraries/irrlicht-1.8.1/examples/11.PerPixelLighting/PerPixelLighting_vc11.vcxproj create mode 100644 libraries/irrlicht-1.8.1/examples/11.PerPixelLighting/PerPixelLighting_vc8.vcproj create mode 100644 libraries/irrlicht-1.8.1/examples/11.PerPixelLighting/PerPixelLighting_vc9.vcproj create mode 100644 libraries/irrlicht-1.8.1/examples/11.PerPixelLighting/main.cpp create mode 100644 libraries/irrlicht-1.8.1/examples/11.PerPixelLighting/tutorial.html create mode 100644 libraries/irrlicht-1.8.1/examples/12.TerrainRendering/Makefile create mode 100644 libraries/irrlicht-1.8.1/examples/12.TerrainRendering/TerrainRendering.cbp create mode 100644 libraries/irrlicht-1.8.1/examples/12.TerrainRendering/TerrainRendering.dev create mode 100644 libraries/irrlicht-1.8.1/examples/12.TerrainRendering/TerrainRendering.vcproj create mode 100644 libraries/irrlicht-1.8.1/examples/12.TerrainRendering/TerrainRendering_vc10.vcxproj create mode 100644 libraries/irrlicht-1.8.1/examples/12.TerrainRendering/TerrainRendering_vc11.vcxproj create mode 100644 libraries/irrlicht-1.8.1/examples/12.TerrainRendering/TerrainRendering_vc8.vcproj create mode 100644 libraries/irrlicht-1.8.1/examples/12.TerrainRendering/TerrainRendering_vc9.vcproj create mode 100644 libraries/irrlicht-1.8.1/examples/12.TerrainRendering/main.cpp create mode 100644 libraries/irrlicht-1.8.1/examples/12.TerrainRendering/tutorial.html create mode 100644 libraries/irrlicht-1.8.1/examples/13.RenderToTexture/Makefile create mode 100644 libraries/irrlicht-1.8.1/examples/13.RenderToTexture/RenderToTexture.cbp create mode 100644 libraries/irrlicht-1.8.1/examples/13.RenderToTexture/RenderToTexture.dev create mode 100644 libraries/irrlicht-1.8.1/examples/13.RenderToTexture/RenderToTexture.vcproj create mode 100644 libraries/irrlicht-1.8.1/examples/13.RenderToTexture/RenderToTexture_vc10.vcxproj create mode 100644 libraries/irrlicht-1.8.1/examples/13.RenderToTexture/RenderToTexture_vc11.vcxproj create mode 100644 libraries/irrlicht-1.8.1/examples/13.RenderToTexture/RenderToTexture_vc8.vcproj create mode 100644 libraries/irrlicht-1.8.1/examples/13.RenderToTexture/RenderToTexture_vc9.vcproj create mode 100644 libraries/irrlicht-1.8.1/examples/13.RenderToTexture/main.cpp create mode 100644 libraries/irrlicht-1.8.1/examples/13.RenderToTexture/tutorial.html create mode 100644 libraries/irrlicht-1.8.1/examples/14.Win32Window/Makefile create mode 100644 libraries/irrlicht-1.8.1/examples/14.Win32Window/Win32Window.cbp create mode 100644 libraries/irrlicht-1.8.1/examples/14.Win32Window/Win32Window.dev create mode 100644 libraries/irrlicht-1.8.1/examples/14.Win32Window/Win32Window.vcproj create mode 100644 libraries/irrlicht-1.8.1/examples/14.Win32Window/Win32Window_vc10.vcxproj create mode 100644 libraries/irrlicht-1.8.1/examples/14.Win32Window/Win32Window_vc11.vcxproj create mode 100644 libraries/irrlicht-1.8.1/examples/14.Win32Window/Win32Window_vc8.vcproj create mode 100644 libraries/irrlicht-1.8.1/examples/14.Win32Window/Win32Window_vc9.vcproj create mode 100644 libraries/irrlicht-1.8.1/examples/14.Win32Window/main.cpp create mode 100644 libraries/irrlicht-1.8.1/examples/14.Win32Window/tutorial.html create mode 100644 libraries/irrlicht-1.8.1/examples/15.LoadIrrFile/LoadIrrFile.cbp create mode 100644 libraries/irrlicht-1.8.1/examples/15.LoadIrrFile/LoadIrrFile.dev create mode 100644 libraries/irrlicht-1.8.1/examples/15.LoadIrrFile/LoadIrrFile.vcproj create mode 100644 libraries/irrlicht-1.8.1/examples/15.LoadIrrFile/LoadIrrFile_vc10.vcxproj create mode 100644 libraries/irrlicht-1.8.1/examples/15.LoadIrrFile/LoadIrrFile_vc11.vcxproj create mode 100644 libraries/irrlicht-1.8.1/examples/15.LoadIrrFile/LoadIrrFile_vc8.vcproj create mode 100644 libraries/irrlicht-1.8.1/examples/15.LoadIrrFile/LoadIrrFile_vc9.vcproj create mode 100644 libraries/irrlicht-1.8.1/examples/15.LoadIrrFile/Makefile create mode 100644 libraries/irrlicht-1.8.1/examples/15.LoadIrrFile/main.cpp create mode 100644 libraries/irrlicht-1.8.1/examples/15.LoadIrrFile/tutorial.html create mode 100644 libraries/irrlicht-1.8.1/examples/16.Quake3MapShader/Makefile create mode 100644 libraries/irrlicht-1.8.1/examples/16.Quake3MapShader/Quake3MapShader.cbp create mode 100644 libraries/irrlicht-1.8.1/examples/16.Quake3MapShader/Quake3MapShader.dev create mode 100644 libraries/irrlicht-1.8.1/examples/16.Quake3MapShader/Quake3MapShader.vcproj create mode 100644 libraries/irrlicht-1.8.1/examples/16.Quake3MapShader/Quake3MapShader_vc10.vcxproj create mode 100644 libraries/irrlicht-1.8.1/examples/16.Quake3MapShader/Quake3MapShader_vc11.vcxproj create mode 100644 libraries/irrlicht-1.8.1/examples/16.Quake3MapShader/Quake3MapShader_vc8.vcproj create mode 100644 libraries/irrlicht-1.8.1/examples/16.Quake3MapShader/Quake3MapShader_vc9.vcproj create mode 100644 libraries/irrlicht-1.8.1/examples/16.Quake3MapShader/main.cpp create mode 100644 libraries/irrlicht-1.8.1/examples/17.HelloWorld_Mobile/17. HelloWorld for Windows Mobile on PC_v8.vcproj create mode 100644 libraries/irrlicht-1.8.1/examples/17.HelloWorld_Mobile/17. HelloWorld for Windows Mobile on PC_v9.vcproj create mode 100644 libraries/irrlicht-1.8.1/examples/17.HelloWorld_Mobile/17. HelloWorld for Windows Mobile on PC_vc10.vcxproj create mode 100644 libraries/irrlicht-1.8.1/examples/17.HelloWorld_Mobile/17. HelloWorld for Windows Mobile on PC_vc11.vcxproj create mode 100644 libraries/irrlicht-1.8.1/examples/17.HelloWorld_Mobile/HelloWorld_mobile.sln create mode 100644 libraries/irrlicht-1.8.1/examples/17.HelloWorld_Mobile/HelloWorld_mobile.vcproj create mode 100644 libraries/irrlicht-1.8.1/examples/17.HelloWorld_Mobile/main.cpp create mode 100644 libraries/irrlicht-1.8.1/examples/18.SplitScreen/Makefile create mode 100644 libraries/irrlicht-1.8.1/examples/18.SplitScreen/SplitScreen.cbp create mode 100644 libraries/irrlicht-1.8.1/examples/18.SplitScreen/SplitScreen.dev create mode 100644 libraries/irrlicht-1.8.1/examples/18.SplitScreen/SplitScreen.vcproj create mode 100644 libraries/irrlicht-1.8.1/examples/18.SplitScreen/SplitScreen_vc10.vcxproj create mode 100644 libraries/irrlicht-1.8.1/examples/18.SplitScreen/SplitScreen_vc11.vcxproj create mode 100644 libraries/irrlicht-1.8.1/examples/18.SplitScreen/SplitScreen_vc8.vcproj create mode 100644 libraries/irrlicht-1.8.1/examples/18.SplitScreen/SplitScreen_vc9.vcproj create mode 100644 libraries/irrlicht-1.8.1/examples/18.SplitScreen/main.cpp create mode 100644 libraries/irrlicht-1.8.1/examples/19.MouseAndJoystick/Makefile create mode 100644 libraries/irrlicht-1.8.1/examples/19.MouseAndJoystick/MouseAndJoystick.cbp create mode 100644 libraries/irrlicht-1.8.1/examples/19.MouseAndJoystick/MouseAndJoystick.dev create mode 100644 libraries/irrlicht-1.8.1/examples/19.MouseAndJoystick/MouseAndJoystick.vcproj create mode 100644 libraries/irrlicht-1.8.1/examples/19.MouseAndJoystick/MouseAndJoystick_vc10.vcxproj create mode 100644 libraries/irrlicht-1.8.1/examples/19.MouseAndJoystick/MouseAndJoystick_vc11.vcxproj create mode 100644 libraries/irrlicht-1.8.1/examples/19.MouseAndJoystick/MouseAndJoystick_vc8.vcproj create mode 100644 libraries/irrlicht-1.8.1/examples/19.MouseAndJoystick/MouseAndJoystick_vc9.vcproj create mode 100644 libraries/irrlicht-1.8.1/examples/19.MouseAndJoystick/main.cpp create mode 100644 libraries/irrlicht-1.8.1/examples/20.ManagedLights/Makefile create mode 100644 libraries/irrlicht-1.8.1/examples/20.ManagedLights/ManagedLights.cbp create mode 100644 libraries/irrlicht-1.8.1/examples/20.ManagedLights/ManagedLights.dev create mode 100644 libraries/irrlicht-1.8.1/examples/20.ManagedLights/ManagedLights.vcproj create mode 100644 libraries/irrlicht-1.8.1/examples/20.ManagedLights/ManagedLights_vc10.vcxproj create mode 100644 libraries/irrlicht-1.8.1/examples/20.ManagedLights/ManagedLights_vc11.vcxproj create mode 100644 libraries/irrlicht-1.8.1/examples/20.ManagedLights/ManagedLights_vc8.vcproj create mode 100644 libraries/irrlicht-1.8.1/examples/20.ManagedLights/ManagedLights_vc9.vcproj create mode 100644 libraries/irrlicht-1.8.1/examples/20.ManagedLights/main.cpp create mode 100644 libraries/irrlicht-1.8.1/examples/21.Quake3Explorer/Makefile create mode 100644 libraries/irrlicht-1.8.1/examples/21.Quake3Explorer/Quake3Explorer.cbp create mode 100644 libraries/irrlicht-1.8.1/examples/21.Quake3Explorer/Quake3Explorer.dev create mode 100644 libraries/irrlicht-1.8.1/examples/21.Quake3Explorer/Quake3Explorer.vcproj create mode 100644 libraries/irrlicht-1.8.1/examples/21.Quake3Explorer/Quake3Explorer_vc10.vcxproj create mode 100644 libraries/irrlicht-1.8.1/examples/21.Quake3Explorer/Quake3Explorer_vc11.vcxproj create mode 100644 libraries/irrlicht-1.8.1/examples/21.Quake3Explorer/Quake3Explorer_vc8.vcproj create mode 100644 libraries/irrlicht-1.8.1/examples/21.Quake3Explorer/Quake3Explorer_vc9.vcproj create mode 100644 libraries/irrlicht-1.8.1/examples/21.Quake3Explorer/main.cpp create mode 100644 libraries/irrlicht-1.8.1/examples/21.Quake3Explorer/q3factory.cpp create mode 100644 libraries/irrlicht-1.8.1/examples/21.Quake3Explorer/q3factory.h create mode 100644 libraries/irrlicht-1.8.1/examples/21.Quake3Explorer/sound.cpp create mode 100644 libraries/irrlicht-1.8.1/examples/21.Quake3Explorer/sound.h create mode 100644 libraries/irrlicht-1.8.1/examples/22.MaterialViewer/Makefile create mode 100644 libraries/irrlicht-1.8.1/examples/22.MaterialViewer/MaterialViewer.cbp create mode 100644 libraries/irrlicht-1.8.1/examples/22.MaterialViewer/MaterialViewer.dev create mode 100644 libraries/irrlicht-1.8.1/examples/22.MaterialViewer/MaterialViewer.vcproj create mode 100644 libraries/irrlicht-1.8.1/examples/22.MaterialViewer/MaterialViewer_vc10.vcxproj create mode 100644 libraries/irrlicht-1.8.1/examples/22.MaterialViewer/MaterialViewer_vc11.vcxproj create mode 100644 libraries/irrlicht-1.8.1/examples/22.MaterialViewer/MaterialViewer_vc8.vcproj create mode 100644 libraries/irrlicht-1.8.1/examples/22.MaterialViewer/MaterialViewer_vc9.vcproj create mode 100644 libraries/irrlicht-1.8.1/examples/22.MaterialViewer/main.cpp create mode 100644 libraries/irrlicht-1.8.1/examples/23.SMeshHandling/Makefile create mode 100644 libraries/irrlicht-1.8.1/examples/23.SMeshHandling/SMeshHandling.cbp create mode 100644 libraries/irrlicht-1.8.1/examples/23.SMeshHandling/SMeshHandling.dev create mode 100644 libraries/irrlicht-1.8.1/examples/23.SMeshHandling/SMeshHandling.vcproj create mode 100644 libraries/irrlicht-1.8.1/examples/23.SMeshHandling/SMeshHandling_vc10.vcxproj create mode 100644 libraries/irrlicht-1.8.1/examples/23.SMeshHandling/SMeshHandling_vc11.vcxproj create mode 100644 libraries/irrlicht-1.8.1/examples/23.SMeshHandling/SMeshHandling_vc8.vcproj create mode 100644 libraries/irrlicht-1.8.1/examples/23.SMeshHandling/SMeshHandling_vc9.vcproj create mode 100644 libraries/irrlicht-1.8.1/examples/23.SMeshHandling/main.cpp create mode 100644 libraries/irrlicht-1.8.1/examples/24.CursorControl/CursorControl.cbp create mode 100644 libraries/irrlicht-1.8.1/examples/24.CursorControl/CursorControl.vcproj create mode 100644 libraries/irrlicht-1.8.1/examples/24.CursorControl/CursorControl_vc10.vcxproj create mode 100644 libraries/irrlicht-1.8.1/examples/24.CursorControl/CursorControl_vc11.vcxproj create mode 100644 libraries/irrlicht-1.8.1/examples/24.CursorControl/CursorControl_vc8.vcproj create mode 100644 libraries/irrlicht-1.8.1/examples/24.CursorControl/CursorControl_vc9.vcproj create mode 100644 libraries/irrlicht-1.8.1/examples/24.CursorControl/Makefile create mode 100644 libraries/irrlicht-1.8.1/examples/24.CursorControl/main.cpp create mode 100644 libraries/irrlicht-1.8.1/examples/25.XmlHandling/Makefile create mode 100644 libraries/irrlicht-1.8.1/examples/25.XmlHandling/XmlHandling.cbp create mode 100644 libraries/irrlicht-1.8.1/examples/25.XmlHandling/XmlHandling.vcproj create mode 100644 libraries/irrlicht-1.8.1/examples/25.XmlHandling/XmlHandling_vc10.vcxproj create mode 100644 libraries/irrlicht-1.8.1/examples/25.XmlHandling/XmlHandling_vc11.vcxproj create mode 100644 libraries/irrlicht-1.8.1/examples/25.XmlHandling/XmlHandling_vc8.vcproj create mode 100644 libraries/irrlicht-1.8.1/examples/25.XmlHandling/XmlHandling_vc9.vcproj create mode 100644 libraries/irrlicht-1.8.1/examples/25.XmlHandling/main.cpp create mode 100644 libraries/irrlicht-1.8.1/examples/26.OcclusionQuery/Makefile create mode 100644 libraries/irrlicht-1.8.1/examples/26.OcclusionQuery/OcclusionQuery.cbp create mode 100644 libraries/irrlicht-1.8.1/examples/26.OcclusionQuery/OcclusionQuery.dev create mode 100644 libraries/irrlicht-1.8.1/examples/26.OcclusionQuery/OcclusionQuery.vcproj create mode 100644 libraries/irrlicht-1.8.1/examples/26.OcclusionQuery/OcclusionQuery_vc10.vcxproj create mode 100644 libraries/irrlicht-1.8.1/examples/26.OcclusionQuery/OcclusionQuery_vc11.vcxproj create mode 100644 libraries/irrlicht-1.8.1/examples/26.OcclusionQuery/OcclusionQuery_vc8.vcproj create mode 100644 libraries/irrlicht-1.8.1/examples/26.OcclusionQuery/OcclusionQuery_vc9.vcproj create mode 100644 libraries/irrlicht-1.8.1/examples/26.OcclusionQuery/main.cpp create mode 100644 libraries/irrlicht-1.8.1/examples/BuildAllExamples.MacOSX/DemoApp-Info.plist create mode 100644 libraries/irrlicht-1.8.1/examples/BuildAllExamples.workspace create mode 100644 libraries/irrlicht-1.8.1/examples/BuildAllExamples_v8.sln create mode 100644 libraries/irrlicht-1.8.1/examples/BuildAllExamples_v9.sln create mode 100644 libraries/irrlicht-1.8.1/examples/BuildAllExamples_vc10.sln create mode 100644 libraries/irrlicht-1.8.1/examples/BuildAllExamples_vc11.sln create mode 100644 libraries/irrlicht-1.8.1/examples/Demo/CDemo.cpp create mode 100644 libraries/irrlicht-1.8.1/examples/Demo/CDemo.h create mode 100644 libraries/irrlicht-1.8.1/examples/Demo/CMainMenu.cpp create mode 100644 libraries/irrlicht-1.8.1/examples/Demo/CMainMenu.h create mode 100644 libraries/irrlicht-1.8.1/examples/Demo/Demo.vcproj create mode 100644 libraries/irrlicht-1.8.1/examples/Demo/Demo_vc10.vcxproj create mode 100644 libraries/irrlicht-1.8.1/examples/Demo/Demo_vc11.vcxproj create mode 100644 libraries/irrlicht-1.8.1/examples/Demo/Demo_vc8.vcproj create mode 100644 libraries/irrlicht-1.8.1/examples/Demo/Demo_vc9.vcproj create mode 100644 libraries/irrlicht-1.8.1/examples/Demo/Makefile create mode 100644 libraries/irrlicht-1.8.1/examples/Demo/demo.cbp create mode 100644 libraries/irrlicht-1.8.1/examples/Demo/demo.dev create mode 100644 libraries/irrlicht-1.8.1/examples/Demo/icon.ico create mode 100644 libraries/irrlicht-1.8.1/examples/Demo/main.cpp create mode 100644 libraries/irrlicht-1.8.1/examples/Demo/resource.h create mode 100644 libraries/irrlicht-1.8.1/examples/Demo/resscript.rc create mode 100644 libraries/irrlicht-1.8.1/examples/Makefile create mode 100755 libraries/irrlicht-1.8.1/examples/buildAllExamples.sh create mode 100644 libraries/irrlicht-1.8.1/examples/whereAreTheBinaries.txt (limited to 'libraries/irrlicht-1.8.1/examples') diff --git a/libraries/irrlicht-1.8.1/examples/01.HelloWorld/HelloWorld.cbp b/libraries/irrlicht-1.8.1/examples/01.HelloWorld/HelloWorld.cbp new file mode 100644 index 0000000..bba207a --- /dev/null +++ b/libraries/irrlicht-1.8.1/examples/01.HelloWorld/HelloWorld.cbp @@ -0,0 +1,55 @@ + + + + + + diff --git a/libraries/irrlicht-1.8.1/examples/01.HelloWorld/HelloWorld.dev b/libraries/irrlicht-1.8.1/examples/01.HelloWorld/HelloWorld.dev new file mode 100644 index 0000000..9de3da7 --- /dev/null +++ b/libraries/irrlicht-1.8.1/examples/01.HelloWorld/HelloWorld.dev @@ -0,0 +1,59 @@ +[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/libraries/irrlicht-1.8.1/examples/01.HelloWorld/HelloWorld.vcproj b/libraries/irrlicht-1.8.1/examples/01.HelloWorld/HelloWorld.vcproj new file mode 100644 index 0000000..3a2fdb0 --- /dev/null +++ b/libraries/irrlicht-1.8.1/examples/01.HelloWorld/HelloWorld.vcproj @@ -0,0 +1,163 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/libraries/irrlicht-1.8.1/examples/01.HelloWorld/HelloWorld_vc10.vcxproj b/libraries/irrlicht-1.8.1/examples/01.HelloWorld/HelloWorld_vc10.vcxproj new file mode 100644 index 0000000..696621f --- /dev/null +++ b/libraries/irrlicht-1.8.1/examples/01.HelloWorld/HelloWorld_vc10.vcxproj @@ -0,0 +1,231 @@ + + + + + Debug + Win32 + + + Debug + x64 + + + Release + Win32 + + + Release + x64 + + + + 01.HelloWorld + {5AD4C95C-BA38-4692-BA4B-8C25A86208F9} + HelloWorld + + + + Application + false + MultiByte + + + Application + false + MultiByte + + + Application + false + MultiByte + + + Application + false + MultiByte + + + + + + + + + + + + + + + + + + + + + + + <_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/libraries/irrlicht-1.8.1/examples/01.HelloWorld/HelloWorld_vc11.vcxproj b/libraries/irrlicht-1.8.1/examples/01.HelloWorld/HelloWorld_vc11.vcxproj new file mode 100644 index 0000000..f5f1fae --- /dev/null +++ b/libraries/irrlicht-1.8.1/examples/01.HelloWorld/HelloWorld_vc11.vcxproj @@ -0,0 +1,235 @@ + + + + + Debug + Win32 + + + Debug + x64 + + + Release + Win32 + + + Release + x64 + + + + 01.HelloWorld + {5AD4C95C-BA38-4692-BA4B-8C25A86208F9} + HelloWorld + + + + Application + false + MultiByte + v110 + + + Application + false + MultiByte + v110 + + + Application + false + MultiByte + v110 + + + Application + false + MultiByte + v110 + + + + + + + + + + + + + + + + + + + + + + + <_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/libraries/irrlicht-1.8.1/examples/01.HelloWorld/HelloWorld_vc8.vcproj b/libraries/irrlicht-1.8.1/examples/01.HelloWorld/HelloWorld_vc8.vcproj new file mode 100644 index 0000000..ac11031 --- /dev/null +++ b/libraries/irrlicht-1.8.1/examples/01.HelloWorld/HelloWorld_vc8.vcproj @@ -0,0 +1,231 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/libraries/irrlicht-1.8.1/examples/01.HelloWorld/HelloWorld_vc9.vcproj b/libraries/irrlicht-1.8.1/examples/01.HelloWorld/HelloWorld_vc9.vcproj new file mode 100644 index 0000000..982d202 --- /dev/null +++ b/libraries/irrlicht-1.8.1/examples/01.HelloWorld/HelloWorld_vc9.vcproj @@ -0,0 +1,230 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/libraries/irrlicht-1.8.1/examples/01.HelloWorld/Makefile b/libraries/irrlicht-1.8.1/examples/01.HelloWorld/Makefile new file mode 100644 index 0000000..c834ab7 --- /dev/null +++ b/libraries/irrlicht-1.8.1/examples/01.HelloWorld/Makefile @@ -0,0 +1,66 @@ +# Makefile for Irrlicht Examples +# It's usually sufficient to change just the target name and source file list +# and be sure that CXX is set to a valid compiler + +# Name of the executable created (.exe will be added automatically if necessary) +Target := 01.HelloWorld +# List of source files, separated by spaces +Sources := main.cpp +# Path to Irrlicht directory, should contain include/ and lib/ +IrrlichtHome := ../.. +# Path for the executable. Note that Irrlicht.dll should usually also be there for win32 systems +BinPath = ../../bin/$(SYSTEM) + +# general compiler settings (might need to be set when compiling the lib, too) +# preprocessor flags, e.g. defines and include paths +USERCPPFLAGS = +# compiler flags such as optimization flags +USERCXXFLAGS = -O3 -ffast-math +#USERCXXFLAGS = -g -Wall +# linker flags such as additional libraries and link paths +USERLDFLAGS = + +#### +#no changes necessary below this line +#### + +CPPFLAGS = -I$(IrrlichtHome)/include -I/usr/X11R6/include $(USERCPPFLAGS) +CXXFLAGS = $(USERCXXFLAGS) +LDFLAGS = $(USERLDFLAGS) + +#default target is Linux +all: all_linux + +# target specific settings +all_linux all_win32 static_win32: LDFLAGS += -L$(IrrlichtHome)/lib/$(SYSTEM) -lIrrlicht +all_linux: LDFLAGS += -L/usr/X11R6/lib$(LIBSELECT) -lGL -lXxf86vm -lXext -lX11 -lXcursor +all_linux clean_linux: SYSTEM=Linux +all_win32 clean_win32 static_win32: SYSTEM=Win32-gcc +all_win32 clean_win32 static_win32: SUF=.exe +static_win32: CPPFLAGS += -D_IRR_STATIC_LIB_ +all_win32: LDFLAGS += -lopengl32 -lm +static_win32: LDFLAGS += -lgdi32 -lwinspool -lcomdlg32 -lole32 -loleaut32 -luuid -lodbc32 -lodbccp32 -lopengl32 +# name of the binary - only valid for targets which set SYSTEM +DESTPATH = $(BinPath)/$(Target)$(SUF) + +all_linux all_win32 static_win32: + $(warning Building...) + $(CXX) $(CPPFLAGS) $(CXXFLAGS) $(Sources) -o $(DESTPATH) $(LDFLAGS) + +clean: clean_linux clean_win32 + $(warning Cleaning...) + +clean_linux clean_win32: + @$(RM) $(DESTPATH) + +.PHONY: all all_win32 static_win32 clean clean_linux clean_win32 + +#multilib handling +ifeq ($(HOSTTYPE), x86_64) +LIBSELECT=64 +endif +#solaris real-time features +ifeq ($(HOSTTYPE), sun4) +LDFLAGS += -lrt +endif + diff --git a/libraries/irrlicht-1.8.1/examples/01.HelloWorld/main.cpp b/libraries/irrlicht-1.8.1/examples/01.HelloWorld/main.cpp new file mode 100644 index 0000000..a53483c --- /dev/null +++ b/libraries/irrlicht-1.8.1/examples/01.HelloWorld/main.cpp @@ -0,0 +1,236 @@ +/** Example 001 HelloWorld + +This Tutorial shows how to set up the IDE for using the Irrlicht Engine and how +to write a simple HelloWorld program with it. The program will show how to use +the basics of the VideoDriver, the GUIEnvironment, and the SceneManager. +Microsoft Visual Studio is used as an IDE, but you will also be able to +understand everything if you are using a different one or even another +operating system than windows. + +You have to include the header file in order to use the engine. The +header file can be found in the Irrlicht Engine SDK directory \c include. To let +the compiler find this header file, the directory where it is located has to be +specified. This is different for every IDE and compiler you use. Let's explain +shortly how to do this in Microsoft Visual Studio: + +- If you use Version 6.0, select the Menu Extras -> Options. + Select the directories tab, and select the 'Include' Item in the combo box. + Add the \c include directory of the irrlicht engine folder to the list of + directories. Now the compiler will find the Irrlicht.h header file. We also + need the irrlicht.lib to be found, so stay in that dialog, select 'Libraries' + in the combo box and add the \c lib/VisualStudio directory. + \image html "vc6optionsdir.jpg" + \image latex "vc6optionsdir.jpg" + \image html "vc6include.jpg" + \image latex "vc6include.jpg" + +- If your IDE is Visual Studio .NET, select Tools -> Options. + Select the projects entry and then select VC++ directories. Select 'show + directories for include files' in the combo box, and add the \c include + directory of the irrlicht engine folder to the list of directories. Now the + compiler will find the Irrlicht.h header file. We also need the irrlicht.lib + to be found, so stay in that dialog, select 'show directories for Library + files' and add the \c lib/VisualStudio directory. + \image html "vcnetinclude.jpg" + \image latex "vcnetinclude.jpg" + +That's it. With your IDE set up like this, you will now be able to develop +applications with the Irrlicht Engine. + +Lets start! + +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 + +/* +In the Irrlicht Engine, everything can be found in the namespace 'irr'. So if +you want to use a class of the engine, you have to write irr:: before the name +of the class. For example to use the IrrlichtDevice write: irr::IrrlichtDevice. +To get rid of the irr:: in front of the name of every class, we tell the +compiler that we use that namespace from now on, and we will not have to write +irr:: anymore. +*/ +using namespace irr; + +/* +There are 5 sub namespaces in the Irrlicht Engine. Take a look at them, you can +read a detailed description of them in the documentation by clicking on the top +menu item 'Namespace List' or by using this link: +http://irrlicht.sourceforge.net/docu/namespaces.html +Like the irr namespace, we do not want these 5 sub namespaces now, to keep this +example simple. Hence, we tell the compiler again that we do not want always to +write their names. +*/ +using namespace core; +using namespace scene; +using namespace video; +using namespace io; +using namespace gui; + +/* +To be able to use the Irrlicht.DLL file, we need to link with the Irrlicht.lib. +We could set this option in the project settings, but to make it easy, we use a +pragma comment lib for VisualStudio. On Windows platforms, we have to get rid +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_ +#pragma comment(lib, "Irrlicht.lib") +#pragma comment(linker, "/subsystem:windows /ENTRY:mainCRTStartup") +#endif + + +/* +This is the main method. We can now use main() on every platform. +*/ +int main() +{ + /* + The most important function of the engine is the createDevice() + function. The IrrlichtDevice is created by it, which is the root + object for doing anything with the engine. createDevice() has 7 + 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 + 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. + + - windowSize: Size of the Window or screen in FullScreenMode to be + created. In this example we use 640x480. + + - bits: Amount of color bits per pixel. This should be 16 or 32. The + parameter is often ignored when running in windowed mode. + + - fullscreen: Specifies if we want the device to run in fullscreen mode + or not. + + - stencilbuffer: Specifies if we want to use the stencil buffer (for + drawing shadows). + + - vsync: Specifies if we want to have vsync enabled, this is only useful + in fullscreen mode. + + - eventReceiver: An object to receive events. We do not want to use this + parameter here, and set it to 0. + + Always check the return value to cope with unsupported drivers, + dimensions, etc. + */ + IrrlichtDevice *device = + createDevice( video::EDT_SOFTWARE, dimension2d(640, 480), 16, + false, false, false, 0); + + if (!device) + return 1; + + /* + Set the caption of the window to some nice text. Note that there is an + 'L' in front of the string. The Irrlicht Engine uses wide character + strings when displaying text. + */ + device->setWindowCaption(L"Hello World! - Irrlicht Engine Demo"); + + /* + Get a pointer to the VideoDriver, the SceneManager and the graphical + user interface environment, so that we do not always have to write + device->getVideoDriver(), device->getSceneManager(), or + device->getGUIEnvironment(). + */ + IVideoDriver* driver = device->getVideoDriver(); + ISceneManager* smgr = device->getSceneManager(); + IGUIEnvironment* guienv = device->getGUIEnvironment(); + + /* + We add a hello world label to the window, using the GUI environment. + The text is placed at the position (10,10) as top left corner and + (260,22) as lower right corner. + */ + guienv->addStaticText(L"Hello World! This is the Irrlicht Software renderer!", + rect(10,10,260,22), true); + + /* + 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 + a SceneNode to display the mesh with addAnimatedMeshSceneNode(). We + check the return value of getMesh() to become aware of loading problems + and other errors. + + Instead of writing the filename sydney.md2, it would also be possible + to load a Maya object file (.obj), a complete Quake3 map (.bsp) or any + 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"); + if (!mesh) + { + device->drop(); + return 1; + } + IAnimatedMeshSceneNode* node = smgr->addAnimatedMeshSceneNode( mesh ); + + /* + To let the mesh look a little bit nicer, we change its material. We + disable lighting because we do not have a dynamic light in here, and + the mesh would be totally black otherwise. Then we set the frame loop, + such that the predefined STAND animation is used. And last, we apply a + texture to the mesh. Without it the mesh would be drawn using only a + color. + */ + if (node) + { + node->setMaterialFlag(EMF_LIGHTING, false); + node->setMD2Animation(scene::EMAT_STAND); + node->setMaterialTexture( 0, driver->getTexture("../../media/sydney.bmp") ); + } + + /* + To look at the mesh, we place a camera into 3d space at the position + (0, 30, -40). The camera looks from there to (0,5,0), which is + approximately the place where our md2 model is. + */ + smgr->addCameraSceneNode(0, vector3df(0,30,-40), vector3df(0,5,0)); + + /* + Ok, now we have set up the scene, lets draw everything: We run the + device in a while() loop, until the device does not want to run any + more. This would be when the user closes the window or presses ALT+F4 + (or whatever keycode closes a window). + */ + while(device->run()) + { + /* + Anything can be drawn between a beginScene() and an endScene() + call. The beginScene() call clears the screen with a color and + the depth buffer, if desired. Then we let the Scene Manager and + 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)); + + smgr->drawAll(); + guienv->drawAll(); + + driver->endScene(); + } + + /* + After we are done with the render loop, we have to delete the Irrlicht + Device created before with createDevice(). In the Irrlicht Engine, you + have to delete all objects you created with a method or function which + starts with 'create'. The object is simply deleted by calling ->drop(). + See the documentation at irr::IReferenceCounted::drop() for more + information. + */ + device->drop(); + + return 0; +} + +/* +That's it. Compile and run. +**/ diff --git a/libraries/irrlicht-1.8.1/examples/01.HelloWorld/tutorial.html b/libraries/irrlicht-1.8.1/examples/01.HelloWorld/tutorial.html new file mode 100644 index 0000000..e46c954 --- /dev/null +++ b/libraries/irrlicht-1.8.1/examples/01.HelloWorld/tutorial.html @@ -0,0 +1,394 @@ + + +Irrlicht Engine Tutorial + + + + +
+ + + + + + + + + +
Tutorial 1.HelloWorld
+

This Tutorial shows how to set up the IDE for using the + Irrlicht Engine and how to write a simple HelloWorld program + with it. The program will show how to use the basics of + the VideoDriver, the GUIEnvironment and the SceneManager.
+ The result of this example will look like this:

+


+

+
+
+ + + + + + +
Setting up the + IDE
+
+

To use the engine, we will have to include + the header file <irrlicht.h>, which can be found + in the Irrlicht Engine SDK directory \include. To let + the compiler find this header file, the directory where + it is located should be specified somewhere. This is different + for every IDE and compiler. I will explain how to do this + in Microsoft Visual Studio C++ 6.0 and .NET:

+ +
+
    +
  • +
    If you use Version 6.0, select the Menu + Extras -> Options. Select the directories tab, and + select the 'Include' Item in the combo box. Add the + \include directory of the Irrlicht Engine folder to + the list of directories. Now the compiler will find + the Irrlicht.h header file. We also need the location + of irrlicht.lib to be listed, so select the 'Libraries' + tab and add the \lib\VisualStudio directory.
    +
    +   
    +  
    + +
    +
  • +
  • If your IDE is Visual Studio .NET, select Tools -> + Options. Select the Projects entry and then select VC++ + directories. Select 'show directories for include files' + in the combo box, and add the \include directory of the + Irrlicht Engine folder to the list of directories so the + compiler will find the Irrlicht.h header file. We also + need the irrlicht.lib to be found, so select 'show directories + for Library files' and add the \lib\VisualStudio directory.
    +
    + +
    +
  • +
+ +

 

+
+
+ + + + + + + + +
Lets start!
+
+
+
+

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 into our code.

+ + + + + +
#include <irrlicht.h>
+

In the Irrlicht Engine, everything can be found in + the namespace 'irr'. So if you want to use a class + of the engine, you'll have to type an irr:: before + the name of the class. For example, to use the IrrlichtDevice, + write: irr::IrrlichtDevice. To avoid having to put + irr:: before of the name of every class, we tell the + compiler that we use that namespace.

+ + + + + +
using namespace irr;
+

There are 5 sub-namespaces in the Irrlicht Engine. + Take a look at them: you can read a detailed description + of them in the documentation by clicking on the top + menu item 'Namespace + List'. To keep this example simple, we don't want + to have to specify the name spaces, Hence:

+ + + + + +
using namespace core;
using namespace scene;
using namespace video;
using namespace io;
using namespace gui;
+

To be able to use the Irrlicht.DLL file, we need + to link with the Irrlicht.lib. We could set this option + in the project settings, but to make it easy we use + a pragma comment:

+ + + + + +
#pragma comment(lib, "Irrlicht.lib")
+

Now the main method: to keep this example simple + we use int main(), which can be used on any platform. + However, on Windows platforms, we could also use the + WinMain method if we would want to get rid of the + console window which pops up when starting a program + with main().

+ + + + + +
int main()
{
+

The most important function of the engine is the + 'createDevice' function. The Irrlicht Device, which + is the root object for doing everything with the engine, + can be created with it. createDevice() has 7 parameters:

+
+
    +
  • + +
    deviceType: Type of the device. This can currently + be the Null device, the Software device, Direct3D8, Direct3D9, + or OpenGL. In this example we use EDT_SOFTWARE, but, to try + them out, you might want to change it to EDT_NULL, EDT_DIRECT3D8, + EDT_DIRECT3D9 or EDT_OPENGL.
    +
  • +
  • +
    windowSize: Size of the window or + full screen mode to be created. In this example + we use 512x384.
    + +
  • +
  • +
    bits: Number of bits per pixel when + in full screen mode. This should be 16 or 32. This + parameter is ignored when running in windowed mode.
    +
  • +
  • +
    fullscreen: Specifies if we want + the device to run in full screen mode or not.
    +
  • +
  • stencilbuffer: Specifies if we want to use the stencil + buffer for drawing shadows.
  • + +
  • vsync: Specifies if we want to have vsync enabled. + This is only useful in full screen mode.
  • +
  • +
    eventReceiver: An object to receive + events. We do not want to use this parameter here, + and set it to 0.
    +
  • +
+ + + + + +
IrrlichtDevice *device =
createDevice(EDT_SOFTWARE, dimension2d<s32>(512, 384), 16,
false, false, false, 0);
+

Now we set the caption of the window to some nice text. + Note that there is a 'L' in front of the string: the + Irrlicht Engine uses wide character strings when displaying + text.

+ + + + + +
device->setWindowCaption(L"Hello World! - Irrlicht Engine Demo");
+

Now we store a pointer to the video driver, the SceneManager, + and the graphical user interface environment so that + we do not always have to write device->getVideoDriver(), + device->getSceneManager(), and device->getGUIEnvironment().

+ + + + + +
IVideoDriver* driver = device->getVideoDriver();
ISceneManager* smgr = device->getSceneManager();
IGUIEnvironment* guienv = device->getGUIEnvironment();
+

We add a hello world label to the window using the + GUI environment. The text is placed at the position + (10,10) as top left corner and (200,22) as lower right + corner.

+ + + + + +
guienv->addStaticText(L"Hello World! This is the Irrlicht Software engine!",
rect<s32>(10,10,200,22), true);
+

To display 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 a SceneNode + to display the mesh with addAnimatedMeshSceneNode(). + Instead of loading a Quake2 file (.md2), it is also + possible to load a Maya object file (.obj), a complete + Quake3 map (.bsp), or a Milshape file (.ms3d).
+ By the way, that cool Quake 2 model called sydney.md2 + was modelled by Brian Collins.

+ + + + + +
IAnimatedMesh* mesh = smgr->getMesh("../../media/sydney.md2");
IAnimatedMeshSceneNode* node = smgr->addAnimatedMeshSceneNode( mesh );
+

To make the mesh look a little bit nicer, we change + its material a little bit: we disable lighting because + we do not have a dynamic light in here and the mesh + would be totally black. Then we set the frame loop so + that the animation is looped between the frames 0 and + 310. Then, at last, we apply a texture to the mesh. + Without it the mesh would be drawn using only a solid + color.

+ + + + + +
if (node)
{
node->setMaterialFlag(EMF_LIGHTING, false);
node->setFrameLoop(0, 310);
node->setMaterialTexture( 0, driver->getTexture("../../media/sydney.bmp") );
}
+
+

To look at the mesh, we place a camera into 3d space + at the position (0, 10, -40). The camera looks from + there to (0,5,0).

+ + + + + +
smgr->addCameraSceneNode(0, vector3df(0,30,-40), vector3df(0,5,0));
+

Ok. Now that we have set up the scene, let's draw everything: + we run the device in a while() loop until the device + does not want to run any more. This would be when the + user closes the window or presses ALT+F4 in Windows.

+ + + + + +
while(device->run())
{
+

Everything must be drawn between a beginScene() and + an endScene() call. The beginScene clears the screen + with a color and also the depth buffer, if desired. + Then we let the Scene Manager and 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));
+ smgr->drawAll(); + guienv->drawAll();
+
	driver->endScene();
+}
+

After we are finished, we have to delete the Irrlicht + Device created earlier with createDevice(). With the + Irrlicht Engine, you should delete all objects you created + with a method or function that starts with 'create'. + The object is deleted simply by calling ->drop(). + See the documentation + for more information.

+ + + + + +
	device->drop();
return 0; +}
+

That's it. Compile and run.

+

 

+
+
+
+
+ + + + + + + +
Possible Errors + or Problems
+
+
+

Visual Studio
+ + While trying to compile the tutorial, if you get the + error:

+ + + + +
fatal + error C1083: Cannot open include file: 'irrlicht.h': + No such file or directory
+

Solution: You may have set the include directory improperly + in the Visual Studio options. See above + for information on setting it.

+ + + + + +
LINK + : LNK6004: HelloWorld.exe not found or not built + by the last incremental link; performing full link
+ LINK : fatal error LNK1104: cannot open file "Irrlicht.lib"
+ Error executing link.exe
+

Solution: You may have set the library directory improperly. + See above for information on + setting it.
+ +
+

+

Compiler independent problems
+
If the tutorial compiles successfully but gives + the error:

+ + + + + +
This + application has failed to start because Irrlicht.dll + was not found. Re-installing the application may + fix this problem
+

Solution: You may have forgotten to copy the Irrlicht.dll + file from Irrlicht\bin\VisualStudio to the directory + the tutorial's project file is in.

+ If the tutorial compiles and runs successfully but produces + errors in the console like:
+
+ + + + + +
Could + not load mesh, because file could not be opened.: + ../media/sydney.md2
+

Or:

+ + + + + +
Could + not open file of texture: stones.jpg
+
Could not load texture: stones.jpg
+

Solution: The file listed in the error message cannot + be found. Ensure that the directory specified in the + main.cpp exists and is where the file is located.
+

+
+
+
+

 

+ + diff --git a/libraries/irrlicht-1.8.1/examples/02.Quake3Map/Makefile b/libraries/irrlicht-1.8.1/examples/02.Quake3Map/Makefile new file mode 100644 index 0000000..09953cf --- /dev/null +++ b/libraries/irrlicht-1.8.1/examples/02.Quake3Map/Makefile @@ -0,0 +1,40 @@ +# Makefile for Irrlicht Examples +# It's usually sufficient to change just the target name and source file list +# and be sure that CXX is set to a valid compiler +Target = 02.Quake3Map +Sources = main.cpp + +# general compiler settings +CPPFLAGS = -I../../include -I/usr/X11R6/include +CXXFLAGS = -O3 -ffast-math +#CXXFLAGS = -g -Wall + +#default target is Linux +all: all_linux + +ifeq ($(HOSTTYPE), x86_64) +LIBSELECT=64 +endif + +# target specific settings +all_linux: LDFLAGS = -L/usr/X11R6/lib$(LIBSELECT) -L../../lib/Linux -lIrrlicht -lGL -lXxf86vm -lXext -lX11 -lXcursor +all_linux clean_linux: SYSTEM=Linux +all_win32: LDFLAGS = -L../../lib/Win32-gcc -lIrrlicht +static_win32: LDFLAGS += -lgdi32 -lopengl32 -ld3dx9d -lwinmm -lm +static_win32: CPPFLAGS += -D_IRR_STATIC_LIB_ +static_win32 all_win32 clean_win32: SYSTEM=Win32-gcc +static_win32 all_win32 clean_win32: SUF=.exe +# name of the binary - only valid for targets which set SYSTEM +DESTPATH = ../../bin/$(SYSTEM)/$(Target)$(SUF) + +all_linux all_win32 static_win32: + $(warning Building...) + $(CXX) $(CPPFLAGS) $(CXXFLAGS) $(Sources) -o $(DESTPATH) $(LDFLAGS) + +clean: clean_linux clean_win32 + $(warning Cleaning...) + +clean_linux clean_win32: + @$(RM) $(DESTPATH) + +.PHONY: all all_win32 clean clean_linux clean_win32 static_win32 diff --git a/libraries/irrlicht-1.8.1/examples/02.Quake3Map/Quake3Map.cbp b/libraries/irrlicht-1.8.1/examples/02.Quake3Map/Quake3Map.cbp new file mode 100644 index 0000000..59f82ba --- /dev/null +++ b/libraries/irrlicht-1.8.1/examples/02.Quake3Map/Quake3Map.cbp @@ -0,0 +1,55 @@ + + + + + + diff --git a/libraries/irrlicht-1.8.1/examples/02.Quake3Map/Quake3Map.dev b/libraries/irrlicht-1.8.1/examples/02.Quake3Map/Quake3Map.dev new file mode 100644 index 0000000..3e0a69e --- /dev/null +++ b/libraries/irrlicht-1.8.1/examples/02.Quake3Map/Quake3Map.dev @@ -0,0 +1,59 @@ +[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/libraries/irrlicht-1.8.1/examples/02.Quake3Map/Quake3Map.vcproj b/libraries/irrlicht-1.8.1/examples/02.Quake3Map/Quake3Map.vcproj new file mode 100644 index 0000000..4416fbb --- /dev/null +++ b/libraries/irrlicht-1.8.1/examples/02.Quake3Map/Quake3Map.vcproj @@ -0,0 +1,162 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/libraries/irrlicht-1.8.1/examples/02.Quake3Map/Quake3Map_vc10.vcxproj b/libraries/irrlicht-1.8.1/examples/02.Quake3Map/Quake3Map_vc10.vcxproj new file mode 100644 index 0000000..da32873 --- /dev/null +++ b/libraries/irrlicht-1.8.1/examples/02.Quake3Map/Quake3Map_vc10.vcxproj @@ -0,0 +1,231 @@ + + + + + Debug + Win32 + + + Debug + x64 + + + Release + Win32 + + + Release + x64 + + + + 02.Quake3Map + {D1A464A2-D479-458C-98A2-60965D823CD1} + Quake3Map + + + + Application + false + MultiByte + + + Application + false + MultiByte + + + Application + false + MultiByte + + + Application + false + MultiByte + + + + + + + + + + + + + + + + + + + + + + + <_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/libraries/irrlicht-1.8.1/examples/02.Quake3Map/Quake3Map_vc11.vcxproj b/libraries/irrlicht-1.8.1/examples/02.Quake3Map/Quake3Map_vc11.vcxproj new file mode 100644 index 0000000..579a016 --- /dev/null +++ b/libraries/irrlicht-1.8.1/examples/02.Quake3Map/Quake3Map_vc11.vcxproj @@ -0,0 +1,235 @@ + + + + + Debug + Win32 + + + Debug + x64 + + + Release + Win32 + + + Release + x64 + + + + 02.Quake3Map + {D1A464A2-D479-458C-98A2-60965D823CD1} + Quake3Map + + + + Application + false + MultiByte + v110 + + + Application + false + MultiByte + v110 + + + Application + false + MultiByte + v110 + + + Application + false + MultiByte + v110 + + + + + + + + + + + + + + + + + + + + + + + <_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/libraries/irrlicht-1.8.1/examples/02.Quake3Map/Quake3Map_vc8.vcproj b/libraries/irrlicht-1.8.1/examples/02.Quake3Map/Quake3Map_vc8.vcproj new file mode 100644 index 0000000..bae5931 --- /dev/null +++ b/libraries/irrlicht-1.8.1/examples/02.Quake3Map/Quake3Map_vc8.vcproj @@ -0,0 +1,231 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/libraries/irrlicht-1.8.1/examples/02.Quake3Map/Quake3Map_vc9.vcproj b/libraries/irrlicht-1.8.1/examples/02.Quake3Map/Quake3Map_vc9.vcproj new file mode 100644 index 0000000..8acc07a --- /dev/null +++ b/libraries/irrlicht-1.8.1/examples/02.Quake3Map/Quake3Map_vc9.vcproj @@ -0,0 +1,230 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/libraries/irrlicht-1.8.1/examples/02.Quake3Map/main.cpp b/libraries/irrlicht-1.8.1/examples/02.Quake3Map/main.cpp new file mode 100644 index 0000000..fc7461f --- /dev/null +++ b/libraries/irrlicht-1.8.1/examples/02.Quake3Map/main.cpp @@ -0,0 +1,206 @@ +/** Example 002 Quake3Map + +This Tutorial shows how to load a Quake 3 map into the engine, create a +SceneNode for optimizing the speed of rendering, and how to create a user +controlled camera. + +Please note that you should know the basics of the engine before starting this +tutorial. Just take a short look at the first tutorial, if you haven't done +this yet: http://irrlicht.sourceforge.net/tut001.html + +Lets start like the HelloWorld example: We include the irrlicht header files +and an additional file to be able to ask the user for a driver type using the +console. +*/ +#include +#include + +/* +As already written in the HelloWorld example, in the Irrlicht Engine everything +can be found in the namespace 'irr'. To get rid of the irr:: in front of the +name of every class, we tell the compiler that we use that namespace from now +on, and we will not have to write that 'irr::'. There are 5 other sub +namespaces 'core', 'scene', 'video', 'io' and 'gui'. Unlike in the HelloWorld +example, we do not call 'using namespace' for these 5 other namespaces, because +in this way you will see what can be found in which namespace. But if you like, +you can also include the namespaces like in the previous example. +*/ +using namespace irr; + +/* +Again, to be able to use the Irrlicht.DLL file, we need to link with the +Irrlicht.lib. We could set this option in the project settings, but to make it +easy, we use a pragma comment lib: +*/ +#ifdef _MSC_VER +#pragma comment(lib, "Irrlicht.lib") +#endif + +/* +Ok, lets start. Again, we use the main() method as start, not the WinMain(). +*/ +int main() +{ + /* + Like in the HelloWorld example, we create an IrrlichtDevice with + createDevice(). The difference now is that we ask the user to select + 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 1.5\n (b) Direct3D 9.0c\n (c) Direct3D 8.1\n"\ + " (d) Burning's Software Renderer\n (e) Software Renderer\n"\ + " (f) NullDevice\n (otherKey) exit\n\n"); + + char i; + std::cin >> i; + + switch(i) + { + case 'a': driverType = video::EDT_OPENGL; break; + case 'b': driverType = video::EDT_DIRECT3D9;break; + case 'c': driverType = video::EDT_DIRECT3D8;break; + case 'd': driverType = video::EDT_BURNINGSVIDEO;break; + case 'e': driverType = video::EDT_SOFTWARE; break; + case 'f': driverType = video::EDT_NULL; break; + default: return 1; + } + + // create device and exit if creation failed + + IrrlichtDevice *device = + createDevice(driverType, core::dimension2d(640, 480)); + + if (device == 0) + return 1; // could not create selected driver. + + /* + Get a pointer to the video driver and the SceneManager so that + we do not always have to call irr::IrrlichtDevice::getVideoDriver() and + irr::IrrlichtDevice::getSceneManager(). + */ + video::IVideoDriver* driver = device->getVideoDriver(); + scene::ISceneManager* smgr = device->getSceneManager(); + + /* + To display the Quake 3 map, we first need to load it. Quake 3 maps + are packed into .pk3 files which are nothing else than .zip files. + So we add the .pk3 file to our irr::io::IFileSystem. After it was added, + 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"); + + /* + Now we can load the mesh by calling + irr::scene::ISceneManager::getMesh(). We get a pointer returned to an + irr::scene::IAnimatedMesh. As you might know, Quake 3 maps are not + really animated, they are only a huge chunk of static geometry with + some materials attached. Hence the IAnimatedMesh consists of only one + frame, so we get the "first frame" of the "animation", which is our + quake level and create an Octree scene node with it, using + irr::scene::ISceneManager::addOctreeSceneNode(). + The Octree optimizes the scene a little bit, trying to draw only geometry + which is currently visible. An alternative to the Octree would be a + irr::scene::IMeshSceneNode, which would always draw the complete + geometry of the mesh, without optimization. Try it: Use + irr::scene::ISceneManager::addMeshSceneNode() instead of + addOctreeSceneNode() and compare the primitives drawn by the video + driver. (There is a irr::video::IVideoDriver::getPrimitiveCountDrawn() + method in the irr::video::IVideoDriver class). Note that this + optimization with the Octree is only useful when drawing huge meshes + consisting of lots of geometry. + */ + scene::IAnimatedMesh* mesh = smgr->getMesh("20kdm2.bsp"); + scene::ISceneNode* node = 0; + + if (mesh) + node = smgr->addOctreeSceneNode(mesh->getMesh(0), 0, -1, 1024); +// node = smgr->addMeshSceneNode(mesh->getMesh(0)); + + /* + Because the level was not modelled around the origin (0,0,0), we + translate the whole level a little bit. This is done on + irr::scene::ISceneNode level using the methods + irr::scene::ISceneNode::setPosition() (in this case), + irr::scene::ISceneNode::setRotation(), and + irr::scene::ISceneNode::setScale(). + */ + if (node) + node->setPosition(core::vector3df(-1300,-144,-1249)); + + /* + Now we only need a camera to look at the Quake 3 map. + We want to create a user controlled camera. There are some + cameras available in the Irrlicht engine. For example the + MayaCamera which can be controlled like the camera in Maya: + Rotate with left mouse button pressed, Zoom with both buttons pressed, + translate with right mouse button pressed. This could be created with + irr::scene::ISceneManager::addCameraSceneNodeMaya(). But for this + example, we want to create a camera which behaves like the ones in + first person shooter games (FPS) and hence use + irr::scene::ISceneManager::addCameraSceneNodeFPS(). + */ + smgr->addCameraSceneNodeFPS(); + + /* + The mouse cursor needs not be visible, so we hide it via the + irr::IrrlichtDevice::ICursorControl. + */ + device->getCursorControl()->setVisible(false); + + /* + We have done everything, so lets draw it. We also write the current + frames per second and the primitives drawn into the caption of the + window. The test for irr::IrrlichtDevice::isWindowActive() is optional, + but prevents the engine to grab the mouse cursor after task switching + when other programs are active. The call to + irr::IrrlichtDevice::yield() will avoid the busy loop to eat up all CPU + cycles when the window is not active. + */ + int lastFPS = -1; + + while(device->run()) + { + if (device->isWindowActive()) + { + driver->beginScene(true, true, video::SColor(255,200,200,200)); + smgr->drawAll(); + driver->endScene(); + + int fps = driver->getFPS(); + + if (lastFPS != fps) + { + core::stringw str = L"Irrlicht Engine - Quake 3 Map example ["; + str += driver->getName(); + str += "] FPS:"; + str += fps; + + device->setWindowCaption(str.c_str()); + lastFPS = fps; + } + } + else + device->yield(); + } + + /* + In the end, delete the Irrlicht device. + */ + device->drop(); + return 0; +} + +/* +That's it. Compile and play around with the program. +**/ diff --git a/libraries/irrlicht-1.8.1/examples/02.Quake3Map/tutorial.html b/libraries/irrlicht-1.8.1/examples/02.Quake3Map/tutorial.html new file mode 100644 index 0000000..1858b86 --- /dev/null +++ b/libraries/irrlicht-1.8.1/examples/02.Quake3Map/tutorial.html @@ -0,0 +1,181 @@ + + +Irrlicht Engine Tutorial + + + + +
+ + + + + + + + +
+ Tutorial 2.Quake3Map
+

This Tutorial shows how to load a Quake 3 map into the engine, create + a SceneNode for optimizing the speed of rendering and how to create + a user controlled camera. Please note that you should know the basics + of the engine before starting this tutorial, just take a short look + at the first tutorial, 1.HelloWorld, if you haven't done this yet.
+ The result of this example will look like this:

+


+

+
+
+ + + + + + + +
+ Lets start!
+

Lets start like the HelloWorld example: We include the irrlicht header + files and an additional file to be able
+ to ask the user for a driver type using the console.

+ + + + +
#include <irrlicht.h>
#include <iostream>
+

As already written in the HelloWorld example, in the Irrlicht Engine, + everything can be found in the namespace 'irr'. To get rid of the irr:: + in front of the name of every class, we tell the compiler that we use + that namespace from now on, and we will not have to write that 'irr::'.
+ There are 5 other sub namespaces 'core', 'scene', 'video', 'io' and + 'gui'. Unlike in the HelloWorld example, we do not a 'using namespace' + for these 5 other namespaces because in this way you will see what can + be found in which namespace. But if you like, you can also include the + namespaces like in the previous example. Code just like you want to.

+ + + + +
using namespace irr;
+

Again, to be able to use the Irrlicht.DLL file, we need to link with + the Irrlicht.lib. We could set this option in the project settings, + but to make it easy, we use a pragma comment lib:

+ + + + +
#pragma comment(lib, "Irrlicht.lib")
+ +
+

Ok, lets start. Again, we use the main() method as start, not the WinMain(), + because its shorter to write.

+ + + + +
int main()
{
+

Like in the HelloWorld example, we create an IrrlichtDevice with createDevice(). + The difference now is that we ask the user to select which hardware accelerated + driver to use. The Software device would be too slow to draw a huge Quake + 3 map, but just for the fun of it, we make this decision possible too.

+ + + + +
// ask user for driver

video::E_DRIVER_TYPE driverType = video::EDT_DIRECT3D9;

printf("Please select the driver you want for this example:\n"\
" (a) Direct3D 9.0c\n (b) Direct3D 8.1\n (c) OpenGL 1.5\n"\
" (d) Software Renderer\n (e) Apfelbaum Software Renderer\n"\
" (f) NullDevice\n (otherKey) exit\n\n");
+char i;
std::cin >> i;

switch(i)
{
case 'a': driverType = video::EDT_DIRECT3D9;break;
case 'b': driverType = video::EDT_DIRECT3D8;break;
case 'c': driverType = video::EDT_OPENGL; break;
case 'd': driverType = video::EDT_SOFTWARE; break;
case 'e': driverType = video::EDT_BURNINGSVIDEO;break;
case 'f': driverType = video::EDT_NULL; break;
default: return 1;
}

// create device and exit if creation failed

IrrlichtDevice *device =
createDevice(driverType, core::dimension2d<s32>(640, 480));

if (device == 0)
return 1;
+

Get a pointer to the video driver and the SceneManager so that we do + not always have to write device->getVideoDriver() and device->getSceneManager().

+ + + + +
video::IVideoDriver* driver = device->getVideoDriver();
+scene::ISceneManager* smgr = device->getSceneManager();
+

To display the Quake 3 map, we first need to load it. Quake 3 maps are + packed into .pk3 files wich are nothing other than .zip files. So we add + the .pk3 file to our FileSystem. After it was added, we are able to read + from the files in that archive as they would directly be stored on disk.

+ + + + +
device->getFileSystem()->addZipFileArchive("../../media/map-20kdm2.pk3");
+

Now we can load the mesh by calling getMesh(). We get a pointer returned + to a IAnimatedMesh. As you know, Quake 3 maps are not really animated, + they are only a huge chunk of static geometry with some materials attached. + Hence the IAnimated mesh consists of only one frame,
+ so we get the "first frame" of the "animation", which + is our quake level and create an OctTree scene node with it, using addOctTreeSceneNode(). + The OctTree optimizes the scene a little bit, trying to draw only geometry + which is currently visible. An alternative to the OctTree would be a AnimatedMeshSceneNode, + which would draw always the complete geometry of the mesh, without optimization. + Try it out: Write addAnimatedMeshSceneNode instead of addOctTreeSceneNode + and compare the primitives drawed by the video driver. (There is a getPrimitiveCountDrawed() + method in the IVideoDriver class). Note that this optimization with the + Octree is only useful when drawing huge meshes consiting of lots of geometry.

+ + + + +
scene::IAnimatedMesh* mesh = smgr->getMesh("20kdm2.bsp");
scene::ISceneNode* node = 0; + +if (mesh)
node = smgr->addOctTreeSceneNode(mesh->getMesh(0));
+

Because the level was modelled not around the origin (0,0,0), we translate + the whole level a little bit.

+ + + + +
if (node)
node->setPosition(core::vector3df(-1300,-144,-1249));
+

Now we only need a Camera to look at the Quake 3 map. And we want to + create a user controlled camera. There are some different cameras available + in the Irrlicht engine. For example the Maya Camera which can be controlled + compareable to the camera in Maya: Rotate with left mouse button pressed, + Zoom with both buttons pressed,
+ translate with right mouse button pressed. This could be created with + addCameraSceneNodeMaya(). But for this example, we want to create a camera + which behaves like the ones in first person shooter games (FPS):

+ + + + +
smgr->addCameraSceneNodeFPS();
+

The mouse cursor needs not to be visible, so we make it invisible.

+ + + + +
device->getCursorControl()->setVisible(false);
+

We have done everything, so lets draw it. We also write the current frames + per second and the drawn primitives to the caption of the window. The + 'if (device->isWindowActive())' line is optional, but prevents the + engine render to set the position of the mouse cursor after task switching + when other program are active.

+ + + + +
int lastFPS = -1;
+
while(device->run())
+{
+  driver->beginScene(true, true, video::SColor(0,200,200,200));
+  smgr->drawAll();
+  driver->endScene();
+
  int fps = driver->getFPS();
+
  if (lastFPS != fps)
+  {
+     core::stringw str = L"Irrlicht Engine - Quake 3 Map example [";
str += driver->getName();
str += "] FPS:";
str += fps;
device->setWindowCaption(str.c_str());
lastFPS = fps; + } +}
+

In the end, delete the Irrlicht device.

+ + + + +
  device->drop();
return 0;
}
+

That's it. Compile and play around with the program.

+

 

+

 

+ + diff --git a/libraries/irrlicht-1.8.1/examples/03.CustomSceneNode/CustomSceneNode.cbp b/libraries/irrlicht-1.8.1/examples/03.CustomSceneNode/CustomSceneNode.cbp new file mode 100644 index 0000000..e68ffd3 --- /dev/null +++ b/libraries/irrlicht-1.8.1/examples/03.CustomSceneNode/CustomSceneNode.cbp @@ -0,0 +1,58 @@ + + + + + + diff --git a/libraries/irrlicht-1.8.1/examples/03.CustomSceneNode/CustomSceneNode.dev b/libraries/irrlicht-1.8.1/examples/03.CustomSceneNode/CustomSceneNode.dev new file mode 100644 index 0000000..57c5ee0 --- /dev/null +++ b/libraries/irrlicht-1.8.1/examples/03.CustomSceneNode/CustomSceneNode.dev @@ -0,0 +1,59 @@ +[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/libraries/irrlicht-1.8.1/examples/03.CustomSceneNode/CustomSceneNode.vcproj b/libraries/irrlicht-1.8.1/examples/03.CustomSceneNode/CustomSceneNode.vcproj new file mode 100644 index 0000000..890d308 --- /dev/null +++ b/libraries/irrlicht-1.8.1/examples/03.CustomSceneNode/CustomSceneNode.vcproj @@ -0,0 +1,163 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/libraries/irrlicht-1.8.1/examples/03.CustomSceneNode/CustomSceneNode_vc10.vcxproj b/libraries/irrlicht-1.8.1/examples/03.CustomSceneNode/CustomSceneNode_vc10.vcxproj new file mode 100644 index 0000000..5512e23 --- /dev/null +++ b/libraries/irrlicht-1.8.1/examples/03.CustomSceneNode/CustomSceneNode_vc10.vcxproj @@ -0,0 +1,243 @@ + + + + + Debug + Win32 + + + Debug + x64 + + + Release + Win32 + + + Release + x64 + + + + 03.CustomSceneNode + {171CCDFA-C140-4956-8EB7-F0168F4521D3} + CustomSceneNode + + + + Application + false + MultiByte + + + Application + false + MultiByte + + + Application + false + MultiByte + + + Application + false + MultiByte + + + + + + + + + + + + + + + + + + + + + + + <_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/libraries/irrlicht-1.8.1/examples/03.CustomSceneNode/CustomSceneNode_vc11.vcxproj b/libraries/irrlicht-1.8.1/examples/03.CustomSceneNode/CustomSceneNode_vc11.vcxproj new file mode 100644 index 0000000..52f6ef2 --- /dev/null +++ b/libraries/irrlicht-1.8.1/examples/03.CustomSceneNode/CustomSceneNode_vc11.vcxproj @@ -0,0 +1,247 @@ + + + + + Debug + Win32 + + + Debug + x64 + + + Release + Win32 + + + Release + x64 + + + + 03.CustomSceneNode + {171CCDFA-C140-4956-8EB7-F0168F4521D3} + CustomSceneNode + + + + Application + false + MultiByte + v110 + + + Application + false + MultiByte + v110 + + + Application + false + MultiByte + v110 + + + Application + false + MultiByte + v110 + + + + + + + + + + + + + + + + + + + + + + + <_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/libraries/irrlicht-1.8.1/examples/03.CustomSceneNode/CustomSceneNode_vc8.vcproj b/libraries/irrlicht-1.8.1/examples/03.CustomSceneNode/CustomSceneNode_vc8.vcproj new file mode 100644 index 0000000..42c7879 --- /dev/null +++ b/libraries/irrlicht-1.8.1/examples/03.CustomSceneNode/CustomSceneNode_vc8.vcproj @@ -0,0 +1,231 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/libraries/irrlicht-1.8.1/examples/03.CustomSceneNode/CustomSceneNode_vc9.vcproj b/libraries/irrlicht-1.8.1/examples/03.CustomSceneNode/CustomSceneNode_vc9.vcproj new file mode 100644 index 0000000..50f0382 --- /dev/null +++ b/libraries/irrlicht-1.8.1/examples/03.CustomSceneNode/CustomSceneNode_vc9.vcproj @@ -0,0 +1,230 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/libraries/irrlicht-1.8.1/examples/03.CustomSceneNode/Makefile b/libraries/irrlicht-1.8.1/examples/03.CustomSceneNode/Makefile new file mode 100644 index 0000000..34e3d43 --- /dev/null +++ b/libraries/irrlicht-1.8.1/examples/03.CustomSceneNode/Makefile @@ -0,0 +1,38 @@ +# Makefile for Irrlicht Examples +# It's usually sufficient to change just the target name and source file list +# and be sure that CXX is set to a valid compiler +Target = 03.CustomSceneNode +Sources = main.cpp + +# general compiler settings +CPPFLAGS = -I../../include -I/usr/X11R6/include +CXXFLAGS = -O3 -ffast-math +#CXXFLAGS = -g -Wall + +#default target is Linux +all: all_linux + +ifeq ($(HOSTTYPE), x86_64) +LIBSELECT=64 +endif + +# target specific settings +all_linux: LDFLAGS = -L/usr/X11R6/lib$(LIBSELECT) -L../../lib/Linux -lIrrlicht -lGL -lXxf86vm -lXext -lX11 -lXcursor +all_linux clean_linux: SYSTEM=Linux +all_win32: LDFLAGS = -L../../lib/Win32-gcc -lIrrlicht -lopengl32 -lm +all_win32 clean_win32: SYSTEM=Win32-gcc +all_win32 clean_win32: SUF=.exe +# name of the binary - only valid for targets which set SYSTEM +DESTPATH = ../../bin/$(SYSTEM)/$(Target)$(SUF) + +all_linux all_win32: + $(warning Building...) + $(CXX) $(CPPFLAGS) $(CXXFLAGS) $(Sources) -o $(DESTPATH) $(LDFLAGS) + +clean: clean_linux clean_win32 + $(warning Cleaning...) + +clean_linux clean_win32: + @$(RM) $(DESTPATH) + +.PHONY: all all_win32 clean clean_linux clean_win32 diff --git a/libraries/irrlicht-1.8.1/examples/03.CustomSceneNode/main.cpp b/libraries/irrlicht-1.8.1/examples/03.CustomSceneNode/main.cpp new file mode 100644 index 0000000..534f0d3 --- /dev/null +++ b/libraries/irrlicht-1.8.1/examples/03.CustomSceneNode/main.cpp @@ -0,0 +1,267 @@ +/** Example 003 Custom SceneNode + +This Tutorial is more advanced than the previous ones. +If you are currently just playing around with the Irrlicht +engine, you may want to look at other examples first. +This tutorials shows how to create a custom scene node and +how to use it in the engine. A custom scene node is needed +if you want to implement a render technique the Irrlicht +Engine currently does not support. For example, you can write +an indoor portal based renderer or an advanced terrain scene +node with it. By creating custom scene nodes, you can +easily extend the Irrlicht Engine and adapt it to your own +needs. + +I will keep the tutorial simple: Keep everything very +short, everything in one .cpp file, and I'll use the engine +here as in all other tutorials. + +To start, I include the header files, use the irr namespace, +and tell the linker to link with the .lib file. +*/ +#include +#include "driverChoice.h" + +using namespace irr; + +#ifdef _MSC_VER +#pragma comment(lib, "Irrlicht.lib") +#endif + +/* +Here comes the more sophisticated part of this tutorial: +The class of our very own custom scene node. To keep it simple, +our scene node will not be an indoor portal renderer nor a terrain +scene node, but a simple tetraeder, a 3d object consisting of 4 +connected vertices, which only draws itself and does nothing more. +Note that this scenario does not require a custom scene node in Irrlicht. +Instead one would create a mesh from the geometry and pass it to a +irr::scene::IMeshSceneNode. This example just illustrates creation of a custom +scene node in a very simple setting. + +To let our scene node be able to be inserted into the Irrlicht +Engine scene, the class we create needs to be derived from the +irr::scene::ISceneNode class and has to override some methods. +*/ + +class CSampleSceneNode : public scene::ISceneNode +{ + + /* + First, we declare some member variables: + The bounding box, 4 vertices, and the material of the tetraeder. + */ + core::aabbox3d Box; + video::S3DVertex Vertices[4]; + video::SMaterial Material; + + /* + The parameters of the constructor specify the parent of the scene node, + a pointer to the scene manager, and an id of the scene node. + In the constructor we call the parent class' constructor, + set some properties of the material, and + create the 4 vertices of the tetraeder we will draw later. + */ + +public: + + CSampleSceneNode(scene::ISceneNode* parent, scene::ISceneManager* mgr, s32 id) + : scene::ISceneNode(parent, mgr, id) + { + Material.Wireframe = false; + Material.Lighting = false; + + Vertices[0] = video::S3DVertex(0,0,10, 1,1,0, + video::SColor(255,0,255,255), 0, 1); + Vertices[1] = video::S3DVertex(10,0,-10, 1,0,0, + video::SColor(255,255,0,255), 1, 1); + Vertices[2] = video::S3DVertex(0,20,0, 0,1,1, + video::SColor(255,255,255,0), 1, 0); + Vertices[3] = video::S3DVertex(-10,0,-10, 0,0,1, + video::SColor(255,0,255,0), 0, 0); + + /* + The Irrlicht Engine needs to know the bounding box of a scene node. + It will use it for automatic culling and other things. Hence, we + need to create a bounding box from the 4 vertices we use. + If you do not want the engine to use the box for automatic culling, + and/or don't want to create the box, you could also call + irr::scene::ISceneNode::setAutomaticCulling() with irr::scene::EAC_OFF. + */ + Box.reset(Vertices[0].Pos); + for (s32 i=1; i<4; ++i) + Box.addInternalPoint(Vertices[i].Pos); + } + + /* + Before it is drawn, the irr::scene::ISceneNode::OnRegisterSceneNode() + method of every scene node in the scene is called by the scene manager. + If the scene node wishes to draw itself, it may register itself in the + scene manager to be drawn. This is necessary to tell the scene manager + when it should call irr::scene::ISceneNode::render(). For + example, normal scene nodes render their content one after another, + while stencil buffer shadows would like to be drawn after all other + scene nodes. And camera or light scene nodes need to be rendered before + all other scene nodes (if at all). So here we simply register the + scene node to render normally. If we would like to let it be rendered + like cameras or light, we would have to call + SceneManager->registerNodeForRendering(this, SNRT_LIGHT_AND_CAMERA); + After this, we call the actual + irr::scene::ISceneNode::OnRegisterSceneNode() method of the base class, + which simply lets also all the child scene nodes of this node register + themselves. + */ + virtual void OnRegisterSceneNode() + { + if (IsVisible) + SceneManager->registerNodeForRendering(this); + + ISceneNode::OnRegisterSceneNode(); + } + + /* + In the render() method most of the interesting stuff happens: The + Scene node renders itself. We override this method and draw the + tetraeder. + */ + virtual void render() + { + u16 indices[] = { 0,2,3, 2,1,3, 1,0,3, 2,0,1 }; + video::IVideoDriver* driver = SceneManager->getVideoDriver(); + + driver->setMaterial(Material); + driver->setTransform(video::ETS_WORLD, AbsoluteTransformation); + driver->drawVertexPrimitiveList(&Vertices[0], 4, &indices[0], 4, video::EVT_STANDARD, scene::EPT_TRIANGLES, video::EIT_16BIT); + } + + /* + And finally we create three small additional methods. + irr::scene::ISceneNode::getBoundingBox() returns the bounding box of + this scene node, irr::scene::ISceneNode::getMaterialCount() returns the + amount of materials in this scene node (our tetraeder only has one + material), and irr::scene::ISceneNode::getMaterial() returns the + material at an index. Because we have only one material here, we can + return the only one material, assuming that no one ever calls + getMaterial() with an index greater than 0. + */ + virtual const core::aabbox3d& getBoundingBox() const + { + return Box; + } + + virtual u32 getMaterialCount() const + { + return 1; + } + + virtual video::SMaterial& getMaterial(u32 i) + { + return Material; + } +}; + +/* +That's it. The Scene node is done. Now we simply have to start +the engine, create the scene node and a camera, and look at the result. +*/ +int main() +{ + // ask user for driver + video::E_DRIVER_TYPE driverType=driverChoiceConsole(); + if (driverType==video::EDT_COUNT) + return 1; + + // create device + + IrrlichtDevice *device = createDevice(driverType, + core::dimension2d(640, 480), 16, false); + + if (device == 0) + return 1; // could not create selected driver. + + // create engine and camera + + device->setWindowCaption(L"Custom Scene Node - Irrlicht Engine Demo"); + + video::IVideoDriver* driver = device->getVideoDriver(); + scene::ISceneManager* smgr = device->getSceneManager(); + + smgr->addCameraSceneNode(0, core::vector3df(0,-40,0), core::vector3df(0,0,0)); + + /* + Create our scene node. I don't check the result of calling new, as it + should throw an exception rather than returning 0 on failure. Because + the new node will create itself with a reference count of 1, and then + will have another reference added by its parent scene node when it is + added to the scene, I need to drop my reference to it. Best practice is + to drop it only *after* I have finished using it, regardless of what + the reference count of the object is after creation. + */ + CSampleSceneNode *myNode = + new CSampleSceneNode(smgr->getRootSceneNode(), smgr, 666); + + /* + To animate something in this boring scene consisting only of one + tetraeder, and to show that you now can use your scene node like any + other scene node in the engine, we add an animator to the scene node, + which rotates the node a little bit. + irr::scene::ISceneManager::createRotationAnimator() could return 0, so + should be checked. + */ + scene::ISceneNodeAnimator* anim = + smgr->createRotationAnimator(core::vector3df(0.8f, 0, 0.8f)); + + if(anim) + { + myNode->addAnimator(anim); + + /* + I'm done referring to anim, so must + irr::IReferenceCounted::drop() this reference now because it + was produced by a createFoo() function. As I shouldn't refer to + it again, ensure that I can't by setting to 0. + */ + anim->drop(); + anim = 0; + } + + /* + I'm done with my CSampleSceneNode object, and so must drop my reference. + This won't delete the object, yet, because it is still attached to the + scene graph, which prevents the deletion until the graph is deleted or the + custom scene node is removed from it. + */ + myNode->drop(); + myNode = 0; // As I shouldn't refer to it again, ensure that I can't + + /* + Now draw everything and finish. + */ + u32 frames=0; + while(device->run()) + { + driver->beginScene(true, true, video::SColor(0,100,100,100)); + + smgr->drawAll(); + + driver->endScene(); + if (++frames==100) + { + core::stringw str = L"Irrlicht Engine ["; + str += driver->getName(); + str += L"] FPS: "; + str += (s32)driver->getFPS(); + + device->setWindowCaption(str.c_str()); + frames=0; + } + } + + device->drop(); + + return 0; +} + +/* +That's it. Compile and play around with the program. +**/ diff --git a/libraries/irrlicht-1.8.1/examples/03.CustomSceneNode/tutorial.html b/libraries/irrlicht-1.8.1/examples/03.CustomSceneNode/tutorial.html new file mode 100644 index 0000000..becc3d7 --- /dev/null +++ b/libraries/irrlicht-1.8.1/examples/03.CustomSceneNode/tutorial.html @@ -0,0 +1,222 @@ + + +Irrlicht Engine Tutorial + + + + +
+ + + + + + + + +
+
+
+
Tutorial 3.CustomSceneNode
+
+
+
+

This Tutorial is a tutorial for more advanced developers. If you are + currently just playing around with the Irrlicht engine, please look + at other examples first. This tutorial shows how to create a custom + scene node and how to use it in the engine. A custom scene node is needed, + if you want to implement a render technique, the Irrlicht Engine is + currently not supporting. For example you can write a indoor portal + based renderer or a advanced terrain scene node with it. With creating + custom scene nodes, you can easily extend the Irrlicht Engine and adapt + it to your needs.

+

I will keep the tutorial simple: Keep everything very short, everything + in one .cpp file, and I'll use the engine here as in all other tutorials. + At the end of the tutorial, the result will look like the image below. + This looks not very exciting, but it is a complete customized scene + node and a good point to start from creating you own scene nodes.

+


+

+
+
+
+ + + + + + + +
+ Lets start!
+

To start, I include the header files, use the irr namespace, and tell + the linker to link with the .lib file.

+ + + + +
#include <irrlicht.h>
using namespace irr;
#pragma comment(lib, "Irrlicht.lib")
+

Here comes the most sophisticated part of this tutorial: The class + of our very own custom scene node. To keep it simple,
+ our scene node will not be an indoor portal renderer nor a terrain scene + node, but a simple tetraeder, a 3d object consiting of 4 connected vertices, + which only draws itself and does nothing more.

+

To let our scene node be able to be inserted into the Irrlicht Engine + scene, the class we create needs only be derived from the ISceneNode + class and has to override some methods.

+ + + + +
class CSampleSceneNode : public scene::ISceneNode
{
+

First, we declare some member variables, to hold data for our tetraeder: + The bounding box, 4 vertices, and
+ the material of the tetraeder.

+ + + + +
core::aabbox3d<f32> Box;
video::S3DVertex Vertices[4];
video::SMaterial Material;
+

The parameters of the constructor specify the parent of the scene node, + a pointer to the scene manager, and an id of the scene node. In the + constructor itself, we call the parent classes constructor, set some + properties of the material we use to draw the scene node and create + the 4 vertices of the tetraeder we will draw later.

+ + + + +
public:
CSampleSceneNode(scene::ISceneNode* parent, scene::ISceneManager* mgr, s32 id)
+ : scene::ISceneNode(parent, mgr, id)
+{ 
+  Material.Wireframe = false;
+  Material.Lighting = false;
+
  Vertices[0] = video::S3DVertex(0,0,10, 1,1,0,video::SColor(255,0,255,255),0,1);
+  Vertices[1] = video::S3DVertex(10,0,-10, 1,0,0,video::SColor(255,255,0,255),1,1); 
+  Vertices[2] = video::S3DVertex(0,20,0, 0,1,1,video::SColor(255,255,255,0),1,0);
+  Vertices[3] = video::S3DVertex(-10,0,-10, 0,0,1,video::SColor(255,0,255,0),0,0);
+
+
+ The Irrlicht Engine needs to know the bounding box of your scene node. + It will use it for doing automatic culling and other things. Hence we + need to create a bounding box from the 4 vertices we use. If you do not + want the engine to use the box for automatic culling, and/or don't want + to create the box, you could also write
+ AutomaticCullingEnabled = false;.
+
+ + + + +
  Box.reset(Vertices[0].Pos);
for (s32 i=1; i<4; ++i)
Box.addInternalPoint(Vertices[i].Pos); +}
+
+

Before it is drawn, the OnPreRender() method of every scene node in + the scene is called by the scene manager. If the scene node wishes to + draw itself, it may register itself in the scene manager to be drawn. + This is necessary to tell the scene manager when it should call the + ::render method. For example normal scene nodes render their content + one after another, while stencil buffer shadows would like to be drawn + after all other scene nodes. And camera or light scene nodes need to + be rendered before all other scene nodes (if at all).
+ So here we simply register the scene node to get rendered normally. + If we would like to let it be rendered like cameras or light, we would + have to call SceneManager->registerNodeForRendering(this, SNRT_LIGHT_AND_CAMERA); +
+ After this, we call the OnPreRender-method of the base class ISceneNode, + which simply lets also all the child scene nodes of this node register + themselves.

+
+ + + + +
virtual void OnPreRender()
{
if (IsVisible)
SceneManager->registerNodeForRendering(this); + + ISceneNode::OnPreRender(); +}
+

In the render() method most of the interresting stuff happenes: The Scene + node renders itself. We override this method and draw the tetraeder.

+ + + + +
virtual void render()
{
u16 indices[] = { 0,2,3, 2,1,3, 1,0,3, 2,0,1 }; + video::IVideoDriver* driver = SceneManager->getVideoDriver();
+
  driver->setMaterial(Material);
+  driver->setTransform(video::ETS_WORLD, AbsoluteTransformation);
+  driver->drawIndexedTriangleList(&Vertices[0], 4, &indices[0], 4);
+}
+

At least, we create three small additional methods. GetBoundingBox() + returns the bounding box of this scene node,
+ GetMaterialCount() returns the amount of materials in this scene node + (our tetraeder only has one material), and getMaterial() returns the material + at an index. Because we have only one material here, we can return the + only one material, assuming that no one ever calls getMaterial() with + an index greater than 0.

+ + + + +
  virtual const core::aabbox3d<f32>& getBoundingBox() const
{
return Box;
}
  virtual u32 getMaterialCount()
+  {
+    return 1;
+  }
  virtual video::SMaterial& getMaterial(u32 i)
+  {
+    return Material;
+  } 
+};
+

That's it. The Scene node is done. Now we simply have to start the engine, + create the scene node and a camera, and look at the result.

+ + + + +
int main()
{ + IrrlichtDevice *device = + createDevice(video::EDT_OPENGL, core::dimension2d<s32>(640, 480), 16, false);
  device->setWindowCaption(L"Custom Scene Node - Irrlicht Engine Demo");
  video::IVideoDriver* driver = device->getVideoDriver();
+           scene::ISceneManager* smgr = device->getSceneManager();
+
  smgr->addCameraSceneNode(0, core::vector3df(0,-40,0), core::vector3df(0,0,0));
+                   
+

Create our scene node. Note that it is dropped (->drop()) instantly + after we create it. This is possible because the scene manager now takes + care of it. This is not nessecary, it would also be possible to drop it + at the end of the program.

+ + + + +
CSampleSceneNode *myNode = 
new CSampleSceneNode(smgr->getRootSceneNode(), smgr, 666); + +myNode->drop();
+

To animate something in this boring scene consisting only of one tetraeder, + and to show, that you now can use your scene node like any other scene + node in the engine, we add an animator to the scene node, which rotates + the node a little bit.

+ + + + +
scene::ISceneNodeAnimator* anim = 
smgr->createRotationAnimator(core::vector3df(0.8f, 0, 0.8f)); + +myNode->addAnimator(anim); +anim->drop();
+

Now draw everything and finish.

+ + + + +
  while(device->run())
{
driver->beginScene(true, true, video::SColor(0,100,100,100)); + + smgr->drawAll(); + + driver->endScene(); + } + +device->drop(); +return 0; +}
+

That's it. Compile and play around with the program.

+

 

+ + diff --git a/libraries/irrlicht-1.8.1/examples/04.Movement/Makefile b/libraries/irrlicht-1.8.1/examples/04.Movement/Makefile new file mode 100644 index 0000000..0dcd252 --- /dev/null +++ b/libraries/irrlicht-1.8.1/examples/04.Movement/Makefile @@ -0,0 +1,39 @@ +# Makefile for Irrlicht Examples +# It's usually sufficient to change just the target name and source file list +# and be sure that CXX is set to a valid compiler +Target = 04.Movement +Sources = main.cpp + +# general compiler settings +CPPFLAGS = -I../../include -I/usr/X11R6/include +CXXFLAGS = -O3 -ffast-math +#CXXFLAGS = -g -Wall + +#default target is Linux +all: all_linux + +ifeq ($(HOSTTYPE), x86_64) +LIBSELECT=64 +endif + +# target specific settings +all_linux: LDFLAGS = -L/usr/X11R6/lib$(LIBSELECT) -L../../lib/Linux -lIrrlicht -lGL -lXxf86vm -lXext -lX11 -lXcursor +all_linux clean_linux: SYSTEM=Linux +all_win32: LDFLAGS = -L../../lib/Win32-gcc -lIrrlicht -lopengl32 -lm +all_win32: CPPFLAGS += -D__GNUWIN32__ -D_WIN32 -DWIN32 -D_WINDOWS -D_MBCS -D_USRDLL +all_win32 clean_win32: SYSTEM=Win32-gcc +all_win32 clean_win32: SUF=.exe +# name of the binary - only valid for targets which set SYSTEM +DESTPATH = ../../bin/$(SYSTEM)/$(Target)$(SUF) + +all_linux all_win32: + $(warning Building...) + $(CXX) $(CPPFLAGS) $(CXXFLAGS) $(Sources) -o $(DESTPATH) $(LDFLAGS) + +clean: clean_linux clean_win32 + $(warning Cleaning...) + +clean_linux clean_win32: + @$(RM) $(DESTPATH) + +.PHONY: all all_win32 clean clean_linux clean_win32 diff --git a/libraries/irrlicht-1.8.1/examples/04.Movement/Movement.cbp b/libraries/irrlicht-1.8.1/examples/04.Movement/Movement.cbp new file mode 100644 index 0000000..0fcc4d0 --- /dev/null +++ b/libraries/irrlicht-1.8.1/examples/04.Movement/Movement.cbp @@ -0,0 +1,55 @@ + + + + + + diff --git a/libraries/irrlicht-1.8.1/examples/04.Movement/Movement.dev b/libraries/irrlicht-1.8.1/examples/04.Movement/Movement.dev new file mode 100644 index 0000000..0753c10 --- /dev/null +++ b/libraries/irrlicht-1.8.1/examples/04.Movement/Movement.dev @@ -0,0 +1,59 @@ +[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/libraries/irrlicht-1.8.1/examples/04.Movement/Movement.vcproj b/libraries/irrlicht-1.8.1/examples/04.Movement/Movement.vcproj new file mode 100644 index 0000000..105c625 --- /dev/null +++ b/libraries/irrlicht-1.8.1/examples/04.Movement/Movement.vcproj @@ -0,0 +1,163 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/libraries/irrlicht-1.8.1/examples/04.Movement/Movement_vc10.vcxproj b/libraries/irrlicht-1.8.1/examples/04.Movement/Movement_vc10.vcxproj new file mode 100644 index 0000000..7e59058 --- /dev/null +++ b/libraries/irrlicht-1.8.1/examples/04.Movement/Movement_vc10.vcxproj @@ -0,0 +1,231 @@ + + + + + Debug + Win32 + + + Debug + x64 + + + Release + Win32 + + + Release + x64 + + + + 04.Movement + {7BDBB7E8-E0C9-4A0D-83C1-D389D6140FEF} + Movement + + + + Application + false + MultiByte + + + Application + false + MultiByte + + + Application + false + MultiByte + + + Application + false + MultiByte + + + + + + + + + + + + + + + + + + + + + + + <_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/libraries/irrlicht-1.8.1/examples/04.Movement/Movement_vc11.vcxproj b/libraries/irrlicht-1.8.1/examples/04.Movement/Movement_vc11.vcxproj new file mode 100644 index 0000000..7fe0339 --- /dev/null +++ b/libraries/irrlicht-1.8.1/examples/04.Movement/Movement_vc11.vcxproj @@ -0,0 +1,235 @@ + + + + + Debug + Win32 + + + Debug + x64 + + + Release + Win32 + + + Release + x64 + + + + 04.Movement + {7BDBB7E8-E0C9-4A0D-83C1-D389D6140FEF} + Movement + + + + Application + false + MultiByte + v110 + + + Application + false + MultiByte + v110 + + + Application + false + MultiByte + v110 + + + Application + false + MultiByte + v110 + + + + + + + + + + + + + + + + + + + + + + + <_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/libraries/irrlicht-1.8.1/examples/04.Movement/Movement_vc8.vcproj b/libraries/irrlicht-1.8.1/examples/04.Movement/Movement_vc8.vcproj new file mode 100644 index 0000000..8f56add --- /dev/null +++ b/libraries/irrlicht-1.8.1/examples/04.Movement/Movement_vc8.vcproj @@ -0,0 +1,231 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/libraries/irrlicht-1.8.1/examples/04.Movement/Movement_vc9.vcproj b/libraries/irrlicht-1.8.1/examples/04.Movement/Movement_vc9.vcproj new file mode 100644 index 0000000..074fe40 --- /dev/null +++ b/libraries/irrlicht-1.8.1/examples/04.Movement/Movement_vc9.vcproj @@ -0,0 +1,230 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/libraries/irrlicht-1.8.1/examples/04.Movement/main.cpp b/libraries/irrlicht-1.8.1/examples/04.Movement/main.cpp new file mode 100644 index 0000000..7bacda3 --- /dev/null +++ b/libraries/irrlicht-1.8.1/examples/04.Movement/main.cpp @@ -0,0 +1,258 @@ +/** Example 004 Movement + +This Tutorial shows how to move and animate SceneNodes. The +basic concept of SceneNodeAnimators is shown as well as manual +movement of nodes using the keyboard. We'll demonstrate framerate +independent movement, which means moving by an amount dependent +on the duration of the last run of the Irrlicht loop. + +Example 19.MouseAndJoystick shows how to handle those kinds of input. + +As always, I include the header files, use the irr namespace, +and tell the linker to link with the .lib file. +*/ +#ifdef _MSC_VER +// We'll also define this to stop MSVC complaining about sprintf(). +#define _CRT_SECURE_NO_WARNINGS +#pragma comment(lib, "Irrlicht.lib") +#endif + +#include +#include "driverChoice.h" + +using namespace irr; + +/* +To receive events like mouse and keyboard input, or GUI events like "the OK +button has been clicked", we need an object which is derived from the +irr::IEventReceiver object. There is only one method to override: +irr::IEventReceiver::OnEvent(). This method will be called by the engine once +when an event happens. What we really want to know is whether a key is being +held down, and so we will remember the current state of each key. +*/ +class MyEventReceiver : public IEventReceiver +{ +public: + // This is the one method that we have to implement + virtual bool OnEvent(const SEvent& event) + { + // Remember whether each key is down or up + if (event.EventType == irr::EET_KEY_INPUT_EVENT) + KeyIsDown[event.KeyInput.Key] = event.KeyInput.PressedDown; + + return false; + } + + // This is used to check whether a key is being held down + virtual bool IsKeyDown(EKEY_CODE keyCode) const + { + return KeyIsDown[keyCode]; + } + + MyEventReceiver() + { + for (u32 i=0; i(640, 480), 16, false, false, false, &receiver); + + if (device == 0) + return 1; // could not create selected driver. + + video::IVideoDriver* driver = device->getVideoDriver(); + scene::ISceneManager* smgr = device->getSceneManager(); + + /* + 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 + at (0,0,30) and assign a texture to it to let it look a little bit more + interesting. Because we have no dynamic lights in this scene we disable + lighting for each model (otherwise the models would be black). + */ + scene::ISceneNode * node = smgr->addSphereSceneNode(); + if (node) + { + node->setPosition(core::vector3df(0,0,30)); + node->setMaterialTexture(0, driver->getTexture("../../media/wall.bmp")); + node->setMaterialFlag(video::EMF_LIGHTING, false); + } + + /* + Now we create another node, movable using a scene node animator. Scene + node animators modify scene nodes and can be attached to any scene node + like mesh scene nodes, billboards, lights and even camera scene nodes. + Scene node animators are not only able to modify the position of a + scene node, they can also animate the textures of an object for + example. We create a cube scene node and attach a 'fly circle' scene + node animator to it, letting this node fly around our sphere scene node. + */ + scene::ISceneNode* n = smgr->addCubeSceneNode(); + + if (n) + { + n->setMaterialTexture(0, driver->getTexture("../../media/t351sml.jpg")); + n->setMaterialFlag(video::EMF_LIGHTING, false); + scene::ISceneNodeAnimator* anim = + smgr->createFlyCircleAnimator(core::vector3df(0,0,30), 20.0f); + if (anim) + { + n->addAnimator(anim); + anim->drop(); + } + } + + /* + The last scene node we add to show possibilities of scene node animators is + a b3d model, which uses a 'fly straight' animator to run between to points. + */ + scene::IAnimatedMeshSceneNode* anms = + smgr->addAnimatedMeshSceneNode(smgr->getMesh("../../media/ninja.b3d")); + + if (anms) + { + scene::ISceneNodeAnimator* anim = + smgr->createFlyStraightAnimator(core::vector3df(100,0,60), + core::vector3df(-100,0,60), 3500, true); + if (anim) + { + anms->addAnimator(anim); + anim->drop(); + } + + /* + To make the model look right we disable lighting, set the + frames between which the animation should loop, rotate the + model around 180 degrees, and adjust the animation speed and + the texture. To set the right animation (frames and speed), we + would also be able to just call + "anms->setMD2Animation(scene::EMAT_RUN)" for the 'run' + animation instead of "setFrameLoop" and "setAnimationSpeed", + but this only works with MD2 animations, and so you know how to + start other animations. But a good advice is to not use + hardcoded frame-numbers... + */ + anms->setMaterialFlag(video::EMF_LIGHTING, false); + + anms->setFrameLoop(0, 13); + anms->setAnimationSpeed(15); +// anms->setMD2Animation(scene::EMAT_RUN); + + 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")); + + } + + + /* + To be able to look at and move around in this scene, we create a first + person shooter style camera and make the mouse cursor invisible. + */ + smgr->addCameraSceneNodeFPS(); + device->getCursorControl()->setVisible(false); + + /* + Add a colorful irrlicht logo + */ + device->getGUIEnvironment()->addImage( + driver->getTexture("../../media/irrlichtlogoalpha2.tga"), + core::position2d(10,20)); + + gui::IGUIStaticText* diagnostics = device->getGUIEnvironment()->addStaticText( + L"", core::rect(10, 10, 400, 20)); + diagnostics->setOverrideColor(video::SColor(255, 255, 255, 0)); + + /* + We have done everything, so lets draw it. We also write the current + frames per second and the name of the driver to the caption of the + window. + */ + int lastFPS = -1; + + // In order to do framerate independent movement, we have to know + // how long it was since the last frame + u32 then = device->getTimer()->getTime(); + + // This is the movemen speed in units per second. + const f32 MOVEMENT_SPEED = 5.f; + + while(device->run()) + { + // Work out a frame delta time. + const u32 now = device->getTimer()->getTime(); + const f32 frameDeltaTime = (f32)(now - then) / 1000.f; // Time in seconds + then = now; + + /* Check if keys W, S, A or D are being held down, and move the + sphere node around respectively. */ + core::vector3df nodePosition = node->getPosition(); + + if(receiver.IsKeyDown(irr::KEY_KEY_W)) + nodePosition.Y += MOVEMENT_SPEED * frameDeltaTime; + else if(receiver.IsKeyDown(irr::KEY_KEY_S)) + nodePosition.Y -= MOVEMENT_SPEED * frameDeltaTime; + + if(receiver.IsKeyDown(irr::KEY_KEY_A)) + nodePosition.X -= MOVEMENT_SPEED * frameDeltaTime; + else if(receiver.IsKeyDown(irr::KEY_KEY_D)) + nodePosition.X += MOVEMENT_SPEED * frameDeltaTime; + + node->setPosition(nodePosition); + + driver->beginScene(true, true, video::SColor(255,113,113,133)); + + smgr->drawAll(); // draw the 3d scene + device->getGUIEnvironment()->drawAll(); // draw the gui environment (the logo) + + driver->endScene(); + + int fps = driver->getFPS(); + + if (lastFPS != fps) + { + core::stringw tmp(L"Movement Example - Irrlicht Engine ["); + tmp += driver->getName(); + tmp += L"] fps: "; + tmp += fps; + + device->setWindowCaption(tmp.c_str()); + lastFPS = fps; + } + } + + /* + In the end, delete the Irrlicht device. + */ + device->drop(); + + return 0; +} + +/* +That's it. Compile and play around with the program. +**/ diff --git a/libraries/irrlicht-1.8.1/examples/04.Movement/tutorial.html b/libraries/irrlicht-1.8.1/examples/04.Movement/tutorial.html new file mode 100644 index 0000000..28b207d --- /dev/null +++ b/libraries/irrlicht-1.8.1/examples/04.Movement/tutorial.html @@ -0,0 +1,188 @@ + + +Irrlicht Engine Tutorial + + + + +
+ + + + + + + + +
+
+
+
Tutorial 4.Movement
+
+
+
+

This Tutorial shows how to move and animate SceneNodes. The basic concept + of SceneNodeAnimators is shown as well as manual movement of nodes using + the keyboard.

+

The program which is described here will look like this:

+


+

+
+
+
+ + + + + + + +
+ Lets start!
+

As always, I include the header files, use the irr namespace, and tell + the linker to link with the .lib file.

+ + + + +
#include <stdio.h>
#include <wchar.h>
#include <irrlicht.h>
+
using namespace irr;
+
#pragma comment(lib, "Irrlicht.lib")
+

In this tutorial, one of our goals is to move a scene node using some + keys on the keyboard. We store a pointer to the scene node we want to + move with the keys here.
+ The other pointer is a pointer to the Irrlicht Device, which we need + int the EventReceiver to manipulate the scene node and to get the active + camera.

+ + + + +
scene::ISceneNode* node = 0;
IrrlichtDevice* device = 0;
+

To get events like mouse and keyboard input, or GUI events like "the + OK button has been clicked", we need an object wich is derived + from the IEventReceiver object. There is only one method to override: + OnEvent. This method will be called by the engine when an event happened. + We will use this input to move the scene node with the keys W and S.

+ + + + +
class MyEventReceiver : public IEventReceiver
{
public:
virtual bool OnEvent(const SEvent& event)
{
+

If the key 'W' or 'S' was left up, we get the position of the scene + node, and modify the Y coordinate a little bit. So if you press 'W', + the node moves up, and if you press 'S' it moves down.

+ + + + +
if (node != 0 && event.EventType == irr::EET_KEY_INPUT_EVENT&&
!event.KeyInput.PressedDown)
{
switch(event.KeyInput.Key)
{
case KEY_KEY_W:
case KEY_KEY_S:
{
core::vector3df v = node->getPosition();
v.Y += event.KeyInput.Key == KEY_KEY_W ? 2.0f : -2.0f;
node->setPosition(v);
}
return true;
}
} return false;
}
};
+ +
+

The event receiver for moving a scene node is ready. So lets just create + an Irrlicht Device and the scene node we want to move. We also create + some other additional scene nodes, to show that there are also some different + possibilities to move and animate scene nodes.

+ + + + +
int main()
{
MyEventReceiver receiver; + + device = createDevice(video::EDT_OPENGL, core::dimension2d<s32>(640, 480), + 16, false, false, false, &receiver);
+
   video::IVideoDriver* driver = device->getVideoDriver();
+   scene::ISceneManager* smgr = device->getSceneManager();
+
+

Create the node for moving it with the 'W' and 'S' key. We create a + sphere node, which is a built in geometric primitive scene node. + We place the node at (0,0,30) and assign a texture to it to let it look + a little bit more interesting.

+ + + + +
node = smgr->addSphereSceneNode();
+node->setPosition(core::vector3df(0,0,30));
+node->setMaterialFlag(video::EMF_LIGHTING, false);
+node->setMaterialTexture(0, driver->getTexture("../../media/wall.bmp"));
+

Now we create another node, moving using a scene node animator. Scene + node animators modify scene nodes and can be attached to any scene node + like
+ mesh scene nodes, billboards, lights and even camera scene nodes. Scene + node animators are not only able to modify the position of a scene node, + they can
+ also animate the textures of an object for example. We create a test scene + node again an attach a 'fly circle' scene node to it, letting this node + fly around our first test scene node.

+ + + + +
scene::ISceneNode* n = smgr->addCubeSceneNode();
+n->setMaterialTexture(0, driver->getTexture("../../media/t351sml.jpg"));
+n->setMaterialFlag(video::EMF_LIGHTING, false);
+scene::ISceneNodeAnimator* anim = 
+	smgr->createFlyCircleAnimator(core::vector3df(0,0,30), 20.0f);
+n->addAnimator(anim);
+anim->drop();
+

The last scene node we add to show possibilities of scene node animators + is a md2 model, which uses a 'fly straight' animator to run between to + points.

+ + + + +
scene::IAnimatedMeshSceneNode* anms = smgr->addAnimatedMeshSceneNode(
smgr->getMesh("../../media/sydney.md2")); + +if (n)
{
anim = smgr->createFlyStraightAnimator(core::vector3df(100,0,60),
core::vector3df(-100,0,60), 10000, true);
anms->addAnimator(anim);
anim->drop();
+
+

To make to model look right we set the frames between which + the animation should loop, rotate the model around 180 degrees, and adjust + the animation speed and the texture.
+ To set the right animation (frames and speed), we would also be able to + just call "anms->setMD2Animation(scene::EMAT_RUN)" for the + 'run' animation instead of "setFrameLoop" and "setAnimationSpeed", + but this only works with MD2 animations, and so you know how to start + other animations.

+ + + + +
   anms->setMaterialFlag(video::EMF_LIGHTING, false);
anms->setFrameLoop(320, 360); + anms->setAnimationSpeed(30);
anms->setRotation(core::vector3df(0,180.0f,0));
anms->setMaterialTexture(0, driver->getTexture("../../media/sydney.bmp"));
}
+

To be able to look at and move around in this scene, we create a first + person shooter style camera and make the mouse cursor invisible.

+ + + + +
smgr->addCameraSceneNodeFPS(0, 100.0f, 100.0f);
device->getCursorControl()->setVisible(false);
+

We have done everything, so lets draw it. We also write the current frames + per second and the name of the driver to the caption of the window.

+ + + + +
int lastFPS = -1;
+
while(device->run())
+{
+     driver->beginScene(true, true, video::SColor(255,90,90,156));
+     smgr->drawAll();
+     driver->endScene();
+
     int fps = driver->getFPS();
+
     if (lastFPS != fps)
+     {
+        wchar_t tmp[1024];
+        swprintf(tmp, 1024, L"Movement Example - Irrlicht Engine (%ls)(fps:%d)",
driver->getName(), fps);
+
       device->setWindowCaption(tmp);
+       lastFPS = fps;
+     }
+}
+
+device->drop();
return 0;
}
+

That's it. Compile and play around with the program.

+

 

+

 

+ + diff --git a/libraries/irrlicht-1.8.1/examples/05.UserInterface/Makefile b/libraries/irrlicht-1.8.1/examples/05.UserInterface/Makefile new file mode 100644 index 0000000..24cd5d4 --- /dev/null +++ b/libraries/irrlicht-1.8.1/examples/05.UserInterface/Makefile @@ -0,0 +1,38 @@ +# Makefile for Irrlicht Examples +# It's usually sufficient to change just the target name and source file list +# and be sure that CXX is set to a valid compiler +Target = 05.UserInterface +Sources = main.cpp + +# general compiler settings +CPPFLAGS = -I../../include -I/usr/X11R6/include +CXXFLAGS = -O3 -ffast-math +#CXXFLAGS = -g -Wall + +#default target is Linux +all: all_linux + +ifeq ($(HOSTTYPE), x86_64) +LIBSELECT=64 +endif + +# target specific settings +all_linux: LDFLAGS = -L/usr/X11R6/lib$(LIBSELECT) -L../../lib/Linux -lIrrlicht -lGL -lXxf86vm -lXext -lX11 -lXcursor +all_linux clean_linux: SYSTEM=Linux +all_win32: LDFLAGS = -L../../lib/Win32-gcc -lIrrlicht -lopengl32 -lm +all_win32 clean_win32: SYSTEM=Win32-gcc +all_win32 clean_win32: SUF=.exe +# name of the binary - only valid for targets which set SYSTEM +DESTPATH = ../../bin/$(SYSTEM)/$(Target)$(SUF) + +all_linux all_win32: + $(warning Building...) + $(CXX) $(CPPFLAGS) $(CXXFLAGS) $(Sources) -o $(DESTPATH) $(LDFLAGS) + +clean: clean_linux clean_win32 + $(warning Cleaning...) + +clean_linux clean_win32: + @$(RM) $(DESTPATH) + +.PHONY: all all_win32 clean clean_linux clean_win32 diff --git a/libraries/irrlicht-1.8.1/examples/05.UserInterface/UserInterface.cbp b/libraries/irrlicht-1.8.1/examples/05.UserInterface/UserInterface.cbp new file mode 100644 index 0000000..0e4aebb --- /dev/null +++ b/libraries/irrlicht-1.8.1/examples/05.UserInterface/UserInterface.cbp @@ -0,0 +1,55 @@ + + + + + + diff --git a/libraries/irrlicht-1.8.1/examples/05.UserInterface/UserInterface.dev b/libraries/irrlicht-1.8.1/examples/05.UserInterface/UserInterface.dev new file mode 100644 index 0000000..6a32ece --- /dev/null +++ b/libraries/irrlicht-1.8.1/examples/05.UserInterface/UserInterface.dev @@ -0,0 +1,59 @@ +[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/libraries/irrlicht-1.8.1/examples/05.UserInterface/UserInterface.vcproj b/libraries/irrlicht-1.8.1/examples/05.UserInterface/UserInterface.vcproj new file mode 100644 index 0000000..4428169 --- /dev/null +++ b/libraries/irrlicht-1.8.1/examples/05.UserInterface/UserInterface.vcproj @@ -0,0 +1,163 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/libraries/irrlicht-1.8.1/examples/05.UserInterface/UserInterface_vc10.vcxproj b/libraries/irrlicht-1.8.1/examples/05.UserInterface/UserInterface_vc10.vcxproj new file mode 100644 index 0000000..12c0501 --- /dev/null +++ b/libraries/irrlicht-1.8.1/examples/05.UserInterface/UserInterface_vc10.vcxproj @@ -0,0 +1,231 @@ + + + + + Debug + Win32 + + + Debug + x64 + + + Release + Win32 + + + Release + x64 + + + + 05.UserInterface + {622C9DD7-0391-49FF-AF53-24F9D5A8EC53} + UserInterface + + + + Application + false + MultiByte + + + Application + false + MultiByte + + + Application + false + MultiByte + + + Application + false + MultiByte + + + + + + + + + + + + + + + + + + + + + + + <_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/libraries/irrlicht-1.8.1/examples/05.UserInterface/UserInterface_vc11.vcxproj b/libraries/irrlicht-1.8.1/examples/05.UserInterface/UserInterface_vc11.vcxproj new file mode 100644 index 0000000..cc6561b --- /dev/null +++ b/libraries/irrlicht-1.8.1/examples/05.UserInterface/UserInterface_vc11.vcxproj @@ -0,0 +1,235 @@ + + + + + Debug + Win32 + + + Debug + x64 + + + Release + Win32 + + + Release + x64 + + + + 05.UserInterface + {622C9DD7-0391-49FF-AF53-24F9D5A8EC53} + UserInterface + + + + Application + false + MultiByte + v110 + + + Application + false + MultiByte + v110 + + + Application + false + MultiByte + v110 + + + Application + false + MultiByte + v110 + + + + + + + + + + + + + + + + + + + + + + + <_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/libraries/irrlicht-1.8.1/examples/05.UserInterface/UserInterface_vc8.vcproj b/libraries/irrlicht-1.8.1/examples/05.UserInterface/UserInterface_vc8.vcproj new file mode 100644 index 0000000..fdc4fef --- /dev/null +++ b/libraries/irrlicht-1.8.1/examples/05.UserInterface/UserInterface_vc8.vcproj @@ -0,0 +1,231 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/libraries/irrlicht-1.8.1/examples/05.UserInterface/UserInterface_vc9.vcproj b/libraries/irrlicht-1.8.1/examples/05.UserInterface/UserInterface_vc9.vcproj new file mode 100644 index 0000000..e192238 --- /dev/null +++ b/libraries/irrlicht-1.8.1/examples/05.UserInterface/UserInterface_vc9.vcproj @@ -0,0 +1,230 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/libraries/irrlicht-1.8.1/examples/05.UserInterface/main.cpp b/libraries/irrlicht-1.8.1/examples/05.UserInterface/main.cpp new file mode 100644 index 0000000..98b3898 --- /dev/null +++ b/libraries/irrlicht-1.8.1/examples/05.UserInterface/main.cpp @@ -0,0 +1,291 @@ +/** Example 005 User Interface + +This tutorial shows how to use the built in User Interface of +the Irrlicht Engine. It will give a brief overview and show +how to create and use windows, buttons, scroll bars, static +texts, and list boxes. + +As always, we include the header files, and use the irrlicht +namespaces. We also store a pointer to the Irrlicht device, +a counter variable for changing the creation position of a window, +and a pointer to a listbox. +*/ +#include +#include "driverChoice.h" + +using namespace irr; + +using namespace core; +using namespace scene; +using namespace video; +using namespace io; +using namespace gui; + +#ifdef _IRR_WINDOWS_ +#pragma comment(lib, "Irrlicht.lib") +#endif + +// Declare a structure to hold some context for the event receiver so that it +// has it available inside its OnEvent() method. +struct SAppContext +{ + IrrlichtDevice *device; + s32 counter; + IGUIListBox* listbox; +}; + +// Define some values that we'll use to identify individual GUI controls. +enum +{ + GUI_ID_QUIT_BUTTON = 101, + GUI_ID_NEW_WINDOW_BUTTON, + GUI_ID_FILE_OPEN_BUTTON, + GUI_ID_TRANSPARENCY_SCROLL_BAR +}; + +/* + Set the skin transparency by changing the alpha values of all skin-colors +*/ +void setSkinTransparency(s32 alpha, irr::gui::IGUISkin * skin) +{ + for (s32 i=0; igetColor((EGUI_DEFAULT_COLOR)i); + col.setAlpha(alpha); + skin->setColor((EGUI_DEFAULT_COLOR)i, col); + } +} + +/* +The Event Receiver is not only capable of getting keyboard and +mouse input events, but also events of the graphical user interface +(gui). There are events for almost everything: Button click, +Listbox selection change, events that say that a element was hovered +and so on. To be able to react to some of these events, we create +an event receiver. +We only react to gui events, and if it's such an event, we get the +id of the caller (the gui element which caused the event) and get +the pointer to the gui environment. +*/ +class MyEventReceiver : public IEventReceiver +{ +public: + MyEventReceiver(SAppContext & context) : Context(context) { } + + virtual bool OnEvent(const SEvent& event) + { + if (event.EventType == EET_GUI_EVENT) + { + s32 id = event.GUIEvent.Caller->getID(); + IGUIEnvironment* env = Context.device->getGUIEnvironment(); + + switch(event.GUIEvent.EventType) + { + + /* + If a scrollbar changed its scroll position, and it is + 'our' scrollbar (the one with id GUI_ID_TRANSPARENCY_SCROLL_BAR), then we change + the transparency of all gui elements. This is a very + easy task: There is a skin object, in which all color + settings are stored. We simply go through all colors + stored in the skin and change their alpha value. + */ + case EGET_SCROLL_BAR_CHANGED: + if (id == GUI_ID_TRANSPARENCY_SCROLL_BAR) + { + s32 pos = ((IGUIScrollBar*)event.GUIEvent.Caller)->getPos(); + setSkinTransparency(pos, env->getSkin()); + } + break; + + /* + If a button was clicked, it could be one of 'our' + three buttons. If it is the first, we shut down the engine. + If it is the second, we create a little window with some + text on it. We also add a string to the list box to log + what happened. And if it is the third button, we create + a file open dialog, and add also this as string to the list box. + That's all for the event receiver. + */ + case EGET_BUTTON_CLICKED: + switch(id) + { + case GUI_ID_QUIT_BUTTON: + Context.device->closeDevice(); + return true; + + case GUI_ID_NEW_WINDOW_BUTTON: + { + Context.listbox->addItem(L"Window created"); + Context.counter += 30; + if (Context.counter > 200) + Context.counter = 0; + + IGUIWindow* window = env->addWindow( + rect(100 + Context.counter, 100 + Context.counter, 300 + Context.counter, 200 + Context.counter), + false, // modal? + L"Test window"); + + env->addStaticText(L"Please close me", + rect(35,35,140,50), + true, // border? + false, // wordwrap? + window); + } + return true; + + case GUI_ID_FILE_OPEN_BUTTON: + Context.listbox->addItem(L"File open"); + // There are some options for the file open dialog + // We set the title, make it a modal window, and make sure + // that the working directory is restored after the dialog + // is finished. + env->addFileOpenDialog(L"Please choose a file.", true, 0, -1, true); + return true; + + default: + return false; + } + break; + + case EGET_FILE_SELECTED: + { + // show the model filename, selected in the file dialog + IGUIFileOpenDialog* dialog = + (IGUIFileOpenDialog*)event.GUIEvent.Caller; + Context.listbox->addItem(dialog->getFileName()); + } + break; + + default: + break; + } + } + + return false; + } + +private: + SAppContext & Context; +}; + + +/* +Ok, now for the more interesting part. First, create the Irrlicht device. As in +some examples before, we ask the user which driver he wants to use for this +example: +*/ +int main() +{ + // ask user for driver + video::E_DRIVER_TYPE driverType=driverChoiceConsole(); + if (driverType==video::EDT_COUNT) + return 1; + + // create device and exit if creation failed + + IrrlichtDevice * device = createDevice(driverType, core::dimension2d(640, 480)); + + if (device == 0) + return 1; // could not create selected driver. + + /* The creation was successful, now we set the event receiver and + store pointers to the driver and to the gui environment. */ + + device->setWindowCaption(L"Irrlicht Engine - User Interface Demo"); + device->setResizable(true); + + video::IVideoDriver* driver = device->getVideoDriver(); + IGUIEnvironment* env = device->getGUIEnvironment(); + + /* + To make the font a little bit nicer, we load an external font + and set it as the new default font in the skin. + To keep the standard font for tool tip text, we set it to + the built-in font. + */ + + IGUISkin* skin = env->getSkin(); + IGUIFont* font = env->getFont("../../media/fonthaettenschweiler.bmp"); + if (font) + skin->setFont(font); + + skin->setFont(env->getBuiltInFont(), EGDF_TOOLTIP); + + /* + We add three buttons. The first one closes the engine. The second + creates a window and the third opens a file open dialog. The third + parameter is the id of the button, with which we can easily identify + the button in the event receiver. + */ + + env->addButton(rect(10,240,110,240 + 32), 0, GUI_ID_QUIT_BUTTON, + L"Quit", L"Exits Program"); + env->addButton(rect(10,280,110,280 + 32), 0, GUI_ID_NEW_WINDOW_BUTTON, + L"New Window", L"Launches a new Window"); + env->addButton(rect(10,320,110,320 + 32), 0, GUI_ID_FILE_OPEN_BUTTON, + L"File Open", L"Opens a file"); + + /* + Now, we add a static text and a scrollbar, which modifies the + transparency of all gui elements. We set the maximum value of + the scrollbar to 255, because that's the maximal value for + a color value. + Then we create an other static text and a list box. + */ + + env->addStaticText(L"Transparent Control:", rect(150,20,350,40), true); + IGUIScrollBar* scrollbar = env->addScrollBar(true, + rect(150, 45, 350, 60), 0, GUI_ID_TRANSPARENCY_SCROLL_BAR); + scrollbar->setMax(255); + scrollbar->setPos(255); + setSkinTransparency( scrollbar->getPos(), env->getSkin()); + + // set scrollbar position to alpha value of an arbitrary element + scrollbar->setPos(env->getSkin()->getColor(EGDC_WINDOW).getAlpha()); + + env->addStaticText(L"Logging ListBox:", rect(50,110,250,130), true); + IGUIListBox * listbox = env->addListBox(rect(50, 140, 250, 210)); + env->addEditBox(L"Editable Text", rect(350, 80, 550, 100)); + + // Store the appropriate data in a context structure. + SAppContext context; + context.device = device; + context.counter = 0; + context.listbox = listbox; + + // Then create the event receiver, giving it that context structure. + MyEventReceiver receiver(context); + + // And tell the device to use our custom event receiver. + device->setEventReceiver(&receiver); + + + /* + And at last, we create a nice Irrlicht Engine logo in the top left corner. + */ + env->addImage(driver->getTexture("../../media/irrlichtlogo2.png"), + position2d(10,10)); + + + /* + That's all, we only have to draw everything. + */ + + while(device->run() && driver) + if (device->isWindowActive()) + { + driver->beginScene(true, true, SColor(0,200,200,200)); + + env->drawAll(); + + driver->endScene(); + } + + device->drop(); + + return 0; +} + +/* +**/ diff --git a/libraries/irrlicht-1.8.1/examples/05.UserInterface/tutorial.html b/libraries/irrlicht-1.8.1/examples/05.UserInterface/tutorial.html new file mode 100644 index 0000000..3f3614f --- /dev/null +++ b/libraries/irrlicht-1.8.1/examples/05.UserInterface/tutorial.html @@ -0,0 +1,225 @@ + + +Irrlicht Engine Tutorial + + + + +
+ + + + + + + + +
+
+
+
Tutorial 5.User Interface
+
+
+
+

This tutorial shows how to use the built in User Interface of the Irrlicht + Engine. It will give a brief overview and show how to create and use + windows, buttons, scroll bars, static texts and list boxes.

+

The program which is described here will look like this:

+


+

+
+
+
+ + + + + + + +
+ Lets start!
+

As always, we include the header files (conio and curses for getting + user input from the console), and use the irrlicht namespaces. We also + store a pointer to the Irrlicht device, a counter variable for changing + the creation position of a window, and a pointer to a listbox.

+ + + + +
#include <irrlicht.h>
+#include <iostream>
+using namespace irr;
+
using namespace core;
+using namespace scene;
+using namespace video;
+using namespace io;
+using namespace gui;
+
#pragma comment(lib, "Irrlicht.lib")
+
IrrlichtDevice *device = 0;
+s32 cnt = 0;
+IGUIListBox* listbox = 0;
+
+

The Event Receiver is not only capable of getting keyboard and mouse + input events, but also events of the graphical user interface (gui). + There are events for almost everything: Button click, Listbox selection + change, events that say that a element was hovered and so on. To be + able to react to some of these events, we create
+ an event receiver. We only react to gui events, and if it's such an + event, we get the id of the caller (the gui element which caused the + event) and get the pointer to the gui environment.

+ + + + +
class MyEventReceiver : public IEventReceiver
{
public:
virtual bool OnEvent(const SEvent& event)
{
if (event.EventType == EET_GUI_EVENT)
{
s32 id = event.GUIEvent.Caller->getID();
IGUIEnvironment* env = device->getGUIEnvironment();
+
            switch(event.GUIEvent.EventType)
+            {
+
+

If a scrollbar changed its scroll position, and it is 'our' scrollbar + (the one with id 104), then we change the
+ transparency of all gui elements. This is a very easy task: There is + a skin object, in which all color settings are stored. We simply go + through all colors stored in the skin and change their alpha value. +

+ + + + +
case EGET_SCROLL_BAR_CHANGED:
if (id == 104)
{
s32 pos = ((IGUIScrollBar*)event.GUIEvent.Caller)->getPos();

for (s32 i=0; i<EGDC_COUNT ; ++i)
{
SColor col = env->getSkin()->getColor((EGUI_DEFAULT_COLOR)i);
col.setAlpha(pos);
env->getSkin()->setColor((EGUI_DEFAULT_COLOR)i, col);
}
}
break;
+

If a button was clicked, it could be one of 'our' three buttons. If + it is the first, we shut down the engine.
+ If it is the second, we create a little window with some text on it. + We also add a string to the list box to log
+ what happened. And if it is the third button, we create a file open + dialog, and add also this as string to the list box.
+ That's all for the event receiver.

+ + + + +
+
       case EGET_BUTTON_CLICKED:
+              if (id == 101)
+              {
+                 device->closeDevice();
+                 return true;
+              }
+
              if (id == 102)
+              {
+                 listbox->addItem(L"Window created");
+                 cnt += 30;
+                 if (cnt > 200) 
+                   cnt = 0;
+
                 IGUIWindow* window = env->addWindow(
+                       rect<s32>(100 + cnt, 100 + cnt, 300 + cnt, 200 + cnt), 
false, // modal? + L"Test window");
+
                 env->addStaticText(L"Please close me", 
+                       rect<s32>(35,35,140,50),
+                       true, // border?,
+                       false, // wordwrap?
+                       window);
+
+                 return true;
+              }
+
              if (id == 103)
+              {
+                 listbox->addItem(L"File open");
+                 env->addFileOpenDialog(L"Please choose a file.");
+                 return true;
+              }
+
              break;
+          }
+       }
+       return false;
+    }
+ };
+
+

Ok, now for the more interesting part. First, create the Irrlicht device. + As in some examples before, we ask the user which driver he wants to + use for this example:

+
+ + + + +
int main()
+{
+  // ask user for driver
+  video::E_DRIVER_TYPE driverType;
+
+
+  printf("Please select the driver you want for this example:\n"\
" (a) Direct3D 9.0c\n (b) Direct3D 8.1\n (c) OpenGL 1.5\n"\
" (d) Software Renderer\n (e) Apfelbaum Software Renderer\n"\
" (f) NullDevice\n (otherKey) exit\n\n");

char i;
std::cin >> i;
+ switch(i)
{
case 'a': driverType = video::EDT_DIRECT3D9;break;
case 'b': driverType = video::EDT_DIRECT3D8;break;
case 'c': driverType = video::EDT_OPENGL; break;
case 'd': driverType = video::EDT_SOFTWARE; break;
case 'e': driverType = video::EDT_BURNINGSVIDEO;break;
case 'f': driverType = video::EDT_NULL; break;
default: return 1;
} + + // create device and exit if creation failed + device = createDevice(driverType, core::dimension2d<s32>(640, 480));
+ if (device == 0) + return 1; +
+
+

The creation was successful, now we set the event receiver and store + pointers to the driver and to the gui environment.

+ + + + +
MyEventReceiver receiver;
+device->setEventReceiver(&receiver);
+device->setWindowCaption(L"Irrlicht Engine - User Inferface Demo");
+
video::IVideoDriver* driver = device->getVideoDriver();
+IGUIEnvironment* env = device->getGUIEnvironment();
+
+
+

We add three buttons. The first one closes the engine. The second creates + a window and the third opens a file open dialog. The third parameter is + the id of the button, with which we can easily identify the button in + the event receiver.

+ + + + +
env->addButton(rect<s32>(10,240,100,270), 0, 101, L"Quit");
env->addButton(rect<s32>(10,280,100,320), 0, 102, L"New Window");
env->addButton(rect<s32>(10,330,100,370), 0, 103, L"File Open");
+

Now, we add a static text and a scrollbar, which modifies the transparency + of all gui elements. We set the maximum value of the scrollbar to 255, + because that's the maximal value for a color value.
+ Then we create an other static text and a list box.

+ + + + +
env->addStaticText(L"Transparent Control:", rect<s32>(150,20,350,40), true);
IGUIScrollBar* scrollbar = env->addScrollBar(true, + rect<s32>(150, 45, 350, 60), 0, 104);
scrollbar->setMax(255);
+
env->addStaticText(L"Logging ListBox:", rect<s32>(50,110,250,130), true);
+listbox = env->addListBox(rect<s32>(50, 140, 250, 210));
+
+ To make the font a little bit nicer, we load an external font and set it + as new font in the skin. An at last, we create a nice Irrlicht Engine logo + in the top left corner.
+
+ + + + +
IGUISkin* skin = env->getSkin();
IGUIFont* font = env->getFont("../../media/fonthaettenschweiler.bmp");
if (font)
skin->setFont(font);
+
IGUIImage* img = env->addImage(
driver->getTexture("../../media/irrlichtlogoalpha.tga"),
position2d<int>(10,10));
+

That's all, we only have to draw everything.

+ + + + +
+
  while(device->run() && driver)
if (device->isWindowActive())
{
driver->beginScene(true, true, SColor(0,122,65,171)); + env->drawAll(); + driver->endScene(); + } + + device->drop();
+
  return 0;
+}
+
+ +
+

 

+ + diff --git a/libraries/irrlicht-1.8.1/examples/06.2DGraphics/2DGraphics.cbp b/libraries/irrlicht-1.8.1/examples/06.2DGraphics/2DGraphics.cbp new file mode 100644 index 0000000..0433c93 --- /dev/null +++ b/libraries/irrlicht-1.8.1/examples/06.2DGraphics/2DGraphics.cbp @@ -0,0 +1,55 @@ + + + + + + diff --git a/libraries/irrlicht-1.8.1/examples/06.2DGraphics/2DGraphics.dev b/libraries/irrlicht-1.8.1/examples/06.2DGraphics/2DGraphics.dev new file mode 100644 index 0000000..93694f1 --- /dev/null +++ b/libraries/irrlicht-1.8.1/examples/06.2DGraphics/2DGraphics.dev @@ -0,0 +1,59 @@ +[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/libraries/irrlicht-1.8.1/examples/06.2DGraphics/2DGraphics.vcproj b/libraries/irrlicht-1.8.1/examples/06.2DGraphics/2DGraphics.vcproj new file mode 100644 index 0000000..b21c351 --- /dev/null +++ b/libraries/irrlicht-1.8.1/examples/06.2DGraphics/2DGraphics.vcproj @@ -0,0 +1,163 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/libraries/irrlicht-1.8.1/examples/06.2DGraphics/2DGraphics_vc10.vcxproj b/libraries/irrlicht-1.8.1/examples/06.2DGraphics/2DGraphics_vc10.vcxproj new file mode 100644 index 0000000..b0f184e --- /dev/null +++ b/libraries/irrlicht-1.8.1/examples/06.2DGraphics/2DGraphics_vc10.vcxproj @@ -0,0 +1,231 @@ + + + + + Debug + Win32 + + + Debug + x64 + + + Release + Win32 + + + Release + x64 + + + + 06.2DGraphics + {E71B6F18-10DC-4101-A541-F6D33F71B2BD} + 2DGraphics + + + + Application + false + MultiByte + + + Application + false + MultiByte + + + Application + false + MultiByte + + + Application + false + MultiByte + + + + + + + + + + + + + + + + + + + + + + + <_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/libraries/irrlicht-1.8.1/examples/06.2DGraphics/2DGraphics_vc11.vcxproj b/libraries/irrlicht-1.8.1/examples/06.2DGraphics/2DGraphics_vc11.vcxproj new file mode 100644 index 0000000..66e7aa0 --- /dev/null +++ b/libraries/irrlicht-1.8.1/examples/06.2DGraphics/2DGraphics_vc11.vcxproj @@ -0,0 +1,235 @@ + + + + + Debug + Win32 + + + Debug + x64 + + + Release + Win32 + + + Release + x64 + + + + 06.2DGraphics + {E71B6F18-10DC-4101-A541-F6D33F71B2BD} + 2DGraphics + + + + Application + false + MultiByte + v110 + + + Application + false + MultiByte + v110 + + + Application + false + MultiByte + v110 + + + Application + false + MultiByte + v110 + + + + + + + + + + + + + + + + + + + + + + + <_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/libraries/irrlicht-1.8.1/examples/06.2DGraphics/2DGraphics_vc8.vcproj b/libraries/irrlicht-1.8.1/examples/06.2DGraphics/2DGraphics_vc8.vcproj new file mode 100644 index 0000000..8a10914 --- /dev/null +++ b/libraries/irrlicht-1.8.1/examples/06.2DGraphics/2DGraphics_vc8.vcproj @@ -0,0 +1,231 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/libraries/irrlicht-1.8.1/examples/06.2DGraphics/2DGraphics_vc9.vcproj b/libraries/irrlicht-1.8.1/examples/06.2DGraphics/2DGraphics_vc9.vcproj new file mode 100644 index 0000000..e78f8a0 --- /dev/null +++ b/libraries/irrlicht-1.8.1/examples/06.2DGraphics/2DGraphics_vc9.vcproj @@ -0,0 +1,230 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/libraries/irrlicht-1.8.1/examples/06.2DGraphics/Makefile b/libraries/irrlicht-1.8.1/examples/06.2DGraphics/Makefile new file mode 100644 index 0000000..6e62b2b --- /dev/null +++ b/libraries/irrlicht-1.8.1/examples/06.2DGraphics/Makefile @@ -0,0 +1,38 @@ +# Makefile for Irrlicht Examples +# It's usually sufficient to change just the target name and source file list +# and be sure that CXX is set to a valid compiler +Target = 06.2DGraphics +Sources = main.cpp + +# general compiler settings +CPPFLAGS = -I../../include -I/usr/X11R6/include +CXXFLAGS = -O3 -ffast-math +#CXXFLAGS = -g -Wall + +#default target is Linux +all: all_linux + +ifeq ($(HOSTTYPE), x86_64) +LIBSELECT=64 +endif + +# target specific settings +all_linux: LDFLAGS = -L/usr/X11R6/lib$(LIBSELECT) -L../../lib/Linux -lIrrlicht -lGL -lXxf86vm -lXext -lX11 -lXcursor +all_linux clean_linux: SYSTEM=Linux +all_win32: LDFLAGS = -L../../lib/Win32-gcc -lIrrlicht -lopengl32 -lm +all_win32 clean_win32: SYSTEM=Win32-gcc +all_win32 clean_win32: SUF=.exe +# name of the binary - only valid for targets which set SYSTEM +DESTPATH = ../../bin/$(SYSTEM)/$(Target)$(SUF) + +all_linux all_win32: + $(warning Building...) + $(CXX) $(CPPFLAGS) $(CXXFLAGS) $(Sources) -o $(DESTPATH) $(LDFLAGS) + +clean: clean_linux clean_win32 + $(warning Cleaning...) + +clean_linux clean_win32: + @$(RM) $(DESTPATH) + +.PHONY: all all_win32 clean clean_linux clean_win32 diff --git a/libraries/irrlicht-1.8.1/examples/06.2DGraphics/main.cpp b/libraries/irrlicht-1.8.1/examples/06.2DGraphics/main.cpp new file mode 100644 index 0000000..40e311a --- /dev/null +++ b/libraries/irrlicht-1.8.1/examples/06.2DGraphics/main.cpp @@ -0,0 +1,166 @@ +/** Example 006 2D Graphics + +This Tutorial shows how to do 2d graphics with the Irrlicht Engine. +It shows how to draw images, keycolor based sprites, +transparent rectangles, and different fonts. You may consider +this useful if you want to make a 2d game with the engine, or if +you want to draw a cool interface or head up display for your 3d game. + +As always, I include the header files, use the irr namespace, +and tell the linker to link with the .lib file. +*/ +#include +#include "driverChoice.h" + +using namespace irr; + +#ifdef _MSC_VER +#pragma comment(lib, "Irrlicht.lib") +#endif + +/* +At first, we let the user select the driver type, then start up the engine, set +a caption, and get a pointer to the video driver. +*/ +int main() +{ + // ask user for driver + video::E_DRIVER_TYPE driverType=driverChoiceConsole(); + if (driverType==video::EDT_COUNT) + return 1; + + // create device + + IrrlichtDevice *device = createDevice(driverType, + core::dimension2d(512, 384)); + + if (device == 0) + return 1; // could not create selected driver. + + device->setWindowCaption(L"Irrlicht Engine - 2D Graphics Demo"); + + video::IVideoDriver* driver = device->getVideoDriver(); + + /* + 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 + load this texture and tell the engine, which part of it should be + transparent based on a colorkey. + + In this example, we don't tell it the color directly, we just say "Hey + Irrlicht Engine, you'll find the color I want at position (0,0) on the + texture.". Instead, it would be also possible to call + driver->makeColorKeyTexture(images, video::SColor(0,0,0,0)), to make + 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"); + driver->makeColorKeyTexture(images, core::position2d(0,0)); + + /* + To be able to draw some text with two different fonts, we first load + them. Ok, we load just one. As the first font we just use the default + font which is built into the engine. Also, we define two rectangles + which specify the position of the images of the red imps (little flying + creatures) in the texture. + */ + gui::IGUIFont* font = device->getGUIEnvironment()->getBuiltInFont(); + gui::IGUIFont* font2 = + device->getGUIEnvironment()->getFont("../../media/fonthaettenschweiler.bmp"); + + core::rect imp1(349,15,385,78); + core::rect imp2(387,15,423,78); + + /* + Prepare a nicely filtering 2d render mode for special cases. + */ + driver->getMaterial2D().TextureLayer[0].BilinearFilter=true; + driver->getMaterial2D().AntiAliasing=video::EAAM_FULL_BASIC; + + /* + Everything is prepared, now we can draw everything in the draw loop, + between the begin scene and end scene calls. In this example, we are + just doing 2d graphics, but it would be no problem to mix them with 3d + graphics. Just try it out, and draw some 3d vertices or set up a scene + with the scene manager and draw it. + */ + while(device->run() && driver) + { + if (device->isWindowActive()) + { + u32 time = device->getTimer()->getTime(); + + driver->beginScene(true, true, video::SColor(255,120,102,136)); + + /* + First, we draw 3 sprites, using the alpha channel we + created with makeColorKeyTexture. The last parameter + specifies that the drawing method should use this alpha + channel. The last-but-one parameter specifies a + color, with which the sprite should be colored. + (255,255,255,255) is full white, so the sprite will + look like the original. The third sprite is drawn + with the red channel modulated based on the time. + */ + + // draw fire & dragons background world + driver->draw2DImage(images, core::position2d(50,50), + core::rect(0,0,342,224), 0, + video::SColor(255,255,255,255), true); + + // draw flying imp + driver->draw2DImage(images, core::position2d(164,125), + (time/500 % 2) ? imp1 : imp2, 0, + video::SColor(255,255,255,255), true); + + // draw second flying imp with colorcylce + driver->draw2DImage(images, core::position2d(270,105), + (time/500 % 2) ? imp1 : imp2, 0, + video::SColor(255,(time) % 255,255,255), true); + + /* + Drawing text is really simple. The code should be self + explanatory. + */ + + // draw some text + if (font) + font->draw(L"This demo shows that Irrlicht is also capable of drawing 2D graphics.", + core::rect(130,10,300,50), + video::SColor(255,255,255,255)); + + // draw some other text + if (font2) + font2->draw(L"Also mixing with 3d graphics is possible.", + core::rect(130,20,300,60), + video::SColor(255,time % 255,time % 255,255)); + + /* + Next, we draw the Irrlicht Engine logo (without + using a color or an alpha channel). Since we slightly scale + the image we use the prepared filter mode. + */ + driver->enableMaterial2D(); + driver->draw2DImage(images, core::rect(10,10,108,48), + core::rect(354,87,442,118)); + driver->enableMaterial2D(false); + + /* + Finally draw a half-transparent rect under the mouse cursor. + */ + core::position2d m = device->getCursorControl()->getPosition(); + driver->draw2DRectangle(video::SColor(100,255,255,255), + core::rect(m.X-20, m.Y-20, m.X+20, m.Y+20)); + + driver->endScene(); + } + } + + device->drop(); + + return 0; +} + +/* +That's all. I hope it was not too difficult. +**/ diff --git a/libraries/irrlicht-1.8.1/examples/06.2DGraphics/tutorial.html b/libraries/irrlicht-1.8.1/examples/06.2DGraphics/tutorial.html new file mode 100644 index 0000000..ea6291a --- /dev/null +++ b/libraries/irrlicht-1.8.1/examples/06.2DGraphics/tutorial.html @@ -0,0 +1,163 @@ + + +Irrlicht Engine Tutorial + + + + +
+ + + + + + + + +
+
+
+
Tutorial 6. 2D Graphics
+
+
+
+

This Tutorial shows how to do 2d graphics with the Irrlicht Engine. + It shows how to draw images, keycolor based sprites, transparent rectangles + and different fonts. You will may consider this useful if you want to + make a 2d game with the engine, or if you want to draw a cool interface + or head up display for your 3d game.

+

The program which is described here will look like this:

+


+

+
+
+
+ + + + + + + +
+ Lets start!
+

As always, I include the header files, use the irr namespace, and tell + the linker to link with the .lib file.

+ + + + +
#include <irrlicht.h>
#include <iostream>

using namespace irr;
+
#pragma comment(lib, "Irrlicht.lib")
+               
+

At first, we let the user select the driver type, then start up the + engine, set a caption, and get a pointer to the video driver.

+ + + + +
int main()
{
// let user select driver type
video::E_DRIVER_TYPE driverType;

printf("Please select the driver you want for this example:\n"\
" (a) Direct3D 9.0c\n (b) Direct3D 8.1\n (c) OpenGL 1.5\n"\
" (d) Software Renderer\n (e) Apfelbaum Software Renderer\n"\
" (f) NullDevice\n (otherKey) exit\n\n");

char i;
std::cin >> i;

switch(i)
{
case 'a': driverType = video::EDT_DIRECT3D9;break;
case 'b': driverType = video::EDT_DIRECT3D8;break;
case 'c': driverType = video::EDT_OPENGL; break;
case 'd': driverType = video::EDT_SOFTWARE; break;
case 'e': driverType = video::EDT_BURNINGSVIDEO;break;
case 'f': driverType = video::EDT_NULL; break;
default: return 0;
}

// create device
+
  IrrlichtDevice *device = createDevice(driverType,
+         core::dimension2d<s32>(512, 384));
+
  if (device == 0)
+      return 1;
+ 
device->setWindowCaption(L"Irrlicht Engine - 2D Graphics Demo");
+
  video::IVideoDriver* driver = device->getVideoDriver();
+

All 2d graphics in this example are put together into one texture, + 2ddemo.bmp. Because we want to draw colorkey based sprites, we need + to load this texture and tell the engine, which part of it should be + transparent based on a colorkey. In this example, we don't tell it the + color directly, we just say "Hey Irrlicht Engine, you'll find the + color I want at position (0,0) on the texture.". Instead, it would + be also possible to call driver->makeColorKeyTexture(images, + video::SColor(0,0,0,0)), to make 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.bmp");
driver->makeColorKeyTexture(images, core::position2d<s32>(0,0));
+

To be able to draw some text with two different fonts, we load them. + Ok, we load just one, as first font we just use the default font which + is built into the engine.
+ Also, we define two rectangles, which specify the position of the images + of the red imps (little flying creatures) in the texture.

+ + + + +
gui::IGUIFont* font = device->getGUIEnvironment()->getBuiltInFont();
gui::IGUIFont* font2 = device->getGUIEnvironment()->getFont( + "../../media/fonthaettenschweiler.bmp");
+
core::rect<s32> imp1(349,15,385,78);
+core::rect<s32> imp2(387,15,423,78);
+

Everything is prepared, now we can draw everything in the draw loop, + between the begin scene and end scene calls. In this example, we are + just doing 2d graphics, but it would be no problem to mix them with + 3d graphics. Just try it out, and draw some 3d vertices or set up a + scene with the scene manager and draw it.

+
+ + + + +
while(device->run() && driver)
{
if (device->isWindowActive())
{
u32 time = device->getTimer()->getTime();
driver->beginScene(true, true, video::SColor(0,120,102,136)); +
+

First, we draw 3 sprites, using the alpha channel we created with makeColorKeyTexture. + The last parameter specifiys that the drawing method should use thiw alpha + channel. The parameter before the last one specifies a color, with wich + the sprite should be colored. (255,255,255,255) is full white, so the + sprite will look like the original. The third sprite is drawed colored + based on the time.

+ + + + +
// draw fire & dragons background world
driver->draw2DImage(images, core::position2d<s32>(50,50),
core::rect<s32>(0,0,342,224), 0,
video::SColor(255,255,255,255), true);
+
// draw flying imp 
+driver->draw2DImage(images, core::position2d<s32>(164,125),
+  (time/500 % 2) ? imp1 : imp2, 0, 
+   video::SColor(255,255,255,255), true);
+
// draw second flying imp with colorcylce
+driver->draw2DImage(images, core::position2d<s32>(270,105),
+  (time/500 % 2) ? imp1 : imp2, 0, 
+  video::SColor(255,(time) % 255,255,255), true);
+

Drawing text is really simple. The code should be self explanatory.

+ + + + +
// draw some text
if (font)
font->draw(L"This is some text.",
core::rect<s32>(130,10,300,50),
video::SColor(255,255,255,255));
+
// draw some other text
+if (font2)
+   font2->draw(L"This is some other text.", 
+       core::rect<s32>(130,20,300,60),
+       video::SColor(255,time % 255,time % 255,255));
+

At last, we draw the Irrlicht Engine logo (without using a color or an + alpha channel) and a transparent 2d Rectangle at the position of the mouse + cursor.

+ + + + +
    // draw logo
driver->draw2DImage(images, core::position2d<s32>(10,10),
core::rect<s32>(354,87,442,118));
+
    // draw transparent rect under cursor
+    core::position2d<s32> m = device->getCursorControl()->getPosition();
+    driver->draw2DRectangle(video::SColor(100,255,255,255),
+          core::rect<s32>(m.X-20, m.Y-20, m.X+20, m.Y+20));
+
    driver->endScene();
+  }
+}
+

That's all, it was not really difficult, I hope.

+ + + + +
   device->drop();
+   return 0;
+}
+
+

 

+

 

+ + diff --git a/libraries/irrlicht-1.8.1/examples/07.Collision/Collision.cbp b/libraries/irrlicht-1.8.1/examples/07.Collision/Collision.cbp new file mode 100644 index 0000000..0d7f828 --- /dev/null +++ b/libraries/irrlicht-1.8.1/examples/07.Collision/Collision.cbp @@ -0,0 +1,55 @@ + + + + + + diff --git a/libraries/irrlicht-1.8.1/examples/07.Collision/Collision.dev b/libraries/irrlicht-1.8.1/examples/07.Collision/Collision.dev new file mode 100644 index 0000000..c13a041 --- /dev/null +++ b/libraries/irrlicht-1.8.1/examples/07.Collision/Collision.dev @@ -0,0 +1,59 @@ +[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/libraries/irrlicht-1.8.1/examples/07.Collision/Collision.vcproj b/libraries/irrlicht-1.8.1/examples/07.Collision/Collision.vcproj new file mode 100644 index 0000000..a4e4b07 --- /dev/null +++ b/libraries/irrlicht-1.8.1/examples/07.Collision/Collision.vcproj @@ -0,0 +1,163 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/libraries/irrlicht-1.8.1/examples/07.Collision/Collision_vc10.vcxproj b/libraries/irrlicht-1.8.1/examples/07.Collision/Collision_vc10.vcxproj new file mode 100644 index 0000000..03a94c8 --- /dev/null +++ b/libraries/irrlicht-1.8.1/examples/07.Collision/Collision_vc10.vcxproj @@ -0,0 +1,231 @@ + + + + + Debug + Win32 + + + Debug + x64 + + + Release + Win32 + + + Release + x64 + + + + 07.Collision + {3E30297B-5BE3-4A5C-B31E-08A28ADDB29E} + Collision + + + + Application + false + MultiByte + + + Application + false + MultiByte + + + Application + false + MultiByte + + + Application + false + MultiByte + + + + + + + + + + + + + + + + + + + + + + + <_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/libraries/irrlicht-1.8.1/examples/07.Collision/Collision_vc11.vcxproj b/libraries/irrlicht-1.8.1/examples/07.Collision/Collision_vc11.vcxproj new file mode 100644 index 0000000..0db4b42 --- /dev/null +++ b/libraries/irrlicht-1.8.1/examples/07.Collision/Collision_vc11.vcxproj @@ -0,0 +1,235 @@ + + + + + Debug + Win32 + + + Debug + x64 + + + Release + Win32 + + + Release + x64 + + + + 07.Collision + {3E30297B-5BE3-4A5C-B31E-08A28ADDB29E} + Collision + + + + Application + false + MultiByte + v110 + + + Application + false + MultiByte + v110 + + + Application + false + MultiByte + v110 + + + Application + false + MultiByte + v110 + + + + + + + + + + + + + + + + + + + + + + + <_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/libraries/irrlicht-1.8.1/examples/07.Collision/Collision_vc8.vcproj b/libraries/irrlicht-1.8.1/examples/07.Collision/Collision_vc8.vcproj new file mode 100644 index 0000000..4a2b6c1 --- /dev/null +++ b/libraries/irrlicht-1.8.1/examples/07.Collision/Collision_vc8.vcproj @@ -0,0 +1,231 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/libraries/irrlicht-1.8.1/examples/07.Collision/Collision_vc9.vcproj b/libraries/irrlicht-1.8.1/examples/07.Collision/Collision_vc9.vcproj new file mode 100644 index 0000000..3cca93d --- /dev/null +++ b/libraries/irrlicht-1.8.1/examples/07.Collision/Collision_vc9.vcproj @@ -0,0 +1,230 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/libraries/irrlicht-1.8.1/examples/07.Collision/Makefile b/libraries/irrlicht-1.8.1/examples/07.Collision/Makefile new file mode 100644 index 0000000..6698725 --- /dev/null +++ b/libraries/irrlicht-1.8.1/examples/07.Collision/Makefile @@ -0,0 +1,38 @@ +# Makefile for Irrlicht Examples +# It's usually sufficient to change just the target name and source file list +# and be sure that CXX is set to a valid compiler +Target = 07.Collision +Sources = main.cpp + +# general compiler settings +CPPFLAGS = -I../../include -I/usr/X11R6/include +CXXFLAGS = -O3 -ffast-math +#CXXFLAGS = -g -Wall + +#default target is Linux +all: all_linux + +ifeq ($(HOSTTYPE), x86_64) +LIBSELECT=64 +endif + +# target specific settings +all_linux: LDFLAGS = -L/usr/X11R6/lib$(LIBSELECT) -L../../lib/Linux -lIrrlicht -lGL -lXxf86vm -lXext -lX11 -lXcursor +all_linux clean_linux: SYSTEM=Linux +all_win32: LDFLAGS = -L../../lib/Win32-gcc -lIrrlicht -lopengl32 -lm +all_win32 clean_win32: SYSTEM=Win32-gcc +all_win32 clean_win32: SUF=.exe +# name of the binary - only valid for targets which set SYSTEM +DESTPATH = ../../bin/$(SYSTEM)/$(Target)$(SUF) + +all_linux all_win32: + $(warning Building...) + $(CXX) $(CPPFLAGS) $(CXXFLAGS) $(Sources) -o $(DESTPATH) $(LDFLAGS) + +clean: clean_linux clean_win32 + $(warning Cleaning...) + +clean_linux clean_win32: + @$(RM) $(DESTPATH) + +.PHONY: all all_win32 clean clean_linux clean_win32 diff --git a/libraries/irrlicht-1.8.1/examples/07.Collision/main.cpp b/libraries/irrlicht-1.8.1/examples/07.Collision/main.cpp new file mode 100644 index 0000000..8387c49 --- /dev/null +++ b/libraries/irrlicht-1.8.1/examples/07.Collision/main.cpp @@ -0,0 +1,330 @@ +/** Example 007 Collision + +We will describe 2 methods: Automatic collision detection for moving through +3d worlds with stair climbing and sliding, and manual scene node and triangle +picking using a ray. In this case, we will use a ray coming out from the +camera, but you can use any ray. + +To start, we take the program from tutorial 2, which loads and displays a +quake 3 level. We will use the level to walk in it and to pick triangles from. +In addition we'll place 3 animated models into it for triangle picking. The +following code starts up the engine and loads the level, as per tutorial 2. +*/ +#include +#include "driverChoice.h" + +using namespace irr; + +#ifdef _MSC_VER +#pragma comment(lib, "Irrlicht.lib") +#endif + +enum +{ + // I use this ISceneNode ID to indicate a scene node that is + // not pickable by getSceneNodeAndCollisionPointFromRay() + ID_IsNotPickable = 0, + + // I use this flag in ISceneNode IDs to indicate that the + // scene node can be picked by ray selection. + IDFlag_IsPickable = 1 << 0, + + // I use this flag in ISceneNode IDs to indicate that the + // scene node can be highlighted. In this example, the + // homonids can be highlighted, but the level mesh can't. + IDFlag_IsHighlightable = 1 << 1 +}; + +int main() +{ + // ask user for driver + video::E_DRIVER_TYPE driverType=driverChoiceConsole(); + if (driverType==video::EDT_COUNT) + return 1; + + // create device + + IrrlichtDevice *device = + createDevice(driverType, core::dimension2d(640, 480), 16, false); + + if (device == 0) + return 1; // could not create selected driver. + + video::IVideoDriver* driver = device->getVideoDriver(); + scene::ISceneManager* smgr = device->getSceneManager(); + + device->getFileSystem()->addFileArchive("../../media/map-20kdm2.pk3"); + + scene::IAnimatedMesh* q3levelmesh = smgr->getMesh("20kdm2.bsp"); + scene::IMeshSceneNode* q3node = 0; + + // The Quake mesh is pickable, but doesn't get highlighted. + if (q3levelmesh) + q3node = smgr->addOctreeSceneNode(q3levelmesh->getMesh(0), 0, IDFlag_IsPickable); + + /* + So far so good, we've loaded the quake 3 level like in tutorial 2. Now, + here comes something different: We create a triangle selector. A + triangle selector is a class which can fetch the triangles from scene + nodes for doing different things with them, for example collision + detection. There are different triangle selectors, and all can be + created with the ISceneManager. In this example, we create an + OctreeTriangleSelector, which optimizes the triangle output a little + bit by reducing it like an octree. This is very useful for huge meshes + like quake 3 levels. After we created the triangle selector, we attach + it to the q3node. This is not necessary, but in this way, we do not + need to care for the selector, for example dropping it after we do not + need it anymore. + */ + + scene::ITriangleSelector* selector = 0; + + if (q3node) + { + q3node->setPosition(core::vector3df(-1350,-130,-1400)); + + selector = smgr->createOctreeTriangleSelector( + q3node->getMesh(), q3node, 128); + q3node->setTriangleSelector(selector); + // We're not done with this selector yet, so don't drop it. + } + + + /* + We add a first person shooter camera to the scene so that we can see and + move in the quake 3 level like in tutorial 2. But this, time, we add a + special animator to the camera: A Collision Response animator. This + animator modifies the scene node to which it is attached to in order to + prevent it moving through walls, and to add gravity to it. The + only thing we have to tell the animator is how the world looks like, + how big the scene node is, how much gravity to apply and so on. After the + collision response animator is attached to the camera, we do not have to do + anything more for collision detection, anything is done automatically. + The rest of the collision detection code below is for picking. And please + note another cool feature: The collision response animator can be + attached also to all other scene nodes, not only to cameras. And it can + be mixed with other scene node animators. In this way, collision + detection and response in the Irrlicht engine is really easy. + + Now we'll take a closer look on the parameters of + createCollisionResponseAnimator(). The first parameter is the + TriangleSelector, which specifies how the world, against collision + detection is done looks like. The second parameter is the scene node, + which is the object, which is affected by collision detection, in our + case it is the camera. The third defines how big the object is, it is + the radius of an ellipsoid. Try it out and change the radius to smaller + values, the camera will be able to move closer to walls after this. The + next parameter is the direction and speed of gravity. We'll set it to + (0, -10, 0), which approximates to realistic gravity, assuming that our + units are metres. You could set it to (0,0,0) to disable gravity. And the + last value is just a translation: Without this, the ellipsoid with which + collision detection is done would be around the camera, and the camera would + be in the middle of the ellipsoid. But as human beings, we are used to have our + eyes on top of the body, with which we collide with our world, not in + the middle of it. So we place the scene node 50 units over the center + of the ellipsoid with this parameter. And that's it, collision + detection works now. + */ + + // Set a jump speed of 3 units per second, which gives a fairly realistic jump + // when used with the gravity of (0, -10, 0) in the collision response animator. + scene::ICameraSceneNode* camera = + smgr->addCameraSceneNodeFPS(0, 100.0f, .3f, ID_IsNotPickable, 0, 0, true, 3.f); + camera->setPosition(core::vector3df(50,50,-60)); + camera->setTarget(core::vector3df(-70,30,-60)); + + if (selector) + { + scene::ISceneNodeAnimator* anim = smgr->createCollisionResponseAnimator( + selector, camera, core::vector3df(30,50,30), + core::vector3df(0,-10,0), core::vector3df(0,30,0)); + selector->drop(); // As soon as we're done with the selector, drop it. + camera->addAnimator(anim); + anim->drop(); // And likewise, drop the animator when we're done referring to it. + } + + // Now I create three animated characters which we can pick, a dynamic light for + // lighting them, and a billboard for drawing where we found an intersection. + + // First, let's get rid of the mouse cursor. We'll use a billboard to show + // what we're looking at. + device->getCursorControl()->setVisible(false); + + // Add the billboard. + scene::IBillboardSceneNode * bill = smgr->addBillboardSceneNode(); + bill->setMaterialType(video::EMT_TRANSPARENT_ADD_COLOR ); + bill->setMaterialTexture(0, driver->getTexture("../../media/particle.bmp")); + bill->setMaterialFlag(video::EMF_LIGHTING, false); + bill->setMaterialFlag(video::EMF_ZBUFFER, false); + bill->setSize(core::dimension2d(20.0f, 20.0f)); + bill->setID(ID_IsNotPickable); // This ensures that we don't accidentally ray-pick it + + /* Add 3 animated hominids, which we can pick using a ray-triangle intersection. + They all animate quite slowly, to make it easier to see that accurate triangle + selection is being performed. */ + scene::IAnimatedMeshSceneNode* node = 0; + + video::SMaterial material; + + // Add an MD2 node, which uses vertex-based animation. + node = smgr->addAnimatedMeshSceneNode(smgr->getMesh("../../media/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.Lighting = true; + material.NormalizeNormals = true; + node->getMaterial(0) = material; + + // Now create a triangle selector for it. The selector will know that it + // is associated with an animated node, and will update itself as necessary. + selector = smgr->createTriangleSelector(node); + node->setTriangleSelector(selector); + 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"), + 0, IDFlag_IsPickable | IDFlag_IsHighlightable); + node->setScale(core::vector3df(10)); + node->setPosition(core::vector3df(-75,-66,-80)); + node->setRotation(core::vector3df(0,90,0)); + node->setAnimationSpeed(8.f); + node->getMaterial(0).NormalizeNormals = true; + node->getMaterial(0).Lighting = true; + // Just do the same as we did above. + selector = smgr->createTriangleSelector(node); + node->setTriangleSelector(selector); + selector->drop(); + + // This X files uses skeletal animation, but without skinning. + node = smgr->addAnimatedMeshSceneNode(smgr->getMesh("../../media/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. + node->setAnimationSpeed(20.f); + node->getMaterial(0).Lighting = true; + selector = smgr->createTriangleSelector(node); + node->setTriangleSelector(selector); + selector->drop(); + + + // And this mdl file uses skinned skeletal animation. + node = smgr->addAnimatedMeshSceneNode(smgr->getMesh("../../media/yodan.mdl"), + 0, IDFlag_IsPickable | IDFlag_IsHighlightable); + node->setPosition(core::vector3df(-90,-25,20)); + node->setScale(core::vector3df(0.8f)); + node->getMaterial(0).Lighting = true; + node->setAnimationSpeed(20.f); + + // Just do the same as we did above. + selector = smgr->createTriangleSelector(node); + node->setTriangleSelector(selector); + selector->drop(); + + material.setTexture(0, 0); + material.Lighting = false; + + // Add a light, so that the unselected nodes aren't completely dark. + scene::ILightSceneNode * light = smgr->addLightSceneNode(0, core::vector3df(-60,100,400), + video::SColorf(1.0f,1.0f,1.0f,1.0f), 600.0f); + light->setID(ID_IsNotPickable); // Make it an invalid target for selection. + + // Remember which scene node is highlighted + scene::ISceneNode* highlightedSceneNode = 0; + scene::ISceneCollisionManager* collMan = smgr->getSceneCollisionManager(); + int lastFPS = -1; + + // draw the selection triangle only as wireframe + material.Wireframe=true; + + while(device->run()) + if (device->isWindowActive()) + { + driver->beginScene(true, true, 0); + smgr->drawAll(); + + // Unlight any currently highlighted scene node + if (highlightedSceneNode) + { + highlightedSceneNode->setMaterialFlag(video::EMF_LIGHTING, true); + highlightedSceneNode = 0; + } + + // All intersections in this example are done with a ray cast out from the camera to + // a distance of 1000. You can easily modify this to check (e.g.) a bullet + // trajectory or a sword's position, or create a ray from a mouse click position using + // ISceneCollisionManager::getRayFromScreenCoordinates() + core::line3d ray; + ray.start = camera->getPosition(); + ray.end = ray.start + (camera->getTarget() - ray.start).normalize() * 1000.0f; + + // Tracks the current intersection point with the level or a mesh + core::vector3df intersection; + // Used to show with triangle has been hit + core::triangle3df hitTriangle; + + // This call is all you need to perform ray/triangle collision on every scene node + // that has a triangle selector, including the Quake level mesh. It finds the nearest + // collision point/triangle, and returns the scene node containing that point. + // Irrlicht provides other types of selection, including ray/triangle selector, + // ray/box and ellipse/triangle selector, plus associated helpers. + // See the methods of ISceneCollisionManager + scene::ISceneNode * selectedSceneNode = + collMan->getSceneNodeAndCollisionPointFromRay( + ray, + intersection, // This will be the position of the collision + hitTriangle, // This will be the triangle hit in the collision + IDFlag_IsPickable, // This ensures that only nodes that we have + // set up to be pickable are considered + 0); // Check the entire scene (this is actually the implicit default) + + // If the ray hit anything, move the billboard to the collision position + // and draw the triangle that was hit. + if(selectedSceneNode) + { + bill->setPosition(intersection); + + // We need to reset the transform before doing our own rendering. + driver->setTransform(video::ETS_WORLD, core::matrix4()); + driver->setMaterial(material); + driver->draw3DTriangle(hitTriangle, video::SColor(0,255,0,0)); + + // We can check the flags for the scene node that was hit to see if it should be + // highlighted. The animated nodes can be highlighted, but not the Quake level mesh + if((selectedSceneNode->getID() & IDFlag_IsHighlightable) == IDFlag_IsHighlightable) + { + highlightedSceneNode = selectedSceneNode; + + // Highlighting in this case means turning lighting OFF for this node, + // which means that it will be drawn with full brightness. + highlightedSceneNode->setMaterialFlag(video::EMF_LIGHTING, false); + } + } + + // We're all done drawing, so end the scene. + driver->endScene(); + + int fps = driver->getFPS(); + + if (lastFPS != fps) + { + core::stringw str = L"Collision detection example - Irrlicht Engine ["; + str += driver->getName(); + str += "] FPS:"; + str += fps; + + device->setWindowCaption(str.c_str()); + lastFPS = fps; + } + } + + device->drop(); + + return 0; +} + +/* +**/ + diff --git a/libraries/irrlicht-1.8.1/examples/07.Collision/tutorial.html b/libraries/irrlicht-1.8.1/examples/07.Collision/tutorial.html new file mode 100644 index 0000000..c04fce9 --- /dev/null +++ b/libraries/irrlicht-1.8.1/examples/07.Collision/tutorial.html @@ -0,0 +1,308 @@ + + +Irrlicht Engine Tutorial + + + + +
+ + + + + + + + +
+
+
+
Tutorial 7. Collision detection + and response
+
+
+
+

In this tutorial, I will show how to collision detection with the Irrlicht + Engine. I will describe 3 methods: Automatic collision detection for + moving through 3d worlds with stair climbing and sliding, manual triangle + picking and manual scene node picking.

+

The program which is described here will look like this:

+


+

+
+
+
+ + + + + + + +
+ Lets start!
+
+

To start, we take the program from tutorial 2, which loaded and displayed + a quake 3 level. We will use the level to walk in it and to pick triangles + from it. In addition we'll place 3 animated models into it for scene + node picking. The following code starts up the engine and loads a + quake 3 level. I will not explain it, because it should already be + known from tutorial 2.

+ + + + +
#include <irrlicht.h>
+#include <iostream>
+
using namespace irr; + +#pragma comment(lib, "Irrlicht.lib") + +int main() +{ + // let user select driver type +
video::E_DRIVER_TYPE driverType;

printf("Please select the driver you want for this example:\n"\
" (a) Direct3D 9.0c\n (b) Direct3D 8.1\n (c) OpenGL 1.5\n"\
" (d) Software Renderer\n (e) Apfelbaum Software Renderer\n"\
" (f) NullDevice\n (otherKey) exit\n\n");

char i;
std::cin >> i;

switch(i)
{
case 'a': driverType = video::EDT_DIRECT3D9;break;
case 'b': driverType = video::EDT_DIRECT3D8;break;
case 'c': driverType = video::EDT_OPENGL; break;
case 'd': driverType = video::EDT_SOFTWARE; break;
case 'e': driverType = video::EDT_BURNINGSVIDEO;break;
case 'f': driverType = video::EDT_NULL; break;
default: return 0;
}
+ // create device
+
  IrrlichtDevice *device = createDevice(driverType,
+     core::dimension2d<s32>(640, 480), 16, false);
+ if (device == 0)
return 1; // could not create selected driver.

video::IVideoDriver* driver = device->getVideoDriver();
scene::ISceneManager* smgr = device->getSceneManager();

device->getFileSystem()->addZipFileArchive
("../../media/map-20kdm2.pk3"); + + + scene::IAnimatedMesh* q3levelmesh = smgr->getMesh("20kdm2.bsp"); + scene::ISceneNode* q3node = 0; + + if (q3levelmesh) + q3node = smgr->addOctTreeSceneNode(q3levelmesh->getMesh(0)); +
+
+

So far so good, we've loaded the quake 3 level like in tutorial + 2. Now, here comes something different: We create a triangle selector. + A triangle selector is a class which can fetch the triangles from + scene nodes for doing different things with them, for example collision + detection. There are different triangle selectors, and all can be + created with the ISceneManager. In this example, we create an OctTreeTriangleSelector, + which optimizes the triangle output a little bit by reducing it like + an octree. This is very useful for huge meshes like quake 3 levels.
+ Afte we created the triangle selector, we attach it to the q3node. + This is not necessary, but in this way, we do not need to care for + the selector, for example dropping it after we do not need it anymore.

+ + + + +
scene::ITriangleSelector* selector = 0;
+	
+	if (q3node)
+	{		
+		q3node->setPosition(core::vector3df(-1370,-130,-1400));
+
+		selector = smgr->createOctTreeTriangleSelector(
+            q3levelmesh->getMesh(0), q3node, 128);
+		q3node->setTriangleSelector(selector);
+	}
+

We add a first person shooter camera to the scene for being able + to move in the quake 3 level like in tutorial 2. But this, time, we + add a special animator to the camera: A Collision Response animator. + This thing modifies the scene node to which it is attached to in that + way, that it may no more move through walls and is affected by gravity. + The only thing we have to tell the animator is how the world looks + like, how big the scene node is, how gravity and so on. After the + collision response animator is attached to the camera, we do not have + to do anything more for collision detection, anything is done automaticly, + all other collision detection code below is for picking. And please + note another cool feature: The collsion response animator can be attached + also to all other scene nodes, not only to cameras. And it can be + mixed with other scene node animators. In this way, collision detection + and response in the Irrlicht
+ engine is really, really easy.
+ Now we'll take a closer look on the parameters of createCollisionResponseAnimator(). + The first parameter is the TriangleSelector, which specifies how the + world, against collision detection is done looks like. The second + parameter is the scene node, which is the object, which is affected + by collision detection, in our case it is the camera. The third defines + how big the object is, it is the radius of an ellipsoid. Try it out + and change the radius to smaller values, the camera will be able to + move closer to walls after this. The next parameter is the direction + and speed of gravity. You could set it to (0,0,0) to disable gravity. + And the last value is just a translation: Without this, the ellipsoid + with which collision detection is done would be around the camera, + and the camera would be in the middle of the ellipsoid. But as human + beings, we are used to have our eyes on top of the body, with which + we collide with our world, not in the middle of it. So we place the + scene node 50 units over the center of the ellipsoid with this parameter. + And that's it, collision detection works now.
+

+ + + + +
	scene::ICameraSceneNode* camera = 	
camera = smgr->addCameraSceneNodeFPS(0,100.0f,300.0f); + camera->setPosition(core::vector3df(-100,50,-150)); + + scene::ISceneNodeAnimator* anim =
smgr->createCollisionResponseAnimator( + selector, camera, core::vector3df(30,50,30), + core::vector3df(0,-3,0), + core::vector3df(0,50,0));
+ selector->drop();
+ camera->addAnimator(anim); + anim->drop();
+

Because collision detection is no big deal in irrlicht, I'll describe + how to do two different types of picking in the next section. But + before this, I'll prepare the scene a little. I need three animated + characters which we
+ could pick later, a dynamic light for lighting them, a billboard for + drawing where we found an intersection, and, yes, I need to get rid + of this mouse cursor. :)

+ + + + +
	// disable mouse cursor
+
+	device->getCursorControl()->setVisible(false);
+
+	// add billboard
+
+	scene::IBillboardSceneNode * bill = smgr->addBillboardSceneNode();
+	bill->setMaterialType(video::EMT_TRANSPARENT_ADD_COLOR );
+	bill->setMaterialTexture(0, driver->getTexture(
"../../media/particle.bmp")); + bill->setMaterialFlag(video::EMF_LIGHTING, false); + bill->setSize(core::dimension2d<f32>(20.0f, 20.0f)); + + // add 3 animated faeries. + + video::SMaterial material; + material.Texture1 = driver->getTexture(
"../../media/faerie2.bmp"
); + material.Lighting = true; + + scene::IAnimatedMeshSceneNode* node = 0; + scene::IAnimatedMesh* faerie = smgr->getMesh(
"../../media/faerie.md2"); + + if (faerie) + { + node = smgr->addAnimatedMeshSceneNode(faerie); + node->setPosition(core::vector3df(-70,0,-90)); + node->setMD2Animation(scene::EMAT_RUN); + node->getMaterial(0) = material; + + node = smgr->addAnimatedMeshSceneNode(faerie); + node->setPosition(core::vector3df(-70,0,-30)); + node->setMD2Animation(scene::EMAT_SALUTE); + node->getMaterial(0) = material; + + node = smgr->addAnimatedMeshSceneNode(faerie); + node->setPosition(core::vector3df(-70,0,-60)); + node->setMD2Animation(scene::EMAT_JUMP); + node->getMaterial(0) = material; + } + + material.Texture1 = 0; + material.Lighting = false; + + // Add a light + + smgr->addLightSceneNode(0, core::vector3df(-60,100,400), + video::SColorf(1.0f,1.0f,1.0f,1.0f), + 600.0f);
+

For not making it to complicated, I'm doing picking inside the drawing + loop. We take two pointers for storing the current and the last selected + scene node and start the loop.

+
+ + + + +
	scene::ISceneNode* selectedSceneNode = 0;
+	scene::ISceneNode* lastSelectedSceneNode = 0;
+
+	
+	int lastFPS = -1;
+
+	while(device->run())
if (device->isWindowActive()) + { + driver->beginScene(true, true, 0); + + smgr->drawAll();
+

After we've drawn the whole scene whit smgr->drawAll(), we'll do + the first picking: We want to know which triangle of the world we are + looking at. In addition, we want the exact point of the quake 3 level + we are looking at. For this, we create a 3d line starting at the position + of the camera and going through the lookAt-target of it. Then we ask + the collision manager if this line collides with a triangle of the world + stored in the triangle selector. If yes, we draw the 3d triangle and + set the position of the billboard to the intersection point.

+ + + + +
		core::line3d<f32> line;
+		line.start = camera->getPosition();
+		line.end = line.start +
+         (camera->getTarget() - line.start).normalize() * 1000.0f;
+
+		core::vector3df intersection;
+		core::triangle3df tri;
+
+		if (smgr->getSceneCollisionManager()->getCollisionPoint(
+			line, selector, intersection, tri))
+		{
+			bill->setPosition(intersection);
+				
+			driver->setTransform(video::ETS_WORLD, core::matrix4());
+			driver->setMaterial(material);
+			driver->draw3DTriangle(tri, video::SColor(0,255,0,0));
+		}
+

Another type of picking supported by the Irrlicht Engine is scene + node picking based on bouding boxes. Every scene node has got a bounding + box, and because of that, it's very fast for example to get the scene + node which the camera looks
+ at. Again, we ask the collision manager for this, and if we've got a + scene node, we highlight it by disabling Lighting in its material, if + it is not the billboard or the quake 3 level.

+ + + + +
		selectedSceneNode = smgr->getSceneCollisionManager()->
+          getSceneNodeFromCameraBB(camera);
+
+		if (lastSelectedSceneNode)
+			lastSelectedSceneNode->setMaterialFlag(
+                video::EMF_LIGHTING, true);
+
+		if (selectedSceneNode == q3node ||
+           selectedSceneNode == bill)
+			selectedSceneNode = 0;
+
+		if (selectedSceneNode)
+			selectedSceneNode->setMaterialFlag(
+               video::EMF_LIGHTING, false);
+
+		lastSelectedSceneNode = selectedSceneNode;
+

That's it, we just have to finish drawing.

+ + + + +
		driver->endScene();
+
+		int fps = driver->getFPS();
+
+		if (lastFPS != fps)
+		{
+		  core::stringw str = L"Collision detection example - Irrlicht Engine [";
str += driver->getName();
str += "] FPS:";
str += fps;

device->setWindowCaption(str.c_str());
lastFPS = fps;
} + } + + device->drop(); + + return 0; +} + +
+

 

+

 

+
+
+

 

+ + diff --git a/libraries/irrlicht-1.8.1/examples/08.SpecialFX/Makefile b/libraries/irrlicht-1.8.1/examples/08.SpecialFX/Makefile new file mode 100644 index 0000000..05b68ec --- /dev/null +++ b/libraries/irrlicht-1.8.1/examples/08.SpecialFX/Makefile @@ -0,0 +1,38 @@ +# Makefile for Irrlicht Examples +# It's usually sufficient to change just the target name and source file list +# and be sure that CXX is set to a valid compiler +Target = 08.SpecialFX +Sources = main.cpp + +# general compiler settings +CPPFLAGS = -I../../include -I/usr/X11R6/include +CXXFLAGS = -O3 -ffast-math +#CXXFLAGS = -g -Wall + +#default target is Linux +all: all_linux + +ifeq ($(HOSTTYPE), x86_64) +LIBSELECT=64 +endif + +# target specific settings +all_linux: LDFLAGS = -L/usr/X11R6/lib$(LIBSELECT) -L../../lib/Linux -lIrrlicht -lGL -lXxf86vm -lXext -lX11 -lXcursor +all_linux clean_linux: SYSTEM=Linux +all_win32: LDFLAGS = -L../../lib/Win32-gcc -lIrrlicht -lopengl32 -lm +all_win32 clean_win32: SYSTEM=Win32-gcc +all_win32 clean_win32: SUF=.exe +# name of the binary - only valid for targets which set SYSTEM +DESTPATH = ../../bin/$(SYSTEM)/$(Target)$(SUF) + +all_linux all_win32: + $(warning Building...) + $(CXX) $(CPPFLAGS) $(CXXFLAGS) $(Sources) -o $(DESTPATH) $(LDFLAGS) + +clean: clean_linux clean_win32 + $(warning Cleaning...) + +clean_linux clean_win32: + @$(RM) $(DESTPATH) + +.PHONY: all all_win32 clean clean_linux clean_win32 diff --git a/libraries/irrlicht-1.8.1/examples/08.SpecialFX/SpecialFX.cbp b/libraries/irrlicht-1.8.1/examples/08.SpecialFX/SpecialFX.cbp new file mode 100644 index 0000000..05243f4 --- /dev/null +++ b/libraries/irrlicht-1.8.1/examples/08.SpecialFX/SpecialFX.cbp @@ -0,0 +1,54 @@ + + + + + + diff --git a/libraries/irrlicht-1.8.1/examples/08.SpecialFX/SpecialFX.dev b/libraries/irrlicht-1.8.1/examples/08.SpecialFX/SpecialFX.dev new file mode 100644 index 0000000..b2c2f26 --- /dev/null +++ b/libraries/irrlicht-1.8.1/examples/08.SpecialFX/SpecialFX.dev @@ -0,0 +1,59 @@ +[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/libraries/irrlicht-1.8.1/examples/08.SpecialFX/SpecialFX.vcproj b/libraries/irrlicht-1.8.1/examples/08.SpecialFX/SpecialFX.vcproj new file mode 100644 index 0000000..e22266e --- /dev/null +++ b/libraries/irrlicht-1.8.1/examples/08.SpecialFX/SpecialFX.vcproj @@ -0,0 +1,163 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/libraries/irrlicht-1.8.1/examples/08.SpecialFX/SpecialFX_vc10.vcxproj b/libraries/irrlicht-1.8.1/examples/08.SpecialFX/SpecialFX_vc10.vcxproj new file mode 100644 index 0000000..c46d1c0 --- /dev/null +++ b/libraries/irrlicht-1.8.1/examples/08.SpecialFX/SpecialFX_vc10.vcxproj @@ -0,0 +1,231 @@ + + + + + Debug + Win32 + + + Debug + x64 + + + Release + Win32 + + + Release + x64 + + + + 08.SpecialFX + {C869BF55-B9D6-4980-BC92-60FA0CF8411A} + SpecialFX + + + + Application + false + MultiByte + + + Application + false + MultiByte + + + Application + false + MultiByte + + + Application + false + MultiByte + + + + + + + + + + + + + + + + + + + + + + + <_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/libraries/irrlicht-1.8.1/examples/08.SpecialFX/SpecialFX_vc11.vcxproj b/libraries/irrlicht-1.8.1/examples/08.SpecialFX/SpecialFX_vc11.vcxproj new file mode 100644 index 0000000..3e2e1c0 --- /dev/null +++ b/libraries/irrlicht-1.8.1/examples/08.SpecialFX/SpecialFX_vc11.vcxproj @@ -0,0 +1,235 @@ + + + + + Debug + Win32 + + + Debug + x64 + + + Release + Win32 + + + Release + x64 + + + + 08.SpecialFX + {C869BF55-B9D6-4980-BC92-60FA0CF8411A} + SpecialFX + + + + Application + false + MultiByte + v110 + + + Application + false + MultiByte + v110 + + + Application + false + MultiByte + v110 + + + Application + false + MultiByte + v110 + + + + + + + + + + + + + + + + + + + + + + + <_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/libraries/irrlicht-1.8.1/examples/08.SpecialFX/SpecialFX_vc8.vcproj b/libraries/irrlicht-1.8.1/examples/08.SpecialFX/SpecialFX_vc8.vcproj new file mode 100644 index 0000000..21dd96f --- /dev/null +++ b/libraries/irrlicht-1.8.1/examples/08.SpecialFX/SpecialFX_vc8.vcproj @@ -0,0 +1,231 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/libraries/irrlicht-1.8.1/examples/08.SpecialFX/SpecialFX_vc9.vcproj b/libraries/irrlicht-1.8.1/examples/08.SpecialFX/SpecialFX_vc9.vcproj new file mode 100644 index 0000000..29763e5 --- /dev/null +++ b/libraries/irrlicht-1.8.1/examples/08.SpecialFX/SpecialFX_vc9.vcproj @@ -0,0 +1,230 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/libraries/irrlicht-1.8.1/examples/08.SpecialFX/main.cpp b/libraries/irrlicht-1.8.1/examples/08.SpecialFX/main.cpp new file mode 100644 index 0000000..d8f32f7 --- /dev/null +++ b/libraries/irrlicht-1.8.1/examples/08.SpecialFX/main.cpp @@ -0,0 +1,308 @@ +/** Example 008 SpecialFX + +This tutorials describes how to do special effects. It shows how to use stencil +buffer shadows, the particle system, billboards, dynamic light, and the water +surface scene node. + +We start like in some tutorials before. Please note that this time, the +'shadows' flag in createDevice() is set to true, for we want to have a dynamic +shadow casted from an animated character. If this example runs too slow, +set it to false. The Irrlicht Engine checks if your hardware doesn't support +the stencil buffer, and disables shadows by itself, but just in case the demo +runs slow on your hardware. +*/ + +#include +#include +#include "driverChoice.h" + +using namespace irr; + +#ifdef _MSC_VER +#pragma comment(lib, "Irrlicht.lib") +#endif + +int main() +{ + // ask if user would like shadows + char i; + printf("Please press 'y' if you want to use realtime shadows.\n"); + + std::cin >> i; + + const bool shadows = (i == 'y'); + + // ask user for driver + video::E_DRIVER_TYPE driverType=driverChoiceConsole(); + if (driverType==video::EDT_COUNT) + return 1; + + + /* + Create device and exit if creation failed. We make the stencil flag + optional to avoid slow screen modes for runs without shadows. + */ + + IrrlichtDevice *device = + createDevice(driverType, core::dimension2d(640, 480), + 16, false, shadows); + + if (device == 0) + return 1; // could not create selected driver. + + video::IVideoDriver* driver = device->getVideoDriver(); + scene::ISceneManager* smgr = device->getSceneManager(); + + /* + For our environment, we load a .3ds file. It is a small room I modelled + with Anim8or and exported into the 3ds format because the Irrlicht + Engine does not support the .an8 format. I am a very bad 3d graphic + artist, and so the texture mapping is not very nice in this model. + Luckily I am a better programmer than artist, and so the Irrlicht + Engine is able to create a cool texture mapping for me: Just use the + mesh manipulator and create a planar texture mapping for the mesh. If + you want to see the mapping I made with Anim8or, uncomment this line. I + also did not figure out how to set the material right in Anim8or, it + has a specular light color which I don't really like. I'll switch it + off too with this code. + */ + + scene::IAnimatedMesh* mesh = smgr->getMesh("../../media/room.3ds"); + + smgr->getMeshManipulator()->makePlanarTextureMapping(mesh->getMesh(0), 0.004f); + + scene::ISceneNode* node = 0; + + node = smgr->addAnimatedMeshSceneNode(mesh); + node->setMaterialTexture(0, driver->getTexture("../../media/wall.jpg")); + node->getMaterial(0).SpecularColor.set(0,0,0,0); + + /* + Now, for the first special effect: Animated water. It works like this: + The WaterSurfaceSceneNode takes a mesh as input and makes it wave like + a water surface. And if we let this scene node use a nice material like + the EMT_REFLECTION_2_LAYER, it looks really cool. We are doing this + with the next few lines of code. As input mesh, we create a hill plane + mesh, without hills. But any other mesh could be used for this, you + could even use the room.3ds (which would look really strange) if you + want to. + */ + + mesh = smgr->addHillPlaneMesh( "myHill", + core::dimension2d(20,20), + core::dimension2d(40,40), 0, 0, + core::dimension2d(0,0), + core::dimension2d(10,10)); + + node = smgr->addWaterSurfaceSceneNode(mesh->getMesh(0), 3.0f, 300.0f, 30.0f); + node->setPosition(core::vector3df(0,7,0)); + + node->setMaterialTexture(0, driver->getTexture("../../media/stones.jpg")); + node->setMaterialTexture(1, driver->getTexture("../../media/water.jpg")); + + node->setMaterialType(video::EMT_REFLECTION_2_LAYER); + + /* + The second special effect is very basic, I bet you saw it already in + some Irrlicht Engine demos: A transparent billboard combined with a + dynamic light. We simply create a light scene node, let it fly around, + and to make it look more cool, we attach a billboard scene node to it. + */ + + // create light + + node = smgr->addLightSceneNode(0, core::vector3df(0,0,0), + video::SColorf(1.0f, 0.6f, 0.7f, 1.0f), 800.0f); + 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)); + node->setMaterialFlag(video::EMF_LIGHTING, false); + node->setMaterialType(video::EMT_TRANSPARENT_ADD_COLOR); + node->setMaterialTexture(0, driver->getTexture("../../media/particlewhite.bmp")); + + /* + The next special effect is a lot more interesting: A particle system. + The particle system in the Irrlicht Engine is quite modular and + extensible, but yet easy to use. There is a particle system scene node + into which you can put a particle emitter, which makes particles come out + of nothing. These emitters are quite flexible and usually have lots of + parameters like direction, amount, and color of the particles they + create. + + There are different emitters, for example a point emitter which lets + particles pop out at a fixed point. If the particle emitters available + in the engine are not enough for you, you can easily create your own + ones, you'll simply have to create a class derived from the + IParticleEmitter interface and attach it to the particle system using + setEmitter(). In this example we create a box particle emitter, which + creates particles randomly inside a box. The parameters define the box, + direction of the particles, minimal and maximal new particles per + second, color, and minimal and maximal lifetime of the particles. + + Because only with emitters particle system would be a little bit + boring, there are particle affectors which modify particles while + they fly around. Affectors can be added to a particle system for + simulating additional effects like gravity or wind. + The particle affector we use in this example is an affector which + modifies the color of the particles: It lets them fade out. Like the + particle emitters, additional particle affectors can also be + implemented by you, simply derive a class from IParticleAffector and + add it with addAffector(). + + After we set a nice material to the particle system, we have a cool + looking camp fire. By adjusting material, texture, particle emitter, + and affector parameters, it is also easily possible to create smoke, + rain, explosions, snow, and so on. + */ + + // create a particle system + + scene::IParticleSystemSceneNode* ps = + smgr->addParticleSystemSceneNode(false); + + scene::IParticleEmitter* em = ps->createBoxEmitter( + core::aabbox3d(-7,0,-7,7,1,7), // emitter size + core::vector3df(0.0f,0.06f,0.0f), // initial direction + 80,100, // emit rate + video::SColor(0,255,255,255), // darkest color + video::SColor(0,255,255,255), // brightest color + 800,2000,0, // min and max age, angle + core::dimension2df(10.f,10.f), // min size + core::dimension2df(20.f,20.f)); // max size + + ps->setEmitter(em); // this grabs the emitter + em->drop(); // so we can drop it here without deleting it + + scene::IParticleAffector* paf = ps->createFadeOutParticleAffector(); + + ps->addAffector(paf); // same goes for the affector + paf->drop(); + + ps->setPosition(core::vector3df(-70,60,40)); + 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->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; + tmp = "../../media/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 + into our world. For creating the shadow, we simply need to call + addShadowVolumeSceneNode(). The color of shadows is only adjustable + globally for all shadows, by calling ISceneManager::setShadowColor(). + Voila, here is our dynamic shadow. + + Because the character is a little bit too small for this scene, we make + it bigger using setScale(). And because the character is lighted by a + dynamic light, we need to normalize the normals to make the lighting on + it correct. This is always necessary if the scale of a dynamic lighted + model is not (1,1,1). Otherwise it would get too dark or too bright + because the normals will be scaled too. + */ + + // add animated character + + mesh = smgr->getMesh("../../media/dwarf.x"); + scene::IAnimatedMeshSceneNode* anode = 0; + + anode = smgr->addAnimatedMeshSceneNode(mesh); + anode->setPosition(core::vector3df(-50,20,-60)); + anode->setAnimationSpeed(15); + + // add shadow + anode->addShadowVolumeSceneNode(); + smgr->setShadowColor(video::SColor(150,0,0,0)); + + // make the model a little bit bigger and normalize its normals + // because of the scaling, for correct lighting + anode->setScale(core::vector3df(2,2,2)); + anode->setMaterialFlag(video::EMF_NORMALIZE_NORMALS, true); + + /* + Finally we simply have to draw everything, that's all. + */ + + scene::ICameraSceneNode* camera = smgr->addCameraSceneNodeFPS(); + camera->setPosition(core::vector3df(-50,50,-150)); + camera->setFarValue(10000.0f); // this increase a shadow visible range. + + // disable mouse cursor + device->getCursorControl()->setVisible(false); + + s32 lastFPS = -1; + + while(device->run()) + if (device->isWindowActive()) + { + driver->beginScene(true, true, 0); + + smgr->drawAll(); + + driver->endScene(); + + const s32 fps = driver->getFPS(); + + if (lastFPS != fps) + { + core::stringw str = L"Irrlicht Engine - SpecialFX example ["; + str += driver->getName(); + str += "] FPS:"; + str += fps; + + device->setWindowCaption(str.c_str()); + lastFPS = fps; + } + } + + device->drop(); + + return 0; +} + +/* +**/ diff --git a/libraries/irrlicht-1.8.1/examples/08.SpecialFX/tutorial.html b/libraries/irrlicht-1.8.1/examples/08.SpecialFX/tutorial.html new file mode 100644 index 0000000..8c1fc51 --- /dev/null +++ b/libraries/irrlicht-1.8.1/examples/08.SpecialFX/tutorial.html @@ -0,0 +1,278 @@ + + +Irrlicht Engine Tutorial + + + + +
+ + + + + + + + +
+
+
Tutorial 8. Special Effects
+
+
+
+

This tutorials describes how to do special effects. It shows how to + use stencil buffer shadows, the particle system, billboards, dynamic + light and the water surface scene node.

+

The program which is described here will look like this:

+


+

+
+
+
+ + + + + + + +
Lets start!
+
+

We start like in some tutorials before. Please note that this time, + the 'shadows' flag in createDevice() is set to true, for we want to + have a dynamic shadow casted from an animated character. If your this + example runs to slow, set it to false. The Irrlicht Engine checks + if your hardware doesn't support the stencil buffer, and disables + shadows by itself, but just in case the demo runs slow on your hardware.

+ + + + +
#include <irrlicht.h>
+#include <iostream>
+
using namespace irr; + +#pragma comment(lib, "Irrlicht.lib") + +int main() +{ + // ask user for driver
video::E_DRIVER_TYPE driverType;
+ printf("Please select the driver you want for this example:\n"\
" (a) Direct3D 9.0c\n (b) Direct3D 8.1\n (c) OpenGL 1.5\n"\
" (d) Software Renderer\n (e) Apfelbaum Software Renderer\n"\
" (f) NullDevice\n (otherKey) exit\n\n");

char i;
std::cin >> i;

switch(i)
{
case 'a': driverType = video::EDT_DIRECT3D9;break;
case 'b': driverType = video::EDT_DIRECT3D8;break;
case 'c': driverType = video::EDT_OPENGL; break;
case 'd': driverType = video::EDT_SOFTWARE; break;
case 'e': driverType = video::EDT_BURNINGSVIDEO;break;
case 'f': driverType = video::EDT_NULL; break;
default: return 1;
} + + // create device and exit if creation failed
IrrlichtDevice *device = createDevice(driverType, + core::dimension2d<s32>(640, 480), 16, false, true); + + if (device == 0) + return 1; + + video::IVideoDriver* driver = device->getVideoDriver(); + scene::ISceneManager* smgr = device->getSceneManager(); +
+
+

For our environment, we load a .3ds file. It is a small room I modelled + with Anim8or and exported it into the 3ds format because the Irrlicht + Engine did not support the .an8 format when I wrote this tutorial. + I am a very bad 3d graphic artist, and so the texture mapping is not + very nice in this model. Luckily I am a better programmer than artist, + and so the Irrlicht Engine is able to create a cool texture mapping + for me: Just use the mesh manipulator and create a planar texture + mapping for the mesh. If you want to see the mapping I made with Anim8or, + uncomment this line. I also did not figure out how to
+ set the material right in Anim8or, it has a specular light color + which I don't really
+ like. I'll switch it off too with this code.

+ + + + +
	scene::IAnimatedMesh* mesh = smgr->getMesh(
+		"../../media/room.3ds");
+
+	smgr->getMeshManipulator()->makePlanarTextureMapping(
+		mesh->getMesh(0), 0.008f);
+
+	scene::ISceneNode* node = 0;
+
+	node = smgr->addAnimatedMeshSceneNode(mesh);
+	node->setMaterialTexture(0,	driver->getTexture("../../media/wall.jpg"));
+	node->getMaterial(0).SpecularColor.set(0,0,0,0);
+

Now, for the first special effect: Animated water. It works like + this: The WaterSurfaceSceneNode takes a mesh as input and makes it + wave like a water surface. And if we let this scene node use a nice + material like the MT_REFLECTION_2_LAYER, it looks really cool. We + are doing this with the next few lines of code. As input mesh, we + create a hill plane mesh, without hills. But any other mesh could + be used for this, you could even use the room.3ds (which would look + really strange) if you wanted to.

+ + + + +
	mesh = smgr->addHillPlaneMesh("myHill",
+		core::dimension2d<f32>(20,20),
+		core::dimension2d<s32>(40,40), 0, 0,
+		core::dimension2d<f32>(0,0),
+		core::dimension2d<f32>(10,10));
+
+	node = smgr->addWaterSurfaceSceneNode(mesh->getMesh(0), 3.0f, 300.0f, 30.0f);
+	node->setPosition(core::vector3df(0,7,0));
+
+	node->setMaterialTexture(0,	driver->getTexture("../../media/stones.jpg"));
+	node->setMaterialTexture(1,	driver->getTexture("../../media/water.jpg"));
+
+	node->setMaterialType(video::EMT_REFLECTION_2_LAYER);
+
+

The second special effect is very basic, I bet you saw it already + in some Irrlicht Engine demos: A transparent billboard combined with + a dynamic light. We simply create a light scene node, let it fly around, + an to make it look more cool, we attach a billboard scene node to + it.

+ + + + +
	// create light
+
+	node = smgr->addLightSceneNode(0, core::vector3df(0,0,0), 
+		video::SColorf(1.0f, 0.6f, 0.7f, 1.0f), 600.0f);
+	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<f32>(50, 50));
+	node->setMaterialFlag(video::EMF_LIGHTING, false);
+	node->setMaterialType(video::EMT_TRANSPARENT_ADD_COLOR);
+	node->setMaterialTexture(0,	driver->getTexture("../../media/particlewhite.bmp"));
+
+
+

The next special effect is a lot more interesting: A particle system. + The particle system in the Irrlicht Engine is quit modular and extensible + and yet easy to use. There is a particle system scene node into which + you can put particle emitters, which make particles come out of nothing. + These emitters are quite flexible and usually have lots of parameters + like direction, amount and color of the particles they should create.
+ There are different emitters, for example a point emitter which lets + particles pop out at a fixed point. If the particle emitters available + in the engine are not enough for you, you can easily create your own + ones, you'll simply have to create a class derived from the IParticleEmitter + interface and attach it to the particle system using setEmitter().
+ In this example we create a box particle emitter, which creates particles + randomly inside a box. The parameters define the box, direction of + the particles, minimal and maximal new particles per second, color + and minimal and maximal livetime of the particles.

+

Because only with emitters particle system would be a little bit + boring, there are particle affectors, which modify particles during + they fly around. They can be added to the particle system, simulating + additional effects like gravity or wind. The particle affector we + use in this example is an affector, which modifies the color of the + particles: It lets them fade out. Like the particle emitters, additional + particle affectors can also be implemented by you, simply derive a + class from IParticleAffector and add it with addAffector(). After + we set a nice material to the particle system, we have a cool looking + camp fire. By adjusting material, texture, particle emitter and affector + parameters, it is also easily possible to create smoke, rain, explosions, + snow, and so on.
+

+
+ + + + +
	scene::IParticleSystemSceneNode* ps = 0;
+	ps = smgr->addParticleSystemSceneNode(false);
+	ps->setPosition(core::vector3df(-70,60,40));
+	ps->setScale(core::vector3df(2,2,2));
+
+	ps->setParticleSize(core::dimension2d<f32>(20.0f, 10.0f));
+
+	scene::IParticleEmitter* em = ps->createBoxEmitter(
+		core::aabbox3d<f32>(-7,0,-7,7,1,7), 
+		core::vector3df(0.0f,0.03f,0.0f),
+		80,100, 
+		video::SColor(0,255,255,255), video::SColor(0,255,255,255),
+		800,2000);
+
+	ps->setEmitter(em);
+	em->drop();
+
+	scene::IParticleAffector* paf = 
+		ps->createFadeOutParticleAffector();
+
+	ps->addAffector(paf);
+	paf->drop();
+
+	ps->setMaterialFlag(video::EMF_LIGHTING, false);
+	ps->setMaterialTexture(0, driver->getTexture("../../media/particle.bmp"));
+	ps->setMaterialType(video::EMT_TRANSPARENT_VERTEX_ALPHA);
+

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 into our world. For creating the shadow, we simply need to call addShadowVolumeSceneNode(). + The color of shadows is only adjustable globally for all shadows, by + calling ISceneManager::setShadowColor(). Voila, here is our dynamic + shadow.
+ Because the character is a little bit too small for this scene, we make + it bigger using setScale(). And because the character is lighted by + a dynamic light, we need to normalize the normals to make the lighting + on it correct. This is always necessary if the scale of a dynamic lighted + model is not (1,1,1). Otherwise it would get too dark or too bright + because the normals will be scaled too.

+ + + + +
	mesh = smgr->getMesh("../../media/dwarf.x");
+	scene::IAnimatedMeshSceneNode* anode = 0;
+
+	anode = smgr->addAnimatedMeshSceneNode(mesh);
+	anode->setPosition(core::vector3df(-50,20,-60));
+	anode->setAnimationSpeed(15);
+
+	// add shadow
+	anode->addShadowVolumeSceneNode();	
+	smgr->setShadowColor(video::SColor(220,0,0,0));
+
+	// make the model a little bit bigger and normalize its normals 
// because of this for correct lighting

anode->setScale(core::vector3df(2,2,2));
anode->setMaterialFlag(video::EMF_NORMALIZE_NORMALS, true);

+

Finally we simply have to draw everything, that's all.

+ + + + +
	scene::ICameraSceneNode* camera = smgr->addCameraSceneNodeFPS();
+	camera->setPosition(core::vector3df(-50,50,-150));
+
+
+	int lastFPS = -1;
+
+	while(device->run())
+	{
+		driver->beginScene(true, true, 0);
+
+		smgr->drawAll();
+
+		driver->endScene();
+
+		int fps = driver->getFPS();
+
+		if (lastFPS != fps)
+		{
+		  core::stringw str = L"Irrlicht Engine - SpecialFX example [";
str += driver->getName();
str += "] FPS:";
str += fps;

device->setWindowCaption(str.c_str());
lastFPS = fps;
} + } + + device->drop(); + + return 0; +} + +
+
+

 

+

 

+

 

+
+
+

 

+ + diff --git a/libraries/irrlicht-1.8.1/examples/09.Meshviewer/9.Meshviewer.rc b/libraries/irrlicht-1.8.1/examples/09.Meshviewer/9.Meshviewer.rc new file mode 100644 index 0000000..3208583 --- /dev/null +++ b/libraries/irrlicht-1.8.1/examples/09.Meshviewer/9.Meshviewer.rc @@ -0,0 +1,84 @@ +// Microsoft Visual C++ generated resource script. +// +#include "resource.h" + +#define APSTUDIO_READONLY_SYMBOLS +///////////////////////////////////////////////////////////////////////////// +// +// Generated from the TEXTINCLUDE 2 resource. +// +#include "afxres.h" + +///////////////////////////////////////////////////////////////////////////// +#undef APSTUDIO_READONLY_SYMBOLS + +///////////////////////////////////////////////////////////////////////////// +// English (U.S.) resources + +#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENU) +#ifdef _WIN32 +LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US +#pragma code_page(1252) +#endif //_WIN32 + +#ifdef APSTUDIO_INVOKED +///////////////////////////////////////////////////////////////////////////// +// +// TEXTINCLUDE +// + +1 TEXTINCLUDE +BEGIN + "resource.h\0" +END + +2 TEXTINCLUDE +BEGIN + "#include ""afxres.h""\r\n" + "\0" +END + +3 TEXTINCLUDE +BEGIN + "\r\n" + "\0" +END + +#endif // APSTUDIO_INVOKED + +#endif // English (U.S.) resources +///////////////////////////////////////////////////////////////////////////// + + +///////////////////////////////////////////////////////////////////////////// +// German (Austria) resources + +#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_DEA) +#ifdef _WIN32 +LANGUAGE LANG_GERMAN, SUBLANG_GERMAN_AUSTRIAN +#pragma code_page(1252) +#endif //_WIN32 + +///////////////////////////////////////////////////////////////////////////// +// +// Icon +// + +// Icon with lowest ID value placed first to ensure application icon +// remains consistent on all systems. +IDI_ICON1 ICON "icon.ico" +#endif // German (Austria) resources +///////////////////////////////////////////////////////////////////////////// + + + +#ifndef APSTUDIO_INVOKED +///////////////////////////////////////////////////////////////////////////// +// +// Generated from the TEXTINCLUDE 3 resource. +// + + +///////////////////////////////////////////////////////////////////////////// +#endif // not APSTUDIO_INVOKED + diff --git a/libraries/irrlicht-1.8.1/examples/09.Meshviewer/Makefile b/libraries/irrlicht-1.8.1/examples/09.Meshviewer/Makefile new file mode 100644 index 0000000..99fe9d0 --- /dev/null +++ b/libraries/irrlicht-1.8.1/examples/09.Meshviewer/Makefile @@ -0,0 +1,38 @@ +# Makefile for Irrlicht Examples +# It's usually sufficient to change just the target name and source file list +# and be sure that CXX is set to a valid compiler +Target = 09.Meshviewer +Sources = main.cpp + +# general compiler settings +CPPFLAGS = -I../../include -I/usr/X11R6/include +CXXFLAGS = -O3 -ffast-math +#CXXFLAGS = -g -Wall + +#default target is Linux +all: all_linux + +ifeq ($(HOSTTYPE), x86_64) +LIBSELECT=64 +endif + +# target specific settings +all_linux: LDFLAGS = -L/usr/X11R6/lib$(LIBSELECT) -L../../lib/Linux -lIrrlicht -lGL -lXxf86vm -lXext -lX11 -lXcursor +all_linux clean_linux: SYSTEM=Linux +all_win32: LDFLAGS = -L../../lib/Win32-gcc -lIrrlicht -lopengl32 -lm +all_win32 clean_win32: SYSTEM=Win32-gcc +all_win32 clean_win32: SUF=.exe +# name of the binary - only valid for targets which set SYSTEM +DESTPATH = ../../bin/$(SYSTEM)/$(Target)$(SUF) + +all_linux all_win32: + $(warning Building...) + $(CXX) $(CPPFLAGS) $(CXXFLAGS) $(Sources) -o $(DESTPATH) $(LDFLAGS) + +clean: clean_linux clean_win32 + $(warning Cleaning...) + +clean_linux clean_win32: + @$(RM) $(DESTPATH) + +.PHONY: all all_win32 clean clean_linux clean_win32 diff --git a/libraries/irrlicht-1.8.1/examples/09.Meshviewer/MeshViewer.dev b/libraries/irrlicht-1.8.1/examples/09.Meshviewer/MeshViewer.dev new file mode 100644 index 0000000..47416a1 --- /dev/null +++ b/libraries/irrlicht-1.8.1/examples/09.Meshviewer/MeshViewer.dev @@ -0,0 +1,59 @@ +[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/libraries/irrlicht-1.8.1/examples/09.Meshviewer/Meshviewer.cbp b/libraries/irrlicht-1.8.1/examples/09.Meshviewer/Meshviewer.cbp new file mode 100644 index 0000000..4600ffd --- /dev/null +++ b/libraries/irrlicht-1.8.1/examples/09.Meshviewer/Meshviewer.cbp @@ -0,0 +1,55 @@ + + + + + + diff --git a/libraries/irrlicht-1.8.1/examples/09.Meshviewer/Meshviewer.vcproj b/libraries/irrlicht-1.8.1/examples/09.Meshviewer/Meshviewer.vcproj new file mode 100644 index 0000000..4077b86 --- /dev/null +++ b/libraries/irrlicht-1.8.1/examples/09.Meshviewer/Meshviewer.vcproj @@ -0,0 +1,163 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/libraries/irrlicht-1.8.1/examples/09.Meshviewer/Meshviewer_vc10.vcxproj b/libraries/irrlicht-1.8.1/examples/09.Meshviewer/Meshviewer_vc10.vcxproj new file mode 100644 index 0000000..c9e9e97 --- /dev/null +++ b/libraries/irrlicht-1.8.1/examples/09.Meshviewer/Meshviewer_vc10.vcxproj @@ -0,0 +1,231 @@ + + + + + Debug + Win32 + + + Debug + x64 + + + Release + Win32 + + + Release + x64 + + + + 09.Meshviewer + {2AE24484-22FC-481B-9A40-7CD0DA5C8E06} + Meshviewer + + + + Application + false + MultiByte + + + Application + false + MultiByte + + + Application + false + MultiByte + + + Application + false + MultiByte + + + + + + + + + + + + + + + + + + + + + + + <_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/libraries/irrlicht-1.8.1/examples/09.Meshviewer/Meshviewer_vc11.vcxproj b/libraries/irrlicht-1.8.1/examples/09.Meshviewer/Meshviewer_vc11.vcxproj new file mode 100644 index 0000000..24ffe1e --- /dev/null +++ b/libraries/irrlicht-1.8.1/examples/09.Meshviewer/Meshviewer_vc11.vcxproj @@ -0,0 +1,235 @@ + + + + + Debug + Win32 + + + Debug + x64 + + + Release + Win32 + + + Release + x64 + + + + 09.Meshviewer + {2AE24484-22FC-481B-9A40-7CD0DA5C8E06} + Meshviewer + + + + Application + false + MultiByte + v110 + + + Application + false + MultiByte + v110 + + + Application + false + MultiByte + v110 + + + Application + false + MultiByte + v110 + + + + + + + + + + + + + + + + + + + + + + + <_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/libraries/irrlicht-1.8.1/examples/09.Meshviewer/Meshviewer_vc8.vcproj b/libraries/irrlicht-1.8.1/examples/09.Meshviewer/Meshviewer_vc8.vcproj new file mode 100644 index 0000000..0346771 --- /dev/null +++ b/libraries/irrlicht-1.8.1/examples/09.Meshviewer/Meshviewer_vc8.vcproj @@ -0,0 +1,231 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/libraries/irrlicht-1.8.1/examples/09.Meshviewer/Meshviewer_vc9.vcproj b/libraries/irrlicht-1.8.1/examples/09.Meshviewer/Meshviewer_vc9.vcproj new file mode 100644 index 0000000..f6a8038 --- /dev/null +++ b/libraries/irrlicht-1.8.1/examples/09.Meshviewer/Meshviewer_vc9.vcproj @@ -0,0 +1,230 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/libraries/irrlicht-1.8.1/examples/09.Meshviewer/icon.ico b/libraries/irrlicht-1.8.1/examples/09.Meshviewer/icon.ico new file mode 100644 index 0000000..49f8eab Binary files /dev/null and b/libraries/irrlicht-1.8.1/examples/09.Meshviewer/icon.ico differ diff --git a/libraries/irrlicht-1.8.1/examples/09.Meshviewer/main.cpp b/libraries/irrlicht-1.8.1/examples/09.Meshviewer/main.cpp new file mode 100644 index 0000000..b9dc550 --- /dev/null +++ b/libraries/irrlicht-1.8.1/examples/09.Meshviewer/main.cpp @@ -0,0 +1,1042 @@ +/** Example 009 Mesh Viewer + +This tutorial show how to create a more complex application with the engine. +We construct a simple mesh viewer using the user interface API and the +scene management of Irrlicht. The tutorial show how to create and use Buttons, +Windows, Toolbars, Menus, ComboBoxes, Tabcontrols, Editboxes, Images, +MessageBoxes, SkyBoxes, and how to parse XML files with the integrated XML +reader of the engine. + +We start like in most other tutorials: Include all necessary header files, add +a comment to let the engine be linked with the right .lib file in Visual +Studio, and declare some global variables. We also add two 'using namespace' +statements, so we do not need to write the whole names of all classes. In this +tutorial, we use a lot stuff from the gui namespace. +*/ +#include +#include "driverChoice.h" + +using namespace irr; +using namespace gui; + +#ifdef _MSC_VER +#pragma comment(lib, "Irrlicht.lib") +#endif + + +/* +Some global variables used later on +*/ +IrrlichtDevice *Device = 0; +core::stringc StartUpModelFile; +core::stringw MessageText; +core::stringw Caption; +scene::ISceneNode* Model = 0; +scene::ISceneNode* SkyBox = 0; +bool Octree=false; +bool UseLight=false; + +scene::ICameraSceneNode* Camera[2] = {0, 0}; + +// Values used to identify individual GUI elements +enum +{ + GUI_ID_DIALOG_ROOT_WINDOW = 0x10000, + + GUI_ID_X_SCALE, + GUI_ID_Y_SCALE, + GUI_ID_Z_SCALE, + + GUI_ID_OPEN_MODEL, + GUI_ID_SET_MODEL_ARCHIVE, + GUI_ID_LOAD_AS_OCTREE, + + GUI_ID_SKY_BOX_VISIBLE, + GUI_ID_TOGGLE_DEBUG_INFO, + + GUI_ID_DEBUG_OFF, + GUI_ID_DEBUG_BOUNDING_BOX, + GUI_ID_DEBUG_NORMALS, + GUI_ID_DEBUG_SKELETON, + GUI_ID_DEBUG_WIRE_OVERLAY, + GUI_ID_DEBUG_HALF_TRANSPARENT, + GUI_ID_DEBUG_BUFFERS_BOUNDING_BOXES, + GUI_ID_DEBUG_ALL, + + GUI_ID_MODEL_MATERIAL_SOLID, + GUI_ID_MODEL_MATERIAL_TRANSPARENT, + GUI_ID_MODEL_MATERIAL_REFLECTION, + + GUI_ID_CAMERA_MAYA, + GUI_ID_CAMERA_FIRST_PERSON, + + GUI_ID_POSITION_TEXT, + + GUI_ID_ABOUT, + GUI_ID_QUIT, + + GUI_ID_TEXTUREFILTER, + GUI_ID_SKIN_TRANSPARENCY, + GUI_ID_SKIN_ANIMATION_FPS, + + GUI_ID_BUTTON_SET_SCALE, + GUI_ID_BUTTON_SCALE_MUL10, + GUI_ID_BUTTON_SCALE_DIV10, + GUI_ID_BUTTON_OPEN_MODEL, + GUI_ID_BUTTON_SHOW_ABOUT, + GUI_ID_BUTTON_SHOW_TOOLBOX, + GUI_ID_BUTTON_SELECT_ARCHIVE, + + GUI_ID_ANIMATION_INFO, + + // And some magic numbers + MAX_FRAMERATE = 80, + DEFAULT_FRAMERATE = 30 +}; + + +/* +Toggle between various cameras +*/ +void setActiveCamera(scene::ICameraSceneNode* newActive) +{ + if (0 == Device) + return; + + scene::ICameraSceneNode * active = Device->getSceneManager()->getActiveCamera(); + active->setInputReceiverEnabled(false); + + newActive->setInputReceiverEnabled(true); + Device->getSceneManager()->setActiveCamera(newActive); +} + +/* + Set the skin transparency by changing the alpha values of all skin-colors +*/ +void setSkinTransparency(s32 alpha, irr::gui::IGUISkin * skin) +{ + for (s32 i=0; igetColor((EGUI_DEFAULT_COLOR)i); + col.setAlpha(alpha); + skin->setColor((EGUI_DEFAULT_COLOR)i, col); + } +} + +/* + Update the display of the model scaling +*/ +void updateScaleInfo(scene::ISceneNode* model) +{ + IGUIElement* toolboxWnd = Device->getGUIEnvironment()->getRootGUIElement()->getElementFromId(GUI_ID_DIALOG_ROOT_WINDOW, true); + if (!toolboxWnd) + return; + if (!model) + { + toolboxWnd->getElementFromId(GUI_ID_X_SCALE, true)->setText( L"-" ); + toolboxWnd->getElementFromId(GUI_ID_Y_SCALE, true)->setText( L"-" ); + toolboxWnd->getElementFromId(GUI_ID_Z_SCALE, true)->setText( L"-" ); + } + else + { + core::vector3df scale = model->getScale(); + toolboxWnd->getElementFromId(GUI_ID_X_SCALE, true)->setText( core::stringw(scale.X).c_str() ); + toolboxWnd->getElementFromId(GUI_ID_Y_SCALE, true)->setText( core::stringw(scale.Y).c_str() ); + toolboxWnd->getElementFromId(GUI_ID_Z_SCALE, true)->setText( core::stringw(scale.Z).c_str() ); + } +} + +/* +Function showAboutText() displays a messagebox with a caption and +a message text. The texts will be stored in the MessageText and Caption +variables at startup. +*/ +void showAboutText() +{ + // create modal message box with the text + // loaded from the xml file. + Device->getGUIEnvironment()->addMessageBox( + Caption.c_str(), MessageText.c_str()); +} + + +/* +Function loadModel() loads a model and displays it using an +addAnimatedMeshSceneNode and the scene manager. Nothing difficult. It also +displays a short message box, if the model could not be loaded. +*/ +void loadModel(const c8* fn) +{ + // modify the name if it a .pk3 file + + io::path filename(fn); + + io::path extension; + core::getFileNameExtension(extension, filename); + extension.make_lower(); + + // if a texture is loaded apply it to the current model.. + if (extension == ".jpg" || extension == ".pcx" || + extension == ".png" || extension == ".ppm" || + extension == ".pgm" || extension == ".pbm" || + extension == ".psd" || extension == ".tga" || + extension == ".bmp" || extension == ".wal" || + extension == ".rgb" || extension == ".rgba") + { + video::ITexture * texture = + Device->getVideoDriver()->getTexture( filename ); + if ( texture && Model ) + { + // always reload texture + Device->getVideoDriver()->removeTexture(texture); + texture = Device->getVideoDriver()->getTexture( filename ); + + Model->setMaterialTexture(0, texture); + } + return; + } + // if a archive is loaded add it to the FileArchive.. + else if (extension == ".pk3" || extension == ".zip" || extension == ".pak" || extension == ".npk") + { + Device->getFileSystem()->addFileArchive(filename.c_str()); + return; + } + + // load a model into the engine + + if (Model) + Model->remove(); + + Model = 0; + + if (extension==".irr") + { + core::array outNodes; + Device->getSceneManager()->loadScene(filename); + Device->getSceneManager()->getSceneNodesFromType(scene::ESNT_ANIMATED_MESH, outNodes); + if (outNodes.size()) + Model = outNodes[0]; + return; + } + + scene::IAnimatedMesh* m = Device->getSceneManager()->getMesh( filename.c_str() ); + + if (!m) + { + // model could not be loaded + + if (StartUpModelFile != filename) + Device->getGUIEnvironment()->addMessageBox( + Caption.c_str(), L"The model could not be loaded. " \ + L"Maybe it is not a supported file format."); + return; + } + + // set default material properties + + if (Octree) + Model = Device->getSceneManager()->addOctreeSceneNode(m->getMesh(0)); + else + { + scene::IAnimatedMeshSceneNode* animModel = Device->getSceneManager()->addAnimatedMeshSceneNode(m); + animModel->setAnimationSpeed(30); + Model = animModel; + } + Model->setMaterialFlag(video::EMF_LIGHTING, UseLight); + Model->setMaterialFlag(video::EMF_NORMALIZE_NORMALS, UseLight); +// Model->setMaterialFlag(video::EMF_BACK_FACE_CULLING, false); + Model->setDebugDataVisible(scene::EDS_OFF); + + // we need to uncheck the menu entries. would be cool to fake a menu event, but + // that's not so simple. so we do it brute force + gui::IGUIContextMenu* menu = (gui::IGUIContextMenu*)Device->getGUIEnvironment()->getRootGUIElement()->getElementFromId(GUI_ID_TOGGLE_DEBUG_INFO, true); + if (menu) + for(int item = 1; item < 6; ++item) + menu->setItemChecked(item, false); + updateScaleInfo(Model); +} + + +/* +Function createToolBox() creates a toolbox window. In this simple mesh +viewer, this toolbox only contains a tab control with three edit boxes for +changing the scale of the displayed model. +*/ +void createToolBox() +{ + // remove tool box if already there + IGUIEnvironment* env = Device->getGUIEnvironment(); + IGUIElement* root = env->getRootGUIElement(); + IGUIElement* e = root->getElementFromId(GUI_ID_DIALOG_ROOT_WINDOW, true); + if (e) + e->remove(); + + // create the toolbox window + IGUIWindow* wnd = env->addWindow(core::rect(600,45,800,480), + false, L"Toolset", 0, GUI_ID_DIALOG_ROOT_WINDOW); + + // create tab control and tabs + IGUITabControl* tab = env->addTabControl( + core::rect(2,20,800-602,480-7), wnd, true, true); + + IGUITab* t1 = tab->addTab(L"Config"); + + // add some edit boxes and a button to tab one + env->addStaticText(L"Scale:", + core::rect(10,20,60,45), false, false, t1); + env->addStaticText(L"X:", core::rect(22,48,40,66), false, false, t1); + env->addEditBox(L"1.0", core::rect(40,46,130,66), true, t1, GUI_ID_X_SCALE); + env->addStaticText(L"Y:", core::rect(22,82,40,96), false, false, t1); + env->addEditBox(L"1.0", core::rect(40,76,130,96), true, t1, GUI_ID_Y_SCALE); + env->addStaticText(L"Z:", core::rect(22,108,40,126), false, false, t1); + env->addEditBox(L"1.0", core::rect(40,106,130,126), true, t1, GUI_ID_Z_SCALE); + + env->addButton(core::rect(10,134,85,165), t1, GUI_ID_BUTTON_SET_SCALE, L"Set"); + + // quick scale buttons + env->addButton(core::rect(65,20,95,40), t1, GUI_ID_BUTTON_SCALE_MUL10, L"* 10"); + env->addButton(core::rect(100,20,130,40), t1, GUI_ID_BUTTON_SCALE_DIV10, L"* 0.1"); + + updateScaleInfo(Model); + + // add transparency control + env->addStaticText(L"GUI Transparency Control:", + core::rect(10,200,150,225), true, false, t1); + IGUIScrollBar* scrollbar = env->addScrollBar(true, + core::rect(10,225,150,240), t1, GUI_ID_SKIN_TRANSPARENCY); + scrollbar->setMax(255); + scrollbar->setPos(255); + + // add framerate control + env->addStaticText(L":", core::rect(10,240,150,265), true, false, t1); + env->addStaticText(L"Framerate:", + core::rect(12,240,75,265), false, false, t1); + // current frame info + env->addStaticText(L"", core::rect(75,240,200,265), false, false, t1, + GUI_ID_ANIMATION_INFO); + scrollbar = env->addScrollBar(true, + core::rect(10,265,150,280), t1, GUI_ID_SKIN_ANIMATION_FPS); + scrollbar->setMax(MAX_FRAMERATE); + scrollbar->setMin(-MAX_FRAMERATE); + scrollbar->setPos(DEFAULT_FRAMERATE); + scrollbar->setSmallStep(1); +} + +/* +Function updateToolBox() is called each frame to update dynamic information in +the toolbox. +*/ +void updateToolBox() +{ + IGUIEnvironment* env = Device->getGUIEnvironment(); + IGUIElement* root = env->getRootGUIElement(); + IGUIElement* dlg = root->getElementFromId(GUI_ID_DIALOG_ROOT_WINDOW, true); + if (!dlg ) + return; + + // update the info we have about the animation of the model + IGUIStaticText * aniInfo = (IGUIStaticText *)(dlg->getElementFromId(GUI_ID_ANIMATION_INFO, true)); + if (aniInfo) + { + if ( Model && scene::ESNT_ANIMATED_MESH == Model->getType() ) + { + scene::IAnimatedMeshSceneNode* animatedModel = (scene::IAnimatedMeshSceneNode*)Model; + + core::stringw str( (s32)core::round_(animatedModel->getAnimationSpeed()) ); + str += L" Frame: "; + str += core::stringw((s32)animatedModel->getFrameNr()); + aniInfo->setText(str.c_str()); + } + else + aniInfo->setText(L""); + } +} + +void onKillFocus() +{ + // Avoid that the FPS-camera continues moving when the user presses alt-tab while + // moving the camera. + const core::list& animators = Camera[1]->getAnimators(); + core::list::ConstIterator iter = animators.begin(); + while ( iter != animators.end() ) + { + if ( (*iter)->getType() == scene::ESNAT_CAMERA_FPS ) + { + // we send a key-down event for all keys used by this animator + scene::ISceneNodeAnimatorCameraFPS * fpsAnimator = static_cast(*iter); + const core::array& keyMap = fpsAnimator->getKeyMap(); + for ( irr::u32 i=0; i< keyMap.size(); ++i ) + { + irr::SEvent event; + event.EventType = EET_KEY_INPUT_EVENT; + event.KeyInput.Key = keyMap[i].KeyCode; + event.KeyInput.PressedDown = false; + fpsAnimator->OnEvent(event); + } + } + ++iter; + } +} + +/* +Function hasModalDialog() checks if we currently have a modal dialog open. +*/ +bool hasModalDialog() +{ + if ( !Device ) + return false; + IGUIEnvironment* env = Device->getGUIEnvironment(); + IGUIElement * focused = env->getFocus(); + while ( focused ) + { + if ( focused->isVisible() && focused->hasType(EGUIET_MODAL_SCREEN) ) + return true; + focused = focused->getParent(); + } + return false; +} + +/* +To get all the events sent by the GUI Elements, we need to create an event +receiver. This one is really simple. If an event occurs, it checks the id of +the caller and the event type, and starts an action based on these values. For +example, if a menu item with id GUI_ID_OPEN_MODEL was selected, it opens a file-open-dialog. +*/ +class MyEventReceiver : public IEventReceiver +{ +public: + virtual bool OnEvent(const SEvent& event) + { + // Escape swaps Camera Input + if (event.EventType == EET_KEY_INPUT_EVENT && + event.KeyInput.PressedDown == false) + { + if ( OnKeyUp(event.KeyInput.Key) ) + return true; + } + + if (event.EventType == EET_GUI_EVENT) + { + s32 id = event.GUIEvent.Caller->getID(); + IGUIEnvironment* env = Device->getGUIEnvironment(); + + switch(event.GUIEvent.EventType) + { + case EGET_MENU_ITEM_SELECTED: + // a menu item was clicked + OnMenuItemSelected( (IGUIContextMenu*)event.GUIEvent.Caller ); + break; + + case EGET_FILE_SELECTED: + { + // load the model file, selected in the file open dialog + IGUIFileOpenDialog* dialog = + (IGUIFileOpenDialog*)event.GUIEvent.Caller; + loadModel(core::stringc(dialog->getFileName()).c_str()); + } + break; + + case EGET_SCROLL_BAR_CHANGED: + + // control skin transparency + if (id == GUI_ID_SKIN_TRANSPARENCY) + { + const s32 pos = ((IGUIScrollBar*)event.GUIEvent.Caller)->getPos(); + setSkinTransparency(pos, env->getSkin()); + } + // control animation speed + else if (id == GUI_ID_SKIN_ANIMATION_FPS) + { + const s32 pos = ((IGUIScrollBar*)event.GUIEvent.Caller)->getPos(); + if (scene::ESNT_ANIMATED_MESH == Model->getType()) + ((scene::IAnimatedMeshSceneNode*)Model)->setAnimationSpeed((f32)pos); + } + break; + + case EGET_COMBO_BOX_CHANGED: + + // control anti-aliasing/filtering + if (id == GUI_ID_TEXTUREFILTER) + { + OnTextureFilterSelected( (IGUIComboBox*)event.GUIEvent.Caller ); + } + break; + + case EGET_BUTTON_CLICKED: + + switch(id) + { + case GUI_ID_BUTTON_SET_SCALE: + { + // set scale + gui::IGUIElement* root = env->getRootGUIElement(); + core::vector3df scale; + core::stringc s; + + s = root->getElementFromId(GUI_ID_X_SCALE, true)->getText(); + scale.X = (f32)atof(s.c_str()); + s = root->getElementFromId(GUI_ID_Y_SCALE, true)->getText(); + scale.Y = (f32)atof(s.c_str()); + s = root->getElementFromId(GUI_ID_Z_SCALE, true)->getText(); + scale.Z = (f32)atof(s.c_str()); + + if (Model) + Model->setScale(scale); + updateScaleInfo(Model); + } + break; + case GUI_ID_BUTTON_SCALE_MUL10: + if (Model) + Model->setScale(Model->getScale()*10.f); + updateScaleInfo(Model); + break; + case GUI_ID_BUTTON_SCALE_DIV10: + if (Model) + Model->setScale(Model->getScale()*0.1f); + updateScaleInfo(Model); + break; + case GUI_ID_BUTTON_OPEN_MODEL: + env->addFileOpenDialog(L"Please select a model file to open"); + break; + case GUI_ID_BUTTON_SHOW_ABOUT: + showAboutText(); + break; + case GUI_ID_BUTTON_SHOW_TOOLBOX: + createToolBox(); + break; + case GUI_ID_BUTTON_SELECT_ARCHIVE: + env->addFileOpenDialog(L"Please select your game archive/directory"); + break; + } + + break; + default: + break; + } + } + + return false; + } + + + /* + Handle key-up events + */ + bool OnKeyUp(irr::EKEY_CODE keyCode) + { + // Don't handle keys if we have a modal dialog open as it would lead + // to unexpected application behaviour for the user. + if ( hasModalDialog() ) + return false; + + if (keyCode == irr::KEY_ESCAPE) + { + if (Device) + { + scene::ICameraSceneNode * camera = + Device->getSceneManager()->getActiveCamera(); + if (camera) + { + camera->setInputReceiverEnabled( !camera->isInputReceiverEnabled() ); + } + return true; + } + } + else if (keyCode == irr::KEY_F1) + { + if (Device) + { + IGUIElement* elem = Device->getGUIEnvironment()->getRootGUIElement()->getElementFromId(GUI_ID_POSITION_TEXT); + if (elem) + elem->setVisible(!elem->isVisible()); + } + } + else if (keyCode == irr::KEY_KEY_M) + { + if (Device) + Device->minimizeWindow(); + } + else if (keyCode == irr::KEY_KEY_L) + { + UseLight=!UseLight; + if (Model) + { + Model->setMaterialFlag(video::EMF_LIGHTING, UseLight); + Model->setMaterialFlag(video::EMF_NORMALIZE_NORMALS, UseLight); + } + } + return false; + } + + + /* + Handle "menu item clicked" events. + */ + void OnMenuItemSelected( IGUIContextMenu* menu ) + { + s32 id = menu->getItemCommandId(menu->getSelectedItem()); + IGUIEnvironment* env = Device->getGUIEnvironment(); + + switch(id) + { + case GUI_ID_OPEN_MODEL: // FilOnButtonSetScalinge -> Open Model + env->addFileOpenDialog(L"Please select a model file to open"); + break; + case GUI_ID_SET_MODEL_ARCHIVE: // File -> Set Model Archive + env->addFileOpenDialog(L"Please select your game archive/directory"); + break; + case GUI_ID_LOAD_AS_OCTREE: // File -> LoadAsOctree + Octree = !Octree; + menu->setItemChecked(menu->getSelectedItem(), Octree); + break; + case GUI_ID_QUIT: // File -> Quit + Device->closeDevice(); + break; + case GUI_ID_SKY_BOX_VISIBLE: // View -> Skybox + menu->setItemChecked(menu->getSelectedItem(), !menu->isItemChecked(menu->getSelectedItem())); + SkyBox->setVisible(!SkyBox->isVisible()); + break; + case GUI_ID_DEBUG_OFF: // View -> Debug Information + menu->setItemChecked(menu->getSelectedItem()+1, false); + menu->setItemChecked(menu->getSelectedItem()+2, false); + menu->setItemChecked(menu->getSelectedItem()+3, false); + menu->setItemChecked(menu->getSelectedItem()+4, false); + menu->setItemChecked(menu->getSelectedItem()+5, false); + menu->setItemChecked(menu->getSelectedItem()+6, false); + if (Model) + Model->setDebugDataVisible(scene::EDS_OFF); + break; + case GUI_ID_DEBUG_BOUNDING_BOX: // View -> Debug Information + menu->setItemChecked(menu->getSelectedItem(), !menu->isItemChecked(menu->getSelectedItem())); + if (Model) + Model->setDebugDataVisible((scene::E_DEBUG_SCENE_TYPE)(Model->isDebugDataVisible()^scene::EDS_BBOX)); + break; + case GUI_ID_DEBUG_NORMALS: // View -> Debug Information + menu->setItemChecked(menu->getSelectedItem(), !menu->isItemChecked(menu->getSelectedItem())); + if (Model) + Model->setDebugDataVisible((scene::E_DEBUG_SCENE_TYPE)(Model->isDebugDataVisible()^scene::EDS_NORMALS)); + break; + case GUI_ID_DEBUG_SKELETON: // View -> Debug Information + menu->setItemChecked(menu->getSelectedItem(), !menu->isItemChecked(menu->getSelectedItem())); + if (Model) + Model->setDebugDataVisible((scene::E_DEBUG_SCENE_TYPE)(Model->isDebugDataVisible()^scene::EDS_SKELETON)); + break; + case GUI_ID_DEBUG_WIRE_OVERLAY: // View -> Debug Information + menu->setItemChecked(menu->getSelectedItem(), !menu->isItemChecked(menu->getSelectedItem())); + if (Model) + Model->setDebugDataVisible((scene::E_DEBUG_SCENE_TYPE)(Model->isDebugDataVisible()^scene::EDS_MESH_WIRE_OVERLAY)); + break; + case GUI_ID_DEBUG_HALF_TRANSPARENT: // View -> Debug Information + menu->setItemChecked(menu->getSelectedItem(), !menu->isItemChecked(menu->getSelectedItem())); + if (Model) + Model->setDebugDataVisible((scene::E_DEBUG_SCENE_TYPE)(Model->isDebugDataVisible()^scene::EDS_HALF_TRANSPARENCY)); + break; + case GUI_ID_DEBUG_BUFFERS_BOUNDING_BOXES: // View -> Debug Information + menu->setItemChecked(menu->getSelectedItem(), !menu->isItemChecked(menu->getSelectedItem())); + if (Model) + Model->setDebugDataVisible((scene::E_DEBUG_SCENE_TYPE)(Model->isDebugDataVisible()^scene::EDS_BBOX_BUFFERS)); + break; + case GUI_ID_DEBUG_ALL: // View -> Debug Information + menu->setItemChecked(menu->getSelectedItem()-1, true); + menu->setItemChecked(menu->getSelectedItem()-2, true); + menu->setItemChecked(menu->getSelectedItem()-3, true); + menu->setItemChecked(menu->getSelectedItem()-4, true); + menu->setItemChecked(menu->getSelectedItem()-5, true); + menu->setItemChecked(menu->getSelectedItem()-6, true); + if (Model) + Model->setDebugDataVisible(scene::EDS_FULL); + break; + case GUI_ID_ABOUT: // Help->About + showAboutText(); + break; + case GUI_ID_MODEL_MATERIAL_SOLID: // View -> Material -> Solid + if (Model) + Model->setMaterialType(video::EMT_SOLID); + break; + case GUI_ID_MODEL_MATERIAL_TRANSPARENT: // View -> Material -> Transparent + if (Model) + Model->setMaterialType(video::EMT_TRANSPARENT_ADD_COLOR); + break; + case GUI_ID_MODEL_MATERIAL_REFLECTION: // View -> Material -> Reflection + if (Model) + Model->setMaterialType(video::EMT_SPHERE_MAP); + break; + + case GUI_ID_CAMERA_MAYA: + setActiveCamera(Camera[0]); + break; + case GUI_ID_CAMERA_FIRST_PERSON: + setActiveCamera(Camera[1]); + break; + } + } + + /* + Handle the event that one of the texture-filters was selected in the corresponding combobox. + */ + void OnTextureFilterSelected( IGUIComboBox* combo ) + { + s32 pos = combo->getSelected(); + switch (pos) + { + case 0: + if (Model) + { + Model->setMaterialFlag(video::EMF_BILINEAR_FILTER, false); + Model->setMaterialFlag(video::EMF_TRILINEAR_FILTER, false); + Model->setMaterialFlag(video::EMF_ANISOTROPIC_FILTER, false); + } + break; + case 1: + if (Model) + { + Model->setMaterialFlag(video::EMF_BILINEAR_FILTER, true); + Model->setMaterialFlag(video::EMF_TRILINEAR_FILTER, false); + } + break; + case 2: + if (Model) + { + Model->setMaterialFlag(video::EMF_BILINEAR_FILTER, false); + Model->setMaterialFlag(video::EMF_TRILINEAR_FILTER, true); + } + break; + case 3: + if (Model) + { + Model->setMaterialFlag(video::EMF_ANISOTROPIC_FILTER, true); + } + break; + case 4: + if (Model) + { + Model->setMaterialFlag(video::EMF_ANISOTROPIC_FILTER, false); + } + break; + } + } +}; + + +/* +Most of the hard work is done. We only need to create the Irrlicht Engine +device and all the buttons, menus and toolbars. We start up the engine as +usual, using createDevice(). To make our application catch events, we set our +eventreceiver as parameter. As you can see, there is also a call to +IrrlichtDevice::setResizeable(). This makes the render window resizeable, which +is quite useful for a mesh viewer. +*/ +int main(int argc, char* argv[]) +{ + // ask user for driver + video::E_DRIVER_TYPE driverType=driverChoiceConsole(); + if (driverType==video::EDT_COUNT) + return 1; + + // create device and exit if creation failed + MyEventReceiver receiver; + Device = createDevice(driverType, core::dimension2d(800, 600), + 16, false, false, false, &receiver); + + if (Device == 0) + return 1; // could not create selected driver. + + Device->setResizable(true); + + Device->setWindowCaption(L"Irrlicht Engine - Loading..."); + + video::IVideoDriver* driver = Device->getVideoDriver(); + IGUIEnvironment* env = Device->getGUIEnvironment(); + scene::ISceneManager* smgr = Device->getSceneManager(); + smgr->getParameters()->setAttribute(scene::COLLADA_CREATE_SCENE_INSTANCES, true); + + driver->setTextureCreationFlag(video::ETCF_ALWAYS_32_BIT, true); + + smgr->addLightSceneNode(0, core::vector3df(200,200,200), + 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/"); + + /* + The next step is to read the configuration file. It is stored in the xml + format and looks a little bit like this: + + @verbatim + + + + + Hello! + + + @endverbatim + + We need the data stored in there to be written into the global variables + StartUpModelFile, MessageText and Caption. This is now done using the + Irrlicht Engine integrated XML parser: + */ + + // read configuration from xml file + + io::IXMLReader* xml = Device->getFileSystem()->createXMLReader( L"config.xml"); + + while(xml && xml->read()) + { + switch(xml->getNodeType()) + { + case io::EXN_TEXT: + // in this xml file, the only text which occurs is the + // messageText + MessageText = xml->getNodeData(); + break; + case io::EXN_ELEMENT: + { + if (core::stringw("startUpModel") == xml->getNodeName()) + StartUpModelFile = xml->getAttributeValue(L"file"); + else + if (core::stringw("messageText") == xml->getNodeName()) + Caption = xml->getAttributeValue(L"caption"); + } + break; + default: + break; + } + } + + if (xml) + xml->drop(); // don't forget to delete the xml reader + + if (argc > 1) + StartUpModelFile = argv[1]; + + /* + That wasn't difficult. Now we'll set a nicer font and create the Menu. + It is possible to create submenus for every menu item. The call + menu->addItem(L"File", -1, true, true); for example adds a new menu + Item with the name "File" and the id -1. The following parameter says + that the menu item should be enabled, and the last one says, that there + should be a submenu. The submenu can now be accessed with + menu->getSubMenu(0), because the "File" entry is the menu item with + index 0. + */ + + // set a nicer font + + IGUISkin* skin = env->getSkin(); + IGUIFont* font = env->getFont("fonthaettenschweiler.bmp"); + if (font) + skin->setFont(font); + + // create menu + gui::IGUIContextMenu* menu = env->addMenu(); + menu->addItem(L"File", -1, true, true); + menu->addItem(L"View", -1, true, true); + menu->addItem(L"Camera", -1, true, true); + menu->addItem(L"Help", -1, true, true); + + gui::IGUIContextMenu* submenu; + submenu = menu->getSubMenu(0); + submenu->addItem(L"Open Model File & Texture...", GUI_ID_OPEN_MODEL); + submenu->addItem(L"Set Model Archive...", GUI_ID_SET_MODEL_ARCHIVE); + submenu->addItem(L"Load as Octree", GUI_ID_LOAD_AS_OCTREE); + submenu->addSeparator(); + submenu->addItem(L"Quit", GUI_ID_QUIT); + + submenu = menu->getSubMenu(1); + submenu->addItem(L"sky box visible", GUI_ID_SKY_BOX_VISIBLE, true, false, true); + submenu->addItem(L"toggle model debug information", GUI_ID_TOGGLE_DEBUG_INFO, true, true); + submenu->addItem(L"model material", -1, true, true ); + + submenu = submenu->getSubMenu(1); + submenu->addItem(L"Off", GUI_ID_DEBUG_OFF); + submenu->addItem(L"Bounding Box", GUI_ID_DEBUG_BOUNDING_BOX); + submenu->addItem(L"Normals", GUI_ID_DEBUG_NORMALS); + submenu->addItem(L"Skeleton", GUI_ID_DEBUG_SKELETON); + submenu->addItem(L"Wire overlay", GUI_ID_DEBUG_WIRE_OVERLAY); + submenu->addItem(L"Half-Transparent", GUI_ID_DEBUG_HALF_TRANSPARENT); + submenu->addItem(L"Buffers bounding boxes", GUI_ID_DEBUG_BUFFERS_BOUNDING_BOXES); + submenu->addItem(L"All", GUI_ID_DEBUG_ALL); + + submenu = menu->getSubMenu(1)->getSubMenu(2); + submenu->addItem(L"Solid", GUI_ID_MODEL_MATERIAL_SOLID); + submenu->addItem(L"Transparent", GUI_ID_MODEL_MATERIAL_TRANSPARENT); + submenu->addItem(L"Reflection", GUI_ID_MODEL_MATERIAL_REFLECTION); + + submenu = menu->getSubMenu(2); + submenu->addItem(L"Maya Style", GUI_ID_CAMERA_MAYA); + submenu->addItem(L"First Person", GUI_ID_CAMERA_FIRST_PERSON); + + submenu = menu->getSubMenu(3); + submenu->addItem(L"About", GUI_ID_ABOUT); + + /* + Below the menu we want a toolbar, onto which we can place colored + buttons and important looking stuff like a senseless combobox. + */ + + // create toolbar + + gui::IGUIToolBar* bar = env->addToolBar(); + + video::ITexture* image = driver->getTexture("open.png"); + bar->addButton(GUI_ID_BUTTON_OPEN_MODEL, 0, L"Open a model",image, 0, false, true); + + image = driver->getTexture("tools.png"); + bar->addButton(GUI_ID_BUTTON_SHOW_TOOLBOX, 0, L"Open Toolset",image, 0, false, true); + + image = driver->getTexture("zip.png"); + bar->addButton(GUI_ID_BUTTON_SELECT_ARCHIVE, 0, L"Set Model Archive",image, 0, false, true); + + image = driver->getTexture("help.png"); + bar->addButton(GUI_ID_BUTTON_SHOW_ABOUT, 0, L"Open Help", image, 0, false, true); + + // create a combobox for texture filters + + gui::IGUIComboBox* box = env->addComboBox(core::rect(250,4,350,23), bar, GUI_ID_TEXTUREFILTER); + box->addItem(L"No filtering"); + box->addItem(L"Bilinear"); + box->addItem(L"Trilinear"); + box->addItem(L"Anisotropic"); + box->addItem(L"Isotropic"); + + /* + To make the editor look a little bit better, we disable transparent gui + elements, and add an Irrlicht Engine logo. In addition, a text showing + the current frames per second value is created and the window caption is + changed. + */ + + // disable alpha + + for (s32 i=0; igetSkin()->getColor((gui::EGUI_DEFAULT_COLOR)i); + col.setAlpha(255); + env->getSkin()->setColor((gui::EGUI_DEFAULT_COLOR)i, col); + } + + // add a tabcontrol + + createToolBox(); + + // create fps text + + IGUIStaticText* fpstext = env->addStaticText(L"", + core::rect(400,4,570,23), true, false, bar); + + IGUIStaticText* postext = env->addStaticText(L"", + core::rect(10,50,470,80),false, false, 0, GUI_ID_POSITION_TEXT); + postext->setVisible(false); + + // set window caption + + Caption += " - ["; + Caption += driver->getName(); + Caption += "]"; + Device->setWindowCaption(Caption.c_str()); + + /* + That's nearly the whole application. We simply show the about message + box at start up, and load the first model. To make everything look + better, a skybox is created and a user controlled camera, to make the + application a little bit more interactive. Finally, everything is drawn + in a standard drawing loop. + */ + + // show about message box and load default model + if (argc==1) + showAboutText(); + loadModel(StartUpModelFile.c_str()); + + // add skybox + + SkyBox = smgr->addSkyBoxSceneNode( + driver->getTexture("irrlicht2_up.jpg"), + driver->getTexture("irrlicht2_dn.jpg"), + driver->getTexture("irrlicht2_lf.jpg"), + driver->getTexture("irrlicht2_rt.jpg"), + driver->getTexture("irrlicht2_ft.jpg"), + driver->getTexture("irrlicht2_bk.jpg")); + + // add a camera scene node + Camera[0] = smgr->addCameraSceneNodeMaya(); + Camera[0]->setFarValue(20000.f); + // Maya cameras reposition themselves relative to their target, so target the location + // where the mesh scene node is placed. + Camera[0]->setTarget(core::vector3df(0,30,0)); + + Camera[1] = smgr->addCameraSceneNodeFPS(); + Camera[1]->setFarValue(20000.f); + Camera[1]->setPosition(core::vector3df(0,0,-70)); + Camera[1]->setTarget(core::vector3df(0,30,0)); + + setActiveCamera(Camera[0]); + + // load the irrlicht engine logo + IGUIImage *img = + env->addImage(driver->getTexture("irrlichtlogo2.png"), + core::position2d(10, driver->getScreenSize().Height - 128)); + + // lock the logo's edges to the bottom left corner of the screen + img->setAlignment(EGUIA_UPPERLEFT, EGUIA_UPPERLEFT, + EGUIA_LOWERRIGHT, EGUIA_LOWERRIGHT); + + // remember state so we notice when the window does lose the focus + bool hasFocus = Device->isWindowFocused(); + + // draw everything + + while(Device->run() && driver) + { + // Catch focus changes (workaround until Irrlicht has events for this) + bool focused = Device->isWindowFocused(); + if ( hasFocus && !focused ) + onKillFocus(); + hasFocus = focused; + + if (Device->isWindowActive()) + { + driver->beginScene(true, true, video::SColor(150,50,50,50)); + + smgr->drawAll(); + env->drawAll(); + + driver->endScene(); + + // update information about current frame-rate + core::stringw str(L"FPS: "); + str.append(core::stringw(driver->getFPS())); + str += L" Tris: "; + str.append(core::stringw(driver->getPrimitiveCountDrawn())); + fpstext->setText(str.c_str()); + + // update information about the active camera + scene::ICameraSceneNode* cam = Device->getSceneManager()->getActiveCamera(); + str = L"Pos: "; + str.append(core::stringw(cam->getPosition().X)); + str += L" "; + str.append(core::stringw(cam->getPosition().Y)); + str += L" "; + str.append(core::stringw(cam->getPosition().Z)); + str += L" Tgt: "; + str.append(core::stringw(cam->getTarget().X)); + str += L" "; + str.append(core::stringw(cam->getTarget().Y)); + str += L" "; + str.append(core::stringw(cam->getTarget().Z)); + postext->setText(str.c_str()); + + // update the tool dialog + updateToolBox(); + } + else + Device->yield(); + } + + Device->drop(); + return 0; +} + +/* +**/ diff --git a/libraries/irrlicht-1.8.1/examples/09.Meshviewer/resource.h b/libraries/irrlicht-1.8.1/examples/09.Meshviewer/resource.h new file mode 100644 index 0000000..a8e8616 --- /dev/null +++ b/libraries/irrlicht-1.8.1/examples/09.Meshviewer/resource.h @@ -0,0 +1,16 @@ +//{{NO_DEPENDENCIES}} +// Microsoft Visual C++ generated include file. +// Used by 9.Meshviewer.rc +// +#define IDI_ICON1 101 + +// Next default values for new objects +// +#ifdef APSTUDIO_INVOKED +#ifndef APSTUDIO_READONLY_SYMBOLS +#define _APS_NEXT_RESOURCE_VALUE 102 +#define _APS_NEXT_COMMAND_VALUE 40001 +#define _APS_NEXT_CONTROL_VALUE 1001 +#define _APS_NEXT_SYMED_VALUE 101 +#endif +#endif diff --git a/libraries/irrlicht-1.8.1/examples/09.Meshviewer/tutorial.html b/libraries/irrlicht-1.8.1/examples/09.Meshviewer/tutorial.html new file mode 100644 index 0000000..d296b6c --- /dev/null +++ b/libraries/irrlicht-1.8.1/examples/09.Meshviewer/tutorial.html @@ -0,0 +1,182 @@ + + +Irrlicht Engine Tutorial + + + + +
+ + + + + + + + +
+
+
Tutorial 9. Mesh Viewer
+
+
+
+

This tutorial shows how to create a more complex application with + the engine. We construct a simple mesh viewer using the user interface + API and the scenemanagement of Irrlicht.
+ The tutorial shows how to create and use Buttons, Windows, Toolbars, + Menus, ComboBoxes, Tabcontrols, Editboxes, Images, MessageBoxes, SkyBoxes, + and how to parse XML files with the integrated XML reader of the engine.

+

The program which is described here will look like this:

+


+

+
+
+
+ + + + + + + +
Lets start!
+
+

We start like in most other tutorials: Include all nesessary header + files, add a comment to let the engine be linked with the right .lib + file in Visual Studio, and deklare some global variables. We also + add two 'using namespece' statements, so we do not need to write the + whole names of all classes. In this tutorial, we use a lot stuff from + the gui namespace.

+ + + + +
#include <irrlicht.h>
#include <iostream>

using namespace irr;
using namespace gui;

#pragma comment(lib, "Irrlicht.lib")

IrrlichtDevice *Device = 0;
core::stringc StartUpModelFile;
core::stringw MessageText;
core::stringw Caption;
scene::IAnimatedMeshSceneNode* Model = 0;
scene::ISceneNode* SkyBox = 0;
+

The three following functions do several stuff used by the mesh + viewer. The first function showAboutText() simply displays a messagebox + with a caption and a message text. The texts will be stored in the + MessageText and Caption variables at startup.

+ + + + +
void showAboutText()
{
// create modal message box with the text
// loaded from the xml file
.
Device->getGUIEnvironment()->addMessageBox(
Caption.c_str(), MessageText.c_str());
}
+

The second function loadModel() loads a model and displays it using + an addAnimatedMeshSceneNode and the scene manager. Nothing difficult. + It also displays a short message box, if the model could not be loaded. +

+ + + + +
void loadModel(const c8* filename)
{
// load a model into the engine
if (Model)
Model->remove();
Model = 0;

scene::IAnimatedMesh* m = Device->getSceneManager()->getMesh(filename);
if (!m)
{
// model could not be loaded
if (StartUpModelFile != filename)
Device->getGUIEnvironment()->addMessageBox(
Caption.c_str(), L"The model could not be loaded. " \
L"Maybe it is not a supported file format.");
return;
}

// set default material properties
Model = Device->getSceneManager()->addAnimatedMeshSceneNode(m);
Model->setMaterialType(video::EMT_TRANSPARENT_ADD_COLOR);
Model->setMaterialFlag(video::EMF_LIGHTING, false);
Model->setDebugDataVisible(true);
}
+

Finally, the third function creates a toolbox window. In this simple + mesh viewer, this toolbox only contains a tab control with three edit + boxes for changing the scale of the displayed model.

+ + + + +
void createToolBox()
{
// remove tool box if already there
IGUIEnvironment* env = Device->getGUIEnvironment();
IGUIElement* root = env->getRootGUIElement();
IGUIElement* e = root->getElementFromId(5000, true);
if (e) e->remove();

// create the toolbox window
IGUIWindow* wnd = env->addWindow(core::rect<s32>(450,25,640,480),
false, L"Toolset", 0, 5000);

// create tab control and tabs
IGUITabControl* tab = env->addTabControl(
core::rect<s32>(2,20,640-452,480-7), wnd, true, true);
IGUITab* t1 = tab->addTab(L"Scale");
IGUITab* t2 = tab->addTab(L"Empty Tab");

// add some edit boxes and a button to tab one
env->addEditBox(L"1.0", core::rect<s32>(40,50,130,70), true, t1, 901);
env->addEditBox(L"1.0", core::rect<s32>(40,80,130,100), true, t1, 902);
env->addEditBox(L"1.0", core::rect<s32>(40,110,130,130), true, t1, 903);
env->addButton(core::rect<s32>(10,150,100,190), t1, 1101, L"set");

// bring irrlicht engine logo to front, because it
// now may be below the newly created toolbox
root->bringToFront(root->getElementFromId(666, true));
}
+

To get all the events sent by the GUI Elements, we need to create + an event receiver. This one is really simple. If an event occurs, + it checks the id of the caller and the event type, and starts an action + based on these values. For example, if a menu item with id 100 was + selected, if opens a file-open-dialog.

+
+ + + + +
class MyEventReceiver : public IEventReceiver
{
public:
virtual bool OnEvent(const SEvent& event)
{
if (event.EventType == EET_GUI_EVENT)
{
s32 id = event.GUIEvent.Caller->getID();
IGUIEnvironment* env = Device->getGUIEnvironment();
switch(event.GUIEvent.EventType)
{
case EGET_MENU_ITEM_SELECTED:
{
// a menu item was clicked
IGUIContextMenu* menu = (IGUIContextMenu*)event.GUIEvent.Caller;
s32 id = menu->getItemCommandId(menu->getSelectedItem());

switch(id)
{
case 100: // File -> Open Model
env->addFileOpenDialog(L"Please select a model file to open");
break;
case 200: // File -> Quit
Device->closeDevice();
break;
case 300: // View -> Skybox
SkyBox->setVisible(!SkyBox->isVisible());
break;
case 400: // View -> Debug Information
if (Model)
Model->setDebugDataVisible(!Model->isDebugDataVisible());
break;
case 500: // Help->About
showAboutText();
break;
case 610: // View -> Material -> Solid
if (Model)
Model->setMaterialType(video::EMT_SOLID);
break;
case 620: // View -> Material -> Transparent
if (Model)
Model->setMaterialType(video::EMT_TRANSPARENT_ADD_COLOR);
break;
case 630: // View -> Material -> Reflection
if (Model)
Model->setMaterialType(video::EMT_SPHERE_MAP);
break;
}
break;
}
case EGET_FILE_SELECTED:
{
// load the model file, selected in the file open dialog
IGUIFileOpenDialog* dialog =
(IGUIFileOpenDialog*)event.GUIEvent.Caller;
loadModel(core::stringc(dialog->getFilename()).c_str());
}
case EGET_BUTTON_CLICKED:
switch(id)
{
case 1101:
{
// set scale
gui::IGUIElement* root = env->getRootGUIElement();
core::vector3df scale;
core::stringc s;
s = root->getElementFromId(901, true)->getText();
scale.X = (f32)atof(s.c_str());
s = root->getElementFromId(902, true)->getText();
scale.Y = (f32)atof(s.c_str());
s = root->getElementFromId(903, true)->getText();
scale.Z = (f32)atof(s.c_str());
if (Model)
Model->setScale(scale);
}
break;
case 1102:
env->addFileOpenDialog(L"Please select a model file to open");
break;
case 1103:
showAboutText();
break;
case 1104:
createToolBox();
break;
}
break;
}
}
return false;
}
};
+

Most of the hard work is done. We only need to create the Irrlicht + Engine device and all the buttons, menus and toolbars. We start up the + engine as usual, using createDevice(). To make our application catch + events, we set our eventreceiver as parameter. The #ifdef WIN32 preprocessor + commands are not necesarry, but I included them to make the tutorial + use DirectX on Windows and OpenGL on all other platforms like Linux. + As you can see, there is also a unusual call to IrrlichtDevice::setResizeAble(). + This makes the render window resizeable, which is quite useful for a + mesh viewer.

+ + + + +
int main()
{
// ask user for driver +
video::E_DRIVER_TYPE driverType; +
printf("Please select the driver you want for this example:\n"\
" (a) Direct3D 9.0c\n (b) Direct3D 8.1\n (c) OpenGL 1.5\n"\
" (d) Software Renderer\n (e) Apfelbaum Software Renderer\n"\
" (f) NullDevice\n (otherKey) exit\n\n");

char key;
std::cin >> key;

switch(key)
{
case 'a': driverType = video::EDT_DIRECT3D9;break;
case 'b': driverType = video::EDT_DIRECT3D8;break;
case 'c': driverType = video::EDT_OPENGL; break;
case 'd': driverType = video::EDT_SOFTWARE; break;
case 'e': driverType = video::EDT_BURNINGSVIDEO;break;
case 'f': driverType = video::EDT_NULL; break;
default: return 1;
} +
// create device and exit if creation failed +
MyEventReceiver receiver;
Device = createDevice(driverType, core::dimension2d<s32>(640, 480),
16, false, false, false, &receiver); +
if (Device == 0)
return 1; // could not create selected driver.

Device->setResizable(true);
Device->setWindowCaption(L"Irrlicht Engine - Loading...");

video::IVideoDriver* driver = Device->getVideoDriver();
IGUIEnvironment* env = Device->getGUIEnvironment();
scene::ISceneManager* smgr = Device->getSceneManager();
+

The next step is to read the configuration file. It is stored in the + xml format and looks a little bit like this:
+
+ <?xml version="1.0"?>
+ <config>
+ <startUpModel file="some filename" />
+ <messageText caption="Irrlicht Engine Mesh Viewer">
+ Hello!
+ </messageText>
+ </config>

+
+ We need the data stored in there to be written into the global variables + StartUpModelFile, MessageText and Caption. This is now done using the + Irrlicht Engine integrated XML parser:

+ + + + +
	// read configuration from xml file
io::IXMLReader* xml =
Device->getFileSystem()->createXMLReader("../../media/config.xml");
while(xml && xml->read())
{
switch(xml->getNodeType())
{
case io::EXN_TEXT:
// in this xml file, the only text which occurs is the messageText
MessageText = xml->getNodeData();
break;
case io::EXN_ELEMENT:
{
if (core::stringw("startUpModel") == xml->getNodeName())
StartUpModelFile = xml->getAttributeValue(L"file");
else
if (core::stringw("messageText") == xml->getNodeName())
Caption = xml->getAttributeValue(L"caption");
}
break;
}
}
if (xml)
xml->drop(); // don't forget to delete the xml reader
+
+

That wasn't difficult. Now we'll set a nicer font and create the Menu. + It is possible to create submenus for every menu item. The call menu->addItem(L"File", + -1, true, true); for example adds a new menu Item with the name "File" + and the id -1. The following parameter says that the menu item should + be enabled, and the last one says, that there should be a submenu. The + submenu can now be accessed with menu->getSubMenu(0), because the + "File" entry is the menu item with index 0.

+ + + + +
	// set a nicer font
IGUISkin* skin = env->getSkin();
IGUIFont* font = env->getFont("../../media/fonthaettenschweiler.bmp");
if (font)
skin->setFont(font);

// create menu
gui::IGUIContextMenu* menu = env->addMenu();
menu->addItem(L"File", -1, true, true);
menu->addItem(L"View", -1, true, true);
menu->addItem(L"Help", -1, true, true);

gui::IGUIContextMenu* submenu;
submenu = menu->getSubMenu(0);
submenu->addItem(L"Open Model File...", 100);
submenu->addSeparator();
submenu->addItem(L"Quit", 200);

submenu = menu->getSubMenu(1);
submenu->addItem(L"toggle sky box visibility", 300);
submenu->addItem(L"toggle model debug information", 400);
submenu->addItem(L"model material", -1, true, true );

submenu = submenu->getSubMenu(2);
submenu->addItem(L"Solid", 610);
submenu->addItem(L"Transparent", 620);
submenu->addItem(L"Reflection", 630);

submenu = menu->getSubMenu(2);
submenu->addItem(L"About", 500); +
+
+ We want a toolbar, onto which we can place colored buttons and important + looking stuff like a senseless combobox.
+
+ + + + +
	// create toolbar
gui::IGUIToolBar* bar = env->addToolBar();
bar->addButton(1102, 0, driver->getTexture("../../media/open.bmp"));
bar->addButton(1103, 0, driver->getTexture("../../media/help.bmp"));
bar->addButton(1104, 0, driver->getTexture("../../media/tools.bmp"));

// create a combobox with some senseless texts
gui::IGUIComboBox* box = env->addComboBox(core::rect<s32>(100,5,200,25), bar);
box->addItem(L"Bilinear");
box->addItem(L"Trilinear");
box->addItem(L"Anisotropic");
box->addItem(L"Isotropic");
box->addItem(L"Psychedelic");
box->addItem(L"No filtering");
+
+ To make the editor look a little bit better, we disable transparent gui + elements, and add a Irrlicht Engine logo. In addition, a text, which will + show the current frame per second value is created, and the window caption + changed.
+
+ + + + +
	// disable alpha
for (s32 i=0; i<gui::EGDC_COUNT ; ++i)
{
video::SColor col = env->getSkin()->getColor((gui::EGUI_DEFAULT_COLOR)i);
col.setAlpha(255);
env->getSkin()->setColor((gui::EGUI_DEFAULT_COLOR)i, col);
}

// add a tabcontrol
createToolBox();

// add the irrlicht engine logo
IGUIImage* img = env->addImage(core::rect<s32>(22,429,108,460), 0, 666);
img->setImage(driver->getTexture("../../media/irrlichtlogoaligned.jpg"));

// create fps text
IGUIStaticText* fpstext =
env->addStaticText(L"", core::rect<s32>(210,26,270,41), true);

// set window caption
Caption += " - [";
Caption += driver->getName();
Caption += "]";
Device->setWindowCaption(Caption.c_str());
+
+ That's nearly the whole application. We simply show the about message + box at start up, and load the first model. To make everything look better, + a skybox is created and a user controled camera, to make the application + a little bit more interactive. Finally, everything is drawed in a standard + drawing loop.
+
+ + + + +
	// show about message box and load default model
showAboutText();
loadModel(StartUpModelFile.c_str());

// add skybox

SkyBox = smgr->addSkyBoxSceneNode(
driver->getTexture("../../media/irrlicht2_up.bmp"),
driver->getTexture("../../media/irrlicht2_dn.bmp"),
driver->getTexture("../../media/irrlicht2_lf.bmp"),
driver->getTexture("../../media/irrlicht2_rt.bmp"),
driver->getTexture("../../media/irrlicht2_ft.bmp"),
driver->getTexture("../../media/irrlicht2_bk.bmp"));

// add a camera scene node
smgr->addCameraSceneNodeMaya();

// draw everything
while(Device->run() && driver)
if (Device->isWindowActive())
{
driver->beginScene(true, true, video::SColor(150,50,50,50));
smgr->drawAll();
env->drawAll();

driver->endScene();

core::stringw str = L"FPS: ";
str += driver->getFPS();
fpstext->setText(str.c_str());
}
Device->drop();
return 0;
}
+
+ Compile and run this, and you have a fully functional 3d Mesh viewer.
+
+
+

 

+ + diff --git a/libraries/irrlicht-1.8.1/examples/10.Shaders/Makefile b/libraries/irrlicht-1.8.1/examples/10.Shaders/Makefile new file mode 100644 index 0000000..ff2df2a --- /dev/null +++ b/libraries/irrlicht-1.8.1/examples/10.Shaders/Makefile @@ -0,0 +1,38 @@ +# Makefile for Irrlicht Examples +# It's usually sufficient to change just the target name and source file list +# and be sure that CXX is set to a valid compiler +Target = 10.Shaders +Sources = main.cpp + +# general compiler settings +CPPFLAGS = -I../../include -I/usr/X11R6/include +CXXFLAGS = -O3 -ffast-math +#CXXFLAGS = -g -Wall + +#default target is Linux +all: all_linux + +ifeq ($(HOSTTYPE), x86_64) +LIBSELECT=64 +endif + +# target specific settings +all_linux: LDFLAGS = -L/usr/X11R6/lib$(LIBSELECT) -L../../lib/Linux -lIrrlicht -lGL -lXxf86vm -lXext -lX11 -lXcursor +all_linux clean_linux: SYSTEM=Linux +all_win32: LDFLAGS = -L../../lib/Win32-gcc -lIrrlicht -lopengl32 -lm +all_win32 clean_win32: SYSTEM=Win32-gcc +all_win32 clean_win32: SUF=.exe +# name of the binary - only valid for targets which set SYSTEM +DESTPATH = ../../bin/$(SYSTEM)/$(Target)$(SUF) + +all_linux all_win32: + $(warning Building...) + $(CXX) $(CPPFLAGS) $(CXXFLAGS) $(Sources) -o $(DESTPATH) $(LDFLAGS) + +clean: clean_linux clean_win32 + $(warning Cleaning...) + +clean_linux clean_win32: + @$(RM) $(DESTPATH) + +.PHONY: all all_win32 clean clean_linux clean_win32 diff --git a/libraries/irrlicht-1.8.1/examples/10.Shaders/Shaders.cbp b/libraries/irrlicht-1.8.1/examples/10.Shaders/Shaders.cbp new file mode 100644 index 0000000..ec37b22 --- /dev/null +++ b/libraries/irrlicht-1.8.1/examples/10.Shaders/Shaders.cbp @@ -0,0 +1,56 @@ + + + + + + diff --git a/libraries/irrlicht-1.8.1/examples/10.Shaders/Shaders.dev b/libraries/irrlicht-1.8.1/examples/10.Shaders/Shaders.dev new file mode 100644 index 0000000..bcaa4f8 --- /dev/null +++ b/libraries/irrlicht-1.8.1/examples/10.Shaders/Shaders.dev @@ -0,0 +1,59 @@ +[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/libraries/irrlicht-1.8.1/examples/10.Shaders/Shaders.vcproj b/libraries/irrlicht-1.8.1/examples/10.Shaders/Shaders.vcproj new file mode 100644 index 0000000..e730a2f --- /dev/null +++ b/libraries/irrlicht-1.8.1/examples/10.Shaders/Shaders.vcproj @@ -0,0 +1,163 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/libraries/irrlicht-1.8.1/examples/10.Shaders/Shaders_vc10.vcxproj b/libraries/irrlicht-1.8.1/examples/10.Shaders/Shaders_vc10.vcxproj new file mode 100644 index 0000000..c2a526e --- /dev/null +++ b/libraries/irrlicht-1.8.1/examples/10.Shaders/Shaders_vc10.vcxproj @@ -0,0 +1,231 @@ + + + + + Debug + Win32 + + + Debug + x64 + + + Release + Win32 + + + Release + x64 + + + + 10.Shaders + {27158C82-CD15-4A9B-9848-35E7065B209F} + Shaders + + + + Application + false + MultiByte + + + Application + false + MultiByte + + + Application + false + MultiByte + + + Application + false + MultiByte + + + + + + + + + + + + + + + + + + + + + + + <_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/libraries/irrlicht-1.8.1/examples/10.Shaders/Shaders_vc11.vcxproj b/libraries/irrlicht-1.8.1/examples/10.Shaders/Shaders_vc11.vcxproj new file mode 100644 index 0000000..30ae642 --- /dev/null +++ b/libraries/irrlicht-1.8.1/examples/10.Shaders/Shaders_vc11.vcxproj @@ -0,0 +1,235 @@ + + + + + Debug + Win32 + + + Debug + x64 + + + Release + Win32 + + + Release + x64 + + + + 10.Shaders + {27158C82-CD15-4A9B-9848-35E7065B209F} + Shaders + + + + Application + false + MultiByte + v110 + + + Application + false + MultiByte + v110 + + + Application + false + MultiByte + v110 + + + Application + false + MultiByte + v110 + + + + + + + + + + + + + + + + + + + + + + + <_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/libraries/irrlicht-1.8.1/examples/10.Shaders/Shaders_vc8.vcproj b/libraries/irrlicht-1.8.1/examples/10.Shaders/Shaders_vc8.vcproj new file mode 100644 index 0000000..f107140 --- /dev/null +++ b/libraries/irrlicht-1.8.1/examples/10.Shaders/Shaders_vc8.vcproj @@ -0,0 +1,231 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/libraries/irrlicht-1.8.1/examples/10.Shaders/Shaders_vc9.vcproj b/libraries/irrlicht-1.8.1/examples/10.Shaders/Shaders_vc9.vcproj new file mode 100644 index 0000000..d870b03 --- /dev/null +++ b/libraries/irrlicht-1.8.1/examples/10.Shaders/Shaders_vc9.vcproj @@ -0,0 +1,230 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/libraries/irrlicht-1.8.1/examples/10.Shaders/main.cpp b/libraries/irrlicht-1.8.1/examples/10.Shaders/main.cpp new file mode 100644 index 0000000..269c47f --- /dev/null +++ b/libraries/irrlicht-1.8.1/examples/10.Shaders/main.cpp @@ -0,0 +1,443 @@ +/** Example 010 Shaders + +This tutorial shows how to use shaders for D3D8, D3D9, OpenGL, and Cg 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 +this. + +At first, we need to include all headers and do the stuff we always do, like in +nearly all other tutorials: +*/ +#include +#include +#include "driverChoice.h" + +using namespace irr; + +#ifdef _MSC_VER +#pragma comment(lib, "Irrlicht.lib") +#endif + +/* +Because we want to use some interesting shaders in this tutorials, we need to +set some data for them to make them able to compute nice colors. In this +example, we'll use a simple vertex shader which will calculate the color of the +vertex based on the position of the camera. +For this, the shader needs the following data: The inverted world matrix for +transforming the normal, the clip matrix for transforming the position, the +camera position and the world position of the object for the calculation of the +angle of light, and the color of the light. To be able to tell the shader all +this data every frame, we have to derive a class from the +IShaderConstantSetCallBack interface and override its only method, namely +OnSetConstants(). This method will be called every time the material is set. +The method setVertexShaderConstant() of the IMaterialRendererServices interface +is used to set the data the shader needs. If the user chose to use a High Level +shader language like HLSL instead of Assembler in this example, you have to set +the variable name as parameter instead of the register index. +*/ + +IrrlichtDevice* device = 0; +bool UseHighLevelShaders = false; +bool UseCgShaders = false; + +class MyShaderCallBack : public video::IShaderConstantSetCallBack +{ +public: + + virtual void OnSetConstants(video::IMaterialRendererServices* services, + s32 userData) + { + video::IVideoDriver* driver = services->getVideoDriver(); + + // set inverted world matrix + // if we are using highlevel shaders (the user can select this when + // starting the program), we must set the constants by name. + + core::matrix4 invWorld = driver->getTransform(video::ETS_WORLD); + invWorld.makeInverse(); + + if (UseHighLevelShaders) + services->setVertexShaderConstant("mInvWorld", invWorld.pointer(), 16); + else + services->setVertexShaderConstant(invWorld.pointer(), 0, 4); + + // set clip matrix + + core::matrix4 worldViewProj; + worldViewProj = driver->getTransform(video::ETS_PROJECTION); + worldViewProj *= driver->getTransform(video::ETS_VIEW); + worldViewProj *= driver->getTransform(video::ETS_WORLD); + + if (UseHighLevelShaders) + services->setVertexShaderConstant("mWorldViewProj", worldViewProj.pointer(), 16); + else + services->setVertexShaderConstant(worldViewProj.pointer(), 4, 4); + + // set camera position + + core::vector3df pos = device->getSceneManager()-> + getActiveCamera()->getAbsolutePosition(); + + if (UseHighLevelShaders) + services->setVertexShaderConstant("mLightPos", reinterpret_cast(&pos), 3); + else + services->setVertexShaderConstant(reinterpret_cast(&pos), 8, 1); + + // set light color + + video::SColorf col(0.0f,1.0f,1.0f,0.0f); + + if (UseHighLevelShaders) + services->setVertexShaderConstant("mLightColor", + reinterpret_cast(&col), 4); + else + services->setVertexShaderConstant(reinterpret_cast(&col), 9, 1); + + // set transposed world matrix + + core::matrix4 world = driver->getTransform(video::ETS_WORLD); + world = world.getTransposed(); + + if (UseHighLevelShaders) + { + services->setVertexShaderConstant("mTransWorld", world.pointer(), 16); + + // set texture, for textures you can use both an int and a float setPixelShaderConstant interfaces (You need it only for an OpenGL driver). + s32 TextureLayerID = 0; + if (UseHighLevelShaders) + services->setPixelShaderConstant("myTexture", &TextureLayerID, 1); + } + else + services->setVertexShaderConstant(world.pointer(), 10, 4); + } +}; + +/* +The next few lines start up the engine just like in most other tutorials +before. But in addition, we ask the user if he wants to use high level shaders +in this example, if he selected a driver which is capable of doing so. +*/ +int main() +{ + // ask user for driver + video::E_DRIVER_TYPE driverType=driverChoiceConsole(); + if (driverType==video::EDT_COUNT) + return 1; + + // ask the user if we should use high level shaders for this example + if (driverType == video::EDT_DIRECT3D9 || + driverType == video::EDT_OPENGL) + { + char i; + printf("Please press 'y' if you want to use high level shaders.\n"); + std::cin >> i; + 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; + } + } + + // create device + device = createDevice(driverType, core::dimension2d(640, 480)); + + if (device == 0) + return 1; // could not create selected driver. + + video::IVideoDriver* driver = device->getVideoDriver(); + scene::ISceneManager* smgr = device->getSceneManager(); + gui::IGUIEnvironment* gui = device->getGUIEnvironment(); + + // Make sure we don't try Cg without support for it + if (UseCgShaders && !driver->queryFeature(video::EVDF_CG)) + { + printf("Warning: No Cg support, disabling.\n"); + UseCgShaders=false; + } + + /* + 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(). + */ + + io::path vsFileName; // filename for the vertex shader + io::path psFileName; // filename for the pixel shader + + 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"; + vsFileName = psFileName; // both shaders are in the same file + } + else + { + psFileName = "../../media/d3d9.psh"; + vsFileName = "../../media/d3d9.vsh"; + } + break; + + 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 + } + } + else + { + psFileName = "../../media/opengl.psh"; + vsFileName = "../../media/opengl.vsh"; + } + break; + } + + /* + In addition, we check if the hardware and the selected renderer is + capable of executing the shaders we want. If not, we simply set the + filename string to 0. This is not necessary, but useful in this + example: For example, if the hardware is able to execute vertex shaders + but not pixel shaders, we create a new material which only uses the + vertex shader, and no pixel shader. Otherwise, if we would tell the + engine to create this material and the engine sees that the hardware + wouldn't be able to fulfill the request completely, it would not + create any new material at all. So in this example you would see at + least the vertex shader in action, without the pixel shader. + */ + + if (!driver->queryFeature(video::EVDF_PIXEL_SHADER_1_1) && + !driver->queryFeature(video::EVDF_ARB_FRAGMENT_PROGRAM_1)) + { + device->getLogger()->log("WARNING: Pixel shaders disabled "\ + "because of missing driver/hardware support."); + psFileName = ""; + } + + if (!driver->queryFeature(video::EVDF_VERTEX_SHADER_1_1) && + !driver->queryFeature(video::EVDF_ARB_VERTEX_PROGRAM_1)) + { + device->getLogger()->log("WARNING: Vertex shaders disabled "\ + "because of missing driver/hardware support."); + vsFileName = ""; + } + + /* + Now lets create the new materials. As you maybe know from previous + examples, a material type in the Irrlicht engine is set by simply + changing the MaterialType value in the SMaterial struct. And this value + is just a simple 32 bit value, like video::EMT_SOLID. So we only need + the engine to create a new value for us which we can set there. To do + this, we get a pointer to the IGPUProgrammingServices and call + addShaderMaterialFromFiles(), which returns such a new 32 bit value. + That's all. + + The parameters to this method are the following: First, the names of + the files containing the code of the vertex and the pixel shader. If + you would use addShaderMaterial() instead, you would not need file + names, then you could write the code of the shader directly as string. + The following parameter is a pointer to the IShaderConstantSetCallBack + class we wrote at the beginning of this tutorial. If you don't want to + set constants, set this to 0. The last parameter tells the engine which + material it should use as base material. + + To demonstrate this, we create two materials with a different base + material, one with EMT_SOLID and one with EMT_TRANSPARENT_ADD_COLOR. + */ + + // create materials + + video::IGPUProgrammingServices* gpu = driver->getGPUProgrammingServices(); + s32 newMaterialType1 = 0; + s32 newMaterialType2 = 0; + + if (gpu) + { + MyShaderCallBack* mc = new MyShaderCallBack(); + + // create the shaders depending on if the user wanted high level + // or low level shaders: + + 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; + + // create material from high level shaders (hlsl, glsl or cg) + + newMaterialType1 = gpu->addHighLevelShaderMaterialFromFiles( + vsFileName, "vertexMain", video::EVST_VS_1_1, + psFileName, "pixelMain", video::EPST_PS_1_1, + mc, video::EMT_SOLID, 0, shadingLanguage); + + newMaterialType2 = gpu->addHighLevelShaderMaterialFromFiles( + vsFileName, "vertexMain", video::EVST_VS_1_1, + psFileName, "pixelMain", video::EPST_PS_1_1, + mc, video::EMT_TRANSPARENT_ADD_COLOR, 0 , shadingLanguage); + } + else + { + // create material from low level shaders (asm or arb_asm) + + newMaterialType1 = gpu->addShaderMaterialFromFiles(vsFileName, + psFileName, mc, video::EMT_SOLID); + + newMaterialType2 = gpu->addShaderMaterialFromFiles(vsFileName, + psFileName, mc, video::EMT_TRANSPARENT_ADD_COLOR); + } + + mc->drop(); + } + + /* + Now it's time for testing the materials. We create a test cube and set + the material we created. In addition, we add a text scene node to the + cube and a rotation animator to make it look more interesting and + important. + */ + + // create test scene node 1, with the new created material type 1 + + scene::ISceneNode* node = smgr->addCubeSceneNode(50); + node->setPosition(core::vector3df(0,0,0)); + node->setMaterialTexture(0, driver->getTexture("../../media/wall.bmp")); + node->setMaterialFlag(video::EMF_LIGHTING, false); + node->setMaterialType((video::E_MATERIAL_TYPE)newMaterialType1); + + smgr->addTextSceneNode(gui->getBuiltInFont(), + L"PS & VS & EMT_SOLID", + video::SColor(255,255,255,255), node); + + scene::ISceneNodeAnimator* anim = smgr->createRotationAnimator( + core::vector3df(0,0.3f,0)); + node->addAnimator(anim); + anim->drop(); + + /* + Same for the second cube, but with the second material we created. + */ + + // create test scene node 2, with the new created material type 2 + + node = smgr->addCubeSceneNode(50); + node->setPosition(core::vector3df(0,-10,50)); + node->setMaterialTexture(0, driver->getTexture("../../media/wall.bmp")); + node->setMaterialFlag(video::EMF_LIGHTING, false); + node->setMaterialFlag(video::EMF_BLEND_OPERATION, true); + node->setMaterialType((video::E_MATERIAL_TYPE)newMaterialType2); + + smgr->addTextSceneNode(gui->getBuiltInFont(), + L"PS & VS & EMT_TRANSPARENT", + video::SColor(255,255,255,255), node); + + anim = smgr->createRotationAnimator(core::vector3df(0,0.3f,0)); + node->addAnimator(anim); + anim->drop(); + + /* + Then we add a third cube without a shader on it, to be able to compare + the cubes. + */ + + // add a scene node with no shader + + node = smgr->addCubeSceneNode(50); + node->setPosition(core::vector3df(0,50,25)); + node->setMaterialTexture(0, driver->getTexture("../../media/wall.bmp")); + node->setMaterialFlag(video::EMF_LIGHTING, false); + smgr->addTextSceneNode(gui->getBuiltInFont(), L"NO SHADER", + video::SColor(255,255,255,255), node); + + /* + And last, we add a skybox and a user controlled camera to the scene. + For the skybox textures, we disable mipmap generation, because we don't + need mipmaps on it. + */ + + // add a nice skybox + + 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->setTextureCreationFlag(video::ETCF_CREATE_MIP_MAPS, true); + + // add a camera and disable the mouse cursor + + scene::ICameraSceneNode* cam = smgr->addCameraSceneNodeFPS(); + cam->setPosition(core::vector3df(-100,50,100)); + cam->setTarget(core::vector3df(0,0,0)); + device->getCursorControl()->setVisible(false); + + /* + Now draw everything. That's all. + */ + + int lastFPS = -1; + + while(device->run()) + if (device->isWindowActive()) + { + driver->beginScene(true, true, video::SColor(255,0,0,0)); + smgr->drawAll(); + driver->endScene(); + + int fps = driver->getFPS(); + + if (lastFPS != fps) + { + core::stringw str = L"Irrlicht Engine - Vertex and pixel shader example ["; + str += driver->getName(); + str += "] FPS:"; + str += fps; + + device->setWindowCaption(str.c_str()); + lastFPS = fps; + } + } + + device->drop(); + + return 0; +} + +/* +Compile and run this, and I hope you have fun with your new little shader +writing tool :). +**/ diff --git a/libraries/irrlicht-1.8.1/examples/10.Shaders/tutorial.html b/libraries/irrlicht-1.8.1/examples/10.Shaders/tutorial.html new file mode 100644 index 0000000..05c4f08 --- /dev/null +++ b/libraries/irrlicht-1.8.1/examples/10.Shaders/tutorial.html @@ -0,0 +1,566 @@ + + +Irrlicht Engine Tutorial + + + + +
+ + + + + + + + +
+
+
Tutorial 10. Shaders
+
+
+
+

This tutorial shows how to use shaders for D3D8, 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 or OpenGL documentation, to search a tutorial, or to + read a book about this.

+

The program which is described here will look like this:

+


+

+
+
+
+ + + + + + + +
Lets start!
+
+

At first, we need to include all headers and do the stuff we always + do, like in nearly all other tutorials:

+ + + + +
#include <irrlicht.h>
#include <iostream>

using namespace irr;

#pragma comment(lib, "Irrlicht.lib")
+

Because we want to use some interesting shaders in this tutorials, + we need to set some data for them to make them able to compute nice + colors. In this example, we'll use a simple vertex shader which will + calculate the color of the vertex based on the position of the camera. + For this, the shader needs the following data: The inverted world + matrix for transforming the normal, the clip matrix for transforming + the position, the camera position and the world position of the object + for the calculation of the angle of light, and the color of the light. + To be able to tell the shader all this data every frame, we have to + derive a class from the IShaderConstantSetCallBack interface and override + its only method, namely OnSetConstants(). This method will be called + every time the material is set.
+ The method setVertexShaderConstant() of the IMaterialRendererServices + interface is used to set the data the shader needs. If the user chose + to use a High Level shader language like HLSL instead of Assembler + in this example, you have to set the variable name as parameter instead + of the register index.

+ + + + +
IrrlichtDevice* device = 0;
bool UseHighLevelShaders = false;

class MyShaderCallBack : public video::IShaderConstantSetCallBack
{
public: +
virtual void OnSetConstants(video::IMaterialRendererServices* services, s32 userData)
{
video::IVideoDriver* driver = services->getVideoDriver();

// set inverted world matrix
// if we are using highlevel shaders (the user can select this when
// starting the program), we must set the constants by name.

core::matrix4 invWorld = driver->getTransform(video::ETS_WORLD);
invWorld.makeInverse();

if (UseHighLevelShaders)
services->setVertexShaderConstant("mInvWorld", &invWorld.M[0], 16);
else
services->setVertexShaderConstant(&invWorld.M[0], 0, 4);

// set clip matrix
core::matrix4 worldViewProj;
worldViewProj = driver->getTransform(video::ETS_PROJECTION);
worldViewProj *= driver->getTransform(video::ETS_VIEW);
worldViewProj *= driver->getTransform(video::ETS_WORLD);

if (UseHighLevelShaders)
services->setVertexShaderConstant("mWorldViewProj", &worldViewProj.M[0], 16);
else
services->setVertexShaderConstant(&worldViewProj.M[0], 4, 4);

// set camera position
core::vector3df pos = device->getSceneManager()->
getActiveCamera()->getAbsolutePosition();

if (UseHighLevelShaders)
services->setVertexShaderConstant("mLightPos", reinterpret_cast<f32*>(&pos), 3);
else
services->setVertexShaderConstant(reinterpret_cast<f32*>(&pos), 8, 1);

// set light color
video::SColorf col(0.0f,1.0f,1.0f,0.0f);

if (UseHighLevelShaders)
services->setVertexShaderConstant("mLightColor", reinterpret_cast<f32*>(&col), 4);
else
services->setVertexShaderConstant(reinterpret_cast<f32*>(&col), 9, 1);

// set transposed world matrix
core::matrix4 world = driver->getTransform(video::ETS_WORLD);
world = world.getTransposed();

if (UseHighLevelShaders)
services->setVertexShaderConstant("mTransWorld", &world.M[0], 16);
else
services->setVertexShaderConstant(&world.M[0], 10, 4);
}
};
+

The next few lines start up the engine. Just like in most other + tutorials before. But in addition, we ask the user if he wants this + example to use high level shaders if he selected a driver which is + capable of doing so.

+ + + + +
int main()
{
// let user select driver type

video::E_DRIVER_TYPE driverType = video::EDT_DIRECTX9;

printf("Please select the driver you want for this example:\n"\
" (a) Direct3D 9.0c\n (b) Direct3D 8.1\n (c) OpenGL 1.5\n"\
" (d) Software Renderer\n (e) Apfelbaum Software Renderer\n"\
" (f) NullDevice\n (otherKey) exit\n\n");

char i;
std::cin >> i;

switch(i)
{
case 'a': driverType = video::EDT_DIRECT3D9;break;
case 'b': driverType = video::EDT_DIRECT3D8;break;
case 'c': driverType = video::EDT_OPENGL; break;
case 'd': driverType = video::EDT_SOFTWARE; break;
case 'e': driverType = video::EDT_BURNINGSVIDEO;break;
case 'f': driverType = video::EDT_NULL; break;
default: return 1;
}

// ask the user if we should use high level shaders for this example
if (driverType == video::EDT_DIRECT3D9 ||
driverType == video::EDT_OPENGL) + {
printf("Please press 'y' if you want to use high level shaders.\n");
std::cin >> i;
if (i == 'y')
UseHighLevelShaders = true;
}

// create device

device = createDevice(driverType, core::dimension2d<s32>(640, 480));

if (device == 0)
{
printf("\nWas not able to create driver.\n"\
"Please restart and select another driver.\n"
);
getch();
return 1;
}

video::IVideoDriver* driver = device->getVideoDriver();
scene::ISceneManager* smgr = device->getSceneManager();
gui::IGUIEnvironment* gui = device->getGUIEnvironment();
+

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().

+ + + + +
	c8* vsFileName = 0; // filename for the vertex shader
c8* psFileName = 0; // filename for the pixel shader

switch(driverType)
{
case video::EDT_DIRECT3D8:
psFileName = "../../media/d3d8.psh";
vsFileName = "../../media/d3d8.vsh";
break;
case video::EDT_DIRECT3D9:
if (UseHighLevelShaders)
{
psFileName = "../../media/d3d9.hlsl";
vsFileName = psFileName; // both shaders are in the same file
}
else
{
psFileName = "../../media/d3d9.psh";
vsFileName = "../../media/d3d9.vsh";
}
break;
case video::EDT_OPENGL:
if (UseHighLevelShaders)
{
psFileName = "../../media/opengl.frag";
vsFileName = "../../media/opengl.vert";
}
else
{
psFileName = "../../media/opengl.psh";
vsFileName = "../../media/opengl.vsh";
}
break;
}
+
+

In addition, we check if the hardware and the selected renderer + is capable of executing the shaders we want. If not, we simply set + the filename string to 0. This is not necessary, but useful in this + example: For example, if the hardware is able to execute vertex shaders + but not pixel shaders, we create a new material which only uses the + vertex shader, and no pixel shader. Otherwise, if we would tell the + engine to create this material and the engine sees that the hardware + wouldn't be able to fullfill the request completely,
+ it would not create any new material at all. So in this example you + would see at least the vertex shader in action, without the pixel + shader.

+
+ + + + +
	if (!driver->queryFeature(video::EVDF_PIXEL_SHADER_1_1) &&
!driver->queryFeature(video::EVDF_ARB_FRAGMENT_PROGRAM_1))
{
device->getLogger()->log("WARNING: Pixel shaders disabled "\
"because of missing driver/hardware support.");
psFileName = 0;
}

if (!driver->queryFeature(video::EVDF_VERTEX_SHADER_1_1) &&
!driver->queryFeature(video::EVDF_ARB_VERTEX_PROGRAM_1))
{
device->getLogger()->log("WARNING: Vertex shaders disabled "\
"because of missing driver/hardware support.");
vsFileName = 0;
}
+

Now lets create the new materials.
+ As you maybe know from previous examples, a material type in the Irrlicht + engine is set by simply changing the MaterialType value in the SMaterial + struct. And this value is just a simple 32 bit value, like video::EMT_SOLID. + So we only need the engine to create a new value for us which we can + set there. To do this, we get a pointer to the IGPUProgrammingServices + and call addShaderMaterialFromFiles(), which returns such a new 32 bit + value. That's all.
+ The parameters to this method are the following: First, the names of + the files containing the code of the vertex and the pixel shader.
+ If you would use addShaderMaterial() instead, you would not need file + names, then you could write the code of the shader directly as string. + The following parameter is a pointer to the IShaderConstantSetCallBack + class we wrote at the beginning of this tutorial. If you don't want + to set constants, set this to 0. The last paramter tells the engine + which material it should use as base material.
+ To demonstrate this, we create two materials with a different base material, + one with EMT_SOLID and one with EMT_TRANSPARENT_ADD_COLOR.

+ + + + +
	// create materials

video::IGPUProgrammingServices* gpu = driver->getGPUProgrammingServices();

s32 newMaterialType1 = 0;
s32 newMaterialType2 = 0;

if (gpu)
{
MyShaderCallBack* mc = new MyShaderCallBack();
+ // create the shaders depending on if the user wanted high level
// or low level shaders:


if (UseHighLevelShaders)
{
// create material from high level shaders (hlsl or glsl)

newMaterialType1 = gpu->addHighLevelShaderMaterialFromFiles(
vsFileName, "vertexMain", video::EVST_VS_1_1,
psFileName, "pixelMain", video::EPST_PS_1_1,
mc, video::EMT_SOLID);

newMaterialType2 = gpu->addHighLevelShaderMaterialFromFiles(
vsFileName, "vertexMain", video::EVST_VS_1_1,
psFileName, "pixelMain", video::EPST_PS_1_1,
mc, video::EMT_TRANSPARENT_ADD_COLOR);
}
else
{
// create material from low level shaders (asm or arb_asm)

newMaterialType1 = gpu->addShaderMaterialFromFiles(vsFileName,
psFileName, mc, video::EMT_SOLID);

newMaterialType2 = gpu->addShaderMaterialFromFiles(vsFileName,
psFileName, mc, video::EMT_TRANSPARENT_ADD_COLOR);
}

mc->drop();
}
+

Now its time for testing out the materials. We create a test cube + and set the material we created. In addition, we add a text scene node + to the cube and a rotatation animator, to make it look more interesting + and important.

+ + + + +

+	// create test scene node 1, with the new created material type 1
+
+	scene::ISceneNode* node = smgr->addCubeSceneNode(50);
+	node->setPosition(core::vector3df(0,0,0));
+	node->setMaterialTexture(0, driver->getTexture("../../media/wall.bmp"));
+	node->setMaterialFlag(video::EMF_LIGHTING, false);
+	node->setMaterialType((video::E_MATERIAL_TYPE)newMaterialType1);
+
+	smgr->addTextSceneNode(gui->getBuiltInFont(),
+			L"PS & VS & EMT_SOLID",
+			video::SColor(255,255,255,255),	node);
+
+	scene::ISceneNodeAnimator* anim = smgr->createRotationAnimator(
+			core::vector3df(0,0.3f,0));
+	node->addAnimator(anim);
+	anim->drop();
+

Same for the second cube, but with the second material we created.

+ + + + +
	// create test scene node 2, with the new created material type 2
+
+	node = smgr->addCubeSceneNode(50);
+	node->setPosition(core::vector3df(0,-10,50));
+	node->setMaterialTexture(0, driver->getTexture("../../media/wall.bmp"));
+	node->setMaterialFlag(video::EMF_LIGHTING, false);
+	node->setMaterialType((video::E_MATERIAL_TYPE)newMaterialType2);
+
+	smgr->addTextSceneNode(gui->getBuiltInFont(),
+			L"PS & VS & EMT_TRANSPARENT",
+			video::SColor(255,255,255,255),	node);
+
+	anim = smgr->createRotationAnimator(core::vector3df(0,0.3f,0));
+	node->addAnimator(anim);
+	anim->drop();
+
+ Then we add a third cube without a shader on it, to be able to compare + the cubes.
+
+ + + + +
	// add a scene node with no shader 
+
+	node = smgr->addCubeSceneNode(50);
+	node->setPosition(core::vector3df(0,50,25));
+	node->setMaterialTexture(0, driver->getTexture("../../media/wall.bmp"));
+	node->setMaterialFlag(video::EMF_LIGHTING, false);
+	smgr->addTextSceneNode(gui->getBuiltInFont(), L"NO SHADER",
+		video::SColor(255,255,255,255), node);
+            
+
+ And last, we add a skybox and a user controlled camera to the scene. For + the skybox textures, we disable mipmap generation, because we don't need + mipmaps on it.
+
+ + + + +
	// add a nice skybox

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->setTextureCreationFlag(video::ETCF_CREATE_MIP_MAPS, true);

// add a camera and disable the mouse cursor

scene::ICameraSceneNode* cam = smgr->addCameraSceneNodeFPS(0, 100.0f, 100.0f);
cam->setPosition(core::vector3df(-100,50,100));
cam->setTarget(core::vector3df(0,0,0));
device->getCursorControl()->setVisible(false);
+
+ Now draw everything. That's all.
+
+ + + + +
	int lastFPS = -1;

while(device->run())
if (device->isWindowActive())
{
driver->beginScene(true, true, video::SColor(255,0,0,0));
smgr->drawAll();
driver->endScene();

int fps = driver->getFPS();

if (lastFPS != fps)
{
core::stringw str = L"Irrlicht Engine - Vertex and pixel shader example [";
str += driver->getName();
str += "] FPS:";
str += fps;
device->setWindowCaption(str.c_str());
lastFPS = fps;
}
}

device->drop();

return 0;
+
+ Compile and run this, and I hope you have fun with your new little shader + writing tool :).
+
+
+
+ + + + + + + +
Shader files
+
+

The files containing the shaders can be found in the media directory + of the SDK. However, they look like this:

+ + + + + + + +
D3D9.HLSL
+
+// part of the Irrlicht Engine Shader example.
+// These simple Direct3D9 pixel and vertex shaders will be loaded by the shaders
+// example. Please note that these example shaders don't do anything really useful. 
+// They only demonstrate that shaders can be used in Irrlicht.
+
+//-----------------------------------------------------------------------------
+// Global variables
+//-----------------------------------------------------------------------------
+float4x4 mWorldViewProj;  // World * View * Projection transformation
+float4x4 mInvWorld;       // Inverted world matrix
+float4x4 mTransWorld;     // Transposed world matrix
+float3 mLightPos;         // Light position
+float4 mLightColor;       // Light color
+
+
+// Vertex shader output structure
+struct VS_OUTPUT
+{
+	float4 Position   : POSITION;   // vertex position 
+	float4 Diffuse    : COLOR0;     // vertex diffuse color
+	float2 TexCoord   : TEXCOORD0;  // tex coords
+};
+
+
+VS_OUTPUT vertexMain( in float4 vPosition : POSITION,
+                      in float3 vNormal   : NORMAL,
+                      float2 texCoord     : TEXCOORD0 )
+{
+	VS_OUTPUT Output;
+
+	// transform position to clip space 
+	Output.Position = mul(vPosition, mWorldViewProj);
+	
+	// transform normal 
+	float3 normal = mul(vNormal, mInvWorld);
+	
+	// renormalize normal 
+	normal = normalize(normal);
+	
+	// position in world coodinates
+	float3 worldpos = mul(mTransWorld, vPosition);
+	
+	// calculate light vector, vtxpos - lightpos
+	float3 lightVector = worldpos - mLightPos;
+	
+	// normalize light vector 
+	lightVector = normalize(lightVector);
+	
+	// calculate light color 
+	float3 tmp = dot(-lightVector, normal);
+	tmp = lit(tmp.x, tmp.y, 1.0);
+	
+	tmp = mLightColor * tmp.y;
+	Output.Diffuse = float4(tmp.x, tmp.y, tmp.z, 0);
+	Output.TexCoord = texCoord;
+	
+	return Output;
+}
+
+
+
+// Pixel shader output structure
+struct PS_OUTPUT
+{
+    float4 RGBColor : COLOR0;  // Pixel color    
+};
+
+
+sampler2D tex0;
+	
+PS_OUTPUT pixelMain( float2 TexCoord : TEXCOORD0,
+                     float4 Position : POSITION,
+                     float4 Diffuse  : COLOR0 ) 
+{ 
+	PS_OUTPUT Output;
+
+	float4 col = tex2D( tex0, TexCoord );  // sample color map
+	
+	// multiply with diffuse and do other senseless operations
+	Output.RGBColor = Diffuse * col;
+	Output.RGBColor *= 4.0;
+
+	return Output;
+}
+
+ + + + + + + +
D3D9.VSH
+; 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 + +dcl_position v0; ; declare position +dcl_normal v1; ; declare normal +dcl_color v2; ; declare color +dcl_texcoord0 v3; ; declare texture coordinate
+; 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
+
+ + + + + + + +
D3D9.PSH
+; 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 +add r0, v0, v0 ; mulitply with color +mul t0, t0, r0 ; mulitply with color +add r0, t0, t0 ; make it brighter and store result +
+
+ + + + + + + +
D3D8.VSH
+; 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
+
+ + + + + + + +
D3D8.PSH
+; 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
+
+ + + + + + + +
OPENGL.VSH
+!!ARBvp1.0
+# part of the Irrlicht Engine Shader example.
+# Please note that these example shaders don't do anything really useful. 
+# They only demonstrate that shaders can be used in Irrlicht.
+#input +ATTRIB InPos = vertex.position; +ATTRIB InColor = vertex.color; +ATTRIB InNormal = vertex.normal; +ATTRIB InTexCoord = vertex.texcoord; + +#output +OUTPUT OutPos = result.position; +OUTPUT OutColor = result.color; +OUTPUT OutTexCoord = result.texcoord; + +PARAM MVP[4] = { state.matrix.mvp }; # modelViewProjection matrix. +TEMP Temp; +TEMP TempColor; +TEMP TempNormal; +TEMP TempPos; + +#transform position to clip space +DP4 Temp.x, MVP[0], InPos; +DP4 Temp.y, MVP[1], InPos; +DP4 Temp.z, MVP[2], InPos; +DP4 Temp.w, MVP[3], InPos; + +#transform normal +DP3 TempNormal.x, InNormal.x, program.local[0]; +DP3 TempNormal.y, InNormal.y, program.local[1]; +DP3 TempNormal.z, InNormal.z, program.local[2]; + +#renormalize normal +DP3 TempNormal.w, TempNormal, TempNormal; +RSQ TempNormal.w, TempNormal.w; +MUL TempNormal, TempNormal, TempNormal.w; + +# calculate light vector +DP4 TempPos.x, InPos, program.local[10]; # vertex into world position +DP4 TempPos.y, InPos, program.local[11]; +DP4 TempPos.z, InPos, program.local[12]; +DP4 TempPos.w, InPos, program.local[13]; + +ADD TempPos, program.local[8], -TempPos; # vtxpos - lightpos + +# normalize light vector +DP3 TempPos.w, TempPos, TempPos; +RSQ TempPos.w, TempPos.w; +MUL TempPos, TempPos, TempPos.w; + +# calculate light color +DP3 TempColor, TempNormal, TempPos; # dp3 with negative light vector +LIT OutColor, TempColor; # clamp to zero if r3 < 0, r5 has diffuce component in r5.y +MUL OutColor, TempColor.y, program.local[9]; # ouput diffuse color +MOV OutColor.w, 1.0; # we want alpha to be always 1 +MOV OutTexCoord, InTexCoord; # store texture coordinate +MOV OutPos, Temp; + +END
+
+ + + + + + + +
OPENGL.PSH
+!!ARBfp1.0
+# part of the Irrlicht Engine Shader example.
+# Please note that these example shaders don't do anything really useful. 
+# They only demonstrate that shaders can be used in Irrlicht.
+#Input +ATTRIB inTexCoord = fragment.texcoord; # texture coordinates +ATTRIB inColor = fragment.color.primary; # interpolated diffuse color + +#Output +OUTPUT outColor = result.color; + +TEMP texelColor; +TEMP tmp; +TXP texelColor, inTexCoord, texture, 2D; + +ADD tmp, inColor, inColor; # mulitply with color +MUL texelColor, texelColor, tmp; # mulitply with color +ADD outColor, texelColor, texelColor; # make it brighter and store result + +END
+

 

+
+
+

 

+

 

+ + diff --git a/libraries/irrlicht-1.8.1/examples/11.PerPixelLighting/Makefile b/libraries/irrlicht-1.8.1/examples/11.PerPixelLighting/Makefile new file mode 100644 index 0000000..affdc02 --- /dev/null +++ b/libraries/irrlicht-1.8.1/examples/11.PerPixelLighting/Makefile @@ -0,0 +1,38 @@ +# Makefile for Irrlicht Examples +# It's usually sufficient to change just the target name and source file list +# and be sure that CXX is set to a valid compiler +Target = 11.PerPixelLighting +Sources = main.cpp + +# general compiler settings +CPPFLAGS = -I../../include -I/usr/X11R6/include +CXXFLAGS = -O3 -ffast-math +#CXXFLAGS = -g -Wall + +#default target is Linux +all: all_linux + +ifeq ($(HOSTTYPE), x86_64) +LIBSELECT=64 +endif + +# target specific settings +all_linux: LDFLAGS = -L/usr/X11R6/lib$(LIBSELECT) -L../../lib/Linux -lIrrlicht -lGL -lXxf86vm -lXext -lX11 -lXcursor +all_linux clean_linux: SYSTEM=Linux +all_win32: LDFLAGS = -L../../lib/Win32-gcc -lIrrlicht -lopengl32 -lm +all_win32 clean_win32: SYSTEM=Win32-gcc +all_win32 clean_win32: SUF=.exe +# name of the binary - only valid for targets which set SYSTEM +DESTPATH = ../../bin/$(SYSTEM)/$(Target)$(SUF) + +all_linux all_win32: + $(warning Building...) + $(CXX) $(CPPFLAGS) $(CXXFLAGS) $(Sources) -o $(DESTPATH) $(LDFLAGS) + +clean: clean_linux clean_win32 + $(warning Cleaning...) + +clean_linux clean_win32: + @$(RM) $(DESTPATH) + +.PHONY: all all_win32 clean clean_linux clean_win32 diff --git a/libraries/irrlicht-1.8.1/examples/11.PerPixelLighting/PerPixelLighting.cbp b/libraries/irrlicht-1.8.1/examples/11.PerPixelLighting/PerPixelLighting.cbp new file mode 100644 index 0000000..2cb49da --- /dev/null +++ b/libraries/irrlicht-1.8.1/examples/11.PerPixelLighting/PerPixelLighting.cbp @@ -0,0 +1,56 @@ + + + + + + diff --git a/libraries/irrlicht-1.8.1/examples/11.PerPixelLighting/PerPixelLighting.dev b/libraries/irrlicht-1.8.1/examples/11.PerPixelLighting/PerPixelLighting.dev new file mode 100644 index 0000000..c83a502 --- /dev/null +++ b/libraries/irrlicht-1.8.1/examples/11.PerPixelLighting/PerPixelLighting.dev @@ -0,0 +1,59 @@ +[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/libraries/irrlicht-1.8.1/examples/11.PerPixelLighting/PerPixelLighting.vcproj b/libraries/irrlicht-1.8.1/examples/11.PerPixelLighting/PerPixelLighting.vcproj new file mode 100644 index 0000000..94d7e6a --- /dev/null +++ b/libraries/irrlicht-1.8.1/examples/11.PerPixelLighting/PerPixelLighting.vcproj @@ -0,0 +1,163 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/libraries/irrlicht-1.8.1/examples/11.PerPixelLighting/PerPixelLighting_vc10.vcxproj b/libraries/irrlicht-1.8.1/examples/11.PerPixelLighting/PerPixelLighting_vc10.vcxproj new file mode 100644 index 0000000..267ded9 --- /dev/null +++ b/libraries/irrlicht-1.8.1/examples/11.PerPixelLighting/PerPixelLighting_vc10.vcxproj @@ -0,0 +1,231 @@ + + + + + Debug + Win32 + + + Debug + x64 + + + Release + Win32 + + + Release + x64 + + + + 11.PerPixelLighting + {C4B42409-542D-4EFC-9E6B-44713FD47A33} + PerPixelLighting + + + + Application + false + MultiByte + + + Application + false + MultiByte + + + Application + false + MultiByte + + + Application + false + MultiByte + + + + + + + + + + + + + + + + + + + + + + + <_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/libraries/irrlicht-1.8.1/examples/11.PerPixelLighting/PerPixelLighting_vc11.vcxproj b/libraries/irrlicht-1.8.1/examples/11.PerPixelLighting/PerPixelLighting_vc11.vcxproj new file mode 100644 index 0000000..06fce8f --- /dev/null +++ b/libraries/irrlicht-1.8.1/examples/11.PerPixelLighting/PerPixelLighting_vc11.vcxproj @@ -0,0 +1,235 @@ + + + + + Debug + Win32 + + + Debug + x64 + + + Release + Win32 + + + Release + x64 + + + + 11.PerPixelLighting + {C4B42409-542D-4EFC-9E6B-44713FD47A33} + PerPixelLighting + + + + Application + false + MultiByte + v110 + + + Application + false + MultiByte + v110 + + + Application + false + MultiByte + v110 + + + Application + false + MultiByte + v110 + + + + + + + + + + + + + + + + + + + + + + + <_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/libraries/irrlicht-1.8.1/examples/11.PerPixelLighting/PerPixelLighting_vc8.vcproj b/libraries/irrlicht-1.8.1/examples/11.PerPixelLighting/PerPixelLighting_vc8.vcproj new file mode 100644 index 0000000..b6830db --- /dev/null +++ b/libraries/irrlicht-1.8.1/examples/11.PerPixelLighting/PerPixelLighting_vc8.vcproj @@ -0,0 +1,231 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/libraries/irrlicht-1.8.1/examples/11.PerPixelLighting/PerPixelLighting_vc9.vcproj b/libraries/irrlicht-1.8.1/examples/11.PerPixelLighting/PerPixelLighting_vc9.vcproj new file mode 100644 index 0000000..c9ed033 --- /dev/null +++ b/libraries/irrlicht-1.8.1/examples/11.PerPixelLighting/PerPixelLighting_vc9.vcproj @@ -0,0 +1,230 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/libraries/irrlicht-1.8.1/examples/11.PerPixelLighting/main.cpp b/libraries/irrlicht-1.8.1/examples/11.PerPixelLighting/main.cpp new file mode 100644 index 0000000..227aa97 --- /dev/null +++ b/libraries/irrlicht-1.8.1/examples/11.PerPixelLighting/main.cpp @@ -0,0 +1,487 @@ +/** Example 011 Per-Pixel Lighting + +This tutorial shows how to use one of the built in more complex materials in +irrlicht: Per pixel lighted surfaces using normal maps and parallax mapping. It +will also show how to use fog and moving particle systems. And don't panic: You +do not need any experience with shaders to use these materials in Irrlicht. + +At first, we need to include all headers and do the stuff we always do, like in +nearly all other tutorials. +*/ +#include +#include "driverChoice.h" + +using namespace irr; + +#ifdef _MSC_VER +#pragma comment(lib, "Irrlicht.lib") +#endif + +/* +For this example, we need an event receiver, to make it possible for the user +to switch between the three available material types. In addition, the event +receiver will create some small GUI window which displays what material is +currently being used. There is nothing special done in this class, so maybe you +want to skip reading it. +*/ +class MyEventReceiver : public IEventReceiver +{ +public: + + MyEventReceiver(scene::ISceneNode* room,scene::ISceneNode* earth, + gui::IGUIEnvironment* env, video::IVideoDriver* driver) + { + // store pointer to room so we can change its drawing mode + Room = room; + Earth = earth; + Driver = driver; + + // set a nicer font + gui::IGUISkin* skin = env->getSkin(); + gui::IGUIFont* font = env->getFont("../../media/fonthaettenschweiler.bmp"); + if (font) + skin->setFont(font); + + // add window and listbox + gui::IGUIWindow* window = env->addWindow( + core::rect(460,375,630,470), false, L"Use 'E' + 'R' to change"); + + ListBox = env->addListBox( + core::rect(2,22,165,88), window); + + ListBox->addItem(L"Diffuse"); + ListBox->addItem(L"Bump mapping"); + ListBox->addItem(L"Parallax mapping"); + ListBox->setSelected(1); + + // create problem text + ProblemText = env->addStaticText( + L"Your hardware or this renderer is not able to use the "\ + L"needed shaders for this material. Using fall back materials.", + core::rect(150,20,470,80)); + + ProblemText->setOverrideColor(video::SColor(100,255,255,255)); + + // set start material (prefer parallax mapping if available) + video::IMaterialRenderer* renderer = + Driver->getMaterialRenderer(video::EMT_PARALLAX_MAP_SOLID); + if (renderer && renderer->getRenderCapability() == 0) + ListBox->setSelected(2); + + // set the material which is selected in the listbox + setMaterial(); + } + + bool OnEvent(const SEvent& event) + { + // check if user presses the key 'E' or 'R' + if (event.EventType == irr::EET_KEY_INPUT_EVENT && + !event.KeyInput.PressedDown && Room && ListBox) + { + // change selected item in listbox + + int sel = ListBox->getSelected(); + if (event.KeyInput.Key == irr::KEY_KEY_R) + ++sel; + else + if (event.KeyInput.Key == irr::KEY_KEY_E) + --sel; + else + return false; + + if (sel > 2) sel = 0; + if (sel < 0) sel = 2; + ListBox->setSelected(sel); + + // set the material which is selected in the listbox + setMaterial(); + } + + return false; + } + +private: + + // sets the material of the room mesh the the one set in the + // list box. + void setMaterial() + { + video::E_MATERIAL_TYPE type = video::EMT_SOLID; + + // change material setting + switch(ListBox->getSelected()) + { + case 0: type = video::EMT_SOLID; + break; + case 1: type = video::EMT_NORMAL_MAP_SOLID; + break; + case 2: type = video::EMT_PARALLAX_MAP_SOLID; + break; + } + + Room->setMaterialType(type); + + // change material setting + switch(ListBox->getSelected()) + { + case 0: type = video::EMT_TRANSPARENT_VERTEX_ALPHA; + break; + case 1: type = video::EMT_NORMAL_MAP_TRANSPARENT_VERTEX_ALPHA; + break; + case 2: type = video::EMT_PARALLAX_MAP_TRANSPARENT_VERTEX_ALPHA; + break; + } + + Earth->setMaterialType(type); + + /* + We need to add a warning if the materials will not be able to + be displayed 100% correctly. This is no problem, they will be + rendered using fall back materials, but at least the user + should know that it would look better on better hardware. We + simply check if the material renderer is able to draw at full + quality on the current hardware. The + IMaterialRenderer::getRenderCapability() returns 0 if this is + the case. + */ + video::IMaterialRenderer* renderer = Driver->getMaterialRenderer(type); + + // display some problem text when problem + if (!renderer || renderer->getRenderCapability() != 0) + ProblemText->setVisible(true); + else + ProblemText->setVisible(false); + } + +private: + + gui::IGUIStaticText* ProblemText; + gui::IGUIListBox* ListBox; + + scene::ISceneNode* Room; + scene::ISceneNode* Earth; + video::IVideoDriver* Driver; +}; + + +/* +Now for the real fun. We create an Irrlicht Device and start to setup the scene. +*/ +int main() +{ + // ask user for driver + video::E_DRIVER_TYPE driverType=driverChoiceConsole(); + if (driverType==video::EDT_COUNT) + return 1; + + // create device + + IrrlichtDevice* device = createDevice(driverType, + core::dimension2d(640, 480)); + + if (device == 0) + return 1; // could not create selected driver. + + /* + Before we start with the interesting stuff, we do some simple things: + Store pointers to the most important parts of the engine (video driver, + scene manager, gui environment) to safe us from typing too much, add an + irrlicht engine logo to the window and a user controlled first person + shooter style camera. Also, we let the engine know that it should store + all textures in 32 bit. This necessary because for parallax mapping, we + need 32 bit textures. + */ + + video::IVideoDriver* driver = device->getVideoDriver(); + scene::ISceneManager* smgr = device->getSceneManager(); + gui::IGUIEnvironment* env = device->getGUIEnvironment(); + + driver->setTextureCreationFlag(video::ETCF_ALWAYS_32_BIT, true); + + // add irrlicht logo + env->addImage(driver->getTexture("../../media/irrlichtlogo3.png"), + core::position2d(10,10)); + + // add camera + scene::ICameraSceneNode* camera = smgr->addCameraSceneNodeFPS(); + camera->setPosition(core::vector3df(-200,200,-200)); + + // disable mouse cursor + device->getCursorControl()->setVisible(false); + + /* + Because we want the whole scene to look a little bit scarier, we add + some fog to it. This is done by a call to IVideoDriver::setFog(). There + you can set various fog settings. In this example, we use pixel fog, + because it will work well with the materials we'll use in this example. + Please note that you will have to set the material flag EMF_FOG_ENABLE + to 'true' in every scene node which should be affected by this fog. + */ + driver->setFog(video::SColor(0,138,125,81), video::EFT_FOG_LINEAR, 250, 1000, .003f, true, false); + + /* + To be able to display something interesting, we load a mesh from a .3ds + file which is a room I modeled with anim8or. It is the same room as + from the specialFX example. Maybe you remember from that tutorial, I am + no good modeler at all and so I totally messed up the texture mapping + in this model, but we can simply repair it with the + IMeshManipulator::makePlanarTextureMapping() method. + */ + + scene::IAnimatedMesh* roomMesh = smgr->getMesh("../../media/room.3ds"); + scene::ISceneNode* room = 0; + scene::ISceneNode* earth = 0; + + if (roomMesh) + { + // The Room mesh doesn't have proper Texture Mapping on the + // floor, so we can recreate them on runtime + smgr->getMeshManipulator()->makePlanarTextureMapping( + roomMesh->getMesh(0), 0.003f); + + /* + Now for the first exciting thing: If we successfully loaded the + mesh we need to apply textures to it. Because we want this room + to be displayed with a very cool material, we have to do a + little bit more than just set the textures. Instead of only + loading a color map as usual, we also load a height map which + is simply a grayscale texture. From this height map, we create + a normal map which we will set as second texture of the room. + If you already have a normal map, you could directly set it, + but I simply didn't find a nice normal map for this texture. + The normal map texture is being generated by the + makeNormalMapTexture method of the VideoDriver. The second + parameter specifies the height of the heightmap. If you set it + to a bigger value, the map will look more rocky. + */ + + video::ITexture* normalMap = + driver->getTexture("../../media/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"); +*/ + /* + But just setting color and normal map is not everything. The + material we want to use needs some additional informations per + vertex like tangents and binormals. Because we are too lazy to + calculate that information now, we let Irrlicht do this for us. + That's why we call IMeshManipulator::createMeshWithTangents(). + It creates a mesh copy with tangents and binormals from another + mesh. After we've done that, we simply create a standard + mesh scene node with this mesh copy, set color and normal map + and adjust some other material settings. Note that we set + EMF_FOG_ENABLE to true to enable fog in the room. + */ + + scene::IMesh* tangentMesh = smgr->getMeshManipulator()-> + createMeshWithTangents(roomMesh->getMesh(0)); + + room = smgr->addMeshSceneNode(tangentMesh); + room->setMaterialTexture(0, + driver->getTexture("../../media/rockwall.jpg")); + room->setMaterialTexture(1, normalMap); + + // Stones don't glitter.. + room->getMaterial(0).SpecularColor.set(0,0,0,0); + room->getMaterial(0).Shininess = 0.f; + + room->setMaterialFlag(video::EMF_FOG_ENABLE, true); + room->setMaterialType(video::EMT_PARALLAX_MAP_SOLID); + // adjust height for parallax effect + room->getMaterial(0).MaterialTypeParam = 1.f / 64.f; + + // drop mesh because we created it with a create.. call. + tangentMesh->drop(); + } + + /* + After we've created a room shaded by per pixel lighting, we add a + sphere into it with the same material, but we'll make it transparent. + In addition, because the sphere looks somehow like a familiar planet, + we make it rotate. The procedure is similar as before. The difference + is that we are loading the mesh from an .x file which already contains + a color map so we do not need to load it manually. But the sphere is a + little bit too small for our needs, so we scale it by the factor 50. + */ + + // add earth sphere + + scene::IAnimatedMesh* earthMesh = smgr->getMesh("../../media/earth.x"); + if (earthMesh) + { + //perform various task with the mesh manipulator + scene::IMeshManipulator *manipulator = smgr->getMeshManipulator(); + + // create mesh copy with tangent informations from original earth.x mesh + scene::IMesh* tangentSphereMesh = + manipulator->createMeshWithTangents(earthMesh->getMesh(0)); + + // set the alpha value of all vertices to 200 + manipulator->setVertexColorAlpha(tangentSphereMesh, 200); + + // scale the mesh by factor 50 + core::matrix4 m; + m.setScale ( core::vector3df(50,50,50) ); + manipulator->transform( tangentSphereMesh, m ); + + earth = smgr->addMeshSceneNode(tangentSphereMesh); + + 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"); + if (earthNormalMap) + { + driver->makeNormalMapTexture(earthNormalMap, 20.0f); + earth->setMaterialTexture(1, earthNormalMap); + earth->setMaterialType(video::EMT_NORMAL_MAP_TRANSPARENT_VERTEX_ALPHA); + } + + // adjust material settings + earth->setMaterialFlag(video::EMF_FOG_ENABLE, true); + + // add rotation animator + scene::ISceneNodeAnimator* anim = + smgr->createRotationAnimator(core::vector3df(0,0.1f,0)); + earth->addAnimator(anim); + anim->drop(); + + // drop mesh because we created it with a create.. call. + tangentSphereMesh->drop(); + } + + /* + Per pixel lighted materials only look cool when there are moving + lights. So we add some. And because moving lights alone are so boring, + we add billboards to them, and a whole particle system to one of them. + We start with the first light which is red and has only the billboard + attached. + */ + + // add light 1 (more green) + scene::ILightSceneNode* light1 = + smgr->addLightSceneNode(0, core::vector3df(0,0,0), + video::SColorf(0.5f, 1.0f, 0.5f, 0.0f), 800.0f); + + light1->setDebugDataVisible ( scene::EDS_BBOX ); + + + // add fly circle animator to light 1 + scene::ISceneNodeAnimator* anim = + smgr->createFlyCircleAnimator (core::vector3df(50,300,0),190.0f, -0.003f); + light1->addAnimator(anim); + anim->drop(); + + // attach billboard to the light + scene::IBillboardSceneNode* bill = + smgr->addBillboardSceneNode(light1, core::dimension2d(60, 60)); + + 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")); + + /* + Now the same again, with the second light. The difference is that we + add a particle system to it too. And because the light moves, the + particles of the particlesystem will follow. If you want to know more + about how particle systems are created in Irrlicht, take a look at the + specialFx example. Maybe you will have noticed that we only add 2 + lights, this has a simple reason: The low end version of this material + was written in ps1.1 and vs1.1, which doesn't allow more lights. You + could add a third light to the scene, but it won't be used to shade the + walls. But of course, this will change in future versions of Irrlicht + where higher versions of pixel/vertex shaders will be implemented too. + */ + + // add light 2 (red) + scene::ISceneNode* light2 = + smgr->addLightSceneNode(0, core::vector3df(0,0,0), + video::SColorf(1.0f, 0.2f, 0.2f, 0.0f), 800.0f); + + // add fly circle animator to light 2 + anim = smgr->createFlyCircleAnimator(core::vector3df(0,150,0), 200.0f, + 0.001f, core::vector3df(0.2f, 0.9f, 0.f)); + light2->addAnimator(anim); + anim->drop(); + + // attach billboard to light + bill = smgr->addBillboardSceneNode(light2, core::dimension2d(120, 120)); + 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")); + + // add particle system + scene::IParticleSystemSceneNode* ps = + smgr->addParticleSystemSceneNode(false, light2); + + // create and set emitter + scene::IParticleEmitter* em = ps->createBoxEmitter( + core::aabbox3d(-3,0,-3,3,1,3), + core::vector3df(0.0f,0.03f,0.0f), + 80,100, + video::SColor(10,255,255,255), video::SColor(10,255,255,255), + 400,1100); + em->setMinStartSize(core::dimension2d(30.0f, 40.0f)); + em->setMaxStartSize(core::dimension2d(30.0f, 40.0f)); + + ps->setEmitter(em); + em->drop(); + + // create and set affector + scene::IParticleAffector* paf = ps->createFadeOutParticleAffector(); + ps->addAffector(paf); + paf->drop(); + + // 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->setMaterialType(video::EMT_TRANSPARENT_ADD_COLOR); + + MyEventReceiver receiver(room, earth, env, driver); + device->setEventReceiver(&receiver); + + /* + Finally, draw everything. That's it. + */ + + int lastFPS = -1; + + while(device->run()) + if (device->isWindowActive()) + { + driver->beginScene(true, true, 0); + + smgr->drawAll(); + env->drawAll(); + + driver->endScene(); + + int fps = driver->getFPS(); + + if (lastFPS != fps) + { + core::stringw str = L"Per pixel lighting example - Irrlicht Engine ["; + str += driver->getName(); + str += "] FPS:"; + str += fps; + + device->setWindowCaption(str.c_str()); + lastFPS = fps; + } + } + + device->drop(); + + return 0; +} + +/* +**/ diff --git a/libraries/irrlicht-1.8.1/examples/11.PerPixelLighting/tutorial.html b/libraries/irrlicht-1.8.1/examples/11.PerPixelLighting/tutorial.html new file mode 100644 index 0000000..89e87bd --- /dev/null +++ b/libraries/irrlicht-1.8.1/examples/11.PerPixelLighting/tutorial.html @@ -0,0 +1,502 @@ + + +Irrlicht Engine Tutorial + + + + +
+ + + + + + + + +
+
+
Tutorial 11. Per pixel lighting
+
+
+
+

This tutorial shows how to use one of the built in more complex materials + in irrlicht: Per pixel lighted surfaces using normal maps and parallax + mapping. It will also show how to use fog and moving particle systems. + And don't panic: You dont need any experience with shaders to use these + materials in Irrlicht.

+

The program which is described here will look like this:

+


+

+
+
+
+ + + + + + + +
Lets start!
+
+

At first, we need to include all headers and do the stuff we always + do, like in nearly all other tutorials.

+ + + + +
#include <irrlicht.h>
#include <iostream>

using namespace irr;

#pragma comment(lib, "Irrlicht.lib")
+

For this example, we need an event receiver, to make it possible + for the user to switch between the three available material types. + In addition, the event receiver will create some small GUI window + which displays what material is currently being used. There is nothing + special done in this class, so maybe you want to skip reading it.

+ + + + +
class MyEventReceiver : public IEventReceiver
+{
+public:
+
+	MyEventReceiver(scene::ISceneNode* room, 
+		gui::IGUIEnvironment* env, video::IVideoDriver* driver)
+	{
+		// store pointer to room so we can change its drawing mode
+		Room = room;
+		Driver = driver;
+
+		// set a nicer font
+		gui::IGUISkin* skin = env->getSkin();
+		gui::IGUIFont* font = env->getFont("../../media/fonthaettenschweiler.bmp");
+		if (font)
+			skin->setFont(font);
+
+		// add window and listbox
+		gui::IGUIWindow* window = env->addWindow(
+			core::rect(490,390,630,470), false, L"Use 'E' + 'R' to change");
+
+		ListBox = env->addListBox(
+			core::rect(2,22,135,78), window);
+
+		ListBox->addItem(L"Diffuse");
+		ListBox->addItem(L"Bump mapping");
+		ListBox->addItem(L"Parallax mapping");
+		ListBox->setSelected(1);
+
+		// create problem text
+		ProblemText = env->addStaticText(
+			L"Your hardware or this renderer is not able to use the "\
+			L"needed shaders for this material. Using fall back materials.",
+			core::rect(150,20,470,60));
+
+		ProblemText->setOverrideColor(video::SColor(100,255,255,255));
+
+		// set start material (prefer parallax mapping if available)
+		video::IMaterialRenderer* renderer = 
+			Driver->getMaterialRenderer(video::EMT_PARALLAX_MAP_SOLID);
+		if (renderer && renderer->getRenderCapability() == 0)
+			ListBox->setSelected(2);
+
+		// set the material which is selected in the listbox
+		setMaterial();
+	}
+
+	bool OnEvent(const SEvent& event)
+	{
+		// check if user presses the key 'E' or 'R'
+		if (event.EventType == irr::EET_KEY_INPUT_EVENT &&
+			!event.KeyInput.PressedDown && Room && ListBox)
+		{
+			// change selected item in listbox 
+
+			int sel = ListBox->getSelected();
+			if (event.KeyInput.Key == irr::KEY_KEY_R)
+				++sel;
+			else
+			if (event.KeyInput.Key == irr::KEY_KEY_E)
+				--sel;
+			else 
+				return false;
+
+			if (sel > 2) sel = 0;
+			if (sel < 0) sel = 2;
+			ListBox->setSelected(sel);
+			
+			// set the material which is selected in the listbox
+			setMaterial();
+		}
+
+		return false;
+	}
+
+private:
+
+	// sets the material of the room mesh the the one set in the 
+	// list box.
+	void setMaterial()
+	{
+		video::E_MATERIAL_TYPE type = video::EMT_SOLID;
+
+		// change material setting
+		switch(ListBox->getSelected())
+		{
+		case 0: type = video::EMT_SOLID;
+			break;
+		case 1: type = video::EMT_NORMAL_MAP_SOLID;
+			break;
+		case 2: type = video::EMT_PARALLAX_MAP_SOLID;
+			break;
+		}
+
+		Room->setMaterialType(type);
+
+

We need to add a warning if the materials will not be able to be + displayed 100% correctly. This is no problem, they will be renderered + using fall back materials, but at least the user should know that + it would look better on better hardware. We simply check if the material + renderer is able to draw at full quality on the current hardware. + The IMaterialRenderer::getRenderCapability() returns 0 if this is + the case.
+

+ + + + +
video::IMaterialRenderer* renderer = Driver->getMaterialRenderer(type);
+
+		// display some problem text when problem
+		if (!renderer || renderer->getRenderCapability() != 0)
+			ProblemText->setVisible(true);
+		else
+			ProblemText->setVisible(false);
+	}
+
+private:
+
+	gui::IGUIStaticText* ProblemText;
+	gui::IGUIListBox* ListBox;
+
+	scene::ISceneNode* Room;	
+	video::IVideoDriver* Driver;
+};
+


+ Now for the real fun. We create an Irrlicht Device and start to setup + the scene.
+

+ + + + +
int main()
+{
+	// let user select driver type
+
+	video::E_DRIVER_TYPE driverType = video::EDT_DIRECT3D9;
+
printf("Please select the driver you want for this example:\n"\
" (a) Direct3D 9.0c\n (b) Direct3D 8.1\n (c) OpenGL 1.5\n"\
" (d) Software Renderer\n (e) Apfelbaum Software Renderer\n"\
" (f) NullDevice\n (otherKey) exit\n\n");
+ char i; + std::cin >> i; + + switch(i)
{
case 'a': driverType = video::EDT_DIRECT3D9;break;
case 'b': driverType = video::EDT_DIRECT3D8;break;
case 'c': driverType = video::EDT_OPENGL; break;
case 'd': driverType = video::EDT_SOFTWARE; break;
case 'e': driverType = video::EDT_BURNINGSVIDEO;break;
case 'f': driverType = video::EDT_NULL; break;
default: return 0;
} + + // create device + + IrrlichtDevice* device = createDevice(driverType, core::dimension2d(640, 480)); + + if (device == 0) + return 1; // could not create selected driver. +
+
+ Before we start with the interesting stuff, we do some simple things: + Store pointers to the most important parts of the engine (video driver,
+ scene manager, gui environment) to safe us from typing too much, add + an irrlicht engine logo to the window and a user controlled first person + shooter style camera. Also, we let the engine now that it should store + all textures in 32 bit. This necessary because for parallax mapping, + we need 32 bit textures.
+
+ + + + +
+	video::IVideoDriver* driver = device->getVideoDriver();
+	scene::ISceneManager* smgr = device->getSceneManager();
+	gui::IGUIEnvironment* env = device->getGUIEnvironment();
+
+	driver->setTextureCreationFlag(video::ETCF_ALWAYS_32_BIT, true);
+
+	// add irrlicht logo
+	env->addImage(driver->getTexture("../../media/irrlichtlogoalpha.tga"),
+		core::position2d(10,10));
+		
+	// add camera
+	scene::ICameraSceneNode* camera = 
+		smgr->addCameraSceneNodeFPS(0,100.0f,300.0f);
+	camera->setPosition(core::vector3df(-200,200,-200));
+
+	// disable mouse cursor
+	device->getCursorControl()->setVisible(false);
+
+ Because we want the whole scene to look a little bit scarier, we add + some fog to it. This is done by a call to IVideoDriver::setFog(). There + you can set
+ various fog settings. In this example, we use pixel fog, because it + will work well with the materials we'll use in this example. Please + note that you will have to set the material flag EMF_FOG_ENABLE to 'true' + in every scene node which should be affected by this fog.
+
+ + + + +
driver->setFog(video::SColor(0,138,125,81), true, 250, 1000, 0, true);
+
+ To be able to display something interesting, we load a mesh from a .3ds + file which is a room I modeled with anim8or. It is the same room as +
+ from the specialFX example. Maybe you remember from that tutorial, I + am no good modeler at all and so I totally messed up the texture mapping + in this model, but we can simply repair it with the IMeshManipulator::makePlanarTextureMapping() + method.
+
+ + + + +
	scene::IAnimatedMesh* roomMesh = smgr->getMesh(
+		"../../media/room.3ds");
+	scene::ISceneNode* room = 0;
+
+	if (roomMesh)
+	{
+		smgr->getMeshManipulator()->makePlanarTextureMapping(
+				roomMesh->getMesh(0), 0.003f);
+
+ Now for the first exciting thing: If we successfully loaded the mesh + we need to apply textures to it. Because we want this room to be displayed + with a very cool material, we have to do a little bit more than just + set the textures. Instead of only loading a color map as usual, we also + load a height map which is simply a grayscale texture. From this height + map, we create a normal map which we will set as second texture of the + room. If you already have a normal map, you could directly set it, but + I simply didn´t find a nice normal map for this texture. The normal + map texture is being generated by the makeNormalMapTexture method
+ of the VideoDriver. The second parameter specifies the height of the + heightmap. If you set it to a bigger value, the map will look more rocky.
+
+ + + + +
		video::ITexture* colorMap = driver->getTexture("../../media/rockwall.bmp");
+		video::ITexture* normalMap = driver->getTexture("../../media/rockwall_height.bmp");
+		
+		driver->makeNormalMapTexture(normalMap, 9.0f);
+
+ But just setting color and normal map is not everything. The material + we want to use needs some additional informations per vertex like tangents + and binormals.
+ Because we are too lazy to calculate that information now, we let Irrlicht + do this for us. That's why we call IMeshManipulator::createMeshWithTangents(). + It
+ creates a mesh copy with tangents and binormals from any other mesh. + After we've done that, we simply create a standard mesh scene node with + this
+ mesh copy, set color and normal map and adjust some other material settings. + Note that we set EMF_FOG_ENABLE to true to enable fog in the room.
+
+ + + + +
scene::IMesh* tangentMesh = smgr->getMeshManipulator()->createMeshWithTangents(
roomMesh->getMesh(0));

room = smgr->addMeshSceneNode(tangentMesh);
room->setMaterialTexture(0, colorMap);
room->setMaterialTexture(1, normalMap);
room->getMaterial(0).SpecularColor.set(0,0,0,0);
room->setMaterialFlag(video::EMF_FOG_ENABLE, true);
room->setMaterialType(video::EMT_PARALLAX_MAP_SOLID);
room->getMaterial(0).MaterialTypeParam = 0.02f; // adjust height for parallax effect
// drop mesh because we created it with a create.. call.
tangentMesh->drop();
}
+
+ After we've created a room shaded by per pixel lighting, we add a sphere + into it with the same material, but we'll make it transparent. In addition,
+ because the sphere looks somehow like a familiar planet, we make it + rotate. The procedure is similar as before. The difference is that we + are loading
+ the mesh from an .x file which already contains a color map so we do + not need to load it manually. But the sphere is a little bit too small + for our needs, so we scale it by the factor 50.
+
+ + + + +
// add earth sphere
+
+	scene::IAnimatedMesh* earthMesh = smgr->getMesh("../../media/earth.x");
+	if (earthMesh)
+	{
+		// create mesh copy with tangent informations from original earth.x mesh
+		scene::IMesh* tangentSphereMesh = 
+			smgr->getMeshManipulator()->createMeshWithTangents(earthMesh->getMesh(0));
+
+		// set the alpha value of all vertices to 200
+		smgr->getMeshManipulator()->setVertexColorAlpha(tangentSphereMesh, 200);
+		
+		// scale the mesh by factor 50
+		smgr->getMeshManipulator()->scaleMesh(
+			tangentSphereMesh, core::vector3df(50,50,50));
+
+		// create mesh scene node
+		scene::ISceneNode* sphere = smgr->addMeshSceneNode(tangentSphereMesh);
+		sphere->setPosition(core::vector3df(-70,130,45));
+
+		// load heightmap, create normal map from it and set it
+		video::ITexture* earthNormalMap = driver->getTexture("../../media/earthbump.bmp");
+		driver->makeNormalMapTexture(earthNormalMap, 20.0f);
+		sphere->setMaterialTexture(1, earthNormalMap);
+
+		// adjust material settings
+		sphere->setMaterialFlag(video::EMF_FOG_ENABLE, true);
+		sphere->setMaterialType(video::EMT_NORMAL_MAP_TRANSPARENT_VERTEX_ALPHA); 
+
+		// add rotation animator
+		scene::ISceneNodeAnimator* anim =
+			smgr->createRotationAnimator(core::vector3df(0,0.1f,0));	
+		sphere->addAnimator(anim);
+		anim->drop();
+
+		// drop mesh because we created it with a create.. call.
+		tangentSphereMesh->drop();
+	}
+
+ Per pixel lighted materials only look cool when there are moving lights. + So we add some. And because moving lights alone are so boring, we add + billboards
+ to them, and a whole particle system to one of them. We start with the + first light which is red and has only the billboard attached.
+
+ + + + +
// add light 1 (nearly red)
+	scene::ILightSceneNode* light1 = 
+		smgr->addLightSceneNode(0, core::vector3df(0,0,0), 
+		video::SColorf(0.5f, 1.0f, 0.5f, 0.0f), 200.0f);
+
+	// add fly circle animator to light 1
+	scene::ISceneNodeAnimator* anim = 
+		smgr->createFlyCircleAnimator (core::vector3df(50,300,0),190.0f, -0.003f);
+	light1->addAnimator(anim);
+	anim->drop();
+
+	// attach billboard to the light
+	scene::ISceneNode* bill = 
+		smgr->addBillboardSceneNode(light1, core::dimension2d(60, 60));
+
+	bill->setMaterialFlag(video::EMF_LIGHTING, false);
+	bill->setMaterialType(video::EMT_TRANSPARENT_ADD_COLOR);
+	bill->setMaterialTexture(0, driver->getTexture("../../media/particlered.bmp"));
+
+ Now the same again, with the second light. The difference is that we + add a particle system to it too. And because the light moves, the particles + of the particlesystem will follow. If you want to know more about how + particle systems are created in Irrlicht, take a look at the specialFx + example.
+ Maybe you will have noticed that we only add 2 lights, this has a simple + reason: The low end version of this material was written in ps1.1 and + vs1.1, which doesn't allow more lights. You could add a third light + to the scene, but it won't be used to shade the walls. But of course, + this will change in future versions of Irrlicht were higher versions + of pixel/vertex shaders will be implemented too.
+
+ + + + +
// add light 2 (gray)
+	scene::ISceneNode* light2 = 
+		smgr->addLightSceneNode(0, core::vector3df(0,0,0), 
+		video::SColorf(1.0f, 0.2f, 0.2f, 0.0f), 200.0f);
+
+	// add fly circle animator to light 2
+	anim = smgr->createFlyCircleAnimator (core::vector3df(0,150,0),200.0f); 
+	light2->addAnimator(anim);
+	anim->drop();
+
+	// attach billboard to light
+	bill = smgr->addBillboardSceneNode(light2, core::dimension2d(120, 120));
+	bill->setMaterialFlag(video::EMF_LIGHTING, false);
+	bill->setMaterialType(video::EMT_TRANSPARENT_ADD_COLOR);
+	bill->setMaterialTexture(0, driver->getTexture("../../media/particlewhite.bmp"));
+
+	// add particle system
+	scene::IParticleSystemSceneNode* ps = 
+		smgr->addParticleSystemSceneNode(false, light2);
+
+	ps->setParticleSize(core::dimension2d(30.0f, 40.0f));
+
+	// create and set emitter
+	scene::IParticleEmitter* em = ps->createBoxEmitter(
+		core::aabbox3d(-3,0,-3,3,1,3), 
+		core::vector3df(0.0f,0.03f,0.0f),
+		80,100, 
+		video::SColor(0,255,255,255), video::SColor(0,255,255,255),
+		400,1100);
+	ps->setEmitter(em);
+	em->drop();
+
+	// create and set affector
+	scene::IParticleAffector* paf = ps->createFadeOutParticleAffector();
+	ps->addAffector(paf);
+	paf->drop();
+
+	// adjust some material settings
+	ps->setMaterialFlag(video::EMF_LIGHTING, false);
+	ps->setMaterialTexture(0, driver->getTexture("../../media/fireball.bmp"));
+	ps->setMaterialType(video::EMT_TRANSPARENT_VERTEX_ALPHA);
+
+
+	MyEventReceiver receiver(room, env, driver);
+	device->setEventReceiver(&receiver);
+
+ Finally, draw everything. That's it.
+
+ + + + +
int lastFPS = -1;
+
+	while(device->run())
+	if (device->isWindowActive())
+	{
+		driver->beginScene(true, true, 0);
+
+		smgr->drawAll();
+		env->drawAll();
+
+		driver->endScene();
+
+		int fps = driver->getFPS();
+
+		if (lastFPS != fps)
+		{
+		  core::stringw str = L"Per pixel lighting example - Irrlicht Engine [";
+		  str += driver->getName();
+		  str += "] FPS:";
+		  str += fps;
+
+		  device->setWindowCaption(str.c_str());
+		  lastFPS = fps;
+		}
+	}
+
+	device->drop();
+	
+	return 0;
+}
+
+
+
+
+
+

 

+ + diff --git a/libraries/irrlicht-1.8.1/examples/12.TerrainRendering/Makefile b/libraries/irrlicht-1.8.1/examples/12.TerrainRendering/Makefile new file mode 100644 index 0000000..92b529f --- /dev/null +++ b/libraries/irrlicht-1.8.1/examples/12.TerrainRendering/Makefile @@ -0,0 +1,38 @@ +# Makefile for Irrlicht Examples +# It's usually sufficient to change just the target name and source file list +# and be sure that CXX is set to a valid compiler +Target = 12.TerrainRendering +Sources = main.cpp + +# general compiler settings +CPPFLAGS = -I../../include -I/usr/X11R6/include +CXXFLAGS = -O3 -ffast-math +#CXXFLAGS = -g -Wall + +#default target is Linux +all: all_linux + +ifeq ($(HOSTTYPE), x86_64) +LIBSELECT=64 +endif + +# target specific settings +all_linux: LDFLAGS = -L/usr/X11R6/lib$(LIBSELECT) -L../../lib/Linux -lIrrlicht -lGL -lXxf86vm -lXext -lX11 -lXcursor +all_linux clean_linux: SYSTEM=Linux +all_win32: LDFLAGS = -L../../lib/Win32-gcc -lIrrlicht -lopengl32 -lm +all_win32 clean_win32: SYSTEM=Win32-gcc +all_win32 clean_win32: SUF=.exe +# name of the binary - only valid for targets which set SYSTEM +DESTPATH = ../../bin/$(SYSTEM)/$(Target)$(SUF) + +all_linux all_win32: + $(warning Building...) + $(CXX) $(CPPFLAGS) $(CXXFLAGS) $(Sources) -o $(DESTPATH) $(LDFLAGS) + +clean: clean_linux clean_win32 + $(warning Cleaning...) + +clean_linux clean_win32: + @$(RM) $(DESTPATH) + +.PHONY: all all_win32 clean clean_linux clean_win32 diff --git a/libraries/irrlicht-1.8.1/examples/12.TerrainRendering/TerrainRendering.cbp b/libraries/irrlicht-1.8.1/examples/12.TerrainRendering/TerrainRendering.cbp new file mode 100644 index 0000000..a0c93b7 --- /dev/null +++ b/libraries/irrlicht-1.8.1/examples/12.TerrainRendering/TerrainRendering.cbp @@ -0,0 +1,56 @@ + + + + + + diff --git a/libraries/irrlicht-1.8.1/examples/12.TerrainRendering/TerrainRendering.dev b/libraries/irrlicht-1.8.1/examples/12.TerrainRendering/TerrainRendering.dev new file mode 100644 index 0000000..678e536 --- /dev/null +++ b/libraries/irrlicht-1.8.1/examples/12.TerrainRendering/TerrainRendering.dev @@ -0,0 +1,59 @@ +[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/libraries/irrlicht-1.8.1/examples/12.TerrainRendering/TerrainRendering.vcproj b/libraries/irrlicht-1.8.1/examples/12.TerrainRendering/TerrainRendering.vcproj new file mode 100644 index 0000000..2200562 --- /dev/null +++ b/libraries/irrlicht-1.8.1/examples/12.TerrainRendering/TerrainRendering.vcproj @@ -0,0 +1,163 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/libraries/irrlicht-1.8.1/examples/12.TerrainRendering/TerrainRendering_vc10.vcxproj b/libraries/irrlicht-1.8.1/examples/12.TerrainRendering/TerrainRendering_vc10.vcxproj new file mode 100644 index 0000000..c68f9ff --- /dev/null +++ b/libraries/irrlicht-1.8.1/examples/12.TerrainRendering/TerrainRendering_vc10.vcxproj @@ -0,0 +1,231 @@ + + + + + Debug + Win32 + + + Debug + x64 + + + Release + Win32 + + + Release + x64 + + + + 12.TerrainRendering + {3A5B74E5-6390-43B0-A459-2793B81FFD31} + TerrainRendering + + + + Application + false + MultiByte + + + Application + false + MultiByte + + + Application + false + MultiByte + + + Application + false + MultiByte + + + + + + + + + + + + + + + + + + + + + + + <_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/libraries/irrlicht-1.8.1/examples/12.TerrainRendering/TerrainRendering_vc11.vcxproj b/libraries/irrlicht-1.8.1/examples/12.TerrainRendering/TerrainRendering_vc11.vcxproj new file mode 100644 index 0000000..d91cb76 --- /dev/null +++ b/libraries/irrlicht-1.8.1/examples/12.TerrainRendering/TerrainRendering_vc11.vcxproj @@ -0,0 +1,235 @@ + + + + + Debug + Win32 + + + Debug + x64 + + + Release + Win32 + + + Release + x64 + + + + 12.TerrainRendering + {3A5B74E5-6390-43B0-A459-2793B81FFD31} + TerrainRendering + + + + Application + false + MultiByte + v110 + + + Application + false + MultiByte + v110 + + + Application + false + MultiByte + v110 + + + Application + false + MultiByte + v110 + + + + + + + + + + + + + + + + + + + + + + + <_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/libraries/irrlicht-1.8.1/examples/12.TerrainRendering/TerrainRendering_vc8.vcproj b/libraries/irrlicht-1.8.1/examples/12.TerrainRendering/TerrainRendering_vc8.vcproj new file mode 100644 index 0000000..757e2f6 --- /dev/null +++ b/libraries/irrlicht-1.8.1/examples/12.TerrainRendering/TerrainRendering_vc8.vcproj @@ -0,0 +1,231 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/libraries/irrlicht-1.8.1/examples/12.TerrainRendering/TerrainRendering_vc9.vcproj b/libraries/irrlicht-1.8.1/examples/12.TerrainRendering/TerrainRendering_vc9.vcproj new file mode 100644 index 0000000..8a7f2f1 --- /dev/null +++ b/libraries/irrlicht-1.8.1/examples/12.TerrainRendering/TerrainRendering_vc9.vcproj @@ -0,0 +1,230 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/libraries/irrlicht-1.8.1/examples/12.TerrainRendering/main.cpp b/libraries/irrlicht-1.8.1/examples/12.TerrainRendering/main.cpp new file mode 100644 index 0000000..d829244 --- /dev/null +++ b/libraries/irrlicht-1.8.1/examples/12.TerrainRendering/main.cpp @@ -0,0 +1,285 @@ +/** Example 012 Terrain Rendering + +This tutorial will briefly show how to use the terrain renderer of Irrlicht. It +will also show the terrain renderer triangle selector to be able to do +collision detection with terrain. + +Note that the Terrain Renderer in Irrlicht is based on Spintz' +GeoMipMapSceneNode, lots of thanks go to him. DeusXL provided a new elegant +simple solution for building larger area on small heightmaps -> terrain +smoothing. + +In the beginning there is nothing special. We include the needed header files +and create an event listener to listen if the user presses a key: The 'W' key +switches to wireframe mode, the 'P' key to pointcloud mode, and the 'D' key +toggles between solid and detail mapped material. +*/ +#include +#include "driverChoice.h" + +using namespace irr; + +#ifdef _MSC_VER +#pragma comment(lib, "Irrlicht.lib") +#endif + + +class MyEventReceiver : public IEventReceiver +{ +public: + + MyEventReceiver(scene::ISceneNode* terrain, scene::ISceneNode* skybox, scene::ISceneNode* skydome) : + Terrain(terrain), Skybox(skybox), Skydome(skydome), showBox(true), showDebug(false) + { + Skybox->setVisible(showBox); + Skydome->setVisible(!showBox); + } + + bool OnEvent(const SEvent& event) + { + // check if user presses the key 'W' or 'D' + if (event.EventType == irr::EET_KEY_INPUT_EVENT && !event.KeyInput.PressedDown) + { + switch (event.KeyInput.Key) + { + case irr::KEY_KEY_W: // switch wire frame mode + Terrain->setMaterialFlag(video::EMF_WIREFRAME, + !Terrain->getMaterial(0).Wireframe); + Terrain->setMaterialFlag(video::EMF_POINTCLOUD, false); + return true; + case irr::KEY_KEY_P: // switch wire frame mode + Terrain->setMaterialFlag(video::EMF_POINTCLOUD, + !Terrain->getMaterial(0).PointCloud); + Terrain->setMaterialFlag(video::EMF_WIREFRAME, false); + return true; + case irr::KEY_KEY_D: // toggle detail map + Terrain->setMaterialType( + Terrain->getMaterial(0).MaterialType == video::EMT_SOLID ? + video::EMT_DETAIL_MAP : video::EMT_SOLID); + return true; + case irr::KEY_KEY_S: // toggle skies + showBox=!showBox; + Skybox->setVisible(showBox); + Skydome->setVisible(!showBox); + return true; + case irr::KEY_KEY_X: // toggle debug information + showDebug=!showDebug; + Terrain->setDebugDataVisible(showDebug?scene::EDS_BBOX_ALL:scene::EDS_OFF); + return true; + default: + break; + } + } + + return false; + } + +private: + scene::ISceneNode* Terrain; + scene::ISceneNode* Skybox; + scene::ISceneNode* Skydome; + bool showBox; + bool showDebug; +}; + + +/* +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 main() +{ + // ask user for driver + video::E_DRIVER_TYPE driverType=driverChoiceConsole(); + if (driverType==video::EDT_COUNT) + return 1; + + // create device with full flexibility over creation parameters + // you can add more parameters if desired, check irr::SIrrlichtCreationParameters + irr::SIrrlichtCreationParameters params; + params.DriverType=driverType; + params.WindowSize=core::dimension2d(640, 480); + IrrlichtDevice* device = createDeviceEx(params); + + if (device == 0) + return 1; // could not create selected driver. + + + /* + First, we add standard stuff to the scene: A nice irrlicht engine + logo, a small help text, a user controlled camera, and we disable + the mouse cursor. + */ + + video::IVideoDriver* driver = device->getVideoDriver(); + scene::ISceneManager* smgr = device->getSceneManager(); + gui::IGUIEnvironment* env = device->getGUIEnvironment(); + + driver->setTextureCreationFlag(video::ETCF_ALWAYS_32_BIT, true); + + // add irrlicht logo + env->addImage(driver->getTexture("../../media/irrlichtlogo2.png"), + core::position2d(10,10)); + + //set other font + env->getSkin()->setFont(env->getFont("../../media/fontlucida.png")); + + // add some help text + env->addStaticText( + L"Press 'W' to change wireframe mode\nPress 'D' to toggle detail map\nPress 'S' to toggle skybox/skydome", + core::rect(10,421,250,475), true, true, 0, -1, true); + + // add camera + scene::ICameraSceneNode* camera = + smgr->addCameraSceneNodeFPS(0,100.0f,1.2f); + + camera->setPosition(core::vector3df(2700*2,255*2,2600*2)); + camera->setTarget(core::vector3df(2397*2,343*2,2700*2)); + camera->setFarValue(42000.0f); + + // disable mouse cursor + device->getCursorControl()->setVisible(false); + + /* + Here comes the terrain renderer scene node: We add it just like any + other scene node to the scene using + ISceneManager::addTerrainSceneNode(). The only parameter we use is a + file name to the heightmap we use. A heightmap is simply a gray scale + texture. The terrain renderer loads it and creates the 3D terrain from + it. + + To make the terrain look more big, we change the scale factor of + it to (40, 4.4, 40). Because we don't have any dynamic lights in the + scene, we switch off the lighting, and we set the file + terrain-texture.jpg as texture for the terrain and detailmap3.jpg as + second texture, called detail map. At last, we set the scale values for + the texture: The first texture will be repeated only one time over the + whole terrain, and the second one (detail map) 20 times. + */ + + // add terrain scene node + scene::ITerrainSceneNode* terrain = smgr->addTerrainSceneNode( + "../../media/terrain-heightmap.bmp", + 0, // parent node + -1, // node id + core::vector3df(0.f, 0.f, 0.f), // position + core::vector3df(0.f, 0.f, 0.f), // rotation + core::vector3df(40.f, 4.4f, 40.f), // scale + video::SColor ( 255, 255, 255, 255 ), // vertexColor + 5, // maxLOD + scene::ETPS_17, // patchSize + 4 // smoothFactor + ); + + terrain->setMaterialFlag(video::EMF_LIGHTING, false); + + terrain->setMaterialTexture(0, + driver->getTexture("../../media/terrain-texture.jpg")); + terrain->setMaterialTexture(1, + driver->getTexture("../../media/detailmap3.jpg")); + + terrain->setMaterialType(video::EMT_DETAIL_MAP); + + terrain->scaleTexture(1.0f, 20.0f); + + /* + To be able to do collision with the terrain, we create a triangle selector. + If you want to know what triangle selectors do, just take a look into the + collision tutorial. The terrain triangle selector works together with the + terrain. To demonstrate this, we create a collision response animator + and attach it to the camera, so that the camera will not be able to fly + through the terrain. + */ + + // create triangle selector for the terrain + scene::ITriangleSelector* selector + = smgr->createTerrainTriangleSelector(terrain, 0); + terrain->setTriangleSelector(selector); + + // create collision response animator and attach it to the camera + scene::ISceneNodeAnimator* anim = smgr->createCollisionResponseAnimator( + selector, camera, core::vector3df(60,100,60), + core::vector3df(0,0,0), + core::vector3df(0,50,0)); + selector->drop(); + camera->addAnimator(anim); + anim->drop(); + + /* If you need access to the terrain data you can also do this directly via the following code fragment. + */ + scene::CDynamicMeshBuffer* buffer = new scene::CDynamicMeshBuffer(video::EVT_2TCOORDS, video::EIT_16BIT); + terrain->getMeshBufferForLOD(*buffer, 0); + video::S3DVertex2TCoords* data = (video::S3DVertex2TCoords*)buffer->getVertexBuffer().getData(); + // Work on data or get the IndexBuffer with a similar call. + buffer->drop(); // When done drop the buffer again. + + /* + To make the user be able to switch between normal and wireframe mode, + we create an instance of the event receiver from above and let Irrlicht + know about it. In addition, we add the skybox which we already used in + lots of Irrlicht examples and a skydome, which is shown mutually + exclusive with the skybox by pressing 'S'. + */ + + // create skybox and skydome + 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->setTextureCreationFlag(video::ETCF_CREATE_MIP_MAPS, true); + + // create event receiver + MyEventReceiver receiver(terrain, skybox, skydome); + device->setEventReceiver(&receiver); + + /* + That's it, draw everything. + */ + + int lastFPS = -1; + + while(device->run()) + if (device->isWindowActive()) + { + driver->beginScene(true, true, 0 ); + + smgr->drawAll(); + env->drawAll(); + + driver->endScene(); + + // display frames per second in window title + int fps = driver->getFPS(); + if (lastFPS != fps) + { + core::stringw str = L"Terrain Renderer - Irrlicht Engine ["; + str += driver->getName(); + str += "] FPS:"; + str += fps; + // Also print terrain height of current camera position + // We can use camera position because terrain is located at coordinate origin + str += " Height: "; + str += terrain->getHeight(camera->getAbsolutePosition().X, + camera->getAbsolutePosition().Z); + + device->setWindowCaption(str.c_str()); + lastFPS = fps; + } + } + + device->drop(); + + return 0; +} + +/* +Now you know how to use terrain in Irrlicht. +**/ diff --git a/libraries/irrlicht-1.8.1/examples/12.TerrainRendering/tutorial.html b/libraries/irrlicht-1.8.1/examples/12.TerrainRendering/tutorial.html new file mode 100644 index 0000000..f3d765f --- /dev/null +++ b/libraries/irrlicht-1.8.1/examples/12.TerrainRendering/tutorial.html @@ -0,0 +1,122 @@ + + +Irrlicht Engine Tutorial + + + + +
+ + + + + + + + +
+
+
Tutorial 12. Terrain Rendering
+
+
+
+

This tutorial will briefly show how to use the terrain renderer of + Irrlicht. It will also show the terrain renderer triangle selector to + be able to do collision detection with terrain.

+

The program which is described here will look like this:

+

+


+ Note that the terrain renderer in Irrlicht is based the terrain renderer + by Soconne and the GeoMipMapSceneNode developed by Spinz, lots of thanks + go to them.

+
+
+
+ + + + + + + +
Lets start!
+
+

In the beginning there is nothing special. We include the needed + header files and create an event listener to listen if the user presses + the 'W' key so we can switch to wireframe mode and if he presses 'D' + we toggle to material between solid and detail mapped.

+ + + + +
#include <irrlicht.h>
#include <iostream>
using namespace irr;

#pragma comment(lib, "Irrlicht.lib")

class MyEventReceiver : public IEventReceiver
{
public:
MyEventReceiver(scene::ISceneNode* terrain)
{
// store pointer to terrain so we can change its drawing mode
Terrain = terrain;
}

bool OnEvent(const SEvent& event)
{
// check if user presses the key 'W' or 'D'
if (event.EventType == irr::EET_KEY_INPUT_EVENT && !event.KeyInput.PressedDown)
{
switch (event.KeyInput.Key)
{
case irr::KEY_KEY_W: // switch wire frame mode
Terrain->setMaterialFlag(video::EMF_WIREFRAME, !Terrain->getMaterial(0).Wireframe);
return true;
case irr::KEY_KEY_D: // toggle detail map
Terrain->setMaterialType(
Terrain->getMaterial(0).MaterialType == video::EMT_SOLID ?
video::EMT_DETAIL_MAP : video::EMT_SOLID);
return true;
}
}
return false;
}

private:
scene::ISceneNode* Terrain;
};

+

The start of the main function starts like in most other example. + We ask the user for the desired renderer and start it up.

+ + + + +
int main()
{
// let user select driver type

video::E_DRIVER_TYPE driverType = video::EDT_DIRECT3D9;

printf("Please select the driver you want for this example:\n"\
" (a) Direct3D 9.0c\n (b) Direct3D 8.1\n (c) OpenGL 1.5\n"\
" (d) Software Renderer\n (e) Apfelbaum Software Renderer\n"\
" (f) NullDevice\n (otherKey) exit\n\n");

char i;
std::cin >> i;

switch(i)
{
case 'a': driverType = video::EDT_DIRECT3D9;break;
case 'b': driverType = video::EDT_DIRECT3D8;break;
case 'c': driverType = video::EDT_OPENGL; break;
case 'd': driverType = video::EDT_SOFTWARE; break;
case 'e': driverType = video::EDT_BURNINGSVIDEO;break;
case 'f': driverType = video::EDT_NULL; break;
default: return 1;
}

// create device
IrrlichtDevice* device = createDevice(driverType, core::dimension2d<s32>(640, 480));

if (device == 0)
return 1; // could not create selected driver.
+

First, we add standard stuff to the scene: A nice irrlicht engine + logo, a small help text, a user controlled camera, and we disable + the mouse cursor.

+ + + + +
video::IVideoDriver* driver = device->getVideoDriver();
scene::ISceneManager* smgr = device->getSceneManager();
gui::IGUIEnvironment* env = device->getGUIEnvironment();

driver->setTextureCreationFlag(video::ETCF_ALWAYS_32_BIT, true);

// add irrlicht logo
env->addImage(driver->getTexture("../../media/irrlichtlogoalpha.tga"),
core::position2d<s32>(10,10));
+// add some help text
gui::IGUIStaticText* text = env->addStaticText(
L"Press 'W' to change wireframe mode\nPress 'D' to toggle detail map",
core::rect<s32>(10,453,200,475), true, true, 0, -1, true);
+// add camera
scene::ICameraSceneNode* camera =
smgr->addCameraSceneNodeFPS(0,100.0f,1200.0f);
camera->setPosition(core::vector3df(1900*2,255*2,3700*2));
camera->setTarget(core::vector3df(2397*2,343*2,2700*2));
camera->setFarValue(12000.0f);

// disable mouse cursor
device->getCursorControl()->setVisible(false);
+

Here comes the terrain renderer scene node: We add it just like + any other scene node to the scene using ISceneManager::addTerrainSceneNode(). + The only parameter we use is a file name to the heightmap we use. + A heightmap is simply a gray scale texture. The terrain renderer loads + it and creates the 3D terrain from it.
+ To make the terrain look more big, we change the scale factor of it + to (40, 4.4, 40). Because we don't have any dynamic lights in the + scene, we switch off the lighting, and we set the file terrain-texture.jpg + as texture for the terrain and detailmap3.jpg as second texture, called + detail map. At last, we set the scale values for the texture: The + first texture will be repeated only one time over the whole terrain, + and the second one (detail map) 20 times.

+ + + + +
// add terrain scene node
scene::ITerrainSceneNode* terrain = smgr->addTerrainSceneNode(
"../../media/terrain-heightmap.bmp");

terrain->setScale(core::vector3df(40, 4.4f, 40));
terrain->setMaterialFlag(video::EMF_LIGHTING, false);

terrain->setMaterialTexture(0, driver->getTexture("../../media/terrain-texture.jpg"));
terrain->setMaterialTexture(1, driver->getTexture("../../media/detailmap3.jpg"));

terrain->setMaterialType(video::EMT_DETAIL_MAP);
terrain->scaleTexture(1.0f, 20.0f);
+

To be able to do collision with the terrain, we create a triangle + selector. If you want to know what triangle selectors do, just take + a look into the collision tutorial. The terrain triangle selector + works together with the terrain. To demonstrate this, we create a + collision response animator and attach it to the camera, so that the + camera will not be able to fly through the terrain.

+
+ + + + +
// create triangle selector for the terrain	
scene::ITriangleSelector* selector =
smgr->createTerrainTriangleSelector(terrain, 0);
terrain->setTriangleSelector(selector);

// create collision response animator and attach it to the camera
scene::ISceneNodeAnimator* anim = smgr->createCollisionResponseAnimator(
selector, camera, core::vector3df(60,100,60),
core::vector3df(0,0,0),
core::vector3df(0,50,0));
selector->drop();
camera->addAnimator(anim);
anim->drop();
+

To make the user be able to switch between normal and wireframe mode, + we create an instance of the event reciever from above and let Irrlicht + know about it. In addition, we add the skybox which we already used + in lots of Irrlicht examples.

+ + + + +
// create event receiver
MyEventReceiver receiver(terrain);
device->setEventReceiver(&receiver);

// create skybox
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->setTextureCreationFlag(video::ETCF_CREATE_MIP_MAPS, true);
+

That's it, draw everything. Now you know how to use terrain in Irrlicht.

+ + + + +
	int lastFPS = -1;

while(device->run())
if (device->isWindowActive())
{
driver->beginScene(true, true, 0 );

smgr->drawAll();
env->drawAll();

driver->endScene(); +
// display frames per second in window title + int fps = driver->getFPS();

if (lastFPS != fps)
{
core::stringw str = L"Terrain Renderer - Irrlicht Engine [";
str += driver->getName();
str += "] FPS:";
str += fps;
device->setWindowCaption(str.c_str());
lastFPS = fps;
}
}

device->drop();

return 0;
}
+

 

+
+
+

 

+ + diff --git a/libraries/irrlicht-1.8.1/examples/13.RenderToTexture/Makefile b/libraries/irrlicht-1.8.1/examples/13.RenderToTexture/Makefile new file mode 100644 index 0000000..7888648 --- /dev/null +++ b/libraries/irrlicht-1.8.1/examples/13.RenderToTexture/Makefile @@ -0,0 +1,38 @@ +# Makefile for Irrlicht Examples +# It's usually sufficient to change just the target name and source file list +# and be sure that CXX is set to a valid compiler +Target = 13.RenderToTexture +Sources = main.cpp + +# general compiler settings +CPPFLAGS = -I../../include -I/usr/X11R6/include +CXXFLAGS = -O3 -ffast-math +#CXXFLAGS = -g -Wall + +#default target is Linux +all: all_linux + +ifeq ($(HOSTTYPE), x86_64) +LIBSELECT=64 +endif + +# target specific settings +all_linux: LDFLAGS = -L/usr/X11R6/lib$(LIBSELECT) -L../../lib/Linux -lIrrlicht -lGL -lXxf86vm -lXext -lX11 -lXcursor +all_linux clean_linux: SYSTEM=Linux +all_win32: LDFLAGS = -L../../lib/Win32-gcc -lIrrlicht -lopengl32 -lm +all_win32 clean_win32: SYSTEM=Win32-gcc +all_win32 clean_win32: SUF=.exe +# name of the binary - only valid for targets which set SYSTEM +DESTPATH = ../../bin/$(SYSTEM)/$(Target)$(SUF) + +all_linux all_win32: + $(warning Building...) + $(CXX) $(CPPFLAGS) $(CXXFLAGS) $(Sources) -o $(DESTPATH) $(LDFLAGS) + +clean: clean_linux clean_win32 + $(warning Cleaning...) + +clean_linux clean_win32: + @$(RM) $(DESTPATH) + +.PHONY: all all_win32 clean clean_linux clean_win32 diff --git a/libraries/irrlicht-1.8.1/examples/13.RenderToTexture/RenderToTexture.cbp b/libraries/irrlicht-1.8.1/examples/13.RenderToTexture/RenderToTexture.cbp new file mode 100644 index 0000000..db3911e --- /dev/null +++ b/libraries/irrlicht-1.8.1/examples/13.RenderToTexture/RenderToTexture.cbp @@ -0,0 +1,55 @@ + + + + + + diff --git a/libraries/irrlicht-1.8.1/examples/13.RenderToTexture/RenderToTexture.dev b/libraries/irrlicht-1.8.1/examples/13.RenderToTexture/RenderToTexture.dev new file mode 100644 index 0000000..0ebdf28 --- /dev/null +++ b/libraries/irrlicht-1.8.1/examples/13.RenderToTexture/RenderToTexture.dev @@ -0,0 +1,59 @@ +[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/libraries/irrlicht-1.8.1/examples/13.RenderToTexture/RenderToTexture.vcproj b/libraries/irrlicht-1.8.1/examples/13.RenderToTexture/RenderToTexture.vcproj new file mode 100644 index 0000000..8fd8e6c --- /dev/null +++ b/libraries/irrlicht-1.8.1/examples/13.RenderToTexture/RenderToTexture.vcproj @@ -0,0 +1,163 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/libraries/irrlicht-1.8.1/examples/13.RenderToTexture/RenderToTexture_vc10.vcxproj b/libraries/irrlicht-1.8.1/examples/13.RenderToTexture/RenderToTexture_vc10.vcxproj new file mode 100644 index 0000000..e376054 --- /dev/null +++ b/libraries/irrlicht-1.8.1/examples/13.RenderToTexture/RenderToTexture_vc10.vcxproj @@ -0,0 +1,231 @@ + + + + + Debug + Win32 + + + Debug + x64 + + + Release + Win32 + + + Release + x64 + + + + 13.RenderToTexture + {0914E5C8-5352-467B-8421-C9EB35BD5596} + RenderToTexture + + + + Application + false + MultiByte + + + Application + false + MultiByte + + + Application + false + MultiByte + + + Application + false + MultiByte + + + + + + + + + + + + + + + + + + + + + + + <_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/libraries/irrlicht-1.8.1/examples/13.RenderToTexture/RenderToTexture_vc11.vcxproj b/libraries/irrlicht-1.8.1/examples/13.RenderToTexture/RenderToTexture_vc11.vcxproj new file mode 100644 index 0000000..f80b7c7 --- /dev/null +++ b/libraries/irrlicht-1.8.1/examples/13.RenderToTexture/RenderToTexture_vc11.vcxproj @@ -0,0 +1,235 @@ + + + + + Debug + Win32 + + + Debug + x64 + + + Release + Win32 + + + Release + x64 + + + + 13.RenderToTexture + {0914E5C8-5352-467B-8421-C9EB35BD5596} + RenderToTexture + + + + Application + false + MultiByte + v110 + + + Application + false + MultiByte + v110 + + + Application + false + MultiByte + v110 + + + Application + false + MultiByte + v110 + + + + + + + + + + + + + + + + + + + + + + + <_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/libraries/irrlicht-1.8.1/examples/13.RenderToTexture/RenderToTexture_vc8.vcproj b/libraries/irrlicht-1.8.1/examples/13.RenderToTexture/RenderToTexture_vc8.vcproj new file mode 100644 index 0000000..dc2840c --- /dev/null +++ b/libraries/irrlicht-1.8.1/examples/13.RenderToTexture/RenderToTexture_vc8.vcproj @@ -0,0 +1,231 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/libraries/irrlicht-1.8.1/examples/13.RenderToTexture/RenderToTexture_vc9.vcproj b/libraries/irrlicht-1.8.1/examples/13.RenderToTexture/RenderToTexture_vc9.vcproj new file mode 100644 index 0000000..7ee213b --- /dev/null +++ b/libraries/irrlicht-1.8.1/examples/13.RenderToTexture/RenderToTexture_vc9.vcproj @@ -0,0 +1,230 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/libraries/irrlicht-1.8.1/examples/13.RenderToTexture/main.cpp b/libraries/irrlicht-1.8.1/examples/13.RenderToTexture/main.cpp new file mode 100644 index 0000000..35ea009 --- /dev/null +++ b/libraries/irrlicht-1.8.1/examples/13.RenderToTexture/main.cpp @@ -0,0 +1,211 @@ +/** Example 013 Render To Texture + +This tutorial shows how to render to a texture using Irrlicht. Render to +texture is a feature with which it is possible to create nice special effects. +In addition, this tutorial shows how to enable specular highlights. + +In the beginning, everything as usual. Include the needed headers, ask the user +for the rendering driver, create the Irrlicht Device: +*/ + +#include +#include "driverChoice.h" + +using namespace irr; + +#ifdef _MSC_VER +#pragma comment(lib, "Irrlicht.lib") +#endif + +int main() +{ + // ask user for driver + video::E_DRIVER_TYPE driverType=driverChoiceConsole(); + if (driverType==video::EDT_COUNT) + return 1; + + // create device and exit if creation failed + + IrrlichtDevice *device = + createDevice(driverType, core::dimension2d(640, 480), + 16, false, false); + + if (device == 0) + return 1; // could not create selected driver. + + video::IVideoDriver* driver = device->getVideoDriver(); + scene::ISceneManager* smgr = device->getSceneManager(); + gui::IGUIEnvironment* env = device->getGUIEnvironment(); + + /* + Now, we load an animated mesh to be displayed. As in most examples, + we'll take the fairy md2 model. The difference here: We set the + shininess of the model to a value other than 0 which is the default + value. This enables specular highlights on the model if dynamic + lighting is on. The value influences the size of the highlights. + */ + + // load and display animated fairy mesh + + scene::IAnimatedMeshSceneNode* fairy = smgr->addAnimatedMeshSceneNode( + smgr->getMesh("../../media/faerie.md2")); + + if (fairy) + { + fairy->setMaterialTexture(0, + driver->getTexture("../../media/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)); + fairy->setMD2Animation ( scene::EMAT_STAND ); + } + + /* + To make specular highlights appear on the model, we need a dynamic + light in the scene. We add one directly in vicinity of the model. In + addition, to make the model not that dark, we set the ambient light to + gray. + */ + + // add white light + smgr->addLightSceneNode(0, core::vector3df(-15,5,-105), + video::SColorf(1.0f, 1.0f, 1.0f)); + + // set ambient light + smgr->setAmbientLight(video::SColor(0,60,60,60)); + + /* + The next is just some standard stuff: Add a test cube and let it rotate + to make the scene more interesting. The user defined camera and cursor + setup is made later on, right before the render loop. + */ + + // create test cube + scene::ISceneNode* test = smgr->addCubeSceneNode(60); + + // let the cube rotate and set some light settings + scene::ISceneNodeAnimator* anim = smgr->createRotationAnimator( + core::vector3df(0.3f, 0.3f,0)); + + test->setPosition(core::vector3df(-100,0,-100)); + test->setMaterialFlag(video::EMF_LIGHTING, false); // disable dynamic lighting + test->addAnimator(anim); + anim->drop(); + + // set window caption + device->setWindowCaption(L"Irrlicht Engine - Render to Texture and Specular Highlights example"); + + /* + To test out the render to texture feature, we need a render target + texture. These are not like standard textures, but need to be created + first. To create one, we call IVideoDriver::addRenderTargetTexture() + and specify the size of the texture. Please don't use sizes bigger than + the frame buffer for this, because the render target shares the zbuffer + with the frame buffer. + Because we want to render the scene not from the user camera into the + texture, we add another fixed camera to the scene. But before we do all + this, we check if the current running driver is able to render to + textures. If it is not, we simply display a warning text. + */ + + // create render target + video::ITexture* rt = 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 + + // add fixed camera + fixedCam = smgr->addCameraSceneNode(0, core::vector3df(10,10,-80), + core::vector3df(-10,10,-100)); + } + else + { + // create problem text + gui::IGUISkin* skin = env->getSkin(); + gui::IGUIFont* font = env->getFont("../../media/fonthaettenschweiler.bmp"); + if (font) + skin->setFont(font); + + gui::IGUIStaticText* text = env->addStaticText( + L"Your hardware or this renderer is not able to use the "\ + L"render to texture feature. RTT Disabled.", + core::rect(150,20,470,60)); + + text->setOverrideColor(video::SColor(100,255,255,255)); + } + + // add fps camera + scene::ICameraSceneNode* fpsCamera = smgr->addCameraSceneNodeFPS(); + fpsCamera->setPosition(core::vector3df(-50,50,-150)); + + // disable mouse cursor + device->getCursorControl()->setVisible(false); + + /* + Nearly finished. Now we need to draw everything. Every frame, we draw + the scene twice. Once from the fixed camera into the render target + texture and once as usual. When rendering into the render target, we + need to disable the visibility of the test cube, because it has the + render target texture applied to it. That's it, wasn't too complicated + I hope. :) + */ + + int lastFPS = -1; + + while(device->run()) + if (device->isWindowActive()) + { + driver->beginScene(true, true, 0); + + if (rt) + { + // draw scene into render target + + // set render target texture + driver->setRenderTarget(rt, true, true, video::SColor(0,0,0,255)); + + // make cube invisible and set fixed camera as active camera + test->setVisible(false); + smgr->setActiveCamera(fixedCam); + + // draw whole scene into render buffer + smgr->drawAll(); + + // set back old render target + // The buffer might have been distorted, so clear it + driver->setRenderTarget(0, true, true, 0); + + // make the cube visible and set the user controlled camera as active one + test->setVisible(true); + smgr->setActiveCamera(fpsCamera); + } + + // draw scene normally + smgr->drawAll(); + env->drawAll(); + + driver->endScene(); + + // display frames per second in window title + int fps = driver->getFPS(); + if (lastFPS != fps) + { + core::stringw str = L"Irrlicht Engine - Render to Texture and Specular Highlights example"; + str += " FPS:"; + str += fps; + + device->setWindowCaption(str.c_str()); + lastFPS = fps; + } + } + + device->drop(); // drop device + return 0; +} + +/* +**/ diff --git a/libraries/irrlicht-1.8.1/examples/13.RenderToTexture/tutorial.html b/libraries/irrlicht-1.8.1/examples/13.RenderToTexture/tutorial.html new file mode 100644 index 0000000..26340a3 --- /dev/null +++ b/libraries/irrlicht-1.8.1/examples/13.RenderToTexture/tutorial.html @@ -0,0 +1,244 @@ + + +Irrlicht Engine Tutorial + + + + +
+ + + + + + + + +
+
+
Tutorial 13. Render to Texture
+
+
+
+

This tutorial shows how to render to a texture using Irrlicht. Render + to texture is a feature with which it is possible to create nice special + effects. In addition, this tutorial shows how to enable specular highlights.

+

The program which is described here will look like this:

+


+

+
+
+
+ + + + + + + +
Lets start!
+
+

In the beginning, everything as usual. Include the needed headers, + ask the user for the rendering driver, create the Irrlicht Device:

+ + + + +
#include <irrlicht.h>
+#include <iostream>
+
+using namespace irr;
+
+#pragma comment(lib, "Irrlicht.lib")
+
+int main()
+{
+	// let user select driver type
+
+	video::E_DRIVER_TYPE driverType = video::EDT_DIRECT3D9;
+
+	printf("Please select the driver you want for this example:\n"\
" (a) Direct3D 9.0c\n (b) Direct3D 8.1\n (c) OpenGL 1.5\n"\
" (d) Software Renderer\n (e) Apfelbaum Software Renderer\n"\
" (f) NullDevice\n (otherKey) exit\n\n"); + + char i; + std::cin >> i; + + switch(i)
{
case 'a': driverType = video::EDT_DIRECT3D9;break;
case 'b': driverType = video::EDT_DIRECT3D8;break;
case 'c': driverType = video::EDT_OPENGL; break;
case 'd': driverType = video::EDT_SOFTWARE; break;
case 'e': driverType = video::EDT_BURNINGSVIDEO;break;
case 'f': driverType = video::EDT_NULL; break;
default: return 1;
} + + // create device and exit if creation failed + + IrrlichtDevice *device = + createDevice(driverType, core::dimension2d(640, 480), + 16, false, false); + + if (device == 0) + return 1; // could not create selected driver. + + video::IVideoDriver* driver = device->getVideoDriver(); + scene::ISceneManager* smgr = device->getSceneManager(); + gui::IGUIEnvironment* env = device->getGUIEnvironment();
+

Now, we load an animated mesh to be displayed. As in most examples, + we'll take the fairy md2 model. The difference here: We set the shininess
+ of the model to a value other than 0 which is the default value. This + enables specular highlights on the model if dynamic lighting is on. + The value influences the size of the highlights.

+ + + + +
// load and display animated fairy mesh
+
+	scene::IAnimatedMeshSceneNode* fairy = smgr->addAnimatedMeshSceneNode(
+		smgr->getMesh("../../media/faerie.md2"));
+
+	if (fairy)
+	{
+		fairy->setMaterialTexture(0, driver->getTexture("../../media/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));
+	}
+

To make specular highlights appear on the model, we need a dynamic + light in the scene. We add one directly in vicinity of the model. + In addition, to make the model not that dark, we set the ambient light + to gray.

+ + + + +
+	// add white light
+	scene::ILightSceneNode* light = smgr->addLightSceneNode(0,
+		core::vector3df(-15,5,-105), video::SColorf(1.0f, 1.0f, 1.0f));
+
+	// set ambient light
+	driver->setAmbientLight(video::SColor(0,60,60,60));
+

The next is just some standard stuff: Add a user controlled camera + to the scene, disable mouse cursor, and add a test cube and let it + rotate to make the scene more interesting.

+ + + + +
+	// add fps camera
+	scene::ICameraSceneNode* fpsCamera = smgr->addCameraSceneNodeFPS();
+	fpsCamera->setPosition(core::vector3df(-50,50,-150));
+
+	// disable mouse cursor
+	device->getCursorControl()->setVisible(false);
+
+	// create test cube
+	scene::ISceneNode* test = smgr->addCubeSceneNode(60);
+
+	// let the cube rotate and set some light settings
+	scene::ISceneNodeAnimator* anim = smgr->createRotationAnimator(
+		core::vector3df(0.3f, 0.3f,0));
+
+	test->setPosition(core::vector3df(-100,0,-100));
+	test->setMaterialFlag(video::EMF_LIGHTING, false); // disable dynamic lighting
+	test->addAnimator(anim);
+	anim->drop();
+
+	// set window caption
+	device->setWindowCaption(L"Irrlicht Engine - Render to Texture and Specular Highlights example");
+

To test out the render to texture feature, we need a render target + texture. These are not like standard textures, but need to be created + first. To create one, we call IVideoDriver::createRenderTargetTexture() + and specify the size of the texture. Please don't use sizes bigger + than the frame buffer for this, because the render target shares the + zbuffer with the frame buffer. And because we want to render the scene + not from the user camera into the texture, we add another, fixed camera + to the scene. But before we do all this, we check if the current running + driver is able to render to textures. If it is not, we simply display + a warning text.

+ + + + +
// create render target
+	video::ITexture* rt = 0;
+	scene::ICameraSceneNode* fixedCam = 0;
+	
+
+	if (driver->queryFeature(video::EVDF_RENDER_TO_TARGET))
+	{
+		rt = driver->createRenderTargetTexture(core::dimension2d(256,256));
+		test->setMaterialTexture(0, rt); // set material of cube to render target
+
+		// add fixed camera
+		fixedCam = smgr->addCameraSceneNode(0, core::vector3df(10,10,-80),
+			core::vector3df(-10,10,-100));
+	}
+	else
+	{
+		// create problem text
+		gui::IGUISkin* skin = env->getSkin();
+		gui::IGUIFont* font = env->getFont("../../media/fonthaettenschweiler.bmp");
+		if (font)
+			skin->setFont(font);
+
+		gui::IGUIStaticText* text = env->addStaticText(
+			L"Your hardware or this renderer is not able to use the "\
+			L"render to texture feature. RTT Disabled.",
+			core::rect(150,20,470,60));
+
+		text->setOverrideColor(video::SColor(100,255,255,255));
+	}
+

Nearly finished. Now we need to draw everything. Every frame, we + draw the scene twice. Once from the fixed camera into the render target + texture and once as usual. When rendering into the render target, + we need to disable the visibilty of the test cube, because it has + the render target texture applied to it.
+ That's, wasn't quite complicated I hope. :)

+ + + + +
while(device->run())
+	if (device->isWindowActive())
+	{
+		driver->beginScene(true, true, 0);
+
+		if (rt)
+		{
+			// draw scene into render target
+			
+			// set render target texture
+			driver->setRenderTarget(rt, true, true, video::SColor(0,0,0,255));     
+
+			// make cube invisible and set fixed camera as active camera
+			test->setVisible(false);
+			smgr->setActiveCamera(fixedCam);
+
+			// draw whole scene into render buffer
+			smgr->drawAll();                 
+
+			// set back old render target
+			driver->setRenderTarget(0);      
+
+			// make the cube visible and set the user controlled camera as active one
+			test->setVisible(true);
+			smgr->setActiveCamera(fpsCamera);
+		}
+		
+		// draw scene normally
+		smgr->drawAll(); 
+		env->drawAll();
+
+		driver->endScene();
+	}
+
+	if (rt)
+		rt->drop(); // drop render target because we created if with a create() method
+
+	device->drop(); // drop device
+	return 0;
+}
+
+ +

 

+
+
+

 

+ + diff --git a/libraries/irrlicht-1.8.1/examples/14.Win32Window/Makefile b/libraries/irrlicht-1.8.1/examples/14.Win32Window/Makefile new file mode 100644 index 0000000..e76f2ff --- /dev/null +++ b/libraries/irrlicht-1.8.1/examples/14.Win32Window/Makefile @@ -0,0 +1,38 @@ +# Makefile for Irrlicht Examples +# It's usually sufficient to change just the target name and source file list +# and be sure that CXX is set to a valid compiler +Target = 14.Win32Window +Sources = main.cpp + +# general compiler settings +CPPFLAGS = -I../../include -I/usr/X11R6/include +CXXFLAGS = -O3 -ffast-math +#CXXFLAGS = -g -Wall + +#default target is Linux +all: all_linux + +ifeq ($(HOSTTYPE), x86_64) +LIBSELECT=64 +endif + +# target specific settings +all_linux: LDFLAGS = -L/usr/X11R6/lib$(LIBSELECT) -L../../lib/Linux -lIrrlicht -lGL -lXxf86vm -lXext -lX11 -lXcursor +all_linux clean_linux: SYSTEM=Linux +all_win32: LDFLAGS = -L../../lib/Win32-gcc -lIrrlicht -lopengl32 -lm +all_win32 clean_win32: SYSTEM=Win32-gcc +all_win32 clean_win32: SUF=.exe +# name of the binary - only valid for targets which set SYSTEM +DESTPATH = ../../bin/$(SYSTEM)/$(Target)$(SUF) + +all_linux all_win32: + $(warning Building...) + $(CXX) $(CPPFLAGS) $(CXXFLAGS) $(Sources) -o $(DESTPATH) $(LDFLAGS) + +clean: clean_linux clean_win32 + $(warning Cleaning...) + +clean_linux clean_win32: + @$(RM) $(DESTPATH) + +.PHONY: all all_win32 clean clean_linux clean_win32 diff --git a/libraries/irrlicht-1.8.1/examples/14.Win32Window/Win32Window.cbp b/libraries/irrlicht-1.8.1/examples/14.Win32Window/Win32Window.cbp new file mode 100644 index 0000000..06f310b --- /dev/null +++ b/libraries/irrlicht-1.8.1/examples/14.Win32Window/Win32Window.cbp @@ -0,0 +1,43 @@ + + + + + + diff --git a/libraries/irrlicht-1.8.1/examples/14.Win32Window/Win32Window.dev b/libraries/irrlicht-1.8.1/examples/14.Win32Window/Win32Window.dev new file mode 100644 index 0000000..6192563 --- /dev/null +++ b/libraries/irrlicht-1.8.1/examples/14.Win32Window/Win32Window.dev @@ -0,0 +1,59 @@ +[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/libraries/irrlicht-1.8.1/examples/14.Win32Window/Win32Window.vcproj b/libraries/irrlicht-1.8.1/examples/14.Win32Window/Win32Window.vcproj new file mode 100644 index 0000000..c8576c7 --- /dev/null +++ b/libraries/irrlicht-1.8.1/examples/14.Win32Window/Win32Window.vcproj @@ -0,0 +1,165 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/libraries/irrlicht-1.8.1/examples/14.Win32Window/Win32Window_vc10.vcxproj b/libraries/irrlicht-1.8.1/examples/14.Win32Window/Win32Window_vc10.vcxproj new file mode 100644 index 0000000..f18c583 --- /dev/null +++ b/libraries/irrlicht-1.8.1/examples/14.Win32Window/Win32Window_vc10.vcxproj @@ -0,0 +1,235 @@ + + + + + Debug + Win32 + + + Debug + x64 + + + Release + Win32 + + + Release + x64 + + + + 14.Win32Window + {772FBE05-D05A-467B-9842-BEC409EEA8D0} + Win32Window + + + + Application + false + MultiByte + + + Application + false + MultiByte + + + Application + false + MultiByte + + + Application + false + MultiByte + + + + + + + + + + + + + + + + + + + + + + + <_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/libraries/irrlicht-1.8.1/examples/14.Win32Window/Win32Window_vc11.vcxproj b/libraries/irrlicht-1.8.1/examples/14.Win32Window/Win32Window_vc11.vcxproj new file mode 100644 index 0000000..07a2fce --- /dev/null +++ b/libraries/irrlicht-1.8.1/examples/14.Win32Window/Win32Window_vc11.vcxproj @@ -0,0 +1,239 @@ + + + + + Debug + Win32 + + + Debug + x64 + + + Release + Win32 + + + Release + x64 + + + + 14.Win32Window + {772FBE05-D05A-467B-9842-BEC409EEA8D0} + Win32Window + + + + Application + false + MultiByte + v110 + + + Application + false + MultiByte + v110 + + + Application + false + MultiByte + v110 + + + Application + false + MultiByte + v110 + + + + + + + + + + + + + + + + + + + + + + + <_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/libraries/irrlicht-1.8.1/examples/14.Win32Window/Win32Window_vc8.vcproj b/libraries/irrlicht-1.8.1/examples/14.Win32Window/Win32Window_vc8.vcproj new file mode 100644 index 0000000..efbf43d --- /dev/null +++ b/libraries/irrlicht-1.8.1/examples/14.Win32Window/Win32Window_vc8.vcproj @@ -0,0 +1,232 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/libraries/irrlicht-1.8.1/examples/14.Win32Window/Win32Window_vc9.vcproj b/libraries/irrlicht-1.8.1/examples/14.Win32Window/Win32Window_vc9.vcproj new file mode 100644 index 0000000..2902fba --- /dev/null +++ b/libraries/irrlicht-1.8.1/examples/14.Win32Window/Win32Window_vc9.vcproj @@ -0,0 +1,232 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/libraries/irrlicht-1.8.1/examples/14.Win32Window/main.cpp b/libraries/irrlicht-1.8.1/examples/14.Win32Window/main.cpp new file mode 100644 index 0000000..33d111e --- /dev/null +++ b/libraries/irrlicht-1.8.1/examples/14.Win32Window/main.cpp @@ -0,0 +1,251 @@ +/** Example 014 Win32 Window + +This example only runs under MS Windows and demonstrates that Irrlicht can +render inside a win32 window. MFC and .NET Windows.Forms windows are possible, +too. + +In the beginning, we create a windows window using the windows API. I'm not +going to explain this code, because it is windows specific. See the MSDN or a +windows book for details. +*/ + +#include +#ifndef _IRR_WINDOWS_ +#error Windows only example +#else +#include // this example only runs with windows +#include +#include "driverChoice.h" + +using namespace irr; + +#pragma comment(lib, "irrlicht.lib") + +HWND hOKButton; +HWND hWnd; + +static LRESULT CALLBACK CustomWndProc(HWND hWnd, UINT message, + WPARAM wParam, LPARAM lParam) +{ + switch (message) + { + case WM_COMMAND: + { + HWND hwndCtl = (HWND)lParam; + int code = HIWORD(wParam); + + if (hwndCtl == hOKButton) + { + DestroyWindow(hWnd); + PostQuitMessage(0); + return 0; + } + } + break; + case WM_DESTROY: + PostQuitMessage(0); + return 0; + + } + + return DefWindowProc(hWnd, message, wParam, lParam); +} + + +/* + Now ask for the driver and create the Windows specific window. +*/ +int main() +{ + // ask user for driver + video::E_DRIVER_TYPE driverType=driverChoiceConsole(); + if (driverType==video::EDT_COUNT) + return 1; + + printf("Select the render window (some dead window may exist too):\n"\ + " (a) Window with button (via CreationParam)\n"\ + " (b) Window with button (via beginScene)\n"\ + " (c) Own Irrlicht window (default behavior)\n"\ + " (otherKey) exit\n\n"); + + char key; + std::cin >> key; + if (key != 'a' && key != 'b' && key != 'c') + return 1; + + HINSTANCE hInstance = 0; + // create dialog + + const char* Win32ClassName = "CIrrlichtWindowsTestDialog"; + + WNDCLASSEX wcex; + wcex.cbSize = sizeof(WNDCLASSEX); + wcex.style = CS_HREDRAW | CS_VREDRAW; + wcex.lpfnWndProc = (WNDPROC)CustomWndProc; + wcex.cbClsExtra = 0; + wcex.cbWndExtra = DLGWINDOWEXTRA; + wcex.hInstance = hInstance; + wcex.hIcon = NULL; + wcex.hCursor = LoadCursor(NULL, IDC_ARROW); + wcex.hbrBackground = (HBRUSH)(COLOR_WINDOW); + wcex.lpszMenuName = 0; + wcex.lpszClassName = Win32ClassName; + wcex.hIconSm = 0; + + RegisterClassEx(&wcex); + + DWORD style = WS_SYSMENU | WS_BORDER | WS_CAPTION | + WS_CLIPCHILDREN | WS_CLIPSIBLINGS | WS_MAXIMIZEBOX | WS_MINIMIZEBOX | WS_SIZEBOX; + + int windowWidth = 440; + int windowHeight = 380; + + hWnd = CreateWindow( Win32ClassName, "Irrlicht Win32 window example", + style, 100, 100, windowWidth, windowHeight, + NULL, NULL, hInstance, NULL); + + RECT clientRect; + GetClientRect(hWnd, &clientRect); + windowWidth = clientRect.right; + windowHeight = clientRect.bottom; + + // create ok button + + hOKButton = CreateWindow("BUTTON", "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.", + WS_CHILD | WS_VISIBLE, 20, 20, 400, 40, hWnd, NULL, hInstance, NULL); + + // create window to put irrlicht in + + HWND hIrrlichtWindow = CreateWindow("BUTTON", "", + WS_CHILD | WS_VISIBLE | BS_OWNERDRAW, + 50, 80, 320, 220, hWnd, NULL, hInstance, NULL); + video::SExposedVideoData videodata((key=='b')?hIrrlichtWindow:0); + + /* + So now that we have some window, we can create an Irrlicht device + inside of it. We use Irrlicht createEx() function for this. We only + need the handle (HWND) to that window, set it as windowsID parameter + and start up the engine as usual. That's it. + */ + // create irrlicht device in the button window + + irr::SIrrlichtCreationParameters param; + param.DriverType = driverType; + if (key=='a') + param.WindowId = reinterpret_cast(hIrrlichtWindow); + + irr::IrrlichtDevice* device = irr::createDeviceEx(param); + if (!device) + return 1; + + // setup a simple 3d scene + + irr::scene::ISceneManager* smgr = device->getSceneManager(); + video::IVideoDriver* driver = device->getVideoDriver(); + + if (driverType==video::EDT_OPENGL) + { + HDC HDc=GetDC(hIrrlichtWindow); + PIXELFORMATDESCRIPTOR pfd={0}; + pfd.nSize=sizeof(PIXELFORMATDESCRIPTOR); + int pf = GetPixelFormat(HDc); + DescribePixelFormat(HDc, pf, sizeof(PIXELFORMATDESCRIPTOR), &pfd); + pfd.dwFlags |= PFD_DOUBLEBUFFER | PFD_SUPPORT_OPENGL | PFD_DRAW_TO_WINDOW; + pfd.cDepthBits=16; + pf = ChoosePixelFormat(HDc, &pfd); + SetPixelFormat(HDc, pf, &pfd); + videodata.OpenGLWin32.HDc = HDc; + videodata.OpenGLWin32.HRc=wglCreateContext(HDc); + wglShareLists((HGLRC)driver->getExposedVideoData().OpenGLWin32.HRc, (HGLRC)videodata.OpenGLWin32.HRc); + } + scene::ICameraSceneNode* cam = smgr->addCameraSceneNode(); + cam->setTarget(core::vector3df(0,0,0)); + + scene::ISceneNodeAnimator* anim = + smgr->createFlyCircleAnimator(core::vector3df(0,15,0), 30.0f); + cam->addAnimator(anim); + anim->drop(); + + scene::ISceneNode* cube = smgr->addCubeSceneNode(20); + + cube->setMaterialTexture(0, driver->getTexture("../../media/wall.bmp")); + cube->setMaterialTexture(1, driver->getTexture("../../media/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")); + + // show and execute dialog + + ShowWindow(hWnd , SW_SHOW); + UpdateWindow(hWnd); + + // do message queue + + /* + Now the only thing missing is the drawing loop using + IrrlichtDevice::run(). We do this as usual. But instead of this, there + is another possibility: You can also simply use your own message loop + using GetMessage, DispatchMessage and whatever. Calling + Device->run() will cause Irrlicht to dispatch messages internally too. + You need not call Device->run() if you want to do your own message + dispatching loop, but Irrlicht will not be able to fetch user input + then and you have to do it on your own using the window messages, + DirectInput, or whatever. + */ + + while (device->run()) + { + driver->beginScene(true, true, 0, videodata); + smgr->drawAll(); + driver->endScene(); + } + + /* + The alternative, own message dispatching loop without Device->run() + would look like this: + */ + + /*MSG msg; + while (true) + { + if (PeekMessage(&msg, NULL, 0, 0, PM_REMOVE)) + { + TranslateMessage(&msg); + DispatchMessage(&msg); + + if (msg.message == WM_QUIT) + break; + } + + // advance virtual time + device->getTimer()->tick(); + + // draw engine picture + driver->beginScene(true, true, 0, (key=='c')?hIrrlichtWindow:0); + smgr->drawAll(); + driver->endScene(); + }*/ + + device->closeDevice(); + device->drop(); + + return 0; +} +#endif // if windows + +/* +That's it, Irrlicht now runs in your own windows window. +**/ diff --git a/libraries/irrlicht-1.8.1/examples/14.Win32Window/tutorial.html b/libraries/irrlicht-1.8.1/examples/14.Win32Window/tutorial.html new file mode 100644 index 0000000..6c5d5ba --- /dev/null +++ b/libraries/irrlicht-1.8.1/examples/14.Win32Window/tutorial.html @@ -0,0 +1,247 @@ + + +Irrlicht Engine Tutorial + + + + +
+ + + + + + + + +
+
+
Tutorial 14. Win32 Window
+
+
+
+

This example only runs in Windows and demonstrates that Irrlicht can + run inside a win32 window. MFC and .NET Windows.Forms windows are possible + too.

+

The program which is described here will look like this:

+


+

+
+
+
+ + + + + + + +
Lets start!
+
+

In the begining, we create a windows window using the windows API. + I'm not going to explain this code, because it is windows specific. + See the MSDN or a windows book for details.

+ + + + +
#include <irrlicht.h>
+#include <windows.h> // this example only runs with windows
+
+using namespace irr;
+
+#pragma comment(lib, "irrlicht.lib")
+
+HWND hOKButton;
+HWND hWnd;
+
+static LRESULT CALLBACK CustomWndProc(HWND hWnd, UINT message,
+    WPARAM wParam, LPARAM lParam)
+{
+	switch (message) 
+	{
+	case WM_COMMAND:
+		{
+			HWND hwndCtl = (HWND)lParam;
+			int code = HIWORD(wParam);
+
+			if (hwndCtl == hOKButton)
+			{
+				DestroyWindow(hWnd);
+				PostQuitMessage(0);
+				return 0;
+			}		
+		}
+		break;
+	case WM_DESTROY:
+		PostQuitMessage(0);
+		return 0;
+
+	}
+
+	return DefWindowProc(hWnd, message, wParam, lParam);
+}
+
+int main()
+//int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE hpre, LPSTR cmd, int cc)
+{
+	HINSTANCE hInstance = 0;
+	// create dialog
+
+	const char* Win32ClassName = "CIrrlichtWindowsTestDialog";
+
+	WNDCLASSEX wcex;
+	wcex.cbSize			= sizeof(WNDCLASSEX); 
+	wcex.style			= CS_HREDRAW | CS_VREDRAW;
+	wcex.lpfnWndProc	= (WNDPROC)CustomWndProc;
+	wcex.cbClsExtra		= 0;
+	wcex.cbWndExtra		= DLGWINDOWEXTRA; 
+	wcex.hInstance		= hInstance;
+	wcex.hIcon			= NULL;
+	wcex.hCursor		= LoadCursor(NULL, IDC_ARROW);
+	wcex.hbrBackground	= (HBRUSH)(COLOR_WINDOW);
+	wcex.lpszMenuName	= 0;
+	wcex.lpszClassName	= Win32ClassName;
+	wcex.hIconSm		= 0;
+
+	RegisterClassEx(&wcex);
+
+	DWORD style = WS_SYSMENU | WS_BORDER | WS_CAPTION | 
+		WS_CLIPCHILDREN | WS_CLIPSIBLINGS | WS_MAXIMIZEBOX
+		| WS_MINIMIZEBOX | WS_SIZEBOX;
+
+	int windowWidth = 440;
+	int windowHeight = 380;
+
+	hWnd = CreateWindow( Win32ClassName, "Irrlicht Win32 window example",
+		style, 100, 100, windowWidth, windowHeight,
+		NULL, NULL, hInstance, NULL);
+
+	RECT clientRect;
+	GetClientRect(hWnd, &clientRect);
+	windowWidth = clientRect.right;
+	windowHeight = clientRect.bottom;
+
+	// create ok button
+
+	hOKButton = CreateWindow(
+	    "BUTTON", "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.",
+		WS_CHILD | WS_VISIBLE, 20, 20, 400, 40, hWnd, NULL, hInstance, NULL);
+
+	// create window to put irrlicht in
+
+	HWND hIrrlichtWindow =
CreateWindow("BUTTON", "", WS_CHILD | WS_VISIBLE | BS_OWNERDRAW, + 50, 80, 320, 220, hWnd, NULL, hInstance, NULL); + +
+

So now that we have some window, we can create an Irrlicht device + inside of it. We use Irrlicht createEx() function for this. We only + need the handle (HWND) to that window, set it as windowsID parameter + and start up the engine as usual. That's it.

+ + + + +
	// create irrlicht device in the button window
+
+	irr::SIrrlichtCreationParameters param;
+	param.WindowId = reinterpret_cast(hIrrlichtWindow); // hColorButton
+	param.DriverType = video::EDT_OPENGL;
+
+	irr::IrrlichtDevice* device = irr::createDeviceEx(param);
+	
+	// setup a simple 3d scene
+
+	irr::scene::ISceneManager* smgr = device->getSceneManager();
+	video::IVideoDriver* driver = device->getVideoDriver();
+
+	scene::ICameraSceneNode* cam = smgr->addCameraSceneNode();
+	cam->setTarget(core::vector3df(0,0,0));
+
+	scene::ISceneNodeAnimator* anim =
+	   smgr->createFlyCircleAnimator(core::vector3df(0,10,0), 30.0f);
+	cam->addAnimator(anim);
+	anim->drop();
+
+	scene::ISceneNode* cube = smgr->addCubeSceneNode(25);
+	cube->setMaterialFlag(video::EMF_LIGHTING, false);
+	
+	cube->setMaterialTexture(0, driver->getTexture("../../media/rockwall.bmp"));
+
+	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"));
+
+	// show and execute dialog
+
+	ShowWindow(hWnd , SW_SHOW);
+	UpdateWindow(hWnd);
+
+

Now the only thing missing is the drawing loop using IrrlichtDevice::run(). + We do this as usual. But instead of this, there is another possibility: + You can also simply use your own message loop using GetMessage, DispatchMessage + and whatever. Calling
+ Device->run() will cause Irrlicht to dispatch messages internally + too. You need not call Device->run() if you want to do your own + message dispatching loop, but Irrlicht will not be able to fetch user + input then and you have to do it on your own using the window messages, + DirectInput, or whatever.

+ + + + +
	while (device->run())
+	{
+		driver->beginScene(true, true, 0);
+		smgr->drawAll();
+		driver->endScene();
+	}
+
+	// the alternative, own message dispatching loop without Device->run() would
+	// look like this:
+
+	/*MSG msg;
+	while (true)
+	{
+		if (PeekMessage(&msg, NULL, 0, 0, PM_REMOVE))
+		{
+			TranslateMessage(&msg);
+			DispatchMessage(&msg);
+
+			if (msg.message == WM_QUIT)
+				break;
+		}
+		
+		// advance virtual time
+		device->getTimer()->tick();
+
+		// draw engine picture
+		driver->beginScene(true, true, 0);
+		smgr->drawAll();
+		driver->endScene();
+	}*/
+
+	device->closeDevice();
+	device->drop();
+
+	return 0;
+}
+

That's it, Irrlicht now runs in your own windows window.

+
+
+
+

 

+ + diff --git a/libraries/irrlicht-1.8.1/examples/15.LoadIrrFile/LoadIrrFile.cbp b/libraries/irrlicht-1.8.1/examples/15.LoadIrrFile/LoadIrrFile.cbp new file mode 100644 index 0000000..edb64dc --- /dev/null +++ b/libraries/irrlicht-1.8.1/examples/15.LoadIrrFile/LoadIrrFile.cbp @@ -0,0 +1,54 @@ + + + + + + diff --git a/libraries/irrlicht-1.8.1/examples/15.LoadIrrFile/LoadIrrFile.dev b/libraries/irrlicht-1.8.1/examples/15.LoadIrrFile/LoadIrrFile.dev new file mode 100644 index 0000000..b43fe68 --- /dev/null +++ b/libraries/irrlicht-1.8.1/examples/15.LoadIrrFile/LoadIrrFile.dev @@ -0,0 +1,59 @@ +[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/libraries/irrlicht-1.8.1/examples/15.LoadIrrFile/LoadIrrFile.vcproj b/libraries/irrlicht-1.8.1/examples/15.LoadIrrFile/LoadIrrFile.vcproj new file mode 100644 index 0000000..fef4626 --- /dev/null +++ b/libraries/irrlicht-1.8.1/examples/15.LoadIrrFile/LoadIrrFile.vcproj @@ -0,0 +1,162 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/libraries/irrlicht-1.8.1/examples/15.LoadIrrFile/LoadIrrFile_vc10.vcxproj b/libraries/irrlicht-1.8.1/examples/15.LoadIrrFile/LoadIrrFile_vc10.vcxproj new file mode 100644 index 0000000..ffc91ed --- /dev/null +++ b/libraries/irrlicht-1.8.1/examples/15.LoadIrrFile/LoadIrrFile_vc10.vcxproj @@ -0,0 +1,231 @@ + + + + + Debug + Win32 + + + Debug + x64 + + + Release + Win32 + + + Release + x64 + + + + 15.LoadIrrFile + {78C9F424-523C-49AC-94B7-823AA4A26BF9} + LoadIrrFile + + + + Application + false + MultiByte + + + Application + false + MultiByte + + + Application + false + MultiByte + + + Application + false + MultiByte + + + + + + + + + + + + + + + + + + + + + + + <_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/libraries/irrlicht-1.8.1/examples/15.LoadIrrFile/LoadIrrFile_vc11.vcxproj b/libraries/irrlicht-1.8.1/examples/15.LoadIrrFile/LoadIrrFile_vc11.vcxproj new file mode 100644 index 0000000..4230696 --- /dev/null +++ b/libraries/irrlicht-1.8.1/examples/15.LoadIrrFile/LoadIrrFile_vc11.vcxproj @@ -0,0 +1,235 @@ + + + + + Debug + Win32 + + + Debug + x64 + + + Release + Win32 + + + Release + x64 + + + + 15.LoadIrrFile + {78C9F424-523C-49AC-94B7-823AA4A26BF9} + LoadIrrFile + + + + Application + false + MultiByte + v110 + + + Application + false + MultiByte + v110 + + + Application + false + MultiByte + v110 + + + Application + false + MultiByte + v110 + + + + + + + + + + + + + + + + + + + + + + + <_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/libraries/irrlicht-1.8.1/examples/15.LoadIrrFile/LoadIrrFile_vc8.vcproj b/libraries/irrlicht-1.8.1/examples/15.LoadIrrFile/LoadIrrFile_vc8.vcproj new file mode 100644 index 0000000..d78a263 --- /dev/null +++ b/libraries/irrlicht-1.8.1/examples/15.LoadIrrFile/LoadIrrFile_vc8.vcproj @@ -0,0 +1,231 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/libraries/irrlicht-1.8.1/examples/15.LoadIrrFile/LoadIrrFile_vc9.vcproj b/libraries/irrlicht-1.8.1/examples/15.LoadIrrFile/LoadIrrFile_vc9.vcproj new file mode 100644 index 0000000..a7bea1b --- /dev/null +++ b/libraries/irrlicht-1.8.1/examples/15.LoadIrrFile/LoadIrrFile_vc9.vcproj @@ -0,0 +1,230 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/libraries/irrlicht-1.8.1/examples/15.LoadIrrFile/Makefile b/libraries/irrlicht-1.8.1/examples/15.LoadIrrFile/Makefile new file mode 100644 index 0000000..f00e494 --- /dev/null +++ b/libraries/irrlicht-1.8.1/examples/15.LoadIrrFile/Makefile @@ -0,0 +1,38 @@ +# Makefile for Irrlicht Examples +# It's usually sufficient to change just the target name and source file list +# and be sure that CXX is set to a valid compiler +Target = 15.LoadIrrFile +Sources = main.cpp + +# general compiler settings +CPPFLAGS = -I../../include -I/usr/X11R6/include +CXXFLAGS = -O3 -ffast-math +#CXXFLAGS = -g -Wall + +#default target is Linux +all: all_linux + +ifeq ($(HOSTTYPE), x86_64) +LIBSELECT=64 +endif + +# target specific settings +all_linux: LDFLAGS = -L/usr/X11R6/lib$(LIBSELECT) -L../../lib/Linux -lIrrlicht -lGL -lXxf86vm -lXext -lX11 -lXcursor +all_linux clean_linux: SYSTEM=Linux +all_win32: LDFLAGS = -L../../lib/Win32-gcc -lIrrlicht -lopengl32 -lm +all_win32 clean_win32: SYSTEM=Win32-gcc +all_win32 clean_win32: SUF=.exe +# name of the binary - only valid for targets which set SYSTEM +DESTPATH = ../../bin/$(SYSTEM)/$(Target)$(SUF) + +all_linux all_win32: + $(warning Building...) + $(CXX) $(CPPFLAGS) $(CXXFLAGS) $(Sources) -o $(DESTPATH) $(LDFLAGS) + +clean: clean_linux clean_win32 + $(warning Cleaning...) + +clean_linux clean_win32: + @$(RM) $(DESTPATH) + +.PHONY: all all_win32 clean clean_linux clean_win32 diff --git a/libraries/irrlicht-1.8.1/examples/15.LoadIrrFile/main.cpp b/libraries/irrlicht-1.8.1/examples/15.LoadIrrFile/main.cpp new file mode 100644 index 0000000..42327cd --- /dev/null +++ b/libraries/irrlicht-1.8.1/examples/15.LoadIrrFile/main.cpp @@ -0,0 +1,173 @@ +/** Example 015 Loading Scenes from .irr Files + +Since version 1.1, Irrlicht is able to save and load +the full scene graph into an .irr file, an xml based +format. There is an editor available to edit +those files, named irrEdit (http://www.ambiera.com/irredit) +which can also be used as world and particle editor. +This tutorial shows how to use .irr files. + +Lets start: Create an Irrlicht device and setup the window. +*/ + +#include +#include "driverChoice.h" + +using namespace irr; + +#ifdef _MSC_VER +#pragma comment(lib, "Irrlicht.lib") +#endif + +int main(int argc, char** argv) +{ + // ask user for driver + video::E_DRIVER_TYPE driverType=driverChoiceConsole(); + if (driverType==video::EDT_COUNT) + return 1; + + // create device and exit if creation failed + + IrrlichtDevice* device = + createDevice(driverType, core::dimension2d(640, 480)); + + if (device == 0) + return 1; // could not create selected driver. + + device->setWindowCaption(L"Load .irr file example"); + + video::IVideoDriver* driver = device->getVideoDriver(); + scene::ISceneManager* smgr = device->getSceneManager(); + + /* + Now load our .irr file. + .irr files can store the whole scene graph including animators, + materials and particle systems. And there is also the possibility to + store arbitrary user data for every scene node in that file. To keep + this example simple, we are simply loading the scene here. See the + documentation at ISceneManager::loadScene and ISceneManager::saveScene + for more information. So to load and display a complicated huge scene, + we only need a single call to loadScene(). + */ + + // load the scene + if (argc>1) + smgr->loadScene(argv[1]); + else + smgr->loadScene("../../media/example.irr"); + + /* + Now we'll create a camera, and give it a collision response animator + that's built from the mesh nodes in the scene we just loaded. + */ + scene::ICameraSceneNode * camera = smgr->addCameraSceneNodeFPS(0, 50.f, 0.1f); + + // Create a meta triangle selector to hold several triangle selectors. + scene::IMetaTriangleSelector * meta = smgr->createMetaTriangleSelector(); + + /* + Now we will find all the nodes in the scene and create triangle + selectors for all suitable nodes. Typically, you would want to make a + more informed decision about which nodes to performs collision checks + on; you could capture that information in the node name or Id. + */ + core::array nodes; + smgr->getSceneNodesFromType(scene::ESNT_ANY, nodes); // Find all nodes + + for (u32 i=0; i < nodes.size(); ++i) + { + scene::ISceneNode * node = nodes[i]; + scene::ITriangleSelector * selector = 0; + + switch(node->getType()) + { + case scene::ESNT_CUBE: + case scene::ESNT_ANIMATED_MESH: + // Because the selector won't animate with the mesh, + // and is only being used for camera collision, we'll just use an approximate + // bounding box instead of ((scene::IAnimatedMeshSceneNode*)node)->getMesh(0) + selector = smgr->createTriangleSelectorFromBoundingBox(node); + break; + + case scene::ESNT_MESH: + case scene::ESNT_SPHERE: // Derived from IMeshSceneNode + selector = smgr->createTriangleSelector(((scene::IMeshSceneNode*)node)->getMesh(), node); + break; + + case scene::ESNT_TERRAIN: + selector = smgr->createTerrainTriangleSelector((scene::ITerrainSceneNode*)node); + break; + + case scene::ESNT_OCTREE: + selector = smgr->createOctreeTriangleSelector(((scene::IMeshSceneNode*)node)->getMesh(), node); + break; + + default: + // Don't create a selector for this node type + break; + } + + if(selector) + { + // Add it to the meta selector, which will take a reference to it + meta->addTriangleSelector(selector); + // And drop my reference to it, so that the meta selector owns it. + selector->drop(); + } + } + + /* + Now that the mesh scene nodes have had triangle selectors created and added + to the meta selector, create a collision response animator from that meta selector. + */ + scene::ISceneNodeAnimator* anim = smgr->createCollisionResponseAnimator( + meta, camera, core::vector3df(5,5,5), + core::vector3df(0,0,0)); + meta->drop(); // I'm done with the meta selector now + + camera->addAnimator(anim); + anim->drop(); // I'm done with the animator now + + // And set the camera position so that it doesn't start off stuck in the geometry + camera->setPosition(core::vector3df(0.f, 20.f, 0.f)); + + // Point the camera at the cube node, by finding the first node of type ESNT_CUBE + scene::ISceneNode * cube = smgr->getSceneNodeFromType(scene::ESNT_CUBE); + if(cube) + camera->setTarget(cube->getAbsolutePosition()); + + /* + That's it. Draw everything and finish as usual. + */ + + int lastFPS = -1; + + while(device->run()) + if (device->isWindowActive()) + { + driver->beginScene(true, true, video::SColor(0,200,200,200)); + smgr->drawAll(); + driver->endScene(); + + int fps = driver->getFPS(); + + if (lastFPS != fps) + { + core::stringw str = L"Load Irrlicht File example - Irrlicht Engine ["; + str += driver->getName(); + str += "] FPS:"; + str += fps; + + device->setWindowCaption(str.c_str()); + lastFPS = fps; + } + + } + + device->drop(); + + return 0; +} + +/* +**/ diff --git a/libraries/irrlicht-1.8.1/examples/15.LoadIrrFile/tutorial.html b/libraries/irrlicht-1.8.1/examples/15.LoadIrrFile/tutorial.html new file mode 100644 index 0000000..e3e4a6b --- /dev/null +++ b/libraries/irrlicht-1.8.1/examples/15.LoadIrrFile/tutorial.html @@ -0,0 +1,129 @@ + + +Irrlicht Engine Tutorial + + + + +
+ + + + + + + + +
+ Tutorial 15. Load .irr File
+

Since version 1.1, Irrlicht is able to save and load the full scene + graph into an .irr file, an xml based format. There is also an editor + available to edit those files, named irrEdit on http://www.ambiera.com/irredit, + which can also be used as world and particle editor. This tutorial shows + how to use .irr files.

+


+

+
+
+ + + + + + + +
+ Lets start!
+

Lets start: Create an Irrlicht device and setup the window.

+ + + + +
#include 
+#include 
+using namespace irr;
+
+#pragma comment(lib, "Irrlicht.lib")
+
+int main()
+{
+	// ask user for driver
+
+	video::E_DRIVER_TYPE driverType;
+
+	printf("Please select the driver you want for this example:\n"\
+		" (a) Direct3D 9.0c\n (b) Direct3D 8.1\n (c) OpenGL 1.5\n"\
+		" (d) Software Renderer\n (e) Apfelbaum Software Renderer\n"\
+		" (f) NullDevice\n (otherKey) exit\n\n");
+
+	char i;
+	std::cin >> i;
+
+	switch(i)
+	{
+		case 'a': driverType = video::EDT_DIRECT3D9;break;
+		case 'b': driverType = video::EDT_DIRECT3D8;break;
+		case 'c': driverType = video::EDT_OPENGL;   break;
+		case 'd': driverType = video::EDT_SOFTWARE; break;
+		case 'e': driverType = video::EDT_BURNINGSVIDEO;break;
+		case 'f': driverType = video::EDT_NULL;     break;
+		default: return 1;
+	}	
+
+	// create device and exit if creation failed
+
+	IrrlichtDevice* device =
+		createDevice(driverType, core::dimension2d(640, 480));
+
+	if (device == 0)
+		return 1; // could not create selected driver.
+
+	device->setWindowCaption(L"Load .irr file example");
+
+	video::IVideoDriver* driver = device->getVideoDriver();
+	scene::ISceneManager* smgr = device->getSceneManager();
+
+

Now load our .irr file. .irr files can store the whole scene graph + including animators, materials and particle systems. And there is also + the possibility to store arbitrary user data for every scene node in + that file. To keep this example simple, we are simply loading the scene + here. See the documentation at ISceneManager::loadScene and ISceneManager::saveScene + for more information. So to load and display a complicated huge scene, + we only need a single call to loadScene().

+ + + + +
// load the scene
smgr->loadScene("../../media/example.irr");
+

That was it already. Now add a camera and draw the scene.

+ + + + +
	// add a user controlled camera
+
+	smgr->addCameraSceneNodeFPS();
+
+	// and draw everything.
+	
+	while(device->run())
+	if (device->isWindowActive())
+	{
+		driver->beginScene(true, true, video::SColor(0,200,200,200));
+		smgr->drawAll();
+		driver->endScene();
+	}
+
+	device->drop();
+	
+	return 0;
+}
+
+ +
+

 

+
+

 

+

 

+ + diff --git a/libraries/irrlicht-1.8.1/examples/16.Quake3MapShader/Makefile b/libraries/irrlicht-1.8.1/examples/16.Quake3MapShader/Makefile new file mode 100644 index 0000000..952b309 --- /dev/null +++ b/libraries/irrlicht-1.8.1/examples/16.Quake3MapShader/Makefile @@ -0,0 +1,38 @@ +# Makefile for Irrlicht Examples +# It's usually sufficient to change just the target name and source file list +# and be sure that CXX is set to a valid compiler +Target = 16.Quake3MapShader +Sources = main.cpp + +# general compiler settings +CPPFLAGS = -I../../include -I/usr/X11R6/include +CXXFLAGS = -O3 -ffast-math +#CXXFLAGS = -g -Wall + +#default target is Linux +all: all_linux + +ifeq ($(HOSTTYPE), x86_64) +LIBSELECT=64 +endif + +# target specific settings +all_linux: LDFLAGS = -L/usr/X11R6/lib$(LIBSELECT) -L../../lib/Linux -lIrrlicht -lGL -lXxf86vm -lXext -lX11 -lXcursor +all_linux clean_linux: SYSTEM=Linux +all_win32: LDFLAGS = -L../../lib/Win32-gcc -lIrrlicht -lopengl32 -lm +all_win32 clean_win32: SYSTEM=Win32-gcc +all_win32 clean_win32: SUF=.exe +# name of the binary - only valid for targets which set SYSTEM +DESTPATH = ../../bin/$(SYSTEM)/$(Target)$(SUF) + +all_linux all_win32: + $(warning Building...) + $(CXX) $(CPPFLAGS) $(CXXFLAGS) $(Sources) -o $(DESTPATH) $(LDFLAGS) + +clean: clean_linux clean_win32 + $(warning Cleaning...) + +clean_linux clean_win32: + @$(RM) $(DESTPATH) + +.PHONY: all all_win32 clean clean_linux clean_win32 diff --git a/libraries/irrlicht-1.8.1/examples/16.Quake3MapShader/Quake3MapShader.cbp b/libraries/irrlicht-1.8.1/examples/16.Quake3MapShader/Quake3MapShader.cbp new file mode 100644 index 0000000..6fc6bb3 --- /dev/null +++ b/libraries/irrlicht-1.8.1/examples/16.Quake3MapShader/Quake3MapShader.cbp @@ -0,0 +1,56 @@ + + + + + + diff --git a/libraries/irrlicht-1.8.1/examples/16.Quake3MapShader/Quake3MapShader.dev b/libraries/irrlicht-1.8.1/examples/16.Quake3MapShader/Quake3MapShader.dev new file mode 100644 index 0000000..14ebb42 --- /dev/null +++ b/libraries/irrlicht-1.8.1/examples/16.Quake3MapShader/Quake3MapShader.dev @@ -0,0 +1,59 @@ +[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/libraries/irrlicht-1.8.1/examples/16.Quake3MapShader/Quake3MapShader.vcproj b/libraries/irrlicht-1.8.1/examples/16.Quake3MapShader/Quake3MapShader.vcproj new file mode 100644 index 0000000..de658b3 --- /dev/null +++ b/libraries/irrlicht-1.8.1/examples/16.Quake3MapShader/Quake3MapShader.vcproj @@ -0,0 +1,133 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/libraries/irrlicht-1.8.1/examples/16.Quake3MapShader/Quake3MapShader_vc10.vcxproj b/libraries/irrlicht-1.8.1/examples/16.Quake3MapShader/Quake3MapShader_vc10.vcxproj new file mode 100644 index 0000000..ea09774 --- /dev/null +++ b/libraries/irrlicht-1.8.1/examples/16.Quake3MapShader/Quake3MapShader_vc10.vcxproj @@ -0,0 +1,190 @@ + + + + + Debug + Win32 + + + Debug + x64 + + + Release + Win32 + + + Release + x64 + + + + 16.Quake3MapShader + {EB3B38EA-5CE7-4983-845B-880661E69D09} + 16.Quake3MapShader + Win32Proj + + + + Application + MultiByte + + + Application + MultiByte + + + Application + MultiByte + + + Application + MultiByte + + + + + + + + + + + + + + + + + + + + + + + <_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/libraries/irrlicht-1.8.1/examples/16.Quake3MapShader/Quake3MapShader_vc11.vcxproj b/libraries/irrlicht-1.8.1/examples/16.Quake3MapShader/Quake3MapShader_vc11.vcxproj new file mode 100644 index 0000000..1bd3735 --- /dev/null +++ b/libraries/irrlicht-1.8.1/examples/16.Quake3MapShader/Quake3MapShader_vc11.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 + v110 + + + Application + MultiByte + v110 + + + Application + MultiByte + v110 + + + Application + MultiByte + v110 + + + + + + + + + + + + + + + + + + + + + + + <_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/libraries/irrlicht-1.8.1/examples/16.Quake3MapShader/Quake3MapShader_vc8.vcproj b/libraries/irrlicht-1.8.1/examples/16.Quake3MapShader/Quake3MapShader_vc8.vcproj new file mode 100644 index 0000000..65fc83c --- /dev/null +++ b/libraries/irrlicht-1.8.1/examples/16.Quake3MapShader/Quake3MapShader_vc8.vcproj @@ -0,0 +1,190 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/libraries/irrlicht-1.8.1/examples/16.Quake3MapShader/Quake3MapShader_vc9.vcproj b/libraries/irrlicht-1.8.1/examples/16.Quake3MapShader/Quake3MapShader_vc9.vcproj new file mode 100644 index 0000000..a533ce0 --- /dev/null +++ b/libraries/irrlicht-1.8.1/examples/16.Quake3MapShader/Quake3MapShader_vc9.vcproj @@ -0,0 +1,188 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/libraries/irrlicht-1.8.1/examples/16.Quake3MapShader/main.cpp b/libraries/irrlicht-1.8.1/examples/16.Quake3MapShader/main.cpp new file mode 100644 index 0000000..6391705 --- /dev/null +++ b/libraries/irrlicht-1.8.1/examples/16.Quake3MapShader/main.cpp @@ -0,0 +1,389 @@ +/** Example 016 Quake3 Map Shader Support + +This Tutorial shows how to load a Quake 3 map into the +engine, create a SceneNode for optimizing the speed of +rendering and how to create a user controlled camera. + +Lets start like the HelloWorld example: We include +the irrlicht header files and an additional file to be able +to ask the user for a driver type using the console. +*/ +#include +#include "driverChoice.h" + +/* + define which Quake3 Level should be loaded +*/ +#define IRRLICHT_QUAKE3_ARENA +//#define ORIGINAL_QUAKE3_ARENA +//#define CUSTOM_QUAKE3_ARENA +//#define SHOW_SHADER_NAME + +#ifdef ORIGINAL_QUAKE3_ARENA + #define QUAKE3_STORAGE_FORMAT addFolderFileArchive + #define QUAKE3_STORAGE_1 "/baseq3/" + #ifdef CUSTOM_QUAKE3_ARENA + #define QUAKE3_STORAGE_2 "/cf/" + #define QUAKE3_MAP_NAME "maps/cf.bsp" + #else + #define QUAKE3_MAP_NAME "maps/q3dm8.bsp" + #endif +#endif + +#ifdef IRRLICHT_QUAKE3_ARENA + #define QUAKE3_STORAGE_FORMAT addFileArchive + #define QUAKE3_STORAGE_1 "../../media/map-20kdm2.pk3" + #define QUAKE3_MAP_NAME "maps/20kdm2.bsp" +#endif + +using namespace irr; +using namespace scene; + +/* +Again, to be able to use the Irrlicht.DLL file, we need to link with the +Irrlicht.lib. We could set this option in the project settings, but +to make it easy, we use a pragma comment lib: +*/ +#ifdef _MSC_VER +#pragma comment(lib, "Irrlicht.lib") +#endif + + +/* +A class to produce a series of screenshots +*/ +class CScreenShotFactory : public IEventReceiver +{ +public: + + CScreenShotFactory( IrrlichtDevice *device, const c8 * templateName, ISceneNode* node ) + : Device(device), Number(0), FilenameTemplate(templateName), Node(node) + { + FilenameTemplate.replace ( '/', '_' ); + FilenameTemplate.replace ( '\\', '_' ); + } + + bool OnEvent(const SEvent& event) + { + // check if user presses the key F9 + if ((event.EventType == EET_KEY_INPUT_EVENT) && + event.KeyInput.PressedDown) + { + if (event.KeyInput.Key == KEY_F9) + { + video::IImage* image = Device->getVideoDriver()->createScreenShot(); + if (image) + { + c8 buf[256]; + snprintf(buf, 256, "%s_shot%04d.jpg", + FilenameTemplate.c_str(), + ++Number); + Device->getVideoDriver()->writeImageToFile(image, buf, 85 ); + image->drop(); + } + } + else + if (event.KeyInput.Key == KEY_F8) + { + if (Node->isDebugDataVisible()) + Node->setDebugDataVisible(scene::EDS_OFF); + else + Node->setDebugDataVisible(scene::EDS_BBOX_ALL); + } + } + return false; + } + +private: + IrrlichtDevice *Device; + u32 Number; + core::stringc FilenameTemplate; + ISceneNode* Node; +}; + + +/* +Ok, lets start. +*/ + +int IRRCALLCONV main(int argc, char* argv[]) +{ + /* + Like in the HelloWorld example, we create an IrrlichtDevice with + createDevice(). The difference now is that we ask the user to select + which hardware accelerated driver to use. The Software device would be + too slow to draw a huge Quake 3 map, but just for the fun of it, we make + this decision possible too. + */ + + // ask user for driver + video::E_DRIVER_TYPE driverType=driverChoiceConsole(); + if (driverType==video::EDT_COUNT) + return 1; + + // create device and exit if creation failed + const core::dimension2du videoDim(800,600); + + IrrlichtDevice *device = createDevice(driverType, videoDim, 32, false ); + + if (device == 0) + return 1; // could not create selected driver. + + const char* mapname=0; + if (argc>2) + mapname = argv[2]; + else + mapname = QUAKE3_MAP_NAME; + + /* + Get a pointer to the video driver and the SceneManager so that + we do not always have to write device->getVideoDriver() and + device->getSceneManager(). + */ + video::IVideoDriver* driver = device->getVideoDriver(); + scene::ISceneManager* smgr = device->getSceneManager(); + gui::IGUIEnvironment* gui = device->getGUIEnvironment(); + + //! add our private media directory to the file system + device->getFileSystem()->addFileArchive("../../media/"); + + /* + To display the Quake 3 map, we first need to load it. Quake 3 maps + are packed into .pk3 files, which are nothing other than .zip files. + So we add the .pk3 file to our FileSystem. After it was added, + we are able to read from the files in that archive as they would + directly be stored on disk. + */ + if (argc>2) + device->getFileSystem()->QUAKE3_STORAGE_FORMAT(argv[1]); + else + device->getFileSystem()->QUAKE3_STORAGE_FORMAT(QUAKE3_STORAGE_1); +#ifdef QUAKE3_STORAGE_2 + device->getFileSystem()->QUAKE3_STORAGE_FORMAT(QUAKE3_STORAGE_2); +#endif + + // Quake3 Shader controls Z-Writing + smgr->getParameters()->setAttribute(scene::ALLOW_ZWRITE_ON_TRANSPARENT, true); + + /* + Now we can load the mesh by calling getMesh(). We get a pointer returned + to a IAnimatedMesh. As you know, Quake 3 maps are not really animated, + they are only a huge chunk of static geometry with some materials + attached. Hence the IAnimated mesh consists of only one frame, + so we get the "first frame" of the "animation", which is our quake level + and create an Octree scene node with it, using addOctreeSceneNode(). + The Octree optimizes the scene a little bit, trying to draw only geometry + which is currently visible. An alternative to the Octree would be a + AnimatedMeshSceneNode, which would draw always the complete geometry of + the mesh, without optimization. Try it out: Write addAnimatedMeshSceneNode + instead of addOctreeSceneNode and compare the primitives drawn by the + video driver. (There is a getPrimitiveCountDrawed() method in the + IVideoDriver class). Note that this optimization with the Octree is only + useful when drawing huge meshes consisting of lots of geometry. + */ + scene::IQ3LevelMesh* const mesh = + (scene::IQ3LevelMesh*) smgr->getMesh(mapname); + + /* + add the geometry mesh to the Scene ( polygon & patches ) + The Geometry mesh is optimised for faster drawing + */ + scene::ISceneNode* node = 0; + if (mesh) + { + scene::IMesh * const geometry = mesh->getMesh(quake3::E_Q3_MESH_GEOMETRY); + node = smgr->addOctreeSceneNode(geometry, 0, -1, 4096); + } + + // create an event receiver for making screenshots + CScreenShotFactory screenshotFactory(device, mapname, node); + device->setEventReceiver(&screenshotFactory); + + /* + now construct SceneNodes for each Shader + The Objects are stored in the quake mesh scene::E_Q3_MESH_ITEMS + and the Shader ID is stored in the MaterialParameters + mostly dark looking skulls and moving lava.. or green flashing tubes? + */ + if ( mesh ) + { + // the additional mesh can be quite huge and is unoptimized + 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"); + u32 count = 0; +#endif + + for ( u32 i = 0; i!= additional_mesh->getMeshBufferCount(); ++i ) + { + const IMeshBuffer* meshBuffer = additional_mesh->getMeshBuffer(i); + const video::SMaterial& material = meshBuffer->getMaterial(); + + // The ShaderIndex is stored in the material parameter + const s32 shaderIndex = (s32) material.MaterialTypeParam2; + + // the meshbuffer can be rendered without additional support, or it has no shader + const quake3::IShader *shader = mesh->getShader(shaderIndex); + if (0 == shader) + { + continue; + } + + // we can dump the shader to the console in its + // original but already parsed layout in a pretty + // printers way.. commented out, because the console + // would be full... + // quake3::dumpShader ( Shader ); + + node = smgr->addQuake3SceneNode(meshBuffer, shader); + +#ifdef SHOW_SHADER_NAME + count += 1; + core::stringw name( node->getName() ); + node = smgr->addBillboardTextSceneNode( + font, name.c_str(), node, + core::dimension2d(80.0f, 8.0f), + core::vector3df(0, 10, 0)); +#endif + } + } + + /* + Now we only need a Camera to look at the Quake 3 map. And we want to + create a user controlled camera. There are some different cameras + available in the Irrlicht engine. For example the Maya Camera which can + be controlled comparable to the camera in Maya: Rotate with left mouse + button pressed, Zoom with both buttons pressed, translate with right + mouse button pressed. This could be created with + addCameraSceneNodeMaya(). But for this example, we want to create a + camera which behaves like the ones in first person shooter games (FPS). + */ + + scene::ICameraSceneNode* camera = smgr->addCameraSceneNodeFPS(); + + /* + so we need a good starting Position in the level. + we can ask the Quake3 Loader for all entities with class_name + "info_player_deathmatch" + we choose a random launch + */ + if ( mesh ) + { + quake3::tQ3EntityList &entityList = mesh->getEntityList(); + + quake3::IEntity search; + search.name = "info_player_deathmatch"; + + s32 index = entityList.binary_search(search); + if (index >= 0) + { + s32 notEndList; + do + { + const quake3::SVarGroup *group = entityList[index].getGroup(1); + + u32 parsepos = 0; + const core::vector3df pos = + quake3::getAsVector3df(group->get("origin"), parsepos); + + parsepos = 0; + const f32 angle = quake3::getAsFloat(group->get("angle"), parsepos); + + core::vector3df target(0.f, 0.f, 1.f); + target.rotateXZBy(angle); + + camera->setPosition(pos); + camera->setTarget(pos + target); + + ++index; +/* + notEndList = ( index < (s32) entityList.size () && + entityList[index].name == search.name && + (device->getTimer()->getRealTime() >> 3 ) & 1 + ); +*/ + notEndList = index == 2; + } while ( notEndList ); + } + } + + /* + The mouse cursor needs not to be visible, so we make it invisible. + */ + + device->getCursorControl()->setVisible(false); + + // load the engine logo + gui->addImage(driver->getTexture("irrlichtlogo2.png"), + core::position2d(10, 10)); + + // show the driver logo + const core::position2di pos(videoDim.Width - 128, videoDim.Height - 64); + + switch ( driverType ) + { + case video::EDT_BURNINGSVIDEO: + gui->addImage(driver->getTexture("burninglogo.png"), pos); + break; + 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; + } + + /* + We have done everything, so lets draw it. We also write the current + frames per second and the drawn primitives to the caption of the + window. The 'if (device->isWindowActive())' line is optional, but + prevents the engine render to set the position of the mouse cursor + after task switching when other program are active. + */ + int lastFPS = -1; + + while(device->run()) + if (device->isWindowActive()) + { + driver->beginScene(true, true, video::SColor(255,20,20,40)); + smgr->drawAll(); + gui->drawAll(); + driver->endScene(); + + int fps = driver->getFPS(); + //if (lastFPS != fps) + { + io::IAttributes * const attr = smgr->getParameters(); + core::stringw str = L"Q3 ["; + str += driver->getName(); + str += "] FPS:"; + str += fps; +#ifdef _IRR_SCENEMANAGER_DEBUG + str += " Cull:"; + str += attr->getAttributeAsInt("calls"); + str += "/"; + str += attr->getAttributeAsInt("culled"); + str += " Draw: "; + str += attr->getAttributeAsInt("drawn_solid"); + str += "/"; + str += attr->getAttributeAsInt("drawn_transparent"); + str += "/"; + str += attr->getAttributeAsInt("drawn_transparent_effect"); +#endif + device->setWindowCaption(str.c_str()); + lastFPS = fps; + } + } + + /* + In the end, delete the Irrlicht device. + */ + device->drop(); + + return 0; +} + +/* +**/ diff --git a/libraries/irrlicht-1.8.1/examples/17.HelloWorld_Mobile/17. HelloWorld for Windows Mobile on PC_v8.vcproj b/libraries/irrlicht-1.8.1/examples/17.HelloWorld_Mobile/17. HelloWorld for Windows Mobile on PC_v8.vcproj new file mode 100644 index 0000000..be07354 --- /dev/null +++ b/libraries/irrlicht-1.8.1/examples/17.HelloWorld_Mobile/17. HelloWorld for Windows Mobile on PC_v8.vcproj @@ -0,0 +1,185 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/libraries/irrlicht-1.8.1/examples/17.HelloWorld_Mobile/17. HelloWorld for Windows Mobile on PC_v9.vcproj b/libraries/irrlicht-1.8.1/examples/17.HelloWorld_Mobile/17. HelloWorld for Windows Mobile on PC_v9.vcproj new file mode 100644 index 0000000..acdc249 --- /dev/null +++ b/libraries/irrlicht-1.8.1/examples/17.HelloWorld_Mobile/17. HelloWorld for Windows Mobile on PC_v9.vcproj @@ -0,0 +1,184 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/libraries/irrlicht-1.8.1/examples/17.HelloWorld_Mobile/17. HelloWorld for Windows Mobile on PC_vc10.vcxproj b/libraries/irrlicht-1.8.1/examples/17.HelloWorld_Mobile/17. HelloWorld for Windows Mobile on PC_vc10.vcxproj new file mode 100644 index 0000000..e46cb0c --- /dev/null +++ b/libraries/irrlicht-1.8.1/examples/17.HelloWorld_Mobile/17. HelloWorld for Windows Mobile on PC_vc10.vcxproj @@ -0,0 +1,176 @@ + + + + + Debug + Win32 + + + Debug + x64 + + + Release + Win32 + + + Release + x64 + + + + 17.HelloWorld_Mobile + {2A29B6B1-AFC4-46C7-9944-7052AAE66F7B} + My17HelloWorldforWindowsMobileonPC + Win32Proj + + + + Application + Unicode + true + + + Application + Unicode + true + + + Application + Unicode + + + Application + Unicode + + + + + + + + + + + + + + + + + + + <_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/libraries/irrlicht-1.8.1/examples/17.HelloWorld_Mobile/17. HelloWorld for Windows Mobile on PC_vc11.vcxproj b/libraries/irrlicht-1.8.1/examples/17.HelloWorld_Mobile/17. HelloWorld for Windows Mobile on PC_vc11.vcxproj new file mode 100644 index 0000000..27b8ed4 --- /dev/null +++ b/libraries/irrlicht-1.8.1/examples/17.HelloWorld_Mobile/17. HelloWorld for Windows Mobile on PC_vc11.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 + v110 + + + Application + Unicode + true + v110 + + + Application + Unicode + v110 + + + Application + Unicode + v110 + + + + + + + + + + + + + + + + + + + <_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/libraries/irrlicht-1.8.1/examples/17.HelloWorld_Mobile/HelloWorld_mobile.sln b/libraries/irrlicht-1.8.1/examples/17.HelloWorld_Mobile/HelloWorld_mobile.sln new file mode 100644 index 0000000..31932b7 --- /dev/null +++ b/libraries/irrlicht-1.8.1/examples/17.HelloWorld_Mobile/HelloWorld_mobile.sln @@ -0,0 +1,33 @@ + +Microsoft Visual Studio Solution File, Format Version 9.00 +# Visual Studio 2005 +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "17.HelloWorld_mobile", "HelloWorld_mobile.vcproj", "{AD95D5D7-91D2-4030-B28D-23A6FE5C0359}" + ProjectSection(ProjectDependencies) = postProject + {E08E042A-6C45-411B-92BE-3CC31331019F} = {E08E042A-6C45-411B-92BE-3CC31331019F} + EndProjectSection +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Irrlicht", "..\..\source\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 + {AD95D5D7-91D2-4030-B28D-23A6FE5C0359}.Debug|Windows Mobile 6 Professional SDK (ARMV4I).ActiveCfg = Debug|Windows Mobile 6 Professional SDK (ARMV4I) + {AD95D5D7-91D2-4030-B28D-23A6FE5C0359}.Debug|Windows Mobile 6 Professional SDK (ARMV4I).Build.0 = Debug|Windows Mobile 6 Professional SDK (ARMV4I) + {AD95D5D7-91D2-4030-B28D-23A6FE5C0359}.Debug|Windows Mobile 6 Professional SDK (ARMV4I).Deploy.0 = Debug|Windows Mobile 6 Professional SDK (ARMV4I) + {AD95D5D7-91D2-4030-B28D-23A6FE5C0359}.Release|Windows Mobile 6 Professional SDK (ARMV4I).ActiveCfg = Release|Windows Mobile 6 Professional SDK (ARMV4I) + {AD95D5D7-91D2-4030-B28D-23A6FE5C0359}.Release|Windows Mobile 6 Professional SDK (ARMV4I).Build.0 = Release|Windows Mobile 6 Professional SDK (ARMV4I) + {AD95D5D7-91D2-4030-B28D-23A6FE5C0359}.Release|Windows Mobile 6 Professional SDK (ARMV4I).Deploy.0 = Release|Windows Mobile 6 Professional SDK (ARMV4I) + {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/libraries/irrlicht-1.8.1/examples/17.HelloWorld_Mobile/HelloWorld_mobile.vcproj b/libraries/irrlicht-1.8.1/examples/17.HelloWorld_Mobile/HelloWorld_mobile.vcproj new file mode 100644 index 0000000..dcaca9e --- /dev/null +++ b/libraries/irrlicht-1.8.1/examples/17.HelloWorld_Mobile/HelloWorld_mobile.vcproj @@ -0,0 +1,198 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/libraries/irrlicht-1.8.1/examples/17.HelloWorld_Mobile/main.cpp b/libraries/irrlicht-1.8.1/examples/17.HelloWorld_Mobile/main.cpp new file mode 100644 index 0000000..4fc15cd --- /dev/null +++ b/libraries/irrlicht-1.8.1/examples/17.HelloWorld_Mobile/main.cpp @@ -0,0 +1,503 @@ +/** 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. +*/ + +#include + +#if defined ( _IRR_WINDOWS_ ) + #include +#endif + +using namespace irr; +using namespace core; +using namespace scene; +using namespace video; +using namespace io; +using namespace gui; + +#pragma comment(lib, "Irrlicht.lib") + +class EventReceiver_basic : public IEventReceiver +{ +private: + IrrlichtDevice *Device; +public: + EventReceiver_basic ( IrrlichtDevice *device ): Device ( device ) {} + + virtual bool OnEvent(const SEvent& event) + { + if (event.EventType == EET_GUI_EVENT) + { + s32 id = event.GUIEvent.Caller->getID(); + + switch(event.GUIEvent.EventType) + { + case EGET_BUTTON_CLICKED: + if (id == 2) + { + Device->closeDevice(); + return true; + } break; + } + } + + return false; + } +}; + +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; + +#if defined (_IRR_USE_WINDOWS_CE_DEVICE_) + // set to standard mobile fullscreen 240x320 + device = createDevice(driverType, dimension2d(240, 320), 16, true ); +#else + // on PC. use window mode + device = createDevice(driverType, dimension2d(240, 320), 16, false ); +#endif + 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: + + EventReceiver_terrain(IrrlichtDevice *device, scene::ISceneNode* terrain, scene::ISceneNode* skybox, scene::ISceneNode* skydome) : + Device ( device ), Terrain(terrain), Skybox(skybox), Skydome(skydome), showBox(true) + { + Skybox->setVisible(true); + Skydome->setVisible(false); + } + + bool OnEvent(const SEvent& event) + { + if (event.EventType == EET_GUI_EVENT) + { + s32 id = event.GUIEvent.Caller->getID(); + + switch(event.GUIEvent.EventType) + { + case EGET_BUTTON_CLICKED: + if (id == 2) + { + Device->closeDevice(); + return true; + } break; + } + } + + // check if user presses the key 'W' or 'D' + if (event.EventType == irr::EET_KEY_INPUT_EVENT && !event.KeyInput.PressedDown) + { + switch (event.KeyInput.Key) + { + case irr::KEY_KEY_W: // switch wire frame mode + Terrain->setMaterialFlag(video::EMF_WIREFRAME, + !Terrain->getMaterial(0).Wireframe); + Terrain->setMaterialFlag(video::EMF_POINTCLOUD, false); + return true; + case irr::KEY_KEY_P: // switch wire frame mode + Terrain->setMaterialFlag(video::EMF_POINTCLOUD, + !Terrain->getMaterial(0).PointCloud); + Terrain->setMaterialFlag(video::EMF_WIREFRAME, false); + return true; + case irr::KEY_KEY_D: // toggle detail map + Terrain->setMaterialType( + Terrain->getMaterial(0).MaterialType == video::EMT_SOLID ? + video::EMT_DETAIL_MAP : video::EMT_SOLID); + return true; + case irr::KEY_KEY_S: // toggle skies + showBox=!showBox; + Skybox->setVisible(showBox); + Skydome->setVisible(!showBox); + return true; + default: + break; + } + } + + return false; + } + +private: + IrrlichtDevice *Device; + scene::ISceneNode* Terrain; + scene::ISceneNode* Skybox; + scene::ISceneNode* Skydome; + bool showBox; +}; + + +/* +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 example_terrain() +{ + // create device + IrrlichtDevice *device = startup(); + if (device == 0) + return 1; // could not create selected driver. + + /* + First, we add standard stuff to the scene: A nice irrlicht engine + logo, a small help text, a user controlled camera, and we disable + the mouse cursor. + */ + + video::IVideoDriver* driver = device->getVideoDriver(); + scene::ISceneManager* smgr = device->getSceneManager(); + gui::IGUIEnvironment* env = device->getGUIEnvironment(); + + + //set other font + //env->getSkin()->setFont(env->getFont("../../media/fontlucida.png")); + + // add some help text + env->addStaticText( + L"Press 'W' to change wireframe mode\nPress 'D' to toggle detail map\nPress 'S' to toggle skybox/skydome", + core::rect(5,250,235,320), true, true, 0, -1, true); + + // add camera + scene::ICameraSceneNode* camera = + smgr->addCameraSceneNodeFPS(0,100.0f,1.2f); + + camera->setPosition(core::vector3df(2700*2,255*2,2600*2)); + camera->setTarget(core::vector3df(2397*2,343*2,2700*2)); + camera->setFarValue(42000.0f); + + // disable mouse cursor + device->getCursorControl()->setVisible(false); + + /* + Here comes the terrain renderer scene node: We add it just like any + other scene node to the scene using + ISceneManager::addTerrainSceneNode(). The only parameter we use is a + file name to the heightmap we use. A heightmap is simply a gray scale + texture. The terrain renderer loads it and creates the 3D terrain from + it. + + To make the terrain look more big, we change the scale factor of + it to (40, 4.4, 40). Because we don't have any dynamic lights in the + scene, we switch off the lighting, and we set the file + terrain-texture.jpg as texture for the terrain and detailmap3.jpg as + second texture, called detail map. At last, we set the scale values for + the texture: The first texture will be repeated only one time over the + whole terrain, and the second one (detail map) 20 times. + */ + + // add terrain scene node + scene::ITerrainSceneNode* terrain = smgr->addTerrainSceneNode( + "../../media/terrain-heightmap.bmp", + 0, // parent node + -1, // node id + core::vector3df(0.f, 0.f, 0.f), // position + core::vector3df(0.f, 0.f, 0.f), // rotation + core::vector3df(40.f, 4.4f, 40.f), // scale + video::SColor ( 255, 255, 255, 255 ), // vertexColor + 5, // maxLOD + scene::ETPS_17, // patchSize + 4 // smoothFactor + ); + + if ( terrain ) + { + terrain->setMaterialFlag(video::EMF_LIGHTING, false); + + terrain->setMaterialTexture(0, + driver->getTexture("../../media/terrain-texture.jpg")); + terrain->setMaterialTexture(1, + driver->getTexture("../../media/detailmap3.jpg")); + + terrain->setMaterialType(video::EMT_DETAIL_MAP); + + terrain->scaleTexture(1.0f, 20.0f); + //terrain->setDebugDataVisible ( true ); + + /* + To be able to do collision with the terrain, we create a triangle selector. + If you want to know what triangle selectors do, just take a look into the + collision tutorial. The terrain triangle selector works together with the + terrain. To demonstrate this, we create a collision response animator + and attach it to the camera, so that the camera will not be able to fly + through the terrain. + */ + + // create triangle selector for the terrain + scene::ITriangleSelector* selector + = smgr->createTerrainTriangleSelector(terrain, 0); + terrain->setTriangleSelector(selector); + + // create collision response animator and attach it to the camera + scene::ISceneNodeAnimator* anim = smgr->createCollisionResponseAnimator( + selector, camera, core::vector3df(60,100,60), + core::vector3df(0,0,0), + core::vector3df(0,50,0)); + selector->drop(); + camera->addAnimator(anim); + anim->drop(); + + /* If you need access to the terrain data you can also do this directly via the following code fragment. + */ + scene::CDynamicMeshBuffer* buffer = new scene::CDynamicMeshBuffer(video::EVT_2TCOORDS, video::EIT_16BIT); + terrain->getMeshBufferForLOD(*buffer, 0); + video::S3DVertex2TCoords* data = (video::S3DVertex2TCoords*)buffer->getVertexBuffer().getData(); + // Work on data or get the IndexBuffer with a similar call. + buffer->drop(); // When done drop the buffer again. + } + + /* + To make the user be able to switch between normal and wireframe mode, + we create an instance of the event receiver from above and let Irrlicht + know about it. In addition, we add the skybox which we already used in + lots of Irrlicht examples and a skydome, which is shown mutually + exclusive with the skybox by pressing 'S'. + */ + + // create skybox and skydome + 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->setTextureCreationFlag(video::ETCF_CREATE_MIP_MAPS, true); + + // create event receiver + EventReceiver_terrain receiver( device, terrain, skybox, skydome); + device->setEventReceiver(&receiver); + + return run ( device ); +} + +/* +*/ +int example_helloworld() +{ + // create device + IrrlichtDevice *device = startup(); + if (device == 0) + return 1; // could not create selected driver. + + IVideoDriver* driver = device->getVideoDriver(); + ISceneManager* smgr = device->getSceneManager(); + IGUIEnvironment* guienv = device->getGUIEnvironment(); + + IAnimatedMesh* mesh = smgr->getMesh("../../media/sydney.md2"); + if (!mesh) + { + device->drop(); + return 1; + } + IAnimatedMeshSceneNode* node = smgr->addAnimatedMeshSceneNode( mesh ); + + /* + To let the mesh look a little bit nicer, we change its material. We + disable lighting because we do not have a dynamic light in here, and + the mesh would be totally black otherwise. Then we set the frame loop, + such that the predefined STAND animation is used. And last, we apply a + texture to the mesh. Without it the mesh would be drawn using only a + color. + */ + if (node) + { + node->setMaterialFlag(EMF_LIGHTING, false); + node->setMD2Animation(scene::EMAT_STAND); + node->setMaterialTexture( 0, driver->getTexture("../../media/sydney.bmp") ); + } + + /* + To look at the mesh, we place a camera into 3d space at the position + (0, 30, -40). The camera looks from there to (0,5,0), which is + approximately the place where our md2 model is. + */ + smgr->addCameraSceneNode(0, vector3df(0,30,-40), vector3df(0,5,0)); + + EventReceiver_basic receiver(device); + device->setEventReceiver(&receiver); + + return run ( device ); + +} + +#if defined (_IRR_USE_WINDOWS_CE_DEVICE_) + #pragma comment(linker, "/subsystem:WINDOWSCE /ENTRY:main") +#elif defined (_IRR_WINDOWS_) + #pragma comment(linker, "/subsystem:windows /ENTRY:mainCRTStartup") +#endif + +/* +*/ +int main() +{ + example_helloworld (); + example_customscenenode(); + //example_terrain(); +} + +/* +**/ diff --git a/libraries/irrlicht-1.8.1/examples/18.SplitScreen/Makefile b/libraries/irrlicht-1.8.1/examples/18.SplitScreen/Makefile new file mode 100644 index 0000000..5ad6913 --- /dev/null +++ b/libraries/irrlicht-1.8.1/examples/18.SplitScreen/Makefile @@ -0,0 +1,38 @@ +# Makefile for Irrlicht Examples +# It's usually sufficient to change just the target name and source file list +# and be sure that CXX is set to a valid compiler +Target = 18.SplitScreen +Sources = main.cpp + +# general compiler settings +CPPFLAGS = -I../../include -I/usr/X11R6/include +CXXFLAGS = -O3 -ffast-math +#CXXFLAGS = -g -Wall + +#default target is Linux +all: all_linux + +ifeq ($(HOSTTYPE), x86_64) +LIBSELECT=64 +endif + +# target specific settings +all_linux: LDFLAGS = -L/usr/X11R6/lib$(LIBSELECT) -L../../lib/Linux -lIrrlicht -lGL -lXxf86vm -lXext -lX11 -lXcursor +all_linux clean_linux: SYSTEM=Linux +all_win32: LDFLAGS = -L../../lib/Win32-gcc -lIrrlicht -lopengl32 -lm +all_win32 clean_win32: SYSTEM=Win32-gcc +all_win32 clean_win32: SUF=.exe +# name of the binary - only valid for targets which set SYSTEM +DESTPATH = ../../bin/$(SYSTEM)/$(Target)$(SUF) + +all_linux all_win32: + $(warning Building...) + $(CXX) $(CPPFLAGS) $(CXXFLAGS) $(Sources) -o $(DESTPATH) $(LDFLAGS) + +clean: clean_linux clean_win32 + $(warning Cleaning...) + +clean_linux clean_win32: + @$(RM) $(DESTPATH) + +.PHONY: all all_win32 clean clean_linux clean_win32 diff --git a/libraries/irrlicht-1.8.1/examples/18.SplitScreen/SplitScreen.cbp b/libraries/irrlicht-1.8.1/examples/18.SplitScreen/SplitScreen.cbp new file mode 100644 index 0000000..93ff1d8 --- /dev/null +++ b/libraries/irrlicht-1.8.1/examples/18.SplitScreen/SplitScreen.cbp @@ -0,0 +1,55 @@ + + + + + + diff --git a/libraries/irrlicht-1.8.1/examples/18.SplitScreen/SplitScreen.dev b/libraries/irrlicht-1.8.1/examples/18.SplitScreen/SplitScreen.dev new file mode 100644 index 0000000..cd843c6 --- /dev/null +++ b/libraries/irrlicht-1.8.1/examples/18.SplitScreen/SplitScreen.dev @@ -0,0 +1,59 @@ +[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/libraries/irrlicht-1.8.1/examples/18.SplitScreen/SplitScreen.vcproj b/libraries/irrlicht-1.8.1/examples/18.SplitScreen/SplitScreen.vcproj new file mode 100644 index 0000000..46cb6b7 --- /dev/null +++ b/libraries/irrlicht-1.8.1/examples/18.SplitScreen/SplitScreen.vcproj @@ -0,0 +1,132 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/libraries/irrlicht-1.8.1/examples/18.SplitScreen/SplitScreen_vc10.vcxproj b/libraries/irrlicht-1.8.1/examples/18.SplitScreen/SplitScreen_vc10.vcxproj new file mode 100644 index 0000000..7db11fe --- /dev/null +++ b/libraries/irrlicht-1.8.1/examples/18.SplitScreen/SplitScreen_vc10.vcxproj @@ -0,0 +1,190 @@ + + + + + Debug + Win32 + + + Debug + x64 + + + Release + Win32 + + + Release + x64 + + + + 18.SplitScreen + {1AB9413E-4F53-42A3-8CB2-CB4BE22336D0} + 18.SplitScreen + Win32Proj + + + + Application + MultiByte + + + Application + MultiByte + + + Application + MultiByte + + + Application + MultiByte + + + + + + + + + + + + + + + + + + + + + + + <_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/libraries/irrlicht-1.8.1/examples/18.SplitScreen/SplitScreen_vc11.vcxproj b/libraries/irrlicht-1.8.1/examples/18.SplitScreen/SplitScreen_vc11.vcxproj new file mode 100644 index 0000000..954ace3 --- /dev/null +++ b/libraries/irrlicht-1.8.1/examples/18.SplitScreen/SplitScreen_vc11.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 + v110 + + + Application + MultiByte + v110 + + + Application + MultiByte + v110 + + + Application + MultiByte + v110 + + + + + + + + + + + + + + + + + + + + + + + <_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/libraries/irrlicht-1.8.1/examples/18.SplitScreen/SplitScreen_vc8.vcproj b/libraries/irrlicht-1.8.1/examples/18.SplitScreen/SplitScreen_vc8.vcproj new file mode 100644 index 0000000..906b950 --- /dev/null +++ b/libraries/irrlicht-1.8.1/examples/18.SplitScreen/SplitScreen_vc8.vcproj @@ -0,0 +1,189 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/libraries/irrlicht-1.8.1/examples/18.SplitScreen/SplitScreen_vc9.vcproj b/libraries/irrlicht-1.8.1/examples/18.SplitScreen/SplitScreen_vc9.vcproj new file mode 100644 index 0000000..86f6552 --- /dev/null +++ b/libraries/irrlicht-1.8.1/examples/18.SplitScreen/SplitScreen_vc9.vcproj @@ -0,0 +1,188 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/libraries/irrlicht-1.8.1/examples/18.SplitScreen/main.cpp b/libraries/irrlicht-1.8.1/examples/18.SplitScreen/main.cpp new file mode 100644 index 0000000..32266c5 --- /dev/null +++ b/libraries/irrlicht-1.8.1/examples/18.SplitScreen/main.cpp @@ -0,0 +1,244 @@ +/** Example 018 Splitscreen + +A tutorial by Max Winkel. + +In this tutorial we'll learn how to use splitscreen (e.g. for racing-games) +with Irrlicht. We'll create a viewport divided +into 4 parts, with 3 fixed cameras and one user-controlled. + +Ok, let's start with the headers (I think there's +nothing to say about it) +*/ + +#include +#include "driverChoice.h" + +#ifdef _MSC_VER +#pragma comment(lib, "Irrlicht.lib") +#endif + +//Namespaces for the engine +using namespace irr; +using namespace core; +using namespace video; +using namespace scene; + +/* +Now we'll define the resolution in a constant for use in +initializing the device and setting up the viewport. In addition +we set up a global variable saying splitscreen is active or not. +*/ +//Resolution +const int ResX=800; +const int ResY=600; +const bool fullScreen=false; + +//Use SplitScreen? +bool SplitScreen=true; + +/* +Now we need four pointers to our cameras which are created later: +*/ +//cameras +ICameraSceneNode *camera[4]={0,0,0,0}; +/* +In our event-receiver we switch the SplitScreen-variable, +whenever the user press the S-key. All other events are sent +to the FPS camera. +*/ + +class MyEventReceiver : public IEventReceiver +{ + public: + virtual bool OnEvent(const SEvent& event) + { + //Key S enables/disables SplitScreen + if (event.EventType == irr::EET_KEY_INPUT_EVENT && + event.KeyInput.Key == KEY_KEY_S && event.KeyInput.PressedDown) + { + SplitScreen = !SplitScreen; + return true; + } + //Send all other events to camera4 + if (camera[3]) + return camera[3]->OnEvent(event); + return false; + } +}; + +/* +Ok, now the main-function: +First, we initialize the device, get the SourceManager and +VideoDriver, load an animated mesh from .md2 and a map from +.pk3. Because that's old stuff, I won't explain every step. +Just take care of the maps position. +*/ +int main() +{ + // ask user for driver + video::E_DRIVER_TYPE driverType=driverChoiceConsole(); + if (driverType==video::EDT_COUNT) + return 1; + + //Instance of the EventReceiver + MyEventReceiver receiver; + + //Initialise the engine + IrrlichtDevice *device = createDevice(driverType, + dimension2du(ResX,ResY), 32, fullScreen, + false, false, &receiver); + if (!device) + return 1; + + ISceneManager *smgr = device->getSceneManager(); + IVideoDriver *driver = device->getVideoDriver(); + + //Load model + IAnimatedMesh *model = smgr->getMesh("../../media/sydney.md2"); + if (!model) + return 1; + IAnimatedMeshSceneNode *model_node = smgr->addAnimatedMeshSceneNode(model); + //Load texture + if (model_node) + { + ITexture *texture = driver->getTexture("../../media/sydney.bmp"); + model_node->setMaterialTexture(0,texture); + model_node->setMD2Animation(scene::EMAT_RUN); + //Disable lighting (we've got no light) + model_node->setMaterialFlag(EMF_LIGHTING,false); + } + + //Load map + device->getFileSystem()->addFileArchive("../../media/map-20kdm2.pk3"); + IAnimatedMesh *map = smgr->getMesh("20kdm2.bsp"); + if (map) + { + ISceneNode *map_node = smgr->addOctreeSceneNode(map->getMesh(0)); + //Set position + map_node->setPosition(vector3df(-850,-220,-850)); + } + +/* +Now we create our four cameras. One is looking at the model +from the front, one from the top and one from the side. In +addition there's a FPS-camera which can be controlled by the +user. +*/ + // Create 3 fixed and one user-controlled cameras + //Front + camera[0] = smgr->addCameraSceneNode(0, vector3df(50,0,0), vector3df(0,0,0)); + //Top + camera[1] = smgr->addCameraSceneNode(0, vector3df(0,50,0), vector3df(0,0,0)); + //Left + camera[2] = smgr->addCameraSceneNode(0, vector3df(0,0,50), vector3df(0,0,0)); + //User-controlled + camera[3] = smgr->addCameraSceneNodeFPS(); + // don't start at sydney's position + if (camera[3]) + camera[3]->setPosition(core::vector3df(-50,0,-50)); + +/* +Create a variable for counting the fps and hide the mouse: +*/ + //Hide mouse + device->getCursorControl()->setVisible(false); + //We want to count the fps + int lastFPS = -1; + +/* +There wasn't much new stuff - till now! +Only by defining four cameras, the game won't be splitscreen. +To do this you need several steps: + - Set the viewport to the whole screen + - Begin a new scene (Clear screen) + + - The following 3 steps are repeated for every viewport in the splitscreen + - Set the viewport to the area you wish + - Activate the camera which should be "linked" with the viewport + - Render all objects + + - If you have a GUI: + - Set the viewport the whole screen + - Display the GUI + - End scene + +Sounds a little complicated, but you'll see it isn't: +*/ + + while(device->run()) + { + //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)); + //If SplitScreen is used + if (SplitScreen) + { + //Activate camera1 + smgr->setActiveCamera(camera[0]); + //Set viewpoint to the first quarter (left top) + driver->setViewPort(rect(0,0,ResX/2,ResY/2)); + //Draw scene + smgr->drawAll(); + //Activate camera2 + smgr->setActiveCamera(camera[1]); + //Set viewpoint to the second quarter (right top) + driver->setViewPort(rect(ResX/2,0,ResX,ResY/2)); + //Draw scene + smgr->drawAll(); + //Activate camera3 + smgr->setActiveCamera(camera[2]); + //Set viewpoint to the third quarter (left bottom) + driver->setViewPort(rect(0,ResY/2,ResX/2,ResY)); + //Draw scene + smgr->drawAll(); + //Set viewport the last quarter (right bottom) + driver->setViewPort(rect(ResX/2,ResY/2,ResX,ResY)); + } + //Activate camera4 + smgr->setActiveCamera(camera[3]); + //Draw scene + smgr->drawAll(); + driver->endScene(); + + /* + As you can probably see, the image is rendered for every + viewport separately. That means, that you'll loose much performance. + Ok, if you're asking "How do I have to set the viewport + to get this or that screen?", don't panic. It's really + easy: In the rect-function you define 4 coordinates: + - X-coordinate of the corner left top + - Y-coordinate of the corner left top + - X-coordinate of the corner right bottom + - Y-coordinate of the corner right bottom + + That means, if you want to split the screen into 2 viewports + you would give the following coordinates: + - 1st viewport: 0,0,ResX/2,ResY + - 2nd viewport: ResX/2,0,ResX,ResY + + If you didn't fully understand, just play around with the example + to check out what happens. + + Now we just view the current fps and shut down the engine, + when the user wants to: + */ + //Get and show fps + if (driver->getFPS() != lastFPS) + { + lastFPS = driver->getFPS(); + core::stringw tmp = L"Irrlicht SplitScreen-Example (FPS: "; + tmp += lastFPS; + tmp += ")"; + device->setWindowCaption(tmp.c_str()); + } + } + //Delete device + device->drop(); + return 0; +} +/* +That's it! Just compile and play around with the program. +Note: With the S-Key you can switch between using splitscreen +and not. +**/ + diff --git a/libraries/irrlicht-1.8.1/examples/19.MouseAndJoystick/Makefile b/libraries/irrlicht-1.8.1/examples/19.MouseAndJoystick/Makefile new file mode 100644 index 0000000..2462ea8 --- /dev/null +++ b/libraries/irrlicht-1.8.1/examples/19.MouseAndJoystick/Makefile @@ -0,0 +1,39 @@ +# Makefile for Irrlicht Examples +# It's usually sufficient to change just the target name and source file list +# and be sure that CXX is set to a valid compiler +Target = 19.MouseAndJoystick +Sources = main.cpp + +# general compiler settings +CPPFLAGS = -I../../include -I/usr/X11R6/include +#CXXFLAGS = -O3 -ffast-math +CXXFLAGS = -g -Wall + +#default target is Linux +all: all_linux + +ifeq ($(HOSTTYPE), x86_64) +LIBSELECT=64 +endif + +# target specific settings +all_linux: LDFLAGS = -L/usr/X11R6/lib$(LIBSELECT) -L../../lib/Linux -lIrrlicht -lGL -lXxf86vm -lXext -lX11 -lXcursor +all_linux clean_linux: SYSTEM=Linux +all_win32: LDFLAGS = -L../../lib/Win32-gcc -lIrrlicht -lopengl32 -lm +all_win32: CPPFLAGS += -D__GNUWIN32__ -D_WIN32 -DWIN32 -D_WINDOWS -D_MBCS -D_USRDLL +all_win32 clean_win32: SYSTEM=Win32-gcc +all_win32 clean_win32: SUF=.exe +# name of the binary - only valid for targets which set SYSTEM +DESTPATH = ../../bin/$(SYSTEM)/$(Target)$(SUF) + +all_linux all_win32: + $(warning Building...) + $(CXX) $(CPPFLAGS) $(CXXFLAGS) $(Sources) -o $(DESTPATH) $(LDFLAGS) + +clean: clean_linux clean_win32 + $(warning Cleaning...) + +clean_linux clean_win32: + @$(RM) $(DESTPATH) + +.PHONY: all all_win32 clean clean_linux clean_win32 diff --git a/libraries/irrlicht-1.8.1/examples/19.MouseAndJoystick/MouseAndJoystick.cbp b/libraries/irrlicht-1.8.1/examples/19.MouseAndJoystick/MouseAndJoystick.cbp new file mode 100644 index 0000000..808c0a7 --- /dev/null +++ b/libraries/irrlicht-1.8.1/examples/19.MouseAndJoystick/MouseAndJoystick.cbp @@ -0,0 +1,56 @@ + + + + + + diff --git a/libraries/irrlicht-1.8.1/examples/19.MouseAndJoystick/MouseAndJoystick.dev b/libraries/irrlicht-1.8.1/examples/19.MouseAndJoystick/MouseAndJoystick.dev new file mode 100644 index 0000000..cac8418 --- /dev/null +++ b/libraries/irrlicht-1.8.1/examples/19.MouseAndJoystick/MouseAndJoystick.dev @@ -0,0 +1,59 @@ +[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/libraries/irrlicht-1.8.1/examples/19.MouseAndJoystick/MouseAndJoystick.vcproj b/libraries/irrlicht-1.8.1/examples/19.MouseAndJoystick/MouseAndJoystick.vcproj new file mode 100644 index 0000000..84d8396 --- /dev/null +++ b/libraries/irrlicht-1.8.1/examples/19.MouseAndJoystick/MouseAndJoystick.vcproj @@ -0,0 +1,162 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/libraries/irrlicht-1.8.1/examples/19.MouseAndJoystick/MouseAndJoystick_vc10.vcxproj b/libraries/irrlicht-1.8.1/examples/19.MouseAndJoystick/MouseAndJoystick_vc10.vcxproj new file mode 100644 index 0000000..aaa8027 --- /dev/null +++ b/libraries/irrlicht-1.8.1/examples/19.MouseAndJoystick/MouseAndJoystick_vc10.vcxproj @@ -0,0 +1,227 @@ + + + + + Debug + Win32 + + + Debug + x64 + + + Release + Win32 + + + Release + x64 + + + + 19.MouseAndJoystick + {FE853A36-E0D1-4AC5-A792-B643E70D2953} + MouseAndJoystick + + + + Application + MultiByte + + + Application + MultiByte + + + Application + MultiByte + + + Application + MultiByte + + + + + + + + + + + + + + + + + + + + + + + <_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/libraries/irrlicht-1.8.1/examples/19.MouseAndJoystick/MouseAndJoystick_vc11.vcxproj b/libraries/irrlicht-1.8.1/examples/19.MouseAndJoystick/MouseAndJoystick_vc11.vcxproj new file mode 100644 index 0000000..44c2b07 --- /dev/null +++ b/libraries/irrlicht-1.8.1/examples/19.MouseAndJoystick/MouseAndJoystick_vc11.vcxproj @@ -0,0 +1,231 @@ + + + + + Debug + Win32 + + + Debug + x64 + + + Release + Win32 + + + Release + x64 + + + + 19.MouseAndJoystick + {FE853A36-E0D1-4AC5-A792-B643E70D2953} + MouseAndJoystick + + + + Application + MultiByte + v110 + + + Application + MultiByte + v110 + + + Application + MultiByte + v110 + + + Application + MultiByte + v110 + + + + + + + + + + + + + + + + + + + + + + + <_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/libraries/irrlicht-1.8.1/examples/19.MouseAndJoystick/MouseAndJoystick_vc8.vcproj b/libraries/irrlicht-1.8.1/examples/19.MouseAndJoystick/MouseAndJoystick_vc8.vcproj new file mode 100644 index 0000000..51b7fac --- /dev/null +++ b/libraries/irrlicht-1.8.1/examples/19.MouseAndJoystick/MouseAndJoystick_vc8.vcproj @@ -0,0 +1,231 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/libraries/irrlicht-1.8.1/examples/19.MouseAndJoystick/MouseAndJoystick_vc9.vcproj b/libraries/irrlicht-1.8.1/examples/19.MouseAndJoystick/MouseAndJoystick_vc9.vcproj new file mode 100644 index 0000000..e121452 --- /dev/null +++ b/libraries/irrlicht-1.8.1/examples/19.MouseAndJoystick/MouseAndJoystick_vc9.vcproj @@ -0,0 +1,230 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/libraries/irrlicht-1.8.1/examples/19.MouseAndJoystick/main.cpp b/libraries/irrlicht-1.8.1/examples/19.MouseAndJoystick/main.cpp new file mode 100644 index 0000000..4563278 --- /dev/null +++ b/libraries/irrlicht-1.8.1/examples/19.MouseAndJoystick/main.cpp @@ -0,0 +1,285 @@ +/** Example 019 Mouse and Joystick + +This tutorial builds on example 04.Movement which showed how to +handle keyboard events in Irrlicht. Here we'll handle mouse events +and joystick events, if you have a joystick connected and a device +that supports joysticks. These are currently Windows, Linux and SDL +devices. +*/ + +#ifdef _MSC_VER +// We'll define this to stop MSVC complaining about sprintf(). +#define _CRT_SECURE_NO_WARNINGS +#pragma comment(lib, "Irrlicht.lib") +#endif + +#include +#include "driverChoice.h" + +using namespace irr; + +/* +Just as we did in example 04.Movement, we'll store the latest state of the +mouse and the first joystick, updating them as we receive events. +*/ +class MyEventReceiver : public IEventReceiver +{ +public: + // We'll create a struct to record info on the mouse state + struct SMouseState + { + core::position2di Position; + bool LeftButtonDown; + SMouseState() : LeftButtonDown(false) { } + } MouseState; + + // This is the one method that we have to implement + virtual bool OnEvent(const SEvent& event) + { + // Remember the mouse state + if (event.EventType == irr::EET_MOUSE_INPUT_EVENT) + { + switch(event.MouseInput.Event) + { + case EMIE_LMOUSE_PRESSED_DOWN: + MouseState.LeftButtonDown = true; + break; + + case EMIE_LMOUSE_LEFT_UP: + MouseState.LeftButtonDown = false; + break; + + case EMIE_MOUSE_MOVED: + MouseState.Position.X = event.MouseInput.X; + MouseState.Position.Y = event.MouseInput.Y; + break; + + default: + // We won't use the wheel + break; + } + } + + // The state of each connected joystick is sent to us + // once every run() of the Irrlicht device. Store the + // state of the first joystick, ignoring other joysticks. + // This is currently only supported on Windows and Linux. + if (event.EventType == irr::EET_JOYSTICK_INPUT_EVENT + && event.JoystickEvent.Joystick == 0) + { + JoystickState = event.JoystickEvent; + } + + return false; + } + + const SEvent::SJoystickEvent & GetJoystickState(void) const + { + return JoystickState; + } + + const SMouseState & GetMouseState(void) const + { + return MouseState; + } + + + MyEventReceiver() + { + } + +private: + SEvent::SJoystickEvent JoystickState; +}; + + +/* +The event receiver for keeping the pressed keys is ready, the actual responses +will be made inside the render loop, right before drawing the scene. So lets +just create an irr::IrrlichtDevice and the scene node we want to move. We also +create some other additional scene nodes, to show that there are also some +different possibilities to move and animate scene nodes. +*/ +int main() +{ + // ask user for driver + video::E_DRIVER_TYPE driverType=driverChoiceConsole(); + if (driverType==video::EDT_COUNT) + return 1; + + // create device + MyEventReceiver receiver; + + IrrlichtDevice* device = createDevice(driverType, + core::dimension2d(640, 480), 16, false, false, false, &receiver); + + if (device == 0) + return 1; // could not create selected driver. + + + core::array joystickInfo; + if(device->activateJoysticks(joystickInfo)) + { + std::cout << "Joystick support is enabled and " << joystickInfo.size() << " joystick(s) are present." << std::endl; + + for(u32 joystick = 0; joystick < joystickInfo.size(); ++joystick) + { + std::cout << "Joystick " << joystick << ":" << std::endl; + std::cout << "\tName: '" << joystickInfo[joystick].Name.c_str() << "'" << std::endl; + std::cout << "\tAxes: " << joystickInfo[joystick].Axes << std::endl; + std::cout << "\tButtons: " << joystickInfo[joystick].Buttons << std::endl; + + std::cout << "\tHat is: "; + + switch(joystickInfo[joystick].PovHat) + { + case SJoystickInfo::POV_HAT_PRESENT: + std::cout << "present" << std::endl; + break; + + case SJoystickInfo::POV_HAT_ABSENT: + std::cout << "absent" << std::endl; + break; + + case SJoystickInfo::POV_HAT_UNKNOWN: + default: + std::cout << "unknown" << std::endl; + break; + } + } + } + else + { + std::cout << "Joystick support is not enabled." << std::endl; + } + + core::stringw tmp = L"Irrlicht Joystick Example ("; + tmp += joystickInfo.size(); + tmp += " joysticks)"; + device->setWindowCaption(tmp.c_str()); + + video::IVideoDriver* driver = device->getVideoDriver(); + scene::ISceneManager* smgr = device->getSceneManager(); + + /* + We'll create an arrow mesh and move it around either with the joystick axis/hat, + or make it follow the mouse pointer. */ + scene::ISceneNode * node = smgr->addMeshSceneNode( + smgr->addArrowMesh( "Arrow", + video::SColor(255, 255, 0, 0), + video::SColor(255, 0, 255, 0), + 16,16, + 2.f, 1.3f, + 0.1f, 0.6f + ) + ); + node->setMaterialFlag(video::EMF_LIGHTING, false); + + scene::ICameraSceneNode * camera = smgr->addCameraSceneNode(); + camera->setPosition(core::vector3df(0, 0, -10)); + + // As in example 04, we'll use framerate independent movement. + u32 then = device->getTimer()->getTime(); + const f32 MOVEMENT_SPEED = 5.f; + + while(device->run()) + { + // Work out a frame delta time. + const u32 now = device->getTimer()->getTime(); + const f32 frameDeltaTime = (f32)(now - then) / 1000.f; // Time in seconds + then = now; + + bool movedWithJoystick = false; + core::vector3df nodePosition = node->getPosition(); + + if(joystickInfo.size() > 0) + { + f32 moveHorizontal = 0.f; // Range is -1.f for full left to +1.f for full right + f32 moveVertical = 0.f; // -1.f for full down to +1.f for full up. + + const SEvent::SJoystickEvent & joystickData = receiver.GetJoystickState(); + + // We receive the full analog range of the axes, and so have to implement our + // own dead zone. This is an empirical value, since some joysticks have more + // jitter or creep around the center point than others. We'll use 5% of the + // range as the dead zone, but generally you would want to give the user the + // option to change this. + const f32 DEAD_ZONE = 0.05f; + + moveHorizontal = + (f32)joystickData.Axis[SEvent::SJoystickEvent::AXIS_X] / 32767.f; + if(fabs(moveHorizontal) < DEAD_ZONE) + moveHorizontal = 0.f; + + moveVertical = + (f32)joystickData.Axis[SEvent::SJoystickEvent::AXIS_Y] / -32767.f; + if(fabs(moveVertical) < DEAD_ZONE) + moveVertical = 0.f; + + // POV hat info is only currently supported on Windows, but the value is + // guaranteed to be 65535 if it's not supported, so we can check its range. + const u16 povDegrees = joystickData.POV / 100; + if(povDegrees < 360) + { + if(povDegrees > 0 && povDegrees < 180) + moveHorizontal = 1.f; + else if(povDegrees > 180) + moveHorizontal = -1.f; + + if(povDegrees > 90 && povDegrees < 270) + moveVertical = -1.f; + else if(povDegrees > 270 || povDegrees < 90) + moveVertical = +1.f; + } + + if(!core::equals(moveHorizontal, 0.f) || !core::equals(moveVertical, 0.f)) + { + nodePosition.X += MOVEMENT_SPEED * frameDeltaTime * moveHorizontal; + nodePosition.Y += MOVEMENT_SPEED * frameDeltaTime * moveVertical; + movedWithJoystick = true; + } + } + + // If the arrow node isn't being moved with the joystick, then have it follow the mouse cursor. + if(!movedWithJoystick) + { + // Create a ray through the mouse cursor. + core::line3df ray = smgr->getSceneCollisionManager()->getRayFromScreenCoordinates( + receiver.GetMouseState().Position, camera); + + // And intersect the ray with a plane around the node facing towards the camera. + core::plane3df plane(nodePosition, core::vector3df(0, 0, -1)); + core::vector3df mousePosition; + if(plane.getIntersectionWithLine(ray.start, ray.getVector(), mousePosition)) + { + // We now have a mouse position in 3d space; move towards it. + core::vector3df toMousePosition(mousePosition - nodePosition); + const f32 availableMovement = MOVEMENT_SPEED * frameDeltaTime; + + if(toMousePosition.getLength() <= availableMovement) + nodePosition = mousePosition; // Jump to the final position + else + nodePosition += toMousePosition.normalize() * availableMovement; // Move towards it + } + } + + node->setPosition(nodePosition); + + // 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)); + smgr->drawAll(); // draw the 3d scene + driver->endScene(); + } + + /* + In the end, delete the Irrlicht device. + */ + device->drop(); + + return 0; +} + +/* +**/ diff --git a/libraries/irrlicht-1.8.1/examples/20.ManagedLights/Makefile b/libraries/irrlicht-1.8.1/examples/20.ManagedLights/Makefile new file mode 100644 index 0000000..1a40866 --- /dev/null +++ b/libraries/irrlicht-1.8.1/examples/20.ManagedLights/Makefile @@ -0,0 +1,39 @@ +# Makefile for Irrlicht Examples +# It's usually sufficient to change just the target name and source file list +# and be sure that CXX is set to a valid compiler +Target = 20.ManagedLights +Sources = main.cpp + +# general compiler settings +CPPFLAGS = -I../../include -I/usr/X11R6/include +#CXXFLAGS = -O3 -ffast-math +CXXFLAGS = -g -Wall + +#default target is Linux +all: all_linux + +ifeq ($(HOSTTYPE), x86_64) +LIBSELECT=64 +endif + +# target specific settings +all_linux: LDFLAGS = -L/usr/X11R6/lib$(LIBSELECT) -L../../lib/Linux -lIrrlicht -lGL -lXxf86vm -lXext -lX11 -lXcursor +all_linux clean_linux: SYSTEM=Linux +all_win32: LDFLAGS = -L../../lib/Win32-gcc -lIrrlicht -lopengl32 -lm +all_win32: CPPFLAGS += -D__GNUWIN32__ -D_WIN32 -DWIN32 -D_WINDOWS -D_MBCS -D_USRDLL +all_win32 clean_win32: SYSTEM=Win32-gcc +all_win32 clean_win32: SUF=.exe +# name of the binary - only valid for targets which set SYSTEM +DESTPATH = ../../bin/$(SYSTEM)/$(Target)$(SUF) + +all_linux all_win32: + $(warning Building...) + $(CXX) $(CPPFLAGS) $(CXXFLAGS) $(Sources) -o $(DESTPATH) $(LDFLAGS) + +clean: clean_linux clean_win32 + $(warning Cleaning...) + +clean_linux clean_win32: + @$(RM) $(DESTPATH) + +.PHONY: all all_win32 clean clean_linux clean_win32 diff --git a/libraries/irrlicht-1.8.1/examples/20.ManagedLights/ManagedLights.cbp b/libraries/irrlicht-1.8.1/examples/20.ManagedLights/ManagedLights.cbp new file mode 100644 index 0000000..7ec0427 --- /dev/null +++ b/libraries/irrlicht-1.8.1/examples/20.ManagedLights/ManagedLights.cbp @@ -0,0 +1,57 @@ + + + + + + diff --git a/libraries/irrlicht-1.8.1/examples/20.ManagedLights/ManagedLights.dev b/libraries/irrlicht-1.8.1/examples/20.ManagedLights/ManagedLights.dev new file mode 100644 index 0000000..9804fee --- /dev/null +++ b/libraries/irrlicht-1.8.1/examples/20.ManagedLights/ManagedLights.dev @@ -0,0 +1,59 @@ +[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/libraries/irrlicht-1.8.1/examples/20.ManagedLights/ManagedLights.vcproj b/libraries/irrlicht-1.8.1/examples/20.ManagedLights/ManagedLights.vcproj new file mode 100644 index 0000000..850a8d2 --- /dev/null +++ b/libraries/irrlicht-1.8.1/examples/20.ManagedLights/ManagedLights.vcproj @@ -0,0 +1,163 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/libraries/irrlicht-1.8.1/examples/20.ManagedLights/ManagedLights_vc10.vcxproj b/libraries/irrlicht-1.8.1/examples/20.ManagedLights/ManagedLights_vc10.vcxproj new file mode 100644 index 0000000..0144522 --- /dev/null +++ b/libraries/irrlicht-1.8.1/examples/20.ManagedLights/ManagedLights_vc10.vcxproj @@ -0,0 +1,230 @@ + + + + + Debug + Win32 + + + Debug + x64 + + + Release + Win32 + + + Release + x64 + + + + 20.ManagedLights + {16007FE2-142B-47F8-93E1-519BA3F39E71} + ManagedLights + + + + Application + MultiByte + + + Application + MultiByte + + + Application + MultiByte + + + Application + MultiByte + + + + + + + + + + + + + + + + + + + + + + + <_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/libraries/irrlicht-1.8.1/examples/20.ManagedLights/ManagedLights_vc11.vcxproj b/libraries/irrlicht-1.8.1/examples/20.ManagedLights/ManagedLights_vc11.vcxproj new file mode 100644 index 0000000..7a86129 --- /dev/null +++ b/libraries/irrlicht-1.8.1/examples/20.ManagedLights/ManagedLights_vc11.vcxproj @@ -0,0 +1,234 @@ + + + + + Debug + Win32 + + + Debug + x64 + + + Release + Win32 + + + Release + x64 + + + + 20.ManagedLights + {16007FE2-142B-47F8-93E1-519BA3F39E71} + ManagedLights + + + + Application + MultiByte + v110 + + + Application + MultiByte + v110 + + + Application + MultiByte + v110 + + + Application + MultiByte + v110 + + + + + + + + + + + + + + + + + + + + + + + <_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/libraries/irrlicht-1.8.1/examples/20.ManagedLights/ManagedLights_vc8.vcproj b/libraries/irrlicht-1.8.1/examples/20.ManagedLights/ManagedLights_vc8.vcproj new file mode 100644 index 0000000..2f37f63 --- /dev/null +++ b/libraries/irrlicht-1.8.1/examples/20.ManagedLights/ManagedLights_vc8.vcproj @@ -0,0 +1,231 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/libraries/irrlicht-1.8.1/examples/20.ManagedLights/ManagedLights_vc9.vcproj b/libraries/irrlicht-1.8.1/examples/20.ManagedLights/ManagedLights_vc9.vcproj new file mode 100644 index 0000000..736faa6 --- /dev/null +++ b/libraries/irrlicht-1.8.1/examples/20.ManagedLights/ManagedLights_vc9.vcproj @@ -0,0 +1,231 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/libraries/irrlicht-1.8.1/examples/20.ManagedLights/main.cpp b/libraries/irrlicht-1.8.1/examples/20.ManagedLights/main.cpp new file mode 100644 index 0000000..f67337a --- /dev/null +++ b/libraries/irrlicht-1.8.1/examples/20.ManagedLights/main.cpp @@ -0,0 +1,386 @@ +/** Example 020 Managed Lights + +Written by Colin MacDonald. This tutorial explains the use of the Light Manager +of Irrlicht. It enables the use of more dynamic light sources than the actual +hardware supports. Further applications of the Light Manager, such as per scene +node callbacks, are left out for simplicity of the example. +*/ + +#include +#include "driverChoice.h" + +using namespace irr; +using namespace core; + +#if defined(_MSC_VER) +#pragma comment(lib, "Irrlicht.lib") +#endif // MSC_VER + +/* + Normally, you are limited to 8 dynamic lights per scene: this is a hardware limit. If you + want to use more dynamic lights in your scene, then you can register an optional light + manager that allows you to to turn lights on and off at specific point during rendering. + You are still limited to 8 lights, but the limit is per scene node. + + This is completely optional: if you do not register a light manager, then a default + distance-based scheme will be used to prioritise hardware lights based on their distance + from the active camera. + + NO_MANAGEMENT disables the light manager and shows Irrlicht's default light behaviour. + The 8 lights nearest to the camera will be turned on, and other lights will be turned off. + In this example, this produces a funky looking but incoherent light display. + + LIGHTS_NEAREST_NODE shows an implementation that turns on a limited number of lights + per mesh scene node. If finds the 3 lights that are nearest to the node being rendered, + and turns them on, turning all other lights off. This works, but as it operates on every + light for every node, it does not scale well with many lights. The flickering you can see + in this demo is due to the lights swapping their relative positions from the cubes + (a deliberate demonstration of the limitations of this technique). + + LIGHTS_IN_ZONE shows a technique for turning on lights based on a 'zone'. Each empty scene + node is considered to be the parent of a zone. When nodes are rendered, they turn off all + lights, then find their parent 'zone' and turn on all lights that are inside that zone, i.e. + are descendents of it in the scene graph. This produces true 'local' lighting for each cube + in this example. You could use a similar technique to locally light all meshes in (e.g.) + a room, without the lights spilling out to other rooms. + + This light manager is also an event receiver; this is purely for simplicity in this example, + it's neither necessary nor recommended for a real application. +*/ +class CMyLightManager : public scene::ILightManager, public IEventReceiver +{ + typedef enum + { + NO_MANAGEMENT, + LIGHTS_NEAREST_NODE, + LIGHTS_IN_ZONE + } + LightManagementMode; + + LightManagementMode Mode; + LightManagementMode RequestedMode; + + // These data represent the state information that this light manager + // is interested in. + scene::ISceneManager * SceneManager; + core::array * SceneLightList; + scene::E_SCENE_NODE_RENDER_PASS CurrentRenderPass; + scene::ISceneNode * CurrentSceneNode; + +public: + CMyLightManager(scene::ISceneManager* sceneManager) + : Mode(NO_MANAGEMENT), RequestedMode(NO_MANAGEMENT), + SceneManager(sceneManager), SceneLightList(0), + CurrentRenderPass(scene::ESNRP_NONE), CurrentSceneNode(0) + { } + + // The input receiver interface, which just switches light management strategy + bool OnEvent(const SEvent & event) + { + bool handled = false; + + if (event.EventType == irr::EET_KEY_INPUT_EVENT && event.KeyInput.PressedDown) + { + handled = true; + switch(event.KeyInput.Key) + { + case irr::KEY_KEY_1: + RequestedMode = NO_MANAGEMENT; + break; + case irr::KEY_KEY_2: + RequestedMode = LIGHTS_NEAREST_NODE; + break; + case irr::KEY_KEY_3: + RequestedMode = LIGHTS_IN_ZONE; + break; + default: + handled = false; + break; + } + + if(NO_MANAGEMENT == RequestedMode) + SceneManager->setLightManager(0); // Show that it's safe to register the light manager + else + SceneManager->setLightManager(this); + } + + return handled; + } + + + // This is called before the first scene node is rendered. + virtual void OnPreRender(core::array & lightList) + { + // Update the mode; changing it here ensures that it's consistent throughout a render + Mode = RequestedMode; + + // Store the light list. I am free to alter this list until the end of OnPostRender(). + SceneLightList = &lightList; + } + + // Called after the last scene node is rendered. + virtual void OnPostRender() + { + // Since light management might be switched off in the event handler, we'll turn all + // lights on to ensure that they are in a consistent state. You wouldn't normally have + // to do this when using a light manager, since you'd continue to do light management + // yourself. + for (u32 i = 0; i < SceneLightList->size(); i++) + (*SceneLightList)[i]->setVisible(true); + } + + virtual void OnRenderPassPreRender(scene::E_SCENE_NODE_RENDER_PASS renderPass) + { + // I don't have to do anything here except remember which render pass I am in. + CurrentRenderPass = renderPass; + } + + virtual void OnRenderPassPostRender(scene::E_SCENE_NODE_RENDER_PASS renderPass) + { + // I only want solid nodes to be lit, so after the solid pass, turn all lights off. + if (scene::ESNRP_SOLID == renderPass) + { + for (u32 i = 0; i < SceneLightList->size(); ++i) + (*SceneLightList)[i]->setVisible(false); + } + } + + // This is called before the specified scene node is rendered + virtual void OnNodePreRender(scene::ISceneNode* node) + { + CurrentSceneNode = node; + + // This light manager only considers solid objects, but you are free to manipulate + // lights during any phase, depending on your requirements. + if (scene::ESNRP_SOLID != CurrentRenderPass) + return; + + // And in fact for this example, I only want to consider lighting for cube scene + // nodes. You will probably want to deal with lighting for (at least) mesh / + // animated mesh scene nodes as well. + if (node->getType() != scene::ESNT_CUBE) + return; + + if (LIGHTS_NEAREST_NODE == Mode) + { + // This is a naive implementation that prioritises every light in the scene + // by its proximity to the node being rendered. This produces some flickering + // when lights orbit closer to a cube than its 'zone' lights. + const vector3df nodePosition = node->getAbsolutePosition(); + + // Sort the light list by prioritising them based on their distance from the node + // that's about to be rendered. + array sortingArray; + sortingArray.reallocate(SceneLightList->size()); + + u32 i; + for(i = 0; i < SceneLightList->size(); ++i) + { + scene::ISceneNode* lightNode = (*SceneLightList)[i]; + const f64 distance = lightNode->getAbsolutePosition().getDistanceFromSQ(nodePosition); + sortingArray.push_back(LightDistanceElement(lightNode, distance)); + } + + sortingArray.sort(); + + // The list is now sorted by proximity to the node. + // Turn on the three nearest lights, and turn the others off. + for(i = 0; i < sortingArray.size(); ++i) + sortingArray[i].node->setVisible(i < 3); + } + else if(LIGHTS_IN_ZONE == Mode) + { + // Empty scene nodes are used to represent 'zones'. For each solid mesh that + // is being rendered, turn off all lights, then find its 'zone' parent, and turn + // on all lights that are found under that node in the scene graph. + // This is a general purpose algorithm that doesn't use any special + // knowledge of how this particular scene graph is organised. + for (u32 i = 0; i < SceneLightList->size(); ++i) + { + if ((*SceneLightList)[i]->getType() != scene::ESNT_LIGHT) + continue; + scene::ILightSceneNode* lightNode = static_cast((*SceneLightList)[i]); + video::SLight & lightData = lightNode->getLightData(); + + if (video::ELT_DIRECTIONAL != lightData.Type) + lightNode->setVisible(false); + } + + scene::ISceneNode * parentZone = findZone(node); + if (parentZone) + turnOnZoneLights(parentZone); + } + } + + // Called after the specified scene node is rendered + virtual void OnNodePostRender(scene::ISceneNode* node) + { + // I don't need to do any light management after individual node rendering. + } + +private: + + // Find the empty scene node that is the parent of the specified node + scene::ISceneNode * findZone(scene::ISceneNode * node) + { + if (!node) + return 0; + + if (node->getType() == scene::ESNT_EMPTY) + return node; + + return findZone(node->getParent()); + } + + // Turn on all lights that are children (directly or indirectly) of the + // specified scene node. + void turnOnZoneLights(scene::ISceneNode * node) + { + core::list const & children = node->getChildren(); + for (core::list::ConstIterator child = children.begin(); + child != children.end(); ++child) + { + if ((*child)->getType() == scene::ESNT_LIGHT) + (*child)->setVisible(true); + else // Assume that lights don't have any children that are also lights + turnOnZoneLights(*child); + } + } + + + // A utility class to aid in sorting scene nodes into a distance order + class LightDistanceElement + { + public: + LightDistanceElement() {}; + + LightDistanceElement(scene::ISceneNode* n, f64 d) + : node(n), distance(d) { } + + scene::ISceneNode* node; + f64 distance; + + // Lower distance elements are sorted to the start of the array + bool operator < (const LightDistanceElement& other) const + { + return (distance < other.distance); + } + }; +}; + + +/* +*/ +int main(int argumentCount, char * argumentValues[]) +{ + // ask user for driver + video::E_DRIVER_TYPE driverType=driverChoiceConsole(); + if (driverType==video::EDT_COUNT) + return 1; + + IrrlichtDevice *device = createDevice(driverType, + dimension2d(640, 480), 32); + + if(!device) + return -1; + + f32 const lightRadius = 60.f; // Enough to reach the far side of each 'zone' + + video::IVideoDriver* driver = device->getVideoDriver(); + scene::ISceneManager* smgr = device->getSceneManager(); + gui::IGUIEnvironment* guienv = device->getGUIEnvironment(); + + 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"); + if(font) + skin->setFont(font); + } + + guienv->addStaticText(L"1 - No light management", core::rect(10,10,200,30)); + guienv->addStaticText(L"2 - Closest 3 lights", core::rect(10,30,200,50)); + guienv->addStaticText(L"3 - Lights in zone", core::rect(10,50,200,70)); + +/* +Add several "zones". You could use this technique to light individual rooms, for example. +*/ + for(f32 zoneX = -100.f; zoneX <= 100.f; zoneX += 50.f) + for(f32 zoneY = -60.f; zoneY <= 60.f; zoneY += 60.f) + { + // Start with an empty scene node, which we will use to represent a zone. + scene::ISceneNode * zoneRoot = smgr->addEmptySceneNode(); + zoneRoot->setPosition(vector3df(zoneX, zoneY, 0)); + + // Each zone contains a rotating cube + scene::IMeshSceneNode * node = smgr->addCubeSceneNode(15, zoneRoot); + scene::ISceneNodeAnimator * rotation = smgr->createRotationAnimator(vector3df(0.25f, 0.5f, 0.75f)); + node->addAnimator(rotation); + rotation->drop(); + + // And each cube has three lights attached to it. The lights are attached to billboards so + // that we can see where they are. The billboards are attached to the cube, so that the + // lights are indirect descendents of the same empty scene node as the cube. + 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->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->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->setMaterialFlag(video::EMF_LIGHTING, false); + smgr->addLightSceneNode(billboard, vector3df(0, 0, 0), video::SColorf(0, 0, 1), lightRadius); + + // Each cube also has a smaller cube rotating around it, to show that the cubes are being + // lit by the lights in their 'zone', not just lights that are their direct children. + node = smgr->addCubeSceneNode(5, node); + node->setPosition(vector3df(0, 21, 0)); + } + + smgr->addCameraSceneNode(0, vector3df(0,0,-130), vector3df(0,0,0)); + + CMyLightManager * myLightManager = new CMyLightManager(smgr); + smgr->setLightManager(0); // This is the default: we won't do light management until told to do it. + device->setEventReceiver(myLightManager); + + int lastFps = -1; + + while(device->run()) + { + driver->beginScene(true, true, video::SColor(255,100,101,140)); + smgr->drawAll(); + guienv->drawAll(); + driver->endScene(); + + int fps = driver->getFPS(); + if(fps != lastFps) + { + lastFps = fps; + core::stringw str = L"Managed Lights ["; + str += driver->getName(); + str += "] FPS:"; + str += fps; + device->setWindowCaption(str.c_str()); + } + } + + myLightManager->drop(); // Drop my implicit reference + device->drop(); + return 0; +} + +/* +**/ + diff --git a/libraries/irrlicht-1.8.1/examples/21.Quake3Explorer/Makefile b/libraries/irrlicht-1.8.1/examples/21.Quake3Explorer/Makefile new file mode 100644 index 0000000..b2c6927 --- /dev/null +++ b/libraries/irrlicht-1.8.1/examples/21.Quake3Explorer/Makefile @@ -0,0 +1,38 @@ +# Makefile for Irrlicht Examples +# It's usually sufficient to change just the target name and source file list +# and be sure that CXX is set to a valid compiler +Target = 21.Quake3Explorer +Sources = main.cpp sound.cpp q3factory.cpp + +# general compiler settings +CPPFLAGS = -I../../include -I/usr/X11R6/include +#CXXFLAGS = -O3 -ffast-math +CXXFLAGS = -g -Wall + +#default target is Linux +all: all_linux + +ifeq ($(HOSTTYPE), x86_64) +LIBSELECT=64 +endif + +# target specific settings +all_linux: LDFLAGS = -L/usr/X11R6/lib$(LIBSELECT) -L../../lib/Linux -lIrrlicht -lGL -lXxf86vm -lXext -lX11 -lXcursor +all_linux clean_linux: SYSTEM=Linux +all_win32: LDFLAGS = -L../../lib/Win32-gcc -lIrrlicht -lopengl32 -lm +all_win32 clean_win32: SYSTEM=Win32-gcc +all_win32 clean_win32: SUF=.exe +# name of the binary - only valid for targets which set SYSTEM +DESTPATH = ../../bin/$(SYSTEM)/$(Target)$(SUF) + +all_linux all_win32: + $(warning Building...) + $(CXX) $(CPPFLAGS) $(CXXFLAGS) $(Sources) -o $(DESTPATH) $(LDFLAGS) + +clean: clean_linux clean_win32 + $(warning Cleaning...) + +clean_linux clean_win32: + @$(RM) $(DESTPATH) + +.PHONY: all all_win32 clean clean_linux clean_win32 diff --git a/libraries/irrlicht-1.8.1/examples/21.Quake3Explorer/Quake3Explorer.cbp b/libraries/irrlicht-1.8.1/examples/21.Quake3Explorer/Quake3Explorer.cbp new file mode 100644 index 0000000..af962e2 --- /dev/null +++ b/libraries/irrlicht-1.8.1/examples/21.Quake3Explorer/Quake3Explorer.cbp @@ -0,0 +1,59 @@ + + + + + + diff --git a/libraries/irrlicht-1.8.1/examples/21.Quake3Explorer/Quake3Explorer.dev b/libraries/irrlicht-1.8.1/examples/21.Quake3Explorer/Quake3Explorer.dev new file mode 100644 index 0000000..193c6bd --- /dev/null +++ b/libraries/irrlicht-1.8.1/examples/21.Quake3Explorer/Quake3Explorer.dev @@ -0,0 +1,99 @@ +[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/libraries/irrlicht-1.8.1/examples/21.Quake3Explorer/Quake3Explorer.vcproj b/libraries/irrlicht-1.8.1/examples/21.Quake3Explorer/Quake3Explorer.vcproj new file mode 100644 index 0000000..b869cc4 --- /dev/null +++ b/libraries/irrlicht-1.8.1/examples/21.Quake3Explorer/Quake3Explorer.vcproj @@ -0,0 +1,132 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/libraries/irrlicht-1.8.1/examples/21.Quake3Explorer/Quake3Explorer_vc10.vcxproj b/libraries/irrlicht-1.8.1/examples/21.Quake3Explorer/Quake3Explorer_vc10.vcxproj new file mode 100644 index 0000000..8ba3e72 --- /dev/null +++ b/libraries/irrlicht-1.8.1/examples/21.Quake3Explorer/Quake3Explorer_vc10.vcxproj @@ -0,0 +1,196 @@ + + + + + Debug + Win32 + + + Debug + x64 + + + Release + Win32 + + + Release + x64 + + + + 21.Quake3Explorer + {CDC4AAA9-72E1-4FFA-A04D-7EF59D8B97CD} + 21.Quake3Explorer + Win32Proj + + + + Application + MultiByte + + + Application + MultiByte + + + Application + MultiByte + + + Application + MultiByte + + + + + + + + + + + + + + + + + + + + + + + <_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/libraries/irrlicht-1.8.1/examples/21.Quake3Explorer/Quake3Explorer_vc11.vcxproj b/libraries/irrlicht-1.8.1/examples/21.Quake3Explorer/Quake3Explorer_vc11.vcxproj new file mode 100644 index 0000000..d0c29b2 --- /dev/null +++ b/libraries/irrlicht-1.8.1/examples/21.Quake3Explorer/Quake3Explorer_vc11.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 + v110 + + + Application + MultiByte + v110 + + + Application + MultiByte + v110 + + + Application + MultiByte + v110 + + + + + + + + + + + + + + + + + + + + + + + <_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/libraries/irrlicht-1.8.1/examples/21.Quake3Explorer/Quake3Explorer_vc8.vcproj b/libraries/irrlicht-1.8.1/examples/21.Quake3Explorer/Quake3Explorer_vc8.vcproj new file mode 100644 index 0000000..9045027 --- /dev/null +++ b/libraries/irrlicht-1.8.1/examples/21.Quake3Explorer/Quake3Explorer_vc8.vcproj @@ -0,0 +1,210 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/libraries/irrlicht-1.8.1/examples/21.Quake3Explorer/Quake3Explorer_vc9.vcproj b/libraries/irrlicht-1.8.1/examples/21.Quake3Explorer/Quake3Explorer_vc9.vcproj new file mode 100644 index 0000000..36aee41 --- /dev/null +++ b/libraries/irrlicht-1.8.1/examples/21.Quake3Explorer/Quake3Explorer_vc9.vcproj @@ -0,0 +1,204 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/libraries/irrlicht-1.8.1/examples/21.Quake3Explorer/main.cpp b/libraries/irrlicht-1.8.1/examples/21.Quake3Explorer/main.cpp new file mode 100644 index 0000000..b2277e6 --- /dev/null +++ b/libraries/irrlicht-1.8.1/examples/21.Quake3Explorer/main.cpp @@ -0,0 +1,2188 @@ +/** Example 021 Quake3 Explorer + +This Tutorial shows how to load different Quake 3 maps. + +Features: + - Load BSP Archives at Runtime from the menu + - Load a Map from the menu. Showing with Screenshot + - Set the VideoDriver at runtime from menu + - Adjust GammaLevel at runtime + - Create SceneNodes for the Shaders + - Load EntityList and create Entity SceneNodes + - Create Players with Weapons and with Collision Response + - Play music + +You can download the Quake III Arena demo ( copyright id software ) +at the following location: +ftp://ftp.idsoftware.com/idstuff/quake3/win32/q3ademo.exe + +Copyright 2006-2011 Burningwater, Thomas Alten +*/ + +#include "driverChoice.h" +#include +#include "q3factory.h" +#include "sound.h" + +/* + Game Data is used to hold Data which is needed to drive the game +*/ +struct GameData +{ + GameData ( const path &startupDir) : + retVal(0), StartupDir(startupDir), createExDevice(0), Device(0) + { + setDefault (); + } + + void setDefault (); + s32 save ( const path &filename ); + s32 load ( const path &filename ); + + s32 debugState; + s32 gravityState; + s32 flyTroughState; + s32 wireFrame; + s32 guiActive; + s32 guiInputActive; + f32 GammaValue; + s32 retVal; + s32 sound; + + path StartupDir; + stringw CurrentMapName; + array CurrentArchiveList; + + vector3df PlayerPosition; + vector3df PlayerRotation; + + tQ3EntityList Variable; + + Q3LevelLoadParameter loadParam; + SIrrlichtCreationParameters deviceParam; + funcptr_createDeviceEx createExDevice; + IrrlichtDevice *Device; +}; + +/* + set default settings +*/ +void GameData::setDefault () +{ + debugState = EDS_OFF; + gravityState = 1; + flyTroughState = 0; + wireFrame = 0; + guiActive = 1; + guiInputActive = 0; + GammaValue = 1.f; + + // default deviceParam; +#if defined ( _IRR_WINDOWS_ ) + deviceParam.DriverType = EDT_DIRECT3D9; +#else + deviceParam.DriverType = EDT_OPENGL; +#endif + deviceParam.WindowSize.Width = 800; + deviceParam.WindowSize.Height = 600; + deviceParam.Fullscreen = false; + deviceParam.Bits = 24; + deviceParam.ZBufferBits = 16; + deviceParam.Vsync = false; + deviceParam.AntiAlias = false; + + // default Quake3 loadParam + loadParam.defaultLightMapMaterial = EMT_LIGHTMAP; + loadParam.defaultModulate = EMFN_MODULATE_1X; + loadParam.defaultFilter = EMF_ANISOTROPIC_FILTER; + loadParam.verbose = 2; + loadParam.mergeShaderBuffer = 1; // merge meshbuffers with same material + loadParam.cleanUnResolvedMeshes = 1; // should unresolved meshes be cleaned. otherwise blue texture + loadParam.loadAllShaders = 1; // load all scripts in the script directory + loadParam.loadSkyShader = 0; // load sky Shader + loadParam.alpharef = 1; + + sound = 0; + + CurrentMapName = ""; + CurrentArchiveList.clear (); + + // Explorer Media directory + CurrentArchiveList.push_back ( StartupDir + "../../media/" ); + + // 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"); +} + +/* + Load the current game State from a typical quake3 cfg file +*/ +s32 GameData::load ( const path &filename ) +{ + if (!Device) + return 0; + + // the quake3 mesh loader can also handle *.shader and *.cfg file + IQ3LevelMesh* mesh = (IQ3LevelMesh*) Device->getSceneManager()->getMesh ( filename ); + if (!mesh) + return 0; + + tQ3EntityList &entityList = mesh->getEntityList (); + + stringc s; + u32 pos; + + for ( u32 e = 0; e != entityList.size (); ++e ) + { + //dumpShader ( s, &entityList[e], false ); + //printf ( s.c_str () ); + + for ( u32 g = 0; g != entityList[e].getGroupSize (); ++g ) + { + const SVarGroup *group = entityList[e].getGroup ( g ); + + for ( u32 index = 0; index < group->Variable.size (); ++index ) + { + const SVariable &v = group->Variable[index]; + pos = 0; + if ( v.name == "playerposition" ) + { + PlayerPosition = getAsVector3df ( v.content, pos ); + } + else + if ( v.name == "playerrotation" ) + { + PlayerRotation = getAsVector3df ( v.content, pos ); + } + } + } + } + + return 1; +} + +/* + Store the current game State in a quake3 configuration file +*/ +s32 GameData::save ( const path &filename ) +{ + return 0; + if (!Device) + return 0; + + c8 buf[128]; + u32 i; + + // Store current Archive for restart + CurrentArchiveList.clear(); + IFileSystem *fs = Device->getFileSystem(); + for ( i = 0; i != fs->getFileArchiveCount(); ++i ) + { + CurrentArchiveList.push_back ( fs->getFileArchive(i)->getFileList()->getPath() ); + } + + // Store Player Position and Rotation + ICameraSceneNode * camera = Device->getSceneManager()->getActiveCamera (); + if ( camera ) + { + PlayerPosition = camera->getPosition (); + PlayerRotation = camera->getRotation (); + } + + IWriteFile *file = fs->createAndWriteFile ( filename ); + if (!file) + return 0; + + snprintf ( 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 () ); + file->write ( buf, (s32) strlen ( buf ) ); + } + + file->drop (); + return 1; +} + +/* + Representing a player +*/ +struct Q3Player : public IAnimationEndCallBack +{ + Q3Player () + : Device(0), MapParent(0), Mesh(0), WeaponNode(0), StartPositionCurrent(0) + { + animation[0] = 0; + memset(Anim, 0, sizeof(TimeFire)*4); + } + + virtual void OnAnimationEnd(IAnimatedMeshSceneNode* node); + + void create ( IrrlichtDevice *device, + IQ3LevelMesh* mesh, + ISceneNode *mapNode, + IMetaTriangleSelector *meta + ); + void shutdown (); + void setAnim ( const c8 *name ); + void respawn (); + void setpos ( const vector3df &pos, const vector3df& rotation ); + + ISceneNodeAnimatorCollisionResponse * cam() { return camCollisionResponse ( Device ); } + + IrrlichtDevice *Device; + ISceneNode* MapParent; + IQ3LevelMesh* Mesh; + IAnimatedMeshSceneNode* WeaponNode; + s32 StartPositionCurrent; + TimeFire Anim[4]; + c8 animation[64]; + c8 buf[64]; +}; + + +/* End player +*/ +void Q3Player::shutdown () +{ + setAnim ( 0 ); + + dropElement (WeaponNode); + + if ( Device ) + { + ICameraSceneNode* camera = Device->getSceneManager()->getActiveCamera(); + dropElement ( camera ); + Device = 0; + } + + MapParent = 0; + Mesh = 0; +} + + +/* create a new player +*/ +void Q3Player::create ( IrrlichtDevice *device, IQ3LevelMesh* mesh, ISceneNode *mapNode, IMetaTriangleSelector *meta ) +{ + setTimeFire ( Anim + 0, 200, FIRED ); + setTimeFire ( Anim + 1, 5000 ); + + if (!device) + return; + // load FPS weapon to Camera + Device = device; + Mesh = mesh; + MapParent = mapNode; + + ISceneManager *smgr = device->getSceneManager (); + IVideoDriver * driver = device->getVideoDriver(); + + ICameraSceneNode* camera = 0; + + SKeyMap keyMap[10]; + keyMap[0].Action = EKA_MOVE_FORWARD; + keyMap[0].KeyCode = KEY_UP; + keyMap[1].Action = EKA_MOVE_FORWARD; + keyMap[1].KeyCode = KEY_KEY_W; + + keyMap[2].Action = EKA_MOVE_BACKWARD; + keyMap[2].KeyCode = KEY_DOWN; + keyMap[3].Action = EKA_MOVE_BACKWARD; + keyMap[3].KeyCode = KEY_KEY_S; + + keyMap[4].Action = EKA_STRAFE_LEFT; + keyMap[4].KeyCode = KEY_LEFT; + keyMap[5].Action = EKA_STRAFE_LEFT; + keyMap[5].KeyCode = KEY_KEY_A; + + keyMap[6].Action = EKA_STRAFE_RIGHT; + keyMap[6].KeyCode = KEY_RIGHT; + keyMap[7].Action = EKA_STRAFE_RIGHT; + keyMap[7].KeyCode = KEY_KEY_D; + + keyMap[8].Action = EKA_JUMP_UP; + keyMap[8].KeyCode = KEY_KEY_J; + + keyMap[9].Action = EKA_CROUCH; + keyMap[9].KeyCode = KEY_KEY_C; + + camera = smgr->addCameraSceneNodeFPS(0, 100.0f, 0.6f, -1, keyMap, 10, false, 0.6f); + camera->setName ( "First Person Camera" ); + //camera->setFOV ( 100.f * core::DEGTORAD ); + camera->setFarValue( 20000.f ); + + IAnimatedMeshMD2* weaponMesh = (IAnimatedMeshMD2*) smgr->getMesh("gun.md2"); + if ( 0 == weaponMesh ) + return; + + if ( weaponMesh->getMeshType() == EAMT_MD2 ) + { + s32 count = weaponMesh->getAnimationCount(); + for ( s32 i = 0; i != count; ++i ) + { + snprintf ( buf, 64, "Animation: %s", weaponMesh->getAnimationName(i) ); + device->getLogger()->log(buf, ELL_INFORMATION); + } + } + + WeaponNode = smgr->addAnimatedMeshSceneNode( + weaponMesh, + smgr->getActiveCamera(), + 10, + vector3df( 0, 0, 0), + vector3df(-90,-90,90) + ); + WeaponNode->setMaterialFlag(EMF_LIGHTING, false); + WeaponNode->setMaterialTexture(0, driver->getTexture( "gun.jpg")); + WeaponNode->setLoopMode ( false ); + WeaponNode->setName ( "tommi the gun man" ); + + //create a collision auto response animator + ISceneNodeAnimator* anim = + smgr->createCollisionResponseAnimator( meta, camera, + vector3df(30,45,30), + getGravity ( "earth" ), + vector3df(0,40,0), + 0.0005f + ); + + camera->addAnimator( anim ); + anim->drop(); + + if ( meta ) + { + meta->drop (); + } + + respawn (); + setAnim ( "idle" ); +} + + +/* + so we need a good starting Position in the level. + we can ask the Quake3 Loader for all entities with class_name "info_player_deathmatch" +*/ +void Q3Player::respawn () +{ + if (!Device) + return; + ICameraSceneNode* camera = Device->getSceneManager()->getActiveCamera(); + + Device->getLogger()->log( "respawn" ); + + if ( StartPositionCurrent >= Q3StartPosition ( + Mesh, camera,StartPositionCurrent++, + cam ()->getEllipsoidTranslation() ) + ) + { + StartPositionCurrent = 0; + } +} + +/* + set Player position from saved coordinates +*/ +void Q3Player::setpos ( const vector3df &pos, const vector3df &rotation ) +{ + if (!Device) + return; + Device->getLogger()->log( "setpos" ); + + ICameraSceneNode* camera = Device->getSceneManager()->getActiveCamera(); + if ( camera ) + { + camera->setPosition ( pos ); + camera->setRotation ( rotation ); + //! New. FPSCamera and animators catches reset on animate 0 + camera->OnAnimate ( 0 ); + } +} + +/* set the Animation of the player and weapon +*/ +void Q3Player::setAnim ( const c8 *name ) +{ + if ( name ) + { + snprintf ( animation, 64, "%s", name ); + if ( WeaponNode ) + { + WeaponNode->setAnimationEndCallback ( this ); + WeaponNode->setMD2Animation ( animation ); + } + } + else + { + animation[0] = 0; + if ( WeaponNode ) + { + WeaponNode->setAnimationEndCallback ( 0 ); + } + } +} + + +// Callback +void Q3Player::OnAnimationEnd(IAnimatedMeshSceneNode* node) +{ + setAnim ( 0 ); +} + + + +/* GUI Elements +*/ +struct GUI +{ + GUI () + { + memset ( this, 0, sizeof ( *this ) ); + } + + void drop() + { + dropElement ( Window ); + dropElement ( Logo ); + } + + IGUIComboBox* VideoDriver; + IGUIComboBox* VideoMode; + IGUICheckBox* FullScreen; + IGUICheckBox* Bit32; + IGUIScrollBar* MultiSample; + IGUIButton* SetVideoMode; + + IGUIScrollBar* Tesselation; + IGUIScrollBar* Gamma; + IGUICheckBox* Collision; + IGUICheckBox* Visible_Map; + IGUICheckBox* Visible_Shader; + IGUICheckBox* Visible_Fog; + IGUICheckBox* Visible_Unresolved; + IGUICheckBox* Visible_Skydome; + IGUIButton* Respawn; + + IGUITable* ArchiveList; + IGUIButton* ArchiveAdd; + IGUIButton* ArchiveRemove; + IGUIFileOpenDialog* ArchiveFileOpen; + IGUIButton* ArchiveUp; + IGUIButton* ArchiveDown; + + IGUIListBox* MapList; + IGUITreeView* SceneTree; + IGUIStaticText* StatusLine; + IGUIImage* Logo; + IGUIWindow* Window; +}; + + +/* + CQuake3EventHandler controls the game +*/ +class CQuake3EventHandler : public IEventReceiver +{ +public: + + CQuake3EventHandler( GameData *gameData ); + virtual ~CQuake3EventHandler (); + + void Animate(); + void Render(); + + void AddArchive ( const path& archiveName ); + void LoadMap ( const stringw& mapName, s32 collision ); + void CreatePlayers(); + void AddSky( u32 dome, const c8 *texture ); + Q3Player *GetPlayer ( u32 index ) { return &Player[index]; } + + void CreateGUI(); + void SetGUIActive( s32 command); + + bool OnEvent(const SEvent& eve); + + +private: + + GameData *Game; + + IQ3LevelMesh* Mesh; + ISceneNode* MapParent; + ISceneNode* ShaderParent; + ISceneNode* ItemParent; + ISceneNode* UnresolvedParent; + ISceneNode* BulletParent; + ISceneNode* FogParent; + ISceneNode * SkyNode; + IMetaTriangleSelector *Meta; + + c8 buf[256]; + + Q3Player Player[2]; + + struct SParticleImpact + { + u32 when; + vector3df pos; + vector3df outVector; + }; + array Impacts; + void useItem( Q3Player * player); + void createParticleImpacts( u32 now ); + + void createTextures (); + void addSceneTreeItem( ISceneNode * parent, IGUITreeViewNode* nodeParent); + + GUI gui; + void dropMap (); +}; + +/* Constructor +*/ +CQuake3EventHandler::CQuake3EventHandler( GameData *game ) +: Game(game), Mesh(0), MapParent(0), ShaderParent(0), ItemParent(0), UnresolvedParent(0), + BulletParent(0), FogParent(0), SkyNode(0), Meta(0) +{ + buf[0]=0; + // Also use 16 Bit Textures for 16 Bit RenderDevice + if ( Game->deviceParam.Bits == 16 ) + { + game->Device->getVideoDriver()->setTextureCreationFlag(ETCF_ALWAYS_16_BIT, true); + } + + // Quake3 Shader controls Z-Writing + game->Device->getSceneManager()->getParameters()->setAttribute(scene::ALLOW_ZWRITE_ON_TRANSPARENT, true); + + // create internal textures + createTextures (); + + sound_init ( game->Device ); + + Game->Device->setEventReceiver ( this ); +} + + +// destructor +CQuake3EventHandler::~CQuake3EventHandler () +{ + Player[0].shutdown (); + sound_shutdown (); + + Game->save( "explorer.cfg" ); + + Game->Device->drop(); +} + + +// create runtime textures smog, fog +void CQuake3EventHandler::createTextures() +{ + IVideoDriver * driver = Game->Device->getVideoDriver(); + + dimension2du dim(64, 64); + + video::IImage* image; + u32 i; + u32 x; + u32 y; + u32 * data; + for ( i = 0; i != 8; ++i ) + { + image = driver->createImage ( video::ECF_A8R8G8B8, dim); + data = (u32*) image->lock (); + for ( y = 0; y != dim.Height; ++y ) + { + for ( x = 0; x != dim.Width; ++x ) + { + data [x] = 0xFFFFFFFF; + } + data = (u32*) ( (u8*) data + image->getPitch() ); + } + image->unlock(); + snprintf ( buf, 64, "smoke_%02d", i ); + driver->addTexture( buf, image ); + image->drop (); + } + + // fog + for ( i = 0; i != 1; ++i ) + { + image = driver->createImage ( video::ECF_A8R8G8B8, dim); + data = (u32*) image->lock (); + for ( y = 0; y != dim.Height; ++y ) + { + for ( x = 0; x != dim.Width; ++x ) + { + data [x] = 0xFFFFFFFF; + } + data = (u32*) ( (u8*) data + image->getPitch() ); + } + image->unlock(); + snprintf ( buf, 64, "fog_%02d", i ); + driver->addTexture( buf, image ); + image->drop (); + } +} + + +/* + create the GUI +*/ +void CQuake3EventHandler::CreateGUI() +{ + + IGUIEnvironment *env = Game->Device->getGUIEnvironment(); + IVideoDriver * driver = Game->Device->getVideoDriver(); + + gui.drop(); + + // set skin font + IGUIFont* font = env->getFont("fontlucida.png"); + if (font) + env->getSkin()->setFont(font); + env->getSkin()->setColor ( EGDC_BUTTON_TEXT, video::SColor(240,0xAA,0xAA,0xAA) ); + env->getSkin()->setColor ( EGDC_3D_HIGH_LIGHT, video::SColor(240,0x22,0x22,0x22) ); + env->getSkin()->setColor ( EGDC_3D_FACE, video::SColor(240,0x44,0x44,0x44) ); + env->getSkin()->setColor ( EGDC_EDITABLE, video::SColor(240,0x44,0x44,0x44) ); + env->getSkin()->setColor ( EGDC_FOCUSED_EDITABLE, video::SColor(240,0x54,0x54,0x54) ); + env->getSkin()->setColor ( EGDC_WINDOW, video::SColor(240,0x66,0x66,0x66) ); + + // minimal gui size 800x600 + dimension2d dim ( 800, 600 ); + dimension2d vdim ( Game->Device->getVideoDriver()->getScreenSize() ); + + if ( vdim.Height >= dim.Height && vdim.Width >= dim.Width ) + { + //dim = vdim; + } + else + { + } + + gui.Window = env->addWindow ( rect ( 0, 0, dim.Width, dim.Height ), false, L"Quake3 Explorer" ); + gui.Window->setToolTipText ( L"Quake3Explorer. Loads and show various BSP File Format and Shaders." ); + gui.Window->getCloseButton()->setToolTipText ( L"Quit Quake3 Explorer" ); + + // add a status line help text + gui.StatusLine = env->addStaticText( 0, rect( 5,dim.Height - 30,dim.Width - 5,dim.Height - 10), + false, false, gui.Window, -1, true + ); + + + 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_SOFTWARE); + gui.VideoDriver->addItem(L"Burning's Video (TM) Thomas Alten", EDT_BURNINGSVIDEO); + gui.VideoDriver->setSelected ( gui.VideoDriver->getIndexForItemData ( Game->deviceParam.DriverType ) ); + gui.VideoDriver->setToolTipText ( L"Use a VideoDriver" ); + + env->addStaticText ( L"VideoMode:", rect( dim.Width - 400, 44, dim.Width - 310, 60 ),false, false, gui.Window, -1, false ); + gui.VideoMode = env->addComboBox(rect( dim.Width - 300, 44, dim.Width - 10, 60 ),gui.Window); + gui.VideoMode->setToolTipText ( L"Supported Screenmodes" ); + IVideoModeList *modeList = Game->Device->getVideoModeList(); + if ( modeList ) + { + s32 i; + for ( i = 0; i != modeList->getVideoModeCount (); ++i ) + { + u16 d = modeList->getVideoModeDepth ( i ); + if ( d < 16 ) + continue; + + u16 w = modeList->getVideoModeResolution ( i ).Width; + u16 h = modeList->getVideoModeResolution ( i ).Height; + u32 val = w << 16 | h; + + if ( gui.VideoMode->getIndexForItemData ( val ) >= 0 ) + continue; + + f32 aspect = (f32) w / (f32) h; + const c8 *a = ""; + if ( core::equals ( aspect, 1.3333333333f ) ) a = "4:3"; + else if ( core::equals ( aspect, 1.6666666f ) ) a = "15:9 widescreen"; + else if ( core::equals ( aspect, 1.7777777f ) ) a = "16:9 widescreen"; + 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 ); + gui.VideoMode->addItem ( stringw ( buf ).c_str(), val ); + } + } + gui.VideoMode->setSelected ( gui.VideoMode->getIndexForItemData ( + Game->deviceParam.WindowSize.Width << 16 | + Game->deviceParam.WindowSize.Height ) ); + + gui.FullScreen = env->addCheckBox ( Game->deviceParam.Fullscreen, rect( dim.Width - 400, 64, dim.Width - 300, 80 ), gui.Window,-1, L"Fullscreen" ); + gui.FullScreen->setToolTipText ( L"Set Fullscreen or Window Mode" ); + + gui.Bit32 = env->addCheckBox ( Game->deviceParam.Bits == 32, rect( dim.Width - 300, 64, dim.Width - 240, 80 ), gui.Window,-1, L"32Bit" ); + gui.Bit32->setToolTipText ( L"Use 16 or 32 Bit" ); + + env->addStaticText ( L"MultiSample:", rect( dim.Width - 235, 64, dim.Width - 150, 80 ),false, false, gui.Window, -1, false ); + gui.MultiSample = env->addScrollBar( true, rect( dim.Width - 150, 64, dim.Width - 70, 80 ), gui.Window,-1 ); + gui.MultiSample->setMin ( 0 ); + gui.MultiSample->setMax ( 8 ); + gui.MultiSample->setSmallStep ( 1 ); + gui.MultiSample->setLargeStep ( 1 ); + gui.MultiSample->setPos ( Game->deviceParam.AntiAlias ); + gui.MultiSample->setToolTipText ( L"Set the MultiSample (disable, 1x, 2x, 4x, 8x )" ); + + gui.SetVideoMode = env->addButton (rect( dim.Width - 60, 64, dim.Width - 10, 80 ), gui.Window, -1,L"set" ); + gui.SetVideoMode->setToolTipText ( L"Set Video Mode with current values" ); + + env->addStaticText ( L"Gamma:", rect( dim.Width - 400, 104, dim.Width - 310, 120 ),false, false, gui.Window, -1, false ); + gui.Gamma = env->addScrollBar( true, rect( dim.Width - 300, 104, dim.Width - 10, 120 ), gui.Window,-1 ); + gui.Gamma->setMin ( 50 ); + gui.Gamma->setMax ( 350 ); + gui.Gamma->setSmallStep ( 1 ); + gui.Gamma->setLargeStep ( 10 ); + gui.Gamma->setPos ( core::floor32 ( Game->GammaValue * 100.f ) ); + gui.Gamma->setToolTipText ( L"Adjust Gamma Ramp ( 0.5 - 3.5)" ); + Game->Device->setGammaRamp ( Game->GammaValue, Game->GammaValue, Game->GammaValue, 0.f, 0.f ); + + + env->addStaticText ( L"Tesselation:", rect( dim.Width - 400, 124, dim.Width - 310, 140 ),false, false, gui.Window, -1, false ); + gui.Tesselation = env->addScrollBar( true, rect( dim.Width - 300, 124, dim.Width - 10, 140 ), gui.Window,-1 ); + gui.Tesselation->setMin ( 2 ); + gui.Tesselation->setMax ( 12 ); + gui.Tesselation->setSmallStep ( 1 ); + gui.Tesselation->setLargeStep ( 1 ); + gui.Tesselation->setPos ( Game->loadParam.patchTesselation ); + gui.Tesselation->setToolTipText ( L"How smooth should curved surfaces be rendered" ); + + gui.Collision = env->addCheckBox ( true, rect( dim.Width - 400, 150, dim.Width - 300, 166 ), gui.Window,-1, L"Collision" ); + gui.Collision->setToolTipText ( L"Set collision on or off ( flythrough ). \nPress F7 on your Keyboard" ); + gui.Visible_Map = env->addCheckBox ( true, rect( dim.Width - 300, 150, dim.Width - 240, 166 ), gui.Window,-1, L"Map" ); + gui.Visible_Map->setToolTipText ( L"Show or not show the static part the Level. \nPress F3 on your Keyboard" ); + gui.Visible_Shader = env->addCheckBox ( true, rect( dim.Width - 240, 150, dim.Width - 170, 166 ), gui.Window,-1, L"Shader" ); + gui.Visible_Shader->setToolTipText ( L"Show or not show the Shader Nodes. \nPress F4 on your Keyboard" ); + gui.Visible_Fog = env->addCheckBox ( true, rect( dim.Width - 170, 150, dim.Width - 110, 166 ), gui.Window,-1, L"Fog" ); + gui.Visible_Fog->setToolTipText ( L"Show or not show the Fog Nodes. \nPress F5 on your Keyboard" ); + gui.Visible_Unresolved = env->addCheckBox ( true, rect( dim.Width - 110, 150, dim.Width - 10, 166 ), gui.Window,-1, L"Unresolved" ); + gui.Visible_Unresolved->setToolTipText ( L"Show the or not show the Nodes the Engine can't handle. \nPress F6 on your Keyboard" ); + gui.Visible_Skydome = env->addCheckBox ( true, rect( dim.Width - 110, 180, dim.Width - 10, 196 ), gui.Window,-1, L"Skydome" ); + gui.Visible_Skydome->setToolTipText ( L"Show the or not show the Skydome." ); + + //Respawn = env->addButton ( rect( dim.Width - 260, 90, dim.Width - 10, 106 ), 0,-1, L"Respawn" ); + + env->addStaticText ( L"Archives:", rect( 5, dim.Height - 530, dim.Width - 600,dim.Height - 514 ),false, false, gui.Window, -1, false ); + + gui.ArchiveAdd = env->addButton ( rect( dim.Width - 725, dim.Height - 530, dim.Width - 665, dim.Height - 514 ), gui.Window,-1, L"add" ); + gui.ArchiveAdd->setToolTipText ( L"Add an archive, usually packed zip-archives (*.pk3) to the Filesystem" ); + gui.ArchiveRemove = env->addButton ( rect( dim.Width - 660, dim.Height - 530, dim.Width - 600, dim.Height - 514 ), gui.Window,-1, L"del" ); + gui.ArchiveRemove->setToolTipText ( L"Remove the selected archive from the FileSystem." ); + gui.ArchiveUp = env->addButton ( rect( dim.Width - 575, dim.Height - 530, dim.Width - 515, dim.Height - 514 ), gui.Window,-1, L"up" ); + gui.ArchiveUp->setToolTipText ( L"Arrange Archive Look-up Hirachy. Move the selected Archive up" ); + gui.ArchiveDown = env->addButton ( rect( dim.Width - 510, dim.Height - 530, dim.Width - 440, dim.Height - 514 ), gui.Window,-1, L"down" ); + gui.ArchiveDown->setToolTipText ( L"Arrange Archive Look-up Hirachy. Move the selected Archive down" ); + + + gui.ArchiveList = env->addTable ( rect( 5,dim.Height - 510, dim.Width - 450,dim.Height - 410 ), gui.Window ); + gui.ArchiveList->addColumn ( L"Type", 0 ); + gui.ArchiveList->addColumn ( L"Real File Path", 1 ); + gui.ArchiveList->setColumnWidth ( 0, 60 ); + gui.ArchiveList->setColumnWidth ( 1, 284 ); + gui.ArchiveList->setToolTipText ( L"Show the attached Archives" ); + + + env->addStaticText ( L"Maps:", rect( 5, dim.Height - 400, dim.Width - 450,dim.Height - 380 ),false, false, gui.Window, -1, false ); + gui.MapList = env->addListBox ( rect( 5,dim.Height - 380, dim.Width - 450,dim.Height - 40 ), gui.Window, -1, true ); + gui.MapList->setToolTipText ( L"Show the current Maps in all Archives.\n Double-Click the Map to start the level" ); + + + // create a visible Scene Tree + env->addStaticText ( L"Scenegraph:", rect( dim.Width - 400, dim.Height - 400, dim.Width - 5,dim.Height - 380 ),false, false, gui.Window, -1, false ); + gui.SceneTree = env->addTreeView( rect( dim.Width - 400, dim.Height - 380, dim.Width - 5, dim.Height - 40 ), + gui.Window, -1, true, true, false ); + gui.SceneTree->setToolTipText ( L"Show the current Scenegraph" ); + gui.SceneTree->getRoot()->clearChildren(); + addSceneTreeItem ( Game->Device->getSceneManager()->getRootSceneNode(), gui.SceneTree->getRoot() ); + + + IGUIImageList* imageList = env->createImageList( driver->getTexture ( "iconlist.png" ), + dimension2di( 32, 32 ), true ); + + if ( imageList ) + { + gui.SceneTree->setImageList( imageList ); + imageList->drop (); + } + + + // load the engine logo + gui.Logo = env->addImage( driver->getTexture("irrlichtlogo3.png"), position2d(5, 16 ), true, 0 ); + gui.Logo->setToolTipText ( L"The great Irrlicht Engine" ); + + AddArchive ( "" ); +} + + +/* + Add an Archive to the FileSystems and updates the GUI +*/ +void CQuake3EventHandler::AddArchive ( const path& archiveName ) +{ + IFileSystem *fs = Game->Device->getFileSystem(); + u32 i; + + if ( archiveName.size () ) + { + bool exists = false; + for ( i = 0; i != fs->getFileArchiveCount(); ++i ) + { + if ( fs->getFileArchive(i)->getFileList()->getPath() == archiveName ) + { + exists = true; + break; + } + } + + if (!exists) + { + fs->addFileArchive(archiveName, true, false); + } + } + + // store the current archives in game data + // show the attached Archive in proper order + if ( gui.ArchiveList ) + { + gui.ArchiveList->clearRows(); + + for ( i = 0; i != fs->getFileArchiveCount(); ++i ) + { + IFileArchive * archive = fs->getFileArchive ( i ); + + u32 index = gui.ArchiveList->addRow(i); + + core::stringw typeName; + switch(archive->getType()) + { + case io::EFAT_ZIP: + typeName = "ZIP"; + break; + case io::EFAT_GZIP: + typeName = "gzip"; + break; + case io::EFAT_FOLDER: + typeName = "Mount"; + break; + case io::EFAT_PAK: + typeName = "PAK"; + break; + case io::EFAT_TAR: + typeName = "TAR"; + break; + default: + typeName = "archive"; + } + + gui.ArchiveList->setCellText ( index, 0, typeName ); + gui.ArchiveList->setCellText ( index, 1, archive->getFileList()->getPath() ); + } + } + + + // browse the archives for maps + if ( gui.MapList ) + { + gui.MapList->clear(); + + IGUISpriteBank *bank = Game->Device->getGUIEnvironment()->getSpriteBank("sprite_q3map"); + if ( 0 == bank ) + bank = Game->Device->getGUIEnvironment()->addEmptySpriteBank("sprite_q3map"); + + SGUISprite sprite; + SGUISpriteFrame frame; + core::rect r; + + bank->getSprites().clear(); + bank->getPositions().clear (); + gui.MapList->setSpriteBank ( bank ); + + u32 g = 0; + core::stringw s; + + // browse the attached file system + fs->setFileListSystem ( FILESYSTEM_VIRTUAL ); + fs->changeWorkingDirectoryTo ( "/maps/" ); + IFileList *fileList = fs->createFileList (); + fs->setFileListSystem ( FILESYSTEM_NATIVE ); + + for ( i=0; i< fileList->getFileCount(); ++i) + { + s = fileList->getFullFileName(i); + if ( s.find ( ".bsp" ) >= 0 ) + { + // get level screenshot. reformat texture to 128x128 + path c ( s ); + deletePathFromFilename ( c ); + cutFilenameExtension ( c, c ); + c = path ( "levelshots/" ) + c; + + dimension2du dim ( 128, 128 ); + IVideoDriver * driver = Game->Device->getVideoDriver(); + IImage* image = 0; + ITexture *tex = 0; + path filename; + + filename = c + ".jpg"; + if ( fs->existFile ( filename ) ) + image = driver->createImageFromFile( filename ); + if ( 0 == image ) + { + filename = c + ".tga"; + if ( fs->existFile ( filename ) ) + image = driver->createImageFromFile( filename ); + } + + if ( image ) + { + IImage* filter = driver->createImage ( video::ECF_R8G8B8, dim ); + image->copyToScalingBoxFilter ( filter, 0 ); + image->drop (); + image = filter; + } + + if ( image ) + { + tex = driver->addTexture ( filename, image ); + image->drop (); + } + + + bank->setTexture ( g, tex ); + + r.LowerRightCorner.X = dim.Width; + r.LowerRightCorner.Y = dim.Height; + gui.MapList->setItemHeight ( r.LowerRightCorner.Y + 4 ); + frame.rectNumber = bank->getPositions().size(); + frame.textureNumber = g; + + bank->getPositions().push_back(r); + + sprite.Frames.set_used ( 0 ); + sprite.Frames.push_back(frame); + sprite.frameTime = 0; + bank->getSprites().push_back(sprite); + + gui.MapList->addItem ( s.c_str (), g ); + g += 1; + } + } + fileList->drop (); + + gui.MapList->setSelected ( -1 ); + IGUIScrollBar * bar = (IGUIScrollBar*)gui.MapList->getElementFromId( 0 ); + if ( bar ) + bar->setPos ( 0 ); + + } + +} + +/* + clears the Map in Memory +*/ +void CQuake3EventHandler::dropMap () +{ + IVideoDriver * driver = Game->Device->getVideoDriver(); + + driver->removeAllHardwareBuffers (); + driver->removeAllTextures (); + + Player[0].shutdown (); + + + dropElement ( ItemParent ); + dropElement ( ShaderParent ); + dropElement ( UnresolvedParent ); + dropElement ( FogParent ); + dropElement ( BulletParent ); + + + Impacts.clear(); + + if ( Meta ) + { + Meta = 0; + } + + dropElement ( MapParent ); + dropElement ( SkyNode ); + + // clean out meshes, because textures are invalid + // TODO: better texture handling;-) + IMeshCache *cache = Game->Device->getSceneManager ()->getMeshCache(); + cache->clear (); + Mesh = 0; +} + +/* Load new map +*/ +void CQuake3EventHandler::LoadMap ( const stringw &mapName, s32 collision ) +{ + if ( 0 == mapName.size() ) + return; + + dropMap (); + + IFileSystem *fs = Game->Device->getFileSystem(); + ISceneManager *smgr = Game->Device->getSceneManager (); + + IReadFile* file = fs->createMemoryReadFile(&Game->loadParam, + sizeof(Game->loadParam), L"levelparameter.cfg", false); + + // load cfg file + smgr->getMesh( file ); + file->drop (); + + // load the actual map + Mesh = (IQ3LevelMesh*) smgr->getMesh(mapName); + if ( 0 == Mesh ) + return; + + /* + add the geometry mesh to the Scene ( polygon & patches ) + The Geometry mesh is optimised for faster drawing + */ + + IMesh *geometry = Mesh->getMesh(E_Q3_MESH_GEOMETRY); + if ( 0 == geometry || geometry->getMeshBufferCount() == 0) + return; + + Game->CurrentMapName = mapName; + + //create a collision list + Meta = 0; + + ITriangleSelector * selector = 0; + if (collision) + Meta = smgr->createMetaTriangleSelector(); + + //IMeshBuffer *b0 = geometry->getMeshBuffer(0); + //s32 minimalNodes = b0 ? core::s32_max ( 2048, b0->getVertexCount() / 32 ) : 2048; + s32 minimalNodes = 2048; + + MapParent = smgr->addOctreeSceneNode(geometry, 0, -1, minimalNodes); + MapParent->setName ( mapName ); + if ( Meta ) + { + selector = smgr->createOctreeTriangleSelector( geometry,MapParent, minimalNodes); + //selector = smgr->createTriangleSelector ( geometry, MapParent ); + Meta->addTriangleSelector( selector); + selector->drop (); + } + + // logical parent for the items + ItemParent = smgr->addEmptySceneNode(); + if ( ItemParent ) + ItemParent->setName ( "Item Container" ); + + ShaderParent = smgr->addEmptySceneNode(); + if ( ShaderParent ) + ShaderParent->setName ( "Shader Container" ); + + UnresolvedParent = smgr->addEmptySceneNode(); + if ( UnresolvedParent ) + UnresolvedParent->setName ( "Unresolved Container" ); + + FogParent = smgr->addEmptySceneNode(); + if ( FogParent ) + FogParent->setName ( "Fog Container" ); + + // logical parent for the bullets + BulletParent = smgr->addEmptySceneNode(); + if ( BulletParent ) + BulletParent->setName ( "Bullet Container" ); + + /* + now construct SceneNodes for each Shader + The Objects are stored in the quake mesh E_Q3_MESH_ITEMS + and the Shader ID is stored in the MaterialParameters + mostly dark looking skulls and moving lava.. or green flashing tubes? + */ + Q3ShaderFactory ( Game->loadParam, Game->Device, Mesh, E_Q3_MESH_ITEMS,ShaderParent, Meta, false ); + Q3ShaderFactory ( Game->loadParam, Game->Device, Mesh, E_Q3_MESH_FOG,FogParent, 0, false ); + Q3ShaderFactory ( Game->loadParam, Game->Device, Mesh, E_Q3_MESH_UNRESOLVED,UnresolvedParent, Meta, true ); + + /* + Now construct Models from Entity List + */ + Q3ModelFactory ( Game->loadParam, Game->Device, Mesh, ItemParent, false ); +} + +/* + Adds a SceneNode with an icon to the Scene Tree +*/ +void CQuake3EventHandler::addSceneTreeItem( ISceneNode * parent, IGUITreeViewNode* nodeParent) +{ + IGUITreeViewNode* node; + wchar_t msg[128]; + + s32 imageIndex; + list::ConstIterator it = parent->getChildren().begin(); + for (; it != parent->getChildren().end(); ++it) + { + switch ( (*it)->getType () ) + { + case ESNT_Q3SHADER_SCENE_NODE: imageIndex = 0; break; + case ESNT_CAMERA: imageIndex = 1; break; + case ESNT_EMPTY: imageIndex = 2; break; + case ESNT_MESH: imageIndex = 3; break; + case ESNT_OCTREE: imageIndex = 3; break; + case ESNT_ANIMATED_MESH: imageIndex = 4; break; + case ESNT_SKY_BOX: imageIndex = 5; break; + case ESNT_BILLBOARD: imageIndex = 6; break; + case ESNT_PARTICLE_SYSTEM: imageIndex = 7; break; + case ESNT_TEXT: imageIndex = 8; break; + default:imageIndex = -1; break; + } + + if ( imageIndex < 0 ) + { + swprintf ( msg, 128, L"%hs,%hs", + Game->Device->getSceneManager ()->getSceneNodeTypeName ( (*it)->getType () ), + (*it)->getName() + ); + } + else + { + swprintf ( msg, 128, L"%hs",(*it)->getName() ); + } + + node = nodeParent->addChildBack( msg, 0, imageIndex ); + + // Add all Animators + list::ConstIterator ait = (*it)->getAnimators().begin(); + for (; ait != (*it)->getAnimators().end(); ++ait) + { + imageIndex = -1; + swprintf ( msg, 128, L"%hs", + Game->Device->getSceneManager ()->getAnimatorTypeName ( (*ait)->getType () ) + ); + + switch ( (*ait)->getType () ) + { + case ESNAT_FLY_CIRCLE: + case ESNAT_FLY_STRAIGHT: + case ESNAT_FOLLOW_SPLINE: + case ESNAT_ROTATION: + case ESNAT_TEXTURE: + case ESNAT_DELETION: + case ESNAT_COLLISION_RESPONSE: + case ESNAT_CAMERA_FPS: + case ESNAT_CAMERA_MAYA: + default: + break; + } + node->addChildBack( msg, 0, imageIndex ); + } + + addSceneTreeItem ( *it, node ); + } +} + + +// Adds life! +void CQuake3EventHandler::CreatePlayers() +{ + Player[0].create ( Game->Device, Mesh, MapParent, Meta ); +} + + +// Adds a skydome to the scene +void CQuake3EventHandler::AddSky( u32 dome, const c8 *texture) +{ + ISceneManager *smgr = Game->Device->getSceneManager (); + IVideoDriver * driver = Game->Device->getVideoDriver(); + + bool oldMipMapState = driver->getTextureCreationFlag(video::ETCF_CREATE_MIP_MAPS); + driver->setTextureCreationFlag(video::ETCF_CREATE_MIP_MAPS, false); + + if ( 0 == dome ) + { + // irrlicht order + //static const c8*p[] = { "ft", "lf", "bk", "rt", "up", "dn" }; + // quake3 order + static const c8*p[] = { "ft", "rt", "bk", "lf", "up", "dn" }; + + u32 i = 0; + snprintf ( 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] ); + SkyNode->getMaterial(i).setTexture ( 0, driver->getTexture ( buf ) ); + } + } + } + else + if ( 1 == dome ) + { + snprintf ( buf, 64, "%s.jpg", texture ); + SkyNode = smgr->addSkyDomeSceneNode( + driver->getTexture( buf ), 32,32, + 1.f, 1.f, 1000.f, 0, 11); + } + else + if ( 2 == dome ) + { + snprintf ( buf, 64, "%s.jpg", texture ); + SkyNode = smgr->addSkyDomeSceneNode( + driver->getTexture( buf ), 16,8, + 0.95f, 2.f, 1000.f, 0, 11); + } + + if (SkyNode) + SkyNode->setName("Skydome"); + //SkyNode->getMaterial(0).ZBuffer = video::EMDF_DEPTH_LESS_EQUAL; + + driver->setTextureCreationFlag(video::ETCF_CREATE_MIP_MAPS, oldMipMapState); +} + + +// enable GUI elements +void CQuake3EventHandler::SetGUIActive( s32 command) +{ + bool inputState = false; + + ICameraSceneNode * camera = Game->Device->getSceneManager()->getActiveCamera (); + + switch ( command ) + { + case 0: Game->guiActive = 0; inputState = !Game->guiActive; break; + case 1: Game->guiActive = 1; inputState = !Game->guiActive;;break; + case 2: Game->guiActive ^= 1; inputState = !Game->guiActive;break; + case 3: + if ( camera ) + inputState = !camera->isInputReceiverEnabled(); + break; + } + + if ( camera ) + { + camera->setInputReceiverEnabled ( inputState ); + Game->Device->getCursorControl()->setVisible( !inputState ); + } + + if ( gui.Window ) + { + gui.Window->setVisible ( Game->guiActive != 0 ); + } + + if ( Game->guiActive && + gui.SceneTree && Game->Device->getGUIEnvironment()->getFocus() != gui.SceneTree + ) + { + gui.SceneTree->getRoot()->clearChildren(); + addSceneTreeItem ( Game->Device->getSceneManager()->getRootSceneNode(), gui.SceneTree->getRoot() ); + } + + Game->Device->getGUIEnvironment()->setFocus ( Game->guiActive ? gui.Window: 0 ); +} + + +/* + Handle game input +*/ +bool CQuake3EventHandler::OnEvent(const SEvent& eve) +{ + if ( eve.EventType == EET_LOG_TEXT_EVENT ) + { + return false; + } + + if ( Game->guiActive && eve.EventType == EET_GUI_EVENT ) + { + if ( eve.GUIEvent.Caller == gui.MapList && eve.GUIEvent.EventType == gui::EGET_LISTBOX_SELECTED_AGAIN ) + { + s32 selected = gui.MapList->getSelected(); + if ( selected >= 0 ) + { + stringw loadMap = gui.MapList->getListItem ( selected ); + if ( 0 == MapParent || loadMap != Game->CurrentMapName ) + { + printf ( "Loading map %ls\n", loadMap.c_str() ); + LoadMap ( loadMap , 1 ); + if ( 0 == Game->loadParam.loadSkyShader ) + { + AddSky ( 1, "skydome2" ); + } + CreatePlayers (); + CreateGUI (); + SetGUIActive ( 0 ); + return true; + } + } + } + else + if ( eve.GUIEvent.Caller == gui.ArchiveRemove && eve.GUIEvent.EventType == gui::EGET_BUTTON_CLICKED ) + { + Game->Device->getFileSystem()->removeFileArchive( gui.ArchiveList->getSelected() ); + Game->CurrentMapName = ""; + AddArchive ( "" ); + } + else + if ( eve.GUIEvent.Caller == gui.ArchiveAdd && eve.GUIEvent.EventType == gui::EGET_BUTTON_CLICKED ) + { + if ( 0 == gui.ArchiveFileOpen ) + { + Game->Device->getFileSystem()->setFileListSystem ( FILESYSTEM_NATIVE ); + gui.ArchiveFileOpen = Game->Device->getGUIEnvironment()->addFileOpenDialog ( L"Add Game Archive" , false,gui.Window ); + } + } + else + if ( eve.GUIEvent.Caller == gui.ArchiveFileOpen && eve.GUIEvent.EventType == gui::EGET_FILE_SELECTED ) + { + AddArchive ( gui.ArchiveFileOpen->getFileName() ); + gui.ArchiveFileOpen = 0; + } + else + if ( eve.GUIEvent.Caller == gui.ArchiveFileOpen && eve.GUIEvent.EventType == gui::EGET_DIRECTORY_SELECTED ) + { + AddArchive ( gui.ArchiveFileOpen->getDirectoryName() ); + } + else + if ( eve.GUIEvent.Caller == gui.ArchiveFileOpen && eve.GUIEvent.EventType == gui::EGET_FILE_CHOOSE_DIALOG_CANCELLED ) + { + gui.ArchiveFileOpen = 0; + } + else + if ( ( eve.GUIEvent.Caller == gui.ArchiveUp || eve.GUIEvent.Caller == gui.ArchiveDown ) && + eve.GUIEvent.EventType == gui::EGET_BUTTON_CLICKED ) + { + s32 rel = eve.GUIEvent.Caller == gui.ArchiveUp ? -1 : 1; + if ( Game->Device->getFileSystem()->moveFileArchive ( gui.ArchiveList->getSelected (), rel ) ) + { + s32 newIndex = core::s32_clamp ( gui.ArchiveList->getSelected() + rel, 0, gui.ArchiveList->getRowCount() - 1 ); + AddArchive ( "" ); + gui.ArchiveList->setSelected ( newIndex ); + Game->CurrentMapName = ""; + } + } + else + if ( eve.GUIEvent.Caller == gui.VideoDriver && eve.GUIEvent.EventType == gui::EGET_COMBO_BOX_CHANGED ) + { + Game->deviceParam.DriverType = (E_DRIVER_TYPE) gui.VideoDriver->getItemData ( gui.VideoDriver->getSelected() ); + } + else + if ( eve.GUIEvent.Caller == gui.VideoMode && eve.GUIEvent.EventType == gui::EGET_COMBO_BOX_CHANGED ) + { + u32 val = gui.VideoMode->getItemData ( gui.VideoMode->getSelected() ); + Game->deviceParam.WindowSize.Width = val >> 16; + Game->deviceParam.WindowSize.Height = val & 0xFFFF; + } + else + if ( eve.GUIEvent.Caller == gui.FullScreen && eve.GUIEvent.EventType == gui::EGET_CHECKBOX_CHANGED ) + { + Game->deviceParam.Fullscreen = gui.FullScreen->isChecked(); + } + else + if ( eve.GUIEvent.Caller == gui.Bit32 && eve.GUIEvent.EventType == gui::EGET_CHECKBOX_CHANGED ) + { + Game->deviceParam.Bits = gui.Bit32->isChecked() ? 32 : 16; + } + else + if ( eve.GUIEvent.Caller == gui.MultiSample && eve.GUIEvent.EventType == gui::EGET_SCROLL_BAR_CHANGED ) + { + Game->deviceParam.AntiAlias = gui.MultiSample->getPos(); + } + else + if ( eve.GUIEvent.Caller == gui.Tesselation && eve.GUIEvent.EventType == gui::EGET_SCROLL_BAR_CHANGED ) + { + Game->loadParam.patchTesselation = gui.Tesselation->getPos (); + } + else + if ( eve.GUIEvent.Caller == gui.Gamma && eve.GUIEvent.EventType == gui::EGET_SCROLL_BAR_CHANGED ) + { + Game->GammaValue = gui.Gamma->getPos () * 0.01f; + Game->Device->setGammaRamp ( Game->GammaValue, Game->GammaValue, Game->GammaValue, 0.f, 0.f ); + } + else + if ( eve.GUIEvent.Caller == gui.SetVideoMode && eve.GUIEvent.EventType == gui::EGET_BUTTON_CLICKED ) + { + Game->retVal = 2; + Game->Device->closeDevice(); + } + else + if ( eve.GUIEvent.Caller == gui.Window && eve.GUIEvent.EventType == gui::EGET_ELEMENT_CLOSED ) + { + Game->Device->closeDevice(); + } + else + if ( eve.GUIEvent.Caller == gui.Collision && eve.GUIEvent.EventType == gui::EGET_CHECKBOX_CHANGED ) + { + // set fly through active + Game->flyTroughState ^= 1; + Player[0].cam()->setAnimateTarget ( Game->flyTroughState == 0 ); + + printf ( "collision %d\n", Game->flyTroughState == 0 ); + } + else + if ( eve.GUIEvent.Caller == gui.Visible_Map && eve.GUIEvent.EventType == gui::EGET_CHECKBOX_CHANGED ) + { + bool v = gui.Visible_Map->isChecked(); + + if ( MapParent ) + { + printf ( "static node set visible %d\n",v ); + MapParent->setVisible ( v ); + } + } + else + if ( eve.GUIEvent.Caller == gui.Visible_Shader && eve.GUIEvent.EventType == gui::EGET_CHECKBOX_CHANGED ) + { + bool v = gui.Visible_Shader->isChecked(); + + if ( ShaderParent ) + { + printf ( "shader node set visible %d\n",v ); + ShaderParent->setVisible ( v ); + } + } + else + if ( eve.GUIEvent.Caller == gui.Visible_Skydome && eve.GUIEvent.EventType == gui::EGET_CHECKBOX_CHANGED ) + { + if ( SkyNode ) + { + bool v = !SkyNode->isVisible(); + printf ( "skynode set visible %d\n",v ); + SkyNode->setVisible ( v ); + } + } + else + if ( eve.GUIEvent.Caller == gui.Respawn && eve.GUIEvent.EventType == gui::EGET_BUTTON_CLICKED ) + { + Player[0].respawn (); + } + + return false; + } + + // fire + if ((eve.EventType == EET_KEY_INPUT_EVENT && eve.KeyInput.Key == KEY_SPACE && + eve.KeyInput.PressedDown == false) || + (eve.EventType == EET_MOUSE_INPUT_EVENT && eve.MouseInput.Event == EMIE_LMOUSE_LEFT_UP) + ) + { + ICameraSceneNode * camera = Game->Device->getSceneManager()->getActiveCamera (); + if ( camera && camera->isInputReceiverEnabled () ) + { + useItem( Player + 0 ); + } + } + + // gui active + if ((eve.EventType == EET_KEY_INPUT_EVENT && eve.KeyInput.Key == KEY_F1 && + eve.KeyInput.PressedDown == false) || + (eve.EventType == EET_MOUSE_INPUT_EVENT && eve.MouseInput.Event == EMIE_RMOUSE_LEFT_UP) + ) + { + SetGUIActive ( 2 ); + } + + // check if user presses the key + if ( eve.EventType == EET_KEY_INPUT_EVENT && eve.KeyInput.PressedDown == false) + { + // Escape toggles camera Input + if ( eve.KeyInput.Key == irr::KEY_ESCAPE ) + { + SetGUIActive ( 3 ); + } + else + if (eve.KeyInput.Key == KEY_F11) + { + // screenshot are taken without gamma! + IImage* image = Game->Device->getVideoDriver()->createScreenShot(); + if (image) + { + core::vector3df pos; + core::vector3df rot; + ICameraSceneNode * cam = Game->Device->getSceneManager()->getActiveCamera (); + if ( cam ) + { + pos = cam->getPosition (); + 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()], + Game->CurrentMapName.c_str(), + pos.X, pos.Y, pos.Z, + rot.X, rot.Y, rot.Z + ); + path filename ( buf ); + filename.replace ( '/', '_' ); + printf ( "screenshot : %s\n", filename.c_str() ); + Game->Device->getVideoDriver()->writeImageToFile(image, filename, 100 ); + image->drop(); + } + } + else + if (eve.KeyInput.Key == KEY_F9) + { + s32 value = EDS_OFF; + + Game->debugState = ( Game->debugState + 1 ) & 3; + + switch ( Game->debugState ) + { + case 1: value = EDS_NORMALS | EDS_MESH_WIRE_OVERLAY | EDS_BBOX_ALL; break; + case 2: value = EDS_NORMALS | EDS_MESH_WIRE_OVERLAY | EDS_SKELETON; break; + } +/* + // set debug map data on/off + debugState = debugState == EDS_OFF ? + EDS_NORMALS | EDS_MESH_WIRE_OVERLAY | EDS_BBOX_ALL: + EDS_OFF; +*/ + if ( ItemParent ) + { + list::ConstIterator it = ItemParent->getChildren().begin(); + for (; it != ItemParent->getChildren().end(); ++it) + { + (*it)->setDebugDataVisible ( value ); + } + } + + if ( ShaderParent ) + { + list::ConstIterator it = ShaderParent->getChildren().begin(); + for (; it != ShaderParent->getChildren().end(); ++it) + { + (*it)->setDebugDataVisible ( value ); + } + } + + if ( UnresolvedParent ) + { + list::ConstIterator it = UnresolvedParent->getChildren().begin(); + for (; it != UnresolvedParent->getChildren().end(); ++it) + { + (*it)->setDebugDataVisible ( value ); + } + } + + if ( FogParent ) + { + list::ConstIterator it = FogParent->getChildren().begin(); + for (; it != FogParent->getChildren().end(); ++it) + { + (*it)->setDebugDataVisible ( value ); + } + } + + if ( SkyNode ) + { + SkyNode->setDebugDataVisible ( value ); + } + + } + else + if (eve.KeyInput.Key == KEY_F8) + { + // set gravity on/off + Game->gravityState ^= 1; + Player[0].cam()->setGravity ( getGravity ( Game->gravityState ? "earth" : "none" ) ); + printf ( "gravity %s\n", Game->gravityState ? "earth" : "none" ); + } + else + if (eve.KeyInput.Key == KEY_F7) + { + // set fly through active + Game->flyTroughState ^= 1; + Player[0].cam()->setAnimateTarget ( Game->flyTroughState == 0 ); + if ( gui.Collision ) + gui.Collision->setChecked ( Game->flyTroughState == 0 ); + + printf ( "collision %d\n", Game->flyTroughState == 0 ); + } + else + if (eve.KeyInput.Key == KEY_F2) + { + Player[0].respawn (); + } + else + if (eve.KeyInput.Key == KEY_F3) + { + if ( MapParent ) + { + bool v = !MapParent->isVisible (); + printf ( "static node set visible %d\n",v ); + MapParent->setVisible ( v ); + if ( gui.Visible_Map ) + gui.Visible_Map->setChecked ( v ); + } + } + else + if (eve.KeyInput.Key == KEY_F4) + { + if ( ShaderParent ) + { + bool v = !ShaderParent->isVisible (); + printf ( "shader node set visible %d\n",v ); + ShaderParent->setVisible ( v ); + if ( gui.Visible_Shader ) + gui.Visible_Shader->setChecked ( v ); + } + } + else + if (eve.KeyInput.Key == KEY_F5) + { + if ( FogParent ) + { + bool v = !FogParent->isVisible (); + printf ( "fog node set visible %d\n",v ); + FogParent->setVisible ( v ); + if ( gui.Visible_Fog ) + gui.Visible_Fog->setChecked ( v ); + } + + } + else + if (eve.KeyInput.Key == KEY_F6) + { + if ( UnresolvedParent ) + { + bool v = !UnresolvedParent->isVisible (); + printf ( "unresolved node set visible %d\n",v ); + UnresolvedParent->setVisible ( v ); + if ( gui.Visible_Unresolved ) + gui.Visible_Unresolved->setChecked ( v ); + } + } + } + + // check if user presses the key C ( for crouch) + if ( eve.EventType == EET_KEY_INPUT_EVENT && eve.KeyInput.Key == KEY_KEY_C ) + { + // crouch + ISceneNodeAnimatorCollisionResponse *anim = Player[0].cam (); + if ( anim && 0 == Game->flyTroughState ) + { + if ( false == eve.KeyInput.PressedDown ) + { + // stand up + anim->setEllipsoidRadius ( vector3df(30,45,30) ); + anim->setEllipsoidTranslation ( vector3df(0,40,0)); + + } + else + { + // on your knees + anim->setEllipsoidRadius ( vector3df(30,20,30) ); + anim->setEllipsoidTranslation ( vector3df(0,20,0)); + } + return true; + } + } + return false; +} + + + +/* + useItem +*/ +void CQuake3EventHandler::useItem( Q3Player * player) +{ + ISceneManager* smgr = Game->Device->getSceneManager(); + ICameraSceneNode* camera = smgr->getActiveCamera(); + + if (!camera) + return; + + SParticleImpact imp; + imp.when = 0; + + // get line of camera + + vector3df start = camera->getPosition(); + + if ( player->WeaponNode ) + { + start.X += 0.f; + start.Y += 0.f; + start.Z += 0.f; + } + + vector3df end = (camera->getTarget() - start); + end.normalize(); + start += end*20.0f; + + end = start + (end * camera->getFarValue()); + + triangle3df triangle; + line3d line(start, end); + + // get intersection point with map + scene::ISceneNode* hitNode; + if (smgr->getSceneCollisionManager()->getCollisionPoint( + line, Meta, end, triangle,hitNode)) + { + // collides with wall + vector3df out = triangle.getNormal(); + out.setLength(0.03f); + + imp.when = 1; + imp.outVector = out; + imp.pos = end; + + player->setAnim ( "pow" ); + player->Anim[1].next += player->Anim[1].delta; + } + else + { + // doesnt collide with wall + vector3df start = camera->getPosition(); + if ( player->WeaponNode ) + { + //start.X += 10.f; + //start.Y += -5.f; + //start.Z += 1.f; + } + + vector3df end = (camera->getTarget() - start); + end.normalize(); + start += end*20.0f; + end = start + (end * camera->getFarValue()); + } + + // create fire ball + ISceneNode* node = 0; + node = smgr->addBillboardSceneNode( BulletParent,dimension2d(10,10), start); + + node->setMaterialFlag(EMF_LIGHTING, false); + node->setMaterialTexture(0, Game->Device->getVideoDriver()->getTexture("fireball.bmp")); + node->setMaterialFlag(video::EMF_ZWRITE_ENABLE, false); + node->setMaterialType(EMT_TRANSPARENT_ADD_COLOR); + + f32 length = (f32)(end - start).getLength(); + const f32 speed = 5.8f; + u32 time = (u32)(length / speed); + + ISceneNodeAnimator* anim = 0; + + // set flight line + + anim = smgr->createFlyStraightAnimator(start, end, time); + node->addAnimator(anim); + anim->drop(); + + snprintf ( buf, 64, "bullet: %s on %.1f,%1.f,%1.f", + imp.when ? "hit" : "nohit", end.X, end.Y, end.Z ); + node->setName ( buf ); + + + anim = smgr->createDeleteAnimator(time); + node->addAnimator(anim); + anim->drop(); + + if (imp.when) + { + // create impact note + imp.when = Game->Device->getTimer()->getTime() + + (time + (s32) ( ( 1.f + Noiser::get() ) * 250.f )); + Impacts.push_back(imp); + } + + // play sound +} + +// rendered when bullets hit something +void CQuake3EventHandler::createParticleImpacts( u32 now ) +{ + ISceneManager* sm = Game->Device->getSceneManager(); + + struct smokeLayer + { + const c8 * texture; + f32 scale; + f32 minparticleSize; + f32 maxparticleSize; + f32 boxSize; + u32 minParticle; + u32 maxParticle; + u32 fadeout; + u32 lifetime; + }; + + smokeLayer smoke[] = + { + { "smoke2.jpg", 0.4f, 1.5f, 18.f, 20.f, 20, 50, 2000, 10000 }, + { "smoke3.jpg", 0.2f, 1.2f, 15.f, 20.f, 10, 30, 1000, 12000 } + }; + + + u32 i; + u32 g; + s32 factor = 1; + for ( g = 0; g != 2; ++g ) + { + smoke[g].minParticle *= factor; + smoke[g].maxParticle *= factor; + smoke[g].lifetime *= factor; + smoke[g].boxSize *= Noiser::get() * 0.5f; + } + + for ( i=0; i < Impacts.size(); ++i) + { + if (now < Impacts[i].when) + continue; + + // create smoke particle system + IParticleSystemSceneNode* pas = 0; + + for ( g = 0; g != 2; ++g ) + { + pas = sm->addParticleSystemSceneNode(false, BulletParent, -1, Impacts[i].pos); + + snprintf ( 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 ); + + // create a flat smoke + vector3df direction = Impacts[i].outVector; + direction *= smoke[g].scale; + IParticleEmitter* em = pas->createBoxEmitter( + aabbox3d(-4.f,0.f,-4.f,20.f,smoke[g].minparticleSize,20.f), + direction,smoke[g].minParticle, smoke[g].maxParticle, + video::SColor(0,0,0,0),video::SColor(0,128,128,128), + 250,4000, 60); + + em->setMinStartSize (dimension2d( smoke[g].minparticleSize, smoke[g].minparticleSize)); + em->setMaxStartSize (dimension2d( smoke[g].maxparticleSize, smoke[g].maxparticleSize)); + + pas->setEmitter(em); + em->drop(); + + // particles get invisible + IParticleAffector* paf = pas->createFadeOutParticleAffector( + video::SColor ( 0, 0, 0, 0 ), smoke[g].fadeout); + pas->addAffector(paf); + paf->drop(); + + // particle system life time + ISceneNodeAnimator* anim = sm->createDeleteAnimator( smoke[g].lifetime); + pas->addAnimator(anim); + anim->drop(); + + pas->setMaterialFlag(video::EMF_LIGHTING, false); + pas->setMaterialFlag(video::EMF_ZWRITE_ENABLE, false); + pas->setMaterialType(video::EMT_TRANSPARENT_ADD_COLOR ); + pas->setMaterialTexture(0, Game->Device->getVideoDriver()->getTexture( smoke[g].texture )); + } + + + // play impact sound + #ifdef USE_IRRKLANG +/* + if (irrKlang) + { + audio::ISound* sound = + irrKlang->play3D(impactSound, Impacts[i].pos, false, false, true); + + if (sound) + { + // adjust max value a bit to make to sound of an impact louder + sound->setMinDistance(400); + sound->drop(); + } + } +*/ + #endif + + + // delete entry + Impacts.erase(i); + i--; + } +} + +/* + render +*/ +void CQuake3EventHandler::Render() +{ + IVideoDriver * driver = Game->Device->getVideoDriver(); + if ( 0 == driver ) + return; + + // TODO: This does not work, yet. + const bool anaglyph=false; + if (anaglyph) + { + scene::ICameraSceneNode* cameraOld = Game->Device->getSceneManager()->getActiveCamera(); + driver->beginScene(true, true, SColor(0,0,0,0)); + driver->getOverrideMaterial().Material.ColorMask = ECP_NONE; + driver->getOverrideMaterial().EnableFlags = EMF_COLOR_MASK; + driver->getOverrideMaterial().EnablePasses = ESNRP_SKY_BOX + + ESNRP_SOLID + + ESNRP_TRANSPARENT + + ESNRP_TRANSPARENT_EFFECT + + ESNRP_SHADOW; + Game->Device->getSceneManager()->drawAll(); + driver->clearZBuffer(); + + const vector3df oldPosition = cameraOld->getPosition(); + const vector3df oldTarget = cameraOld->getTarget(); + const matrix4 startMatrix = cameraOld->getAbsoluteTransformation(); + const vector3df focusPoint = (oldTarget - + cameraOld->getAbsolutePosition()).setLength(10000) + + cameraOld->getAbsolutePosition() ; + + scene::ICameraSceneNode* camera = cameraOld;//Game->Device->getSceneManager()->addCameraSceneNode(); + + //Left eye... + vector3df pos; + matrix4 move; + + move.setTranslation( vector3df(-1.5f,0.0f,0.0f) ); + pos=(startMatrix*move).getTranslation(); + + driver->getOverrideMaterial().Material.ColorMask = ECP_RED; + driver->getOverrideMaterial().EnableFlags = EMF_COLOR_MASK; + driver->getOverrideMaterial().EnablePasses = + ESNRP_SKY_BOX|ESNRP_SOLID|ESNRP_TRANSPARENT| + ESNRP_TRANSPARENT_EFFECT|ESNRP_SHADOW; + + camera->setPosition(pos); + camera->setTarget(focusPoint); + + Game->Device->getSceneManager()->drawAll(); + driver->clearZBuffer(); + + //Right eye... + move.setTranslation( vector3df(1.5f,0.0f,0.0f) ); + pos=(startMatrix*move).getTranslation(); + + driver->getOverrideMaterial().Material.ColorMask = ECP_GREEN + ECP_BLUE; + driver->getOverrideMaterial().EnableFlags = EMF_COLOR_MASK; + driver->getOverrideMaterial().EnablePasses = + ESNRP_SKY_BOX|ESNRP_SOLID|ESNRP_TRANSPARENT| + ESNRP_TRANSPARENT_EFFECT|ESNRP_SHADOW; + + camera->setPosition(pos); + camera->setTarget(focusPoint); + + Game->Device->getSceneManager()->drawAll(); + + driver->getOverrideMaterial().Material.ColorMask=ECP_ALL; + driver->getOverrideMaterial().EnableFlags=0; + driver->getOverrideMaterial().EnablePasses=0; + + if (camera != cameraOld) + { + Game->Device->getSceneManager()->setActiveCamera(cameraOld); + camera->remove(); + } + else + { + camera->setPosition(oldPosition); + camera->setTarget(oldTarget); + } + } + else + { + driver->beginScene(true, true, SColor(0,0,0,0)); + Game->Device->getSceneManager()->drawAll(); + } + Game->Device->getGUIEnvironment()->drawAll(); + driver->endScene(); +} + +/* + update the generic scene node +*/ +void CQuake3EventHandler::Animate() +{ + u32 now = Game->Device->getTimer()->getTime(); + + Q3Player * player = Player + 0; + + checkTimeFire ( player->Anim, 4, now ); + + // Query Scene Manager attributes + if ( player->Anim[0].flags & FIRED ) + { + ISceneManager *smgr = Game->Device->getSceneManager (); + wchar_t msg[128]; + IVideoDriver * driver = Game->Device->getVideoDriver(); + + IAttributes * attr = smgr->getParameters(); +#ifdef _IRR_SCENEMANAGER_DEBUG + swprintf ( msg, 128, + L"Q3 %s [%ls], FPS:%03d Tri:%.03fm Cull %d/%d nodes (%d,%d,%d)", + Game->CurrentMapName.c_str(), + driver->getName(), + driver->getFPS (), + (f32) driver->getPrimitiveCountDrawn( 0 ) * ( 1.f / 1000000.f ), + attr->getAttributeAsInt ( "culled" ), + attr->getAttributeAsInt ( "calls" ), + attr->getAttributeAsInt ( "drawn_solid" ), + attr->getAttributeAsInt ( "drawn_transparent" ), + attr->getAttributeAsInt ( "drawn_transparent_effect" ) + ); +#else +swprintf ( msg, 128, + L"Q3 %s [%ls], FPS:%03d Tri:%.03fm", + Game->CurrentMapName.c_str(), + driver->getName(), + driver->getFPS (), + (f32) driver->getPrimitiveCountDrawn( 0 ) * ( 1.f / 1000000.f ) + ); +#endif + Game->Device->setWindowCaption( msg ); + + swprintf ( 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 () + ); + if ( gui.StatusLine ) + gui.StatusLine->setText ( msg ); + player->Anim[0].flags &= ~FIRED; + } + + // idle.. + if ( player->Anim[1].flags & FIRED ) + { + if ( strcmp ( player->animation, "idle" ) ) + player->setAnim ( "idle" ); + + player->Anim[1].flags &= ~FIRED; + } + + createParticleImpacts ( now ); + +} + + +/* The main game states +*/ +void runGame ( GameData *game ) +{ + if ( game->retVal >= 3 ) + return; + + game->Device = (*game->createExDevice) ( game->deviceParam ); + if ( 0 == game->Device) + { + // could not create selected driver. + game->retVal = 0; + return; + } + + // create an event receiver based on current game data + CQuake3EventHandler *eventHandler = new CQuake3EventHandler( game ); + + // load stored config + game->load ( "explorer.cfg" ); + + // add our media directory and archive to the file system + for ( u32 i = 0; i < game->CurrentArchiveList.size(); ++i ) + { + eventHandler->AddArchive ( game->CurrentArchiveList[i] ); + } + + // Load a Map or startup to the GUI + if ( game->CurrentMapName.size () ) + { + eventHandler->LoadMap ( game->CurrentMapName, 1 ); + if ( 0 == game->loadParam.loadSkyShader ) + eventHandler->AddSky ( 1, "skydome2" ); + eventHandler->CreatePlayers (); + eventHandler->CreateGUI (); + eventHandler->SetGUIActive ( 0 ); + + // set player to last position on restart + if ( game->retVal == 2 ) + { + eventHandler->GetPlayer( 0 )->setpos ( game->PlayerPosition, game->PlayerRotation ); + } + } + else + { + // start up empty + eventHandler->AddSky ( 1, "skydome2" ); + eventHandler->CreatePlayers (); + eventHandler->CreateGUI (); + eventHandler->SetGUIActive ( 1 ); + background_music ( "IrrlichtTheme.ogg" ); + } + + + game->retVal = 3; + while( game->Device->run() ) + { + eventHandler->Animate (); + eventHandler->Render (); + //if ( !game->Device->isWindowActive() ) + game->Device->yield(); + } + + game->Device->setGammaRamp ( 1.f, 1.f, 1.f, 0.f, 0.f ); + delete eventHandler; +} + +#if defined (_IRR_WINDOWS_) && 0 + #pragma comment(linker, "/subsystem:windows /ENTRY:mainCRTStartup") +#endif + + +/* The main routine, doing all setup +*/ +int IRRCALLCONV main(int argc, char* argv[]) +{ + path prgname(argv[0]); + GameData game ( deletePathFromPath ( prgname, 1 ) ); + + // dynamically load irrlicht + const c8 * dllName = argc > 1 ? argv[1] : "irrlicht.dll"; + game.createExDevice = load_createDeviceEx ( dllName ); + if ( 0 == game.createExDevice ) + { + game.retVal = 3; + printf ( "Could not load %s.\n", dllName ); + return game.retVal; // could not load dll + } + + // start without asking for driver + game.retVal = 1; + do + { + // if driver could not created, ask for another driver + if ( game.retVal == 0 ) + { + game.setDefault (); + // ask user for driver + game.deviceParam.DriverType=driverChoiceConsole(); + if (game.deviceParam.DriverType==video::EDT_COUNT) + game.retVal = 3; + } + runGame ( &game ); + } while ( game.retVal < 3 ); + + return game.retVal; +} + +/* +**/ diff --git a/libraries/irrlicht-1.8.1/examples/21.Quake3Explorer/q3factory.cpp b/libraries/irrlicht-1.8.1/examples/21.Quake3Explorer/q3factory.cpp new file mode 100644 index 0000000..d0f09b2 --- /dev/null +++ b/libraries/irrlicht-1.8.1/examples/21.Quake3Explorer/q3factory.cpp @@ -0,0 +1,824 @@ +/*! + Model Factory. + create the additional scenenodes for ( bullets, health... ) + + Defines the Entities for Quake3 +*/ + +#include +#include "q3factory.h" +#include "sound.h" + +using namespace irr; +using namespace scene; +using namespace gui; +using namespace video; +using namespace core; +using namespace quake3; + +//! This list is based on the original quake3. +static const SItemElement Quake3ItemElement [] = { +{ "item_health", + {"models/powerups/health/medium_cross.md3", + "models/powerups/health/medium_sphere.md3"}, + "sound/items/n_health.wav", + "icons/iconh_yellow", + "25 Health", + 25, + HEALTH, + SUB_NONE, + SPECIAL_SFX_BOUNCE | SPECIAL_SFX_ROTATE_1 +}, +{ "item_health_large", + "models/powerups/health/large_cross.md3", + "models/powerups/health/large_sphere.md3", + "sound/items/l_health.wav", + "icons/iconh_red", + "50 Health", + 50, + HEALTH, + SUB_NONE, + SPECIAL_SFX_BOUNCE | SPECIAL_SFX_ROTATE_1 +}, +{ + "item_health_mega", + "models/powerups/health/mega_cross.md3", + "models/powerups/health/mega_sphere.md3", + "sound/items/m_health.wav", + "icons/iconh_mega", + "Mega Health", + 100, + HEALTH, + SUB_NONE, + SPECIAL_SFX_BOUNCE | SPECIAL_SFX_ROTATE_1 +}, +{ + "item_health_small", + "models/powerups/health/small_cross.md3", + "models/powerups/health/small_sphere.md3", + "sound/items/s_health.wav", + "icons/iconh_green", + "5 Health", + 5, + HEALTH, + SUB_NONE, + SPECIAL_SFX_BOUNCE | SPECIAL_SFX_ROTATE_1 +}, +{ "ammo_bullets", + "models/powerups/ammo/machinegunam.md3", + "", + "sound/misc/am_pkup.wav", + "icons/icona_machinegun", + "Bullets", + 50, + AMMO, + MACHINEGUN, + SPECIAL_SFX_BOUNCE, +}, +{ + "ammo_cells", + "models/powerups/ammo/plasmaam.md3", + "", + "sound/misc/am_pkup.wav", + "icons/icona_plasma", + "Cells", + 30, + AMMO, + PLASMAGUN, + SPECIAL_SFX_BOUNCE +}, +{ "ammo_rockets", + "models/powerups/ammo/rocketam.md3", + "", + "", + "icons/icona_rocket", + "Rockets", + 5, + AMMO, + ROCKET_LAUNCHER, + SPECIAL_SFX_ROTATE +}, +{ + "ammo_shells", + "models/powerups/ammo/shotgunam.md3", + "", + "sound/misc/am_pkup.wav", + "icons/icona_shotgun", + "Shells", + 10, + AMMO, + SHOTGUN, + SPECIAL_SFX_ROTATE +}, +{ + "ammo_slugs", + "models/powerups/ammo/railgunam.md3", + "", + "sound/misc/am_pkup.wav", + "icons/icona_railgun", + "Slugs", + 10, + AMMO, + RAILGUN, + SPECIAL_SFX_ROTATE +}, +{ + "item_armor_body", + "models/powerups/armor/armor_red.md3", + "", + "sound/misc/ar2_pkup.wav", + "icons/iconr_red", + "Heavy Armor", + 100, + ARMOR, + SUB_NONE, + SPECIAL_SFX_ROTATE +}, +{ + "item_armor_combat", + "models/powerups/armor/armor_yel.md3", + "", + "sound/misc/ar2_pkup.wav", + "icons/iconr_yellow", + "Armor", + 50, + ARMOR, + SUB_NONE, + SPECIAL_SFX_ROTATE +}, +{ + "item_armor_shard", + "models/powerups/armor/shard.md3", + "", + "sound/misc/ar1_pkup.wav", + "icons/iconr_shard", + "Armor Shared", + 5, + ARMOR, + SUB_NONE, + SPECIAL_SFX_ROTATE +}, +{ + "weapon_gauntlet", + "models/weapons2/gauntlet/gauntlet.md3", + "", + "sound/misc/w_pkup.wav", + "icons/iconw_gauntlet", + "Gauntlet", + 0, + WEAPON, + GAUNTLET, + SPECIAL_SFX_ROTATE +}, +{ + "weapon_shotgun", + "models/weapons2/shotgun/shotgun.md3", + "", + "sound/misc/w_pkup.wav", + "icons/iconw_shotgun", + "Shotgun", + 10, + WEAPON, + SHOTGUN, + SPECIAL_SFX_ROTATE +}, +{ + "weapon_machinegun", + "models/weapons2/machinegun/machinegun.md3", + "", + "sound/misc/w_pkup.wav", + "icons/iconw_machinegun", + "Machinegun", + 40, + WEAPON, + MACHINEGUN, + SPECIAL_SFX_ROTATE +}, +{ + "weapon_grenadelauncher", + "models/weapons2/grenadel/grenadel.md3", + "", + "sound/misc/w_pkup.wav", + "icons/iconw_grenade", + "Grenade Launcher", + 10, + WEAPON, + GRENADE_LAUNCHER, + SPECIAL_SFX_ROTATE +}, +{ + "weapon_rocketlauncher", + "models/weapons2/rocketl/rocketl.md3", + "", + "sound/misc/w_pkup.wav", + "icons/iconw_rocket", + "Rocket Launcher", + 10, + WEAPON, + ROCKET_LAUNCHER, + SPECIAL_SFX_ROTATE +}, +{ + "weapon_lightning", + "models/weapons2/lightning/lightning.md3", + "", + "sound/misc/w_pkup.wav", + "icons/iconw_lightning", + "Lightning Gun", + 100, + WEAPON, + LIGHTNING, + SPECIAL_SFX_ROTATE +}, +{ + "weapon_railgun", + "models/weapons2/railgun/railgun.md3", + "", + "sound/misc/w_pkup.wav", + "icons/iconw_railgun", + "Railgun", + 10, + WEAPON, + RAILGUN, + SPECIAL_SFX_ROTATE +}, +{ + "weapon_plasmagun", + "models/weapons2/plasma/plasma.md3", + "", + "sound/misc/w_pkup.wav", + "icons/iconw_plasma", + "Plasma Gun", + 50, + WEAPON, + PLASMAGUN, + SPECIAL_SFX_ROTATE +}, +{ + "weapon_bfg", + "models/weapons2/bfg/bfg.md3", + "", + "sound/misc/w_pkup.wav", + "icons/iconw_bfg", + "BFG10K", + 20, + WEAPON, + BFG, + SPECIAL_SFX_ROTATE +}, +{ + "weapon_grapplinghook", + "models/weapons2/grapple/grapple.md3", + "", + "sound/misc/w_pkup.wav", + "icons/iconw_grapple", + "Grappling Hook", + 0, + WEAPON, + GRAPPLING_HOOK, + SPECIAL_SFX_ROTATE +}, +{ + 0 +} + +}; + + +/*! +*/ +const SItemElement * getItemElement ( const stringc& key ) +{ + const SItemElement *item = Quake3ItemElement; + + while ( item->key ) + { + if ( 0 == strcmp ( key.c_str(), item->key ) ) + return item; + item += 1; + } + return 0; +} + +/*! + Quake3 Model Factory. + Takes the mesh buffers and creates scenenodes for their associated shaders +*/ +void Q3ShaderFactory ( Q3LevelLoadParameter &loadParam, + IrrlichtDevice *device, + IQ3LevelMesh* mesh, + eQ3MeshIndex meshIndex, + ISceneNode *parent, + IMetaTriangleSelector *meta, + bool showShaderName ) +{ + if ( 0 == mesh || 0 == device ) + return; + + IMeshSceneNode* node = 0; + ISceneManager* smgr = device->getSceneManager(); + ITriangleSelector * selector = 0; + + // the additional mesh can be quite huge and is unoptimized + // Save to cast to SMesh + SMesh * additional_mesh = (SMesh*) mesh->getMesh ( meshIndex ); + if ( 0 == additional_mesh || additional_mesh->getMeshBufferCount() == 0) + return; + + char buf[128]; + if ( loadParam.verbose > 0 ) + { + loadParam.startTime = device->getTimer()->getRealTime(); + if ( loadParam.verbose > 1 ) + { + snprintf(buf, 128, "q3shaderfactory start" ); + device->getLogger()->log( buf, ELL_INFORMATION); + } + } + + IGUIFont *font = 0; + if ( showShaderName ) + font = device->getGUIEnvironment()->getFont("fontlucida.png"); + + IVideoDriver *driver = device->getVideoDriver(); + + // create helper textures + if ( 1 ) + { + tTexArray tex; + u32 pos = 0; + getTextures ( tex, "$redimage $blueimage $whiteimage $checkerimage", pos, + device->getFileSystem(), driver ); + } + + s32 sceneNodeID = 0; + for ( u32 i = 0; i!= additional_mesh->getMeshBufferCount (); ++i ) + { + IMeshBuffer *meshBuffer = additional_mesh->getMeshBuffer ( i ); + const SMaterial &material = meshBuffer->getMaterial(); + + //! The ShaderIndex is stored in the second material parameter + s32 shaderIndex = (s32) material.MaterialTypeParam2; + + // the meshbuffer can be rendered without additional support, or it has no shader + IShader *shader = (IShader *) mesh->getShader ( shaderIndex ); + + // no shader, or mapped to existing material + if ( 0 == shader ) + { + +#if 1 + // clone mesh + SMesh * m = new SMesh (); + m->addMeshBuffer ( meshBuffer ); + SMaterial &mat = m->getMeshBuffer( 0 )->getMaterial(); + if ( mat.getTexture( 0 ) == 0 ) + mat.setTexture ( 0, driver->getTexture ( "$blueimage" ) ); + if ( mat.getTexture( 1 ) == 0 ) + mat.setTexture ( 1, driver->getTexture ( "$redimage" ) ); + + IMesh * store = smgr->getMeshManipulator ()->createMeshWith2TCoords ( m ); + m->drop(); + + node = smgr->addMeshSceneNode ( store, parent, sceneNodeID ); + node->setAutomaticCulling ( scene::EAC_OFF ); + store->drop (); + sceneNodeID += 1; +#endif + } + else if ( 1 ) + { +/* + stringc s; + dumpShader ( s, shader ); + printf ( s.c_str () ); +*/ + // create sceneNode + node = smgr->addQuake3SceneNode ( meshBuffer, shader, parent, sceneNodeID ); + node->setAutomaticCulling ( scene::EAC_FRUSTUM_BOX ); + sceneNodeID += 1; + } + + // show Debug Shader Name + if ( showShaderName && node ) + { + swprintf ( (wchar_t*) buf, 64, L"%hs:%d", node->getName(),node->getID() ); + smgr->addBillboardTextSceneNode( + font, + (wchar_t*) buf, + node, + dimension2d(80.0f, 8.0f), + vector3df(0, 10, 0), + sceneNodeID); + sceneNodeID += 1; + } + + // create Portal Rendertargets + if ( shader ) + { + const SVarGroup *group = shader->getGroup(1); + if ( group->isDefined( "surfaceparm", "portal" ) ) + { + } + + } + + + // add collision + // find out if shader is marked as nonsolid + u8 doCreate = meta !=0 ; + + if ( shader ) + { + const SVarGroup *group = shader->getGroup(1); + if ( group->isDefined( "surfaceparm", "trans" ) + // || group->isDefined( "surfaceparm", "sky" ) + // || group->isDefined( "surfaceparm", "nonsolid" ) + ) + { + if ( !group->isDefined( "surfaceparm", "metalsteps" ) ) + { + doCreate = 0; + } + } + } + + if ( doCreate ) + { + IMesh *m = 0; + + //! controls if triangles are modified by the scenenode during runtime + bool takeOriginal = true; + + if ( takeOriginal ) + { + m = new SMesh (); + ((SMesh*) m )->addMeshBuffer (meshBuffer); + } + else + { + m = node->getMesh(); + } + + //selector = smgr->createOctreeTriangleSelector ( m, 0, 128 ); + selector = smgr->createTriangleSelector ( m, 0 ); + meta->addTriangleSelector ( selector ); + selector->drop (); + + if ( takeOriginal ) + { + delete m; + } + } + + } + +#if 0 + if ( meta ) + { + selector = smgr->createOctreeTriangleSelector ( additional_mesh, 0 ); + meta->addTriangleSelector ( selector ); + selector->drop (); + } +#endif + + if ( loadParam.verbose > 0 ) + { + loadParam.endTime = device->getTimer()->getRealTime (); + snprintf(buf, 128, "q3shaderfactory needed %04d ms to create %d shader nodes", + loadParam.endTime - loadParam.startTime, + sceneNodeID + ); + device->getLogger()->log(buf, ELL_INFORMATION); + } + +} + + +/*! + create Items from Entity +*/ +void Q3ModelFactory ( Q3LevelLoadParameter &loadParam, + IrrlichtDevice *device, + IQ3LevelMesh* masterMesh, + ISceneNode *parent, + bool showShaderName + ) +{ + if ( 0 == masterMesh ) + return; + + tQ3EntityList &entity = masterMesh->getEntityList (); + ISceneManager* smgr = device->getSceneManager(); + + + char buf[128]; + const SVarGroup *group; + IEntity search; + s32 index; + s32 lastIndex; + +/* + stringc s; + FILE *f = 0; + f = fopen ( "entity.txt", "wb" ); + for ( index = 0; (u32) index < entityList.size (); ++index ) + { + const IEntity *entity = &entityList[ index ]; + s = entity->name; + dumpShader ( s, entity ); + fwrite ( s.c_str(), 1, s.size(), f ); + } + fclose ( f ); +*/ + IAnimatedMeshMD3* model; + SMD3Mesh * mesh; + const SMD3MeshBuffer *meshBuffer; + IMeshSceneNode* node; + ISceneNodeAnimator* anim; + const IShader *shader; + u32 pos; + vector3df p; + u32 nodeCount = 0; + tTexArray textureArray; + + IGUIFont *font = 0; + if ( showShaderName ) + font = device->getGUIEnvironment()->getFont("fontlucida.png"); + + const SItemElement *itemElement; + + // walk list + for ( index = 0; (u32) index < entity.size(); ++index ) + { + itemElement = getItemElement ( entity[index].name ); + if ( 0 == itemElement ) + continue; + + pos = 0; + p = getAsVector3df ( entity[index].getGroup(1)->get ( "origin" ), pos ); + + nodeCount += 1; + for ( u32 g = 0; g < 2; ++g ) + { + if ( 0 == itemElement->model[g] || itemElement->model[g][0] == 0 ) + continue; + model = (IAnimatedMeshMD3*) smgr->getMesh( itemElement->model[g] ); + if ( 0 == model ) + continue; + + mesh = model->getOriginalMesh(); + for ( u32 j = 0; j != mesh->Buffer.size (); ++j ) + { + meshBuffer = mesh->Buffer[j]; + if ( 0 == meshBuffer ) + continue; + + shader = masterMesh->getShader ( meshBuffer->Shader.c_str(), false ); + IMeshBuffer *final = model->getMesh(0)->getMeshBuffer(j); + if ( shader ) + { + //!TODO: Hack don't modify the vertexbuffer. make it better;-) + final->getMaterial().ColorMask = 0; + node = smgr->addQuake3SceneNode ( final, shader, parent ); + final->getMaterial().ColorMask = 15; + } + else + { + // clone mesh + SMesh * m = new SMesh (); + m->addMeshBuffer ( final ); + node = smgr->addMeshSceneNode ( m, parent ); + m->drop(); + } + + if ( 0 == node ) + { + snprintf ( buf, 128, "q3ModelFactory shader %s failed", meshBuffer->Shader.c_str() ); + device->getLogger()->log ( buf ); + continue; + } + + // node was maybe centered by shaderscenenode + node->setPosition ( p ); + node->setName ( meshBuffer->Shader ); + node->setAutomaticCulling ( scene::EAC_BOX ); + + // add special effects to node + if ( itemElement->special & SPECIAL_SFX_ROTATE || + (g == 0 && itemElement->special & SPECIAL_SFX_ROTATE_1) + ) + { + anim = smgr->createRotationAnimator ( vector3df ( 0.f, + 2.f, 0.f ) ); + node->addAnimator ( anim ); + anim->drop (); + } + + if ( itemElement->special & SPECIAL_SFX_BOUNCE ) + { + //anim = smgr->createFlyStraightAnimator ( + // p, p + vector3df ( 0.f, 60.f, 0.f ), 1000, true, true ); + anim = smgr->createFlyCircleAnimator ( + p + vector3df( 0.f, 20.f, 0.f ), + 20.f, + 0.005f, + vector3df ( 1.f, 0.f, 0.f ), + core::fract ( nodeCount * 0.05f ), + 1.f + ); + node->addAnimator ( anim ); + anim->drop (); + } + } + } + // show name + if ( showShaderName ) + { + swprintf ( (wchar_t*) buf, sizeof(buf) / 2, L"%hs", itemElement->key ); + smgr->addBillboardTextSceneNode( + font, + (wchar_t*) buf, + parent, + dimension2d(80.0f, 8.0f), + p + vector3df(0, 30, 0), + 0); + } + } + + // music + search.name = "worldspawn"; + index = entity.binary_search_multi ( search, lastIndex ); + + if ( index >= 0 ) + { + group = entity[ index ].getGroup(1); + background_music ( group->get ( "music" ).c_str () ); + } + + // music + search.name = "worldspawn"; + index = entity.binary_search_multi ( search, lastIndex ); + + if ( index >= 0 ) + { + group = entity[ index ].getGroup(1); + background_music ( group->get ( "music" ).c_str () ); + } + + //IAnimatedMesh* mesh = smgr->getMesh("../../media/sydney.md2"); + //IAnimatedMeshSceneNode* node = smgr->addAnimatedMeshSceneNode( mesh ); + +} + +/*! + so we need a good starting Position in the level. + we can ask the Quake3 Loader for all entities with class_name "info_player_deathmatch" +*/ +s32 Q3StartPosition ( IQ3LevelMesh* mesh, + ICameraSceneNode* camera, + s32 startposIndex, + const vector3df &translation + ) +{ + if ( 0 == mesh ) + return 0; + + tQ3EntityList &entityList = mesh->getEntityList (); + + IEntity search; + search.name = "info_player_start"; // "info_player_deathmatch"; + + // find all entities in the multi-list + s32 lastIndex; + s32 index = entityList.binary_search_multi ( search, lastIndex ); + + if ( index < 0 ) + { + search.name = "info_player_deathmatch"; + index = entityList.binary_search_multi ( search, lastIndex ); + } + + if ( index < 0 ) + return 0; + + index += core::clamp ( startposIndex, 0, lastIndex - index ); + + u32 parsepos; + + const SVarGroup *group; + group = entityList[ index ].getGroup(1); + + parsepos = 0; + vector3df pos = getAsVector3df ( group->get ( "origin" ), parsepos ); + pos += translation; + + parsepos = 0; + f32 angle = getAsFloat ( group->get ( "angle"), parsepos ); + + vector3df target ( 0.f, 0.f, 1.f ); + target.rotateXZBy ( angle - 90.f, vector3df () ); + + if ( camera ) + { + camera->setPosition ( pos ); + camera->setTarget ( pos + target ); + //! New. FPSCamera and animators catches reset on animate 0 + camera->OnAnimate ( 0 ); + } + return lastIndex - index + 1; +} + + +/*! + gets a accumulated force on a given surface +*/ +vector3df getGravity ( const c8 * surface ) +{ + if ( 0 == strcmp ( surface, "earth" ) ) return vector3df ( 0.f, -90.f, 0.f ); + if ( 0 == strcmp ( surface, "moon" ) ) return vector3df ( 0.f, -6.f / 100.f, 0.f ); + if ( 0 == strcmp ( surface, "water" ) ) return vector3df ( 0.1f / 100.f, -2.f / 100.f, 0.f ); + if ( 0 == strcmp ( surface, "ice" ) ) return vector3df ( 0.2f / 100.f, -9.f / 100.f, 0.3f / 100.f ); + + return vector3df ( 0.f, 0.f, 0.f ); +} + + + +/* + Dynamically load the Irrlicht Library +*/ + +#if defined(_IRR_WINDOWS_API_) +#ifdef _MSC_VER +#pragma comment(lib, "Irrlicht.lib") +#endif + +#include + +funcptr_createDevice load_createDevice ( const c8 * filename) +{ + return (funcptr_createDevice) GetProcAddress ( LoadLibrary ( filename ), "createDevice" ); +} + +funcptr_createDeviceEx load_createDeviceEx ( const c8 * filename) +{ + return (funcptr_createDeviceEx) GetProcAddress ( LoadLibrary ( filename ), "createDeviceEx" ); +} + +#else + +// TODO: Dynamic Loading for other os +funcptr_createDevice load_createDevice ( const c8 * filename) +{ + return createDevice; +} + +funcptr_createDeviceEx load_createDeviceEx ( const c8 * filename) +{ + return createDeviceEx; +} + +#endif + +/* + get the current collision response camera animator +*/ +ISceneNodeAnimatorCollisionResponse* camCollisionResponse( IrrlichtDevice * device ) +{ + ICameraSceneNode *camera = device->getSceneManager()->getActiveCamera(); + ISceneNodeAnimatorCollisionResponse *a = 0; + + list::ConstIterator it = camera->getAnimators().begin(); + for (; it != camera->getAnimators().end(); ++it) + { + a = (ISceneNodeAnimatorCollisionResponse*) (*it); + if ( a->getType() == ESNAT_COLLISION_RESPONSE ) + return a; + } + + return 0; +} + + +//! internal Animation +void setTimeFire ( TimeFire *t, u32 delta, u32 flags ) +{ + t->flags = flags; + t->next = 0; + t->delta = delta; +} + + +void checkTimeFire ( TimeFire *t, u32 listSize, u32 now ) +{ + u32 i; + for ( i = 0; i < listSize; ++i ) + { + if ( now < t[i].next ) + continue; + + t[i].next = core::max_ ( now + t[i].delta, t[i].next + t[i].delta ); + t[i].flags |= FIRED; + } +} diff --git a/libraries/irrlicht-1.8.1/examples/21.Quake3Explorer/q3factory.h b/libraries/irrlicht-1.8.1/examples/21.Quake3Explorer/q3factory.h new file mode 100644 index 0000000..d9606ed --- /dev/null +++ b/libraries/irrlicht-1.8.1/examples/21.Quake3Explorer/q3factory.h @@ -0,0 +1,149 @@ +/*! + Model Factory. + create the additional scenenodes for ( bullets, health... ) + + Defines the Entities for Quake3 +*/ +#ifndef __QUAKE3_FACTORY__H_INCLUDED__ +#define __QUAKE3_FACTORY__H_INCLUDED__ + +using namespace irr; +using namespace scene; +using namespace gui; +using namespace video; +using namespace core; +using namespace quake3; +using namespace io; + + + +//! Defines to which group the entities belong +enum eItemGroup +{ + WEAPON, + AMMO, + ARMOR, + HEALTH, + POWERUP +}; + +//! define a supgroup for the item. for e.q the Weapons +enum eItemSubGroup +{ + SUB_NONE = 0, + GAUNTLET, + MACHINEGUN, + SHOTGUN, + GRENADE_LAUNCHER, + ROCKET_LAUNCHER, + LIGHTNING, + RAILGUN, + PLASMAGUN, + BFG, + GRAPPLING_HOOK, + NAILGUN, + PROX_LAUNCHER, + CHAINGUN, +}; + +//! aplly a special effect to the shader +enum eItemSpecialEffect +{ + SPECIAL_SFX_NONE = 0, + SPECIAL_SFX_ROTATE = 1, + SPECIAL_SFX_BOUNCE = 2, + SPECIAL_SFX_ROTATE_1 = 4, +}; + +// a List for defining a model +struct SItemElement +{ + const c8 *key; + const c8 *model[2]; + const c8 *sound; + const c8 *icon; + const c8 *pickup; + s32 value; + eItemGroup group; + eItemSubGroup sub; + u32 special; +}; + + +//! Get's an entity based on it's key +const SItemElement * getItemElement ( const stringc& key ); + +/*! + Quake3 Model Factory. + Takes the mesh buffers and creates scenenodes for their associated shaders +*/ +void Q3ShaderFactory ( Q3LevelLoadParameter &loadParam, + IrrlichtDevice *device, + IQ3LevelMesh* mesh, + eQ3MeshIndex meshIndex, + ISceneNode *parent, + IMetaTriangleSelector *meta, + bool showShaderName + ); + + +/*! + Creates Model based on the entity list +*/ +void Q3ModelFactory ( Q3LevelLoadParameter &loadParam, + IrrlichtDevice *device, + IQ3LevelMesh* masterMesh, + ISceneNode *parent, + bool showShaderName + ); + +/*! + so we need a good starting Position in the level. + we can ask the Quake3 Loader for all entities with class_name "info_player_deathmatch" +*/ +s32 Q3StartPosition ( IQ3LevelMesh* mesh, + ICameraSceneNode* camera, + s32 startposIndex, + const vector3df &translation + ); +/*! + gets a accumulated force on a given surface +*/ +vector3df getGravity ( const c8 * surface ); + + +/* + Dynamically load the Irrlicht Library +*/ +funcptr_createDevice load_createDevice ( const c8 * filename); +funcptr_createDeviceEx load_createDeviceEx ( const c8 * filename); + + +//! Macro for save Dropping an Element +#define dropElement(x) if (x) { x->remove(); x = 0; } + + +/* + get the current collision respone camera animator +*/ +ISceneNodeAnimatorCollisionResponse* camCollisionResponse( IrrlichtDevice * device ); + +//! internal Animation +enum eTimeFireFlag +{ + FIRED = 1, +}; + +struct TimeFire +{ + u32 flags; + u32 next; + u32 delta; +}; + +void setTimeFire ( TimeFire *t, u32 delta, u32 flags = 0 ); +void checkTimeFire ( TimeFire *t, u32 listSize, u32 now ); + +#endif // __QUAKE3_FACTORY__H_INCLUDED__ + + diff --git a/libraries/irrlicht-1.8.1/examples/21.Quake3Explorer/sound.cpp b/libraries/irrlicht-1.8.1/examples/21.Quake3Explorer/sound.cpp new file mode 100644 index 0000000..75615c1 --- /dev/null +++ b/libraries/irrlicht-1.8.1/examples/21.Quake3Explorer/sound.cpp @@ -0,0 +1,98 @@ +/*! + Sound Factory. + provides a sound interface + +*/ + +#include "sound.h" + + +//#define USE_IRRKLANG + +#ifdef USE_IRRKLANG + +#include +#ifdef _IRR_WINDOWS_ + #pragma comment (lib, "irrKlang.lib") +#endif + +using namespace irrklang; + +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 (); } + io::IReadFile* file; +}; + +struct klangFactory : public irrklang::IFileFactory +{ + klangFactory ( IrrlichtDevice *device ) { Device = device; } + + virtual irrklang::IFileReader* createFileReader(const ik_c8* filename) + { + io::IReadFile* file = Device->getFileSystem()->createAndOpenFile(filename); + if ( 0 == file ) + return 0; + + return new soundfile ( file ); + } + + IrrlichtDevice *Device; +}; + +ISoundEngine *engine = 0; +ISound *backMusic = 0; + +void sound_init ( IrrlichtDevice *device ) +{ + engine = createIrrKlangDevice (); + if ( 0 == engine ) + return; + + klangFactory *f = new klangFactory ( device ); + engine->addFileFactory ( f ); +} + +void sound_shutdown () +{ + if ( backMusic ) + backMusic->drop (); + + if ( engine ) + engine->drop (); +} + +void background_music ( const c8 * file ) +{ + if ( 0 == engine ) + return; + + if ( backMusic ) + { + backMusic->stop (); + backMusic->drop (); + } + + backMusic = engine->play2D ( file, true, false, true ); + + if ( backMusic ) + { + backMusic->setVolume ( 0.5f ); + } +} + +#else + +void sound_init ( IrrlichtDevice *device ) {} +void sound_shutdown () {} +void background_music ( const c8 * file ) {} + +#endif + diff --git a/libraries/irrlicht-1.8.1/examples/21.Quake3Explorer/sound.h b/libraries/irrlicht-1.8.1/examples/21.Quake3Explorer/sound.h new file mode 100644 index 0000000..033e9bb --- /dev/null +++ b/libraries/irrlicht-1.8.1/examples/21.Quake3Explorer/sound.h @@ -0,0 +1,18 @@ +/*! + Sound Factory. + provides a sound interface + +*/ +#ifndef __QUAKE3_SOUND__H_INCLUDED__ +#define __QUAKE3_SOUND__H_INCLUDED__ + +#include + +using namespace irr; + +void sound_init ( IrrlichtDevice *device ); +void sound_shutdown (); +void background_music ( const c8 * file ); + + +#endif // __QUAKE3_SOUND__H_INCLUDED__ diff --git a/libraries/irrlicht-1.8.1/examples/22.MaterialViewer/Makefile b/libraries/irrlicht-1.8.1/examples/22.MaterialViewer/Makefile new file mode 100644 index 0000000..8016988 --- /dev/null +++ b/libraries/irrlicht-1.8.1/examples/22.MaterialViewer/Makefile @@ -0,0 +1,38 @@ +# Makefile for Irrlicht Examples +# It's usually sufficient to change just the target name and source file list +# and be sure that CXX is set to a valid compiler +Target = 22.MaterialViewer +Sources = main.cpp + +# general compiler settings +CPPFLAGS = -I../../include -I/usr/X11R6/include +#CXXFLAGS = -O3 -ffast-math +CXXFLAGS = -g -Wall + +#default target is Linux +all: all_linux + +ifeq ($(HOSTTYPE), x86_64) +LIBSELECT=64 +endif + +# target specific settings +all_linux: LDFLAGS = -L/usr/X11R6/lib$(LIBSELECT) -L../../lib/Linux -lIrrlicht -lGL -lXxf86vm -lXext -lX11 -lXcursor +all_linux clean_linux: SYSTEM=Linux +all_win32: LDFLAGS = -L../../lib/Win32-gcc -lIrrlicht -lopengl32 -lm +all_win32 clean_win32: SYSTEM=Win32-gcc +all_win32 clean_win32: SUF=.exe +# name of the binary - only valid for targets which set SYSTEM +DESTPATH = ../../bin/$(SYSTEM)/$(Target)$(SUF) + +all_linux all_win32: + $(warning Building...) + $(CXX) $(CPPFLAGS) $(CXXFLAGS) $(Sources) -o $(DESTPATH) $(LDFLAGS) + +clean: clean_linux clean_win32 + $(warning Cleaning...) + +clean_linux clean_win32: + @$(RM) $(DESTPATH) + +.PHONY: all all_win32 clean clean_linux clean_win32 diff --git a/libraries/irrlicht-1.8.1/examples/22.MaterialViewer/MaterialViewer.cbp b/libraries/irrlicht-1.8.1/examples/22.MaterialViewer/MaterialViewer.cbp new file mode 100644 index 0000000..3626d10 --- /dev/null +++ b/libraries/irrlicht-1.8.1/examples/22.MaterialViewer/MaterialViewer.cbp @@ -0,0 +1,55 @@ + + + + + + diff --git a/libraries/irrlicht-1.8.1/examples/22.MaterialViewer/MaterialViewer.dev b/libraries/irrlicht-1.8.1/examples/22.MaterialViewer/MaterialViewer.dev new file mode 100644 index 0000000..dfd9d4d --- /dev/null +++ b/libraries/irrlicht-1.8.1/examples/22.MaterialViewer/MaterialViewer.dev @@ -0,0 +1,59 @@ +[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/libraries/irrlicht-1.8.1/examples/22.MaterialViewer/MaterialViewer.vcproj b/libraries/irrlicht-1.8.1/examples/22.MaterialViewer/MaterialViewer.vcproj new file mode 100644 index 0000000..7419359 --- /dev/null +++ b/libraries/irrlicht-1.8.1/examples/22.MaterialViewer/MaterialViewer.vcproj @@ -0,0 +1,229 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/libraries/irrlicht-1.8.1/examples/22.MaterialViewer/MaterialViewer_vc10.vcxproj b/libraries/irrlicht-1.8.1/examples/22.MaterialViewer/MaterialViewer_vc10.vcxproj new file mode 100644 index 0000000..6a8b5c8 --- /dev/null +++ b/libraries/irrlicht-1.8.1/examples/22.MaterialViewer/MaterialViewer_vc10.vcxproj @@ -0,0 +1,231 @@ + + + + + Debug + Win32 + + + Debug + x64 + + + Release + Win32 + + + Release + x64 + + + + 22.MaterialViewer + {4E6C2F8D-BA92-4C5B-96FD-72D4FE8BD7FA} + MaterialViewer + + + + Application + MultiByte + + + Application + MultiByte + + + Application + MultiByte + + + Application + MultiByte + + + + + + + + + + + + + + + + + + + + + + + <_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/libraries/irrlicht-1.8.1/examples/22.MaterialViewer/MaterialViewer_vc11.vcxproj b/libraries/irrlicht-1.8.1/examples/22.MaterialViewer/MaterialViewer_vc11.vcxproj new file mode 100644 index 0000000..6ea9a2b --- /dev/null +++ b/libraries/irrlicht-1.8.1/examples/22.MaterialViewer/MaterialViewer_vc11.vcxproj @@ -0,0 +1,235 @@ + + + + + Debug + Win32 + + + Debug + x64 + + + Release + Win32 + + + Release + x64 + + + + 22.MaterialViewer + {4E6C2F8D-BA92-4C5B-96FD-72D4FE8BD7FA} + MaterialViewer + + + + Application + MultiByte + v110 + + + Application + MultiByte + v110 + + + Application + MultiByte + v110 + + + Application + MultiByte + v110 + + + + + + + + + + + + + + + + + + + + + + + <_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/libraries/irrlicht-1.8.1/examples/22.MaterialViewer/MaterialViewer_vc8.vcproj b/libraries/irrlicht-1.8.1/examples/22.MaterialViewer/MaterialViewer_vc8.vcproj new file mode 100644 index 0000000..1e7c0db --- /dev/null +++ b/libraries/irrlicht-1.8.1/examples/22.MaterialViewer/MaterialViewer_vc8.vcproj @@ -0,0 +1,231 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/libraries/irrlicht-1.8.1/examples/22.MaterialViewer/MaterialViewer_vc9.vcproj b/libraries/irrlicht-1.8.1/examples/22.MaterialViewer/MaterialViewer_vc9.vcproj new file mode 100644 index 0000000..8ce9803 --- /dev/null +++ b/libraries/irrlicht-1.8.1/examples/22.MaterialViewer/MaterialViewer_vc9.vcproj @@ -0,0 +1,230 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/libraries/irrlicht-1.8.1/examples/22.MaterialViewer/main.cpp b/libraries/irrlicht-1.8.1/examples/22.MaterialViewer/main.cpp new file mode 100644 index 0000000..5dcab19 --- /dev/null +++ b/libraries/irrlicht-1.8.1/examples/22.MaterialViewer/main.cpp @@ -0,0 +1,1057 @@ +/** Example 022 Material Viewer + +This example can be used to play around with material settings and watch the results. +Only the default non-shader materials are used in here. + +You have two nodes to make it easier to see which difference your settings will make. +Additionally you have one lightscenenode and you can set the global ambient values. +*/ + +#include +#include "driverChoice.h" + +using namespace irr; + +#ifdef _MSC_VER +#pragma comment(lib, "Irrlicht.lib") +#endif + +/* + Variables within the empty namespace are globals which are restricted to this file. +*/ +namespace +{ + const wchar_t* const DriverTypeNames[] = + { + L"NULL", + L"SOFTWARE", + L"BURNINGSVIDEO", + L"DIRECT3D8", + L"DIRECT3D9", + L"OPENGL", + 0, + }; + + // For the gui id's + enum EGUI_IDS + { + GUI_ID_OPEN_TEXTURE = 1, + GUI_ID_QUIT, + GUI_ID_MAX + }; + + // Name used in texture selection to clear the textures on the node + const core::stringw CLEAR_TEXTURE = L"CLEAR texture"; + + // some useful color constants + const video::SColor SCOL_BLACK = video::SColor(255, 0, 0, 0); + const video::SColor SCOL_BLUE = video::SColor(255, 0, 0, 255); + const video::SColor SCOL_CYAN = video::SColor(255, 0, 255, 255); + const video::SColor SCOL_GRAY = video::SColor(255, 128,128, 128); + const video::SColor SCOL_GREEN = video::SColor(255, 0, 255, 0); + const video::SColor SCOL_MAGENTA = video::SColor(255, 255, 0, 255); + const video::SColor SCOL_RED = video::SColor(255, 255, 0, 0); + const video::SColor SCOL_YELLOW = video::SColor(255, 255, 255, 0); + const video::SColor SCOL_WHITE = video::SColor(255, 255, 255, 255); +}; // namespace + +/* + Returns a new unique number on each call. +*/ +s32 makeUniqueId() +{ + static int unique = GUI_ID_MAX; + ++unique; + return unique; +} + +/* + Find out which vertex-type is needed for the given material type. +*/ +video::E_VERTEX_TYPE getVertexTypeForMaterialType(video::E_MATERIAL_TYPE materialType) +{ + using namespace video; + + switch ( materialType ) + { + case EMT_SOLID: + return EVT_STANDARD; + + case EMT_SOLID_2_LAYER: + return EVT_STANDARD; + + case EMT_LIGHTMAP: + case EMT_LIGHTMAP_ADD: + case EMT_LIGHTMAP_M2: + case EMT_LIGHTMAP_M4: + case EMT_LIGHTMAP_LIGHTING: + case EMT_LIGHTMAP_LIGHTING_M2: + case EMT_LIGHTMAP_LIGHTING_M4: + return EVT_2TCOORDS; + + case EMT_DETAIL_MAP: + return EVT_2TCOORDS; + + case EMT_SPHERE_MAP: + return EVT_STANDARD; + + case EMT_REFLECTION_2_LAYER: + return EVT_2TCOORDS; + + case EMT_TRANSPARENT_ADD_COLOR: + return EVT_STANDARD; + + case EMT_TRANSPARENT_ALPHA_CHANNEL: + return EVT_STANDARD; + + case EMT_TRANSPARENT_ALPHA_CHANNEL_REF: + return EVT_STANDARD; + + case EMT_TRANSPARENT_VERTEX_ALPHA: + return EVT_STANDARD; + + case EMT_TRANSPARENT_REFLECTION_2_LAYER: + return EVT_2TCOORDS; + + case EMT_NORMAL_MAP_SOLID: + case EMT_NORMAL_MAP_TRANSPARENT_ADD_COLOR: + case EMT_NORMAL_MAP_TRANSPARENT_VERTEX_ALPHA: + case EMT_PARALLAX_MAP_SOLID: + case EMT_PARALLAX_MAP_TRANSPARENT_ADD_COLOR: + case EMT_PARALLAX_MAP_TRANSPARENT_VERTEX_ALPHA: + return EVT_TANGENTS; + + case EMT_ONETEXTURE_BLEND: + return EVT_STANDARD; + + case EMT_FORCE_32BIT: + return EVT_STANDARD; + } + return EVT_STANDARD; +} + +/* + Custom GUI-control to edit colorvalues. +*/ +class CColorControl : public gui::IGUIElement +{ +public: + // Constructor + CColorControl(gui::IGUIEnvironment* guiEnv, const core::position2d & pos, const wchar_t *text, IGUIElement* parent, s32 id=-1 ) + : gui::IGUIElement(gui::EGUIET_ELEMENT, guiEnv, parent,id, core::rect< s32 >(pos, pos+core::dimension2d(80, 75))) + , DirtyFlag(true) + , ColorStatic(0) + , EditAlpha(0) + , EditRed(0) + , EditGreen(0) + , EditBlue(0) + { + using namespace gui; + ButtonSetId = makeUniqueId(); + + const core::rect< s32 > rectControls(0,0,AbsoluteRect.getWidth(),AbsoluteRect.getHeight() ); + IGUIStaticText * groupElement = guiEnv->addStaticText (L"", rectControls, true, false, this, -1, false); + groupElement->setNotClipped(true); + + guiEnv->addStaticText (text, core::rect(0,0,80,15), false, false, groupElement, -1, false); + + EditAlpha = addEditForNumbers(guiEnv, core::position2d(0,15), L"a", -1, groupElement ); + EditRed = addEditForNumbers(guiEnv, core::position2d(0,30), L"r", -1, groupElement ); + EditGreen = addEditForNumbers(guiEnv, core::position2d(0,45), L"g", -1, groupElement ); + EditBlue = addEditForNumbers(guiEnv, core::position2d(0,60), L"b", -1, groupElement ); + + ColorStatic = guiEnv->addStaticText (L"", core::rect(60,15,80,75), true, false, groupElement, -1, true); + + guiEnv->addButton (core::rect(60,35,80,50), groupElement, ButtonSetId, L"set"); + SetEditsFromColor(Color); + } + + // event receiver + virtual bool OnEvent(const SEvent &event) + { + if ( event.EventType != EET_GUI_EVENT ) + return false; + + if ( event.GUIEvent.Caller->getID() == ButtonSetId && event.GUIEvent.EventType == gui::EGET_BUTTON_CLICKED ) + { + Color = GetColorFromEdits(); + SetEditsFromColor(Color); + } + + return false; + } + + // set the color values + void setColor(const video::SColor& col) + { + DirtyFlag = true; + Color = col; + SetEditsFromColor(Color); + } + + // get the color values + const video::SColor& getColor() const + { + return Color; + } + + // To reset the dirty flag + void resetDirty() + { + DirtyFlag = false; + } + + // when the color was changed the dirty flag is set + bool isDirty() const + { + return DirtyFlag; + }; + +protected: + + // Add a staticbox for a description + an editbox so users can enter numbers + gui::IGUIEditBox* addEditForNumbers(gui::IGUIEnvironment* guiEnv, const core::position2d & pos, const wchar_t *text, s32 id, gui::IGUIElement * parent) + { + using namespace gui; + + core::rect< s32 > rect(pos, pos+core::dimension2d(10, 15)); + guiEnv->addStaticText (text, rect, false, false, parent, -1, false); + rect += core::position2d( 20, 0 ); + rect.LowerRightCorner.X += 20; + gui::IGUIEditBox* edit = guiEnv->addEditBox(L"0", rect, true, parent, id); + return edit; + } + + // Get the color value from the editfields + video::SColor GetColorFromEdits() + { + video::SColor col; + + if (EditAlpha) + { + u32 alpha = core::strtoul10(core::stringc(EditAlpha->getText()).c_str()); + if (alpha > 255) + alpha = 255; + col.setAlpha(alpha); + } + + if (EditRed) + { + u32 red = core::strtoul10(core::stringc(EditRed->getText()).c_str()); + if (red > 255) + red = 255; + col.setRed(red); + } + + if (EditGreen) + { + u32 green = core::strtoul10(core::stringc(EditGreen->getText()).c_str()); + if (green > 255) + green = 255; + col.setGreen(green); + } + + if (EditBlue) + { + u32 blue = core::strtoul10(core::stringc(EditBlue->getText()).c_str()); + if (blue > 255) + blue = 255; + col.setBlue(blue); + } + + return col; + } + + // Fill the editfields with the value for the given color + void SetEditsFromColor(video::SColor col) + { + DirtyFlag = true; + if ( EditAlpha ) + EditAlpha->setText( core::stringw(col.getAlpha()).c_str() ); + if ( EditRed ) + EditRed->setText( core::stringw(col.getRed()).c_str() ); + if ( EditGreen ) + EditGreen->setText( core::stringw(col.getGreen()).c_str() ); + if ( EditBlue ) + EditBlue->setText( core::stringw(col.getBlue()).c_str() ); + if ( ColorStatic ) + ColorStatic->setBackgroundColor(col); + } + +private: + + bool DirtyFlag; + video::SColor Color; + s32 ButtonSetId; + gui::IGUIStaticText * ColorStatic; + gui::IGUIEditBox * EditAlpha; + gui::IGUIEditBox * EditRed; + gui::IGUIEditBox * EditGreen; + gui::IGUIEditBox * EditBlue; +}; + +/* + Custom GUI-control for to edit all colors typically used in materials and lights +*/ +class CAllColorsControl : public gui::IGUIElement +{ +public: + // Constructor + CAllColorsControl(gui::IGUIEnvironment* guiEnv, const core::position2d & pos, const wchar_t * description, bool hasEmissive, IGUIElement* parent, s32 id=-1) + : gui::IGUIElement(gui::EGUIET_ELEMENT, guiEnv, parent,id, core::rect(pos,pos+core::dimension2d(60,250))) + , ControlAmbientColor(0), ControlDiffuseColor(0), ControlSpecularColor(0), ControlEmissiveColor(0) + { + core::rect rect(0, 0, 60, 15); + guiEnv->addStaticText (description, rect, false, false, this, -1, false); + createColorControls(guiEnv, core::position2d(0, 15), hasEmissive); + } + + // Destructor + virtual ~CAllColorsControl() + { + ControlAmbientColor->drop(); + ControlDiffuseColor->drop(); + if ( ControlEmissiveColor ) + ControlEmissiveColor->drop(); + ControlSpecularColor->drop(); + } + + // Set the color values to those within the material + void setColorsToMaterialColors(const video::SMaterial & material) + { + ControlAmbientColor->setColor(material.AmbientColor); + ControlDiffuseColor->setColor(material.DiffuseColor); + ControlEmissiveColor->setColor(material.EmissiveColor); + ControlSpecularColor->setColor(material.SpecularColor); + } + + // Update all changed colors in the material + void updateMaterialColors(video::SMaterial & material) + { + if ( ControlAmbientColor->isDirty() ) + material.AmbientColor = ControlAmbientColor->getColor(); + if ( ControlDiffuseColor->isDirty() ) + material.DiffuseColor = ControlDiffuseColor->getColor(); + if ( ControlEmissiveColor->isDirty() ) + material.EmissiveColor = ControlEmissiveColor->getColor(); + if ( ControlSpecularColor->isDirty() ) + material.SpecularColor = ControlSpecularColor->getColor(); + } + + // Set the color values to those from the light data + void setColorsToLightDataColors(const video::SLight & lightData) + { + ControlAmbientColor->setColor(lightData.AmbientColor.toSColor()); + ControlAmbientColor->setColor(lightData.DiffuseColor.toSColor()); + ControlAmbientColor->setColor(lightData.SpecularColor.toSColor()); + } + + // Update all changed colors in the light data + void updateLightColors(video::SLight & lightData) + { + if ( ControlAmbientColor->isDirty() ) + lightData.AmbientColor = video::SColorf( ControlAmbientColor->getColor() ); + if ( ControlDiffuseColor->isDirty() ) + lightData.DiffuseColor = video::SColorf( ControlDiffuseColor->getColor() ); + if ( ControlSpecularColor->isDirty() ) + lightData.SpecularColor = video::SColorf(ControlSpecularColor->getColor() ); + } + + // To reset the dirty flags + void resetDirty() + { + ControlAmbientColor->resetDirty(); + ControlDiffuseColor->resetDirty(); + ControlSpecularColor->resetDirty(); + if ( ControlEmissiveColor ) + ControlEmissiveColor->resetDirty(); + } + +protected: + void createColorControls(gui::IGUIEnvironment* guiEnv, const core::position2d & pos, bool hasEmissive) + { + ControlAmbientColor = new CColorControl( guiEnv, pos, L"ambient", this); + ControlDiffuseColor = new CColorControl( guiEnv, pos + core::position2d(0, 75), L"diffuse", this ); + ControlSpecularColor = new CColorControl( guiEnv, pos + core::position2d(0, 150), L"specular", this ); + if ( hasEmissive ) + { + ControlEmissiveColor = new CColorControl( guiEnv, pos + core::position2d(0, 225), L"emissive", this ); + } + } + +private: + CColorControl* ControlAmbientColor; + CColorControl* ControlDiffuseColor; + CColorControl* ControlSpecularColor; + CColorControl* ControlEmissiveColor; +}; + +/* + GUI-Control to offer a selection of available textures. +*/ +class CTextureControl : public gui::IGUIElement +{ +public: + CTextureControl(gui::IGUIEnvironment* guiEnv, video::IVideoDriver * driver, const core::position2d & pos, IGUIElement* parent, s32 id=-1) + : gui::IGUIElement(gui::EGUIET_ELEMENT, guiEnv, parent,id, core::rect(pos,pos+core::dimension2d(100,15))) + , DirtyFlag(true), ComboTexture(0) + { + core::rect rectCombo(0, 0, AbsoluteRect.getWidth(),AbsoluteRect.getHeight()); + ComboTexture = guiEnv->addComboBox (rectCombo, this); + updateTextures(driver); + } + + virtual bool OnEvent(const SEvent &event) + { + if ( event.EventType != EET_GUI_EVENT ) + return false; + + if ( event.GUIEvent.Caller == ComboTexture && event.GUIEvent.EventType == gui::EGET_COMBO_BOX_CHANGED ) + { + DirtyFlag = true; + } + + return false; + } + + // Workaround for a problem with comboboxes. + // We have to get in front when the combobox wants to get in front or combobox-list might be drawn below other elements. + virtual bool bringToFront(IGUIElement* element) + { + bool result = gui::IGUIElement::bringToFront(element); + if ( Parent && element == ComboTexture ) + result &= Parent->bringToFront(this); + return result; + } + + // return selected texturename (if any, otherwise 0) + const wchar_t * getSelectedTextureName() const + { + s32 selected = ComboTexture->getSelected(); + if ( selected < 0 ) + return 0; + return ComboTexture->getItem(selected); + } + + // reset the dirty flag + void resetDirty() + { + DirtyFlag = false; + } + + // when the texture was changed the dirty flag is set + bool isDirty() const + { + return DirtyFlag; + }; + + // Put the names of all currently loaded textures in a combobox + void updateTextures(video::IVideoDriver * driver) + { + s32 oldSelected = ComboTexture->getSelected(); + s32 selectNew = -1; + const wchar_t * oldTextureName = 0; + if ( oldSelected >= 0 ) + { + oldTextureName = ComboTexture->getItem(oldSelected); + } + ComboTexture->clear(); + for ( u32 i=0; i < driver->getTextureCount(); ++i ) + { + video::ITexture * texture = driver->getTextureByIndex(i); + core::stringw name( texture->getName() ); + ComboTexture->addItem( name.c_str() ); + if ( oldTextureName && selectNew < 0 && name == oldTextureName ) + selectNew = i; + } + + // add another name which can be used to clear the texture + ComboTexture->addItem( CLEAR_TEXTURE.c_str() ); + if ( CLEAR_TEXTURE == oldTextureName ) + selectNew = ComboTexture->getItemCount()-1; + + if ( selectNew >= 0 ) + ComboTexture->setSelected(selectNew); + + DirtyFlag = true; + } + +private: + bool DirtyFlag; + gui::IGUIComboBox * ComboTexture; +}; + +/* + Control which allows setting some of the material values for a meshscenenode +*/ +struct SMeshNodeControl +{ + // constructor + SMeshNodeControl() + : Initialized(false), Driver(0), MeshManipulator(0), SceneNode(0), SceneNode2T(0), SceneNodeTangents(0) + , AllColorsControl(0), ButtonLighting(0), InfoLighting(0), ComboMaterial(0), TextureControl1(0), TextureControl2(0), ControlVertexColors(0) + { + } + + // Destructor + virtual ~SMeshNodeControl() + { + if ( TextureControl1 ) + TextureControl1->drop(); + if ( TextureControl2 ) + TextureControl2->drop(); + if ( ControlVertexColors ) + ControlVertexColors->drop(); + if ( AllColorsControl ) + AllColorsControl->drop(); + } + + void init(scene::IMeshSceneNode* node, IrrlichtDevice * device, const core::position2d & pos, const wchar_t * description) + { + if ( Initialized || !node || !device) // initializing twice or with invalid data not allowed + return; + + Driver = device->getVideoDriver (); + gui::IGUIEnvironment* guiEnv = device->getGUIEnvironment(); + scene::ISceneManager* smgr = device->getSceneManager(); + MeshManipulator = smgr->getMeshManipulator(); + + SceneNode = node; + scene::IMeshManipulator * meshManip = smgr->getMeshManipulator(); + + scene::IMesh * mesh2T = meshManip->createMeshWith2TCoords(node->getMesh()); + SceneNode2T = smgr->addMeshSceneNode(mesh2T, 0, -1, SceneNode->getPosition(), SceneNode->getRotation(), SceneNode->getScale() ); + mesh2T->drop(); + + scene::IMesh * meshTangents = meshManip->createMeshWithTangents(node->getMesh(), false, false, false); + SceneNodeTangents = smgr->addMeshSceneNode(meshTangents, 0, -1 + , SceneNode->getPosition(), SceneNode->getRotation(), SceneNode->getScale() ); + meshTangents->drop(); + + video::SMaterial & material = SceneNode->getMaterial(0); + material.Lighting = true; + AllColorsControl = new CAllColorsControl(guiEnv, pos, description, true, guiEnv->getRootGUIElement()); + AllColorsControl->setColorsToMaterialColors(material); + + core::rect rectBtn(pos + core::position2d(0, 320), core::dimension2d(60, 15)); + ButtonLighting = guiEnv->addButton (rectBtn, 0, -1, L"Lighting"); + ButtonLighting->setIsPushButton(true); + ButtonLighting->setPressed(material.Lighting); + core::rect rectInfo( rectBtn.LowerRightCorner.X, rectBtn.UpperLeftCorner.Y, rectBtn.LowerRightCorner.X+40, rectBtn.UpperLeftCorner.Y+15 ); + InfoLighting = guiEnv->addStaticText(L"", rectInfo, true, false ); + InfoLighting->setTextAlignment(gui::EGUIA_CENTER, gui::EGUIA_CENTER ); + + core::rect rectCombo(pos.X, rectBtn.LowerRightCorner.Y, pos.X+100, rectBtn.LowerRightCorner.Y+15); + ComboMaterial = guiEnv->addComboBox (rectCombo); + for ( int i=0; i <= (int)video::EMT_ONETEXTURE_BLEND; ++i ) + { + ComboMaterial->addItem( core::stringw(video::sBuiltInMaterialTypeNames[i]).c_str() ); + } + ComboMaterial->setSelected( (s32)material.MaterialType ); + + core::position2d posTex(rectCombo.UpperLeftCorner.X,rectCombo.LowerRightCorner.Y); + TextureControl1 = new CTextureControl(guiEnv, Driver, posTex, guiEnv->getRootGUIElement()); + posTex.Y += 15; + TextureControl2 = new CTextureControl(guiEnv, Driver, posTex, guiEnv->getRootGUIElement()); + + core::position2d posVertexColors( posTex.X, posTex.Y + 15); + ControlVertexColors = new CColorControl( guiEnv, posVertexColors, L"Vertex colors", guiEnv->getRootGUIElement()); + + video::S3DVertex * vertices = (video::S3DVertex *)node->getMesh()->getMeshBuffer(0)->getVertices(); + if ( vertices ) + { + ControlVertexColors->setColor(vertices[0].Color); + } + + Initialized = true; + } + + void update() + { + if ( !Initialized ) + return; + + video::SMaterial & material = SceneNode->getMaterial(0); + video::SMaterial & material2T = SceneNode2T->getMaterial(0); + video::SMaterial & materialTangents = SceneNodeTangents->getMaterial(0); + + s32 selectedMaterial = ComboMaterial->getSelected(); + if ( selectedMaterial >= (s32)video::EMT_SOLID && selectedMaterial <= (s32)video::EMT_ONETEXTURE_BLEND) + { + video::E_VERTEX_TYPE vertexType = getVertexTypeForMaterialType((video::E_MATERIAL_TYPE)selectedMaterial); + switch ( vertexType ) + { + case video::EVT_STANDARD: + material.MaterialType = (video::E_MATERIAL_TYPE)selectedMaterial; + SceneNode->setVisible(true); + SceneNode2T->setVisible(false); + SceneNodeTangents->setVisible(false); + break; + case video::EVT_2TCOORDS: + material2T.MaterialType = (video::E_MATERIAL_TYPE)selectedMaterial; + SceneNode->setVisible(false); + SceneNode2T->setVisible(true); + SceneNodeTangents->setVisible(false); + break; + case video::EVT_TANGENTS: + materialTangents.MaterialType = (video::E_MATERIAL_TYPE)selectedMaterial; + SceneNode->setVisible(false); + SceneNode2T->setVisible(false); + SceneNodeTangents->setVisible(true); + break; + } + } + + updateMaterial(material); + updateMaterial(material2T); + updateMaterial(materialTangents); + + if ( ButtonLighting->isPressed() ) + InfoLighting->setText(L"on"); + else + InfoLighting->setText(L"off"); + + AllColorsControl->resetDirty(); + TextureControl1->resetDirty(); + TextureControl2->resetDirty(); + ControlVertexColors->resetDirty(); + } + + void updateTextures() + { + TextureControl1->updateTextures(Driver); + TextureControl2->updateTextures(Driver); + } + +protected: + + void updateMaterial(video::SMaterial & material) + { + AllColorsControl->updateMaterialColors(material); + material.Lighting = ButtonLighting->isPressed(); + if ( TextureControl1->isDirty() ) + { + material.TextureLayer[0].Texture = Driver->getTexture( io::path(TextureControl1->getSelectedTextureName()) ); + } + if ( TextureControl2->isDirty() ) + { + material.TextureLayer[1].Texture = Driver->getTexture( io::path(TextureControl2->getSelectedTextureName()) ); + } + if ( ControlVertexColors->isDirty() ) + { + MeshManipulator->setVertexColors (SceneNode->getMesh(), ControlVertexColors->getColor()); + MeshManipulator->setVertexColors (SceneNode2T->getMesh(), ControlVertexColors->getColor()); + MeshManipulator->setVertexColors (SceneNodeTangents->getMesh(), ControlVertexColors->getColor()); + } + } + + bool Initialized; + video::IVideoDriver * Driver; + scene::IMeshManipulator* MeshManipulator; + scene::IMeshSceneNode* SceneNode; + scene::IMeshSceneNode* SceneNode2T; + scene::IMeshSceneNode* SceneNodeTangents; + CAllColorsControl* AllColorsControl; + gui::IGUIButton * ButtonLighting; + gui::IGUIStaticText* InfoLighting; + gui::IGUIComboBox * ComboMaterial; + CTextureControl* TextureControl1; + CTextureControl* TextureControl2; + CColorControl* ControlVertexColors; +}; + +/* + Control to allow setting the color values of a lightscenenode. +*/ +struct SLightNodeControl +{ + // constructor + SLightNodeControl() : Initialized(false), SceneNode(0), AllColorsControl(0) + { + } + + virtual ~SLightNodeControl() + { + if ( AllColorsControl ) + AllColorsControl->drop(); + } + + void init(scene::ILightSceneNode* node, gui::IGUIEnvironment* guiEnv, const core::position2d & pos, const wchar_t * description) + { + if ( Initialized || !node || !guiEnv) // initializing twice or with invalid data not allowed + return; + SceneNode = node; + AllColorsControl = new CAllColorsControl(guiEnv, pos, description, false, guiEnv->getRootGUIElement()); + const video::SLight & lightData = SceneNode->getLightData(); + AllColorsControl->setColorsToLightDataColors(lightData); + Initialized = true; + } + + void update() + { + if ( !Initialized ) + return; + + video::SLight & lightData = SceneNode->getLightData(); + AllColorsControl->updateLightColors(lightData); + } + +protected: + bool Initialized; + scene::ILightSceneNode* SceneNode; + CAllColorsControl* AllColorsControl; +}; + +/* + Application configuration +*/ +struct SConfig +{ + SConfig() + : RenderInBackground(true) + , DriverType(video::EDT_BURNINGSVIDEO) + , ScreenSize(640, 480) + { + } + + bool RenderInBackground; + video::E_DRIVER_TYPE DriverType; + core::dimension2d ScreenSize; +}; + +/* + Main application class +*/ +class CApp : public IEventReceiver +{ + friend int main(int argc, char *argv[]); + +public: + // constructor + CApp() + : IsRunning(false) + , Device(0) + , Camera(0) + , GlobalAmbient(0) + { + } + + // destructor + ~CApp() + { + } + + // stop running - will quit at end of mainloop + void stopApp() + { + IsRunning = false; + } + + // Event handler + virtual bool OnEvent(const SEvent &event) + { + if (event.EventType == EET_GUI_EVENT) + { + gui::IGUIEnvironment* env = Device->getGUIEnvironment(); + + switch(event.GUIEvent.EventType) + { + case gui::EGET_MENU_ITEM_SELECTED: + { + gui::IGUIContextMenu* menu = (gui::IGUIContextMenu*)event.GUIEvent.Caller; + s32 id = menu->getItemCommandId(menu->getSelectedItem()); + + switch(id) + { + case GUI_ID_OPEN_TEXTURE: // File -> Open Texture + env->addFileOpenDialog(L"Please select a texture file to open"); + break; + case GUI_ID_QUIT: // File -> Quit + stopApp(); + break; + } + } + break; + + case gui::EGET_FILE_SELECTED: + { + // load the model file, selected in the file open dialog + gui::IGUIFileOpenDialog* dialog = + (gui::IGUIFileOpenDialog*)event.GUIEvent.Caller; + loadTexture(io::path(dialog->getFileName()).c_str()); + } + break; + + default: + break; + } + } + + return false; + } + +protected: + + // Application initialization + // returns true when it was successful initialized, otherwise false. + bool init(int argc, char *argv[]) + { + // ask user for driver + Config.DriverType=driverChoiceConsole(); + if (Config.DriverType==video::EDT_COUNT) + return false; + + // create the device with the settings from our config + Device = createDevice(Config.DriverType, Config.ScreenSize); + if (!Device) + return false; + Device->setWindowCaption( DriverTypeNames[Config.DriverType] ); + Device->setEventReceiver(this); + + scene::ISceneManager* smgr = Device->getSceneManager(); + video::IVideoDriver * driver = Device->getVideoDriver (); + gui::IGUIEnvironment* guiEnv = Device->getGUIEnvironment(); + + // set a nicer font + gui::IGUISkin* skin = guiEnv->getSkin(); + gui::IGUIFont* font = guiEnv->getFont("../../media/fonthaettenschweiler.bmp"); + if (font) + skin->setFont(font); + + // remove some alpha value because it makes those menus harder to read otherwise + video::SColor col3dHighLight( skin->getColor(gui::EGDC_APP_WORKSPACE) ); + col3dHighLight.setAlpha(255); + video::SColor colHighLight( col3dHighLight ); + skin->setColor(gui::EGDC_HIGH_LIGHT, colHighLight ); + skin->setColor(gui::EGDC_3D_HIGH_LIGHT, col3dHighLight ); + + // Add some textures which are useful to test material settings + createDefaultTextures(driver); + + // create a menu + gui::IGUIContextMenu * menuBar = guiEnv->addMenu(); + menuBar->addItem(L"File", -1, true, true); + + gui::IGUIContextMenu* subMenuFile = menuBar->getSubMenu(0); + subMenuFile->addItem(L"Open texture ...", GUI_ID_OPEN_TEXTURE); + subMenuFile->addSeparator(); + subMenuFile->addItem(L"Quit", GUI_ID_QUIT); + + // a static camera + Camera = smgr->addCameraSceneNode (0, core::vector3df(0, 0, 0), + core::vector3df(0, 0, 100), + -1); + + // add the nodes which are used to show the materials + scene::IMeshSceneNode* nodeL = smgr->addCubeSceneNode (30.0f, 0, -1, + core::vector3df(-35, 0, 100), + core::vector3df(0, 0, 0), + core::vector3df(1.0f, 1.0f, 1.0f)); + NodeLeft.init( nodeL, Device, core::position2d(10,20), L"left node" ); + + scene::IMeshSceneNode* nodeR = smgr->addCubeSceneNode (30.0f, 0, -1, + core::vector3df(35, 0, 100), + core::vector3df(0, 0, 0), + core::vector3df(1.0f, 1.0f, 1.0f)); + NodeRight.init( nodeR, Device, core::position2d(530,20), L"right node" ); + + // add one light + scene::ILightSceneNode* nodeLight = smgr->addLightSceneNode(0, core::vector3df(0, 0, 0), + video::SColorf(1.0f, 1.0f, 1.0f), + 100.0f); + LightControl.init(nodeLight, guiEnv, core::position2d(270,20), L"light" ); + + // one large cube around everything. That's mainly to make the light more obvious. + scene::IMeshSceneNode* backgroundCube = smgr->addCubeSceneNode (200.0f, 0, -1, core::vector3df(0, 0, 0), + core::vector3df(45, 0, 0), + core::vector3df(1.0f, 1.0f, 1.0f)); + backgroundCube->getMaterial(0).BackfaceCulling = false; // we are within the cube, so we have to disable backface culling to see it + backgroundCube->getMaterial(0).EmissiveColor.set(255,50,50,50); // we keep some self lighting to keep texts visible + + // set the ambient light value + GlobalAmbient = new CColorControl( guiEnv, core::position2d(270, 300), L"global ambient", guiEnv->getRootGUIElement()); + GlobalAmbient->setColor( smgr->getAmbientLight().toSColor() ); + + return true; + } + + // Update one frame + bool update() + { + using namespace irr; + + video::IVideoDriver* videoDriver = Device->getVideoDriver(); + if ( !Device->run() ) + return false; + + if ( Device->isWindowActive() || Config.RenderInBackground ) + { + gui::IGUIEnvironment* guiEnv = Device->getGUIEnvironment(); + scene::ISceneManager* smgr = Device->getSceneManager(); + gui::IGUISkin * skin = guiEnv->getSkin(); + + // update our controls + NodeLeft.update(); + NodeRight.update(); + LightControl.update(); + + // update ambient light settings + if ( GlobalAmbient->isDirty() ) + { + smgr->setAmbientLight( GlobalAmbient->getColor() ); + GlobalAmbient->resetDirty(); + } + + // draw everything + video::SColor bkColor( skin->getColor(gui::EGDC_APP_WORKSPACE) ); + videoDriver->beginScene(true, true, bkColor); + + smgr->drawAll(); + guiEnv->drawAll(); + + videoDriver->endScene(); + } + + return true; + } + + // Run the application. Our main loop. + void run() + { + IsRunning = true; + + if ( !Device ) + return; + + // main application loop + while(IsRunning) + { + if ( !update() ) + break; + + Device->sleep( 5 ); + } + } + + // Close down the application + void quit() + { + IsRunning = false; + GlobalAmbient->drop(); + GlobalAmbient = NULL; + if ( Device ) + { + Device->closeDevice(); + Device->drop(); + Device = NULL; + } + } + + // Create some useful textures. + // Note that the function put readability over speed, you shouldn't use setPixel at runtime but for initialization it's nice. + void createDefaultTextures(video::IVideoDriver * driver) + { + const u32 width = 256; + const u32 height = 256; + video::IImage * imageA8R8G8B8 = driver->createImage (video::ECF_A8R8G8B8, core::dimension2d(width, height)); + if ( !imageA8R8G8B8 ) + return; + const u32 pitch = imageA8R8G8B8->getPitch(); + + // some nice square-pattern with 9 typical colors + for ( u32 y = 0; y < height; ++ y ) + { + for ( u32 x = 0; x < pitch; ++x ) + { + if ( y < height/3 ) + { + if ( x < width/3 ) + imageA8R8G8B8->setPixel (x, y, SCOL_BLACK); + else if ( x < 2*width/3 ) + imageA8R8G8B8->setPixel (x, y, SCOL_BLUE); + else + imageA8R8G8B8->setPixel (x, y, SCOL_CYAN); + } + else if ( y < 2*height/3 ) + { + if ( x < width/3 ) + imageA8R8G8B8->setPixel (x, y, SCOL_GRAY); + else if ( x < 2*width/3 ) + imageA8R8G8B8->setPixel (x, y, SCOL_GREEN); + else + imageA8R8G8B8->setPixel (x, y, SCOL_MAGENTA); + } + else + { + if ( x < width/3 ) + imageA8R8G8B8->setPixel (x, y, SCOL_RED); + else if ( x < 2*width/3 ) + imageA8R8G8B8->setPixel (x, y, SCOL_YELLOW); + else + imageA8R8G8B8->setPixel (x, y, SCOL_WHITE); + } + } + } + driver->addTexture (io::path("CARO_A8R8G8B8"), imageA8R8G8B8); + + // all white + imageA8R8G8B8->fill(SCOL_WHITE); + driver->addTexture (io::path("WHITE_A8R8G8B8"), imageA8R8G8B8); + + // all black + imageA8R8G8B8->fill(SCOL_BLACK); + driver->addTexture (io::path("BLACK_A8R8G8B8"), imageA8R8G8B8); + + // gray-scale + for ( u32 y = 0; y < height; ++ y ) + { + for ( u32 x = 0; x < pitch; ++x ) + { + imageA8R8G8B8->setPixel (x, y, video::SColor(y, x,x,x) ); + } + } + driver->addTexture (io::path("GRAYSCALE_A8R8G8B8"), imageA8R8G8B8); + + imageA8R8G8B8->drop(); + } + + // Load a texture and make sure nodes know it when more textures are available. + void loadTexture(const io::path &name) + { + Device->getVideoDriver()->getTexture(name); + NodeLeft.updateTextures(); + NodeRight.updateTextures(); + } + +private: + SConfig Config; + volatile bool IsRunning; + IrrlichtDevice * Device; + scene::ICameraSceneNode * Camera; + SMeshNodeControl NodeLeft; + SMeshNodeControl NodeRight; + SLightNodeControl LightControl; + CColorControl * GlobalAmbient; +}; + +/* + A very short main as we do everything else in classes. +*/ +int main(int argc, char *argv[]) +{ + CApp APP; + + if ( !APP.init(argc, argv) ) + { + printf("init failed\n"); + return 1; + } + + APP.run(); + APP.quit(); + + return 0; +} + +/* +**/ diff --git a/libraries/irrlicht-1.8.1/examples/23.SMeshHandling/Makefile b/libraries/irrlicht-1.8.1/examples/23.SMeshHandling/Makefile new file mode 100644 index 0000000..eab5060 --- /dev/null +++ b/libraries/irrlicht-1.8.1/examples/23.SMeshHandling/Makefile @@ -0,0 +1,38 @@ +# Makefile for Irrlicht Examples +# It's usually sufficient to change just the target name and source file list +# and be sure that CXX is set to a valid compiler +Target = 23.SMeshHandling +Sources = main.cpp + +# general compiler settings +CPPFLAGS = -I../../include -I/usr/X11R6/include +CXXFLAGS = -O3 -ffast-math +#CXXFLAGS = -g -Wall + +#default target is Linux +all: all_linux + +ifeq ($(HOSTTYPE), x86_64) +LIBSELECT=64 +endif + +# target specific settings +all_linux: LDFLAGS = -L/usr/X11R6/lib$(LIBSELECT) -L../../lib/Linux -lIrrlicht -lGL -lXxf86vm -lXext -lX11 -lXcursor +all_linux clean_linux: SYSTEM=Linux +all_win32: LDFLAGS = -L../../lib/Win32-gcc -lIrrlicht -lopengl32 -lm +all_win32 clean_win32: SYSTEM=Win32-gcc +all_win32 clean_win32: SUF=.exe +# name of the binary - only valid for targets which set SYSTEM +DESTPATH = ../../bin/$(SYSTEM)/$(Target)$(SUF) + +all_linux all_win32: + $(warning Building...) + $(CXX) $(CPPFLAGS) $(CXXFLAGS) $(Sources) -o $(DESTPATH) $(LDFLAGS) + +clean: clean_linux clean_win32 + $(warning Cleaning...) + +clean_linux clean_win32: + @$(RM) $(DESTPATH) + +.PHONY: all all_win32 clean clean_linux clean_win32 diff --git a/libraries/irrlicht-1.8.1/examples/23.SMeshHandling/SMeshHandling.cbp b/libraries/irrlicht-1.8.1/examples/23.SMeshHandling/SMeshHandling.cbp new file mode 100644 index 0000000..2fbcfe2 --- /dev/null +++ b/libraries/irrlicht-1.8.1/examples/23.SMeshHandling/SMeshHandling.cbp @@ -0,0 +1,44 @@ + + + + + + diff --git a/libraries/irrlicht-1.8.1/examples/23.SMeshHandling/SMeshHandling.dev b/libraries/irrlicht-1.8.1/examples/23.SMeshHandling/SMeshHandling.dev new file mode 100644 index 0000000..94043f3 --- /dev/null +++ b/libraries/irrlicht-1.8.1/examples/23.SMeshHandling/SMeshHandling.dev @@ -0,0 +1,59 @@ +[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/libraries/irrlicht-1.8.1/examples/23.SMeshHandling/SMeshHandling.vcproj b/libraries/irrlicht-1.8.1/examples/23.SMeshHandling/SMeshHandling.vcproj new file mode 100644 index 0000000..a63d583 --- /dev/null +++ b/libraries/irrlicht-1.8.1/examples/23.SMeshHandling/SMeshHandling.vcproj @@ -0,0 +1,132 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/libraries/irrlicht-1.8.1/examples/23.SMeshHandling/SMeshHandling_vc10.vcxproj b/libraries/irrlicht-1.8.1/examples/23.SMeshHandling/SMeshHandling_vc10.vcxproj new file mode 100644 index 0000000..51a6f9e --- /dev/null +++ b/libraries/irrlicht-1.8.1/examples/23.SMeshHandling/SMeshHandling_vc10.vcxproj @@ -0,0 +1,188 @@ + + + + + Debug + Win32 + + + Debug + x64 + + + Release + Win32 + + + Release + x64 + + + + 23.SMeshHandling + {6AEC2AA2-C9FF-4B7D-B07A-94A9D34B41D7} + 23.SMeshHandling + Win32Proj + + + + Application + MultiByte + + + Application + MultiByte + + + Application + MultiByte + + + Application + MultiByte + + + + + + + + + + + + + + + + + + + + + + + <_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/libraries/irrlicht-1.8.1/examples/23.SMeshHandling/SMeshHandling_vc11.vcxproj b/libraries/irrlicht-1.8.1/examples/23.SMeshHandling/SMeshHandling_vc11.vcxproj new file mode 100644 index 0000000..7f2a781 --- /dev/null +++ b/libraries/irrlicht-1.8.1/examples/23.SMeshHandling/SMeshHandling_vc11.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 + v110 + + + Application + MultiByte + v110 + + + Application + MultiByte + v110 + + + Application + MultiByte + v110 + + + + + + + + + + + + + + + + + + + + + + + <_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/libraries/irrlicht-1.8.1/examples/23.SMeshHandling/SMeshHandling_vc8.vcproj b/libraries/irrlicht-1.8.1/examples/23.SMeshHandling/SMeshHandling_vc8.vcproj new file mode 100644 index 0000000..ecc9135 --- /dev/null +++ b/libraries/irrlicht-1.8.1/examples/23.SMeshHandling/SMeshHandling_vc8.vcproj @@ -0,0 +1,190 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/libraries/irrlicht-1.8.1/examples/23.SMeshHandling/SMeshHandling_vc9.vcproj b/libraries/irrlicht-1.8.1/examples/23.SMeshHandling/SMeshHandling_vc9.vcproj new file mode 100644 index 0000000..b1b921e --- /dev/null +++ b/libraries/irrlicht-1.8.1/examples/23.SMeshHandling/SMeshHandling_vc9.vcproj @@ -0,0 +1,187 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/libraries/irrlicht-1.8.1/examples/23.SMeshHandling/main.cpp b/libraries/irrlicht-1.8.1/examples/23.SMeshHandling/main.cpp new file mode 100644 index 0000000..c3c2ccf --- /dev/null +++ b/libraries/irrlicht-1.8.1/examples/23.SMeshHandling/main.cpp @@ -0,0 +1,426 @@ +/** Example 023 SMeshBufferHandling + +A tutorial by geoff. + +In this tutorial we'll learn how to create custom meshes and deal with them +with Irrlicht. We'll create an interesting heightmap with some lighting effects. +With keys 1,2,3 you can choose a different mesh layout, which is put into the +mesh buffers as desired. All positions, normals, etc. are updated accordingly. + +Ok, let's start with the headers (I think there's nothing to say about it) +*/ + +#include +#include "driverChoice.h" + +#ifdef _MSC_VER +#pragma comment(lib, "Irrlicht.lib") +#endif + +//Namespaces for the engine +using namespace irr; +using namespace video; +using namespace core; +using namespace scene; +using namespace io; +using namespace gui; + +/* This is the type of the functions which work out the colour. */ +typedef SColor colour_func(f32 x, f32 y, f32 z); + +/* Here comes a set of functions which can be used for coloring the nodes while +creating the mesh. */ + +// Greyscale, based on the height. +SColor grey(f32, f32, f32 z) +{ + u32 n = (u32)(255.f * z); + return SColor(255, n, n, n); +} + +// Interpolation between blue and white, with red added in one +// direction and green in the other. +SColor yellow(f32 x, f32 y, f32) +{ + return SColor(255, 128 + (u32)(127.f * x), 128 + (u32)(127.f * y), 255); +} + +// Pure white. +SColor white(f32, f32, f32) { return SColor(255, 255, 255, 255); } + +/* The type of the functions which generate the heightmap. x and y +range between -0.5 and 0.5, and s is the scale of the heightmap. */ + +typedef f32 generate_func(s16 x, s16 y, f32 s); + +// An interesting sample function :-) +f32 eggbox(s16 x, s16 y, f32 s) +{ + const f32 r = 4.f*sqrtf((f32)(x*x + y*y))/s; + const f32 z = expf(-r * 2) * (cosf(0.2f * x) + cosf(0.2f * y)); + return 0.25f+0.25f*z; +} + +// A rather dumb sine function :-/ +f32 moresine(s16 x, s16 y, f32 s) +{ + const f32 xx=0.3f*(f32)x/s; + const f32 yy=12*y/s; + const f32 z = sinf(xx*xx+yy)*sinf(xx+yy*yy); + return 0.25f + 0.25f * z; +} + +// A simple function +f32 justexp(s16 x, s16 y, f32 s) +{ + const f32 xx=6*x/s; + const f32 yy=6*y/s; + const f32 z = (xx*xx+yy*yy); + return 0.3f*z*cosf(xx*yy); +} + +/* A simple class for representing heightmaps. Most of this should be obvious. */ + +class HeightMap +{ +private: + const u16 Width; + const u16 Height; + f32 s; + core::array data; +public: + HeightMap(u16 _w, u16 _h) : Width(_w), Height(_h), s(0.f), data(0) + { + s = sqrtf((f32)(Width * Width + Height * Height)); + data.set_used(Width * Height); + } + + // Fill the heightmap with values generated from f. + void generate(generate_func f) + { + u32 i=0; + for(u16 y = 0; y < Height; ++y) + for(u16 x = 0; x < Width; ++x) + set(i++, calc(f, x, y)); + } + + u16 height() const { return Height; } + u16 width() const { return Width; } + + f32 calc(generate_func f, u16 x, u16 y) const + { + const f32 xx = (f32)x - Width*0.5f; + const f32 yy = (f32)y - Height*0.5f; + return f((u16)xx, (u16)yy, s); + } + + // The height at (x, y) is at position y * Width + x. + + void set(u16 x, u16 y, f32 z) { data[y * Width + x] = z; } + void set(u32 i, f32 z) { data[i] = z; } + f32 get(u16 x, u16 y) const { return data[y * Width + x]; } + + /* The only difficult part. This considers the normal at (x, y) to + be the cross product of the vectors between the adjacent points + in the horizontal and vertical directions. + + s is a scaling factor, which is necessary if the height units are + different from the coordinate units; for example, if your map has + heights in metres and the coordinates are in units of a + kilometer. */ + + vector3df getnormal(u16 x, u16 y, f32 s) const + { + const f32 zc = get(x, y); + f32 zl, zr, zu, zd; + + if (x == 0) + { + zr = get(x + 1, y); + zl = zc + zc - zr; + } + else if (x == Width - 1) + { + zl = get(x - 1, y); + zr = zc + zc - zl; + } + else + { + zr = get(x + 1, y); + zl = get(x - 1, y); + } + + if (y == 0) + { + zd = get(x, y + 1); + zu = zc + zc - zd; + } + else if (y == Height - 1) + { + zu = get(x, y - 1); + zd = zc + zc - zu; + } + else + { + zd = get(x, y + 1); + zu = get(x, y - 1); + } + + return vector3df(s * 2 * (zl - zr), 4, s * 2 * (zd - zu)).normalize(); + } +}; + +/* A class which generates a mesh from a heightmap. */ +class TMesh +{ +private: + u16 Width; + u16 Height; + f32 Scale; +public: + SMesh* Mesh; + + TMesh() : Mesh(0), Width(0), Height(0), Scale(1.f) + { + Mesh = new SMesh(); + } + + ~TMesh() + { + Mesh->drop(); + } + + // Unless the heightmap is small, it won't all fit into a single + // SMeshBuffer. This function chops it into pieces and generates a + // buffer from each one. + + void init(const HeightMap &hm, f32 scale, colour_func cf, IVideoDriver *driver) + { + Scale = scale; + + const u32 mp = driver -> getMaximalPrimitiveCount(); + Width = hm.width(); + Height = hm.height(); + + const u32 sw = mp / (6 * Height); // the width of each piece + + u32 i=0; + for(u32 y0 = 0; y0 < Height; y0 += sw) + { + u16 y1 = y0 + sw; + if (y1 >= Height) + y1 = Height - 1; // the last one might be narrower + addstrip(hm, cf, y0, y1, i); + ++i; + } + if (igetMeshBufferCount()) + { + // clear the rest + for (u32 j=i; jgetMeshBufferCount(); ++j) + { + Mesh->getMeshBuffer(j)->drop(); + } + Mesh->MeshBuffers.erase(i,Mesh->getMeshBufferCount()-i); + } + // set dirty flag to make sure that hardware copies of this + // buffer are also updated, see IMesh::setHardwareMappingHint + Mesh->setDirty(); + Mesh->recalculateBoundingBox(); + } + + // Generate a SMeshBuffer which represents all the vertices and + // indices for values of y between y0 and y1, and add it to the + // mesh. + + void addstrip(const HeightMap &hm, colour_func cf, u16 y0, u16 y1, u32 bufNum) + { + SMeshBuffer *buf = 0; + if (bufNumgetMeshBufferCount()) + { + buf = (SMeshBuffer*)Mesh->getMeshBuffer(bufNum); + } + else + { + // create new buffer + buf = new SMeshBuffer(); + Mesh->addMeshBuffer(buf); + // to simplify things we drop here but continue using buf + buf->drop(); + } + buf->Vertices.set_used((1 + y1 - y0) * Width); + + u32 i=0; + for (u16 y = y0; y <= y1; ++y) + { + for (u16 x = 0; x < Width; ++x) + { + const f32 z = hm.get(x, y); + const f32 xx = (f32)x/(f32)Width; + const f32 yy = (f32)y/(f32)Height; + + S3DVertex& v = buf->Vertices[i++]; + v.Pos.set(x, Scale * z, y); + v.Normal.set(hm.getnormal(x, y, Scale)); + v.Color=cf(xx, yy, z); + v.TCoords.set(xx, yy); + } + } + + buf->Indices.set_used(6 * (Width - 1) * (y1 - y0)); + i=0; + for(u16 y = y0; y < y1; ++y) + { + for(u16 x = 0; x < Width - 1; ++x) + { + const u16 n = (y-y0) * Width + x; + buf->Indices[i]=n; + buf->Indices[++i]=n + Width; + buf->Indices[++i]=n + Width + 1; + buf->Indices[++i]=n + Width + 1; + buf->Indices[++i]=n + 1; + buf->Indices[++i]=n; + ++i; + } + } + + buf->recalculateBoundingBox(); + } +}; + +/* +Our event receiver implementation, taken from tutorial 4. +*/ +class MyEventReceiver : public IEventReceiver +{ +public: + // This is the one method that we have to implement + virtual bool OnEvent(const SEvent& event) + { + // Remember whether each key is down or up + if (event.EventType == irr::EET_KEY_INPUT_EVENT) + KeyIsDown[event.KeyInput.Key] = event.KeyInput.PressedDown; + + return false; + } + + // This is used to check whether a key is being held down + virtual bool IsKeyDown(EKEY_CODE keyCode) const + { + return KeyIsDown[keyCode]; + } + + MyEventReceiver() + { + for (u32 i=0; igetVideoDriver(); + ISceneManager *smgr = device->getSceneManager(); + device->setWindowCaption(L"Irrlicht Example for SMesh usage."); + + /* + Create the custom mesh and initialize with a heightmap + */ + TMesh mesh; + HeightMap hm = HeightMap(255, 255); + hm.generate(eggbox); + mesh.init(hm, 50.f, grey, driver); + + // Add the mesh to the scene graph + IMeshSceneNode* meshnode = smgr -> addMeshSceneNode(mesh.Mesh); + meshnode->setMaterialFlag(video::EMF_BACK_FACE_CULLING, false); + + // light is just for nice effects + ILightSceneNode *node = smgr->addLightSceneNode(0, vector3df(0,100,0), + SColorf(1.0f, 0.6f, 0.7f, 1.0f), 500.0f); + if (node) + { + node->getLightData().Attenuation.set(0.f, 1.f/500.f, 0.f); + ISceneNodeAnimator* anim = smgr->createFlyCircleAnimator(vector3df(0,150,0),250.0f); + if (anim) + { + node->addAnimator(anim); + anim->drop(); + } + } + + ICameraSceneNode* camera = smgr->addCameraSceneNodeFPS(); + if (camera) + { + camera->setPosition(vector3df(-20.f, 150.f, -20.f)); + camera->setTarget(vector3df(200.f, -80.f, 150.f)); + camera->setFarValue(20000.0f); + } + + /* + Just a usual render loop with event handling. The custom mesh is + a usual part of the scene graph which gets rendered by drawAll. + */ + while(device->run()) + { + if(!device->isWindowActive()) + { + device->sleep(100); + continue; + } + + if(receiver.IsKeyDown(irr::KEY_KEY_W)) + { + meshnode->setMaterialFlag(video::EMF_WIREFRAME, !meshnode->getMaterial(0).Wireframe); + } + else if(receiver.IsKeyDown(irr::KEY_KEY_1)) + { + hm.generate(eggbox); + mesh.init(hm, 50.f, grey, driver); + } + else if(receiver.IsKeyDown(irr::KEY_KEY_2)) + { + hm.generate(moresine); + mesh.init(hm, 50.f, yellow, driver); + } + else if(receiver.IsKeyDown(irr::KEY_KEY_3)) + { + hm.generate(justexp); + mesh.init(hm, 50.f, yellow, driver); + } + + driver->beginScene(true, true, SColor(0xff000000)); + smgr->drawAll(); + driver->endScene(); + } + + device->drop(); + + return 0; +} + +/* +That's it! Just compile and play around with the program. +**/ diff --git a/libraries/irrlicht-1.8.1/examples/24.CursorControl/CursorControl.cbp b/libraries/irrlicht-1.8.1/examples/24.CursorControl/CursorControl.cbp new file mode 100644 index 0000000..6d1b92a --- /dev/null +++ b/libraries/irrlicht-1.8.1/examples/24.CursorControl/CursorControl.cbp @@ -0,0 +1,56 @@ + + + + + + diff --git a/libraries/irrlicht-1.8.1/examples/24.CursorControl/CursorControl.vcproj b/libraries/irrlicht-1.8.1/examples/24.CursorControl/CursorControl.vcproj new file mode 100644 index 0000000..1bc2f53 --- /dev/null +++ b/libraries/irrlicht-1.8.1/examples/24.CursorControl/CursorControl.vcproj @@ -0,0 +1,132 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/libraries/irrlicht-1.8.1/examples/24.CursorControl/CursorControl_vc10.vcxproj b/libraries/irrlicht-1.8.1/examples/24.CursorControl/CursorControl_vc10.vcxproj new file mode 100644 index 0000000..9912eda --- /dev/null +++ b/libraries/irrlicht-1.8.1/examples/24.CursorControl/CursorControl_vc10.vcxproj @@ -0,0 +1,184 @@ + + + + + Debug + Win32 + + + Debug + x64 + + + Release + Win32 + + + Release + x64 + + + + 24.CursorControl + {02B67A37-50E1-49DB-BECF-905BC029C2FE} + 24.CursorControl + Win32Proj + + + + Application + MultiByte + + + Application + MultiByte + + + Application + MultiByte + + + Application + MultiByte + + + + + + + + + + + + + + + + + + + + + + + <_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/libraries/irrlicht-1.8.1/examples/24.CursorControl/CursorControl_vc11.vcxproj b/libraries/irrlicht-1.8.1/examples/24.CursorControl/CursorControl_vc11.vcxproj new file mode 100644 index 0000000..362f064 --- /dev/null +++ b/libraries/irrlicht-1.8.1/examples/24.CursorControl/CursorControl_vc11.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 + v110 + + + Application + MultiByte + v110 + + + Application + MultiByte + v110 + + + Application + MultiByte + v110 + + + + + + + + + + + + + + + + + + + + + + + <_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/libraries/irrlicht-1.8.1/examples/24.CursorControl/CursorControl_vc8.vcproj b/libraries/irrlicht-1.8.1/examples/24.CursorControl/CursorControl_vc8.vcproj new file mode 100644 index 0000000..6148942 --- /dev/null +++ b/libraries/irrlicht-1.8.1/examples/24.CursorControl/CursorControl_vc8.vcproj @@ -0,0 +1,190 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/libraries/irrlicht-1.8.1/examples/24.CursorControl/CursorControl_vc9.vcproj b/libraries/irrlicht-1.8.1/examples/24.CursorControl/CursorControl_vc9.vcproj new file mode 100644 index 0000000..90ebf1f --- /dev/null +++ b/libraries/irrlicht-1.8.1/examples/24.CursorControl/CursorControl_vc9.vcproj @@ -0,0 +1,185 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/libraries/irrlicht-1.8.1/examples/24.CursorControl/Makefile b/libraries/irrlicht-1.8.1/examples/24.CursorControl/Makefile new file mode 100644 index 0000000..bc2a137 --- /dev/null +++ b/libraries/irrlicht-1.8.1/examples/24.CursorControl/Makefile @@ -0,0 +1,66 @@ +# Makefile for Irrlicht Examples +# It's usually sufficient to change just the target name and source file list +# and be sure that CXX is set to a valid compiler + +# Name of the executable created (.exe will be added automatically if necessary) +Target := 24.CursorControl +# List of source files, separated by spaces +Sources := main.cpp +# Path to Irrlicht directory, should contain include/ and lib/ +IrrlichtHome := ../.. +# Path for the executable. Note that Irrlicht.dll should usually also be there for win32 systems +BinPath = ../../bin/$(SYSTEM) + +# general compiler settings (might need to be set when compiling the lib, too) +# preprocessor flags, e.g. defines and include paths +USERCPPFLAGS = +# compiler flags such as optimization flags +USERCXXFLAGS = -O3 -ffast-math +#USERCXXFLAGS = -g -Wall +# linker flags such as additional libraries and link paths +USERLDFLAGS = + +#### +#no changes necessary below this line +#### + +CPPFLAGS = -I$(IrrlichtHome)/include -I/usr/X11R6/include $(USERCPPFLAGS) +CXXFLAGS = $(USERCXXFLAGS) +LDFLAGS = $(USERLDFLAGS) + +#default target is Linux +all: all_linux + +# target specific settings +all_linux all_win32 static_win32: LDFLAGS += -L$(IrrlichtHome)/lib/$(SYSTEM) -lIrrlicht +all_linux: LDFLAGS += -L/usr/X11R6/lib$(LIBSELECT) -lGL -lXxf86vm -lXext -lX11 -lXcursor +all_linux clean_linux: SYSTEM=Linux +all_win32 clean_win32 static_win32: SYSTEM=Win32-gcc +all_win32 clean_win32 static_win32: SUF=.exe +static_win32: CPPFLAGS += -D_IRR_STATIC_LIB_ +all_win32: LDFLAGS += -lopengl32 -lm +static_win32: LDFLAGS += -lgdi32 -lwinspool -lcomdlg32 -lole32 -loleaut32 -luuid -lodbc32 -lodbccp32 -lopengl32 +# name of the binary - only valid for targets which set SYSTEM +DESTPATH = $(BinPath)/$(Target)$(SUF) + +all_linux all_win32 static_win32: + $(warning Building...) + $(CXX) $(CPPFLAGS) $(CXXFLAGS) $(Sources) -o $(DESTPATH) $(LDFLAGS) + +clean: clean_linux clean_win32 + $(warning Cleaning...) + +clean_linux clean_win32: + @$(RM) $(DESTPATH) + +.PHONY: all all_win32 static_win32 clean clean_linux clean_win32 + +#multilib handling +ifeq ($(HOSTTYPE), x86_64) +LIBSELECT=64 +endif +#solaris real-time features +ifeq ($(HOSTTYPE), sun4) +LDFLAGS += -lrt +endif + diff --git a/libraries/irrlicht-1.8.1/examples/24.CursorControl/main.cpp b/libraries/irrlicht-1.8.1/examples/24.CursorControl/main.cpp new file mode 100644 index 0000000..ff7c16f --- /dev/null +++ b/libraries/irrlicht-1.8.1/examples/24.CursorControl/main.cpp @@ -0,0 +1,563 @@ +/** Example 024 CursorControl + +Show how to modify cursors and offer some useful tool-functions for creating cursors. +It can also be used for experiments with the mouse in general. +*/ + +#include +#include "driverChoice.h" + +using namespace irr; +using namespace core; +using namespace scene; +using namespace video; +using namespace io; +using namespace gui; + +#ifdef _IRR_WINDOWS_ +#pragma comment(lib, "Irrlicht.lib") +#endif + +const int DELAY_TIME = 3000; + +enum ETimerAction +{ + ETA_MOUSE_VISIBLE, + ETA_MOUSE_INVISIBLE, +}; + +/* + Structure to allow delayed execution of some actions. +*/ +struct TimerAction +{ + u32 TargetTime; + ETimerAction Action; +}; + +/* +*/ +struct SAppContext +{ + SAppContext() + : Device(0), InfoStatic(0), EventBox(0), CursorBox(0), SpriteBox(0) + , ButtonSetVisible(0), ButtonSetInvisible(0), ButtonSimulateBadFps(0) + , ButtonChangeIcon(0) + , SimulateBadFps(false) + { + } + + void update() + { + if (!Device) + return; + u32 timeNow = Device->getTimer()->getTime(); + for ( u32 i=0; i < TimerActions.size(); ++i ) + { + if ( timeNow >= TimerActions[i].TargetTime ) + { + runTimerAction(TimerActions[i]); + TimerActions.erase(i); + } + else + { + ++i; + } + } + } + + void runTimerAction(const TimerAction& action) + { + if (ETA_MOUSE_VISIBLE == action.Action) + { + Device->getCursorControl()->setVisible(true); + ButtonSetVisible->setEnabled(true); + } + else if ( ETA_MOUSE_INVISIBLE == action.Action) + { + Device->getCursorControl()->setVisible(false); + ButtonSetInvisible->setEnabled(true); + } + } + + /* + Add another icon which the user can click and select as cursor later on. + */ + void addIcon(const stringw& name, const SCursorSprite &sprite, bool addCursor=true) + { + // Sprites are just icons - not yet cursors. They can be displayed by Irrlicht sprite functions and be used to create cursors. + SpriteBox->addItem(name.c_str(), sprite.SpriteId); + Sprites.push_back(sprite); + + // create the cursor together with the icon? + if ( addCursor ) + { + /* Here we create a hardware cursor from a sprite */ + Device->getCursorControl()->addIcon(sprite); + + // ... and add it to the cursors selection listbox to the other system cursors. + CursorBox->addItem(name.c_str()); + } + } + + IrrlichtDevice * Device; + gui::IGUIStaticText * InfoStatic; + gui::IGUIListBox * EventBox; + gui::IGUIListBox * CursorBox; + gui::IGUIListBox * SpriteBox; + gui::IGUIButton * ButtonSetVisible; + gui::IGUIButton * ButtonSetInvisible; + gui::IGUIButton * ButtonSimulateBadFps; + gui::IGUIButton * ButtonChangeIcon; + array TimerActions; + bool SimulateBadFps; + array Sprites; +}; + +/* + Helper function to print mouse event names into a stringw +*/ +void PrintMouseEventName(const SEvent& event, stringw &result) +{ + switch ( event.MouseInput.Event ) + { + case EMIE_LMOUSE_PRESSED_DOWN: result += stringw(L"EMIE_LMOUSE_PRESSED_DOWN"); break; + case EMIE_RMOUSE_PRESSED_DOWN: result += stringw(L"EMIE_RMOUSE_PRESSED_DOWN"); break; + case EMIE_MMOUSE_PRESSED_DOWN: result += stringw(L"EMIE_MMOUSE_PRESSED_DOWN"); break; + case EMIE_LMOUSE_LEFT_UP: result += stringw(L"EMIE_LMOUSE_LEFT_UP"); break; + case EMIE_RMOUSE_LEFT_UP: result += stringw(L"EMIE_RMOUSE_LEFT_UP"); break; + case EMIE_MMOUSE_LEFT_UP: result += stringw(L"EMIE_MMOUSE_LEFT_UP"); break; + case EMIE_MOUSE_MOVED: result += stringw(L"EMIE_MOUSE_MOVED"); break; + case EMIE_MOUSE_WHEEL: result += stringw(L"EMIE_MOUSE_WHEEL"); break; + case EMIE_LMOUSE_DOUBLE_CLICK: result += stringw(L"EMIE_LMOUSE_DOUBLE_CLICK"); break; + case EMIE_RMOUSE_DOUBLE_CLICK: result += stringw(L"EMIE_RMOUSE_DOUBLE_CLICK"); break; + case EMIE_MMOUSE_DOUBLE_CLICK: result += stringw(L"EMIE_MMOUSE_DOUBLE_CLICK"); break; + case EMIE_LMOUSE_TRIPLE_CLICK: result += stringw(L"EMIE_LMOUSE_TRIPLE_CLICK"); break; + case EMIE_RMOUSE_TRIPLE_CLICK: result += stringw(L"EMIE_RMOUSE_TRIPLE_CLICK"); break; + case EMIE_MMOUSE_TRIPLE_CLICK: result += stringw(L"EMIE_MMOUSE_TRIPLE_CLICK"); break; + default: + break; + } +} + +/* + Helper function to print all the state information which get from a mouse-event into a stringw +*/ +void PrintMouseState(const SEvent& event, stringw &result) +{ + result += stringw(L"X: "); + result += stringw(event.MouseInput.X); + result += stringw(L"\n"); + + result += stringw(L"Y: "); + result += stringw(event.MouseInput.Y); + result += stringw(L"\n"); + + + result += stringw(L"Wheel: "); + result += stringw(event.MouseInput.Wheel); + result += stringw(L"\n"); + + result += stringw(L"Shift: "); + if ( event.MouseInput.Shift ) + result += stringw(L"true\n"); + else + result += stringw(L"false\n"); + + result += stringw(L"Control: "); + if ( event.MouseInput.Control ) + result += stringw(L"true\n"); + else + result += stringw(L"false\n"); + + result += stringw(L"ButtonStates: "); + result += stringw(event.MouseInput.ButtonStates); + result += stringw(L"\n"); + + result += stringw(L"isLeftPressed: "); + if ( event.MouseInput.isLeftPressed() ) + result += stringw(L"true\n"); + else + result += stringw(L"false\n"); + + result += stringw(L"isRightPressed: "); + if ( event.MouseInput.isRightPressed() ) + result += stringw(L"true\n"); + else + result += stringw(L"false\n"); + + result += stringw(L"isMiddlePressed: "); + if ( event.MouseInput.isMiddlePressed() ) + result += stringw(L"true\n"); + else + result += stringw(L"false\n"); + + result += stringw(L"Event: "); + + PrintMouseEventName(event, result); + + result += stringw(L"\n"); +} + +/* + A typical event receiver. +*/ +class MyEventReceiver : public IEventReceiver +{ +public: + MyEventReceiver(SAppContext & context) : Context(context) { } + + virtual bool OnEvent(const SEvent& event) + { + if (event.EventType == EET_GUI_EVENT ) + { + switch ( event.GUIEvent.EventType ) + { + case EGET_BUTTON_CLICKED: + { + u32 timeNow = Context.Device->getTimer()->getTime(); + TimerAction action; + action.TargetTime = timeNow + DELAY_TIME; + if ( event.GUIEvent.Caller == Context.ButtonSetVisible ) + { + action.Action = ETA_MOUSE_VISIBLE; + Context.TimerActions.push_back(action); + Context.ButtonSetVisible->setEnabled(false); + } + else if ( event.GUIEvent.Caller == Context.ButtonSetInvisible ) + { + action.Action = ETA_MOUSE_INVISIBLE; + Context.TimerActions.push_back(action); + Context.ButtonSetInvisible->setEnabled(false); + } + else if ( event.GUIEvent.Caller == Context.ButtonSimulateBadFps ) + { + Context.SimulateBadFps = Context.ButtonSimulateBadFps->isPressed(); + } + else if ( event.GUIEvent.Caller == Context.ButtonChangeIcon ) + { + /* + Replace an existing cursor icon by another icon. + The user has to select both - the icon which should be replaced and the icon which will replace it. + */ + s32 selectedCursor = Context.CursorBox->getSelected(); + s32 selectedSprite = Context.SpriteBox->getSelected(); + if ( selectedCursor >= 0 && selectedSprite >= 0 ) + { + /* + This does replace the icon. + */ + Context.Device->getCursorControl()->changeIcon((ECURSOR_ICON)selectedCursor, Context.Sprites[selectedSprite] ); + + /* + Do also show the new icon. + */ + Context.Device->getCursorControl()->setActiveIcon( ECURSOR_ICON(selectedCursor) ); + } + } + } + break; + case EGET_LISTBOX_CHANGED: + case EGET_LISTBOX_SELECTED_AGAIN: + { + if ( event.GUIEvent.Caller == Context.CursorBox ) + { + /* + Find out which cursor the user selected + */ + s32 selected = Context.CursorBox->getSelected(); + if ( selected >= 0 ) + { + /* + Here we set the new cursor icon which will now be used within our window. + */ + Context.Device->getCursorControl()->setActiveIcon( ECURSOR_ICON(selected) ); + } + } + } + break; + default: + break; + } + } + + if (event.EventType == EET_MOUSE_INPUT_EVENT) + { + stringw infoText; + PrintMouseState(event, infoText); + Context.InfoStatic->setText(infoText.c_str()); + if ( event.MouseInput.Event != EMIE_MOUSE_MOVED && event.MouseInput.Event != EMIE_MOUSE_WHEEL ) // no spam + { + infoText = L""; + PrintMouseEventName(event, infoText); + Context.EventBox->insertItem(0, infoText.c_str(), -1); + } + } + + return false; + } + +private: + SAppContext & Context; +}; + +/* + Use several imagefiles as animation frames for a sprite which can be used as cursor icon. + The images in those files all need to have the same size. + Return sprite index on success or -1 on failure +*/ +s32 AddAnimatedIconToSpriteBank( gui::IGUISpriteBank * spriteBank, video::IVideoDriver* driver, const array< io::path >& files, u32 frameTime ) +{ + if ( !spriteBank || !driver || !files.size() ) + return -1; + + video::ITexture * tex = driver->getTexture( files[0] ); + if ( tex ) + { + array< rect >& spritePositions = spriteBank->getPositions(); + u32 idxRect = spritePositions.size(); + spritePositions.push_back( rect(0,0, tex->getSize().Width, tex->getSize().Height) ); + + SGUISprite sprite; + sprite.frameTime = frameTime; + + array< SGUISprite >& sprites = spriteBank->getSprites(); + u32 startIdx = spriteBank->getTextureCount(); + for ( u32 f=0; f < files.size(); ++f ) + { + tex = driver->getTexture( files[f] ); + if ( tex ) + { + spriteBank->addTexture( driver->getTexture(files[f]) ); + gui::SGUISpriteFrame frame; + frame.rectNumber = idxRect; + frame.textureNumber = startIdx+f; + sprite.Frames.push_back( frame ); + } + } + + sprites.push_back( sprite ); + return sprites.size()-1; + } + + return -1; +} + +/* + Use several images within one imagefile as animation frames for a sprite which can be used as cursor icon + The sizes of the icons within that file all need to have the same size + Return sprite index on success or -1 on failure +*/ +s32 AddAnimatedIconToSpriteBank( gui::IGUISpriteBank * spriteBank, video::IVideoDriver* driver, const io::path& file, const array< rect >& rects, u32 frameTime ) +{ + if ( !spriteBank || !driver || !rects.size() ) + return -1; + + video::ITexture * tex = driver->getTexture( file ); + if ( tex ) + { + array< rect >& spritePositions = spriteBank->getPositions(); + u32 idxRect = spritePositions.size(); + u32 idxTex = spriteBank->getTextureCount(); + spriteBank->addTexture( tex ); + + SGUISprite sprite; + sprite.frameTime = frameTime; + + array< SGUISprite >& sprites = spriteBank->getSprites(); + for ( u32 i=0; i < rects.size(); ++i ) + { + spritePositions.push_back( rects[i] ); + + gui::SGUISpriteFrame frame; + frame.rectNumber = idxRect+i; + frame.textureNumber = idxTex; + sprite.Frames.push_back( frame ); + } + + sprites.push_back( sprite ); + return sprites.size()-1; + } + + return -1; +} + +/* + Create a non-animated icon from the given file and position and put it into the spritebank. + We can use this icon later on in a cursor. +*/ +s32 AddIconToSpriteBank( gui::IGUISpriteBank * spriteBank, video::IVideoDriver* driver, const io::path& file, const core::rect& rect ) +{ + if ( !spriteBank || !driver ) + return -1; + + video::ITexture * tex = driver->getTexture( file ); + if ( tex ) + { + core::array< core::rect >& spritePositions = spriteBank->getPositions(); + spritePositions.push_back( rect ); + array< SGUISprite >& sprites = spriteBank->getSprites(); + spriteBank->addTexture( tex ); + + gui::SGUISpriteFrame frame; + frame.rectNumber = spritePositions.size()-1; + frame.textureNumber = spriteBank->getTextureCount()-1; + + SGUISprite sprite; + sprite.frameTime = 0; + sprite.Frames.push_back( frame ); + + sprites.push_back( sprite ); + + return sprites.size()-1; + } + + return -1; +} + +int main() +{ + video::E_DRIVER_TYPE driverType = driverChoiceConsole(); + if (driverType==video::EDT_COUNT) + return 1; + + IrrlichtDevice * device = createDevice(driverType, dimension2d(640, 480)); + if (device == 0) + return 1; // could not create selected driver. + + // It's sometimes of interest to know how the mouse behaves after a resize + device->setResizable(true); + + device->setWindowCaption(L"Cursor control - Irrlicht engine tutorial"); + video::IVideoDriver* driver = device->getVideoDriver(); + IGUIEnvironment* env = device->getGUIEnvironment(); + + gui::IGUISpriteBank * SpriteBankIcons; + + SAppContext context; + context.Device = device; + + rect< s32 > rectInfoStatic(10,10, 200, 200); + env->addStaticText (L"Cursor state information", rectInfoStatic, true, true); + rectInfoStatic.UpperLeftCorner += dimension2di(0, 15); + context.InfoStatic = env->addStaticText (L"", rectInfoStatic, true, true); + rect< s32 > rectEventBox(10,210, 200, 400); + env->addStaticText (L"click events (new on top)", rectEventBox, true, true); + rectEventBox.UpperLeftCorner += dimension2di(0, 15); + context.EventBox = env->addListBox(rectEventBox); + rect< s32 > rectCursorBox(210,10, 400, 250); + env->addStaticText (L"cursors, click to set the active one", rectCursorBox, true, true); + rectCursorBox.UpperLeftCorner += dimension2di(0, 15); + context.CursorBox = env->addListBox(rectCursorBox); + rect< s32 > rectSpriteBox(210,260, 400, 400); + env->addStaticText (L"sprites", rectSpriteBox, true, true); + rectSpriteBox.UpperLeftCorner += dimension2di(0, 15); + context.SpriteBox = env->addListBox(rectSpriteBox); + + context.ButtonSetVisible = env->addButton( rect( 410, 20, 560, 40 ), 0, -1, L"set visible (delayed)" ); + context.ButtonSetInvisible = env->addButton( rect( 410, 50, 560, 70 ), 0, -1, L"set invisible (delayed)" ); + context.ButtonSimulateBadFps = env->addButton( rect( 410, 80, 560, 100 ), 0, -1, L"simulate bad FPS" ); + context.ButtonSimulateBadFps->setIsPushButton(true); + context.ButtonChangeIcon = env->addButton( rect( 410, 140, 560, 160 ), 0, -1, L"replace cursor icon\n(cursor+sprite must be selected)" ); + + // set the names for all the system cursors + for ( int i=0; i < (int)gui::ECI_COUNT; ++i ) + { + context.CursorBox->addItem(stringw( GUICursorIconNames[i] ).c_str()); + } + + /* + Create sprites which then can be used as cursor icons. + */ + SpriteBankIcons = env->addEmptySpriteBank(io::path("cursor_icons")); + context.SpriteBox->setSpriteBank(SpriteBankIcons); + + // 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") ); + SCursorSprite spriteBw; // the sprite + some additional information needed for cursors + spriteBw.SpriteId = AddAnimatedIconToSpriteBank( SpriteBankIcons, driver, files, 200 ); + spriteBw.SpriteBank = SpriteBankIcons; + spriteBw.HotSpot = position2d(7,7); + context.addIcon(L"crosshair_bw", spriteBw); + + // create one animated icon from one file + array< rect > iconRects; + iconRects.push_back( rect(0,0, 16, 16) ); + iconRects.push_back( rect(16,0, 32, 16) ); + iconRects.push_back( rect(0,16, 16, 32) ); + 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.HotSpot = position2d(7,7); + spriteCol.SpriteBank = SpriteBankIcons; + context.addIcon(L"crosshair_colored", spriteCol); + + // Create some non-animated icons + rect rectIcon; + 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 ); + 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 ); + 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 ); + context.addIcon(L"crosshair_col3", spriteNonAnimated, false); + + + MyEventReceiver receiver(context); + device->setEventReceiver(&receiver); + + while(device->run() && driver) + { + // if (device->isWindowActive()) + { + u32 realTimeNow = device->getTimer()->getRealTime(); + + context.update(); + + driver->beginScene(true, true, SColor(0,200,200,200)); + + env->drawAll(); + + // draw custom sprite with Irrlicht functions for comparison. It should usually look the same as the cursors. + if ( context.SpriteBox ) + { + s32 selectedSprite = context.SpriteBox->getSelected(); + if ( selectedSprite >= 0 && context.Sprites[selectedSprite].SpriteId >= 0 ) + { + SpriteBankIcons->draw2DSprite(u32(context.Sprites[selectedSprite].SpriteId), position2di(580, 140), 0, video::SColor(255, 255, 255, 255), 0, realTimeNow); + } + } + + driver->endScene(); + } + + // By simulating bad fps we can find out if hardware-support for cursors works or not. If it works the cursor will move as usual,while it otherwise will just update with 2 fps now. + if ( context.SimulateBadFps ) + { + device->sleep(500); // 2 fps + } + else + { + device->sleep(10); + } + } + + device->drop(); + + return 0; +} + +/* +**/ diff --git a/libraries/irrlicht-1.8.1/examples/25.XmlHandling/Makefile b/libraries/irrlicht-1.8.1/examples/25.XmlHandling/Makefile new file mode 100644 index 0000000..92f5655 --- /dev/null +++ b/libraries/irrlicht-1.8.1/examples/25.XmlHandling/Makefile @@ -0,0 +1,66 @@ +# Makefile for Irrlicht Examples +# It's usually sufficient to change just the target name and source file list +# and be sure that CXX is set to a valid compiler + +# Name of the executable created (.exe will be added automatically if necessary) +Target := 25.XmlHandling +# List of source files, separated by spaces +Sources := main.cpp +# Path to Irrlicht directory, should contain include/ and lib/ +IrrlichtHome := ../.. +# Path for the executable. Note that Irrlicht.dll should usually also be there for win32 systems +BinPath = ../../bin/$(SYSTEM) + +# general compiler settings (might need to be set when compiling the lib, too) +# preprocessor flags, e.g. defines and include paths +USERCPPFLAGS = +# compiler flags such as optimization flags +USERCXXFLAGS = -O3 -ffast-math +#USERCXXFLAGS = -g -Wall +# linker flags such as additional libraries and link paths +USERLDFLAGS = + +#### +#no changes necessary below this line +#### + +CPPFLAGS = -I$(IrrlichtHome)/include -I/usr/X11R6/include $(USERCPPFLAGS) +CXXFLAGS = $(USERCXXFLAGS) +LDFLAGS = $(USERLDFLAGS) + +#default target is Linux +all: all_linux + +# target specific settings +all_linux all_win32 static_win32: LDFLAGS += -L$(IrrlichtHome)/lib/$(SYSTEM) -lIrrlicht +all_linux: LDFLAGS += -L/usr/X11R6/lib$(LIBSELECT) -lGL -lXxf86vm -lXext -lX11 -lXcursor +all_linux clean_linux: SYSTEM=Linux +all_win32 clean_win32 static_win32: SYSTEM=Win32-gcc +all_win32 clean_win32 static_win32: SUF=.exe +static_win32: CPPFLAGS += -D_IRR_STATIC_LIB_ +all_win32: LDFLAGS += -lopengl32 -lm +static_win32: LDFLAGS += -lgdi32 -lwinspool -lcomdlg32 -lole32 -loleaut32 -luuid -lodbc32 -lodbccp32 -lopengl32 +# name of the binary - only valid for targets which set SYSTEM +DESTPATH = $(BinPath)/$(Target)$(SUF) + +all_linux all_win32 static_win32: + $(warning Building...) + $(CXX) $(CPPFLAGS) $(CXXFLAGS) $(Sources) -o $(DESTPATH) $(LDFLAGS) + +clean: clean_linux clean_win32 + $(warning Cleaning...) + +clean_linux clean_win32: + @$(RM) $(DESTPATH) + +.PHONY: all all_win32 static_win32 clean clean_linux clean_win32 + +#multilib handling +ifeq ($(HOSTTYPE), x86_64) +LIBSELECT=64 +endif +#solaris real-time features +ifeq ($(HOSTTYPE), sun4) +LDFLAGS += -lrt +endif + diff --git a/libraries/irrlicht-1.8.1/examples/25.XmlHandling/XmlHandling.cbp b/libraries/irrlicht-1.8.1/examples/25.XmlHandling/XmlHandling.cbp new file mode 100644 index 0000000..3ecf5a2 --- /dev/null +++ b/libraries/irrlicht-1.8.1/examples/25.XmlHandling/XmlHandling.cbp @@ -0,0 +1,55 @@ + + + + + + diff --git a/libraries/irrlicht-1.8.1/examples/25.XmlHandling/XmlHandling.vcproj b/libraries/irrlicht-1.8.1/examples/25.XmlHandling/XmlHandling.vcproj new file mode 100644 index 0000000..152a415 --- /dev/null +++ b/libraries/irrlicht-1.8.1/examples/25.XmlHandling/XmlHandling.vcproj @@ -0,0 +1,195 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/libraries/irrlicht-1.8.1/examples/25.XmlHandling/XmlHandling_vc10.vcxproj b/libraries/irrlicht-1.8.1/examples/25.XmlHandling/XmlHandling_vc10.vcxproj new file mode 100644 index 0000000..2f550a1 --- /dev/null +++ b/libraries/irrlicht-1.8.1/examples/25.XmlHandling/XmlHandling_vc10.vcxproj @@ -0,0 +1,178 @@ + + + + + Debug + Win32 + + + Debug + x64 + + + Release + Win32 + + + Release + x64 + + + + 25.XmlHandling + {8FDA260E-EF27-4F8C-8720-7AF707DD0D9E} + 25.XmlHandling + Win32Proj + + + + Application + MultiByte + + + Application + MultiByte + + + Application + MultiByte + + + Application + MultiByte + + + + + + + + + + + + + + + + + + + + + + + <_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/libraries/irrlicht-1.8.1/examples/25.XmlHandling/XmlHandling_vc11.vcxproj b/libraries/irrlicht-1.8.1/examples/25.XmlHandling/XmlHandling_vc11.vcxproj new file mode 100644 index 0000000..b150b95 --- /dev/null +++ b/libraries/irrlicht-1.8.1/examples/25.XmlHandling/XmlHandling_vc11.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 + v110 + + + Application + MultiByte + v110 + + + Application + MultiByte + v110 + + + Application + MultiByte + v110 + + + + + + + + + + + + + + + + + + + + + + + <_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/libraries/irrlicht-1.8.1/examples/25.XmlHandling/XmlHandling_vc8.vcproj b/libraries/irrlicht-1.8.1/examples/25.XmlHandling/XmlHandling_vc8.vcproj new file mode 100644 index 0000000..0831ba9 --- /dev/null +++ b/libraries/irrlicht-1.8.1/examples/25.XmlHandling/XmlHandling_vc8.vcproj @@ -0,0 +1,190 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/libraries/irrlicht-1.8.1/examples/25.XmlHandling/XmlHandling_vc9.vcproj b/libraries/irrlicht-1.8.1/examples/25.XmlHandling/XmlHandling_vc9.vcproj new file mode 100644 index 0000000..79a1048 --- /dev/null +++ b/libraries/irrlicht-1.8.1/examples/25.XmlHandling/XmlHandling_vc9.vcproj @@ -0,0 +1,185 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/libraries/irrlicht-1.8.1/examples/25.XmlHandling/main.cpp b/libraries/irrlicht-1.8.1/examples/25.XmlHandling/main.cpp new file mode 100644 index 0000000..3eb261d --- /dev/null +++ b/libraries/irrlicht-1.8.1/examples/25.XmlHandling/main.cpp @@ -0,0 +1,505 @@ +/** Example 025 Xml Handling + +Demonstrates loading and saving of configurations via XML + +@author Y.M. Bosman \ + +This demo features a fully usable system for configuration handling. The code +can easily be integrated into own apps. + +*/ + +#include + +using namespace irr; +using namespace core; +using namespace scene; +using namespace video; +using namespace io; +using namespace gui; + +#ifdef _IRR_WINDOWS_ +#pragma comment(lib, "Irrlicht.lib") +#endif + + +/* SettingManager class. + +This class loads and writes the settings and manages the options. + +The class makes use of irrMap which is a an associative arrays using a +red-black tree it allows easy mapping of a key to a value, along the way there +is some information on how to use it. +*/ + +class SettingManager +{ +public: + + // Construct setting managers and set default settings + SettingManager(const stringw& settings_file): SettingsFile(settings_file), NullDevice(0) + { + // Irrlicht null device, we want to load settings before we actually created our device, therefore, nulldevice + NullDevice = irr::createDevice(irr::video::EDT_NULL); + + //DriverOptions is an irrlicht map, + //we can insert values in the map in two ways by calling insert(key,value) or by using the [key] operator + //the [] operator overrides values if they already exist + DriverOptions.insert(L"Software", EDT_SOFTWARE); + DriverOptions.insert(L"OpenGL", EDT_OPENGL); + DriverOptions.insert(L"Direct3D9", EDT_DIRECT3D9); + + //some resolution options + ResolutionOptions.insert(L"640x480", dimension2du(640,480)); + ResolutionOptions.insert(L"800x600", dimension2du(800,600)); + ResolutionOptions.insert(L"1024x768", dimension2du(1024,768)); + + //our preferred defaults + SettingMap.insert(L"driver", L"Direct3D9"); + SettingMap.insert(L"resolution", L"640x480"); + SettingMap.insert(L"fullscreen", L"0"); //0 is false + } + + // Destructor, you could store settings automatically on exit of your + // application if you wanted to in our case we simply drop the + // nulldevice + ~SettingManager() + { + if (NullDevice) + { + NullDevice->closeDevice(); + NullDevice->drop(); + } + }; + + /* + Load xml from disk, overwrite default settings + The xml we are trying to load has the following structure + settings nested in sections nested in the root node, like so +
+		
+		
+			
+		
+	
+ */ + bool load() + { + //if not able to create device don't attempt to load + if (!NullDevice) + return false; + + irr::io::IXMLReader* xml = NullDevice->getFileSystem()->createXMLReader(SettingsFile); //create xml reader + if (!xml) + return false; + + const stringw settingTag(L"setting"); //we'll be looking for this tag in the xml + stringw currentSection; //keep track of our current section + const stringw videoTag(L"video"); //constant for videotag + + //while there is more to read + while (xml->read()) + { + //check the node type + switch (xml->getNodeType()) + { + //we found a new element + case irr::io::EXN_ELEMENT: + { + //we currently are in the empty or mygame section and find the video tag so we set our current section to video + if (currentSection.empty() && videoTag.equals_ignore_case(xml->getNodeName())) + { + currentSection = videoTag; + } + //we are in the video section and we find a setting to parse + else if (currentSection.equals_ignore_case(videoTag) && settingTag.equals_ignore_case(xml->getNodeName() )) + { + //read in the key + stringw key = xml->getAttributeValueSafe(L"name"); + //if there actually is a key to set + if (!key.empty()) + { + //set the setting in the map to the value, + //the [] operator overrides values if they already exist or inserts a new key value + //pair into the settings map if it was not defined yet + SettingMap[key] = xml->getAttributeValueSafe(L"value"); + } + } + + //.. + // You can add your own sections and tags to read in here + //.. + } + break; + + //we found the end of an element + case irr::io::EXN_ELEMENT_END: + //we were at the end of the video section so we reset our tag + currentSection=L""; + break; + } + } + + // don't forget to delete the xml reader + xml->drop(); + + return true; + } + + // Save the xml to disk. We use the nulldevice. + bool save() + { + + //if not able to create device don't attempt to save + if (!NullDevice) + return false; + + //create xml writer + irr::io::IXMLWriter* xwriter = NullDevice->getFileSystem()->createXMLWriter( SettingsFile ); + if (!xwriter) + return false; + + //write out the obligatory xml header. Each xml-file needs to have exactly one of those. + xwriter->writeXMLHeader(); + + //start element mygame, you replace the label "mygame" with anything you want + xwriter->writeElement(L"mygame"); + xwriter->writeLineBreak(); //new line + + //start section with video settings + xwriter->writeElement(L"video"); + xwriter->writeLineBreak(); //new line + + // getIterator gets us a pointer to the first node of the settings map + // every iteration we increase the iterator which gives us the next map node + // until we reach the end we write settings one by one by using the nodes key and value functions + map::Iterator i = SettingMap.getIterator(); + for(; !i.atEnd(); i++) + { + //write element as + //the second parameter indicates this is an empty element with no children, just attributes + xwriter->writeElement(L"setting",true, L"name", i->getKey().c_str(), L"value",i->getValue().c_str() ); + xwriter->writeLineBreak(); + } + xwriter->writeLineBreak(); + + //close video section + xwriter->writeClosingTag(L"video"); + xwriter->writeLineBreak(); + + //.. + // You can add writing sound settings, savegame information etc + //.. + + //close mygame section + xwriter->writeClosingTag(L"mygame"); + + //delete xml writer + xwriter->drop(); + + return true; + } + + // Set setting in our manager + void setSetting(const stringw& name, const stringw& value) + { + SettingMap[name]=value; + } + + // set setting overload to quickly assign integers to our setting map + void setSetting(const stringw& name, s32 value) + { + SettingMap[name]=stringw(value); + } + + // Get setting as string + stringw getSetting(const stringw& key) const + { + //the find function or irrmap returns a pointer to a map Node + //if the key can be found, otherwise it returns null + //the map node has the function getValue and getKey, as we already know the key, we return node->getValue() + map::Node* n = SettingMap.find(key); + if (n) + return n->getValue(); + else + return L""; + } + + // + bool getSettingAsBoolean(const stringw& key ) const + { + stringw s = getSetting(key); + if (s.empty()) + return false; + return s.equals_ignore_case(L"1"); + } + + // + s32 getSettingAsInteger(const stringw& key) const + { + //we implicitly cast to string instead of stringw because strtol10 does not accept wide strings + const stringc s = getSetting(key); + if (s.empty()) + return 0; + + return strtol10(s.c_str()); + } + +public: + map DriverOptions; //available options for driver config + map ResolutionOptions; //available options for resolution config +private: + SettingManager(const SettingManager& other); // defined but not implemented + SettingManager& operator=(const SettingManager& other); // defined but not implemented + + map SettingMap; //current config + + stringw SettingsFile; // location of the xml, usually the + irr::IrrlichtDevice* NullDevice; +}; + +/* +Application context for global variables +*/ +struct SAppContext +{ + SAppContext() + : Device(0),Gui(0), Driver(0), Settings(0), ShouldQuit(false), + ButtonSave(0), ButtonExit(0), ListboxDriver(0), + ListboxResolution(0), CheckboxFullscreen(0) + { + } + + ~SAppContext() + { + if (Settings) + delete Settings; + + if (Device) + { + Device->closeDevice(); + Device->drop(); + } + } + + IrrlichtDevice* Device; + IGUIEnvironment* Gui; + IVideoDriver* Driver; + SettingManager* Settings; + bool ShouldQuit; + + //settings dialog + IGUIButton* ButtonSave; + IGUIButton* ButtonExit; + IGUIListBox* ListboxDriver; + IGUIListBox* ListboxResolution; + IGUICheckBox* CheckboxFullscreen; +}; + +/* + A typical event receiver. +*/ +class MyEventReceiver : public IEventReceiver +{ +public: + MyEventReceiver(SAppContext & a) : App(a) { } + + virtual bool OnEvent(const SEvent& event) + { + if (event.EventType == EET_GUI_EVENT ) + { + switch ( event.GUIEvent.EventType ) + { + //handle button click events + case EGET_BUTTON_CLICKED: + { + //Our save button was called so we obtain the settings from our dialog and save them + if ( event.GUIEvent.Caller == App.ButtonSave ) + { + //if there is a selection write it + if ( App.ListboxDriver->getSelected() != -1) + App.Settings->setSetting(L"driver", App.ListboxDriver->getListItem(App.ListboxDriver->getSelected())); + + //if there is a selection write it + if ( App.ListboxResolution->getSelected() != -1) + App.Settings->setSetting(L"resolution", App.ListboxResolution->getListItem(App.ListboxResolution->getSelected())); + + App.Settings->setSetting(L"fullscreen", App.CheckboxFullscreen->isChecked()); + + + if (App.Settings->save()) + { + App.Gui->addMessageBox(L"settings save",L"settings saved, please restart for settings to change effect","",true); + } + } + // cancel/exit button clicked, tell the application to exit + else if ( event.GUIEvent.Caller == App.ButtonExit) + { + App.ShouldQuit = true; + } + } + break; + } + } + + return false; + } + +private: + SAppContext & App; +}; + + +/* +Function to create a video settings dialog +This dialog shows the current settings from the configuration xml and allows them to be changed +*/ +void createSettingsDialog(SAppContext& app) +{ + // first get rid of alpha in gui + for (irr::s32 i=0; igetSkin()->getColor((irr::gui::EGUI_DEFAULT_COLOR)i); + col.setAlpha(255); + app.Gui->getSkin()->setColor((irr::gui::EGUI_DEFAULT_COLOR)i, col); + } + + //create video settings windows + gui::IGUIWindow* windowSettings = app.Gui->addWindow(rect(10,10,400,400),true,L"Videosettings"); + app.Gui->addStaticText (L"Select your desired video settings", rect< s32 >(10,20, 200, 40), false, true, windowSettings); + + // add listbox for driver choice + app.Gui->addStaticText (L"Driver", rect< s32 >(10,50, 200, 60), false, true, windowSettings); + app.ListboxDriver = app.Gui->addListBox(rect(10,60,220,120), windowSettings, 1,true); + + //add all available options to the driver choice listbox + map::Iterator i = app.Settings->DriverOptions.getIterator(); + for(; !i.atEnd(); i++) + app.ListboxDriver->addItem(i->getKey().c_str()); + + //set currently selected driver + app.ListboxDriver->setSelected(app.Settings->getSetting("driver").c_str()); + + // add listbox for resolution choice + app.Gui->addStaticText (L"Resolution", rect< s32 >(10,130, 200, 140), false, true, windowSettings); + app.ListboxResolution = app.Gui->addListBox(rect(10,140,220,200), windowSettings, 1,true); + + //add all available options to the resolution listbox + map::Iterator ri = app.Settings->ResolutionOptions.getIterator(); + for(; !ri.atEnd(); ri++) + app.ListboxResolution->addItem(ri->getKey().c_str()); + + //set currently selected resolution + app.ListboxResolution->setSelected(app.Settings->getSetting("resolution").c_str()); + + //add checkbox to toggle fullscreen, initially set to loaded setting + app.CheckboxFullscreen = app.Gui->addCheckBox( + app.Settings->getSettingAsBoolean("fullscreen"), + rect(10,220,220,240), windowSettings, -1, + L"Fullscreen"); + + //last but not least add save button + app.ButtonSave = app.Gui->addButton( + rect(80,250,150,270), windowSettings, 2, + L"Save video settings"); + + //exit/cancel button + app.ButtonExit = app.Gui->addButton( + rect(160,250,240,270), windowSettings, 2, + L"Cancel and exit"); +} + +/* +The main function. Creates all objects and does the XML handling. +*/ +int main() +{ + //create new application context + SAppContext app; + + //create device creation parameters that can get overwritten by our settings file + SIrrlichtCreationParameters param; + param.DriverType = EDT_SOFTWARE; + param.WindowSize.set(640,480); + + // 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"); + if ( !app.Settings->load() ) + { + // ... + // Here add your own exception handling, for now we continue because there are defaults set in SettingManager constructor + // ... + } + else + { + //settings xml loaded from disk, + + //map driversetting to driver type and test if the setting is valid + //the DriverOptions map contains string representations mapped to to irrlicht E_DRIVER_TYPE enum + //e.g "direct3d9" will become 4 + //see DriverOptions in the settingmanager class for details + map::Node* driver = app.Settings->DriverOptions.find( app.Settings->getSetting("driver") ); + + if (driver) + { + if ( irr::IrrlichtDevice::isDriverSupported( static_cast( driver->getValue() ))) + { + // selected driver is supported, so we use it. + param.DriverType = static_cast( driver->getValue()); + } + } + + //map resolution setting to dimension in a similar way as demonstrated above + map::Node* res = app.Settings->ResolutionOptions.find( app.Settings->getSetting("resolution") ); + if (res) + { + param.WindowSize = res->getValue(); + } + + //get fullscreen setting from config + param.Fullscreen = app.Settings->getSettingAsBoolean("fullscreen"); + } + + //create the irrlicht device using the settings + app.Device = createDeviceEx(param); + if (app.Device == 0) + { + // You can add your own exception handling on driver failure + exit(0); + } + + app.Device->setWindowCaption(L"Xmlhandling - Irrlicht engine tutorial"); + app.Driver = app.Device->getVideoDriver(); + app.Gui = app.Device->getGUIEnvironment(); + + createSettingsDialog(app); + + //set event receiver so we can respond to gui events + MyEventReceiver receiver(app); + app.Device->setEventReceiver(&receiver); + + //enter main loop + while (!app.ShouldQuit && app.Device->run()) + { + if (app.Device->isWindowActive()) + { + app.Driver->beginScene(true, true, SColor(0,200,200,200)); + app.Gui->drawAll(); + app.Driver->endScene(); + } + app.Device->sleep(10); + } + + //app destroys device in destructor + + return 0; +} + +/* +**/ diff --git a/libraries/irrlicht-1.8.1/examples/26.OcclusionQuery/Makefile b/libraries/irrlicht-1.8.1/examples/26.OcclusionQuery/Makefile new file mode 100644 index 0000000..87e37e4 --- /dev/null +++ b/libraries/irrlicht-1.8.1/examples/26.OcclusionQuery/Makefile @@ -0,0 +1,39 @@ +# Makefile for Irrlicht Examples +# It's usually sufficient to change just the target name and source file list +# and be sure that CXX is set to a valid compiler +Target = 26.OcclusionQuery +Sources = main.cpp + +# general compiler settings +CPPFLAGS = -I../../include -I/usr/X11R6/include +CXXFLAGS = -O3 -ffast-math +#CXXFLAGS = -g -Wall + +#default target is Linux +all: all_linux + +ifeq ($(HOSTTYPE), x86_64) +LIBSELECT=64 +endif + +# target specific settings +all_linux: LDFLAGS = -L/usr/X11R6/lib$(LIBSELECT) -L../../lib/Linux -lIrrlicht -lGL -lXxf86vm -lXext -lX11 -lXcursor +all_linux clean_linux: SYSTEM=Linux +all_win32: LDFLAGS = -L../../lib/Win32-gcc -lIrrlicht -lopengl32 -lm +all_win32: CPPFLAGS += -D__GNUWIN32__ -D_WIN32 -DWIN32 -D_WINDOWS -D_MBCS -D_USRDLL +all_win32 clean_win32: SYSTEM=Win32-gcc +all_win32 clean_win32: SUF=.exe +# name of the binary - only valid for targets which set SYSTEM +DESTPATH = ../../bin/$(SYSTEM)/$(Target)$(SUF) + +all_linux all_win32: + $(warning Building...) + $(CXX) $(CPPFLAGS) $(CXXFLAGS) $(Sources) -o $(DESTPATH) $(LDFLAGS) + +clean: clean_linux clean_win32 + $(warning Cleaning...) + +clean_linux clean_win32: + @$(RM) $(DESTPATH) + +.PHONY: all all_win32 clean clean_linux clean_win32 diff --git a/libraries/irrlicht-1.8.1/examples/26.OcclusionQuery/OcclusionQuery.cbp b/libraries/irrlicht-1.8.1/examples/26.OcclusionQuery/OcclusionQuery.cbp new file mode 100644 index 0000000..8872705 --- /dev/null +++ b/libraries/irrlicht-1.8.1/examples/26.OcclusionQuery/OcclusionQuery.cbp @@ -0,0 +1,55 @@ + + + + + + diff --git a/libraries/irrlicht-1.8.1/examples/26.OcclusionQuery/OcclusionQuery.dev b/libraries/irrlicht-1.8.1/examples/26.OcclusionQuery/OcclusionQuery.dev new file mode 100644 index 0000000..e9d7c04 --- /dev/null +++ b/libraries/irrlicht-1.8.1/examples/26.OcclusionQuery/OcclusionQuery.dev @@ -0,0 +1,59 @@ +[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/libraries/irrlicht-1.8.1/examples/26.OcclusionQuery/OcclusionQuery.vcproj b/libraries/irrlicht-1.8.1/examples/26.OcclusionQuery/OcclusionQuery.vcproj new file mode 100644 index 0000000..602f2d3 --- /dev/null +++ b/libraries/irrlicht-1.8.1/examples/26.OcclusionQuery/OcclusionQuery.vcproj @@ -0,0 +1,163 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/libraries/irrlicht-1.8.1/examples/26.OcclusionQuery/OcclusionQuery_vc10.vcxproj b/libraries/irrlicht-1.8.1/examples/26.OcclusionQuery/OcclusionQuery_vc10.vcxproj new file mode 100644 index 0000000..d56f995 --- /dev/null +++ b/libraries/irrlicht-1.8.1/examples/26.OcclusionQuery/OcclusionQuery_vc10.vcxproj @@ -0,0 +1,231 @@ + + + + + Debug + Win32 + + + Debug + x64 + + + Release + Win32 + + + Release + x64 + + + + 26.OcclusionQuery + {5CE0E2E7-879D-4152-B61D-24E7D0707B45} + OcclusionQuery + + + + Application + false + MultiByte + + + Application + false + MultiByte + + + Application + false + MultiByte + + + Application + false + MultiByte + + + + + + + + + + + + + + + + + + + + + + + <_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/libraries/irrlicht-1.8.1/examples/26.OcclusionQuery/OcclusionQuery_vc11.vcxproj b/libraries/irrlicht-1.8.1/examples/26.OcclusionQuery/OcclusionQuery_vc11.vcxproj new file mode 100644 index 0000000..fb8b7a9 --- /dev/null +++ b/libraries/irrlicht-1.8.1/examples/26.OcclusionQuery/OcclusionQuery_vc11.vcxproj @@ -0,0 +1,235 @@ + + + + + Debug + Win32 + + + Debug + x64 + + + Release + Win32 + + + Release + x64 + + + + 26.OcclusionQuery + {5CE0E2E7-879D-4152-B61D-24E7D0707B45} + OcclusionQuery + + + + Application + false + MultiByte + v110 + + + Application + false + MultiByte + v110 + + + Application + false + MultiByte + v110 + + + Application + false + MultiByte + v110 + + + + + + + + + + + + + + + + + + + + + + + <_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/libraries/irrlicht-1.8.1/examples/26.OcclusionQuery/OcclusionQuery_vc8.vcproj b/libraries/irrlicht-1.8.1/examples/26.OcclusionQuery/OcclusionQuery_vc8.vcproj new file mode 100644 index 0000000..faa137f --- /dev/null +++ b/libraries/irrlicht-1.8.1/examples/26.OcclusionQuery/OcclusionQuery_vc8.vcproj @@ -0,0 +1,231 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/libraries/irrlicht-1.8.1/examples/26.OcclusionQuery/OcclusionQuery_vc9.vcproj b/libraries/irrlicht-1.8.1/examples/26.OcclusionQuery/OcclusionQuery_vc9.vcproj new file mode 100644 index 0000000..c15a527 --- /dev/null +++ b/libraries/irrlicht-1.8.1/examples/26.OcclusionQuery/OcclusionQuery_vc9.vcproj @@ -0,0 +1,230 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/libraries/irrlicht-1.8.1/examples/26.OcclusionQuery/main.cpp b/libraries/irrlicht-1.8.1/examples/26.OcclusionQuery/main.cpp new file mode 100644 index 0000000..17f64b2 --- /dev/null +++ b/libraries/irrlicht-1.8.1/examples/26.OcclusionQuery/main.cpp @@ -0,0 +1,213 @@ +/** Example 026 OcclusionQuery + +This Tutorial shows how to speed up rendering by use of the +OcclusionQuery feature. The usual rendering tries to avoid rendering of +scene nodes by culling those nodes which are outside the visible area, the +view frustum. However, this technique does not cope with occluded objects +which are still in the line of sight, but occluded by some larger object +between the object and the eye (camera). Occlusion queries check exactly that. +The queries basically measure the number of pixels that a previous render +left on the screen. +Since those pixels cannot be recognized at the end of a rendering anymore, +the pixel count is measured directly when rendering. Thus, one needs to render +the occluder (the object in front) first. This object needs to write to the +z-buffer in order to become a real occluder. Then the node is rendered and in +case a z-pass happens, i.e. the pixel is written to the framebuffer, the pixel +is counted in the query. +The result of a query is the number of pixels which got through. One can, based +on this number, judge if the scene node is visible enough to be rendered, or if +the node should be removed in the next round. Also note that the number of +pixels is a safe over approximation in general. The pixels might be overdrawn +later on, and the GPU tries to avoid inaccuracies which could lead to false +negatives in the queries. + +As you might have recognized already, we had to render the node to get the +numbers. So where's the benefit, you might say. There are several ways where +occlusion queries can help. It is often a good idea to just render the bbox +of the node instead of the actual mesh. This is really fast and is a safe over +approximation. If you need a more exact render with the actual geometry, it's +a good idea to render with just basic solid material. Avoid complex shaders +and state changes through textures. There's no need while just doing the +occlusion query. At least if the render is not used for the actual scene. This +is the third way to optimize occlusion queries. Just check the queries every +5th or 10th frame, or even less frequent. This depends on the movement speed +of the objects and camera. +*/ + +#ifdef _MSC_VER +// We'll also define this to stop MSVC complaining about sprintf(). +#define _CRT_SECURE_NO_WARNINGS +#pragma comment(lib, "Irrlicht.lib") +#endif + +#include +#include "driverChoice.h" + +using namespace irr; + +/* +We need keyboard input events to switch some parameters +*/ +class MyEventReceiver : public IEventReceiver +{ +public: + // This is the one method that we have to implement + virtual bool OnEvent(const SEvent& event) + { + // Remember whether each key is down or up + if (event.EventType == irr::EET_KEY_INPUT_EVENT) + KeyIsDown[event.KeyInput.Key] = event.KeyInput.PressedDown; + + return false; + } + + // This is used to check whether a key is being held down + virtual bool IsKeyDown(EKEY_CODE keyCode) const + { + return KeyIsDown[keyCode]; + } + + MyEventReceiver() + { + for (u32 i=0; i(640, 480), 16, false, false, false, &receiver); + + if (device == 0) + return 1; // could not create selected driver. + + video::IVideoDriver* driver = device->getVideoDriver(); + scene::ISceneManager* smgr = device->getSceneManager(); + + smgr->getGUIEnvironment()->addStaticText(L"Press Space to hide occluder.", core::recti(10,10, 200,50)); + + /* + Create the node to be occluded. We create a sphere node with high poly count. + */ + scene::ISceneNode * node = smgr->addSphereSceneNode(10, 64); + if (node) + { + node->setPosition(core::vector3df(0,0,60)); + node->setMaterialTexture(0, driver->getTexture("../../media/wall.bmp")); + node->setMaterialFlag(video::EMF_LIGHTING, false); + } + + /* + Now we create another node, the occluder. It's a simple plane. + */ + scene::ISceneNode* plane = smgr->addMeshSceneNode(smgr->addHillPlaneMesh( + "plane", core::dimension2df(10,10), core::dimension2du(2,2)), 0, -1, + core::vector3df(0,0,20), core::vector3df(270,0,0)); + + if (plane) + { + plane->setMaterialTexture(0, driver->getTexture("../../media/t351sml.jpg")); + plane->setMaterialFlag(video::EMF_LIGHTING, false); + plane->setMaterialFlag(video::EMF_BACK_FACE_CULLING, true); + } + + /* + Here we create the occlusion query. Because we don't have a plain mesh scene node + (ESNT_MESH or ESNT_ANIMATED_MESH), we pass the base geometry as well. Instead, + we could also pass a simpler mesh or the bounding box. But we will use a time + based method, where the occlusion query renders to the frame buffer and in case + of success (occlusion), the mesh is not drawn for several frames. + */ + driver->addOcclusionQuery(node, ((scene::IMeshSceneNode*)node)->getMesh()); + + /* + We have done everything, just a camera and draw it. We also write the + current frames per second and the name of the driver to the caption of the + window to examine the render speedup. + We also store the time for measuring the time since the last occlusion query ran + and store whether the node should be visible in the next frames. + */ + smgr->addCameraSceneNode(); + int lastFPS = -1; + u32 timeNow = device->getTimer()->getTime(); + bool nodeVisible=true; + + while(device->run()) + { + plane->setVisible(!receiver.IsKeyDown(irr::KEY_SPACE)); + + driver->beginScene(true, true, 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 + managers to collect a number of possible occluders in a separately rendered + scene. + */ + node->setVisible(nodeVisible); + smgr->drawAll(); + smgr->getGUIEnvironment()->drawAll(); + + /* + Once in a while, here every 100 ms, we check the visibility. We run the queries, + update the pixel value, and query the result. Since we already rendered the node + we render the query invisible. The update is made blocking, as we need the result + immediately. If you don't need the result immediately, e.g. because you have other + things to render, you can call the update non-blocking. This gives the GPU more + time to pass back the results without flushing the render pipeline. + If the update was called non-blocking, the result from getOcclusionQueryResult is + either the previous value, or 0xffffffff if no value has been generated at all, yet. + The result is taken immediately as visibility flag for the node. + */ + if (device->getTimer()->getTime()-timeNow>100) + { + driver->runAllOcclusionQueries(false); + driver->updateAllOcclusionQueries(); + nodeVisible=driver->getOcclusionQueryResult(node)>0; + timeNow=device->getTimer()->getTime(); + } + + driver->endScene(); + + int fps = driver->getFPS(); + + if (lastFPS != fps) + { + core::stringw tmp(L"OcclusionQuery Example ["); + tmp += driver->getName(); + tmp += L"] fps: "; + tmp += fps; + + device->setWindowCaption(tmp.c_str()); + lastFPS = fps; + } + } + + /* + In the end, delete the Irrlicht device. + */ + device->drop(); + + return 0; +} + +/* +That's it. Compile and play around with the program. +**/ diff --git a/libraries/irrlicht-1.8.1/examples/BuildAllExamples.MacOSX/DemoApp-Info.plist b/libraries/irrlicht-1.8.1/examples/BuildAllExamples.MacOSX/DemoApp-Info.plist new file mode 100644 index 0000000..a754c7f --- /dev/null +++ b/libraries/irrlicht-1.8.1/examples/BuildAllExamples.MacOSX/DemoApp-Info.plist @@ -0,0 +1,24 @@ + + + + + CFBundleDevelopmentRegion + English + CFBundleExecutable + ${EXECUTABLE_NAME} + CFBundleIdentifier + com.irrlicht.${EXECUTABLE_NAME} + CFBundleInfoDictionaryVersion + 6.0 + CFBundlePackageType + APPL + CFBundleSignature + IRRL + CFBundleVersion + 1.0 + NSMainNibFile + MainMenu + NSPrincipalClass + NSApplication + + diff --git a/libraries/irrlicht-1.8.1/examples/BuildAllExamples.workspace b/libraries/irrlicht-1.8.1/examples/BuildAllExamples.workspace new file mode 100644 index 0000000..56933c1 --- /dev/null +++ b/libraries/irrlicht-1.8.1/examples/BuildAllExamples.workspace @@ -0,0 +1,35 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/libraries/irrlicht-1.8.1/examples/BuildAllExamples_v8.sln b/libraries/irrlicht-1.8.1/examples/BuildAllExamples_v8.sln new file mode 100644 index 0000000..4368378 --- /dev/null +++ b/libraries/irrlicht-1.8.1/examples/BuildAllExamples_v8.sln @@ -0,0 +1,236 @@ + +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/libraries/irrlicht-1.8.1/examples/BuildAllExamples_v9.sln b/libraries/irrlicht-1.8.1/examples/BuildAllExamples_v9.sln new file mode 100644 index 0000000..61ebb1f --- /dev/null +++ b/libraries/irrlicht-1.8.1/examples/BuildAllExamples_v9.sln @@ -0,0 +1,284 @@ + +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 +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 + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection +EndGlobal diff --git a/libraries/irrlicht-1.8.1/examples/BuildAllExamples_vc10.sln b/libraries/irrlicht-1.8.1/examples/BuildAllExamples_vc10.sln new file mode 100644 index 0000000..11190a6 --- /dev/null +++ b/libraries/irrlicht-1.8.1/examples/BuildAllExamples_vc10.sln @@ -0,0 +1,409 @@ + +Microsoft Visual Studio Solution File, Format Version 11.00 +# Visual Studio 2010 +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Irrlicht", "..\source\Irrlicht\Irrlicht10.0.vcxproj", "{E08E042A-6C45-411B-92BE-3CC31331019F}" +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "01.HelloWorld", "01.HelloWorld\HelloWorld_vc10.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_vc10.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_vc10.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_vc10.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_vc10.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_vc10.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_vc10.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_vc10.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_vc10.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_vc10.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_vc10.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_vc10.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_vc10.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_vc10.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_vc10.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_vc10.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_vc10.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_vc10.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_vc10.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_vc10.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_vc10.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_vc10.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_vc10.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_vc10.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}") = "Demo", "Demo\Demo_vc10.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}") = "GUIEditor", "..\tools\GUIEditor\GUI Editor_vc10.vcxproj", "{853A396E-C031-4C26-A716-5B4E176BE11D}" +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "FontTool", "..\tools\IrrFontTool\newFontTool\irrFontTool_vc10.vcxproj", "{4D53E40F-37E3-42B1-8848-F4C6F8313A17}" +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "MeshConverter", "..\tools\MeshConverter\MeshConverter_vc10.vcxproj", "{E72B637E-4AA6-46F3-885F-AC67B4B470ED}" +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "26.OcclusionQuery", "26.OcclusionQuery\OcclusionQuery_vc10.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}") = "25.XmlHandling", "25.XmlHandling\XmlHandling_vc10.vcxproj", "{8FDA260E-EF27-4F8C-8720-7AF707DD0D9E}" + ProjectSection(ProjectDependencies) = postProject + {E08E042A-6C45-411B-92BE-3CC31331019F} = {E08E042A-6C45-411B-92BE-3CC31331019F} + EndProjectSection +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Win32 = Debug|Win32 + Debug|x64 = Debug|x64 + Release|Win32 = Release|Win32 + Release|x64 = 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}.Debug|x64.Build.2 = Static lib - Release - Fast FPU|x64 + {E08E042A-6C45-411B-92BE-3CC31331019F}.Debug|x64.Build.4 = SDL-Debug|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 + {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|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 + {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|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 + {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|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 + {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|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 + {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|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 + {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|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 + {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|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 + {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|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 + {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|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 + {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|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 + {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|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 + {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|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 + {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|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 + {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|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 + {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|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 + {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|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 + {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|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 + {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|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 + {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|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 + {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|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 + {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|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 + {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|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 + {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|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 + {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|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 + {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|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 + {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|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 + {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|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 + {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|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 + {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|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 + {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|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 + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection +EndGlobal diff --git a/libraries/irrlicht-1.8.1/examples/BuildAllExamples_vc11.sln b/libraries/irrlicht-1.8.1/examples/BuildAllExamples_vc11.sln new file mode 100644 index 0000000..50ac646 --- /dev/null +++ b/libraries/irrlicht-1.8.1/examples/BuildAllExamples_vc11.sln @@ -0,0 +1,409 @@ + +Microsoft Visual Studio Solution File, Format Version 11.00 +# Visual Studio 2012 +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Irrlicht", "..\source\Irrlicht\Irrlicht11.0.vcxproj", "{E08E042A-6C45-411B-92BE-3CC31331019F}" +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "01.HelloWorld", "01.HelloWorld\HelloWorld_vc11.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_vc11.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_vc11.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_vc11.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_vc11.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_vc11.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_vc11.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_vc11.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_vc11.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_vc11.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_vc11.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_vc11.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_vc11.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_vc11.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_vc11.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_vc11.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_vc11.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_vc11.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_vc11.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_vc11.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_vc11.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_vc11.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_vc11.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_vc11.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}") = "Demo", "Demo\Demo_vc11.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}") = "GUIEditor", "..\tools\GUIEditor\GUI Editor_vc11.vcxproj", "{853A396E-C031-4C26-A716-5B4E176BE11D}" +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "FontTool", "..\tools\IrrFontTool\newFontTool\irrFontTool_vc11.vcxproj", "{4D53E40F-37E3-42B1-8848-F4C6F8313A17}" +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "MeshConverter", "..\tools\MeshConverter\MeshConverter_vc11.vcxproj", "{E72B637E-4AA6-46F3-885F-AC67B4B470ED}" +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "26.OcclusionQuery", "26.OcclusionQuery\OcclusionQuery_vc11.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}") = "25.XmlHandling", "25.XmlHandling\XmlHandling_vc11.vcxproj", "{8FDA260E-EF27-4F8C-8720-7AF707DD0D9E}" + ProjectSection(ProjectDependencies) = postProject + {E08E042A-6C45-411B-92BE-3CC31331019F} = {E08E042A-6C45-411B-92BE-3CC31331019F} + EndProjectSection +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Win32 = Debug|Win32 + Debug|x64 = Debug|x64 + Release|Win32 = Release|Win32 + Release|x64 = 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}.Debug|x64.Build.2 = Static lib - Release - Fast FPU|x64 + {E08E042A-6C45-411B-92BE-3CC31331019F}.Debug|x64.Build.4 = SDL-Debug|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 + {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|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 + {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|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 + {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|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 + {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|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 + {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|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 + {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|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 + {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|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 + {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|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 + {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|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 + {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|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 + {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|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 + {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|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 + {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|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 + {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|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 + {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|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 + {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|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 + {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|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 + {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|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 + {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|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 + {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|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 + {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|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 + {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|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 + {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|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 + {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|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 + {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|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 + {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|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 + {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|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 + {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|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 + {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|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 + {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|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 + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection +EndGlobal diff --git a/libraries/irrlicht-1.8.1/examples/Demo/CDemo.cpp b/libraries/irrlicht-1.8.1/examples/Demo/CDemo.cpp new file mode 100644 index 0000000..1ce72a9 --- /dev/null +++ b/libraries/irrlicht-1.8.1/examples/Demo/CDemo.cpp @@ -0,0 +1,815 @@ +// This is a Demo of the Irrlicht Engine (c) 2005-2009 by N.Gebhardt. +// This file is not documented. + +#include "CDemo.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), + driverType(d), device(0), +#ifdef USE_IRRKLANG + irrKlang(0), ballSound(0), impactSound(0), +#endif +#ifdef USE_SDL_MIXER + stream(0), ballSound(0), impactSound(0), +#endif + currentScene(-2), backColor(0), statusText(0), inOutFader(0), + quakeLevelMesh(0), quakeLevelNode(0), skyboxNode(0), model1(0), model2(0), + campFire(0), metaSelector(0), mapSelector(0), sceneStartTime(0), + timeForThisScene(0) +{ +} + + +CDemo::~CDemo() +{ + if (mapSelector) + mapSelector->drop(); + + if (metaSelector) + metaSelector->drop(); + +#ifdef USE_IRRKLANG + if (irrKlang) + irrKlang->drop(); +#endif +} + + +void CDemo::run() +{ + core::dimension2d resolution ( 800, 600 ); + + if ( driverType == video::EDT_BURNINGSVIDEO || driverType == video::EDT_SOFTWARE ) + { + resolution.Width = 640; + resolution.Height = 480; + } + + irr::SIrrlichtCreationParameters params; + params.DriverType=driverType; + params.WindowSize=resolution; + params.Bits=32; + params.Fullscreen=fullscreen; + params.Stencilbuffer=shadows; + params.Vsync=vsync; + params.AntiAlias=aa; + params.EventReceiver=this; + + device = createDeviceEx(params); + if (!device) + return; + + if (device->getFileSystem()->existFile("irrlicht.dat")) + device->getFileSystem()->addFileArchive("irrlicht.dat"); + else + device->getFileSystem()->addFileArchive("../../media/irrlicht.dat"); + if (device->getFileSystem()->existFile("map-20kdm2.pk3")) + device->getFileSystem()->addFileArchive("map-20kdm2.pk3"); + else + device->getFileSystem()->addFileArchive("../../media/map-20kdm2.pk3"); + + video::IVideoDriver* driver = device->getVideoDriver(); + scene::ISceneManager* smgr = device->getSceneManager(); + gui::IGUIEnvironment* guienv = device->getGUIEnvironment(); + + device->setWindowCaption(L"Irrlicht Engine Demo"); + + // set ambient light + smgr->setAmbientLight ( video::SColorf ( 0x00c0c0c0 ) ); + + wchar_t tmp[255]; + + // draw everything + + s32 now = 0; + s32 lastfps = 0; + sceneStartTime = device->getTimer()->getTime(); + while(device->run() && driver) + { + if (device->isWindowActive()) + { + #ifdef USE_IRRKLANG + // update 3D position for sound engine + scene::ICameraSceneNode* cam = smgr->getActiveCamera(); + if (cam && irrKlang) + irrKlang->setListenerPosition(cam->getAbsolutePosition(), cam->getTarget()); + #endif + + // load next scene if necessary + now = device->getTimer()->getTime(); + if (now - sceneStartTime > timeForThisScene && timeForThisScene!=-1) + switchToNextScene(); + + createParticleImpacts(); + + driver->beginScene(timeForThisScene != -1, true, backColor); + + smgr->drawAll(); + guienv->drawAll(); + driver->endScene(); + + // write statistics + const s32 nowfps = driver->getFPS(); + + swprintf(tmp, 255, L"%ls fps:%3d triangles:%0.3f mio/s", + driver->getName(), driver->getFPS(), + driver->getPrimitiveCountDrawn(1) * (1.f / 1000000.f)); + + statusText->setText(tmp); + if ( nowfps != lastfps ) + { + device->setWindowCaption(tmp); + lastfps = nowfps; + } + } + } + + device->drop(); +} + + +bool CDemo::OnEvent(const SEvent& event) +{ + if (!device) + return false; + + if (event.EventType == EET_KEY_INPUT_EVENT && + event.KeyInput.Key == KEY_ESCAPE && + event.KeyInput.PressedDown == false) + { + // user wants to quit. + if (currentScene < 3) + timeForThisScene = 0; + else + device->closeDevice(); + } + else + if (((event.EventType == EET_KEY_INPUT_EVENT && + event.KeyInput.Key == KEY_SPACE && + event.KeyInput.PressedDown == false) || + (event.EventType == EET_MOUSE_INPUT_EVENT && + event.MouseInput.Event == EMIE_LMOUSE_LEFT_UP)) && + currentScene == 3) + { + // shoot + shoot(); + } + else + if (event.EventType == EET_KEY_INPUT_EVENT && + event.KeyInput.Key == KEY_F9 && + event.KeyInput.PressedDown == false) + { + video::IImage* image = device->getVideoDriver()->createScreenShot(); + if (image) + { + device->getVideoDriver()->writeImageToFile(image, "screenshot.bmp"); + device->getVideoDriver()->writeImageToFile(image, "screenshot.png"); + device->getVideoDriver()->writeImageToFile(image, "screenshot.tga"); + device->getVideoDriver()->writeImageToFile(image, "screenshot.ppm"); + device->getVideoDriver()->writeImageToFile(image, "screenshot.jpg"); + device->getVideoDriver()->writeImageToFile(image, "screenshot.pcx"); + image->drop(); + } + } + else + if (device->getSceneManager()->getActiveCamera()) + { + device->getSceneManager()->getActiveCamera()->OnEvent(event); + return true; + } + + return false; +} + + +void CDemo::switchToNextScene() +{ + currentScene++; + if (currentScene > 3) + currentScene = 1; + + scene::ISceneManager* sm = device->getSceneManager(); + scene::ISceneNodeAnimator* sa = 0; + scene::ICameraSceneNode* camera = 0; + + camera = sm->getActiveCamera(); + if (camera) + { + sm->setActiveCamera(0); + camera->remove(); + camera = 0; + } + + switch(currentScene) + { + case -1: // loading screen + timeForThisScene = 0; + createLoadingScreen(); + break; + + case 0: // load scene + timeForThisScene = 0; + loadSceneData(); + break; + + case 1: // panorama camera + { + currentScene += 1; + //camera = sm->addCameraSceneNode(0, core::vector3df(0,0,0), core::vector3df(-586,708,52)); + //camera->setTarget(core::vector3df(0,400,0)); + + core::array points; + + points.push_back(core::vector3df(-931.473755f, 138.300003f, 987.279114f)); // -49873 + points.push_back(core::vector3df(-847.902222f, 136.757553f, 915.792725f)); // -50559 + points.push_back(core::vector3df(-748.680420f, 152.254501f, 826.418945f)); // -51964 + points.push_back(core::vector3df(-708.428406f, 213.569580f, 784.466675f)); // -53251 + points.push_back(core::vector3df(-686.217651f, 288.141174f, 762.965576f)); // -54015 + points.push_back(core::vector3df(-679.685059f, 365.095612f, 756.551453f)); // -54733 + points.push_back(core::vector3df(-671.317871f, 447.360107f, 749.394592f)); // -55588 + points.push_back(core::vector3df(-669.468445f, 583.335632f, 747.711853f)); // -56178 + points.push_back(core::vector3df(-667.611267f, 727.313232f, 746.018250f)); // -56757 + points.push_back(core::vector3df(-665.853210f, 862.791931f, 744.436096f)); // -57859 + points.push_back(core::vector3df(-642.649597f, 1026.047607f, 724.259827f)); // -59705 + points.push_back(core::vector3df(-517.793884f, 838.396790f, 490.326050f)); // -60983 + points.push_back(core::vector3df(-474.387299f, 715.691467f, 344.639984f)); // -61629 + points.push_back(core::vector3df(-444.600250f, 601.155701f, 180.938095f)); // -62319 + points.push_back(core::vector3df(-414.808899f, 479.691406f, 4.866660f)); // -63048 + points.push_back(core::vector3df(-410.418945f, 429.642242f, -134.332687f)); // -63757 + points.push_back(core::vector3df(-399.837585f, 411.498383f, -349.350983f)); // -64418 + points.push_back(core::vector3df(-390.756653f, 403.970093f, -524.454407f)); // -65005 + points.push_back(core::vector3df(-334.864227f, 350.065491f, -732.397400f)); // -65701 + points.push_back(core::vector3df(-195.253387f, 349.577209f, -812.475891f)); // -66335 + points.push_back(core::vector3df(16.255573f, 363.743134f, -833.800415f)); // -67170 + points.push_back(core::vector3df(234.940964f, 352.957825f, -820.150696f)); // -67939 + points.push_back(core::vector3df(436.797668f, 349.236450f, -816.914185f)); // -68596 + points.push_back(core::vector3df(575.236206f, 356.244812f, -719.788513f)); // -69166 + points.push_back(core::vector3df(594.131042f, 387.173828f, -609.675598f)); // -69744 + points.push_back(core::vector3df(617.615234f, 412.002899f, -326.174072f)); // -70640 + points.push_back(core::vector3df(606.456848f, 403.221954f, -104.179291f)); // -71390 + points.push_back(core::vector3df(610.958252f, 407.037750f, 117.209778f)); // -72085 + points.push_back(core::vector3df(597.956909f, 395.167877f, 345.942200f)); // -72817 + points.push_back(core::vector3df(587.383118f, 391.444519f, 566.098633f)); // -73477 + points.push_back(core::vector3df(559.572449f, 371.991333f, 777.689453f)); // -74124 + points.push_back(core::vector3df(423.753204f, 329.990051f, 925.859741f)); // -74941 + points.push_back(core::vector3df(247.520050f, 252.818954f, 935.311829f)); // -75651 + points.push_back(core::vector3df(114.756012f, 199.799759f, 805.014160f)); + points.push_back(core::vector3df(96.783348f, 181.639481f, 648.188110f)); + points.push_back(core::vector3df(97.865623f, 138.905975f, 484.812561f)); + points.push_back(core::vector3df(99.612457f, 102.463669f, 347.603210f)); + points.push_back(core::vector3df(99.612457f, 102.463669f, 347.603210f)); + points.push_back(core::vector3df(99.612457f, 102.463669f, 347.603210f)); + + timeForThisScene = (points.size()-3)* 1000; + + camera = sm->addCameraSceneNode(0, points[0], core::vector3df(0 ,400,0)); + //camera->setTarget(core::vector3df(0,400,0)); + + sa = sm->createFollowSplineAnimator(device->getTimer()->getTime(), + points); + camera->addAnimator(sa); + sa->drop(); + + model1->setVisible(false); + model2->setVisible(false); + campFire->setVisible(false); + inOutFader->fadeIn(7000); + } + break; + + case 2: // down fly anim camera + camera = sm->addCameraSceneNode(0, core::vector3df(100,40,-80), core::vector3df(844,670,-885)); + sa = sm->createFlyStraightAnimator(core::vector3df(94, 1002, 127), + core::vector3df(108, 15, -60), 10000, true); + camera->addAnimator(sa); + timeForThisScene = 9900; + model1->setVisible(true); + model2->setVisible(false); + campFire->setVisible(false); + sa->drop(); + break; + + case 3: // interactive, go around + { + model1->setVisible(true); + model2->setVisible(true); + campFire->setVisible(true); + timeForThisScene = -1; + + SKeyMap keyMap[9]; + keyMap[0].Action = EKA_MOVE_FORWARD; + keyMap[0].KeyCode = KEY_UP; + keyMap[1].Action = EKA_MOVE_FORWARD; + keyMap[1].KeyCode = KEY_KEY_W; + + keyMap[2].Action = EKA_MOVE_BACKWARD; + keyMap[2].KeyCode = KEY_DOWN; + keyMap[3].Action = EKA_MOVE_BACKWARD; + keyMap[3].KeyCode = KEY_KEY_S; + + keyMap[4].Action = EKA_STRAFE_LEFT; + keyMap[4].KeyCode = KEY_LEFT; + keyMap[5].Action = EKA_STRAFE_LEFT; + keyMap[5].KeyCode = KEY_KEY_A; + + keyMap[6].Action = EKA_STRAFE_RIGHT; + keyMap[6].KeyCode = KEY_RIGHT; + keyMap[7].Action = EKA_STRAFE_RIGHT; + keyMap[7].KeyCode = KEY_KEY_D; + + keyMap[8].Action = EKA_JUMP_UP; + keyMap[8].KeyCode = KEY_KEY_J; + + camera = sm->addCameraSceneNodeFPS(0, 100.0f, .4f, -1, keyMap, 9, false, 3.f); + camera->setPosition(core::vector3df(108,140,-140)); + camera->setFarValue(5000.0f); + + scene::ISceneNodeAnimatorCollisionResponse* collider = + sm->createCollisionResponseAnimator( + metaSelector, camera, core::vector3df(25,50,25), + core::vector3df(0, quakeLevelMesh ? -10.f : 0.0f,0), + core::vector3df(0,45,0), 0.005f); + + camera->addAnimator(collider); + collider->drop(); + } + break; + } + + sceneStartTime = device->getTimer()->getTime(); +} + + +void CDemo::loadSceneData() +{ + // load quake level + + video::IVideoDriver* driver = device->getVideoDriver(); + scene::ISceneManager* sm = device->getSceneManager(); + + // Quake3 Shader controls Z-Writing + sm->getParameters()->setAttribute(scene::ALLOW_ZWRITE_ON_TRANSPARENT, true); + + quakeLevelMesh = (scene::IQ3LevelMesh*) sm->getMesh("maps/20kdm2.bsp"); + + if (quakeLevelMesh) + { + u32 i; + + //move all quake level meshes (non-realtime) + core::matrix4 m; + m.setTranslation(core::vector3df(-1300,-70,-1249)); + + for ( i = 0; i != scene::quake3::E_Q3_MESH_SIZE; ++i ) + sm->getMeshManipulator()->transform(quakeLevelMesh->getMesh(i), m); + + quakeLevelNode = sm->addOctreeSceneNode( + quakeLevelMesh->getMesh( scene::quake3::E_Q3_MESH_GEOMETRY)); + if (quakeLevelNode) + { + //quakeLevelNode->setPosition(core::vector3df(-1300,-70,-1249)); + quakeLevelNode->setVisible(true); + + // create map triangle selector + mapSelector = sm->createOctreeTriangleSelector(quakeLevelMesh->getMesh(0), + quakeLevelNode, 128); + + // if not using shader and no gamma it's better to use more lighting, because + // quake3 level are usually dark + quakeLevelNode->setMaterialType ( video::EMT_LIGHTMAP_M4 ); + + // set additive blending if wanted + if (additive) + quakeLevelNode->setMaterialType(video::EMT_LIGHTMAP_ADD); + } + + // the additional mesh can be quite huge and is unoptimized + scene::IMesh * additional_mesh = quakeLevelMesh->getMesh ( scene::quake3::E_Q3_MESH_ITEMS ); + + for ( i = 0; i!= additional_mesh->getMeshBufferCount (); ++i ) + { + scene::IMeshBuffer *meshBuffer = additional_mesh->getMeshBuffer ( i ); + const video::SMaterial &material = meshBuffer->getMaterial(); + + //! The ShaderIndex is stored in the material parameter + s32 shaderIndex = (s32) material.MaterialTypeParam2; + + // the meshbuffer can be rendered without additional support, or it has no shader + const scene::quake3::IShader *shader = quakeLevelMesh->getShader ( shaderIndex ); + if ( 0 == shader ) + { + continue; + } + // Now add the MeshBuffer(s) with the current Shader to the Manager + sm->addQuake3SceneNode ( meshBuffer, shader ); + } + } + + // load sydney model and create 2 instances + + scene::IAnimatedMesh* mesh = 0; + mesh = sm->getMesh("../../media/sydney.md2"); + if (mesh) + { + model1 = sm->addAnimatedMeshSceneNode(mesh); + if (model1) + { + model1->setMaterialTexture(0, driver->getTexture("../../media/spheremap.jpg")); + model1->setPosition(core::vector3df(100,40,-80)); + model1->setScale(core::vector3df(2,2,2)); + model1->setMD2Animation(scene::EMAT_STAND); + model1->setMaterialFlag(video::EMF_LIGHTING, false); + model1->setMaterialFlag(video::EMF_NORMALIZE_NORMALS, true); + model1->setMaterialType(video::EMT_SPHERE_MAP); + model1->addShadowVolumeSceneNode(); + } + + model2 = sm->addAnimatedMeshSceneNode(mesh); + if (model2) + { + 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->setMaterialFlag(video::EMF_LIGHTING, true); + model2->setMaterialFlag(video::EMF_NORMALIZE_NORMALS, true); + model2->addShadowVolumeSceneNode(); + } + } + + scene::ISceneNodeAnimator* anim = 0; + + // 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->setTextureCreationFlag(video::ETCF_CREATE_MIP_MAPS, true); + + // create walk-between-portals animation + + core::vector3df waypoint[2]; + waypoint[0].set(-150,40,100); + waypoint[1].set(350,40,100); + + if (model2) + { + anim = device->getSceneManager()->createFlyStraightAnimator( + waypoint[0], waypoint[1], 2000, true); + model2->addAnimator(anim); + anim->drop(); + } + + // create animation for portals; + + core::array textures; + for (s32 g=1; g<8; ++g) + { + core::stringc tmp("../../media/portal"); + tmp += g; + tmp += ".bmp"; + video::ITexture* t = driver->getTexture( tmp ); + textures.push_back(t); + } + + anim = sm->createTextureAnimator(textures, 100); + + // create portals + + scene::IBillboardSceneNode* bill = 0; + + for (int r=0; r<2; ++r) + { + 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->setMaterialType(video::EMT_TRANSPARENT_ADD_COLOR); + bill->addAnimator(anim); + } + + anim->drop(); + + // create cirlce flying dynamic light with transparent billboard attached + + scene::ILightSceneNode* light = 0; + + light = sm->addLightSceneNode(0, + core::vector3df(0,0,0), video::SColorf(1.0f, 1.0f, 1.f, 1.0f), 500.f); + + anim = sm->createFlyCircleAnimator( + core::vector3df(100,150,80), 80.0f, 0.0005f); + + light->addAnimator(anim); + anim->drop(); + + bill = device->getSceneManager()->addBillboardSceneNode( + light, core::dimension2d(40,40)); + bill->setMaterialFlag(video::EMF_LIGHTING, false); + bill->setMaterialTexture(0, driver->getTexture("../../media/particlewhite.bmp")); + bill->setMaterialType(video::EMT_TRANSPARENT_ADD_COLOR); + + // create meta triangle selector with all triangles selectors in it. + metaSelector = sm->createMetaTriangleSelector(); + metaSelector->addTriangleSelector(mapSelector); + + // create camp fire + + campFire = sm->addParticleSystemSceneNode(false); + campFire->setPosition(core::vector3df(100,120,600)); + campFire->setScale(core::vector3df(2,2,2)); + + scene::IParticleEmitter* em = campFire->createBoxEmitter( + core::aabbox3d(-7,0,-7,7,1,7), + core::vector3df(0.0f,0.06f,0.0f), + 80,100, video::SColor(1,255,255,255),video::SColor(1,255,255,255), 800,2000); + + em->setMinStartSize(core::dimension2d(20.0f, 10.0f)); + em->setMaxStartSize(core::dimension2d(20.0f, 10.0f)); + campFire->setEmitter(em); + em->drop(); + + scene::IParticleAffector* paf = campFire->createFadeOutParticleAffector(); + campFire->addAffector(paf); + paf->drop(); + + campFire->setMaterialFlag(video::EMF_LIGHTING, false); + campFire->setMaterialFlag(video::EMF_ZWRITE_ENABLE, false); + campFire->setMaterialTexture(0, driver->getTexture("../../media/fireball.bmp")); + campFire->setMaterialType(video::EMT_TRANSPARENT_ADD_COLOR); + + // load music + + #ifdef USE_IRRKLANG + if (music) + startIrrKlang(); + #endif + #ifdef USE_SDL_MIXER + if (music) + startSound(); + #endif +} + + +void CDemo::createLoadingScreen() +{ + core::dimension2d size = device->getVideoDriver()->getScreenSize(); + + device->getCursorControl()->setVisible(false); + + // setup loading screen + + backColor.set(255,90,90,156); + + // create in fader + + inOutFader = device->getGUIEnvironment()->addInOutFader(); + inOutFader->setColor(backColor, video::SColor ( 0, 230, 230, 230 )); + + // irrlicht logo + device->getGUIEnvironment()->addImage(device->getVideoDriver()->getTexture("../../media/irrlichtlogo2.png"), + core::position2d(5,5)); + + // loading text + + const int lwidth = size.Width - 20; + const int lheight = 16; + + core::rect pos(10, size.Height-lheight-10, 10+lwidth, size.Height-10); + + device->getGUIEnvironment()->addImage(pos); + statusText = device->getGUIEnvironment()->addStaticText(L"Loading...", pos, true); + statusText->setOverrideColor(video::SColor(255,205,200,200)); + + // load bigger font + + device->getGUIEnvironment()->getSkin()->setFont( + device->getGUIEnvironment()->getFont("../../media/fonthaettenschweiler.bmp")); + + // set new font color + + device->getGUIEnvironment()->getSkin()->setColor(gui::EGDC_BUTTON_TEXT, + video::SColor(255,100,100,100)); +} + + +void CDemo::shoot() +{ + scene::ISceneManager* sm = device->getSceneManager(); + scene::ICameraSceneNode* camera = sm->getActiveCamera(); + + if (!camera || !mapSelector) + return; + + SParticleImpact imp; + imp.when = 0; + + // get line of camera + + core::vector3df start = camera->getPosition(); + core::vector3df end = (camera->getTarget() - start); + end.normalize(); + start += end*8.0f; + end = start + (end * camera->getFarValue()); + + core::triangle3df triangle; + + core::line3d line(start, end); + + // get intersection point with map + scene::ISceneNode* hitNode; + if (sm->getSceneCollisionManager()->getCollisionPoint( + line, mapSelector, end, triangle, hitNode)) + { + // collides with wall + core::vector3df out = triangle.getNormal(); + out.setLength(0.03f); + + imp.when = 1; + imp.outVector = out; + imp.pos = end; + } + else + { + // doesnt collide with wall + core::vector3df start = camera->getPosition(); + core::vector3df end = (camera->getTarget() - start); + end.normalize(); + start += end*8.0f; + end = start + (end * camera->getFarValue()); + } + + // create fire ball + scene::ISceneNode* node = 0; + node = sm->addBillboardSceneNode(0, + core::dimension2d(25,25), start); + + node->setMaterialFlag(video::EMF_LIGHTING, false); + node->setMaterialTexture(0, device->getVideoDriver()->getTexture("../../media/fireball.bmp")); + node->setMaterialType(video::EMT_TRANSPARENT_ADD_COLOR); + + f32 length = (f32)(end - start).getLength(); + const f32 speed = 0.6f; + u32 time = (u32)(length / speed); + + scene::ISceneNodeAnimator* anim = 0; + + // set flight line + + anim = sm->createFlyStraightAnimator(start, end, time); + node->addAnimator(anim); + anim->drop(); + + anim = sm->createDeleteAnimator(time); + node->addAnimator(anim); + anim->drop(); + + if (imp.when) + { + // create impact note + imp.when = device->getTimer()->getTime() + (time - 100); + Impacts.push_back(imp); + } + + // play sound + #ifdef USE_IRRKLANG + if (ballSound) + irrKlang->play2D(ballSound); + #endif + #ifdef USE_SDL_MIXER + if (ballSound) + playSound(ballSound); + #endif +} + + +void CDemo::createParticleImpacts() +{ + u32 now = device->getTimer()->getTime(); + scene::ISceneManager* sm = device->getSceneManager(); + + for (s32 i=0; i<(s32)Impacts.size(); ++i) + if (now > Impacts[i].when) + { + // create smoke particle system + scene::IParticleSystemSceneNode* pas = 0; + + pas = sm->addParticleSystemSceneNode(false, 0, -1, Impacts[i].pos); + + pas->setParticleSize(core::dimension2d(10.0f, 10.0f)); + + scene::IParticleEmitter* em = pas->createBoxEmitter( + core::aabbox3d(-5,-5,-5,5,5,5), + Impacts[i].outVector, 20,40, video::SColor(50,255,255,255),video::SColor(50,255,255,255), + 1200,1600, 20); + + pas->setEmitter(em); + em->drop(); + + scene::IParticleAffector* paf = campFire->createFadeOutParticleAffector(); + pas->addAffector(paf); + paf->drop(); + + pas->setMaterialFlag(video::EMF_LIGHTING, false); + pas->setMaterialFlag(video::EMF_ZWRITE_ENABLE, false); + pas->setMaterialTexture(0, device->getVideoDriver()->getTexture("../../media/smoke.bmp")); + pas->setMaterialType(video::EMT_TRANSPARENT_ADD_COLOR); + + scene::ISceneNodeAnimator* anim = sm->createDeleteAnimator(2000); + pas->addAnimator(anim); + anim->drop(); + + // play impact sound + #ifdef USE_IRRKLANG + if (irrKlang) + { + irrklang::ISound* sound = + irrKlang->play3D(impactSound, Impacts[i].pos, false, false, true); + + if (sound) + { + // adjust max value a bit to make to sound of an impact louder + sound->setMinDistance(400); + sound->drop(); + } + } + #endif + + #ifdef USE_SDL_MIXER + if (impactSound) + playSound(impactSound); + #endif + + // delete entry + Impacts.erase(i); + i--; + } +} + + +#ifdef USE_IRRKLANG +void CDemo::startIrrKlang() +{ + irrKlang = irrklang::createIrrKlangDevice(); + + if (!irrKlang) + return; + + // play music + + irrklang::ISound* snd = irrKlang->play2D("../../media/IrrlichtTheme.ogg", true, false, true); + if ( !snd ) + snd = irrKlang->play2D("IrrlichtTheme.ogg", true, false, true); + + if (snd) + { + snd->setVolume(0.5f); // 50% volume + snd->drop(); + } + + // preload both sound effects + + ballSound = irrKlang->getSoundSource("../../media/ball.wav"); + impactSound = irrKlang->getSoundSource("../../media/impact.wav"); +} +#endif + + +#ifdef USE_SDL_MIXER +void CDemo::startSound() +{ + stream = NULL; + ballSound = NULL; + impactSound = NULL; + + SDL_Init(SDL_INIT_AUDIO); + + if (Mix_OpenAudio(22050, AUDIO_S16, 2, 128)) + return; + + stream = Mix_LoadMUS("../../media/IrrlichtTheme.ogg"); + if (stream) + Mix_PlayMusic(stream, -1); + + ballSound = Mix_LoadWAV("../../media/ball.wav"); + impactSound = Mix_LoadWAV("../../media/impact.wav"); +} + +void CDemo::playSound(Mix_Chunk *sample) +{ + if (sample) + Mix_PlayChannel(-1, sample, 0); +} + +void CDemo::pollSound(void) +{ + SDL_Event event; + + while (SDL_PollEvent(&event)) + ; +} +#endif diff --git a/libraries/irrlicht-1.8.1/examples/Demo/CDemo.h b/libraries/irrlicht-1.8.1/examples/Demo/CDemo.h new file mode 100644 index 0000000..e2c564d --- /dev/null +++ b/libraries/irrlicht-1.8.1/examples/Demo/CDemo.h @@ -0,0 +1,110 @@ +// This is a Demo of the Irrlicht Engine (c) 2006 by N.Gebhardt. +// This file is not documented. + +#ifndef __C_DEMO_H_INCLUDED__ +#define __C_DEMO_H_INCLUDED__ + +//#define USE_IRRKLANG +//#define USE_SDL_MIXER + +#include + +#ifdef _IRR_WINDOWS_ +#include +#endif + +using namespace irr; + +// audio support + +#ifdef USE_IRRKLANG + #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_ + #pragma comment (lib, "irrKlang.lib") + #endif +#endif +#ifdef USE_SDL_MIXER + # include + # include +#endif + +const int CAMERA_COUNT = 7; + +class CDemo : public IEventReceiver +{ +public: + + CDemo(bool fullscreen, bool music, bool shadows, bool additive, bool vsync, bool aa, video::E_DRIVER_TYPE driver); + + ~CDemo(); + + void run(); + + virtual bool OnEvent(const SEvent& event); + +private: + + void createLoadingScreen(); + void loadSceneData(); + void switchToNextScene(); + void shoot(); + void createParticleImpacts(); + + bool fullscreen; + bool music; + bool shadows; + bool additive; + bool vsync; + bool aa; + video::E_DRIVER_TYPE driverType; + IrrlichtDevice *device; + +#ifdef USE_IRRKLANG + void startIrrKlang(); + irrklang::ISoundEngine* irrKlang; + irrklang::ISoundSource* ballSound; + irrklang::ISoundSource* impactSound; +#endif + +#ifdef USE_SDL_MIXER + void startSound(); + void playSound(Mix_Chunk *); + void pollSound(); + Mix_Music *stream; + Mix_Chunk *ballSound; + Mix_Chunk *impactSound; +#endif + + struct SParticleImpact + { + u32 when; + core::vector3df pos; + core::vector3df outVector; + }; + + int currentScene; + video::SColor backColor; + + gui::IGUIStaticText* statusText; + gui::IGUIInOutFader* inOutFader; + + scene::IQ3LevelMesh* quakeLevelMesh; + scene::ISceneNode* quakeLevelNode; + scene::ISceneNode* skyboxNode; + scene::IAnimatedMeshSceneNode* model1; + scene::IAnimatedMeshSceneNode* model2; + scene::IParticleSystemSceneNode* campFire; + + scene::IMetaTriangleSelector* metaSelector; + scene::ITriangleSelector* mapSelector; + + s32 sceneStartTime; + s32 timeForThisScene; + + core::array Impacts; +}; + +#endif + diff --git a/libraries/irrlicht-1.8.1/examples/Demo/CMainMenu.cpp b/libraries/irrlicht-1.8.1/examples/Demo/CMainMenu.cpp new file mode 100644 index 0000000..aa963e5 --- /dev/null +++ b/libraries/irrlicht-1.8.1/examples/Demo/CMainMenu.cpp @@ -0,0 +1,378 @@ +// This is a Demo of the Irrlicht Engine (c) 2005-2009 by N.Gebhardt. +// This file is not documented. + +#include "CMainMenu.h" + + + +CMainMenu::CMainMenu() +: startButton(0), MenuDevice(0), selected(2), start(false), fullscreen(true), + music(true), shadows(false), additive(false), transparent(true), vsync(false), aa(false) +{ +} + + +bool CMainMenu::run(bool& outFullscreen, bool& outMusic, bool& outShadows, + bool& outAdditive, bool& outVSync, bool& outAA, + video::E_DRIVER_TYPE& outDriver) +{ + //video::E_DRIVER_TYPE driverType = video::EDT_DIRECT3D9; + //video::E_DRIVER_TYPE driverType = video::EDT_OPENGL; + video::E_DRIVER_TYPE driverType = video::EDT_BURNINGSVIDEO; + //video::E_DRIVER_TYPE driverType = video::EDT_SOFTWARE; + + MenuDevice = createDevice(driverType, + core::dimension2d(512, 384), 16, false, false, false, this); + + if (MenuDevice->getFileSystem()->existFile("irrlicht.dat")) + MenuDevice->getFileSystem()->addFileArchive("irrlicht.dat"); + else + MenuDevice->getFileSystem()->addFileArchive("../../media/irrlicht.dat"); + + video::IVideoDriver* driver = MenuDevice->getVideoDriver(); + scene::ISceneManager* smgr = MenuDevice->getSceneManager(); + gui::IGUIEnvironment* guienv = MenuDevice->getGUIEnvironment(); + + core::stringw str = "Irrlicht Engine Demo v"; + str += MenuDevice->getVersion(); + MenuDevice->setWindowCaption(str.c_str()); + + // set new Skin + gui::IGUISkin* newskin = guienv->createSkin(gui::EGST_BURNING_SKIN); + guienv->setSkin(newskin); + newskin->drop(); + + // load font + gui::IGUIFont* font = guienv->getFont("../../media/fonthaettenschweiler.bmp"); + if (font) + guienv->getSkin()->setFont(font); + + // add images + + const s32 leftX = 260; + + // add tab control + gui::IGUITabControl* tabctrl = guienv->addTabControl(core::rect(leftX,10,512-10,384-10), + 0, true, true); + gui::IGUITab* optTab = tabctrl->addTab(L"Demo"); + gui::IGUITab* aboutTab = tabctrl->addTab(L"About"); + + // add list box + + gui::IGUIListBox* box = guienv->addListBox(core::rect(10,10,220,120), optTab, 1); + box->addItem(L"OpenGL 1.5"); + box->addItem(L"Direct3D 8.1"); + box->addItem(L"Direct3D 9.0c"); + box->addItem(L"Burning's Video 0.47"); + box->addItem(L"Irrlicht Software Renderer 1.0"); + box->setSelected(selected); + + // add button + + startButton = guienv->addButton(core::rect(30,295,200,324), optTab, 2, L"Start Demo"); + + // add checkbox + + const s32 d = 50; + + guienv->addCheckBox(fullscreen, core::rect(20,85+d,130,110+d), + optTab, 3, L"Fullscreen"); + guienv->addCheckBox(music, core::rect(135,85+d,245,110+d), + optTab, 4, L"Music & Sfx"); + guienv->addCheckBox(shadows, core::rect(20,110+d,135,135+d), + optTab, 5, L"Realtime shadows"); + guienv->addCheckBox(additive, core::rect(20,135+d,230,160+d), + optTab, 6, L"Old HW compatible blending"); + guienv->addCheckBox(vsync, core::rect(20,160+d,230,185+d), + optTab, 7, L"Vertical synchronisation"); + guienv->addCheckBox(aa, core::rect(20,185+d,230,210+d), + optTab, 8, L"Antialiasing"); + + // add about text + + const wchar_t* text2 = L"This is the tech demo of the Irrlicht engine. To start, "\ + L"select a video driver which works best with your hardware and press 'Start Demo'.\n"\ + L"What you currently see is displayed using the Burning Software Renderer (Thomas Alten).\n"\ + L"The Irrlicht Engine was written by me, Nikolaus Gebhardt. The models, "\ + L"maps and textures were placed at my disposal by B.Collins, M.Cook and J.Marton. The music was created by "\ + L"M.Rohde and is played back by irrKlang.\n"\ + L"For more informations, please visit the homepage of the Irrlicht engine:\nhttp://irrlicht.sourceforge.net"; + + guienv->addStaticText(text2, core::rect(10, 10, 230, 320), + true, true, aboutTab); + + // add md2 model + + scene::IAnimatedMesh* mesh = smgr->getMesh("../../media/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->setMaterialFlag(video::EMF_LIGHTING, true); + modelNode->getMaterial(0).Shininess = 50.f; + modelNode->getMaterial(0).NormalizeNormals = true; + modelNode->setMD2Animation(scene::EMAT_STAND); + } + + // set ambient light (no sun light in the catacombs) + smgr->setAmbientLight( video::SColorf(0.2f, 0.2f, 0.2f) ); + + scene::ILightSceneNode *light; + scene::ISceneNodeAnimator* anim; + scene::ISceneNode* bill; + + enum eLightParticle + { + LIGHT_NONE, + LIGHT_GLOBAL, + LIGHT_RED, + LIGHT_BLUE + }; + core::vector3df lightDir[2] = { + core::vector3df(0.f, 0.1f, 0.4f), + core::vector3df(0.f, 0.1f, -0.4f), + }; + + struct SLightParticle + { + eLightParticle type; + u32 dir; + }; + const SLightParticle lightParticle[] = + { + //LIGHT_GLOBAL,0, + {LIGHT_RED,0}, + {LIGHT_BLUE,0}, + {LIGHT_RED,1}, + {LIGHT_BLUE,1}, + {LIGHT_NONE,0} + }; + + const SLightParticle *l = lightParticle; + while ( l->type != LIGHT_NONE ) + { + switch ( l->type ) + { + case LIGHT_GLOBAL: + // add illumination from the background + light = smgr->addLightSceneNode(0, core::vector3df(10.f,40.f,-5.f), + video::SColorf(0.2f, 0.2f, 0.2f), 90.f); + break; + case LIGHT_RED: + // add light nearly red + light = smgr->addLightSceneNode(0, core::vector3df(0,1,0), + video::SColorf(0.8f, 0.f, 0.f, 0.0f), 30.0f); + // attach red billboard to the light + bill = smgr->addBillboardSceneNode(light, core::dimension2d(10, 10)); + if ( bill ) + { + bill->setMaterialFlag(video::EMF_LIGHTING, false); + bill->setMaterialType(video::EMT_TRANSPARENT_ADD_COLOR); + bill->setMaterialTexture(0, driver->getTexture("../../media/particlered.bmp")); + } + // add fly circle animator to the light + anim = smgr->createFlyCircleAnimator(core::vector3df(0.f,0.f,-5.f),20.f, + 0.002f, lightDir [l->dir] ); + light->addAnimator(anim); + anim->drop(); + break; + case LIGHT_BLUE: + // add light nearly blue + light = smgr->addLightSceneNode(0, core::vector3df(0,1,0), + video::SColorf(0.f, 0.0f, 0.8f, 0.0f), 30.0f); + // attach blue billboard to the light + bill = smgr->addBillboardSceneNode(light, core::dimension2d(10, 10)); + if (bill) + { + bill->setMaterialFlag(video::EMF_LIGHTING, false); + bill->setMaterialType(video::EMT_TRANSPARENT_ADD_COLOR); + bill->setMaterialTexture(0, driver->getTexture("../../media/portal1.bmp")); + } + // add fly circle animator to the light + anim = smgr->createFlyCircleAnimator(core::vector3df(0.f,0.f,-5.f),20.f, + -0.002f, lightDir [l->dir], 0.5f); + light->addAnimator(anim); + anim->drop(); + break; + case LIGHT_NONE: + break; + } + l += 1; + } + + // create a fixed camera + smgr->addCameraSceneNode(0, core::vector3df(45,0,0), core::vector3df(0,0,10)); + + + // irrlicht logo and background + // add irrlicht logo + bool oldMipMapState = driver->getTextureCreationFlag(video::ETCF_CREATE_MIP_MAPS); + driver->setTextureCreationFlag(video::ETCF_CREATE_MIP_MAPS, false); + + guienv->addImage(driver->getTexture("../../media/irrlichtlogo3.png"), + core::position2d(5,5)); + + video::ITexture* irrlichtBack = driver->getTexture("../../media/demoback.jpg"); + + driver->setTextureCreationFlag(video::ETCF_CREATE_MIP_MAPS, oldMipMapState); + + // query original skin color + getOriginalSkinColor(); + + // set transparency + setTransparency(); + + // draw all + + while(MenuDevice->run()) + { + if (MenuDevice->isWindowActive()) + { + driver->beginScene(false, true, video::SColor(0,0,0,0)); + + if (irrlichtBack) + driver->draw2DImage(irrlichtBack, + core::position2d(0,0)); + + smgr->drawAll(); + guienv->drawAll(); + driver->endScene(); + } + } + + MenuDevice->drop(); + + outFullscreen = fullscreen; + outMusic = music; + outShadows = shadows; + outAdditive = additive; + outVSync = vsync; + outAA = aa; + + switch(selected) + { + case 0: outDriver = video::EDT_OPENGL; break; + case 1: outDriver = video::EDT_DIRECT3D8; break; + case 2: outDriver = video::EDT_DIRECT3D9; break; + case 3: outDriver = video::EDT_BURNINGSVIDEO; break; + case 4: outDriver = video::EDT_SOFTWARE; break; + } + + return start; +} + + +bool CMainMenu::OnEvent(const SEvent& event) +{ + if (event.EventType == EET_KEY_INPUT_EVENT && + event.KeyInput.Key == KEY_F9 && + event.KeyInput.PressedDown == false) + { + video::IImage* image = MenuDevice->getVideoDriver()->createScreenShot(); + if (image) + { + MenuDevice->getVideoDriver()->writeImageToFile(image, "screenshot_main.jpg"); + image->drop(); + } + } + else + if (event.EventType == irr::EET_MOUSE_INPUT_EVENT && + event.MouseInput.Event == EMIE_RMOUSE_LEFT_UP ) + { + core::rect r(event.MouseInput.X, event.MouseInput.Y, 0, 0); + gui::IGUIContextMenu* menu = MenuDevice->getGUIEnvironment()->addContextMenu(r, 0, 45); + menu->addItem(L"transparent menus", 666, transparent == false); + menu->addItem(L"solid menus", 666, transparent == true); + menu->addSeparator(); + menu->addItem(L"Cancel"); + } + else + if (event.EventType == EET_GUI_EVENT) + { + s32 id = event.GUIEvent.Caller->getID(); + switch(id) + { + case 45: // context menu + if (event.GUIEvent.EventType == gui::EGET_MENU_ITEM_SELECTED) + { + s32 s = ((gui::IGUIContextMenu*)event.GUIEvent.Caller)->getSelectedItem(); + if (s == 0 || s == 1) + { + transparent = !transparent; + setTransparency(); + } + } + break; + case 1: + if (event.GUIEvent.EventType == gui::EGET_LISTBOX_CHANGED || + event.GUIEvent.EventType == gui::EGET_LISTBOX_SELECTED_AGAIN) + { + selected = ((gui::IGUIListBox*)event.GUIEvent.Caller)->getSelected(); + //startButton->setEnabled(selected != 4); + startButton->setEnabled(true); + } + break; + case 2: + if (event.GUIEvent.EventType == gui::EGET_BUTTON_CLICKED ) + { + MenuDevice->closeDevice(); + start = true; + } + case 3: + if (event.GUIEvent.EventType == gui::EGET_CHECKBOX_CHANGED ) + fullscreen = ((gui::IGUICheckBox*)event.GUIEvent.Caller)->isChecked(); + break; + case 4: + if (event.GUIEvent.EventType == gui::EGET_CHECKBOX_CHANGED ) + music = ((gui::IGUICheckBox*)event.GUIEvent.Caller)->isChecked(); + break; + case 5: + if (event.GUIEvent.EventType == gui::EGET_CHECKBOX_CHANGED ) + shadows = ((gui::IGUICheckBox*)event.GUIEvent.Caller)->isChecked(); + break; + case 6: + if (event.GUIEvent.EventType == gui::EGET_CHECKBOX_CHANGED ) + additive = ((gui::IGUICheckBox*)event.GUIEvent.Caller)->isChecked(); + break; + case 7: + if (event.GUIEvent.EventType == gui::EGET_CHECKBOX_CHANGED ) + vsync = ((gui::IGUICheckBox*)event.GUIEvent.Caller)->isChecked(); + break; + case 8: + if (event.GUIEvent.EventType == gui::EGET_CHECKBOX_CHANGED ) + aa = ((gui::IGUICheckBox*)event.GUIEvent.Caller)->isChecked(); + break; + } + } + + return false; +} + + +void CMainMenu::getOriginalSkinColor() +{ + irr::gui::IGUISkin * skin = MenuDevice->getGUIEnvironment()->getSkin(); + for (s32 i=0; igetColor( (gui::EGUI_DEFAULT_COLOR)i ); + } + +} + + +void CMainMenu::setTransparency() +{ + irr::gui::IGUISkin * skin = MenuDevice->getGUIEnvironment()->getSkin(); + + for (u32 i=0; isetColor((gui::EGUI_DEFAULT_COLOR)i, col); + } +} + diff --git a/libraries/irrlicht-1.8.1/examples/Demo/CMainMenu.h b/libraries/irrlicht-1.8.1/examples/Demo/CMainMenu.h new file mode 100644 index 0000000..06a0d04 --- /dev/null +++ b/libraries/irrlicht-1.8.1/examples/Demo/CMainMenu.h @@ -0,0 +1,48 @@ +// This is a Demo of the Irrlicht Engine (c) 2005 by N.Gebhardt. +// This file is not documentated. + +#ifndef __C_MAIN_MENU_H_INCLUDED__ +#define __C_MAIN_MENU_H_INCLUDED__ + +#include + +using namespace irr; + +class CMainMenu : public IEventReceiver +{ +public: + + CMainMenu(); + + bool run(bool& outFullscreen, bool& outMusic, bool& outShadows, + bool& outAdditive, bool &outVSync, bool& outAA, + video::E_DRIVER_TYPE& outDriver); + + virtual bool OnEvent(const SEvent& event); + +private: + + void setTransparency(); + + gui::IGUIButton* startButton; + IrrlichtDevice *MenuDevice; + s32 selected; + bool start; + bool fullscreen; + bool music; + bool shadows; + bool additive; + bool transparent; + bool vsync; + bool aa; + + scene::IAnimatedMesh* quakeLevel; + scene::ISceneNode* lightMapNode; + scene::ISceneNode* dynamicNode; + + video::SColor SkinColor [ gui::EGDC_COUNT ]; + void getOriginalSkinColor(); +}; + +#endif + diff --git a/libraries/irrlicht-1.8.1/examples/Demo/Demo.vcproj b/libraries/irrlicht-1.8.1/examples/Demo/Demo.vcproj new file mode 100644 index 0000000..fe55b37 --- /dev/null +++ b/libraries/irrlicht-1.8.1/examples/Demo/Demo.vcproj @@ -0,0 +1,223 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/libraries/irrlicht-1.8.1/examples/Demo/Demo_vc10.vcxproj b/libraries/irrlicht-1.8.1/examples/Demo/Demo_vc10.vcxproj new file mode 100644 index 0000000..73b5a2f --- /dev/null +++ b/libraries/irrlicht-1.8.1/examples/Demo/Demo_vc10.vcxproj @@ -0,0 +1,279 @@ + + + + + Debug + Win32 + + + Debug + x64 + + + Release + Win32 + + + Release + x64 + + + + {6F076455-D955-45D4-9C68-4AD4E45F2D47} + Demo + + + + Application + MultiByte + + + Application + MultiByte + + + Application + MultiByte + + + Application + MultiByte + + + + + + + + + + + + + + + + + + + + + + + <_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 + + + ..\..\bin\Win32-VisualStudio\Demo.exe + ..\..\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/libraries/irrlicht-1.8.1/examples/Demo/Demo_vc11.vcxproj b/libraries/irrlicht-1.8.1/examples/Demo/Demo_vc11.vcxproj new file mode 100644 index 0000000..ecb5f33 --- /dev/null +++ b/libraries/irrlicht-1.8.1/examples/Demo/Demo_vc11.vcxproj @@ -0,0 +1,283 @@ + + + + + Debug + Win32 + + + Debug + x64 + + + Release + Win32 + + + Release + x64 + + + + {6F076455-D955-45D4-9C68-4AD4E45F2D47} + Demo + + + + Application + MultiByte + v110 + + + Application + MultiByte + v110 + + + Application + MultiByte + v110 + + + Application + MultiByte + v110 + + + + + + + + + + + + + + + + + + + + + + + <_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 + + + ..\..\bin\Win32-VisualStudio\Demo.exe + ..\..\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/libraries/irrlicht-1.8.1/examples/Demo/Demo_vc8.vcproj b/libraries/irrlicht-1.8.1/examples/Demo/Demo_vc8.vcproj new file mode 100644 index 0000000..5504310 --- /dev/null +++ b/libraries/irrlicht-1.8.1/examples/Demo/Demo_vc8.vcproj @@ -0,0 +1,300 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/libraries/irrlicht-1.8.1/examples/Demo/Demo_vc9.vcproj b/libraries/irrlicht-1.8.1/examples/Demo/Demo_vc9.vcproj new file mode 100644 index 0000000..e0052aa --- /dev/null +++ b/libraries/irrlicht-1.8.1/examples/Demo/Demo_vc9.vcproj @@ -0,0 +1,300 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/libraries/irrlicht-1.8.1/examples/Demo/Makefile b/libraries/irrlicht-1.8.1/examples/Demo/Makefile new file mode 100644 index 0000000..1577ac9 --- /dev/null +++ b/libraries/irrlicht-1.8.1/examples/Demo/Makefile @@ -0,0 +1,43 @@ +# Irrlicht Engine Demo Makefile +Target = Demo +Sources = CDemo.cpp CMainMenu.cpp main.cpp + +CPPFLAGS = -I../../include -I/usr/X11R6/include +CXXFLAGS = -Wall -O3 -ffast-math + +ifeq ($(HOSTTYPE), x86_64) +LIBSELECT=64 +endif + +all: all_linux + +# target specific settings +all_linux: SYSTEM=Linux +all_linux: LDFLAGS = -L/usr/X11R6/lib$(LIBSELECT) -L../../lib/$(SYSTEM) -lIrrlicht -lGL -lXxf86vm -lXext -lX11 -lXcursor + +all_win32 clean_win32: SYSTEM=Win32-gcc +all_win32: LDFLAGS = -L../../lib/$(SYSTEM) -lIrrlicht -lopengl32 -lm + +# if you enable sound add the proper library for linking +#LDFLAGS += -lIrrKlang +#LDFLAGS += -laudiere +#LDFLAGS += -lSDL_mixer -lSDL + +all_win32 clean_win32: SUF=.exe +# name of the binary - only valid for targets which set SYSTEM +DESTPATH = ../../bin/$(SYSTEM)/$(Target)$(SUF) + +OBJ = $(Sources:.cpp=.o) + +all_linux all_win32: $(OBJ) + $(warning Building...) + $(CXX) $(CPPFLAGS) $(CXXFLAGS) $^ -o $(DESTPATH) $(LDFLAGS) + +clean: clean_linux clean_win32 + $(warning Cleaning...) + @$(RM) $(OBJ) + +clean_linux clean_win32: + @$(RM) $(DESTPATH) + +.PHONY: all all_win32 clean clean_linux clean_win32 diff --git a/libraries/irrlicht-1.8.1/examples/Demo/demo.cbp b/libraries/irrlicht-1.8.1/examples/Demo/demo.cbp new file mode 100644 index 0000000..4e58305 --- /dev/null +++ b/libraries/irrlicht-1.8.1/examples/Demo/demo.cbp @@ -0,0 +1,68 @@ + + + + + + diff --git a/libraries/irrlicht-1.8.1/examples/Demo/demo.dev b/libraries/irrlicht-1.8.1/examples/Demo/demo.dev new file mode 100644 index 0000000..9e1b4c0 --- /dev/null +++ b/libraries/irrlicht-1.8.1/examples/Demo/demo.dev @@ -0,0 +1,99 @@ +[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/libraries/irrlicht-1.8.1/examples/Demo/icon.ico b/libraries/irrlicht-1.8.1/examples/Demo/icon.ico new file mode 100644 index 0000000..49f8eab Binary files /dev/null and b/libraries/irrlicht-1.8.1/examples/Demo/icon.ico differ diff --git a/libraries/irrlicht-1.8.1/examples/Demo/main.cpp b/libraries/irrlicht-1.8.1/examples/Demo/main.cpp new file mode 100644 index 0000000..3d26999 --- /dev/null +++ b/libraries/irrlicht-1.8.1/examples/Demo/main.cpp @@ -0,0 +1,49 @@ +// This is a Demo of the Irrlicht Engine (c) 2005-2009 by N.Gebhardt. +// This file is not documented. + +#include +#ifdef _IRR_WINDOWS_ +#include +#endif + +#include + +#include "CMainMenu.h" +#include "CDemo.h" + +using namespace irr; + +#ifdef _WIN32 + +#pragma comment(lib, "Irrlicht.lib") +INT WINAPI WinMain( HINSTANCE hInst, HINSTANCE, LPSTR strCmdLine, INT ) +#else +int main(int argc, char* argv[]) +#endif +{ + bool fullscreen = false; + bool music = true; + bool shadows = false; + bool additive = false; + bool vsync = false; + bool aa = false; + +#ifndef _IRR_WINDOWS_ + video::E_DRIVER_TYPE driverType = video::EDT_OPENGL; +#else + video::E_DRIVER_TYPE driverType = video::EDT_DIRECT3D9; +#endif + + CMainMenu menu; + +//#ifndef _DEBUG + if (menu.run(fullscreen, music, shadows, additive, vsync, aa, driverType)) +//#endif + { + CDemo demo(fullscreen, music, shadows, additive, vsync, aa, driverType); + demo.run(); + } + + return 0; +} + diff --git a/libraries/irrlicht-1.8.1/examples/Demo/resource.h b/libraries/irrlicht-1.8.1/examples/Demo/resource.h new file mode 100644 index 0000000..eb3b976 --- /dev/null +++ b/libraries/irrlicht-1.8.1/examples/Demo/resource.h @@ -0,0 +1,16 @@ +//{{NO_DEPENDENCIES}} +// Microsoft Developer Studio generated include file. +// Used by resscript.rc +// +#define IDI_ICON1 101 + +// Next default values for new objects +// +#ifdef APSTUDIO_INVOKED +#ifndef APSTUDIO_READONLY_SYMBOLS +#define _APS_NEXT_RESOURCE_VALUE 102 +#define _APS_NEXT_COMMAND_VALUE 40001 +#define _APS_NEXT_CONTROL_VALUE 1000 +#define _APS_NEXT_SYMED_VALUE 101 +#endif +#endif diff --git a/libraries/irrlicht-1.8.1/examples/Demo/resscript.rc b/libraries/irrlicht-1.8.1/examples/Demo/resscript.rc new file mode 100644 index 0000000..be12eb7 --- /dev/null +++ b/libraries/irrlicht-1.8.1/examples/Demo/resscript.rc @@ -0,0 +1,72 @@ +//Microsoft Developer Studio generated resource script. +// +#include "resource.h" + +#define APSTUDIO_READONLY_SYMBOLS +///////////////////////////////////////////////////////////////////////////// +// +// Generated from the TEXTINCLUDE 2 resource. +// +#include "afxres.h" + +///////////////////////////////////////////////////////////////////////////// +#undef APSTUDIO_READONLY_SYMBOLS + +///////////////////////////////////////////////////////////////////////////// +// Deutsch (Österreich) resources + +#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_DEA) +#ifdef _WIN32 +LANGUAGE LANG_GERMAN, SUBLANG_GERMAN_AUSTRIAN +#pragma code_page(1252) +#endif //_WIN32 + +#ifdef APSTUDIO_INVOKED +///////////////////////////////////////////////////////////////////////////// +// +// TEXTINCLUDE +// + +1 TEXTINCLUDE DISCARDABLE +BEGIN + "resource.h\0" +END + +2 TEXTINCLUDE DISCARDABLE +BEGIN + "#include ""afxres.h""\r\n" + "\0" +END + +3 TEXTINCLUDE DISCARDABLE +BEGIN + "\r\n" + "\0" +END + +#endif // APSTUDIO_INVOKED + + +///////////////////////////////////////////////////////////////////////////// +// +// Icon +// + +// Icon with lowest ID value placed first to ensure application icon +// remains consistent on all systems. +IDI_ICON1 ICON DISCARDABLE "icon.ico" +#endif // Deutsch (Österreich) resources +///////////////////////////////////////////////////////////////////////////// + + + +#ifndef APSTUDIO_INVOKED +///////////////////////////////////////////////////////////////////////////// +// +// Generated from the TEXTINCLUDE 3 resource. +// + + +///////////////////////////////////////////////////////////////////////////// +#endif // not APSTUDIO_INVOKED + diff --git a/libraries/irrlicht-1.8.1/examples/Makefile b/libraries/irrlicht-1.8.1/examples/Makefile new file mode 100644 index 0000000..da65881 --- /dev/null +++ b/libraries/irrlicht-1.8.1/examples/Makefile @@ -0,0 +1,8 @@ +DIRS = $(wildcard [012]* Demo) + +all: $(DIRS) + +$(DIRS): + -@cd $@ && make clean && make + +.PHONY: $(DIRS) diff --git a/libraries/irrlicht-1.8.1/examples/buildAllExamples.sh b/libraries/irrlicht-1.8.1/examples/buildAllExamples.sh new file mode 100755 index 0000000..272a329 --- /dev/null +++ b/libraries/irrlicht-1.8.1/examples/buildAllExamples.sh @@ -0,0 +1,8 @@ +#! /bin/bash +[ -z $1 ] || TARGET=$1 +[ -z $TARGET ] && TARGET=all +for i in [012]* Demo; do + echo "Building $i"; + pushd $i && make clean $TARGET; + popd; +done diff --git a/libraries/irrlicht-1.8.1/examples/whereAreTheBinaries.txt b/libraries/irrlicht-1.8.1/examples/whereAreTheBinaries.txt new file mode 100644 index 0000000..d9f7d6a --- /dev/null +++ b/libraries/irrlicht-1.8.1/examples/whereAreTheBinaries.txt @@ -0,0 +1,7 @@ +If you are searching for executeables of the examples and the demo, +you'll find some for Windows in the directory +/bin/win32-VisualStudio. + +For Linux, just go into the directory of the example you want and +execute a simple 'make' after you made the engine from source/Irrlicht. + -- cgit v1.1