lmgl 1.0.0
A lightweight OpenGL graphics engine library written in C++
Loading...
Searching...
No Matches
lmgl::scene::Cubemap Class Reference

Represents a cubemap texture for skybox rendering. More...

#include <skybox.hpp>

Public Member Functions

 ~Cubemap ()
 Destructor for the Cubemap class.
 
void bind (unsigned int slot=0) const
 Binds the cubemap texture to a specified texture slot.
 
unsigned int get_id () const
 Retrieves the OpenGL texture ID of the cubemap.
 

Static Public Member Functions

static std::shared_ptr< Cubemapfrom_faces (const std::vector< std::string > &faces)
 Creates a Cubemap from six face images.
 
static std::shared_ptr< Cubemapfrom_equirectangular (const std::string &path)
 Creates a Cubemap from an equirectangular image.
 

Detailed Description

Represents a cubemap texture for skybox rendering.

The Cubemap class provides functionality to load cubemaps from either six individual face images or a single equirectangular image. It manages the OpenGL texture ID and provides methods to bind the cubemap for rendering.

Constructor & Destructor Documentation

◆ ~Cubemap()

lmgl::scene::Cubemap::~Cubemap ( )

Destructor for the Cubemap class.

Cleans up the OpenGL texture associated with the cubemap.

Member Function Documentation

◆ bind()

void lmgl::scene::Cubemap::bind ( unsigned int slot = 0) const

Binds the cubemap texture to a specified texture slot.

Binds the cubemap texture to the given texture slot for use in rendering.

Parameters
slotThe texture slot to bind the cubemap to (default is 0).

◆ from_equirectangular()

std::shared_ptr< Cubemap > lmgl::scene::Cubemap::from_equirectangular ( const std::string & path)
static

Creates a Cubemap from an equirectangular image.

Creates a Cubemap object by loading a single equirectangular image and converting it into a cubemap texture.

Parameters
pathThe file path to the equirectangular image.
Returns
A shared pointer to the created Cubemap object.

◆ from_faces()

std::shared_ptr< Cubemap > lmgl::scene::Cubemap::from_faces ( const std::vector< std::string > & faces)
static

Creates a Cubemap from six face images.

Creates a Cubemap object by loading six images corresponding to the faces of the cubemap. The images should be provided in the following order: +X, -X, +Y, -Y, +Z, -Z.

Parameters
facesA vector of file paths to the six face images in the order: +X, -X, +Y, -Y, +Z, -Z.
Returns
A shared pointer to the created Cubemap object.

◆ get_id()

unsigned int lmgl::scene::Cubemap::get_id ( ) const
inline

Retrieves the OpenGL texture ID of the cubemap.

Returns
The OpenGL texture ID.

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