Sign in to follow this  

SDL Calling a function in a event

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

Another problem that i have. I want to call a function ( void set_roll() ) in a event that happens when the left mouse button is pressed. The thing is that nothing happens. I click the left mouse button and it shud call a function to do seomething but nothing happens. Please help how do i have to put the function so that it will work.

Share this post


Link to post
Share on other sites
Quote:
Original post by RedReaper132
Another problem that i have. I want to call a function ( void set_roll() ) in a event that happens when the left mouse button is pressed. The thing is that nothing happens. I click the left mouse button and it shud call a function to do seomething but nothing happens. Please help how do i have to put the function so that it will work.


I don't know what you're talking about because you haven't provided any code.

But have you done the basics: set a break point in that function? Or a simple statement that prints something to the console?

Share this post


Link to post
Share on other sites
Furthermore, what "event", are you talking about? Are you talked about an msvc event? A GLUT mouse callback? Something else entirely? Do you have any other functions to verify that the event is set up correctly?

My guess is that you didn't set the event up correctly.

Share this post


Link to post
Share on other sites
Well it was a mouse down event when a left key was presed on the mouse. But i figured it alredy out. When i saw what the problem was i laught. I thought i was soo stupid. The problem was:

In the event i whrote:

void slot_roll();

But it shud be:

slot_roll();

LOL what a mistake.

Share this post


Link to post
Share on other sites

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