Closed dmbfm closed 1 week ago
That's because it actually returns CAMetalDrawable
, which itself is kinda weird; it exists in the QuartzCore
/CoreAnimation
framework (along with a bunch of other CAMetalX
), but extends the MTLDrawable
protocol from the Metal
framework, so there's a kind of circular dependency here, which I think I was unsure of how to resolve cleanly.
Hmm, no, actually, I think MTKView
is defined in MetalKit
, so this should be fixable
I've fixed part of this in https://github.com/madsmtm/objc2/commit/0f1479ba6f9fe368f1bf0c872d3fe8cff46c4337, the QuartzCore
framework wasn't properly public, so we couldn't really use it in the other frameworks.
Still need to actually generate the CAMetalDrawable
class.
When using
MTKView
for rendering with the Metal API there seems to be no way to access thecurrentDrawable
property ofMTKView
so we can present it.Currently I do this as a workaround and it works fine: