Skip to content

Conversation

@Fincap
Copy link
Contributor

@Fincap Fincap commented Sep 4, 2025

Adds missing bindings for the glfw functions:

  • glfwSetWindowAspectRatio
  • glfwGetWindowFrameSize
  • glfwGetWindowOpacity
  • glfwSetWindowOpacity
  • glfwIconifyWindow
  • glfwRestoreWindow
  • glfwMaximizeWindow
  • glfwHideWIndow
  • glfwRequestWindowAttention
  • glfwPostEmptyEvent

All functions except for postEmptyEvent have been aliased as methods to the Window struct to support the "objecty" API.

@hazeycode hazeycode requested a review from Copilot September 4, 2025 21:27
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR adds missing GLFW bindings for window management functions, expanding the Zig wrapper's coverage of GLFW's window API. The bindings include window state management (iconify, restore, maximize, hide), opacity control, aspect ratio setting, frame size querying, and attention requests.

  • Adds 10 new GLFW function bindings for window management operations
  • Provides both direct function bindings and object-oriented method aliases on the Window struct
  • Implements a helper method getFrameSize() that returns window frame dimensions as an array

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

Comment on lines +771 to +774
var left: c_int = 0.0;
var top: c_int = 0.0;
var right: c_int = 0.0;
var bottom: c_int = 0.0;
Copy link

Copilot AI Sep 4, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Integer variables are being initialized with floating-point literal 0.0. Use 0 instead of 0.0 for c_int variables.

Copilot uses AI. Check for mistakes.
Comment on lines 780 to 781
var width: c_int = 0.0;
var height: c_int = 0.0;
Copy link

Copilot AI Sep 4, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Integer variables are being initialized with floating-point literal 0.0. Use 0 instead of 0.0 for c_int variables.

Copilot uses AI. Check for mistakes.
@hazeycode hazeycode merged commit de6a1ea into zig-gamedev:main Sep 4, 2025
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants