2 * Copyright 1994-1997 Mark Kilgard, All rights reserved.
3 * Distributed under the terms of the MIT License.
5 * GPL licensing not permitted.
20 /* strdup is actually not a standard ANSI C or POSIX routine
21 so implement a private one for GLUT. OpenVMS does not have a
22 strdup; Linux's standard libc doesn't declare strdup by default
23 (unless BSD or SVID interfaces are requested). */
25 __glutStrdup(const char *string
)
29 copy
= (char*) malloc(strlen(string
) + 1);
37 __glutWarning(const char *format
,...)
41 va_start(args
, format
);
42 fprintf(stderr
, "GLUT: Warning in %s: ",
43 __glutProgramName
? __glutProgramName
: "(unamed)");
44 vfprintf(stderr
, format
, args
);
51 glutReportErrors(void)
55 while ((error
= glGetError()) != GL_NO_ERROR
)
56 __glutWarning("GL error: %s", gluErrorString(error
));
61 __glutFatalError(const char *format
,...)
65 va_start(args
, format
);
66 fprintf(stderr
, "GLUT: Fatal Error in %s: ",
67 __glutProgramName
? __glutProgramName
: "(unamed)");
68 vfprintf(stderr
, format
, args
);
75 __glutFatalUsage(const char *format
,...)
79 va_start(args
, format
);
80 fprintf(stderr
, "GLUT: Fatal API Usage in %s: ",
81 __glutProgramName
? __glutProgramName
: "(unamed)");
82 vfprintf(stderr
, format
, args
);