OSX/Metal people: do you know of any guide how to create a simple window with a metal layer from code? I have a MTKView but it seems I cannot do things like while(running) { repaint(); } on it. Do I need it to event based? Can I fake it?(OSX noob here)
-
Show this thread
-
Replying to @joeldevahl
You’d normally want to draw in response to a CVDisplayLink callback (which MTKView uses internally on macOS), but you can also use the setNeedsDisplay/updateLayer mechanism to provoke drawing into a CAMetalLayer. Happy to discuss further on DM.
2 replies 0 retweets 1 like -
Replying to @warrenm @joeldevahl
I'd be interested to see any proof-of-concept / minimal code that does this *cleanly*. (I tackled the same problem a few months ago with no Cocoa knowledge at all and ended up with a solution that I found... gross)
2 replies 0 retweets 0 likes -
Replying to @TheEpsylon @warrenm
I don't think I have done it cleanly enough, but I will try to pull it out of framework and get some code posted later. Focus for me right now is rendering abstraction and not game loop/window management, sorry
1 reply 0 retweets 0 likes
Understood. Feel free to get in touch if I can help down the line.
Loading seems to be taking a while.
Twitter may be over capacity or experiencing a momentary hiccup. Try again or visit Twitter Status for more information.