1// This file is generated by WOWCube SDK project wizard
2//
3// Application UUID: 4Q5Ol6v-cL
4//
5
6use wowcube_sdk::application::{AppErr, Application, ApplicationContext, Mappable};
7
8use wowcube_sdk::cubios;
9use wowcube_sdk::cubios::{gfx, topology};
10
11const TEXT_SIZE: u32 = 10;
12
13#[derive(Default)]
14pub struct HelloWOWCube {
15 initialized: bool,
16 app_context: ApplicationContext,
17}
18
19impl HelloWOWCube {
20 pub fn new() -> Self {
21 HelloWOWCube::default()
22 }
23}
24
25impl Mappable for HelloWOWCube {}
26
27impl Application for HelloWOWCube {
28 fn app_context_mut(&mut self) -> &mut ApplicationContext {
29 &mut self.app_context
30 }
31
32 fn on_render(&self) -> Result<(), AppErr> {
33 if !self.initialized {
34 return Ok(());
35 }
36 // iterate through screens
37 self.get_twist();
38 for screen in 0..3 {
39 gfx::set_render_target(screen as u8);
40
41 gfx::clear(0xff000000); // TODO: Colors::Black
42
43 gfx::draw_text(
44 120,
45 100,
46 TEXT_SIZE,
47 0,
48 cubios::TextAlign::Center,
49 0xffffffff as u32,
50 "HELLO",
51 );
52 gfx::draw_text(
53 120,
54 140,
55 TEXT_SIZE,
56 0,
57 cubios::TextAlign::Center,
58 0xffffffff as u32,
59 "WOWCUBE",
60 );
61
62 gfx::render();
63 }
64
65 Ok(())
66 }
67
68 fn on_init(&mut self) -> Result<(), AppErr> {
69 self.initialized = true;
70
71 Ok(())
72 }
73
74 fn on_tick(&mut self) -> Result<(), AppErr> {
75 if !self.initialized {
76 self.on_init()?;
77 }
78
79 Ok(())
80 }
81}
82