OpenGLPrakt --> cObject --> cMaterial

class cMaterial
    extends cObject as public

a class for representation of an OpenGL material

This is thought to be the base material class.

It might be derived from it later. (e.g. for Texturing)

Source:
../src/cMaterial.hh:38

Constructors Index

cMaterial
[public] default constructor
cMaterial
[public] constructor with full initialization
~cMaterial
[public] destructor


Variables Index

mColor
[protected] color of material
mOldBackColor
[protected] we later need to restore back color too
mOldBackShininess
[protected]
mOldFrontColor
[protected] we need to restore the material which was active before Activate()
mOldFrontShininess
[protected]
mShininess
[protected] shininess of material


Methods Index

Activate
[protected] activate material
Deactivate
[protected] deactivate material
EndMaterialUse
[public] end using the material's properties
GetDefaultName
[protected]
Init
[public] not used, but if omitted, it might not be overloaded later
StartMaterialUse
[public] start using the material's properties


Constructors

cMaterial

public cMaterial ( const char * name = NULL ) ;

default constructor

Parameters:
name optional name of object

cMaterial

public cMaterial ( const cADSEColor & color = cADSEColor ( ) ,
                   const int shininess = 0 ,
                   const char * name = NULL ) ;

constructor with full initialization

Parameters:
color material's color (cADSEColor object)
shininess how shiny is the surface (0..128)
name optional name of object

cMaterial

public virtual ~ cMaterial ( ) ;

destructor


Variables

mColor

protected cADSEColor mColor

color of material

mOldFrontColor

protected cADSEColor mOldFrontColor

we need to restore the material which was active before Activate()

mOldFrontShininess

protected GLfloat mOldFrontShininess

mOldBackColor

protected cADSEColor mOldBackColor

we later need to restore back color too

mOldBackShininess

protected GLfloat mOldBackShininess

mShininess

protected int mShininess

shininess of material


Methods

Init

public virtual int Init ( ) ;

not used, but if omitted, it might not be overloaded later

StartMaterialUse

public virtual void StartMaterialUse ( ) ;

start using the material's properties

This is only neccessary to embed a cMaterial into a cVisibleObject. We cannot use Activate() there since it will call cObject::Activate() which in turn calls Deactivate() so the material settings are undone before the object gets drawn.

EndMaterialUse

public virtual void EndMaterialUse ( ) ;

end using the material's properties

GetDefaultName

protected virtual const char * GetDefaultName ( ) const ;

Activate

protected virtual void Activate ( ) ;

activate material

Deactivate

protected virtual void Deactivate ( ) ;

deactivate material


This documentation was generated automatically by the ccdoc tool (version 0.7a).
Click here to submit a bug report or feature request.

Click here to return to the top of the page.