mirror of
https://github.com/LostArtefacts/TRX.git
synced 2025-05-13 14:07:08 +03:00
29 lines
357 B
C++
29 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
|