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

Represents a skybox in a 3D scene. More...

#include <skybox.hpp>

Public Member Functions

 Skybox (std::shared_ptr< Cubemap > cubemap, const std::string &shader_path="shaders/skybox.glsl")
 Constructs a Skybox with the given cubemap and shader.
 
 ~Skybox ()
 Destructor for the Skybox class.
 
void render (std::shared_ptr< Camera > camera)
 Renders the skybox using the specified camera.
 
void set_cubemap (std::shared_ptr< Cubemap > cubemap)
 Sets the cubemap texture for the skybox.
 
std::shared_ptr< Cubemapget_cubemap () const
 Retrieves the cubemap texture used by the skybox.
 
void set_exposure (float exposure)
 Sets the exposure level for the skybox rendering.
 
float get_exposure () const
 Retrieves the exposure level for the skybox rendering.
 
std::shared_ptr< renderer::Shaderget_shader () const
 Retrieves the shader used for rendering the skybox.
 

Detailed Description

Represents a skybox in a 3D scene.

The Skybox class manages the rendering of a skybox using a cubemap texture. It provides methods to render the skybox with a specified camera and shader.

Constructor & Destructor Documentation

◆ Skybox()

lmgl::scene::Skybox::Skybox ( std::shared_ptr< Cubemap > cubemap,
const std::string & shader_path = "shaders/skybox.glsl" )

Constructs a Skybox with the given cubemap and shader.

Creates a Skybox object using the provided Cubemap and shader file path. If no shader path is provided, a default skybox shader is used.

Parameters
cubemapA shared pointer to the Cubemap object to be used for the skybox.
shader_pathThe file path to the shader used for rendering the skybox (default is "shaders/skybox.glsl").

Member Function Documentation

◆ get_cubemap()

std::shared_ptr< Cubemap > lmgl::scene::Skybox::get_cubemap ( ) const
inline

Retrieves the cubemap texture used by the skybox.

Returns
A shared pointer to the Cubemap object used for the skybox.

◆ get_exposure()

float lmgl::scene::Skybox::get_exposure ( ) const
inline

Retrieves the exposure level for the skybox rendering.

Returns
The current exposure level.

◆ get_shader()

std::shared_ptr< renderer::Shader > lmgl::scene::Skybox::get_shader ( ) const
inline

Retrieves the shader used for rendering the skybox.

Returns
A shared pointer to the Shader object used for the skybox.

◆ render()

void lmgl::scene::Skybox::render ( std::shared_ptr< Camera > camera)

Renders the skybox using the specified camera.

Renders the skybox by setting up the appropriate shader uniforms and drawing the cube geometry.

Parameters
cameraA shared pointer to the Camera object used for rendering.

◆ set_cubemap()

void lmgl::scene::Skybox::set_cubemap ( std::shared_ptr< Cubemap > cubemap)
inline

Sets the cubemap texture for the skybox.

Sets the Cubemap object to be used for rendering the skybox.

Parameters
cubemapA shared pointer to the Cubemap object to be used for the skybox.

◆ set_exposure()

void lmgl::scene::Skybox::set_exposure ( float exposure)
inline

Sets the exposure level for the skybox rendering.

Parameters
exposureThe exposure level to set.

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