Cocoa and OpenGL entry points?
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?
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: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.
You don't need to dynamically load extension function pointers on the Mac. Just call the functions as you would any normal GL function.
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.
If I'm interpreting that right, score one for Apple Dev Tools.
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
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
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.
Possibly Related Threads...
| Thread: | Author | Replies: | Views: | Last Post | |
| Opengl/Cocoa text rendering | tesil | 15 | 14,416 |
Mar 20, 2012 11:16 AM Last Post: OneSadCookie |
|
| Two gluProject points? | mikey | 5 | 4,072 |
Jan 5, 2012 01:03 PM Last Post: mikey |
|
| OpenGL Text Rendering (in Cocoa) | daveh84 | 5 | 6,621 |
Feb 19, 2009 12:44 PM Last Post: TomorrowPlusX |
|
| OpenGL & Cocoa - Improving frame rate | daveh84 | 4 | 4,916 |
Feb 2, 2009 06:53 AM Last Post: backslash |
|
| bad depth sorting in Cocoa OpenGL | aldermoore | 2 | 4,100 |
Dec 30, 2008 03:07 PM Last Post: ThemsAllTook |
|

