globjects  2.0.0.630135941c42
Strict OpenGL objects wrapper.
Loading...
Searching...
No Matches
Sampler.h
Go to the documentation of this file.
1
2#pragma once
3
4
5#include <glm/fwd.hpp>
6
7#include <glbinding/gl/types.h>
8
9#include <globjects/globjects_api.h>
10#include <globjects/Object.h>
12
13
14namespace globjects
15{
16
17
22class GLOBJECTS_API Sampler : public Object, public Instantiator<Sampler>
23{
24public:
26
27 virtual ~Sampler();
28
29 static std::unique_ptr<Sampler> fromId(gl::GLuint id);
30
31 void bind(gl::GLuint unit) const;
32 static void unbind(gl::GLuint unit);
33
34 void setParameter(gl::GLenum name, gl::GLenum value);
35 void setParameter(gl::GLenum name, gl::GLint value);
36 void setParameter(gl::GLenum name, gl::GLfloat value);
37 void setParameter(gl::GLenum name, const glm::vec4 & value);
38 void setParameter(gl::GLenum name, const glm::ivec4 & value);
39 void setParameter(gl::GLenum name, const glm::uvec4 & value);
40
41 gl::GLint getParameteri(gl::GLenum pname) const;
42 gl::GLfloat getParameterf(gl::GLenum pname) const;
43
44 virtual gl::GLenum objectType() const override;
45
46
47protected:
48 Sampler(std::unique_ptr<IDResource> && resource);
49};
50
51
52} // namespace globjects
CRTP for creating objects similar to std::make_unique.
Definition Instantiator.h:22
Superclass of all wrapped OpenGL objects.
Definition Object.h:28
Wraps OpenGL sampler objects.
Definition Sampler.h:23
virtual gl::GLenum objectType() const override
void setParameter(gl::GLenum name, const glm::vec4 &value)
void setParameter(gl::GLenum name, gl::GLenum value)
Sampler(std::unique_ptr< IDResource > &&resource)
void setParameter(gl::GLenum name, gl::GLfloat value)
static std::unique_ptr< Sampler > fromId(gl::GLuint id)
void setParameter(gl::GLenum name, const glm::uvec4 &value)
static void unbind(gl::GLuint unit)
gl::GLint getParameteri(gl::GLenum pname) const
gl::GLfloat getParameterf(gl::GLenum pname) const
void bind(gl::GLuint unit) const
void setParameter(gl::GLenum name, gl::GLint value)
void setParameter(gl::GLenum name, const glm::ivec4 &value)
Contains all the classes that wrap OpenGL functionality.