irrlib

irrlib Commit Details


Date:2013-08-24 12:03:00 (5 years 10 months ago)
Author:Natalie Adams
Branch:default
Commit:ca2aafbed07a
Message:Migrating from google code

Changes:
AExamples/Example_1.old/q3level.cpp (full)
AExamples/Example_10_DisableEscExit/main_x.cpp (full)
AExamples/Example_11_3DObjects/main_x.cpp (full)
AExamples/Example_1_Basic/main.cpp (full)
AExamples/Example_1_Basic/main_x.cpp (full)
AExamples/Example_2_SceneColor/main.cpp (full)
AExamples/Example_2_SceneColor/main_x.cpp (full)
AExamples/Example_3_Keyboard/main.cpp (full)
AExamples/Example_3_Keyboard/main_x.cpp (full)
AExamples/Example_4_WindowCaption/UsingStdString.cpp (full)
AExamples/Example_4_WindowCaption/UsingStringw.cpp (full)
AExamples/Example_4_WindowCaption/main.cpp (full)
AExamples/Example_4_WindowCaption/main_x.cpp (full)
AExamples/Example_5_Cursor/main.cpp (full)
AExamples/Example_5_Cursor/main_x.cpp (full)
AExamples/Example_6_GameLoop/main.cpp (full)
AExamples/Example_6_GameLoop/main_x.cpp (full)
AExamples/Example_7_Spheres/main.cpp (full)
AExamples/Example_7_Spheres/main_x.cpp (full)
AExamples/Example_8_Mouse/main.cpp (full)
AExamples/Example_8_Mouse/main_x.cpp (full)
AExamples/Example_9_PictoDraw/main.cpp (full)
AExamples/Example_9_PictoDraw/main_x.cpp (full)
AOld Versions/1.1/IrrLib.cpp (full)
AOld Versions/1.1/IrrLib.h (full)
AOld Versions/1.1/IrrSphere.cpp (full)
AOld Versions/1.1/IrrSphere.h (full)
AOld Versions/1.2/CHANGES (full)
AOld Versions/1.2/Irr2D.cpp (full)
AOld Versions/1.2/Irr2D.h (full)
AOld Versions/1.2/Irr3D.cpp (full)
AOld Versions/1.2/Irr3D.h (full)
AOld Versions/1.2/IrrColor.cpp (full)
AOld Versions/1.2/IrrColor.h (full)
AOld Versions/1.2/IrrLib.cpp (full)
AOld Versions/1.2/IrrLib.h (full)
AOld Versions/1.2/IrrLibBase.cpp (full)
AOld Versions/1.2/IrrLibBase.h (full)
AOld Versions/1.2/IrrLibGUI.cpp (full)
AOld Versions/1.2/IrrLibGUI.h (full)
AOld Versions/1.2/IrrSphere.cpp (full)
AOld Versions/1.2/IrrSphere.h (full)
AOld Versions/1.2/IrrSprite.cpp (full)
AOld Versions/1.2/IrrSprite.h (full)
AOld Versions/1.2/README (full)
AOld Versions/1/IrrLib.cpp (full)
AOld Versions/1/IrrLib.h (full)
AOld Versions/1/irrlibdocs.txt (full)
AStable Version/1.2.2/CHANGES (full)
AStable Version/1.2.2/Irr2D.cpp (full)
AStable Version/1.2.2/Irr2D.h (full)
AStable Version/1.2.2/Irr3D.cpp (full)
AStable Version/1.2.2/Irr3D.h (full)
AStable Version/1.2.2/IrrColor.cpp (full)
AStable Version/1.2.2/IrrColor.h (full)
AStable Version/1.2.2/IrrEventReciever.cpp (full)
AStable Version/1.2.2/IrrEventReciever.h (full)
AStable Version/1.2.2/IrrLib.cpp (full)
AStable Version/1.2.2/IrrLib.h (full)
AStable Version/1.2.2/IrrLibBase.cpp (full)
AStable Version/1.2.2/IrrLibBase.h (full)
AStable Version/1.2.2/IrrLibGUI.cpp (full)
AStable Version/1.2.2/IrrLibGUI.h (full)
AStable Version/1.2.2/IrrSphere.cpp (full)
AStable Version/1.2.2/IrrSphere.h (full)
AStable Version/1.2.2/IrrSprite.cpp (full)
AStable Version/1.2.2/IrrSprite.h (full)
AStable Version/1.2.2/README (full)
AStable Version/1.2.3/CHANGES (full)
AStable Version/1.2.3/CREDITS (full)
AStable Version/1.2.3/Irr2D.cpp (full)
AStable Version/1.2.3/Irr2D.h (full)
AStable Version/1.2.3/Irr3D.cpp (full)
AStable Version/1.2.3/Irr3D.h (full)
AStable Version/1.2.3/IrrColor.cpp (full)
AStable Version/1.2.3/IrrColor.h (full)
AStable Version/1.2.3/IrrEventReciever.cpp (full)
AStable Version/1.2.3/IrrEventReciever.h (full)
AStable Version/1.2.3/IrrLib.cpp (full)
AStable Version/1.2.3/IrrLib.h (full)
AStable Version/1.2.3/IrrLibBase.cpp (full)
AStable Version/1.2.3/IrrLibBase.h (full)
AStable Version/1.2.3/IrrLibData.cpp
AStable Version/1.2.3/IrrLibData.h (full)
AStable Version/1.2.3/IrrLibGUI.cpp (full)
AStable Version/1.2.3/IrrLibGUI.h (full)
AStable Version/1.2.3/IrrSphere.cpp (full)
AStable Version/1.2.3/IrrSphere.h (full)
AStable Version/1.2.3/IrrSprite.cpp (full)
AStable Version/1.2.3/IrrSprite.h (full)
AStable Version/1.2.3/README (full)
AStable Version/1.2.4/CHANGES (full)
AStable Version/1.2.4/CREDITS (full)
AStable Version/1.2.4/Irr2D.cpp (full)
AStable Version/1.2.4/Irr2D.h (full)
AStable Version/1.2.4/Irr3D.cpp (full)
AStable Version/1.2.4/Irr3D.h (full)
AStable Version/1.2.4/IrrColor.cpp (full)
AStable Version/1.2.4/IrrColor.h (full)
AStable Version/1.2.4/IrrEventReciever.cpp (full)
AStable Version/1.2.4/IrrEventReciever.h (full)
AStable Version/1.2.4/IrrLib.cpp (full)
AStable Version/1.2.4/IrrLib.h (full)
AStable Version/1.2.4/IrrLibBase.cpp (full)
AStable Version/1.2.4/IrrLibBase.h (full)
AStable Version/1.2.4/IrrLibData.cpp
AStable Version/1.2.4/IrrLibData.h (full)
AStable Version/1.2.4/IrrLibGUI.cpp (full)
AStable Version/1.2.4/IrrLibGUI.h (full)
AStable Version/1.2.4/IrrSphere.cpp (full)
AStable Version/1.2.4/IrrSphere.h (full)
AStable Version/1.2.4/IrrSprite.cpp (full)
AStable Version/1.2.4/IrrSprite.h (full)
AStable Version/1.2.4/README (full)
AStable Version/1.2.5/CHANGES (full)
AStable Version/1.2.5/CREDITS (full)
AStable Version/1.2.5/Irr2D.cpp (full)
AStable Version/1.2.5/Irr2D.h (full)
AStable Version/1.2.5/Irr3D.cpp (full)
AStable Version/1.2.5/Irr3D.h (full)
AStable Version/1.2.5/IrrColor.cpp (full)
AStable Version/1.2.5/IrrColor.h (full)
AStable Version/1.2.5/IrrEventReciever.cpp (full)
AStable Version/1.2.5/IrrEventReciever.h (full)
AStable Version/1.2.5/IrrLib.cpp (full)
AStable Version/1.2.5/IrrLib.h (full)
AStable Version/1.2.5/IrrLibBase.cpp (full)
AStable Version/1.2.5/IrrLibBase.h (full)
AStable Version/1.2.5/IrrLibDLL.dll
AStable Version/1.2.5/IrrLibData.cpp
AStable Version/1.2.5/IrrLibData.h (full)
AStable Version/1.2.5/IrrLibGUI.cpp (full)
AStable Version/1.2.5/IrrLibGUI.h (full)
AStable Version/1.2.5/IrrSphere.cpp (full)
AStable Version/1.2.5/IrrSphere.h (full)
AStable Version/1.2.5/IrrSprite.cpp (full)
AStable Version/1.2.5/IrrSprite.h (full)
AStable Version/1.2.5/README (full)
AStable Version/1.2.5/dll.cbp (full)
AStable Version/1.2.5/dll.layout (full)
AStable Version/1.2.5/libIrrLibDLL.a
AStable Version/1.2.6/CHANGES (full)
AStable Version/1.2.6/CREDITS (full)
AStable Version/1.2.6/Irr2D.cpp (full)
AStable Version/1.2.6/Irr2D.h (full)
AStable Version/1.2.6/Irr3D.cpp (full)
AStable Version/1.2.6/Irr3D.h (full)
AStable Version/1.2.6/IrrColor.cpp (full)
AStable Version/1.2.6/IrrColor.h (full)
AStable Version/1.2.6/IrrEventReciever.cpp (full)
AStable Version/1.2.6/IrrEventReciever.h (full)
AStable Version/1.2.6/IrrLib.cpp (full)
AStable Version/1.2.6/IrrLib.h (full)
AStable Version/1.2.6/IrrLibBase.cpp (full)
AStable Version/1.2.6/IrrLibBase.h (full)
AStable Version/1.2.6/IrrLibData.cpp
AStable Version/1.2.6/IrrLibData.h (full)
AStable Version/1.2.6/IrrLibGUI.cpp (full)
AStable Version/1.2.6/IrrLibGUI.h (full)
AStable Version/1.2.6/IrrSphere.cpp (full)
AStable Version/1.2.6/IrrSphere.h (full)
AStable Version/1.2.6/IrrSprite.cpp (full)
AStable Version/1.2.6/IrrSprite.h (full)
AStable Version/1.2.6/README (full)
AStable Version/1.2.7/CHANGES (full)
AStable Version/1.2.7/CREDITS (full)
AStable Version/1.2.7/Irr2D.cpp (full)
AStable Version/1.2.7/Irr2D.h (full)
AStable Version/1.2.7/Irr3D.cpp (full)
AStable Version/1.2.7/Irr3D.h (full)
AStable Version/1.2.7/IrrColor.cpp (full)
AStable Version/1.2.7/IrrColor.h (full)
AStable Version/1.2.7/IrrEventReciever.cpp (full)
AStable Version/1.2.7/IrrEventReciever.h (full)
AStable Version/1.2.7/IrrLib.cpp (full)
AStable Version/1.2.7/IrrLib.h (full)
AStable Version/1.2.7/IrrLibBase.cpp (full)
AStable Version/1.2.7/IrrLibBase.h (full)
AStable Version/1.2.7/IrrLibGUI.cpp (full)
AStable Version/1.2.7/IrrLibGUI.h (full)
AStable Version/1.2.7/IrrSphere.cpp (full)
AStable Version/1.2.7/IrrSphere.h (full)
AStable Version/1.2.7/IrrSprite.cpp (full)
AStable Version/1.2.7/IrrSprite.h (full)
AStable Version/1.2.7/README (full)
AStable Version/1.2.9/CHANGES (full)
AStable Version/1.2.9/CREDITS (full)
AStable Version/1.2.9/Irr2D.cpp (full)
AStable Version/1.2.9/Irr2D.h (full)
AStable Version/1.2.9/Irr3D.cpp (full)
AStable Version/1.2.9/Irr3D.h (full)
AStable Version/1.2.9/IrrColor.cpp (full)
AStable Version/1.2.9/IrrColor.h (full)
AStable Version/1.2.9/IrrData.h (full)
AStable Version/1.2.9/IrrEventReciever.cpp (full)
AStable Version/1.2.9/IrrEventReciever.h (full)
AStable Version/1.2.9/IrrLib.cpp (full)
AStable Version/1.2.9/IrrLib.h (full)
AStable Version/1.2.9/IrrLibBase.cpp (full)
AStable Version/1.2.9/IrrLibBase.h (full)
AStable Version/1.2.9/IrrLibGUI.cpp (full)
AStable Version/1.2.9/IrrLibGUI.h (full)
AStable Version/1.2.9/IrrSphere.cpp (full)
AStable Version/1.2.9/IrrSphere.h (full)
AStable Version/1.2.9/IrrSprite.cpp (full)
AStable Version/1.2.9/IrrSprite.h (full)
AStable Version/1.2.9/README (full)
AStable Version/1.3.3/CHANGES (full)
AStable Version/1.3.3/CREDITS (full)
AStable Version/1.3.3/Collision.h (full)
AStable Version/1.3.3/Irr2D.cpp (full)
AStable Version/1.3.3/Irr2D.h (full)
AStable Version/1.3.3/Irr2DLibObj.cpp
AStable Version/1.3.3/Irr2DLibObj.h
AStable Version/1.3.3/Irr3D.cpp (full)
AStable Version/1.3.3/Irr3D.h (full)
AStable Version/1.3.3/Irr3DLibObj.cpp (full)
AStable Version/1.3.3/Irr3DLibObj.h (full)
AStable Version/1.3.3/Irr3DObjColor.h (full)
AStable Version/1.3.3/Irr3DPos.h (full)
AStable Version/1.3.3/IrrColor.cpp (full)
AStable Version/1.3.3/IrrColor.h (full)
AStable Version/1.3.3/IrrDefines.h (full)
AStable Version/1.3.3/IrrEventReciever.cpp (full)
AStable Version/1.3.3/IrrEventReciever.h (full)
AStable Version/1.3.3/IrrFunctions.cpp (full)
AStable Version/1.3.3/IrrFunctions.h (full)
AStable Version/1.3.3/IrrGUIStruct.h (full)
AStable Version/1.3.3/IrrLib.cpp (full)
AStable Version/1.3.3/IrrLib.h (full)
AStable Version/1.3.3/IrrLibBase.cpp (full)
AStable Version/1.3.3/IrrLibBase.h (full)
AStable Version/1.3.3/IrrLibGUI.cpp (full)
AStable Version/1.3.3/IrrLibGUI.h (full)
AStable Version/1.3.3/IrrLibObj.h (full)
AStable Version/1.3.3/IrrObj.h (full)
AStable Version/1.3.3/IrrOpt.h (full)
AStable Version/1.3.3/IrrPhysics.cpp (full)
AStable Version/1.3.3/IrrPhysics.h (full)
AStable Version/1.3.3/IrrSphere.cpp (full)
AStable Version/1.3.3/IrrSphere.h (full)
AStable Version/1.3.3/IrrSprite.cpp (full)
AStable Version/1.3.3/IrrSprite.h (full)
AStable Version/1.3.3/Newton.h (full)
AStable Version/1.3.3/README (full)
AStable Version/1.3.3/_mouse.h (full)
AUnstable Version/1.2.2b/CHANGES (full)
AUnstable Version/1.2.2b/Irr2D.cpp (full)
AUnstable Version/1.2.2b/Irr2D.h (full)
AUnstable Version/1.2.2b/Irr3D.cpp (full)
AUnstable Version/1.2.2b/Irr3D.h (full)
AUnstable Version/1.2.2b/IrrColor.cpp (full)
AUnstable Version/1.2.2b/IrrColor.h (full)
AUnstable Version/1.2.2b/IrrEventReciever.h (full)
AUnstable Version/1.2.2b/IrrLib.cpp (full)
AUnstable Version/1.2.2b/IrrLib.h (full)
AUnstable Version/1.2.2b/IrrSphere.cpp (full)
AUnstable Version/1.2.2b/IrrSphere.h (full)
AUnstable Version/1.2.2b/IrrSprite.cpp (full)
AUnstable Version/1.2.2b/IrrSprite.h (full)
AUnstable Version/1.2.2b/README (full)
AUnstable Version/1.2.8/CHANGES (full)
AUnstable Version/1.2.8/CREDITS (full)
AUnstable Version/1.2.8/Irr2D.cpp (full)
AUnstable Version/1.2.8/Irr2D.h (full)
AUnstable Version/1.2.8/Irr3D.cpp (full)
AUnstable Version/1.2.8/Irr3D.h (full)
AUnstable Version/1.2.8/IrrColor.cpp (full)
AUnstable Version/1.2.8/IrrColor.h (full)
AUnstable Version/1.2.8/IrrEventReciever.cpp (full)
AUnstable Version/1.2.8/IrrEventReciever.h (full)
AUnstable Version/1.2.8/IrrLib.cpp (full)
AUnstable Version/1.2.8/IrrLib.h (full)
AUnstable Version/1.2.8/IrrLibBase.cpp (full)
AUnstable Version/1.2.8/IrrLibBase.h (full)
AUnstable Version/1.2.8/IrrLibGUI.cpp (full)
AUnstable Version/1.2.8/IrrLibGUI.h (full)
AUnstable Version/1.2.8/IrrSphere.cpp (full)
AUnstable Version/1.2.8/IrrSphere.h (full)
AUnstable Version/1.2.8/IrrSprite.cpp (full)
AUnstable Version/1.2.8/IrrSprite.h (full)
AUnstable Version/1.2.8/README (full)
AUnstable Version/1.2.9/CHANGES (full)
AUnstable Version/1.2.9/CREDITS (full)
AUnstable Version/1.2.9/Irr2D.cpp (full)
AUnstable Version/1.2.9/Irr2D.h (full)
AUnstable Version/1.2.9/Irr3D.cpp (full)
AUnstable Version/1.2.9/Irr3D.h (full)
AUnstable Version/1.2.9/IrrColor.cpp (full)
AUnstable Version/1.2.9/IrrColor.h (full)
AUnstable Version/1.2.9/IrrEventReciever.cpp (full)
AUnstable Version/1.2.9/IrrEventReciever.h (full)
AUnstable Version/1.2.9/IrrLib.cpp (full)
AUnstable Version/1.2.9/IrrLib.h (full)
AUnstable Version/1.2.9/IrrLibBase.cpp (full)
AUnstable Version/1.2.9/IrrLibBase.h (full)
AUnstable Version/1.2.9/IrrLibGUI.cpp (full)
AUnstable Version/1.2.9/IrrLibGUI.h (full)
AUnstable Version/1.2.9/IrrSphere.cpp (full)
AUnstable Version/1.2.9/IrrSphere.h (full)
AUnstable Version/1.2.9/IrrSprite.cpp (full)
AUnstable Version/1.2.9/IrrSprite.h (full)
AUnstable Version/1.2.9/README (full)
AUnstable Version/1.2b/Irr2D.cpp (full)
AUnstable Version/1.2b/Irr2D.h (full)
AUnstable Version/1.2b/IrrColor.cpp (full)
AUnstable Version/1.2b/IrrColor.h (full)
AUnstable Version/1.2b/IrrLib.cpp (full)
AUnstable Version/1.2b/IrrLib.h (full)
AUnstable Version/1.2b/IrrSphere.cpp (full)
AUnstable Version/1.2b/IrrSphere.h (full)
AUnstable Version/1.3.0/CHANGES (full)
AUnstable Version/1.3.0/CREDITS (full)
AUnstable Version/1.3.0/Irr2D.cpp (full)
AUnstable Version/1.3.0/Irr2D.h (full)
AUnstable Version/1.3.0/Irr3D.cpp (full)
AUnstable Version/1.3.0/Irr3D.h (full)
AUnstable Version/1.3.0/IrrColor.cpp (full)
AUnstable Version/1.3.0/IrrColor.h (full)
AUnstable Version/1.3.0/IrrData.h (full)
AUnstable Version/1.3.0/IrrEventReciever.cpp (full)
AUnstable Version/1.3.0/IrrEventReciever.h (full)
AUnstable Version/1.3.0/IrrLib.cpp (full)
AUnstable Version/1.3.0/IrrLib.h (full)
AUnstable Version/1.3.0/IrrLibBase.cpp (full)
AUnstable Version/1.3.0/IrrLibBase.h (full)
AUnstable Version/1.3.0/IrrLibGUI.cpp (full)
AUnstable Version/1.3.0/IrrLibGUI.h (full)
AUnstable Version/1.3.0/IrrSphere.cpp (full)
AUnstable Version/1.3.0/IrrSphere.h (full)
AUnstable Version/1.3.0/IrrSprite.cpp (full)
AUnstable Version/1.3.0/IrrSprite.h (full)
AUnstable Version/1.3.0/README (full)
AUnstable Version/1.3.1/Changes (full)
AUnstable Version/1.3.1/Credits (full)
AUnstable Version/1.3.1/Irr2d.cpp (full)
AUnstable Version/1.3.1/Irr2d.h (full)
AUnstable Version/1.3.1/Irr3d.cpp (full)
AUnstable Version/1.3.1/Irr3d.h (full)
AUnstable Version/1.3.1/IrrEventReciever.cpp (full)
AUnstable Version/1.3.1/IrrEventReciever.h (full)
AUnstable Version/1.3.1/IrrLibBase.cpp (full)
AUnstable Version/1.3.1/IrrLibBase.h (full)
AUnstable Version/1.3.1/IrrLibGUI.cpp (full)
AUnstable Version/1.3.1/IrrLibGUI.h (full)
AUnstable Version/1.3.1/IrrSphere.cpp (full)
AUnstable Version/1.3.1/IrrSphere.h (full)
AUnstable Version/1.3.1/IrrSprite.cpp (full)
AUnstable Version/1.3.1/IrrSprite.h (full)
AUnstable Version/1.3.1/Irrcolor.cpp (full)
AUnstable Version/1.3.1/Irrcolor.h (full)
AUnstable Version/1.3.1/Irrdata.h (full)
AUnstable Version/1.3.1/Irrlib.cpp (full)
AUnstable Version/1.3.1/Irrlib.h (full)
AUnstable Version/1.3.1/Readme (full)
AUnstable Version/1.3.2/CHANGES (full)
AUnstable Version/1.3.2/CREDITS (full)
AUnstable Version/1.3.2/Irr2D.cpp (full)
AUnstable Version/1.3.2/Irr2D.h (full)
AUnstable Version/1.3.2/Irr3D.cpp (full)
AUnstable Version/1.3.2/Irr3D.h (full)
AUnstable Version/1.3.2/Irr3DObj.cpp (full)
AUnstable Version/1.3.2/Irr3DObj.h (full)
AUnstable Version/1.3.2/IrrColor.cpp (full)
AUnstable Version/1.3.2/IrrColor.h (full)
AUnstable Version/1.3.2/IrrData.h (full)
AUnstable Version/1.3.2/IrrEventReciever.cpp (full)
AUnstable Version/1.3.2/IrrEventReciever.h (full)
AUnstable Version/1.3.2/IrrFunctions.cpp (full)
AUnstable Version/1.3.2/IrrFunctions.h (full)
AUnstable Version/1.3.2/IrrLib.cpp (full)
AUnstable Version/1.3.2/IrrLib.h (full)
AUnstable Version/1.3.2/IrrLibBase.cpp (full)
AUnstable Version/1.3.2/IrrLibBase.h (full)
AUnstable Version/1.3.2/IrrLibGUI.cpp (full)
AUnstable Version/1.3.2/IrrLibGUI.h (full)
AUnstable Version/1.3.2/IrrPhysics.cpp (full)
AUnstable Version/1.3.2/IrrPhysics.h (full)
AUnstable Version/1.3.2/IrrSphere.cpp (full)
AUnstable Version/1.3.2/IrrSphere.h (full)
AUnstable Version/1.3.2/IrrSprite.cpp (full)
AUnstable Version/1.3.2/IrrSprite.h (full)
AUnstable Version/1.3.2/Newton.h (full)
AUnstable Version/1.3.2/README (full)
AUnstable Version/1.3.3/CHANGES (full)
AUnstable Version/1.3.3/CREDITS (full)
AUnstable Version/1.3.3/Collision.h (full)
AUnstable Version/1.3.3/Copy of IrrFunctions.cpp (full)
AUnstable Version/1.3.3/Irr2D.cpp (full)
AUnstable Version/1.3.3/Irr2D.h (full)
AUnstable Version/1.3.3/Irr2DLibObj.cpp (full)
AUnstable Version/1.3.3/Irr2DLibObj.h (full)
AUnstable Version/1.3.3/Irr3D.cpp (full)
AUnstable Version/1.3.3/Irr3D.h (full)
AUnstable Version/1.3.3/Irr3DLibObj.cpp (full)
AUnstable Version/1.3.3/Irr3DLibObj.h (full)
AUnstable Version/1.3.3/Irr3DObjColor.h (full)
AUnstable Version/1.3.3/Irr3DPos.h (full)
AUnstable Version/1.3.3/IrrColor.cpp (full)
AUnstable Version/1.3.3/IrrColor.h (full)
AUnstable Version/1.3.3/IrrDefines.h (full)
AUnstable Version/1.3.3/IrrDevices.h (full)
AUnstable Version/1.3.3/IrrEventReciever.cpp (full)
AUnstable Version/1.3.3/IrrEventReciever.h (full)
AUnstable Version/1.3.3/IrrFunctions.cpp (full)
AUnstable Version/1.3.3/IrrFunctions.h (full)
AUnstable Version/1.3.3/IrrGUIStruct.h (full)
AUnstable Version/1.3.3/IrrLib.cpp (full)
AUnstable Version/1.3.3/IrrLib.h (full)
AUnstable Version/1.3.3/IrrLibBase.cpp (full)
AUnstable Version/1.3.3/IrrLibBase.h (full)
AUnstable Version/1.3.3/IrrLibGUI.cpp (full)
AUnstable Version/1.3.3/IrrLibGUI.h (full)
AUnstable Version/1.3.3/IrrLibObj.h (full)
AUnstable Version/1.3.3/IrrObj.h (full)
AUnstable Version/1.3.3/IrrOpt.h (full)
AUnstable Version/1.3.3/IrrPhysics.cpp (full)
AUnstable Version/1.3.3/IrrPhysics.h (full)
AUnstable Version/1.3.3/IrrSphere.cpp (full)
AUnstable Version/1.3.3/IrrSphere.h (full)
AUnstable Version/1.3.3/IrrSprite.cpp (full)
AUnstable Version/1.3.3/IrrSprite.h (full)
AUnstable Version/1.3.3/IrrText.cpp (full)
AUnstable Version/1.3.3/IrrText.h (full)
AUnstable Version/1.3.3/Newton.h (full)
AUnstable Version/1.3.3/README (full)
AUnstable Version/1.3.3/_mouse.h (full)
AUnstable Version/1.3.3/dList.h (full)
AUnstable Version/1.3.3/dMatrix.cpp (full)
AUnstable Version/1.3.3/dMatrix.h (full)
AUnstable Version/1.3.3/dQuaternion.cpp (full)
AUnstable Version/1.3.3/dQuaternion.h (full)
AUnstable Version/1.3.3/dVector.h (full)
AUnstable Version/1.3.3/glut.h (full)
AUnstable Version/1.3.3/main.cpp (full)
AUnstable Version/1.3.3/stdafx.h (full)
AWIP/INFO (full)
AWIP/Irr2D.h (full)
AWIP/Irr2DObj.cpp (full)
AWIP/Irr2DObj.h (full)
AWIP/Irr2d.cpp (full)
AWIP/Irr3D.cpp (full)
AWIP/Irr3DObj.cpp (full)
AWIP/Irr3DObj.h (full)
AWIP/Irr3d.h (full)
AWIP/IrrColor.cpp (full)
AWIP/IrrColor.h (full)
AWIP/IrrLib.cpp (full)
AWIP/IrrLib.h (full)
AWIP/Newton.h (full)
AWIP/dlls/newton.dll
AWIP/dlls/newton.lib
AWIP/dlls/newton.map (full)
AWIP/dlls/newton.pdb

