NLS Engine  v0.1
The Next Logical Step in game engine design.
 All Classes Namespaces Files Functions Variables Enumerations Enumerator Defines
LightAmbientRenderable.cpp
Go to the documentation of this file.
00001 
00009 #include <d3dx9.h>
00010 #include <windows.h>
00011 
00012 #include "LightAmbientRenderable.h"
00013 
00014 namespace GraphicsCore {
00015   LightAmbientRenderable::LightAmbientRenderable(EntitySPTR owner, ModuleInterface* renderModule) :
00016       RenderableComponent(owner, renderModule) {
00017     this->SetEnableStatus(true);
00018     this->SetAmbientColor(D3DCOLOR_XRGB(255, 255, 255));
00019   }
00020 
00021   LightAmbientRenderable::~LightAmbientRenderable() {
00022   }
00023 
00024   void LightAmbientRenderable::Render(LPDIRECT3DDEVICE9 pd3dDevice) {
00025     if (this->isEnabled) {
00026       pd3dDevice->SetRenderState(D3DRS_AMBIENT, this->ambientColor);
00027     }
00028   }
00029 
00030   D3DXCOLOR LightAmbientRenderable::GetAmbientColor() {
00031     return this->ambientColor;
00032   }
00033 
00034   bool LightAmbientRenderable::SetAmbientColor(D3DXCOLOR color) {
00035     this->ambientColor = color;
00036     return true;
00037   }
00038 
00039   bool LightAmbientRenderable::GetEnableStatus() {
00040     return this->isEnabled;
00041   }
00042 
00043   void LightAmbientRenderable::SetEnableStatus(bool isEnabled) {
00044     this->isEnabled = isEnabled;
00045   }
00046 }
00047