UniShader
1.0.0a
Interface for GPGPU and working with shader programs
|
Shader output class. More...
#include <ShaderOutput.h>
Classes | |
class | SignalID |
Signal identifier enum. More... | |
Public Types | |
typedef SafePtr< ShaderOutput > | Ptr |
Safe pointer. | |
typedef SafePtr< const ShaderOutput > | PtrConst |
Safe pointer. | |
Public Member Functions | |
ShaderOutput (ShaderProgram &program) | |
virtual const std::string & | getClassName () const |
Get name of this class. | |
Varying::Ptr | addVarying (std::string name) |
Add new varying. | |
Varying::Ptr | getVarying (std::string name) |
Get varying. | |
void | removeVarying (std::string name) |
Remove varying. | |
void | interleave (bool interl) |
Interleave shader output. | |
bool | isInterleaved () |
Is interleaved? | |
template<typename T > | |
Buffer< T >::PtrConst | getInterleavedBuffer () |
Get interleaved buffer. | |
void | setUp () |
Set up. | |
bool | prepare (unsigned int primitiveCount) |
Prepare. | |
void | activate (PrimitiveType primitiveType) |
Activate. | |
bool | isActive () |
Is active? | |
void | deactivate () |
Deactivate. |
Shader output class.
Shader output manages all output operations for shader program.
void ShaderOutput::activate | ( | PrimitiveType | primitiveType | ) |
Activate.
Activate output by modyfying OpenGL context and make it availible for shader program.
Varying::Ptr ShaderOutput::addVarying | ( | std::string | name | ) |
Add new varying.
Create and add new varying to shader output. If varying with same name already exists, pointer to that varying is returned.
name | Name of varying. |
void ShaderOutput::deactivate | ( | ) |
Deactivate.
Return OpenGL context states modified by this class to their default state.
UNISHADER_BEGIN Buffer< T >::PtrConst ShaderOutput::getInterleavedBuffer | ( | ) |
Get interleaved buffer.
Return pointer to interleaved buffer. If output is not interlraved, null pointer is returned and error is generated.
Varying::Ptr ShaderOutput::getVarying | ( | std::string | name | ) |
Get varying.
Return pointer to previously added varying. If varying with the name doesn't exists, null pointer is returned.
name | Name of varying. |
void ShaderOutput::interleave | ( | bool | interl | ) |
Interleave shader output.
If shader output is interleaved, all values are recorded to single buffer. In interleaved mode all underlying varyings return this buffer. In deinterleaved (separate) mode each varying has it own buffer and values are split between them.
bool ShaderOutput::isActive | ( | ) |
Is active?
Return if shader output is active.
bool ShaderOutput::isInterleaved | ( | ) |
Is interleaved?
Returns if output is interleaved.
bool ShaderOutput::prepare | ( | unsigned int | primitiveCount | ) |
Prepare.
Prepare output and underlying classes for use.
primitiveCount | Number of primitives that will be recorded. |
void ShaderOutput::removeVarying | ( | std::string | name | ) |
Remove varying.
Destroy varying and remove it from shader output. If varying with the name doesn't exists, function returns silently.
name | Name of varying. |
void ShaderOutput::setUp | ( | ) |
Set up.
Set up underlying varyings to be recorded. This will affect next shader program linkage.