12#define GLFW_EXPOSE_NATIVE_WIN32
14#define GLFW_EXPOSE_NATIVE_X11
16#define GLFW_EXPOSE_NATIVE_COCOA
18#include <GLFW/glfw3.h>
42 [[nodiscard]] std::string
getName()
const override {
return "GLFW"; }
47 void close()
override;
52 void setIcon(
const std::string &path)
const override;
63 static void keyCallback(GLFWwindow *window,
int key,
int scancode,
int action,
int mods);
66 static void scrollCallback(GLFWwindow *window,
double xoffset,
double yoffset);
This file contains the Window abstract class.
Class for the GLFW plugin.
bool create(const std::string &name, WindowSize size) override
Create a window with the given name and size.
void setIcon(const std::string &path) const override
Set the window icon from the given image path.
static void cursorPosCallback(GLFWwindow *window, double x, double y)
void close() override
Close the window.
GLFW(const GLFW &)=delete
utl::PluginType getType() const override
Get the type of the plugin.
bool m_frameBufferResized
utl::PluginPlatform getPlatform() const override
Get the handled platform of the plugin.
bool wasResized() const override
Check if the window was resized.
static void scrollCallback(GLFWwindow *window, double xoffset, double yoffset)
GLFW & operator=(const GLFW &)=delete
static void frameBufferResizeCallback(GLFWwindow *window, int width, int height)
WindowSize getWindowSize() const override
Get the current window size.
bool pollEvent(WindowEvent &event) override
Poll window events into outEvent.
NativeWindowHandle getNativeHandle() const override
Get the native window handle.
std::string getName() const override
Get the name of the plugin.
void pollEvents() override
Poll window events.
std::queue< WindowEvent > m_eventQueue
WindowSize m_frameBufferSize
static void mouseButtonCallback(GLFWwindow *window, int button, int action, int mods)
void resetResizedFlag() override
Reset the resized flag.
GLFW & operator=(GLFW &&)=delete
static void keyCallback(GLFWwindow *window, int key, int scancode, int action, int mods)
bool shouldClose() const override
Check if the window should close.
Struct for native window handle.
Struct for window events.