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.
Important
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.
Warning
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 | |
|---|---|---|
| Constructor |
Creates a renderer plugin enumerator.
|
|
| Destructor |
Clears all loaded plugin entries and releases module handles.
|
Plugin methods
| Name | Description | |
|---|---|---|
| EnumeratePluginsInDirectory |
Searches a directory for renderer plugin libraries.
|
|
| AddPluginByPath |
Loads one plugin library and adds all renderer implementations it exports.
|
|
| GetAllPlugins |
Returns all loaded renderer plugins.
|
|
| GetFilteredPlugins |
Returns the plugins remaining after filters have been applied.
|
|
| GetPreferredPlugin |
Returns the preferred plugin from the filtered set.
|
|
| ClearAllPlugins |
Clears every loaded plugin and releases their module handles.
|
Filtering methods
| Name | Description | |
|---|---|---|
| FilterPlugin |
Removes a specific plugin from the filtered set.
|
|
| FilterPluginsOfFamily |
Removes plugins of a specific API family from the filtered set.
|
|
| FilterPluginsNotOfFamily |
Removes plugins that are not of a specific API family from the filtered set.
|
|
| FilterPluginsOfFamilyBelowVersion |
Removes plugins of a family below a required API version.
|
|
| ClearPluginFilters |
Restores the filtered set to all loaded plugins.
|
Helper methods
| Name | Description | |
|---|---|---|
| GetProcessDirectory |
Returns the directory containing the current executable.
|