Added support for getting all windows and hiding the cursor

This commit is contained in:
Robert Osfield
2007-01-02 12:50:57 +00:00
parent db7df9d6d4
commit d068f7025a
7 changed files with 88 additions and 17 deletions

View File

@@ -51,6 +51,9 @@ class OSGVIEWER_EXPORT GraphicsWindow : public osg::GraphicsContext, public osgG
/** Get focus on if the pointer is in this window.*/
virtual void grabFocusIfPointerInWindow() {}
/** Switch on/off the cursor.*/
virtual void useCursor(bool /*cursorOn*/) {}
public:
/** Realise the GraphicsContext implementation,

View File

@@ -89,6 +89,21 @@ class GraphicsWindowX11 : public osgViewer::GraphicsWindow
// Override from GUIActionAdapter
virtual void requestWarpPointer(float x,float y);
/** Switch on/off the cursor.*/
virtual void useCursor(bool cursorOn);
public:
// X11 specific aces functions
Display* getDisplay() { return _display; }
Window& getParent() { return _parent; }
Window& getWindow() { return _window; }
Cursor& getDefaultCursor() { return _defaultCursor; }
Cursor& getNullCursor() { return _nullCursor; }
Cursor& getCurrentCursor() { return _nullCursor; }
protected:
bool createVisualInfo();

View File

@@ -58,13 +58,16 @@ class OSGVIEWER_EXPORT Viewer : public osgViewer::View
osg::Camera* getCameraWithFocus() { return _cameraWithFocus.get(); }
const osg::Camera* getCameraWithFocus() const { return _cameraWithFocus.get(); }
typedef std::vector<osg::GraphicsContext*> Contexts;
void getContexts(Contexts& contexts);
typedef std::vector<osgViewer::GraphicsWindow*> Windows;
void getWindows(Windows& windows);
public:
void init();
typedef std::vector<osg::GraphicsContext*> Contexts;
void getContexts(Contexts& contexts);
bool _firstFrame;
bool _done;