Rendering Engine 0.2.0
Modular Graphics Rendering Engine | v0.2.0
Loading...
Searching...
No Matches
i_application.hpp
Go to the documentation of this file.
1// This file is part of the Rendering Engine project.
2// Author: Alexander Obzherin <alexanderobzherin@gmail.com>
3// Copyright (c) 2025 Alexander Obzherin
4// Distributed under the terms of the zlib License. See LICENSE.md for details.
5
6#pragma once
7
8#include "i_renderer.hpp"
9#include <string>
10
11namespace rendering_engine
12{
13
14/**
15 * @struct ScreenSettings
16 * @brief Describes window and display configuration for the application.
17 *
18 * This structure holds parameters defining how the application window
19 * or rendering surface is initialized, including its name, resolution,
20 * and display mode.
21 */
23{
24 /** @brief The window or application name. */
25 std::string name;
26 /** @brief Whether the application runs in fullscreen mode. */
28 /** @brief Screen or window width in pixels. */
29 unsigned int width;
30 /** @brief Screen or window height in pixels. */
31 unsigned int height;
32};
33
34/**
35 * @class IApplication
36 * @brief Defines a generic application interface for rendering-based programs.
37 *
38 * Provides lifecycle control for initialization, main loop, update, rendering,
39 * and shutdown. All specific applications built on top of the Rendering Engine
40 * should implement this interface.
41 *
42 * @see IRenderer
43 */
45{
46public:
47 /** @brief Initializes the application and its subsystems. */
48 virtual void Initialize() = 0;
49 /** @brief Runs the main application loop. */
50 virtual void Run() = 0;
51 /**
52 * @brief Updates the application state.
53 * @param deltaTime Time elapsed since the previous frame, in milliseconds.
54 */
55 virtual void Update(float deltaTime) = 0;
56 /** @brief Executes the rendering logic for the current frame. */
57 virtual void Draw() = 0;
58 /** @brief Performs cleanup and shuts down the application. */
59 virtual void Shutdown() = 0;
60 /** @brief Virtual destructor for safe polymorphic deletion. */
61 virtual ~IApplication() = default;
62 /**
63 * @brief Retrieves the current screen or window settings.
64 * @return A structure describing screen configuration parameters.
65 */
66 virtual ScreenSettings GetScreenSettings() const = 0;
67
68};
69} //rendering_engine
Defines a generic application interface for rendering-based programs.
virtual void Shutdown()=0
Performs cleanup and shuts down the application.
virtual void Initialize()=0
Initializes the application and its subsystems.
virtual ScreenSettings GetScreenSettings() const =0
Retrieves the current screen or window settings.
virtual void Run()=0
Runs the main application loop.
virtual ~IApplication()=default
Virtual destructor for safe polymorphic deletion.
virtual void Draw()=0
Executes the rendering logic for the current frame.
virtual void Update(float deltaTime)=0
Updates the application state.
Describes window and display configuration for the application.
std::string name
The window or application name.
unsigned int width
Screen or window width in pixels.
unsigned int height
Screen or window height in pixels.
bool isFullScreen
Whether the application runs in fullscreen mode.