Merged changes to DisplaySettings from Stephan Huber in prep for controlling the menu hiding behaviour under OSX.

Added new WindowSystemInterface::setDisplaySettings() method to provide a mechanism for passing settings onto the WindowSystemInterface so it can then set up the system appropriately.

Added assignment of the DisplaySettings to the WindowSystemInterface in Viewer/ComppsiteViewer::realize().
This commit is contained in:
Robert Osfield
2013-10-22 19:12:34 +00:00
parent b7b7186cf8
commit c45f3aa4fb
5 changed files with 74 additions and 15 deletions

View File

@@ -283,21 +283,29 @@ class OSG_EXPORT DisplaySettings : public osg::Referenced
/** Get the hint of the profile mask to use in when creating graphic contexts.*/
unsigned int getGLContextProfileMask() const { return _glContextProfileMask; }
void setKeystoneHint(bool enabled) { _keystoneHint = enabled; }
bool getKeystoneHint() const { return _keystoneHint; }
typedef std::vector<std::string> FileNames;
void setKeystoneFileNames(const FileNames& filenames) { _keystoneFileNames = filenames; }
FileNames& getKeystoneFileNames() { return _keystoneFileNames; }
const FileNames& getKeystoneFileNames() const { return _keystoneFileNames; }
typedef std::vector< osg::ref_ptr<osg::Object> > Objects;
void setKeystones(const Objects& objects) { _keystones = objects; }
Objects& getKeystones() { return _keystones; }
const Objects& getKeystones() const { return _keystones; }
enum OSXMenubarBehavior {
MENUBAR_AUTO_HIDE,
MENUBAR_FORCE_HIDE,
MENUBAR_FORCE_SHOW
};
OSXMenubarBehavior getOSXMenubarBehavior() const { return _OSXMenubarBehavior; }
void setOSXMenubarBehavior(OSXMenubarBehavior hint) { _OSXMenubarBehavior = hint; }
/** helper function for computing the left eye projection matrix.*/
virtual osg::Matrixd computeLeftEyeProjectionImplementation(const osg::Matrixd& projection) const;
@@ -365,11 +373,13 @@ class OSG_EXPORT DisplaySettings : public osg::Referenced
SwapMethod _swapMethod;
bool _keystoneHint;
FileNames _keystoneFileNames;
Objects _keystones;
Objects _keystones;
OSXMenubarBehavior _OSXMenubarBehavior;
};
}

View File

@@ -176,6 +176,10 @@ class OSG_EXPORT GraphicsContext : public Object
virtual void enumerateScreenSettings(const ScreenIdentifier& screenIdentifier, ScreenSettingsList & resolutionList) = 0;
virtual void setDisplaySettings(DisplaySettings*) {}
virtual osg::DisplaySettings* getDisplaySettings() const { return 0; }
virtual GraphicsContext* createGraphicsContext(Traits* traits) = 0;
virtual ~WindowingSystemInterface() {}
@@ -206,6 +210,7 @@ class OSG_EXPORT GraphicsContext : public Object
settings.refreshRate = refreshRate;
return setScreenSettings(screenIdentifier, settings);
}
};