Brenta Engine 1.2
Loading...
Searching...
No Matches
brenta::Texture Class Reference
Inheritance diagram for brenta::Texture:
brenta::Cubemap

Data Structures

class  Builder
 
struct  Config
 
struct  Properties
 

Public Types

enum  Type { None , Diffuse , Specular }
 
enum  Target {
  Texture1D = GL_TEXTURE_1D , Texture2D = GL_TEXTURE_2D , Texture3D = GL_TEXTURE_3D , Texture1DArray = GL_TEXTURE_1D_ARRAY ,
  Texture2DArray = GL_TEXTURE_2D_ARRAY , TextureRectangle = GL_TEXTURE_RECTANGLE , TextureCubeMap = GL_TEXTURE_CUBE_MAP , TextureCubeMapArray = GL_TEXTURE_CUBE_MAP_ARRAY ,
  TextureBuffer = GL_TEXTURE_BUFFER , Texture2DMultisample = GL_TEXTURE_2D_MULTISAMPLE , Texture2DMultisampleArray = GL_TEXTURE_2D_MULTISAMPLE_ARRAY
}
 
enum  Wrapping { Repeat = GL_REPEAT , MirroredRepeat = GL_MIRRORED_REPEAT , ClampToEdge = GL_CLAMP_TO_EDGE , ClampToBorder = GL_CLAMP_TO_BORDER }
 
enum  Filtering {
  Nearest = GL_NEAREST , Linear = GL_LINEAR , NearestMipmapNearest = GL_NEAREST_MIPMAP_NEAREST , NearestMipmapLinear = GL_NEAREST_MIPMAP_LINEAR ,
  LinearMipmapNearest = GL_LINEAR_MIPMAP_NEAREST , LinearMipmapLinear = GL_LINEAR_MIPMAP_LINEAR
}
 
using Id = unsigned int
 

Public Member Functions

 Texture (const Config &conf)
 
 Texture (const Texture &)=delete
 
Textureoperator= (const Texture &)=delete
 
 Texture (Texture &&other) noexcept
 
Textureoperator= (Texture &&other) noexcept
 
Texture::Id get_id () const
 
std::filesystem::path get_path () const
 
Texture::Type get_type () const
 
Texture::Target get_target () const
 
Texture::Propertiesget_properties ()
 
void bind ()
 

Static Public Member Functions

static void active_texture (int texture)
 
static Texture::Id load (const std::filesystem::path &path, int &loaded_memory, bool flip=true)
 
static Texture::Id load_solid_color (Color color)
 
static void bind_id (Texture::Target target, Texture::Id id)
 
static void bind_id (Texture::Target target, Texture::Id id, const Texture::Properties &properties)
 

Data Fields

int memory = 0
 

Static Public Attributes

static int tot_memory = 0
 

Static Protected Member Functions

static int read_image (const std::filesystem::path &path, bool flip)
 

Protected Attributes

Texture::Id id = 0
 
Texture::Type type
 
Texture::Target target
 
std::filesystem::path path
 
Texture::Properties properties
 

Detailed Description

Definition at line 30 of file texture.hpp.

Member Typedef Documentation

◆ Id

using brenta::Texture::Id = unsigned int

Definition at line 34 of file texture.hpp.

Member Enumeration Documentation

◆ Filtering

enum brenta::Texture::Filtering

Definition at line 73 of file texture.hpp.

◆ Target

enum brenta::Texture::Target

Definition at line 43 of file texture.hpp.

◆ Type

enum brenta::Texture::Type

Definition at line 36 of file texture.hpp.

◆ Wrapping

enum brenta::Texture::Wrapping

Definition at line 58 of file texture.hpp.

Constructor & Destructor Documentation

◆ Texture() [1/3]

brenta::Texture::Texture ( )
inline

Definition at line 149 of file texture.hpp.

◆ Texture() [2/3]

Texture::Texture ( const Config conf)

Definition at line 20 of file texture.cpp.

◆ Texture() [3/3]

brenta::Texture::Texture ( Texture &&  other)
inlinenoexcept

Definition at line 155 of file texture.hpp.

◆ ~Texture()

Texture::~Texture ( )

Definition at line 60 of file texture.cpp.

Member Function Documentation

◆ active_texture()

void Texture::active_texture ( int  texture)
static

Definition at line 101 of file texture.cpp.

◆ bind()

void Texture::bind ( )

Definition at line 189 of file texture.cpp.

◆ bind_id() [1/2]

void Texture::bind_id ( Texture::Target  target,
Texture::Id  id 
)
static

Definition at line 159 of file texture.cpp.

◆ bind_id() [2/2]

void Texture::bind_id ( Texture::Target  target,
Texture::Id  id,
const Texture::Properties properties 
)
static

Definition at line 164 of file texture.cpp.

◆ get_id()

Texture::Id Texture::get_id ( ) const

Definition at line 75 of file texture.cpp.

◆ get_path()

std::filesystem::path Texture::get_path ( ) const

Definition at line 80 of file texture.cpp.

◆ get_properties()

Texture::Properties & Texture::get_properties ( )

Definition at line 96 of file texture.cpp.

◆ get_target()

Texture::Target Texture::get_target ( ) const

Definition at line 90 of file texture.cpp.

◆ get_type()

Texture::Type Texture::get_type ( ) const

Definition at line 85 of file texture.cpp.

◆ load()

unsigned int Texture::load ( const std::filesystem::path &  path,
int &  loaded_memory,
bool  flip = true 
)
static

Definition at line 139 of file texture.cpp.

◆ load_solid_color()

unsigned int Texture::load_solid_color ( Color  color)
static

Definition at line 108 of file texture.cpp.

◆ operator=()

Texture & brenta::Texture::operator= ( Texture &&  other)
inlinenoexcept

Definition at line 168 of file texture.hpp.

◆ read_image()

int Texture::read_image ( const std::filesystem::path &  path,
bool  flip 
)
staticprotected

Definition at line 195 of file texture.cpp.

Field Documentation

◆ id

Texture::Id brenta::Texture::id = 0
protected

Definition at line 194 of file texture.hpp.

◆ memory

int brenta::Texture::memory = 0

Definition at line 146 of file texture.hpp.

◆ path

std::filesystem::path brenta::Texture::path
protected

Definition at line 197 of file texture.hpp.

◆ properties

Texture::Properties brenta::Texture::properties
protected

Definition at line 198 of file texture.hpp.

◆ target

Texture::Target brenta::Texture::target
protected

Definition at line 196 of file texture.hpp.

◆ tot_memory

int Texture::tot_memory = 0
static

Definition at line 147 of file texture.hpp.

◆ type

Texture::Type brenta::Texture::type
protected

Definition at line 195 of file texture.hpp.


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