globjects
2.0.0.690708773bba
Strict OpenGL objects wrapper.
|
Encapsulates OpenGL shaders. More...
#include <globjects/include/globjects/Shader.h>
Public Types | |
enum | IncludeImplementation { IncludeImplementation::ShadingLanguageIncludeARB, IncludeImplementation::Fallback } |
using | IncludePaths = std::vector< std::string > |
Public Types inherited from globjects::Object | |
enum | NameImplementation { NameImplementation::DebugKHR, NameImplementation::Legacy } |
Public Member Functions | |
Shader (const gl::GLenum type, AbstractStringSource *source, const IncludePaths &includePaths=IncludePaths()) | |
Shader (const gl::GLenum type) | |
virtual | ~Shader () |
virtual void | accept (ObjectVisitor &visitor) override |
gl::GLenum | type () const |
void | setSource (AbstractStringSource *source) |
const AbstractStringSource * | source () const |
void | updateSource () |
const IncludePaths & | includePaths () const |
void | setIncludePaths (const IncludePaths &includePaths) |
bool | compile () const |
bool | isCompiled () const |
void | invalidate () |
gl::GLint | get (gl::GLenum pname) const |
std::string | getSource () const |
bool | checkCompileStatus () const |
std::string | infoLog () const |
std::string | typeString () const |
virtual gl::GLenum | objectType () const override |
Public Member Functions inherited from globjects::Object | |
gl::GLuint | id () const |
std::string | name () const |
void | setName (const std::string &name) |
bool | hasName () const |
bool | isDefault () const |
void | detach () |
Public Member Functions inherited from globjects::Changeable | |
Changeable () | |
virtual | ~Changeable () |
void | changed () const |
void | registerListener (ChangeListener *listener) |
void | deregisterListener (ChangeListener *listener) |
Static Public Member Functions | |
static void | hintIncludeImplementation (IncludeImplementation impl) |
static void | globalReplace (const std::string &search, const std::string &replacement) |
static void | globalReplace (const std::string &search, int i) |
static void | clearGlobalReplacements () |
static std::unique_ptr< StaticStringSource > | sourceFromString (const std::string &sourceString) |
static std::unique_ptr< File > | sourceFromFile (const std::string &filename) |
static std::unique_ptr< AbstractStringSource > | applyGlobalReplacements (AbstractStringSource *source) |
static std::string | typeString (gl::GLenum type) |
Static Public Member Functions inherited from globjects::Object | |
static void | hintNameImplementation (NameImplementation impl) |
Static Public Member Functions inherited from globjects::Instantiator< Shader > | |
static std::unique_ptr< Shader > | create (Args &&...args) |
static std::unique_ptr< Shader > | fromId (gl::GLuint id, Args &&...args) |
Protected Member Functions | |
virtual void | notifyChanged (const Changeable *changeable) override |
std::string | shaderString () const |
Protected Member Functions inherited from globjects::Object | |
Object (std::unique_ptr< IDResource > &&resource) | |
virtual | ~Object () |
Protected Member Functions inherited from globjects::ChangeListener | |
void | addSubject (Changeable *subject) |
virtual void | removeSubject (Changeable *subject) |
virtual | ~ChangeListener () |
Protected Member Functions inherited from globjects::Changeable | |
Changeable () | |
virtual | ~Changeable () |
void | changed () const |
void | registerListener (ChangeListener *listener) |
void | deregisterListener (ChangeListener *listener) |
Protected Attributes | |
gl::GLenum | m_type |
AbstractStringSource * | m_source |
IncludePaths | m_includePaths |
std::set< Program * > | m_programs |
bool | m_compiled |
bool | m_compilationFailed |
Protected Attributes inherited from globjects::Object | |
std::unique_ptr< IDResource > | m_resource |
void * | m_objectLabelState |
Protected Attributes inherited from globjects::ChangeListener | |
std::set< Changeable * > | m_subjects |
Protected Attributes inherited from globjects::Changeable | |
std::set< ChangeListener * > | m_listeners |
Static Protected Attributes | |
static std::map< std::string, std::string > | s_globalReplacements |
Friends | |
class | Program |
Encapsulates OpenGL shaders.
A shader can be constructed using an AbstractStringSource. A shader can be attached to a program using Program::attach(). A Shader subclasses either ChangeListener and Changeable to react to changing shader sources and to propagate this change to ChangeListeners.
using globjects::Shader::IncludePaths = std::vector<std::string> |
|
strong |
globjects::Shader::Shader | ( | const gl::GLenum | type, |
AbstractStringSource * | source, | ||
const IncludePaths & | includePaths = IncludePaths() |
||
) |
globjects::Shader::Shader | ( | const gl::GLenum | type | ) |
|
virtual |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
overridevirtual |
Implements globjects::Object.
gl::GLenum globjects::Shader::type | ( | ) | const |
void globjects::Shader::setSource | ( | AbstractStringSource * | source | ) |
const AbstractStringSource* globjects::Shader::source | ( | ) | const |
void globjects::Shader::updateSource | ( | ) |
const IncludePaths& globjects::Shader::includePaths | ( | ) | const |
void globjects::Shader::setIncludePaths | ( | const IncludePaths & | includePaths | ) |
bool globjects::Shader::compile | ( | ) | const |
bool globjects::Shader::isCompiled | ( | ) | const |
void globjects::Shader::invalidate | ( | ) |
gl::GLint globjects::Shader::get | ( | gl::GLenum | pname | ) | const |
std::string globjects::Shader::getSource | ( | ) | const |
bool globjects::Shader::checkCompileStatus | ( | ) | const |
std::string globjects::Shader::infoLog | ( | ) | const |
std::string globjects::Shader::typeString | ( | ) | const |
|
overridevirtual |
Implements globjects::Object.
|
static |
|
overrideprotectedvirtual |
Reimplemented from globjects::ChangeListener.
|
protected |
|
friend |
|
protected |
|
protected |
|
protected |
|
protected |
|
mutableprotected |
|
mutableprotected |
|
staticprotected |