Home -> PlatformBindings -> RenderPluginEnumerator

Declaration

class RenderPluginEnumerator;

Description

The RenderPluginEnumerator class is a C++17 helper for loading renderer plugin libraries, checking their exported GetCobaltAPIVersion function, retrieving RendererPlugin values from the exported GetRendererPlugin function, filtering the discovered renderers, and selecting a preferred renderer.

Availability: This helper is included by PlatformBindings.pkg only for C++17 or newer builds. It uses Win32 dynamic library APIs on Windows and POSIX dlopen APIs on Linux and macOS.

ImportantImportant

The enumerator owns module handles for every loaded renderer plugin. Returned RendererPlugin values share ownership of those modules, so they remain valid as long as any copy of the returned object exists.

WarningWarning

Keep the selected RendererPlugin object alive while using objects created by the selected plugin. Copies of the object share ownership of the loaded module, so any copy is sufficient.

Members

Constructors

Name Description
Public member Constructor
Creates a renderer plugin enumerator.
Public member Destructor
Clears all loaded plugin entries and releases module handles.

Plugin methods

Name Description
Public member EnumeratePluginsInDirectory
Searches a directory for renderer plugin libraries.
Public member AddPluginByPath
Loads one plugin library and adds all renderer implementations it exports.
Public member GetAllPlugins
Returns all loaded renderer plugins.
Public member GetFilteredPlugins
Returns the plugins remaining after filters have been applied.
Public member GetPreferredPlugin
Returns the preferred plugin from the filtered set.
Public member ClearAllPlugins
Clears every loaded plugin and releases their module handles.

Filtering methods

Name Description
Public member FilterPlugin
Removes a specific plugin from the filtered set.
Public member FilterPluginsOfFamily
Removes plugins of a specific API family from the filtered set.
Public member FilterPluginsNotOfFamily
Removes plugins that are not of a specific API family from the filtered set.
Public member FilterPluginsOfFamilyBelowVersion
Removes plugins of a family below a required API version.
Public member ClearPluginFilters
Restores the filtered set to all loaded plugins.

Helper methods

Name Description
Public member GetProcessDirectory
Returns the directory containing the current executable.

See also