Index: /trunk/packages/vizservers/nanovis/Trace.cpp
===================================================================
--- /trunk/packages/vizservers/nanovis/Trace.cpp	(revision 1199)
+++ /trunk/packages/vizservers/nanovis/Trace.cpp	(revision 1200)
@@ -6,9 +6,10 @@
 #include <GL/glut.h>
 
-void Trace(const char* format, ...)
+void 
+Trace(const char* format, ...)
 {
     char buff[1024];
     va_list lst;
-
+    
     va_start(lst, format);
     vsnprintf(buff, 1023, format, lst);
@@ -19,77 +20,67 @@
 
 bool
-CheckFramebuffer(GLenum *statusPtr) 
+CheckFBO(GLenum *statusPtr) 
 {
-    *statusPtr = (GLenum)glCheckFramebufferStatusEXT(GL_FRAMEBUFFER_EXT);
+    *statusPtr = glCheckFramebufferStatusEXT(GL_FRAMEBUFFER_EXT);
     return (*statusPtr == GL_FRAMEBUFFER_COMPLETE_EXT);
 }
 
-
-
 void
-PrintFramebufferStatus(GLenum status, const char *string) 
+PrintFBOStatus(GLenum status, const char *prefix) 
 {
-  const char *mesg;
-  fprintf(stderr, "FB Status: %s: ", string);
-  switch(status) {
+    const char *mesg;
+    switch(status) {
     case GL_FRAMEBUFFER_COMPLETE_EXT:
-      mesg = "<<<< OK >>>>";
-      break;
+	mesg = "<<<< OK >>>>";						break;
     case GL_FRAMEBUFFER_INCOMPLETE_ATTACHMENT_EXT:
-      mesg = "GL_FRAMEBUFFER_INCOMPLETE_ATTACHMENT_EXT";
-      break;
+	mesg = "GL_FRAMEBUFFER_INCOMPLETE_ATTACHMENT_EXT";		break;
     case GL_FRAMEBUFFER_UNSUPPORTED_EXT:
-      mesg = "GL_FRAMEBUFFER_UNSUPPORTED_EXT";
-      break;
+	mesg = "GL_FRAMEBUFFER_UNSUPPORTED_EXT";			break;
     case GL_FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT_EXT:
-      mesg = "GL_FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT_EXT";
-      break;
+	mesg = "GL_FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT_EXT";	break;
     case GL_FRAMEBUFFER_INCOMPLETE_DIMENSIONS_EXT:
-      mesg = "GL_FRAMEBUFFER_INCOMPLETE_DIMENSIONS_EXT";
-      break;
+	mesg = "GL_FRAMEBUFFER_INCOMPLETE_DIMENSIONS_EXT";		break;
     case GL_FRAMEBUFFER_INCOMPLETE_FORMATS_EXT:
-      mesg = "GL_FRAMEBUFFER_INCOMPLETE_FORMATS_EXT";
-      break;
+	mesg = "GL_FRAMEBUFFER_INCOMPLETE_FORMATS_EXT";			break;
     case GL_FRAMEBUFFER_INCOMPLETE_DRAW_BUFFER_EXT:
-      mesg = "GL_FRAMEBUFFER_INCOMPLETE_DRAW_BUFFER_EXT";
-      break;
+	mesg = "GL_FRAMEBUFFER_INCOMPLETE_DRAW_BUFFER_EXT";		break;
     case GL_FRAMEBUFFER_INCOMPLETE_READ_BUFFER_EXT:
-      mesg = "GL_FRAMEBUFFER_INCOMPLETE_READ_BUFFER_EXT";
-      break;
+	mesg = "GL_FRAMEBUFFER_INCOMPLETE_READ_BUFFER_EXT";		break;
     default:
-      fprintf(stderr, "UNKNOWN framebuffer status %u\n", (unsigned int)status);
-      return;
-  }
-  fprintf(stderr, "%d\n", mesg);
+	fprintf(stderr, "FB Status: %s: UNKNOWN framebuffer status %u\n", 
+		prefix, (unsigned int)status);
+	return;
+    }
+    fprintf(stderr, "FB Status: %s: %s", prefix, mesg);
 }
 
 bool
-CheckGL(const char *string)
+CheckGL(const char *prefix)
 {
-  const char *mesg;
-  GLenum status = (GLenum)glGetError();
-  switch(status) {
+    const char *mesg;
+    GLenum status = (GLenum)glGetError();
+    switch(status) {
     case GL_NO_ERROR:
-      return true;
+	return true;
     case GL_INVALID_ENUM:
-      mesg = "GL_INVALID_ENUM"; break;
+	mesg = "GL_INVALID_ENUM";			break;
     case GL_INVALID_VALUE:
-      mesg = "GL_INVALID_VALUE"; break;
+	mesg = "GL_INVALID_VALUE";			break;
     case GL_INVALID_OPERATION:
-      mesg = "GL_INVALID_OPERATION"; break;
+	mesg = "GL_INVALID_OPERATION";			break;
     case GL_STACK_OVERFLOW:
-      mesg = "GL_STACK_OVERFLOW"; break;
+	mesg = "GL_STACK_OVERFLOW";			break;
     case GL_STACK_UNDERFLOW:
-      mesg = "GL_STACK_UNDERFLOW"; break;
+	mesg = "GL_STACK_UNDERFLOW";			break;
     case GL_OUT_OF_MEMORY:
-      mesg = "GL_OUT_OF_MEMORY"; break;
+	mesg = "GL_OUT_OF_MEMORY";			break;
     case GL_INVALID_FRAMEBUFFER_OPERATION_EXT:
-      mesg = "GL_INVALID_FRAMEBUFFER_OPERATION_EXT"; break;
+	mesg = "GL_INVALID_FRAMEBUFFER_OPERATION_EXT";	break;
     default:
-      fprintf(stderr, "UNKNOWN GL status %d: %s\n", status, string);
-      return false;
-  } 
-  fprintf(stderr, "GL Status: %s: %s", string, mesg);
-  return false;
+	fprintf(stderr, "GL Status: %s: Unknown status %d\n", prefix, status);
+	return false;
+    } 
+    fprintf(stderr, "GL Status: %s: %s", prefix, mesg);
+    return false;
 }
 
Index: /trunk/packages/vizservers/nanovis/Trace.h
===================================================================
--- /trunk/packages/vizservers/nanovis/Trace.h	(revision 1199)
+++ /trunk/packages/vizservers/nanovis/Trace.h	(revision 1200)
@@ -6,6 +6,6 @@
 
 extern void Trace(const char* format, ...);
-extern bool CheckFramebuffer(GLenum *statusPtr);
-extern void PrintFramebufferStatus(GLenum status, const char *string);
-extern bool CheckGL(const char *string);
+extern bool CheckFBO(GLenum *statusPtr);
+extern void PrintFBOStatus(GLenum status, const char *prefix);
+extern bool CheckGL(const char *prefix);
 #endif
Index: /trunk/packages/vizservers/nanovis/nanovis.cpp
===================================================================
--- /trunk/packages/vizservers/nanovis/nanovis.cpp	(revision 1199)
+++ /trunk/packages/vizservers/nanovis/nanovis.cpp	(revision 1200)
@@ -601,12 +601,12 @@
 {
     if (debug_flag) {
-       fprintf(stderr, "in init_offscreen_buffer\n");
+	fprintf(stderr, "in init_offscreen_buffer\n");
     }
     // Initialize a fbo for final display.
     glGenFramebuffersEXT(1, &final_fbo);
-   
+    
     glGenTextures(1, &final_color_tex);
     glBindTexture(GL_TEXTURE_2D, final_color_tex);
-
+    
     glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR);
     glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR);
