ok, i implemented the one in the Tutorial, it compiles just fine under dev-c++, but when ever i mouse over one of the buttons, it gives me the send error report to micro$oft.
Please help, let me know if you need any more info.
Please help, The event Reaciver isnt working!!!!!!!!!!
class MyEventReceiver : public IEventReceiver
{
public:
virtual bool OnEvent(SEvent event)
{
if (event.EventType == EET_GUI_EVENT)
{
s32 id = event.GUIEvent.Caller->getID();
IGUIEnvironment* env = device->getGUIEnvironment();
switch(event.GUIEvent.EventType)
{
case EGET_BUTTON_CLICKED:
if (id == 101)
{
device->closeDevice();
return true;
}
break;
}//End switch
}// End if
else
{
return false;
}
} //end v-bool
}; //End class
{
public:
virtual bool OnEvent(SEvent event)
{
if (event.EventType == EET_GUI_EVENT)
{
s32 id = event.GUIEvent.Caller->getID();
IGUIEnvironment* env = device->getGUIEnvironment();
switch(event.GUIEvent.EventType)
{
case EGET_BUTTON_CLICKED:
if (id == 101)
{
device->closeDevice();
return true;
}
break;
}//End switch
}// End if
else
{
return false;
}
} //end v-bool
}; //End class
You shouldn't have to.
My central game class, called GameCore, creates my EventReceiver object, and the code is like this :
Works with no problems, and the EventReceiver is created before the device. I've noticed the trend with people having problems with the Event Receiver is that they make the class which creates the device and maintains it, derive from IEventReceiver. I have a completely separate class, maybe that's the problem?
My central game class, called GameCore, creates my EventReceiver object, and the code is like this :
Code: Select all
m_receiver = new CEventReceiver ( );
m_device = createDevice ( m_deviceType, m_windowSize, m_bits, m_fullscreen, m_stencilBuffer, m_vsync, m_receiver );