PDA

View Full Version : Simple OpenGL/Xcode Question.


loopfick
2005.08.09, 01:27 PM
Hello,

I have a very easy question: Has anyone ever gotten the NeHe OpenGL tutorials to work with Xcode?

I won't post any problems I'm having...I just want to know if anyone has gotten them to work...then I'll post the errors. I'm missing something very simple, obviously.

The only tutorial that works for me is OneSadCookie's GLUT tutorial.

unknown
2005.08.09, 01:41 PM
I got the ones Ive tried to work.
Some are made for xcode (Download the Cocoa/Mac OS X version) but they sometimes need you to add the OpenGL libraries for it to compile. In Target inspector/Build Phases add OpenGL.framework to Frameworks and Libraires group. It is the equavalent of adding -I/System/Library/Frameworks/OpenGL.framework/Headers to the gcc call.

loopfick
2005.08.09, 02:01 PM
Thank you for answering my question. :) I did add the GLUT and OpenGL frameworks to the project. I guess I'll try to look at the Mac OS downloads, but I prefer to use Carbon or C++.

That's the error I'm getting with the first tutorial...

ZeroLink: unknown symbol '_ReSizeGLScene'

Executable “ffdff” has exited due to signal 6 (SIGABRT).

Thanks again! :D

LongJumper
2005.08.09, 02:42 PM
That means you don't have a function defined called ReSizeGLScene, and you are trying to call it somewhere.

loopfick
2005.08.09, 03:11 PM
Hi Long Jumper!

Yes...I thought that this function would be defined in the GLUT or OpenGL framework...but I'm sure I'll figure out where it is. :)

unknown
2005.08.09, 03:32 PM
If there is a glutReshapeFunc(void (*func)(int width, int height)) where ReSizeGLScene is passed when somthing else like resizeGLScene is defined?

loopfick
2005.08.09, 03:55 PM
Oh...I'M supposed to define the function! Sorry...

LongJumper
2005.08.09, 07:34 PM
Yes, GLUT works in a way where it does all the work of calling your functions when the application needs to. You simply just send a function to one of the glut*Func's, depending on what you want to do. There is a whole less of them, the important one is the drawing function, which I can't think of the name of right now.

unknown
2005.08.09, 07:40 PM
Its glutDisplayFunc(myFunc) to make myFunc the graphics callback.

loopfick
2005.08.10, 01:20 PM
Thank you for the replies! I got the tutorials working now. I guess it just wasn't obvious to me that I could use any function I wanted to to do the drawing. In the first NeHe tutorial, the drawing functions weren't defined, and I thought they were supposed to be in the frameworks...

Since I was going with the logic that 'if I can't get the first tutorial right, then why do the second?', I never saw that in the second tutorial, they are defined! :)

Volte
2005.09.08, 01:54 PM
EDIT: Never mind, was on the compete wrong track. Got things working now. (Thanks to Keith) http://onesadcookie.com/~keith/XcodeGLUT