@@ -629,21 +629,23 @@
 
     glFramebufferTexture2DEXT(GL_FRAMEBUFFER_EXT, GL_COLOR_ATTACHMENT0_EXT,
-        GL_TEXTURE_2D, final_color_tex, 0);
+	GL_TEXTURE_2D, final_color_tex, 0);
     glFramebufferRenderbufferEXT(GL_FRAMEBUFFER_EXT, GL_DEPTH_ATTACHMENT_EXT,
-        GL_RENDERBUFFER_EXT, final_depth_rb);
+	GL_RENDERBUFFER_EXT, final_depth_rb);
+
     CheckGL("glFramebufferTexture2DEXT");
+
     GLenum status;
-    if (!CheckFramebuffer(&status)) {
-       if (debug_flag) {
-       	  PrintFramebufferStatus(status, "final_fbo");
-       }
-    }
+    if (!CheckFBO(&status)) {
+	if (debug_flag) {
+	    PrintFBOStatus(status, "final_fbo");
+	}
+    }
+
     // Check framebuffer completeness at the end of initialization.
     //CHECK_FRAMEBUFFER_STATUS();
-    //NanoVis::display();
-
+    
     //assert(glGetError()==0);
     if (debug_flag) {
-       fprintf(stderr, "leaving init_offscreen_buffer\n");
+	fprintf(stderr, "leaving init_offscreen_buffer\n");
     }
 }
