From 2f3f32084369aa69073804656be982978592991b Mon Sep 17 00:00:00 2001 From: aquiles Date: Thu, 27 May 2010 21:57:44 +0200 Subject: [PATCH] Fixed: #944 Bloom for non NV Cards on OpenGL --- code/nel/src/3d/driver/opengl/driver_opengl.cpp | 5 +++-- .../src/3d/driver/opengl/driver_opengl_extension.cpp | 11 +++++++++++ .../src/3d/driver/opengl/driver_opengl_extension.h | 2 ++ 3 files changed, 16 insertions(+), 2 deletions(-) diff --git a/code/nel/src/3d/driver/opengl/driver_opengl.cpp b/code/nel/src/3d/driver/opengl/driver_opengl.cpp index 5dfb25b5f..1f7679823 100644 --- a/code/nel/src/3d/driver/opengl/driver_opengl.cpp +++ b/code/nel/src/3d/driver/opengl/driver_opengl.cpp @@ -1273,7 +1273,7 @@ bool CDriverGL::setDisplay(nlWindow wnd, const GfxMode &mode, bool show, bool re _UserLightEnable[i]= false; // init _DriverGLStates - _DriverGLStates.init(_Extensions.ARBTextureCubeMap, _Extensions.NVTextureRectangle, _MaxDriverLight); + _DriverGLStates.init(_Extensions.ARBTextureCubeMap, (_Extensions.NVTextureRectangle || _Extensions.EXTTextureRectangle), _MaxDriverLight); // Init OpenGL/Driver defaults. @@ -4158,7 +4158,8 @@ bool CDriverGL::supportOcclusionQuery() const bool CDriverGL::supportTextureRectangle() const { H_AUTO_OGL(CDriverGL_supportTextureRectangle) - return _Extensions.NVTextureRectangle; + return (_Extensions.NVTextureRectangle || + _Extensions.EXTTextureRectangle); } // *************************************************************************** diff --git a/code/nel/src/3d/driver/opengl/driver_opengl_extension.cpp b/code/nel/src/3d/driver/opengl/driver_opengl_extension.cpp index ea1e0d389..fb6e33baa 100644 --- a/code/nel/src/3d/driver/opengl/driver_opengl_extension.cpp +++ b/code/nel/src/3d/driver/opengl/driver_opengl_extension.cpp @@ -1143,6 +1143,14 @@ static bool setupNVTextureRectangle(const char *glext) return true; } +// *************************************************************************** +static bool setupEXTTextureRectangle(const char *glext) +{ + H_AUTO_OGL(setupEXTTextureRectangle); + CHECK_EXT("GL_EXT_texture_rectangle"); + return true; +} + // *************************************************************************** static bool setupFrameBufferObject(const char *glext) { @@ -1311,6 +1319,9 @@ void registerGlExtensions(CGlExtensions &ext) // Check GL_NV_texture_rectangle ext.NVTextureRectangle = setupNVTextureRectangle(glext); + // Check GL_EXT_texture_rectangle + ext.EXTTextureRectangle = setupEXTTextureRectangle(glext); + // Check GL_EXT_framebuffer_object ext.FrameBufferObject = setupFrameBufferObject(glext); diff --git a/code/nel/src/3d/driver/opengl/driver_opengl_extension.h b/code/nel/src/3d/driver/opengl/driver_opengl_extension.h index 49068522c..676f43f41 100644 --- a/code/nel/src/3d/driver/opengl/driver_opengl_extension.h +++ b/code/nel/src/3d/driver/opengl/driver_opengl_extension.h @@ -70,6 +70,7 @@ struct CGlExtensions bool NVTextureShader; bool NVOcclusionQuery; bool NVTextureRectangle; + bool EXTTextureRectangle; bool FrameBufferObject; bool PackedDepthStencil; // true if NVVertexProgram and if we know that VP is emulated @@ -181,6 +182,7 @@ public: result += ARBTextureCubeMap ? "ARBTextureCubeMap " : ""; result += ATIEnvMapBumpMap ? "ATIEnvMapBumpMap " : ""; result += NVTextureRectangle ? "NVTextureRectangle " : ""; + result += EXTTextureRectangle ? "EXTTextureRectangle " : ""; result += ARBTextureNonPowerOfTwo ? "ARBTextureNonPowerOfTwo " : ""; result += "texture stages(*) = "; result += NLMISC::toString(NbTextureStages);