Changeset 5217
- Timestamp:
- Apr 17, 2008, 2:10:58 PM (15 years ago)
- Location:
- anuga_work/development/anugavis
- Files:
-
- 3 added
- 7 edited
Legend:
- Unmodified
- Added
- Removed
-
anuga_work/development/anugavis/configure.ac
r5216 r5217 16 16 AX_CHECK_GL 17 17 AC_SEARCH_LIBS([SDL_Init], [SDL], [], 18 [AC_MSG_ERROR([Can't link against the SDL library. (LDFLAGS?)])]) 18 [AC_MSG_ERROR([Can't link the SDL library. (LDFLAGS?)])]) 19 AC_SEARCH_LIBS([nc_open], [netcdf], [], 20 [AC_MSG_ERROR([Can't link the NetCDF library. (LDFLAGS?)])]) 19 21 20 22 # Checks for header files. 21 23 AC_CHECK_HEADER([SDL.h], [], 22 24 [AC_MSG_ERROR([Can't find the SDL header. (Check CPPFLAGS?)])]) 25 AC_CHECK_HEADER([netcdf.h], [], 26 [AC_MSG_ERROR([Can't find the NetCDF header. (CPPFLAGS?)])]) 23 27 24 28 # Checks for typedefs, structures, and compiler characteristics. -
anuga_work/development/anugavis/src/Makefile.am
r5216 r5217 1 SUBDIRS = anugavis_simple libanugavis1 SUBDIRS = libanugavis anugavis_simple -
anuga_work/development/anugavis/src/anugavis_simple/anugavis_simple.c
r5216 r5217 4 4 int main(int argc, char *argv[]){ 5 5 if(AnugaVis_Init() == -1){ 6 printf("AnugaVis Error: %s", AnugaVis_GetError());6 printf("AnugaVis_Init() Error: %s", AnugaVis_GetError()); 7 7 return 1; 8 8 } -
anuga_work/development/anugavis/src/libanugavis/Makefile.am
r5216 r5217 2 2 3 3 lib_LTLIBRARIES = libanugavis.la 4 libanugavis_la_SOURCES = anugavis.h error.c init.c4 libanugavis_la_SOURCES = anugavis.h error.c error.h globals.c globals.h init.c 5 5 libanugavis_la_LDFLAGS = -no-undefined -version-info 1:0:0 -
anuga_work/development/anugavis/src/libanugavis/anugavis.h
r5216 r5217 2 2 #define ANUGAVIS_H 3 3 4 /* Start and stop the visualiser. AnugaVis_Init() returns -1 on 5 * error. To get detailed error information, use AnugaVis_GetError(). 6 */ 4 7 extern int AnugaVis_Init(void); 5 8 extern void AnugaVis_DeInit(void); 6 9 10 /* Get detailed error information. The returned string should not be 11 * freed by the caller. 12 */ 7 13 extern char* AnugaVis_GetError(void); 8 extern void AnugaVis_SetError(const char *format, ...);9 14 10 15 #endif -
anuga_work/development/anugavis/src/libanugavis/error.c
r5216 r5217 1 1 #include <SDL.h> 2 2 #include "anugavis.h" 3 #include "error.h" 3 4 4 5 #define MAX_ERROR_LEN 50 … … 16 17 va_end(args); 17 18 } 19 20 void AnugaVis_SDLError(void){ 21 AnugaVis_SetError("SDL Error: %s", SDL_GetError()); 22 SDL_ClearError(); 23 } -
anuga_work/development/anugavis/src/libanugavis/init.c
r5216 r5217 1 1 #include <SDL.h> 2 2 #include "anugavis.h" 3 #include "error.h" 4 #include "globals.h" 3 5 4 6 int AnugaVis_Init(void){ 5 if(SDL_Init(SDL_INIT_VIDEO) == -1){ 6 AnugaVis_SetError("SDL Error: %s", SDL_GetError()); 7 SDL_ClearError(); 7 if((SDL_Init(SDL_INIT_VIDEO) == -1) || 8 (SDL_GL_SetAttribute(SDL_GL_RED_SIZE, 5) == -1) || 9 (SDL_GL_SetAttribute(SDL_GL_GREEN_SIZE, 5) == -1) || 10 (SDL_GL_SetAttribute(SDL_GL_BLUE_SIZE, 5) == -1) || 11 (SDL_GL_SetAttribute(SDL_GL_DEPTH_SIZE, 16) == -1) || 12 (SDL_GL_SetAttribute(SDL_GL_DOUBLEBUFFER, 1) == -1) || 13 ((screen = SDL_SetVideoMode(640, 480, 16, SDL_OPENGL)) == NULL)){ 14 AnugaVis_SDLError(); 8 15 return -1; 9 16 }
Note: See TracChangeset
for help on using the changeset viewer.