Fixed: #944 Bloom for non NV Cards on OpenGL

This commit is contained in:
aquiles 2010-05-27 21:57:44 +02:00
parent 9dcd284614
commit 2f3f320843
3 changed files with 16 additions and 2 deletions

View file

@ -1273,7 +1273,7 @@ bool CDriverGL::setDisplay(nlWindow wnd, const GfxMode &mode, bool show, bool re
_UserLightEnable[i]= false; _UserLightEnable[i]= false;
// init _DriverGLStates // init _DriverGLStates
_DriverGLStates.init(_Extensions.ARBTextureCubeMap, _Extensions.NVTextureRectangle, _MaxDriverLight); _DriverGLStates.init(_Extensions.ARBTextureCubeMap, (_Extensions.NVTextureRectangle || _Extensions.EXTTextureRectangle), _MaxDriverLight);
// Init OpenGL/Driver defaults. // Init OpenGL/Driver defaults.
@ -4158,7 +4158,8 @@ bool CDriverGL::supportOcclusionQuery() const
bool CDriverGL::supportTextureRectangle() const bool CDriverGL::supportTextureRectangle() const
{ {
H_AUTO_OGL(CDriverGL_supportTextureRectangle) H_AUTO_OGL(CDriverGL_supportTextureRectangle)
return _Extensions.NVTextureRectangle; return (_Extensions.NVTextureRectangle ||
_Extensions.EXTTextureRectangle);
} }
// *************************************************************************** // ***************************************************************************

View file

@ -1143,6 +1143,14 @@ static bool setupNVTextureRectangle(const char *glext)
return true; 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) static bool setupFrameBufferObject(const char *glext)
{ {
@ -1311,6 +1319,9 @@ void registerGlExtensions(CGlExtensions &ext)
// Check GL_NV_texture_rectangle // Check GL_NV_texture_rectangle
ext.NVTextureRectangle = setupNVTextureRectangle(glext); ext.NVTextureRectangle = setupNVTextureRectangle(glext);
// Check GL_EXT_texture_rectangle
ext.EXTTextureRectangle = setupEXTTextureRectangle(glext);
// Check GL_EXT_framebuffer_object // Check GL_EXT_framebuffer_object
ext.FrameBufferObject = setupFrameBufferObject(glext); ext.FrameBufferObject = setupFrameBufferObject(glext);

View file

@ -70,6 +70,7 @@ struct CGlExtensions
bool NVTextureShader; bool NVTextureShader;
bool NVOcclusionQuery; bool NVOcclusionQuery;
bool NVTextureRectangle; bool NVTextureRectangle;
bool EXTTextureRectangle;
bool FrameBufferObject; bool FrameBufferObject;
bool PackedDepthStencil; bool PackedDepthStencil;
// true if NVVertexProgram and if we know that VP is emulated // true if NVVertexProgram and if we know that VP is emulated
@ -181,6 +182,7 @@ public:
result += ARBTextureCubeMap ? "ARBTextureCubeMap " : ""; result += ARBTextureCubeMap ? "ARBTextureCubeMap " : "";
result += ATIEnvMapBumpMap ? "ATIEnvMapBumpMap " : ""; result += ATIEnvMapBumpMap ? "ATIEnvMapBumpMap " : "";
result += NVTextureRectangle ? "NVTextureRectangle " : ""; result += NVTextureRectangle ? "NVTextureRectangle " : "";
result += EXTTextureRectangle ? "EXTTextureRectangle " : "";
result += ARBTextureNonPowerOfTwo ? "ARBTextureNonPowerOfTwo " : ""; result += ARBTextureNonPowerOfTwo ? "ARBTextureNonPowerOfTwo " : "";
result += "texture stages(*) = "; result += "texture stages(*) = ";
result += NLMISC::toString(NbTextureStages); result += NLMISC::toString(NbTextureStages);