Main Page   Namespace List   Class Hierarchy   Alphabetical List   Compound List   File List   Compound Members   File Members   Related Pages  

vmdmain.C

Go to the documentation of this file.
00001 /***************************************************************************
00002  *cr
00003  *cr            (C) Copyright 1995-2011 The Board of Trustees of the
00004  *cr                        University of Illinois
00005  *cr                         All Rights Reserved
00006  *cr
00007  ***************************************************************************/
00008 
00009 /***************************************************************************
00010  * RCS INFORMATION:
00011  *
00012  *      $RCSfile: vmdmain.C,v $
00013  *      $Author: johns $        $Locker:  $             $State: Exp $
00014  *      $Revision: 1.7 $       $Date: 2010/12/16 04:08:59 $
00015  *
00016  ***************************************************************************
00017  * DESCRIPTION:
00018  *
00019  * Main program.
00020  *
00021  ***************************************************************************/
00022 #include "vmd.h"
00023 
00024 int main(int argc, char **argv) {
00025   if (!VMDinitialize(&argc, &argv)) {
00026     return 0;
00027   }
00028 
00029   const char *displayTypeName = VMDgetDisplayTypeName();
00030   int displayLoc[2], displaySize[2];
00031   VMDgetDisplayFrame(displayLoc, displaySize);
00032 
00033   VMDApp *app = new VMDApp(argc, argv);
00034 
00035   if (!app->VMDinit(argc, argv, displayTypeName, displayLoc, displaySize)) {
00036     delete app;
00037     return 1;
00038   }
00039 
00040   // read various application defaults
00041   VMDreadInit(app);
00042 
00043   // read user-defined startup files
00044   VMDreadStartup(app);
00045 
00046   // main event loop
00047   do {
00048     // If we knew that there were no embedded python interpreter, we could
00049     // process Tcl events here, rather than within the VMD instance. 
00050 #ifdef VMDTCL
00051     // Loop on the Tcl event notifier
00052     // while (Tcl_DoOneEvent(TCL_DONT_WAIT));
00053 #endif
00054 
00055     // handle Fltk events
00056     VMDupdateFltk();
00057 
00058 #if 0
00059     // take over the console
00060     if (vmd_check_stdin()) {
00061       app->process_console();
00062     }
00063 #endif
00064 
00065   } while(app->VMDupdate(VMD_CHECK_EVENTS));
00066 
00067   // end of program
00068   delete app;
00069   VMDshutdown();
00070 
00071   return 0;
00072 }
00073 

Generated on Thu May 24 01:51:38 2012 for VMD (current) by doxygen1.2.14 written by Dimitri van Heesch, © 1997-2002