@@ -52,6 +52,8 @@ class application : public utki::intrusive_singleton<application>
5252 // NOLINTNEXTLINE(cppcoreguidelines-avoid-non-const-global-variables)
5353 static instance_type instance;
5454
55+ std::vector<window> windows_v;
56+
5557public:
5658 const std::string name;
5759
@@ -64,6 +66,17 @@ class application : public utki::intrusive_singleton<application>
6466 void swap_frame_buffers ();
6567
6668public:
69+ /* *
70+ * @brief Get application windows.
71+ * It is guaranteed that at least one window always exists,
72+ * so the returned span's size is guaranteed to be >= 1.
73+ * @return A span of application windows. Size of the span is always >= 1.
74+ */
75+ utki::span<window> windows ()
76+ {
77+ return this ->windows_v ;
78+ }
79+
6780 ruis::gui gui;
6881
6982public:
@@ -183,16 +196,52 @@ class application : public utki::intrusive_singleton<application>
183196 unsigned pointer_id
184197 );
185198
199+ public:
200+ /* *
201+ * @brief Application parameters.
202+ */
203+ struct parameters {
204+ /* *
205+ * @brief Application's name.
206+ * This name is not to be presented to the user, instead it is the name for
207+ * itentifying the application within the system.
208+ * For example, this name will be used to name application's config directories etc.
209+ * So, the name should be picked so that it does not collide with others.
210+ */
211+ std::string name;
212+
213+ /* *
214+ * @brief Graphics API version.
215+ * The version of the graphics API to initialize.
216+ * All windows will share the same graphics API.
217+ * A shared graphics API context will be created for each window.
218+ * Version value of 0.0 means to initialize minimal supported version of the graphics API.
219+ * Minimal supported versions of various graphics APIs:
220+ * - OpenGL 2.0
221+ * - OpenGL ES 2.0
222+ * - TODO: add more APIs
223+ */
224+ // clang-format off
225+ utki::version_duplet graphics_api_version = {
226+ .major = 0 ,
227+ .minor = 0
228+ };
229+ // clang-format on
230+
231+ /* *
232+ * @brief Application windows to create.
233+ * At least one window should be specified.
234+ */
235+ std::vector<window_parameters> windows;
236+ };
237+
186238protected:
187239 /* *
188240 * @brief Application constructor.
189- * @param name - name of the application.
190- * @param window_params - requested window parameters .
241+ * @param params - application parameters .
242+ * @throw std::invalid_argument - in case list of windows to create is empty .
191243 */
192- application (
193- std::string name, //
194- const window_parameters& window_params
195- );
244+ application (parameters params);
196245
197246public:
198247 application (const application&) = delete ;
0 commit comments