[ODE] Fixing the SDL/win32 incompatibility

David McClurg dmcclurg at pandemicstudios.com.au
Sun Sep 22 23:16:02 2002


AFAIK...

dCloseODE() will delete all the globally defined classes with destructors in C++.
atexit() is not used.
dInitODE() is not needed because ODE inits itself as needed (creating classes).
Error routines can be overriden in error.h to avoid printfs or to redirect them somewhere else.

-----Original Message-----
From: Thomas Harte [mailto:thomasharte@lycos.co.uk]
Sent: Monday, 23 September 2002 4:17 AM
To: ode@q12.org
Subject: [ODE] Fixing the SDL/win32 incompatibility


I now have it confirmed by members of the SDL community that something which outputs to stderr as part of either the C atexit list or due to some globally defined classes with destructors in C++ under win32 is likely to crash the system. ODE falls into this set.

There are two obvious fixes. The first would be to add :

dCreate() / dDestroy()

Which work to initialise and deinitialise the entire ODE library. Now there are no globally defined classes (maybe some global pointers to classes, but whatever), or else you can call dDestroy yourself rather than leave it to atexit in order to be sure of when it executes in relation to everything else.

The second would be to have ODE generate a file "ode.log" and output to that rather than using stderr if it is being built under win32. This would actually be the better solution not just due to API consistency, but also because most win32 applications don't have a console, and on 95/98/ME, building with a console can cause some graphics cards to refuse various types of acceleration.

Thoughts? Comments? Anyone? Worth submitting a patch via CVS?

-Thomas