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

fix resize on macos #1412

Merged
merged 1 commit into from
Feb 27, 2023
Merged

fix resize on macos #1412

merged 1 commit into from
Feb 27, 2023

Conversation

allefant
Copy link
Contributor

This fixes #1410 (the line coordinates, but unfortunately not the red flicker).

The issues I believe is that acknowledge_resize_display_win_main_thread gets run on the main thread and so setup_gl inside of it does not work properly as the main thread can't access the TLS variables from the thread with the user's main() function.

I moved setup_gl(d); out of that function and just call it from both acknowledge_resize_display_win and resize_display_win instead, on whichever thread those are called from. It seems to fix both resizing a window with the handle as well as using al_resize_display to resize it.

The reason resizing is not completely broken without this PR is that calls to al_draw_bitmap can also repair the opengl viewport so in most cases the viewport would only be wrong for a frame or two after a resize but then eventually things would work again.

I also moved another call of _al_ogl_setup_gl to after [context update] which seems to make more sense and removed a superfluous _al_ogl_resize_backbuffer call (it gets called inside _al_ogl_setup_gl anyway). And I added the display dimensions to some of the log messages.

@SiegeLord
Copy link
Member

Nice! Thanks!

@MarkOates
Copy link
Contributor

After pulling this change, the fullscreen mode seems to have broken. I made a (brief) issue: #1415.

I haven't had a chance to investigate other than confirm (through a git bisect) that it happened after this change.

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.

al_draw_line coordinates are off when resizing a window on MacOS
3 participants