Original Post
I am writing a SDL Tic Tac Toe game and I'm doing mouse events. I have it set so when I press the left mouse button down, it spits out a message ala console. The only thing is the event happens way too many times when I click the mouse. ie -Hatty [Edited by - Hatty on January 30, 2007 11:31:00 PM]
Quote:--Small sample-- when it should be only once:
Button down: x=257 y=163! Button down: x=257 y=163! Button down: x=257 y=163! Button down: x=257 y=163! Button down: x=257 y=163! Button down: x=257 y=163! Button down: x=257 y=163! Button down: x=257 y=163! Button down: x=257 y=163! Button down: x=257 y=163!
Quote:Is this easily accomplished? My poll event code:
Button down: x=257 y=163!
while (SDL_PollEvent(&event)) {
switch (event.type) {
case SDL_QUIT:
exit(0);
break;
case SDL_MOUSEBUTTONDOWN:
if (event.button.button == SDL_BUTTON_LEFT) {
printf("Button down: x=%i y=%i!\n", event.button.x, event.button.y);
}
break;
}
}