Commit c010d007 authored by hybrid's avatar hybrid

Fixed an OpenGL render state bug and added GLSL version number to check in extension handler.

git-svn-id: svn://svn.code.sf.net/p/irrlicht/code/trunk@772 dfc29bdd-3216-0410-991c-e03cc46cb475
parent 569d6d89
...@@ -274,6 +274,15 @@ bool COpenGLDriver::genericDriverInit(const core::dimension2d<s32>& screenSize, ...@@ -274,6 +274,15 @@ bool COpenGLDriver::genericDriverInit(const core::dimension2d<s32>& screenSize,
CurrentTexture[i]=0; CurrentTexture[i]=0;
// load extensions // load extensions
initExtensions(stencilBuffer); initExtensions(stencilBuffer);
if (queryFeature(EVDF_ARB_GLSL))
{
char buf[32];
const u32 maj = ShaderLanguageVersion/100;
snprintf(buf, 32, "%u.%u", maj, ShaderLanguageVersion-maj*100);
os::Printer::log("GLSL version", buf, ELL_INFORMATION);
}
else
os::Printer::log("GLSL not available.", ELL_INFORMATION);
glViewport(0, 0, screenSize.Width, screenSize.Height); // Reset The Current Viewport glViewport(0, 0, screenSize.Width, screenSize.Height); // Reset The Current Viewport
setAmbientLight(SColorf(0.0f,0.0f,0.0f,0.0f)); setAmbientLight(SColorf(0.0f,0.0f,0.0f,0.0f));
...@@ -1459,7 +1468,7 @@ void COpenGLDriver::setBasicRenderStates(const SMaterial& material, const SMater ...@@ -1459,7 +1468,7 @@ void COpenGLDriver::setBasicRenderStates(const SMaterial& material, const SMater
mode=GL_REPEAT; mode=GL_REPEAT;
break; break;
} }
if (MultiTextureExtension) if (MultiTextureExtension)
extGlActiveTexture(GL_TEXTURE0_ARB + u); extGlActiveTexture(GL_TEXTURE0_ARB + u);
else if (u>0) else if (u>0)
...@@ -1468,6 +1477,9 @@ void COpenGLDriver::setBasicRenderStates(const SMaterial& material, const SMater ...@@ -1468,6 +1477,9 @@ void COpenGLDriver::setBasicRenderStates(const SMaterial& material, const SMater
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, mode); glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, mode);
} }
} }
// be sure to leave in texture stage 0
if (MultiTextureExtension)
extGlActiveTexture(GL_TEXTURE0_ARB);
} }
......
This diff is collapsed.
...@@ -655,7 +655,7 @@ class COpenGLExtensionHandler ...@@ -655,7 +655,7 @@ class COpenGLExtensionHandler
//! queries the features of the driver, returns true if feature is available //! queries the features of the driver, returns true if feature is available
bool queryFeature(E_VIDEO_DRIVER_FEATURE feature) const; bool queryFeature(E_VIDEO_DRIVER_FEATURE feature) const;
// show all features with availablity //! show all features with availablity
void dump() const; void dump() const;
// Some variables for properties // Some variables for properties
...@@ -669,11 +669,18 @@ class COpenGLExtensionHandler ...@@ -669,11 +669,18 @@ class COpenGLExtensionHandler
bool SeparateSpecularColorExtension; bool SeparateSpecularColorExtension;
// Some non-boolean properties // Some non-boolean properties
//! Maxmimum texture layers supported by the fixed pipeline
GLint MaxTextureUnits; GLint MaxTextureUnits;
//! Maximum hardware lights supported
GLint MaxLights; GLint MaxLights;
//! Optimal number of indices per meshbuffer
GLint MaxIndices; GLint MaxIndices;
//! Maximal Anisotropy
f32 MaxAnisotropy; f32 MaxAnisotropy;
//! OpenGL version as Integer: 100*Major+Minor, i.e. 2.1 becomes 201
u32 Version; u32 Version;
//! GLSL version as Integer: 100*Major+Minor
u32 ShaderLanguageVersion;
// public access to the (loaded) extensions. // public access to the (loaded) extensions.
// general functions // general functions
......
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