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

Implemented blocking_event_loop for osx #443

Merged
merged 1 commit into from
Jun 3, 2024

Conversation

birhburh
Copy link
Contributor

@birhburh birhburh commented Jun 3, 2024

Implemented window loop for OSX (as far as I underastand NSApplication run works like this)
And also implemented blocking_event_loop for osx (based on this pull request: #437)

@not-fl3
Copy link
Owner

not-fl3 commented Jun 3, 2024

Thanks for PR, great work!

@not-fl3 not-fl3 merged commit 833799e into not-fl3:master Jun 3, 2024
10 checks passed
birhburh added a commit to birhburh/miniquad that referenced this pull request Aug 11, 2024
- Reverted macos.rs to this implementation:
not-fl3#443 (it's probably better compare changes with this PR than with latest commit to understand what was added additionally)
- Now using own NSView with NSOpenGLContext instead of NSOpenGLView
- For metal backend using redraw instead setNeedsDisplay, because somehow it reduces cpu usage (Cannot find info about enabling vsync like this in MTKView docs)
- Fixed freezing on resize by drawing in draw_rect that called during "live resize"™. I don't like this approach, but it blocks main event loop while resizing, so it will not be some kind of concurency of opengl stuff i think
- Reducing CPU usage when window is occluded
- Added comments to hacky places, there are lots of them imo

Fixes:
- not-fl3#455
- not-fl3#470
not-fl3 pushed a commit that referenced this pull request Aug 11, 2024
- Reverted macos.rs to this implementation:
#443 (it's probably better compare changes with this PR than with latest commit to understand what was added additionally)
- Now using own NSView with NSOpenGLContext instead of NSOpenGLView
- For metal backend using redraw instead setNeedsDisplay, because somehow it reduces cpu usage (Cannot find info about enabling vsync like this in MTKView docs)
- Fixed freezing on resize by drawing in draw_rect that called during "live resize"™. I don't like this approach, but it blocks main event loop while resizing, so it will not be some kind of concurency of opengl stuff i think
- Reducing CPU usage when window is occluded
- Added comments to hacky places, there are lots of them imo

Fixes:
- #455
- #470
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.

2 participants