SDL Calling a function in a event

Started by
2 comments, last by RedReaper132 15 years, 5 months ago
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.
-----------------------------Please visit my GameDev Blog:http://red-dev.co.nr/
Advertisement
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?
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.
Check out the first gameplay video from my javascript/PHP RTS game
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.
-----------------------------Please visit my GameDev Blog:http://red-dev.co.nr/

This topic is closed to new replies.

Advertisement