source: anuga_work/development/anugavis/src/error.c @ 5487

Last change on this file since 5487 was 5267, checked in by jack, 16 years ago

AnugaVis?: compile the data into openGL display lists.

File size: 864 bytes
Line 
1#ifdef HAVE_CONFIG_H
2#  include "config.h"
3#endif
4
5#ifdef HAVE_GL_GLU_H
6#  include <GL/glu.h>
7#elif HAVE_OPENGL_GLU_H
8#  include <OpenGL/glu.h>
9#endif
10#include <stdarg.h>
11#include <netcdf.h>
12#include <SDL.h>
13#include "error.h"
14
15#define MAX_ERROR_LEN 200
16
17static char error[MAX_ERROR_LEN];
18
19char* AnugaVis_GetError(void){
20  return error;
21}
22
23void AnugaVis_SetError(const char *format, ...){
24  va_list args;
25  va_start(args, format);
26  vsnprintf(error, MAX_ERROR_LEN, format, args);
27  va_end(args);
28}
29
30void AnugaVis_SDLError(void){
31  AnugaVis_SetError("SDL Error: %s", SDL_GetError());
32  SDL_ClearError();
33}
34
35void AnugaVis_NetCDFError(int ncerr){
36  AnugaVis_SetError("NetCDF Error: %s", nc_strerror(ncerr));
37}
38
39void AnugaVis_OpenGLError(GLenum errorCode){
40  AnugaVis_SetError("OpenGL Error: %s", gluErrorString(errorCode));
41}
Note: See TracBrowser for help on using the repository browser.