1. Welcome to the new MacRumors forums. See our announcement and read our FAQ


Discussion in 'Mac Programming' started by SRossi, Jun 25, 2009.

  1. macrumors regular

    Im thinking of learning OpenGL but have a few questions first.

    Is there any advantage in learning OpenGL, like will it improve my applications or the such?

    If so what platform is it better to use OpenGL on? as I have access to a Windows machine and my Mac mini.

    And lastly is there any books that people recommend that I could use to help me along?

    I know its a longish post but im just trying to think of, Is OpenGL necessary for me?

  2. macrumors 603


    This seems a rather odd question.

    OpenGL is very good at what it does and as such if you need fast graphics then it will obviously benefit your application.

    Unlike DirectX OpenGL only deals with graphics (and a little bit of other random stuff if you include GLUT, which I wouldn't, SDL is much better) and so you will need to look into other APIs for audio etc.

    Personally I bought myself the red book and the orange book as they contain everything you need to know about it.

    I would use the Mac for OpenGL development as Apple include everything you need with the Xcode tools, it is a bit harder on Windows (although not much). The only problem you might have is that the graphics are not great on the Mac Mini.
  3. macrumors 6502a


    What sort of app are you writing or planning to write?

    b e n
  4. macrumors regular

    Thanks, I have used a bit of GLUT as Aaron Hillegass goes on about it in a chapter near the end. Those books look good may perhaps buy them both. Can I ask though what is it that DirectX does then because I always thought that it done the graphics for windows?

    Right now Im not planning on any projects but when I return to University I will be writing a lot of applications and I was hoping that OpenGL could be an added feature of these applications.

    Thanks for your help sooo far.


    PS would it be good to get the newer edition of the Red Book? http://www.amazon.co.uk/OpenGL-Programming-Guide-Official-Learning/dp/0321552628/ref=sr_1_10?ie=UTF8&s=books&qid=1245926319&sr=1-10. Means waiting though.
  5. macrumors 6502a

    I would say OpenGL is really only of use if you need or want to use high performance graphics, either 2D or 3D. So unless you're writing a game or designing an app which can make use of fast graphics then OpenGL isn't really going to be of that much use to you. On the other hand if you're interested in 3D anyway then go for it. Unless you're going to get into great depth with OpenGL then the previous edition of the book would be fine. It's going to take a while before the world moves to v3 anyway. Immediate Mode (which I think has been taken out of v3) may not be as high performance as vertex buffer objects etc but it is easy and fun to play around with.

    b e n
  6. macrumors regular

    Right I have gona and got the Red book.

    Question though What sort of application will I create in Xcode?


  7. macrumors 6502a

    For GLUT select C/C++ console application and add the OpenGL and GLUT frameworks. If you want to create a Cocoa based app then best have a look at one of the OpenGL examples in the Developer directory.

    b e n
  8. macrumors regular

    Thanks I tried that but the command "InatializeAWindowPlease();" threw any error.

    Any help?

  9. macrumors 603


    That is because it is just pseudo code in the book used to illustrate a point. You need to do your own window management which means using either GLUT, SDL, Carbon or Cocoa (or maybe even X11 if you are feeling brave :)).
  10. macrumors regular

    Got it to work :)

    Ended up just creating a new Cocoa app.

    Although im sure there is an easier way. I just dont know how to create a window only using code.

    Any help is appreciated.

  11. macrumors newbie

  12. macrumors G4

    It is also very useful for displaying scientific data. (data visualization) This data does not move fast. But I can display it using a natural coordinate system and let OpenGl transform it for display, perhaps by moving the time axis. It also is good to use if you need to export to other file formats like postcript or .jpg
  13. macrumors 65816


    Well, pure OpenGL might be overkill, but SDL I've found is quite useful. OpenGL is definitely faster though.
  14. macrumors 6502

    DirectX is a collection of libraries for high-performance multimedia tasks, where a programmer wants to write lower-level code. If you wanted to write a 'normal' application in Windows, such as a word processor or a 2d graphics package or a web browser or anything like that, you'd use other libraries. In very general terms, it's DirectX for speed but lots of hassle, other paths for ease of implementation and access to all the standard widgets and controls.

    One component of DirectX, DirectGraphics, represents a Microsoft-specific alternative to OpenGL. It's actually the new name for Direct3d with some minor additions to ameliorate for the removal of DirectDraw (the 2d-specific library). Microsoft supported OpenGL before Direct3d, but only on the NT-platform OSs, long before they were the mainstream releases. OpenGL's ongoing viability as a target for Windows owes a great deal to iD Software who chose OpenGL as a better library than an early version of Direct3d when the API was very different. It's managed to be popular with a sufficient number of teams in the interim to survive on the Windows platform, but I think it'd be accurate to say that the majority of Windows games sit on top of DirectGraphics.
  15. macrumors regular

    Thanks for all your help. Im finding that OpenGL isn't too hard to understand, already there's a few ideas that I have to use the skills im learning.

    And I think I'll give DirectX a miss, sounds a bit complicated and I dont plan on programming on windows.

    Overall I think so far into OpenGL its quite easy not much to learn other than all the functions that you can have but im glad that im learning a new framework.

    Thanks for all your help so far.

  16. macrumors regular

    Sorry to bring up this old thread but im wondering what is the newest version on OpenGL available on the mac just now? Because i've just got back into reading about OpenGL and found that there is 3.0 and 3.1 but i'm reading up on 2.1.

    So is 3.1 available for the mac?

    Thanks again,

  17. macrumors 603


    2.1 is the latest version of OpenGL that 10.5 supports. It is not yet public as far as I know which version of OpenGL 10.6 supports.

    I do believe that it is a fairly safe bet that Apple will have added support for 3.0 or 3.1 at least in 10.6.

    As an aside Khronos have just released the OpenGL 3.2 specification. I get the impression that they are starting to push OpenGL extremely hard now compared to in the past when they were perhaps a little less aggressive.
  18. macrumors regular

    Thanks man, knew I could relie on you :)

    Lets just hope that Apple include at least 3.1, the potential of 3.1 looks limitless, so lets hope.

  19. macrumors member

    If you're just starting out, you don't need anything more than 2.0. 3.1 removed basically everything that makes OpenGL easy, changing the learning curve into more of a learning cliff.
  20. macrumors regular

    Sorry for bringing up this old thread yet again, but i have been busy and just picked up OpenGL again at the start of this week, and I am now at the Imaging "Subset" and the Pipeline.

    What I would like to know is in Snow Leopard is the Imaging "Subset" available? Because in an example it uses imaging subset and gives an error if it is not supported. Could this be a graphics card limit? As I only have the Intel GMA 950.



Share This Page