![]() |
Jopnal Engine
alpha 0.4
Simple Component Based 2D/3D Game Engine
|
#include <Shader.hpp>
Public Types | |
| enum | Type { Type::Vertex, Type::Geometry, Type::Fragment } |
Public Member Functions | |
| Shader (const std::string &name) | |
| Constructor. More... | |
| ~Shader () override | |
| Destructor. More... | |
| void | destroy () |
| Destroy this shader. More... | |
| void | addSource (const char *source) |
| Add shader source. More... | |
| bool | compile (const Type type, const bool preprocess=true) |
| Compile shader. More... | |
| bool | load (const std::string &path, Type type, const bool preprocess=true) |
| Load shader. More... | |
| Type | getType () const |
| Get the shader type. More... | |
| unsigned int | getHandle () const |
| Get the OpenGL handle. More... | |
Public Member Functions inherited from jop::Resource | |
| Resource (const std::string &name) | |
| Constructor. More... | |
| virtual | ~Resource ()=0 |
| Virtual destructor. More... | |
| const std::string & | getName () const |
| Get the name of this resource. More... | |
| void | setPersistence (const unsigned short level) |
| Set the persistence level. More... | |
| unsigned short | getPersistence () const |
| Get the persistence level. More... | |
Public Member Functions inherited from jop::SafeReferenceable< Resource > | |
| WeakReference< Resource > | getReference () const |
| Get a weak reference to the bound object. More... | |
Public Member Functions inherited from jop::SerializeInfo | |
| SerializeInfo () | |
| void | setSerializePackage (const uint16 package) |
| uint16 | getSerializePackage () const |
| void | setShouldSerialize (const bool set) |
| bool | shouldSerialize () const |
| void | setLightSerializeable (const bool set) |
| bool | isLightSerializeable () const |
Static Public Member Functions | |
| static const std::string & | getVersionString () |
| Get the version definition string. More... | |
| static const std::string & | getExtensionString () |
| Get the extension definition string. More... | |
Additional Inherited Members | |
Protected Member Functions inherited from jop::Resource | |
| Resource (const Resource &other, const std::string &newName) | |
| Copy constructor. More... | |
Protected Member Functions inherited from jop::SafeReferenceable< Resource > | |
| SafeReferenceable (Resource *ref) | |
| Constructor. More... | |
| SafeReferenceable (SafeReferenceable< Resource > &&other) | |
| Move constructor. More... | |
| SafeReferenceable & | operator= (SafeReferenceable< Resource > &&other) |
| Move assignment operator. More... | |
| ~SafeReferenceable () | |
| Protected destructor. More... | |
Definition at line 35 of file Shader.hpp.
|
strong |
|
explicit |
Constructor.
| name | Name of the resource |
|
override |
Destructor.
| void jop::Shader::addSource | ( | const char * | source | ) |
Add shader source.
The string must stay in existence until after compile() is called.
| source | The shader source |
| bool jop::Shader::compile | ( | const Type | type, |
| const bool | preprocess = true |
||
| ) |
Compile shader.
| type | Shader type |
| preprocess | Should shader be preprocessed? |
| void jop::Shader::destroy | ( | ) |
Destroy this shader.
|
static |
Get the extension definition string.
| unsigned int jop::Shader::getHandle | ( | ) | const |
Get the OpenGL handle.
| Type jop::Shader::getType | ( | ) | const |
Get the shader type.
|
static |
Get the version definition string.
| bool jop::Shader::load | ( | const std::string & | path, |
| Type | type, | ||
| const bool | preprocess = true |
||
| ) |
Load shader.
| path | Path to file containing shader or shaders source code |
| type | Shader type |
| preprocess | Should shader be preprocessed? |
1.8.11