TRX/lib/glrage_gl/Texture.cpp
2021-11-21 22:29:01 +01:00

28 lines
357 B
C++

#include "Texture.hpp"
namespace glrage {
namespace gl {
Texture::Texture(GLenum target)
: m_target(target)
{
glGenTextures(1, &m_id);
}
Texture::~Texture()
{
glDeleteTextures(1, &m_id);
}
void Texture::bind()
{
glBindTexture(m_target, m_id);
}
GLenum Texture::target()
{
return m_target;
}
} // namespace gl
} // namespace glrage