File differences

Examples/Example_1.old/q3level.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
#include <iostream>
#include "../../IrrLib/IrrLib.h"
using namespace std;
using namespace irr;
using namespace core;
using namespace scene;
using namespace video;
using namespace io;
using namespace gui;
int main(){
IrrLib Irrlicht(3, 640, 480, 16, false, true, true);
Irrlicht.ReadArchive("../../media/map-20kdm2.pk3");
Irrlicht.LoadQ3Level("20kdm2.bsp");
Irrlicht.NodePos(-1300, -144, -1249);
//Sets the camera at that x, y, z position
Irrlicht.AddFPSCam();
Irrlicht.VisibleCursor(false);
int lastFPS = -1;
int fps = -1;
while (Irrlicht.DeviceIsRunning())
if (Irrlicht.IsActiveWindow())
{
Irrlicht.BeginScene();
Irrlicht.DrawAll();
Irrlicht.EndScene();
fps = Irrlicht.GetFPSCount();
if (lastFPS != fps)
{
stringw str = L"Irrlicht Engine - Quake 3 Map example [";
str += Irrlicht.GetDriverName();
str += "] FPS:";
str += fps;
Irrlicht.SetWindowCaption(str);
lastFPS = fps;
}
}
Irrlicht.EndIrrlicht();
return 0; //the deconstructor will delete all our dynamic vars so we don't have horriable memory leaks!
//That was easy wasn't it?
//Everything is now humanreadable, I think your next door neighbor could even figure out whats going on....maybe
}
Examples/Example_10_DisableEscExit/main_x.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
#include <iostream>
#include "IrrLib.h"
#include <irrlicht.h>
using namespace std;
using namespace irr;
using namespace core;
using namespace scene;
using namespace video;
using namespace io;
using namespace gui;
int main(){
IrrLib Irrlicht(5, 640, 480, 16, false, true, false);
Irrlicht.IrrEvent.SetEscExit(false);
while (Irrlicht.DeviceIsRunning())
if (Irrlicht.IsActiveWindow())
{
Irrlicht.BeginScene();
Irrlicht.DrawAll();
Irrlicht.EndScene();
}
Irrlicht.EndIrrlicht();
return 0;
}
Examples/Example_11_3DObjects/main_x.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
#include <iostream>
#include "IrrLib.h"
#include <irrlicht.h>
using namespace std;
using namespace irr;
using namespace core;
using namespace scene;
using namespace video;
using namespace io;
using namespace gui;
int main(){
IrrLib Irrlicht(5, 640, 480, 16, false, true, false);
Irr3DObjColor col1;
Irr3DObjColor col2;
int nHits;
int nTimes = 0;
//Color 1
col1.a = 255;
col1.r = 0;
col1.g = 255;
col1.b = 5;
//color 2
col2.a = 255;
col2.r = 0;
col2.g = 255;
col2.b = 255;
//Pos 1
Irr3DPos pos1;
pos1.x = 0;
pos1.y = 0;
pos1.z = 0;
Irr3DObj obj1;
obj1->setColor(col1);
obj1->setMesh("sphere.3ds");
Irr3DObj obj2;
obj2->setMesh("cube.3ds");
obj2->setColor(col2);
obj1->addToScene();
obj2->addToScene();
Irrlicht.AddFPSCam();
while (Irrlicht.DeviceIsRunning())
if (Irrlicht.IsActiveWindow())
{
nHits = CheckForCollision(obj1,obj2);
if (nHits > 0)
{
cout << "The sphere collided with the squre " << nTimes << endl;
nTimes++;
}
if (Irrlicht.IrrEvent.keyStates[KEY_KEY_W]){
Irrlicht.IrrEvent.keyStates[KEY_KEY_W] = false;
pos1.x = pos1.x + 10;
obj1->Move(pos1);
}
if (Irrlicht.IrrEvent.keyStates[KEY_KEY_S]){
Irrlicht.IrrEvent.keyStates[KEY_KEY_S] = false;
pos1.x = pos1.x - 10;
obj1->Move(pos1);
}
Irrlicht.BeginScene(Irrlicht.Color.RED);
Irrlicht.DrawAll();
Irrlicht.EndScene();
nHits = 0;
}
Irrlicht.EndIrrlicht();
return 0;
}
Examples/Example_1_Basic/main.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
#include <iostream>
#include "IrrLib.h"
#include <irrlicht.h>
using namespace std;
using namespace irr;
using namespace core;
using namespace scene;
using namespace video;
using namespace io;
using namespace gui;
int main(){
/*
Driver types:
0 = NULL
1 = EDT_SOFTWARE
2 = EDT_BURNINGSVIDEO
3 = EDT_OPENGL
4 = EDT_DIRECT3D8 *Note not supported by Microsoft anymore
5 = EDT_DIRECT3D9 *Reccommended
defualt = EDT_SOFTWARE
If you are confused using the driver types consider using an enum:
//note you can name the drivers what ever you want, C++ will still number them correctly assuming they are in this order
enum IrrDriverType { NULL, EDT_SOFTWARE, EDT_BURNINGSVIDEO, EDT_OPENGL, EDT_DIRECT3D8, EDT_DIRECT3D9 };
IrrDriverType = EDT_DIRECT3D9;
//then pass IrrDriverType to Irrlicht constructor
IrrLib Irrlicht(IrrDriverType, 640, 480, 16, false, true, false);
Note: Do not set vsync, last param, to true unless you want to slow down your
software. ie playing doom on a $5,000 gaming machine, would be wise to use vsync
in that senerio.
*/
//This is a non defualt constructor for the IrrLib
//Defualt uses software with 640x480 res and all settings to false
// You can declare a default Irrlicht like this:
// IrrLib Irrlicht;
/*
IrrLib::IrrLib(int nDrivertype, int width, int height, int bits, bool fullscreen, bool stencilbuffer, bool vsync);
As you can see from the function prototype, I am created a new Irrlicht device using Direct3D9 driver, 640x480 res, with fullscreen off, stencil buffer on, and vsync off
*/
IrrLib Irrlicht(5, 640, 480, 16, false, true, false);
//if Irrlicht is the active window
// You don't have to use it, but your 'game' will still be running if the user alt tabs to word or something
//Lets create a loop until the Irrlicht device is stoped
while (Irrlicht.DeviceIsRunning())
if (Irrlicht.IsActiveWindow())
{
//Default begin scene uses a grey background
Irrlicht.BeginScene();
//Tells Irrlicht to draw everything to the screen, GUI elements/3D-2D objects including spheres
Irrlicht.DrawAll();
//Tells Irrlicht that we are done drawing anything
Irrlicht.EndScene();
}
//Our game is done, tell Irrlicht to clean up and exit
Irrlicht.EndIrrlicht();
return 0; //the deconstructor will delete all our dynamic vars so we don't have horriable memory leaks!
}
Examples/Example_1_Basic/main_x.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
#include <iostream>
#include "IrrLib.h"
#include <irrlicht.h>
using namespace std;
using namespace irr;
using namespace core;
using namespace scene;
using namespace video;
using namespace io;
using namespace gui;
int main(){
IrrLib Irrlicht(5, 640, 480, 16, false, true, false);
while (Irrlicht.DeviceIsRunning())
if (Irrlicht.IsActiveWindow())
{
Irrlicht.BeginScene();
Irrlicht.DrawAll();
Irrlicht.EndScene();
}
Irrlicht.EndIrrlicht();
return 0;
}
Examples/Example_2_SceneColor/main.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
#include <iostream>
#include "IrrLib.h"
#include <irrlicht.h>
using namespace std;
using namespace irr;
using namespace core;
using namespace scene;
using namespace video;
using namespace io;
using namespace gui;
int main(){
/*
Driver types:
0 = NULL
1 = EDT_SOFTWARE
2 = EDT_BURNINGSVIDEO
3 = EDT_OPENGL
4 = EDT_DIRECT3D8 *Note not supported by Microsoft anymore
5 = EDT_DIRECT3D9 *Reccommended
defualt = EDT_SOFTWARE
Note: Do not set vsync, last param, to true unless you want to slow down your
software. ie playing doom on a $5,000 gaming machine, would be wise to use vsync
in that senerio.
*/
//This is a non defualt constructor for the IrrLib
//Defualt uses software with 640x480 res and all settings to false
// You can declare a default Irrlicht like this:
// IrrLib Irrlicht;
/*
IrrLib::IrrLib(int nDrivertype, int width, int height, int bits, bool fullscreen, bool stencilbuffer, bool vsync);
As you can see from the function prototype, I am created a new Irrlicht device using Direct3D9 driver, 640x480 res, with fullscreen off, stencil buffer on, and vsync off
*/
IrrLib Irrlicht(5, 640, 480, 16, false, true, false);
//if Irrlicht is the active window
// You don't have to use it, but your 'game' will still be running if the user alt tabs to word or something
//Lets create a loop until the Irrlicht device is stoped
while (Irrlicht.DeviceIsRunning())
if (Irrlicht.IsActiveWindow())
{
//black background
Irrlicht.BeginScene(SColor(255, 255, 255));
//For the background color you have another choice:
/*
Irrlicht.BeginScene(Irrlicht.Color("green"));
*/
//This would also work, because the color class is a wrapper for some basic colors.
/* Other choices include:
red
green
blue
dark green
pink
grey
*/
//Tells Irrlicht to draw everything to the screen, GUI elements/3D-2D objects including spheres
Irrlicht.DrawAll();
//Tells Irrlicht that we are done drawing anything
Irrlicht.EndScene();
}
//Our game is done, tell Irrlicht to clean up and exit
Irrlicht.EndIrrlicht();
return 0; //the deconstructor will delete all our dynamic vars so we don't have horriable memory leaks!
}
Examples/Example_2_SceneColor/main_x.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
#include <iostream>
#include "IrrLib.h"
#include <irrlicht.h>
using namespace std;
using namespace irr;
using namespace core;
using namespace scene;
using namespace video;
using namespace io;
using namespace gui;
int main(){
IrrLib Irrlicht(5, 640, 480, 16, false, true, false);
while (Irrlicht.DeviceIsRunning())
if (Irrlicht.IsActiveWindow())
{
Irrlicht.BeginScene(SColor(255, 255, 255, 255));
Irrlicht.DrawAll();
Irrlicht.EndScene();
}
Irrlicht.EndIrrlicht();
return 0;
}
Examples/Example_3_Keyboard/main.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
#include <iostream>
#include "IrrLib.h"
#include <irrlicht.h>
using namespace std;
using namespace irr;
using namespace core;
using namespace scene;
using namespace video;
using namespace io;
using namespace gui;
int main(){
/*
Driver types:
0 = NULL
1 = EDT_SOFTWARE
2 = EDT_BURNINGSVIDEO
3 = EDT_OPENGL
4 = EDT_DIRECT3D8 *Note not supported by Microsoft anymore
5 = EDT_DIRECT3D9 *Reccommended
defualt = EDT_SOFTWARE
Note: Do not set vsync, last param, to true unless you want to slow down your
software. ie playing doom on a $5,000 gaming machine, would be wise to use vsync
in that senerio.
*/
//This is a non defualt constructor for the IrrLib
//Defualt uses software with 640x480 res and all settings to false
// You can declare a default Irrlicht like this:
// IrrLib Irrlicht;
/*
IrrLib::IrrLib(int nDrivertype, int width, int height, int bits, bool fullscreen, bool stencilbuffer, bool vsync);
As you can see from the function prototype, I am created a new Irrlicht device using Direct3D9 driver, 640x480 res, with fullscreen off, stencil buffer on, and vsync off
*/
IrrLib Irrlicht(5, 640, 480, 16, false, true, false);
//if Irrlicht is the active window
// You don't have to use it, but your 'game' will still be running if the user alt tabs to word or something
//Lets create a loop until the Irrlicht device is stoped
while (Irrlicht.DeviceIsRunning())
if (Irrlicht.IsActiveWindow())
{
//grey background
Irrlicht.BeginScene();
//Tells Irrlicht to draw everything to the screen, GUI elements/3D-2D objects including spheres
Irrlicht.DrawAll();
//Tells Irrlicht that we are done drawing anything
Irrlicht.EndScene();
//If user hits escape, exit
//Note* Exit condition has to be done last else you will get a nonsense error from Irrlicht saying it couldn't draw.
if (Irrlicht.IrrEvent.keyStates[KEY_ESCAPE]){
Irrlicht.IrrEvent.keyStates[KEY_ESCAPE] = false;
Irrlicht.Exit();
}
}
//Our game is done, tell Irrlicht to clean up and exit
Irrlicht.EndIrrlicht();
return 0; //the deconstructor will delete all our dynamic vars so we don't have horriable memory leaks!
}
Examples/Example_3_Keyboard/main_x.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
#include <iostream>
#include "IrrLib.h"
#include <irrlicht.h>
using namespace std;
using namespace irr;
using namespace core;
using namespace scene;
using namespace video;
using namespace io;
using namespace gui;
int main(){
IrrLib Irrlicht(5, 640, 480, 16, false, true, false);
while (Irrlicht.DeviceIsRunning())
if (Irrlicht.IsActiveWindow())
{
Irrlicht.BeginScene();
Irrlicht.DrawAll();
Irrlicht.EndScene();
if (Irrlicht.IrrEvent.keyStates[KEY_ESCAPE]){
Irrlicht.IrrEvent.keyStates[KEY_ESCAPE] = false;
Irrlicht.Exit();
}
}
Irrlicht.EndIrrlicht();
return 0;
}
Examples/Example_4_WindowCaption/UsingStdString.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
#include <iostream>
#include "IrrLib.h"
#include <irrlicht.h>
using namespace std;
using namespace irr;
using namespace core;
using namespace scene;
using namespace video;
using namespace io;
using namespace gui;
int main(){
/*
Driver types:
0 = NULL
1 = EDT_SOFTWARE
2 = EDT_BURNINGSVIDEO
3 = EDT_OPENGL
4 = EDT_DIRECT3D8 *Note not supported by Microsoft anymore
5 = EDT_DIRECT3D9 *Reccommended
defualt = EDT_SOFTWARE
Note: Do not set vsync, last param, to true unless you want to slow down your
software. ie playing doom on a $5,000 gaming machine, would be wise to use vsync
in that senerio.
*/
//This is a non defualt constructor for the IrrLib
//Defualt uses software with 640x480 res and all settings to false
// You can declare a default Irrlicht like this:
// IrrLib Irrlicht;
/*
IrrLib::IrrLib(int nDrivertype, int width, int height, int bits, bool fullscreen, bool stencilbuffer, bool vsync);
As you can see from the function prototype, I am created a new Irrlicht device using Direct3D9 driver, 640x480 res, with fullscreen off, stencil buffer on, and vsync off
*/
IrrLib Irrlicht(5, 640, 480, 16, false, true, false);
//if Irrlicht is the active window
// You don't have to use it, but your 'game' will still be running if the user alt tabs to word or something
//Lets create a loop until the Irrlicht device is stoped
while (Irrlicht.DeviceIsRunning())
if (Irrlicht.IsActiveWindow())
{
//grey background
Irrlicht.BeginScene();
//Tells Irrlicht to draw everything to the screen, GUI elements/3D-2D objects including spheres
Irrlicht.DrawAll();
//Tells Irrlicht that we are done drawing anything
Irrlicht.EndScene();
//If user hits escape, exit
//Note* Exit condition has to be done last else you will get a nonsense error from Irrlicht saying it couldn't draw.
if (Irrlicht.IrrEvent.keyStates[KEY_ESCAPE]){
Irrlicht.IrrEvent.keyStates[KEY_ESCAPE] = false;
Irrlicht.Exit();
}
//This demostrates using std::string to set a window caption
std::string str = "IrrLib is cool!";
//Every class in Irrlicht knows some basic conversion
//See the following examples for more options
/*
You can also convert a stringw to a std::string using
stringw tmpw = L"This is fun!";
std::string tmp = Irrlicht.stringw_to_stdstring(tmpw);
Every class also knows how to convert an int to std::string
std::string snum = Irrlicht.int_to_string(5);
*/
Irrlicht.SetWindowCaption(Irrlicht.stdstring_to_stringw(str));
}
//Our game is done, tell Irrlicht to clean up and exit
Irrlicht.EndIrrlicht();
return 0; //the deconstructor will delete all our dynamic vars so we don't have horriable memory leaks!
}
Examples/Example_4_WindowCaption/UsingStringw.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
#include <iostream>
#include "IrrLib.h"
#include <irrlicht.h>
using namespace std;
using namespace irr;
using namespace core;
using namespace scene;
using namespace video;
using namespace io;
using namespace gui;
int main(){
/*
Driver types:
0 = NULL
1 = EDT_SOFTWARE
2 = EDT_BURNINGSVIDEO
3 = EDT_OPENGL
4 = EDT_DIRECT3D8 *Note not supported by Microsoft anymore
5 = EDT_DIRECT3D9 *Reccommended
defualt = EDT_SOFTWARE
Note: Do not set vsync, last param, to true unless you want to slow down your
software. ie playing doom on a $5,000 gaming machine, would be wise to use vsync
in that senerio.
*/
//This is a non defualt constructor for the IrrLib
//Defualt uses software with 640x480 res and all settings to false
// You can declare a default Irrlicht like this:
// IrrLib Irrlicht;
/*
IrrLib::IrrLib(int nDrivertype, int width, int height, int bits, bool fullscreen, bool stencilbuffer, bool vsync);
As you can see from the function prototype, I am created a new Irrlicht device using Direct3D9 driver, 640x480 res, with fullscreen off, stencil buffer on, and vsync off
*/
IrrLib Irrlicht(5, 640, 480, 16, false, true, false);
//if Irrlicht is the active window
// You don't have to use it, but your 'game' will still be running if the user alt tabs to word or something
//Lets create a loop until the Irrlicht device is stoped
while (Irrlicht.DeviceIsRunning())
if (Irrlicht.IsActiveWindow())
{
//grey background
Irrlicht.BeginScene();
//Tells Irrlicht to draw everything to the screen, GUI elements/3D-2D objects including spheres
Irrlicht.DrawAll();
//Tells Irrlicht that we are done drawing anything
Irrlicht.EndScene();
//If user hits escape, exit
//Note* Exit condition has to be done last else you will get a nonsense error from Irrlicht saying it couldn't draw.
if (Irrlicht.IrrEvent.keyStates[KEY_ESCAPE]){
Irrlicht.IrrEvent.keyStates[KEY_ESCAPE] = false;
Irrlicht.Exit();
}
//This demostrates using irrlichts stringw data type
//See the following examples for more options
stringw str = L"Hello world, this is a fun game!";
Irrlicht.SetWindowCaption(str);
}
//Our game is done, tell Irrlicht to clean up and exit
Irrlicht.EndIrrlicht();
return 0; //the deconstructor will delete all our dynamic vars so we don't have horriable memory leaks!
}
Examples/Example_4_WindowCaption/main.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
#include <iostream>
#include "IrrLib.h"
#include <irrlicht.h>
using namespace std;
using namespace irr;
using namespace core;
using namespace scene;
using namespace video;
using namespace io;
using namespace gui;
int main(){
/*
Driver types:
0 = NULL
1 = EDT_SOFTWARE
2 = EDT_BURNINGSVIDEO
3 = EDT_OPENGL
4 = EDT_DIRECT3D8 *Note not supported by Microsoft anymore
5 = EDT_DIRECT3D9 *Reccommended
defualt = EDT_SOFTWARE
Note: Do not set vsync, last param, to true unless you want to slow down your
software. ie playing doom on a $5,000 gaming machine, would be wise to use vsync
in that senerio.
*/
//This is a non defualt constructor for the IrrLib
//Defualt uses software with 640x480 res and all settings to false
// You can declare a default Irrlicht like this:
// IrrLib Irrlicht;
/*
IrrLib::IrrLib(int nDrivertype, int width, int height, int bits, bool fullscreen, bool stencilbuffer, bool vsync);
As you can see from the function prototype, I am created a new Irrlicht device using Direct3D9 driver, 640x480 res, with fullscreen off, stencil buffer on, and vsync off
*/
IrrLib Irrlicht(5, 640, 480, 16, false, true, false);
//if Irrlicht is the active window
// You don't have to use it, but your 'game' will still be running if the user alt tabs to word or something
//Lets create a loop until the Irrlicht device is stoped
while (Irrlicht.DeviceIsRunning())
if (Irrlicht.IsActiveWindow())
{
//grey background
Irrlicht.BeginScene();
//Tells Irrlicht to draw everything to the screen, GUI elements/3D-2D objects including spheres
Irrlicht.DrawAll();
//Tells Irrlicht that we are done drawing anything
Irrlicht.EndScene();
//If user hits escape, exit
//Note* Exit condition has to be done last else you will get a nonsense error from Irrlicht saying it couldn't draw.
if (Irrlicht.IrrEvent.keyStates[KEY_ESCAPE]){
Irrlicht.IrrEvent.keyStates[KEY_ESCAPE] = false;
Irrlicht.Exit();
}
//This demostrates setting a static window caption
Irrlicht.SetWindowCaption(L"Hello world, this is a fun game!");
}
//Our game is done, tell Irrlicht to clean up and exit
Irrlicht.EndIrrlicht();
return 0; //the deconstructor will delete all our dynamic vars so we don't have horriable memory leaks!
}
Examples/Example_4_WindowCaption/main_x.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
#include <iostream>
#include "IrrLib.h"
#include <irrlicht.h>
using namespace std;
using namespace irr;
using namespace core;
using namespace scene;
using namespace video;
using namespace io;
using namespace gui;
int main(){
IrrLib Irrlicht(5, 640, 480, 16, false, true, false);
while (Irrlicht.DeviceIsRunning())
if (Irrlicht.IsActiveWindow())
{
Irrlicht.BeginScene();
Irrlicht.DrawAll();
Irrlicht.EndScene();
if (Irrlicht.IrrEvent.keyStates[KEY_ESCAPE]){
Irrlicht.IrrEvent.keyStates[KEY_ESCAPE] = false;
Irrlicht.Exit();
}
std::string str = "IrrLib is cool!";
Irrlicht.SetWindowCaption(Irrlicht.stdstring_to_stringw(str));
}
Irrlicht.EndIrrlicht();
return 0;
}
----------------------
#include <iostream>
#include "IrrLib.h"
#include <irrlicht.h>
using namespace std;
using namespace irr;
using namespace core;
using namespace scene;
using namespace video;
using namespace io;
using namespace gui;
int main(){
IrrLib Irrlicht(5, 640, 480, 16, false, true, false);
while (Irrlicht.DeviceIsRunning())
if (Irrlicht.IsActiveWindow())
{
Irrlicht.BeginScene();
Irrlicht.DrawAll();
Irrlicht.EndScene();
if (Irrlicht.IrrEvent.keyStates[KEY_ESCAPE]){
Irrlicht.IrrEvent.keyStates[KEY_ESCAPE] = false;
Irrlicht.Exit();
}
stringw str = L"Hello world, this is a fun game!";
Irrlicht.SetWindowCaption(str);
}
Irrlicht.EndIrrlicht();
return 0;
}
------------------------------------------------------
#include <iostream>
#include "IrrLib.h"
#include <irrlicht.h>
using namespace std;
using namespace irr;
using namespace core;
using namespace scene;
using namespace video;
using namespace io;
using namespace gui;
int main(){
IrrLib Irrlicht(5, 640, 480, 16, false, true, false);
while (Irrlicht.DeviceIsRunning())
if (Irrlicht.IsActiveWindow())
{
Irrlicht.BeginScene();
Irrlicht.DrawAll();
Irrlicht.EndScene();
if (Irrlicht.IrrEvent.keyStates[KEY_ESCAPE]){
Irrlicht.IrrEvent.keyStates[KEY_ESCAPE] = false;
Irrlicht.Exit();
}
Irrlicht.SetWindowCaption(L"Hello world, this is a fun game!");
}
Irrlicht.EndIrrlicht();
return 0;
}
Examples/Example_5_Cursor/main.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
#include <iostream>
#include "IrrLib.h"
#include <irrlicht.h>
using namespace std;
using namespace irr;
using namespace core;
using namespace scene;
using namespace video;
using namespace io;
using namespace gui;
int main(){
/*
Driver types:
0 = NULL
1 = EDT_SOFTWARE
2 = EDT_BURNINGSVIDEO
3 = EDT_OPENGL
4 = EDT_DIRECT3D8 *Note not supported by Microsoft anymore
5 = EDT_DIRECT3D9 *Reccommended
defualt = EDT_SOFTWARE
Note: Do not set vsync, last param, to true unless you want to slow down your
software. ie playing doom on a $5,000 gaming machine, would be wise to use vsync
in that senerio.
*/
//This is a non defualt constructor for the IrrLib
//Defualt uses software with 640x480 res and all settings to false
// You can declare a default Irrlicht like this:
// IrrLib Irrlicht;
/*
IrrLib::IrrLib(int nDrivertype, int width, int height, int bits, bool fullscreen, bool stencilbuffer, bool vsync);
As you can see from the function prototype, I am created a new Irrlicht device using Direct3D9 driver, 640x480 res, with fullscreen off, stencil buffer on, and vsync off
*/
IrrLib Irrlicht(5, 640, 480, 16, false, true, false);
//You only need one line to hide the mouse cursor if you want
Irrlicht.VisibleCursor(false);
//if Irrlicht is the active window
// You don't have to use it, but your 'game' will still be running if the user alt tabs to word or something
//Lets create a loop until the Irrlicht device is stoped
while (Irrlicht.DeviceIsRunning())
if (Irrlicht.IsActiveWindow())
{
//Default begin scene uses a grey background
Irrlicht.BeginScene();
//Tells Irrlicht to draw everything to the screen, GUI elements/3D-2D objects including spheres
Irrlicht.DrawAll();
//Tells Irrlicht that we are done drawing anything
Irrlicht.EndScene();
}
//Our game is done, tell Irrlicht to clean up and exit
Irrlicht.EndIrrlicht();
return 0; //the deconstructor will delete all our dynamic vars so we don't have horriable memory leaks!
}
Examples/Example_5_Cursor/main_x.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
#include <iostream>
#include "IrrLib.h"
#include <irrlicht.h>
using namespace std;
using namespace irr;
using namespace core;
using namespace scene;
using namespace video;
using namespace io;
using namespace gui;
int main(){
IrrLib Irrlicht(5, 640, 480, 16, false, true, false);
Irrlicht.VisibleCursor(false);
while (Irrlicht.DeviceIsRunning())
if (Irrlicht.IsActiveWindow())
{
Irrlicht.BeginScene();
Irrlicht.DrawAll();
Irrlicht.EndScene();
}
Irrlicht.EndIrrlicht();
return 0;
}
Examples/Example_6_GameLoop/main.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
#include <iostream>
#include "IrrLib.h"
#include <irrlicht.h>
using namespace std;
using namespace irr;
using namespace core;
using namespace scene;
using namespace video;
using namespace io;
using namespace gui;
int main(){
/*
Driver types:
0 = NULL
1 = EDT_SOFTWARE
2 = EDT_BURNINGSVIDEO
3 = EDT_OPENGL
4 = EDT_DIRECT3D8 *Note not supported by Microsoft anymore
5 = EDT_DIRECT3D9 *Reccommended
defualt = EDT_SOFTWARE
Note: Do not set vsync, last param, to true unless you want to slow down your
software. ie playing doom on a $5,000 gaming machine, would be wise to use vsync
in that senerio.
*/
//This is a non defualt constructor for the IrrLib
//Defualt uses software with 640x480 res and all settings to false
// You can declare a default Irrlicht like this:
// IrrLib Irrlicht;
/*
IrrLib::IrrLib(int nDrivertype, int width, int height, int bits, bool fullscreen, bool stencilbuffer, bool vsync);
As you can see from the function prototype, I am created a new Irrlicht device using Direct3D9 driver, 640x480 res, with fullscreen off, stencil buffer on, and vsync off
*/
IrrLib Irrlicht(5, 640, 480, 16, false, true, false);
//if Irrlicht is the active window
// You don't have to use it, but your 'game' will still be running if the user alt tabs to word or something
//Lets create a loop until the Irrlicht device is stoped
while (Irrlicht.DeviceIsRunning())
if (Irrlicht.IsActiveWindow())
{
//Lets start a game loop
//Default game loop is 30ms, you can also use:
/*
Irrlicht.CheckGameLoop(60);
*/
//To set a custom gameloop timer
if(Irrlicht.CheckGameLoop()){
//Default begin scene uses a grey background
Irrlicht.BeginScene();
//Tells Irrlicht to draw everything to the screen, GUI elements/3D-2D objects including spheres
Irrlicht.DrawAll();
//Tells Irrlicht that we are done drawing anything
Irrlicht.EndScene();
}
}
//Our game is done, tell Irrlicht to clean up and exit
Irrlicht.EndIrrlicht();
return 0; //the deconstructor will delete all our dynamic vars so we don't have horriable memory leaks!
}
Examples/Example_6_GameLoop/main_x.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
#include <iostream>
#include "IrrLib.h"
#include <irrlicht.h>
using namespace std;
using namespace irr;
using namespace core;
using namespace scene;
using namespace video;
using namespace io;
using namespace gui;
int main(){
IrrLib Irrlicht(5, 640, 480, 16, false, true, false);
while (Irrlicht.DeviceIsRunning())
if (Irrlicht.IsActiveWindow())
{
if(Irrlicht.CheckGameLoop()){
Irrlicht.BeginScene();
Irrlicht.DrawAll();
Irrlicht.EndScene();
}
}
//Our game is done, tell Irrlicht to clean up and exit
Irrlicht.EndIrrlicht();
return 0; //the deconstructor will delete all our dynamic vars so we don't have horriable memory leaks!
}
Examples/Example_7_Spheres/main.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
#include <iostream>
#include "IrrLib.h"
#include <irrlicht.h>
using namespace std;
using namespace irr;
using namespace core;
using namespace scene;
using namespace video;
using namespace io;
using namespace gui;
int main(){
/*
Driver types:
0 = NULL
1 = EDT_SOFTWARE
2 = EDT_BURNINGSVIDEO
3 = EDT_OPENGL
4 = EDT_DIRECT3D8 *Note not supported by Microsoft anymore
5 = EDT_DIRECT3D9 *Reccommended
defualt = EDT_SOFTWARE
If you are confused using the driver types consider using an enum:
//note you can name the drivers what ever you want, C++ will still number them correctly assuming they are in this order
enum IrrDriverType { NULL, EDT_SOFTWARE, EDT_BURNINGSVIDEO, EDT_OPENGL, EDT_DIRECT3D8, EDT_DIRECT3D9 };
IrrDriverType = EDT_DIRECT3D9;
//then pass IrrDriverType to Irrlicht constructor
IrrLib Irrlicht(IrrDriverType, 640, 480, 16, false, true, false);
Note: Do not set vsync, last param, to true unless you want to slow down your
software. ie playing doom on a $5,000 gaming machine, would be wise to use vsync
in that senerio.
*/
//This is a non defualt constructor for the IrrLib
//Defualt uses software with 640x480 res and all settings to false
// You can declare a default Irrlicht like this:
// IrrLib Irrlicht;
/*
IrrLib::IrrLib(int nDrivertype, int width, int height, int bits, bool fullscreen, bool stencilbuffer, bool vsync);
As you can see from the function prototype, I am created a new Irrlicht device using Direct3D9 driver, 640x480 res, with fullscreen off, stencil buffer on, and vsync off
*/
IrrLib Irrlicht(5, 640, 480, 16, false, true, false);
int sphere1 = Irrlicht.Irr3DLib.Sphere.CreateNewSphereNode(0, 0, 30, "../../media/wall.bmp", false);
int sphere2 = Irrlicht.Irr3DLib.Sphere.CreateNewSphereNode(0, 20, 40, "../../media/wall.bmp", false);
int sphere3 = Irrlicht.Irr3DLib.Sphere.CreateNewSphereNode(0, 0, 50, "../../media/wall.bmp", false);
//if Irrlicht is the active window
// You don't have to use it, but your 'game' will still be running if the user alt tabs to word or something
//Lets create a loop until the Irrlicht device is stoped
while (Irrlicht.DeviceIsRunning())
if (Irrlicht.IsActiveWindow())
{
//Default begin scene uses a grey background
Irrlicht.BeginScene();
//Tells Irrlicht to draw everything to the screen, GUI elements/3D-2D objects including spheres
Irrlicht.DrawAll();
//Tells Irrlicht that we are done drawing anything
Irrlicht.EndScene();
}
//Our game is done, tell Irrlicht to clean up and exit
Irrlicht.EndIrrlicht();
return 0; //the deconstructor will delete all our dynamic vars so we don't have horriable memory leaks!
}
Examples/Example_7_Spheres/main_x.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
#include <iostream>
#include "IrrLib.h"
#include <irrlicht.h>
using namespace std;
using namespace irr;
using namespace core;
using namespace scene;
using namespace video;
using namespace io;
using namespace gui;
int main(){
IrrLib Irrlicht(5, 640, 480, 16, false, true, false);
int sphere1 = Irrlicht.Irr3DLib.Sphere.CreateNewSphereNode(0, 0, 30, "../../media/wall.bmp", false);
int sphere2 = Irrlicht.Irr3DLib.Sphere.CreateNewSphereNode(0, 20, 40, "../../media/wall.bmp", false);
int sphere3 = Irrlicht.Irr3DLib.Sphere.CreateNewSphereNode(0, 0, 50, "../../media/wall.bmp", false);
while (Irrlicht.DeviceIsRunning())
if (Irrlicht.IsActiveWindow())
{
Irrlicht.BeginScene();
Irrlicht.DrawAll();
Irrlicht.EndScene();
}
Irrlicht.EndIrrlicht();
return 0;
}
Examples/Example_8_Mouse/main.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
#include <iostream>
#include "IrrLib.h"
#include <irrlicht.h>
using namespace std;
using namespace irr;
using namespace core;
using namespace scene;
using namespace video;
using namespace io;
using namespace gui;
int main(){
/*
Driver types:
0 = NULL
1 = EDT_SOFTWARE
2 = EDT_BURNINGSVIDEO
3 = EDT_OPENGL
4 = EDT_DIRECT3D8 *Note not supported by Microsoft anymore
5 = EDT_DIRECT3D9 *Reccommended
defualt = EDT_SOFTWARE
If you are confused using the driver types consider using an enum:
//note you can name the drivers what ever you want, C++ will still number them correctly assuming they are in this order
enum IrrDriverType { NULL, EDT_SOFTWARE, EDT_BURNINGSVIDEO, EDT_OPENGL, EDT_DIRECT3D8, EDT_DIRECT3D9 };
IrrDriverType = EDT_DIRECT3D9;
//then pass IrrDriverType to Irrlicht constructor
IrrLib Irrlicht(IrrDriverType, 640, 480, 16, false, true, false);
Note: Do not set vsync, last param, to true unless you want to slow down your
software. ie playing doom on a $5,000 gaming machine, would be wise to use vsync
in that senerio.
*/
//This is a non defualt constructor for the IrrLib
//Defualt uses software with 640x480 res and all settings to false
// You can declare a default Irrlicht like this:
// IrrLib Irrlicht;
/*
IrrLib::IrrLib(int nDrivertype, int width, int height, int bits, bool fullscreen, bool stencilbuffer, bool vsync);
As you can see from the function prototype, I am created a new Irrlicht device using Direct3D9 driver, 640x480 res, with fullscreen off, stencil buffer on, and vsync off
*/
IrrLib Irrlicht(5, 640, 480, 16, false, true, false);
//if Irrlicht is the active window
// You don't have to use it, but your 'game' will still be running if the user alt tabs to word or something
//Lets create a loop until the Irrlicht device is stoped
std::string cap;
while (Irrlicht.DeviceIsRunning())
if (Irrlicht.IsActiveWindow())
{
//IrrEvent class has 2 functions for mouse handling
//getMouseX() returns the X pos of the mouse as an int
//getMouseY() returns the Y pos of the mouse as an int
cap = "Mouse X = " + Irrlicht.int_to_string(Irrlicht.IrrEvent.getMouseX()) + " Mouse Y = " + Irrlicht.int_to_string(Irrlicht.IrrEvent.getMouseY());
Irrlicht.SetWindowCaption(Irrlicht.stdstring_to_stringw(cap));
//Default begin scene uses a grey background
Irrlicht.BeginScene();
//Tells Irrlicht to draw everything to the screen, GUI elements/3D-2D objects including spheres
Irrlicht.DrawAll();
//Tells Irrlicht that we are done drawing anything
Irrlicht.EndScene();
}
//Our game is done, tell Irrlicht to clean up and exit
Irrlicht.EndIrrlicht();
return 0; //the deconstructor will delete all our dynamic vars so we don't have horriable memory leaks!
}
Examples/Example_8_Mouse/main_x.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
#include <iostream>
#include "IrrLib.h"
#include <irrlicht.h>
using namespace std;
using namespace irr;
using namespace core;
using namespace scene;
using namespace video;
using namespace io;
using namespace gui;
int main(){
IrrLib Irrlicht(5, 640, 480, 16, false, true, false);
std::string cap;
while (Irrlicht.DeviceIsRunning())
if (Irrlicht.IsActiveWindow())
{
cap = "Mouse X = " + Irrlicht.int_to_string(Irrlicht.IrrEvent.getMouseX()) + " Mouse Y = " + Irrlicht.int_to_string(Irrlicht.IrrEvent.getMouseY());
Irrlicht.SetWindowCaption(Irrlicht.stdstring_to_stringw(cap));
Irrlicht.BeginScene();
Irrlicht.DrawAll();
Irrlicht.EndScene();
}
Irrlicht.EndIrrlicht();
return 0;
}
Examples/Example_9_PictoDraw/main.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
#include <iostream>
#include "IrrLib.h"
#include <irrlicht.h>
using namespace std;
using namespace irr;
using namespace core;
using namespace scene;
using namespace video;
using namespace io;
using namespace gui;
int main(){
IrrLib Irrlicht(5, 640, 480, 16, false, true, false);
//Create a variable to determine if we should draw under the mouse or not
bool draw = false;
//Screen caption
std::string cap;
//Future use of screen resolution
dimension2d<s32> res;
//Declare 2 mouse containters so we can find out if the user has moved the mouse
position2d<s32> mxy;
position2d<s32> lastmxy;
//This function returns the size of the window Irrlicht is currently using
res = Irrlicht.GetScreenSize();
//Set the caption
cap = "Height in pixels: " + Irrlicht.int_to_string(res.Height) + " Width in pixels: " + Irrlicht.int_to_string(res.Width);
Irrlicht.SetWindowCaption(Irrlicht.stdstring_to_stringw(cap));
while (Irrlicht.DeviceIsRunning())
if (Irrlicht.IsActiveWindow())
{
//I was in a Red color mood when I made this, you can chose from a varity of colors.
Irrlicht.BeginScene(Irrlicht.Color.RED);
//If the user hits the left mouse button
if (Irrlicht.IrrEvent.mouseStates[0])
{
//we need to set it to false so we don't detect it again
Irrlicht.IrrEvent.mouseStates[0] = false;
//The user clicked the mouse so we need to turn drawing on and record the mouse
//pos so we can find out later if they move the mouse
if (draw == false){
lastmxy.Y = Irrlicht.IrrEvent.getMouseY();
lastmxy.X = Irrlicht.IrrEvent.getMouseX();
draw = true;
}
else
//turn it off
draw = false;
}
//if drawing is on
if (draw)
{
//Get current mouse pos
mxy.Y = Irrlicht.IrrEvent.getMouseY();
mxy.X = Irrlicht.IrrEvent.getMouseX();
//If current mouse pos != last mouse pos then add the line to Irr2D's vector of lines
//So Irr2D will know how many lines to draw and where to draw them
//Also record this pos so we can compare it later
if (mxy != lastmxy){
Irrlicht.Irr2DLib.AddLines(lastmxy, mxy, Irrlicht.Color.GREEN);
lastmxy = mxy;
}
}
//This is new, this tells Irr2D to draw all lines that it has collected so far
Irrlicht.Irr2DLib.DrawLines();
//The usual stuff
Irrlicht.DrawAll();
Irrlicht.EndScene();
}
Irrlicht.EndIrrlicht();
return 0;
}
Examples/Example_9_PictoDraw/main_x.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
#include <iostream>
#include "IrrLib.h"
#include <irrlicht.h>
using namespace std;
using namespace irr;
using namespace core;
using namespace scene;
using namespace video;
using namespace io;
using namespace gui;
int main(){
IrrLib Irrlicht(5, 640, 480, 16, false, true, false);
bool draw = false;
std::string cap;
dimension2d<s32> res;
position2d<s32> mxy;
position2d<s32> lastmxy;
res = Irrlicht.GetScreenSize();
cap = "Height in pixels: " + Irrlicht.int_to_string(res.Height) + " Width in pixels: " + Irrlicht.int_to_string(res.Width);
Irrlicht.SetWindowCaption(Irrlicht.stdstring_to_stringw(cap));
while (Irrlicht.DeviceIsRunning())
if (Irrlicht.IsActiveWindow())
{
Irrlicht.BeginScene(Irrlicht.Color.RED);
if (Irrlicht.IrrEvent.mouseStates[0])
{
Irrlicht.IrrEvent.mouseStates[0] = false;
if (draw == false){
lastmxy.Y = Irrlicht.IrrEvent.getMouseY();
lastmxy.X = Irrlicht.IrrEvent.getMouseX();
draw = true;
}
else
draw = false;
}
if (draw)
{
mxy.Y = Irrlicht.IrrEvent.getMouseY();
mxy.X = Irrlicht.IrrEvent.getMouseX();
if (mxy != lastmxy){
Irrlicht.Irr2DLib.AddLines(lastmxy, mxy, Irrlicht.Color.GREEN);
lastmxy = mxy;
}
}
Irrlicht.Irr2DLib.DrawLines();
Irrlicht.DrawAll();
Irrlicht.EndScene();
}
Irrlicht.EndIrrlicht();
return 0;
}
Old Versions/1.1/IrrLib.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
/*
Irrlicht Library Wrapper
Created by Nathan Adams
Version 1.1
Copyright (C) 2007
This software is licensed under the GNU/GPL.
This software may not be used for commerical purposes.
*/
#include <iostream>
#include "IrrLib.h"
#include <irrlicht.h>
#include <strings.h>
#include "IrrSphere.h"
using namespace irr;
using namespace core;
using namespace scene;
using namespace video;
using namespace io;
using namespace gui;
using namespace std;
//TODO: Create own class for handling inputs!
/*IrrLib::IrrLib(MastEventReceiver & receiver){
this->device = createDevice(EDT_SOFTWARE, dimension2d<s32>(640, 480), 16, false, false, false, &receiver);
if (this->device == 0)
exit(1);
IrrLib::Init();
}*/
IrrLib::IrrLib(){
this->device = createDevice(EDT_SOFTWARE, dimension2d<s32>(640, 480), 16, false, false, false, 0);
if (this->device == 0)
exit(1);
IrrLib::Init();
}
IrrLib::IrrLib(video::E_DRIVER_TYPE drivertype, core::dimension2d<s32> & res, u32 bits, bool fullscreen, bool stencilbuffer, bool vsync){
//MyEventReceiver receiver;
this->device = createDevice(drivertype, res, bits, fullscreen, stencilbuffer, vsync, 0);
if (this->device == 0)
exit(1);
IrrLib::Init();
}
IrrLib::IrrLib(int nDrivertype, int width, int height, int bits, bool fullscreen, bool stencilbuffer, bool vsync){
//MyEventReceiver receiver;
video::E_DRIVER_TYPE drivertype;
switch (nDrivertype){
case 0: //TODO: finish this switch case
drivertype = EDT_NULL;
break;
case 1:
drivertype = EDT_SOFTWARE;
break;
case 2:
drivertype = EDT_BURNINGSVIDEO;
break;
case 3:
drivertype = EDT_OPENGL;
break;
case 4:
drivertype = EDT_DIRECT3D8;
//TODO: Find how to detect if DX is complied into Irrlicht
//TODO: Find how to detecht for linux
break;
case 5:
drivertype = EDT_DIRECT3D9;
break;
default:
drivertype = EDT_SOFTWARE;
break;
}
this->device = createDevice(drivertype, dimension2d<s32>(width, height), bits, fullscreen, stencilbuffer, vsync, 0);
if (this->device == 0)
exit(1);
IrrLib::Init();
}
IrrLib::~IrrLib (){ //Our moms wont clean up after us!
//Although I'm sure Irrlicht does this for us already, its always a good idea to check!
/*if (this->device != NULL)
delete this->device;
if (this->driver != NULL)
delete this->driver;
if (this->smgr != NULL)
delete this->smgr;
if (this->mesh != NULL)
delete this->mesh;
if (this->node != NULL)
delete this->node;*/ //it seems Irrlicht picks up after us...
//however we created newNodes, now we need to delete it!
}
void IrrLib::Init(){
//this->numNodes = 0;
//this->nodeNew = new ISceneNode[10];
this->driver = this->device->getVideoDriver();
this->smgr = this->device->getSceneManager();
Sphere.SetSmgr(this->smgr);
Sphere.SetDriver(this->driver);
}
void IrrLib::ReadArchive(std::string file){
this->device->getFileSystem()->addZipFileArchive(file.c_str());
}
void IrrLib::LoadQ3Level(std::string q3level){
this->mesh = this->smgr->getMesh(q3level.c_str());
this->node = 0;
if (this->mesh)
this->node = this->smgr->addOctTreeSceneNode(this->mesh->getMesh(0), 0, -1, 128);
}
void IrrLib::NodePos(int x, int y, int z){
if (this->node)
this->node->setPosition(core::vector3df(x, y, z));
}
void IrrLib::NodePos(){
if (this->node)
this->node->setPosition(core::vector3df(0, 0, 0));
}
void IrrLib::AddFPSCam(){
this->cam = this->smgr->addCameraSceneNodeFPS();
}
void IrrLib::AddFPSCam(f32 x, f32 y, f32 z)
{
this->cam = this->smgr->addCameraSceneNodeFPS();
this->cam->setPosition(irr::core::vector3df(x, y, z));
}
void IrrLib::VisibleCursor(bool tf){
if (tf == false)
this->device->getCursorControl()->setVisible(false);
else
this->device->getCursorControl()->setVisible(true);
}
int IrrLib::GetFPSCount(){
return this->driver->getFPS();
}
bool IrrLib::DeviceIsRunning(){
return this->device->run();
}
bool IrrLib::IsActiveWindow(){
return this->device->isWindowActive();
}
void IrrLib::BeginScene(){
this->driver->beginScene(true, true, video::SColor(0,200,200,200));
}
void IrrLib::BeginScene(irr::video::SColor color){
this->driver->beginScene(true, true, color);
}
void IrrLib::BeginScene(bool usebackBuffer, bool usezBuffer, irr::video::SColor color){
this->driver->beginScene(usebackBuffer, usezBuffer, color);
}
void IrrLib::DrawAll(){
this->smgr->drawAll();
//this->device->getGUIEnvironment()->drawAll();
}
void IrrLib::EndScene(){
this->driver->endScene();
}
void IrrLib::SetWindowCaption(stringw str){
this->device->setWindowCaption(str.c_str());
}
irr::core::stringw IrrLib::GetDriverName(){
return this->driver->getName();
}
void IrrLib::EndIrrlicht(){
this->device->drop();
}
void IrrLib::KeyPress(char key){
this->key = key;
}
char IrrLib::KeyPressed(){
return key;
}
Old Versions/1.1/IrrLib.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
/*
Irrlicht Library Wrapper
Created by Nathan Adams
Version 1.1
Copyright (C) 2007
This software is licensed under the GNU/GPL.
This software may not be used for commerical purposes.
*/
#ifndef IRRLIB_H
#define IRRLIB_H
/* We should include some basic functions */
#include <iostream>
/* include strings */
#include <strings.h>
/* We have to include Irrlichts libs */
#include <irrlicht.h>
#include "IrrSphere.h"
//Start class
class IrrLib {
private:
/* Create an Irrlicht device as private because the class should handle
All irrlicht interaction */
irr::IrrlichtDevice *device;
// Tells Irrlicht what driver to use
//video::E_DRIVER_TYPE driverType;
/*
Get a pointer to the video driver and the SceneManager so that
we do not always have to write device->getVideoDriver() and
device->getSceneManager().
*/
irr::video::IVideoDriver* driver;
irr::scene::ISceneManager* smgr;
/*
Get a pointer to the 'mesh' aka the level.
Note: This is for Quake3 levels, ie bsp maps.
*/
irr::scene::IAnimatedMesh* mesh;
irr::scene::ISceneNode* node;
irr::scene::ISceneNode * tempNode; //use this to store nodeNew's data so we can resize it
irr::scene::ICameraSceneNode * cam;
char key;
void IrrLib::Init();
public:
IrrSphere Sphere; //This has to be public to be able to access the Sphere class
IrrLib::IrrLib();
//IrrLib::IrrLib(MastEventReceiver & receiver);
IrrLib::IrrLib(irr::video::E_DRIVER_TYPE drivertype, irr::core::dimension2d<irr::s32> & res, irr::u32 bits, bool fullscreen, bool stencilbuffer, bool vsync);
IrrLib::IrrLib(int drivertype, int width, int height, int bits, bool fullscreen, bool stencilbuffer, bool vsync);
IrrLib::~IrrLib(); //Our moms wont clean up after us!
void IrrLib::ReadArchive(std::string file);
void IrrLib::LoadQ3Level(std::string q3level);
void IrrLib::NodePos(int x, int y, int z); //I think this moves the actual camera?
void IrrLib::NodePos();
void IrrLib::AddFPSCam();
void IrrLib::AddFPSCam(irr::f32 x, irr::f32 y, irr::f32 z);
void IrrLib::VisibleCursor(bool tf);
int IrrLib::GetFPSCount();
bool IrrLib::DeviceIsRunning();
bool IrrLib::IsActiveWindow();
void IrrLib::BeginScene();
void IrrLib::BeginScene(irr::video::SColor color);
void IrrLib::BeginScene(bool usebackBuffer, bool usezBuffer, irr::video::SColor color);
//TODO: Add one more for human readable colors and hex colors!
void IrrLib::DrawAll();
void IrrLib::EndScene();
void IrrLib::SetWindowCaption(irr::core::stringw str);
irr::core::stringw IrrLib::GetDriverName();
//TODO: Make function to turn stringw to string and visa versa
void IrrLib::EndIrrlicht(); //Renamed from KillIrrlicht to EndIrrlicht
//TODO: Add logging
void IrrLib::KeyPress(char key);
char IrrLib::KeyPressed();
};
#endif
Old Versions/1.1/IrrSphere.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
/*
Irrlicht Library Wrapper
Created by Nathan Adams
Version 1.1
Copyright (C) 2007
This software is licensed under the GNU/GPL.
This software may not be used for commerical purposes.
*/
#include <iostream>
#include "IrrLib.h"
#include "IrrSphere.h"
#include <irrlicht.h>
#include <strings.h>
using namespace irr;
using namespace core;
using namespace scene;
using namespace video;
using namespace io;
using namespace gui;
using namespace std;
void IrrSphere::SetSmgr(irr::scene::ISceneManager* smgr){
this->smgr = smgr;
}
void IrrSphere::SetDriver(irr::video::IVideoDriver* driver){
this->driver = driver;
}
int IrrSphere::CreateNewSphereNode(int x, int y, int z, std::string texture, bool light){
//TODO: Resize after 10, and add 10 more to the mix!
this->nodeNew[this->numNodes] = this->smgr->addSphereSceneNode();
this->nodeNew[this->numNodes]->setPosition(core::vector3df(x,y,z));
this->nodeNew[this->numNodes]->setMaterialTexture(0, this->driver->getTexture(texture.c_str()));
this->nodeNew[this->numNodes]->setMaterialFlag(video::EMF_LIGHTING, light);
this->numNodes++;
return this->numNodes--;
/*this->node = this->smgr->addSphereSceneNode();
this->node->setPosition(core::vector3df(x,y,z));
this->node->setMaterialTexture(0, this->driver->getTexture(texture.c_str()));
this->node->setMaterialFlag(video::EMF_LIGHTING, light);*/
}
irr::core::vector3df IrrSphere::GetSphereVector(int sphere){
return this->nodeNew[sphere]->getPosition();
}
void IrrSphere::SetSphereVector(int sphere, irr::core::vector3df v){
this->nodeNew[sphere]->setPosition(v);
}
IrrSphere::IrrSphere(){
this->numNodes = 0;
}
IrrSphere::~IrrSphere(){
for(int i = 0; i < numNodes; ++i)
delete this->nodeNew[i];
delete this->nodeNew;
}
Old Versions/1.1/IrrSphere.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
/*
Irrlicht Library Wrapper
Created by Nathan Adams
Version 1.1
Copyright (C) 2007
This software is licensed under the GNU/GPL.
This software may not be used for commerical purposes.
*/
#ifndef IRRSPHERE_H
#define IRRSPHERE_H
/* We should include some basic functions */
#include <iostream>
/* include strings */
#include <strings.h>
/* We have to include Irrlichts libs */
#include <irrlicht.h>
#include "IrrLib.h"
class IrrSphere
{
private:
irr::scene::ISceneNode* nodeNew[10];
int numNodes;
irr::scene::ISceneManager* smgr;
irr::video::IVideoDriver* driver;
public:
void IrrSphere::SetDriver(irr::video::IVideoDriver* driver);
void IrrSphere::SetSmgr(irr::scene::ISceneManager* smgr);
int IrrSphere::CreateNewSphereNode(int x, int y, int z, std::string texture, bool light); //this is going to take my advanced C++ skillz!
irr::core::vector3df IrrSphere::GetSphereVector(int sphere);
void IrrSphere::SetSphereVector(int sphere, irr::core::vector3df v);
IrrSphere::IrrSphere();
IrrSphere::~IrrSphere();
};
#endif
Old Versions/1.2/CHANGES
1
2
3
4
5
Version 1.2
+ Added a Irr3DLib class that will control all 3D objects
+ Also Added a Irr2D class that works on the same concept.
+ IrrSphere is now owned by Irr3DLib
+ Updated the examples using the latest code
Old Versions/1.2/Irr2D.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
/*
Irrlicht Library Wrapper
Created by Nathan Adams
Copyright (C) 2007
This software is licensed under the GNU/GPL.
This software may not be used for commerical purposes.
*/
#include <iostream>
#include "IrrLib.h"
//#include "IrrSphere.h" //You probably aren't going to be using 3D objects in a 2D environment!
#include "Irr2D.h"
#include <irrlicht.h>
#include <strings.h>
using namespace irr;
using namespace core;
using namespace scene;
using namespace video;
using namespace io;
using namespace gui;
using namespace std;
Irr2D::Irr2D(){
this->numTextures = 0;
//NA Should we set textures to new
}
Irr2D::~Irr2D(){
for(int i = 0; i < numTextures; ++i)
delete this->textures[i];
delete this->textures;
}
void Irr2D::SetSmgr(irr::scene::ISceneManager* smgr){
this->smgr = smgr;
Sprite.SetSmgr(smgr);
}
void Irr2D::SetDriver(irr::video::IVideoDriver* driver){
this->driver = driver;
Sprite.SetDriver(driver);
}
void Irr2D::LoadTexturemap(std::string file){
this->texturemap = driver->getTexture(file.c_str());
}
int Irr2D::LoadTexture(std::string file){
this->textures[this->numTextures] = driver->getTexture(file.c_str());
this->numTextures++;
return numTextures--;
}
Old Versions/1.2/Irr2D.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
/*
Irrlicht Library Wrapper
Created by Nathan Adams
Copyright (C) 2007
This software is licensed under the GNU/GPL.
This software may not be used for commerical purposes.
*/
#ifndef IRR2D_H
#define IRR2D_H
/* We should include some basic functions */
#include <iostream>
/* include strings */
#include <strings.h>
/* We have to include Irrlichts libs */
#include <irrlicht.h>
#include "IrrLib.h"
#include "IrrSprite.h"
class Irr2D {
private:
irr::scene::ISceneManager* smgr;
irr::video::IVideoDriver* driver;
irr::video::ITexture* texturemap;
int numTextures;
irr::video::ITexture* textures[10];
public:
//Irr2D::Irr2D();
IrrSprite Sprite;
Irr2D::Irr2D();
Irr2D::~Irr2D();
void Irr2D::SetDriver(irr::video::IVideoDriver* driver);
void Irr2D::SetSmgr(irr::scene::ISceneManager* smgr);
void Irr2D::LoadTexturemap(std::string file);
int Irr2D::LoadTexture(std::string file);
void Irr2D::DrawImage(int texture, const irr::core::position2d<irr::s32> & destPos);
void Irr2D::DrawImage(const irr::core::position2d<irr::s32> & destPos, const irr::core::rect<irr::s32> & sourceRect, const irr::core::rect<irr::s32> * clipRect, irr::video::SColor color, bool useAlphaChannelOfTexture);
void Irr2D::DrawLine(const irr::core::position2d<irr::s32> & start, const irr::core::position2d<irr::s32> & end, irr::video::SColor color);
};
#endif
Old Versions/1.2/Irr3D.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
/*
Irrlicht Library Wrapper
Created by Nathan Adams
Copyright (C) 2007
This software is licensed under the GNU/GPL.
This software may not be used for commerical purposes.
*/
#include <iostream>
#include <strings.h>
//#include "IrrLib.h"
//Libraries we create go here
#include "IrrSphere.h"
//#include "IrrColor.h"
#include "Irr3D.h"
#include <irrlicht.h>
//#include "Irr2D.h"
using namespace irr;
using namespace core;
using namespace scene;
using namespace video;
using namespace io;
using namespace gui;
using namespace std;
void Irr3D::SetDriver(irr::video::IVideoDriver* driver) //so much for copying and pasting code from the header file
{
this->driver = driver;
Sphere.SetDriver(driver);
}
void Irr3D::SetSmgr(irr::scene::ISceneManager* smgr)
{
this->smgr = smgr;
Sphere.SetSmgr(smgr);
}
Irr3D::Irr3D()
{
//do stuff here!
}
Irr3D::~Irr3D()
{
//delete stuff here!
}
Old Versions/1.2/Irr3D.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
/*
Irrlicht Library Wrapper
Created by Nathan Adams
Copyright (C) 2007
This software is licensed under the GNU/GPL.
This software may not be used for commerical purposes.
*/
#ifndef IRR3D_H
#define IRR3D_H
/* We should include some basic functions */
#include <iostream>
/* include strings */
#include <strings.h>
/* We have to include Irrlichts libs */
#include <irrlicht.h>
#include "IrrSphere.h"
//#include "IrrColor.h"
//#include "Irr3D.h"
//#include "Irr2D.h" This is a 3D class not 2D
/* However due to Irrlciht's nature mixing 2D with 3D is possible */
//Start class
class Irr3D {
private:
irr::video::IVideoDriver* driver;
irr::scene::ISceneManager* smgr;
public:
IrrSphere Sphere;
Irr3D::Irr3D();
Irr3D::~Irr3D();
void Irr3D::SetDriver(irr::video::IVideoDriver* driver);
void Irr3D::SetSmgr(irr::scene::ISceneManager* smgr);
};
#endif
Old Versions/1.2/IrrColor.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
/*
Irrlicht Library Wrapper
Created by Nathan Adams
Copyright (C) 2007
This software is licensed under the GNU/GPL.
This software may not be used for commerical purposes.
*/
#include <iostream>
#include <irrlicht.h>
#include <strings.h>
//#include "IrrLib.h"
#include "IrrColor.h"
using namespace irr;
using namespace core;
using namespace scene;
using namespace video;
using namespace io;
using namespace gui;
using namespace std;
void IrrColor::test(){
//do nothing
}
SColor IrrColor::returnColor(std::string color){
int nColor = -1;
if (color == "red")
nColor = 1;
else if (color == "green")
nColor = 2;
else if (color == "blue")
nColor = 3;
else if (color == "dark green")
nColor = 4;
else if (color == "pink")
nColor = 5;
else if (color == "grey")
nColor = 6;
switch (nColor){
case 1:
return SColor(255, 255, 0, 0);
break;
case 2:
return SColor(255, 0, 255, 0);
break;
case 3:
return SColor(255, 0, 0, 255);
break;
case 4:
return SColor(255, 0, 50, 0);
break;
case 5:
return SColor(255, 255, 10, 255);
break;
case 6:
return SColor(255,200,200,200);
break;
default:
return SColor(255,200,200,200);
break;
}// TODO: Make this function modular
}
Old Versions/1.2/IrrColor.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
/*
Irrlicht Library Wrapper
Created by Nathan Adams
Copyright (C) 2007
This software is licensed under the GNU/GPL.
This software may not be used for commerical purposes.
*/
#ifndef IRRCOLOR_H
#define IRRCOLOR_H
#include <iostream>
#include <strings.h>
#include "irrlicht.h"
//#include "IrrLib.h"
class IrrColor {
private:
//who knows?
public:
void IrrColor::test();
irr::video::SColor IrrColor::returnColor(std::string color);
};
#endif
Old Versions/1.2/IrrLib.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
/*
Irrlicht Library Wrapper
Created by Nathan Adams
Copyright (C) 2007
This software is licensed under the GNU/GPL.
This software may not be used for commerical purposes.
*/
#include <iostream>
#include <irrlicht.h>
#include <strings.h>
#include "IrrLib.h"
//Libraries we create go here
//#include "IrrSphere.h"
#include "IrrColor.h"
#include "Irr2D.h"
using namespace irr;
using namespace core;
using namespace scene;
using namespace video;
using namespace io;
using namespace gui;
using namespace std;
//TODO: Create own class for handling inputs!
/*IrrLib::IrrLib(MastEventReceiver & receiver){
this->device = createDevice(EDT_SOFTWARE, dimension2d<s32>(640, 480), 16, false, false, false, &receiver);
if (this->device == 0)
exit(1);
IrrLib::Init();
}*/
IrrLib::IrrLib(){
this->device = createDevice(EDT_SOFTWARE, dimension2d<s32>(640, 480), 16, false, false, false, 0);
if (this->device == 0)
exit(1);
IrrLib::Init();
}
IrrLib::IrrLib(video::E_DRIVER_TYPE drivertype, core::dimension2d<s32> & res, u32 bits, bool fullscreen, bool stencilbuffer, bool vsync){
//MyEventReceiver receiver;
this->device = createDevice(drivertype, res, bits, fullscreen, stencilbuffer, vsync, 0);
if (this->device == 0)
exit(1);
IrrLib::Init();
}
IrrLib::IrrLib(int nDrivertype, int width, int height, int bits, bool fullscreen, bool stencilbuffer, bool vsync){
//MyEventReceiver receiver;
video::E_DRIVER_TYPE drivertype;
switch (nDrivertype){
case 0: //TODO: finish this switch case
drivertype = EDT_NULL;
break;
case 1:
drivertype = EDT_SOFTWARE;
break;
case 2:
drivertype = EDT_BURNINGSVIDEO;
break;
case 3:
drivertype = EDT_OPENGL;
break;
case 4:
drivertype = EDT_DIRECT3D8;
//*Note: It seems as Microsoft has stoped supporting DX 8.1, so you can not compile it into Irrlicht engine anymore
//TODO: Find how to detect if DX is complied into Irrlicht
//TODO: Find how to detecht for linux
break;
case 5:
drivertype = EDT_DIRECT3D9;
break;
default:
drivertype = EDT_SOFTWARE;
break;
}
this->device = createDevice(drivertype, dimension2d<s32>(width, height), bits, fullscreen, stencilbuffer, vsync, 0);
if (this->device == 0)
exit(1);
IrrLib::Init();
}
IrrLib::~IrrLib (){ //Our moms wont clean up after us!
//Although I'm sure Irrlicht does this for us already, its always a good idea to check!
/*if (this->device != NULL)
delete this->device;
if (this->driver != NULL)
delete this->driver;
if (this->smgr != NULL)
delete this->smgr;
if (this->mesh != NULL)
delete this->mesh;
if (this->node != NULL)
delete this->node;*/ //it seems Irrlicht picks up after us...
//however we created newNodes, now we need to delete it!
}
void IrrLib::Init(){
//this->numNodes = 0;
//this->nodeNew = new ISceneNode[10];
this->driver = this->device->getVideoDriver();
this->smgr = this->device->getSceneManager();
Irr3DLib.SetSmgr(this->smgr);
Irr3DLib.SetDriver(this->driver);
Irr2DLib.SetSmgr(this->smgr);
Irr2DLib.SetDriver(this->driver);
}
void IrrLib::ReadArchive(std::string file){
this->device->getFileSystem()->addZipFileArchive(file.c_str());
}
void IrrLib::LoadQ3Level(std::string q3level){
this->mesh = this->smgr->getMesh(q3level.c_str());
this->node = 0;
if (this->mesh)
this->node = this->smgr->addOctTreeSceneNode(this->mesh->getMesh(0), 0, -1, 128);
}
void IrrLib::MapPos(int x, int y, int z){
if (this->node)
this->node->setPosition(core::vector3df(x, y, z));
}
void IrrLib::MapPos(){
if (this->node)
this->node->setPosition(core::vector3df(0, 0, 0));
}
void IrrLib::AddFPSCam(){
this->cam = this->smgr->addCameraSceneNodeFPS();
}
void IrrLib::AddFPSCam(f32 x, f32 y, f32 z)
{
this->cam = this->smgr->addCameraSceneNodeFPS();
this->cam->setPosition(irr::core::vector3df(x, y, z));
}
void IrrLib::VisibleCursor(bool tf){
if (tf == false)
this->device->getCursorControl()->setVisible(false);
else
this->device->getCursorControl()->setVisible(true);
}
int IrrLib::GetFPSCount(){
return this->driver->getFPS();
}
bool IrrLib::DeviceIsRunning(){
return this->device->run();
}
bool IrrLib::IsActiveWindow(){
return this->device->isWindowActive();
}
void IrrLib::BeginScene(){
this->driver->beginScene(true, true, video::SColor(0,200,200,200));
}
void IrrLib::BeginScene(irr::video::SColor color){
this->driver->beginScene(true, true, color);
}
void IrrLib::BeginScene(bool usebackBuffer, bool usezBuffer, irr::video::SColor color){
this->driver->beginScene(usebackBuffer, usezBuffer, color);
}
void IrrLib::DrawAll(){
this->smgr->drawAll();
//this->device->getGUIEnvironment()->drawAll();
}
void IrrLib::EndScene(){
this->driver->endScene();
}
void IrrLib::SetWindowCaption(stringw str){
this->device->setWindowCaption(str.c_str());
}
irr::core::stringw IrrLib::GetDriverName(){
return this->driver->getName();
}
void IrrLib::EndIrrlicht(){
this->device->drop();
}
void IrrLib::KeyPress(char key){
this->key = key;
}
char IrrLib::KeyPressed(){
return key;
}
irr::f32 IrrLib::getX(){
return this->smgr->getActiveCamera()->getPosition().X;
}
irr::f32 IrrLib::getY(){
return this->smgr->getActiveCamera()->getPosition().Y;
}
irr::f32 IrrLib::getZ(){
return this->smgr->getActiveCamera()->getPosition().Z;
}
Old Versions/1.2/IrrLib.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
/*
Irrlicht Library Wrapper
Created by Nathan Adams
Copyright (C) 2007
This software is licensed under the GNU/GPL.
This software may not be used for commerical purposes.
*/
#ifndef IRRLIB_H
#define IRRLIB_H
/* We should include some basic functions */
#include <iostream>
/* include strings */
#include <strings.h>
/* We have to include Irrlichts libs */
#include <irrlicht.h>
#include "Irr3D.h"
#include "IrrColor.h"
#include "Irr2D.h"
//Start class
class IrrLib {
private:
/* Create an Irrlicht device as private because the class should handle
All irrlicht interaction */
irr::IrrlichtDevice *device;
// Tells Irrlicht what driver to use
//video::E_DRIVER_TYPE driverType;
/*
Get a pointer to the video driver and the SceneManager so that
we do not always have to write device->getVideoDriver() and
device->getSceneManager().
*/
irr::video::IVideoDriver* driver;
irr::scene::ISceneManager* smgr;
/*
Get a pointer to the 'mesh' aka the level.
Note: This is for Quake3 levels, ie bsp maps.
*/
irr::scene::IAnimatedMesh* mesh;
irr::scene::ISceneNode* node;
irr::scene::ISceneNode * tempNode; //use this to store nodeNew's data so we can resize it
irr::scene::ICameraSceneNode * cam;
char key;
void IrrLib::Init();
/*friend class IrrColor;
friend class Irr2DLib;
friend class Sphere;*/
public:
//IrrSphere Sphere; //This has to be public to be able to access the Sphere class
/* IrrSphere is now in Irr3D class */
//Prehaps put this into a IrrLib3D class?
Irr3D Irr3DLib;
IrrColor Color; //Color class...not much of a class but lets keep it OO
Irr2D Irr2DLib; //1/2 variable to be labeled like this due to variables not able to begin with a number
IrrLib::IrrLib();
//IrrLib::IrrLib(MastEventReceiver & receiver);
IrrLib::IrrLib(irr::video::E_DRIVER_TYPE drivertype, irr::core::dimension2d<irr::s32> & res, irr::u32 bits, bool fullscreen, bool stencilbuffer, bool vsync);
IrrLib::IrrLib(int drivertype, int width, int height, int bits, bool fullscreen, bool stencilbuffer, bool vsync);
IrrLib::~IrrLib(); //Our moms wont clean up after us!
void IrrLib::ReadArchive(std::string file);
void IrrLib::LoadQ3Level(std::string q3level);
void IrrLib::MapPos(int x, int y, int z); //I think this moves the actual camera?
void IrrLib::MapPos();
void IrrLib::AddFPSCam();
void IrrLib::AddFPSCam(irr::f32 x, irr::f32 y, irr::f32 z);
void IrrLib::VisibleCursor(bool tf);
int IrrLib::GetFPSCount();
bool IrrLib::DeviceIsRunning();
bool IrrLib::IsActiveWindow();
void IrrLib::BeginScene();
void IrrLib::BeginScene(irr::video::SColor color);
void IrrLib::BeginScene(bool usebackBuffer, bool usezBuffer, irr::video::SColor color);
//TODO: Add one more for human readable colors and hex colors!
void IrrLib::DrawAll();
void IrrLib::EndScene();
void IrrLib::SetWindowCaption(irr::core::stringw str);
irr::core::stringw IrrLib::GetDriverName();
//TODO: Make function to turn stringw to string and visa versa
void IrrLib::EndIrrlicht(); //Renamed from KillIrrlicht to EndIrrlicht
//TODO: Add logging
void IrrLib::KeyPress(char key);
char IrrLib::KeyPressed();
irr::f32 getX();
irr::f32 getY();
irr::f32 getZ();
};
#endif
Old Versions/1.2/IrrLibBase.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
/*
Irrlicht Library Wrapper
Created by Nathan Adams
Copyright (C) 2007
This software is licensed under the GNU/GPL.
This software may not be used for commerical purposes.
*/
#include <irrlicht.h>
#include "IrrLibBase.h"
using namespace irr;
using namespace core;
using namespace scene;
using namespace video;
using namespace io;
using namespace gui;
using namespace std;
void IrrLibBase::SetDriver(IVideoDriver* driver) //can be overloaded
{
this->driver = driver;
}
void IrrLibBase::SetSmgr(ISceneManager* smgr)
{
this->smgr = smgr;
}
Old Versions/1.2/IrrLibBase.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
/*
Irrlicht Library Wrapper
Created by Nathan Adams
Copyright (C) 2007
This software is licensed under the GNU/GPL.
This software may not be used for commerical purposes.
*/
#ifndef IRRLIBBASE_H
#define IRRLIBBASE_H
/* We should include some basic functions */
#include <iostream>
/* include strings */
#include <strings.h>
/* We have to include Irrlichts libs */
#include <irrlicht.h>
class IrrLibBase {
protected:
irr::video::IVideoDriver* driver;
irr::scene::ISceneManager* smgr;
public:
void IrrLibBase::SetDriver(irr::video::IVideoDriver* driver);
void IrrLibBase::SetSmgr(irr::scene::ISceneManager* smgr);
};
#endif
Old Versions/1.2/IrrLibGUI.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
/*
Irrlicht Library Wrapper
Created by Nathan Adams
Copyright (C) 2007
This software is licensed under the GNU/GPL.
This software may not be used for commerical purposes.
*/
#include <iostream>
#include <strings.h>
#include <irrlicht.h>
using namespace irr;
using namespace core;
using namespace scene;
using namespace video;
using namespace io;
using namespace gui;
using namespace std;
IrrLibGUI::IrrLibGUI()
{
//NA does it need to do anything at init?
this->nStaticText = 0;
this->env = device->getGUIEnvironment(); //NA yes we do!
}
IrrLibGUI::~IrrLibGUI()
{
//NA Do we have to delete anything?
}
IrrLibGUI::Clear()
{
this->env->clear();
}
IrrLibGUI::DrawAll()
{
this->env->drawAll();
}
IrrLibGUI::AddStaticText()
{
this->env->addStaticText(L"Powered by IrrLib.", rect<s32>(0,0,0,0), true);
}
IrrLibGUI::AddStaticText(std::string message)
{
this->env->addStaticText(message.c_str(), rect<s32>(0,0,0,0), true);
}
IrrLibGUI::AddStaticText(std::string message, int x1, int y1, int x2, int y2)
{
this->env->addStaticText(message.c_str(), rect<s32>(x1,y1,x2,y2), true);
}
IrrLibGUI::AddStaticText(std::string message, int x1, int y1, int x2, int y2, bool border, bool wordwrap)
{
this->env->addStaticText(message.c_str(), rect<s32>(x1,y1,x2,y2), border, wordwrap);
}
IrrLibGUI::AddStaticText(std::string message, int x1, int y1, int x2, int y2, bool border, bool wordwrap, int id, bool fillbackground)
{
this->env->addStaticText(message.c_str(), rect<s32>(x1,y1,x2,y2), border, wordwrap, 0, id, fillbackground);
}
IrrLibGUI::AddStaticText(std::string message, const core::rect< s32 > &rectangle)
{
this->env->addStaticText(message.c_str(), rectangle);
}
IrrLibGUI::AddStaticText(std::string message, const core::rect< s32 > &rectangle, bool border, bool wordwrap)
{
this->env->addStaticText(message.c_str(), rectangle, border, wordwrap);
}
IrrLibGUI::AddStaticText(std::string message, const core::rect< s32 > &rectangle, bool border, bool wordwrap, int id, bool fillbackground)
{
this->env->addStaticText(message.c_str(), rectangle, border, wordwrap, 0, id, background);
}
Old Versions/1.2/IrrLibGUI.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
/*
Irrlicht Library Wrapper
Created by Nathan Adams
Copyright (C) 2007
This software is licensed under the GNU/GPL.
This software may not be used for commerical purposes.
*/
#ifndef IRRLIBGUI_H
#define IRRLIBGUI_H
#include <iostream>
#include <strings.h>
#include <irrlicht.h>
#include "IrrLibBase.h"
class IrrLibGUI: public IrrLibBase {
private:
irr::gui::IGUISkin* skin;
irr::gui::IGUIFont* font;
irr::gui::IGUIEnvironment* env = device->getGUIEnvironment();
//TODO: Create an array storing all messages
int nStaticText;
irr::gui::IGUIStaticText* arrStaticText[10];
public:
IrrLibGUI::IrrLibGUI();
IrrLibGUI::~IrrLibGUI();
IrrLibGUI::Clear();
IrrLibGUI::DrawAll();
IrrLibGUI::AddStaticText(); //NA eh a default text adder why not?
IrrLibGUI::AddStaticText(std::string message);
IrrLibGUI::AddStaticText(std::string message, int x1, int y1, int x2, int y2);
IrrLibGUI::AddStaticText(std::string message, int x1, int y1, int x2, int y2, bool border, bool wordwrap);
IrrLibGUI::AddStaticText(std::string message, int x1, int y1, int x2, int y2, bool border, bool wordwrap, int id, bool fillbackground);
IrrLibGUI::AddStaticText(std::string message, const irr::core::rect< s32 > &rectangle);
IrrLibGUI::AddStaticText(std::string message, const irr::core::rect< s32 > &rectangle, bool border, bool wordwrap);
IrrLibGUI::AddStaticText(std::string message, const irr::core::rect< s32 > &rectangle, bool border, bool wordwrap, int id, bool fillbackground);
#endif
Old Versions/1.2/IrrSphere.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
/*
Irrlicht Library Wrapper
Created by Nathan Adams
Copyright (C) 2007
This software is licensed under the GNU/GPL.
This software may not be used for commerical purposes.
*/
#include <iostream>
#include "IrrLib.h"
#include "IrrSphere.h"
#include <irrlicht.h>
#include <strings.h>
using namespace irr;
using namespace core;
using namespace scene;
using namespace video;
using namespace io;
using namespace gui;
using namespace std;
void IrrSphere::SetSmgr(irr::scene::ISceneManager* smgr){
this->smgr = smgr;
}
void IrrSphere::SetDriver(irr::video::IVideoDriver* driver){
this->driver = driver;
}
int IrrSphere::CreateNewSphereNode(int x, int y, int z, std::string texture, bool light){
//TODO: Resize after 10, and add 10 more to the mix!
this->nodeNew[this->numNodes] = this->smgr->addSphereSceneNode();
this->nodeNew[this->numNodes]->setPosition(core::vector3df(x,y,z));
this->nodeNew[this->numNodes]->setMaterialTexture(0, this->driver->getTexture(texture.c_str()));
this->nodeNew[this->numNodes]->setMaterialFlag(video::EMF_LIGHTING, light);
this->numNodes++;
return this->numNodes--;
/*this->node = this->smgr->addSphereSceneNode();
this->node->setPosition(core::vector3df(x,y,z));
this->node->setMaterialTexture(0, this->driver->getTexture(texture.c_str()));
this->node->setMaterialFlag(video::EMF_LIGHTING, light);*/
}
irr::core::vector3df IrrSphere::GetSphereVector(int sphere){
return this->nodeNew[sphere]->getPosition();
}
void IrrSphere::SetSphereVector(int sphere, irr::core::vector3df v){
this->nodeNew[sphere]->setPosition(v);
}
IrrSphere::IrrSphere(){
this->numNodes = 0;
}
IrrSphere::~IrrSphere(){
for(int i = 0; i < numNodes; ++i)
delete this->nodeNew[i];
delete this->nodeNew;
}
Old Versions/1.2/IrrSphere.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
/*
Irrlicht Library Wrapper
Created by Nathan Adams
Copyright (C) 2007
This software is licensed under the GNU/GPL.
This software may not be used for commerical purposes.
*/
#ifndef IRRSPHERE_H
#define IRRSPHERE_H
/* We should include some basic functions */
#include <iostream>
/* include strings */
#include <strings.h>
/* We have to include Irrlichts libs */
#include <irrlicht.h>
//#include "IrrLib.h"
class IrrSphere
{
private:
irr::scene::ISceneNode* nodeNew[10];
int numNodes;
irr::scene::ISceneManager* smgr;
irr::video::IVideoDriver* driver;
public:
void IrrSphere::SetDriver(irr::video::IVideoDriver* driver);
void IrrSphere::SetSmgr(irr::scene::ISceneManager* smgr);
int IrrSphere::CreateNewSphereNode(int x, int y, int z, std::string texture, bool light); //this is going to take my advanced C++ skillz!
irr::core::vector3df IrrSphere::GetSphereVector(int sphere);
void IrrSphere::SetSphereVector(int sphere, irr::core::vector3df v);
IrrSphere::IrrSphere();
//IrrSphere::IrrSphere(IrrLib*);
IrrSphere::~IrrSphere();
};
#endif
Old Versions/1.2/IrrSprite.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
/*
Irrlicht Library Wrapper
Created by Nathan Adams
Copyright (C) 2007
This software is licensed under the GNU/GPL.
This software may not be used for commerical purposes.
*/
#include <iostream>
#include <irrlicht.h>
#include <strings.h>
#include "IrrLib.h"
//Libraries we create go here
#include "IrrSphere.h"
#include "IrrColor.h"
#include "Irr2D.h"
using namespace irr;
using namespace core;
using namespace scene;
using namespace video;
using namespace io;
using namespace gui;
using namespace std;
IrrSprite::IrrSprite()
{
//do stuff
}
IrrSprite::~IrrSprite()
{
//delete stuff
}
void IrrSprite::SetDriver(irr::video::IVideoDriver* driver)
{
this->driver = driver;
}
void IrrSprite::SetSmgr(irr::scene::ISceneManager* smgr)
{
this->smgr = smgr;
}
Old Versions/1.2/IrrSprite.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
/*
Irrlicht Library Wrapper
Created by Nathan Adams
Copyright (C) 2007
This software is licensed under the GNU/GPL.
This software may not be used for commerical purposes.
*/
#ifndef IRRSPRITE_H
#define IRRSPRITE_H
/* We should include some basic functions */
#include <iostream>
/* include strings */
#include <strings.h>
/* We have to include Irrlichts libs */
#include <irrlicht.h>
#include "IrrSphere.h"
#include "IrrColor.h"
#include "Irr2D.h"
#include "IrrSprite.h"
//Start class
class IrrSprite {
private:
irr::video::IVideoDriver* driver;
irr::scene::ISceneManager* smgr;
public:
IrrSprite::IrrSprite();
IrrSprite::~IrrSprite();
void IrrSprite::SetDriver(irr::video::IVideoDriver* driver);
void IrrSprite::SetSmgr(irr::scene::ISceneManager* smgr);
// I forgot a semicolon here....and it wasn't compling
//Thats 1 bad thing about OOP if there is an error you don't know where the @#$@# the problem is!
};
#endif
Old Versions/1.2/README
1
2
3
4
5
6
7
8
9
10
11
12
13
Irrlicht Library Wrapper
Created by Nathan Adams
Version 1.2
Copyright (C) 2007
This software is licensed under the GNU/GPL.
This software may not be used for commerical purposes.
Please leave all files intact if you redistrubte this software.
How to use:
Add all the files to your Irrlicht project, you could compile it into a DLL if you wanted too, but for now just add all the files to your project.
Then inside your complier add the directory that you have the IrrLib files and use #include "IrrLib.h" to refrence it, and you are good to go!
Old Versions/1/IrrLib.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
/*
Irrlicht Library Wrapper
Created by Nathan Adams
Version 1
Copyright (C) 2007
This software is licensed under the GNU/GPL.
This software may not be used for commerical purposes.
*/
#include <iostream>
#include "IrrLib.h"
#include <irrlicht.h>
#include <strings.h>
using namespace irr;
using namespace core;
using namespace scene;
using namespace video;
using namespace io;
using namespace gui;
using namespace std;
//TODO: Create own class for handling inputs!
/*IrrLib::IrrLib(MastEventReceiver & receiver){
this->device = createDevice(EDT_SOFTWARE, dimension2d<s32>(640, 480), 16, false, false, false, &receiver);
if (this->device == 0)
exit(1);
IrrLib::Init();
}*/
IrrLib::IrrLib(){
this->device = createDevice(EDT_SOFTWARE, dimension2d<s32>(640, 480), 16, false, false, false, 0);
if (this->device == 0)
exit(1);
IrrLib::Init();
}
IrrLib::IrrLib(video::E_DRIVER_TYPE drivertype, core::dimension2d<s32> & res, u32 bits, bool fullscreen, bool stencilbuffer, bool vsync){
//MyEventReceiver receiver;
this->device = createDevice(drivertype, res, bits, fullscreen, stencilbuffer, vsync, 0);
if (this->device == 0)
exit(1);
IrrLib::Init();
}
IrrLib::IrrLib(int nDrivertype, int width, int height, int bits, bool fullscreen, bool stencilbuffer, bool vsync){
//MyEventReceiver receiver;
video::E_DRIVER_TYPE drivertype;
switch (nDrivertype){
case 0: //TODO: finish this switch case
drivertype = EDT_NULL;
break;
case 1:
drivertype = EDT_SOFTWARE;
break;
case 2:
drivertype = EDT_BURNINGSVIDEO;
break;
case 3:
drivertype = EDT_OPENGL;
break;
case 4:
drivertype = EDT_DIRECT3D8;
//TODO: Find how to detect if DX is complied into Irrlicht
//TODO: Find how to detecht for linux
break;
case 5:
drivertype = EDT_DIRECT3D9;
break;
default:
drivertype = EDT_SOFTWARE;
break;
}
this->device = createDevice(drivertype, dimension2d<s32>(width, height), bits, fullscreen, stencilbuffer, vsync, 0);
if (this->device == 0)
exit(1);
IrrLib::Init();
}
IrrLib::~IrrLib (){ //Our moms wont clean up after us!
//Although I'm sure Irrlicht does this for us already, its always a good idea to check!
/*if (this->device != NULL)
delete this->device;
if (this->driver != NULL)
delete this->driver;
if (this->smgr != NULL)
delete this->smgr;
if (this->mesh != NULL)
delete this->mesh;
if (this->node != NULL)
delete this->node;*/ //it seems Irrlicht picks up after us...
//however we created newNodes, now we need to delete it!
for(int i = 0; i < numNodes; ++i)
delete this->nodeNew[i];
delete this->nodeNew;
}
void IrrLib::Init(){
this->numNodes = 0;
//this->nodeNew = new ISceneNode[10];
this->driver = this->device->getVideoDriver();
this->smgr = this->device->getSceneManager();
}
void IrrLib::ReadArchive(std::string file){
this->device->getFileSystem()->addZipFileArchive(file.c_str());
}
void IrrLib::LoadQ3Level(std::string q3level){
this->mesh = this->smgr->getMesh(q3level.c_str());
this->node = 0;
if (this->mesh)
this->node = this->smgr->addOctTreeSceneNode(this->mesh->getMesh(0), 0, -1, 128);
}
void IrrLib::NodePos(int x, int y, int z){
if (this->node)
this->node->setPosition(core::vector3df(x, y, z));
}
void IrrLib::NodePos(){
if (this->node)
this->node->setPosition(core::vector3df(0, 0, 0));
}
void IrrLib::AddFPSCam(){
this->cam = this->smgr->addCameraSceneNodeFPS();
}
void IrrLib::AddFPSCam(f32 x, f32 y, f32 z)
{
this->cam = this->smgr->addCameraSceneNodeFPS();
this->cam->setPosition(irr::core::vector3df(x, y, z));
}
void IrrLib::VisibleCursor(bool tf){
if (tf == false)
this->device->getCursorControl()->setVisible(false);
else
this->device->getCursorControl()->setVisible(true);
}
int IrrLib::GetFPSCount(){
return this->driver->getFPS();
}
bool IrrLib::DeviceIsRunning(){
return this->device->run();
}
bool IrrLib::IsActiveWindow(){
return this->device->isWindowActive();
}
void IrrLib::BeginScene(){
this->driver->beginScene(true, true, video::SColor(0,200,200,200));
}
void IrrLib::BeginScene(irr::video::SColor color){
this->driver->beginScene(true, true, color);
}
void IrrLib::BeginScene(bool usebackBuffer, bool usezBuffer, irr::video::SColor color){
this->driver->beginScene(usebackBuffer, usezBuffer, color);
}
void IrrLib::DrawAll(){
this->smgr->drawAll();
//this->device->getGUIEnvironment()->drawAll();
}
void IrrLib::EndScene(){
this->driver->endScene();
}
void IrrLib::SetWindowCaption(stringw str){
this->device->setWindowCaption(str.c_str());
}
irr::core::stringw IrrLib::GetDriverName(){
return this->driver->getName();
}
void IrrLib::EndIrrlicht(){
this->device->drop();
}
void IrrLib::KeyPress(char key){
this->key = key;
}
char IrrLib::KeyPressed(){
return key;
}
int IrrLib::CreateNewSphereNode(int x, int y, int z, std::string texture, bool light){
this->nodeNew[this->numNodes] = this->smgr->addSphereSceneNode();
this->nodeNew[this->numNodes]->setPosition(core::vector3df(x,y,z));
this->nodeNew[this->numNodes]->setMaterialTexture(0, this->driver->getTexture(texture.c_str()));
this->nodeNew[this->numNodes]->setMaterialFlag(video::EMF_LIGHTING, light);
this->numNodes++;
return this->numNodes--;
/*this->node = this->smgr->addSphereSceneNode();
this->node->setPosition(core::vector3df(x,y,z));
this->node->setMaterialTexture(0, this->driver->getTexture(texture.c_str()));
this->node->setMaterialFlag(video::EMF_LIGHTING, light);*/
return 0;
}
irr::core::vector3df IrrLib::GetSphereVector(int sphere){
return this->nodeNew[sphere]->getPosition();
}
void IrrLib::SetSphereVector(int sphere, irr::core::vector3df v){
this->nodeNew[sphere]->setPosition(v);
}
Old Versions/1/IrrLib.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
/*
Irrlicht Library Wrapper
Created by Nathan Adams
Version 1
Copyright (C) 2007
This software is licensed under the GNU/GPL.
This software may not be used for commerical purposes.
*/
#ifndef IRRLIB_H
#define IRRLIB_H
/* We should include some basic functions */
#include <iostream>
/* include strings */
#include <strings.h>
/* We have to include Irrlichts libs */
#include <irrlicht.h>
//Start class
class IrrLib {
private:
/* Create an Irrlicht device as private because the class should handle
All irrlicht interaction */
irr::IrrlichtDevice *device;
// Tells Irrlicht what driver to use
//video::E_DRIVER_TYPE driverType;
/*
Get a pointer to the video driver and the SceneManager so that
we do not always have to write device->getVideoDriver() and
device->getSceneManager().
*/
irr::video::IVideoDriver* driver;
irr::scene::ISceneManager* smgr;
/*
Get a pointer to the 'mesh' aka the level.
Note: This is for Quake3 levels, ie bsp maps.
*/
irr::scene::IAnimatedMesh* mesh;
irr::scene::ISceneNode* node;
irr::scene::ISceneNode* nodeNew[10];
irr::scene::ISceneNode * tempNode; //use this to store nodeNew's data so we can resize it
int numNodes;
irr::scene::ICameraSceneNode * cam;
char key;
void IrrLib::Init();
public:
IrrLib::IrrLib();
//IrrLib::IrrLib(MastEventReceiver & receiver);
IrrLib::IrrLib(irr::video::E_DRIVER_TYPE drivertype, irr::core::dimension2d<irr::s32> & res, irr::u32 bits, bool fullscreen, bool stencilbuffer, bool vsync);
IrrLib::IrrLib(int drivertype, int width, int height, int bits, bool fullscreen, bool stencilbuffer, bool vsync);
IrrLib::~IrrLib(); //Our moms wont clean up after us!
void IrrLib::ReadArchive(std::string file);
void IrrLib::LoadQ3Level(std::string q3level);
void IrrLib::NodePos(int x, int y, int z); //I think this moves the actual camera?
void IrrLib::NodePos();
void IrrLib::AddFPSCam();
void IrrLib::AddFPSCam(irr::f32 x, irr::f32 y, irr::f32 z);
void IrrLib::VisibleCursor(bool tf);
int IrrLib::GetFPSCount();
bool IrrLib::DeviceIsRunning();
bool IrrLib::IsActiveWindow();
void IrrLib::BeginScene();
void IrrLib::BeginScene(irr::video::SColor color);
void IrrLib::BeginScene(bool usebackBuffer, bool usezBuffer, irr::video::SColor color);
//TODO: Add one more for human readable colors and hex colors!
void IrrLib::DrawAll();
void IrrLib::EndScene();
void IrrLib::SetWindowCaption(irr::core::stringw str);
irr::core::stringw IrrLib::GetDriverName();
//TODO: Make function to turn stringw to string and visa versa
void IrrLib::EndIrrlicht(); //Renamed from KillIrrlicht to EndIrrlicht
//TODO: Add logging
void IrrLib::KeyPress(char key);
char IrrLib::KeyPressed();
int IrrLib::CreateNewSphereNode(int x, int y, int z, std::string texture, bool light); //this is going to take my advanced C++ skillz!
irr::core::vector3df IrrLib::GetSphereVector(int sphere);
void IrrLib::SetSphereVector(int sphere, irr::core::vector3df v);
};
#endif
Old Versions/1/irrlibdocs.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
IrrLib Documentation:f
------------------------
//Important Note from the start: C++ is case senstitive, ReadArchive is not the same as readarchive
Private:
irr::IrrlichtDevice *device;
This is the main device for 'talking' to Irrlicht. This is very important and only the class should interact with it.
irr::video::IVideoDriver* driver;
irr::scene::ISceneManager* smgr;
The driver handles textures and the smgr handles putting models in the scene.
irr::scene::IAnimatedMesh* mesh;
irr::scene::ISceneNode* node;
A mesh object stores a mesh, aka a q3 level. A node, from what I understand contains where the camera should be placed.
Public: //These functions are the ones you call!
IrrLib::IrrLib();
IrrLib::IrrLib(irr::video::E_DRIVER_TYPE drivertype, irr::core::dimension2d<irr::s32> & res, irr::u32 bits, bool fullscreen, bool stencilbuffer, bool vsync, irr::IEventReceiver * receiver);
IrrLib::IrrLib(int drivertype, int width, int height, int bits, bool fullscreen, bool stencilbuffer, bool vsync, irr::IEventReceiver * receiver);
All 3 of those are class constructor. They construct both the class AND Irrlicht.
The first one loads it with defualt values, using software driver.
The second is more for the hard core Irrlicht users, you pass the normal Irrlicht values.
The third is for new users, you don't need a PhD in order to use it.
Code Example:
int main(){
IrrLib Irrlicht; //you are free to name the class variable whatever you want
//This use the defualt constructor, creates an Irrlicht device with defualt values.
}
int main(){
IrrLib Irrlicht(EDT_OPENGL, core::dimension2d<s32>(640, 480), 16, false, false, false, 0);
//This uses the second constructor
}
int main(){
IrrLib Irrlicht(3, 640, 480, 16, false, false, false, 0)
//This uses the third constructor using the opengl driver.
}
Table for drivertype:
0 - EDT_NULL;
1 - EDT_SOFTWARE;
2 - EDT_BURNINGSVIDEO;
3 - EDT_OPENGL;
4 - EDT_DIRECT3D8;
5 - EDT_DIRECT3D9;
default - EDT_SOFTWARE;
//Be careful with 4 and 5 when using someone else's complied Irrlicht, it could crash your program or cause a memory leak if DirectX is not complied into the library!
IrrLib::~IrrLib();
The deconstructor, clean up after ourselves because our moms wont! Need to clear up some dynamic variables that was created so we don't have memory leaks.
/*
Simple so far eh?
Don't worry it gets harder ;)
*/
void IrrLib::ReadArchive(std::string file)
This loads an archive into Irrlicht.
Code Example:
int main(){
IrrLib Irrlicht;
Irrlicht.ReadArchive("c:\program files\my game\myzip.zip");
}
void IrrLib::LoadQ3Level(std::string q3level);
This loads a q3 level onto the scene.
Code Example:
int main(){
IrrLib Irrlicht;
Irrlicht.ReadArchive("c:\program files\my game\myzip.zip");
Irrlicht.LoadQ3Level("20kdm2.bsp");
}
void IrrLib::CameraPos(int x, int y, int z); //I think this moves the actual camera?
void IrrLib::CameraPos();
CameraPos is an overloaded function for a reason, sometimes you do model the level around the orgin, and sometimes you don't.
So I took in account both to make it easier for people using this library.
Code Example:
int main(){
IrrLib Irrlicht;
Irrlicht.ReadArchive("c:\program files\my game\myzip.zip");
Irrlicht.LoadQ3Level("20kdm2.bsp");
IrrLib.CameraPos();
//Sets the camera at the orgin
}
int main(){
IrrLib Irrlicht;
Irrlicht.ReadArchive("c:\program files\my game\myzip.zip");
Irrlicht.LoadQ3Level("20kdm2.bsp");
IrrLib.CameraPos(-1300, -144, -1249);
//Sets the camera at that x, y, z position
}
void IrrLib::AddFPSCam();
This simply adds a camera FPS style. Will add other cameras later.
Code Example:
int main(){
IrrLib Irrlicht;
Irrlicht.ReadArchive("c:\program files\my game\myzip.zip");
Irrlicht.LoadQ3Level("20kdm2.bsp");
IrrLib.CameraPos(-1300, -144, -1249);
//Sets the camera at that x, y, z position
Irrlicht.AddFPSCam();
}
void IrrLib::VisibleCursor(bool tf);
This hides or shows the mouse cursor. Usually you want it hidden.
Code Example:
int main(){
IrrLib Irrlicht;
Irrlicht.ReadArchive("c:\program files\my game\myzip.zip");
Irrlicht.LoadQ3Level("20kdm2.bsp");
IrrLib.CameraPos(-1300, -144, -1249);
//Sets the camera at that x, y, z position
Irrlicht.AddFPSCam();
Irrlicht.VisibleCursor(false);
}
int IrrLib::GetFPSCount();
This returns an int of what the current frames per second count is.
int main(){
IrrLib Irrlicht;
cout << Irrlicht.GetFPSCount() << endl;
return 0;
}
bool IrrLib::DeviceIsRunning();
This returns weither or not the Irrlicht device is running, aka a test to see if the user exists.
Code Example:
int main(){
IrrLib Irrlicht;
Irrlicht.ReadArchive("c:\program files\my game\myzip.zip");
Irrlicht.LoadQ3Level("20kdm2.bsp");
IrrLib.CameraPos(-1300, -144, -1249);
//Sets the camera at that x, y, z position
Irrlicht.AddFPSCam();
Irrlicht.VisibleCursor(false);
while (Irrlicht.DeviceIsRunning()){
//Do cool stuff
}
}
bool IrrLib::IsActiveWindow();
This returns if the Irrlicht spawned window is the window, ie did the user alt tab to play a game of freecell?
int main(){
IrrLib Irrlicht;
Irrlicht.ReadArchive("c:\program files\my game\myzip.zip");
Irrlicht.LoadQ3Level("20kdm2.bsp");
IrrLib.CameraPos(-1300, -144, -1249);
//Sets the camera at that x, y, z position
Irrlicht.AddFPSCam();
Irrlicht.VisibleCursor(false);
while (Irrlicht.DeviceIsRunning()){
if (Irrlicht.IsActiveWindow())
{
//Do cool stuff
}
}
}
void IrrLib::BeginScene();
void IrrLib::BeginScene(irr::video::SColor color);
void IrrLib::BeginScene(bool usebackBuffer, bool usezBuffer, irr::video::SColor color);
This has 3 overloaded functions to allow more of a customization to the interaction between Irrlicht Library -> Irrlicht Engine.
The first uses default values, backbuffer = true, zBuffer = true, and a 'color' of video::SColor(0,200,200,200). //grey I think?
The second assumes, backbuffer = true, zBuffer = true, and a custom color of your choice for the backcolor.
The third is all your choice.
Code Example:
int main(){
IrrLib Irrlicht;
Irrlicht.ReadArchive("c:\program files\my game\myzip.zip");
Irrlicht.LoadQ3Level("20kdm2.bsp");
IrrLib.CameraPos(-1300, -144, -1249);
//Sets the camera at that x, y, z position
Irrlicht.AddFPSCam();
Irrlicht.VisibleCursor(false);
while (Irrlicht.DeviceIsRunning()){
if (Irrlicht.IsActiveWindow())
{
Irrlicht.BeginScene();
}
}
}
int main(){
IrrLib Irrlicht;
Irrlicht.ReadArchive("c:\program files\my game\myzip.zip");
Irrlicht.LoadQ3Level("20kdm2.bsp");
IrrLib.CameraPos(-1300, -144, -1249);
//Sets the camera at that x, y, z position
Irrlicht.AddFPSCam();
Irrlicht.VisibleCursor(false);
while (Irrlicht.DeviceIsRunning()){
if (Irrlicht.IsActiveWindow())
{
Irrlicht.BeginScene(video::SColor(0,200,200,200));
}
}
}
int main(){
IrrLib Irrlicht;
Irrlicht.ReadArchive("c:\program files\my game\myzip.zip");
Irrlicht.LoadQ3Level("20kdm2.bsp");
IrrLib.CameraPos(-1300, -144, -1249);
//Sets the camera at that x, y, z position
Irrlicht.AddFPSCam();
Irrlicht.VisibleCursor(false);
while (Irrlicht.DeviceIsRunning()){
if (Irrlicht.IsActiveWindow())
{
Irrlicht.BeginScene(false, false, video::SColor(0,200,200,200));
}
}
}
void IrrLib::DrawAll();
Draws everything on the scene.
Code Example:
int main(){
IrrLib Irrlicht;
Irrlicht.ReadArchive("c:\program files\my game\myzip.zip");
Irrlicht.LoadQ3Level("20kdm2.bsp");
IrrLib.CameraPos(-1300, -144, -1249);
//Sets the camera at that x, y, z position
Irrlicht.AddFPSCam();
Irrlicht.VisibleCursor(false);
while (Irrlicht.DeviceIsRunning()){
if (Irrlicht.IsActiveWindow())
{
Irrlicht.BeginScene();
Irrlicht.DrawAll();
}
}
}
void IrrLib::EndScene()
Ends the scene.
Code Example:
int main(){
IrrLib Irrlicht;
Irrlicht.ReadArchive("c:\program files\my game\myzip.zip");
Irrlicht.LoadQ3Level("20kdm2.bsp");
IrrLib.CameraPos(-1300, -144, -1249);
//Sets the camera at that x, y, z position
Irrlicht.AddFPSCam();
Irrlicht.VisibleCursor(false);
while (Irrlicht.DeviceIsRunning()){
if (Irrlicht.IsActiveWindow())
{
Irrlicht.BeginScene();
Irrlicht.DrawAll();
Irrlicht.EndScene();
}
}
}
void IrrLib::SetWindowCaption(irr::core::stringw str);
Tells Irrlicht what to set the window caption.
Code Example:
int main(){
IrrLib Irrlicht;
Irrlicht.ReadArchive("c:\program files\my game\myzip.zip");
Irrlicht.LoadQ3Level("20kdm2.bsp");
IrrLib.CameraPos(-1300, -144, -1249);
//Sets the camera at that x, y, z position
Irrlicht.AddFPSCam();
Irrlicht.VisibleCursor(false);
while (Irrlicht.DeviceIsRunning()){
if (Irrlicht.IsActiveWindow())
{
Irrlicht.BeginScene();
Irrlicht.DrawAll();
Irrlicht.EndScene();
Irrlicht.SetWindowCaption(L"Irrlicht is awsome!");
}
}
}
irr:core::stringw IrrLib::GetDriverName();
Returns a stringw of what the driver name is.
Code Example:
int main(){
IrrLib Irrlicht;
Irrlicht.ReadArchive("c:\program files\my game\myzip.zip");
Irrlicht.LoadQ3Level("20kdm2.bsp");
IrrLib.CameraPos(-1300, -144, -1249);
//Sets the camera at that x, y, z position
Irrlicht.AddFPSCam();
Irrlicht.VisibleCursor(false);
while (Irrlicht.DeviceIsRunning()){
if (Irrlicht.IsActiveWindow())
{
Irrlicht.BeginScene();
Irrlicht.DrawAll();
Irrlicht.EndScene();
Irrlicht.SetWindowCaption(L"Irrlicht is awsome! This is using " + Irrlicht.GetDriverName());
}
}
}
void IrrLib::EndIrrlicht();
Ends the Irrlicht scene.
int main(){
IrrLib Irrlicht;
Irrlicht.ReadArchive("c:\program files\my game\myzip.zip");
Irrlicht.LoadQ3Level("20kdm2.bsp");
IrrLib.CameraPos(-1300, -144, -1249);
//Sets the camera at that x, y, z position
Irrlicht.AddFPSCam();
Irrlicht.VisibleCursor(false);
while (Irrlicht.DeviceIsRunning()){
if (Irrlicht.IsActiveWindow())
{
Irrlicht.BeginScene();
Irrlicht.DrawAll();
Irrlicht.EndScene();
Irrlicht.SetWindowCaption(L"Irrlicht is awsome! This is using " + Irrlicht.GetDriverName())
}
}
IrrLib.EndIrrlicht();
return 0; //the deconstructor will delete all our dynamic vars so we don't have horriable memory leaks!
}
Part 2: Putting it all together!
//This exmaple is example #2 from the Irrlicht doc examples
int main(){
IrrLib Irrlicht;
Irrlicht.ReadArchive("../../media/map-20kdm2.pk3");
Irrlicht.LoadQ3Level("20kdm2.bsp");
IrrLib.CameraPos(-1300, -144, -1249);
//Sets the camera at that x, y, z position
Irrlicht.AddFPSCam();
Irrlicht.VisibleCursor(false);
int lastFPS = -1;
while (Irrlicht.DeviceIsRunning()){
if (Irrlicht.IsActiveWindow())
{
Irrlicht.BeginScene();
Irrlicht.DrawAll();
Irrlicht.EndScene();
int fps = Irrlicht.GetFPSCount();
if (lastFPS != fps)
{
core::stringw str = L"Irrlicht Engine - Quake 3 Map example [";
str += Irrlicht.GetDriverName();
str += "] FPS:";
str += fps;
Irrlicht.SetWindowCaption(str.c_str());
lastfps = fps;
}
}
}
IrrLib.EndIrrlicht();
return 0; //the deconstructor will delete all our dynamic vars so we don't have horriable memory leaks!
//That was easy wasn't it?
//Everything is now humanreadable, I think your next door neighbor could even figure out whats going on....maybe
}
Stable Version/1.2.2/CHANGES
1
2
3
4
5
6
7
8
9
10
11
12
Version 1.2
+ Added a Irr3DLib class that will control all 3D objects
+ Also Added a Irr2D class that works on the same concept.
+ IrrSphere is now owned by Irr3DLib
+ Updated the examples using the latest code
Version 1.2.2
+ Added IrrEventReciever to handle all input
- Still under work
+ Fixed some misc coding bugs
+ Added template class
+ Added sprite class
+ Added GUI class
Stable Version/1.2.2/Irr2D.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
/*
Irrlicht Library Wrapper
Created by Nathan Adams
Copyright (C) 2007
This software is licensed under the GNU/GPL.
This software may not be used for commerical purposes.
*/
#include <iostream>
//#include "IrrLib.h"
//#include "IrrSphere.h" //You probably aren't going to be using 3D objects in a 2D environment!
#include <irrlicht.h>
#include <strings.h>
#include "Irr2D.h"
#include "IrrSprite.h"
using namespace irr;
using namespace core;
using namespace scene;
using namespace video;
using namespace io;
using namespace gui;
using namespace std;
Irr2D::Irr2D(){
this->numTextures = 0;
//NA Should we set textures to new
}
Irr2D::~Irr2D(){
for(int i = 0; i < numTextures; ++i)
delete this->textures[i];
delete this->textures;
}
void Irr2D::SetSmgr(irr::scene::ISceneManager* smgr){
this->smgr = smgr;
Sprite.SetSmgr(smgr);
}
void Irr2D::SetDriver(irr::video::IVideoDriver* driver){
this->driver = driver;
Sprite.SetDriver(driver);
}
void Irr2D::LoadTexturemap(std::string file){
this->texturemap = driver->getTexture(file.c_str());
}
int Irr2D::LoadTexture(std::string file){
this->textures[this->numTextures] = driver->getTexture(file.c_str());
this->numTextures++;
return numTextures--;
}
Stable Version/1.2.2/Irr2D.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
/*
Irrlicht Library Wrapper
Created by Nathan Adams
Copyright (C) 2007
This software is licensed under the GNU/GPL.