Is there any reason you can't just use the built in with OpenGL? For example, to enable fog, you just need the following:
// Enables fog. glEnable(GL_FOG);
// Parameters for the fog glFogi(GL_FOG_COLOR, GL_LINEAR); // fog mode set to linear, could also use GL_EXP or GL_EXP2
GLfloat fogColor[] = {0.5, 0.5, 0.5, 1.0}; glFogfv(GL_FOG_COLOR, fogColor);
glFogf(GL_FOG_DENSITY, 0.5); // or whatever density you want instead of 0.5 glFogf(GL_FOG_START, 1.0); // (in current MV matrix) where the fog interpolation begins glFogf(GL_FOG_END, 10.0); // depth (in current MV matrix) where the fog ends
There a few more options, be sure to read up on them. By the way, I wrote the code above in-email, so it might be perfect.
As far as where to put this code, if this is a Cocoa app and you are using a subclass of NSOpenGLView, I like to put it in initWithFrame: or initWithCoder: (unless of course the fog is dynamic). If you are using GLUT, you could have a function off of main that enables things like fog, depth buffers, etc. But if worse comes to worse, you could always put it in your display function (drawRect: for Cocoa or whatever your GLUT window display function is), but that is not optimal as glEnable calls can be expensive.
It looks like PFNGLFOGCOORDFEXTPROC and the other types you got are Windows API only, and definitely not supported with Mac OS X. The best thing hear is just to use the fog built-in with OpenGL.
Hope that helps.
Kevin
---------------------- Kevin Cathey
Do not post admin requests to the list. They will be ignored.
Xcode-users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden
|