WOWCube Docs logo
WOWCube Docs
Mission Control
Section Shortcuts
APIExamplesSourceWOWConnectChangelog
Filters
SDK and language defaults persist in cookies.
SDK version
Navigation Tree
Collapsed by default, focused on the active path.
Made byMcKay Seamons
GitHub
  1. Home
  2. Docs
  3. API
  4. Application
Mission NodeSDK 6.1C++API Reference

Application

Application Virual Methods on Tick Summary Application tick handler. Description This function is called on each iteration of an application loop. Main appli...

API / SDK 6.1 / C++ / API Reference

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

Application
CPP
1virtual void on_Tick(uint32_t time, uint32_t dt)
2
Wrapped for easier reading. Turn wrap off to inspect exact line lengths.

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 Screen objects

Synopsis

Application
CPP
1virtual void on_Render(std::array<Screen, 3>& screens)
2
Wrapped for easier reading. Turn wrap off to inspect exact line lengths.

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 Screen objects

Synopsis

Application
CPP
1virtual void on_PhysicsTick(const std::array<Screen, 3>& screens)
2
Wrapped for easier reading. Turn wrap off to inspect exact line lengths.

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

Application
CPP
1virtual void on_Message(uint32_t type, uint8_t* pkt, u32_t size)
2
Wrapped for easier reading. Turn wrap off to inspect exact line lengths.

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

Application
CPP
1virtual void on_ExternalMessage(uint8_t *pkt, u32_t size)
2
Wrapped for easier reading. Turn wrap off to inspect exact line lengths.

on_Twist

Summary

Twist handler.

Description

This function is called when device twist is detected.

Arguments

  • twist - a TOPOLOGY_twistInfo_t structure that contains twist information

Synopsis

Application
CPP
1virtual void on_Twist(const TOPOLOGY_twistInfo_t& twist)
2
Wrapped for easier reading. Turn wrap off to inspect exact line lengths.

on_Tap

Summary

Tap handler.

Description

This function is called when tap sequence is detected.

Arguments

  • count - number of detected taps

Synopsis

Application
CPP
1virtual void on_Tap(uint32_t count)
2
Wrapped for easier reading. Turn wrap off to inspect exact line lengths.

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

Application
CPP
1virtual void on_Timer(uint8_t timerID)
2
Wrapped for easier reading. Turn wrap off to inspect exact line lengths.

on_Close

Summary

Application quit handler.

Description

This funciton is called to handle an application quit event when user triple-shakes the device.

Synopsis

Application
CPP
1virtual void on_Close()
2
Wrapped for easier reading. Turn wrap off to inspect exact line lengths.

Public Methods

GetTime

Summary

Gets the time since the device was started, in milliseconds.

Synopsis

Application
CPP
1uint32_t GetTime() const
2
Wrapped for easier reading. Turn wrap off to inspect exact line lengths.

GetTimeSeconds

Summary

Gets the time since the device was started, in seconds.

Synopsis

Application
CPP
1uint32_t GetTimeSeconds() const
2
Wrapped for easier reading. Turn wrap off to inspect exact line lengths.

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

Application
CPP
1void SendRawMessage(uint8_t* data, size_t size) const
2void SendRawMessage(NetworkMessage *msg) const
3
Wrapped for easier reading. Turn wrap off to inspect exact line lengths.

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

Application
CPP
1void SendNetworkMessage(uint32_t type,NetworkMessage* msg) const
2
Wrapped for easier reading. Turn wrap off to inspect exact line lengths.

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

Application
CPP
1void SendExternalMessage(uint32_t type, uint8_t *data, size_t size) const
2
Wrapped for easier reading. Turn wrap off to inspect exact line lengths.

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

Application
CPP
1size_t LoadState(u32_t* id, void* data, size_t size) const
2
Wrapped for easier reading. Turn wrap off to inspect exact line lengths.

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

Application
CPP
1size_t LoadState(u32_t *id, SaveMessage *msg) const
2
Wrapped for easier reading. Turn wrap off to inspect exact line lengths.

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

Application
CPP
1void SaveState(void* data, size_t size) const
2
Wrapped for easier reading. Turn wrap off to inspect exact line lengths.

Arguments

  • msg - a SaveMessage object that contains application data to save

Synopsis

Application
CPP
1void SaveState(SaveMessage *msg) const
2
Wrapped for easier reading. Turn wrap off to inspect exact line lengths.

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

Application
CPP
1bool SetTimer(uint8_t id, uint32_t delay, bool suspended = false)
2
Wrapped for easier reading. Turn wrap off to inspect exact line lengths.

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

Application
CPP
1bool StartTimer(uint8_t id)
2
Wrapped for easier reading. Turn wrap off to inspect exact line lengths.

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

Application
CPP
1bool StopTimer(uint8_t id)
2
Wrapped for easier reading. Turn wrap off to inspect exact line lengths.

KillTimer

Summary

Destroys the specified timer

Arguments

  • id - an identifier of the timer to destroy

Synopsis

Application
CPP
1void KillTimer(uint8_t id)
2
Wrapped for easier reading. Turn wrap off to inspect exact line lengths.

ShowFPSCounter

Summary

Toggles FPS counter window.

Arguments

  • show - boolean value to control the visibility of FPS windows

Synopsis

Application
CPP
1void ShowFPSCounter(bool show)
2
Wrapped for easier reading. Turn wrap off to inspect exact line lengths.

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

Application
CPP
1bool IsMasterModule()
2
Wrapped for easier reading. Turn wrap off to inspect exact line lengths.

GetImageAssetsCount

Summary

Visual assets counting funciton

Output

Returns the number of visual assets currently used by an application.

Synopsis

Application
CPP
1int GetImageAssetsCount()
2
Wrapped for easier reading. Turn wrap off to inspect exact line lengths.

GetSoundAssetsCount

Summary

Sound assets counting funciton

Output

Returns the number of sound assets currently used by an application.

Synopsis

Application
CPP
1int GetSoundAssetsCount()
2
Wrapped for easier reading. Turn wrap off to inspect exact line lengths.

Public Members

Module

Summary

Index of a device module the application is running on.

Synopsis

Application
CPP
1uint32_t Module
2
Wrapped for easier reading. Turn wrap off to inspect exact line lengths.

Scene

Summary

An object that holds GFX Engine scene.

Synopsis

Application
CPP
1Cubios::Scene Scene
2
Wrapped for easier reading. Turn wrap off to inspect exact line lengths.

Jump Grid

On This Page

Virual Methodson Tickon Renderon PhysicsTickon Messageon ExternalMessageon Twiston Tapon Timeron ClosePublic MethodsGetTimeGetTimeSecondsSendRawMessageSendNetworkMessageSendExternalMessageLoadStateSaveStateSetTimerStartTimerStopTimerKillTimerShowFPSCounterIsMasterModuleGetImageAssetsCountGetSoundAssetsCountPublic MembersModuleScene
Context Rail

Related nodes

Global Defines
API / SDK 6.1 / C++ / API Reference
Data Structures
API / SDK 6.1 / C++ / API Reference
Enumerated Types
API / SDK 6.1 / C++ / API Reference
Graphics
API / SDK 6.1 / C++ / API Reference
Previous Node
Enumerated Types
API / SDK 6.1 / C++ / API Reference
Next Node
Graphics
API / SDK 6.1 / C++ / API Reference