state_error.c revision c6eaa029f87be54c58d0559d7f5c02c227bcaec0
/* Copyright (c) 2001, Stanford University
* All rights reserved
*
* See the file LICENSE.txt for information on redistributing this software.
*/
#include "state/cr_stateerror.h"
#include "state/cr_statetypes.h"
#include "state.h"
#include "cr_error.h"
#include "cr_environment.h"
#include <stdarg.h>
#include <stdio.h>
{
CRContext *g = GetCurrentContext();
char errstr[8096];
{
char *glerr;
switch (error) {
case GL_NO_ERROR:
glerr = "GL_NO_ERROR";
break;
case GL_INVALID_VALUE:
glerr = "GL_INVALID_VALUE";
break;
case GL_INVALID_ENUM:
glerr = "GL_INVALID_ENUM";
break;
case GL_INVALID_OPERATION:
glerr = "GL_INVALID_OPERATION";
break;
case GL_STACK_OVERFLOW:
glerr = "GL_STACK_OVERFLOW";
break;
case GL_STACK_UNDERFLOW:
glerr = "GL_STACK_UNDERFLOW";
break;
case GL_OUT_OF_MEMORY:
glerr = "GL_OUT_OF_MEMORY";
break;
case GL_TABLE_TOO_LARGE:
glerr = "GL_TABLE_TOO_LARGE";
break;
default:
glerr = "unknown";
break;
}
crWarning( "OpenGL error in %s, line %d: %s: %s\n",
}
}
{
CRContext *g = GetCurrentContext();
if (g->current.inBeginEnd)
{
return 0;
}
g->error = GL_NO_ERROR;
return e;
}