CARB_PLUGIN_IMPL

Defined in carb/PluginUtils.h

CARB_PLUGIN_IMPL(impl, ...)

Main macro to declare a plugin implementation.

Carbonite plugins should use this macro to define boiler-plate code needed by the plugin to play nicely with Carbonite’s carb::Framework.

In particular, this macro:

This macro must be called in the global namespace. For example:

const struct carb::PluginImplDesc kPluginImpl = { "carb.windowing-glfw.plugin", "Windowing (glfw).", "NVIDIA",
                                                   carb::PluginHotReload::eDisabled, "dev" };
CARB_PLUGIN_IMPL(kPluginImpl, carb::windowing::IWindowing, carb::windowing::IGLContext)

See Framework Overview for more information on creating Carbonite plugins.

Parameters
  • impl – The carb::PluginImplDesc constant to be used as plugin description.

  • ... – One or more interface types to be implemented by the plugin. An interface is a struct with a call to CARB_PLUGIN_INTERFACE() inside it. These interface types are constructed during plugin registration (prior to the plugin startup) and destructed immediately after plugin shutdown. A global fillInterface() function must exist and will be called immediately after instantiating the interface type. The interface types need not be trivially constructed or destructed, but their constructors and destructors MUST NOT use any Carbonite framework functions.