static void preference_loop( scalar_t time_step ) { check_gl_error(); update_audio(); set_gl_options( GUI ); clear_rendering_context(); ui_setup_display(); if (getparam_ui_snow()) { update_ui_snow( time_step, False ); draw_ui_snow(); } ui_draw_menu_decorations(); draw_preference(); ui_draw(); reshape( getparam_x_resolution(), getparam_y_resolution() ); winsys_swap_buffers(); }
/*! Mode loop function \author jfpatry \date Created: 2000-09-24 \date Modified: 2000-09-24 */ static void race_select_loop( scalar_t time_step ) { check_gl_error(); update_audio(); set_gl_options( GUI ); clear_rendering_context(); ui_setup_display(); if (getparam_ui_snow()) { update_ui_snow( time_step, (bool_t) ( wind_ssbtn != NULL && ssbutton_get_state( wind_ssbtn ) ) ); draw_ui_snow(); } ui_draw_menu_decorations(); set_widget_positions_and_draw_decorations(); ui_draw(); reshape( getparam_x_resolution(), getparam_y_resolution() ); winsys_swap_buffers(); }
static void credits_loop( scalar_t time_step ) { int width, height; width = getparam_x_resolution(); height = getparam_y_resolution(); check_gl_error(); update_audio(); clear_rendering_context(); set_gl_options( GUI ); ui_setup_display(); draw_credits_text( time_step ); if (getparam_ui_snow()) { update_ui_snow( time_step, False ); draw_ui_snow(); } ui_draw_menu_decorations(); ui_draw(); reshape( width, height ); winsys_swap_buffers(); }
/*! Mode loop function \author jfpatry \date Created: 2000-09-24 \date Modified: 2000-09-24 */ static void race_select_loop( scalar_t time_step ) { use_hud_program(); check_gl_error(); update_audio(); set_gl_options( GUI ); clear_rendering_context(); ui_setup_display(); if (getparam_ui_snow()) { update_ui_snow( time_step, False ); draw_ui_snow(); } ui_draw_menu_decorations(False); if (price_update) { update_text(); price_update = False; } GameMenu_draw(); draw_preview(); winsys_update_joysticks(); ui_draw(); reshape( getparam_x_resolution(), getparam_y_resolution() ); winsys_swap_buffers(); }
void UIManager::motionEvent( int x, int y ) { if ( is_mode_change_pending() ) { // Don't process events until mode change occurs return; } // Reverse y coordinate y = getparam_y_resolution() - y; std::list<pp::Widget*>::iterator it; for(it=widgets.begin();it!=widgets.end();it++){ (*it)->mouseMotion(x,y); } pp::Vec2d oldPos = cursorPos; cursorPos = pp::Vec2d(x,y); if ( oldPos.x != x || oldPos.y != y ) { // Update UI snow if ( getparam_ui_snow() ) { if ( rightMouseButtonDown ) { make_ui_snow( cursorPos ); reset_ui_snow_cursor_pos( cursorPos ); } else if ( middleMouseButtonDown ) { make_ui_snow( cursorPos ); push_ui_snow( cursorPos ); } else { push_ui_snow( cursorPos ); } } // Need to redraw cursor setDirty(); checkDirty(); } }
/*! callback for mouse motion events \return None \author jfpatry \date Created: 2000-09-16 \date Modified: 2000-09-16 */ void ui_event_motion_func( int x, int y ) { point2d_t old_pos; if ( is_mode_change_pending() ) { /* Don't process events until mode change occurs */ return; } /* Reverse y coordinate */ y = getparam_y_resolution() - y; trigger_mouse_motion_cbs( mouse_motion_cbs, x, y ); old_pos = cursor_pos; cursor_pos = make_point2d( x, y ); if ( old_pos.x != x || old_pos.y != y ) { /* Update UI snow */ if ( getparam_ui_snow() ) { if ( right_mouse_button_down ) { make_ui_snow( cursor_pos ); reset_ui_snow_cursor_pos( cursor_pos ); } else if ( middle_mouse_button_down ) { make_ui_snow( cursor_pos ); push_ui_snow( cursor_pos ); } else { push_ui_snow( cursor_pos ); } } /* Need to redraw cursor */ ui_set_dirty(); ui_check_dirty(); } }