PrevUpHomeNext

Samplers

#include <oglplus/sampler.hpp>

Common sampler operations

template <>
class ObjCommonOps<tag::Sampler>
 : public SamplerName
{
public:
	typedef TextureUnitSelector Target; 1

	static SamplerName Binding(TextureUnitSelector target); 2
	static void Bind(TextureUnitSelector target, SamplerName sampler); 3

	void Bind(TextureUnitSelector target) const; 4
};

1

Sampler bind target.

2

Returns the sampler currently bound to the specified target. See glGetIntegerv.

3

Binds the specified sampler to the specified target. See glBindSampler.

4

Binds this sampler to the specified target. See glBindSampler.

Operations with direct state access

template <>
class ObjectOps<tag::DirectState, tag::Sampler>
 : public ObjZeroOps<tag::DirectState, tag::Sampler> 1
{
public:
	Vector<GLfloat, 4> BorderColor(TypeTag<GLfloat>) const; 2
	Vector<GLuint, 4> BorderColor(TypeTag<GLuint>) const;
	Vector<GLint, 4> BorderColor(TypeTag<GLint>) const;

	void BorderColor(Vector<GLfloat, 4> color); 3
	void BorderColor(Vector<GLuint, 4> color);
	void BorderColor(Vector<GLint, 4> color);

	TextureCompareMode CompareMode(void) const; 4
	void CompareMode(TextureCompareMode mode); 5

	CompareFunction CompareFunc(void) const; 6
	void CompareFunc(CompareFunction func); 7

	TextureMinFilter MinFilter(void) const; 8
	void MinFilter(TextureMinFilter filter); 9

	TextureMagFilter MagFilter(void) const; 10
	void MagFilter(TextureMagFilter filter); 11

	void Filter(TextureFilter filter) const; 12

1

Indirectly inherits from ObjCommonOps<tag::Sampler>.

2

Returns the currently set border color of this sampler object. See glGetSamplerParameter, GL_TEXTURE_BORDER_COLOR.

3

Sets the border color for this sampler object. See glSamplerParameter, GL_TEXTURE_BORDER_COLOR.

4

Returns the currently set texture compare mode of this sampler object. See glGetSamplerParameter, GL_TEXTURE_COMPARE_MODE.

5

Sets the texture compare mode for this sampler object. See glSamplerParameter, GL_TEXTURE_COMPARE_MODE.

6

Returns the currently set texture compare function of this sampler object. See glGetSamplerParameter, GL_TEXTURE_COMPARE_FUNC.

7

Sets the texture compare mode for this sampler object. See glSamplerParameter, GL_TEXTURE_COMPARE_FUNC.

8

Returns the currently set texture minnification filter of this sampler object. See glGetSamplerParameter, GL_TEXTURE_MIN_FILTER.

9

Sets the texture minnification filter for this sampler object. See glSamplerParameter, GL_TEXTURE_MIN_FILTER.

10

Returns the currently set texture magnification filter of this sampler object. See glGetSamplerParameter, GL_TEXTURE_MAG_FILTER.

11

Sets the texture magnification filter for this sampler object. See glSamplerParameter, GL_TEXTURE_MAG_FILTER.

12

Sets both the minification and the magnification filter for this sampler object. See glSamplerParameter, GL_TEXTURE_MIN_FILTER, GL_TEXTURE_MAG_FILTER.

	TextureWrap Wrap(TextureWrapCoord coord) const; 1
	void Wrap(TextureWrapCoord coord, TextureWrap mode) 2

	TextureWrap WrapS(void) const; 3
	TextureWrap WrapT(void) const;
	TextureWrap WrapR(void) const;

	void WrapS(TextureWrap mode);  4
	void WrapT(TextureWrap mode);
	void WrapR(TextureWrap mode);

	GLfloat LODBias(void) const; 5
	void LODBias(GLfloat value); 6

	GLfloat MinLOD(void) const; 7
	void MinLOD(GLfloat value); 8

	GLfloat MaxLOD(void) const; 9
	void MaxLOD(GLfloat value); 10

#if GL_ARB_seamless_cubemap_per_texture
	Boolean Seamless(void) const; 11
	void Seamless(Boolean enable); 12
#endif
};

1

Returns the currently set texture wrap mode on the specified coord of this sampler object. See glGetSamplerParameter.

2

Sets the texture wrap mode on the specified coord for this sampler object. See glSamplerParameter.

3

Returns the currently set texture wrap mode on the S, T and R coordinates of this sampler object. See glGetSamplerParameter, GL_TEXTURE_WRAP_S, GL_TEXTURE_WRAP_T, GL_TEXTURE_WRAP_R.

4

Sets the texture wrap mode on the S, T and R coordinates for this sampler object. See glSamplerParameter, GL_TEXTURE_WRAP_S, GL_TEXTURE_WRAP_T, GL_TEXTURE_WRAP_R.

5

Returns the currently set texture level-of-detail bias value of this sampler object. See glGetSamplerParameter, GL_TEXTURE_LOD_BIAS.

6

Sets the texture level-of-detail bias value for this sampler object. See glSamplerParameter, GL_TEXTURE_LOD_BIAS.

7

Returns the currently set minimum texture level-of-detail value of this sampler object. See glGetSamplerParameter, GL_TEXTURE_MIN_LOD.

8

Sets the minimal texture level-of-detail value for this sampler object. See glSamplerParameter, GL_TEXTURE_MIN_LOD.

9

Returns the currently set maximum texture level-of-detail value of this sampler object. See glGetSamplerParameter, GL_TEXTURE_MAX_LOD.

10

Sets the maximal texture level-of-detail value for this sampler object. See glSamplerParameter, GL_TEXTURE_MAX_LOD.

11

Returns the value of the seamless-cube map setting of this sampler object. See glGetSamplerParameter, GL_TEXTURE_CUBE_MAP_SEAMLESS.

12

Sets the seamless cubemap setting for this sampler object. See glSamplerParameter, GL_TEXTURE_CUBE_MAP_SEAMLESS.

Definition

typedef ObjectOps<tag::DirectState, tag::Sampler>
	SamplerOps;

typedef Object<SamplerOps> Sampler;

typedef ObjectZero<ObjZeroOps<tag::DirectState, tag::Sampler>>
	NoSampler;

Syntax sugar operators

struct SamplerOpsAndSlot { };

SamplerOpsAndSlot operator | (
	SamplerOps& sam,
	GLuint slot
);

SamplerOps& operator << (
	SamplerOps& sam,
	TextureUnitSelector tus
); 1

SamplerOps& operator << (
	SamplerOps& sam,
	TextureFilter filter
); 2

SamplerOps& operator << (
	SamplerOps& sam,
	TextureMinFilter filter
); 3

SamplerOps& operator << (
	SamplerOps& sam,
	TextureMagFilter filter
); 4

SamplerOps& operator << (
	SamplerOps& sam,
	TextureCompareMode mode
); 5

SamplerOps& operator << (
	SamplerOps& sam,
	CompareFunction func
); 6
{
	sam.CompareFunc(func);
	return sam;
}

SamplerOps& operator << (
	SamplerOps& sam,
	TextureWrap wrap
); 7

SamplerOps& operator << (
	SamplerOpsAndSlot sas,
	TextureWrap wrap
); 8

template <typename T>
SamplerOps& operator << (
	SamplerOps& sam,
	const Vector<T, 4>& col
); 9

1

Bind

2

Filter

3

MinFilter

4

MagFilter

5

CompareMode

6

CompareFunc

7

Wrap mode on all coordinates

8

Wrap mode on the i-th coordinate

9

Border color


PrevUpHomeNext