Another problem is my current inability to draw any of the Gui, well less of the gui but more or the Rectangles and Text Box type things. I've gotten the basics of the engine, but it just doesn't seem to like some of the commands i try.
If anyone minds trying to figure out why it won't draw then thanks.
Obviously you need the code so here it be.
Code: Select all
#include <irrlicht.h>
#include <ISceneNode.h>
using namespace irr;
using namespace core;
using namespace scene;
using namespace video;
using namespace io;
using namespace gui;
int main()
{
// start up the engine
IrrlichtDevice *device = createDevice(video::EDT_OPENGL,
core::dimension2d<s32>(640,480));
video::IVideoDriver* driver = device->getVideoDriver();
scene::ISceneManager* scenemgr = device->getSceneManager();
gui::IGUIEnvironment* guienv = device->getGUIEnvironment();
device->setWindowCaption(L"Hello World!");
// add a first person shooter style user controlled camera
scene::ISceneNode* camnode = scenemgr->addCameraSceneNodeFPS();
camnode->setPosition(core::vector3df(0,0,120));
// load and show quake2 .md2 model
scene::ISceneNode* node = scenemgr->addAnimatedMeshSceneNode(
scenemgr->getMesh("../../media/faerie.md2"));
// if everything worked, add a texture and disable lighting
if (node)
{
node->setMaterialTexture(0, driver->getTexture("../../media/faerie5.bmp"));
node->setMaterialFlag(video::EMF_LIGHTING, false);
}
//Add Some Text
IGUIStaticText* text = guienv->addStaticText(L"This is a Test",rect<int>(), true);
// draw everything
while(device->run() && driver)
{
driver->beginScene(true, true, video::SColor(255,0,0,255));
scenemgr->drawAll();
guienv->drawAll();
driver->endScene();
}
// delete device
device->drop();
return 0;
}