resize GL context on window size change #204
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Edit: Ugh, I have never compiled for wasm to be honest, and I haven't noticed that wasm example directory. If this change is fine otherwise, I'll update this to fix the example code obviously.
This might be problematic because it changes the public API of the renderer in a pretty prominent place. Since the renderer doesn't have easy access to the glutin context (as far as I can tell), this was the best I could come up with, other than possible workarounds like "set a dirty flag in the renderer, then resize the context on next render_and_swap_buffers() call where the context is passed in". Let me know if you prefer that solution. :-)
Both input and "windowing" seem to work pretty well on Wayland Gnome for me with that change. The window decoration appears to be rather "simple" but that's okay.
This is an API-breaking change for anyone not using the
Framework
helper. Instead of calling the
set_frame_size()
method on theRenderer
after a window size change, it is now necessary to call theset_frame_size()
method on theEngine
.Framework
was updated tohandle this correctly.
Explicitly changing the GL context size (backbuffer) after window resize
events happens automatically on most platforms, but is needed for
Wayland and macOS according to glutin docs.
This fixes an issue on Wayland, where the window content size did not
change after a window resize, only the window title bar.
Might help for issues #167 and #10.