-
-
Notifications
You must be signed in to change notification settings - Fork 397
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
Multiple calls to GetInput extension lead to new glfw input contexts #80
Comments
This is by design, you should really only be calling GetInput once and keeping track of the input context. |
Although I guess we could change it, idk @Ultz/silk-working-group what do you think? |
If you want to keep it this way, then this has to be documented better. Moreover a method labeled "GetXYZ" should have no side-effects by design. I would not expect that a new context is created. This should be renamed to |
Yeah I 100% agree with you. The only reason we purposely made it so that it creates a new context is we wanted to avoid people going window.GetInput().blah for every single input call as that’s a code smell. |
I’ll put it up to an working group vote now. |
You can rename it to |
This was prematurely closed as this change was not implemented in InputWindowExtensions. |
Summary
Multiple calls to the GetInput extension will create a new glfw input context each time. Therefore event registering on other than the first input context will not raise the events.
Steps to reproduce
The problem is the method GetInput below. It creates a new instance of the input context instead of reusing the existing one if present.
Possible solutions
CreateInput
)I would prefer first fix.
The text was updated successfully, but these errors were encountered: