Metal for OSX tutorials?

Discussion in 'Mac Programming' started by blueshogun96, Sep 30, 2015.

  1. blueshogun96 macrumors regular

    blueshogun96

    Joined:
    Nov 24, 2012
    #1
    Okay, I'm totally new to Metal and I want to add Metal support to my engine for OSX. It's cross platform, so it already works on OSX via OpenGL4. When I search for tutorials on Metal, all I find is iOS documentation, and I'm not focusing on iOS right now. Anything related to OSX? I also tried looking at the developer website, but it was all related to iOS as well. :/

    Does this mean that the code is exactly the same, minus UIView and stuff? I'm no expert on Objective-C either. My engine uses SDL because it's cross platform, so I barely touch any Obj-C if I can help it.

    I tried modifying an iOS example for OSX that happens to use SDL2, but nothing shows up on the screen. If you want to see what I did, view the modified code here: http://pastebin.com/zB7hpeun

    So yeah, it's pretty safe to say I don't know what I'm doing. Any ideas? Thanks.

    Shogun.
     
  2. teagls macrumors regular

    Joined:
    May 16, 2013
    #2
    If you are wanting to just learn Metal that is one thing, but I think from an engineering perspective adding Metal support to a cross platform application that already uses OpenGL4 seems like a headache and possibly a waste of time unless there is performance critical rendering that without a doubt would benefit from Metal.

    There are Mac specific Metal examples on the developer site as well as in the application sample code created under games for Mac Apps. There are also videos from WWDC 15 focusing on using Metal. The metal API is written in ObjC so if you don't know ObjC there will be some learning curves. Secondly Metal while having some similarities to OpenGL I find it to be more similar to OpenCL. I personally have worked with OpenGL/CL extensively so I found Metal easy to pick up, but there might be more of a learning curve depending on prior experience.
     
  3. blueshogun96 thread starter macrumors regular

    blueshogun96

    Joined:
    Nov 24, 2012
    #3
    Well, my engine works similar to the Unreal engine, so users can choose the API they want to use during their gaming experience. I'm not going to drop OpenGL4 for Metal, but my engine is built for taking advantage of customization on a user and dev level. But believe me, it's anything but a waste of time :)

    If there's one thing I've learned in my experience so far is that Apple is more likely to feature a game that supports it's latest API, including Metal (but of course, the game actually has to be good and worthy of their promotion). Jumping on the bandwagon early is my motto.

    So far, I've only seen one Mac supported Metal sample. I'll search again given the keywords you've given me tonight. I'm not the biggest fan of Objective-C, but I can read it well enough to write what I need. Thanks.

    Shogun
     

Share This Page