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;
241 #ifdef OXYGEN_ENGINE_DEBUG_VALIDATE_ORDERED_OPERATIONS
242 bool is_between_begin_end =
false;
246 glm::ivec2 _dimensions;
247 glm::ivec2 _buffer_dimensions;
249 void* _handle =
nullptr;
251 Cursor* _cursor =
nullptr;
253 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.
void setResizable(const bool enable=true) noexcept
Toggle to let the window being resizable by the user.
bool isResizable() const noexcept
Check if the window is resizable by the user.
void setDecorated(const bool enable=true) noexcept
Toggle the decorations (title bar and OS specific borders)
void setMousePasthrough(const bool enable=true) noexcept
Toggle to let the window being transparent to mouse input.
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)
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)
bool isMousePasthrough() const noexcept
Check if the window is transparent to mouse input, letting any mouse events pass through to whatever ...
void setClipboardContent(const std::string &contents)
Set the contents of the system clipboard to the UTF-8 string.
bool isHovered() const noexcept
Check if the cursor is currently directly over the content area of the window, with no other windows ...
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.
bool isAlwaysOnTop() const noexcept
Check if the window is forced at foreground.
void setAlwaysOnTop(const bool enable=true) noexcept
Toggle if the window should be always on top.
bool isDecorated() const noexcept
Check if the window has decorations (title bar and OS specific borders)
void blink()
Make the window blink to get user attention.
bool shouldClose() const
Check if nothing prevented the window to close.
bool isFocused() const noexcept
Check if the window has input focus.
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