int global = 0;
static int thread_menu ( void *data ) {
SDL_Event event;
while ( !global ) {
SDL_WaitEvent ( &event );
switch ( event.type ) {
case SDL_MOUSEBUTTONDOWN:
break;
case SDL_MOUSEBUTTONUP:
{
int x = event.button.x;
int y = event.button.y;
y = cf.screen_height - y;
scene_event_click ( sc, x, y );
SDL_PushEvent ( &event );
}
break;
case SDL_MOUSEMOTION:
{
int x = event.motion.x;
int y = event.motion.y;
y = cf.screen_height - y;
scene_event_over ( sc, x, y );
SDL_PushEvent ( &event );
}
break;
default:
break;
}
}
return 0;
}