UniShader  1.0.0a
Interface for GPGPU and working with shader programs
 All Classes Functions Typedefs Enumerations Enumerator
Classes | Public Types | Public Member Functions | Static Public Member Functions
ShaderObject Class Reference

Shader object class. More...

#include <ShaderObject.h>

Inheritance diagram for ShaderObject:
SignalSender ObjectBase

List of all members.

Classes

class  CompilationStatus
 Shader object compilation status. More...
class  SignalID
 Signal identifier enum. More...
class  Type
 Shader object type. More...

Public Types

typedef std::shared_ptr
< ShaderObject
Ptr
 Shared pointer.
typedef std::shared_ptr< const
ShaderObject
PtrConst
 Shared pointer.

Public Member Functions

virtual const std::string & getClassName () const
 Get name of this class.
bool loadFile (const std::string fileName, Type shaderType=Type::NONE)
 Load source code for shader object from file.
bool loadCode (const std::string code, Type shaderType)
 Load source code for shader object from string.
bool ensureCompilation ()
 Ensure compilation.
unsigned int getGlID () const
 Get OpenGL shader object identifier.
Type getType () const
 Get shader object type.
CompilationStatus getCompilationStatus () const
 Get shader object compilation status.

Static Public Member Functions

static Ptr create ()
 Create shader object.

Detailed Description

Shader object class.

    Shader objects are elementary parts of shader program. They are
    similar to C++ object files as they are each compiled separately
    and then can be mixed to create complex programs.

    There are vertex, geometry and fragment shader objects, each affecting
    corresponding stage in shader pipeline. By default, files with extension

.vert are recognized as vertex, *.geom as geometry and .frag as fragment objects.


Member Function Documentation

static Ptr ShaderObject::create ( ) [static]

Create shader object.

Returns:
Shader object.

Get shader object compilation status.

Returns:
Compilation status.
unsigned int ShaderObject::getGlID ( ) const

Get OpenGL shader object identifier.

Returns:
Numeric identifier of shader object in OpenGL.

Get shader object type.

Returns:
Type of shader object.
bool ShaderObject::loadCode ( const std::string  code,
Type  shaderType 
)

Load source code for shader object from string.

Parameters:
codeSource code.
shaderTypeType of shader object.
Returns:
True if loaded successfully
bool ShaderObject::loadFile ( const std::string  fileName,
Type  shaderType = Type::NONE 
)

Load source code for shader object from file.

Parameters:
fileNameName of file with source code.
shaderTypeType of shader object.
Returns:
True if loaded successfully

The documentation for this class was generated from the following file: