aboutsummaryrefslogtreecommitdiff
path: root/Source/Fog.cpp
diff options
context:
space:
mode:
authoricculus <icculus@5198baeb-e213-0410-be47-fc2ff85ca46f>2003-01-02 21:06:00 +0000
committericculus <icculus@5198baeb-e213-0410-be47-fc2ff85ca46f>2003-01-02 21:06:00 +0000
commite17acec1c9bec3a26d97ca2873bb77bdcb48665e (patch)
tree26b14b6cedcb70df651c23dddbf0981970d0bd4d /Source/Fog.cpp
parent59ca62d601e30b5467f8ecd2cb7d517bc682fc12 (diff)
downloadblackshades-e17acec1c9bec3a26d97ca2873bb77bdcb48665e.tar.gz
Initial revision
git-svn-id: svn://svn.icculus.org/blackshades/trunk@2 5198baeb-e213-0410-be47-fc2ff85ca46f
Diffstat (limited to 'Source/Fog.cpp')
-rw-r--r--Source/Fog.cpp53
1 files changed, 53 insertions, 0 deletions
diff --git a/Source/Fog.cpp b/Source/Fog.cpp
new file mode 100644
index 0000000..af30dfa
--- /dev/null
+++ b/Source/Fog.cpp
@@ -0,0 +1,53 @@
+/**> HEADER FILES <**/
+#include "Fog.h"
+
+void Fog::SetFog(float colorR, float colorG, float colorB, float fStart, float fEnd, float Density)
+{
+ fogColor[0]=colorR;
+ fogColor[1]=colorG;
+ fogColor[2]=colorB;
+ fogColor[3]=1;
+ fogStart=fStart;
+ fogEnd=fEnd;
+ fogDensity=Density;
+ fogMode=GL_LINEAR;
+
+ glFogi(GL_FOG_MODE,fogMode);
+ glFogfv(GL_FOG_COLOR,fogColor);
+ glFogf(GL_FOG_DENSITY,fogDensity);
+ glFogi(GL_FOG_HINT,GL_DONT_CARE);
+ glFogi(GL_FOG_START,fogStart);
+ glFogi(GL_FOG_END,fogEnd);
+
+ glEnable(GL_FOG);
+}
+
+void Fog::TempFog(float colorR, float colorG, float colorB)
+{
+ GLfloat tempfogColor[4];
+ tempfogColor[0]=colorR;
+ tempfogColor[1]=colorG;
+ tempfogColor[2]=colorB;
+ tempfogColor[3]=1;
+
+ glFogi(GL_FOG_MODE,fogMode);
+ glFogfv(GL_FOG_COLOR,tempfogColor);
+ glFogf(GL_FOG_DENSITY,fogDensity);
+ glFogi(GL_FOG_HINT,GL_DONT_CARE);
+ glFogi(GL_FOG_START,fogStart);
+ glFogi(GL_FOG_END,fogEnd);
+
+ glEnable(GL_FOG);
+}
+
+void Fog::ResetFog()
+{
+ glFogi(GL_FOG_MODE,fogMode);
+ glFogfv(GL_FOG_COLOR,fogColor);
+ glFogf(GL_FOG_DENSITY,fogDensity);
+ glFogi(GL_FOG_HINT,GL_DONT_CARE);
+ glFogi(GL_FOG_START,fogStart);
+ glFogi(GL_FOG_END,fogEnd);
+
+ glEnable(GL_FOG);
+} \ No newline at end of file