openMSX
|
Wrapper around a pixel buffer. More...
#include <GLUtil.hh>
Public Member Functions | |
PixelBuffer () | |
PixelBuffer (PixelBuffer &&other) | |
PixelBuffer & | operator= (PixelBuffer &&other) |
~PixelBuffer () | |
bool | openGLSupported () const |
Are PBOs supported by this openGL implementation? This class implements a SW fallback in case PBOs are not directly supported by this openGL implementation, but it will probably be a lot slower. More... | |
void | setImage (GLuint width, GLuint height) |
Sets the image for this buffer. More... | |
void | bind () const |
Bind this PixelBuffer. More... | |
void | unbind () const |
Unbind this buffer. More... | |
T * | getOffset (GLuint x, GLuint y) |
Gets a pointer relative to the start of this buffer. More... | |
T * | mapWrite () |
Maps the contents of this buffer into memory. More... | |
void | unmap () const |
Unmaps the contents of this buffer. More... | |
Wrapper around a pixel buffer.
The pixel buffer will be allocated in VRAM if possible, in main RAM otherwise. The pixel type is templatized T.
openmsx::PixelBuffer< T >::PixelBuffer | ( | ) |
Definition at line 271 of file GLUtil.hh.
References openmsx::PixelBuffers::enabled.
openmsx::PixelBuffer< T >::PixelBuffer | ( | PixelBuffer< T > && | other | ) |
openmsx::PixelBuffer< T >::~PixelBuffer | ( | ) |
void openmsx::PixelBuffer< T >::bind | ( | ) | const |
Bind this PixelBuffer.
Must be called before the methods getOffset() or mapWrite() are used. (Is a wrapper around glBindBuffer).
Definition at line 332 of file GLUtil.hh.
Referenced by openmsx::GLHQLiteScaler::uploadBlock(), and openmsx::GLHQScaler::uploadBlock().
T * openmsx::PixelBuffer< T >::getOffset | ( | GLuint | x, |
GLuint | y | ||
) |
Gets a pointer relative to the start of this buffer.
You must not dereference this pointer, but you can pass it to glTexImage etc when this buffer is bound as the source.
Definition at line 348 of file GLUtil.hh.
Referenced by openmsx::GLHQLiteScaler::uploadBlock(), and openmsx::GLHQScaler::uploadBlock().
T * openmsx::PixelBuffer< T >::mapWrite | ( | ) |
Maps the contents of this buffer into memory.
The returned buffer is write-only (reading could be very slow or even result in a segfault).
Definition at line 361 of file GLUtil.hh.
Referenced by openmsx::GLHQLiteScaler::uploadBlock(), and openmsx::GLHQScaler::uploadBlock().
bool openmsx::PixelBuffer< T >::openGLSupported | ( | ) | const |
PixelBuffer< T > & openmsx::PixelBuffer< T >::operator= | ( | PixelBuffer< T > && | other | ) |
void openmsx::PixelBuffer< T >::setImage | ( | GLuint | width, |
GLuint | height | ||
) |
Sets the image for this buffer.
TODO: Actually, only image size for now; later, if we need it, image data too.
Definition at line 314 of file GLUtil.hh.
Referenced by openmsx::GLHQLiteScaler::GLHQLiteScaler(), and openmsx::GLHQScaler::GLHQScaler().
void openmsx::PixelBuffer< T >::unbind | ( | ) | const |
Unbind this buffer.
Definition at line 340 of file GLUtil.hh.
Referenced by openmsx::GLHQLiteScaler::uploadBlock(), and openmsx::GLHQScaler::uploadBlock().
void openmsx::PixelBuffer< T >::unmap | ( | ) | const |
Unmaps the contents of this buffer.
After this call, you must no longer use the pointer returned by mapWrite.
Definition at line 372 of file GLUtil.hh.
Referenced by openmsx::GLHQLiteScaler::uploadBlock(), and openmsx::GLHQScaler::uploadBlock().