1
0
Fork 0

add support for resizing mouse cursors

(except on OSX, where OSG uses a default)
This commit is contained in:
mfranz 2009-01-11 15:01:05 +00:00 committed by Tim Moore
parent 8605c6f33d
commit 1382c81dca
2 changed files with 26 additions and 1 deletions

View file

@ -24,7 +24,16 @@ enum { MOUSE_CURSOR_NONE,
MOUSE_CURSOR_POINTER,
MOUSE_CURSOR_WAIT,
MOUSE_CURSOR_CROSSHAIR,
MOUSE_CURSOR_LEFTRIGHT };
MOUSE_CURSOR_LEFTRIGHT,
MOUSE_CURSOR_TOPSIDE,
MOUSE_CURSOR_BOTTOMSIDE,
MOUSE_CURSOR_LEFTSIDE,
MOUSE_CURSOR_RIGHTSIDE,
MOUSE_CURSOR_TOPLEFT,
MOUSE_CURSOR_TOPRIGHT,
MOUSE_CURSOR_BOTTOMLEFT,
MOUSE_CURSOR_BOTTOMRIGHT,
};
enum { KEYMOD_NONE = 0,
KEYMOD_RELEASED = 1, // Not a mod key, indicates "up" action

View file

@ -227,6 +227,22 @@ static void setMouseCursor(osg::Camera* camera, int cursor)
mouseCursor = osgViewer::GraphicsWindow::CrosshairCursor;
else if(cursor == MOUSE_CURSOR_LEFTRIGHT)
mouseCursor = osgViewer::GraphicsWindow::LeftRightCursor;
else if(cursor == MOUSE_CURSOR_TOPSIDE)
mouseCursor = osgViewer::GraphicsWindow::TopSideCursor;
else if(cursor == MOUSE_CURSOR_BOTTOMSIDE)
mouseCursor = osgViewer::GraphicsWindow::BottomSideCursor;
else if(cursor == MOUSE_CURSOR_LEFTSIDE)
mouseCursor = osgViewer::GraphicsWindow::LeftSideCursor;
else if(cursor == MOUSE_CURSOR_RIGHTSIDE)
mouseCursor = osgViewer::GraphicsWindow::RightSideCursor;
else if(cursor == MOUSE_CURSOR_TOPLEFT)
mouseCursor = osgViewer::GraphicsWindow::TopLeftCorner;
else if(cursor == MOUSE_CURSOR_TOPRIGHT)
mouseCursor = osgViewer::GraphicsWindow::TopRightCorner;
else if(cursor == MOUSE_CURSOR_BOTTOMLEFT)
mouseCursor = osgViewer::GraphicsWindow::BottomLeftCorner;
else if(cursor == MOUSE_CURSOR_BOTTOMRIGHT)
mouseCursor = osgViewer::GraphicsWindow::BottomRightCorner;
gw->setCursor(mouseCursor);
}