irrlib

irrlib Mercurial Source Tree


Root/Stable Version/1.2.2/Irr2D.cpp

/*
    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--;
}

Archive Download this file

Branches

Tags

Page rendered in 0.75826s using 11 queries.