PDA

View Full Version : Opengl crashing badly



warlordQ
08-21-2000, 10:55 PM
Man this is pissing me off so much.....

Whenever i compile any OpenGL program at all, even if they have a blank screen, and i don't use any opengl commands at all, it still crashes...

All of Glut stuff crashes, and NeHe stuff too....

Im using Borland C++Builder 3.0, and i have the lastest Opengl32.lib, Glu32.lib, and glut.lib files which have been converted to Borland.....

This only started happening after i installed the detonator2 drivers... Every other Opengl app runs fine, Quake2/3 runs great, Mark's Opalis demo run fine....

I have tried compiling programs using Opengl 1.1 libs, and opengl 1.2 libs, and dynamically linking to OpenGL32.dll and mapping out all the function calls at runtime.... They all seem to crash....

There is a problem with the floating point on the borland compilers and opengl, but borland says to use this:

#ifdef __BORLANDC__
#include <float.h>
#endif /* End __BORLANDC__ */

/*----- Inside WinMain ------ */
#ifdef __BORLANDC__
_control87( MCW_EM, MCW_EM );
#endif /* End __BORLANDC__ */

And that will fix things up.... I don't know why it crashes.....

heres the link to some excutables....
http://www.ompac.net.au/~troyfa/GLTest.zip

There's 3 files..... One uses the dynamic runtime binding to OpenGL32.dll, and resolves all the opengl functions at runtime.... To see what i mean, right click on any of the exes, and select quick view.... There should be an import listing declaration... Two of the files, will have Opengl32.dll with the appropiate functions... The other one dosn't have this, it'll be blank, that one is the dynamic version.....

Those programs will crash your system forcing a reboot, or they will crash programs that are run afterwards... However it won't crash on all systems, i don't know why....

So if anyone here knows why this happens, let us know, becuase it's a friggen pain....

The GLTest11.exe and GLTest12.exe uses one of NeHe demo code, nothing has changed except for the font, Title bar, and the color of the font, everything else remains the same.....

DPalomo
08-21-2000, 11:06 PM
Hi,

I've tested your apps. and they worked fine,
I think it's a matter of non-working drivers, to test this you should copy a version of OpenGL32.dll for your graphics card or use the software version of microsoft. Or you even could try to use the DX 6 OpenGL driver of altsoftware, you can download it from: http://www.altsoftware.com/demos/altogl.exe
(run the exec and rename the .dll to opengl32.dll).

Hope this helps,

Daniel Palomo van Es

Gorg
08-22-2000, 03:41 AM
glut was often crashing on me when I forgot to put some keyboard or mouse callback or to say that there were none.

warlordQ
08-22-2000, 05:48 AM
I recompiled the demos with Visual C++ Introductory edition....

The only one working fine is the dynamic linking version, it runs great no probs..... The Font one runs fine about 10 times in a row, then that will crash around the tenth run or so....

I suspect it could be a calling problem or something... Some calling convections push parameters right to left and calling function cleans the stack( C )... other push parameters left to right( PASCAL ).....
And sometimes the calling function pop the stack ( stdcall )...

Heres my project options i use.....
486 target CPU C Calling convection No register variables Correct Pentium FDIV Flaw ( used in trig tables ) Smart virtual tables Map file off No debug info

Heres the stack and heap size, maybe i should of put this first....
Min stack size == 0x00002000 Max stack size == 0x00100000 Min heap size == 0x00001000 Max heap size == 0x00100000 Image base == 0x00400000

All those are the recommended stack/heap size for a window32 application....

I so confused now.....