PROTO::KLUDGE  0.1
Quick prototyping library for games using SDL and OpenGL.
pk::DiffuseLight Class Reference

Class for creating an OpenGL diffuse light. More...

#include <DiffuseLight.hpp>

Collaboration diagram for pk::DiffuseLight:
Collaboration graph

Public Member Functions

 DiffuseLight ()
 Default constructor - this is probably not the constructor you want to use - see below. More...
 
 DiffuseLight (glm::vec4 color, GLfloat ambientIntensity, GLfloat x, GLfloat y, GLfloat z, GLfloat diffuseIntensity)
 Construct an OpenGL diffuse light source from parameters for ambient and diffuse lights. More...
 
virtual ~DiffuseLight ()
 
void update (GLuint ambientIntensityLocation, GLuint ambientColorLocation, GLuint diffuseIntensityLocation, GLuint directionLocation)
 Use an OpenGL diffuse light source. More...
 

Private Attributes

glm::vec4 m_color
 Color of the ambient lighting. More...
 
GLfloat m_ambientIntensity
 Intensity value for the ambient lighting. More...
 
glm::vec3 m_direction
 The direction that the light points. More...
 
GLfloat m_diffuseIntensity
 Intensity value for the diffuse lighting. More...
 

Detailed Description

Class for creating an OpenGL diffuse light.

Constructor & Destructor Documentation

◆ DiffuseLight() [1/2]

pk::DiffuseLight::DiffuseLight ( )
inline

Default constructor - this is probably not the constructor you want to use - see below.

◆ DiffuseLight() [2/2]

pk::DiffuseLight::DiffuseLight ( glm::vec4  color,
GLfloat  ambientIntensity,
GLfloat  x,
GLfloat  y,
GLfloat  z,
GLfloat  diffuseIntensity 
)

Construct an OpenGL diffuse light source from parameters for ambient and diffuse lights.

Parameters
glm::vec4color - the color of the ambient light.
GLfloatambientIntensity - the value determining the intensity of the ambient light.
GLfloatx - the direction of the light on the x-axis.
GLfloaty - the direction of the light on the y-axis.
GLfloatz - the direction of the light on the z-axis.
GLfloatdiffuseIntensity - the value determining the intensity of the diffuse light.

◆ ~DiffuseLight()

virtual pk::DiffuseLight::~DiffuseLight ( )
virtual

Member Function Documentation

◆ update()

void pk::DiffuseLight::update ( GLuint  ambientIntensityLocation,
GLuint  ambientColorLocation,
GLuint  diffuseIntensityLocation,
GLuint  directionLocation 
)

Use an OpenGL diffuse light source.

Parameters
GLuintambientIntensityLocation - a value corresponding to a memory location for ambient intensity.
GLuintambientColorLocation - a value corresponding to a memory location for ambient color.
GLuintdiffuseIntensityLocation - a value corresponding to a memory location for diffuse intensity.
GLuintdirectionLocation - a value corresponding to a memory location for the light's direction.

Member Data Documentation

◆ m_ambientIntensity

GLfloat pk::DiffuseLight::m_ambientIntensity
private

Intensity value for the ambient lighting.

◆ m_color

glm::vec4 pk::DiffuseLight::m_color
private

Color of the ambient lighting.

◆ m_diffuseIntensity

GLfloat pk::DiffuseLight::m_diffuseIntensity
private

Intensity value for the diffuse lighting.

◆ m_direction

glm::vec3 pk::DiffuseLight::m_direction
private

The direction that the light points.


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