Add ability to create a separate render thread locked to the display refresh rate #1

Open
emidoots wants to merge 6 commits from foxnne-frames into main
Owner

PR authored by @foxnne and sent by me as part of repo migration to code.hexops.com

This PR adds the ability to init our window's view with a CVDisplayLink that syncs a separate render thread with the display refresh rate. Window now has an on_tick, which when set, notifies the window creation method that the separate thread needs to be created and kicked off.

Currently most of the code that handles this uses the view's events directly by overriding defaults like viewDidMoveToWindow. I have started looking into how to move as much of this code to zig as possible, but currently none of it is used, and the objc code is responsible for the behavior.

This PR will need to be merged before the Mach companion PR is merged.

  • By selecting this checkbox, I agree to license my contributions to this project under the license(s) described in the LICENSE file, and I have the right to do so or have received permission to do so by an employer or client I am producing work for whom has this right.
PR authored by [@foxnne](https://github.com/foxnne/) and sent by me as part of repo migration to code.hexops.com This PR adds the ability to init our window's view with a CVDisplayLink that syncs a separate render thread with the display refresh rate. Window now has an `on_tick`, which when set, notifies the window creation method that the separate thread needs to be created and kicked off. Currently most of the code that handles this uses the view's events directly by overriding defaults like `viewDidMoveToWindow`. I have started looking into how to move as much of this code to zig as possible, but currently none of it is used, and the objc code is responsible for the behavior. This PR will need to be merged before the Mach companion PR is merged. - [X] By selecting this checkbox, I agree to license my contributions to this project under the license(s) described in the LICENSE file, and I have the right to do so or have received permission to do so by an employer or client I am producing work for whom has this right.
Some checks are pending
CI / x86_64-linux (push) Waiting to run
CI / x86_64-macos (push) Waiting to run
CI / x86_64-linux (pull_request) Waiting to run
CI / x86_64-macos (pull_request) Waiting to run
This pull request can be merged automatically.
You are not authorized to merge this pull request.
View command line instructions

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u origin foxnne-frames:foxnne-frames
git switch foxnne-frames

Merge

Merge the changes and update on Forgejo.

Warning: The "Autodetect manual merge" setting is not enabled for this repository, you will have to mark this pull request as manually merged afterwards.

git switch main
git merge --no-ff foxnne-frames
git switch foxnne-frames
git rebase main
git switch main
git merge --ff-only foxnne-frames
git switch foxnne-frames
git rebase main
git switch main
git merge --no-ff foxnne-frames
git switch main
git merge --squash foxnne-frames
git switch main
git merge --ff-only foxnne-frames
git switch main
git merge foxnne-frames
git push origin main
Sign in to join this conversation.
No reviewers
No labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
hexops/mach-objc!1
No description provided.