Changeset 8585

Show
Ignore:
Timestamp:
07/15/08 16:24:21
Author:
robert
Message:

From Art Trevs, Removed GLeunm version setAttachment() to avoid ambigiuity with
whether to enable MRT.

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • OpenSceneGraph/trunk/include/osg/FrameBufferObject

    r8453 r8585  
    372372         
    373373 
    374         void setAttachment(GLenum attachment_point, const FrameBufferAttachment &attachment); 
    375         inline const FrameBufferAttachment& getAttachment(GLenum attachment_point) const; 
    376         inline bool hasAttachment(GLenum attachment_point) const; 
    377  
    378374        void setAttachment(BufferComponent attachment_point, const FrameBufferAttachment &attachment); 
    379375        inline const FrameBufferAttachment& getAttachment(BufferComponent attachment_point) const; 
    380376        inline bool hasAttachment(BufferComponent attachment_point) const; 
    381  
    382         GLenum convertBufferComponentToGLenum(BufferComponent attachment_point) const; 
    383         BufferComponent convertGLenumToBufferComponent(GLenum attachment_point) const; 
    384          
    385  
     377         
    386378        inline bool hasMultipleRenderingTargets() const { return !_drawBuffers.empty(); } 
    387379        inline const MultipleRenderingTargets& getMultipleRenderingTargets() const { return _drawBuffers; } 
     
    424416        inline void dirtyAll(); 
    425417 
     418        GLenum convertBufferComponentToGLenum(BufferComponent attachment_point) const; 
     419 
    426420    private:         
    427421        AttachmentMap               _attachments; 
     
    443437    } 
    444438 
    445     inline bool FrameBufferObject::hasAttachment(GLenum attachment_point) const 
    446     { 
    447         return hasAttachment(convertGLenumToBufferComponent(attachment_point)); 
    448     } 
    449          
    450439    inline bool FrameBufferObject::hasAttachment(FrameBufferObject::BufferComponent attachment_point) const 
    451440    { 
     
    453442    } 
    454443 
    455     inline const FrameBufferAttachment &FrameBufferObject::getAttachment(GLenum attachment_point) const 
    456     { 
    457         return getAttachment(convertGLenumToBufferComponent(attachment_point)); 
    458     } 
    459  
    460444    inline const FrameBufferAttachment &FrameBufferObject::getAttachment(FrameBufferObject::BufferComponent attachment_point) const 
    461445    { 
  • OpenSceneGraph/trunk/src/osg/FrameBufferObject.cpp

    r8453 r8585  
    660660} 
    661661 
    662 void FrameBufferObject::setAttachment(GLenum attachment_point, const FrameBufferAttachment &attachment) 
    663 { 
    664     setAttachment(convertGLenumToBufferComponent(attachment_point),attachment); 
    665 } 
    666  
    667662void FrameBufferObject::setAttachment(BufferComponent attachment_point, const FrameBufferAttachment &attachment) 
    668663{ 
     
    683678        case(Camera::COLOR_BUFFER): return GL_COLOR_ATTACHMENT0_EXT; 
    684679        default: return GLenum(GL_COLOR_ATTACHMENT0_EXT + (attachment_point-Camera::COLOR_BUFFER0)); 
    685     } 
    686 } 
    687  
    688 FrameBufferObject::BufferComponent FrameBufferObject::convertGLenumToBufferComponent(GLenum attachment_point) const 
    689 { 
    690     switch(attachment_point) 
    691     { 
    692         case(GL_DEPTH_ATTACHMENT_EXT): return Camera::DEPTH_BUFFER; 
    693         case(GL_STENCIL_ATTACHMENT_EXT): return Camera::STENCIL_BUFFER; 
    694         case(GL_COLOR_ATTACHMENT0_EXT): return Camera::COLOR_BUFFER; 
    695         default: return BufferComponent(Camera::COLOR_BUFFER0+(attachment_point-GL_COLOR_ATTACHMENT0_EXT)); 
    696680    } 
    697681}