OpenGL + Xcode 4

Discussion in 'Mac Programming' started by robvas, Feb 4, 2012.

  1. macrumors 68000

    Joined:
    Mar 29, 2009
    Location:
    USA
    #1
    I seem to remember in Xcode 3 there was a project template that used an OpenGL-based view. Is it hiding in Xcode 4, or is there a link to a tutorial on setting it up from scratch?
     
  2. robvas, Feb 4, 2012
    Last edited: Feb 4, 2012

    thread starter macrumors 68000

    Joined:
    Mar 29, 2009
    Location:
    USA
    #2
    I got it all figured out. I think before there was a template provided by SDL which I used a long time ago. I looked through an old OpenGL tutorial I wrote and the second edition of 'Cocoa Programming for OS X' (old, but it still has some relevance) and came up with this:

    [​IMG]

    I included the project file if anyone wants to play with it. Visit the NeHe page for OpenGL tutorials - http://nehe.gamedev.net/tutorial/lessons_01__05/22004/
     

    Attached Files:

    • OGL.zip
      File size:
      32.7 KB
      Views:
      165
  3. macrumors member

    Mark FX

    Joined:
    Nov 18, 2011
    #3
    No its not hiding robvas, there is no OpenGL Mac project template in Xcode 4.
    But there is a OpenGL Game template in the iOS templates.

    You could create one and put it in the
    ~/Library/Developer/Xcode/Templates/Project Templates/Application/OpenGL
    Folder, then it would be displayed on creating a new Xcode project.

    A good start for a template, would be a standard Cocoa or Empty application, and then add the OpenGL.framework and the GLUT.framework, from the
    project navigator, under the linked frameworks heading, click the + button to
    add these frameworks.

    Then you could also add a new Objective C Class file to the project, and type
    in OpenGLView as its class name, and type in NSOpenGLView as its subclass.

    You can also drag a OpenGL View object from the Object Library in Interface
    Builder, onto the main Window, and set its class to the previously added file
    OpenGLView.

    Thats how I would go about getting a basic OpenGL project template.

    Hope this helps.

    Regards Mark

    PS. I posted this after you found a solution, well done for that.
     
  4. macrumors 6502a

    Joined:
    May 10, 2009
    Location:
    Des Moines, WA
    #4
    A bit dated but gives the basics with interactive API presentation.

    <http://user.xmission.com/~nate/tutors.html>
     
  5. macrumors 604

    chrono1081

    Joined:
    Jan 26, 2008
    Location:
    Isla Nublar
    #5
    I am so happy NeHe has been doing iOS tutorials. I know there is only two but I hope the trend continues.

    I love OpenGL and every time I get back in to it some other project rips me right back out.
     

Share This Page