Changeset 8585
- Timestamp:
- 07/15/08 16:24:21
- Files:
-
- OpenSceneGraph/trunk/include/osg/FrameBufferObject (modified) (4 diffs)
- OpenSceneGraph/trunk/src/osg/FrameBufferObject.cpp (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
OpenSceneGraph/trunk/include/osg/FrameBufferObject
r8453 r8585 372 372 373 373 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 378 374 void setAttachment(BufferComponent attachment_point, const FrameBufferAttachment &attachment); 379 375 inline const FrameBufferAttachment& getAttachment(BufferComponent attachment_point) const; 380 376 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 386 378 inline bool hasMultipleRenderingTargets() const { return !_drawBuffers.empty(); } 387 379 inline const MultipleRenderingTargets& getMultipleRenderingTargets() const { return _drawBuffers; } … … 424 416 inline void dirtyAll(); 425 417 418 GLenum convertBufferComponentToGLenum(BufferComponent attachment_point) const; 419 426 420 private: 427 421 AttachmentMap _attachments; … … 443 437 } 444 438 445 inline bool FrameBufferObject::hasAttachment(GLenum attachment_point) const446 {447 return hasAttachment(convertGLenumToBufferComponent(attachment_point));448 }449 450 439 inline bool FrameBufferObject::hasAttachment(FrameBufferObject::BufferComponent attachment_point) const 451 440 { … … 453 442 } 454 443 455 inline const FrameBufferAttachment &FrameBufferObject::getAttachment(GLenum attachment_point) const456 {457 return getAttachment(convertGLenumToBufferComponent(attachment_point));458 }459 460 444 inline const FrameBufferAttachment &FrameBufferObject::getAttachment(FrameBufferObject::BufferComponent attachment_point) const 461 445 { OpenSceneGraph/trunk/src/osg/FrameBufferObject.cpp
r8453 r8585 660 660 } 661 661 662 void FrameBufferObject::setAttachment(GLenum attachment_point, const FrameBufferAttachment &attachment)663 {664 setAttachment(convertGLenumToBufferComponent(attachment_point),attachment);665 }666 667 662 void FrameBufferObject::setAttachment(BufferComponent attachment_point, const FrameBufferAttachment &attachment) 668 663 { … … 683 678 case(Camera::COLOR_BUFFER): return GL_COLOR_ATTACHMENT0_EXT; 684 679 default: return GLenum(GL_COLOR_ATTACHMENT0_EXT + (attachment_point-Camera::COLOR_BUFFER0)); 685 }686 }687 688 FrameBufferObject::BufferComponent FrameBufferObject::convertGLenumToBufferComponent(GLenum attachment_point) const689 {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));696 680 } 697 681 }
