Simple OpenGL/Xcode Question.

loopfick
Unregistered
 
Post: #1
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.
Quote this message in a reply
Sage
Posts: 1,403
Joined: 2005.07
Post: #2
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.
Quote this message in a reply
loopfick
Unregistered
 
Post: #3
Thank you for answering my question. Smile 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! Grin
Quote this message in a reply
Moderator
Posts: 133
Joined: 2008.05
Post: #4
That means you don't have a function defined called ReSizeGLScene, and you are trying to call it somewhere.
Quote this message in a reply
loopfick
Unregistered
 
Post: #5
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. Smile
Quote this message in a reply
Sage
Posts: 1,403
Joined: 2005.07
Post: #6
If there is a glutReshapeFunc(void (*func)(int width, int height)) where ReSizeGLScene is passed when somthing else like resizeGLScene is defined?

Sir, e^iπ + 1 = 0, hence God exists; reply!
Quote this message in a reply
loopfick
Unregistered
 
Post: #7
Oh...I'M supposed to define the function! Sorry...
Quote this message in a reply
Moderator
Posts: 133
Joined: 2008.05
Post: #8
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.
Quote this message in a reply
Sage
Posts: 1,403
Joined: 2005.07
Post: #9
Its glutDisplayFunc(myFunc) to make myFunc the graphics callback.

Sir, e^iπ + 1 = 0, hence God exists; reply!
Quote this message in a reply
loopfick
Unregistered
 
Post: #10
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! Smile
Quote this message in a reply
Member
Posts: 89
Joined: 2005.06
Post: #11
EDIT: Never mind, was on the compete wrong track. Got things working now. (Thanks to Keith) http://onesadcookie.com/~keith/XcodeGLUT
Quote this message in a reply
Post Reply 

Possibly Related Threads...
Thread: Author Replies: Views: Last Post
  Xcode gdb SIGTRAP on an OpenGL Project mikey 4 3,526 May 25, 2009 03:39 AM
Last Post: mikey
  simple question (private) imaumac 9 3,729 Oct 21, 2008 09:37 PM
Last Post: imaumac
  XCode OpenGL Game Engine MoltenWhale 20 12,606 Aug 17, 2008 07:10 AM
Last Post: ThemsAllTook
  simple Question about movement bonanza 3 2,964 Oct 17, 2007 11:12 AM
Last Post: bonanza
  OpenGL question Leroy 2 2,059 Apr 28, 2007 04:48 PM
Last Post: BinarySpike