feat: add window resize support
Added width/height tracking to the window class via a GLFW resize callback. The callback stores the current size and forwards it to a user-provided std::function. Added context::set_size() to update the GL viewport when the window is resized. Changed scene::render() to accept (int width, int height) parameters so scenes can compute the correct aspect ratio for their projection matrix instead of hardcoding 1280/720. Fixed parameter shadowing in resize_callback_impl (glfw_window instead of window).
This commit is contained in:
+1
-1
@@ -16,7 +16,7 @@ public:
|
||||
sphere();
|
||||
auto init() -> bool override;
|
||||
auto update(float delta_time) -> void override;
|
||||
auto render() -> void override;
|
||||
auto render(int width, int height) -> void override;
|
||||
|
||||
private:
|
||||
opengl::shader m_prog;
|
||||
|
||||
Reference in New Issue
Block a user