|
lmgl 1.0.0
A lightweight OpenGL graphics engine library written in C++
|
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< Cubemap > | from_faces (const std::vector< std::string > &faces) |
| Creates a Cubemap from six face images. | |
| static std::shared_ptr< Cubemap > | from_equirectangular (const std::string &path) |
| Creates a Cubemap from an equirectangular image. | |
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.
| lmgl::scene::Cubemap::~Cubemap | ( | ) |
Destructor for the Cubemap class.
Cleans up the OpenGL texture associated with the cubemap.
| 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.
| slot | The texture slot to bind the cubemap to (default is 0). |
|
static |
|
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.
| faces | A vector of file paths to the six face images in the order: +X, -X, +Y, -Y, +Z, -Z. |
|
inline |
Retrieves the OpenGL texture ID of the cubemap.