function (irr::IrrlitchDevice *device);

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
Sindromequijote
Posts: 6
Joined: Tue Oct 11, 2005 9:15 pm

function (irr::IrrlitchDevice *device);

Post 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.
Acki
Posts: 3496
Joined: Tue Jun 29, 2004 12:04 am
Location: Nobody's Place (Venlo NL)
Contact:

Post 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 !!! ;)
while(!asleep) sheep++;
IrrExtensions:Image
http://abusoft.g0dsoft.com
try Stendhal a MORPG written in Java
Sindromequijote
Posts: 6
Joined: Tue Oct 11, 2005 9:15 pm

Post by Sindromequijote »

class CPanelAcciones{
private:
...
public:
CPanelAcciones (irr:IrrlitchDevice* device, ...);
...
}

Error C2226: unexpected type 'irr::IrrlitchDevice'
error C2238: unexpected token(s) preceding ';'
specialtactics
Posts: 17
Joined: Tue Dec 09, 2003 9:03 am
Location: Germany

Post 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.
BlackNinjaGames
Posts: 31
Joined: Mon Sep 05, 2005 4:47 pm
Contact:

Post by BlackNinjaGames »

Irrlicht is spelled wrong... :wink:

you have Irrlitch. It is Irrlicht.

8)
Sindromequijote
Posts: 6
Joined: Tue Oct 11, 2005 9:15 pm

Post by Sindromequijote »

In my code I spelled it correctly and I'd included irrlicht allready...
Thanks Anyway
Post Reply