## Public API Reference

- Main Page
- Modules
- Namespaces
- Classes
- Files
- Related Pages

- Alphabetical List
- Class List
- Class Hierarchy
- Class Members

# iOpenGLDriverDatabase Struct Reference

Interface to read custom GL driver databases. More...

`#include <csplugincommon/iopengl/driverdb.h>`

Inheritance diagram for iOpenGLDriverDatabase:

[legend]
List of all members.

## Public Member Functions

void | ReadDatabase (iDocumentNode *dbRoot, int configPriority=iConfigManager::ConfigPriorityPlugin+20, const char *phase=0)
| Read a custom driver database.

## Detailed Description

Interface to read custom GL driver databases.

While in a perfect world the rendering would behave, succeed and fail on every OpenGL implementation the same way, the actual reality requires working around quirks and problems in OpenGL drivers and versions thereof. CS provides the so-called "driver database" (`/config/glshader.xml`) which contains configuration settings to work around known issues for certain drivers. It contains settings that are suitable an out-of-the-box Crystal Space; however, if an application employs advanced renderer features (such as complex custom shaders), it may be desireable to provide driver-dependent tweaks for this custom content as well. For this purpose this interface is provided.

Remarks:
  If you wanted to load CS' own driver database with this interface, the following code fragment will give you a rough idea on how to achieve that:

       csRef<iOpenGLDriverDatabase> driverDB =
        scfQueryInterface<iOpenGLDriverDatabase> (graphics2D);
       if (driverDB.IsValid())
       {
         csRef<iFile> dbFile = VFS->Open ("/config/gldrivers.xml", VFS_FILE_READ);
         csRef<iDocument> dbDocument = documentSystem->CreateDocument();
         dbDocument->Parse();
         csRef<iDocumentNode> dbRoot = doc->GetRoot()->GetNode ("gldriverdb");
         driverDB->ReadDatabase (dbRoot);
       }

Definition at line 59 of file driverdb.h.

## Member Function Documentation

void iOpenGLDriverDatabase::ReadDatabase | ( | iDocumentNode * | dbRoot,
|  | int | configPriority = `iConfigManager::ConfigPriorityPlugin+20`,
|  | const char * | phase = `0`
| ) |

Read a custom driver database.

Parameters:

  | dbRoot | Document node containing the `<configs>` and `<rules>` nodes required by the driver DB as children.
  | configPriority | Priority with which the individual tweaks are added to the configuration manager.
  | phase | Simple rule filter; only rules whose "phase" attribute match this string are considered. 0 and an empty string are equivalent.

Reimplemented in csGraphics2DGLCommon.

The documentation for this struct was generated from the following file:

- csplugincommon/iopengl/driverdb.h