GLMaterial

A class that wraps all of the parameters for specifying material properties in an OpenGL context.

Project

GLCore

Include

GLMaterial.h

Summary
A class that wraps all of the parameters for specifying material properties in an OpenGL context.
The default GLMaterial constructor.
The wxColour GLMaterial constructor.
The different kinds of properties that can be set.
Sets the color values of a certain property of the material.
Sets both the ambient and diffuse properties of the material.
Multiplies the specified property by a certain value.
Calls OpenGL directly and sets the current material properties to this material.
The ambient color.
The diffuse color.
The emissive color.
The specular color.
The shininess value.

Public

Summary
The default GLMaterial constructor.
The wxColour GLMaterial constructor.
The different kinds of properties that can be set.
Sets the color values of a certain property of the material.
Sets both the ambient and diffuse properties of the material.
Multiplies the specified property by a certain value.
Calls OpenGL directly and sets the current material properties to this material.

Constructors

GLMaterial

GLMaterial()

The default GLMaterial constructor.

GLMaterial

GLMaterial(wxColour color)

The wxColour GLMaterial constructor.

Parameters

colorThe color the material should be initialized to.

Enumerations

Property

The different kinds of properties that can be set.  A user can specify the following properties for the material: Ambient, Diffuse, Emissive, Specular.

Functions

SetProperty

void SetProperty(Property property,
wxColour color)

Sets the color values of a certain property of the material.

Parameters

propertyThe material property being set.
colorThe value the ambient color should be set to.

SetMaterial

void SetMaterial(wxColour color)

Sets both the ambient and diffuse properties of the material.

Parameters

colorThe value the ambient and diffuse colors should be set to.

MultProperty

void MultProperty(Property property,
GLfloat val)

Multiplies the specified property by a certain value.  Useful for dimming or brightening a material.

Parameters

propertyThe material property being multiplied.
valThe value by which the property should be multipled.

UseMaterial

void UseMaterial() const

Calls OpenGL directly and sets the current material properties to this material.

Private

Summary
The ambient color.
The diffuse color.
The emissive color.
The specular color.
The shininess value.

Variables

mAmbient

GLColor mAmbient

The ambient color.

mDiffuse

GLColor mDiffuse

The diffuse color.

mEmissive

GLColor mEmissive

The emissive color.

mSpecular

GLColor mSpecular

The specular color.

mShininess

GLfloat mShininess

The shininess value.

GLMaterial()
The default GLMaterial constructor.
void SetProperty(Property property,
wxColour color)
Sets the color values of a certain property of the material.
void SetMaterial(wxColour color)
Sets both the ambient and diffuse properties of the material.
void MultProperty(Property property,
GLfloat val)
Multiplies the specified property by a certain value.
void UseMaterial() const
Calls OpenGL directly and sets the current material properties to this material.
GLColor mAmbient
The ambient color.
GLColor mDiffuse
The diffuse color.
GLColor mEmissive
The emissive color.
GLColor mSpecular
The specular color.
GLfloat mShininess
The shininess value.
GLCore provides the underlying window classes and tools needed to create and use an OpenGL window with a camera, lighting, selection, mouse/keyboard handling, and IDrawObject rendering.