32 #ifndef Framebuffer_INCLUDE_ONCE 33 #define Framebuffer_INCLUDE_ONCE 58 mOpenGLContext(ctx), mWidth(w), mHeight(h)
60 VL_DEBUG_SET_OBJECT_NAME()
61 setDrawBuffer(draw_buffer);
62 setReadBuffer(read_buffer);
72 int width()
const {
return mWidth; }
75 int height()
const {
return mHeight; }
84 virtual GLuint
handle()
const {
return 0; }
89 bindFramebuffer(target);
103 #if defined(VL_OPENGL) 119 void bindReadBuffer();
122 void bindDrawBuffers()
const;
125 bool checkDrawBuffers()
const;
130 mDrawBuffers.clear();
131 mDrawBuffers.push_back(draw_buffer);
137 mDrawBuffers.clear();
138 mDrawBuffers.push_back(draw_buffer1);
139 mDrawBuffers.push_back(draw_buffer2);
145 mDrawBuffers.clear();
146 mDrawBuffers.push_back(draw_buffer1);
147 mDrawBuffers.push_back(draw_buffer2);
148 mDrawBuffers.push_back(draw_buffer3);
154 mDrawBuffers.clear();
155 mDrawBuffers.push_back(draw_buffer1);
156 mDrawBuffers.push_back(draw_buffer2);
157 mDrawBuffers.push_back(draw_buffer3);
158 mDrawBuffers.push_back(draw_buffer4);
162 void setDrawBuffers(
const std::vector< EReadDrawBuffer >& draw_buffers) { mDrawBuffers = draw_buffers; }
165 const std::vector< EReadDrawBuffer >&
drawBuffers() {
return mDrawBuffers; }
174 std::vector< EReadDrawBuffer > mDrawBuffers;
virtual GLuint handle() const
The framebuffer object id as used by glBindFramebuffer, Framebuffer::handle() always returns 0...
const std::vector< EReadDrawBuffer > & drawBuffers()
The color buffers to be drawn into.
void setWidth(int width)
The width of a render target.
EReadDrawBuffer readBuffer() const
The read-buffer bound when the render target is activated.
int width() const
The width of a render target.
void setReadBuffer(EReadDrawBuffer read_buffer)
The read-buffer bound when the render target is activated.
Represents an OpenGL context, possibly a widget or a pbuffer, which can also respond to keyboard...
void setDrawBuffers(EReadDrawBuffer draw_buffer1, EReadDrawBuffer draw_buffer2)
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.
#define VL_INSTRUMENT_CLASS(ClassName, BaseClass)
Visualization Library main namespace.
int height() const
The height of a render target.
The base class for all the reference counted objects.
virtual void bindFramebuffer(EFramebufferBind target=FBB_FRAMEBUFFER)
Calls glBindFramebuffer(target, 0) thus activating the the framebuffer 0, that is, the normal OpenGL buffers.
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 activate(EFramebufferBind target=FBB_FRAMEBUFFER)
Activates the Framebuffer by calling bindFramebuffer() and bindDrawBuffers()
#define VLGRAPHICS_EXPORT
OpenGLContext * openglContext()
The OpenGLContext bound to a render target.
void setDrawBuffer(EReadDrawBuffer draw_buffer)
Specifies the color buffer to be drawn into.
void setHeight(int height)
The height of a render target.
Visualization Library's enums in the 'vl' namespace.
The Framebuffer class defines an abstract 'surface' where OpenGL can render into. ...
const OpenGLContext * openglContext() const
The OpenGLContext bound to a render target.