Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

glfw: support multiple types from glfw.Window.hint #32

Merged
merged 2 commits into from
Oct 18, 2021

Conversation

Avokadoen
Copy link
Contributor

  • By selecting this checkbox, I agree to license my contributions to this project under the license(s) described in the LICENSE file, and I have the right to do so or have received permission to do so by an employer or client I am producing work for whom has this right.

This PR attempts to solve #29

@@ -1368,12 +1375,51 @@ test "hint" {
try defaultHints();
}

test "hintString" {
test "hint int" {
Copy link
Member

Choose a reason for hiding this comment

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

Very cool PR! Thank you a ton for this!

Could you add a bool hint test? (unless I missed it?)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done!

Copy link
Contributor Author

@Avokadoen Avokadoen Oct 18, 2021

Choose a reason for hiding this comment

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

One fear I have is that zig is unable to type coerce strings to a zero terminated string using this meaning it is possibly UB, but it seems like this is not the case and zig is able to track the variable until it's called by the c function.

Copy link
Member

Choose a reason for hiding this comment

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

Ah, interesting thought - I think it should be OK but if we find out it's not later on, we could always introduce a temporary buffer / allocation for purposes of passing it to C since this is an infrequent code path.

@Avokadoen
Copy link
Contributor Author

Sorry for the array of force pushes, will be using a draft next time. Didn't expect you to be that fast 😅

Copy link
Member

@slimsag slimsag left a comment

Choose a reason for hiding this comment

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

Thanks so much for this!

@Avokadoen
Copy link
Contributor Author

Thanks so much for this!

Thank you for this awesome library :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants