GL3: Remove GL_ARB_texture_rectangle

--HG--
branch : opengl3
hg/feature/opengl3
kaetemi 11 years ago
parent 0802330985
commit 313de47e53

@ -409,7 +409,7 @@ bool CDriverGL3::setupDisplay()
_UserLightEnable[i]= false;
// init _DriverGLStates
_DriverGLStates.init((_Extensions.NVTextureRectangle || _Extensions.EXTTextureRectangle || _Extensions.ARBTextureRectangle), _MaxDriverLight);
_DriverGLStates.init(_MaxDriverLight);
// Init OpenGL/Driver defaults.
//=============================
@ -522,13 +522,13 @@ bool CDriverGL3::stretchRect(ITexture * /* srcText */, NLMISC::CRect &/* srcRect
// ***************************************************************************
bool CDriverGL3::supportBloomEffect() const
{
return (isVertexProgramSupported() && supportFrameBufferObject() && supportPackedDepthStencil() && supportTextureRectangle());
return false; // FIXME GL3
}
// ***************************************************************************
bool CDriverGL3::supportNonPowerOfTwoTextures() const
{
return true;
return _Extensions.GLCore;
}
// ***************************************************************************
@ -993,7 +993,7 @@ void CDriverGL3::copyFrameBufferToTexture(ITexture *tex,
// setup texture mode, after activeTextureARB()
CDriverGLStates3::TTextureMode textureMode= CDriverGLStates3::Texture2D;
if (gltext->TextureMode == GL_TEXTURE_RECTANGLE_NV)
if (gltext->TextureMode == GL_TEXTURE_RECTANGLE)
textureMode = CDriverGLStates3::TextureRect;
_DriverGLStates.setTextureMode(textureMode);
@ -1253,7 +1253,7 @@ bool CDriverGL3::supportEMBM() const
{
H_AUTO_OGL(CDriverGL3_supportEMBM);
return true;
return _Extensions.GLCore;
}
// ***************************************************************************
@ -1526,8 +1526,7 @@ bool CDriverGL3::supportCloudRenderSinglePass() const
{
H_AUTO_OGL(CDriverGL3_supportCloudRenderSinglePass)
// there are slowdown for now with ati fragment shader... don't know why
return true;
return _Extensions.GLCore;
}
// ***************************************************************************
@ -1535,7 +1534,7 @@ bool CDriverGL3::supportMADOperator() const
{
H_AUTO_OGL(CDriverGL3_supportMADOperator)
return true;
return _Extensions.GLCore;
}
// ***************************************************************************
@ -1630,7 +1629,7 @@ void CDriverGL3::checkTextureOn() const
glGetBooleanv(GL_TEXTURE_2D, &flag2D);
glGetBooleanv(GL_TEXTURE_CUBE_MAP, &flagCM);
glGetBooleanv(GL_TEXTURE_RECTANGLE_NV, &flagTR);
glGetBooleanv(GL_TEXTURE_RECTANGLE, &flagTR);
switch(dgs.getTextureMode())
{
@ -1661,7 +1660,8 @@ void CDriverGL3::checkTextureOn() const
bool CDriverGL3::supportOcclusionQuery() const
{
H_AUTO_OGL(CDriverGL3_supportOcclusionQuery)
return true;
return _Extensions.GLCore;
}
// ***************************************************************************
@ -1669,7 +1669,7 @@ bool CDriverGL3::supportTextureRectangle() const
{
H_AUTO_OGL(CDriverGL3_supportTextureRectangle);
return (_Extensions.NVTextureRectangle || _Extensions.EXTTextureRectangle || _Extensions.ARBTextureRectangle);
return _Extensions.GLCore;
}
// ***************************************************************************
@ -1677,7 +1677,7 @@ bool CDriverGL3::supportPackedDepthStencil() const
{
H_AUTO_OGL(CDriverGL3_supportPackedDepthStencil);
return true;
return _Extensions.GLCore;
}
// ***************************************************************************
@ -1685,7 +1685,7 @@ bool CDriverGL3::supportFrameBufferObject() const
{
H_AUTO_OGL(CDriverGL3_supportFrameBufferObject);
return true;
return _Extensions.GLCore;
}
// ***************************************************************************

@ -163,7 +163,7 @@ public:
// This is the owner driver.
CDriverGL3 *_Driver;
// enum to use for this texture (GL_TEXTURE_2D, GL_TEXTURE_RECTANGLE_NV..)
// enum to use for this texture (GL_TEXTURE_2D, GL_TEXTURE_RECTANGLE..)
GLenum TextureMode;
// FBO Id

@ -600,32 +600,6 @@ static bool setupEXTBlendColor(const char *glext)
return true;
}
// ***************************************************************************
static bool setupNVTextureRectangle(const char *glext)
{
H_AUTO_OGL(setupNVTextureRectangle);
CHECK_EXT("GL_NV_texture_rectangle");
return true;
}
// ***************************************************************************
static bool setupEXTTextureRectangle(const char *glext)
{
H_AUTO_OGL(setupEXTTextureRectangle);
CHECK_EXT("GL_EXT_texture_rectangle");
return true;
}
// ***************************************************************************
static bool setupARBTextureRectangle(const char *glext)
{
H_AUTO_OGL(setupARBTextureRectangle);
CHECK_EXT("GL_ARB_texture_rectangle");
return true;
}
// ***************************************************************************
static bool setupEXTTextureFilterAnisotropic(const char *glext)
{
@ -855,6 +829,14 @@ void registerGlExtensions(CGlExtensions &ext)
// Check GL_EXT_texture_filter_anisotropic
ext.EXTTextureFilterAnisotropic = setupEXTTextureFilterAnisotropic(glext);
if (ext.EXTTextureFilterAnisotropic)
{
// get the maximum value
glGetFloatv(GL_MAX_TEXTURE_MAX_ANISOTROPY_EXT, &ext.EXTTextureFilterAnisotropicMaximum);
}
// ---
// Check ARBMultiTexture
ext.ARBMultiTexture= setupARBMultiTexture(glext);
if (ext.ARBMultiTexture)
@ -873,21 +855,6 @@ void registerGlExtensions(CGlExtensions &ext)
// Check EXTBlendColor
ext.EXTBlendColor= setupEXTBlendColor(glext);
// Check GL_NV_texture_rectangle
ext.NVTextureRectangle = setupNVTextureRectangle(glext);
// Check GL_EXT_texture_rectangle
ext.EXTTextureRectangle = setupEXTTextureRectangle(glext);
// Check GL_ARB_texture_rectangle
ext.ARBTextureRectangle = setupARBTextureRectangle(glext);
if (ext.EXTTextureFilterAnisotropic)
{
// get the maximum value
glGetFloatv(GL_MAX_TEXTURE_MAX_ANISOTROPY_EXT, &ext.EXTTextureFilterAnisotropicMaximum);
}
}

@ -49,9 +49,6 @@ struct CGlExtensions
uint NbTextureStages;
// Optional Extensions. (old)
bool NVTextureRectangle;
bool EXTTextureRectangle;
bool ARBTextureRectangle;
bool EXTSecondaryColor;
bool EXTBlendColor;
bool ARBMultisample;
@ -81,11 +78,8 @@ public:
GLXSGISwapControl= false;
GLXMESASwapControl= false;
EXTBlendColor= false;
NVTextureRectangle = false;
EXTTextureRectangle = false;
EXTTextureFilterAnisotropic = false;
EXTTextureFilterAnisotropicMaximum = 0.f;
ARBTextureRectangle = false;
ARBMultisample = false;
}
@ -98,9 +92,6 @@ public:
result += "\n Texturing: ";
result += ARBMultiTexture ? "ARBMultiTexture " : "";
result += EXTTextureCompressionS3TC ? "EXTTextureCompressionS3TC " : "";
result += NVTextureRectangle ? "NVTextureRectangle " : "";
result += EXTTextureRectangle ? "EXTTextureRectangle " : "";
result += ARBTextureRectangle ? "ARBTextureRectangle " : "";
result += EXTTextureFilterAnisotropic ? "EXTTextureFilterAnisotropic (Maximum = " + NLMISC::toString(EXTTextureFilterAnisotropicMaximum) + ") " : "";
result += "texture stages(*) = ";
result += NLMISC::toString(NbTextureStages);

@ -42,10 +42,9 @@ CDriverGLStates3::CDriverGLStates3()
// ***************************************************************************
void CDriverGLStates3::init(bool supportTextureRectangle, uint maxLight)
void CDriverGLStates3::init(uint maxLight)
{
H_AUTO_OGL(CDriverGLStates3_init)
_TextureRectangleSupported= supportTextureRectangle;
_MaxDriverLight= maxLight;
_MaxDriverLight= std::min(_MaxDriverLight, uint(MaxLight));
@ -151,8 +150,7 @@ void CDriverGLStates3::forceDefaults(uint nbStages)
// Tex gen init
_TexGenMode[stage] = 0;
if (_TextureRectangleSupported)
glDisable(GL_TEXTURE_RECTANGLE_NV);
glDisable(GL_TEXTURE_RECTANGLE);
glDisable(GL_TEXTURE_GEN_S);
glDisable(GL_TEXTURE_GEN_T);

@ -74,7 +74,7 @@ public:
/// Constructor. no-op.
CDriverGLStates3();
// init. Do it just after setDisplay()
void init(bool supportTextureRectangle, uint maxLight);
void init(uint maxLight);
/// Reset all OpenGL states of interest to default, and update caching. This don't apply to light.
void forceDefaults(uint nbTextureStages);
@ -195,7 +195,6 @@ private:
float _CurShininess;
bool _VertexColorLighted;
bool _TextureRectangleSupported;
uint _CurrentActiveTextureARB;
TTextureMode _TextureMode[8];

@ -62,7 +62,7 @@ CTextureDrvInfosGL3::CTextureDrvInfosGL3(IDriver *drv, ItTexDrvInfoPtrMap it, CD
// Nb: at Driver dtor, all tex infos are deleted, so _Driver is always valid.
_Driver= drvGl;
TextureMode = isRectangleTexture?GL_TEXTURE_RECTANGLE_NV:GL_TEXTURE_2D;
TextureMode = isRectangleTexture?GL_TEXTURE_RECTANGLE:GL_TEXTURE_2D;
FBOId = 0;
DepthFBOId = 0;
@ -608,7 +608,7 @@ void CDriverGL3::bindTextureWithMode(ITexture &tex)
{
CDriverGLStates3::TTextureMode textureMode= CDriverGLStates3::Texture2D;
if (gltext->TextureMode == GL_TEXTURE_RECTANGLE_NV)
if (gltext->TextureMode == GL_TEXTURE_RECTANGLE)
textureMode = CDriverGLStates3::TextureRect;
_DriverGLStates.setTextureMode(textureMode);
@ -1121,7 +1121,7 @@ bool CDriverGL3::uploadTexture (ITexture& tex, CRect& rect, uint8 nNumMipMap)
_DriverGLStates.activeTextureARB (0);
CDriverGLStates3::TTextureMode textureMode= CDriverGLStates3::Texture2D;
if (gltext->TextureMode == GL_TEXTURE_RECTANGLE_NV)
if (gltext->TextureMode == GL_TEXTURE_RECTANGLE)
textureMode = CDriverGLStates3::TextureRect;
_DriverGLStates.setTextureMode (textureMode);
@ -1288,7 +1288,7 @@ bool CDriverGL3::activateTexture(uint stage, ITexture *tex)
{
// setup texture mode, after activeTextureARB()
CDriverGLStates3::TTextureMode textureMode= CDriverGLStates3::Texture2D;
if (gltext->TextureMode == GL_TEXTURE_RECTANGLE_NV)
if (gltext->TextureMode == GL_TEXTURE_RECTANGLE)
textureMode = CDriverGLStates3::TextureRect;
_DriverGLStates.setTextureMode(/*CDriverGLStates3::Texture2D*/textureMode);

Loading…
Cancel
Save