Loading...
Searching...
No Matches
hellfire::Texture Class Reference

#include <Texture.h>

Collaboration diagram for hellfire::Texture:

Public Member Functions

 Texture (const std::string &path, TextureType type=TextureType::DIFFUSE)
 
 Texture (const std::string &path, TextureType type, const TextureSettings &settings)
 
 Texture (const Texture &)=delete
 
Textureoperator= (const Texture &)=delete
 
 Texture (Texture &&other) noexcept
 
Textureoperator= (Texture &&other) noexcept
 
 ~Texture ()
 
void bind (unsigned int slot=0) const
 
void unbind () const
 
TextureType get_type () const
 
uint32_t get_id ()
 
const std::string & get_path ()
 
int get_slot ()
 
void set_slot (int slot)
 
void set_wrap_mode (TextureWrap wrap_s, TextureWrap wrap_t)
 
void set_filter_mode (TextureFilter min_filter, TextureFilter mag_filter)
 
bool is_valid () const
 

Static Public Member Functions

static std::string type_to_string (TextureType type)
 
static std::string get_uniform_name (TextureType type)
 

Public Attributes

int width
 
int height
 
int nr_channels
 

Private Member Functions

void load_texture_data ()
 
GLint get_gl_wrap_mode (TextureWrap wrap) const
 
GLint get_gl_filter_mode (TextureFilter filter) const
 

Private Attributes

TextureType type_
 
std::string path_
 
uint32_t texture_id_
 
TextureSettings settings_
 
int slot_ = 0
 
bool is_valid_
 

Detailed Description

Definition at line 91 of file Texture.h.

Constructor & Destructor Documentation

◆ Texture() [1/4]

hellfire::Texture::Texture ( const std::string &  path,
TextureType  type = TextureType::DIFFUSE 
)

Definition at line 40 of file Texture.cpp.

◆ Texture() [2/4]

hellfire::Texture::Texture ( const std::string &  path,
TextureType  type,
const TextureSettings settings 
)

Definition at line 44 of file Texture.cpp.

◆ Texture() [3/4]

hellfire::Texture::Texture ( const Texture )
delete

◆ Texture() [4/4]

hellfire::Texture::Texture ( Texture &&  other)
noexcept

Definition at line 49 of file Texture.cpp.

◆ ~Texture()

hellfire::Texture::~Texture ( )

Definition at line 77 of file Texture.cpp.

Member Function Documentation

◆ bind()

void hellfire::Texture::bind ( unsigned int  slot = 0) const

Definition at line 202 of file Texture.cpp.

◆ get_gl_filter_mode()

GLint hellfire::Texture::get_gl_filter_mode ( TextureFilter  filter) const
private

Definition at line 251 of file Texture.cpp.

◆ get_gl_wrap_mode()

GLint hellfire::Texture::get_gl_wrap_mode ( TextureWrap  wrap) const
private

Definition at line 241 of file Texture.cpp.

◆ get_id()

uint32_t hellfire::Texture::get_id ( )
inline

Definition at line 114 of file Texture.h.

◆ get_path()

const std::string & hellfire::Texture::get_path ( )
inline

Definition at line 115 of file Texture.h.

◆ get_slot()

int hellfire::Texture::get_slot ( )
inline

Definition at line 117 of file Texture.h.

◆ get_type()

TextureType hellfire::Texture::get_type ( ) const
inline

Definition at line 113 of file Texture.h.

◆ get_uniform_name()

std::string hellfire::Texture::get_uniform_name ( TextureType  type)
static

Definition at line 226 of file Texture.cpp.

◆ is_valid()

bool hellfire::Texture::is_valid ( ) const

Definition at line 198 of file Texture.cpp.

◆ load_texture_data()

void hellfire::Texture::load_texture_data ( )
private

Definition at line 83 of file Texture.cpp.

◆ operator=() [1/2]

Texture & hellfire::Texture::operator= ( const Texture )
delete

◆ operator=() [2/2]

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

Definition at line 56 of file Texture.cpp.

◆ set_filter_mode()

void hellfire::Texture::set_filter_mode ( TextureFilter  min_filter,
TextureFilter  mag_filter 
)

◆ set_slot()

void hellfire::Texture::set_slot ( int  slot)
inline

Definition at line 118 of file Texture.h.

◆ set_wrap_mode()

void hellfire::Texture::set_wrap_mode ( TextureWrap  wrap_s,
TextureWrap  wrap_t 
)

◆ type_to_string()

std::string hellfire::Texture::type_to_string ( TextureType  type)
static

Definition at line 211 of file Texture.cpp.

◆ unbind()

void hellfire::Texture::unbind ( ) const

Definition at line 207 of file Texture.cpp.

Member Data Documentation

◆ height

int hellfire::Texture::height

Definition at line 93 of file Texture.h.

◆ is_valid_

bool hellfire::Texture::is_valid_
private

Definition at line 139 of file Texture.h.

◆ nr_channels

int hellfire::Texture::nr_channels

Definition at line 93 of file Texture.h.

◆ path_

std::string hellfire::Texture::path_
private

Definition at line 135 of file Texture.h.

◆ settings_

TextureSettings hellfire::Texture::settings_
private

Definition at line 137 of file Texture.h.

◆ slot_

int hellfire::Texture::slot_ = 0
private

Definition at line 138 of file Texture.h.

◆ texture_id_

uint32_t hellfire::Texture::texture_id_
private

Definition at line 136 of file Texture.h.

◆ type_

TextureType hellfire::Texture::type_
private

Definition at line 134 of file Texture.h.

◆ width

int hellfire::Texture::width

Definition at line 93 of file Texture.h.


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