Podunk wrote:can i, from my main program loop, check a sort of "event queue" array of events, and if this so called "event queue" contains any elements, then call a function which performs some things using the "event queue"
reason being is, I can't figure out how to do things to my array of (IAnimatedMeshSceneNode)s from within the instance of the event reciever class:
Code: Select all
class MyEventReceiver : public IEventReceiver
I know that when instantiating the event reciever object from the event reciever class, i can pass the constructor a pointer to the array of objects, but for some reason i think thats kind of a funky way to do things.
Should I just do everything from within an event reciever class?
I can't seem to make main() my event reciever either
Thanks in advance
Why do u use event in main?
Irrlicht events is global system. If u programming under the windows only u must use windows voids...
If u want use irrlicht events u implemented the next example:
//start header
//====================================================================================================
class Start : public IEventReceiver
{
public:
Start() {}
~Start() {}
void Start_running_void();
virtual bool OnEvent(SEvent event);
};
-------------------------------------------------------------------------------------------------------
//main source
#include start.h
Start Start_running;
//====================================================================================================
int main()
{
Start.Start_running_void();
return 0;
}
-------------------------------------------------------------------------------------------------------
//start source
#include start.h
//====================================================================================================
void Start::Start_running_void()
{
Start Start_events;
............
device = createDevice(video::EDT_SOFTWARE, core::dimension2d<s32>(512, 384), 16, false, true, false, &Start_events);
............
}
//====================================================================================================
bool Start::OnEvent(SEvent event)
{
if (event.EventType == EET_GUI_EVENT)
{
s32 id = event.GUIEvent.Caller->getID();
switch(event.GUIEvent.EventType)
{
case gui::EGET_BUTTON_CLICKED: //buttons
..................................
}
}
}
-------------------------------------------------------------------------------------------------------
[SOM]Roberto