my irrlicht game engine is off to a bad start.
i dont understand why it is giving me an unhandeled exception at runtime. any thoughts?
main.h
Code: Select all
#ifndef MAIN_H_
#define MAIN_H_
#include <irrlicht.h>
using namespace irr;
using namespace core;
using namespace scene;
using namespace video;
using namespace io;
using namespace gui;
//globals
class RedNovember
{
public:
RedNovember(); // constructor
void initIrrlicht();
void renderScene();
int shutdown();
IrrlichtDevice* getDevice() { return device; }
private:
IrrlichtDevice* device;
IVideoDriver* driver;
ISceneManager* smgr;
IGUIEnvironment* guienv;
// every other global you would need can instead of being global just be put in here.
};
#endif
Code: Select all
#include "main.h"
RedNovember* sys;
void RedNovember::renderScene()
{
while(device->run())
{
driver->beginScene(true,true,SColor(255,100,101,140));
smgr->drawAll();
guienv->drawAll();
driver->endScene();
}
}
int RedNovember::shutdown()
{
device->drop();
return 0;
}
int main()
{
sys->initIrrlicht();
sys->renderScene();
sys->shutdown();
}
Code: Select all
#include "main.h"
void RedNovember::initIrrlicht()
{
device = createDevice(EDT_OPENGL, dimension2d<u32>(800, 600), 32,
false, false, false, 0);
device->setWindowCaption(L"Project: Red November");
driver = device->getVideoDriver();
smgr = device->getSceneManager();
guienv = device->getGUIEnvironment();
}
please help :)