As you can see i have commit a full revision of the fog functions.
But I have changed a bit the usual way of manage fog in opengl.
Now you have to change the properties with
void raydium_fog_mode_set(GLuint mode)
int raydium_fog_mode_get(void)
void raydium_fog_density_set(GLfloat density)
float raydium_fog_density_get(void)
void raydium_fog_near_set(GLfloat near)
float raydium_fog_near_get(void)
void raydium_fog_far_set(GLfloat far)
float raydium_fog_far_get(void)
But, you will have to use one of the next function to make effective the last changes. In fact , the above functions DO NOT CHANGE openGL stuff, just raydium internals. So the bottom functions are needed to apply the changes:
void raydium_fog_enable(void)
void raydium_fog_disable(void)
void raydium_fog_apply(void)
void raydium_fog_wait(void)
enable and disable are obvious.
raydium_fog_apply is the function that really applies the changes.
raydium_fog_wait is used to temporaly stop the use of fog withouf change the raydium internals about fog. The next tiem you use
raydium_fog_apply, everything (should) returns to the previous state. Usefull for certain rendering operations (or i think so).
For example to see the real world use, you can edit mania_drive.c and let the end of the file like this:
Code:
raydium_fog_mode_set(RAYDIUM_FOG_MODE_LINEAR);
raydium_fog_color_update();
raydium_fog_near_set(0);
raydium_fog_far_set(10.0f);
//raydium_fog_density_set(0.15f);
raydium_fog_enable();
raydium_callback(&display);
return 0;
}
or, if you want to see exponential fog, you can try with this:
Code:
raydium_fog_mode_set(RAYDIUM_FOG_MODE_EXP2);
raydium_fog_color_update();
//raydium_fog_near_set(0);
//raydium_fog_far_set(10.0f);
raydium_fog_density_set(0.15f);
raydium_fog_enable();
raydium_callback(&display);
return 0;
}