tgLighting.cpp
Go to the documentation of this file.
00001 
00002 #include <blort/TomGine/tgLighting.h>
00003 
00004 using namespace TomGine;
00005 
00006 tgLight::tgLight(){
00007         ambient  = vec4(0.0, 0.0, 0.0, 1.0);
00008         diffuse  = vec4(1.0, 1.0, 1.0, 1.0);
00009         specular = vec4(1.0, 1.0, 1.0, 1.0);
00010         position = vec4(0.0, 0.0, 1.0, 0.0);
00011 }
00012 
00013 void tgLighting::ApplyLight(tgLight light, int index){
00014         glLightfv(GL_LIGHT0+index, GL_AMBIENT, light.ambient);
00015         glLightfv(GL_LIGHT0+index, GL_DIFFUSE, light.diffuse);
00016         glLightfv(GL_LIGHT0+index, GL_SPECULAR, light.specular);
00017         glLightfv(GL_LIGHT0+index, GL_POSITION, light.position);
00018         glEnable(GL_LIGHT0+index);
00019 }
00020 
00021 void tgLighting::Activate(){
00022         glEnable(GL_LIGHTING);
00023 }
00024 
00025 void tgLighting::Deactivate(){
00026         glDisable(GL_LIGHTING);
00027 }
00028 
00029 


blort
Author(s): Michael Zillich, Thomas Mörwald, Johann Prankl, Andreas Richtsfeld, Bence Magyar (ROS version)
autogenerated on Thu Jan 2 2014 11:38:26