// -*- Mode: c++ -*- // include files #include "uistate.h" #include const int UIState::UNDEF = -1; // to process mouse motion events we need a known mouse state // initially unknown int UIState::p_mousex = UIState::UNDEF; int UIState::p_mousey = UIState::UNDEF; // translation parameters float UIState::p_transx = 0; float UIState::p_transy = 0; // initially no animation function void ( *UIState::p_animate )( void ) = 0; // state for animation function float UIState::p_angle = 0; // 3^o at a time float UIState::p_angle_incr = 3.14159265358979323846f / 60.f; void UIState::ApplyModelTransform( void ) { glMatrixMode( GL_MODELVIEW ); glLoadIdentity(); glTranslatef( p_transx, p_transy, 0 ); glRotatef( p_angle, 0, 0, 1 ); } void UIState::ResetModelTransform( void ) { p_angle = 0; p_transx = 0; p_transy = 0; ApplyModelTransform(); }