Changed the FrameBufferObject::setAttachment() methods so it now use osg::Camera::BufferComponent
to enable it to distinguish between MRT and non MRT paths
This commit is contained in:
@@ -295,8 +295,10 @@ namespace osg
|
||||
class OSG_EXPORT FrameBufferObject: public StateAttribute
|
||||
{
|
||||
public:
|
||||
typedef std::map<GLenum, FrameBufferAttachment> AttachmentMap;
|
||||
typedef std::map<Camera::BufferComponent, FrameBufferAttachment> AttachmentMap;
|
||||
typedef std::vector<GLenum> MultipleRenderingTargets;
|
||||
|
||||
typedef Camera::BufferComponent BufferComponent;
|
||||
|
||||
FrameBufferObject();
|
||||
FrameBufferObject(const FrameBufferObject& copy, const CopyOp& copyop = CopyOp::SHALLOW_COPY);
|
||||
@@ -304,10 +306,19 @@ namespace osg
|
||||
META_StateAttribute(osg, FrameBufferObject, (StateAttribute::Type)0x101010/*FrameBufferObject*/);
|
||||
|
||||
inline const AttachmentMap& getAttachmentMap() const;
|
||||
inline bool hasAttachment(GLenum attachment_point) 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; }
|
||||
@@ -333,6 +344,8 @@ namespace osg
|
||||
virtual ~FrameBufferObject();
|
||||
FrameBufferObject& operator = (const FrameBufferObject&) { return *this; }
|
||||
|
||||
void updateDrawBuffers();
|
||||
|
||||
inline void dirtyAll();
|
||||
|
||||
private:
|
||||
@@ -355,11 +368,21 @@ namespace osg
|
||||
}
|
||||
|
||||
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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user