A little help with cb

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
Irrlicht Engine
Posts: 12
Joined: Thu Apr 10, 2008 11:21 pm

A little help with cb

Post by Irrlicht Engine »

I was using this tutorial that uses codeblocks http://www.gameiterator.com/index.php/Games/HowToCreateAComputerGame
Anyway...
I went and added the files they wanted in the directories and linker areas and still got errors. However when I go to build options the titles are a little different on the tabs like instead of directories it says search directories, and instead of linker it says linker settings. Anyway when I make the modifications it suggests it still gives me errors. I've noticed that in the Search directory-> compiler window the C\programfiles\codeblocks\include is not there, and it is in the tutorial, could this be causing a problem? If the version difference is the problem, what do I need to do?
CuteAlien
Admin
Posts: 9930
Joined: Mon Mar 06, 2006 2:25 pm
Location: Tübingen, Germany
Contact:

Post by CuteAlien »

As cb and Irrlicht are both changing all the time it often happens that tutorials are a little outdated. In your case it looks like an older Irrlicht version was used.

So instead of

Code: Select all

virtual bool OnEvent(SEvent event)
you will need

Code: Select all

virtual bool OnEvent(const SEvent & event)
If there are more errors, please do copy the extact error messages in here.
IRC: #irrlicht on irc.libera.chat
Code snippet repository: https://github.com/mzeilfelder/irr-playground-micha
Free racer made with Irrlicht: http://www.irrgheist.com/hcraftsource.htm
Irrlicht Engine
Posts: 12
Joined: Thu Apr 10, 2008 11:21 pm

Post by Irrlicht Engine »

The file compiled with no errors :) but when I attempted to run the .exe it created in a debug file (with the irrlicht file and a scenes folder containing a world called game.irr, also tried just game after I saw the error) I got this
Image
What can I do?
hybrid
Admin
Posts: 14143
Joined: Wed Apr 19, 2006 9:20 pm
Location: Oldenburg(Oldb), Germany
Contact:

Post by hybrid »

You should make the .irr file available from the path you specified. Seems like the path is wrong, because it cannot open the file (as the error message obvioulsy mentions).
Irrlicht Engine
Posts: 12
Joined: Thu Apr 10, 2008 11:21 pm

Post by Irrlicht Engine »

And unless I missed something I said I put the file game.irr in the scenes folder seen to the left in the screen shot, so I'm wondering if I missed something, or what I need to change.
It does say unable to open, but there is a file called game.irr made by irredit in that scenes folder seen above. Is it possible it has to do with the GLSL it says is unavailable in the line above the game.irr line?
hybrid
Admin
Posts: 14143
Joined: Wed Apr 19, 2006 9:20 pm
Location: Oldenburg(Oldb), Germany
Contact:

Post by hybrid »

No, GLSL is definitely not used to open .irr files. But I neither see your code, nor the contents of the directory or the file you want to load. So how should I (or someone else) tell you something more specific, when you're the only one who has the necessary information?!
Irrlicht Engine
Posts: 12
Joined: Thu Apr 10, 2008 11:21 pm

Post by Irrlicht Engine »

sorry, :) your right, here is some of the necessary information

the code in the file I compiled is as follows

Code: Select all

#include <irrlicht.h>
#include <iostream>
#include <direct.h>
using namespace irr;

IrrlichtDevice* Device = 0;

class EventReceiver : public IEventReceiver
{
public:
 virtual bool OnEvent(const SEvent & event)
 {
   // close app when user presses escape

   if(event.KeyInput.Key == KEY_ESCAPE)
   Device->closeDevice();

   return false;
 }
};

int main()
{
 chdir(".."); // change to the main irredit directory

 Device = createDevice(video::EDT_OPENGL,
                       core::dimension2d<s32>(640, 480));

 EventReceiver receiver;
 Device->setEventReceiver(&receiver);

 Device->setWindowCaption(L"A Game");

 scene::ISceneManager* smgr = Device->getSceneManager();

 smgr->loadScene("scenes/game.irr");
 smgr->addCameraSceneNodeFPS(); // create fps camera

 Device->getCursorControl()->setVisible(false);

 while(Device->run())
   if (Device->isWindowActive())
   {
     Device->getVideoDriver()->beginScene(true,
                 true, video::SColor(0,200,200,200));

     smgr->drawAll();
     Device->getVideoDriver()->endScene();
   }

 Device->drop();

 return 0;
}
This error I'm receiving is this:
Image

and inside the scenes folder it talks about (which is a direct subdirectory of the .exe file) looks like this
Image

There is a copy of Irrlicht.dll in the folder with the exe as well.

Does anyone know what sort of error this is?
ecsos
Posts: 30
Joined: Mon Feb 04, 2008 8:02 am

Post by ecsos »

this line,

Code: Select all

chdir(".."); // change to the main irredit directory 
comment it out, could be your problem
Irrlicht Engine
Posts: 12
Joined: Thu Apr 10, 2008 11:21 pm

Post by Irrlicht Engine »

I gave it a try and it looks closer, but it gave me this error.
Image
JP
Posts: 4526
Joined: Tue Sep 13, 2005 2:56 pm
Location: UK
Contact:

Post by JP »

You need to change the irrEdit working directory to that of your .exe for your game. It's in the options menu of irrEdit (restart irrEdit after setting it and resave your .irr file).
Image Image Image
Irrlicht Engine
Posts: 12
Joined: Thu Apr 10, 2008 11:21 pm

Post by Irrlicht Engine »

I changed the directory but the error seems to be the same.

Image

Do I need to relocate all of the resources to the .exe or scenes file?
Post Reply