2018-09-15 21:40:49 +00:00
|
|
|
#pragma once
|
|
|
|
|
|
|
|
#include "stdafx.h"
|
|
|
|
|
|
|
|
namespace charcoal
|
|
|
|
{
|
|
|
|
class Sampler
|
|
|
|
{
|
|
|
|
public:
|
2018-09-16 00:43:29 +00:00
|
|
|
enum class MinFilter : GLenum
|
2018-09-15 21:40:49 +00:00
|
|
|
{
|
|
|
|
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,
|
|
|
|
};
|
|
|
|
|
2018-09-16 00:43:29 +00:00
|
|
|
enum class MagFilter : GLenum
|
2018-09-15 21:40:49 +00:00
|
|
|
{
|
|
|
|
NEAREST = GL_NEAREST,
|
|
|
|
LINEAR = GL_LINEAR,
|
|
|
|
};
|
|
|
|
|
2018-09-16 00:43:29 +00:00
|
|
|
enum class Wrap : GLenum
|
2018-09-15 21:40:49 +00:00
|
|
|
{
|
|
|
|
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);
|
|
|
|
|
2018-09-16 00:43:29 +00:00
|
|
|
GLuint get_sampler() const { return m_sampler; }
|
|
|
|
|
2018-09-15 21:40:49 +00:00
|
|
|
private:
|
|
|
|
GLuint m_sampler = 0;
|
|
|
|
};
|
|
|
|
}
|