Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Exception crashes Borland opengl program

5 views
Skip to first unread message

L.J. Wischik

unread,
Jan 19, 1999, 3:00:00 AM1/19/99
to
My opengl program ran fine on most machines, but on my brother's notebook
it crashed with a floating point exception. I'm using Borland C++Builder
3.

I read on Scott Heiman's page (http://www.gnt.net/~heiman/opengl.htm) that
we can disable floating point exceptions with the following code:
_control87(MCW_EM, MCW_EM); /* defined in float.h */

This appears to work correctly. However, I'm writing just an OpenGL
component that other developers can stick into their forms: it would be
wrong of me to reprogram the FPU behaviour of the entire program. I'd like
to just be able to catch the floating point exceptions, and I don't know
how to do it.

I tried this code:
try {bunch of gl functions} catch (EMathError &err) {}
but it didn't work: the programs screen went blank and it crashed. (my
brother didn't relate what the error message was).

So: does anyone know, please, how to catch floating point exceptions
without reprogramming the FPU?

--
Lucian Wischik, Queens' College, Cambridge CB3 9ET. www.wischik.com/lu

Iain Russell

unread,
Jan 23, 1999, 3:00:00 AM1/23/99
to
I'm using BC++3 and I sometimes get a crash within the gdi thread
called from opengl32.dll. Seems to be when my spinning cube is facing
a certain way... I'd be interested in anyone else's experiences with
this.

Scott Heiman

unread,
Jan 23, 1999, 3:00:00 AM1/23/99
to
There is a well known problem with the OpenGL lighting model that causes
occasional floating point exceptions. Microsoft ignores the floating point
exceptions, Borland does not. You can disable Borland's floating point
exception handler by calling

_control87(MCW_EM,MCW_EM);

which is defined in float.h

--
Regards,
Scott
http://www.gnt.net/~heiman


Paul Martz

unread,
Jan 24, 1999, 3:00:00 AM1/24/99
to
Scott Heiman wrote in message <78cak7$57q$1...@tourist.gnt.net>...

>There is a well known problem with the OpenGL lighting model that causes
>occasional floating point exceptions.

Is there a list of "well-known problems" with Microsoft's implementation of
OpenGL 1.1 online somewhere? I have seen problems mixing fog and texture
mapping and would be interested in seeing a complete list of known defects.

-Paul Martz
Hewlett Packard Workstation Systems Lab
To reply, remove "DONTSPAM" from email address.

0 new messages