1// This file is generated by WOWCube SDK project wizard
2
3#include <stdint.h>
4#include <string>
5#include <vector>
6#include <string>
7#include <memory>
8
9#include "AppManager.h"
10#include "HelloWOWCube.h"
11
12using namespace Cubios;
13using namespace Cubios::Gfx;
14
15//Applicaton initialization callback. Called once when CUB application starts
16void OnInit(Cubios::AppManager& appMgr)
17{
18 appMgr.SetApplication(new HelloWOWCube);
19}
20
21
22HelloWOWCube::HelloWOWCube()
23{
24}
25
26HelloWOWCube::~HelloWOWCube()
27{
28}
29
30//This callback is called every "tick" of cubeapp application loop
31void HelloWOWCube::on_Tick(uint32_t currentTime, uint32_t deltaTime)
32{
33}
34
35//This callback is called every time device is about to render visuals. Use it for calling your rendering code.
36void HelloWOWCube::on_Render(std::array<Cubios::Screen, 3>& screens)
37{
38 //iterate through screens
39 for(auto it = screens.begin(); it != screens.end(); ++it)
40 {
41 //set screen render target
42 GFX_setRenderTarget(it->ID());
43
44 //fill the screen with black color
45 GFX_clear(Colors::black);
46
47 //render text
48 GFX_drawText(120,100, TEXT_SIZE, 0, text_align_t::TEXT_ALIGN_CENTER, Colors::white, "HELLO");
49 GFX_drawText(120,140, TEXT_SIZE, 0, text_align_t::TEXT_ALIGN_CENTER, Colors::white, "WOWCUBE");
50
51 GFX_render();
52 }
53}
54
55//The "physics" callback. Gets called recurrently with at least 33ms resolution or less depending on the load.
56void HelloWOWCube::on_PhysicsTick(const std::array<Cubios::Screen, 3>& screens)
57{
58}
59
60//This callback is called on programmable timer (if any)
61void HelloWOWCube::on_Timer(uint8_t timerID)
62{
63}
64
65//The cube topology change callback. Gets called when cube is twisted and its topological desctiption has been changed
66void HelloWOWCube::on_Twist(const Cubios::TOPOLOGY_twistInfo_t& twist)
67{
68}
69
70//The "inner network" callback. Gets called when WOWCube module receives a data packet from other module
71void HelloWOWCube::on_Message(uint32_t type, uint8_t* pkt, u32_t size)
72{
73}
74
75//The external data transfer callback. Gets called when WOWCube module receives a data over BLE from an external source
76void HelloWOWCube::on_ExternalMessage(uint8_t* pkt, u32_t size)
77{
78}
79
80//Screen tap callback
81void HelloWOWCube::on_Tap(uint32_t count)
82{
83}