Visualization Library v1.0.3

A lightweight C++ OpenGL middleware for 2D/3D graphics

VL     Star     Watch     Fork     Issue

[Download] [Tutorials] [All Classes] [Grouped Classes]
Public Member Functions | Friends

vl::Framebuffer Class Reference

The Framebuffer class defines an abstract 'surface' where OpenGL can render into. More...

#include <Framebuffer.hpp>

Inheritance diagram for vl::Framebuffer:
vl::Object vl::FramebufferObject

List of all members.

Public Member Functions

 Framebuffer (OpenGLContext *ctx, int w, int h, EReadDrawBuffer draw_buffer, EReadDrawBuffer read_buffer)
 Constructor, see also OpenGLContext::framebuffer().
OpenGLContextopenglContext ()
 The OpenGLContext bound to a render target.
const OpenGLContextopenglContext () const
 The OpenGLContext bound to a render target.
int width () const
 The width of a render target.
int height () const
 The height of a render target.
void setWidth (int width)
 The width of a render target.
void setHeight (int height)
 The height of a render target.
virtual GLuint handle () const
 The framebuffer object id as used by glBindFramebuffer, Framebuffer::handle() always returns 0, i.e., the standard OpenGL framebuffer.
void activate (EFramebufferBind target=FBB_FRAMEBUFFER)
 Activates the Framebuffer by calling bindFramebuffer() and bindDrawBuffers()
virtual void bindFramebuffer (EFramebufferBind target=FBB_FRAMEBUFFER)
 Calls glBindFramebuffer(target, 0) thus activating the the framebuffer 0, that is, the normal OpenGL buffers.
void bindReadBuffer ()
 Binds to the currently active framebuffer object (including the 0 one) the read buffer specified by setReadBuffer().
void bindDrawBuffers () const
 Binds to the currently active framebuffer object (including the 0 one) the draw buffers specified by setDrawBuffers().
bool checkDrawBuffers () const
 Returns true if the draw buffers bound to this render target are legal for this render target type.
void setDrawBuffer (EReadDrawBuffer draw_buffer)
 Specifies the color buffer to be drawn into.
void setDrawBuffers (EReadDrawBuffer draw_buffer1, EReadDrawBuffer draw_buffer2)
 Specifies a list of color buffers to be drawn into.
void setDrawBuffers (EReadDrawBuffer draw_buffer1, EReadDrawBuffer draw_buffer2, EReadDrawBuffer draw_buffer3)
 Specifies a list of color buffers to be drawn into.
void setDrawBuffers (EReadDrawBuffer draw_buffer1, EReadDrawBuffer draw_buffer2, EReadDrawBuffer draw_buffer3, EReadDrawBuffer draw_buffer4)
 Specifies a list of color buffers to be drawn into.
void setDrawBuffers (const std::vector< EReadDrawBuffer > &draw_buffers)
 Specifies a list of color buffers to be drawn into.
const std::vector
< EReadDrawBuffer > & 
drawBuffers ()
 The color buffers to be drawn into.
EReadDrawBuffer readBuffer () const
 The read-buffer bound when the render target is activated.
void setReadBuffer (EReadDrawBuffer read_buffer)
 The read-buffer bound when the render target is activated.

Friends

class OpenGLContext

Detailed Description

The Framebuffer class defines an abstract 'surface' where OpenGL can render into.

See also:
OpenGLContext::framebuffer() and FramebufferObject

Definition at line 49 of file Framebuffer.hpp.


Constructor & Destructor Documentation

vl::Framebuffer::Framebuffer ( OpenGLContext ctx,
int  w,
int  h,
EReadDrawBuffer  draw_buffer,
EReadDrawBuffer  read_buffer 
) [inline]

Constructor, see also OpenGLContext::framebuffer().

Definition at line 57 of file Framebuffer.hpp.

References VL_DEBUG_SET_OBJECT_NAME.


Member Function Documentation

OpenGLContext* vl::Framebuffer::openglContext (  ) [inline]
const OpenGLContext* vl::Framebuffer::openglContext (  ) const [inline]

The OpenGLContext bound to a render target.

Definition at line 69 of file Framebuffer.hpp.

int vl::Framebuffer::width (  ) const [inline]
int vl::Framebuffer::height (  ) const [inline]
void vl::Framebuffer::setWidth ( int  width ) [inline]

The width of a render target.

Definition at line 78 of file Framebuffer.hpp.

Referenced by vl::FramebufferObject::deleteFBO(), vlWin32::Win32Window::WindowProc(), and vlEGL::EGLWindow::WindowProc().

void vl::Framebuffer::setHeight ( int  height ) [inline]

The height of a render target.

Definition at line 81 of file Framebuffer.hpp.

Referenced by vl::FramebufferObject::deleteFBO(), vlWin32::Win32Window::WindowProc(), and vlEGL::EGLWindow::WindowProc().

