18 #ifndef ION_GFX_FRAMEBUFFEROBJECT_H_
19 #define ION_GFX_FRAMEBUFFEROBJECT_H_
21 #include "base/macros.h"
58 kColorAttachmentChanged = kNumBaseChanges,
128 return binding_ != other.binding_ || format_ != other.format_ ||
129 texture_.Get() != other.texture_.
Get() ||
130 image_.Get() != other.image_.
Get() ||
131 cubemap_.Get() != other.cubemap_.
Get() ||
132 mip_level_ != other.mip_level_ || samples_ != other.samples_;
154 void Resize(uint32
width, uint32 height);
164 DCHECK_EQ(0U, i) <<
"***ION: Only a single color attachment is supported";
165 return color0_.Get();
167 void SetColorAttachment(
size_t i,
const Attachment& attachment);
170 void SetDepthAttachment(
const Attachment& attachment);
173 return stencil_.Get();
175 void SetStencilAttachment(
const Attachment& attachment);
178 static bool IsColorRenderable(uint32 gl_format);
179 static bool IsDepthRenderable(uint32 gl_format);
180 static bool IsStencilRenderable(uint32 gl_format);
195 void SetAttachment(Field<Attachment>* field,
bool (*validator)(
Image::Format),
196 const Attachment& attachment,
197 const std::string& type_name);
199 Field<uint32> width_;
200 Field<uint32> height_;
201 Field<Attachment> color0_;
202 Field<Attachment> depth_;
203 Field<Attachment> stencil_;
214 #endif // ION_GFX_FRAMEBUFFEROBJECT_H_
base::ReferentPtr< FramebufferObject >::Type FramebufferObjectPtr
Convenience typedef for shared pointer to a FramebufferObject.
Changes
Changes that affect the resource.
Format
Supported image formats.
const CubeMapTexturePtr & GetCubeMapTexture() const
Gets the cubemap of the attachment, if any.
AttachmentBinding GetBinding() const
Gets the binding of the attachment.
uint32 GetWidth() const
Gets the width of the FramebufferObject and its attachments.
A Notifier both sends notifications to and receives notifications from other Notifiers.
size_t GetSamples() const
Returns the number of samples for multisampling.
const TexturePtr & GetTexture() const
Gets the texture of the attachment, if any.
CubeFace
The names of faces of the cube map.
AttachmentBinding
The type of binding for an Attachment.
A FramebufferObject describes an off-screen framebuffer that can be drawn to and read from like a reg...
T * Get() const
Returns a raw pointer to the instance, which may be NULL.
const Attachment & GetDepthAttachment() const
Gets and sets the depth Attachment.
size_t GetMipLevel() const
Returns the mipmap level of a Texture or CubeMapTexture attachment.
#define DCHECK_EQ(val1, val2)
uint32 GetHeight() const
Gets the height of the FramebufferObject and its attachments.
const Attachment & GetStencilAttachment() const
Gets and sets the stencil Attachment.
const ImagePtr & GetImage() const
Gets the image of the attachment, if any.
bool operator!=(const StlAllocator< T1 > &lhs, const StlAllocator< T2 > &rhs)
CubeMapTexture::CubeFace GetCubeMapFace() const
Gets the cubemap face of the attachment.
An attachment represents a data store attached to one of the framebuffer's targets.
A SharedPtr is a smart shared pointer to an instance of some class that implements reference counting...
ResourceHolder is an internal base class for objects that hold resources managed by an outside entity...
const Attachment & GetColorAttachment(size_t i) const
Gets and sets the i-th color Attachment.