gKitGL
 All Classes Namespaces Functions Variables Typedefs Enumerator Friends
Public Member Functions | Protected Member Functions | Protected Attributes
gk::GLFramebuffer Class Reference

representation d'un (draw) framebuffer. More...

#include <TPFramebuffer.h>

Inheritance diagram for gk::GLFramebuffer:
gk::GLRendertarget gk::GLResource

List of all members.

Public Member Functions

 GLFramebuffer ()
 constructeur.
 GLFramebuffer (const int w, const int h, const unsigned int buffer_bits, const TextureFormat &color_format=TextureRGBA, const TextureFormat &depth_format=TextureDepth)
 constructeur, cf GLRendertarget().
 ~GLFramebuffer ()
 destructeur.
int attachTexture (const unsigned int buffer, GLTexture *texture, const int level=0)
 associe une texture au framebuffer. cf GLRendertarget::attachTexture().
int attachTexture (const GLenum target, const unsigned int buffer, GLDepthTexture *texture, const int level=0)
 associe une texture au framebuffer. cf GLRendertarget::attachTexture().
int attachTexture (const GLenum target, const unsigned int buffer, GLTexture2DArray *texture, const int layer, const int level=0)
 associe une texture au framebuffer. cf GLRendertarget::attachTexture().
int attachTexture (const GLenum target, const unsigned int buffer, GLTextureCube *texture, const GLenum face, const int level=0)
 associe une texture au framebuffer. cf GLRendertarget::attachTexture().
int attachRenderbuffer (const unsigned int buffer, GLRenderbuffer *renderbuffer)
int validate ()
 valide la configuration du framebuffer.
int attachTexture (const GLenum target, const unsigned int buffer, GLTexture *texture, const int level=0)
 associe une texture existante au framebuffer.
int attachRenderbuffer (const GLenum target, const unsigned int buffer, GLRenderbuffer *renderbuffer)
int createGLResource ()
 creation de l'objet opengl.
int releaseGLResource ()
 destruction de l'objet opengl.
int validate (const GLenum target)
 verifie la configuration du framebuffer.
int width () const
 renvoie la largeur du framebuffer. renvoie 0, si la largeur du framebuffer n'est pas definie.
int height () const
 renvoie la hauteur du framebuffer. renvoie 0, si la hauteur du framebuffer n'est pas definie.
GLTexturetexture (const unsigned int buffer)
 renvoie la texture associee a buffer (cf gk::COLOR0, gk::COLOR1, etc.)
GLRenderbufferrenderbuffer (const unsigned int buffer)
 renvoie le renderbuffer associe a buffer (cf gk::COLOR0, gk::COLOR1, gk::DEPTH, etc.)
GLDepthTexturedepthtexture ()
 renvoie le zbuffer, la texture associee a gk::DEPTH
const std::vector< GLenum > & drawBuffers ()
 renvoie les draw buffers opengl / textures attachees (cf. glDrawBuffers() et GL_COLOR_ATTACHMENT0, etc.).
bool colorMask () const
 renvoie vrai si des textures couleurs sont attachees.
bool depthMask () const
 renvoie vrai si un zbuffer est attache.
GLuint name () const
 renvoie l'identifiant de l'objet openGL.

Protected Member Functions

template<typename Texture >
int attach_buffer (const unsigned int buffer, Texture *texture)

Protected Attributes

std::vector< GLTexture * > m_textures
std::vector< GLRenderbuffer * > m_renderbuffers
std::vector< GLenum > m_draw_buffers
int m_width
int m_height
int m_color_mask
int m_depth_mask
GLuint m_name

Detailed Description

representation d'un (draw) framebuffer.


Member Function Documentation

int gk::GLRendertarget::attachTexture ( const GLenum  target,
const unsigned int  buffer,
GLTexture texture,
const int  level = 0 
) [inherited]

associe une texture existante au framebuffer.

buffer = gk::COLOR0, etc. ou gk::DEPTH. toutes les textures doivent avoir les memes dimensions.

References gk::GLResource::name(), and gk::GLTexture::target().

renvoie le zbuffer, la texture associee a gk::DEPTH

Todo:
inclure les autres formats depth component
const std::vector<GLenum>& gk::GLRendertarget::drawBuffers ( ) [inline, inherited]

renvoie les draw buffers opengl / textures attachees (cf. glDrawBuffers() et GL_COLOR_ATTACHMENT0, etc.).

    const std::vector<GLenum>& buffers= framebuffer->drawBuffers();
    glDrawbuffers((GLsizei) buffers.size(), &buffers.front());
bool gk::GLRendertarget::colorMask ( ) const [inline, inherited]

renvoie vrai si des textures couleurs sont attachees.

cf. glColorMask( ) pour bloquer l'ecriture dans le framebuffer, si necessaire.

bool gk::GLRendertarget::depthMask ( ) const [inline, inherited]

renvoie vrai si un zbuffer est attache.

cf. glDepthMask( ) pour bloquer l'ecriture dans le framebuffer, si necessaire.


The documentation for this class was generated from the following file:
 All Classes Namespaces Functions Variables Typedefs Enumerator Friends