diff --git a/code/nel/src/3d/driver/opengl3/driver_opengl.cpp b/code/nel/src/3d/driver/opengl3/driver_opengl.cpp index 31d4a7281..618bc92bc 100644 --- a/code/nel/src/3d/driver/opengl3/driver_opengl.cpp +++ b/code/nel/src/3d/driver/opengl3/driver_opengl.cpp @@ -460,7 +460,7 @@ bool CDriverGL3::setupDisplay() _CurrentTexEnvSpecial[stage] = TexEnvSpecialDisabled; // set All TexGen by default to identity matrix (prefer use the textureMatrix scheme) - _DriverGLStates.activeTextureARB(stage); + _DriverGLStates.activeTexture(stage); } if (!initProgramPipeline()) @@ -974,8 +974,8 @@ void CDriverGL3::copyFrameBufferToTexture(ITexture *tex, CTextureDrvInfosGL3* gltext = (CTextureDrvInfosGL3*)(ITextureDrvInfos*)(tex->TextureDrvShare->DrvTexture); //if (_RenderTargetFBO) // gltext->activeFrameBufferObject(NULL); - _DriverGLStates.activeTextureARB(0); - // setup texture mode, after activeTextureARB() + _DriverGLStates.activeTexture(0); + // setup texture mode, after activeTexture() CDriverGLStates3::TTextureMode textureMode= CDriverGLStates3::Texture2D; if (gltext->TextureMode == GL_TEXTURE_RECTANGLE) @@ -1158,7 +1158,7 @@ void CDriverGL3::setMatrix2DForTextureOffsetAddrMode(const uint stage, const flo if (!supportTextureShaders()) return; //nlassert(supportTextureShaders()); nlassert(stage < inlGetNumTextStages()); - _DriverGLStates.activeTextureARB(stage); + _DriverGLStates.activeTexture(stage); //glTexEnvfv(GL_TEXTURE_SHADER_NV, GL_OFFSET_TEXTURE_MATRIX_NV, mat); } @@ -1586,10 +1586,10 @@ void CDriverGL3::checkTextureOn() const H_AUTO_OGL(CDriverGL3_checkTextureOn) // tmp for debug CDriverGLStates3 &dgs = const_cast(_DriverGLStates); - uint currTexStage = dgs.getActiveTextureARB(); + uint currTexStage = dgs.getActiveTexture(); for (uint k = 0; k < this->getNbTextureStages(); ++k) { - dgs.activeTextureARB(k); + dgs.activeTexture(k); GLboolean flag2D; GLboolean flagCM; GLboolean flagTR; @@ -1620,7 +1620,7 @@ void CDriverGL3::checkTextureOn() const break; } } - dgs.activeTextureARB(currTexStage); + dgs.activeTexture(currTexStage); } // *************************************************************************** diff --git a/code/nel/src/3d/driver/opengl3/driver_opengl_extension.cpp b/code/nel/src/3d/driver/opengl3/driver_opengl_extension.cpp index b15041011..752c1daf8 100644 --- a/code/nel/src/3d/driver/opengl3/driver_opengl_extension.cpp +++ b/code/nel/src/3d/driver/opengl3/driver_opengl_extension.cpp @@ -156,6 +156,8 @@ PFNGLBLITFRAMEBUFFERPROC nglBlitFramebuffer; PFNGLRENDERBUFFERSTORAGEMULTISAMPLEPROC nglRenderbufferStorageMultisample; PFNGLFRAMEBUFFERTEXTURELAYERPROC nglFramebufferTextureLayer; +PFNGLACTIVETEXTUREPROC nglActiveTexture; + PFNGLCOMPRESSEDTEXIMAGE3DPROC nglCompressedTexImage3D; PFNGLCOMPRESSEDTEXIMAGE2DPROC nglCompressedTexImage2D; PFNGLCOMPRESSEDTEXIMAGE1DPROC nglCompressedTexImage1D; @@ -436,6 +438,8 @@ static bool setupGLCore(const char *glext) CHECK_ADDRESS(PFNGLRENDERBUFFERSTORAGEMULTISAMPLEPROC, glRenderbufferStorageMultisample); CHECK_ADDRESS(PFNGLFRAMEBUFFERTEXTURELAYERPROC, glFramebufferTextureLayer); + CHECK_ADDRESS(PFNGLACTIVETEXTUREPROC, glActiveTexture); + CHECK_ADDRESS(PFNGLCOMPRESSEDTEXIMAGE3DPROC, glCompressedTexImage3D); CHECK_ADDRESS(PFNGLCOMPRESSEDTEXIMAGE2DPROC, glCompressedTexImage2D); CHECK_ADDRESS(PFNGLCOMPRESSEDTEXIMAGE1DPROC, glCompressedTexImage1D); diff --git a/code/nel/src/3d/driver/opengl3/driver_opengl_extension.h b/code/nel/src/3d/driver/opengl3/driver_opengl_extension.h index 717b65c6e..14c8555bd 100644 --- a/code/nel/src/3d/driver/opengl3/driver_opengl_extension.h +++ b/code/nel/src/3d/driver/opengl3/driver_opengl_extension.h @@ -140,9 +140,9 @@ void registerGlExtensions(CGlExtensions &ext); // *************************************************************************** // The exported function names -/* NB: We named all like nglActiveTextureARB (n for NEL :) +/* NB: We named all like nglActiveTexture (n for NEL :) to avoid compilation conflict with future version of gl.h - eg: gl.h Version 1.2 define glActiveTextureARB so we can't use it. + eg: gl.h Version 1.2 define glActiveTexture so we can't use it. NB: we do it for all (EXT, NV, ARB extension) even it should be useful only for ARB ones. */ @@ -240,6 +240,8 @@ extern PFNGLBLITFRAMEBUFFERPROC nglBlitFramebuffer; extern PFNGLRENDERBUFFERSTORAGEMULTISAMPLEPROC nglRenderbufferStorageMultisample; extern PFNGLFRAMEBUFFERTEXTURELAYERPROC nglFramebufferTextureLayer; +extern PFNGLACTIVETEXTUREPROC nglActiveTexture; + extern PFNGLCOMPRESSEDTEXIMAGE3DPROC nglCompressedTexImage3D; extern PFNGLCOMPRESSEDTEXIMAGE2DPROC nglCompressedTexImage2D; extern PFNGLCOMPRESSEDTEXIMAGE1DPROC nglCompressedTexImage1D; diff --git a/code/nel/src/3d/driver/opengl3/driver_opengl_material.cpp b/code/nel/src/3d/driver/opengl3/driver_opengl_material.cpp index 718c76e4f..f243ff531 100644 --- a/code/nel/src/3d/driver/opengl3/driver_opengl_material.cpp +++ b/code/nel/src/3d/driver/opengl3/driver_opengl_material.cpp @@ -128,7 +128,7 @@ void CDriverGL3::setTextureEnvFunction(uint stage, CMaterial& mat) activateTexEnvColor(stage, env); // Activate texture generation mapping - _DriverGLStates.activeTextureARB(stage); + _DriverGLStates.activeTexture(stage); if (mat.getTexCoordGen (stage)) { // set mode and enable. @@ -820,7 +820,7 @@ void CDriverGL3::setupLightMapPass(uint pass) _DriverGLStates.setEmissive(packedColorBlack, glcolBlack); // Setup gen tex off - _DriverGLStates.activeTextureARB(0); + _DriverGLStates.activeTexture(0); _DriverGLStates.setTexGenMode(0, 0); // And disable other stages. @@ -922,7 +922,7 @@ void CDriverGL3::setupLightMapPass(uint pass) activateTexEnvColor(stage, stdEnv); // Setup env for texture stage. - _DriverGLStates.activeTextureARB(stage); + _DriverGLStates.activeTexture(stage); _DriverGLStates.setTexGenMode(stage, 0); // setup TexEnvCombine4 (ignore alpha part). @@ -951,7 +951,7 @@ void CDriverGL3::setupLightMapPass(uint pass) activateTexEnvMode(stage, _LightMapLastStageEnv); // Setup gen tex off - _DriverGLStates.activeTextureARB(stage); + _DriverGLStates.activeTexture(stage); _DriverGLStates.setTexGenMode(stage, 0); int tl = currentProgram.pp->getUniformIndex(CProgramIndex::TName(CProgramIndex::Sampler0 + stage)); @@ -1080,13 +1080,13 @@ void CDriverGL3::setupSpecularBegin() activateTexEnvMode(0, env); // Disable texGen for stage 0 - _DriverGLStates.activeTextureARB(0); + _DriverGLStates.activeTexture(0); _DriverGLStates.setTexGenMode(0, 0); // ---- Stage 1 Common Setup. // NB don't setup the TexEnv here (stage1 setuped in setupSpecularPass() according to extensions) // For all cases, setup the TexCoord gen for stage1 - _DriverGLStates.activeTextureARB(1); + _DriverGLStates.activeTexture(1); // setup the good matrix for stage 1. _UserTexMat[ 1 ] = _SpecularTexMtx; @@ -1098,7 +1098,7 @@ void CDriverGL3::setupSpecularEnd() { H_AUTO_OGL(CDriverGL3_setupSpecularEnd) // Disable Texture coord generation. - _DriverGLStates.activeTextureARB(1); + _DriverGLStates.activeTexture(1); _DriverGLStates.setTexGenMode(1, 0); // Happiness !!! we have already enabled the stage 1 @@ -1181,7 +1181,7 @@ void CDriverGL3::setupSpecularPass(uint pass) // TexEnv is special. _CurrentTexEnvSpecial[1] = newEnvStage1; - _DriverGLStates.activeTextureARB(1); + _DriverGLStates.activeTexture(1); } } diff --git a/code/nel/src/3d/driver/opengl3/driver_opengl_states.cpp b/code/nel/src/3d/driver/opengl3/driver_opengl_states.cpp index 3f72abfce..628b747be 100644 --- a/code/nel/src/3d/driver/opengl3/driver_opengl_states.cpp +++ b/code/nel/src/3d/driver/opengl3/driver_opengl_states.cpp @@ -84,7 +84,6 @@ void CDriverGLStates3::forceDefaults(uint nbStages) _CurLighting= false; _CurZWrite= true; _CurStencilTest=false; - _CurMultisample= false; // setup GLStates. glDisable(GL_FOG); @@ -93,7 +92,6 @@ void CDriverGLStates3::forceDefaults(uint nbStages) glDisable(GL_ALPHA_TEST); glDisable(GL_LIGHTING); glDepthMask(GL_TRUE); - glDisable(GL_MULTISAMPLE_ARB); // Func. _CurBlendSrc= GL_SRC_ALPHA; @@ -137,7 +135,7 @@ void CDriverGLStates3::forceDefaults(uint nbStages) for (stage=0;stage TextureDisabled. */ void setTextureMode(TTextureMode texMode); - TTextureMode getTextureMode() const { return _TextureMode[_CurrentActiveTextureARB]; } + TTextureMode getTextureMode() const { return _TextureMode[_CurrentActiveTexture]; } // reset texture mode to the default (disabled) for the current stage. It forces the state (useful after texture shaders) void resetTextureMode(); // @} @@ -176,7 +173,6 @@ private: bool _CurLighting; bool _CurZWrite; bool _CurStencilTest; - bool _CurMultisample; GLenum _CurBlendSrc; GLenum _CurBlendDst; @@ -197,7 +193,7 @@ private: float _CurShininess; bool _VertexColorLighted; - uint _CurrentActiveTextureARB; + uint _CurrentActiveTexture; TTextureMode _TextureMode[8]; bool _VertexArrayEnabled; @@ -205,7 +201,7 @@ private: bool _WeightArrayEnabled; bool _ColorArrayEnabled; bool _SecondaryColorArrayEnabled; - uint _CurrentClientActiveTextureARB; + uint _CurrentClientActiveTexture; bool _TexCoordArrayEnabled[8]; bool _VertexAttribArrayEnabled[CVertexBuffer::NumValue]; diff --git a/code/nel/src/3d/driver/opengl3/driver_opengl_texture.cpp b/code/nel/src/3d/driver/opengl3/driver_opengl_texture.cpp index ddf36c6a7..c739fcbd1 100644 --- a/code/nel/src/3d/driver/opengl3/driver_opengl_texture.cpp +++ b/code/nel/src/3d/driver/opengl3/driver_opengl_texture.cpp @@ -597,7 +597,7 @@ void CDriverGL3::bindTextureWithMode(ITexture &tex) CTextureDrvInfosGL3* gltext; gltext= getTextureGl(tex); // system of "backup the previous binded texture" seems to not work with some drivers.... - _DriverGLStates.activeTextureARB(0); + _DriverGLStates.activeTexture(0); if (tex.isTextureCube()) { _DriverGLStates.setTextureMode(CDriverGLStates3::TextureCubeMap); @@ -1118,7 +1118,7 @@ bool CDriverGL3::uploadTexture (ITexture& tex, CRect& rect, uint8 nNumMipMap) gltext = getTextureGl (tex); // system of "backup the previous binded texture" seems to not work with some drivers.... - _DriverGLStates.activeTextureARB (0); + _DriverGLStates.activeTexture (0); CDriverGLStates3::TTextureMode textureMode= CDriverGLStates3::Texture2D; if (gltext->TextureMode == GL_TEXTURE_RECTANGLE) @@ -1238,7 +1238,7 @@ bool CDriverGL3::activateTexture(uint stage, ITexture *tex) H_AUTO_OGL(activateTexture) if (this->_CurrentTexture[stage]!=tex) { - _DriverGLStates.activeTextureARB(stage); + _DriverGLStates.activeTexture(stage); if (tex && tex->TextureDrvShare) { // get the drv info. should be not NULL. @@ -1255,7 +1255,7 @@ bool CDriverGL3::activateTexture(uint stage, ITexture *tex) if (tex->isTextureCube()) { - // setup texture mode, after activeTextureARB() + // setup texture mode, after activeTexture() _DriverGLStates.setTextureMode(CDriverGLStates3::TextureCubeMap); // Activate texturing... @@ -1286,7 +1286,7 @@ bool CDriverGL3::activateTexture(uint stage, ITexture *tex) } else { - // setup texture mode, after activeTextureARB() + // setup texture mode, after activeTexture() CDriverGLStates3::TTextureMode textureMode= CDriverGLStates3::Texture2D; if (gltext->TextureMode == GL_TEXTURE_RECTANGLE) textureMode = CDriverGLStates3::TextureRect; @@ -1334,7 +1334,7 @@ bool CDriverGL3::activateTexture(uint stage, ITexture *tex) { // Force no texturing for this stage. _CurrentTextureInfoGL[stage]= NULL; - // setup texture mode, after activeTextureARB() + // setup texture mode, after activeTexture() _DriverGLStates.setTextureMode(CDriverGLStates3::TextureDisabled); /*if (_Extensions.ATITextureEnvCombine3)