CARB_PLUGIN_IMPL#

Defined in carb/PluginUtils.h

CARB_PLUGIN_IMPL(impl, ...)#

Main macro to declare a plugin implementation where multiple interface versions are not required.

Authors of Carbonite plugins must use this macro in exactly one compilation unit for their plugin to generate code expected by the Carbonite framework.

In particular, this macro:

This macro must be used in the global namespace. A carb::PluginImplDesc must be provided as well as all interfaces exported by this plugin. Each interface must be declared with CARB_PLUGIN_INTERFACE. There must also exist a fillInterface(InterfaceType&) function for each interface type that is exported by this plugin. A trailing semicolon is optional.

Example:

// Plugin Implementation Descriptor
const carb::PluginImplDesc kPluginImpl{ "carb.windowing-glfw.plugin", "Windowing (glfw).", "NVIDIA",
                                         carb::PluginHotReload::eDisabled, "dev" };

// Generate boilerplate code
CARB_PLUGIN_IMPL(kPluginImpl, carb::windowing::IWindowing, carb::windowing::IGLContext)

// Construct the carb::windowing::IWindowing interface
void fillInterface(carb::windowing::IWindowing& iface) { /* ... */ }

// Construct the carb::windowing::IGLContext interface
void fillInterface(carb::windowing::IGLContext& iface) { /* ... */ }

See Framework Overview and Carbonite Interfaces for more information on creating Carbonite plugins.

Note

Carbonite plugins can provide multiple versions of an interface to remain backwards compatible with apps and modules that are built against earlier versions of plugins. In order to do this, see CARB_PLUGIN_IMPL_EX.

Parameters: