Changeset 5228 for anuga_work/development/anugavis/src/libanugavis/init.c
- Timestamp:
- Apr 22, 2008, 1:36:01 PM (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
anuga_work/development/anugavis/src/libanugavis/init.c
r5220 r5228 1 #ifdef HAVE_CONFIG_H 2 # include "config.h" 3 #endif 4 5 #ifdef HAVE_GL_GL_H 6 # include <GL/gl.h> 7 #elif HAVE_OPENGL_GL_H 8 # include <OpenGL/gl.h> 9 #endif 10 #ifdef HAVE_GL_GLU_H 11 # include <GL/glu.h> 12 #elif HAVE_OPENGL_GLU_H 13 # include <OpenGL/glu.h> 14 #endif 15 #include <netcdf.h> 1 16 #include <SDL.h> 2 17 #include "anugavis.h" … … 5 20 6 21 int AnugaVis_Init(int width, int height, const char *swwFilePath){ 22 int ncstatus; 7 23 if((SDL_Init(SDL_INIT_VIDEO) == -1) || 8 24 (SDL_GL_SetAttribute(SDL_GL_RED_SIZE, 5) == -1) || … … 16 32 return -1; 17 33 } 34 35 glEnable(GL_DEPTH_TEST); 36 glShadeModel(GL_FLAT); 37 glEnable(GL_NORMALIZE); 38 glMatrixMode(GL_PROJECTION); 39 gluPerspective(45.0, ((GLdouble)width)/((GLdouble)height), 0.1, 1000); 40 glMatrixMode(GL_MODELVIEW); 41 glLoadIdentity(); 42 43 if((ncstatus = nc_open(swwFilePath, NC_SHARE, 44 &anugavis.netcdfId)) != NC_NOERR){ 45 AnugaVis_NetCDFError(ncstatus); 46 SDL_Quit(); 47 return -1; 48 } 18 49 anugavis.heights = NULL; 19 50 return 0; … … 23 54 while(anugavis.heights != NULL) 24 55 AnugaVis_UndefineHeightQuantity(anugavis.heights->name); 56 nc_close(anugavis.netcdfId); 25 57 SDL_Quit(); 26 58 }
Note: See TracChangeset
for help on using the changeset viewer.