Changeset 5220
- Timestamp:
- Apr 21, 2008, 1:02:58 PM (17 years ago)
- Location:
- anuga_work/development/anugavis
- Files:
-
- 3 added
- 10 edited
Legend:
- Unmodified
- Added
- Removed
-
anuga_work/development/anugavis/configure.ac
r5217 r5220 3 3 4 4 AC_PREREQ([2.56]) 5 AC_INIT([ANUGA OpenGLVisualiser], [alpha], [u4112456@anu.edu.au])5 AC_INIT([ANUGA SWW Visualiser], [alpha], [u4112456@anu.edu.au]) 6 6 AM_INIT_AUTOMAKE([-Wall -Werror foreign]) 7 7 AC_CONFIG_SRCDIR([src/libanugavis/anugavis.h]) … … 15 15 # Checks for libraries. 16 16 AX_CHECK_GL 17 AC_SEARCH_LIBS([SDL_Init], [SDL], [], 18 [AC_MSG_ERROR([Can't link the SDL library. (LDFLAGS?)])]) 17 AM_PATH_SDL([1.2.12], [], [AC_MSG_ERROR([SDL is required to build.])]) 18 AC_CACHE_CHECK([for SDL library path], 19 [anugavis_cv_LIB_SDLPATH], 20 [anugavis_cv_LIB_SDLPATH="" 21 for token in `sdl-config --libs`; do 22 case $token in 23 -L*) 24 anugavis_cv_LIB_SDLPATH="$anugavis_cv_LIB_SDLPATH $token" ;; 25 esac 26 done]) 27 SDL_LIBPATH="$anugavis_cv_LIB_SDLPATH" 28 AC_SUBST([SDL_LIBPATH]) 19 29 AC_SEARCH_LIBS([nc_open], [netcdf], [], 20 30 [AC_MSG_ERROR([Can't link the NetCDF library. (LDFLAGS?)])]) 21 22 31 # Checks for header files. 23 AC_CHECK_HEADER([SDL.h], [],24 [AC_MSG_ERROR([Can't find the SDL header. (Check CPPFLAGS?)])])25 32 AC_CHECK_HEADER([netcdf.h], [], 26 33 [AC_MSG_ERROR([Can't find the NetCDF header. (CPPFLAGS?)])]) -
anuga_work/development/anugavis/src/anugavis_simple/Makefile.am
r5216 r5220 1 1 bin_PROGRAMS = anugavis_simple 2 2 anugavis_simple_SOURCES = anugavis_simple.c 3 anugavis_simple_CPPFLAGS = -I ../libanugavis3 anugavis_simple_CPPFLAGS = -I@abs_top_srcdir@/src/libanugavis 4 4 anugavis_simple_LDADD = ../libanugavis/libanugavis.la -
anuga_work/development/anugavis/src/anugavis_simple/anugavis_simple.c
r5217 r5220 3 3 4 4 int main(int argc, char *argv[]){ 5 if(AnugaVis_Init( ) == -1){5 if(AnugaVis_Init(640, 480, "") == -1){ 6 6 printf("AnugaVis_Init() Error: %s", AnugaVis_GetError()); 7 7 return 1; -
anuga_work/development/anugavis/src/libanugavis/Makefile.am
r5217 r5220 2 2 3 3 lib_LTLIBRARIES = libanugavis.la 4 libanugavis_la_SOURCES = anugavis.h error.c error.h globals.c globals.h init.c 5 libanugavis_la_LDFLAGS = -no-undefined -version-info 1:0:0 4 libanugavis_la_SOURCES = anugavis.h \ 5 error.c \ 6 error.h \ 7 globals.c \ 8 globals.h \ 9 height_quantity.c \ 10 height_quantity.h \ 11 init.c 12 libanugavis_la_CFLAGS = @SDL_CFLAGS@ 13 libanugavis_la_LIBADD = -lSDL 14 libanugavis_la_LDFLAGS = @SDL_LIBPATH@ -no-undefined -version-info 0:0:0 -
anuga_work/development/anugavis/src/libanugavis/anugavis.h
r5217 r5220 5 5 * error. To get detailed error information, use AnugaVis_GetError(). 6 6 */ 7 extern int AnugaVis_Init( void);7 extern int AnugaVis_Init(int width, int height, const char *swwFilePath); 8 8 extern void AnugaVis_DeInit(void); 9 10 /* Define (or redefine if already defined a simple height quantity with the 11 * given offset, scale, and color. Returns 0 on success, -1 on error. 12 */ 13 extern int AnugaVis_DefineHeightQuantity(char *name, 14 double offset, double scale, 15 int red, int green, int blue); 16 /* Undefine a given simple height quantity. 17 */ 18 extern void AnugaVis_UndefineHeightQuantity(char *name); 9 19 10 20 /* Get detailed error information. The returned string should not be -
anuga_work/development/anugavis/src/libanugavis/error.c
r5217 r5220 1 #include <stdarg.h> 1 2 #include <SDL.h> 2 3 #include "anugavis.h" 3 4 #include "error.h" 4 5 5 #define MAX_ERROR_LEN 506 #define MAX_ERROR_LEN 100 6 7 7 8 static char error[MAX_ERROR_LEN]; -
anuga_work/development/anugavis/src/libanugavis/error.h
r5217 r5220 4 4 /* Set the error message with a printf-style format string. 5 5 */ 6 externvoid AnugaVis_SetError(const char *format, ...);6 void AnugaVis_SetError(const char *format, ...); 7 7 8 8 /* Report a SDL error. 9 9 */ 10 extern void AnugaVis_SDLError(void); 10 void AnugaVis_SDLError(void); 11 11 12 #endif -
anuga_work/development/anugavis/src/libanugavis/globals.c
r5217 r5220 2 2 #include "globals.h" 3 3 4 SDL_Surface *screen;4 ANUGAVIS anugavis; -
anuga_work/development/anugavis/src/libanugavis/globals.h
r5217 r5220 3 3 4 4 #include <SDL.h> 5 #include "height_quantity.h" 5 6 6 extern SDL_Surface *screen; 7 typedef struct{ 8 SDL_Surface *screen; 9 struct height_quantity_simple *heights; 10 } ANUGAVIS; 11 12 extern ANUGAVIS anugavis; 7 13 8 14 #endif -
anuga_work/development/anugavis/src/libanugavis/init.c
r5217 r5220 4 4 #include "globals.h" 5 5 6 int AnugaVis_Init( void){6 int AnugaVis_Init(int width, int height, const char *swwFilePath){ 7 7 if((SDL_Init(SDL_INIT_VIDEO) == -1) || 8 8 (SDL_GL_SetAttribute(SDL_GL_RED_SIZE, 5) == -1) || … … 11 11 (SDL_GL_SetAttribute(SDL_GL_DEPTH_SIZE, 16) == -1) || 12 12 (SDL_GL_SetAttribute(SDL_GL_DOUBLEBUFFER, 1) == -1) || 13 ((screen = SDL_SetVideoMode(640, 480, 16, SDL_OPENGL)) == NULL)){ 13 ((anugavis.screen = 14 SDL_SetVideoMode(width, height, 16, SDL_OPENGL)) == NULL)){ 14 15 AnugaVis_SDLError(); 15 16 return -1; 16 17 } 18 anugavis.heights = NULL; 19 return 0; 17 20 } 18 21 19 22 void AnugaVis_DeInit(void){ 23 while(anugavis.heights != NULL) 24 AnugaVis_UndefineHeightQuantity(anugavis.heights->name); 20 25 SDL_Quit(); 21 26 }
Note: See TracChangeset
for help on using the changeset viewer.