Extension

Functions for creating and controlling engine native extension libraries.

dmExtension::Result

result enumeration

Result enumeration.

MEMBERS

dmExtension::RESULT_OK -

dmExtension::RESULT_INIT_ERROR -


dmExtension::AppParams()

application level callback data

Extension application entry callback data. This is the data structure passed as parameter by extension Application entry callbacks (AppInit and AppFinalize) functions

MEMBERS

m_ConfigFile -

m_WebServer - Only valid in debug builds, where the engine service is running. 0 otherwise.


dmExtension::Params()

extension level callback data

Extension callback data. This is the data structure passed as parameter by extension callbacks (Init, Finalize, Update, OnEvent)

MEMBERS

m_ConfigFile - the config file

m_ResourceFactory - the resource factory

m_L - the lua state


dmExtension::EventID

event id enumeration

Event id enumeration. EVENT_ID_ICONIFYAPP and EVENT_ID_DEICONIFYAPP only available on

MEMBERS

dmExtension::EVENT_ID_ACTIVATEAPP -

dmExtension::EVENT_ID_DEACTIVATEAPP -

dmExtension::EVENT_ID_ICONIFYAPP -

dmExtension::EVENT_ID_DEICONIFYAPP -


dmExtension::CallbackType

extra callback enumeration

Extra callback enumeration for RegisterCallback function.

MEMBERS

dmExtension::CALLBACK_PRE_RENDER -

dmExtension::CALLBACK_POST_RENDER -


dmExtension::Event()

event callback data

Extension event callback data. This is the data structure passed as parameter by extension event callbacks (OnEvent)

MEMBERS

m_Event -


extension_callback_t

Extra extension callback typedef

Callback typedef for functions passed to RegisterCallback().

PARAMETERS

params -

RETURN

-


RegisterCallback(callback_type, func)

Register extra extension callbacks.

Register extra extension callbacks.

PARAMETERS

callback_type - Callback type enum

func - Function to register as callback

RETURN

- Returns true if successfully registered the function, false otherwise.


DM_DECLARE_EXTENSION

declare a new extension

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.

PARAMETERS

symbol - external extension symbol description (no quotes).

name - extension name. Human readable.

appinit - app-init function. May be null.

app_params
dmExtension::AppParams* Pointer to an AppParams structure.

appfinal - app-final function. May be null.

app_params
dmExtension::AppParams* Pointer to an AppParams structure.

init - init function. May not be null.

params
dmExtension::Params* Pointer to a Params structure

update - update function. May be null.

params
dmExtension::Params* Pointer to a Params structure

on_event - event callback function. May be null.

params
dmExtension::Params* Pointer to a Params structure
event
dmExtension::Event* const Pointer to an Event structure

final - function. May not be null.

params
dmExtension::Params* Pointer to an Params structure.

EXAMPLES

Register a new extension:

DM_DECLARE_EXTENSION(MyExt, "MyExt", AppInitializeMyExt, AppFinalizeMyExt, InitializeMyExt, UpdateMyExt, OnEventMyExt, FinalizeMyExt);


RegisteriOSUIApplicationDelegate(delegate)

Register application delegate

Register an iOS application delegate to the engine. Multiple delegates are supported (Max 32)

PARAMETERS

delegate - An UIApplicationDelegate, see: https://developer.apple.com/documentation/uikit/uiapplicationdelegate?language=objc

EXAMPLES

```objective-c // myextension_ios.mm id g_MyApplicationDelegate;


UnregisteriOSUIApplicationDelegate(delegate)

Unregister an application delegate

Deregister a previously registered iOS application delegate This function is only available on iOS.

PARAMETERS

delegate - an id


DM_PLATFORM_IOS

Set if the platform is iPhoneOS

Set if the platform is iPhoneOS


DM_PLATFORM_ANDROID

Set if the platform is Android

Set if the platform is Android


DM_PLATFORM_HTML5

Set if the platform is Html5

Set if the platform is Html5


DM_PLATFORM_OSX

Set if the platform is OSX

Set if the platform is OSX


DM_PLATFORM_LINUX

Set if the platform is Linux

Set if the platform is Linux


DM_PLATFORM_WINDOWS

Set if the platform is Windows (on both x86 and x86_64)

Set if the platform is Windows (on both x86 and x86_64)