virtual GLuint vl::Framebuffer::handle (  ) const [inline, virtual]

The framebuffer object id as used by glBindFramebuffer, Framebuffer::handle() always returns 0, i.e., the standard OpenGL framebuffer.

Reimplemented in vl::FramebufferObject.

Definition at line 84 of file Framebuffer.hpp.

void vl::Framebuffer::activate ( EFramebufferBind  target = FBB_FRAMEBUFFER ) [inline]

Activates the Framebuffer by calling bindFramebuffer() and bindDrawBuffers()

Definition at line 87 of file Framebuffer.hpp.

Referenced by vl::BlitFramebuffer::copyPixels().

virtual void vl::Framebuffer::bindFramebuffer ( EFramebufferBind  target = FBB_FRAMEBUFFER ) [inline, virtual]

Calls glBindFramebuffer(target, 0) thus activating the the framebuffer 0, that is, the normal OpenGL buffers.

Note:
This method is overridden in FramebufferObject in order to activate the appropriate framebuffer object.

Reimplemented in vl::FramebufferObject.

Definition at line 96 of file Framebuffer.hpp.

References vl::FBB_DRAW_FRAMEBUFFER, vl::FBB_FRAMEBUFFER, vl::FBB_READ_FRAMEBUFFER, and VL_CHECK_OGL.

void Framebuffer::bindReadBuffer (  )

Binds to the currently active framebuffer object (including the 0 one) the read buffer specified by setReadBuffer().

Definition at line 159 of file Framebuffer.cpp.

References readBuffer(), and VL_CHECK_OGL.

Referenced by vl::FramebufferObject::bindFramebuffer().

void Framebuffer::bindDrawBuffers (  ) const

Binds to the currently active framebuffer object (including the 0 one) the draw buffers specified by setDrawBuffers().

Definition at line 131 of file Framebuffer.cpp.

References checkDrawBuffers(), vl::Log::error(), vl::Has_GL_Version_2_0, VL_CHECK, and VL_CHECK_OGL.

Referenced by vl::FramebufferObject::bindFramebuffer().

bool Framebuffer::checkDrawBuffers (  ) const

Returns true if the draw buffers bound to this render target are legal for this render target type.

Definition at line 44 of file Framebuffer.cpp.

References vl::Log::error().

Referenced by bindDrawBuffers().

void vl::Framebuffer::setDrawBuffer ( EReadDrawBuffer  draw_buffer ) [inline]

Specifies the color buffer to be drawn into.

Definition at line 128 of file Framebuffer.hpp.

void vl::Framebuffer::setDrawBuffers ( EReadDrawBuffer  draw_buffer1,
EReadDrawBuffer  draw_buffer2 
) [inline]

Specifies a list of color buffers to be drawn into.

Definition at line 135 of file Framebuffer.hpp.

void vl::Framebuffer::setDrawBuffers ( EReadDrawBuffer  draw_buffer1,
EReadDrawBuffer  draw_buffer2,
EReadDrawBuffer  draw_buffer3 
) [inline]

Specifies a list of color buffers to be drawn into.

Definition at line 143 of file Framebuffer.hpp.

void vl::Framebuffer::setDrawBuffers ( EReadDrawBuffer  draw_buffer1,
EReadDrawBuffer  draw_buffer2,
EReadDrawBuffer  draw_buffer3,
EReadDrawBuffer  draw_buffer4 
) [inline]

Specifies a list of color buffers to be drawn into.

Definition at line 152 of file Framebuffer.hpp.

void vl::Framebuffer::setDrawBuffers ( const std::vector< EReadDrawBuffer > &  draw_buffers ) [inline]

Specifies a list of color buffers to be drawn into.

Definition at line 162 of file Framebuffer.hpp.

const std::vector< EReadDrawBuffer >& vl::Framebuffer::drawBuffers (  ) [inline]

The color buffers to be drawn into.

Definition at line 165 of file Framebuffer.hpp.

EReadDrawBuffer vl::Framebuffer::readBuffer (  ) const [inline]

The read-buffer bound when the render target is activated.

Definition at line 168 of file Framebuffer.hpp.

Referenced by bindReadBuffer().

void vl::Framebuffer::setReadBuffer ( EReadDrawBuffer  read_buffer ) [inline]

The read-buffer bound when the render target is activated.

Definition at line 171 of file Framebuffer.hpp.


Friends And Related Function Documentation

friend class OpenGLContext [friend]

Reimplemented in vl::FramebufferObject.

Definition at line 53 of file Framebuffer.hpp.


The documentation for this class was generated from the following files:

Visualization Library v1.0.3 Reference Documentation
Copyright Michele Bosi. All rights reserved.
Updated on Tue Feb 7 2017 00:55:10.
Permission is granted to use this page to write and publish articles regarding Visualization Library.