Carna  Version 3.3.2
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>
16 #include <Carna/base/noncopyable.h>
17 
22 namespace Carna
23 {
24 
25 namespace base
26 {
27 
28 
29 
30 // ----------------------------------------------------------------------------------
31 // Sampler
32 // ----------------------------------------------------------------------------------
33 
44 class CARNA_LIB Sampler
45 {
46 
48 
49 public:
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 
61  Sampler
62  ( unsigned int wrapModeS
63  , unsigned int wrapModeT
64  , unsigned int wrapModeR
65  , unsigned int minFilter
66  , unsigned int magFilter );
67 
71  ~Sampler();
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
const unsigned int id
Holds the ID of the maintained OpenGL sampler object.
Definition: Sampler.h:76
static const unsigned int FILTER_LINEAR
Represents GL_LINEAR.
Definition: Sampler.h:56
static const unsigned int WRAP_MODE_MIRRORED_REPEAT
Represents GL_MIRRORED_REPEAT.
Definition: Sampler.h:53
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
Maintains an OpenGL texture sampler object. This class realizes the RAII-idiom.
Definition: Sampler.h:44
static const unsigned int FILTER_NEAREST
Represents GL_NEAREST.
Definition: Sampler.h:55
#define NON_COPYABLE
Features class it is placed in as non-copyable.
Definition: noncopyable.h:109