@@ -655,38 +657,37 @@
 {
     if (debug_flag) {
-       fprintf(stderr, "in resize_offscreen_buffer(%d, %d)\n", w, h);
+	fprintf(stderr, "in resize_offscreen_buffer(%d, %d)\n", w, h);
     }
     win_width = w;
     win_height = h;
-
+    
     if (fonts) {
         fonts->resize(w, h);
     }
-
     //fprintf(stderr, "screen_buffer size: %d\n", sizeof(screen_buffer));
     printf("screen_buffer size: %d %d\n", w, h);
-
+    
     if (screen_buffer) {
         delete[] screen_buffer;
         screen_buffer = NULL;
     }
-
+    
     screen_buffer = new unsigned char[4*win_width*win_height];
     assert(screen_buffer != NULL);
-
+    
     //delete the current render buffer resources
     glDeleteTextures(1, &final_color_tex);
     glDeleteFramebuffersEXT(1, &final_fbo);
-
+    
     glBindRenderbufferEXT(GL_RENDERBUFFER_EXT, final_depth_rb);
     glDeleteRenderbuffersEXT(1, &final_depth_rb);
-
+    
     //change the camera setting
     cam->set_screen_size(0, 0, win_width, win_height);
     plane_render->set_screen_size(win_width, win_height);
-
+    
     //Reinitialize final fbo for final display
     glGenFramebuffersEXT(1, &final_fbo);
-
+    
     glGenTextures(1, &final_color_tex);
     glBindTexture(GL_TEXTURE_2D, final_color_tex);
@@ -701,26 +702,25 @@
 #endif
     glBindFramebufferEXT(GL_FRAMEBUFFER_EXT, final_fbo);
-    glFramebufferTexture2DEXT(GL_FRAMEBUFFER_EXT,
-                              GL_COLOR_ATTACHMENT0_EXT,
-                              GL_TEXTURE_2D, final_color_tex, 0);
-
+    glFramebufferTexture2DEXT(GL_FRAMEBUFFER_EXT, GL_COLOR_ATTACHMENT0_EXT,
+	GL_TEXTURE_2D, final_color_tex, 0);
+    
     glGenRenderbuffersEXT(1, &final_depth_rb);
     glBindRenderbufferEXT(GL_RENDERBUFFER_EXT, final_depth_rb);
-    glRenderbufferStorageEXT(GL_RENDERBUFFER_EXT,
-                             GL_DEPTH_COMPONENT24, win_width, win_height);
-    glFramebufferRenderbufferEXT(GL_FRAMEBUFFER_EXT,
-                                 GL_DEPTH_ATTACHMENT_EXT,
-                                 GL_RENDERBUFFER_EXT, final_depth_rb);
-
+    glRenderbufferStorageEXT(GL_RENDERBUFFER_EXT, GL_DEPTH_COMPONENT24, 
+	win_width, win_height);
+    glFramebufferRenderbufferEXT(GL_FRAMEBUFFER_EXT, GL_DEPTH_ATTACHMENT_EXT,
+	GL_RENDERBUFFER_EXT, final_depth_rb);
+    
     CheckGL("glFramebufferText2DEXT");
     GLenum status;
-    if (!CheckFramebuffer(&status)) {
-       if (debug_flag) {
-       	  PrintFramebufferStatus(status, "final_fbo");
-       }
-    }
+    if (!CheckFBO(&status)) {
+	if (debug_flag) {
+	    PrintFBOStatus(status, "final_fbo");
+	}
+    }
+
     //CHECK_FRAMEBUFFER_STATUS();
     if (debug_flag) {
-       fprintf(stderr, "leaving resize_offscreen_buffer(%d, %d)\n", w, h);
+	fprintf(stderr, "leaving resize_offscreen_buffer(%d, %d)\n", w, h);
     }
 }
@@ -808,14 +808,16 @@
 {
     // print system information
-    fprintf(stderr, "-----------------------------------------------------------\n");
-    fprintf(stderr, "OpenGL driver: %s %s\n", glGetString(GL_VENDOR), glGetString(GL_VERSION));
+    fprintf(stderr, 
+	    "-----------------------------------------------------------\n");
+    fprintf(stderr, "OpenGL driver: %s %s\n", glGetString(GL_VENDOR), 
+	    glGetString(GL_VERSION));
     fprintf(stderr, "Graphics hardware: %s\n", glGetString(GL_RENDERER));
-    fprintf(stderr, "-----------------------------------------------------------\n");
+    fprintf(stderr, 
+	    "-----------------------------------------------------------\n");
     if (path == NULL) {
-	fprintf(stderr, "no path defined for shaders or resources\n");
+	fprintf(stderr, "No path defined for shaders or resources\n");
 	fflush(stderr);
-	DoExit(-1);
-    }
-    // init GLEW
+	DoExit(1);
+    }
     GLenum err = glewInit();
     if (GLEW_OK != err) {
@@ -831,15 +833,14 @@
 	DoExit(1);
     }
-
+    
     NvInitCG();
     NvShader::setErrorCallback(CgErrorCallback);
-
+    
     fonts = new R2Fonts();
     fonts->addFont("verdana", "verdana.fnt");
     fonts->setFont("verdana");
-
+    
     color_table_renderer = new NvColorTableRenderer();
     color_table_renderer->setFonts(fonts);
-
     particleRenderer = new NvParticleRenderer(NMESH, NMESH, g_context);
 
@@ -852,7 +853,5 @@
     grid->setFont(fonts);
 
-#ifdef notdef
     pointset_renderer = new PointSetRenderer();
-#endif
 }
 
