#include <pbuffer.h>
Collaboration diagram for gl::pixel_buffer:
Public Methods | |
pixel_buffer (void) | |
Default Constructor. | |
virtual | ~pixel_buffer (void) |
Destructor. | |
virtual bool | init (unsigned int w, unsigned int h, unsigned int bpp, GLXContext shared) |
Initializes the pixel buffer. More... | |
virtual bool | init (unsigned int w, unsigned int h, unsigned int bpp, const int attributes[], GLXContext shared) |
Initialize the pixel buffer. More... | |
virtual void | activate (void) |
Activates the GL context for the pixel buffer. | |
virtual void | shutdown (void) |
Destroys the pixel buffer. More... | |
unsigned int | get_width (void) const |
Returns the width of the pixel buffer. | |
unsigned int | get_height (void) const |
Returns the height of the pixel buffer. | |
bool | error (void) const |
Returns true if an error has occurred. | |
std::string | get_error (void) |
Returns the error message. | |
gl::texture | get_texture (void) const |
Returns a gl::texture object to the pbuffer. | |
Protected Methods | |
void | clear_error (void) |
Clears the internal error state. | |
void | set_error (const std::string &msg) |
Sets the internal error state. | |
Protected Attributes | |
unsigned int | m_width |
Pixel buffer width. | |
unsigned int | m_height |
Pixel buffer height. | |
unsigned int | m_bpp |
Bits per pixel. | |
bool | m_initialized |
Flag indicating the pixel buffer has been initialized. | |
bool | m_error |
If an error has occured. | |
std::string | m_error_msg |
Error message. | |
gl::texture | m_texture |
Texture object for the pbuffer. |
This class handles pixel buffer creation. The programmer will still need to activate the GL context of the pixel buffer in order to draw in it.
Definition at line 21 of file pbuffer.h.
|
Initialize the pixel buffer. Creates a pixel buffer w pixels wide by h pixels in height, using a set of framebuffer attributes passed as attributes.
Definition at line 132 of file pbuffer.cpp. References m_bpp, m_height, m_initialized, m_texture, m_width, gl::texture::set, and set_error. |
|
Initializes the pixel buffer. Creates a pixel buffer w pixels wide by h pixels in height.
Definition at line 60 of file pbuffer.cpp. References m_bpp, m_height, m_initialized, m_texture, m_width, gl::texture::set, and set_error. |
|
Destroys the pixel buffer. This method should be called to release the pixel buffer when it is no longer needed. Definition at line 208 of file pbuffer.cpp. References m_initialized. |