27 std::string
Title =
"QuasarEngine";
48 Window(
const Window&) =
delete;
49 Window& operator=(
const Window&) =
delete;
50 Window(Window&&) =
delete;
51 Window& operator=(Window&&) =
delete;
99 void SetGlfwCallbacks();
100 void SendEvent(
Event& event);
102 GLFWwindow* m_Handle =
nullptr;
105 bool m_VSync =
false;
Contains the base definitions and utilities for the Quasar engine.
Base class of all events, with their types and categories.
Codes of the keyboard keys, independent from GLFW.
Base class of all events.
Definition Event.h:95
const std::string & GetTitle() const
Returns the title of the window.
GLFWwindow * GetNativeWindow() const
Returns the GLFW window, for the code that needs to call GLFW directly.
void Close()
Asks the window to close. ShouldClose() then returns true.
void SetEventCallback(EventCallback callback)
Sets the function that receives every event of the window.
bool ShouldClose() const
Returns true when the window was asked to close, by the user or by Close().
void Update()
Shows the rendered image and processes the messages of the operating system.
static Scope< Window > Create(const WindowSpecification &specification)
Creates a window and shows it.
std::string GetKeyName(Key key) const
Returns the name of a key in the current keyboard layout, for example "z" for Key::W on AZERTY.
bool IsVSync() const
Returns true if vertical synchronization is enabled.
std::uint32_t GetHeight() const
Returns the height of the drawing area, in pixels.
void SetVSync(bool enabled)
Enables or disables vertical synchronization.
std::uint32_t GetWidth() const
Returns the width of the drawing area, in pixels.
std::function< void(Event &)> EventCallback
Function that receives the events of the window.
Definition Window.h:45
Contains all the engine code.
std::unique_ptr< T > Scope
Pointer with a single owner. Alias of std::unique_ptr.
Definition Base.h:23
Key
Physical key of the keyboard.
Definition KeyCodes.h:22
Settings used to create a window.
Definition Window.h:26
std::uint32_t Height
Height of the window when it is created.
Definition Window.h:29
bool GraphicsContext
Whether the window gets an OpenGL 4.5 core context.
Definition Window.h:34
std::string Title
Title of the window.
Definition Window.h:27
bool VSync
Whether vertical synchronization is enabled when it is created.
Definition Window.h:30
std::uint32_t Width
Width of the window when it is created.
Definition Window.h:28