Extension

Namespace: dmExtension Language: C++ Type: Defold C++ File: extension_gen.hpp Source: engine/extension/src/dmsdk/extension/extension_gen.hpp Include: dmsdk/extension/extension_gen.hpp

Functions for creating and controlling engine native extension libraries.

API

AppExitCode

Type: ENUM Engine exit code.

Members

AppParams

Type: STRUCT The extension app parameters

Members

AppParamsFinalize

Type: FUNCTION Finalizes an extension app params struct (deallocates internal memory)

Parameters

AppParamsGetAppExitCode

Type: FUNCTION get the app exit code

Parameters

Returns

AppParamsGetContext

Type: FUNCTION Gets a context using a specified name hash

Parameters

Returns

AppParamsGetContextByName

Type: FUNCTION Gets a context using a specified name

Parameters

Returns

AppParamsInitialize

Type: FUNCTION Initializes an extension app params struct NOTE: this is an opaque struct, do not use it’s members directly!

Parameters

AppParamsSetContext

Type: FUNCTION Sets a context using a specified name

Parameters

Returns

CallbackType

Type: ENUM Extra callback type for RegisterCallback function.

Members

DM_DECLARE_EXTENSION

Type: MACRO 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);

DM_PLATFORM_ANDROID

Type: MACRO Set if the platform is Android

DM_PLATFORM_HTML5

Type: MACRO Set if the platform is Html5

DM_PLATFORM_IOS

Type: MACRO Set if the platform is iPhoneOS

DM_PLATFORM_LINUX

Type: MACRO Set if the platform is Linux

DM_PLATFORM_OSX

Type: MACRO Set if the platform is OSX

DM_PLATFORM_WINDOWS

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

Event

Type: STRUCT Extension event

EventID

Type: ENUM Event id enumeration. EVENT_ID_ICONIFYAPP and EVENT_ID_DEICONIFYAPP only available on

Members

ExtensionAppExitCode

Type: ENUM Engine exit code.

Members

ExtensionAppParams

Type: STRUCT The extension app parameters

Members

ExtensionAppParamsFinalize

Type: FUNCTION Finalizes an extension app params struct (deallocates internal memory)

Parameters

ExtensionAppParamsGetAppExitCode

Type: FUNCTION get the app exit code

Parameters

Returns

ExtensionAppParamsGetContext

Type: FUNCTION Gets a context using a specified name hash

Parameters

Returns

ExtensionAppParamsGetContextByName

Type: FUNCTION Gets a context using a specified name

Parameters

Returns

ExtensionAppParamsInitialize

Type: FUNCTION Initializes an extension app params struct NOTE: this is an opaque struct, do not use it’s members directly!

Parameters

ExtensionAppParamsSetContext

Type: FUNCTION Sets a context using a specified name

Parameters

Returns

ExtensionCallbackType

Type: ENUM Extra callback type for RegisterCallback function.

Members

ExtensionDescBufferSize

Type: FUNCTION Used when registering new extensions

ExtensionEvent

Type: STRUCT Extension event

ExtensionEventID

Type: ENUM Event id enumeration. EVENT_ID_ICONIFYAPP and EVENT_ID_DEICONIFYAPP only available on

Members

ExtensionParams

Type: STRUCT The global parameters avalable when registering and unregistering an extension

Members

ExtensionParamsFinalize

Type: FUNCTION Finalizes an extension params struct (deallocates internal memory)

Parameters

ExtensionParamsGetContext

Type: FUNCTION Gets a context using a specified name hash

Parameters

Returns

ExtensionParamsGetContextByName

Type: FUNCTION Gets a context using a specified name

Parameters

Returns

ExtensionParamsInitialize

Type: FUNCTION Initializes an extension params struct NOTE: this is an opaque struct, do not use it’s members directly!

Parameters

ExtensionParamsSetContext

Type: FUNCTION Sets a context using a specified name

Parameters

Returns

ExtensionRegister

Type: FUNCTION Extension declaration helper. Internal function. Use DM_DECLARE_EXTENSION

Parameters

ExtensionRegisteriOSUIApplicationDelegate

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

Notes

This function is only available on iOS. [icon:ios]

Parameters

Examples

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

ExtensionResult

Type: ENUM Result enumeration.

Members

ExtensionUnregisteriOSUIApplicationDelegate

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

Parameters

FCallback

Type: TYPEDEF Callback typedef for functions passed to RegisterCallback().

Parameters

Returns

FExtensionAppFinalize

Type: TYPEDEF Callback when the app is being finalized

Parameters

Returns

FExtensionAppInitialize

Type: TYPEDEF Callback when the app is being initialized. Called before FExtensionInitialize

Notes

Parameters

Returns

FExtensionCallback

Type: TYPEDEF Callback typedef for functions passed to RegisterCallback().

Parameters

Returns

FExtensionFinalize

Type: TYPEDEF Calls for the finalization of an extension

Notes

Parameters

Returns

FExtensionInitialize

Type: TYPEDEF Callback when the app is being finalized

Parameters

Returns

FExtensionOnEvent

Type: TYPEDEF Receives an event from the engine

Parameters

FExtensionUpdate

Type: TYPEDEF Updates an extension. Called for each game frame.

Parameters

Returns

Params

Type: STRUCT The global parameters avalable when registering and unregistering an extension

Members

ParamsFinalize

Type: FUNCTION Finalizes an extension params struct (deallocates internal memory)

Parameters

ParamsGetContext

Type: FUNCTION Gets a context using a specified name hash

Parameters

Returns

ParamsGetContextByName

Type: FUNCTION Gets a context using a specified name

Parameters

Returns

ParamsInitialize

Type: FUNCTION Initializes an extension params struct NOTE: this is an opaque struct, do not use it’s members directly!

Parameters

ParamsSetContext

Type: FUNCTION Sets a context using a specified name

Parameters

Returns

RegisteriOSUIApplicationDelegate

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

Notes

This function is only available on iOS. [icon:ios]

Parameters

Examples

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

Result

Type: ENUM Result enumeration.

Members

UnregisteriOSUIApplicationDelegate

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

Parameters