Commit 88a3cc61 authored by hybrid's avatar hybrid

Add variable to store the maximum number of simultaneously supported textures of the driver.

git-svn-id: svn://svn.code.sf.net/p/irrlicht/code/trunk@3404 dfc29bdd-3216-0410-991c-e03cc46cb475
parent 6d80b111
...@@ -19,8 +19,8 @@ namespace video ...@@ -19,8 +19,8 @@ namespace video
COpenGLExtensionHandler::COpenGLExtensionHandler() : COpenGLExtensionHandler::COpenGLExtensionHandler() :
StencilBuffer(false), MultiTextureExtension(false), StencilBuffer(false), MultiTextureExtension(false),
TextureCompressionExtension(false), TextureCompressionExtension(false),
MaxTextureUnits(1), MaxLights(1), MaxAnisotropy(1), MaxSupportedTextures(1), MaxTextureUnits(1), MaxLights(1),
MaxUserClipPlanes(0), MaxAuxBuffers(0), MaxAnisotropy(1), MaxUserClipPlanes(0), MaxAuxBuffers(0),
MaxMultipleRenderTargets(1), MaxIndices(65535), MaxMultipleRenderTargets(1), MaxIndices(65535),
MaxTextureSize(1), MaxGeometryVerticesOut(0), MaxTextureSize(1), MaxGeometryVerticesOut(0),
MaxTextureLODBias(0.f), Version(0), ShaderLanguageVersion(0), MaxTextureLODBias(0.f), Version(0), ShaderLanguageVersion(0),
...@@ -606,7 +606,7 @@ void COpenGLExtensionHandler::initExtensions(bool stencilBuffer) ...@@ -606,7 +606,7 @@ void COpenGLExtensionHandler::initExtensions(bool stencilBuffer)
if (Version>102 || FeatureAvailable[IRR_ARB_multitexture]) if (Version>102 || FeatureAvailable[IRR_ARB_multitexture])
{ {
glGetIntegerv(GL_MAX_TEXTURE_UNITS, &num); glGetIntegerv(GL_MAX_TEXTURE_UNITS, &num);
MaxTextureUnits=static_cast<u8>(num); MaxSupportedTextures=static_cast<u8>(num);
} }
#endif #endif
glGetIntegerv(GL_MAX_LIGHTS, &num); glGetIntegerv(GL_MAX_LIGHTS, &num);
...@@ -689,12 +689,12 @@ void COpenGLExtensionHandler::initExtensions(bool stencilBuffer) ...@@ -689,12 +689,12 @@ void COpenGLExtensionHandler::initExtensions(bool stencilBuffer)
} }
else else
#endif #endif
MaxTextureUnits = core::min_(MaxSupportedTextures, static_cast<u8>(MATERIAL_MAX_TEXTURES));
if (MaxTextureUnits < 2) if (MaxTextureUnits < 2)
{ {
MultiTextureExtension = false; MultiTextureExtension = false;
os::Printer::log("Warning: OpenGL device only has one texture unit. Disabling multitexturing.", ELL_WARNING); os::Printer::log("Warning: OpenGL device only has one texture unit. Disabling multitexturing.", ELL_WARNING);
} }
MaxTextureUnits = core::min_(MaxTextureUnits,static_cast<u8>(MATERIAL_MAX_TEXTURES));
#ifdef GL_ARB_occlusion_query #ifdef GL_ARB_occlusion_query
if (FeatureAvailable[IRR_ARB_occlusion_query]) if (FeatureAvailable[IRR_ARB_occlusion_query])
......
...@@ -836,6 +836,8 @@ class COpenGLExtensionHandler ...@@ -836,6 +836,8 @@ class COpenGLExtensionHandler
// Some non-boolean properties // Some non-boolean properties
//! Maxmimum texture layers supported by the fixed pipeline //! Maxmimum texture layers supported by the fixed pipeline
u8 MaxSupportedTextures;
//! Maxmimum texture layers supported by the engine
u8 MaxTextureUnits; u8 MaxTextureUnits;
//! Maximum hardware lights supported //! Maximum hardware lights supported
u8 MaxLights; u8 MaxLights;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment