while(SDL_PollEvents(&event)) { switch(event.type){ case SDL_MOUSEBUTTONDOWN: switch(event.type.button.button){ case SDL_BUTTON_WHEELUP: scroll_up = true; break; case SDL_BUTTON_WHEELDOWN: scroll_down = true; break; } break; } case SDL_MOUSEBUTTONUP: switch(event.type.button.button){ case SDL_BUTTON_WHEELUP: scroll_up = false; break; case SDL_BUTTON_WHEELDOWN: scroll_down = false; break; } break; } } } (...) if(scroll_up) scroll_y -= 5 * elapsed_time; if(scroll_down) scroll_y += 5 * elapsed_time; »
Anyway, since nobody can scroll the wheel faster than your ordinary frame rate, I'd just do something like this:
« (...) case SDL_MOUSEBUTTONUP: switch(event.type.button.button){ case SDL_BUTTON_WHEELUP: scroll_y -= 5; break; case SDL_BUTTON_WHEELDOWN: scroll_y += 5; break; (...)
Aqui el link completo a la lista de mails de sdl donde saque la info: http://www.devolution.com/pipermail/sdl/2006-January/072043.html _________________ I wanna heal i wanna feel like I'm close to something real. I wanna find something I've wanted all along somewhere i belong