Program Object. More...
#include <program_object.h>
Public Member Functions | |
virtual void | attach (const ShaderObjectPtr &obj)=0 |
Add shader to program object. More... | |
virtual int | attribute_location (const std::string &name) const =0 |
Returns the location of a named active attribute. More... | |
virtual void | bind_attribute_location (int index, const std::string &name)=0 |
Bind attribute to specific location. More... | |
virtual void | bind_frag_data_location (int color_number, const std::string &name)=0 |
Bind shader out variable a specific color buffer location. More... | |
virtual void | detach (const ShaderObjectPtr &obj)=0 |
Remove shader from program object. More... | |
virtual std::string | info_log () const =0 |
Returns the current info log for the program object. More... | |
virtual void | link ()=0 |
Link program. More... | |
virtual void | set_storage_buffer_index (const std::string &block_name, int bind_index)=0 |
virtual void | set_storage_buffer_index (int block_index, int bind_index)=0 |
virtual void | set_uniform1f (int location, float value_a)=0 |
void | set_uniform1f (const std::string &name, float value_a) |
virtual void | set_uniform1i (int location, int value_a)=0 |
void | set_uniform1i (const std::string &name, int value_a) |
void | set_uniform2b (int location, const Vec2b &vec) |
void | set_uniform2b (const std::string &name, const Vec2b &vec) |
virtual void | set_uniform2f (int location, float value_a, float value_b)=0 |
void | set_uniform2f (int location, const Vec2f &vec) |
void | set_uniform2f (const std::string &name, float value_a, float value_b) |
void | set_uniform2f (const std::string &name, const Vec2f &vec) |
virtual void | set_uniform2i (int location, int value_a, int value_b)=0 |
void | set_uniform2i (int location, const Vec2i &vec) |
void | set_uniform2i (const std::string &name, int value_a, int value_b) |
void | set_uniform2i (const std::string &name, const Vec2i &vec) |
void | set_uniform2s (int location, const Vec2s &vec) |
void | set_uniform2s (const std::string &name, const Vec2s &vec) |
void | set_uniform3b (int location, const Vec3b &vec) |
void | set_uniform3b (const std::string &name, const Vec3b &vec) |
virtual void | set_uniform3f (int location, float value_a, float value_b, float value_c)=0 |
void | set_uniform3f (int location, const Vec3f &vec) |
void | set_uniform3f (const std::string &name, float value_a, float value_b, float value_c) |
void | set_uniform3f (const std::string &name, const Vec3f &vec) |
virtual void | set_uniform3i (int location, int value_a, int value_b, int value_c)=0 |
void | set_uniform3i (int location, const Vec3i &vec) |
void | set_uniform3i (const std::string &name, int value_a, int value_b, int value_c) |
void | set_uniform3i (const std::string &name, const Vec3i &vec) |
void | set_uniform3s (int location, const Vec3s &vec) |
void | set_uniform3s (const std::string &name, const Vec3s &vec) |
void | set_uniform4b (int location, const Vec4b &vec) |
void | set_uniform4b (const std::string &name, const Vec4b &vec) |
virtual void | set_uniform4f (int location, float value_a, float value_b, float value_c, float value_d)=0 |
void | set_uniform4f (int location, const Vec4f &vec) |
void | set_uniform4f (const std::string &name, float value_a, float value_b, float value_c, float value_d) |
void | set_uniform4f (const std::string &name, const Vec4f &vec) |
virtual void | set_uniform4i (int location, int value_a, int value_b, int value_c, int value_d)=0 |
void | set_uniform4i (int location, const Vec4i &vec) |
void | set_uniform4i (const std::string &name, int value_a, int value_b, int value_c, int value_d) |
void | set_uniform4i (const std::string &name, const Vec4i &vec) |
void | set_uniform4s (int location, const Vec4s &vec) |
void | set_uniform4s (const std::string &name, const Vec4s &vec) |
virtual void | set_uniform_buffer_index (const std::string &block_name, int bind_index)=0 |
virtual void | set_uniform_buffer_index (int block_index, int bind_index)=0 |
virtual void | set_uniform_matrix (int location, int size, int count, bool transpose, const float *data)=0 |
void | set_uniform_matrix (int location, const Mat2f &matrix) |
void | set_uniform_matrix (int location, const Mat3f &matrix) |
void | set_uniform_matrix (int location, const Mat4f &matrix) |
void | set_uniform_matrix (int location, int count, const Mat2f *matrix) |
void | set_uniform_matrix (int location, int count, const Mat3f *matrix) |
void | set_uniform_matrix (int location, int count, const Mat4f *matrix) |
void | set_uniform_matrix (const std::string &name, int size, int count, bool transpose, const float *data) |
void | set_uniform_matrix (const std::string &name, const Mat2f &matrix) |
void | set_uniform_matrix (const std::string &name, const Mat3f &matrix) |
void | set_uniform_matrix (const std::string &name, const Mat4f &matrix) |
void | set_uniform_matrix (const std::string &name, int count, const Mat2f *matrix) |
void | set_uniform_matrix (const std::string &name, int count, const Mat3f *matrix) |
void | set_uniform_matrix (const std::string &name, int count, const Mat4f *matrix) |
virtual void | set_uniformfv (int location, int size, int count, const float *data)=0 |
void | set_uniformfv (int location, int count, const Vec2f *data) |
void | set_uniformfv (int location, int count, const Vec3f *data) |
void | set_uniformfv (int location, int count, const Vec4f *data) |
void | set_uniformfv (const std::string &name, int size, int count, const float *data) |
void | set_uniformfv (const std::string &name, int count, const Vec2f *data) |
void | set_uniformfv (const std::string &name, int count, const Vec3f *data) |
void | set_uniformfv (const std::string &name, int count, const Vec4f *data) |
virtual void | set_uniformiv (int location, int size, int count, const int *data)=0 |
void | set_uniformiv (int location, int count, const Vec2i *data) |
void | set_uniformiv (int location, int count, const Vec3i *data) |
void | set_uniformiv (int location, int count, const Vec4i *data) |
void | set_uniformiv (const std::string &name, int size, int count, const int *data) |
void | set_uniformiv (const std::string &name, int count, const Vec2i *data) |
void | set_uniformiv (const std::string &name, int count, const Vec3i *data) |
void | set_uniformiv (const std::string &name, int count, const Vec4i *data) |
virtual std::vector< ShaderObjectPtr > | shaders () const =0 |
Returns the shaders attached to the program object. More... | |
virtual int | storage_buffer_index (const std::string &name) const =0 |
Get the storage buffer index. More... | |
virtual bool | try_link ()=0 |
Link program. More... | |
virtual int | uniform_buffer_index (const std::string &block_name) const =0 |
Get the uniform block index. More... | |
virtual int | uniform_buffer_size (const std::string &block_name) const =0 |
Get the uniform block size. More... | |
virtual int | uniform_buffer_size (int block_index) const =0 |
Get the uniform block size. More... | |
virtual int | uniform_location (const std::string &name) const =0 |
Returns the location of a named uniform variable. More... | |
virtual bool | validate ()=0 |
Validate program. More... | |
Static Public Member Functions | |
static std::shared_ptr< ProgramObject > | create (const GraphicContextPtr &gc) |
Constructs a ProgramObject. More... | |
static std::shared_ptr< ProgramObject > | load (const GraphicContextPtr &gc, const std::string &vertex_fullname, const std::string &fragment_fullname) |
Load. More... | |
static std::shared_ptr< ProgramObject > | load (const GraphicContextPtr &gc, const std::string &vertex_fullname, const std::string &geometry_fullname, const std::string &fragment_fullname) |
static std::shared_ptr< ProgramObject > | load (const GraphicContextPtr &gc, const IODevicePtr &vertex_file, const IODevicePtr &fragment_file) |
static std::shared_ptr< ProgramObject > | load (const GraphicContextPtr &gc, const IODevicePtr &vertex_file, const IODevicePtr &geometry_file, const IODevicePtr &fragment_file) |
static std::shared_ptr< ProgramObject > | load_and_link (const GraphicContextPtr &gc, const std::string &vertex_fullname, const std::string &fragment_fullname) |
Load and link. More... | |
static std::shared_ptr< ProgramObject > | load_and_link (const GraphicContextPtr &gc, const std::string &vertex_fullname, const std::string &geometry_fullname, const std::string &fragment_fullname) |
static std::shared_ptr< ProgramObject > | load_and_link (const GraphicContextPtr &gc, const IODevicePtr &vertex_file, const IODevicePtr &fragment_file) |
static std::shared_ptr< ProgramObject > | load_and_link (const GraphicContextPtr &gc, const IODevicePtr &vertex_file, const IODevicePtr &geometry_file, const IODevicePtr &fragment_file) |
Program Object.
|
pure virtual |
Add shader to program object.
|
pure virtual |
Returns the location of a named active attribute.
Returns -1 when unknown
|
pure virtual |
Bind attribute to specific location.
This function must be called before linking.
|
pure virtual |
Bind shader out variable a specific color buffer location.
This function must be called before linking.
|
static |
Constructs a ProgramObject.
|
pure virtual |
Remove shader from program object.
|
pure virtual |
Returns the current info log for the program object.
|
pure virtual |
Link program.
If the linking fails an exception will be thrown
|
static |
Load.
|
static |
|
static |
|
static |
|
static |
Load and link.
|
static |
|
static |
|
static |
|
pure virtual |
|
pure virtual |
|
pure virtual |
|
inline |
References set_uniform1f(), and uniform_location().
Referenced by set_uniform1f().
|
pure virtual |
|
inline |
References set_uniform1i(), and uniform_location().
Referenced by set_uniform1i().
|
inline |
References set_uniform2i(), uicore::Vec2< Type >::x, and uicore::Vec2< Type >::y.
|
inline |
References set_uniform2b(), and uniform_location().
Referenced by set_uniform2b().
|
pure virtual |
|
inline |
References set_uniform2f(), uicore::Vec2< Type >::x, and uicore::Vec2< Type >::y.
Referenced by set_uniform2f().
|
inline |
References set_uniform2f(), and uniform_location().
Referenced by set_uniform2f().
|
inline |
References set_uniform2f(), and uniform_location().
Referenced by set_uniform2f().
|
pure virtual |
Referenced by set_uniform2b(), and set_uniform2s().
|
inline |
References set_uniform2i(), uicore::Vec2< Type >::x, and uicore::Vec2< Type >::y.
Referenced by set_uniform2i().
|
inline |
References set_uniform2i(), and uniform_location().
Referenced by set_uniform2i().
|
inline |
References set_uniform2i(), and uniform_location().
Referenced by set_uniform2i().
|
inline |
References set_uniform2i(), uicore::Vec2< Type >::x, and uicore::Vec2< Type >::y.
|
inline |
References set_uniform2s(), and uniform_location().
Referenced by set_uniform2s().
|
inline |
References set_uniform3i(), uicore::Vec3< Type >::x, uicore::Vec3< Type >::y, and uicore::Vec3< Type >::z.
|
inline |
References set_uniform3b(), and uniform_location().
Referenced by set_uniform3b().
|
pure virtual |
|
inline |
References set_uniform3f(), uicore::Vec3< Type >::x, uicore::Vec3< Type >::y, and uicore::Vec3< Type >::z.
Referenced by set_uniform3f().
|
inline |
References set_uniform3f(), and uniform_location().
Referenced by set_uniform3f().
|
inline |
References set_uniform3f(), and uniform_location().
Referenced by set_uniform3f().
|
pure virtual |
Referenced by set_uniform3b(), and set_uniform3s().
|
inline |
References set_uniform3i(), uicore::Vec3< Type >::x, uicore::Vec3< Type >::y, and uicore::Vec3< Type >::z.
Referenced by set_uniform3i().
|
inline |
References set_uniform3i(), and uniform_location().
Referenced by set_uniform3i().
|
inline |
References set_uniform3i(), and uniform_location().
Referenced by set_uniform3i().
|
inline |
References set_uniform3i(), uicore::Vec3< Type >::x, uicore::Vec3< Type >::y, and uicore::Vec3< Type >::z.
|
inline |
References set_uniform3s(), and uniform_location().
Referenced by set_uniform3s().
|
inline |
|
inline |
References set_uniform4b(), and uniform_location().
Referenced by set_uniform4b().
|
pure virtual |
|
inline |
References set_uniform4f(), uicore::Vec4< Type >::w, uicore::Vec4< Type >::x, uicore::Vec4< Type >::y, and uicore::Vec4< Type >::z.
Referenced by set_uniform4f().
|
inline |
References set_uniform4f(), and uniform_location().
Referenced by set_uniform4f().
|
inline |
References set_uniform4f(), and uniform_location().
Referenced by set_uniform4f().
|
pure virtual |
Referenced by set_uniform4b(), and set_uniform4s().
|
inline |
References set_uniform4i(), uicore::Vec4< Type >::w, uicore::Vec4< Type >::x, uicore::Vec4< Type >::y, and uicore::Vec4< Type >::z.
Referenced by set_uniform4i().
|
inline |
References set_uniform4i(), and uniform_location().
Referenced by set_uniform4i().
|
inline |
References set_uniform4i(), and uniform_location().
Referenced by set_uniform4i().
|
inline |
|
inline |
References set_uniform4s(), and uniform_location().
Referenced by set_uniform4s().
|
pure virtual |
|
pure virtual |
|
pure virtual |
|
inline |
References uicore::Mat2< Type >::matrix, and set_uniform_matrix().
Referenced by set_uniform_matrix().
|
inline |
References uicore::Mat3< Type >::matrix, and set_uniform_matrix().
Referenced by set_uniform_matrix().
|
inline |
References uicore::Mat4< Type >::matrix, and set_uniform_matrix().
Referenced by set_uniform_matrix().
|
inline |
References uicore::Mat2< Type >::matrix, and set_uniform_matrix().
Referenced by set_uniform_matrix().
|
inline |
References uicore::Mat3< Type >::matrix, and set_uniform_matrix().
Referenced by set_uniform_matrix().
|
inline |
References uicore::Mat4< Type >::matrix, and set_uniform_matrix().
Referenced by set_uniform_matrix().
|
inline |
References set_uniform_matrix(), and uniform_location().
Referenced by set_uniform_matrix().
|
inline |
References set_uniform_matrix(), and uniform_location().
Referenced by set_uniform_matrix().
|
inline |
References set_uniform_matrix(), and uniform_location().
Referenced by set_uniform_matrix().
|
inline |
References set_uniform_matrix(), and uniform_location().
Referenced by set_uniform_matrix().
|
inline |
References set_uniform_matrix(), and uniform_location().
Referenced by set_uniform_matrix().
|
inline |
References set_uniform_matrix(), and uniform_location().
Referenced by set_uniform_matrix().
|
inline |
References set_uniform_matrix(), and uniform_location().
Referenced by set_uniform_matrix().
|
pure virtual |
|
inline |
References set_uniformfv(), and uicore::Vec2< Type >::x.
Referenced by set_uniformfv().
|
inline |
References set_uniformfv(), and uicore::Vec3< Type >::x.
Referenced by set_uniformfv().
|
inline |
References set_uniformfv(), and uicore::Vec4< Type >::x.
Referenced by set_uniformfv().
|
inline |
References set_uniformfv(), and uniform_location().
Referenced by set_uniformfv().
|
inline |
References set_uniformfv(), and uniform_location().
Referenced by set_uniformfv().
|
inline |
References set_uniformfv(), and uniform_location().
Referenced by set_uniformfv().
|
inline |
References set_uniformfv(), and uniform_location().
Referenced by set_uniformfv().
|
pure virtual |
|
inline |
References set_uniformiv(), and uicore::Vec2< Type >::x.
Referenced by set_uniformiv().
|
inline |
References set_uniformiv(), and uicore::Vec3< Type >::x.
Referenced by set_uniformiv().
|
inline |
References set_uniformiv(), and uicore::Vec4< Type >::x.
Referenced by set_uniformiv().
|
inline |
References set_uniformiv(), and uniform_location().
Referenced by set_uniformiv().
|
inline |
References set_uniformiv(), and uniform_location().
Referenced by set_uniformiv().
|
inline |
References set_uniformiv(), and uniform_location().
Referenced by set_uniformiv().
|
inline |
References set_uniformiv(), and uniform_location().
Referenced by set_uniformiv().
|
pure virtual |
Returns the shaders attached to the program object.
|
pure virtual |
Get the storage buffer index.
Returns -1 when the block index was not found
|
pure virtual |
Link program.
If the linking fails, info_log() will return the link log
|
pure virtual |
Get the uniform block index.
Returns -1 when the block index was not found
|
pure virtual |
Get the uniform block size.
An exception is thrown of block_name was not found
Returns -1 when unknown
|
pure virtual |
Get the uniform block size.
|
pure virtual |
Returns the location of a named uniform variable.
Returns -1 when unknown
Referenced by set_uniform1f(), set_uniform1i(), set_uniform2b(), set_uniform2f(), set_uniform2i(), set_uniform2s(), set_uniform3b(), set_uniform3f(), set_uniform3i(), set_uniform3s(), set_uniform4b(), set_uniform4f(), set_uniform4i(), set_uniform4s(), set_uniform_matrix(), set_uniformfv(), and set_uniformiv().
|
pure virtual |
Validate program.
If the validation fails, info_log() will return the validation log