Jump to content
  • Advertisement
Sign in to follow this  
Zotoaster

Having trouble with Irrlicht event receivers

This topic is 3992 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Hey y'all. I've been trying to get to understand event receivers in Irrlicht for a while, and I'm sorry to say, but I just dont get wtf they are all about ¬_¬. I figure if they make an enum with every event type in it, they are just aswell making functions to check, it makes so much more sense (especially since I can't do it! :P ) Does anyone out there know how to help, or post me a simple code snippet showing something like how to check for mouse click or something? It would be much appriciated, not only for my game, but also because I'll be needing to use it for my Advanced Higher Computing project after the holidays. Thanks everyone

Share this post


Link to post
Share on other sites
Advertisement
Checking the Irrlicht tutorials may help: Tutorial

Quote:
Does anyone out there know how to help, or post me a simple code snippet showing something like how to check for mouse click or something?



bool OnEvent(SEvent event)
{
if(!device)
return false;

if(event.EventType == EET_MOUSE_INPUT_EVENT &&
event.MouseInput.Event == EMIE_LMOUSE_PRESSED_DOWN)
{
// do stuff
return true;
}
else
return false;
}


I think this code should work, but I haven't tested it. You can list all of the different events you need this way.

Hope this helps.

Share this post


Link to post
Share on other sites
Hmm, I tried making that function, but I don't know what parameter to give it... I think I'm getting the wrong end of the stick though. Am I right in saying that that should return true if the mouse is clicked (provided I give it the right parameters), or, do I have to put all events in there? :/

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

Participate in the game development conversation and more when you create an account on GameDev.net!

Sign me up!