Simple class for wrapping up the data used in glProgramBinary and glGetProgramBinary.
More...
List of all members.
Public Member Functions |
| ProgramBinary () |
| ProgramBinary (const ProgramBinary &rhs, const osg::CopyOp ©op=osg::CopyOp::SHALLOW_COPY) |
| Copy constructor using CopyOp to manage deep vs shallow copy.
|
| META_Object (osg, ProgramBinary) |
void | assign (unsigned int size, const unsigned char *data) |
| Allocated a data buffer of specified size/*/ void allocate(unsigned int size);.
|
void | setFormat (GLenum format) |
| Set the format of the program binary data.
|
GLenum | getFormat () const |
| Get the format of the program binary data.
|
unsigned int | getSize () const |
| Get the size of the program binary data.
|
unsigned char * | getData () |
| Get a ptr to the program binary data.
|
const unsigned char * | getData () const |
| Get a const ptr to the program binary data.
|
Protected Attributes |
std::vector< unsigned char > | _data |
GLenum | _format |
Detailed Description
Simple class for wrapping up the data used in glProgramBinary and glGetProgramBinary.
On the first run of your application Programs should be assigned an empty ProgramBinary. Before your application exits it should retrieve the program binary via Program::PerContextProgram::compileProgramBinary and save it to disk. When your application is run subsequently, load your binary from disk and use it to set the data of a ProgramBinary, and set the ProgramBinary on the associated Program. This will typically result in Program::compileGLObjects executing much faster.
Constructor & Destructor Documentation
osg::Program::ProgramBinary::ProgramBinary |
( |
| ) |
|
osg::Program::ProgramBinary::ProgramBinary |
( |
const ProgramBinary & |
rhs, |
|
|
const osg::CopyOp & |
copyop = osg::CopyOp::SHALLOW_COPY |
|
) |
| |
Copy constructor using CopyOp to manage deep vs shallow copy.
Member Function Documentation
void osg::Program::ProgramBinary::assign |
( |
unsigned int |
size, |
|
|
const unsigned char * |
data |
|
) |
| |
Allocated a data buffer of specified size/*/ void allocate(unsigned int size);.
/** Assign program binary data, copying the specified data into locally stored data buffer, the original data can then be deleted.
unsigned char* osg::Program::ProgramBinary::getData |
( |
| ) |
[inline] |
Get a ptr to the program binary data.
const unsigned char* osg::Program::ProgramBinary::getData |
( |
| ) |
const [inline] |
Get a const ptr to the program binary data.
GLenum osg::Program::ProgramBinary::getFormat |
( |
| ) |
const [inline] |
Get the format of the program binary data.
unsigned int osg::Program::ProgramBinary::getSize |
( |
| ) |
const [inline] |
Get the size of the program binary data.
void osg::Program::ProgramBinary::setFormat |
( |
GLenum |
format | ) |
[inline] |
Set the format of the program binary data.
Member Data Documentation
The documentation for this class was generated from the following file: