Shkyera Engine
Easy to use, game engine for Python
Loading...
Searching...
No Matches
shkyera::Texture Class Reference

#include <Texture.hpp>

Public Member Functions

 Texture (GLenum minFilter=GL_LINEAR, GLenum magFilter=GL_LINEAR, GLenum wrapS=GL_CLAMP_TO_EDGE, GLenum wrapT=GL_CLAMP_TO_EDGE)
 
 Texture (const std::filesystem::path &path)
 
 ~Texture ()
 
 Texture (const Texture &other)=delete
 
Textureoperator= (const Texture &other)=delete
 
 Texture (Texture &&other) noexcept
 
Textureoperator= (Texture &&other) noexcept
 
void bind () const
 
void unbind () const
 
bool loadImage (std::shared_ptr< Image > imageAsset)
 
void setData (GLenum internalFormat, uint32_t width, uint32_t height, GLenum format, GLenum type, const void *data=nullptr)
 
void activate (GLenum textureUnit) const
 
GLuint getID () const
 
voidgetImguiTextureID () const
 
glm::vec2 getSize () const
 

Private Member Functions

 Texture (std::shared_ptr< Image > image)
 
void generateTexture (GLenum minFilter=GL_LINEAR, GLenum magFilter=GL_LINEAR, GLenum wrapS=GL_CLAMP_TO_EDGE, GLenum wrapT=GL_CLAMP_TO_EDGE)
 

Private Attributes

GLuint _textureID
 
glm::vec2 _size {}
 

Constructor & Destructor Documentation

◆ Texture() [1/5]

shkyera::Texture::Texture ( GLenum  minFilter = GL_LINEAR,
GLenum  magFilter = GL_LINEAR,
GLenum  wrapS = GL_CLAMP_TO_EDGE,
GLenum  wrapT = GL_CLAMP_TO_EDGE 
)

◆ Texture() [2/5]

shkyera::Texture::Texture ( const std::filesystem::path &  path)

◆ ~Texture()

shkyera::Texture::~Texture ( )

◆ Texture() [3/5]

shkyera::Texture::Texture ( const Texture other)
delete

◆ Texture() [4/5]

shkyera::Texture::Texture ( Texture &&  other)
noexcept

◆ Texture() [5/5]

shkyera::Texture::Texture ( std::shared_ptr< Image image)
private

Member Function Documentation

◆ activate()

void shkyera::Texture::activate ( GLenum  textureUnit) const

◆ bind()

void shkyera::Texture::bind ( ) const

◆ generateTexture()

void shkyera::Texture::generateTexture ( GLenum  minFilter = GL_LINEAR,
GLenum  magFilter = GL_LINEAR,
GLenum  wrapS = GL_CLAMP_TO_EDGE,
GLenum  wrapT = GL_CLAMP_TO_EDGE 
)
private

◆ getID()

GLuint shkyera::Texture::getID ( ) const
inline

◆ getImguiTextureID()

void * shkyera::Texture::getImguiTextureID ( ) const
inline

◆ getSize()

glm::vec2 shkyera::Texture::getSize ( ) const

◆ loadImage()

bool shkyera::Texture::loadImage ( std::shared_ptr< Image imageAsset)

◆ operator=() [1/2]

Texture & shkyera::Texture::operator= ( const Texture other)
delete

◆ operator=() [2/2]

Texture & shkyera::Texture::operator= ( Texture &&  other)
noexcept

◆ setData()

void shkyera::Texture::setData ( GLenum  internalFormat,
uint32_t  width,
uint32_t  height,
GLenum  format,
GLenum  type,
const void data = nullptr 
)

◆ unbind()

void shkyera::Texture::unbind ( ) const

Member Data Documentation

◆ _size

glm::vec2 shkyera::Texture::_size {}
private

◆ _textureID

GLuint shkyera::Texture::_textureID
private

The documentation for this class was generated from the following files: