Changeset 846

Show
Ignore:
Timestamp:
07/24/07 11:08:26 (1 year ago)
Author:
dshipton
Message:

Don't re-create FBO's when re-initializing or refreshing windows…just rebind.
Otherwise we run out of FBO's to alloc because we are binding new without deleting the old.

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • branches/fcptr_stable_jun07/Source/System/Window/FrameBufferObjects/OSGFrameBufferObject.cpp

    r646 r846  
    349349    { 
    350350        GLuint uiFBOId; 
    351  
    352         GLGenFramebuffersEXTProcT glGenFramebuffersEXTProc =  
    353             (GLGenFramebuffersEXTProcT) win->getFunction( 
    354                 _uiFuncGenFramebuffers); 
    355  
    356         glGenFramebuffersEXTProc(1, &uiFBOId); 
    357  
    358         win->setGLObjectId(osgid, uiFBOId); 
    359  
    360         GLBindFramebufferEXTProcT glBindFramebufferEXTProc = 
    361             (GLBindFramebufferEXTProcT) win->getFunction( 
    362                 _uiFuncBindFramebuffer); 
    363  
     351        if(mode == Window::initialize) 
     352        { 
     353           GLGenFramebuffersEXTProcT glGenFramebuffersEXTProc =  
     354               (GLGenFramebuffersEXTProcT) win->getFunction( 
     355                   _uiFuncGenFramebuffers); 
     356 
     357           glGenFramebuffersEXTProc(1, &uiFBOId); 
     358 
     359           win->setGLObjectId(osgid, uiFBOId); 
     360         } 
     361         else 
     362         { 
     363            // already has an GLid 
     364            uiFBOId = win->getGLObjectId(osgid); 
     365         } 
     366 
     367        GLBindFramebufferEXTProcT glBindFramebufferEXTProc = 
     368            (GLBindFramebufferEXTProcT) win->getFunction( 
     369                _uiFuncBindFramebuffer); 
    364370        glBindFramebufferEXTProc(GL_FRAMEBUFFER_EXT, uiFBOId); 
    365371