ISceneManager

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
Vlad_
Posts: 9
Joined: Fri Jan 04, 2008 9:25 pm
Location: Berlin/Germany

ISceneManager

Post by Vlad_ »

hi there,

i ve started programming a game with an own engine but.... well i hate the code i hate everything on it... SO i decided to try irrlicht. the first tutorial is great, but it doesn't work!

i ve added paths to libs and includes, added everything and everywhere, but ms visual c++ 2005 says that ISceneManager is not there....

Code: Select all

ISceneManager* smgr =ISceneManager* device->getSceneManager();
this line is not correct, accroding to msvc... but why? i ve included the irrlicht.h... i m getting mad ...
Vlad_
Posts: 9
Joined: Fri Jan 04, 2008 9:25 pm
Location: Berlin/Germany

Post by Vlad_ »

edit:

ok i corrected the line:

Code: Select all

ISceneManager* smgr = device->getSceneManager();
it looks like this... but it is still not working :( same error
MasterGod
Posts: 2061
Joined: Fri May 25, 2007 8:06 pm
Location: Israel
Contact:

Post by MasterGod »

Post the error you get.
Image
Dev State: Abandoned (For now..)
Requirements Analysis Doc: ~87%
UML: ~0.5%
hybrid
Admin
Posts: 14144
Joined: Wed Apr 19, 2006 9:20 pm
Location: Oldenburg(Oldb), Germany
Contact:

Post by hybrid »

You need several other lines in front of the one you mentioned. Just check the examples that come with the Irrlicht SDK, they will tell you the complete setup and much more.
Vlad_
Posts: 9
Joined: Fri Jan 04, 2008 9:25 pm
Location: Berlin/Germany

Post by Vlad_ »

the entire code:

Code: Select all

#include <Irrlicht.h>

using namespace irr;
using namespace core;
using namespace video;
using namespace io;
using namespace gui;

#pragma comment(lib, "Irrlicht.lib")

int main()
{
	IrrlichtDevice *device = createDevice(EDT_OPENGL, dimension2d<s32>(640, 480), 16, false, false, false, 0);

	device->setWindowCaption(L"Hello World!");

	IVideoDriver* driver = device->getVideoDriver();
	ISceneManager* smgr = device->getSceneManager();
	IGUIEnvironment* guienv = device->getGUIEnvironment();

	guienv->addStaticText(L"Hello There!", rect<int>(10,10,200,22), true);

	while(device->run())
	{
		driver->beginScene(true, true, SColor(55,100,101,140));

		smgr->drawAll();
		guienv->drawAll();
	}

	device->drop();

	return 0;
}
the error message, as you wanted (well it's german)

Fehler 1 error C2065: 'ISceneManager': nichtdeklarierter Bezeichner c:\Dokumente und Einstellungen\and\Eigene Dateien\Visual Studio 2005\Projects\irrlicht\irrlicht\main.cpp 18

"not declared name", would be a correct translation i guess!
rogerborg
Admin
Posts: 3590
Joined: Mon Oct 09, 2006 9:36 am
Location: Scotland - gonnae no slag aff mah Engleesh
Contact:

Post by rogerborg »

Either add:

Code: Select all

using namespace scene;
or use

Code: Select all

scene::ISceneManager* smgr = device->getSceneManager();
Please upload candidate patches to the tracker.
Need help now? IRC to #irrlicht on irc.freenode.net
How To Ask Questions The Smart Way
Ico
Posts: 289
Joined: Tue Aug 22, 2006 11:35 pm

Post by Ico »

Du hast einfach den Namespace "scene" vergessen. ;)
-----
The displayed (english) error is "undeclared identifier". You forgot to add the namespace "scene" which contains ISceneManager.
Dark_Kilauea
Posts: 368
Joined: Tue Aug 21, 2007 1:43 am
Location: The Middle of Nowhere

Post by Dark_Kilauea »

you forgot

Code: Select all

using namespace scene;

otherwise put scene:: in front of all members of that namespace, whatever suits you best.
rogerborg wrote:Every time someone learns to use a debugger, an angel gets their wings.
MasterGod
Posts: 2061
Joined: Fri May 25, 2007 8:06 pm
Location: Israel
Contact:

Post by MasterGod »

1. Add:

Code: Select all

using namespace scene;
or
scene::ISceneManager
2. Add:

Code: Select all

driver->endScene();
after guienv->drawAll();

like this:

Code: Select all

#include <Irrlicht.h>

using namespace irr;
using namespace core;
using namespace video;
using namespace io;
using namespace gui;
using namespace scene;

#pragma comment(lib, "Irrlicht.lib")

int main()
{
   IrrlichtDevice *device = createDevice(EDT_OPENGL, dimension2d<s32>(640, 480), 16, false, false, false, 0);

   device->setWindowCaption(L"Hello World!");

   IVideoDriver* driver = device->getVideoDriver();
   ISceneManager* smgr = device->getSceneManager();
   IGUIEnvironment* guienv = device->getGUIEnvironment();

   guienv->addStaticText(L"Hello There!", rect<int>(10,10,200,22), true);

   while(device->run())
   {
      driver->beginScene(true, true, SColor(55,100,101,140));

      smgr->drawAll();
      guienv->drawAll();

	  driver->endScene();
   }

   device->drop();

   return 0;
}
Image
Dev State: Abandoned (For now..)
Requirements Analysis Doc: ~87%
UML: ~0.5%
Vlad_
Posts: 9
Joined: Fri Jan 04, 2008 9:25 pm
Location: Berlin/Germany

Post by Vlad_ »

yeah thanks it works perfectly :)
Post Reply