Getting Started with OpenGL - Mac

Moderator
Posts: 608
Joined: 2002.04
Post: #16
There are numerous Cocoa OpenGL examples here at iDG (in the source code section) and With a Y has Cocoa ports of NeHe's tutorials. On the other hand, if you wish to continue with C++, I would recommend checking out sealfin's ports. (How are those going, btw?) If you ever have a specific question about programming or OpenGL, feel free to ask away. There are some gurus that frequent the boards that seem to be living programming references (you know who you are LOL ). Good luck! Programming can be tricky but extremely rewarding!
Quote this message in a reply
ThrottleMonkey
Unregistered
 
Post: #17
Ok, I've got all these files on my comptuer and no idea where to begin. Thanks for your patience so far.

I guess it would kind of help if everyone posted where they began with it all. Right now it's kind of overwhelming. The dedication is still there, and I can almost taste a beginning... but I'm really rather confused on where to start.

I guess I'm just lost!

Sure, programming can be tricky... but GETTING to the point where you can actually put in some kind of code seems to be the biggest step for me! Wacko Help!

Also, when I open Project Builder (and am going through NEHE's first tutorial), select "File>NewProject" it gives me a screen that says "empty project" as my only option... This is an empty project with no files, targets, or build styles.

Where as NEHE's tutorial says I should be able to select a "Cocoa Application"... whatever he means there.
Quote this message in a reply
DoG
Moderator
Posts: 869
Joined: 2003.01
Post: #18
Actually, I started with the opengl redbook, and only then went on to nehe tuts after I thought I understand the basics.
Quote this message in a reply
Mars_999
Unregistered
 
Post: #19
I started with getting a good grasp on C++, and then got SDL and worked with that, and then bought the OpenGL game programming book and used SDL with it. The first thing to do is setup OpenGL and from their make a triangle and display it!! Then change the colors then rotate it and shift it ect.... Baby steps my young grasshopper!! I was the same way when I first was learning OpenGL and C++. Still got plenty to learn but who doesn't!! Wow
Quote this message in a reply
Member
Posts: 269
Joined: 2005.04
Post: #20
Quote: Also, when I open Project Builder (and am going through NEHE's first tutorial), select "File>NewProject" it gives me a screen that says "empty project" as my only option... This is an empty project with no files, targets, or build styles.


Whoa. Are you sure? That's really weird. You should see "Empty Project" at the very top, with a bunch of subheadings like "Application," "Bundle," "Framework," etc. Try reinstalling Project Builder.

Okay. How to get started with OpenGL First of all, you should read this article on setting up OpenGL in Cocoa (a notoriously hard article to find considering it's found in the *Carbon* docs). Just follow it step by step and you'll learn how to create an OpenGL View and draw things in it. After you've done that you're ready for the NeHe lessons. There's Cocoa code at the bottom of every sample that you can follow along with. Stick to the first 8 lessons until you've really got everything down.

Also see this documentation and this sample code.

Going through all that will probably take about two weeks for you to really learn it. Then you'll be ready for more advanced topics. Buy a copy of the OpenGL Red Book. It's value can not be overstated (though don't begin with the book). Oh, and I'd stay away from GLUT or SDL, at least at first. You're not really learning if you're letting them do all the work for you.
Quote this message in a reply
Feanor
Unregistered
 
Post: #21
ThrottleMonkey,

The hardest problem I ever had with programming was getting familiar with the tools. They are large, they are complicated, and they replace another kind of complication which exists under the surface. It took me quite a long time and a lot of different tools to finally get comfortable with the peripheral issues which are essential. Writing software requires a knowledge of the platform, especially the runtime.

It's too bad there isn't a short intro guide to the Mac OS X runtime. Apple has a big complicated one, and you might do well to skim the introduction to it: Mac OS X Runtime Architecture. Very briefly, there is language, preprocessing, compiling, assembling, and linking. You should know a little about all of those (a lot about language), although compiling and assembling is mostly automatic. Now you know why people sometimes prefer BASIC or Java or another language where much of this is hidden from you.

Another key point is libraries (or frameworks): pre-compiled code provided by the operating system or third parties which you can take advantage of using the interface, by including the correct header files and linking to the library or framework. Read the Project Builder help files to learn about linking.

Once you understand a bit about the context of writing code, you will feel much more comfortable, and can then worry about the specifics of dealing with the OpenGL framework and its conventions. That will include learning the terminology of 3D rendering and the data types and functions used to access OpenGL's rendering features.

At this point, you must simply accept that there is a minimum amount of reading, searching, head scratching and question posing in order to go from treading water to swimming. If you take your time and don't panic, you will have no problem.
Quote this message in a reply
Moderator
Posts: 608
Joined: 2002.04
Post: #22
Quote:Originally posted by ThrottleMonkey
Also, when I open Project Builder (and am going through NEHE's first tutorial), select "File>NewProject" it gives me a screen that says "empty project" as my only option... This is an empty project with no files, targets, or build styles.
That's a new one. As Bachus said, you should see a lot of options. If you don't, perhaps you should try a different version? Blink
Quote this message in a reply
ThrottleMonkey
Unregistered
 
Post: #23
Doh! I moved my "Developer" folder to a different location... hence the empty project dilema.

You guys rock! Thanks for all your help! Though I'm sure you'll hear panic filled cries from me still.
Quote this message in a reply
ThrottleMonkey
Unregistered
 
Post: #24
Ok, here's another question...

Since I can run Project Builder now, if I want the OpenGL tutorials to work that are provided by NEHE, do I just cut and paste? Sure I have to add the frameworks... but when I DO cut and paste after doing all the other stuff (adding frameworks) i get a bunch of build errors. What gives?
Quote this message in a reply
Luminary
Posts: 5,143
Joined: 2002.04
Post: #25
What errors do you get?
Quote this message in a reply
Feanor
Unregistered
 
Post: #26
NeHe, as I mentioned, wrote his tutorials for Windows. They will not work as is for Mac. Download the best match project file from the link at the bottom of the page. You have to decide whether to use AGL (Carbon), NSGL (Cocoa) or GLUT. I recommend GLUT. Start with the OS X GLUT tutorial, which spells everything out for you. Then continue onto the tutorials proper. There are also a ton of GLUT samples in the developer/examples/OpenGL/GLUT folder, all part of one uber-project, with which you can build a single project (recommended) or all the projects at once (not recommended).

Note on Project Builder: I strongly recommend choosing a shared build folder for projects, and not storing build products inside each project folder, especially with the samples. This will save you from some aggravations later. Read the Project Builder release notes and developer tools help topics now! Failure to heed this requirement will bring the anger of the OS X Developer gods (the Apple engineers) down upon you!
Quote this message in a reply
ThrottleMonkey
Unregistered
 
Post: #27
Bachus:

Quote:Originally posted by Bachus
Okay. How to get started with OpenGL First of all, you should read this article on setting up OpenGL in Cocoa (a notoriously hard article to find considering it's found in the *Carbon* docs). Just follow it step by step


Thanks for the link man, it looks way helpful.
Quote this message in a reply
ThrottleMonkey
Unregistered
 
Post: #28
Okie dokie, I've already run into another problem.

On the 1st lesson mentioned in the quote above from Bachus, when it comes time to "Build and Run" I think I've done everything right, but I get the following error:


Missing file or directory: Green
Missing file or directory: Triangle_Prefix.h

Now, the file "Green Triangle_Prefix.h" exists... but it was in the "Other Sources" group folder. Does this matter?

Since it's breaking that into two files or directories, do I need to put an underscore between "Green" and "Triangle"?

Any hints? I'll keep re-working the tutorial again and again to make sure I'm not doing anything dumb. Rasp


*** EDIT !!! ***
Ok, YES! It was the fact that "Green Triangle_Prefix.h" were separated. Apple should make note of that for n00bs like me. Oh... and BTW... I DREW A GREEN TRIANGLE!!! Wow
*cough* ok, more like jacked some code... LOL Back to the tutorials I go!

Thanks again everyone for all your help!
Quote this message in a reply
ThrottleMonkey
Unregistered
 
Post: #29
Cheers! I now have a pulsating green triangle!

:ohmy:

Hmm... I still don't know what I just did. Rolleyes

Do the rest of those courses clear things up a bit? It seems like GL has a few new commands up its sleeve I'm still a bit fuzzy on.
Quote this message in a reply
Moderator
Posts: 916
Joined: 2002.10
Post: #30
which commands are you unsure of? also, most (all?) opengl commands have a man page you can use to understand the function in depth
Quote this message in a reply
Post Reply 

Possibly Related Threads...
Thread: Author Replies: Views: Last Post
  Getting started with OpenGL XxtraLarGe 8 3,495 Mar 20, 2006 05:40 PM
Last Post: wadesworld