Getting started with OpenGL on OSX

Started by
3 comments, last by Rimher 11 years, 7 months ago
Hello there,
I'm new over here, but I'm not exactly new to programming; I've studied Java, C, a bit of C++, and, since I got a Mac recently, I was trying to build my own knowledge of Obj-C.
Recently I was trying to learn a little bit of OpenGL, but almost everything that I've found online is windows-related. Can you guys help me find something suitable for OSX as well??

Thanks in advance
Advertisement
I just started playing with OpenGL, with Java + lwjgl. So, even though I'm developing on OSX as well, there's nothing platform specific here. So that's the extent of my OpenGL experience.

Using a search engine I found this: http://developer.apple.com/library/mac/#documentation/graphicsimaging/conceptual/opengl-macprogguide/opengl_intro/opengl_intro.html#//apple_ref/doc/uid/TP40001987-CH207-TP9
I skimmed through this a bit and it looks promising. Just look at the table of contents and see what looks useful to you. There seem to be plenty of code samples. I'm assuming you're using Xcode, so getting your environment set up will be the only major challenge. developer.apple.com should have the info you need to get this set up.

Keep in mind, OpenGL itself is not platform specific. So, once you have a library which implements the OpenGL API, the API calls are pretty much the same, no matter what is language or platform. For example, this objective-c code is almost identical to what I would do in Java (using lwjgl) to draw a triangle:

static void drawAnObject ()
{
glColor3f(1.0f, 0.85f, 0.35f);
glBegin(GL_TRIANGLES);
{
glVertex3f( 0.0, 0.6, 0.0);
glVertex3f( -0.2, -0.3, 0.0);
glVertex3f( 0.2, -0.3 ,0.0);
}
glEnd();
}


Again, once have a proper lib set up for your language/platform, you then just need to learn the OpenGL API.

The wikipedia article about OpenGL has a lot of good info, including history, concepts, and features: http://en.wikipedia.org/wiki/OpenGL

Hope that helps.
One way it to find SDL, Allegro or any other cross platform library and start coding.

On a quick search try this tutorial series. Also Apple seem to have some coding samples with OpenGL on their developer site.
Hope that helps.
Ony little differences to other Unix/Linux. Anyway, I won't bother about that company anymore...

I just started playing with OpenGL, with Java + lwjgl. So, even though I'm developing on OSX as well, there's nothing platform specific here. So that's the extent of my OpenGL experience.

Using a search engine I found this: http://developer.app...01987-CH207-TP9
I skimmed through this a bit and it looks promising. Just look at the table of contents and see what looks useful to you. There seem to be plenty of code samples. I'm assuming you're using Xcode, so getting your environment set up will be the only major challenge. developer.apple.com should have the info you need to get this set up.

Keep in mind, OpenGL itself is not platform specific. So, once you have a library which implements the OpenGL API, the API calls are pretty much the same, no matter what is language or platform. For example, this objective-c code is almost identical to what I would do in Java (using lwjgl) to draw a triangle:

static void drawAnObject ()
{
glColor3f(1.0f, 0.85f, 0.35f);
glBegin(GL_TRIANGLES);
{
glVertex3f( 0.0, 0.6, 0.0);
glVertex3f( -0.2, -0.3, 0.0);
glVertex3f( 0.2, -0.3 ,0.0);
}
glEnd();
}


Again, once have a proper lib set up for your language/platform, you then just need to learn the OpenGL API.

The wikipedia article about OpenGL has a lot of good info, including history, concepts, and features: http://en.wikipedia.org/wiki/OpenGL

Hope that helps.
Thanks a lot, sometimes too much information is not information at all.
I'll start with wikipedia, and I'll try and see what the apple developers have in store! ;)

This topic is closed to new replies.

Advertisement