Changeset 19839
- Timestamp:
- 02/22/07 21:02:32 (2 years ago)
- Files:
-
- juggler/trunk/modules/vrjuggler/ChangeLog (modified) (1 diff)
- juggler/trunk/modules/vrjuggler/VERSION (modified) (1 diff)
- juggler/trunk/modules/vrjuggler/vrj/Draw/OGL/GlBasicSimulator.cpp (modified) (3 diffs)
- juggler/trunk/modules/vrjuggler/vrj/Draw/OGL/GlBasicSimulator.h (modified) (2 diffs)
- juggler/trunk/modules/vrjuggler/vrj/Draw/OGL/GlDrawHeadFunctors.cpp (modified) (2 diffs)
- juggler/trunk/modules/vrjuggler/vrj/Draw/OGL/GlDrawHeadFunctors.h (modified) (1 diff)
- juggler/trunk/modules/vrjuggler/vrj/Draw/OGL/GlPipe.cpp (modified) (4 diffs)
- juggler/trunk/modules/vrjuggler/vrj/Draw/OGL/GlSimInterface.h (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
juggler/trunk/modules/vrjuggler/ChangeLog
r19833 r19839 1 1 DATE AUTHOR CHANGE 2 2 ----------- ----------- ------------------------------------------------------- 3 Feb-22-2007 patrick Added vrj::GlSimInterface::contextInit() so that the 4 contextInit() method in vrj::GlDrawObjectFunctor can 5 be invoked. 6 NEW VERSION: 2.1.18 3 7 Feb-21-2007 patrick Updated for new keys in Gadgeteer 1.1.24. 4 8 Jan-30-2007 patrick Eliminated the need to set VJ_BASE_DIR on Windwos to juggler/trunk/modules/vrjuggler/VERSION
r19790 r19839 1 2.1.1 7-0 @01/30/2007 22:30:00 UTC@1 2.1.18-0 @02/23/2007 03:05:00 UTC@ 2 2 2.1.16-0 @12/18/2006 17:45:00 UTC@ 3 3 2.1.15-0 @11/14/2006 23:05:00 UTC@ juggler/trunk/modules/vrjuggler/vrj/Draw/OGL/GlBasicSimulator.cpp
r19729 r19839 119 119 } 120 120 121 void GlBasicSimulator::contextInit() 122 { 123 initSimulator(); 124 } 125 121 126 /** 122 127 * Draws this sim device using the given information about the Window it … … 127 132 drawSimulator(scaleFactor); 128 133 } 129 130 134 131 135 /** … … 319 323 } // for viewports 320 324 } // for disps 325 } 326 327 void GlBasicSimulator::initSimulator() 328 { 329 mDrawHeadFunctor->contextInit(); 330 mDrawWandFunctor->contextInit(); 321 331 } 322 332 juggler/trunk/modules/vrjuggler/vrj/Draw/OGL/GlBasicSimulator.h
r19729 r19839 76 76 77 77 /** 78 * Tells the simulator draw functors to perform context-specific 79 * negotiation. 80 * 81 * @since 2.1.18 82 */ 83 virtual void contextInit(); 84 85 /** 78 86 * Draws this sim device using the given information about the Window it 79 87 * will be drawing into. … … 136 144 void drawProjections(bool drawFrustum, gmtl::Vec3f surfColor, 137 145 const float scaleFactor); 146 147 /** 148 * Tells the simulator draw functors to perform context-specific 149 * negotiation. 150 */ 151 void initSimulator(); 138 152 139 153 /** juggler/trunk/modules/vrjuggler/vrj/Draw/OGL/GlDrawHeadFunctors.cpp
r19729 r19839 37 37 38 38 GlDrawEllipsoidHeadFunctor::GlDrawEllipsoidHeadFunctor() 39 : mQuadObj( gluNewQuadric())39 : mQuadObj(NULL) 40 40 { 41 41 } … … 43 43 GlDrawEllipsoidHeadFunctor::~GlDrawEllipsoidHeadFunctor() 44 44 { 45 gluDeleteQuadric(mQuadObj); 45 if ( NULL != mQuadObj ) 46 { 47 gluDeleteQuadric(mQuadObj); 48 } 49 } 50 51 void GlDrawEllipsoidHeadFunctor::contextInit() 52 { 53 if ( NULL == mQuadObj ) 54 { 55 mQuadObj = gluNewQuadric(); 56 } 46 57 } 47 58 juggler/trunk/modules/vrjuggler/vrj/Draw/OGL/GlDrawHeadFunctors.h
r19729 r19839 56 56 57 57 /** Called to initialize any context-specific information. */ 58 virtual void contextInit() 59 {;} 60 58 virtual void contextInit(); 59 61 60 /** 62 61 * Callback function for drawing. Called when the object should be drawn. juggler/trunk/modules/vrjuggler/vrj/Draw/OGL/GlPipe.cpp
r19729 r19839 362 362 // Update the projections for the display using the current app's scale factor 363 363 // NOTE: This relies upon no other thread trying to update this display at the same time 364 float scale_factor = the_app->getDrawScaleFactor();364 const float scale_factor = the_app->getDrawScaleFactor(); 365 365 the_display->updateProjections(scale_factor); 366 366 … … 382 382 win->updateViewport(); 383 383 } 384 385 const size_t num_vps = the_display->getNumViewports(); 384 386 385 387 // CONTEXT INIT(): Check if we need to call contextInit() … … 394 396 395 397 the_app->contextInit(); // Call context init function 398 399 // Invoke vrj::GlSimInterface::contextInit() for all simulator 400 // viewports. 401 for ( size_t vp_num = 0; vp_num < num_vps; ++vp_num ) 402 { 403 Viewport* viewport = the_display->getViewport(vp_num); 404 405 if ( viewport->isActive() && viewport->isSimulator() ) 406 { 407 SimViewport* sim_vp = dynamic_cast<SimViewport*>(viewport); 408 vprASSERT(NULL != sim_vp); 409 410 GlSimInterface* draw_sim_i = 411 dynamic_cast<GlSimInterface*>(sim_vp->getDrawSimInterface()); 412 413 if ( NULL != draw_sim_i ) 414 { 415 draw_sim_i->contextInit(); 416 } 417 } 418 } 419 396 420 win->setDirtyContext(false); // All clean now 397 421 } … … 413 437 414 438 // --- FOR EACH VIEWPORT -- // 415 Viewport* viewport = NULL;416 size_t num_vps = the_display->getNumViewports();417 439 for ( size_t vp_num = 0; vp_num < num_vps; ++vp_num ) 418 440 { 419 viewport = the_display->getViewport(vp_num);441 Viewport* viewport = the_display->getViewport(vp_num); 420 442 421 443 // Should viewport be rendered??? juggler/trunk/modules/vrjuggler/vrj/Draw/OGL/GlSimInterface.h
r19729 r19839 51 51 52 52 /** 53 * Provides this simulator interface with an opportunity to perform 54 * context-specific initialization. 55 * 56 * @since 2.1.18 57 */ 58 virtual void contextInit() 59 { 60 /* Do nothing. */ ; 61 } 62 63 /** 53 64 * Draws this sim device using the given information about the Window it 54 65 * will be drawing into.
