PrevUpHomeNext

Uniform blocks

#include <oglplus/uniform_block.hpp>

Basic block location operations

template <>
class ProgVarLocOps<tag::UniformBlock>
{
public:
	static GLint GetLocation(
		ProgramName program,
		StrCRef identifier,
		bool active_only
	); 1
};

1

Finds the location of the uniform block specified by identifier in a program. If active_only is true then throws ProgVarError if no such uniform block exists or if it is not active. See glGetUniformBlockIndex.

Common uniform block operations

template <>
class ProgVarCommonOps<tag::UniformBlock>
 : public ProgVarLoc<tag::UniformBlock>
{
public:
	static GLuint MaxIn(ShaderType shader_type); 1

	Boolean ReferencedBy(ShaderType shader_type) const; 2

	GLuint DataSize(void) const; 3

	void Binding(UniformBufferBindingPoint binding); 4
};

1

Returns the maximum number of uniform blocks for a shader_type.

2

Returns true if this uniform block is referenced by a shader_type. See glGetActiveUniformBlock.

3

Returns the size of the uniform block. See glGetActiveUniformBlock, GL_UNIFORM_BLOCK_DATA_SIZE.

4

Sets up the uniform block binding. See glUniformBlockBinding.

Definition

template <typename T>
using Uniform = ProgVar<
	tag::ImplicitSel,
	tag::UniformBlock,
	tag::NoTypecheck,
	void
>; 1

1

UniformBlock indirectly inherits from ProgVarLocOps and ProgVarCommonOps.


PrevUpHomeNext