Ignore:
Timestamp:
May 2, 2008, 12:13:55 PM (17 years ago)
Author:
jack
Message:

AnugaVis?: compile the data into openGL display lists.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • anuga_work/development/anugavis/src/init.c

    r5264 r5267  
    2020#include "error.h"
    2121#include "globals.h"
     22#include "init.h"
    2223#include "netcdf_util.h"
    23 #include "xmalloc.h"
     24#include "xfunctions.h"
    2425
    2526int AnugaVis_Init(int width, int height, const char *swwFilePath){
     
    4344  }
    4445
     46  SDL_WM_SetCaption("ANUGA Visualiser", "ANUGA Visualiser");
    4547  glEnable(GL_DEPTH_TEST);
    4648  glShadeModel(GL_FLAT);
     
    6365     (nc_inq_dimlen_by_name(anugavis.netcdfId, "number_of_volumes",
    6466                            &anugavis.number_of_volumes) != NC_NOERR) ||
     67     (nc_inq_dimlen_by_name(anugavis.netcdfId, "number_of_timesteps",
     68                            &anugavis.number_of_timesteps) != NC_NOERR) ||
    6569     ((anugavis.x = xmalloc(sizeof(float) * anugavis.number_of_points,
    6670                            "AnugaVis_Init()")) == NULL) ||
     
    7781     (nc_get_var_int_by_name(anugavis.netcdfId, "volumes",
    7882                             anugavis.volumes) != NC_NOERR)){
    79     nc_close(anugavis.netcdfId);
    80     if(anugavis.x != NULL) free(anugavis.x);
    81     if(anugavis.y != NULL) free(anugavis.y);
    82     if(anugavis.volumes != NULL) free(anugavis.volumes);
    83     SDL_Quit();
     83    AnugaVis_DeInit();
    8484    return -1;
    8585  }
     
    9191    AnugaVis_UndefineHeightQuantity(anugavis.heights->name);
    9292  nc_close(anugavis.netcdfId);
    93   free(anugavis.x);
    94   free(anugavis.y);
    95   free(anugavis.volumes);
     93  if(anugavis.x != NULL) free(anugavis.x);
     94  if(anugavis.y != NULL) free(anugavis.y);
     95  if(anugavis.volumes != NULL) free(anugavis.volumes);
    9696  SDL_Quit();
    9797}
Note: See TracChangeset for help on using the changeset viewer.