Cocoa and OpenGL entry points?

napthali
Unregistered
 
Post: #1
I'm trying to implement volumetric fog in my application, but I can't seem to work the GL extension entry points properly.

I've tried adapting NeHe's Lesson 41 using this technote from Apple, but I keep getting linking errors with multiple definitions of NSGLGetProcAddress and pfglFogCoordfEXT (which is what I'm calling the function), even adding "#ifndef ... #endif"'s for good measure.

Am I going about this the entirely wrong way? Is there a better way to do volumetric fog? If this is indeed the best way, how can I get around this entry point problem?
Quote this message in a reply
DoG
Moderator
Posts: 869
Joined: 2003.01
Post: #2
Quote:Originally posted by napthali

Am I going about this the entirely wrong way? Is there a better way to do volumetric fog? If this is indeed the best way, how can I get around this entry point problem?

You could do volumetric fog the hard way, without that gl extension, but its definitely not better.

Why do you need the function pointers?

Check what frameworks you are binding to, its definitely some funky linking stuff going on.
Quote this message in a reply
Luminary
Posts: 5,143
Joined: 2002.04
Post: #3
You don't need to dynamically load extension function pointers on the Mac. Just call the functions as you would any normal GL function.
Quote this message in a reply
napthali
Unregistered
 
Post: #4
OneSadCookie, could you elaborate a bit? Can I just call glFogCoordfEXT()? No specific headers need to be included?

If I'm interpreting that right, score one for Apple Dev Tools. Wink
Quote this message in a reply
Luminary
Posts: 5,143
Joined: 2002.04
Post: #5
You need to include <OpenGL/glext.h>, but yep, then you can just call glFogCoordEXT (of course, check for extension support first, or suffer the consequences)...

It's both a good thing and a bad thing. I think these days, I lean more towards bad... but that rant's for another thread and another day Wink
Quote this message in a reply
Moderator
Posts: 3,571
Joined: 2003.06
Post: #6
Hey napthali, let us know if you manage to get lesson 41 going. I tried a few months ago without success (didn't spend much time trying though, stupid priorities). GL volumetric fog would be real groovy to play around with.
Quote this message in a reply
Post Reply 

Possibly Related Threads...
Thread: Author Replies: Views: Last Post
  Opengl/Cocoa text rendering tesil 15 16,788 Mar 20, 2012 11:16 AM
Last Post: OneSadCookie
  Two gluProject points? mikey 5 4,885 Jan 5, 2012 01:03 PM
Last Post: mikey
  OpenGL Text Rendering (in Cocoa) daveh84 5 7,662 Feb 19, 2009 12:44 PM
Last Post: TomorrowPlusX
  OpenGL &amp; Cocoa - Improving frame rate daveh84 4 5,407 Feb 2, 2009 06:53 AM
Last Post: backslash
  bad depth sorting in Cocoa OpenGL aldermoore 2 4,535 Dec 30, 2008 03:07 PM
Last Post: ThemsAllTook