Application
Virual Methods
on_Tick
Summary
Application tick handler.
Description
This function is called on each iteration of an application loop. Main application logic should be placed here. Frequency of calls is not constant and depends on the application complexity.
Argument
- time - current device time in milliseconds
- dt - delta time between current and previous call, in milliseconds
Synopsis
on_Render
Summary
Screen render handler.
Description
This function is called at the end of an application loop. All rendering code of an application must be called in this function.
Arguments
- screens - an array of
Screenobjects
Synopsis
on_PhysicsTick
Summary
Uniformly delayed loop handler.
Description
This funciton is called approximately each 30 milliseconds. However time interval between calls can be larger because the application is single threaded and complex rendering or calculation can delay events processing. Useful for calculations requiring a time delta, e.g. sprite movement at a constant speed.
Arguments
- screens - an array of
Screenobjects
Synopsis
on_Message
Summary
Network message handler.
Description
This function is called when application receives data from other module over internal network.
Arguments
- type - network packet type
- ptk - network packet data payload
- size - size of the packet
Synopsis
on_ExternalMessage
Summary
External message (the message recevied over BLE) handler.
Description
This function is called when application receives data from the host application that uses WOWCubeConnect library over BLE.
Arguments
- ptk - network packet data payload
- size - size of the packet
Synopsis
on_Twist
Summary
Twist handler.
Description
This function is called when device twist is detected.
Arguments
- twist - a
TOPOLOGY_twistInfo_tstructure that contains twist information
Synopsis
on_Tap
Summary
Tap handler.
Description
This function is called when tap sequence is detected.
Arguments
- count - number of detected taps
Synopsis
on_Timer
Summary
Software timer handler.
Description
This function gets called on every tick of a software timer with particular id.
Arguments
- timerID - an identifier of a software timer
Synopsis
on_Close
Summary
Application quit handler.
Description
This funciton is called to handle an application quit event when user triple-shakes the device.
Synopsis
Public Methods
GetTime
Summary
Gets the time since the device was started, in milliseconds.
Synopsis
GetTimeSeconds
Summary
Gets the time since the device was started, in seconds.
Synopsis
SendRawMessage
Summary
Sends a raw data message over the network.
Description
The function is NOT RECOMMENDED for use.
Allows you to send an unformatted data set to the device's internal network.
Arguments
- data - an unsigned byte array with data
- size - a size of the array
Synopsis
SendNetworkMessage
Summary
Sends a NetworkMessage over the network.
Description
NetworkMessage is a class designed to simplify the work with data transmitted over the device's internal network. The main advantages are the possibility of bit-by-bit data packing and packet typing.
Arguments
- type - packet type overrider value that will be used instead of a type specidied in NetworkMessage object
- msg - a pointer to NetworkMessage object that holds data to send
Synopsis
SendExternalMessage
Summary
Sends a NetworkMessage over the BLE network.
Description
This function allows to send the data to the WOWConnect-enabled host application.
Arguments
- type - packet type overrider value that will be used instead of a type specidied in NetworkMessage object
- msg - a pointer to NetworkMessage object that holds data to send
Synopsis
LoadState
Summary
Loads the application-specific data.
Description
Typically, WOWCube applications are stateful applications, which means that during execution, the application may accumulate data that will later need to be saved. Such data, for example, includes the current level at which the player is located, his inventory, statistics of his moves, and so on.
Arguments
- id - a pointer to unsigned int variable that must be initialized with zero
- data - a pointer to byte array that receives the loaded application data
- size - a size of the array
Output
Retuns the size of the loaded array or 0 in case of a failure.
Synopsis
Arguments
- id - a pointer to unsigned int variable that must be initialized with zero
- msg - a SaveMessage object that receives the loaded application data
Output
Retuns the size of the loaded array or 0 in case of a failure.
Synopsis
SaveState
Summary
Saves the application-specific data.
Description
Typically, WOWCube applications are stateful applications, which means that during execution, the application may accumulate data that will later need to be saved. Such data, for example, includes the current level at which the player is located, his inventory, statistics of his moves, and so on.
Arguments
- data - a pointer to byte array that contains application data to save
- size - a size of the array
Synopsis
Arguments
- msg - a SaveMessage object that contains application data to save
Synopsis
SetTimer
Summary
Creates a timer with the specified time-out value and execution status
Arguments
- id - an identifier of the timer to create
- delay - the time-out value, in milliseconds
- suspended - boolean value that controls the initial state of the timer. If false, the timer will be started instantly; otherwise execution of the timer will be suspended till the next StartTimer() call
Output
Returns true in case of successfull creation of the timer, otherwise false.
Synopsis
StartTimer
Summary
Starts the specified timer
Arguments
- id - an identifier of the timer to start
Output
Returns true in case of succssfull start of the timer, otherwise false.
Synopsis
StopTimer
Summary
Stops the specified timer
Arguments
- id - an identifier of the timer to stop
Output
Returns true in case of succssfull halt of the timer, otherwise false.
Synopsis
KillTimer
Summary
Destroys the specified timer
Arguments
- id - an identifier of the timer to destroy
Synopsis
ShowFPSCounter
Summary
Toggles FPS counter window.
Arguments
- show - boolean value to control the visibility of FPS windows
Synopsis
IsMasterModule
Summary
Checks if the application is running on a master module (a module with ID=0)
Output
Returns true if caller application is running on a master module, otherwise false.
Synopsis
GetImageAssetsCount
Summary
Visual assets counting funciton
Output
Returns the number of visual assets currently used by an application.
Synopsis
GetSoundAssetsCount
Summary
Sound assets counting funciton
Output
Returns the number of sound assets currently used by an application.
Synopsis
Public Members
Module
Summary
Index of a device module the application is running on.
Synopsis
Scene
Summary
An object that holds GFX Engine scene.
Synopsis