Skip to content

Commit

Permalink
sokol_app.h gl: make GL context current in NSOpenGLView.reshape
Browse files Browse the repository at this point in the history
Not sure if this is a regression in macOS, or never worked:

The SAPP_EVENTTYPE_RESIZED event may be fired from within the
NSOpenGLView.reshape method, which doesn't seem to have a GL
context bound, so calling any GL function from within
the RESIZED handler fails. The commit simply makes the
NSOpenGLView's GL context current in the reshape function.
  • Loading branch information
floooh committed May 8, 2023
1 parent 4535a3b commit 957191c
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions sokol_app.h
Original file line number Diff line number Diff line change
Expand Up @@ -3983,6 +3983,7 @@ _SOKOL_PRIVATE void _sapp_macos_frame(void) {
the correct dimensions.
*/
- (void)reshape {
[[self openGLContext] makeCurrentContext];
_sapp_macos_update_dimensions();
[super reshape];
}
Expand Down

0 comments on commit 957191c

Please sign in to comment.