00001 /*************************************************************************** 00002 *cr 00003 *cr (C) Copyright 1995-2019 The Board of Trustees of the 00004 *cr University of Illinois 00005 *cr All Rights Reserved 00006 *cr 00007 *cr VRJuggler patches contributed by Martijn Kragtwijk: m.kragtwijk@rug.nl 00008 *cr 00009 ***************************************************************************/ 00010 00011 /*************************************************************************** 00012 * RCS INFORMATION: 00013 * 00014 * $RCSfile: VRJugglerRoutines.C,v $ 00015 * $Author: johns $ $Locker: $ $State: Exp $ 00016 * $Revision: 1.4 $ $Date: 2019/01/17 21:21:02 $ 00017 * 00018 *************************************************************************** 00019 * DESCRIPTION: 00020 * 00021 * routines to get memory from and return memory to the 00022 * VRJuggler shared memory arena 00023 ***************************************************************************/ 00024 //#include <vrjuggler_ogl.h> 00025 00026 #include "VRJugglerRoutines.h" 00027 #include "Inform.h" 00028 #include "VMDApp.h" 00029 #include "VRJugglerDisplayDevice.h" 00030 #include "VRJugglerScene.h" 00031 00032 #define VRJugglerMAGICINIT 3142 00033 static int vmd_vrjuggler_initialized_flag = 0; // global init state variable 00034 00035 int vmd_vrjuggler_is_initialized() { 00036 if (vmd_vrjuggler_initialized_flag == VRJugglerMAGICINIT) 00037 return 1; 00038 else 00039 return 0; 00040 } 00041 00042 void vmd_set_vrjuggler_is_initialized() { 00043 vmd_vrjuggler_initialized_flag = VRJugglerMAGICINIT; 00044 } 00045 00046 // set up the graphics, called from VRJugglerInitApplication 00047 void vrjuggler_gl_init_fn(void) { 00048 // nothing to do 00049 } 00050 00051 // XXX globals to keep track of the display and scene data structures 00052 static VRJugglerScene *vrjugglerscene; 00053 static VRJugglerDisplayDevice *vrjugglerdisplay; 00054 00055 void set_vrjuggler_pointers(VRJugglerScene *scene, VRJugglerDisplayDevice *display) { 00056 msgInfo << "set_vrjuggler_pointers" << sendmsg; 00057 vrjugglerscene = scene; 00058 vrjugglerdisplay = display; 00059 } 00060 00061 // call the child display renderer, and wait until they are done 00062 void vrjuggler_renderer(void) { 00063 // msgInfo << "vrjuggler_renderer" << sendmsg; 00064 if (vrjugglerscene){ 00065 vrjugglerscene->draw(vrjugglerdisplay); 00066 vrjugglerscene->draw_finished(); 00067 } else { 00068 msgErr << "vrjuggler_renderer(): vrjugglerscene is NULL" << sendmsg; 00069 } 00070 } 00071