Index: /anuga_work/development/anugavis/configure.ac
===================================================================
--- /anuga_work/development/anugavis/configure.ac	(revision 5486)
+++ /anuga_work/development/anugavis/configure.ac	(revision 5487)
@@ -10,5 +10,5 @@
 # Checks for programs.
 AC_PROG_CC
-AM_PROG_CC_C_O
+AC_PROG_CXX
 AC_PROG_RANLIB
 
@@ -24,8 +24,12 @@
 AC_CHECK_HEADER([netcdf.h], [],
                 [AC_MSG_ERROR([Can't find the NetCDF header. (CPPFLAGS?)])])
+AC_CHECK_HEADER([windows.h])
+AX_BOOST_BASE([1.35.0])
 
 # Checks for typedefs, structures, and compiler characteristics.
 AC_C_CONST
+AC_C_INLINE
 AC_TYPE_SIZE_T
+AM_PROG_CC_C_O
 
 # Checks for library functions.
Index: /anuga_work/development/anugavis/src/Makefile.am
===================================================================
--- /anuga_work/development/anugavis/src/Makefile.am	(revision 5486)
+++ /anuga_work/development/anugavis/src/Makefile.am	(revision 5487)
@@ -1,6 +1,8 @@
 ## Process this file with automake to generate Makefile.in
+AM_CFLAGS = $(SDL_CFLAGS) $(GLU_CFLAGS)
+AM_CXXFLAGS = $(SDL_CFLAGS) $(GLU_CFLAGS)
 
 # Convenience library for the core visualiser code.
-noinst_LIBRARIES = libanugavis.a
+noinst_LIBRARIES = libanugavis.a libanugavis_cxx.a
 libanugavis_a_SOURCES = camera.c \
                         camera.h \
@@ -20,9 +22,14 @@
                         xfunctions.c \
                         xfunctions.h
-libanugavis_a_CFLAGS = @SDL_CFLAGS@ @GLU_CFLAGS@
-libanugavis_a_LIBADD = @LIBOBJS@
+libanugavis_a_LIBADD = $(LIBOBJS)
+libanugavis_cxx_a_SOURCES = anugavis.cc \
+			    anugavis.hh \
+			    netcdf_file.cc \
+			    netcdf_file.hh \
+			    output.cc \
+			    output.hh
+libanugavis_cxx_a_LIBADD = $(LIBOBJS)
 
 bin_PROGRAMS = anugavis_simple
-anugavis_simple_SOURCES = anugavis_simple.c
-anugavis_simple_CFLAGS = @SDL_CFLAGS@ @GLU_CFLAGS@
-anugavis_simple_LDADD = libanugavis.a @SDL_LIBS@ @GLU_LIBS@
+anugavis_simple_SOURCES = anugavis_simple_cxx.cc
+anugavis_simple_LDADD = libanugavis_cxx.a $(SDL_LIBS) $(GLU_LIBS)
Index: /anuga_work/development/anugavis/src/anugavis.cc
===================================================================
--- /anuga_work/development/anugavis/src/anugavis.cc	(revision 5487)
+++ /anuga_work/development/anugavis/src/anugavis.cc	(revision 5487)
@@ -0,0 +1,61 @@
+#ifdef HAVE_CONFIG_H
+#  include "config.h"
+#endif
+
+#include <iostream>
+#include <string>
+#ifdef HAVE_GL_GL_H
+#  include <GL/gl.h>
+#elif HAVE_OPENGL_GL_H
+#  include <OpenGL/gl.h>
+#endif
+#ifdef HAVE_GL_GLU_H
+#  include <GL/glu.h>
+#elif HAVE_OPENGL_GLU_H
+#  include <OpenGL/glu.h>
+#endif
+#include <SDL.h>
+#include "anugavis.hh"
+
+using std::string;
+
+AnugaVis::AnugaVis(const string &sww_file, int width, int height):
+  screen(NULL), netcdf(sww_file){
+  init_SDL(width, height);
+  init_OpenGL(width, height);
+}
+
+AnugaVis::~AnugaVis(void){
+  if(this->screen != NULL) SDL_Quit();
+}
+
+void AnugaVis::init_SDL(int width, int height){
+  if((SDL_Init(SDL_INIT_VIDEO) == -1) ||
+     (SDL_GL_SetAttribute(SDL_GL_RED_SIZE, 5) == -1) ||
+     (SDL_GL_SetAttribute(SDL_GL_GREEN_SIZE, 5) == -1) ||
+     (SDL_GL_SetAttribute(SDL_GL_BLUE_SIZE, 5) == -1) ||
+     (SDL_GL_SetAttribute(SDL_GL_DEPTH_SIZE, 16) == -1) ||
+     (SDL_GL_SetAttribute(SDL_GL_DOUBLEBUFFER, 1) == -1) ||
+     ((this->screen = 
+       SDL_SetVideoMode(width, height, 16, SDL_OPENGL)) == NULL))
+    throw SDL_GetError();
+  SDL_WM_SetCaption("ANUGA Visualiser", "ANUGA Visualiser");
+}
+
+void AnugaVis::init_OpenGL(int width, int height){
+  GLfloat lightAmbient[] = {0.0, 0.0, 0.0, 1.0};
+  GLfloat lightDiffuse[] = {1.0, 1.0, 1.0, 1.0};
+  glEnable(GL_DEPTH_TEST);
+  glShadeModel(GL_FLAT);
+  glEnable(GL_NORMALIZE);
+  glMatrixMode(GL_PROJECTION);
+  gluPerspective(45.0, ((GLdouble)width)/((GLdouble)height), 0.1, 1000);
+  glMatrixMode(GL_MODELVIEW);
+  glLoadIdentity();
+  glColorMaterial(GL_FRONT_AND_BACK, GL_AMBIENT_AND_DIFFUSE);
+  glEnable(GL_COLOR_MATERIAL);
+  glEnable(GL_LIGHTING);
+  glEnable(GL_LIGHT0);
+  glLightfv(GL_LIGHT0, GL_AMBIENT, lightAmbient);
+  glLightfv(GL_LIGHT0, GL_DIFFUSE, lightDiffuse);
+}
Index: /anuga_work/development/anugavis/src/anugavis.hh
===================================================================
--- /anuga_work/development/anugavis/src/anugavis.hh	(revision 5487)
+++ /anuga_work/development/anugavis/src/anugavis.hh	(revision 5487)
@@ -0,0 +1,23 @@
+#ifndef ANUGAVIS_HH
+#define ANUGAVIS_HH
+
+/* The main controller object. */
+
+#include <string>
+#include <SDL.h>
+#include "netcdf_file.hh"
+
+using std::string;
+
+class AnugaVis{
+public:
+  AnugaVis(const string &sww_file, int width, int height);
+  ~AnugaVis(void);
+private:
+  void init_SDL(int width, int height);
+  void init_OpenGL(int width, int height);
+  SDL_Surface *screen;
+  NetCDFFile netcdf;
+};
+
+#endif
Index: /anuga_work/development/anugavis/src/anugavis_simple_cxx.cc
===================================================================
--- /anuga_work/development/anugavis/src/anugavis_simple_cxx.cc	(revision 5487)
+++ /anuga_work/development/anugavis/src/anugavis_simple_cxx.cc	(revision 5487)
@@ -0,0 +1,28 @@
+#include <iostream>
+#include <sstream>
+#include <SDL.h>
+#include "anugavis.hh"
+#include "output.hh"
+
+using std::cout;
+using std::endl;
+using std::ostringstream;
+
+extern "C"
+int main(int argc, char *argv[]){
+  if(argc != 2){
+    ostringstream ss;
+    ss << "Usage: " << argv[0] << " sww_file_name";
+    output_string(ss.str());
+    return 1;
+  }
+  try{
+    AnugaVis anuga(argv[1], 640, 480);
+  }catch(const char *str){
+    output_string(string(str));
+  }catch(string &str){
+    output_string(str);
+    return 1;
+  }
+  return 0;
+}
Index: /anuga_work/development/anugavis/src/netcdf_file.cc
===================================================================
--- /anuga_work/development/anugavis/src/netcdf_file.cc	(revision 5487)
+++ /anuga_work/development/anugavis/src/netcdf_file.cc	(revision 5487)
@@ -0,0 +1,16 @@
+#include <string>
+#include <netcdf.h>
+#include "netcdf_file.hh"
+
+using std::string;
+
+NetCDFFile::NetCDFFile(const string &file_name){
+  int ncstatus;
+  if((ncstatus = nc_open(file_name.c_str(),
+			 NC_SHARE, &this->netcdf_id)) != NC_NOERR)
+    throw nc_strerror(ncstatus);
+}
+
+NetCDFFile::~NetCDFFile(void){
+  nc_close(this->netcdf_id);
+}
Index: /anuga_work/development/anugavis/src/netcdf_file.hh
===================================================================
--- /anuga_work/development/anugavis/src/netcdf_file.hh	(revision 5487)
+++ /anuga_work/development/anugavis/src/netcdf_file.hh	(revision 5487)
@@ -0,0 +1,19 @@
+#ifndef NETCDF_FILE_HH
+#define NETCDF_FILE_HH
+
+/* A simple read-only wrapper around the NetCDF C calls, since it's
+   difficult to build the C++ binding on Win32 (further, it fails its
+   test suite. */
+
+#include <string>
+using std::string;
+
+class NetCDFFile{
+public:
+  NetCDFFile(const string &file_name);
+  ~NetCDFFile(void);
+private:
+  int netcdf_id;
+};
+
+#endif
Index: /anuga_work/development/anugavis/src/output.cc
===================================================================
--- /anuga_work/development/anugavis/src/output.cc	(revision 5487)
+++ /anuga_work/development/anugavis/src/output.cc	(revision 5487)
@@ -0,0 +1,32 @@
+#ifdef HAVE_CONFIG_H
+#  include "config.h"
+#endif
+
+#include <iostream>
+#include <string>
+#ifdef HAVE_WINDOWS_H
+#  define WIN32_LEAN_AND_MEAN
+#  include <windows.h>
+#endif
+#include "output.hh"
+
+using std::cout;
+using std::endl;
+using std::string;
+
+void output_string(const string &str){
+  /* Better to have some kind of HAVE_MESSAGEBOX, but that's not
+     possible since:
+     1. MessageBox is a macro that is defined to MessageBoxA or MessageBoxW.
+     2. MessageBox{A,W} are called with the stdcall calling
+        convention, mangling the names based on the parameters meaning
+        that autoconf can't get this right.
+     3. We can't define the full prototype for MessageBox{A,W} since
+        the parameters are typedef'd out the wazoo and our guess could
+        well break on 64-bit Windows. */
+#ifdef HAVE_WINDOWS_H
+  MessageBox(NULL, str.c_str(), "Message", MB_OK|MB_ICONEXCLAMATION);
+#else
+  cout << str << endl;
+#endif
+}
Index: /anuga_work/development/anugavis/src/output.hh
===================================================================
--- /anuga_work/development/anugavis/src/output.hh	(revision 5487)
+++ /anuga_work/development/anugavis/src/output.hh	(revision 5487)
@@ -0,0 +1,12 @@
+#ifndef OUTPUT_HH
+#define OUTPUT_HH
+
+#include <string>
+
+using std::string;
+
+/* Output the string in a messagebox if available, to stdout with a
+   trailing newline if not. */
+void output_string(const string &str);
+
+#endif
