diff --git a/include/osg/FrameBufferObject b/include/osg/FrameBufferObject index 0305e19d9..de1a52326 100644 --- a/include/osg/FrameBufferObject +++ b/include/osg/FrameBufferObject @@ -371,18 +371,10 @@ namespace osg inline const AttachmentMap& getAttachmentMap() const; - void setAttachment(GLenum attachment_point, const FrameBufferAttachment &attachment); - inline const FrameBufferAttachment& getAttachment(GLenum attachment_point) const; - inline bool hasAttachment(GLenum attachment_point) const; - void setAttachment(BufferComponent attachment_point, const FrameBufferAttachment &attachment); inline const FrameBufferAttachment& getAttachment(BufferComponent attachment_point) const; inline bool hasAttachment(BufferComponent attachment_point) const; - - GLenum convertBufferComponentToGLenum(BufferComponent attachment_point) const; - BufferComponent convertGLenumToBufferComponent(GLenum attachment_point) const; - inline bool hasMultipleRenderingTargets() const { return !_drawBuffers.empty(); } inline const MultipleRenderingTargets& getMultipleRenderingTargets() const { return _drawBuffers; } @@ -423,6 +415,8 @@ namespace osg inline void dirtyAll(); + GLenum convertBufferComponentToGLenum(BufferComponent attachment_point) const; + private: AttachmentMap _attachments; @@ -442,21 +436,11 @@ namespace osg return _attachments; } - inline bool FrameBufferObject::hasAttachment(GLenum attachment_point) const - { - return hasAttachment(convertGLenumToBufferComponent(attachment_point)); - } - inline bool FrameBufferObject::hasAttachment(FrameBufferObject::BufferComponent attachment_point) const { return _attachments.find(attachment_point) != _attachments.end(); } - inline const FrameBufferAttachment &FrameBufferObject::getAttachment(GLenum attachment_point) const - { - return getAttachment(convertGLenumToBufferComponent(attachment_point)); - } - inline const FrameBufferAttachment &FrameBufferObject::getAttachment(FrameBufferObject::BufferComponent attachment_point) const { return _attachments.find(attachment_point)->second; diff --git a/src/osg/FrameBufferObject.cpp b/src/osg/FrameBufferObject.cpp index b51f282a8..d30a7e94a 100644 --- a/src/osg/FrameBufferObject.cpp +++ b/src/osg/FrameBufferObject.cpp @@ -659,11 +659,6 @@ FrameBufferObject::~FrameBufferObject() } } -void FrameBufferObject::setAttachment(GLenum attachment_point, const FrameBufferAttachment &attachment) -{ - setAttachment(convertGLenumToBufferComponent(attachment_point),attachment); -} - void FrameBufferObject::setAttachment(BufferComponent attachment_point, const FrameBufferAttachment &attachment) { GLenum gl_attachment = convertBufferComponentToGLenum(attachment_point); @@ -685,17 +680,6 @@ GLenum FrameBufferObject::convertBufferComponentToGLenum(BufferComponent attachm } } -FrameBufferObject::BufferComponent FrameBufferObject::convertGLenumToBufferComponent(GLenum attachment_point) const -{ - switch(attachment_point) - { - case(GL_DEPTH_ATTACHMENT_EXT): return Camera::DEPTH_BUFFER; - case(GL_STENCIL_ATTACHMENT_EXT): return Camera::STENCIL_BUFFER; - case(GL_COLOR_ATTACHMENT0_EXT): return Camera::COLOR_BUFFER; - default: return BufferComponent(Camera::COLOR_BUFFER0+(attachment_point-GL_COLOR_ATTACHMENT0_EXT)); - } -} - void FrameBufferObject::updateDrawBuffers() { _drawBuffers.clear();