From 4811b7c7e02c0612975a8526f8ebba49ece0e72b Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Thu, 16 Sep 1999 22:45:24 +0000 Subject: initial check-in --- src/glut/beos/glut_util.cpp | 66 +++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 66 insertions(+) create mode 100644 src/glut/beos/glut_util.cpp (limited to 'src/glut/beos/glut_util.cpp') diff --git a/src/glut/beos/glut_util.cpp b/src/glut/beos/glut_util.cpp new file mode 100644 index 0000000000..97e3115832 --- /dev/null +++ b/src/glut/beos/glut_util.cpp @@ -0,0 +1,66 @@ + +/* Copyright (c) Mark J. Kilgard, 1994. */ + +/* This program is freely distributable without licensing fees + and is provided without guarantee or warrantee expressed or + implied. This program is -not- in the public domain. */ + +#include +#include +#include + +#include +#include "glutint.h" +#include "glutState.h" + +void +__glutWarning(char *format,...) +{ + va_list args; + + va_start(args, format); + fprintf(stderr, "GLUT: Warning in %s: ", + gState.programName ? gState.programName : "(unamed)"); + vfprintf(stderr, format, args); + va_end(args); + putc('\n', stderr); +} + +/* CENTRY */ +void APIENTRY +glutReportErrors(void) +{ + GLenum error; + + while ((error = glGetError()) != GL_NO_ERROR) + __glutWarning("GL error: %s", gluErrorString(error)); +} +/* ENDCENTRY */ + +void +__glutFatalError(char *format,...) +{ + va_list args; + + va_start(args, format); + fprintf(stderr, "GLUT: Fatal Error in %s: ", + gState.programName ? gState.programName : "(unamed)"); + vfprintf(stderr, format, args); + va_end(args); + putc('\n', stderr); + exit(1); +} + +void +__glutFatalUsage(char *format,...) +{ + va_list args; + + va_start(args, format); + fprintf(stderr, "GLUT: Fatal API Usage in %s: ", + gState.programName ? gState.programName : "(unamed)"); + vfprintf(stderr, format, args); + va_end(args); + putc('\n', stderr); + abort(); +} -- cgit v1.2.3