Inviwo 0.9.12-pre
Inviwo documentation
Loading...
Searching...
No Matches
inviwo::Shader Class Reference

Public Types

enum class  OnError { Warn , Throw }
 
enum class  UniformWarning { Ignore , Warn , Throw }
 
using Build = detail::Build
 
using iterator = typename std::vector<ShaderObject>::iterator
 
using const_iterator = typename std::vector<ShaderObject>::const_iterator
 

Public Member Functions

 Shader (const std::vector< std::pair< ShaderType, std::string > > &items, Build buildShader=Build::Yes)
 
 Shader (const std::vector< std::pair< ShaderType, std::shared_ptr< const ShaderResource > > > &items, Build buildShader=Build::Yes)
 
 Shader (std::vector< std::unique_ptr< ShaderObject > > &shaderObjects, Build buildShader=Build::Yes)
 
 Shader (std::string_view fragmentFilename, Build buildShader=Build::Yes)
 
 Shader (std::string_view vertexFilename, std::string_view fragmentFilename, Build buildShader=Build::Yes)
 
 Shader (std::string_view vertexFilename, std::string_view geometryFilename, std::string_view fragmentFilename, Build buildShader=Build::Yes)
 
 Shader (const Shader &rhs)=delete
 
 Shader (Shader &&rhs)
 
Shaderoperator= (const Shader &that)=delete
 
Shaderoperator= (Shader &&that)
 
void link ()
 
void build ()
 
bool isReady () const
 
void invalidate ()
 
GLuint getID () const
 
iterator begin ()
 
iterator end ()
 
const_iterator begin () const
 
const_iterator end () const
 
util::iter_range< iterator > getShaderObjects ()
 
util::iter_range< const_iterator > getShaderObjects () const
 
const ShaderObjectgetShaderObject (ShaderType type) const
 
ShaderObjectgetShaderObject (ShaderType type)
 
const ShaderObjectoperator[] (ShaderType type) const
 
ShaderObjectoperator[] (ShaderType type)
 
const ShaderObjectgetVertexShaderObject () const
 
const ShaderObjectgetGeometryShaderObject () const
 
const ShaderObjectgetFragmentShaderObject () const
 
const ShaderObjectgetComputeShaderObject () const
 
const ShaderObjectgetTessellationControlShaderObject () const
 
const ShaderObjectgetTessellationEvaluationShaderObject () const
 
ShaderObjectgetVertexShaderObject ()
 
ShaderObjectgetGeometryShaderObject ()
 
ShaderObjectgetFragmentShaderObject ()
 
ShaderObjectgetComputeShaderObject ()
 
ShaderObjectgetTessellationControlShaderObject ()
 
ShaderObjectgetTessellationEvaluationShaderObject ()
 
void setShaderObject (ShaderType type, std::shared_ptr< const ShaderResource > resource)
 
void setShaderObject (ShaderObject object)
 
void activate ()
 
void deactivate ()
 
void setUniform (std::string_view name, bool value) const
 
void setUniform (std::string_view name, std::span< const bool > values) const
 
void setUniform (std::string_view name, int value) const
 
void setUniform (std::string_view name, std::span< const int > values) const
 
void setUniform (std::string_view name, unsigned int value) const
 
void setUniform (std::string_view name, std::span< const unsigned int > values) const
 
void setUniform (std::string_view name, float value) const
 
void setUniform (std::string_view name, std::span< const float > values) const
 
void setUniform (std::string_view name, bvec2 value) const
 
void setUniform (std::string_view name, std::span< const bvec2 > values) const
 
void setUniform (std::string_view name, bvec3 value) const
 
void setUniform (std::string_view name, std::span< const bvec3 > values) const
 
void setUniform (std::string_view name, bvec4 value) const
 
void setUniform (std::string_view name, std::span< const bvec4 > values) const
 
void setUniform (std::string_view name, ivec2 value) const
 
void setUniform (std::string_view name, std::span< const ivec2 > values) const
 
void setUniform (std::string_view name, ivec3 value) const
 
void setUniform (std::string_view name, std::span< const ivec3 > values) const
 
void setUniform (std::string_view name, ivec4 value) const
 
void setUniform (std::string_view name, std::span< const ivec4 > values) const
 
void setUniform (std::string_view name, uvec2 value) const
 
void setUniform (std::string_view name, std::span< const uvec2 > values) const
 
void setUniform (std::string_view name, uvec3 value) const
 
void setUniform (std::string_view name, std::span< const uvec3 > values) const
 
void setUniform (std::string_view name, uvec4 value) const
 
void setUniform (std::string_view name, std::span< const uvec4 > values) const
 
void setUniform (std::string_view name, vec2 value) const
 
void setUniform (std::string_view name, std::span< const vec2 > values) const
 
void setUniform (std::string_view name, vec3 value) const
 
void setUniform (std::string_view name, std::span< const vec3 > values) const
 
void setUniform (std::string_view name, vec4 value) const
 
void setUniform (std::string_view name, std::span< const vec4 > values) const
 
void setUniform (std::string_view name, const mat2 &value) const
 
void setUniform (std::string_view name, std::span< const mat2 > values) const
 
void setUniform (std::string_view name, const mat3 &value) const
 
void setUniform (std::string_view name, std::span< const mat3 > values) const
 
void setUniform (std::string_view name, const mat4 &value) const
 
void setUniform (std::string_view name, std::span< const mat4 > values) const
 
void setUniform (std::string_view name, const TextureUnit &value) const
 
void setUniformWarningLevel (UniformWarning level)
 
const BaseCallBack * onReload (std::function< void()> callback)
 
std::shared_ptr< std::function< void()> > onReloadScoped (std::function< void()> callback)
 
void removeOnReload (const BaseCallBack *callback)
 
void setTransformFeedbackVaryings (std::span< const char * > varyings, GLenum bufferMode)
 

Member Function Documentation

◆ setTransformFeedbackVaryings()

void inviwo::Shader::setTransformFeedbackVaryings ( std::span< const char * > varyings,
GLenum bufferMode )

Specify values to record in transform feedback buffers.

Parameters
varyingsArray of names of the varying variables to use for transform feedback.
bufferModeThe mode used to capture the varying variables when transform feedback is active. Must be GL_INTERLEAVED_ATTRIBS or GL_SEPARATE_ATTRIBS.

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