Class SoGLDeviceSettings


  • public class SoGLDeviceSettings
    extends Inventor
    Device settings management class. This class provides functions to query and modify information about OpenGL device settings. A setting is a vendor defined collection of device dependent parameters like "Stereo - Enable", "Antialiasing ? Mode" or "Vertical Sync". NVIDIA calls this a "driver profile". Parameters can be set as a group using setSettingName(), with a predefined name, or one by one using setParameter(). Applications should only create an SoDeviceSettings object using the SoGLDevice method getDeviceSettings() (see below).

    Device settings should be changed before any rendering is done, i.e. before the OpenGL render context is created.

    Setting and parameter changes do not take effect until applySettings() is called.

    Changes should only affect the current running application (but this may depend on the graphics board vendor and driver installed).

    The settings and parameters that can be queried through this interface may not correspond to the parameters displayed by the graphics board vendor's "control panel" application. This depends on the vendor and the driver installed.

    EXAMPLE

    Set a predefined driver setting (profile) for an NVIDIA graphics board.

     SoGLDevice gldevice = SoGLDevice.getDevice( 0 );
     SoGLDeviceSettings devSettings = gldevice.getDeviceSettings();
     if (devSettings != null) {
       devSettings.setSettingName( "Workstation App - Dynamic Streaming" );
       devSettings.applySettings();
     }

    See Also:
    SoGLDevice
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      boolean applySettings()
      Apply changes to the setting and/or parameters.
      java.lang.String getParameter​(java.lang.String pParameterId)
      Returns current value of specified parameter in current setting.
      int getParameterCount()
      Returns number of parameters in current setting.
      java.lang.String getParameterIdbyIndex​(int index)
      Returns the name of the parameter with the specified index in the current setting.
      java.lang.String getSettingName()
      Returns the name of the current setting (vendor defined list of parameters).
      java.lang.String getSettingNameByIndex​(int index)
      Returns the name of the specified setting.
      int getSettingsCount()
      Returns the number of vendor defined settings.
      boolean setParameter​(java.lang.String pParameterId, java.lang.String pParameterValue)
      Set the value of a parameter in the current setting.
      boolean setSettingName​(java.lang.String pPredefinedSettingName)
      Set a setting (vendor defined list of parameters) by name.
      • Methods inherited from class java.lang.Object

        equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Method Detail

      • getParameterCount

        public int getParameterCount()
        Returns number of parameters in current setting.
      • setSettingName

        public boolean setSettingName​(java.lang.String pPredefinedSettingName)
        Set a setting (vendor defined list of parameters) by name. See getSettingsCount and getSettingNameByIndex to retrieved predefined list of settings.

        Returns:
        true if success, false otherwise

      • getParameterIdbyIndex

        public java.lang.String getParameterIdbyIndex​(int index)
        Returns the name of the parameter with the specified index in the current setting. Use getParameterCount() to get the number of parameters in the current setting. For example "Ambient Occlusion", "Anisotropic filtering mode", "Anisotropic filtering setting", "Antialiasing - Behavior Flags", "Preferred OpenGL GPU", etc.
      • setParameter

        public boolean setParameter​(java.lang.String pParameterId,
                                    java.lang.String pParameterValue)
        Set the value of a parameter in the current setting.

        Returns:
        true if success, false otherwise

      • getSettingsCount

        public int getSettingsCount()
        Returns the number of vendor defined settings. Depends on the graphics board and driver version.
      • getSettingName

        public java.lang.String getSettingName()
        Returns the name of the current setting (vendor defined list of parameters).
      • applySettings

        public boolean applySettings()
        Apply changes to the setting and/or parameters.
      • getParameter

        public java.lang.String getParameter​(java.lang.String pParameterId)
        Returns current value of specified parameter in current setting. The value is converted to a string.
      • getSettingNameByIndex

        public java.lang.String getSettingNameByIndex​(int index)
        Returns the name of the specified setting. See getSettingsCount to get the number of settings available.