Skip to content

Add native osx backend v1 (with bitmap support)#206

Closed
almarklein wants to merge 1 commit into
mainfrom
native-macos
Closed

Add native osx backend v1 (with bitmap support)#206
almarklein wants to merge 1 commit into
mainfrom
native-macos

Conversation

@almarklein
Copy link
Copy Markdown
Member

This code has been sitting in my local folder for months. I'm making a PR, and will close it right away; then the code is at least stored somewhere safe.

My plan is to (eventually) make a native backend for all major platforms (windows, macos, linux), so that the simple use-case of just creating a window Just Works without any dependencies.

This PR adds a WIP for macos, using Cocoa. It supports both 'screen' and 'bitmap' present. The bitmap present is pretty cool: it uses Metal, and a GPU texture that (on Apple silicon) lives in RAM, so all that's needed to update the bitmap is to copy it to the texture's memory address 🤯, so it's super-fast.

However, for the Metal stuff to work, the code needs a small piece of objective-C, which needs compilation. Therefore, I'll probably refactor this into a simpler backend that only supports screen-present. The remaining work is mostly about adding the user events.

@almarklein almarklein marked this pull request as draft April 10, 2026 12:39
@almarklein almarklein closed this Apr 10, 2026
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.

1 participant