Code: Select all
IrrlichtDevice *device = 0; //Place Holder
...
class eventReceiver : public IEventReceiver
{
public:
virtual bool OnEvent(SEvent event)
{
if (event.EventType == EET_GUI_EVENT)
{
s32 id = event.GUIEvent.Caller -> getID();
IGUIEnvironment* guienv = device -> getGUIEnvironment();
switch(event.GUIEvent.EventType)
{
case EGET_BUTTON_CLICKED:
if (id == 101)
{
//Finish Later
}
break;
}
}
return false;
}
};
Though if I am to take out the place holder device, I get these errors.--------------------Configuration: RB - Win32 Debug--------------------
Compiling...
main.cpp
rb_game.cpp
Linking...
rb_game.obj : error LNK2005: "class irr::IrrlichtDevice * device" (?device@@3PAVIrrlichtDevice@irr@@A) already defined in main.obj
Debug/RB.exe : fatal error LNK1169: one or more multiply defined symbols found
Error executing link.exe.
RollerBall.exe - 2 error(s), 0 warning(s)
--------------------Configuration: RB - Win32 Debug--------------------
Compiling...
main.cpp
.\rb_game.h(44) : error C2065: 'device' : undeclared identifier
.\rb_game.h(44) : error C2227: left of '->getGUIEnvironment' must point to class/struct/union
rb_game.cpp
.\rb_game.h(44) : error C2065: 'device' : undeclared identifier
.\rb_game.h(44) : error C2227: left of '->getGUIEnvironment' must point to class/struct/union
Error executing cl.exe.
RB.exe - 4 error(s), 0 warning(s)