#ifdef HAVE_CONFIG_H # include "config.h" #endif #ifdef HAVE_GL_GLU_H # include #elif HAVE_OPENGL_GLU_H # include #endif #include #include #include #include "error.h" #define MAX_ERROR_LEN 200 static char error[MAX_ERROR_LEN]; char* AnugaVis_GetError(void){ return error; } void AnugaVis_SetError(const char *format, ...){ va_list args; va_start(args, format); vsnprintf(error, MAX_ERROR_LEN, format, args); va_end(args); } void AnugaVis_SDLError(void){ AnugaVis_SetError("SDL Error: %s", SDL_GetError()); SDL_ClearError(); } void AnugaVis_NetCDFError(int ncerr){ AnugaVis_SetError("NetCDF Error: %s", nc_strerror(ncerr)); } void AnugaVis_OpenGLError(GLenum errorCode){ AnugaVis_SetError("OpenGL Error: %s", gluErrorString(errorCode)); }