From 06e03103147119c3a2dc67a7a3d8b2ae028121af Mon Sep 17 00:00:00 2001 From: Robert Osfield Date: Thu, 17 Jan 2002 22:40:16 +0000 Subject: [PATCH] Added support for glutSpecialFunc, glutSpaceballMotion, glutSpaceballRotate and glutSpaceballRotate into osgGLUT::Window base class. --- include/osgGLUT/Window | 11 +++++++++ src/osgGLUT/Window.cpp | 51 ++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 62 insertions(+) diff --git a/include/osgGLUT/Window b/include/osgGLUT/Window index 31363291d..53e0ce98c 100644 --- a/include/osgGLUT/Window +++ b/include/osgGLUT/Window @@ -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; diff --git a/src/osgGLUT/Window.cpp b/src/osgGLUT/Window.cpp index b8d2591bd..e7eb2c931 100644 --- a/src/osgGLUT/Window.cpp +++ b/src/osgGLUT/Window.cpp @@ -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."<