LibCarna Version 3.4.0
Loading...
Searching...
No Matches
Sampler.hpp
Go to the documentation of this file.
1/*
2 * Copyright (C) 2010 - 2016 Leonid Kostrykin
3 *
4 * Chair of Medical Engineering (mediTEC)
5 * RWTH Aachen University
6 * Pauwelsstr. 20
7 * 52074 Aachen
8 * Germany
9 *
10 *
11 * Copyright (C) 2021 - 2025 Leonid Kostrykin
12 *
13 */
14
15#ifndef SAMPLER_H_6014714286
16#define SAMPLER_H_6014714286
17
18#include <LibCarna/LibCarna.hpp>
20
26namespace LibCarna
27{
28
29namespace base
30{
31
32
33
34// ----------------------------------------------------------------------------------
35// Sampler
36// ----------------------------------------------------------------------------------
37
47class LIBCARNA Sampler
48{
49
51
52public:
53
54 const static unsigned int WRAP_MODE_CLAMP;
55 const static unsigned int WRAP_MODE_REPEAT;
56 const static unsigned int WRAP_MODE_MIRRORED_REPEAT;
57
58 const static unsigned int FILTER_NEAREST;
59 const static unsigned int FILTER_LINEAR;
60
65 ( unsigned int wrapModeS
66 , unsigned int wrapModeT
67 , unsigned int wrapModeR
68 , unsigned int minFilter
69 , unsigned int magFilter );
70
75
79 const unsigned int id;
80
84 void bind( int unit ) const;
85
90 void setWrapModeS( unsigned int wrapMode );
91
96 void setWrapModeT( unsigned int wrapMode );
97
102 void setWrapModeR( unsigned int wrapMode );
103
107 void setMinFilter( unsigned int minFilter );
108
112 void setMagFilter( unsigned int magFilter );
113
114}; // Sampler
115
116
117
118} // namespace LibCarna :: base
119
120} // namespace LibCarna
121
122#endif // SAMPLER_H_6014714286
Contains forward-declarations.
Represents an association.
Maintains an OpenGL texture sampler object. This class realizes the RAII-idiom.
Definition Sampler.hpp:48
static const unsigned int FILTER_NEAREST
Represents GL_NEAREST.
Definition Sampler.hpp:58
void setMinFilter(unsigned int minFilter)
Configures sampling for when texel maps onto less than one pixel.
void setWrapModeS(unsigned int wrapMode)
Configures sampling for with .
void bind(int unit) const
Binds the maintained OpenGL sampler objec to texture unit.
void setWrapModeR(unsigned int wrapMode)
Configures sampling for with .
static const unsigned int WRAP_MODE_CLAMP
Represents GL_CLAMP_TO_EDGE.
Definition Sampler.hpp:54
void setMagFilter(unsigned int magFilter)
Configures sampling for when texel maps onto more than one pixel.
void setWrapModeT(unsigned int wrapMode)
Configures sampling for with .
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.
static const unsigned int WRAP_MODE_MIRRORED_REPEAT
Represents GL_MIRRORED_REPEAT.
Definition Sampler.hpp:56
static const unsigned int WRAP_MODE_REPEAT
Represents GL_REPEAT.
Definition Sampler.hpp:55
static const unsigned int FILTER_LINEAR
Represents GL_LINEAR.
Definition Sampler.hpp:59
const unsigned int id
Holds the ID of the maintained OpenGL sampler object.
Definition Sampler.hpp:79
Defines LibCarna::base::noncopyable and NON_COPYABLE.
#define NON_COPYABLE
Marks the class that it is placed in as non-copyable.