@@ -58,17 +58,30 @@ class Application {
58
58
/* *
59
59
* @brief Prepare the objects for the application
60
60
*
61
- * @details This will be called once before creating the first scene,
62
- * and should be used to initialize any other objects necessary. Do
63
- * not try to access any hardware resources during this call.
61
+ * @details This will be called once before the main loop, and
62
+ * should be used to initialize any other objects necessary. Do
63
+ * not try to access any hardware resources during this call,
64
+ * as interrupts are disabled at this point.
64
65
*/
65
66
virtual void prepare () {}
66
67
68
+ /* *
69
+ * @brief Start the application.
70
+ *
71
+ * @details This will be called once before the main loop, and
72
+ * after the `prepare` method. It should be used to initialize
73
+ * any hardware resources necessary, as interrupts are enabled.
74
+ */
75
+ virtual void start () {}
76
+
67
77
/* *
68
78
* @brief Create the root scene object.
69
79
*
70
80
* @details This will be called once before the main loop. It should
71
- * create the root scene object and push it onto the stack.
81
+ * create the root scene object and push it onto the stack. This will
82
+ * only be called if the `frame` method of the `Application` class
83
+ * hasn't been overridden. If you override the `frame` method, you
84
+ * are responsible for managing your own scene system.
72
85
*/
73
86
virtual void createScene () {}
74
87
@@ -111,6 +124,18 @@ class Application {
111
124
*/
112
125
Scene* popScene ();
113
126
127
+ /* *
128
+ * @brief The frame method.
129
+ *
130
+ * @details The default implementation of this method will call the
131
+ * `createScene` method if the scene stack is empty, and then call
132
+ * the `frame` method of the current scene. This method is called
133
+ * once per frame, and should be used to update the application
134
+ * state. If you override this method, you are responsible for
135
+ * managing your own scene system.
136
+ */
137
+ virtual void frame ();
138
+
114
139
virtual ~Application () = default ;
115
140
116
141
private:
0 commit comments