1
0
Fork 0

Fog tweaks.

This commit is contained in:
curt 1998-04-24 14:19:29 +00:00
parent 2addcf2e76
commit a144bfc090
2 changed files with 20 additions and 15 deletions

View file

@ -108,7 +108,7 @@ void GLUTkey(unsigned char k, int x, int y) {
return; return;
case 90: /* Z key */ case 90: /* Z key */
w->visibility /= 1.10; w->visibility /= 1.10;
xglFogf (GL_FOG_START, w->visibility / 10000000.0 ); xglFogf (GL_FOG_START, w->visibility / 1000000.0 );
xglFogf(GL_FOG_END, w->visibility); xglFogf(GL_FOG_END, w->visibility);
fgPrintf( FG_INPUT, FG_DEBUG, fgPrintf( FG_INPUT, FG_DEBUG,
"Fog density = %.4f\n", w->visibility ); "Fog density = %.4f\n", w->visibility );
@ -168,7 +168,7 @@ void GLUTkey(unsigned char k, int x, int y) {
return; return;
case 122: /* z key */ case 122: /* z key */
w->visibility *= 1.10; w->visibility *= 1.10;
xglFogf (GL_FOG_START, w->visibility / 10000000.0 ); xglFogf (GL_FOG_START, w->visibility / 1000000.0 );
xglFogf(GL_FOG_END, w->visibility); xglFogf(GL_FOG_END, w->visibility);
fgPrintf( FG_INPUT, FG_DEBUG, fgPrintf( FG_INPUT, FG_DEBUG,
"Fog density = %.4f\n", w->visibility); "Fog density = %.4f\n", w->visibility);
@ -266,11 +266,14 @@ void GLUTspecialkey(int k, int x, int y) {
/* $Log$ /* $Log$
/* Revision 1.2 1998/04/24 00:49:17 curt /* Revision 1.3 1998/04/24 14:19:29 curt
/* Wrapped "#include <config.h>" in "#ifdef HAVE_CONFIG_H" /* Fog tweaks.
/* Trying out some different option parsing code.
/* Some code reorganization.
/* /*
* Revision 1.2 1998/04/24 00:49:17 curt
* Wrapped "#include <config.h>" in "#ifdef HAVE_CONFIG_H"
* Trying out some different option parsing code.
* Some code reorganization.
*
* Revision 1.1 1998/04/22 13:25:40 curt * Revision 1.1 1998/04/22 13:25:40 curt
* C++ - ifing the code. * C++ - ifing the code.
* Starting a bit of reorganization of lighting code. * Starting a bit of reorganization of lighting code.

View file

@ -200,7 +200,7 @@ static void fgInitVisuals( void ) {
xglLightfv( GL_LIGHT0, GL_POSITION, l->sun_vec ); xglLightfv( GL_LIGHT0, GL_POSITION, l->sun_vec );
xglFogi (GL_FOG_MODE, GL_LINEAR); xglFogi (GL_FOG_MODE, GL_LINEAR);
xglFogf (GL_FOG_START, w->visibility / 10000000.0 ); xglFogf (GL_FOG_START, w->visibility / 1000000.0 );
xglFogf (GL_FOG_END, w->visibility); xglFogf (GL_FOG_END, w->visibility);
// xglFogf (GL_FOG_DENSITY, w->visibility); // xglFogf (GL_FOG_DENSITY, w->visibility);
xglHint (GL_FOG_HINT, GL_NICEST /* GL_FASTEST */ ); xglHint (GL_FOG_HINT, GL_NICEST /* GL_FASTEST */ );
@ -647,9 +647,8 @@ int main( int argc, char **argv ) {
fgPrintf( FG_GENERAL, FG_EXIT, "\nShutting down ...\n"); fgPrintf( FG_GENERAL, FG_EXIT, "\nShutting down ...\n");
} }
// This is the general house keeping init routine. It initializes the // These are a few miscellaneous things that aren't really
// debug trail scheme and then any other stuff. // "subsystems" but still need to be initialized.
if( !fgInitGeneral()) { if( !fgInitGeneral()) {
fgPrintf( FG_GENERAL, FG_EXIT, "General initializations failed ...\n" ); fgPrintf( FG_GENERAL, FG_EXIT, "General initializations failed ...\n" );
} }
@ -663,22 +662,22 @@ int main( int argc, char **argv ) {
"Subsystem initializations failed ...\n" ); "Subsystem initializations failed ...\n" );
} }
// setup view parameters, only makes GL calls // setup OpenGL view parameters
fgInitVisuals(); fgInitVisuals();
if ( use_signals ) { if ( use_signals ) {
// init timer routines, signals, etc. Arrange for an // init timer routines, signals, etc. Arrange for an alarm
// alarm signal to be generated, etc. // signal to be generated, etc.
fgInitTimeDepCalcs(); fgInitTimeDepCalcs();
} }
// Initialize the GLUT Event Handlers. // Initialize the various GLUT Event Handlers.
if( !fgGlutInitEvents() ) { if( !fgGlutInitEvents() ) {
fgPrintf( FG_GENERAL, FG_EXIT, fgPrintf( FG_GENERAL, FG_EXIT,
"GLUT event handler initialization failed ...\n" ); "GLUT event handler initialization failed ...\n" );
} }
// pass control off to the GLUT event handler // pass control off to the master GLUT event handler
glutMainLoop(); glutMainLoop();
// we never actually get here ... but just in case ... :-) // we never actually get here ... but just in case ... :-)
@ -695,6 +694,9 @@ extern "C" {
// $Log$ // $Log$
// Revision 1.4 1998/04/24 14:19:30 curt
// Fog tweaks.
//
// Revision 1.3 1998/04/24 00:49:18 curt // Revision 1.3 1998/04/24 00:49:18 curt
// Wrapped "#include <config.h>" in "#ifdef HAVE_CONFIG_H" // Wrapped "#include <config.h>" in "#ifdef HAVE_CONFIG_H"
// Trying out some different option parsing code. // Trying out some different option parsing code.