charcoal/OpenGLEngine/Sampler.cpp
elipzer ae7fcc9011 Starting Textured Scene
Want to use seperate textures and samplers for the scene to allow
for more modularization. Currently have created a texture class
and started creating a scene class.
2018-09-15 17:40:49 -04:00

21 lines
396 B
C++

#include "Sampler.h"
namespace charcoal
{
Sampler::Sampler(Wrap wrap_s, Wrap wrap_t, MagFilter magnification_filter, MinFilter minification_filter)
{
glGenSamplers(1, &m_sampler);
glSamplerParameteri(m_sampler, GL_WRAP_S, wrap_s);
}
Sampler::~Sampler()
{
glDeleteSamplers(1, &m_sampler);
}
void Sampler::bind(GLuint texture_unit)
{
glBindSampler(texture_unit, m_sampler);
}
}