An OpenGL shader program. More...
#include <sceneview/shader_resource.hpp>
Public Types | |
typedef std::shared_ptr < ShaderResource > | Ptr |
Public Member Functions | |
const QString | Name () const |
void | LoadFromFiles (const QString &prefix) |
Loads a vertex shader and fragment shader into this resource. More... | |
void | LoadFromFiles (const QString &prefix, const QString &preamble) |
Loads a vertex shader and fragment shader into this resource. More... | |
QOpenGLShaderProgram * | Program () |
const ShaderStandardVariables & | StandardVariables () const |
Friends | |
class | ResourceManager |
An OpenGL shader program.
ShaderResource objects cannot be directly instantiated. Instead, use ResourceManager or StockResources.
void sv::ShaderResource::LoadFromFiles | ( | const QString & | prefix | ) |
Loads a vertex shader and fragment shader into this resource.
filename prefix. ".vshader" will automatically be added to the vertex shader filename, and ".fshader" will automatically be added to the fragment shader filename.
void sv::ShaderResource::LoadFromFiles | ( | const QString & | prefix, |
const QString & | preamble | ||
) |
Loads a vertex shader and fragment shader into this resource.
prefix | filename prefix. ".vshader" will automatically be added to the vertex shader filename, and ".fshader" will automatically be added to the fragment shader filename. |
preamble | text to prepend to both the vertex and fragment shaders before compiling. You can use this to define preprocessor constants, etc. |