From: curt Date: Wed, 18 Sep 2002 19:41:52 +0000 (+0000) Subject: Erik Hofman: X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=01ccdd3ae1f1b0bb60f6d0515016411f5d9ef9ca;p=simgear.git Erik Hofman: This patch fixes and STL problem, and adds (compile time) support for architextures that don't support multitexturing. --- diff --git a/simgear/scene/sky/clouds3d/SkyTextureState.cpp b/simgear/scene/sky/clouds3d/SkyTextureState.cpp index f8a0d1ed..5844ff7d 100644 --- a/simgear/scene/sky/clouds3d/SkyTextureState.cpp +++ b/simgear/scene/sky/clouds3d/SkyTextureState.cpp @@ -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; } diff --git a/simgear/scene/sky/clouds3d/camera.cpp b/simgear/scene/sky/clouds3d/camera.cpp index 86078376..b6e1394c 100644 --- a/simgear/scene/sky/clouds3d/camera.cpp +++ b/simgear/scene/sky/clouds3d/camera.cpp @@ -20,8 +20,11 @@ //---------------------------------------------------------------------------- // $Id$ //============================================================================ + +#include + #include "camera.hpp" -#include +#include STL_IOSTREAM //---------------------------------------------------------------------------- // CONSTRUCTOR: defines a default camera system defined as (45 DEG FOV)