CL_ShaderObject Class Reference
[clanDisplay Display]

Shader Object. More...

#include <shader_object.h>

List of all members.

Construction

 CL_ShaderObject (CL_GraphicContext &gc, CL_ShaderType type, const CL_StringRef &source)
 Constructs an OpenGL shader.
 CL_ShaderObject (CL_GraphicContext &gc, CL_ShaderType type, const std::vector< CL_StringRef > &sources)
 Constructs a ShaderObject.
 CL_ShaderObject (CL_GraphicContextProvider *gc_provider, CL_ShaderType type, const CL_StringRef &source)
 Constructs a ShaderObject.
 CL_ShaderObject (CL_GraphicContextProvider *gc_provider, CL_ShaderType type, const std::vector< CL_StringRef > &sources)
 Constructs a ShaderObject.
virtual ~CL_ShaderObject ()
static CL_ShaderObject load (CL_GraphicContext &gc, const CL_StringRef &resource_id, CL_ResourceManager *resources)
 Load.
static CL_ShaderObject load (CL_GraphicContext &gc, CL_ShaderType type, const CL_StringRef &filename, const CL_VirtualDirectory &directory)
 Load.
static CL_ShaderObject load (CL_GraphicContext &gc, CL_ShaderType type, const CL_StringRef &fullname)
 Load.
static CL_ShaderObject load (CL_GraphicContext &gc, CL_ShaderType type, CL_IODevice &file)
 Load.
static CL_ShaderObject load_and_compile (CL_GraphicContext &gc, CL_ShaderType type, const CL_StringRef &filename, const CL_VirtualDirectory &directory)
 Load and compile.
static CL_ShaderObject load_and_compile (CL_GraphicContext &gc, CL_ShaderType type, const CL_StringRef &filename)
 Load and compile.
static CL_ShaderObject load_and_compile (CL_GraphicContext &gc, CL_ShaderType type, CL_IODevice &file)
 Load and compile.

Public Member Functions

Attributes
unsigned int get_handle () const
 Returns the OpenGL shader handle.
CL_ShaderType get_shader_type () const
 Gets the shader type.
CL_String get_info_log () const
 Get shader object's info log.
CL_String get_shader_source () const
 Get shader source code.
Operations
bool operator== (const CL_ShaderObject &other) const
 Handle comparision operator.
bool compile ()
 Compile program.


Detailed Description

Shader Object.

The source code that makes up a program that gets executed by one of the programmable stages is encapsulated in one or more shader objects. Shader objects are attached to a program objects to form a programmable setup. CL_ShaderObject is ClanLib's C++ interface to OpenGL shader objects.


Constructor & Destructor Documentation

CL_ShaderObject::CL_ShaderObject CL_GraphicContext gc,
CL_ShaderType  type,
const CL_StringRef source
 

Constructs an OpenGL shader.

Parameters:
type Shader type. Can be cl_shadertype_vertex or cl_shadertype_fragment.
source Shader source code, in OpenGL Shader Language (GLSL).
sources Shader source code as list of strings.
gc_provider Graphics context in which to create the shader object
resource_id Name of shader object resource.
resources Resource Manager providing resource.

CL_ShaderObject::CL_ShaderObject CL_GraphicContext gc,
CL_ShaderType  type,
const std::vector< CL_StringRef > &  sources
 

Constructs a ShaderObject.

Parameters:
gc = Graphic Context
type = Shader Type
vector = std

CL_ShaderObject::CL_ShaderObject CL_GraphicContextProvider gc_provider,
CL_ShaderType  type,
const CL_StringRef source
 

Constructs a ShaderObject.

Parameters:
gc_provider = Graphic Context Provider
type = Shader Type
source = String Ref

CL_ShaderObject::CL_ShaderObject CL_GraphicContextProvider gc_provider,
CL_ShaderType  type,
const std::vector< CL_StringRef > &  sources
 

Constructs a ShaderObject.

Parameters:
gc_provider = Graphic Context Provider
type = Shader Type
vector = std

virtual CL_ShaderObject::~CL_ShaderObject  )  [virtual]
 


Member Function Documentation

bool CL_ShaderObject::compile  ) 
 

Compile program.

If the compiling fails, get_info_log() will return the compile log.

unsigned int CL_ShaderObject::get_handle  )  const
 

Returns the OpenGL shader handle.

CL_String CL_ShaderObject::get_info_log  )  const
 

Get shader object's info log.

CL_String CL_ShaderObject::get_shader_source  )  const
 

Get shader source code.

CL_ShaderType CL_ShaderObject::get_shader_type  )  const
 

Gets the shader type.

static CL_ShaderObject CL_ShaderObject::load CL_GraphicContext gc,
CL_ShaderType  type,
CL_IODevice file
[static]
 

Load.

Parameters:
gc = Graphic Context
type = Shader Type
file = IODevice
Returns:
Shader Object

static CL_ShaderObject CL_ShaderObject::load CL_GraphicContext gc,
CL_ShaderType  type,
const CL_StringRef fullname
[static]
 

Load.

Parameters:
gc = Graphic Context
type = Shader Type
fullname = String Ref
Returns:
Shader Object

static CL_ShaderObject CL_ShaderObject::load CL_GraphicContext gc,
CL_ShaderType  type,
const CL_StringRef filename,
const CL_VirtualDirectory directory
[static]
 

Load.

Parameters:
gc = Graphic Context
type = Shader Type
filename = String Ref
directory = Virtual Directory
Returns:
Shader Object

static CL_ShaderObject CL_ShaderObject::load CL_GraphicContext gc,
const CL_StringRef resource_id,
CL_ResourceManager resources
[static]
 

Load.

Parameters:
gc = Graphic Context
resource_id = String Ref
resources = Resource Manager
Returns:
Shader Object

static CL_ShaderObject CL_ShaderObject::load_and_compile CL_GraphicContext gc,
CL_ShaderType  type,
CL_IODevice file
[static]
 

Load and compile.

Parameters:
gc = Graphic Context
type = Shader Type
file = IODevice
Returns:
Shader Object

static CL_ShaderObject CL_ShaderObject::load_and_compile CL_GraphicContext gc,
CL_ShaderType  type,
const CL_StringRef filename
[static]
 

Load and compile.

Parameters:
gc = Graphic Context
type = Shader Type
filename = String Ref
Returns:
Shader Object

static CL_ShaderObject CL_ShaderObject::load_and_compile CL_GraphicContext gc,
CL_ShaderType  type,
const CL_StringRef filename,
const CL_VirtualDirectory directory
[static]
 

Load and compile.

Parameters:
gc = Graphic Context
type = Shader Type
filename = String Ref
directory = Virtual Directory
Returns:
Shader Object

bool CL_ShaderObject::operator== const CL_ShaderObject other  )  const
 

Handle comparision operator.


The documentation for this class was generated from the following file:
Generated on Thu Dec 3 02:39:40 2009 for ClanLib by  doxygen 1.4.6