Carna Version 3.3.3
Loading...
Searching...
No Matches
Sampler.h
Go to the documentation of this file.
1/*
2 * Copyright (C) 2010 - 2015 Leonid Kostrykin
3 *
4 * Chair of Medical Engineering (mediTEC)
5 * RWTH Aachen University
6 * Pauwelsstr. 20
7 * 52074 Aachen
8 * Germany
9 *
10 */
11
12#ifndef SAMPLER_H_6014714286
13#define SAMPLER_H_6014714286
14
15#include <Carna/Carna.h>
17
22namespace Carna
23{
24
25namespace base
26{
27
28
29
30// ----------------------------------------------------------------------------------
31// Sampler
32// ----------------------------------------------------------------------------------
33
44class CARNA_LIB Sampler
45{
46
48
49public:
50
51 const static unsigned int WRAP_MODE_CLAMP;
52 const static unsigned int WRAP_MODE_REPEAT;
53 const static unsigned int WRAP_MODE_MIRRORED_REPEAT;
54
55 const static unsigned int FILTER_NEAREST;
56 const static unsigned int FILTER_LINEAR;
57
62 ( unsigned int wrapModeS
63 , unsigned int wrapModeT
64 , unsigned int wrapModeR
65 , unsigned int minFilter
66 , unsigned int magFilter );
67
72
76 const unsigned int id;
77
81 void bind( int unit ) const;
82
87 void setWrapModeS( unsigned int wrapMode );
88
93 void setWrapModeT( unsigned int wrapMode );
94
99 void setWrapModeR( unsigned int wrapMode );
100
104 void setMinFilter( unsigned int minFilter );
105
109 void setMagFilter( unsigned int magFilter );
110
111}; // Sampler
112
113
114
115} // namespace Carna :: base
116
117} // namespace Carna
118
119#endif // SAMPLER_H_6014714286
Represents an association.
Definition Association.h:45
Maintains an OpenGL texture sampler object. This class realizes the RAII-idiom.
Definition Sampler.h:45
static const unsigned int WRAP_MODE_MIRRORED_REPEAT
Represents GL_MIRRORED_REPEAT.
Definition Sampler.h:53
void setWrapModeR(unsigned int wrapMode)
Configures sampling for with .
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 .
void bind(int unit) const
Binds the maintained OpenGL sampler objec to texture unit.
static const unsigned int FILTER_LINEAR
Represents GL_LINEAR.
Definition Sampler.h:56
~Sampler()
Deletes the maintained OpenGL sampler object.
void setMinFilter(unsigned int minFilter)
Configures sampling for when texel maps onto less than one pixel.
const unsigned int id
Holds the ID of the maintained OpenGL sampler object.
Definition Sampler.h:76
static const unsigned int WRAP_MODE_REPEAT
Represents GL_REPEAT.
Definition Sampler.h:52
static const unsigned int WRAP_MODE_CLAMP
Represents GL_CLAMP_TO_EDGE.
Definition Sampler.h:51
static const unsigned int FILTER_NEAREST
Represents GL_NEAREST.
Definition Sampler.h:55
Sampler(unsigned int wrapModeS, unsigned int wrapModeT, unsigned int wrapModeR, unsigned int minFilter, unsigned int magFilter)
Creates new OpenGL sampler object.
void setWrapModeS(unsigned int wrapMode)
Configures sampling for with .
#define NON_COPYABLE
Features class it is placed in as non-copyable.