[fpc-devel] Is GLUT_EXCLUSIVE_FPUMODE really needed?
Michalis Kamburelis
michalis.kambi at gmail.com
Sat Nov 27 09:34:59 CET 2010
Hi,
This applies to GLUT_EXCLUSIVE_FPUMODE mode inside
packages/opengl/src/glut.pp source code. Reading history, I see it was
caused by this bug and patch:
http://bugs.freepascal.org/view.php?id=7570 . However, it's not needed
anymore, IMHO. It seems submitter of #7570 hacked glut unit, suspecting
the troubles inside GLUT, while in fact it is OpenGL library causing
floating point trouble.
Moreover, since FPC 2.2.0, we have a correct fix inside the gl.pp unit
itself (see #5914 and #7570). Inside gl.pp, we do SetExceptionMask to
hide fpu errors that may be raised by some OpenGL implementations on all
x86. This, in my view, makes the GLUT_EXCLUSIVE_FPUMODE not needed. The
GLUT_EXCLUSIVE_FPUMODE duplicates the work (adds the same ExceptionMask
flags) that is already done, in much simpler way, by gl.pp initialization.
Comments?
P.S. On an unrelated note, I'm preparing a patch to add freeglut
extensions to glut unit. It's actually ready, but now I'm wondering if
it's worth the trouble to deal with complications caused by
GLUT_EXCLUSIVE_FPUMODE, when instead we could just remove the
GLUT_EXCLUSIVE_FPUMODE hack :)
Michalis
More information about the fpc-devel
mailing list