Added support for glutSpecialFunc, glutSpaceballMotion, glutSpaceballRotate and
glutSpaceballRotate into osgGLUT::Window base class.
This commit is contained in:
@@ -39,12 +39,23 @@ class OSGGLUT_EXPORT Window
|
||||
static void mouseCB(int button, int state, int x, int y);
|
||||
static void keyboardCB(unsigned char key, int x, int y );
|
||||
|
||||
static void specialCB(int key, int x, int y);
|
||||
static void spaceballMotionCB(int x, int y, int z);
|
||||
static void spaceballRotateCB(int x, int y, int z);
|
||||
static void spaceballButtonCB(int button, int state);
|
||||
|
||||
virtual void reshape(GLint w, GLint h);
|
||||
virtual void visibility(int state);
|
||||
virtual void mouseMotion(int x, int y);
|
||||
virtual void mousePassiveMotion(int x, int y);
|
||||
virtual void mouse(int button, int state, int x, int y);
|
||||
virtual void keyboard(unsigned char key, int x, int y);
|
||||
|
||||
virtual void special(int key, int x, int y);
|
||||
virtual void spaceballMotion(int x, int y, int z);
|
||||
virtual void spaceballRotate(int x, int y, int z);
|
||||
virtual void spaceballButton(int button, int state);
|
||||
|
||||
|
||||
static Window* s_theWindow;
|
||||
|
||||
|
||||
@@ -70,6 +70,11 @@ bool Window::open()
|
||||
glutMotionFunc( mouseMotionCB );
|
||||
glutPassiveMotionFunc( mousePassiveMotionCB );
|
||||
|
||||
glutSpecialFunc( specialCB );
|
||||
glutSpaceballMotionFunc( spaceballMotionCB );
|
||||
glutSpaceballRotateFunc( spaceballRotateCB );
|
||||
glutSpaceballButtonFunc( spaceballButtonCB );
|
||||
|
||||
_is_open = 1;
|
||||
return true;
|
||||
}
|
||||
@@ -116,9 +121,30 @@ void Window::keyboardCB(unsigned char key, int x, int y)
|
||||
s_theWindow->keyboard(key,x,y);
|
||||
}
|
||||
|
||||
void Window::specialCB(int key, int x, int y)
|
||||
{
|
||||
s_theWindow->special(key,x,y);
|
||||
}
|
||||
|
||||
void Window::spaceballMotionCB(int x, int y, int z)
|
||||
{
|
||||
s_theWindow->spaceballMotion(x,y,z);
|
||||
}
|
||||
|
||||
void Window::spaceballRotateCB(int x, int y, int z)
|
||||
{
|
||||
s_theWindow->spaceballRotate(x,y,z);
|
||||
}
|
||||
|
||||
void Window::spaceballButtonCB(int button, int state)
|
||||
{
|
||||
s_theWindow->spaceballButton(button,state);
|
||||
}
|
||||
|
||||
|
||||
void Window::display()
|
||||
{
|
||||
osg::notify(osg::INFO)<<"info : Window::display() unhandled."<<endl;
|
||||
}
|
||||
|
||||
|
||||
@@ -140,16 +166,19 @@ void Window::visibility(int state)
|
||||
|
||||
void Window::mouseMotion(int , int )
|
||||
{
|
||||
osg::notify(osg::INFO)<<"info : Window::mouseMotion() unhandled."<<endl;
|
||||
}
|
||||
|
||||
|
||||
void Window::mousePassiveMotion(int , int )
|
||||
{
|
||||
osg::notify(osg::INFO)<<"info : Window::mousePassiveMotion() unhandled."<<endl;
|
||||
}
|
||||
|
||||
|
||||
void Window::mouse(int , int , int , int )
|
||||
{
|
||||
osg::notify(osg::INFO)<<"info : mouse::() unhandled."<<endl;
|
||||
}
|
||||
|
||||
|
||||
@@ -173,6 +202,28 @@ void Window::keyboard(unsigned char key, int , int )
|
||||
}
|
||||
}
|
||||
|
||||
void Window::special(int , int , int )
|
||||
{
|
||||
osg::notify(osg::INFO)<<"info : Window::special() unhandled."<<endl;
|
||||
}
|
||||
|
||||
void Window::spaceballMotion(int , int , int )
|
||||
{
|
||||
osg::notify(osg::INFO)<<"info : Window::spaceballMotion() unhandled."<<endl;
|
||||
}
|
||||
|
||||
void Window::spaceballRotate(int , int , int )
|
||||
{
|
||||
osg::notify(osg::INFO)<<"info : Window::spaceballRotate() unhandled."<<endl;
|
||||
}
|
||||
|
||||
void Window::spaceballButton(int , int )
|
||||
{
|
||||
osg::notify(osg::INFO)<<"info : Window::spaceballButton() unhandled."<<endl;
|
||||
}
|
||||
|
||||
|
||||
|
||||
bool Window::run()
|
||||
{
|
||||
if (!_is_open) {
|
||||
|
||||
Reference in New Issue
Block a user