3DRadSpace 0.1.0Alpha
3DRadSpace is a free, simple to use, rapid application development game engine.
Loading...
Searching...
No Matches
Engine3DRadSpace::Plugins Namespace Reference

Classes

struct  PluginInfo
 Plugin information. More...
class  PluginManager

Typedefs

typedef E3DRSP_RawSpan(* LoadCustomObjects) (void)
 Returns a span of ReflectedObject references that contain custom object reflection data.
typedef void *(* ObjectCustomWindow) (void *hwnd, void *hInstance, void *reflectionData, void *contentManager, void *object)
 The function signature for the function that creates a custom window for editing a custom object in the editor.
typedef PluginInfo(* LoadPluginInfo) ()
 Returns plugin base information.
typedef bool(* PluginMain) ()
 Entry base function for a 3DRadSpace plugin.
typedef bool(* PluginUnload) ()
 Called when unloading the plugin.

Enumerations

enum class  PluginLoadingError { UnableToLoadPluginLibrary , NotA3DRadSpacePlugin , InitializationFunctionFailure }
 Error when attempted to load a 3DRadSpace plugin. More...

Functions

size_t E3DRSP_PLUGINS_EXPORT LoadCustomObjectsFromLibHandle (void *libraryHandle)
 Loads custom objects from a library handle for the editor.
std::expected< std::pair< PluginInfo, void * >, PluginLoadingError > E3DRSP_PLUGINS_EXPORT LoadPlugin (const std::filesystem::path &pluginPath)
 Loads a plugin for the editor.

Typedef Documentation

◆ LoadCustomObjects

typedef E3DRSP_RawSpan(* Engine3DRadSpace::Plugins::LoadCustomObjects) (void)

Returns a span of ReflectedObject references that contain custom object reflection data.

◆ LoadPluginInfo

typedef PluginInfo(* Engine3DRadSpace::Plugins::LoadPluginInfo) ()

Returns plugin base information.

Returns
Plugin information.

◆ ObjectCustomWindow

typedef void *(* Engine3DRadSpace::Plugins::ObjectCustomWindow) (void *hwnd, void *hInstance, void *reflectionData, void *contentManager, void *object)

The function signature for the function that creates a custom window for editing a custom object in the editor.

Returns a pointer to the new or updated object.

The arguments are:

An analogue for the default implementation would be EditObjectDialog(...).ShowDialog().

◆ PluginMain

typedef bool(* Engine3DRadSpace::Plugins::PluginMain) ()

Entry base function for a 3DRadSpace plugin.

Returns
True if succeded.

When called, PluginMain has to:

  • Load resources related to the plugin itself, such as images, windows..., etc. Meaning that it is safe to create windows, display messages boxes here, unline Windows's in DllMain.
  • Define new asset types, if any
  • Optionally find the editor window, and apply modifications and hooks. If failed, return false, then call Logging::SetLastError() to report the failure.

◆ PluginUnload

typedef bool(* Engine3DRadSpace::Plugins::PluginUnload) ()

Called when unloading the plugin.

Returns
True if succeded.

Enumeration Type Documentation

◆ PluginLoadingError

Error when attempted to load a 3DRadSpace plugin.

Enumerator
UnableToLoadPluginLibrary 

Returned if the library module coudln't be loaded.

NotA3DRadSpacePlugin 

Returned if the loaded library/DLL doesn't have the LoadPluginInfo() or PluginMain() functions.

InitializationFunctionFailure 

PluginMain() was called, but it returned false.

Function Documentation

◆ LoadCustomObjectsFromLibHandle()

size_t Engine3DRadSpace::Plugins::LoadCustomObjectsFromLibHandle ( void * libraryHandle)

Loads custom objects from a library handle for the editor.

Returns
The number of custom objects loaded.
Parameters
libraryHandleHMODULE in Windows, void* in Linux

◆ LoadPlugin()

std::expected< std::pair< PluginInfo, void * >, PluginLoadingError > Engine3DRadSpace::Plugins::LoadPlugin ( const std::filesystem::path & pluginPath)

Loads a plugin for the editor.

Returns
Plugin information + libray handle if succeded, or a PluginLoadingError enum value.
Parameters
pluginPathPath to plugin library file