Class Application


#include <include/Sirius/Core/Application.h>

class Application


Application class.

This is the main class, where the application loop is located.


ApplicationDefault constructor.
getApplication getter.
getWindowApplication window getter.
onEventIs called when an event occurs.
onWindowCloseIs called when a WindowCloseEvent is triggered.
pushLayerPush a new window layer.
pushOverlayPush a new window overlay.
runMain application loop.


Lines 32-95 in include/Sirius/Core/Application.h.

class Application
        static Application* instance;
        std::unique_ptr<Window> window;
        bool running = true;
        float lastFrameTime = 0.f;
        LayerStack layerStack;
        ImGuiLayer* imGuiLayer;
        /// @brief Default constructor
        /// A single window is created, where the
        /// simulation lives.
        /// @brief Application getter
        /// There is only one Application object per
        /// application, accessed with this getter.
        inline static Application& get() { return *instance; }
        /// @brief Application window getter
        /// Each simulation has a single window,
        /// which is accessed with this getter.
        /// @see Window class
        inline Window& getWindow() const { return *window; };
        /// @brief Is called when an event occurs
        /// @see Event class
        void onEvent(Event& event);
        /// @brief Push a new window layer
        /// @see Layer class
        void pushLayer(Layer* layer);
        /// @brief Push a new window overlay
        /// @see Layer class
        void pushOverlay(Layer* overlay);
        /// @brief Is called when a WindowCloseEvent is triggered
        /// @param event The WindowCloseEvent
        /// @return True
        bool onWindowClose(WindowCloseEvent& event);
        /// @brief Main application loop
        /// @see onUpdate()
        void run();

Add Discussion as Guest

Log in