]> git.mxchange.org Git - simgear.git/commitdiff
Erik Hofman:
authorcurt <curt>
Wed, 18 Sep 2002 19:41:52 +0000 (19:41 +0000)
committercurt <curt>
Wed, 18 Sep 2002 19:41:52 +0000 (19:41 +0000)
This patch fixes and STL problem, and adds (compile time) support for
architextures that don't support multitexturing.

simgear/scene/sky/clouds3d/SkyTextureState.cpp
simgear/scene/sky/clouds3d/camera.cpp

index f8a0d1ed8a854a7039d9eb279f46569a703023df..5844ff7d823b0d92f1f2e707a8e1d5b47dd37686 100644 (file)
@@ -1,3 +1,4 @@
+
 //------------------------------------------------------------------------------
 // File : SkyTextureState.cpp
 //------------------------------------------------------------------------------
@@ -42,11 +43,13 @@ SkyTextureState::SkyTextureState()
   if (0 == s_iNumTextureUnits)
   {
     int iNumTextureUnits = 0;
+#ifdef GL_ARB_multitexture
     glGetIntegerv(GL_MAX_TEXTURE_UNITS_ARB, &iNumTextureUnits);
     if (iNumTextureUnits > 0)
       s_iNumTextureUnits = iNumTextureUnits;
     else
       s_iNumTextureUnits = 1;
+#endif
   }
   
   _pTextureUnitState = new TexState[s_iNumTextureUnits];
@@ -84,8 +87,10 @@ SKYRESULT SkyTextureState::Activate()
   //GLVU::CheckForGLError("SkyTextureState::Activate(8)");
   for (unsigned int i = 0; i < s_iNumTextureUnits; ++i)
   {
+#ifdef GL_ARB_multitexture
     if (s_iNumTextureUnits > 1)
       glActiveTextureARB(GL_TEXTURE0_ARB + i);
+#endif
     bool bEnabled = IsTextureEnabled(i);
     if (pCurrent->IsTextureEnabled(i) != bEnabled)
     {
@@ -144,8 +149,10 @@ SKYRESULT SkyTextureState::Activate()
       }
       //GLVU::CheckForGLError("SkyTextureState::Activate()");
     }
+#ifdef GL_ARB_multitexture
     if (s_iNumTextureUnits > 1)
       glActiveTextureARB(GL_TEXTURE0_ARB);
+#endif
   }
   return SKYRESULT_OK;
 }
index 86078376d71271f5d76cb6b37156d47fb33b1b72..b6e1394c3b2c507d70005f7d346dbabc98bd5b11 100644 (file)
 //----------------------------------------------------------------------------
 // $Id$
 //============================================================================
+
+#include <simgear/compiler.h>
+
 #include "camera.hpp"
-#include <iostream>
+#include STL_IOSTREAM
 
 //----------------------------------------------------------------------------
 // CONSTRUCTOR: defines a default camera system defined as (45 DEG FOV)