Jopnal Engine  alpha 0.4
Simple Component Based 2D/3D Game Engine
Public Member Functions | Static Public Member Functions | List of all members
jop::ShaderAssembler Class Referencefinal

#include <ShaderAssembler.hpp>

Inheritance diagram for jop::ShaderAssembler:
jop::Subsystem

Public Member Functions

 ShaderAssembler ()
 Default constructor. More...
 
 ~ShaderAssembler () override
 Destructor. More...
 
- Public Member Functions inherited from jop::Subsystem
 Subsystem (const uint32 ID)
 Constructor. More...
 
virtual ~Subsystem ()=0
 Virtual destructor. More...
 
virtual void preUpdate (const float deltaTime)
 Pre-update. More...
 
virtual void postUpdate (const float deltaTime)
 Post-update. More...
 
virtual void draw ()
 Draw. More...
 
Message::Result sendMessage (const Message &message)
 Function to handle messages. More...
 
SubsystemsetActive (const bool active)
 Set this sub system active. More...
 
bool isActive () const
 Check if this sub system is active. More...
 
uint32 getID () const
 Get the ID. More...
 

Static Public Member Functions

static void addPlugin (const std::string &name, const std::string &source)
 Add a single plugin. More...
 
static void addPlugins (const std::string &source)
 Add multiple plugins from single string. More...
 
static void removePlugin (const std::string &name)
 Removes plugin with given name from memory. More...
 
static void clearPlugins ()
 Clear all plugins from memory. More...
 
static void preprocess (const std::vector< const char * > &input, std::string &output)
 Pre-processes shaders source code and adds necessary plugins before compilation. More...
 
static ShaderProgramgetShader (const uint64 materialAttribs, const uint64 drawableAttribs=0)
 Get a shader with the given attribute combination. More...
 
static const ShaderMap & getShaderMap ()
 Get the shader map. More...
 
static void setShaderSource (const Shader::Type type, const std::string &source)
 Set a shader source. More...
 

Additional Inherited Members

- Protected Member Functions inherited from jop::Subsystem
virtual Message::Result receiveMessage (const Message &message)
 Receive a message. More...
 

Detailed Description

Definition at line 42 of file ShaderAssembler.hpp.

Constructor & Destructor Documentation

jop::ShaderAssembler::ShaderAssembler ( )

Default constructor.

Reads the uber shader from the resource dll

jop::ShaderAssembler::~ShaderAssembler ( )
override

Destructor.

Member Function Documentation

static void jop::ShaderAssembler::addPlugin ( const std::string &  name,
const std::string &  source 
)
static

Add a single plugin.

Parameters
nameName of the plugin
sourceThe source code for the plugin
See also
addPlugins()
static void jop::ShaderAssembler::addPlugins ( const std::string &  source)
static

Add multiple plugins from single string.

Parses through the string and searches for plugins and adds them to memory.

Different plugins are defined as follows:

/// #plugin <PluginName>
/// 
/// some GLSL code...
///
/// #pluginend
/// 
Multiple plugins can be defined in a single source.

\param source The plugin source

\see addPlugin()
static void jop::ShaderAssembler::clearPlugins ( )
static

Clear all plugins from memory.

static ShaderProgram& jop::ShaderAssembler::getShader ( const uint64  materialAttribs,
const uint64  drawableAttribs = 0 
)
static

Get a shader with the given attribute combination.

Parameters
materialAttribsThe material attributes
drawableAttribsThe drawable attributes
Returns
Reference to the shader
static const ShaderMap& jop::ShaderAssembler::getShaderMap ( )
static

Get the shader map.

Returns
Reference to the internal shader map
static void jop::ShaderAssembler::preprocess ( const std::vector< const char * > &  input,
std::string &  output 
)
static

Pre-processes shaders source code and adds necessary plugins before compilation.

Parameters
inputShaders source code
outputPreprocessed source code
static void jop::ShaderAssembler::removePlugin ( const std::string &  name)
static

Removes plugin with given name from memory.

Parameters
nameName of the plugin
static void jop::ShaderAssembler::setShaderSource ( const Shader::Type  type,
const std::string &  source 
)
static

Set a shader source.

This can be used to override the default über shader.

Parameters
typeThe shader type
sourceThe shader source

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