#include "IrrLib.h" #include "irrlicht.h" using namespace irr; using namespace core; using namespace scene; using namespace video; using namespace io; using namespace gui; IrrLib::IrrLib(video::E_DRIVER_TYPE drivertype, core::dimension2d & res, u32 bits, bool fullscreen, bool stencilbuffer, bool vsync) { this->device = createDevice(drivertype, res, bits, fullscreen, stencilbuffer, vsync); if (this->device == 0) exit(1); this->Lib2D.setDevice(this->device); this->Lib3D.setDevice(this->device); } bool IrrLib::DeviceIsRunning() { return this->device->run(); } void IrrLib::BeginScene() { this->device->getVideoDriver()->beginScene(true, true, video::SColor(0,200,200,200)); //smgr->addCameraSceneNode(0, vector3df(0,1,-7), vector3df(0,0,0)); } void IrrLib::BeginScene(irr::video::SColor color) { this->device->getVideoDriver()->beginScene(true, true, color); } void IrrLib::BeginScene(bool usebackBuffer, bool usezBuffer, irr::video::SColor color) { this->device->getVideoDriver()->beginScene(usebackBuffer, usezBuffer, color); } void IrrLib::SetWindowCaption(stringw str) { this->device->setWindowCaption(str.c_str()); } void IrrLib::DrawAll() { this->device->getGUIEnvironment()->drawAll(); this->device->getSceneManager()->drawAll(); } void IrrLib::EndScene() { this->device->getVideoDriver()->endScene(); } void IrrLib::EndIrrlicht() { if(this->device != NULL){ this->device->drop(); this->device = NULL; } } void IrrLib::AddFPSCam() { this->cam = this->device->getSceneManager()->addCameraSceneNodeFPS(); }