From Art Trevs, Removed GLeunm version setAttachment() to avoid ambigiuity with

whether to enable MRT.
This commit is contained in:
Robert Osfield 2008-07-15 14:24:21 +00:00
parent c88d34ee97
commit 35bc9c7dd2
2 changed files with 2 additions and 34 deletions

View File

@ -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;

View File

@ -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();