Sign in to follow this  

SDL_SetEventFilter?

This topic is 3501 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

How do I use this function? I'm guessing that it is used to ignore some events while posting other into the queue but I'm confused as to how to implement this. For example:
int MyEventFilter( const SDL_Event *event )
{
     if ( event.type == SDL_MOUSEBUTTONDOWN )
     { return 1; // post to queue }

     return 0; // do not post
}

int main()
{
   ....
   SDL_SetEventFilter( MyEventFilter );

   for ( ;; )
   {
        // what do I do here?

        // SDL doc says not to mess with SDL_QUIT. How do I deal with that?
   }

return 0;
}

Share this post


Link to post
Share on other sites

This topic is 3501 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.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this