Polyphase Game Engine
Loading...
Searching...
No Matches
RuntimePluginManager.h File Reference

Lightweight plugin manager for runtime (non-editor) builds. More...

#include "PolyphasePluginAPI.h"
#include "PolyphaseEngineAPI.h"
#include <vector>
#include <string>

Go to the source code of this file.

Classes

struct  RuntimePluginState
 Runtime state for a registered plugin. More...
 
class  RuntimePluginManager
 Singleton manager for runtime plugins. More...
 

Macros

#define POLYPHASE_REGISTER_PLUGIN(pluginId, getDescFunc)
 Helper macro for static plugin registration.
 

Functions

void QueuePluginRegistration (int(*getDescFunc)(PolyphasePluginDesc *), const char *pluginId)
 Queue a plugin descriptor for registration.
 

Detailed Description

Lightweight plugin manager for runtime (non-editor) builds.

This manager handles plugins that are compiled directly into the game. Unlike NativeAddonManager (editor-only), this doesn't handle building or hot-reloading - it just manages the plugin lifecycle and ticking.

Macro Definition Documentation

◆ POLYPHASE_REGISTER_PLUGIN

#define POLYPHASE_REGISTER_PLUGIN (   pluginId,
  getDescFunc 
)
Value:
namespace { \
struct PluginRegistrar_##pluginId { \
PluginRegistrar_##pluginId() { \
QueuePluginRegistration(getDescFunc, #pluginId); \
} \
}; \
static PluginRegistrar_##pluginId sRegistrar_##pluginId; \
}

Helper macro for static plugin registration.

Usage in plugin source file: POLYPHASE_REGISTER_PLUGIN(MyPlugin, GetMyPluginDesc);

Where GetMyPluginDesc is a function that fills in PolyphasePluginDesc.

Function Documentation

◆ QueuePluginRegistration()

void QueuePluginRegistration ( int(*)(PolyphasePluginDesc *)  getDescFunc,
const char *  pluginId 
)

Queue a plugin descriptor for registration.

This can be called before RuntimePluginManager::Create() - the descriptors are stored in a pending queue and processed when Create() is called.

Parameters
getDescFuncFunction that fills in PolyphasePluginDesc
pluginIdUnique identifier for the plugin