Functions for creating and controlling engine native extension libraries.
Namespace: | dmExtension |
Include: | #include <dmsdk/extension/extension_gen.hpp> |
TYPES | |
---|---|
FCallback | Extra extension callback typedef |
FExtensionAppInitialize | Callback when the app is being initialized. Called... |
FExtensionCallback | Extra extension callback typedef |
FExtensionFinalize | Calls for the finalization of an extension |
FExtensionInitialize | Callback when the app is being finalized |
FExtensionInitialize | Callback when the app is being finalized |
FExtensionOnEvent | Receives an event from the engine |
FExtensionUpdate | Updates an extension. Called for each game frame. |
ENUMS | |
---|---|
CallbackType | extra callback type |
EventID | event id enumeration |
ExtensionCallbackType | extra callback type |
ExtensionEventID | event id enumeration |
ExtensionResult | result enumeration |
Result | result enumeration |
STRUCTS | |
---|---|
struct ExtensionParams | The global parameters avalable when registering an... |
struct Params | The global parameters avalable when registering an... |
FUNCTIONS | |
---|---|
void ExtensionDescBufferSize() | Used when registering new extensions |
void ExtensionRegister(void* desc, const char* desc_size, const char* name, FExtensionAppInitialize app_initialize, FExtensionAppFinalize app_finalize, FExtensionInitialize initialize, FExtensionFinalize finalize, FExtensionUpdate update, FExtensionOnEvent on_event) | Extension declaration helper. Internal function. U... |
void ExtensionRegisteriOSUIApplicationDelegate(id |
Register application delegate |
void ExtensionUnregisteriOSUIApplicationDelegate(void* delegate) | Unregister an application delegate |
void RegisteriOSUIApplicationDelegate(id |
Register application delegate |
void UnregisteriOSUIApplicationDelegate(void* delegate) | Unregister an application delegate |
MACROS | |
---|---|
DM_DECLARE_EXTENSION() | declare a new extension |
DM_PLATFORM_ANDROID() | Set if the platform is Android |
DM_PLATFORM_HTML5() | Set if the platform is Html5 |
DM_PLATFORM_IOS() | Set if the platform is iPhoneOS |
DM_PLATFORM_LINUX() | Set if the platform is Linux |
DM_PLATFORM_OSX() | Set if the platform is OSX |
DM_PLATFORM_WINDOWS() | Set if the platform is Windows (on both x86 and x86_64) |
void ExtensionDescBufferSize()
Used when registering new extensions
PARAMETERS
void ExtensionRegister(void* desc, const char* desc_size, const char* name, FExtensionAppInitialize app_initialize, FExtensionAppFinalize app_finalize, FExtensionInitialize initialize, FExtensionFinalize finalize, FExtensionUpdate update, FExtensionOnEvent on_event)
Extension declaration helper. Internal function. Use DM_DECLARE_EXTENSION
PARAMETERS
void* |
desc |
A persistent buffer of at least 128 bytes. |
const char* |
desc_size |
size of buffer holding desc. in bytes |
const char* |
name |
extension name. human readble. max 16 characters long. |
FExtensionAppInitialize |
app_initialize |
app-init function. May be null |
FExtensionAppFinalize |
app_finalize |
app-final function. May be null |
FExtensionInitialize |
initialize |
init function. May not be 0 |
FExtensionFinalize |
finalize |
finalize function. May not be 0 |
FExtensionUpdate |
update |
update function. May be null |
FExtensionOnEvent |
on_event |
event callback function. May be null |
void ExtensionRegisteriOSUIApplicationDelegate(id
Register an iOS application delegate to the engine. Multiple delegates are supported (Max 32)
PARAMETERS
id |
delegate |
An UIApplicationDelegate, see: https://developer.apple.com/documentation/uikit/uiapplicationdelegate?language=objc |
EXAMPLES
```objective-c // myextension_ios.mm idvoid ExtensionUnregisteriOSUIApplicationDelegate(void* delegate)
Deregister a previously registered iOS application delegate This function is only available on iOS.
PARAMETERS
void* |
delegate |
an id |
void RegisteriOSUIApplicationDelegate(id
Register an iOS application delegate to the engine. Multiple delegates are supported (Max 32)
PARAMETERS
id |
delegate |
An UIApplicationDelegate, see: https://developer.apple.com/documentation/uikit/uiapplicationdelegate?language=objc |
EXAMPLES
```objective-c // myextension_ios.mm idvoid UnregisteriOSUIApplicationDelegate(void* delegate)
Deregister a previously registered iOS application delegate This function is only available on iOS.
PARAMETERS
void* |
delegate |
an id |
TYPE
struct ExtensionParams
The global parameters avalable when registering and unregistering an extensioin
MEMBERS
HConfigFile |
m_ConfigFile |
The game project settings (including overrides and plugins) |
HResourceFactory |
m_ResourceFactory |
The game resource factory / repository |
lua_State* |
m_L |
The Lua state. |
TYPE
struct Params
The global parameters avalable when registering and unregistering an extensioin
MEMBERS
HConfigFile |
m_ConfigFile |
The game project settings (including overrides and plugins) |
HResourceFactory |
m_ResourceFactory |
The game resource factory / repository |
lua_State* |
m_L |
The Lua state. |
Callback typedef for functions passed to RegisterCallback().
Callback when the app is being initialized. Called before FExtensionInitialize
Callback typedef for functions passed to RegisterCallback().
Calls for the finalization of an extension
Callback when the app is being finalized
Callback when the app is being finalized
Receives an event from the engine
Updates an extension. Called for each game frame.
Extra callback type for RegisterCallback function.
EXTENSION_CALLBACK_PRE_RENDER |
|
EXTENSION_CALLBACK_POST_RENDER |
Event id enumeration. EVENT_ID_ICONIFYAPP and EVENT_ID_DEICONIFYAPP only available on
EXTENSION_EVENT_ID_ACTIVATEAPP |
|
EXTENSION_EVENT_ID_DEACTIVATEAPP |
|
EXTENSION_EVENT_ID_ICONIFYAPP |
|
EXTENSION_EVENT_ID_DEICONIFYAPP |
|
EXTENSION_EVENT_ID_ENGINE_INITIALIZED |
|
EXTENSION_EVENT_ID_ENGINE_DELETE |
Extra callback type for RegisterCallback function.
EXTENSION_CALLBACK_PRE_RENDER |
|
EXTENSION_CALLBACK_POST_RENDER |
Event id enumeration. EVENT_ID_ICONIFYAPP and EVENT_ID_DEICONIFYAPP only available on
EXTENSION_EVENT_ID_ACTIVATEAPP |
|
EXTENSION_EVENT_ID_DEACTIVATEAPP |
|
EXTENSION_EVENT_ID_ICONIFYAPP |
|
EXTENSION_EVENT_ID_DEICONIFYAPP |
|
EXTENSION_EVENT_ID_ENGINE_INITIALIZED |
|
EXTENSION_EVENT_ID_ENGINE_DELETE |
Result enumeration.
EXTENSION_RESULT_OK |
|
EXTENSION_RESULT_INIT_ERROR |
Result enumeration.
EXTENSION_RESULT_OK |
|
EXTENSION_RESULT_INIT_ERROR |
Declare and register new extension to the engine. This macro is used to declare the extension callback functions used by the engine to communicate with the extension.
EXAMPLES
Register a new extension:DM_DECLARE_EXTENSION(MyExt, "MyExt", AppInitializeMyExt, AppFinalizeMyExt, InitializeMyExt, UpdateMyExt, OnEventMyExt, FinalizeMyExt);
Set if the platform is Android
Set if the platform is Html5
Set if the platform is iPhoneOS
Set if the platform is Linux
Set if the platform is OSX
Set if the platform is Windows (on both x86 and x86_64)