Support Forum       G3D Web Page     
Public Types | Public Member Functions | Protected Member Functions | Static Protected Member Functions | Protected Attributes | Friends | List of all members
G3D::Framebuffer::Attachment Class Reference

Inherits G3D::ReferenceCountedObject.

Public Types

enum  Type {
  TEXTURE,
  DUMMY
}
 

Public Member Functions

CubeFace cubeFace () const
 
const ImageFormatformat () const
 
int height () const
 
int layer () const
 Will be -1 if no layer selected. More...
 
int mipLevel () const
 
AttachmentPoint point () const
 
void resize (int w, int h)
 
const shared_ptr< Texture > & texture () const
 
Type type () const
 
Vector2 vector2Bounds () const
 
int width () const
 

Protected Member Functions

 Attachment (AttachmentPoint ap, const shared_ptr< Texture > &r, CubeFace c, int miplevel, int layer)
 
 Attachment (AttachmentPoint ap, int width, int height, int numLayers, int numSamples, bool fixedSamplesLocation)
 Dummy attachment. More...
 
void attach () const
 Called from sync() to actually force this to be attached at the OpenGL level. More...
 
void detach () const
 Called from sync() to actually force this to be detached at the OpenGL level. More...
 
bool equals (const shared_ptr< Texture > &t, CubeFace f, int miplevel, int layer) const
 Assumes the point is correct. More...
 
bool equals (const shared_ptr< Attachment > &other) const
 

Static Protected Member Functions

static shared_ptr< Attachmentcreate (AttachmentPoint ap, const shared_ptr< Texture > &r, CubeFace c, int miplevel, int layer)
 
template<class T , class ... ArgTypes>
static shared_ptr< T > createShared (ArgTypes &&... args)
 Like std::make_shared, but works for protected constructors. More...
 

Protected Attributes

Color4 m_clearValue
 
CubeFace m_cubeFace
 If texture is a CubeFace::MAP, this is the face that is attached. More...
 
bool m_fixedSamplesLocation
 
int m_height
 
int m_layer
 Individual layer to be bound. More...
 
int m_mipLevel
 Mip level being rendered to. More...
 
int m_numLayers
 
int m_numSamples
 
AttachmentPoint m_point
 
shared_ptr< Texturem_texture
 
Type m_type
 
int m_width
 These parameters are used only for DUMMY attachment, which is used when the framebuffer is in no-attachment mode. More...
 

Friends

class Framebuffer
 

Member Enumeration Documentation

◆ Type

Enumerator
TEXTURE 
DUMMY 

DUMMY attachment is used as a proxy for framebuffer parameters (resolution, num layers, etc.) when using no-attachment FBO.

Constructor & Destructor Documentation

◆ Attachment() [1/2]

G3D::Framebuffer::Attachment::Attachment ( AttachmentPoint  ap,
const shared_ptr< Texture > &  r,
CubeFace  c,
int  miplevel,
int  layer 
)
protected

◆ Attachment() [2/2]

G3D::Framebuffer::Attachment::Attachment ( AttachmentPoint  ap,
int  width,
int  height,
int  numLayers,
int  numSamples,
bool  fixedSamplesLocation 
)
protected

Dummy attachment.

Member Function Documentation

◆ attach()

void G3D::Framebuffer::Attachment::attach ( ) const
protected

Called from sync() to actually force this to be attached at the OpenGL level.

Assumes the framebuffer is already bound.

◆ create()

static shared_ptr<Attachment> G3D::Framebuffer::Attachment::create ( AttachmentPoint  ap,
const shared_ptr< Texture > &  r,
CubeFace  c,
int  miplevel,
int  layer 
)
inlinestaticprotected

◆ createShared()

template<class T , class ... ArgTypes>
static shared_ptr<T> G3D::ReferenceCountedObject::createShared ( ArgTypes &&...  args)
inlinestaticprotectedinherited

Like std::make_shared, but works for protected constructors.

Call as createShared<myclass>.

◆ cubeFace()

CubeFace G3D::Framebuffer::Attachment::cubeFace ( ) const
inline

◆ detach()

void G3D::Framebuffer::Attachment::detach ( ) const
protected

Called from sync() to actually force this to be detached at the OpenGL level.

Assumes the framebuffer is already bound.

◆ equals() [1/2]

bool G3D::Framebuffer::Attachment::equals ( const shared_ptr< Texture > &  t,
CubeFace  f,
int  miplevel,
int  layer 
) const
protected

Assumes the point is correct.

◆ equals() [2/2]

bool G3D::Framebuffer::Attachment::equals ( const shared_ptr< Attachment > &  other) const
protected

◆ format()

const ImageFormat* G3D::Framebuffer::Attachment::format ( ) const

◆ height()

int G3D::Framebuffer::Attachment::height ( ) const

◆ layer()

int G3D::Framebuffer::Attachment::layer ( ) const
inline

Will be -1 if no layer selected.

Referenced by create().

◆ mipLevel()

int G3D::Framebuffer::Attachment::mipLevel ( ) const
inline

◆ point()

AttachmentPoint G3D::Framebuffer::Attachment::point ( ) const
inline

◆ resize()

void G3D::Framebuffer::Attachment::resize ( int  w,
int  h 
)

◆ texture()

const shared_ptr<Texture>& G3D::Framebuffer::Attachment::texture ( ) const
inline

◆ type()

Type G3D::Framebuffer::Attachment::type ( ) const
inline

◆ vector2Bounds()

Vector2 G3D::Framebuffer::Attachment::vector2Bounds ( ) const

◆ width()

int G3D::Framebuffer::Attachment::width ( ) const

Friends And Related Function Documentation

◆ Framebuffer

friend class Framebuffer
friend

Member Data Documentation

◆ m_clearValue

Color4 G3D::Framebuffer::Attachment::m_clearValue
protected

◆ m_cubeFace

CubeFace G3D::Framebuffer::Attachment::m_cubeFace
protected

If texture is a CubeFace::MAP, this is the face that is attached.

Referenced by cubeFace().

◆ m_fixedSamplesLocation

bool G3D::Framebuffer::Attachment::m_fixedSamplesLocation
protected

◆ m_height

int G3D::Framebuffer::Attachment::m_height
protected

◆ m_layer

int G3D::Framebuffer::Attachment::m_layer
protected

Individual layer to be bound.

If -1, the texture is bound normally, if >= 0, it is bound using glFramebufferTextureLayer

Referenced by layer().

◆ m_mipLevel

int G3D::Framebuffer::Attachment::m_mipLevel
protected

Mip level being rendered to.

Referenced by mipLevel().

◆ m_numLayers

int G3D::Framebuffer::Attachment::m_numLayers
protected

◆ m_numSamples

int G3D::Framebuffer::Attachment::m_numSamples
protected

◆ m_point

AttachmentPoint G3D::Framebuffer::Attachment::m_point
protected

Referenced by point().

◆ m_texture

shared_ptr<Texture> G3D::Framebuffer::Attachment::m_texture
protected

Referenced by texture().

◆ m_type

Type G3D::Framebuffer::Attachment::m_type
protected

Referenced by type().

◆ m_width

int G3D::Framebuffer::Attachment::m_width
protected

These parameters are used only for DUMMY attachment, which is used when the framebuffer is in no-attachment mode.

Dummy attahcment do not have any texture associated, and thus have to keep parameters here.


documentation generated on Wed Nov 24 2021 08:01:55 using doxygen 1.8.15