Root/
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 | /* Irrlicht Library Wrapper Created by: Nathan Adams Denzel Morris 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--; } |
Source at commit tip created 11 years 4 months ago. By Nathan Adams, Migrating from google code |
---|