LibCarna Version 3.4.0
Loading...
Searching...
No Matches
Public Member Functions | Public Attributes | Static Public Attributes | List of all members
LibCarna::base::Sampler Class Reference

Maintains an OpenGL texture sampler object. This class realizes the RAII-idiom. More...

#include <Sampler.hpp>

Public Member Functions

 Sampler (unsigned int wrapModeS, unsigned int wrapModeT, unsigned int wrapModeR, unsigned int minFilter, unsigned int magFilter)
 Creates new OpenGL sampler object.
 
 ~Sampler ()
 Deletes the maintained OpenGL sampler object.
 
void bind (int unit) const
 Binds the maintained OpenGL sampler objec to texture unit.
 
void setWrapModeS (unsigned int wrapMode)
 Configures sampling for \(\left(s,t,r\right)^\mathrm T\) with \(s\not\in\left[0,1\right]\).
 
void setWrapModeT (unsigned int wrapMode)
 Configures sampling for \(\left(s,t,r\right)^\mathrm T\) with \(t\not\in\left[0,1\right]\).
 
void setWrapModeR (unsigned int wrapMode)
 Configures sampling for \(\left(s,t,r\right)^\mathrm T\) with \(r\not\in\left[0,1\right]\).
 
void setMinFilter (unsigned int minFilter)
 Configures sampling for when texel maps onto less than one pixel.
 
void setMagFilter (unsigned int magFilter)
 Configures sampling for when texel maps onto more than one pixel.
 

Public Attributes

const unsigned int id
 Holds the ID of the maintained OpenGL sampler object.
 

Static Public Attributes

static const unsigned int WRAP_MODE_CLAMP
 Represents GL_CLAMP_TO_EDGE.
 
static const unsigned int WRAP_MODE_REPEAT
 Represents GL_REPEAT.
 
static const unsigned int WRAP_MODE_MIRRORED_REPEAT
 Represents GL_MIRRORED_REPEAT.
 
static const unsigned int FILTER_NEAREST
 Represents GL_NEAREST.
 
static const unsigned int FILTER_LINEAR
 Represents GL_LINEAR.
 

Detailed Description

Maintains an OpenGL texture sampler object. This class realizes the RAII-idiom.

Sampling values from textures requires a sampler object to be bound to the same texture unit as the texture is bound to. The sampler object controls how values are sampled from the texture.

Author
Leonid Kostrykin

Definition at line 47 of file Sampler.hpp.

Member Data Documentation

◆ FILTER_LINEAR

const unsigned int LibCarna::base::Sampler::FILTER_LINEAR
static

Represents GL_LINEAR.

Definition at line 59 of file Sampler.hpp.

◆ FILTER_NEAREST

const unsigned int LibCarna::base::Sampler::FILTER_NEAREST
static

Represents GL_NEAREST.

Definition at line 58 of file Sampler.hpp.

◆ id

const unsigned int LibCarna::base::Sampler::id

Holds the ID of the maintained OpenGL sampler object.

Definition at line 79 of file Sampler.hpp.

◆ WRAP_MODE_CLAMP

const unsigned int LibCarna::base::Sampler::WRAP_MODE_CLAMP
static

Represents GL_CLAMP_TO_EDGE.

Definition at line 54 of file Sampler.hpp.

◆ WRAP_MODE_MIRRORED_REPEAT

const unsigned int LibCarna::base::Sampler::WRAP_MODE_MIRRORED_REPEAT
static

Represents GL_MIRRORED_REPEAT.

Definition at line 56 of file Sampler.hpp.

◆ WRAP_MODE_REPEAT

const unsigned int LibCarna::base::Sampler::WRAP_MODE_REPEAT
static

Represents GL_REPEAT.

Definition at line 55 of file Sampler.hpp.


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