GL++  0.1
OpenGL API C++ Wrapper
 All Classes Namespaces Functions Variables Typedefs Enumerations Friends Groups Pages
glpp::shader Struct Reference

GPU Shader object. More...

#include <shader.hpp>

Inheritance diagram for glpp::shader:
glpp::named_object< GLint > glpp::noncopyable

Public Member Functions

 shader (shader_type type, const std::string &source)
 Construct from source.
 ~shader ()
 Destroy and release shader.
const std::string & source () const
 Get GLSL source code of this shader.
std::string & source ()
 Get reference to GLSL source code of this shader.
void compile () throw (compile_error)
 Compile this shader to shader object.
bool is_compiled () const
 Return true only if it is compiled successfully.
std::string info_log () const
 Get the information log about compilation of this shader.
const shader_typetype () const
 Get the type of this shader.
- Public Member Functions inherited from glpp::named_object< GLint >
name_type object_name () const
 Return the name of object (handle)
- Public Member Functions inherited from glpp::noncopyable
 noncopyable (noncopyable &)
noncopyableoperator= (noncopyable &)

Protected Member Functions

void initialize ()
 Generic initialize function.

Protected Attributes

shader_type m_type
 Type of this shader (Fragment, Geometry .. )
std::string m_source
 Source code of this shader.
- Protected Attributes inherited from glpp::named_object< GLint >
GLint m_gl_name
 Stored object name.

Additional Inherited Members

- Public Types inherited from glpp::named_object< GLint >
typedef GLint name_type
 Type of the name.

Detailed Description

GPU Shader object.

Remarks
non-copyable, non-inheritable, RAII

Constructor & Destructor Documentation

glpp::shader::shader ( shader_type  type,
const std::string &  source 
)

Construct from source.

Parameters
typeType of this shader (Fragment, Geometry .. )
sourceThe GLSL source code of this shader.

Member Function Documentation

void glpp::shader::compile ( ) throw (compile_error)
std::string glpp::shader::info_log ( ) const

Get the information log about compilation of this shader.

http://www.opengl.org/sdk/docs/man4/xhtml/glGetShaderInfoLog.xml

See Also
compile(), is_compiled()
bool glpp::shader::is_compiled ( ) const

Return true only if it is compiled successfully.

http://www.opengl.org/sdk/docs/man4/xhtml/glCompileShader.xml

See Also
compile()
std::string& glpp::shader::source ( )
inline

Get reference to GLSL source code of this shader.

Changing source code has effect only if the object is not compiled yet.


The documentation for this struct was generated from the following files: