C:/irrlicht/IrrLib/Irr2D.cpp

Go to the documentation of this file.
00001 /*
00002     Irrlicht Library Wrapper
00003     Created by:
00004         Nathan Adams
00005         Denzel Morris
00006     Copyright (C) 2007
00007 
00008     This software is licensed under the GNU/GPL.
00009     This software may not be used for commerical purposes.
00010 */
00011 
00012 #include <iostream>
00013 //#include "IrrLib.h"
00014 //#include "IrrSphere.h" //You probably aren't going to be using 3D objects in a 2D environment!
00015 #include <irrlicht.h>
00016 #include <strings.h>
00017 
00018 #include "Irr2D.h"
00019 #include "IrrSprite.h"
00020 
00021 using namespace irr;
00022 using namespace core;
00023 using namespace scene;
00024 using namespace video;
00025 using namespace io;
00026 using namespace gui;
00027 
00028 using namespace std;
00029 
00030 Irr2D::Irr2D(){
00031         this->numTextures = 0;
00032         this->numLines = 0;
00033         //NA Should we set textures to new
00034 }
00035 
00036 Irr2D::~Irr2D(){
00037     /*for(int i = 0; i < numTextures; ++i)
00038         delete this->textures[i];
00039 
00040     delete this->textures;*/
00041     //No more dynamic memory business yay! NA
00042 }
00043 
00044 /*void Irr2D::SetSmgr(irr::scene::ISceneManager* smgr){
00045     this->smgr = smgr;
00046         Sprite.SetSmgr(smgr);
00047 }
00048 
00049 void Irr2D::SetDriver(irr::video::IVideoDriver* driver){
00050     this->driver = driver;
00051         Sprite.SetDriver(driver);
00052 }*/
00053 
00054 void Irr2D::LoadTexturemap(stringc file){
00055         this->texturemap = driver->getTexture(file.c_str());
00056 }
00057 
00058 int Irr2D::LoadTexture(stringc file){
00059         //this->textures[this->numTextures] = driver->getTexture(file.c_str());
00060         textures.push_back(driver->getTexture(file.c_str()));
00061         this->numTextures++;
00062         return numTextures--;
00063 }
00064 
00065 void Irr2D::DrawLine(IrrPos& start, IrrPos& end, const irr::video::SColor& color)
00066 {
00067         this->driver->draw2DLine(start, end, color);
00068 }
00069 
00070 void Irr2D::AddLines(IrrPos& start, IrrPos& end, const irr::video::SColor& color)
00071 {
00072         this->start.push_back(start);
00073         this->end.push_back(end);
00074         this->color.push_back(color);
00075         this->numLines++;
00076 }
00077 
00078 void Irr2D::DrawLines()
00079 {
00080         for(int i = 0; i < numLines; ++i)
00081                 this->driver->draw2DLine(this->start[i], this->end[i], this->color[i]);
00082 }

Generated on Thu Dec 27 18:25:19 2007 for IrrLib by  doxygen 1.5.4