From: Fay J. F Dr C. U. 46 S. <joh...@eg...> - 2007-10-22 13:53:35
|
Folks, What do people think of moving the check for initialization into a "#ifdef DEBUG" block where a call to an uninitialized "freeglut" will not cause a crash? John F. Fay Technical Fellow Jacobs Technology TEAS Group 850-883-1294=20 -----Original Message----- From: fre...@li... [mailto:fre...@li...] On Behalf Of Henrik R. Nagel Sent: Monday, October 22, 2007 2:41 AM To: fre...@li... Subject: [Freeglut-bugs] Incompatibility with FLTK Hi, I have made an OpenGL program using FLTK. The user of the program has=20 Ubuntu installed, which, apparently, only provides freeglut and not the=20 old version of glut, which I uses. When the program is run, the=20 following error message appears: freeglut ERROR: Function <glutStrokeLength> called without first=20 calling 'glutInit' This error obviously comes from the call to=20 FREEGLUT_EXIT_IF_NOT_INITIALISED() in glutStrokeLength(). Must you absolutely check for this at every single frame during the=20 entire execution of a program? In my program, I have statements like this: #ifdef DEBUG if (column >=3D maxNumberOfColumns) ... #endif for handling rarely occurring errors, that do not depend on the input=20 data of a program. When developing, DEBUG is always defined, but when a=20 program is working correctly, I can make an optimized version of it=20 without this code. The point is that I thereby can insert these kinds of checks all over the code, without being concerned with the program=20 slowing down. In your case, you could provide two libraries optim and=20 devel/debug, where the first is optimized and the other is for=20 development. If you did this, freeglut programs would run faster and the problem with the incompatibility with FLTK would go away. Best regards, Henrik ------------------------------------------------------------------------ - This SF.net email is sponsored by: Splunk Inc. Still grepping through log files to find problems? Stop. Now Search log events and configuration files using AJAX and a browser. Download your FREE copy of Splunk now >> http://get.splunk.com/ _______________________________________________ Freeglut-bugs mailing list Fre...@li... https://lists.sourceforge.net/lists/listinfo/freeglut-bugs |