Public Member Functions | Public Attributes | Private Types | Private Member Functions | Private Attributes | Friends

shader::ShaderFactory Class Reference

ShaderFactory attaches a shader to a node. More...

#include <_src_shader_shader_factory.hh>

List of all members.

Public Member Functions

 DEFINE_GetInstance (ShaderFactory) void AttachShader(const ShaderName &shaderName
ShaderProgram GetShader (const ShaderName &shaderName)
void Flush (void)

Public Attributes

RefPtr< Nodenode

Private Types

typedef std::map< ShaderName,
ShaderProgram
ShaderMap

Private Member Functions

 ShaderFactory (void)
 ~ShaderFactory ()
ShaderProgram CreateShader (const ShaderName &shaderName)
string ExpandMacros (const string &shaderSrc)

Private Attributes

CLASS_VAR ShaderFactorymsInstance
const string mShaderDir
 directory with shader src code
ShaderMap mShaderMap
 map of shader programs

Friends

class graph::NodeSort

Detailed Description

ShaderFactory attaches a shader to a node.

Build pathnames to files container GLSL shader source code. Naming convention: ${shaderName}_vert.glsl ${shaderName}_frag.glsl

Design notes: Abstracts OSG to a degree, but assumes a scene-graph capable of attaching a shader program to any kind of node.


Member Typedef Documentation


Constructor & Destructor Documentation

shader::ShaderFactory::ShaderFactory ( void   )  [private]

ctor/dtor.

shader::ShaderFactory::~ShaderFactory (  )  [private]

Member Function Documentation

ShaderProgram shader::ShaderFactory::CreateShader ( const ShaderName shaderName  )  [private]

(private) Unconditionally create/compile a shader.

shader::ShaderFactory::DEFINE_GetInstance ( ShaderFactory   )  const
string shader::ShaderFactory::ExpandMacros ( const string &  shaderSrc  )  [private]

Recursively expand macros in shader source. Tests for this is at: tests/shader/macro.cc

void shader::ShaderFactory::Flush ( void   ) 

Flush cache of shader programs.

ShaderProgram shader::ShaderFactory::GetShader ( const ShaderName shaderName  ) 

Get shader program.


Friends And Related Function Documentation

friend class graph::NodeSort [friend]

Member Data Documentation

const string shader::ShaderFactory::mShaderDir [private]

directory with shader src code

map of shader programs


The documentation for this class was generated from the following files:
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines
Palomino Flight Simulator documents generated by doxygen 1.7.1 on Tue May 15 2012 22:40:12