The Super Newb Question

If you are a new Irrlicht Engine user, and have a newbie-question, this is the forum for you. You may also post general programming questions here.
Post Reply
jlulian38
Posts: 11
Joined: Fri Apr 21, 2006 3:57 am

The Super Newb Question

Post by jlulian38 »

I've just started recently (as in the last few days) and I'm having a few problems. The first being that if i don't have my files in a certain folder, i can't load my dll's and nothing works.

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;
 }
Note: For me to get this to even Compile was a big achievement in my eyes
Hirte
Posts: 73
Joined: Sat Apr 01, 2006 1:32 pm

Post by Hirte »

#include <ISceneNode.h>

--> don't needed, I think

IGUIStaticText* text = guienv->addStaticText(L"This is a Test",rect<int>(), true);

--> no coordinates, so you don't get a visible text. try rect<int>(0,0,200,200) or something
jlulian38
Posts: 11
Joined: Fri Apr 21, 2006 3:57 am

Post by jlulian38 »

:lol: Not sure how i missed that. Now I just need to get a million other things to work D:
Post Reply