MTKView not in IB?

hey I'm trying to get started with Metal & MetalKit, and. the MTKView is not available in IB for mac apps, but it is available for IOS apps, is there some install I need to do? this doesn't make sense.

Replies

As far as I remember (can't check now) you can still create MTKView in IB by placing ordinary NSView on window and changing the class to MTKView. Just like with any custom view. Regards Michal

the probblem (issue) with that is: you can't set the delegate in IB, or do any of the other setup. I'm left wondering why it wasn't added to the mac os x side of things, when the hard work is already done for you, on the IOS side. Especially since Apple blocked developers from building out plugins themselves to do this.

and also (i forgot to mention)

NO, you cannot just change the class of a view to MTKView.

it doesn't work.

I have the frameworks imported into my app, and the MTKView class is not found by IB. I was forced to subclass MTKView, with literally no content, and use that class.


this is not normal.

class BKMetalView : MTKView {
}

Now that you mention it, I remembered doing something like this, too. I guess it is not enought to import frameworks, you have to somehow force linking against class that (for the compiler) is "not in use", because it does not sees any instantiation of it. I guess it depends on definition of "normal" - but you should not expect Metal to be easy to use. Powerful, yeah. Besides, Mac implementation is later and, one may say, less cared for (or harder to get right, since they have to support more devices) than iOS one.