A
ADT_CLONE
Hello everyone. I'm quite new to this newsgroup and fairly new to C++,
though I have solid knowledge. Basically what I want to do is define a
child in a variable that has a parent type. I am using the Irrlicht
Graphics Engine and it has this function:
Idevice=createDevice(video::EDT_OPENGL,
core::dimension2d<s32>(512, 384), 16, false, false,
false,eventReceiver);
The "eventReceiver" variable has to be of type irr::IEventReceiver*.
Anyway, here is the variable declaration for "eventReceiver":
static Easy_Event_Receiver eventReceiver;
As you can see, there are type issues here, since they are of different
types. Though Easy_Event_Receiver is a child of irr::IEventReceiver* so
isn't it suppose to inherit the type or something. Anyway, I've tried
various things from logical to utterly stupid. I've tried typecasting
though that doesn't work. There must be some way that I can define the
eventReceiver variable with type irr::IEventReceiver* while it still
holds the Easy_Event_Receiver class. Any help would be greatly
appriciated.
ADT_CLONE
though I have solid knowledge. Basically what I want to do is define a
child in a variable that has a parent type. I am using the Irrlicht
Graphics Engine and it has this function:
Idevice=createDevice(video::EDT_OPENGL,
core::dimension2d<s32>(512, 384), 16, false, false,
false,eventReceiver);
The "eventReceiver" variable has to be of type irr::IEventReceiver*.
Anyway, here is the variable declaration for "eventReceiver":
static Easy_Event_Receiver eventReceiver;
As you can see, there are type issues here, since they are of different
types. Though Easy_Event_Receiver is a child of irr::IEventReceiver* so
isn't it suppose to inherit the type or something. Anyway, I've tried
various things from logical to utterly stupid. I've tried typecasting
though that doesn't work. There must be some way that I can define the
eventReceiver variable with type irr::IEventReceiver* while it still
holds the Easy_Event_Receiver class. Any help would be greatly
appriciated.
ADT_CLONE