GL3: Remove GL_ARB_texture_cube_map

--HG--
branch : opengl3
hg/feature/opengl3
kaetemi 11 years ago
parent 441d3a66f5
commit 0802330985

@ -409,7 +409,7 @@ bool CDriverGL3::setupDisplay()
_UserLightEnable[i]= false; _UserLightEnable[i]= false;
// init _DriverGLStates // init _DriverGLStates
_DriverGLStates.init(_Extensions.ARBTextureCubeMap, (_Extensions.NVTextureRectangle || _Extensions.EXTTextureRectangle || _Extensions.ARBTextureRectangle), _MaxDriverLight); _DriverGLStates.init((_Extensions.NVTextureRectangle || _Extensions.EXTTextureRectangle || _Extensions.ARBTextureRectangle), _MaxDriverLight);
// Init OpenGL/Driver defaults. // Init OpenGL/Driver defaults.
//============================= //=============================
@ -999,12 +999,9 @@ void CDriverGL3::copyFrameBufferToTexture(ITexture *tex,
_DriverGLStates.setTextureMode(textureMode); _DriverGLStates.setTextureMode(textureMode);
if (tex->isTextureCube()) if (tex->isTextureCube())
{ {
if (_Extensions.ARBTextureCubeMap) glBindTexture(GL_TEXTURE_CUBE_MAP, gltext->ID);
{
glBindTexture(GL_TEXTURE_CUBE_MAP_ARB, gltext->ID);
glCopyTexSubImage2D(NLCubeFaceToGLCubeFace[cubeFace], level, offsetx, offsety, x, y, width, height); glCopyTexSubImage2D(NLCubeFaceToGLCubeFace[cubeFace], level, offsetx, offsety, x, y, width, height);
} }
}
else else
{ {
glBindTexture(gltext->TextureMode, gltext->ID); glBindTexture(gltext->TextureMode, gltext->ID);
@ -1631,7 +1628,7 @@ void CDriverGL3::checkTextureOn() const
GLboolean flagCM; GLboolean flagCM;
GLboolean flagTR; GLboolean flagTR;
glGetBooleanv(GL_TEXTURE_2D, &flag2D); glGetBooleanv(GL_TEXTURE_2D, &flag2D);
glGetBooleanv(GL_TEXTURE_CUBE_MAP_ARB, &flagCM); glGetBooleanv(GL_TEXTURE_CUBE_MAP, &flagCM);
glGetBooleanv(GL_TEXTURE_RECTANGLE_NV, &flagTR); glGetBooleanv(GL_TEXTURE_RECTANGLE_NV, &flagTR);

@ -519,16 +519,6 @@ static bool setupEXTTextureCompressionS3TC(const char *glext)
return true; return true;
} }
// *********************************
static bool setupARBTextureCubeMap(const char *glext)
{
H_AUTO_OGL(setupARBTextureCubeMap);
CHECK_EXT("GL_ARB_texture_cube_map");
return true;
}
// ********************************* // *********************************
static bool setupEXTSecondaryColor(const char *glext) static bool setupEXTSecondaryColor(const char *glext)
{ {
@ -878,9 +868,6 @@ void registerGlExtensions(CGlExtensions &ext)
// Check ARBMultisample // Check ARBMultisample
ext.ARBMultisample = setupARBMultisample(glext); ext.ARBMultisample = setupARBMultisample(glext);
// Check for cube mapping
ext.ARBTextureCubeMap = setupARBTextureCubeMap(glext);
// Check EXTSecondaryColor // Check EXTSecondaryColor
ext.EXTSecondaryColor= setupEXTSecondaryColor(glext); ext.EXTSecondaryColor= setupEXTSecondaryColor(glext);

@ -49,7 +49,6 @@ struct CGlExtensions
uint NbTextureStages; uint NbTextureStages;
// Optional Extensions. (old) // Optional Extensions. (old)
bool ARBTextureCubeMap;
bool NVTextureRectangle; bool NVTextureRectangle;
bool EXTTextureRectangle; bool EXTTextureRectangle;
bool ARBTextureRectangle; bool ARBTextureRectangle;
@ -74,7 +73,6 @@ public:
ARBMultiTexture= false; ARBMultiTexture= false;
NbTextureStages= 1; NbTextureStages= 1;
EXTTextureCompressionS3TC= false; EXTTextureCompressionS3TC= false;
ARBTextureCubeMap= false;
EXTSecondaryColor= false; EXTSecondaryColor= false;
WGLARBPBuffer= false; WGLARBPBuffer= false;
WGLARBPixelFormat= false; WGLARBPixelFormat= false;
@ -100,7 +98,6 @@ public:
result += "\n Texturing: "; result += "\n Texturing: ";
result += ARBMultiTexture ? "ARBMultiTexture " : ""; result += ARBMultiTexture ? "ARBMultiTexture " : "";
result += EXTTextureCompressionS3TC ? "EXTTextureCompressionS3TC " : ""; result += EXTTextureCompressionS3TC ? "EXTTextureCompressionS3TC " : "";
result += ARBTextureCubeMap ? "ARBTextureCubeMap " : "";
result += NVTextureRectangle ? "NVTextureRectangle " : ""; result += NVTextureRectangle ? "NVTextureRectangle " : "";
result += EXTTextureRectangle ? "EXTTextureRectangle " : ""; result += EXTTextureRectangle ? "EXTTextureRectangle " : "";
result += ARBTextureRectangle ? "ARBTextureRectangle " : ""; result += ARBTextureRectangle ? "ARBTextureRectangle " : "";

@ -94,7 +94,7 @@ static inline void convTexAddr(ITexture *tex, CMaterial::TTexAddressingMode mode
static const GLenum glTexCubeAddrModesNV[] = static const GLenum glTexCubeAddrModesNV[] =
{ {
GL_NONE, GL_TEXTURE_CUBE_MAP_ARB, GL_NONE, GL_TEXTURE_CUBE_MAP,
GL_PASS_THROUGH_NV, GL_CULL_FRAGMENT_NV, GL_PASS_THROUGH_NV, GL_CULL_FRAGMENT_NV,
GL_OFFSET_TEXTURE_2D_NV, GL_OFFSET_TEXTURE_2D_SCALE_NV, GL_OFFSET_TEXTURE_2D_NV, GL_OFFSET_TEXTURE_2D_SCALE_NV,
GL_DEPENDENT_AR_TEXTURE_2D_NV, GL_DEPENDENT_GB_TEXTURE_2D_NV, GL_DEPENDENT_AR_TEXTURE_2D_NV, GL_DEPENDENT_GB_TEXTURE_2D_NV,
@ -1125,9 +1125,6 @@ sint CDriverGL3::beginSpecularMultiPass()
if (mat.getTexture(1)==NULL) if (mat.getTexture(1)==NULL)
return 1; return 1;
if (!_Extensions.ARBTextureCubeMap)
return 1;
return 1; return 1;
} }

@ -32,7 +32,6 @@ namespace NLDRIVERGL3 {
CDriverGLStates3::CDriverGLStates3() CDriverGLStates3::CDriverGLStates3()
{ {
H_AUTO_OGL(CDriverGLStates3_CDriverGLStates) H_AUTO_OGL(CDriverGLStates3_CDriverGLStates)
_TextureCubeMapSupported= false;
_CurrARBVertexBuffer = 0; _CurrARBVertexBuffer = 0;
_DepthRangeNear = 0.f; _DepthRangeNear = 0.f;
_DepthRangeFar = 1.f; _DepthRangeFar = 1.f;
@ -43,10 +42,9 @@ CDriverGLStates3::CDriverGLStates3()
// *************************************************************************** // ***************************************************************************
void CDriverGLStates3::init(bool supportTextureCubeMap, bool supportTextureRectangle, uint maxLight) void CDriverGLStates3::init(bool supportTextureRectangle, uint maxLight)
{ {
H_AUTO_OGL(CDriverGLStates3_init) H_AUTO_OGL(CDriverGLStates3_init)
_TextureCubeMapSupported= supportTextureCubeMap;
_TextureRectangleSupported= supportTextureRectangle; _TextureRectangleSupported= supportTextureRectangle;
_MaxDriverLight= maxLight; _MaxDriverLight= maxLight;
_MaxDriverLight= std::min(_MaxDriverLight, uint(MaxLight)); _MaxDriverLight= std::min(_MaxDriverLight, uint(MaxLight));
@ -146,8 +144,7 @@ void CDriverGLStates3::forceDefaults(uint nbStages)
nglActiveTextureARB(GL_TEXTURE0_ARB+stage); nglActiveTextureARB(GL_TEXTURE0_ARB+stage);
glDisable(GL_TEXTURE_2D); glDisable(GL_TEXTURE_2D);
if (_TextureCubeMapSupported) glDisable(GL_TEXTURE_CUBE_MAP);
glDisable(GL_TEXTURE_CUBE_MAP_ARB);
_TextureMode[stage]= TextureDisabled; _TextureMode[stage]= TextureDisabled;

@ -36,7 +36,7 @@ namespace NLDRIVERGL3 {
- GL_ALPHA_TEST - GL_ALPHA_TEST
- GL_LIGHTING - GL_LIGHTING
- GL_LIGHT0 + i ..... - GL_LIGHT0 + i .....
- GL_TEXTURE_2D or GL_TEXTURE_CUBE_MAP_ARB/OES. - GL_TEXTURE_2D or GL_TEXTURE_CUBE_MAP/OES.
- GL_TEXTURE_GEN_S, GL_TEXTURE_GEN_T, GL_TEXTURE_GEN_R - GL_TEXTURE_GEN_S, GL_TEXTURE_GEN_T, GL_TEXTURE_GEN_R
- GL_COLOR_MATERIAL - GL_COLOR_MATERIAL
- GL_FOG - GL_FOG
@ -74,7 +74,7 @@ public:
/// Constructor. no-op. /// Constructor. no-op.
CDriverGLStates3(); CDriverGLStates3();
// init. Do it just after setDisplay() // init. Do it just after setDisplay()
void init(bool supportTextureCubeMap, bool supportTextureRectangle, uint maxLight); void init(bool supportTextureRectangle, uint maxLight);
/// Reset all OpenGL states of interest to default, and update caching. This don't apply to light. /// Reset all OpenGL states of interest to default, and update caching. This don't apply to light.
void forceDefaults(uint nbTextureStages); void forceDefaults(uint nbTextureStages);
@ -195,7 +195,6 @@ private:
float _CurShininess; float _CurShininess;
bool _VertexColorLighted; bool _VertexColorLighted;
bool _TextureCubeMapSupported;
bool _TextureRectangleSupported; bool _TextureRectangleSupported;
uint _CurrentActiveTextureARB; uint _CurrentActiveTextureARB;
TTextureMode _TextureMode[8]; TTextureMode _TextureMode[8];

@ -599,13 +599,10 @@ void CDriverGL3::bindTextureWithMode(ITexture &tex)
// system of "backup the previous binded texture" seems to not work with some drivers.... // system of "backup the previous binded texture" seems to not work with some drivers....
_DriverGLStates.activeTextureARB(0); _DriverGLStates.activeTextureARB(0);
if (tex.isTextureCube()) if (tex.isTextureCube())
{
if (_Extensions.ARBTextureCubeMap)
{ {
_DriverGLStates.setTextureMode(CDriverGLStates3::TextureCubeMap); _DriverGLStates.setTextureMode(CDriverGLStates3::TextureCubeMap);
// Bind this texture // Bind this texture
glBindTexture(GL_TEXTURE_CUBE_MAP_ARB, gltext->ID); glBindTexture(GL_TEXTURE_CUBE_MAP, gltext->ID);
}
} }
else else
{ {
@ -636,17 +633,14 @@ void CDriverGL3::setupTextureBasicParameters(ITexture &tex)
gltext->MinFilter = tex.getMinFilter(); gltext->MinFilter = tex.getMinFilter();
if (tex.isTextureCube()) if (tex.isTextureCube())
{ {
if (_Extensions.ARBTextureCubeMap) glTexParameteri(GL_TEXTURE_CUBE_MAP, GL_TEXTURE_WRAP_S, translateWrapToGl(ITexture::Clamp, _Extensions));
{ glTexParameteri(GL_TEXTURE_CUBE_MAP, GL_TEXTURE_WRAP_T, translateWrapToGl(ITexture::Clamp, _Extensions));
glTexParameteri(GL_TEXTURE_CUBE_MAP_ARB,GL_TEXTURE_WRAP_S, translateWrapToGl(ITexture::Clamp, _Extensions)); glTexParameteri(GL_TEXTURE_CUBE_MAP, GL_TEXTURE_WRAP_R, translateWrapToGl(ITexture::Clamp, _Extensions));
glTexParameteri(GL_TEXTURE_CUBE_MAP_ARB,GL_TEXTURE_WRAP_T, translateWrapToGl(ITexture::Clamp, _Extensions)); glTexParameteri(GL_TEXTURE_CUBE_MAP, GL_TEXTURE_MAG_FILTER, translateMagFilterToGl(gltext));
glTexParameteri(GL_TEXTURE_CUBE_MAP_ARB,GL_TEXTURE_WRAP_R, translateWrapToGl(ITexture::Clamp, _Extensions)); glTexParameteri(GL_TEXTURE_CUBE_MAP, GL_TEXTURE_MIN_FILTER, translateMinFilterToGl(gltext));
glTexParameteri(GL_TEXTURE_CUBE_MAP_ARB,GL_TEXTURE_MAG_FILTER, translateMagFilterToGl(gltext));
glTexParameteri(GL_TEXTURE_CUBE_MAP_ARB,GL_TEXTURE_MIN_FILTER, translateMinFilterToGl(gltext));
if (_AnisotropicFilter > 1.f && gltext->MinFilter > ITexture::NearestMipMapLinear) if (_AnisotropicFilter > 1.f && gltext->MinFilter > ITexture::NearestMipMapLinear)
glTexParameteri(GL_TEXTURE_CUBE_MAP_ARB, GL_TEXTURE_MAX_ANISOTROPY_EXT, _AnisotropicFilter); glTexParameteri(GL_TEXTURE_CUBE_MAP, GL_TEXTURE_MAX_ANISOTROPY_EXT, _AnisotropicFilter);
}
} }
else else
{ {
@ -669,9 +663,6 @@ bool CDriverGL3::setupTextureEx (ITexture& tex, bool bUpload, bool &bAllUploaded
//nldebug("3D: CDriverGL3::setupTextureEx(%016p, %d, %d, %d)", &tex, bUpload, bAllUploaded, bMustRecreateSharedTexture); //nldebug("3D: CDriverGL3::setupTextureEx(%016p, %d, %d, %d)", &tex, bUpload, bAllUploaded, bMustRecreateSharedTexture);
bAllUploaded = false; bAllUploaded = false;
if (tex.isTextureCube() && (!_Extensions.ARBTextureCubeMap))
return true;
// 0. Create/Retrieve the driver texture. // 0. Create/Retrieve the driver texture.
//======================================= //=======================================
bool mustCreate = false; bool mustCreate = false;
@ -1267,8 +1258,6 @@ bool CDriverGL3::activateTexture(uint stage, ITexture *tex)
// setup texture mode, after activeTextureARB() // setup texture mode, after activeTextureARB()
_DriverGLStates.setTextureMode(CDriverGLStates3::TextureCubeMap); _DriverGLStates.setTextureMode(CDriverGLStates3::TextureCubeMap);
if (_Extensions.ARBTextureCubeMap)
{
// Activate texturing... // Activate texturing...
//====================== //======================
@ -1279,20 +1268,19 @@ bool CDriverGL3::activateTexture(uint stage, ITexture *tex)
_CurrentTextureInfoGL[stage]= gltext; _CurrentTextureInfoGL[stage]= gltext;
// setup this texture // setup this texture
glBindTexture(GL_TEXTURE_CUBE_MAP_ARB, gltext->ID); glBindTexture(GL_TEXTURE_CUBE_MAP, gltext->ID);
// Change parameters of texture, if necessary. // Change parameters of texture, if necessary.
//============================================ //============================================
if (gltext->MagFilter!= tex->getMagFilter()) if (gltext->MagFilter!= tex->getMagFilter())
{ {
gltext->MagFilter= tex->getMagFilter(); gltext->MagFilter= tex->getMagFilter();
glTexParameteri(GL_TEXTURE_CUBE_MAP_ARB,GL_TEXTURE_MAG_FILTER, translateMagFilterToGl(gltext)); glTexParameteri(GL_TEXTURE_CUBE_MAP,GL_TEXTURE_MAG_FILTER, translateMagFilterToGl(gltext));
} }
if (gltext->MinFilter!= tex->getMinFilter()) if (gltext->MinFilter!= tex->getMinFilter())
{ {
gltext->MinFilter= tex->getMinFilter(); gltext->MinFilter= tex->getMinFilter();
glTexParameteri(GL_TEXTURE_CUBE_MAP_ARB,GL_TEXTURE_MIN_FILTER, translateMinFilterToGl(gltext)); glTexParameteri(GL_TEXTURE_CUBE_MAP,GL_TEXTURE_MIN_FILTER, translateMinFilterToGl(gltext));
}
} }
} }
} }

Loading…
Cancel
Save