I'm using Objective-C++ so I can get practice w/ C++, since I use Swift at work. I think Swift examples would be easy enough to follow. (?)
-
-
Replying to @meb_michael @warrenm
Obj-C also makes it easier to follow along in your book. I tried already in Swift, but it was a little tricky... and then I got busy.
1 reply 0 retweets 0 likes -
Replying to @meb_michael @warrenm
So far I've found some documentation about layer hosting, which sounds like it might be a key step I'm missing https://developer.apple.com/library/content/documentation/Cocoa/Conceptual/CoreAnimation_guide/SettingUpLayerObjects/SettingUpLayerObjects.html …
1 reply 0 retweets 0 likes -
Replying to @meb_michael
You want to be layer-backed. It's sufficient to override makeBackingLayer in your NSView subclass to return an instance of CAMetalLayer.
1 reply 0 retweets 0 likes -
Replying to @warrenm
Is this in addition to the override of layerClass, and the metalLayer getter? I've tried various combinations, but drawRect no longer called
1 reply 0 retweets 0 likes -
Replying to @meb_michael @warrenm
Apologies for my severely out-of-practice ObjC, but here's what I've got, which doesn't seem to work:https://gist.github.com/mebmichael/4ddfa78f89a7c27fe71808712c24cf17 …
1 reply 0 retweets 0 likes -
Replying to @meb_michael @warrenm
Though now that I look at it, it doesn't run in your sample code either, so I suppose I'll try moving forward w/ the tutorials :) Thanks!
1 reply 0 retweets 0 likes -
Replying to @meb_michael @warrenm
(drawRect, that is. I thought it wasn't working because it wasn't being called. Sorry for so many messages!)
1 reply 0 retweets 0 likes -
Replying to @meb_michael
No problem. This wound up being a bit more involved than I recall, and I learned a few things! Here's a sample: https://gist.github.com/warrenm/6a6f9f3419fce1f9b43015344f56401b …
2 replies 0 retweets 1 like -
Replying to @warrenm
Thanks to your help, I finally got my code working in Objective-C! I also updated my Gist. I would've been stuck for a day w/o your help :)
1 reply 0 retweets 0 likes
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.
