YAGE  1.0
Yet Another Game Engine
IGameObject Class Referenceabstract

A Game Object. All objects that are to be rendered will inherit this class. More...

#include <IGameObject.h>

Inheritance diagram for IGameObject:
Light Model Particle_Container Scene_Container AmbientLight DirectionalLight PointLight SpotLight Mesh

Public Member Functions

virtual ~IGameObject ()
 Destructor that deletes the unique shader program and shadow program belonging to the object. More...
 
virtual void Draw (GLuint shader)=0
 Draws via the given shader. More...
 
virtual void DrawShadow (GLuint shader)=0
 Draw shadows via the given shader. More...
 
virtual void Update ()=0
 Updates this object. More...
 
virtual void Destroy ()=0
 Destroys this object. More...
 
virtual void SetProgram (GLuint shaderName)
 Sets the main shader program corresponding to this object. More...
 
virtual void SetShadowProgram (GLuint shaderName)
 Sets the shadow pass shader program corresponding to this object. More...
 
virtual GLuint GetProgram ()
 Gets the object's main shader program. More...
 
virtual GLuint GetShadowProgram ()
 Gets the object's shadow program. More...
 
virtual void SetTexture (const std::string &textureName, const TextureType &textureType, const GLuint &texture)=0
 Adds a texture to an object. More...
 
virtual const GLuint GetTexture (const std::string &textureName) const =0
 Gets a texture. More...
 

Protected Attributes

GLuint program = 0
 
GLuint shadowProgram = 0
 

Detailed Description

A Game Object. All objects that are to be rendered will inherit this class.

Constructor & Destructor Documentation

IGameObject::~IGameObject ( )
inlinevirtual

Destructor that deletes the unique shader program and shadow program belonging to the object.

Member Function Documentation

void IGameObject::Destroy ( )
pure virtual

Destroys this object.

Implemented in Light, Scene_Container, Model, and Particle_Container.

void IGameObject::Draw ( GLuint  shader)
pure virtual

Draws via the given shader.

Parameters
shaderThe shader.

Implemented in SpotLight, PointLight, AmbientLight, DirectionalLight, Light, Scene_Container, Mesh, and Particle_Container.

void IGameObject::DrawShadow ( GLuint  shader)
pure virtual

Draw shadows via the given shader.

Implemented in DirectionalLight, Light, Scene_Container, Mesh, and Particle_Container.

GLuint IGameObject::GetProgram ( )
inlinevirtual

Gets the object's main shader program.

Returns
The main shader program.
GLuint IGameObject::GetShadowProgram ( )
inlinevirtual

Gets the object's shadow program.

Returns
The shadow program.
const GLuint IGameObject::GetTexture ( const std::string &  textureName) const
pure virtual

Gets a texture.

Parameters
textureNameThe name of the texture.
Returns
The texture.

Implemented in Light, Scene_Container, Model, and Particle_Container.

void IGameObject::SetProgram ( GLuint  shaderName)
inlinevirtual

Sets the main shader program corresponding to this object.

Author
Harry
Date
4/14/2016
Parameters
shaderNameName of the shader.

Reimplemented in Scene_Container, and Model.

void IGameObject::SetShadowProgram ( GLuint  shaderName)
inlinevirtual

Sets the shadow pass shader program corresponding to this object.

Parameters
shaderNameName of the shader.

Reimplemented in Scene_Container, and Model.

void IGameObject::SetTexture ( const std::string &  textureName,
const TextureType textureType,
const GLuint &  texture 
)
pure virtual

Adds a texture to an object.

Parameters
textureNameName of the texture.
textureTypeType of the texture.
textureThe texture id.

Implemented in Light, Scene_Container, Model, and Particle_Container.

void IGameObject::Update ( )
pure virtual

Updates this object.

Implemented in Light, Scene_Container, Mesh, and Particle_Container.

Member Data Documentation

GLuint IGameObject::program = 0
protected
GLuint IGameObject::shadowProgram = 0
protected