61 #ifndef GRAPHICS_SHADER_SHADER_H 62 #define GRAPHICS_SHADER_SHADER_H 227 glBindAttribLocation(
glid, (GLuint)(attrib), name.
c_str());
293 #define ShaderMan Graphics::Shader::ShaderManager::instance() 295 #endif // GRAPHICS_SHADER_SHADER_H void parseShaderVariables(const Common::UString &shaderString, std::vector< ShaderObject::ShaderObjectVariable > &variableList)
Parses a given string, representing a GLSL shader, and extracts uniform variable information from it...
const ShaderObjectVariable & operator=(const ShaderObjectVariable &src)
ShaderObjectVariable(ShaderVariableType t, uint32 cnt, const Common::UString &n)
Class and macro for implementing singletons.
ShaderProgram * getShaderProgram(ShaderObject *vertexObject, ShaderObject *fragmentObject)
An object containing shader information.
A class holding an UTF-8 string.
std::vector< ShaderObject::ShaderObjectVariable > variablesSelf
ShaderProgram * registerShaderProgram(ShaderObject *vertexObject, ShaderObject *fragmentObject)
void addToQueue(QueueType queue)
Common::UString shaderString
void bindShaderVariable(ShaderObject::ShaderObjectVariable &var, GLint loc, const void *data)
Common::Mutex _programMutex
A handle to an Aurora texture.
ShaderUBO(const ShaderUBO &src)
Virtual base class of a texture.
ShaderObject * fragmentObject
ShaderObject * getShaderObject(const Common::UString &name, ShaderType type)
const char * c_str() const
Return the (utf8 encoded) string data.
ShaderUBO(GLuint idx, GLuint gid)
Generic template base class for implementing the singleton design pattern.
Graphics::Aurora::TextureHandle handle
ShaderVariableType shaderstringToEnum(const Common::UString &stype)
ShaderVariableType
Enum of all supported shader variable parsing and automatic binding.
ShaderObjectVariable(const ShaderObjectVariable &src)
void genGLShader(ShaderObject *object)
Generate GL ids for, and compile a shader object.
std::vector< GLint > fragmentVariableLocations
ShaderObject * vertexObject
std::vector< Shader::ShaderProgram * > _shaderProgramArray
const ShaderUBO & operator=(const ShaderUBO &src)
void deinit()
Deinitialise shader subsystem.
void registerShaderAttachment(GLuint progid, ShaderObject *obj)
Recursively attaches shader objects to a given program.
void genShaderVariableList(ShaderObject *obj, std::vector< ShaderObject::ShaderObjectVariable > &vars)
std::vector< ShaderObject * > subObjects
Shader sampler is used to bind a texture to a texture unit.
void genGLProgram(ShaderProgram *program)
Generate GL id for, and link, a shader program.
void init()
Initialise shader management, including default shader set creation.
std::map< Common::UString, Shader::ShaderObject * > _shaderObjectMap
ShaderSampler(Texture *t, uint32 u)
std::vector< GLint > vertexVariableLocations
A container of OpenGL elements.
void bindShaderInstance(ShaderProgram *program, const void **vertexVariables, const void **fragmentVariables)
void bindAttribute(ShaderVertexAttrib attrib, const Common::UString &name)
Common::Mutex _shaderMutex
std::vector< ShaderObject::ShaderObjectVariable > variablesCombined