Added a bunch of files synched with 0.8.42

This commit is contained in:
Don BURNS
2001-09-19 21:08:56 +00:00
parent fed86f3f03
commit e8f256a59d
446 changed files with 58397 additions and 10552 deletions

View File

@@ -15,18 +15,19 @@ int GLUTEventAdapter::_s_my = 0;
GLUTEventAdapter::GLUTEventAdapter()
{
_eventType = NONE; // adaptor does not encapsulate any events.
_key = -1; // set to 'invalid' key value.
_button = -1; // set to 'invalid' button value.
_mx = -1; // set to 'invalid' position value.
_my = -1; // set to 'invalid' position value.
_buttonMask = 0; // default to no mouse buttons being pressed.
_time = 0.0f; // default to no time has been set.
_eventType = NONE; // adaptor does not encapsulate any events.
_key = -1; // set to 'invalid' key value.
_button = -1; // set to 'invalid' button value.
_mx = -1; // set to 'invalid' position value.
_my = -1; // set to 'invalid' position value.
_buttonMask = 0; // default to no mouse buttons being pressed.
_time = 0.0f; // default to no time has been set.
copyStaticVariables();
}
void GLUTEventAdapter::copyStaticVariables()
{
_buttonMask = _s_accumulatedButtonMask;
@@ -38,6 +39,7 @@ void GLUTEventAdapter::copyStaticVariables()
_my = _s_my;
}
void GLUTEventAdapter::setWindowSize(int Xmin, int Ymin, int Xmax, int Ymax)
{
_s_Xmin = Xmin;
@@ -46,6 +48,7 @@ void GLUTEventAdapter::setWindowSize(int Xmin, int Ymin, int Xmax, int Ymax)
_s_Ymax = Ymax;
}
void GLUTEventAdapter::setButtonMask(unsigned int buttonMask)
{
_s_accumulatedButtonMask = buttonMask;
@@ -60,6 +63,7 @@ void GLUTEventAdapter::adaptResize(float time, int Xmin, int Ymin, int Xmax, int
copyStaticVariables();
}
/** method for adapting mouse motion events whilst mouse buttons are pressed.*/
void GLUTEventAdapter::adaptMouseMotion(float time, int x, int y)
{
@@ -70,6 +74,7 @@ void GLUTEventAdapter::adaptMouseMotion(float time, int x, int y)
copyStaticVariables();
}
/** method for adapting mouse motion events whilst no mouse button are pressed.*/
void GLUTEventAdapter::adaptMousePassiveMotion(float time, int x, int y)
{
@@ -80,12 +85,12 @@ void GLUTEventAdapter::adaptMousePassiveMotion(float time, int x, int y)
copyStaticVariables();
}
/** method for adapting mouse button pressed/released events.*/
void GLUTEventAdapter::adaptMouse(float time, int button, int state, int x, int y)
{
_time = time;
if( state == GLUT_DOWN )
{
@@ -94,9 +99,9 @@ void GLUTEventAdapter::adaptMouse(float time, int button, int state, int x, int
switch(button)
{
case(GLUT_LEFT_BUTTON): _s_accumulatedButtonMask = _s_accumulatedButtonMask | LEFT_BUTTON; break;
case(GLUT_MIDDLE_BUTTON): _s_accumulatedButtonMask = _s_accumulatedButtonMask | MIDDLE_BUTTON; break;
case(GLUT_RIGHT_BUTTON): _s_accumulatedButtonMask = _s_accumulatedButtonMask | RIGHT_BUTTON; break;
case(GLUT_LEFT_BUTTON): _s_accumulatedButtonMask = _s_accumulatedButtonMask | LEFT_BUTTON; break;
case(GLUT_MIDDLE_BUTTON): _s_accumulatedButtonMask = _s_accumulatedButtonMask | MIDDLE_BUTTON; break;
case(GLUT_RIGHT_BUTTON): _s_accumulatedButtonMask = _s_accumulatedButtonMask | RIGHT_BUTTON; break;
}
}
@@ -108,19 +113,20 @@ void GLUTEventAdapter::adaptMouse(float time, int button, int state, int x, int
switch(button)
{
case(GLUT_LEFT_BUTTON): _s_accumulatedButtonMask = _s_accumulatedButtonMask & ~LEFT_BUTTON; break;
case(GLUT_MIDDLE_BUTTON): _s_accumulatedButtonMask = _s_accumulatedButtonMask & ~MIDDLE_BUTTON; break;
case(GLUT_RIGHT_BUTTON): _s_accumulatedButtonMask = _s_accumulatedButtonMask & ~RIGHT_BUTTON; break;
case(GLUT_LEFT_BUTTON): _s_accumulatedButtonMask = _s_accumulatedButtonMask & ~LEFT_BUTTON; break;
case(GLUT_MIDDLE_BUTTON): _s_accumulatedButtonMask = _s_accumulatedButtonMask & ~MIDDLE_BUTTON; break;
case(GLUT_RIGHT_BUTTON): _s_accumulatedButtonMask = _s_accumulatedButtonMask & ~RIGHT_BUTTON; break;
}
}
_s_mx = x;
_s_my = y;
copyStaticVariables();
}
/** method for adapting keyboard events.*/
void GLUTEventAdapter::adaptKeyboard(float time, unsigned char key, int x, int y )
{
@@ -129,16 +135,16 @@ void GLUTEventAdapter::adaptKeyboard(float time, unsigned char key, int x, int y
_key = key;
_s_mx = x;
_s_my = y;
copyStaticVariables();
}
/** method for adapting frame events, i.e. iddle/display callback.*/
void GLUTEventAdapter::adaptFrame(float time)
{
_eventType = FRAME;
_time = time;
copyStaticVariables();
}