StevEngine
StevEngine is a customizable C++ game engine.
Loading...
Searching...
No Matches
StevEngine::Visuals::Light Class Referenceabstract

Base class for light components. More...

#include <visuals/Lights.hpp>

Inheritance diagram for StevEngine::Visuals::Light:
StevEngine::Component StevEngine::Visuals::DirectionalLight StevEngine::Visuals::PointLight StevEngine::Visuals::SpotLight

Public Member Functions

virtual void UpdateShader (const Renderer::ShaderProgram &program) const =0
 Update shader uniforms for this light.
 
virtual void ResetShader (const Renderer::ShaderProgram &program) const =0
 Reset shader uniforms for this light.
 
uint32_t GetShaderLightID () const
 Get shader light ID.
 
- Public Member Functions inherited from StevEngine::Component
 Component ()
 Create new component.
 
virtual ~Component ()
 Clean up component resources.
 
GameObjectGetParent () const
 Get parent GameObject.
 
SceneGetScene () const
 Get containing Scene.
 
virtual std::string GetType () const =0
 Get component type.
 
virtual Utilities::Stream Export (Utilities::StreamType stream) const
 Serialize component to a stream.
 
virtual void Start ()
 Initialize component after creation.
 
virtual void Deactivate ()
 Clean up when component is deactivated.
 
virtual void Update (double deltaTime)
 Update component logic.
 
virtual void Draw (const Utilities::Matrix4 &transform)
 Draw component visuals.
 

Public Attributes

Utilities::Vector3 diffuse
 Diffuse light color.
 
Utilities::Vector3 specular
 Specular light color.
 

Protected Member Functions

 Light (uint32_t shaderID, Utilities::Vector3 diffuse, Utilities::Vector3 specular, std::string type)
 
 Light (Utilities::Stream &stream, std::string type)
 

Protected Attributes

const uint32_t shaderLightID
 Light index in shader.
 
- Protected Attributes inherited from StevEngine::Component
std::vector< std::pair< Utilities::ID, std::string > > handlers
 Event handler registrations.
 

Detailed Description

Base class for light components.

Provides common functionality for different types of lights. Handles shader updates and light properties.

Member Function Documentation

◆ GetShaderLightID()

uint32_t StevEngine::Visuals::Light::GetShaderLightID ( ) const
inline

Get shader light ID.

Returns
Light index in shader

◆ ResetShader()

virtual void StevEngine::Visuals::Light::ResetShader ( const Renderer::ShaderProgram & program) const
pure virtual

Reset shader uniforms for this light.

Parameters
programShader program to reset

Implemented in StevEngine::Visuals::DirectionalLight, StevEngine::Visuals::PointLight, and StevEngine::Visuals::SpotLight.

◆ UpdateShader()

virtual void StevEngine::Visuals::Light::UpdateShader ( const Renderer::ShaderProgram & program) const
pure virtual

Update shader uniforms for this light.

Parameters
programShader program to update

Implemented in StevEngine::Visuals::DirectionalLight, StevEngine::Visuals::PointLight, and StevEngine::Visuals::SpotLight.


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