Added some more compile time checks for OpenGL support.

git-svn-id: svn://svn.code.sf.net/p/irrlicht/code/trunk@785 dfc29bdd-3216-0410-991c-e03cc46cb475
master
hybrid 2007-07-13 18:28:58 +00:00
parent 9eabb49041
commit 63b756e8db
3 changed files with 18 additions and 7 deletions

View File

@ -1305,9 +1305,11 @@ void COpenGLDriver::setBasicRenderStates(const SMaterial& material, const SMater
glTexParameteri( GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER,
(material.BilinearFilter[i] || material.TrilinearFilter[i]) ? GL_LINEAR : GL_NEAREST);
#ifdef GL_EXT_texture_filter_anisotropic
if (AnisotropyExtension)
glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_MAX_ANISOTROPY_EXT,
material.AnisotropicFilter[i] ? MaxAnisotropy : 1.0f );
#endif
}
// fillmode

View File

@ -18,7 +18,7 @@ COpenGLExtensionHandler::COpenGLExtensionHandler() :
SeparateStencilExtension(false),
TextureCompressionExtension(false),
PackedDepthStencilExtension(false),
MaxTextureUnits(1), MaxLights(1), MaxIndices(1),
MaxTextureUnits(1), MaxLights(1), MaxIndices(65535),
MaxAnisotropy(1.0f), Version(0), ShaderLanguageVersion(0)
#ifdef _IRR_OPENGL_USE_EXTPOINTER_
,pGlActiveTextureARB(0), pGlClientActiveTextureARB(0),
@ -349,11 +349,20 @@ void COpenGLExtensionHandler::initExtensions(bool stencilBuffer)
#endif // _IRR_WINDOWS_API_
// set some properties
glGetIntegerv(GL_MAX_TEXTURE_UNITS, &MaxTextureUnits);
#if defined(GL_ARB_multitexture) || defined(GL_VERSION_1_3)
if (Version>102 || FeatureAvailable[IRR_ARB_multitexture])
glGetIntegerv(GL_MAX_TEXTURE_UNITS, &MaxTextureUnits);
#endif
glGetIntegerv(GL_MAX_LIGHTS, &MaxLights);
glGetFloatv(GL_MAX_TEXTURE_MAX_ANISOTROPY_EXT, &MaxAnisotropy);
glGetIntegerv(GL_MAX_ELEMENTS_INDICES, &MaxIndices);
#if defined(GL_ARB_shading_language_100) || defined (GL_VERSION_2_0)
#ifdef GL_EXT_texture_filter_anisotropic
if (FeatureAvailable[IRR_EXT_texture_filter_anisotropic])
glGetFloatv(GL_MAX_TEXTURE_MAX_ANISOTROPY_EXT, &MaxAnisotropy);
#endif
#ifdef GL_VERSION_1_2
if (Version>101)
glGetIntegerv(GL_MAX_ELEMENTS_INDICES, &MaxIndices);
#endif
#if defined(GL_ARB_shading_language_100) || defined (GL_VERSION_2_0)
if (FeatureAvailable[IRR_ARB_shading_language_100] || Version>=200)
{
glGetError(); // clean error buffer
@ -366,7 +375,7 @@ void COpenGLExtensionHandler::initExtensions(bool stencilBuffer)
ShaderLanguageVersion = core::floor32(ver)*100+core::ceil32((ver-floor(ver))*10.0);
}
}
#endif
#endif
#ifdef _IRR_OPENGL_USE_EXTPOINTER_
if (!pGlActiveTextureARB || !pGlClientActiveTextureARB)

View File

@ -73,7 +73,7 @@ public:
{
Driver->disableTextures(1);
Driver->setTexture(0, material.Textures[0]);
services->setBasicRenderStates(material, lastMaterial, resetAllRenderstates);
Driver->setBasicRenderStates(material, lastMaterial, resetAllRenderstates);
// if (material.MaterialType != lastMaterial.MaterialType ||
// material.MaterialTypeParam != lastMaterial.MaterialTypeParam ||