PrevUpHomeNext

Uniforms

#include <oglplus/uniform.hpp>

Basic location operations

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

1

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

Value get/set operations

template <typename OpsTag, typename T>
class ProgVarGetSetOps<OpsTag, tag::Uniform, T>
 : public ProgVarCommonOps<tag::Uniform>
{
public:
	void Set(T value);
	void SetValue(T value); 1

	void SetValues(std::size_t n, const T* values); 2

	void TrySet(T value); 3
};

template <typename OpsTag>
class ProgVarGetSetOps<OpsTag, tag::Uniform, void>
 : public ProgVarCommonOps<tag::Uniform>
{
public:
	template <typename T>
	void Set(T value);

	template <typename T>
	void SetValue(T value); 4

	template <typename T>
	void SetValues(std::size_t n, const T* values); 5
};

1

Sets uniform value.

2

Sets multiple consecutive values.

3

Sets the uniform value if it is active. See glVertexAttrib.

4

Sets uniform value.

5

Sets multiple consecutive values.

Definition

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

typedef Uniform<GLint> UniformSampler;

1

Uniform indirectly inherits from ProgVarLocOps and ProgVarGetSetOps.

Untyped

typedef ProgVar<
	tag::ImplicitSel,
	tag::Uniform,
	tag::NoTypecheck,
	void
> UntypedUniform; 1

UntypedUniform
operator / (ProgramName program, StrCRef identifier);

1

Uniform indirectly inherits from ProgVarLocOps and ProgVarGetSetOps.


PrevUpHomeNext