The SDL forums have moved to discourse.libsdl.org.
This is just a read-only archive of the previous forums, to keep old links working.
SDL
Simple Directmedia Layer Forums
Structure problem : SDL_MOUSEWHEEL && event.motion
eze
Joined: 15 Aug 2014
Posts: 1
Posted: Mon Aug 18, 2014 6:14 pm
The problem i have, it's very silly.
I'm creating a scrollbar but when i pollEvent SDL_MOUSEWHEEL the structure SDL_MouseMotionEvent.y(shows a random const), SDL_MouseMotionEvent.x(shows wheel.y) don't show the cursor position.
And when i pollEvent SDL_MOUSEMOTION the structure SDL_MouseWheelEvent.y(shows motion.y), SDL_MouseWheelEvent.x(shows 0).
Seems like the structures some how get corrupted or maybe there is something i don't know.
The idea was use motion.y and motion.x to limit the mouse the same size of the scrollbar and wheel.y to control de value of the scrollbar.
Here is a screenshot to explain much better:
Code main.h:
Code:
...
while(true){
// Update the surface
SDL_UpdateWindowSurface( window );