13 mFramebufferResized(false)
20 glfwWindowHint(GLFW_CLIENT_API, GLFW_NO_API);
21 glfwWindowHint(GLFW_RESIZABLE, GLFW_TRUE);
25 const GLFWvidmode* mode = glfwGetVideoMode(glfwGetPrimaryMonitor());
26 mFullScreenRes.
width =
static_cast<unsigned int>(mode->width);
27 mFullScreenRes.
height =
static_cast<unsigned int>(mode->height);
28 mWindow = glfwCreateWindow(mode->width,
31 glfwGetPrimaryMonitor(),
nullptr);
35 if (width >
static_cast<unsigned int>(std::numeric_limits<int>::max()) ||
36 height >
static_cast<unsigned int>(std::numeric_limits<int>::max()))
38 throw std::out_of_range(
"Window dimensions exceed GLFW supported range.");
41 mWindow = glfwCreateWindow(
42 static_cast<int>(width),
43 static_cast<int>(height),
49 glfwSetWindowUserPointer(mWindow,
this);
60 return glfwWindowShouldClose(mWindow);
65 return static_cast<void*
>(mWindow);
70 glfwDestroyWindow(mWindow);
81 static_cast<void>(width);
82 static_cast<void>(height);
85 app->mFramebufferResized =
true;
90 return mFullScreenRes;
Defines a generic application interface for rendering-based programs.
virtual ScreenSettings GetScreenSettings() const =0
Retrieves the current screen or window settings.
Desktop implementation of the IWindowSystem interface using GLFW.
bool ShouldClose() const override
Checks whether the user has requested to close the window.
StandaloneDesktopWindow(IApplication &app)
Constructs a desktop window system instance.
void CreateAppWindow(unsigned int width, unsigned int height, const std::string &title) override
Creates the main application window.
const IApplication & GetApplication() override
Retrieves a reference to the owning application instance.
void PollEvents() override
Polls and processes OS-level window events (input, resize, close, etc.).
WindowResolution GetFullScreenResolution() const override
Queries the resolution of the full-screen display mode.
void Shutdown() override
Performs cleanup and releases window-related resources.
static void FramebufferResizeCallback(GLFWwindow *window, int width, int height)
GLFW framebuffer resize callback.
void * GetNativeHandle() const override
Returns a pointer to the underlying native window handle.
bool isFullScreen
Whether the application runs in fullscreen mode.
Represents the pixel resolution of a window or display.
unsigned int height
Window or screen height in pixels.
unsigned int width
Window or screen width in pixels.