Andy Ross wrote:
> But the simplest solution is to use the standard fmod() (which returns
> a double) instead of fmodf() (which returns a float) by casting the
> result to a float.
I'm currently experimenting with a change like this and so far I don't
experience any drawbacks:
--- shadanim.cxx.original 2005-10-08 13:52:48.000000000 +0200
+++ shadanim.cxx 2005-10-13 10:37:34.000000000 +0200
@@ -175,7 +175,7 @@
// noise texture, tex coord from the model translated by a time factor
glActiveTexturePtr( GL_TEXTURE0_ARB );
glEnable(GL_TEXTURE_2D);
- const float noiseDist = fmodf(- totalTime * my_shader->_factor *
my_shader->_speed, 4.0f);
+ const double noiseDist = fmod(- totalTime * my_shader->_factor *
my_shader->_speed, 4.0f);
glMatrixMode(GL_TEXTURE);
glLoadIdentity();
glTranslatef( noiseDist, 0.0f, 0.0f );
Could this be an approach that people would call tolerable (as I'm no
C++ programmer at all) ?
Thanks,
Martin.
--
Unix _IS_ user friendly - it's just selective about who its friends are !
--------------------------------------------------------------------------
_______________________________________________
Flightgear-devel mailing list
[email protected]
http://mail.flightgear.org/mailman/listinfo/flightgear-devel
2f585eeea02e2c79d7b1d8c4963bae2d