Skip to content

refactor: Split init call of Plugin & PluginGLFW #138

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

Closed
wants to merge 1 commit into from

Conversation

pchampio
Copy link
Member

@pchampio pchampio commented May 17, 2019

The Plugin interface doesn't need a glfw.Window to be instantiated.
Calling the init function of the Plugin interface before the glfw.Window is created improves the app's flexibility.

Example of why it's needed: draft-wiki answering the issue #137

Plugin interface doesn't need a glfw.Window to be instantiated.
Calling the init function of the Plugin interface improves the
flexibility. #137
@pchampio pchampio requested a review from GeertJohan May 17, 2019 12:51
@pchampio pchampio self-assigned this May 17, 2019
@pchampio pchampio added embedder Issue concerns the embedder package enhancement New feature or request plugin-system labels May 17, 2019
@GeertJohan
Copy link
Member

GeertJohan commented May 18, 2019

This breaks the order in which plugins are fully initialized. Currently the user can determine an order by adding the plugins in a certain order. Which is no longer the case when GLFW plugins are always initialized after 'normal' plugins.
Also, the provided use-case introduces a flaw for users that want to initialize multiple windows. One borderless and one normal. If the Application manages bordres and/or fullscreen, then it can set the window hints right before creation, and reset them after creation. That way a user can have 2 Applications with different options, instead of abusing the Plugin system to set GLFW options.
Lastly, if we move to go-glfw/glfw 3.3, then the plugin won't work anymore because it sets the window hint in the GLFW 3.2 package. Afaik there is no compatibility between the packages and they each have their own GLFW namespace/globals. So setting the window hints in the GLFW 3.2 package won't affect GLFW 3.3 windows.

@pchampio
Copy link
Member Author

Thanks for your detailed feedback, closing the PR.

@pchampio pchampio closed this May 18, 2019
@pchampio pchampio deleted the refactor/split-plugin-initialization branch May 18, 2019 20:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
embedder Issue concerns the embedder package enhancement New feature or request plugin-system
Development

Successfully merging this pull request may close these issues.

2 participants