QuasarEngine
Cross-platform 3D engine and editor
Loading...
Searching...
No Matches
ImGuiLayer.h
Go to the documentation of this file.
1#pragma once
2
7
8#include <quasar/core/Layer.h>
10
11namespace Quasar
12{
13 class Window;
14
30 class ImGuiLayer final : public Layer
31 {
32 public:
35 explicit ImGuiLayer(Window& window);
36
38 void OnAttach() override;
39
41 void OnDetach() override;
42
44 void OnEvent(Event& event) override;
45
47 void Begin();
48
52 void End();
53
57 void SetBlockEvents(bool block) { m_BlockEvents = block; }
58
59 private:
60 Window* m_Window = nullptr;
61 bool m_BlockEvents = true;
62 };
63}
Base class of all events, with their types and categories.
Base class for every part of an application that is updated, rendered and receives events.
Base class of all events.
Definition Event.h:111
ImGuiLayer(Window &window)
Creates the layer for a window that has an OpenGL context.
void OnDetach() override
Stops the backends, then ImGui.
void OnAttach() override
Starts ImGui and its GLFW and OpenGL backends.
void End()
Draws the ImGui frame in the window, then the ImGui windows outside it.
void OnEvent(Event &event) override
Marks the mouse and keyboard events as handled while ImGui uses them. See SetBlockEvents().
void SetBlockEvents(bool block)
Chooses whether the events used by ImGui are kept from the layers below.
Definition ImGuiLayer.h:57
void Begin()
Starts a new ImGui frame. The application calls it before the OnImGuiRender() hooks.
Application window.
Definition Window.h:42
Contains all the engine code.