Support Forum       G3D Web Page     
Public Member Functions | Public Attributes | List of all members
G3D::Shader::ShaderProgram::UniformDeclaration Class Reference

Uniform variable declaration discovered in the program. More...

Public Member Functions

void fillOutDummy (const String &name, int index, GLenum type)
 Sets the name, index, and type fields, and provides proper defaults for all other field for a dummy variable. More...
 
void setAllFields (const String &name, int index, GLenum type, GLint location, bool dummy, GLint glUnit)
 Shorthand to avoid having to set these fields one-by-one. More...
 

Public Attributes

bool dummy
 If true, this uniform is not used by the shader program, so we never try to bind a value to it. More...
 
GLuint elementNum
 The number of elements in this variable. More...
 
GLint glUnit
 The texture, image, or shader buffer unit this uniform is bound to. More...
 
GLuint index
 The index of this element in its array. More...
 
GLint location
 OpenGL location returned by glGetUniformLocation, -1 if this uniform is inactive. More...
 
String name
 
GLenum type
 OpenGL type of the variable (e.g., GL_INT) More...
 

Detailed Description

Uniform variable declaration discovered in the program.

Member Function Documentation

◆ fillOutDummy()

void G3D::Shader::ShaderProgram::UniformDeclaration::fillOutDummy ( const String name,
int  index,
GLenum  type 
)
inline

Sets the name, index, and type fields, and provides proper defaults for all other field for a dummy variable.

◆ setAllFields()

void G3D::Shader::ShaderProgram::UniformDeclaration::setAllFields ( const String name,
int  index,
GLenum  type,
GLint  location,
bool  dummy,
GLint  glUnit 
)
inline

Shorthand to avoid having to set these fields one-by-one.

Not in a constructor since UniformDeclaration is a G3D::Table key in its main role and thus gets initialized by the default constructor.

Referenced by fillOutDummy().

Member Data Documentation

◆ dummy

bool G3D::Shader::ShaderProgram::UniformDeclaration::dummy

If true, this uniform is not used by the shader program, so we never try to bind a value to it.

Referenced by setAllFields().

◆ elementNum

GLuint G3D::Shader::ShaderProgram::UniformDeclaration::elementNum

The number of elements in this variable.

For non-arrays, this is 1. For now, we store all array elements separately, so this is always 1. Left for future use.

◆ glUnit

GLint G3D::Shader::ShaderProgram::UniformDeclaration::glUnit

The texture, image, or shader buffer unit this uniform is bound to.

Referenced by setAllFields().

◆ index

GLuint G3D::Shader::ShaderProgram::UniformDeclaration::index

The index of this element in its array.

For non-array elements, -1.

Referenced by fillOutDummy(), and setAllFields().

◆ location

GLint G3D::Shader::ShaderProgram::UniformDeclaration::location

OpenGL location returned by glGetUniformLocation, -1 if this uniform is inactive.

Referenced by setAllFields().

◆ name

String G3D::Shader::ShaderProgram::UniformDeclaration::name

Referenced by fillOutDummy(), and setAllFields().

◆ type

GLenum G3D::Shader::ShaderProgram::UniformDeclaration::type

OpenGL type of the variable (e.g., GL_INT)

Referenced by fillOutDummy(), and setAllFields().


documentation generated on Wed Nov 24 2021 08:02:00 using doxygen 1.8.15