ae7fcc9011
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.
21 lines
396 B
C++
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);
|
|
}
|
|
} |