Page 1 of 1

function (irr::IrrlitchDevice *device);

Posted: Tue Oct 11, 2005 9:32 pm
by Sindromequijote
Hi,
I suppose that i can't pass the Irrlitch Device as a parameter of a function. I got some errors trying that. I wanted to do a class' function (for example a menu/button... class) to draw "itself" on the device. How can I do that?
Thanks a lot.

Posted: Tue Oct 11, 2005 10:06 pm
by Acki
Why you can't pass the device as a parameter ???

Code: Select all

void myFunc(IrrlichtDevice* irrdev){
  // enter code here
}
now you can pass the device like this:

Code: Select all

IrrlichtDevice* device = createDevice(EDT_DIRECTX9, dimension2d<s32>(640, 480), 16);
myFunc(device);
I don't see where the problem is...
It's C++ pointer basics !!! ;)

Posted: Tue Oct 11, 2005 10:33 pm
by Sindromequijote
class CPanelAcciones{
private:
...
public:
CPanelAcciones (irr:IrrlitchDevice* device, ...);
...
}

Error C2226: unexpected type 'irr::IrrlitchDevice'
error C2238: unexpected token(s) preceding ';'

Posted: Tue Oct 11, 2005 10:42 pm
by specialtactics
Hi,
you probably forgot to include irrlicht.h there - the compiler tells you it doesn't know what a IrrlichtDevice is.
Actually all SceneNodes and GUIElements in irrlicht draw themselves. The object-oriented way to go would be to derive from IGUIElement or one of its subclasses.

Posted: Wed Oct 12, 2005 12:11 am
by BlackNinjaGames
Irrlicht is spelled wrong... :wink:

you have Irrlitch. It is Irrlicht.

8)

Posted: Wed Oct 12, 2005 6:58 am
by Sindromequijote
In my code I spelled it correctly and I'd included irrlicht allready...
Thanks Anyway