#pragma once #include "stdafx.h" namespace charcoal { class Sampler { public: enum class MinFilter : GLenum { NEAREST = GL_NEAREST, LINEAR = GL_LINEAR, NEAREST_MIPMAP_NEAREST = GL_NEAREST_MIPMAP_NEAREST, LINEAR_MIPMAP_NEAREST = GL_LINEAR_MIPMAP_NEAREST, NEAREST_MIPMAP_LINEAR = GL_NEAREST_MIPMAP_LINEAR, LINEAR_MIPMAP_LINEAR = GL_LINEAR_MIPMAP_LINEAR, }; enum class MagFilter : GLenum { NEAREST = GL_NEAREST, LINEAR = GL_LINEAR, }; enum class Wrap : GLenum { CLAMP_TO_EDGE = GL_CLAMP_TO_EDGE, MIRRORED_REPEAT = GL_MIRRORED_REPEAT, REPEAT = GL_REPEAT, }; /* TODO: GL_TEXTURE_BORDER_COLOR, GL_TEXTURE_MIN_LOD, GL_TEXTURE_MAX_LOD, GL_TEXTURE_LOD_BIAS GL_TEXTURE_COMPARE_MODE, GL_TEXTURE_COMPARE_FUNC, GL_TEXTURE_WRAP_R */ Sampler(Wrap wrap_s, Wrap wrap_t, MagFilter magnification_filter, MinFilter minification_filter); ~Sampler(); void bind(GLuint texture_unit); GLuint get_sampler() const { return m_sampler; } private: GLuint m_sampler = 0; }; }