![]() |
Raven Engine v0.1
|
Class representing a window. More...
#include <Window.h>
Public Member Functions | |
| Window (const WindowProps &props) | |
| Constructs a window with the given properties. | |
| ~Window () | |
| Destructor for the window. | |
| u32 | GetWidth () const |
| Gets the width of the window. | |
| u32 | GetHeight () const |
| Gets the height of the window. | |
| const WindowProps & | GetProps () const |
| Retrieves the current window properties. | |
| WindowProps & | GetProps () |
| Retrieves a mutable reference to the window properties. | |
| void | SetEventCallback (const EventCallbackFn &callback) |
| Sets the event callback function for the window. | |
| void | OnUpdate () |
| Updates the window state. | |
| void * | GetNativeWindow () |
| Gets the native window handle. | |
Class representing a window.
This class provides an interface for creating and managing a window using GLFW. It includes methods for handling events, setting properties, and updating the window state. The class allows for flexible window management and integrates with the engine's event system.
| Raven::Window::Window | ( | const WindowProps & | props | ) |
Constructs a window with the given properties.
This constructor creates a window using GLFW, initializes it with the specified properties (such as title, size, VSync, etc.), and sets up the event callback function.
| props | The window properties to use for creating the window. |
| Raven::Window::~Window | ( | ) |
Destructor for the window.
This destructor cleans up resources associated with the window and shuts down GLFW.
|
inline |
Gets the height of the window.
This method returns the current height of the window in pixels.
|
inline |
Gets the native window handle.
This method returns the native window handle, which can be passed to platform-specific APIs if necessary.
|
inline |
Retrieves a mutable reference to the window properties.
This allows direct modification of the window's runtime state. Useful for updating properties like the callback function at runtime.
|
inline |
Retrieves the current window properties.
This method returns a reference to the window's properties, which include the title, size (width and height), maximized state, and the event callback.
|
inline |
Gets the width of the window.
This method returns the current width of the window in pixels.
| void Raven::Window::OnUpdate | ( | ) |
Updates the window state.
This method should be called every frame to update the window's state, handle events, and refresh the window contents.
|
inline |
Sets the event callback function for the window.
This method allows the user to set a custom callback function that will be called when an event (such as a key press or window resize) occurs.
| callback | The event callback function. |