1#ifndef OE_CORE_WINDOW_H
2#define OE_CORE_WINDOW_H
8#include "event_handler.h"
32 Window(
const std::string& title,
bool is_visible =
true);
41 Window(
const glm::ivec2& dimensions,
const std::string& title,
bool is_visible =
true);
72 void setCursorVisible(
bool visible =
true);
106 void makeContextCurrent();
139 return 1.0f * _dimensions.x / _dimensions.y;
162 return _event_handler;
170 return _event_handler;
186 glm::ivec2 _dimensions;
187 glm::ivec2 _buffer_dimensions;
189 void* _handle =
nullptr;
191 Cursor* _cursor =
nullptr;
193 std::shared_ptr<Renderer> _renderer;
Event handler.
Definition event_handler.h:22
void beginRender()
Begin rendering to the main framebuffer.
void setDimensions(const glm::ivec2 &)
Set window dimensions (excluding decorations)
void setCursorPosition(const double &x, const double &y)
Set cursor position relative to the window.
glm::ivec2 getBufferDimensions()
Get main framebuffer dimensions.
Definition window.h:145
glm::vec2 getCursorPosition(const bool &absolute=false)
Get cursor position relative to the window or screen.
void setPosition(const glm::ivec2 &)
Set window position (excluding decorations)
bool canRun() const
Check if nothing prevented the window to close.
Window(const glm::ivec2 &dimensions, const std::string &title, bool is_visible=true)
Generate and open a new window.
const glm::ivec2 getPosition() const
Get window position (excluding decorations)
void setClipboardContent(const std::string &contents)
Set the contents of the system clipboard to the UTF-8 string.
float getAspectRatio() const noexcept
Get window aspect ratio.
Definition window.h:137
const glm::ivec2 getDimensions() const
Get window dimensions (excluding decorations)
Definition window.h:129
void moveToCenter()
Center the window.
void endRender()
End framebuffer rendering.
const std::string getClipboardContent()
Returns the contents of the system clipboard, if the content contains or is convertible to a UTF-8 en...
void setTitle(const std::string &title)
Set window title.
void hide()
Hide the window.
void setShouldClose(bool can_close=true)
Tell the window to close.
void show()
Display the window.
void lockCursor()
Hide cursor and lock it at window center.
void blink()
Make the window blink to get user attention.
void processEvents()
Process window events.
EventHandler & getEventHandler()
Get a reference to the event handler bound to this window.
Definition window.h:160
Window(const std::string &title, bool is_visible=true)
Generate and open a fullscreen window.
const EventHandler & getEventHandler() const
Get a const reference to the event handler bound to this window.
Definition window.h:168
Core functionality (windows, event handler, logger, ...)
Definition cursor.h:8
Oxygen Engine common namespace.
Definition cursor.h:8
Class providing native access to underlying handles.
Definition native.h:20