Class SoGLDeviceSettings

java.lang.Object
com.openinventor.inventor.Inventor
com.openinventor.inventor.devices.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:
  • Method Details

    • getParameterCount

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

      public boolean setSettingName(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 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(String pParameterId, 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 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 String getParameter(String pParameterId)
      Returns current value of specified parameter in current setting. The value is converted to a string.
    • getSettingNameByIndex

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