From 296083ba61900bd9401769c1838b67cf57ec95d2 Mon Sep 17 00:00:00 2001 From: dfighter1985 Date: Thu, 25 Jul 2013 05:24:15 +0200 Subject: [PATCH] First batch of renames. --HG-- branch : gsoc2013-dfighter --- .../src/3d/driver/OpenGL3/driver_opengl.cpp | 468 +++++++++--------- .../nel/src/3d/driver/OpenGL3/driver_opengl.h | 74 ++- .../OpenGL3/driver_opengl_extension.cpp | 2 +- .../driver/OpenGL3/driver_opengl_extension.h | 2 +- .../driver/OpenGL3/driver_opengl_inputs.cpp | 68 +-- .../3d/driver/OpenGL3/driver_opengl_light.cpp | 38 +- .../driver/OpenGL3/driver_opengl_material.cpp | 170 +++---- .../driver/OpenGL3/driver_opengl_matrix.cpp | 34 +- .../driver/OpenGL3/driver_opengl_states.cpp | 206 ++++---- .../3d/driver/OpenGL3/driver_opengl_states.h | 6 +- .../driver/OpenGL3/driver_opengl_texture.cpp | 144 +++--- .../driver/OpenGL3/driver_opengl_vertex.cpp | 166 +++---- .../driver_opengl_vertex_buffer_hard.cpp | 22 +- .../driver_opengl_vertex_buffer_hard.h | 28 +- .../OpenGL3/driver_opengl_vertex_program.cpp | 92 ++-- .../driver/OpenGL3/driver_opengl_window.cpp | 164 +++--- 16 files changed, 840 insertions(+), 844 deletions(-) diff --git a/code/nel/src/3d/driver/OpenGL3/driver_opengl.cpp b/code/nel/src/3d/driver/OpenGL3/driver_opengl.cpp index 29e14a1a0..8ffdb5f34 100644 --- a/code/nel/src/3d/driver/OpenGL3/driver_opengl.cpp +++ b/code/nel/src/3d/driver/OpenGL3/driver_opengl.cpp @@ -100,7 +100,7 @@ IDriver* createGlEsDriverInstance () IDriver* createGlDriverInstance () { - return new NLDRIVERGL::CDriverGL; + return new NLDRIVERGL::CDriverGL3; } #endif @@ -111,7 +111,7 @@ IDriver* createGlDriverInstance () __declspec(dllexport) IDriver* NL3D_createIDriverInstance () { - return new CDriverGL; + return new CDriverGL3; } __declspec(dllexport) uint32 NL3D_interfaceVersion () @@ -125,7 +125,7 @@ extern "C" { IDriver* NL3D_createIDriverInstance () { - return new CDriverGL; + return new CDriverGL3; } uint32 NL3D_interfaceVersion () @@ -142,24 +142,24 @@ extern "C" #ifdef USE_OPENGLES namespace NLDRIVERGLES { #else -namespace NLDRIVERGL { +namespace NLDRIVERGL3 { #endif #endif -CMaterial::CTexEnv CDriverGL::_TexEnvReplace; +CMaterial::CTexEnv CDriverGL3::_TexEnvReplace; #ifdef NL_OS_WINDOWS -uint CDriverGL::_Registered=0; +uint CDriverGL3::_Registered=0; #endif // NL_OS_WINDOWS // Version of the driver. Not the interface version!! Increment when implementation of the driver change. -const uint32 CDriverGL::ReleaseVersion = 0x11; +const uint32 CDriverGL3::ReleaseVersion = 0x11; // Number of register to allocate for the EXTVertexShader extension -const uint CDriverGL::_EVSNumConstant = 97; +const uint CDriverGL3::_EVSNumConstant = 97; -GLenum CDriverGL::NLCubeFaceToGLCubeFace[6] = +GLenum CDriverGL3::NLCubeFaceToGLCubeFace[6] = { GL_TEXTURE_CUBE_MAP_POSITIVE_X_ARB, GL_TEXTURE_CUBE_MAP_NEGATIVE_X_ARB, @@ -170,9 +170,9 @@ GLenum CDriverGL::NLCubeFaceToGLCubeFace[6] = }; // *************************************************************************** -CDriverGL::CDriverGL() +CDriverGL3::CDriverGL3() { - H_AUTO_OGL(CDriverGL_CDriverGL) + H_AUTO_OGL(CDriverGL3_CDriverGL) #ifdef USE_OPENGLES @@ -368,9 +368,9 @@ CDriverGL::CDriverGL() } // *************************************************************************** -CDriverGL::~CDriverGL() +CDriverGL3::~CDriverGL3() { - H_AUTO_OGL(CDriverGL_CDriverGLDtor) + H_AUTO_OGL(CDriverGL3_CDriverGLDtor) release(); #if defined(NL_OS_MAC) @@ -379,9 +379,9 @@ CDriverGL::~CDriverGL() } // -------------------------------------------------- -bool CDriverGL::setupDisplay() +bool CDriverGL3::setupDisplay() { - H_AUTO_OGL(CDriverGL_setupDisplay) + H_AUTO_OGL(CDriverGL3_setupDisplay) // Driver caps. //============= @@ -680,40 +680,40 @@ bool CDriverGL::setupDisplay() } // *************************************************************************** -bool CDriverGL::stretchRect(ITexture * /* srcText */, NLMISC::CRect &/* srcRect */, ITexture * /* destText */, NLMISC::CRect &/* destRect */) +bool CDriverGL3::stretchRect(ITexture * /* srcText */, NLMISC::CRect &/* srcRect */, ITexture * /* destText */, NLMISC::CRect &/* destRect */) { - H_AUTO_OGL(CDriverGL_stretchRect) + H_AUTO_OGL(CDriverGL3_stretchRect) return false; } // *************************************************************************** -bool CDriverGL::supportBloomEffect() const +bool CDriverGL3::supportBloomEffect() const { return (isVertexProgramSupported() && supportFrameBufferObject() && supportPackedDepthStencil() && supportTextureRectangle()); } // *************************************************************************** -bool CDriverGL::supportNonPowerOfTwoTextures() const +bool CDriverGL3::supportNonPowerOfTwoTextures() const { return _Extensions.ARBTextureNonPowerOfTwo; } // *************************************************************************** -bool CDriverGL::isTextureRectangle(ITexture * tex) const +bool CDriverGL3::isTextureRectangle(ITexture * tex) const { return (supportTextureRectangle() && tex->isBloomTexture() && tex->mipMapOff() && (!isPowerOf2(tex->getWidth()) || !isPowerOf2(tex->getHeight()))); } // *************************************************************************** -bool CDriverGL::activeFrameBufferObject(ITexture * tex) +bool CDriverGL3::activeFrameBufferObject(ITexture * tex) { if(supportFrameBufferObject()/* && supportPackedDepthStencil()*/) { if(tex) { - CTextureDrvInfosGL* gltext = (CTextureDrvInfosGL*)(ITextureDrvInfos*)(tex->TextureDrvShare->DrvTexture); + CTextureDrvInfosGL3* gltext = (CTextureDrvInfosGL3*)(ITextureDrvInfos*)(tex->TextureDrvShare->DrvTexture); return gltext->activeFrameBufferObject(tex); } else @@ -731,30 +731,30 @@ bool CDriverGL::activeFrameBufferObject(ITexture * tex) } // -------------------------------------------------- -void CDriverGL::disableHardwareVertexProgram() +void CDriverGL3::disableHardwareVertexProgram() { - H_AUTO_OGL(CDriverGL_disableHardwareVertexProgram) + H_AUTO_OGL(CDriverGL3_disableHardwareVertexProgram) _Extensions.DisableHardwareVertexProgram= true; } // *************************************************************************** -void CDriverGL::disableHardwareVertexArrayAGP() +void CDriverGL3::disableHardwareVertexArrayAGP() { - H_AUTO_OGL(CDriverGL_disableHardwareVertexArrayAGP) + H_AUTO_OGL(CDriverGL3_disableHardwareVertexArrayAGP) _Extensions.DisableHardwareVertexArrayAGP= true; } // *************************************************************************** -void CDriverGL::disableHardwareTextureShader() +void CDriverGL3::disableHardwareTextureShader() { - H_AUTO_OGL(CDriverGL_disableHardwareTextureShader) + H_AUTO_OGL(CDriverGL3_disableHardwareTextureShader) _Extensions.DisableHardwareTextureShader= true; } // -------------------------------------------------- -void CDriverGL::resetTextureShaders() +void CDriverGL3::resetTextureShaders() { - H_AUTO_OGL(CDriverGL_resetTextureShaders); + H_AUTO_OGL(CDriverGL3_resetTextureShaders); #ifndef USE_OPENGLES if (_Extensions.NVTextureShader) @@ -782,9 +782,9 @@ void CDriverGL::resetTextureShaders() } // -------------------------------------------------- -bool CDriverGL::isTextureExist(const ITexture&tex) +bool CDriverGL3::isTextureExist(const ITexture&tex) { - H_AUTO_OGL(CDriverGL_isTextureExist) + H_AUTO_OGL(CDriverGL3_isTextureExist) bool result; // Create the shared Name. @@ -800,9 +800,9 @@ bool CDriverGL::isTextureExist(const ITexture&tex) } // -------------------------------------------------- -bool CDriverGL::clear2D(CRGBA rgba) +bool CDriverGL3::clear2D(CRGBA rgba) { - H_AUTO_OGL(CDriverGL_clear2D) + H_AUTO_OGL(CDriverGL3_clear2D) glClearColor((float)rgba.R/255.0f,(float)rgba.G/255.0f,(float)rgba.B/255.0f,(float)rgba.A/255.0f); glClear(GL_COLOR_BUFFER_BIT); @@ -811,9 +811,9 @@ bool CDriverGL::clear2D(CRGBA rgba) } // -------------------------------------------------- -bool CDriverGL::clearZBuffer(float zval) +bool CDriverGL3::clearZBuffer(float zval) { - H_AUTO_OGL(CDriverGL_clearZBuffer); + H_AUTO_OGL(CDriverGL3_clearZBuffer); #ifdef USE_OPENGLES glClearDepthf(zval); @@ -828,9 +828,9 @@ bool CDriverGL::clearZBuffer(float zval) } // -------------------------------------------------- -bool CDriverGL::clearStencilBuffer(float stencilval) +bool CDriverGL3::clearStencilBuffer(float stencilval) { - H_AUTO_OGL(CDriverGL_clearStencilBuffer) + H_AUTO_OGL(CDriverGL3_clearStencilBuffer) glClearStencil((int)stencilval); glClear(GL_STENCIL_BUFFER_BIT); @@ -839,16 +839,16 @@ bool CDriverGL::clearStencilBuffer(float stencilval) } // -------------------------------------------------- -void CDriverGL::setColorMask (bool bRed, bool bGreen, bool bBlue, bool bAlpha) +void CDriverGL3::setColorMask (bool bRed, bool bGreen, bool bBlue, bool bAlpha) { - H_AUTO_OGL(CDriverGL_setColorMask ) + H_AUTO_OGL(CDriverGL3_setColorMask ) glColorMask (bRed, bGreen, bBlue, bAlpha); } // -------------------------------------------------- -bool CDriverGL::swapBuffers() +bool CDriverGL3::swapBuffers() { - H_AUTO_OGL(CDriverGL_swapBuffers) + H_AUTO_OGL(CDriverGL3_swapBuffers) ++ _SwapBufferCounter; // Reset texture shaders @@ -1013,9 +1013,9 @@ bool CDriverGL::swapBuffers() } // -------------------------------------------------- -bool CDriverGL::release() +bool CDriverGL3::release() { - H_AUTO_OGL(CDriverGL_release) + H_AUTO_OGL(CDriverGL3_release) // release only if the driver was initialized if (!_Initialized) return true; @@ -1061,9 +1061,9 @@ bool CDriverGL::release() } // -------------------------------------------------- -void CDriverGL::setupViewport (const class CViewport& viewport) +void CDriverGL3::setupViewport (const class CViewport& viewport) { - H_AUTO_OGL(CDriverGL_setupViewport ) + H_AUTO_OGL(CDriverGL3_setupViewport ) if (_win == EmptyWindow) return; @@ -1109,16 +1109,16 @@ void CDriverGL::setupViewport (const class CViewport& viewport) } // -------------------------------------------------- -void CDriverGL::getViewport(CViewport &viewport) +void CDriverGL3::getViewport(CViewport &viewport) { - H_AUTO_OGL(CDriverGL_getViewport) + H_AUTO_OGL(CDriverGL3_getViewport) viewport = _CurrViewport; } // -------------------------------------------------- -void CDriverGL::setupScissor (const class CScissor& scissor) +void CDriverGL3::setupScissor (const class CScissor& scissor) { - H_AUTO_OGL(CDriverGL_setupScissor ) + H_AUTO_OGL(CDriverGL3_setupScissor ) if (_win == EmptyWindow) return; @@ -1178,15 +1178,15 @@ void CDriverGL::setupScissor (const class CScissor& scissor) } } -uint8 CDriverGL::getBitPerPixel () +uint8 CDriverGL3::getBitPerPixel () { - H_AUTO_OGL(CDriverGL_getBitPerPixel ) + H_AUTO_OGL(CDriverGL3_getBitPerPixel ) return _CurrentMode.Depth; } -const char *CDriverGL::getVideocardInformation () +const char *CDriverGL3::getVideocardInformation () { - H_AUTO_OGL(CDriverGL_getVideocardInformation) + H_AUTO_OGL(CDriverGL3_getVideocardInformation) static char name[1024]; if (!_Initialized) return "OpenGL isn't initialized"; @@ -1199,9 +1199,9 @@ const char *CDriverGL::getVideocardInformation () return name; } -bool CDriverGL::clipRect(NLMISC::CRect &rect) +bool CDriverGL3::clipRect(NLMISC::CRect &rect) { - H_AUTO_OGL(CDriverGL_clipRect) + H_AUTO_OGL(CDriverGL3_clipRect) // Clip the wanted rectangle with window. uint32 width, height; getWindowSize(width, height); @@ -1218,9 +1218,9 @@ bool CDriverGL::clipRect(NLMISC::CRect &rect) return rect.Width>0 && rect.Height>0; } -void CDriverGL::getBufferPart (CBitmap &bitmap, NLMISC::CRect &rect) +void CDriverGL3::getBufferPart (CBitmap &bitmap, NLMISC::CRect &rect) { - H_AUTO_OGL(CDriverGL_getBufferPart ) + H_AUTO_OGL(CDriverGL3_getBufferPart ) bitmap.reset(); if(clipRect(rect)) @@ -1230,9 +1230,9 @@ void CDriverGL::getBufferPart (CBitmap &bitmap, NLMISC::CRect &rect) } } -void CDriverGL::getZBufferPart (std::vector &zbuffer, NLMISC::CRect &rect) +void CDriverGL3::getZBufferPart (std::vector &zbuffer, NLMISC::CRect &rect) { - H_AUTO_OGL(CDriverGL_getZBufferPart ) + H_AUTO_OGL(CDriverGL3_getZBufferPart ) zbuffer.clear(); if(clipRect(rect)) @@ -1249,26 +1249,26 @@ void CDriverGL::getZBufferPart (std::vector &zbuffer, NLMISC::CRect &rec } } -void CDriverGL::getZBuffer (std::vector &zbuffer) +void CDriverGL3::getZBuffer (std::vector &zbuffer) { - H_AUTO_OGL(CDriverGL_getZBuffer ) + H_AUTO_OGL(CDriverGL3_getZBuffer ) CRect rect(0,0); getWindowSize(rect.Width, rect.Height); getZBufferPart(zbuffer, rect); } -void CDriverGL::getBuffer (CBitmap &bitmap) +void CDriverGL3::getBuffer (CBitmap &bitmap) { - H_AUTO_OGL(CDriverGL_getBuffer ) + H_AUTO_OGL(CDriverGL3_getBuffer ) CRect rect(0,0); getWindowSize(rect.Width, rect.Height); getBufferPart(bitmap, rect); bitmap.flipV(); } -bool CDriverGL::fillBuffer (CBitmap &bitmap) +bool CDriverGL3::fillBuffer (CBitmap &bitmap) { - H_AUTO_OGL(CDriverGL_fillBuffer ) + H_AUTO_OGL(CDriverGL3_fillBuffer ) CRect rect(0,0); getWindowSize(rect.Width, rect.Height); if( rect.Width!=bitmap.getWidth() || rect.Height!=bitmap.getHeight() || bitmap.getPixelFormat()!=CBitmap::RGBA ) @@ -1296,7 +1296,7 @@ bool CDriverGL::fillBuffer (CBitmap &bitmap) } // *************************************************************************** -void CDriverGL::copyFrameBufferToTexture(ITexture *tex, +void CDriverGL3::copyFrameBufferToTexture(ITexture *tex, uint32 level, uint32 offsetx, uint32 offsety, @@ -1307,22 +1307,22 @@ void CDriverGL::copyFrameBufferToTexture(ITexture *tex, uint cubeFace /*= 0*/ ) { - H_AUTO_OGL(CDriverGL_copyFrameBufferToTexture) + H_AUTO_OGL(CDriverGL3_copyFrameBufferToTexture) bool compressed = false; getGlTextureFormat(*tex, compressed); nlassert(!compressed); // first, mark the texture as valid, and make sure there is a corresponding texture in the device memory setupTexture(*tex); - CTextureDrvInfosGL* gltext = (CTextureDrvInfosGL*)(ITextureDrvInfos*)(tex->TextureDrvShare->DrvTexture); + CTextureDrvInfosGL3* gltext = (CTextureDrvInfosGL3*)(ITextureDrvInfos*)(tex->TextureDrvShare->DrvTexture); //if (_RenderTargetFBO) // gltext->activeFrameBufferObject(NULL); _DriverGLStates.activeTextureARB(0); // setup texture mode, after activeTextureARB() - CDriverGLStates::TTextureMode textureMode= CDriverGLStates::Texture2D; + CDriverGLStates3::TTextureMode textureMode= CDriverGLStates3::Texture2D; #ifndef USE_OPENGLES if(gltext->TextureMode == GL_TEXTURE_RECTANGLE_NV) - textureMode = CDriverGLStates::TextureRect; + textureMode = CDriverGLStates3::TextureRect; #endif _DriverGLStates.setTextureMode(textureMode); @@ -1340,7 +1340,7 @@ void CDriverGL::copyFrameBufferToTexture(ITexture *tex, glCopyTexSubImage2D(gltext->TextureMode, level, offsetx, offsety, x, y, width, height); } // disable texturing. - _DriverGLStates.setTextureMode(CDriverGLStates::TextureDisabled); + _DriverGLStates.setTextureMode(CDriverGLStates3::TextureDisabled); _CurrentTexture[0] = NULL; _CurrentTextureInfoGL[0] = NULL; //if (_RenderTargetFBO) @@ -1348,9 +1348,9 @@ void CDriverGL::copyFrameBufferToTexture(ITexture *tex, } // *************************************************************************** -void CDriverGL::setPolygonMode (TPolygonMode mode) +void CDriverGL3::setPolygonMode (TPolygonMode mode) { - H_AUTO_OGL(CDriverGL_setPolygonMode ) + H_AUTO_OGL(CDriverGL3_setPolygonMode ) IDriver::setPolygonMode (mode); #ifndef USE_OPENGLES @@ -1371,24 +1371,24 @@ void CDriverGL::setPolygonMode (TPolygonMode mode) } // *************************************************************************** -bool CDriverGL::fogEnabled() +bool CDriverGL3::fogEnabled() { - H_AUTO_OGL(CDriverGL_fogEnabled) + H_AUTO_OGL(CDriverGL3_fogEnabled) return _FogEnabled; } // *************************************************************************** -void CDriverGL::enableFog(bool enable) +void CDriverGL3::enableFog(bool enable) { - H_AUTO_OGL(CDriverGL_enableFog) + H_AUTO_OGL(CDriverGL3_enableFog) _DriverGLStates.enableFog(enable); _FogEnabled= enable; } // *************************************************************************** -void CDriverGL::setupFog(float start, float end, CRGBA color) +void CDriverGL3::setupFog(float start, float end, CRGBA color) { - H_AUTO_OGL(CDriverGL_setupFog) + H_AUTO_OGL(CDriverGL3_setupFog) glFogf(GL_FOG_MODE, GL_LINEAR); glFogf(GL_FOG_START, start); glFogf(GL_FOG_END, end); @@ -1422,23 +1422,23 @@ void CDriverGL::setupFog(float start, float end, CRGBA color) } // *************************************************************************** -float CDriverGL::getFogStart() const +float CDriverGL3::getFogStart() const { - H_AUTO_OGL(CDriverGL_getFogStart) + H_AUTO_OGL(CDriverGL3_getFogStart) return _FogStart; } // *************************************************************************** -float CDriverGL::getFogEnd() const +float CDriverGL3::getFogEnd() const { - H_AUTO_OGL(CDriverGL_getFogEnd) + H_AUTO_OGL(CDriverGL3_getFogEnd) return _FogEnd; } // *************************************************************************** -CRGBA CDriverGL::getFogColor() const +CRGBA CDriverGL3::getFogColor() const { - H_AUTO_OGL(CDriverGL_getFogColor) + H_AUTO_OGL(CDriverGL3_getFogColor) CRGBA ret; ret.R= (uint8)(_CurrentFogColor[0]*255); ret.G= (uint8)(_CurrentFogColor[1]*255); @@ -1449,43 +1449,43 @@ CRGBA CDriverGL::getFogColor() const // *************************************************************************** -void CDriverGL::profileRenderedPrimitives(CPrimitiveProfile &pIn, CPrimitiveProfile &pOut) +void CDriverGL3::profileRenderedPrimitives(CPrimitiveProfile &pIn, CPrimitiveProfile &pOut) { - H_AUTO_OGL(CDriverGL_profileRenderedPrimitives) + H_AUTO_OGL(CDriverGL3_profileRenderedPrimitives) pIn= _PrimitiveProfileIn; pOut= _PrimitiveProfileOut; } // *************************************************************************** -uint32 CDriverGL::profileAllocatedTextureMemory() +uint32 CDriverGL3::profileAllocatedTextureMemory() { - H_AUTO_OGL(CDriverGL_profileAllocatedTextureMemory) + H_AUTO_OGL(CDriverGL3_profileAllocatedTextureMemory) return _AllocatedTextureMemory; } // *************************************************************************** -uint32 CDriverGL::profileSetupedMaterials() const +uint32 CDriverGL3::profileSetupedMaterials() const { - H_AUTO_OGL(CDriverGL_profileSetupedMaterials) + H_AUTO_OGL(CDriverGL3_profileSetupedMaterials) return _NbSetupMaterialCall; } // *************************************************************************** -uint32 CDriverGL::profileSetupedModelMatrix() const +uint32 CDriverGL3::profileSetupedModelMatrix() const { - H_AUTO_OGL(CDriverGL_profileSetupedModelMatrix) + H_AUTO_OGL(CDriverGL3_profileSetupedModelMatrix) return _NbSetupModelMatrixCall; } // *************************************************************************** -void CDriverGL::enableUsedTextureMemorySum (bool enable) +void CDriverGL3::enableUsedTextureMemorySum (bool enable) { - H_AUTO_OGL(CDriverGL_enableUsedTextureMemorySum ) + H_AUTO_OGL(CDriverGL3_enableUsedTextureMemorySum ) if (enable) nlinfo ("3D: PERFORMANCE INFO: enableUsedTextureMemorySum has been set to true in CDriverGL"); @@ -1494,19 +1494,19 @@ void CDriverGL::enableUsedTextureMemorySum (bool enable) // *************************************************************************** -uint32 CDriverGL::getUsedTextureMemory() const +uint32 CDriverGL3::getUsedTextureMemory() const { - H_AUTO_OGL(CDriverGL_getUsedTextureMemory) + H_AUTO_OGL(CDriverGL3_getUsedTextureMemory) // Sum memory used uint32 memory=0; // For each texture used - set::const_iterator ite=_TextureUsed.begin(); + set::const_iterator ite=_TextureUsed.begin(); while (ite!=_TextureUsed.end()) { // Get the gl texture - CTextureDrvInfosGL* gltext; + CTextureDrvInfosGL3* gltext; gltext= (*ite); // Sum the memory used by this texture @@ -1522,18 +1522,18 @@ uint32 CDriverGL::getUsedTextureMemory() const // *************************************************************************** -bool CDriverGL::supportTextureShaders() const +bool CDriverGL3::supportTextureShaders() const { - H_AUTO_OGL(CDriverGL_supportTextureShaders) + H_AUTO_OGL(CDriverGL3_supportTextureShaders) // fully supported by NV_TEXTURE_SHADER return _Extensions.NVTextureShader; } // *************************************************************************** -bool CDriverGL::isWaterShaderSupported() const +bool CDriverGL3::isWaterShaderSupported() const { - H_AUTO_OGL(CDriverGL_isWaterShaderSupported); + H_AUTO_OGL(CDriverGL3_isWaterShaderSupported); if(_Extensions.ARBFragmentProgram && ARBWaterShader[0] != 0) return true; @@ -1543,9 +1543,9 @@ bool CDriverGL::isWaterShaderSupported() const } // *************************************************************************** -bool CDriverGL::isTextureAddrModeSupported(CMaterial::TTexAddressingMode /* mode */) const +bool CDriverGL3::isTextureAddrModeSupported(CMaterial::TTexAddressingMode /* mode */) const { - H_AUTO_OGL(CDriverGL_isTextureAddrModeSupported) + H_AUTO_OGL(CDriverGL3_isTextureAddrModeSupported) if (_Extensions.NVTextureShader) { @@ -1559,9 +1559,9 @@ bool CDriverGL::isTextureAddrModeSupported(CMaterial::TTexAddressingMode /* mode } // *************************************************************************** -void CDriverGL::setMatrix2DForTextureOffsetAddrMode(const uint stage, const float mat[4]) +void CDriverGL3::setMatrix2DForTextureOffsetAddrMode(const uint stage, const float mat[4]) { - H_AUTO_OGL(CDriverGL_setMatrix2DForTextureOffsetAddrMode) + H_AUTO_OGL(CDriverGL3_setMatrix2DForTextureOffsetAddrMode) if (!supportTextureShaders()) return; //nlassert(supportTextureShaders()); @@ -1575,9 +1575,9 @@ void CDriverGL::setMatrix2DForTextureOffsetAddrMode(const uint stage, const floa // *************************************************************************** -void CDriverGL::enableNVTextureShader(bool enabled) +void CDriverGL3::enableNVTextureShader(bool enabled) { - H_AUTO_OGL(CDriverGL_enableNVTextureShader) + H_AUTO_OGL(CDriverGL3_enableNVTextureShader) if (enabled != _NVTextureShaderEnabled) { @@ -1596,9 +1596,9 @@ void CDriverGL::enableNVTextureShader(bool enabled) } // *************************************************************************** -void CDriverGL::checkForPerPixelLightingSupport() +void CDriverGL3::checkForPerPixelLightingSupport() { - H_AUTO_OGL(CDriverGL_checkForPerPixelLightingSupport) + H_AUTO_OGL(CDriverGL3_checkForPerPixelLightingSupport) // we need at least 3 texture stages and cube map support + EnvCombine4 or 3 support // TODO : support for EnvCombine3 @@ -1616,17 +1616,17 @@ void CDriverGL::checkForPerPixelLightingSupport() } // *************************************************************************** -bool CDriverGL::supportPerPixelLighting(bool specular) const +bool CDriverGL3::supportPerPixelLighting(bool specular) const { - H_AUTO_OGL(CDriverGL_supportPerPixelLighting) + H_AUTO_OGL(CDriverGL3_supportPerPixelLighting) return specular ? _SupportPerPixelShader : _SupportPerPixelShaderNoSpec; } // *************************************************************************** -void CDriverGL::setPerPixelLightingLight(CRGBA diffuse, CRGBA specular, float shininess) +void CDriverGL3::setPerPixelLightingLight(CRGBA diffuse, CRGBA specular, float shininess) { - H_AUTO_OGL(CDriverGL_setPerPixelLightingLight) + H_AUTO_OGL(CDriverGL3_setPerPixelLightingLight) _PPLExponent = shininess; _PPLightDiffuseColor = diffuse; @@ -1634,16 +1634,16 @@ void CDriverGL::setPerPixelLightingLight(CRGBA diffuse, CRGBA specular, float sh } // *************************************************************************** -bool CDriverGL::supportBlendConstantColor() const +bool CDriverGL3::supportBlendConstantColor() const { - H_AUTO_OGL(CDriverGL_supportBlendConstantColor) + H_AUTO_OGL(CDriverGL3_supportBlendConstantColor) return _Extensions.EXTBlendColor; } // *************************************************************************** -void CDriverGL::setBlendConstantColor(NLMISC::CRGBA col) +void CDriverGL3::setBlendConstantColor(NLMISC::CRGBA col) { - H_AUTO_OGL(CDriverGL_setBlendConstantColor) + H_AUTO_OGL(CDriverGL3_setBlendConstantColor) // bkup _CurrentBlendConstantColor= col; @@ -1659,24 +1659,24 @@ void CDriverGL::setBlendConstantColor(NLMISC::CRGBA col) } // *************************************************************************** -NLMISC::CRGBA CDriverGL::getBlendConstantColor() const +NLMISC::CRGBA CDriverGL3::getBlendConstantColor() const { - H_AUTO_OGL(CDriverGL_CDriverGL) + H_AUTO_OGL(CDriverGL3_CDriverGL) return _CurrentBlendConstantColor; } // *************************************************************************** -uint CDriverGL::getNbTextureStages() const +uint CDriverGL3::getNbTextureStages() const { - H_AUTO_OGL(CDriverGL_getNbTextureStages) + H_AUTO_OGL(CDriverGL3_getNbTextureStages) return inlGetNumTextStages(); } // *************************************************************************** -void CDriverGL::refreshProjMatrixFromGL() +void CDriverGL3::refreshProjMatrixFromGL() { - H_AUTO_OGL(CDriverGL_refreshProjMatrixFromGL) + H_AUTO_OGL(CDriverGL3_refreshProjMatrixFromGL) if (!_ProjMatDirty) return; float mat[16]; @@ -1686,18 +1686,18 @@ void CDriverGL::refreshProjMatrixFromGL() } // *************************************************************************** -bool CDriverGL::supportEMBM() const +bool CDriverGL3::supportEMBM() const { - H_AUTO_OGL(CDriverGL_supportEMBM); + H_AUTO_OGL(CDriverGL3_supportEMBM); // For now, supported via ATI extension return _Extensions.ATIEnvMapBumpMap; } // *************************************************************************** -bool CDriverGL::isEMBMSupportedAtStage(uint stage) const +bool CDriverGL3::isEMBMSupportedAtStage(uint stage) const { - H_AUTO_OGL(CDriverGL_isEMBMSupportedAtStage) + H_AUTO_OGL(CDriverGL3_isEMBMSupportedAtStage) nlassert(supportEMBM()); nlassert(stage < IDRV_MAT_MAXTEXTURES); @@ -1705,9 +1705,9 @@ bool CDriverGL::isEMBMSupportedAtStage(uint stage) const } // *************************************************************************** -void CDriverGL::setEMBMMatrix(const uint stage,const float mat[4]) +void CDriverGL3::setEMBMMatrix(const uint stage,const float mat[4]) { - H_AUTO_OGL(CDriverGL_setEMBMMatrix) + H_AUTO_OGL(CDriverGL3_setEMBMMatrix) #ifndef USE_OPENGLES nlassert(supportEMBM()); @@ -1722,9 +1722,9 @@ void CDriverGL::setEMBMMatrix(const uint stage,const float mat[4]) } // *************************************************************************** -void CDriverGL::initEMBM() +void CDriverGL3::initEMBM() { - H_AUTO_OGL(CDriverGL_initEMBM); + H_AUTO_OGL(CDriverGL3_initEMBM); #ifndef USE_OPENGLES if (supportEMBM()) @@ -1963,7 +1963,7 @@ uint loadARBFragmentProgramStringNative(const char *prog, bool forceNativeProgra */ static void fetchPerturbedEnvMapR200() { - H_AUTO_OGL(CDriverGL_fetchPerturbedEnvMapR200); + H_AUTO_OGL(CDriverGL3_fetchPerturbedEnvMapR200); #ifndef USE_OPENGLES //////////// @@ -1984,15 +1984,15 @@ static void fetchPerturbedEnvMapR200() } // *************************************************************************** -void CDriverGL::forceNativeFragmentPrograms(bool nativeOnly) +void CDriverGL3::forceNativeFragmentPrograms(bool nativeOnly) { _ForceNativeFragmentPrograms = nativeOnly; } // *************************************************************************** -void CDriverGL::initFragmentShaders() +void CDriverGL3::initFragmentShaders() { - H_AUTO_OGL(CDriverGL_initFragmentShaders); + H_AUTO_OGL(CDriverGL3_initFragmentShaders); #ifndef USE_OPENGLES /////////////////// @@ -2107,9 +2107,9 @@ void CDriverGL::initFragmentShaders() } // *************************************************************************** -void CDriverGL::deleteARBFragmentPrograms() +void CDriverGL3::deleteARBFragmentPrograms() { - H_AUTO_OGL(CDriverGL_deleteARBFragmentPrograms); + H_AUTO_OGL(CDriverGL3_deleteARBFragmentPrograms); #ifndef USE_OPENGLES for(uint k = 0; k < 4; ++k) @@ -2125,9 +2125,9 @@ void CDriverGL::deleteARBFragmentPrograms() } // *************************************************************************** -void CDriverGL::deleteFragmentShaders() +void CDriverGL3::deleteFragmentShaders() { - H_AUTO_OGL(CDriverGL_deleteFragmentShaders) + H_AUTO_OGL(CDriverGL3_deleteFragmentShaders) #ifndef USE_OPENGLES deleteARBFragmentPrograms(); @@ -2151,23 +2151,23 @@ void CDriverGL::deleteFragmentShaders() } // *************************************************************************** -void CDriverGL::finish() +void CDriverGL3::finish() { - H_AUTO_OGL(CDriverGL_finish) + H_AUTO_OGL(CDriverGL3_finish) glFinish(); } // *************************************************************************** -void CDriverGL::flush() +void CDriverGL3::flush() { - H_AUTO_OGL(CDriverGL_flush) + H_AUTO_OGL(CDriverGL3_flush) glFlush(); } // *************************************************************************** -void CDriverGL::setSwapVBLInterval(uint interval) +void CDriverGL3::setSwapVBLInterval(uint interval) { - H_AUTO_OGL(CDriverGL_setSwapVBLInterval) + H_AUTO_OGL(CDriverGL3_setSwapVBLInterval) if (!_Initialized) return; @@ -2208,9 +2208,9 @@ void CDriverGL::setSwapVBLInterval(uint interval) } // *************************************************************************** -uint CDriverGL::getSwapVBLInterval() +uint CDriverGL3::getSwapVBLInterval() { - H_AUTO_OGL(CDriverGL_getSwapVBLInterval) + H_AUTO_OGL(CDriverGL3_getSwapVBLInterval) #ifdef USE_OPENGLES #elif defined(NL_OS_WINDOWS) @@ -2238,9 +2238,9 @@ uint CDriverGL::getSwapVBLInterval() } // *************************************************************************** -void CDriverGL::enablePolygonSmoothing(bool smooth) +void CDriverGL3::enablePolygonSmoothing(bool smooth) { - H_AUTO_OGL(CDriverGL_enablePolygonSmoothing); + H_AUTO_OGL(CDriverGL3_enablePolygonSmoothing); #ifndef USE_OPENGLES if(smooth) @@ -2253,15 +2253,15 @@ void CDriverGL::enablePolygonSmoothing(bool smooth) } // *************************************************************************** -bool CDriverGL::isPolygonSmoothingEnabled() const +bool CDriverGL3::isPolygonSmoothingEnabled() const { - H_AUTO_OGL(CDriverGL_isPolygonSmoothingEnabled) + H_AUTO_OGL(CDriverGL3_isPolygonSmoothingEnabled) return _PolygonSmooth; } // *************************************************************************** -void CDriverGL::startProfileVBHardLock() +void CDriverGL3::startProfileVBHardLock() { if(_VBHardProfiling) return; @@ -2275,7 +2275,7 @@ void CDriverGL::startProfileVBHardLock() } // *************************************************************************** -void CDriverGL::endProfileVBHardLock(vector &result) +void CDriverGL3::endProfileVBHardLock(vector &result) { if(!_VBHardProfiling) return; @@ -2313,7 +2313,7 @@ void CDriverGL::endProfileVBHardLock(vector &result) } // *************************************************************************** -void CDriverGL::appendVBHardLockProfile(NLMISC::TTicks time, CVertexBuffer *vb) +void CDriverGL3::appendVBHardLockProfile(NLMISC::TTicks time, CVertexBuffer *vb) { // must allocate a new place? if(_CurVBHardLockCount>=_VBHardProfiles.size()) @@ -2338,25 +2338,25 @@ void CDriverGL::appendVBHardLockProfile(NLMISC::TTicks time, CVertexBuffer *vb) } // *************************************************************************** -void CDriverGL::startProfileIBLock() +void CDriverGL3::startProfileIBLock() { // not implemented } // *************************************************************************** -void CDriverGL::endProfileIBLock(std::vector &/* result */) +void CDriverGL3::endProfileIBLock(std::vector &/* result */) { // not implemented } // *************************************************************************** -void CDriverGL::profileIBAllocation(std::vector &/* result */) +void CDriverGL3::profileIBAllocation(std::vector &/* result */) { // not implemented } // *************************************************************************** -void CDriverGL::profileVBHardAllocation(std::vector &result) +void CDriverGL3::profileVBHardAllocation(std::vector &result) { result.clear(); result.reserve(1000); @@ -2392,9 +2392,9 @@ void CDriverGL::profileVBHardAllocation(std::vector &result) } // *************************************************************************** -bool CDriverGL::supportCloudRenderSinglePass() const +bool CDriverGL3::supportCloudRenderSinglePass() const { - H_AUTO_OGL(CDriverGL_supportCloudRenderSinglePass) + H_AUTO_OGL(CDriverGL3_supportCloudRenderSinglePass) //return _Extensions.NVTextureEnvCombine4 || (_Extensions.ATIXTextureEnvRoute && _Extensions.EXTTextureEnvCombine); // there are slowdown for now with ati fragment shader... don't know why @@ -2402,9 +2402,9 @@ bool CDriverGL::supportCloudRenderSinglePass() const } // *************************************************************************** -void CDriverGL::retrieveATIDriverVersion() +void CDriverGL3::retrieveATIDriverVersion() { - H_AUTO_OGL(CDriverGL_retrieveATIDriverVersion) + H_AUTO_OGL(CDriverGL3_retrieveATIDriverVersion) _ATIDriverVersion = 0; // we may need this driver version to fix flaws of previous ati drivers version (fog issue with V.P) #ifdef NL_OS_WINDOWS @@ -2510,25 +2510,25 @@ void CDriverGL::retrieveATIDriverVersion() } // *************************************************************************** -bool CDriverGL::supportMADOperator() const +bool CDriverGL3::supportMADOperator() const { - H_AUTO_OGL(CDriverGL_supportMADOperator) + H_AUTO_OGL(CDriverGL3_supportMADOperator) return _Extensions.NVTextureEnvCombine4 || _Extensions.ATITextureEnvCombine3; } // *************************************************************************** -uint CDriverGL::getNumAdapter() const +uint CDriverGL3::getNumAdapter() const { - H_AUTO_OGL(CDriverGL_getNumAdapter) + H_AUTO_OGL(CDriverGL3_getNumAdapter) return 1; } // *************************************************************************** -bool CDriverGL::getAdapter(uint adapter, CAdapter &desc) const +bool CDriverGL3::getAdapter(uint adapter, CAdapter &desc) const { - H_AUTO_OGL(CDriverGL_getAdapter) + H_AUTO_OGL(CDriverGL3_getAdapter) if (adapter == 0) { @@ -2548,43 +2548,43 @@ bool CDriverGL::getAdapter(uint adapter, CAdapter &desc) const } // *************************************************************************** -bool CDriverGL::setAdapter(uint adapter) +bool CDriverGL3::setAdapter(uint adapter) { - H_AUTO_OGL(CDriverGL_setAdapter) + H_AUTO_OGL(CDriverGL3_setAdapter) return adapter == 0; } // *************************************************************************** -CVertexBuffer::TVertexColorType CDriverGL::getVertexColorFormat() const +CVertexBuffer::TVertexColorType CDriverGL3::getVertexColorFormat() const { - H_AUTO_OGL(CDriverGL_CDriverGL) + H_AUTO_OGL(CDriverGL3_CDriverGL) return CVertexBuffer::TRGBA; } // *************************************************************************** -bool CDriverGL::activeShader(CShader * /* shd */) +bool CDriverGL3::activeShader(CShader * /* shd */) { - H_AUTO_OGL(CDriverGL_activeShader) + H_AUTO_OGL(CDriverGL3_activeShader) return false; } // *************************************************************************** -void CDriverGL::startBench (bool wantStandardDeviation, bool quick, bool reset) +void CDriverGL3::startBench (bool wantStandardDeviation, bool quick, bool reset) { CHTimer::startBench (wantStandardDeviation, quick, reset); } // *************************************************************************** -void CDriverGL::endBench () +void CDriverGL3::endBench () { CHTimer::endBench (); } // *************************************************************************** -void CDriverGL::displayBench (class NLMISC::CLog *log) +void CDriverGL3::displayBench (class NLMISC::CLog *log) { // diplay CHTimer::displayHierarchicalByExecutionPathSorted(log, CHTimer::TotalTime, true, 48, 2); @@ -2595,18 +2595,18 @@ void CDriverGL::displayBench (class NLMISC::CLog *log) } #ifdef NL_DEBUG -void CDriverGL::dumpMappedBuffers() +void CDriverGL3::dumpMappedBuffers() { _AGPVertexArrayRange->dumpMappedBuffers(); } #endif // *************************************************************************** -void CDriverGL::checkTextureOn() const +void CDriverGL3::checkTextureOn() const { - H_AUTO_OGL(CDriverGL_checkTextureOn) + H_AUTO_OGL(CDriverGL3_checkTextureOn) // tmp for debug - CDriverGLStates &dgs = const_cast(_DriverGLStates); + CDriverGLStates3 &dgs = const_cast(_DriverGLStates); uint currTexStage = dgs.getActiveTextureARB(); for(uint k = 0; k < this->getNbTextureStages(); ++k) { @@ -2623,19 +2623,19 @@ void CDriverGL::checkTextureOn() const #endif switch(dgs.getTextureMode()) { - case CDriverGLStates::TextureDisabled: + case CDriverGLStates3::TextureDisabled: nlassert(!flag2D); nlassert(!flagCM); break; - case CDriverGLStates::Texture2D: + case CDriverGLStates3::Texture2D: nlassert(flag2D); nlassert(!flagCM); break; - case CDriverGLStates::TextureRect: + case CDriverGLStates3::TextureRect: nlassert(flagTR); nlassert(!flagCM); break; - case CDriverGLStates::TextureCubeMap: + case CDriverGLStates3::TextureCubeMap: nlassert(!flag2D); nlassert(flagCM); break; @@ -2647,47 +2647,47 @@ void CDriverGL::checkTextureOn() const } // *************************************************************************** -bool CDriverGL::supportOcclusionQuery() const +bool CDriverGL3::supportOcclusionQuery() const { - H_AUTO_OGL(CDriverGL_supportOcclusionQuery) + H_AUTO_OGL(CDriverGL3_supportOcclusionQuery) return _Extensions.NVOcclusionQuery; } // *************************************************************************** -bool CDriverGL::supportTextureRectangle() const +bool CDriverGL3::supportTextureRectangle() const { - H_AUTO_OGL(CDriverGL_supportTextureRectangle); + H_AUTO_OGL(CDriverGL3_supportTextureRectangle); return (_Extensions.NVTextureRectangle || _Extensions.EXTTextureRectangle || _Extensions.ARBTextureRectangle); } // *************************************************************************** -bool CDriverGL::supportPackedDepthStencil() const +bool CDriverGL3::supportPackedDepthStencil() const { - H_AUTO_OGL(CDriverGL_supportPackedDepthStencil); + H_AUTO_OGL(CDriverGL3_supportPackedDepthStencil); return _Extensions.PackedDepthStencil; } // *************************************************************************** -bool CDriverGL::supportFrameBufferObject() const +bool CDriverGL3::supportFrameBufferObject() const { - H_AUTO_OGL(CDriverGL_supportFrameBufferObject); + H_AUTO_OGL(CDriverGL3_supportFrameBufferObject); return _Extensions.FrameBufferObject; } // *************************************************************************** -IOcclusionQuery *CDriverGL::createOcclusionQuery() +IOcclusionQuery *CDriverGL3::createOcclusionQuery() { - H_AUTO_OGL(CDriverGL_createOcclusionQuery) + H_AUTO_OGL(CDriverGL3_createOcclusionQuery) nlassert(_Extensions.NVOcclusionQuery); #ifndef USE_OPENGLES GLuint id; nglGenOcclusionQueriesNV(1, &id); if (id == 0) return NULL; - COcclusionQueryGL *oqgl = new COcclusionQueryGL; + COcclusionQueryGL3 *oqgl = new COcclusionQueryGL3; oqgl->Driver = this; oqgl->ID = id; oqgl->OcclusionType = IOcclusionQuery::NotAvailable; @@ -2701,14 +2701,14 @@ IOcclusionQuery *CDriverGL::createOcclusionQuery() } // *************************************************************************** -void CDriverGL::deleteOcclusionQuery(IOcclusionQuery *oq) +void CDriverGL3::deleteOcclusionQuery(IOcclusionQuery *oq) { - H_AUTO_OGL(CDriverGL_deleteOcclusionQuery); + H_AUTO_OGL(CDriverGL3_deleteOcclusionQuery); #ifndef USE_OPENGLES if (!oq) return; - COcclusionQueryGL *oqgl = NLMISC::safe_cast(oq); - nlassert((CDriverGL *) oqgl->Driver == this); // should come from the same driver + COcclusionQueryGL3 *oqgl = NLMISC::safe_cast(oq); + nlassert((CDriverGL3 *) oqgl->Driver == this); // should come from the same driver oqgl->Driver = NULL; nlassert(oqgl->ID != 0); GLuint id = oqgl->ID; @@ -2723,9 +2723,9 @@ void CDriverGL::deleteOcclusionQuery(IOcclusionQuery *oq) } // *************************************************************************** -void COcclusionQueryGL::begin() +void COcclusionQueryGL3::begin() { - H_AUTO_OGL(COcclusionQueryGL_begin); + H_AUTO_OGL(COcclusionQueryGL3_begin); #ifndef USE_OPENGLES nlassert(Driver); @@ -2739,9 +2739,9 @@ void COcclusionQueryGL::begin() } // *************************************************************************** -void COcclusionQueryGL::end() +void COcclusionQueryGL3::end() { - H_AUTO_OGL(COcclusionQueryGL_end); + H_AUTO_OGL(COcclusionQueryGL3_end); #ifndef USE_OPENGLES nlassert(Driver); @@ -2753,9 +2753,9 @@ void COcclusionQueryGL::end() } // *************************************************************************** -IOcclusionQuery::TOcclusionType COcclusionQueryGL::getOcclusionType() +IOcclusionQuery::TOcclusionType COcclusionQueryGL3::getOcclusionType() { - H_AUTO_OGL(COcclusionQueryGL_getOcclusionType); + H_AUTO_OGL(COcclusionQueryGL3_getOcclusionType); #ifndef USE_OPENGLES nlassert(Driver); @@ -2779,9 +2779,9 @@ IOcclusionQuery::TOcclusionType COcclusionQueryGL::getOcclusionType() } // *************************************************************************** -uint COcclusionQueryGL::getVisibleCount() +uint COcclusionQueryGL3::getVisibleCount() { - H_AUTO_OGL(COcclusionQueryGL_getVisibleCount) + H_AUTO_OGL(COcclusionQueryGL3_getVisibleCount) nlassert(Driver); nlassert(ID); nlassert(Driver->_CurrentOcclusionQuery != this); // can't query result between a begin/end pair! @@ -2790,51 +2790,51 @@ uint COcclusionQueryGL::getVisibleCount() } // *************************************************************************** -void CDriverGL::setDepthRange(float znear, float zfar) +void CDriverGL3::setDepthRange(float znear, float zfar) { - H_AUTO_OGL(CDriverGL_setDepthRange) + H_AUTO_OGL(CDriverGL3_setDepthRange) _DriverGLStates.setDepthRange(znear, zfar); } // *************************************************************************** -void CDriverGL::getDepthRange(float &znear, float &zfar) const +void CDriverGL3::getDepthRange(float &znear, float &zfar) const { - H_AUTO_OGL(CDriverGL_getDepthRange) + H_AUTO_OGL(CDriverGL3_getDepthRange) _DriverGLStates.getDepthRange(znear, zfar); } // *************************************************************************** -void CDriverGL::setCullMode(TCullMode cullMode) +void CDriverGL3::setCullMode(TCullMode cullMode) { - H_AUTO_OGL(CDriverGL_setCullMode) - _DriverGLStates.setCullMode((CDriverGLStates::TCullMode) cullMode); + H_AUTO_OGL(CDriverGL3_setCullMode) + _DriverGLStates.setCullMode((CDriverGLStates3::TCullMode) cullMode); } // *************************************************************************** -CDriverGL::TCullMode CDriverGL::getCullMode() const +CDriverGL3::TCullMode CDriverGL3::getCullMode() const { - H_AUTO_OGL(CDriverGL_CDriverGL) - return (CDriverGL::TCullMode) _DriverGLStates.getCullMode(); + H_AUTO_OGL(CDriverGL3_CDriverGL) + return (CDriverGL3::TCullMode) _DriverGLStates.getCullMode(); } // *************************************************************************** -void CDriverGL::enableStencilTest(bool enable) +void CDriverGL3::enableStencilTest(bool enable) { - H_AUTO_OGL(CDriverGL_CDriverGL) + H_AUTO_OGL(CDriverGL3_CDriverGL) _DriverGLStates.enableStencilTest(enable); } // *************************************************************************** -bool CDriverGL::isStencilTestEnabled() const +bool CDriverGL3::isStencilTestEnabled() const { - H_AUTO_OGL(CDriverGL_CDriverGL) + H_AUTO_OGL(CDriverGL3_CDriverGL) return _DriverGLStates.isStencilTestEnabled(); } // *************************************************************************** -void CDriverGL::stencilFunc(TStencilFunc stencilFunc, int ref, uint mask) +void CDriverGL3::stencilFunc(TStencilFunc stencilFunc, int ref, uint mask) { - H_AUTO_OGL(CDriverGL_CDriverGL) + H_AUTO_OGL(CDriverGL3_CDriverGL) GLenum glstencilFunc = 0; @@ -2855,9 +2855,9 @@ void CDriverGL::stencilFunc(TStencilFunc stencilFunc, int ref, uint mask) } // *************************************************************************** -void CDriverGL::stencilOp(TStencilOp fail, TStencilOp zfail, TStencilOp zpass) +void CDriverGL3::stencilOp(TStencilOp fail, TStencilOp zfail, TStencilOp zpass) { - H_AUTO_OGL(CDriverGL_CDriverGL) + H_AUTO_OGL(CDriverGL3_CDriverGL) GLenum glFail = 0, glZFail = 0, glZPass = 0; @@ -2898,27 +2898,27 @@ void CDriverGL::stencilOp(TStencilOp fail, TStencilOp zfail, TStencilOp zpass) } // *************************************************************************** -void CDriverGL::stencilMask(uint mask) +void CDriverGL3::stencilMask(uint mask) { - H_AUTO_OGL(CDriverGL_CDriverGL) + H_AUTO_OGL(CDriverGL3_CDriverGL) _DriverGLStates.stencilMask((GLuint)mask); } // *************************************************************************** -void CDriverGL::getNumPerStageConstant(uint &lightedMaterial, uint &unlightedMaterial) const +void CDriverGL3::getNumPerStageConstant(uint &lightedMaterial, uint &unlightedMaterial) const { lightedMaterial = inlGetNumTextStages(); unlightedMaterial = inlGetNumTextStages(); } // *************************************************************************** -void CDriverGL::beginDialogMode() +void CDriverGL3::beginDialogMode() { } // *************************************************************************** -void CDriverGL::endDialogMode() +void CDriverGL3::endDialogMode() { } diff --git a/code/nel/src/3d/driver/OpenGL3/driver_opengl.h b/code/nel/src/3d/driver/OpenGL3/driver_opengl.h index bfe73492d..87cc957b4 100644 --- a/code/nel/src/3d/driver/OpenGL3/driver_opengl.h +++ b/code/nel/src/3d/driver/OpenGL3/driver_opengl.h @@ -95,48 +95,44 @@ using NLMISC::CVector; namespace NL3D { #ifdef NL_STATIC -#ifdef USE_OPENGLES -namespace NLDRIVERGLES { -#else -namespace NLDRIVERGL { -#endif +namespace NLDRIVERGL3 { #endif -class CDriverGL; +class CDriverGL3; class IVertexArrayRange; class IVertexBufferHardGL; -class COcclusionQueryGL; +class COcclusionQueryGL3; void displayGLError(GLenum error); #ifdef NL_OS_WINDOWS -bool GlWndProc(CDriverGL *driver, HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam); +bool GlWndProc(CDriverGL3 *driver, HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam); typedef HCURSOR nlCursor; #define EmptyCursor (nlCursor)NULL #elif defined (NL_OS_MAC) -bool GlWndProc(CDriverGL *driver, const void* e); +bool GlWndProc(CDriverGL3 *driver, const void* e); typedef void* nlCursor; #define EmptyCursor (nlCursor)NULL #elif defined (NL_OS_UNIX) -bool GlWndProc(CDriverGL *driver, XEvent &e); +bool GlWndProc(CDriverGL3 *driver, XEvent &e); typedef Cursor nlCursor; #define EmptyCursor None #endif -typedef std::list TOcclusionQueryList; +typedef std::list TOcclusionQueryList; // *************************************************************************** -class COcclusionQueryGL : public IOcclusionQuery +class COcclusionQueryGL3 : public IOcclusionQuery { public: GLuint ID; // id of gl object - NLMISC::CRefPtr Driver; // owner driver + NLMISC::CRefPtr Driver; // owner driver TOcclusionQueryList::iterator Iterator; // iterator in owner driver list of queries TOcclusionType OcclusionType; // current type of occlusion uint VisibleCount; // number of samples that passed the test @@ -148,7 +144,7 @@ public: }; // *************************************************************************** -class CTextureDrvInfosGL : public ITextureDrvInfos +class CTextureDrvInfosGL3 : public ITextureDrvInfos { public: /* @@ -165,7 +161,7 @@ public: // This is the computed size of what memory this texture take. uint32 TextureMemory; // This is the owner driver. - CDriverGL *_Driver; + CDriverGL3 *_Driver; // enum to use for this texture (GL_TEXTURE_2D, GL_TEXTURE_RECTANGLE_NV..) GLenum TextureMode; @@ -188,9 +184,9 @@ public: ITexture::TMinFilter MinFilter; // The gl id is auto created here. - CTextureDrvInfosGL(IDriver *drv, ItTexDrvInfoPtrMap it, CDriverGL *drvGl, bool isRectangleTexture); + CTextureDrvInfosGL3(IDriver *drv, ItTexDrvInfoPtrMap it, CDriverGL3 *drvGl, bool isRectangleTexture); // The gl id is auto deleted here. - ~CTextureDrvInfosGL(); + ~CTextureDrvInfosGL3(); // For Debug info. return the memory cost of this texture virtual uint getTextureMemoryUsed() const {return TextureMemory;} @@ -200,26 +196,26 @@ public: // *************************************************************************** -class CVBDrvInfosGL : public IVBDrvInfos +class CVBDrvInfosGL3 : public IVBDrvInfos { public: - CVBDrvInfosGL(CDriverGL *drv, ItVBDrvInfoPtrList it, CVertexBuffer *vb); + CVBDrvInfosGL3(CDriverGL3 *drv, ItVBDrvInfoPtrList it, CVertexBuffer *vb); // Verex buffer hard ? IVertexBufferHardGL *_VBHard; - class CDriverGL *_DriverGL; + class CDriverGL3 *_DriverGL; uint8 *_SystemMemory; // From IVBDrvInfos - virtual ~CVBDrvInfosGL(); + virtual ~CVBDrvInfosGL3(); virtual uint8 *lock (uint first, uint last, bool readOnly); virtual void unlock (uint first, uint last); }; // *************************************************************************** -class CShaderGL : public IMaterialDrvInfos +class CShaderGL3 : public IMaterialDrvInfos { public: GLenum SrcBlend; @@ -239,7 +235,7 @@ public: // The supported Shader type. CMaterial::TShader SupportedShader; - CShaderGL(IDriver *drv, ItMatDrvInfoPtrList it) : IMaterialDrvInfos(drv, it) {} + CShaderGL3(IDriver *drv, ItMatDrvInfoPtrList it) : IMaterialDrvInfos(drv, it) {} }; @@ -291,15 +287,15 @@ public: // *************************************************************************** -class CDriverGL : public IDriver +class CDriverGL3 : public IDriver { public: // Some constants enum { MaxLight=8 }; - CDriverGL(); - virtual ~CDriverGL(); + CDriverGL3(); + virtual ~CDriverGL3(); virtual bool isLost() const { return false; } // there's no notion of 'lost device" in OpenGL @@ -690,8 +686,8 @@ public: private: virtual class IVertexBufferHardGL *createVertexBufferHard(uint size, uint numVertices, CVertexBuffer::TPreferredMemory vbType, CVertexBuffer *vb); - friend class CTextureDrvInfosGL; - friend class CVertexProgamDrvInfosGL; + friend class CTextureDrvInfosGL3; + friend class CVertexProgamDrvInfosGL3; private: // Version of the driver. Not the interface version!! Increment when implementation of the driver change. @@ -784,7 +780,7 @@ private: bool convertBitmapToIcon(const NLMISC::CBitmap &bitmap, HICON &icon, uint iconWidth, uint iconHeight, uint iconDepth, const NLMISC::CRGBA &col = NLMISC::CRGBA::White, sint hotSpotX = 0, sint hotSpotY = 0, bool cursor = false); - friend bool GlWndProc(CDriverGL *driver, HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam); + friend bool GlWndProc(CDriverGL3 *driver, HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam); static uint _Registered; DEVMODE _OldScreenMode; @@ -806,7 +802,7 @@ private: bool convertBitmapToIcon(const NLMISC::CBitmap &bitmap, std::vector &icon); - friend bool GlWndProc(CDriverGL *driver, XEvent &e); + friend bool GlWndProc(CDriverGL3 *driver, XEvent &e); Display* _dpy; NLMISC::CUnixEventEmitter _EventEmitter; @@ -940,7 +936,7 @@ private: */ ITexture* _CurrentTexture[IDRV_MAT_MAXTEXTURES]; - CTextureDrvInfosGL* _CurrentTextureInfoGL[IDRV_MAT_MAXTEXTURES]; + CTextureDrvInfosGL3* _CurrentTextureInfoGL[IDRV_MAT_MAXTEXTURES]; CMaterial::CTexEnv _CurrentTexEnv[IDRV_MAT_MAXTEXTURES]; // Special Texture Environnement. CTexEnvSpecial _CurrentTexEnvSpecial[IDRV_MAT_MAXTEXTURES]; @@ -960,7 +956,7 @@ private: float _AnisotropicFilter; // Prec settings for material. - CDriverGLStates _DriverGLStates; + CDriverGLStates3 _DriverGLStates; // Optim: To not test change in Materials states if just texture has changed. Very useful for landscape. uint32 _MaterialAllTextureTouchedFlag; @@ -1044,7 +1040,7 @@ private: } void forceActivateTexEnvColor(uint stage, const CMaterial::CTexEnv &env) { - H_AUTO_OGL(CDriverGL_forceActivateTexEnvColor) + H_AUTO_OGL(CDriverGL3_forceActivateTexEnvColor) forceActivateTexEnvColor(stage, env.ConstantColor); } @@ -1236,7 +1232,7 @@ private: friend class CVertexBufferHardGLATI; friend class CVertexArrayRangeMapObjectATI; friend class CVertexBufferHardGLMapObjectATI; - friend class CVBDrvInfosGL; + friend class CVBDrvInfosGL3; // The VertexArrayRange activated. IVertexArrayRange *_CurrentVertexArrayRange; @@ -1273,7 +1269,7 @@ private: uint32 _NbSetupMaterialCall; uint32 _NbSetupModelMatrixCall; bool _SumTextureMemoryUsed; - std::set _TextureUsed; + std::set _TextureUsed; uint computeMipMapMemoryUsage(uint w, uint h, GLint glfmt) const; // VBHard Lock Profiling @@ -1462,7 +1458,7 @@ public: static CMaterial::CTexEnv _TexEnvReplace; // occlusion query TOcclusionQueryList _OcclusionQueryList; - COcclusionQueryGL *_CurrentOcclusionQuery; + COcclusionQueryGL3 *_CurrentOcclusionQuery; protected: // is the window active , bool _WndActive; @@ -1494,7 +1490,7 @@ private: }; // *************************************************************************** -class CVertexProgamDrvInfosGL : public IVertexProgramDrvInfos +class CVertexProgamDrvInfosGL3 : public IVertexProgramDrvInfos { public: // The GL Id. @@ -1506,7 +1502,7 @@ public: /** EXTVertexShader specific * handle of allocated variants */ - GLuint Variants[CDriverGL::EVSNumVariants]; + GLuint Variants[CDriverGL3::EVSNumVariants]; /** EXTVertexShader specific * Used input registers. * This allow to activate only the gl arrays that are needed by a given shader. @@ -1515,7 +1511,7 @@ public: // The gl id is auto created here. - CVertexProgamDrvInfosGL (CDriverGL *drv, ItVtxPrgDrvInfoPtrList it); + CVertexProgamDrvInfosGL3 (CDriverGL3 *drv, ItVtxPrgDrvInfoPtrList it); }; #ifdef NL_STATIC 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 d38ff8f51..bc15e3aef 100644 --- a/code/nel/src/3d/driver/OpenGL3/driver_opengl_extension.cpp +++ b/code/nel/src/3d/driver/OpenGL3/driver_opengl_extension.cpp @@ -525,7 +525,7 @@ namespace NL3D { #ifdef USE_OPENGLES namespace NLDRIVERGLES { #else -namespace NLDRIVERGL { +namespace NLDRIVERGL3 { #endif #endif 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 9d28a15ab..62937839a 100644 --- a/code/nel/src/3d/driver/OpenGL3/driver_opengl_extension.h +++ b/code/nel/src/3d/driver/OpenGL3/driver_opengl_extension.h @@ -29,7 +29,7 @@ namespace NL3D { #ifdef USE_OPENGLES namespace NLDRIVERGLES { #else -namespace NLDRIVERGL { +namespace NLDRIVERGL3 { #endif #endif diff --git a/code/nel/src/3d/driver/OpenGL3/driver_opengl_inputs.cpp b/code/nel/src/3d/driver/OpenGL3/driver_opengl_inputs.cpp index 4064c8819..867db3233 100644 --- a/code/nel/src/3d/driver/OpenGL3/driver_opengl_inputs.cpp +++ b/code/nel/src/3d/driver/OpenGL3/driver_opengl_inputs.cpp @@ -41,12 +41,12 @@ namespace NL3D { #ifdef USE_OPENGLES namespace NLDRIVERGLES { #else -namespace NLDRIVERGL { +namespace NLDRIVERGL3 { #endif #endif // ************************************************************************************* -CDriverGL::CCursor::CCursor() : ColorDepth(CDriverGL::ColorDepth32), +CDriverGL3::CCursor::CCursor() : ColorDepth(CDriverGL3::ColorDepth32), OrigHeight(32), HotspotScale(1.f), HotspotOffsetX(0), @@ -63,13 +63,13 @@ CDriverGL::CCursor::CCursor() : ColorDepth(CDriverGL::ColorDepth32), } // ************************************************************************************* -CDriverGL::CCursor::~CCursor() +CDriverGL3::CCursor::~CCursor() { reset(); } // ************************************************************************************* -void CDriverGL::CCursor::reset() +void CDriverGL3::CCursor::reset() { if (Cursor != EmptyCursor) { @@ -84,7 +84,7 @@ void CDriverGL::CCursor::reset() } // ************************************************************************************* -CDriverGL::CCursor& CDriverGL::CCursor::operator= (const CDriverGL::CCursor& from) +CDriverGL3::CCursor& CDriverGL3::CCursor::operator= (const CDriverGL3::CCursor& from) { if (&from == this) return *this; @@ -105,7 +105,7 @@ CDriverGL::CCursor& CDriverGL::CCursor::operator= (const CDriverGL::CCursor& fro } // ************************************************************************************* -bool CDriverGL::isAlphaBlendedCursorSupported() +bool CDriverGL3::isAlphaBlendedCursorSupported() { if (!_AlphaBlendedCursorSupportRetrieved) { @@ -143,7 +143,7 @@ bool CDriverGL::isAlphaBlendedCursorSupported() } // ************************************************************************************* -void CDriverGL::addCursor(const std::string &name, const NLMISC::CBitmap &cursorBitmap) +void CDriverGL3::addCursor(const std::string &name, const NLMISC::CBitmap &cursorBitmap) { if (!isAlphaBlendedCursorSupported()) return; @@ -269,7 +269,7 @@ void CDriverGL::addCursor(const std::string &name, const NLMISC::CBitmap &cursor } // ************************************************************************************* -void CDriverGL::createCursors() +void CDriverGL3::createCursors() { #ifdef NL_OS_WINDOWS _DefaultCursor = LoadCursor(NULL, IDC_ARROW); @@ -293,7 +293,7 @@ void CDriverGL::createCursors() } // ************************************************************************************* -void CDriverGL::releaseCursors() +void CDriverGL3::releaseCursors() { #ifdef NL_OS_WINDOWS SetClassLongPtr(_win, GCLP_HCURSOR, 0); @@ -307,13 +307,13 @@ void CDriverGL::releaseCursors() } // ************************************************************************************* -void CDriverGL::updateCursor(bool forceRebuild) +void CDriverGL3::updateCursor(bool forceRebuild) { setCursor(_CurrName, _CurrCol, _CurrRot, _CurrHotSpotX, _CurrHotSpotY, forceRebuild); } // ************************************************************************************* -void CDriverGL::setCursor(const std::string &name, NLMISC::CRGBA col, uint8 rot, sint hotSpotX, sint hotSpotY, bool forceRebuild) +void CDriverGL3::setCursor(const std::string &name, NLMISC::CRGBA col, uint8 rot, sint hotSpotX, sint hotSpotY, bool forceRebuild) { // don't update cursor if it's hidden or if custom cursors are not suppported if (!isAlphaBlendedCursorSupported() || _CurrName == "none") return; @@ -386,13 +386,13 @@ void CDriverGL::setCursor(const std::string &name, NLMISC::CRGBA col, uint8 rot, } // ************************************************************************************* -void CDriverGL::setCursorScale(float scale) +void CDriverGL3::setCursorScale(float scale) { _CursorScale = scale; } // ************************************************************************************* -nlCursor CDriverGL::buildCursor(const CBitmap &src, NLMISC::CRGBA col, uint8 rot, sint hotSpotX, sint hotSpotY) +nlCursor CDriverGL3::buildCursor(const CBitmap &src, NLMISC::CRGBA col, uint8 rot, sint hotSpotX, sint hotSpotY) { nlassert(isAlphaBlendedCursorSupported()); @@ -417,9 +417,9 @@ nlCursor CDriverGL::buildCursor(const CBitmap &src, NLMISC::CRGBA col, uint8 rot // ************************************************************************************* -void CDriverGL::setSystemArrow() +void CDriverGL3::setSystemArrow() { - H_AUTO_OGL(CDriverGL_setSystemArrow); + H_AUTO_OGL(CDriverGL3_setSystemArrow); #ifdef NL_OS_WINDOWS if (isSystemCursorInClientArea() || isSystemCursorCaptured()) @@ -436,9 +436,9 @@ void CDriverGL::setSystemArrow() } // *************************************************************************** -void CDriverGL::showCursor(bool b) +void CDriverGL3::showCursor(bool b) { - H_AUTO_OGL(CDriverGL_showCursor); + H_AUTO_OGL(CDriverGL3_showCursor); if (_win == EmptyWindow) return; @@ -503,9 +503,9 @@ void CDriverGL::showCursor(bool b) } // *************************************************************************** -void CDriverGL::setMousePos(float x, float y) +void CDriverGL3::setMousePos(float x, float y) { - H_AUTO_OGL(CDriverGL_setMousePos) + H_AUTO_OGL(CDriverGL3_setMousePos) if (_win == EmptyWindow) return; @@ -557,9 +557,9 @@ void CDriverGL::setMousePos(float x, float y) } // *************************************************************************** -void CDriverGL::setCapture (bool b) +void CDriverGL3::setCapture (bool b) { - H_AUTO_OGL(CDriverGL_setCapture); + H_AUTO_OGL(CDriverGL3_setCapture); #ifdef NL_OS_WINDOWS @@ -603,7 +603,7 @@ void CDriverGL::setCapture (bool b) } // *************************************************************************** -bool CDriverGL::isSystemCursorInClientArea() +bool CDriverGL3::isSystemCursorInClientArea() { if (!_CurrentMode.Windowed) { @@ -655,9 +655,9 @@ bool CDriverGL::isSystemCursorInClientArea() } // *************************************************************************** -bool CDriverGL::isSystemCursorCaptured() +bool CDriverGL3::isSystemCursorCaptured() { - H_AUTO_OGL(CDriverGL_isSystemCursorCaptured); + H_AUTO_OGL(CDriverGL3_isSystemCursorCaptured); #ifdef NL_OS_WINDOWS return GetCapture() == _win; @@ -667,9 +667,9 @@ bool CDriverGL::isSystemCursorCaptured() } // *************************************************************************** -NLMISC::IMouseDevice* CDriverGL::enableLowLevelMouse(bool enable, bool exclusive) +NLMISC::IMouseDevice* CDriverGL3::enableLowLevelMouse(bool enable, bool exclusive) { - H_AUTO_OGL(CDriverGL_enableLowLevelMouse); + H_AUTO_OGL(CDriverGL3_enableLowLevelMouse); NLMISC::IMouseDevice *res = NULL; @@ -705,9 +705,9 @@ NLMISC::IMouseDevice* CDriverGL::enableLowLevelMouse(bool enable, bool exclusive } // *************************************************************************** -NLMISC::IKeyboardDevice* CDriverGL::enableLowLevelKeyboard(bool enable) +NLMISC::IKeyboardDevice* CDriverGL3::enableLowLevelKeyboard(bool enable) { - H_AUTO_OGL(CDriverGL_enableLowLevelKeyboard); + H_AUTO_OGL(CDriverGL3_enableLowLevelKeyboard); NLMISC::IKeyboardDevice *res = NULL; @@ -743,9 +743,9 @@ NLMISC::IKeyboardDevice* CDriverGL::enableLowLevelKeyboard(bool enable) } // *************************************************************************** -NLMISC::IInputDeviceManager* CDriverGL::getLowLevelInputDeviceManager() +NLMISC::IInputDeviceManager* CDriverGL3::getLowLevelInputDeviceManager() { - H_AUTO_OGL(CDriverGL_getLowLevelInputDeviceManager); + H_AUTO_OGL(CDriverGL3_getLowLevelInputDeviceManager); NLMISC::IInputDeviceManager *res = NULL; @@ -762,9 +762,9 @@ NLMISC::IInputDeviceManager* CDriverGL::getLowLevelInputDeviceManager() } // *************************************************************************** -uint CDriverGL::getDoubleClickDelay(bool hardwareMouse) +uint CDriverGL3::getDoubleClickDelay(bool hardwareMouse) { - H_AUTO_OGL(CDriverGL_getDoubleClickDelay); + H_AUTO_OGL(CDriverGL3_getDoubleClickDelay); uint res = 250; @@ -811,7 +811,7 @@ uint CDriverGL::getDoubleClickDelay(bool hardwareMouse) return res; } -bool CDriverGL::getBestCursorSize(uint srcWidth, uint srcHeight, uint &dstWidth, uint &dstHeight) +bool CDriverGL3::getBestCursorSize(uint srcWidth, uint srcHeight, uint &dstWidth, uint &dstHeight) { #ifdef NL_OS_WINDOWS @@ -834,7 +834,7 @@ bool CDriverGL::getBestCursorSize(uint srcWidth, uint srcHeight, uint &dstWidth, return true; } -bool CDriverGL::convertBitmapToCursor(const NLMISC::CBitmap &bitmap, nlCursor &cursor, uint iconWidth, uint iconHeight, uint iconDepth, const NLMISC::CRGBA &col, sint hotSpotX, sint hotSpotY) +bool CDriverGL3::convertBitmapToCursor(const NLMISC::CBitmap &bitmap, nlCursor &cursor, uint iconWidth, uint iconHeight, uint iconDepth, const NLMISC::CRGBA &col, sint hotSpotX, sint hotSpotY) { #if defined(NL_OS_WINDOWS) diff --git a/code/nel/src/3d/driver/OpenGL3/driver_opengl_light.cpp b/code/nel/src/3d/driver/OpenGL3/driver_opengl_light.cpp index 7b52e3225..a527b8534 100644 --- a/code/nel/src/3d/driver/OpenGL3/driver_opengl_light.cpp +++ b/code/nel/src/3d/driver/OpenGL3/driver_opengl_light.cpp @@ -25,23 +25,23 @@ namespace NL3D { #ifdef USE_OPENGLES namespace NLDRIVERGLES { #else -namespace NLDRIVERGL { +namespace NLDRIVERGL3 { #endif #endif // *************************************************************************** -uint CDriverGL::getMaxLight () const +uint CDriverGL3::getMaxLight () const { - H_AUTO_OGL(CDriverGL_getMaxLight ) + H_AUTO_OGL(CDriverGL3_getMaxLight ) // return min(maxLight supported by openGL, MaxLight=8). return _MaxDriverLight; } // *************************************************************************** -void CDriverGL::setLight (uint8 num, const CLight& light) +void CDriverGL3::setLight (uint8 num, const CLight& light) { - H_AUTO_OGL(CDriverGL_setLight ) + H_AUTO_OGL(CDriverGL3_setLight ) // bkup real light, for lightmap dynamic lighting purpose if(num==0) { @@ -55,9 +55,9 @@ void CDriverGL::setLight (uint8 num, const CLight& light) // *************************************************************************** -void CDriverGL::setLightInternal(uint8 num, const CLight& light) +void CDriverGL3::setLightInternal(uint8 num, const CLight& light) { - H_AUTO_OGL(CDriverGL_setLightInternal) + H_AUTO_OGL(CDriverGL3_setLightInternal) // Check light count is good // nlassert (num<_MaxDriverLight); @@ -164,9 +164,9 @@ void CDriverGL::setLightInternal(uint8 num, const CLight& light) } // *************************************************************************** -void CDriverGL::enableLight (uint8 num, bool enable) +void CDriverGL3::enableLight (uint8 num, bool enable) { - H_AUTO_OGL(CDriverGL_enableLight ) + H_AUTO_OGL(CDriverGL3_enableLight ) // User call => set the User flag if(num<_MaxDriverLight) { @@ -182,9 +182,9 @@ void CDriverGL::enableLight (uint8 num, bool enable) // *************************************************************************** -void CDriverGL::enableLightInternal(uint8 num, bool enable) +void CDriverGL3::enableLightInternal(uint8 num, bool enable) { - H_AUTO_OGL(CDriverGL_enableLightInternal) + H_AUTO_OGL(CDriverGL3_enableLightInternal) // Check light count is good // nlassert (num<_MaxDriverLight); @@ -205,9 +205,9 @@ void CDriverGL::enableLightInternal(uint8 num, bool enable) // *************************************************************************** -void CDriverGL::setAmbientColor (CRGBA color) +void CDriverGL3::setAmbientColor (CRGBA color) { - H_AUTO_OGL(CDriverGL_setAmbientColor ) + H_AUTO_OGL(CDriverGL3_setAmbientColor ) // Gl array GLfloat array[4]; array[0]=(float)color.R/255.f; @@ -221,9 +221,9 @@ void CDriverGL::setAmbientColor (CRGBA color) // *************************************************************************** -void CDriverGL::cleanLightSetup () +void CDriverGL3::cleanLightSetup () { - H_AUTO_OGL(CDriverGL_cleanLightSetup ) + H_AUTO_OGL(CDriverGL3_cleanLightSetup ) // Should be dirty nlassert (_LightSetupDirty); @@ -311,9 +311,9 @@ void CDriverGL::cleanLightSetup () // *************************************************************************** -void CDriverGL::setLightMapDynamicLight (bool enable, const CLight& light) +void CDriverGL3::setLightMapDynamicLight (bool enable, const CLight& light) { - H_AUTO_OGL(CDriverGL_setLightMapDynamicLight ) + H_AUTO_OGL(CDriverGL3_setLightMapDynamicLight ) // just store, for future setup in lightmap material rendering _LightMapDynamicLightEnabled= enable; _LightMapDynamicLight= light; @@ -322,9 +322,9 @@ void CDriverGL::setLightMapDynamicLight (bool enable, const CLight& light) // *************************************************************************** -void CDriverGL::setupLightMapDynamicLighting(bool enable) +void CDriverGL3::setupLightMapDynamicLighting(bool enable) { - H_AUTO_OGL(CDriverGL_setupLightMapDynamicLighting) + H_AUTO_OGL(CDriverGL3_setupLightMapDynamicLighting) // start lightmap dynamic lighting if(enable) { 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 6d9dbb247..ecf1eda50 100644 --- a/code/nel/src/3d/driver/OpenGL3/driver_opengl_material.cpp +++ b/code/nel/src/3d/driver/OpenGL3/driver_opengl_material.cpp @@ -27,7 +27,7 @@ namespace NL3D { #ifdef USE_OPENGLES namespace NLDRIVERGLES { #else -namespace NLDRIVERGL { +namespace NLDRIVERGL3 { #endif #endif @@ -122,9 +122,9 @@ static inline void convTexAddr(ITexture *tex, CMaterial::TTexAddressingMode mode } // -------------------------------------------------- -void CDriverGL::setTextureEnvFunction(uint stage, CMaterial& mat) +void CDriverGL3::setTextureEnvFunction(uint stage, CMaterial& mat) { - H_AUTO_OGL(CDriverGL_setTextureEnvFunction) + H_AUTO_OGL(CDriverGL3_setTextureEnvFunction) ITexture *text= mat.getTexture(uint8(stage)); if(text) { @@ -179,9 +179,9 @@ void CDriverGL::setTextureEnvFunction(uint stage, CMaterial& mat) } //-------------------------------- -void CDriverGL::setupUserTextureMatrix(uint numStages, CMaterial& mat) +void CDriverGL3::setupUserTextureMatrix(uint numStages, CMaterial& mat) { - H_AUTO_OGL(CDriverGL_setupUserTextureMatrix) + H_AUTO_OGL(CDriverGL3_setupUserTextureMatrix) if ( (_UserTexMatEnabled != 0 && (mat.getFlags() & IDRV_MAT_USER_TEX_MAT_ALL) == 0) || (mat.getFlags() & IDRV_MAT_USER_TEX_MAT_ALL) != 0 @@ -220,9 +220,9 @@ void CDriverGL::setupUserTextureMatrix(uint numStages, CMaterial& mat) } } -void CDriverGL::disableUserTextureMatrix() +void CDriverGL3::disableUserTextureMatrix() { - H_AUTO_OGL(CDriverGL_disableUserTextureMatrix) + H_AUTO_OGL(CDriverGL3_disableUserTextureMatrix) if (_UserTexMatEnabled != 0) { glMatrixMode(GL_TEXTURE); @@ -245,9 +245,9 @@ void CDriverGL::disableUserTextureMatrix() } // -------------------------------------------------- -CMaterial::TShader CDriverGL::getSupportedShader(CMaterial::TShader shader) +CMaterial::TShader CDriverGL3::getSupportedShader(CMaterial::TShader shader) { - H_AUTO_OGL(CDriverGL_CDriverGL) + H_AUTO_OGL(CDriverGL3_CDriverGL) switch (shader) { case CMaterial::PerPixelLighting: return _SupportPerPixelShader ? CMaterial::PerPixelLighting : CMaterial::Normal; @@ -260,9 +260,9 @@ CMaterial::TShader CDriverGL::getSupportedShader(CMaterial::TShader shader) } // -------------------------------------------------- -void CDriverGL::setTextureShaders(const uint8 *addressingModes, const CSmartPtr *textures) +void CDriverGL3::setTextureShaders(const uint8 *addressingModes, const CSmartPtr *textures) { - H_AUTO_OGL(CDriverGL_setTextureShaders) + H_AUTO_OGL(CDriverGL3_setTextureShaders) GLenum glAddrMode; for (uint stage = 0; stage < IDRV_MAT_MAXTEXTURES; ++stage) { @@ -280,10 +280,10 @@ void CDriverGL::setTextureShaders(const uint8 *addressingModes, const CSmartPtr< } // -------------------------------------------------- -bool CDriverGL::setupMaterial(CMaterial& mat) +bool CDriverGL3::setupMaterial(CMaterial& mat) { - H_AUTO_OGL(CDriverGL_setupMaterial) - CShaderGL* pShader; + H_AUTO_OGL(CDriverGL3_setupMaterial) + CShaderGL3* pShader; GLenum glenum = GL_ZERO; uint32 touched = mat.getTouched(); uint stage; @@ -299,12 +299,12 @@ bool CDriverGL::setupMaterial(CMaterial& mat) // insert into driver list. (so it is deleted when driver is deleted). ItMatDrvInfoPtrList it= _MatDrvInfos.insert(_MatDrvInfos.end(), (NL3D::IMaterialDrvInfos*)NULL); // create and set iterator, for future deletion. - *it= mat._MatDrvInfo= new CShaderGL(this, it); + *it= mat._MatDrvInfo= new CShaderGL3(this, it); // Must create all OpenGL shader states. touched= IDRV_TOUCHED_ALL; } - pShader=static_cast((IMaterialDrvInfos*)(mat._MatDrvInfo)); + pShader=static_cast((IMaterialDrvInfos*)(mat._MatDrvInfo)); // 1. Setup modified fields of material. //===================================== @@ -561,9 +561,9 @@ bool CDriverGL::setupMaterial(CMaterial& mat) } // *************************************************************************** -sint CDriverGL::beginMultiPass() +sint CDriverGL3::beginMultiPass() { - H_AUTO_OGL(CDriverGL_beginMultiPass) + H_AUTO_OGL(CDriverGL3_beginMultiPass) // Depending on material type and hardware, return number of pass required to draw this material. switch(_CurrentMaterialSupportedShader) { @@ -588,9 +588,9 @@ sint CDriverGL::beginMultiPass() } // *************************************************************************** -void CDriverGL::setupPass(uint pass) +void CDriverGL3::setupPass(uint pass) { - H_AUTO_OGL(CDriverGL_setupPass) + H_AUTO_OGL(CDriverGL3_setupPass) switch(_CurrentMaterialSupportedShader) { case CMaterial::LightMap: @@ -621,9 +621,9 @@ void CDriverGL::setupPass(uint pass) } // *************************************************************************** -void CDriverGL::endMultiPass() +void CDriverGL3::endMultiPass() { - H_AUTO_OGL(CDriverGL_endMultiPass) + H_AUTO_OGL(CDriverGL3_endMultiPass) switch(_CurrentMaterialSupportedShader) { case CMaterial::LightMap: @@ -653,9 +653,9 @@ void CDriverGL::endMultiPass() } // *************************************************************************** -void CDriverGL::computeLightMapInfos (const CMaterial &mat) +void CDriverGL3::computeLightMapInfos (const CMaterial &mat) { - H_AUTO_OGL(CDriverGL_computeLightMapInfos ) + H_AUTO_OGL(CDriverGL3_computeLightMapInfos ) static const uint32 RGBMaskPacked = CRGBA(255,255,255,0).getPacked(); // For optimisation consideration, suppose there is not too much lightmap. @@ -694,9 +694,9 @@ void CDriverGL::computeLightMapInfos (const CMaterial &mat) } // *************************************************************************** -sint CDriverGL::beginLightMapMultiPass () +sint CDriverGL3::beginLightMapMultiPass () { - H_AUTO_OGL(CDriverGL_beginLightMapMultiPass ) + H_AUTO_OGL(CDriverGL3_beginLightMapMultiPass ) const CMaterial &mat= *_CurrentMaterial; // compute how many lightmap and pass we must process. @@ -726,9 +726,9 @@ sint CDriverGL::beginLightMapMultiPass () } // *************************************************************************** -void CDriverGL::setupLightMapPass(uint pass) +void CDriverGL3::setupLightMapPass(uint pass) { - H_AUTO_OGL(CDriverGL_setupLightMapPass) + H_AUTO_OGL(CDriverGL3_setupLightMapPass) const CMaterial &mat= *_CurrentMaterial; // common colors @@ -1052,9 +1052,9 @@ void CDriverGL::setupLightMapPass(uint pass) } // *************************************************************************** -void CDriverGL::endLightMapMultiPass() +void CDriverGL3::endLightMapMultiPass() { - H_AUTO_OGL(CDriverGL_endLightMapMultiPass) + H_AUTO_OGL(CDriverGL3_endLightMapMultiPass) // Flag the fact that VertexSetup is dirty (special lightmap). reseted in activeVertexBuffer(), and setupMaterial() // NB: if no lightmaps, no setupUVPtr() has been called => don't need to flag // (important else crash if graphist error while exporting a Lightmap material, with a MeshVertexProgram (WindTree) ) @@ -1083,9 +1083,9 @@ void CDriverGL::endLightMapMultiPass() } // *************************************************************************** -void CDriverGL::resetLightMapVertexSetup() +void CDriverGL3::resetLightMapVertexSetup() { - H_AUTO_OGL(CDriverGL_resetLightMapVertexSetup) + H_AUTO_OGL(CDriverGL3_resetLightMapVertexSetup) // special for all stage, std UV behavior. for(uint i = 0; i < inlGetNumTextStages(); i++) { @@ -1104,27 +1104,27 @@ void CDriverGL::resetLightMapVertexSetup() } // *************************************************************************** -void CDriverGL::startSpecularBatch() +void CDriverGL3::startSpecularBatch() { - H_AUTO_OGL(CDriverGL_startSpecularBatch) + H_AUTO_OGL(CDriverGL3_startSpecularBatch) _SpecularBatchOn= true; setupSpecularBegin(); } // *************************************************************************** -void CDriverGL::endSpecularBatch() +void CDriverGL3::endSpecularBatch() { - H_AUTO_OGL(CDriverGL_endSpecularBatch) + H_AUTO_OGL(CDriverGL3_endSpecularBatch) _SpecularBatchOn= false; setupSpecularEnd(); } // *************************************************************************** -void CDriverGL::setupSpecularBegin() +void CDriverGL3::setupSpecularBegin() { - H_AUTO_OGL(CDriverGL_setupSpecularBegin) + H_AUTO_OGL(CDriverGL3_setupSpecularBegin) // ---- Reset any textures with id>=2 uint stage = 2; for(; stage < inlGetNumTextStages(); stage++) @@ -1150,7 +1150,7 @@ void CDriverGL::setupSpecularBegin() _DriverGLStates.activeTextureARB(1); // todo hulud remove - // _DriverGLStates.setTextureMode(CDriverGLStates::TextureCubeMap); + // _DriverGLStates.setTextureMode(CDriverGLStates3::TextureCubeMap); _DriverGLStates.setTexGenMode (1, GL_REFLECTION_MAP_ARB); // setup the good matrix for stage 1. @@ -1160,9 +1160,9 @@ void CDriverGL::setupSpecularBegin() } // *************************************************************************** -void CDriverGL::setupSpecularEnd() +void CDriverGL3::setupSpecularEnd() { - H_AUTO_OGL(CDriverGL_setupSpecularEnd) + H_AUTO_OGL(CDriverGL3_setupSpecularEnd) // Disable Texture coord generation. _DriverGLStates.activeTextureARB(1); _DriverGLStates.setTexGenMode(1, 0); @@ -1174,9 +1174,9 @@ void CDriverGL::setupSpecularEnd() } // *************************************************************************** -sint CDriverGL::beginSpecularMultiPass() +sint CDriverGL3::beginSpecularMultiPass() { - H_AUTO_OGL(CDriverGL_beginSpecularMultiPass) + H_AUTO_OGL(CDriverGL3_beginSpecularMultiPass) const CMaterial &mat= *_CurrentMaterial; // activate the 2 textures here @@ -1208,9 +1208,9 @@ sint CDriverGL::beginSpecularMultiPass() } // *************************************************************************** -void CDriverGL::setupSpecularPass(uint pass) +void CDriverGL3::setupSpecularPass(uint pass) { - H_AUTO_OGL(CDriverGL_setupSpecularPass) + H_AUTO_OGL(CDriverGL3_setupSpecularPass) const CMaterial &mat= *_CurrentMaterial; // Manage the rare case when the SpecularMap is not provided (error of a graphist). @@ -1391,7 +1391,7 @@ void CDriverGL::setupSpecularPass(uint pass) // Just display the texture _DriverGLStates.enableBlend(false); _DriverGLStates.activeTextureARB(1); - _DriverGLStates.setTextureMode(CDriverGLStates::TextureDisabled); + _DriverGLStates.setTextureMode(CDriverGLStates3::TextureDisabled); } else { @@ -1432,9 +1432,9 @@ void CDriverGL::setupSpecularPass(uint pass) } // *************************************************************************** -void CDriverGL::endSpecularMultiPass() +void CDriverGL3::endSpecularMultiPass() { - H_AUTO_OGL(CDriverGL_endSpecularMultiPass) + H_AUTO_OGL(CDriverGL3_endSpecularMultiPass) // End specular , only if not Batching mode. if(!_SpecularBatchOn) setupSpecularEnd(); @@ -1461,9 +1461,9 @@ const uint SpecularExpStep = 8; const uint SpecularMapSize = 32; */ // *************************************************************************** -CTextureCube *CDriverGL::getSpecularCubeMap(uint exp) +CTextureCube *CDriverGL3::getSpecularCubeMap(uint exp) { - H_AUTO_OGL(CDriverGL__getSpecularCubeMap) + H_AUTO_OGL(CDriverGL3__getSpecularCubeMap) const uint DiffuseMapSize = 64; const uint SpecularMapSize = 32; const uint SpecularMapSizeHighExponent = 64; @@ -1560,9 +1560,9 @@ CTextureCube *CDriverGL::getSpecularCubeMap(uint exp) } // *************************************************************************** -sint CDriverGL::beginPPLMultiPass() +sint CDriverGL3::beginPPLMultiPass() { - H_AUTO_OGL(CDriverGL_beginPPLMultiPass) + H_AUTO_OGL(CDriverGL3_beginPPLMultiPass) #ifdef NL_DEBUG nlassert(supportPerPixelLighting(true)); // make sure the hardware can do that #endif @@ -1570,9 +1570,9 @@ sint CDriverGL::beginPPLMultiPass() } // *************************************************************************** -void CDriverGL::setupPPLPass(uint pass) +void CDriverGL3::setupPPLPass(uint pass) { - H_AUTO_OGL(CDriverGL_setupPPLPass) + H_AUTO_OGL(CDriverGL3_setupPPLPass) const CMaterial &mat= *_CurrentMaterial; nlassert(pass == 0); @@ -1779,16 +1779,16 @@ void CDriverGL::setupPPLPass(uint pass) } // *************************************************************************** -void CDriverGL::endPPLMultiPass() +void CDriverGL3::endPPLMultiPass() { - H_AUTO_OGL(CDriverGL_endPPLMultiPass) + H_AUTO_OGL(CDriverGL3_endPPLMultiPass) // nothing to do there ... } // ******PER PIXEL LIGHTING, NO SPECULAR************************************** -sint CDriverGL::beginPPLNoSpecMultiPass() +sint CDriverGL3::beginPPLNoSpecMultiPass() { - H_AUTO_OGL(CDriverGL_beginPPLNoSpecMultiPass) + H_AUTO_OGL(CDriverGL3_beginPPLNoSpecMultiPass) #ifdef NL_DEBUG nlassert(supportPerPixelLighting(false)); // make sure the hardware can do that #endif @@ -1796,9 +1796,9 @@ sint CDriverGL::beginPPLNoSpecMultiPass() } // ******PER PIXEL LIGHTING, NO SPECULAR************************************** -void CDriverGL::setupPPLNoSpecPass(uint pass) +void CDriverGL3::setupPPLNoSpecPass(uint pass) { - H_AUTO_OGL(CDriverGL_setupPPLNoSpecPass) + H_AUTO_OGL(CDriverGL3_setupPPLNoSpecPass) const CMaterial &mat= *_CurrentMaterial; nlassert(pass == 0); @@ -1887,14 +1887,14 @@ void CDriverGL::setupPPLNoSpecPass(uint pass) } // ******PER PIXEL LIGHTING, NO SPECULAR************************************** -void CDriverGL::endPPLNoSpecMultiPass() +void CDriverGL3::endPPLNoSpecMultiPass() { - H_AUTO_OGL(CDriverGL_endPPLNoSpecMultiPass) + H_AUTO_OGL(CDriverGL3_endPPLNoSpecMultiPass) // nothing to do there ... } // *************************************************************************** -/* sint CDriverGL::beginCausticsMultiPass(const CMaterial &mat) +/* sint CDriverGL3::beginCausticsMultiPass(const CMaterial &mat) { nlassert(mat.getShader() == CMaterial::Caustics); if (!_Extensions.ARBTextureCubeMap) return 1; @@ -1908,7 +1908,7 @@ void CDriverGL::endPPLNoSpecMultiPass() }*/ // *************************************************************************** -/*inline void CDriverGL::setupCausticsFirstTex(const CMaterial &mat) +/*inline void CDriverGL3::setupCausticsFirstTex(const CMaterial &mat) { /// setup texture 0 activateTexture(0, mat.getTexture(0)); @@ -1921,14 +1921,14 @@ void CDriverGL::endPPLNoSpecMultiPass() } // *************************************************************************** -inline void CDriverGL::setupCausticsSecondTex(uint stage) +inline void CDriverGL3::setupCausticsSecondTex(uint stage) { activateTexture(stage, mat.getTexture(0)); _CausticCubeMap } // *************************************************************************** -void CDriverGL::setupCausticsPass(const CMaterial &mat, uint pass) +void CDriverGL3::setupCausticsPass(const CMaterial &mat, uint pass) { nlassert(mat.getShader() == CMaterial::Caustics); @@ -1960,7 +1960,7 @@ void CDriverGL::setupCausticsPass(const CMaterial &mat, uint pass) } // *************************************************************************** -void CDriverGL::endCausticsMultiPass(const CMaterial &mat) +void CDriverGL3::endCausticsMultiPass(const CMaterial &mat) { nlassert(mat.getShader() == CMaterial::Caustics); @@ -1968,17 +1968,17 @@ void CDriverGL::endCausticsMultiPass(const CMaterial &mat) */ // *************************************************************************** -sint CDriverGL::beginCloudMultiPass () +sint CDriverGL3::beginCloudMultiPass () { - H_AUTO_OGL(CDriverGL_beginCloudMultiPass ) + H_AUTO_OGL(CDriverGL3_beginCloudMultiPass ) nlassert(_CurrentMaterial->getShader() == CMaterial::Cloud); return 1; } // *************************************************************************** -void CDriverGL::setupCloudPass (uint /* pass */) +void CDriverGL3::setupCloudPass (uint /* pass */) { - H_AUTO_OGL(CDriverGL_setupCloudPass ) + H_AUTO_OGL(CDriverGL3_setupCloudPass ) nlassert(_CurrentMaterial->getShader() == CMaterial::Cloud); const CMaterial &mat= *_CurrentMaterial; @@ -2113,9 +2113,9 @@ void CDriverGL::setupCloudPass (uint /* pass */) } // *************************************************************************** -void CDriverGL::endCloudMultiPass() +void CDriverGL3::endCloudMultiPass() { - H_AUTO_OGL(CDriverGL_endCloudMultiPass) + H_AUTO_OGL(CDriverGL3_endCloudMultiPass) nlassert(_CurrentMaterial->getShader() == CMaterial::Cloud); if (ATICloudShaderHandle) { @@ -2126,9 +2126,9 @@ void CDriverGL::endCloudMultiPass() } // *************************************************************************** -sint CDriverGL::beginWaterMultiPass() +sint CDriverGL3::beginWaterMultiPass() { - H_AUTO_OGL(CDriverGL_beginWaterMultiPass) + H_AUTO_OGL(CDriverGL3_beginWaterMultiPass) nlassert(_CurrentMaterial->getShader() == CMaterial::Water); return 1; } @@ -2137,9 +2137,9 @@ sint CDriverGL::beginWaterMultiPass() // *************************************************************************** /** water setup for ATI */ -void CDriverGL::setupWaterPassR200(const CMaterial &mat) +void CDriverGL3::setupWaterPassR200(const CMaterial &mat) { - H_AUTO_OGL(CDriverGL_setupWaterPassR200); + H_AUTO_OGL(CDriverGL3_setupWaterPassR200); #ifndef USE_OPENGLES uint k; @@ -2219,9 +2219,9 @@ void CDriverGL::setupWaterPassR200(const CMaterial &mat) // *************************************************************************** /** water setup for ARB_fragment_program */ -void CDriverGL::setupWaterPassARB(const CMaterial &mat) +void CDriverGL3::setupWaterPassARB(const CMaterial &mat) { - H_AUTO_OGL(CDriverGL_setupWaterPassARB); + H_AUTO_OGL(CDriverGL3_setupWaterPassARB); #ifndef USE_OPENGLES uint k; @@ -2327,9 +2327,9 @@ static const uint8 WaterTexAddrMode[IDRV_MAT_MAXTEXTURES] = static const float IdentityTexMat[4] = { 1.f, 0.f, 0.f, 1.f }; // *************************************************************************** -void CDriverGL::setupWaterPassNV20(const CMaterial &mat) +void CDriverGL3::setupWaterPassNV20(const CMaterial &mat) { - H_AUTO_OGL(CDriverGL_setupWaterPassNV20); + H_AUTO_OGL(CDriverGL3_setupWaterPassNV20); #ifndef USE_OPENGLES static bool setupDone = false; @@ -2420,9 +2420,9 @@ void CDriverGL::setupWaterPassNV20(const CMaterial &mat) } // *************************************************************************** -void CDriverGL::setupWaterPass(uint /* pass */) +void CDriverGL3::setupWaterPass(uint /* pass */) { - H_AUTO_OGL(CDriverGL_setupWaterPass) + H_AUTO_OGL(CDriverGL3_setupWaterPass) nlassert (_CurrentMaterial); CMaterial &mat = *_CurrentMaterial; nlassert(_CurrentMaterial->getShader() == CMaterial::Water); @@ -2442,9 +2442,9 @@ void CDriverGL::setupWaterPass(uint /* pass */) } // *************************************************************************** -void CDriverGL::endWaterMultiPass() +void CDriverGL3::endWaterMultiPass() { - H_AUTO_OGL(CDriverGL_endWaterMultiPass); + H_AUTO_OGL(CDriverGL3_endWaterMultiPass); #ifndef USE_OPENGLES nlassert(_CurrentMaterial->getShader() == CMaterial::Water); diff --git a/code/nel/src/3d/driver/OpenGL3/driver_opengl_matrix.cpp b/code/nel/src/3d/driver/OpenGL3/driver_opengl_matrix.cpp index 855c10c21..0a14eb77c 100644 --- a/code/nel/src/3d/driver/OpenGL3/driver_opengl_matrix.cpp +++ b/code/nel/src/3d/driver/OpenGL3/driver_opengl_matrix.cpp @@ -23,14 +23,14 @@ namespace NL3D { #ifdef USE_OPENGLES namespace NLDRIVERGLES { #else -namespace NLDRIVERGL { +namespace NLDRIVERGL3 { #endif #endif // *************************************************************************** -void CDriverGL::setFrustum(float left, float right, float bottom, float top, float znear, float zfar, bool perspective) +void CDriverGL3::setFrustum(float left, float right, float bottom, float top, float znear, float zfar, bool perspective) { - H_AUTO_OGL(CDriverGL_setFrustum); + H_AUTO_OGL(CDriverGL3_setFrustum); glMatrixMode(GL_PROJECTION); glLoadIdentity(); @@ -62,9 +62,9 @@ void CDriverGL::setFrustum(float left, float right, float bottom, float top, flo // *************************************************************************** -void CDriverGL::setFrustumMatrix(CMatrix &frustumMatrix) +void CDriverGL3::setFrustumMatrix(CMatrix &frustumMatrix) { - H_AUTO_OGL(CDriverGL_setFrustum) + H_AUTO_OGL(CDriverGL3_setFrustum) glMatrixMode(GL_PROJECTION); glLoadMatrixf(((GLfloat*)frustumMatrix.get())); @@ -74,9 +74,9 @@ void CDriverGL::setFrustumMatrix(CMatrix &frustumMatrix) // *************************************************************************** -CMatrix CDriverGL::getFrustumMatrix() +CMatrix CDriverGL3::getFrustumMatrix() { - H_AUTO_OGL(CDriverGL_getFrustum) + H_AUTO_OGL(CDriverGL3_getFrustum) glMatrixMode(GL_PROJECTION); @@ -91,9 +91,9 @@ CMatrix CDriverGL::getFrustumMatrix() } // *************************************************************************** -void CDriverGL::setupViewMatrixEx(const CMatrix& mtx, const CVector &cameraPos) +void CDriverGL3::setupViewMatrixEx(const CMatrix& mtx, const CVector &cameraPos) { - H_AUTO_OGL(CDriverGL_setupViewMatrixEx) + H_AUTO_OGL(CDriverGL3_setupViewMatrixEx) _UserViewMtx= mtx; // Setup the matrix to transform the CScene basis in openGL basis. @@ -125,9 +125,9 @@ void CDriverGL::setupViewMatrixEx(const CMatrix& mtx, const CVector &cameraPos) // *************************************************************************** -void CDriverGL::setupViewMatrix(const CMatrix& mtx) +void CDriverGL3::setupViewMatrix(const CMatrix& mtx) { - H_AUTO_OGL(CDriverGL_setupViewMatrix) + H_AUTO_OGL(CDriverGL3_setupViewMatrix) _UserViewMtx= mtx; // Setup the matrix to transform the CScene basis in openGL basis. @@ -158,16 +158,16 @@ void CDriverGL::setupViewMatrix(const CMatrix& mtx) } // *************************************************************************** -CMatrix CDriverGL::getViewMatrix(void) const +CMatrix CDriverGL3::getViewMatrix(void) const { - H_AUTO_OGL(CDriverGL_getViewMatrix) + H_AUTO_OGL(CDriverGL3_getViewMatrix) return _UserViewMtx; } // *************************************************************************** -void CDriverGL::setupModelMatrix(const CMatrix& mtx) +void CDriverGL3::setupModelMatrix(const CMatrix& mtx) { - H_AUTO_OGL(CDriverGL_setupModelMatrix) + H_AUTO_OGL(CDriverGL3_setupModelMatrix) // profiling _NbSetupModelMatrixCall++; @@ -185,9 +185,9 @@ void CDriverGL::setupModelMatrix(const CMatrix& mtx) } // *************************************************************************** -void CDriverGL::doRefreshRenderSetup() +void CDriverGL3::doRefreshRenderSetup() { - H_AUTO_OGL(CDriverGL_doRefreshRenderSetup) + H_AUTO_OGL(CDriverGL3_doRefreshRenderSetup) // Check if the light setup has been modified first if (_LightSetupDirty) // Recompute light setup 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 60a0609dc..9a33d90fd 100644 --- a/code/nel/src/3d/driver/OpenGL3/driver_opengl_states.cpp +++ b/code/nel/src/3d/driver/OpenGL3/driver_opengl_states.cpp @@ -28,14 +28,14 @@ namespace NL3D { #ifdef USE_OPENGLES namespace NLDRIVERGLES { #else -namespace NLDRIVERGL { +namespace NLDRIVERGL3 { #endif #endif // *************************************************************************** -CDriverGLStates::CDriverGLStates() +CDriverGLStates3::CDriverGLStates3() { - H_AUTO_OGL(CDriverGLStates_CDriverGLStates) + H_AUTO_OGL(CDriverGLStates3_CDriverGLStates) _TextureCubeMapSupported= false; _CurrARBVertexBuffer = 0; _DepthRangeNear = 0.f; @@ -47,9 +47,9 @@ CDriverGLStates::CDriverGLStates() // *************************************************************************** -void CDriverGLStates::init(bool supportTextureCubeMap, bool supportTextureRectangle, uint maxLight) +void CDriverGLStates3::init(bool supportTextureCubeMap, bool supportTextureRectangle, uint maxLight) { - H_AUTO_OGL(CDriverGLStates_init) + H_AUTO_OGL(CDriverGLStates3_init) _TextureCubeMapSupported= supportTextureCubeMap; _TextureRectangleSupported= supportTextureRectangle; _MaxDriverLight= maxLight; @@ -82,9 +82,9 @@ void CDriverGLStates::init(bool supportTextureCubeMap, bool supportTextureRect // *************************************************************************** -void CDriverGLStates::forceDefaults(uint nbStages) +void CDriverGLStates3::forceDefaults(uint nbStages) { - H_AUTO_OGL(CDriverGLStates_forceDefaults); + H_AUTO_OGL(CDriverGLStates3_forceDefaults); // Enable / disable. _CurFog= false; @@ -216,9 +216,9 @@ void CDriverGLStates::forceDefaults(uint nbStages) } // *************************************************************************** -void CDriverGLStates::enableBlend(uint enable) +void CDriverGLStates3::enableBlend(uint enable) { - H_AUTO_OGL(CDriverGLStates_enableBlend) + H_AUTO_OGL(CDriverGLStates3_enableBlend) // If different from current setup, update. bool enabled= (enable!=0); #ifndef NL3D_GLSTATE_DISABLE_CACHE @@ -236,9 +236,9 @@ void CDriverGLStates::enableBlend(uint enable) } // *************************************************************************** -void CDriverGLStates::enableCullFace(uint enable) +void CDriverGLStates3::enableCullFace(uint enable) { - H_AUTO_OGL(CDriverGLStates_enableCullFace) + H_AUTO_OGL(CDriverGLStates3_enableCullFace) // If different from current setup, update. bool enabled= (enable!=0); #ifndef NL3D_GLSTATE_DISABLE_CACHE @@ -256,9 +256,9 @@ void CDriverGLStates::enableCullFace(uint enable) } // *************************************************************************** -void CDriverGLStates::enableAlphaTest(uint enable) +void CDriverGLStates3::enableAlphaTest(uint enable) { - H_AUTO_OGL(CDriverGLStates_enableAlphaTest) + H_AUTO_OGL(CDriverGLStates3_enableAlphaTest) // If different from current setup, update. bool enabled= (enable!=0); #ifndef NL3D_GLSTATE_DISABLE_CACHE @@ -283,9 +283,9 @@ void CDriverGLStates::enableAlphaTest(uint enable) // *************************************************************************** -void CDriverGLStates::enableLighting(uint enable) +void CDriverGLStates3::enableLighting(uint enable) { - H_AUTO_OGL(CDriverGLStates_enableLighting) + H_AUTO_OGL(CDriverGLStates3_enableLighting) // If different from current setup, update. bool enabled= (enable!=0); #ifndef NL3D_GLSTATE_DISABLE_CACHE @@ -305,9 +305,9 @@ void CDriverGLStates::enableLighting(uint enable) } // *************************************************************************** -void CDriverGLStates::enableLight(uint num, uint enable) +void CDriverGLStates3::enableLight(uint num, uint enable) { - H_AUTO_OGL(CDriverGLStates_enableLight) + H_AUTO_OGL(CDriverGLStates3_enableLight) if(num>=_MaxDriverLight) return; @@ -328,9 +328,9 @@ void CDriverGLStates::enableLight(uint num, uint enable) } // *************************************************************************** -bool CDriverGLStates::isLightEnabled(uint num) const +bool CDriverGLStates3::isLightEnabled(uint num) const { - H_AUTO_OGL(CDriverGLStates_isLightEnabled) + H_AUTO_OGL(CDriverGLStates3_isLightEnabled) if(num>=_MaxDriverLight) return false; else @@ -339,9 +339,9 @@ bool CDriverGLStates::isLightEnabled(uint num) const // *************************************************************************** -void CDriverGLStates::enableZWrite(uint enable) +void CDriverGLStates3::enableZWrite(uint enable) { - H_AUTO_OGL(CDriverGLStates_enableZWrite) + H_AUTO_OGL(CDriverGLStates3_enableZWrite) // If different from current setup, update. bool enabled= (enable!=0); #ifndef NL3D_GLSTATE_DISABLE_CACHE @@ -360,9 +360,9 @@ void CDriverGLStates::enableZWrite(uint enable) // *************************************************************************** -void CDriverGLStates::enableStencilTest(bool enable) +void CDriverGLStates3::enableStencilTest(bool enable) { - H_AUTO_OGL(CDriverGLStates_enableStencilTest); + H_AUTO_OGL(CDriverGLStates3_enableStencilTest); // If different from current setup, update. #ifndef NL3D_GLSTATE_DISABLE_CACHE @@ -380,9 +380,9 @@ void CDriverGLStates::enableStencilTest(bool enable) } // *************************************************************************** -void CDriverGLStates::enableMultisample(bool enable) +void CDriverGLStates3::enableMultisample(bool enable) { - H_AUTO_OGL(CDriverGLStates_enableMultisample); + H_AUTO_OGL(CDriverGLStates3_enableMultisample); // If different from current setup, update. #ifndef NL3D_GLSTATE_DISABLE_CACHE @@ -401,9 +401,9 @@ void CDriverGLStates::enableMultisample(bool enable) } // *************************************************************************** -void CDriverGLStates::blendFunc(GLenum src, GLenum dst) +void CDriverGLStates3::blendFunc(GLenum src, GLenum dst) { - H_AUTO_OGL(CDriverGLStates_blendFunc) + H_AUTO_OGL(CDriverGLStates3_blendFunc) // If different from current setup, update. #ifndef NL3D_GLSTATE_DISABLE_CACHE if( src!= _CurBlendSrc || dst!=_CurBlendDst ) @@ -418,9 +418,9 @@ void CDriverGLStates::blendFunc(GLenum src, GLenum dst) } // *************************************************************************** -void CDriverGLStates::depthFunc(GLenum zcomp) +void CDriverGLStates3::depthFunc(GLenum zcomp) { - H_AUTO_OGL(CDriverGLStates_depthFunc) + H_AUTO_OGL(CDriverGLStates3_depthFunc) // If different from current setup, update. #ifndef NL3D_GLSTATE_DISABLE_CACHE if( zcomp != _CurDepthFunc ) @@ -435,9 +435,9 @@ void CDriverGLStates::depthFunc(GLenum zcomp) // *************************************************************************** -void CDriverGLStates::alphaFunc(float threshold) +void CDriverGLStates3::alphaFunc(float threshold) { - H_AUTO_OGL(CDriverGLStates_alphaFunc) + H_AUTO_OGL(CDriverGLStates3_alphaFunc) #ifndef NL3D_GLSTATE_DISABLE_CACHE if(threshold != _CurAlphaTestThreshold) #endif @@ -451,9 +451,9 @@ void CDriverGLStates::alphaFunc(float threshold) // *************************************************************************** -void CDriverGLStates::stencilFunc(GLenum func, GLint ref, GLuint mask) +void CDriverGLStates3::stencilFunc(GLenum func, GLint ref, GLuint mask) { - H_AUTO_OGL(CDriverGLStates_stencilFunc) + H_AUTO_OGL(CDriverGLStates3_stencilFunc) #ifndef NL3D_GLSTATE_DISABLE_CACHE if((func!=_CurStencilFunc) || (ref!=_CurStencilRef) || (mask!=_CurStencilMask)) #endif @@ -470,9 +470,9 @@ void CDriverGLStates::stencilFunc(GLenum func, GLint ref, GLuint mask) // *************************************************************************** -void CDriverGLStates::stencilOp(GLenum fail, GLenum zfail, GLenum zpass) +void CDriverGLStates3::stencilOp(GLenum fail, GLenum zfail, GLenum zpass) { - H_AUTO_OGL(CDriverGLStates_stencilOp) + H_AUTO_OGL(CDriverGLStates3_stencilOp) #ifndef NL3D_GLSTATE_DISABLE_CACHE if((fail!=_CurStencilOpFail) || (zfail!=_CurStencilOpZFail) || (zpass!=_CurStencilOpZPass)) #endif @@ -488,9 +488,9 @@ void CDriverGLStates::stencilOp(GLenum fail, GLenum zfail, GLenum zpass) } // *************************************************************************** -void CDriverGLStates::stencilMask(GLuint mask) +void CDriverGLStates3::stencilMask(GLuint mask) { - H_AUTO_OGL(CDriverGLStates_stencilMask) + H_AUTO_OGL(CDriverGLStates3_stencilMask) #ifndef NL3D_GLSTATE_DISABLE_CACHE if(mask!=_CurStencilWriteMask) #endif @@ -505,9 +505,9 @@ void CDriverGLStates::stencilMask(GLuint mask) // *************************************************************************** -void CDriverGLStates::setEmissive(uint32 packedColor, const GLfloat color[4]) +void CDriverGLStates3::setEmissive(uint32 packedColor, const GLfloat color[4]) { - H_AUTO_OGL(CDriverGLStates_setEmissive) + H_AUTO_OGL(CDriverGLStates3_setEmissive) #ifndef NL3D_GLSTATE_DISABLE_CACHE if( packedColor!=_CurEmissive ) #endif @@ -518,9 +518,9 @@ void CDriverGLStates::setEmissive(uint32 packedColor, const GLfloat color[4]) } // *************************************************************************** -void CDriverGLStates::setAmbient(uint32 packedColor, const GLfloat color[4]) +void CDriverGLStates3::setAmbient(uint32 packedColor, const GLfloat color[4]) { - H_AUTO_OGL(CDriverGLStates_setAmbient) + H_AUTO_OGL(CDriverGLStates3_setAmbient) #ifndef NL3D_GLSTATE_DISABLE_CACHE if( packedColor!=_CurAmbient ) #endif @@ -531,9 +531,9 @@ void CDriverGLStates::setAmbient(uint32 packedColor, const GLfloat color[4]) } // *************************************************************************** -void CDriverGLStates::setDiffuse(uint32 packedColor, const GLfloat color[4]) +void CDriverGLStates3::setDiffuse(uint32 packedColor, const GLfloat color[4]) { - H_AUTO_OGL(CDriverGLStates_setDiffuse) + H_AUTO_OGL(CDriverGLStates3_setDiffuse) #ifndef NL3D_GLSTATE_DISABLE_CACHE if( packedColor!=_CurDiffuse ) #endif @@ -544,9 +544,9 @@ void CDriverGLStates::setDiffuse(uint32 packedColor, const GLfloat color[4]) } // *************************************************************************** -void CDriverGLStates::setSpecular(uint32 packedColor, const GLfloat color[4]) +void CDriverGLStates3::setSpecular(uint32 packedColor, const GLfloat color[4]) { - H_AUTO_OGL(CDriverGLStates_setSpecular) + H_AUTO_OGL(CDriverGLStates3_setSpecular) #ifndef NL3D_GLSTATE_DISABLE_CACHE if( packedColor!=_CurSpecular ) #endif @@ -557,9 +557,9 @@ void CDriverGLStates::setSpecular(uint32 packedColor, const GLfloat color[4]) } // *************************************************************************** -void CDriverGLStates::setShininess(float shin) +void CDriverGLStates3::setShininess(float shin) { - H_AUTO_OGL(CDriverGLStates_setShininess) + H_AUTO_OGL(CDriverGLStates3_setShininess) #ifndef NL3D_GLSTATE_DISABLE_CACHE if( shin != _CurShininess ) #endif @@ -582,9 +582,9 @@ static void convColor(CRGBA col, GLfloat glcol[4]) } // *************************************************************************** -void CDriverGLStates::setVertexColorLighted(bool enable) +void CDriverGLStates3::setVertexColorLighted(bool enable) { - H_AUTO_OGL(CDriverGLStates_setVertexColorLighted) + H_AUTO_OGL(CDriverGLStates3_setVertexColorLighted) #ifndef NL3D_GLSTATE_DISABLE_CACHE if( enable != _VertexColorLighted) #endif @@ -616,9 +616,9 @@ void CDriverGLStates::setVertexColorLighted(bool enable) // *************************************************************************** -void CDriverGLStates::updateDepthRange() +void CDriverGLStates3::updateDepthRange() { - H_AUTO_OGL(CDriverGLStates_updateDepthRange); + H_AUTO_OGL(CDriverGLStates3_updateDepthRange); float delta = _ZBias * (_DepthRangeFar - _DepthRangeNear); @@ -630,9 +630,9 @@ void CDriverGLStates::updateDepthRange() } // *************************************************************************** -void CDriverGLStates::setZBias(float zbias) +void CDriverGLStates3::setZBias(float zbias) { - H_AUTO_OGL(CDriverGLStates_setZBias) + H_AUTO_OGL(CDriverGLStates3_setZBias) #ifndef NL3D_GLSTATE_DISABLE_CACHE if (zbias != _ZBias) #endif @@ -644,9 +644,9 @@ void CDriverGLStates::setZBias(float zbias) // *************************************************************************** -void CDriverGLStates::setDepthRange(float znear, float zfar) +void CDriverGLStates3::setDepthRange(float znear, float zfar) { - H_AUTO_OGL(CDriverGLStates_setDepthRange) + H_AUTO_OGL(CDriverGLStates3_setDepthRange) nlassert(znear != zfar); #ifndef NL3D_GLSTATE_DISABLE_CACHE if (znear != _DepthRangeNear || zfar != _DepthRangeFar) @@ -659,9 +659,9 @@ void CDriverGLStates::setDepthRange(float znear, float zfar) } // *************************************************************************** -void CDriverGLStates::setTexGenMode (uint stage, GLint mode) +void CDriverGLStates3::setTexGenMode (uint stage, GLint mode) { - H_AUTO_OGL(CDriverGLStates_setTexGenMode); + H_AUTO_OGL(CDriverGLStates3_setTexGenMode); #ifndef NL3D_GLSTATE_DISABLE_CACHE if (mode != _TexGenMode[stage]) @@ -733,9 +733,9 @@ void CDriverGLStates::setTexGenMode (uint stage, GLint mode) } // *************************************************************************** -void CDriverGLStates::resetTextureMode() +void CDriverGLStates3::resetTextureMode() { - H_AUTO_OGL(CDriverGLStates_resetTextureMode); + H_AUTO_OGL(CDriverGLStates3_resetTextureMode); glDisable(GL_TEXTURE_2D); @@ -756,9 +756,9 @@ void CDriverGLStates::resetTextureMode() // *************************************************************************** -void CDriverGLStates::setTextureMode(TTextureMode texMode) +void CDriverGLStates3::setTextureMode(TTextureMode texMode) { - H_AUTO_OGL(CDriverGLStates_setTextureMode) + H_AUTO_OGL(CDriverGLStates3_setTextureMode) TTextureMode oldTexMode = _TextureMode[_CurrentActiveTextureARB]; if(oldTexMode != texMode) { @@ -829,9 +829,9 @@ void CDriverGLStates::setTextureMode(TTextureMode texMode) // *************************************************************************** -void CDriverGLStates::activeTextureARB(uint stage) +void CDriverGLStates3::activeTextureARB(uint stage) { - H_AUTO_OGL(CDriverGLStates_activeTextureARB); + H_AUTO_OGL(CDriverGLStates3_activeTextureARB); if( _CurrentActiveTextureARB != stage ) { @@ -846,9 +846,9 @@ void CDriverGLStates::activeTextureARB(uint stage) } // *************************************************************************** -void CDriverGLStates::forceActiveTextureARB(uint stage) +void CDriverGLStates3::forceActiveTextureARB(uint stage) { - H_AUTO_OGL(CDriverGLStates_forceActiveTextureARB); + H_AUTO_OGL(CDriverGLStates3_forceActiveTextureARB); #ifdef USE_OPENGLES glActiveTexture(GL_TEXTURE0+stage); @@ -860,9 +860,9 @@ void CDriverGLStates::forceActiveTextureARB(uint stage) } // *************************************************************************** -void CDriverGLStates::enableVertexArray(bool enable) +void CDriverGLStates3::enableVertexArray(bool enable) { - H_AUTO_OGL(CDriverGLStates_enableVertexArray); + H_AUTO_OGL(CDriverGLStates3_enableVertexArray); if(_VertexArrayEnabled != enable) { @@ -875,9 +875,9 @@ void CDriverGLStates::enableVertexArray(bool enable) } } // *************************************************************************** -void CDriverGLStates::enableNormalArray(bool enable) +void CDriverGLStates3::enableNormalArray(bool enable) { - H_AUTO_OGL(CDriverGLStates_enableNormalArray) + H_AUTO_OGL(CDriverGLStates3_enableNormalArray) if(_NormalArrayEnabled != enable) { if(enable) @@ -890,9 +890,9 @@ void CDriverGLStates::enableNormalArray(bool enable) } } // *************************************************************************** -void CDriverGLStates::enableWeightArray(bool enable) +void CDriverGLStates3::enableWeightArray(bool enable) { - H_AUTO_OGL(CDriverGLStates_enableWeightArray); + H_AUTO_OGL(CDriverGLStates3_enableWeightArray); if(_WeightArrayEnabled != enable) { @@ -907,9 +907,9 @@ void CDriverGLStates::enableWeightArray(bool enable) } } // *************************************************************************** -void CDriverGLStates::enableColorArray(bool enable) +void CDriverGLStates3::enableColorArray(bool enable) { - H_AUTO_OGL(CDriverGLStates_enableColorArray); + H_AUTO_OGL(CDriverGLStates3_enableColorArray); if(_ColorArrayEnabled != enable) { @@ -925,9 +925,9 @@ void CDriverGLStates::enableColorArray(bool enable) // *************************************************************************** -void CDriverGLStates::enableSecondaryColorArray(bool enable) +void CDriverGLStates3::enableSecondaryColorArray(bool enable) { - H_AUTO_OGL(CDriverGLStates_enableSecondaryColorArray); + H_AUTO_OGL(CDriverGLStates3_enableSecondaryColorArray); if(_SecondaryColorArrayEnabled != enable) { @@ -952,9 +952,9 @@ void CDriverGLStates::enableSecondaryColorArray(bool enable) } // *************************************************************************** -void CDriverGLStates::clientActiveTextureARB(uint stage) +void CDriverGLStates3::clientActiveTextureARB(uint stage) { - H_AUTO_OGL(CDriverGLStates_clientActiveTextureARB); + H_AUTO_OGL(CDriverGLStates3_clientActiveTextureARB); if( _CurrentClientActiveTextureARB != stage ) { @@ -968,9 +968,9 @@ void CDriverGLStates::clientActiveTextureARB(uint stage) } // *************************************************************************** -void CDriverGLStates::enableTexCoordArray(bool enable) +void CDriverGLStates3::enableTexCoordArray(bool enable) { - H_AUTO_OGL(CDriverGLStates_enableTexCoordArray); + H_AUTO_OGL(CDriverGLStates3_enableTexCoordArray); if(_TexCoordArrayEnabled[_CurrentClientActiveTextureARB] != enable) { @@ -985,9 +985,9 @@ void CDriverGLStates::enableTexCoordArray(bool enable) } // *************************************************************************** -void CDriverGLStates::enableVertexAttribArray(uint glIndex, bool enable) +void CDriverGLStates3::enableVertexAttribArray(uint glIndex, bool enable) { - H_AUTO_OGL(CDriverGLStates_enableVertexAttribArray); + H_AUTO_OGL(CDriverGLStates3_enableVertexAttribArray); if(_VertexAttribArrayEnabled[glIndex] != enable) { @@ -1003,9 +1003,9 @@ void CDriverGLStates::enableVertexAttribArray(uint glIndex, bool enable) } // *************************************************************************** -void CDriverGLStates::enableVertexAttribArrayARB(uint glIndex,bool enable) +void CDriverGLStates3::enableVertexAttribArrayARB(uint glIndex,bool enable) { - H_AUTO_OGL(CDriverGLStates_enableVertexAttribArrayARB); + H_AUTO_OGL(CDriverGLStates3_enableVertexAttribArrayARB); #ifndef NL3D_GLSTATE_DISABLE_CACHE if(_VertexAttribArrayEnabled[glIndex] != enable) @@ -1023,9 +1023,9 @@ void CDriverGLStates::enableVertexAttribArrayARB(uint glIndex,bool enable) } // *************************************************************************** -void CDriverGLStates::enableVertexAttribArrayForEXTVertexShader(uint glIndex, bool enable, uint *variants) +void CDriverGLStates3::enableVertexAttribArrayForEXTVertexShader(uint glIndex, bool enable, uint *variants) { - H_AUTO_OGL(CDriverGLStates_enableVertexAttribArrayForEXTVertexShader); + H_AUTO_OGL(CDriverGLStates3_enableVertexAttribArrayForEXTVertexShader); if(_VertexAttribArrayEnabled[glIndex] != enable) { @@ -1037,9 +1037,9 @@ void CDriverGLStates::enableVertexAttribArrayForEXTVertexShader(uint glIndex, bo case 1: // skin weight #ifndef USE_OPENGLES if(enable) - nglEnableVariantClientStateEXT(variants[CDriverGL::EVSSkinWeightVariant]); + nglEnableVariantClientStateEXT(variants[CDriverGL3::EVSSkinWeightVariant]); else - nglDisableVariantClientStateEXT(variants[CDriverGL::EVSSkinWeightVariant]); + nglDisableVariantClientStateEXT(variants[CDriverGL3::EVSSkinWeightVariant]); #endif break; case 2: // normal @@ -1051,25 +1051,25 @@ void CDriverGLStates::enableVertexAttribArrayForEXTVertexShader(uint glIndex, bo case 4: // secondary color #ifndef USE_OPENGLES if(enable) - nglEnableVariantClientStateEXT(variants[CDriverGL::EVSSecondaryColorVariant]); + nglEnableVariantClientStateEXT(variants[CDriverGL3::EVSSecondaryColorVariant]); else - nglDisableVariantClientStateEXT(variants[CDriverGL::EVSSecondaryColorVariant]); + nglDisableVariantClientStateEXT(variants[CDriverGL3::EVSSecondaryColorVariant]); #endif break; case 5: // fog coordinate #ifndef USE_OPENGLES if(enable) - nglEnableVariantClientStateEXT(variants[CDriverGL::EVSFogCoordsVariant]); + nglEnableVariantClientStateEXT(variants[CDriverGL3::EVSFogCoordsVariant]); else - nglDisableVariantClientStateEXT(variants[CDriverGL::EVSFogCoordsVariant]); + nglDisableVariantClientStateEXT(variants[CDriverGL3::EVSFogCoordsVariant]); #endif break; case 6: // palette skin #ifndef USE_OPENGLES if(enable) - nglEnableVariantClientStateEXT(variants[CDriverGL::EVSPaletteSkinVariant]); + nglEnableVariantClientStateEXT(variants[CDriverGL3::EVSPaletteSkinVariant]); else - nglDisableVariantClientStateEXT(variants[CDriverGL::EVSPaletteSkinVariant]); + nglDisableVariantClientStateEXT(variants[CDriverGL3::EVSPaletteSkinVariant]); #endif break; case 7: // empty @@ -1097,9 +1097,9 @@ void CDriverGLStates::enableVertexAttribArrayForEXTVertexShader(uint glIndex, bo // *************************************************************************** -void CDriverGLStates::enableFog(uint enable) +void CDriverGLStates3::enableFog(uint enable) { - H_AUTO_OGL(CDriverGLStates_enableFog) + H_AUTO_OGL(CDriverGLStates3_enableFog) // If different from current setup, update. bool enabled= (enable!=0); #ifndef NL3D_GLSTATE_DISABLE_CACHE @@ -1117,9 +1117,9 @@ void CDriverGLStates::enableFog(uint enable) } // *************************************************************************** -void CDriverGLStates::forceBindARBVertexBuffer(uint objectID) +void CDriverGLStates3::forceBindARBVertexBuffer(uint objectID) { - H_AUTO_OGL(CDriverGLStates_forceBindARBVertexBuffer) + H_AUTO_OGL(CDriverGLStates3_forceBindARBVertexBuffer) #ifdef USE_OPENGLES glBindBuffer(GL_ARRAY_BUFFER, objectID); @@ -1131,9 +1131,9 @@ void CDriverGLStates::forceBindARBVertexBuffer(uint objectID) } // *************************************************************************** -void CDriverGLStates::bindARBVertexBuffer(uint objectID) +void CDriverGLStates3::bindARBVertexBuffer(uint objectID) { - H_AUTO_OGL(CDriverGLStates_bindARBVertexBuffer) + H_AUTO_OGL(CDriverGLStates3_bindARBVertexBuffer) #ifndef NL3D_GLSTATE_DISABLE_CACHE if (objectID != _CurrARBVertexBuffer) #endif @@ -1143,9 +1143,9 @@ void CDriverGLStates::bindARBVertexBuffer(uint objectID) } // *************************************************************************** -void CDriverGLStates::setCullMode(TCullMode cullMode) +void CDriverGLStates3::setCullMode(TCullMode cullMode) { - H_AUTO_OGL(CDriverGLStates_setCullMode) + H_AUTO_OGL(CDriverGLStates3_setCullMode) #ifndef NL3D_GLSTATE_DISABLE_CACHE if (cullMode != _CullMode) #endif @@ -1156,9 +1156,9 @@ void CDriverGLStates::setCullMode(TCullMode cullMode) } // *************************************************************************** -CDriverGLStates::TCullMode CDriverGLStates::getCullMode() const +CDriverGLStates3::TCullMode CDriverGLStates3::getCullMode() const { - H_AUTO_OGL(CDriverGLStates_CDriverGLStates) + H_AUTO_OGL(CDriverGLStates3_CDriverGLStates) return _CullMode; } diff --git a/code/nel/src/3d/driver/OpenGL3/driver_opengl_states.h b/code/nel/src/3d/driver/OpenGL3/driver_opengl_states.h index be5c1918f..b04ad2be3 100644 --- a/code/nel/src/3d/driver/OpenGL3/driver_opengl_states.h +++ b/code/nel/src/3d/driver/OpenGL3/driver_opengl_states.h @@ -26,7 +26,7 @@ namespace NL3D { #ifdef USE_OPENGLES namespace NLDRIVERGLES { #else -namespace NLDRIVERGL { +namespace NLDRIVERGL3 { #endif #endif @@ -72,11 +72,11 @@ namespace NLDRIVERGL { * \author Nevrax France * \date 2001 */ -class CDriverGLStates +class CDriverGLStates3 { public: /// Constructor. no-op. - CDriverGLStates(); + CDriverGLStates3(); // init. Do it just after setDisplay() void init(bool supportTextureCubeMap, bool supportTextureRectangle, uint maxLight); 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 77954a8e3..290a84a0a 100644 --- a/code/nel/src/3d/driver/OpenGL3/driver_opengl_texture.cpp +++ b/code/nel/src/3d/driver/OpenGL3/driver_opengl_texture.cpp @@ -47,15 +47,15 @@ namespace NL3D { #ifdef USE_OPENGLES namespace NLDRIVERGLES { #else -namespace NLDRIVERGL { +namespace NLDRIVERGL3 { #endif #endif // *************************************************************************** -CTextureDrvInfosGL::CTextureDrvInfosGL(IDriver *drv, ItTexDrvInfoPtrMap it, CDriverGL *drvGl, bool isRectangleTexture) : ITextureDrvInfos(drv, it) +CTextureDrvInfosGL3::CTextureDrvInfosGL3(IDriver *drv, ItTexDrvInfoPtrMap it, CDriverGL3 *drvGl, bool isRectangleTexture) : ITextureDrvInfos(drv, it) { - H_AUTO_OGL(CTextureDrvInfosGL_CTextureDrvInfosGL) - //nldebug("3D: CTextureDrvInfosGL::ctor()"); + H_AUTO_OGL(CTextureDrvInfosGL3_CTextureDrvInfosGL3) + //nldebug("3D: CTextureDrvInfosGL3::ctor()"); // The id is auto created here. glGenTextures(1,&ID); @@ -81,9 +81,9 @@ CTextureDrvInfosGL::CTextureDrvInfosGL(IDriver *drv, ItTexDrvInfoPtrMap it, CDri UsePackedDepthStencil = drvGl->supportPackedDepthStencil(); } // *************************************************************************** -CTextureDrvInfosGL::~CTextureDrvInfosGL() +CTextureDrvInfosGL3::~CTextureDrvInfosGL3() { - H_AUTO_OGL(CTextureDrvInfosGL_CTextureDrvInfosGLDtor) + H_AUTO_OGL(CTextureDrvInfosGL3_CTextureDrvInfosGLDtor) // The id is auto deleted here. glDeleteTextures(1,&ID); @@ -116,7 +116,7 @@ CTextureDrvInfosGL::~CTextureDrvInfosGL() } // *************************************************************************** -bool CTextureDrvInfosGL::initFrameBufferObject(ITexture * tex) +bool CTextureDrvInfosGL3::initFrameBufferObject(ITexture * tex) { if(!InitFBO) { @@ -354,7 +354,7 @@ bool CTextureDrvInfosGL::initFrameBufferObject(ITexture * tex) } // *************************************************************************** -bool CTextureDrvInfosGL::activeFrameBufferObject(ITexture * tex) +bool CTextureDrvInfosGL3::activeFrameBufferObject(ITexture * tex) { if(tex) { @@ -384,19 +384,19 @@ bool CTextureDrvInfosGL::activeFrameBufferObject(ITexture * tex) // *************************************************************************** // Get the glText mirror of an existing setuped texture. -static inline CTextureDrvInfosGL* getTextureGl(ITexture& tex) +static inline CTextureDrvInfosGL3* getTextureGl(ITexture& tex) { H_AUTO_OGL(getTextureGl) - CTextureDrvInfosGL* gltex; - gltex= (CTextureDrvInfosGL*)(ITextureDrvInfos*)(tex.TextureDrvShare->DrvTexture); + CTextureDrvInfosGL3* gltex; + gltex= (CTextureDrvInfosGL3*)(ITextureDrvInfos*)(tex.TextureDrvShare->DrvTexture); return gltex; } // *************************************************************************** // Translation of TexFmt mode. -GLint CDriverGL::getGlTextureFormat(ITexture& tex, bool &compressed) +GLint CDriverGL3::getGlTextureFormat(ITexture& tex, bool &compressed) { - H_AUTO_OGL(CDriverGL_getGlTextureFormat) + H_AUTO_OGL(CDriverGL3_getGlTextureFormat) ITexture::TUploadFormat texfmt= tex.getUploadFormat(); // If auto, retrieve the pixel format of the bitmap. @@ -549,9 +549,9 @@ static GLenum getGlSrcTextureComponentType(GLint texSrcFormat) } // *************************************************************************** -uint CDriverGL::computeMipMapMemoryUsage(uint w, uint h, GLint glfmt) const +uint CDriverGL3::computeMipMapMemoryUsage(uint w, uint h, GLint glfmt) const { - H_AUTO_OGL(CDriverGL_computeMipMapMemoryUsage) + H_AUTO_OGL(CDriverGL3_computeMipMapMemoryUsage) switch(glfmt) { #ifdef GL_RGBA8 @@ -640,7 +640,7 @@ static inline GLenum translateWrapToGl(ITexture::TWrapMode mode, const CGlExtens } // *************************************************************************** -static inline GLenum translateMagFilterToGl(CTextureDrvInfosGL *glText) +static inline GLenum translateMagFilterToGl(CTextureDrvInfosGL3 *glText) { H_AUTO_OGL(translateMagFilterToGl) #ifdef NEL_FORCE_NEAREST @@ -660,7 +660,7 @@ static inline GLenum translateMagFilterToGl(CTextureDrvInfosGL *glText) // *************************************************************************** -static inline GLenum translateMinFilterToGl(CTextureDrvInfosGL *glText) +static inline GLenum translateMinFilterToGl(CTextureDrvInfosGL3 *glText) { H_AUTO_OGL(translateMinFilterToGl) #ifdef NEL_FORCE_NEAREST @@ -758,7 +758,7 @@ static inline bool isDXTCFormat(GLint glfmt) } // *************************************************************************** -bool CDriverGL::setupTexture (ITexture& tex) +bool CDriverGL3::setupTexture (ITexture& tex) { H_AUTO_OGL(setupTexture) bool nTmp; @@ -769,9 +769,9 @@ bool CDriverGL::setupTexture (ITexture& tex) #ifndef NL_DEBUG inline #endif -void CDriverGL::bindTextureWithMode(ITexture &tex) +void CDriverGL3::bindTextureWithMode(ITexture &tex) { - CTextureDrvInfosGL* gltext; + CTextureDrvInfosGL3* gltext; gltext= getTextureGl(tex); // system of "backup the previous binded texture" seems to not work with some drivers.... _DriverGLStates.activeTextureARB(0); @@ -779,17 +779,17 @@ void CDriverGL::bindTextureWithMode(ITexture &tex) { if (_Extensions.ARBTextureCubeMap) { - _DriverGLStates.setTextureMode(CDriverGLStates::TextureCubeMap); + _DriverGLStates.setTextureMode(CDriverGLStates3::TextureCubeMap); // Bind this texture glBindTexture(GL_TEXTURE_CUBE_MAP_ARB, gltext->ID); } } else { - CDriverGLStates::TTextureMode textureMode= CDriverGLStates::Texture2D; + CDriverGLStates3::TTextureMode textureMode= CDriverGLStates3::Texture2D; #ifndef USE_OPENGLES if(gltext->TextureMode == GL_TEXTURE_RECTANGLE_NV) - textureMode = CDriverGLStates::TextureRect; + textureMode = CDriverGLStates3::TextureRect; #endif _DriverGLStates.setTextureMode(textureMode); @@ -802,9 +802,9 @@ void CDriverGL::bindTextureWithMode(ITexture &tex) #ifndef NL_DEBUG inline #endif -void CDriverGL::setupTextureBasicParameters(ITexture &tex) +void CDriverGL3::setupTextureBasicParameters(ITexture &tex) { - CTextureDrvInfosGL* gltext; + CTextureDrvInfosGL3* gltext; gltext= getTextureGl(tex); // TODO: possible cache here, but beware, this is called just after texture creation as well, so these fields // haven't ever been filled. @@ -843,10 +843,10 @@ void CDriverGL::setupTextureBasicParameters(ITexture &tex) } // *************************************************************************** -bool CDriverGL::setupTextureEx (ITexture& tex, bool bUpload, bool &bAllUploaded, bool bMustRecreateSharedTexture) +bool CDriverGL3::setupTextureEx (ITexture& tex, bool bUpload, bool &bAllUploaded, bool bMustRecreateSharedTexture) { H_AUTO_OGL(setupTextureEx) - //nldebug("3D: CDriverGL::setupTextureEx(%016p, %d, %d, %d)", &tex, bUpload, bAllUploaded, bMustRecreateSharedTexture); + //nldebug("3D: CDriverGL3::setupTextureEx(%016p, %d, %d, %d)", &tex, bUpload, bAllUploaded, bMustRecreateSharedTexture); bAllUploaded = false; if(tex.isTextureCube() && (!_Extensions.ARBTextureCubeMap)) @@ -881,7 +881,7 @@ bool CDriverGL::setupTextureEx (ITexture& tex, bool bUpload, bool &bAllUploaded, // Disable texture 0 _CurrentTexture[0]= NULL; _CurrentTextureInfoGL[0]= NULL; - _DriverGLStates.setTextureMode(CDriverGLStates::TextureDisabled); + _DriverGLStates.setTextureMode(CDriverGLStates3::TextureDisabled); // } // @@ -928,7 +928,7 @@ bool CDriverGL::setupTextureEx (ITexture& tex, bool bUpload, bool &bAllUploaded, // insert into driver map. (so it is deleted when driver is deleted). itTex= (rTexDrvInfos.insert(make_pair(name, (ITextureDrvInfos*)NULL))).first; // create and set iterator, for future deletion. - itTex->second= tex.TextureDrvShare->DrvTexture = new CTextureDrvInfosGL(this, itTex, this, isTextureRectangle(&tex)); + itTex->second= tex.TextureDrvShare->DrvTexture = new CTextureDrvInfosGL3(this, itTex, this, isTextureRectangle(&tex)); // need to load ALL this texture. mustLoadAll= true; @@ -957,7 +957,7 @@ bool CDriverGL::setupTextureEx (ITexture& tex, bool bUpload, bool &bAllUploaded, // Must create it. Create auto a GL id (in constructor). // Do not insert into the map. This un-shared texture will be deleted at deletion of the texture. // Inform ITextureDrvInfos by passing NULL _Driver. - tex.TextureDrvShare->DrvTexture = new CTextureDrvInfosGL(NULL, ItTexDrvInfoPtrMap(), this, isTextureRectangle(&tex)); + tex.TextureDrvShare->DrvTexture = new CTextureDrvInfosGL3(NULL, ItTexDrvInfoPtrMap(), this, isTextureRectangle(&tex)); // need to load ALL this texture. mustLoadAll= true; @@ -975,7 +975,7 @@ bool CDriverGL::setupTextureEx (ITexture& tex, bool bUpload, bool &bAllUploaded, // system of "backup the previous binded texture" seems to not work with some drivers.... bindTextureWithMode(tex); - CTextureDrvInfosGL* gltext; + CTextureDrvInfosGL3* gltext; gltext= getTextureGl(tex); glPixelStorei(GL_UNPACK_ALIGNMENT,1); @@ -1296,7 +1296,7 @@ bool CDriverGL::setupTextureEx (ITexture& tex, bool bUpload, bool &bAllUploaded, // Disable texture 0 _CurrentTexture[0]= NULL; _CurrentTextureInfoGL[0]= NULL; - _DriverGLStates.setTextureMode(CDriverGLStates::TextureDisabled); + _DriverGLStates.setTextureMode(CDriverGLStates3::TextureDisabled); } // The texture is correctly setuped. @@ -1305,7 +1305,7 @@ bool CDriverGL::setupTextureEx (ITexture& tex, bool bUpload, bool &bAllUploaded, } // *************************************************************************** -bool CDriverGL::uploadTexture (ITexture& tex, CRect& rect, uint8 nNumMipMap) +bool CDriverGL3::uploadTexture (ITexture& tex, CRect& rect, uint8 nNumMipMap) { H_AUTO_OGL(uploadTexture) if (tex.TextureDrvShare == NULL) @@ -1330,16 +1330,16 @@ bool CDriverGL::uploadTexture (ITexture& tex, CRect& rect, uint8 nNumMipMap) clamp (y1, y0, h); // bind the texture to upload - CTextureDrvInfosGL* gltext; + CTextureDrvInfosGL3* gltext; gltext = getTextureGl (tex); // system of "backup the previous binded texture" seems to not work with some drivers.... _DriverGLStates.activeTextureARB (0); - CDriverGLStates::TTextureMode textureMode= CDriverGLStates::Texture2D; + CDriverGLStates3::TTextureMode textureMode= CDriverGLStates3::Texture2D; #ifndef USE_OPENGLES if(gltext->TextureMode == GL_TEXTURE_RECTANGLE_NV) - textureMode = CDriverGLStates::TextureRect; + textureMode = CDriverGLStates3::TextureRect; #endif _DriverGLStates.setTextureMode (textureMode); @@ -1390,7 +1390,7 @@ bool CDriverGL::uploadTexture (ITexture& tex, CRect& rect, uint8 nNumMipMap) { _CurrentTexture[0]= NULL; _CurrentTextureInfoGL[0]= NULL; - _DriverGLStates.setTextureMode (CDriverGLStates::TextureDisabled); + _DriverGLStates.setTextureMode (CDriverGLStates3::TextureDisabled); return false; } @@ -1457,13 +1457,13 @@ bool CDriverGL::uploadTexture (ITexture& tex, CRect& rect, uint8 nNumMipMap) // Disable texture 0 _CurrentTexture[0]= NULL; _CurrentTextureInfoGL[0]= NULL; - _DriverGLStates.setTextureMode (CDriverGLStates::TextureDisabled); + _DriverGLStates.setTextureMode (CDriverGLStates3::TextureDisabled); return true; } // *************************************************************************** -bool CDriverGL::uploadTextureCube (ITexture& tex, CRect& /* rect */, uint8 /* nNumMipMap */, uint8 /* nNumFace */) +bool CDriverGL3::uploadTextureCube (ITexture& tex, CRect& /* rect */, uint8 /* nNumMipMap */, uint8 /* nNumFace */) { H_AUTO_OGL(uploadTextureCube) if (tex.TextureDrvShare == NULL) @@ -1475,7 +1475,7 @@ bool CDriverGL::uploadTextureCube (ITexture& tex, CRect& /* rect */, uint8 /* nN } // *************************************************************************** -bool CDriverGL::activateTexture(uint stage, ITexture *tex) +bool CDriverGL3::activateTexture(uint stage, ITexture *tex) { H_AUTO_OGL(activateTexture) if (this->_CurrentTexture[stage]!=tex) @@ -1484,7 +1484,7 @@ bool CDriverGL::activateTexture(uint stage, ITexture *tex) if(tex && tex->TextureDrvShare) { // get the drv info. should be not NULL. - CTextureDrvInfosGL* gltext; + CTextureDrvInfosGL3* gltext; gltext= getTextureGl(*tex); // Profile, log the use of this texture @@ -1498,7 +1498,7 @@ bool CDriverGL::activateTexture(uint stage, ITexture *tex) if(tex->isTextureCube()) { // setup texture mode, after activeTextureARB() - _DriverGLStates.setTextureMode(CDriverGLStates::TextureCubeMap); + _DriverGLStates.setTextureMode(CDriverGLStates3::TextureCubeMap); if(_Extensions.ARBTextureCubeMap) { @@ -1532,12 +1532,12 @@ bool CDriverGL::activateTexture(uint stage, ITexture *tex) else { // setup texture mode, after activeTextureARB() - CDriverGLStates::TTextureMode textureMode= CDriverGLStates::Texture2D; + CDriverGLStates3::TTextureMode textureMode= CDriverGLStates3::Texture2D; #ifndef USE_OPENGLES if(gltext->TextureMode == GL_TEXTURE_RECTANGLE_NV) - textureMode = CDriverGLStates::TextureRect; + textureMode = CDriverGLStates3::TextureRect; #endif - _DriverGLStates.setTextureMode(/*CDriverGLStates::Texture2D*/textureMode); + _DriverGLStates.setTextureMode(/*CDriverGLStates3::Texture2D*/textureMode); // Activate texture... //====================== @@ -1582,7 +1582,7 @@ bool CDriverGL::activateTexture(uint stage, ITexture *tex) // Force no texturing for this stage. _CurrentTextureInfoGL[stage]= NULL; // setup texture mode, after activeTextureARB() - _DriverGLStates.setTextureMode(CDriverGLStates::TextureDisabled); + _DriverGLStates.setTextureMode(CDriverGLStates3::TextureDisabled); #ifndef USE_OPENGLES if (_Extensions.ATITextureEnvCombine3) @@ -1907,7 +1907,7 @@ static void forceActivateTexEnvModeEnvCombine4(const CMaterial::CTexEnv &env) #endif // *************************************************************************** -void CDriverGL::forceActivateTexEnvMode(uint stage, const CMaterial::CTexEnv &env) +void CDriverGL3::forceActivateTexEnvMode(uint stage, const CMaterial::CTexEnv &env) { H_AUTO_OGL(forceActivateTexEnvMode) // cache mgt. @@ -2150,9 +2150,9 @@ void CDriverGL::forceActivateTexEnvMode(uint stage, const CMaterial::CTexEnv & } // *************************************************************************** -void CDriverGL::activateTexEnvColor(uint stage, NLMISC::CRGBA col) +void CDriverGL3::activateTexEnvColor(uint stage, NLMISC::CRGBA col) { - H_AUTO_OGL(CDriverGL_activateTexEnvColor) + H_AUTO_OGL(CDriverGL3_activateTexEnvColor) if (col != _CurrentTexEnv[stage].ConstantColor) { forceActivateTexEnvColor(stage, col); @@ -2160,9 +2160,9 @@ void CDriverGL::activateTexEnvColor(uint stage, NLMISC::CRGBA col) } // *************************************************************************** -void CDriverGL::activateTexEnvMode(uint stage, const CMaterial::CTexEnv &env) +void CDriverGL3::activateTexEnvMode(uint stage, const CMaterial::CTexEnv &env) { - H_AUTO_OGL(CDriverGL_activateTexEnvMode) + H_AUTO_OGL(CDriverGL3_activateTexEnvMode) // If a special Texture environnement is setuped, or if not the same normal texture environnement, // must setup a new normal Texture environnement. if(_CurrentTexEnvSpecial[stage] != TexEnvSpecialDisabled || _CurrentTexEnv[stage].EnvPacked!= env.EnvPacked) @@ -2173,9 +2173,9 @@ void CDriverGL::activateTexEnvMode(uint stage, const CMaterial::CTexEnv &env) // *************************************************************************** -void CDriverGL::activateTexEnvColor(uint stage, const CMaterial::CTexEnv &env) +void CDriverGL3::activateTexEnvColor(uint stage, const CMaterial::CTexEnv &env) { - H_AUTO_OGL(CDriverGL_activateTexEnvColor) + H_AUTO_OGL(CDriverGL3_activateTexEnvColor) if(_CurrentTexEnv[stage].ConstantColor!= env.ConstantColor) { forceActivateTexEnvColor(stage, env); @@ -2184,16 +2184,16 @@ void CDriverGL::activateTexEnvColor(uint stage, const CMaterial::CTexEnv &env) // *************************************************************************** -void CDriverGL::forceDXTCCompression(bool dxtcComp) +void CDriverGL3::forceDXTCCompression(bool dxtcComp) { - H_AUTO_OGL(CDriverGL_forceDXTCCompression) + H_AUTO_OGL(CDriverGL3_forceDXTCCompression) _ForceDXTCCompression= dxtcComp; } // *************************************************************************** -void CDriverGL::setAnisotropicFilter(sint filtering) +void CDriverGL3::setAnisotropicFilter(sint filtering) { - H_AUTO_OGL(CDriverGL_setAnisotropicFiltering); + H_AUTO_OGL(CDriverGL3_setAnisotropicFiltering); if (!_Extensions.EXTTextureFilterAnisotropic) return; @@ -2210,9 +2210,9 @@ void CDriverGL::setAnisotropicFilter(sint filtering) } // *************************************************************************** -void CDriverGL::forceTextureResize(uint divisor) +void CDriverGL3::forceTextureResize(uint divisor) { - H_AUTO_OGL(CDriverGL_forceTextureResize) + H_AUTO_OGL(CDriverGL3_forceTextureResize) clamp(divisor, 1U, 256U); // 16 -> 4. @@ -2221,9 +2221,9 @@ void CDriverGL::forceTextureResize(uint divisor) // *************************************************************************** -void CDriverGL::swapTextureHandle(ITexture &tex0, ITexture &tex1) +void CDriverGL3::swapTextureHandle(ITexture &tex0, ITexture &tex1) { - H_AUTO_OGL(CDriverGL_swapTextureHandle) + H_AUTO_OGL(CDriverGL3_swapTextureHandle) // ensure creation of both texture setupTexture(tex0); setupTexture(tex1); @@ -2235,8 +2235,8 @@ void CDriverGL::swapTextureHandle(ITexture &tex0, ITexture &tex1) } // get the handle. - CTextureDrvInfosGL *t0= getTextureGl(tex0); - CTextureDrvInfosGL *t1= getTextureGl(tex1); + CTextureDrvInfosGL3 *t0= getTextureGl(tex0); + CTextureDrvInfosGL3 *t1= getTextureGl(tex1); /* Swap contents. Can't swap directly the pointers cause would have to change all CTextureDrvShare which point on Can't do swap(*t0, *t1), because must keep the correct _DriverIterator @@ -2260,15 +2260,15 @@ void CDriverGL::swapTextureHandle(ITexture &tex0, ITexture &tex1) // *************************************************************************** -uint CDriverGL::getTextureHandle(const ITexture &tex) +uint CDriverGL3::getTextureHandle(const ITexture &tex) { - H_AUTO_OGL(CDriverGL_getTextureHandle) + H_AUTO_OGL(CDriverGL3_getTextureHandle) // If DrvShare not setuped if(!tex.TextureDrvShare) return 0; // If DrvInfo not setuped - const CTextureDrvInfosGL *t0= (const CTextureDrvInfosGL*)(const ITextureDrvInfos*)(tex.TextureDrvShare->DrvTexture); + const CTextureDrvInfosGL3 *t0= (const CTextureDrvInfosGL3*)(const ITextureDrvInfos*)(tex.TextureDrvShare->DrvTexture); if(!t0) return 0; @@ -2285,9 +2285,9 @@ uint CDriverGL::getTextureHandle(const ITexture &tex) setRenderTarget (NULL) copies the modified framebuffer area into "tex" and then, updates the viewport and scissor */ -bool CDriverGL::setRenderTarget (ITexture *tex, uint32 x, uint32 y, uint32 width, uint32 height, uint32 mipmapLevel, uint32 cubeFace) +bool CDriverGL3::setRenderTarget (ITexture *tex, uint32 x, uint32 y, uint32 width, uint32 height, uint32 mipmapLevel, uint32 cubeFace) { - H_AUTO_OGL(CDriverGL_setRenderTarget ) + H_AUTO_OGL(CDriverGL3_setRenderTarget ) // make backup of offscreen buffer to old texture if not using FBOs if (!_RenderTargetFBO && _TextureTarget && _TextureTargetUpload && (_TextureTarget != tex || _TextureTargetCubeFace != cubeFace)) @@ -2355,7 +2355,7 @@ bool CDriverGL::setRenderTarget (ITexture *tex, uint32 x, uint32 y, uint32 width // *************************************************************************** -bool CDriverGL::copyTargetToTexture (ITexture *tex, +bool CDriverGL3::copyTargetToTexture (ITexture *tex, uint32 offsetx, uint32 offsety, uint32 x, @@ -2364,7 +2364,7 @@ bool CDriverGL::copyTargetToTexture (ITexture *tex, uint32 height, uint32 mipmapLevel) { - H_AUTO_OGL(CDriverGL_copyTargetToTexture) + H_AUTO_OGL(CDriverGL3_copyTargetToTexture) if (!_TextureTarget) return false; _TextureTargetUpload = false; @@ -2384,9 +2384,9 @@ bool CDriverGL::copyTargetToTexture (ITexture *tex, // *************************************************************************** -bool CDriverGL::getRenderTargetSize (uint32 &width, uint32 &height) +bool CDriverGL3::getRenderTargetSize (uint32 &width, uint32 &height) { - H_AUTO_OGL(CDriverGL_getRenderTargetSize) + H_AUTO_OGL(CDriverGL3_getRenderTargetSize) if (_TextureTarget) { width = _TextureTarget->getWidth(); diff --git a/code/nel/src/3d/driver/OpenGL3/driver_opengl_vertex.cpp b/code/nel/src/3d/driver/OpenGL3/driver_opengl_vertex.cpp index 14ed83adb..32b206329 100644 --- a/code/nel/src/3d/driver/OpenGL3/driver_opengl_vertex.cpp +++ b/code/nel/src/3d/driver/OpenGL3/driver_opengl_vertex.cpp @@ -52,13 +52,13 @@ namespace NL3D { #ifdef USE_OPENGLES namespace NLDRIVERGLES { #else -namespace NLDRIVERGL { +namespace NLDRIVERGL3 { #endif #endif // *************************************************************************** -CVBDrvInfosGL::CVBDrvInfosGL(CDriverGL *drv, ItVBDrvInfoPtrList it, CVertexBuffer *vb) : IVBDrvInfos(drv, it, vb) +CVBDrvInfosGL3::CVBDrvInfosGL3(CDriverGL3 *drv, ItVBDrvInfoPtrList it, CVertexBuffer *vb) : IVBDrvInfos(drv, it, vb) { H_AUTO_OGL(CVBDrvInfosGL_CVBDrvInfosGL) _DriverGL = drv; @@ -68,7 +68,7 @@ CVBDrvInfosGL::CVBDrvInfosGL(CDriverGL *drv, ItVBDrvInfoPtrList it, CVertexBuffe // *************************************************************************** -CVBDrvInfosGL::~CVBDrvInfosGL() +CVBDrvInfosGL3::~CVBDrvInfosGL3() { H_AUTO_OGL(CVBDrvInfosGL_CVBDrvInfosGLDtor) // Restaure non resident memory @@ -92,7 +92,7 @@ CVBDrvInfosGL::~CVBDrvInfosGL() } // *************************************************************************** -uint8 *CVBDrvInfosGL::lock (uint /* first */, uint /* last */, bool /* readOnly */) +uint8 *CVBDrvInfosGL3::lock (uint /* first */, uint /* last */, bool /* readOnly */) { H_AUTO_OGL(CVBDrvInfosGL_lock) if (_VBHard) @@ -108,7 +108,7 @@ uint8 *CVBDrvInfosGL::lock (uint /* first */, uint /* last */, bool /* readOnly } // *************************************************************************** -void CVBDrvInfosGL::unlock (uint first, uint last) +void CVBDrvInfosGL3::unlock (uint first, uint last) { H_AUTO_OGL(CVBDrvInfosGL_unlock) if (_VBHard) @@ -123,9 +123,9 @@ void CVBDrvInfosGL::unlock (uint first, uint last) } // *************************************************************************** -bool CDriverGL::setupVertexBuffer(CVertexBuffer& VB) +bool CDriverGL3::setupVertexBuffer(CVertexBuffer& VB) { - H_AUTO_OGL(CDriverGL_setupVertexBuffer) + H_AUTO_OGL(CDriverGL3_setupVertexBuffer) // 2. If necessary, do modifications. //================================== const bool touched = (VB.getTouchFlags() & (CVertexBuffer::TouchedReserve|CVertexBuffer::TouchedVertexFormat)) != 0; @@ -144,7 +144,7 @@ bool CDriverGL::setupVertexBuffer(CVertexBuffer& VB) // insert into driver list. (so it is deleted when driver is deleted). ItVBDrvInfoPtrList it= _VBDrvInfos.insert(_VBDrvInfos.end(), (NL3D::IVBDrvInfos*)NULL); // create and set iterator, for future deletion. - CVBDrvInfosGL *info = new CVBDrvInfosGL(this, it, &VB); + CVBDrvInfosGL3 *info = new CVBDrvInfosGL3(this, it, &VB); *it= VB.DrvInfos = info; // Preferred memory @@ -179,9 +179,9 @@ bool CDriverGL::setupVertexBuffer(CVertexBuffer& VB) // *************************************************************************** -bool CDriverGL::activeVertexBuffer(CVertexBuffer& VB) +bool CDriverGL3::activeVertexBuffer(CVertexBuffer& VB) { - H_AUTO_OGL(CDriverGL_activeVertexBuffer) + H_AUTO_OGL(CDriverGL3_activeVertexBuffer) // NB: must duplicate changes in activeVertexBufferHard() uint32 flags; @@ -206,7 +206,7 @@ bool CDriverGL::activeVertexBuffer(CVertexBuffer& VB) //=================== // For MultiPass Material. CVertexBufferInfo::TVBMode lastVBMode = _LastVB.VBMode; - CVBDrvInfosGL *info= safe_cast((IVBDrvInfos*)VB.DrvInfos); + CVBDrvInfosGL3 *info= safe_cast((IVBDrvInfos*)VB.DrvInfos); if (!info->_VBHard || (info->_VBHard && !info->_VBHard->isInvalid())) { _LastVB.setupVertexBuffer(VB); @@ -243,18 +243,18 @@ bool CDriverGL::activeVertexBuffer(CVertexBuffer& VB) } // *************************************************************************** -bool CDriverGL::activeIndexBuffer(CIndexBuffer& IB) +bool CDriverGL3::activeIndexBuffer(CIndexBuffer& IB) { - H_AUTO_OGL(CDriverGL_activeIndexBuffer) + H_AUTO_OGL(CDriverGL3_activeIndexBuffer) _LastIB.setupIndexBuffer(IB); return true; } // *************************************************************************** -bool CDriverGL::renderLines(CMaterial& mat, uint32 firstIndex, uint32 nlines) +bool CDriverGL3::renderLines(CMaterial& mat, uint32 firstIndex, uint32 nlines) { - H_AUTO_OGL(CDriverGL_renderLines) + H_AUTO_OGL(CDriverGL3_renderLines) // update matrix and Light in OpenGL if needed refreshRenderSetup(); @@ -307,9 +307,9 @@ bool CDriverGL::renderLines(CMaterial& mat, uint32 firstIndex, uint32 nlines) // *************************************************************************** -bool CDriverGL::renderTriangles(CMaterial& mat, uint32 firstIndex, uint32 ntris) +bool CDriverGL3::renderTriangles(CMaterial& mat, uint32 firstIndex, uint32 ntris) { - H_AUTO_OGL(CDriverGL_renderTriangles); + H_AUTO_OGL(CDriverGL3_renderTriangles); // update matrix and Light in OpenGL if needed refreshRenderSetup(); @@ -367,9 +367,9 @@ bool CDriverGL::renderTriangles(CMaterial& mat, uint32 firstIndex, uint32 ntris) // *************************************************************************** -bool CDriverGL::renderSimpleTriangles(uint32 firstTri, uint32 ntris) +bool CDriverGL3::renderSimpleTriangles(uint32 firstTri, uint32 ntris) { - H_AUTO_OGL(CDriverGL_renderSimpleTriangles); + H_AUTO_OGL(CDriverGL3_renderSimpleTriangles); nlassert(ntris>0); @@ -411,9 +411,9 @@ bool CDriverGL::renderSimpleTriangles(uint32 firstTri, uint32 ntris) // *************************************************************************** -bool CDriverGL::renderRawPoints(CMaterial& mat, uint32 startIndex, uint32 numPoints) +bool CDriverGL3::renderRawPoints(CMaterial& mat, uint32 startIndex, uint32 numPoints) { - H_AUTO_OGL(CDriverGL_renderRawPoints) + H_AUTO_OGL(CDriverGL3_renderRawPoints) // update matrix and Light in OpenGL if needed refreshRenderSetup(); @@ -452,9 +452,9 @@ bool CDriverGL::renderRawPoints(CMaterial& mat, uint32 startIndex, uint32 numPoi // *************************************************************************** -bool CDriverGL::renderRawLines(CMaterial& mat, uint32 startIndex, uint32 numLines) +bool CDriverGL3::renderRawLines(CMaterial& mat, uint32 startIndex, uint32 numLines) { - H_AUTO_OGL(CDriverGL_renderRawLines) + H_AUTO_OGL(CDriverGL3_renderRawLines) // update matrix and Light in OpenGL if needed refreshRenderSetup(); @@ -493,9 +493,9 @@ bool CDriverGL::renderRawLines(CMaterial& mat, uint32 startIndex, uint32 numLine // *************************************************************************** -bool CDriverGL::renderRawTriangles(CMaterial& mat, uint32 startIndex, uint32 numTris) +bool CDriverGL3::renderRawTriangles(CMaterial& mat, uint32 startIndex, uint32 numTris) { - H_AUTO_OGL(CDriverGL_renderRawTriangles) + H_AUTO_OGL(CDriverGL3_renderRawTriangles) // update matrix and Light in OpenGL if needed refreshRenderSetup(); @@ -536,9 +536,9 @@ bool CDriverGL::renderRawTriangles(CMaterial& mat, uint32 startIndex, uint32 num // *************************************************************************** -bool CDriverGL::renderRawQuads(CMaterial& mat, uint32 startIndex, uint32 numQuads) +bool CDriverGL3::renderRawQuads(CMaterial& mat, uint32 startIndex, uint32 numQuads) { - H_AUTO_OGL(CDriverGL_renderRawQuads) + H_AUTO_OGL(CDriverGL3_renderRawQuads) if (!numQuads) return true; // update matrix and Light in OpenGL if needed refreshRenderSetup(); @@ -664,9 +664,9 @@ bool CDriverGL::renderRawQuads(CMaterial& mat, uint32 startIndex, uint32 numQuad // *************************************************************************** -void CDriverGL::setupUVPtr(uint stage, CVertexBufferInfo &VB, uint uvId) +void CDriverGL3::setupUVPtr(uint stage, CVertexBufferInfo &VB, uint uvId) { - H_AUTO_OGL(CDriverGL_setupUVPtr) + H_AUTO_OGL(CDriverGL3_setupUVPtr) // sould not be called with vertex program Array setuped. nlassert(!_LastSetupGLArrayVertexProgram); @@ -713,9 +713,9 @@ void CDriverGL::setupUVPtr(uint stage, CVertexBufferInfo &VB, uint uvId) // *************************************************************************** -void CDriverGL::mapTextureStageToUV(uint stage, uint uv) +void CDriverGL3::mapTextureStageToUV(uint stage, uint uv) { - H_AUTO_OGL(CDriverGL_mapTextureStageToUV) + H_AUTO_OGL(CDriverGL3_mapTextureStageToUV) // Just call it for last VertexBuffer setuped. setupUVPtr(stage, _LastVB, uv); } @@ -730,41 +730,41 @@ void CDriverGL::mapTextureStageToUV(uint stage, uint uv) // *************************************************************************** -bool CDriverGL::supportVertexBufferHard() const +bool CDriverGL3::supportVertexBufferHard() const { - H_AUTO_OGL(CDriverGL_supportVertexBufferHard) + H_AUTO_OGL(CDriverGL3_supportVertexBufferHard) return _SupportVBHard; } // *************************************************************************** -bool CDriverGL::supportVolatileVertexBuffer() const +bool CDriverGL3::supportVolatileVertexBuffer() const { - H_AUTO_OGL(CDriverGL_supportVolatileVertexBuffer) + H_AUTO_OGL(CDriverGL3_supportVolatileVertexBuffer) return false; } // *************************************************************************** -bool CDriverGL::slowUnlockVertexBufferHard() const +bool CDriverGL3::slowUnlockVertexBufferHard() const { - H_AUTO_OGL(CDriverGL_slowUnlockVertexBufferHard) + H_AUTO_OGL(CDriverGL3_slowUnlockVertexBufferHard) return _SlowUnlockVBHard; } // *************************************************************************** -uint CDriverGL::getMaxVerticesByVertexBufferHard() const +uint CDriverGL3::getMaxVerticesByVertexBufferHard() const { - H_AUTO_OGL(CDriverGL_getMaxVerticesByVertexBufferHard) + H_AUTO_OGL(CDriverGL3_getMaxVerticesByVertexBufferHard) return _MaxVerticesByVBHard; } // *************************************************************************** -IVertexBufferHardGL *CDriverGL::createVertexBufferHard(uint size, uint numVertices, CVertexBuffer::TPreferredMemory vbType, CVertexBuffer *vb) +IVertexBufferHardGL *CDriverGL3::createVertexBufferHard(uint size, uint numVertices, CVertexBuffer::TPreferredMemory vbType, CVertexBuffer *vb) { - H_AUTO_OGL(CDriverGL_createVertexBufferHard) + H_AUTO_OGL(CDriverGL3_createVertexBufferHard) // choose the VertexArrayRange of good type IVertexArrayRange *vertexArrayRange= NULL; switch(vbType) @@ -810,7 +810,7 @@ IVertexBufferHardGL *CDriverGL::createVertexBufferHard(uint size, uint numVertic // *************************************************************************** -const uint CDriverGL::NumCoordinatesType[CVertexBuffer::NumType]= +const uint CDriverGL3::NumCoordinatesType[CVertexBuffer::NumType]= { 1, // Double1 1, // Float1 @@ -829,7 +829,7 @@ const uint CDriverGL::NumCoordinatesType[CVertexBuffer::NumType]= // *************************************************************************** -const uint CDriverGL::GLType[CVertexBuffer::NumType]= +const uint CDriverGL3::GLType[CVertexBuffer::NumType]= { #ifdef USE_OPENGLES GL_FLOAT, // Double1 @@ -863,7 +863,7 @@ const uint CDriverGL::GLType[CVertexBuffer::NumType]= }; // *************************************************************************** -const bool CDriverGL::GLTypeIsIntegral[CVertexBuffer::NumType] = +const bool CDriverGL3::GLTypeIsIntegral[CVertexBuffer::NumType] = { false, // Double1 false, // Float1 @@ -883,7 +883,7 @@ const bool CDriverGL::GLTypeIsIntegral[CVertexBuffer::NumType] = // *************************************************************************** -const uint CDriverGL::GLVertexAttribIndex[CVertexBuffer::NumValue]= +const uint CDriverGL3::GLVertexAttribIndex[CVertexBuffer::NumValue]= { 0, // Position 2, // Normal @@ -906,9 +906,9 @@ const uint CDriverGL::GLVertexAttribIndex[CVertexBuffer::NumValue]= // *************************************************************************** -void CDriverGL::setupGlArraysStd(CVertexBufferInfo &vb) +void CDriverGL3::setupGlArraysStd(CVertexBufferInfo &vb) { - H_AUTO_OGL(CDriverGL_setupGlArraysStd) + H_AUTO_OGL(CDriverGL3_setupGlArraysStd) uint32 flags= vb.VertexFormat; if (vb.VBMode == CVertexBufferInfo::HwARB) @@ -1023,9 +1023,9 @@ void CDriverGL::setupGlArraysStd(CVertexBufferInfo &vb) // *************************************************************************** -void CDriverGL::toggleGlArraysForNVVertexProgram() +void CDriverGL3::toggleGlArraysForNVVertexProgram() { - H_AUTO_OGL(CDriverGL_toggleGlArraysForNVVertexProgram) + H_AUTO_OGL(CDriverGL3_toggleGlArraysForNVVertexProgram) // If change of setup type, must disable olds. //======================= @@ -1066,9 +1066,9 @@ void CDriverGL::toggleGlArraysForNVVertexProgram() } // *************************************************************************** -void CDriverGL::toggleGlArraysForARBVertexProgram() +void CDriverGL3::toggleGlArraysForARBVertexProgram() { - H_AUTO_OGL(CDriverGL_toggleGlArraysForARBVertexProgram) + H_AUTO_OGL(CDriverGL3_toggleGlArraysForARBVertexProgram) // If change of setup type, must disable olds. //======================= @@ -1138,9 +1138,9 @@ void CDriverGL::toggleGlArraysForARBVertexProgram() // *************************************************************************** -void CDriverGL::toggleGlArraysForEXTVertexShader() +void CDriverGL3::toggleGlArraysForEXTVertexShader() { - H_AUTO_OGL(CDriverGL_toggleGlArraysForEXTVertexShader) + H_AUTO_OGL(CDriverGL3_toggleGlArraysForEXTVertexShader) // If change of setup type, must disable olds. //======================= @@ -1151,7 +1151,7 @@ void CDriverGL::toggleGlArraysForEXTVertexShader() CVertexProgram *vp = _LastSetuppedVP; if (vp) { - CVertexProgamDrvInfosGL *drvInfo = NLMISC::safe_cast((IVertexProgramDrvInfos *) vp->_DrvInfo); + CVertexProgamDrvInfosGL3 *drvInfo = NLMISC::safe_cast((IVertexProgramDrvInfos *) vp->_DrvInfo); if (drvInfo) { // Disable all VertexAttribs. @@ -1185,9 +1185,9 @@ void CDriverGL::toggleGlArraysForEXTVertexShader() } // *************************************************************************** -void CDriverGL::setupGlArraysForNVVertexProgram(CVertexBufferInfo &vb) +void CDriverGL3::setupGlArraysForNVVertexProgram(CVertexBufferInfo &vb) { - H_AUTO_OGL(CDriverGL_setupGlArraysForNVVertexProgram) + H_AUTO_OGL(CDriverGL3_setupGlArraysForNVVertexProgram) uint16 flags= vb.VertexFormat; if (vb.VBMode == CVertexBufferInfo::HwARB) @@ -1302,9 +1302,9 @@ static const GLboolean ARBVertexProgramMustNormalizeAttrib[] = }; // *************************************************************************** -void CDriverGL::setupGlArraysForARBVertexProgram(CVertexBufferInfo &vb) +void CDriverGL3::setupGlArraysForARBVertexProgram(CVertexBufferInfo &vb) { - H_AUTO_OGL(CDriverGL_setupGlArraysForARBVertexProgram) + H_AUTO_OGL(CDriverGL3_setupGlArraysForARBVertexProgram) uint32 flags= vb.VertexFormat; @@ -1389,14 +1389,14 @@ void CDriverGL::setupGlArraysForARBVertexProgram(CVertexBufferInfo &vb) // *************************************************************************** -void CDriverGL::setupGlArraysForEXTVertexShader(CVertexBufferInfo &vb) +void CDriverGL3::setupGlArraysForEXTVertexShader(CVertexBufferInfo &vb) { - H_AUTO_OGL(CDriverGL_setupGlArraysForEXTVertexShader) + H_AUTO_OGL(CDriverGL3_setupGlArraysForEXTVertexShader) CVertexProgram *vp = _LastSetuppedVP; if (!vp) return; - CVertexProgamDrvInfosGL *drvInfo = NLMISC::safe_cast((IVertexProgramDrvInfos *) vp->_DrvInfo); + CVertexProgamDrvInfosGL3 *drvInfo = NLMISC::safe_cast((IVertexProgramDrvInfos *) vp->_DrvInfo); if (!drvInfo) return; uint32 flags= vb.VertexFormat; @@ -1438,7 +1438,7 @@ void CDriverGL::setupGlArraysForEXTVertexShader(CVertexBufferInfo &vb) case CVertexBuffer::Weight: // skin weight { nlassert(NumCoordinatesType[type] == 4); // variant, only 4 component supported - nglVariantArrayObjectATI(drvInfo->Variants[CDriverGL::EVSSkinWeightVariant], GLType[type], vb.VertexSize, vb.VertexObjectId, (ptrdiff_t) vb.ValuePtr[CVertexBuffer::Weight]); + nglVariantArrayObjectATI(drvInfo->Variants[CDriverGL3::EVSSkinWeightVariant], GLType[type], vb.VertexSize, vb.VertexObjectId, (ptrdiff_t) vb.ValuePtr[CVertexBuffer::Weight]); } break; case CVertexBuffer::Normal: // normal @@ -1457,21 +1457,21 @@ void CDriverGL::setupGlArraysForEXTVertexShader(CVertexBufferInfo &vb) { // implemented using a variant, as not available with EXTVertexShader nlassert(NumCoordinatesType[type] == 4); // variant, only 4 component supported - nglVariantArrayObjectATI(drvInfo->Variants[CDriverGL::EVSSecondaryColorVariant], GLType[type], vb.VertexSize, vb.VertexObjectId, (ptrdiff_t) vb.ValuePtr[CVertexBuffer::SecondaryColor]); + nglVariantArrayObjectATI(drvInfo->Variants[CDriverGL3::EVSSecondaryColorVariant], GLType[type], vb.VertexSize, vb.VertexObjectId, (ptrdiff_t) vb.ValuePtr[CVertexBuffer::SecondaryColor]); } break; case CVertexBuffer::Fog: // fog coordinate { // implemented using a variant nlassert(NumCoordinatesType[type] == 4); // variant, only 4 component supported - nglVariantArrayObjectATI(drvInfo->Variants[CDriverGL::EVSFogCoordsVariant], GLType[type], vb.VertexSize, vb.VertexObjectId, (ptrdiff_t) vb.ValuePtr[CVertexBuffer::Fog]); + nglVariantArrayObjectATI(drvInfo->Variants[CDriverGL3::EVSFogCoordsVariant], GLType[type], vb.VertexSize, vb.VertexObjectId, (ptrdiff_t) vb.ValuePtr[CVertexBuffer::Fog]); } break; case CVertexBuffer::PaletteSkin: // palette skin { // implemented using a variant nlassert(NumCoordinatesType[type] == 4); // variant, only 4 component supported - nglVariantArrayObjectATI(drvInfo->Variants[CDriverGL::EVSPaletteSkinVariant], GLType[type], vb.VertexSize, vb.VertexObjectId, (ptrdiff_t) vb.ValuePtr[CVertexBuffer::PaletteSkin]); + nglVariantArrayObjectATI(drvInfo->Variants[CDriverGL3::EVSPaletteSkinVariant], GLType[type], vb.VertexSize, vb.VertexObjectId, (ptrdiff_t) vb.ValuePtr[CVertexBuffer::PaletteSkin]); } break; case CVertexBuffer::Empty: // empty @@ -1510,7 +1510,7 @@ void CDriverGL::setupGlArraysForEXTVertexShader(CVertexBufferInfo &vb) { nlassert(NumCoordinatesType[type] == 4); // variant, only 4 component supported #ifndef USE_OPENGLES - nglVariantPointerEXT(drvInfo->Variants[CDriverGL::EVSSkinWeightVariant], GLType[type], vb.VertexSize, vb.ValuePtr[value]); + nglVariantPointerEXT(drvInfo->Variants[CDriverGL3::EVSSkinWeightVariant], GLType[type], vb.VertexSize, vb.ValuePtr[value]); #endif } break; @@ -1531,7 +1531,7 @@ void CDriverGL::setupGlArraysForEXTVertexShader(CVertexBufferInfo &vb) // implemented using a variant, as not available with EXTVertexShader nlassert(NumCoordinatesType[type] == 4); // variant, only 4 component supported #ifndef USE_OPENGLES - nglVariantPointerEXT(drvInfo->Variants[CDriverGL::EVSSecondaryColorVariant], GLType[type], vb.VertexSize, vb.ValuePtr[value]); + nglVariantPointerEXT(drvInfo->Variants[CDriverGL3::EVSSecondaryColorVariant], GLType[type], vb.VertexSize, vb.ValuePtr[value]); #endif } break; @@ -1540,7 +1540,7 @@ void CDriverGL::setupGlArraysForEXTVertexShader(CVertexBufferInfo &vb) // implemented using a variant nlassert(NumCoordinatesType[type] == 4); // variant, only 4 component supported #ifndef USE_OPENGLES - nglVariantPointerEXT(drvInfo->Variants[CDriverGL::EVSFogCoordsVariant], GLType[type], vb.VertexSize, vb.ValuePtr[value]); + nglVariantPointerEXT(drvInfo->Variants[CDriverGL3::EVSFogCoordsVariant], GLType[type], vb.VertexSize, vb.ValuePtr[value]); #endif } break; @@ -1549,7 +1549,7 @@ void CDriverGL::setupGlArraysForEXTVertexShader(CVertexBufferInfo &vb) // implemented using a variant nlassert(NumCoordinatesType[type] == 4); // variant, only 4 component supported #ifndef USE_OPENGLES - nglVariantPointerEXT(drvInfo->Variants[CDriverGL::EVSPaletteSkinVariant], GLType[type], vb.VertexSize, vb.ValuePtr[value]); + nglVariantPointerEXT(drvInfo->Variants[CDriverGL3::EVSPaletteSkinVariant], GLType[type], vb.VertexSize, vb.ValuePtr[value]); #endif } break; @@ -1585,9 +1585,9 @@ void CDriverGL::setupGlArraysForEXTVertexShader(CVertexBufferInfo &vb) // *************************************************************************** -void CDriverGL::setupGlArrays(CVertexBufferInfo &vb) +void CDriverGL3::setupGlArrays(CVertexBufferInfo &vb) { - H_AUTO_OGL(CDriverGL_setupGlArrays) + H_AUTO_OGL(CDriverGL3_setupGlArrays) // Standard case (NVVertexProgram or no vertex program case) if (_Extensions.NVVertexProgram) @@ -1640,7 +1640,7 @@ void CDriverGL::setupGlArrays(CVertexBufferInfo &vb) // *************************************************************************** void CVertexBufferInfo::setupVertexBuffer(CVertexBuffer &vb) { - H_AUTO_OGL(CDriverGL_setupVertexBuffer) + H_AUTO_OGL(CDriverGL3_setupVertexBuffer) sint i; VertexFormat= vb.getVertexFormat(); VertexSize= vb.getVertexSize(); @@ -1649,7 +1649,7 @@ void CVertexBufferInfo::setupVertexBuffer(CVertexBuffer &vb) // Lock the buffer CVertexBufferReadWrite access; uint8 *ptr; - CVBDrvInfosGL *info= safe_cast((IVBDrvInfos*)vb.DrvInfos); + CVBDrvInfosGL3 *info= safe_cast((IVBDrvInfos*)vb.DrvInfos); nlassert (info); if (info->_VBHard) { @@ -1687,9 +1687,9 @@ void CVertexBufferInfo::setupVertexBuffer(CVertexBuffer &vb) // *************************************************************************** -void CDriverGL::resetVertexArrayRange() +void CDriverGL3::resetVertexArrayRange() { - H_AUTO_OGL(CDriverGL_resetVertexArrayRange) + H_AUTO_OGL(CDriverGL3_resetVertexArrayRange) if(_CurrentVertexBufferHard) { // Must ensure it has ended any drawing @@ -1710,9 +1710,9 @@ void CDriverGL::resetVertexArrayRange() // *************************************************************************** -bool CDriverGL::initVertexBufferHard(uint agpMem, uint vramMem) +bool CDriverGL3::initVertexBufferHard(uint agpMem, uint vramMem) { - H_AUTO_OGL(CDriverGL_initVertexBufferHard) + H_AUTO_OGL(CDriverGL3_initVertexBufferHard) if(!supportVertexBufferHard()) return false; @@ -1781,9 +1781,9 @@ bool CDriverGL::initVertexBufferHard(uint agpMem, uint vramMem) // *************************************************************************** -uint32 CDriverGL::getAvailableVertexAGPMemory () +uint32 CDriverGL3::getAvailableVertexAGPMemory () { - H_AUTO_OGL(CDriverGL_getAvailableVertexAGPMemory ) + H_AUTO_OGL(CDriverGL3_getAvailableVertexAGPMemory ) if (_AGPVertexArrayRange) return _AGPVertexArrayRange->sizeAllocated(); else @@ -1792,9 +1792,9 @@ uint32 CDriverGL::getAvailableVertexAGPMemory () // *************************************************************************** -uint32 CDriverGL::getAvailableVertexVRAMMemory () +uint32 CDriverGL3::getAvailableVertexVRAMMemory () { - H_AUTO_OGL(CDriverGL_getAvailableVertexVRAMMemory ) + H_AUTO_OGL(CDriverGL3_getAvailableVertexVRAMMemory ) if (_VRAMVertexArrayRange) return _VRAMVertexArrayRange->sizeAllocated(); else @@ -1803,9 +1803,9 @@ uint32 CDriverGL::getAvailableVertexVRAMMemory () // *************************************************************************** -void CDriverGL::fenceOnCurVBHardIfNeeded(IVertexBufferHardGL *newVBHard) +void CDriverGL3::fenceOnCurVBHardIfNeeded(IVertexBufferHardGL *newVBHard) { - H_AUTO_OGL(CDriverGL_fenceOnCurVBHardIfNeeded); + H_AUTO_OGL(CDriverGL3_fenceOnCurVBHardIfNeeded); #ifndef USE_OPENGLES // If old is not a VBHard, or if not a NVidia VBHard, no-op. diff --git a/code/nel/src/3d/driver/OpenGL3/driver_opengl_vertex_buffer_hard.cpp b/code/nel/src/3d/driver/OpenGL3/driver_opengl_vertex_buffer_hard.cpp index 60109cfb6..3c02201d0 100644 --- a/code/nel/src/3d/driver/OpenGL3/driver_opengl_vertex_buffer_hard.cpp +++ b/code/nel/src/3d/driver/OpenGL3/driver_opengl_vertex_buffer_hard.cpp @@ -30,7 +30,7 @@ namespace NL3D { #ifdef USE_OPENGLES namespace NLDRIVERGLES { #else -namespace NLDRIVERGL { +namespace NLDRIVERGL3 { #endif #endif @@ -47,7 +47,7 @@ namespace NLDRIVERGL { // *************************************************************************** -IVertexArrayRange::IVertexArrayRange(CDriverGL *drv) +IVertexArrayRange::IVertexArrayRange(CDriverGL3 *drv) { H_AUTO_OGL(IVertexArrayRange_IVertexArrayRange) _Driver= drv; @@ -59,7 +59,7 @@ IVertexArrayRange::~IVertexArrayRange() } // *************************************************************************** -IVertexBufferHardGL::IVertexBufferHardGL(CDriverGL *drv, CVertexBuffer *vb) : VB (vb) +IVertexBufferHardGL::IVertexBufferHardGL(CDriverGL3 *drv, CVertexBuffer *vb) : VB (vb) { H_AUTO_OGL(IVertexBufferHardGL_IVertexBufferHardGL) _Driver= drv; @@ -93,7 +93,7 @@ IVertexBufferHardGL::~IVertexBufferHardGL() // *************************************************************************** -CVertexArrayRangeNVidia::CVertexArrayRangeNVidia(CDriverGL *drv) : IVertexArrayRange(drv) +CVertexArrayRangeNVidia::CVertexArrayRangeNVidia(CDriverGL3 *drv) : IVertexArrayRange(drv) { H_AUTO_OGL(CVertexArrayRangeNVidia_CVertexArrayRangeNVidia) _VertexArrayPtr= NULL; @@ -280,7 +280,7 @@ IVertexBufferHardGL *CVertexArrayRangeNVidia::createVBHardGL(uint size, CVertex // *************************************************************************** -CVertexBufferHardGLNVidia::CVertexBufferHardGLNVidia(CDriverGL *drv, CVertexBuffer *vb) : IVertexBufferHardGL(drv, vb) +CVertexBufferHardGLNVidia::CVertexBufferHardGLNVidia(CDriverGL3 *drv, CVertexBuffer *vb) : IVertexBufferHardGL(drv, vb) { H_AUTO_OGL(CVertexBufferHardGLNVidia_CVertexBufferHardGLNVidia) _VertexArrayRange= NULL; @@ -483,7 +483,7 @@ void CVertexBufferHardGLNVidia::testFence() // *************************************************************************** -CVertexArrayRangeATI::CVertexArrayRangeATI(CDriverGL *drv) : IVertexArrayRange(drv) +CVertexArrayRangeATI::CVertexArrayRangeATI(CDriverGL3 *drv) : IVertexArrayRange(drv) { H_AUTO_OGL(CVertexArrayRangeATI_CVertexArrayRangeATI) _Allocated= false; @@ -629,7 +629,7 @@ void CVertexArrayRangeATI::freeVB(void *ptr) // *************************************************************************** -CVertexBufferHardGLATI::CVertexBufferHardGLATI(CDriverGL *drv, CVertexBuffer *vb) : IVertexBufferHardGL(drv, vb) +CVertexBufferHardGLATI::CVertexBufferHardGLATI(CDriverGL3 *drv, CVertexBuffer *vb) : IVertexBufferHardGL(drv, vb) { H_AUTO_OGL(CVertexBufferHardGLATI_CVertexBufferHardGLATI) _VertexArrayRange= NULL; @@ -808,7 +808,7 @@ void CVertexBufferHardGLATI::setupVBInfos(CVertexBufferInfo &vb) // *************************************************************************** -CVertexArrayRangeMapObjectATI::CVertexArrayRangeMapObjectATI(CDriverGL *drv) : IVertexArrayRange(drv), +CVertexArrayRangeMapObjectATI::CVertexArrayRangeMapObjectATI(CDriverGL3 *drv) : IVertexArrayRange(drv), _VBType(CVertexBuffer::AGPPreferred), _SizeAllocated(0) { @@ -910,7 +910,7 @@ void CVertexArrayRangeMapObjectATI::disable() // *************************************************************************** // *************************************************************************** -CVertexBufferHardGLMapObjectATI::CVertexBufferHardGLMapObjectATI(CDriverGL *drv, CVertexBuffer *vb) : IVertexBufferHardGL(drv, vb), +CVertexBufferHardGLMapObjectATI::CVertexBufferHardGLMapObjectATI(CDriverGL3 *drv, CVertexBuffer *vb) : IVertexBufferHardGL(drv, vb), _VertexPtr(NULL), _VertexArrayRange(NULL), _VertexObjectId(0) @@ -1153,7 +1153,7 @@ void CVertexArrayRangeMapObjectATI::updateLostBuffers() // *************************************************************************** -CVertexArrayRangeARB::CVertexArrayRangeARB(CDriverGL *drv) : IVertexArrayRange(drv), +CVertexArrayRangeARB::CVertexArrayRangeARB(CDriverGL3 *drv) : IVertexArrayRange(drv), _VBType(CVertexBuffer::AGPPreferred), _SizeAllocated(0) { @@ -1318,7 +1318,7 @@ void CVertexArrayRangeARB::updateLostBuffers() // *************************************************************************** -CVertexBufferHardARB::CVertexBufferHardARB(CDriverGL *drv, CVertexBuffer *vb) : IVertexBufferHardGL(drv, vb), +CVertexBufferHardARB::CVertexBufferHardARB(CDriverGL3 *drv, CVertexBuffer *vb) : IVertexBufferHardGL(drv, vb), _VertexPtr(NULL), _VertexObjectId(0) diff --git a/code/nel/src/3d/driver/OpenGL3/driver_opengl_vertex_buffer_hard.h b/code/nel/src/3d/driver/OpenGL3/driver_opengl_vertex_buffer_hard.h index 1ec64ccf2..3637de358 100644 --- a/code/nel/src/3d/driver/OpenGL3/driver_opengl_vertex_buffer_hard.h +++ b/code/nel/src/3d/driver/OpenGL3/driver_opengl_vertex_buffer_hard.h @@ -26,7 +26,7 @@ namespace NL3D { #ifdef USE_OPENGLES namespace NLDRIVERGLES { #else -namespace NLDRIVERGL { +namespace NLDRIVERGL3 { #endif #endif @@ -51,7 +51,7 @@ class CVertexBufferHardARB; class IVertexArrayRange { public: - IVertexArrayRange(CDriverGL *drv); + IVertexArrayRange(CDriverGL3 *drv); virtual ~IVertexArrayRange(); /// allocate a vertex array space. false if error. client must free before re-allocate. @@ -65,13 +65,13 @@ public: // Check & invalidate lost buffers. Default assume they can't be lost virtual void updateLostBuffers() {} // Get driver - CDriverGL *getDriver() const { return _Driver; } + CDriverGL3* getDriver() const { return _Driver; } // tmp, for debug #ifdef NL_DEBUG virtual void dumpMappedBuffers() {} #endif protected: - CDriverGL *_Driver; + CDriverGL3 *_Driver; }; @@ -84,7 +84,7 @@ class IVertexBufferHardGL { public: - IVertexBufferHardGL(CDriverGL *drv, CVertexBuffer *vb); + IVertexBufferHardGL(CDriverGL3 *drv, CVertexBuffer *vb); virtual ~IVertexBufferHardGL(); @@ -113,7 +113,7 @@ public: CVertexBuffer *VB; protected: - CDriverGL *_Driver; + CDriverGL3 *_Driver; bool _Invalid; }; @@ -133,7 +133,7 @@ protected: class CVertexArrayRangeNVidia : public IVertexArrayRange { public: - CVertexArrayRangeNVidia(CDriverGL *drv); + CVertexArrayRangeNVidia(CDriverGL3 *drv); /// \name Implementation @@ -182,7 +182,7 @@ class CVertexBufferHardGLNVidia : public IVertexBufferHardGL { public: - CVertexBufferHardGLNVidia(CDriverGL *drv, CVertexBuffer *vb); + CVertexBufferHardGLNVidia(CDriverGL3 *drv, CVertexBuffer *vb); virtual ~CVertexBufferHardGLNVidia(); @@ -250,7 +250,7 @@ private: class CVertexArrayRangeATI : public IVertexArrayRange { public: - CVertexArrayRangeATI(CDriverGL *drv); + CVertexArrayRangeATI(CDriverGL3 *drv); /// \name Implementation @@ -306,7 +306,7 @@ class CVertexBufferHardGLATI : public IVertexBufferHardGL { public: - CVertexBufferHardGLATI(CDriverGL *drv, CVertexBuffer *vb); + CVertexBufferHardGLATI(CDriverGL3 *drv, CVertexBuffer *vb); virtual ~CVertexBufferHardGLATI(); @@ -357,7 +357,7 @@ private: class CVertexArrayRangeMapObjectATI : public IVertexArrayRange { public: - CVertexArrayRangeMapObjectATI(CDriverGL *drv); + CVertexArrayRangeMapObjectATI(CDriverGL3 *drv); /// \name Implementation @@ -414,7 +414,7 @@ class CVertexBufferHardGLMapObjectATI : public IVertexBufferHardGL { public: - CVertexBufferHardGLMapObjectATI(CDriverGL *drv, CVertexBuffer *vb); + CVertexBufferHardGLMapObjectATI(CDriverGL3 *drv, CVertexBuffer *vb); virtual ~CVertexBufferHardGLMapObjectATI(); @@ -470,7 +470,7 @@ public: class CVertexArrayRangeARB : public IVertexArrayRange { public: - CVertexArrayRangeARB(CDriverGL *drv); + CVertexArrayRangeARB(CDriverGL3 *drv); /// \name Implementation @@ -522,7 +522,7 @@ class CVertexBufferHardARB : public IVertexBufferHardGL { public: - CVertexBufferHardARB(CDriverGL *drv, CVertexBuffer *vb); + CVertexBufferHardARB(CDriverGL3 *drv, CVertexBuffer *vb); virtual ~CVertexBufferHardARB(); diff --git a/code/nel/src/3d/driver/OpenGL3/driver_opengl_vertex_program.cpp b/code/nel/src/3d/driver/OpenGL3/driver_opengl_vertex_program.cpp index 5392bcbdd..2555198ff 100644 --- a/code/nel/src/3d/driver/OpenGL3/driver_opengl_vertex_program.cpp +++ b/code/nel/src/3d/driver/OpenGL3/driver_opengl_vertex_program.cpp @@ -36,12 +36,12 @@ namespace NL3D { #ifdef USE_OPENGLES namespace NLDRIVERGLES { #else -namespace NLDRIVERGL { +namespace NLDRIVERGL3 { #endif #endif // *************************************************************************** -CVertexProgamDrvInfosGL::CVertexProgamDrvInfosGL (CDriverGL *drv, ItVtxPrgDrvInfoPtrList it) : IVertexProgramDrvInfos (drv, it) +CVertexProgamDrvInfosGL3::CVertexProgamDrvInfosGL3 (CDriverGL3 *drv, ItVtxPrgDrvInfoPtrList it) : IVertexProgramDrvInfos (drv, it) { H_AUTO_OGL(CVertexProgamDrvInfosGL_CVertexProgamDrvInfosGL); @@ -70,14 +70,14 @@ CVertexProgamDrvInfosGL::CVertexProgamDrvInfosGL (CDriverGL *drv, ItVtxPrgDrvInf // *************************************************************************** -bool CDriverGL::isVertexProgramSupported () const +bool CDriverGL3::isVertexProgramSupported () const { H_AUTO_OGL(CVertexProgamDrvInfosGL_isVertexProgramSupported) return _Extensions.NVVertexProgram || _Extensions.EXTVertexShader || _Extensions.ARBVertexProgram; } // *************************************************************************** -bool CDriverGL::isVertexProgramEmulated () const +bool CDriverGL3::isVertexProgramEmulated () const { H_AUTO_OGL(CVertexProgamDrvInfosGL_isVertexProgramEmulated) return _Extensions.NVVertexProgramEmulated; @@ -86,7 +86,7 @@ bool CDriverGL::isVertexProgramEmulated () const // *************************************************************************** -bool CDriverGL::activeNVVertexProgram (CVertexProgram *program) +bool CDriverGL3::activeNVVertexProgram (CVertexProgram *program) { H_AUTO_OGL(CVertexProgamDrvInfosGL_activeNVVertexProgram); @@ -100,7 +100,7 @@ bool CDriverGL::activeNVVertexProgram (CVertexProgram *program) // Driver info - CVertexProgamDrvInfosGL *drvInfo; + CVertexProgamDrvInfosGL3 *drvInfo; // Program setuped ? if (program->_DrvInfo==NULL) @@ -126,7 +126,7 @@ bool CDriverGL::activeNVVertexProgram (CVertexProgram *program) ItVtxPrgDrvInfoPtrList it= _VtxPrgDrvInfos.insert(_VtxPrgDrvInfos.end(), (NL3D::IVertexProgramDrvInfos*)NULL); // Create a driver info - *it = drvInfo = new CVertexProgamDrvInfosGL (this, it); + *it = drvInfo = new CVertexProgamDrvInfosGL3 (this, it); // Set the pointer program->_DrvInfo=drvInfo; @@ -182,7 +182,7 @@ bool CDriverGL::activeNVVertexProgram (CVertexProgram *program) else { // Cast the driver info pointer - drvInfo=safe_cast((IVertexProgramDrvInfos*)program->_DrvInfo); + drvInfo=safe_cast((IVertexProgramDrvInfos*)program->_DrvInfo); } // Setup this program @@ -402,9 +402,9 @@ static void doWriteMask(GLuint res, GLuint in, GLenum outX, GLenum outY, GLenum // *************************************************************************** /** Setup a vertex shader from its parsed program */ -bool CDriverGL::setupEXTVertexShader(const CVPParser::TProgram &program, GLuint id, uint variants[EVSNumVariants], uint16 &usedInputRegisters) +bool CDriverGL3::setupEXTVertexShader(const CVPParser::TProgram &program, GLuint id, uint variants[EVSNumVariants], uint16 &usedInputRegisters) { - H_AUTO_OGL(CDriverGL_setupEXTVertexShader); + H_AUTO_OGL(CDriverGL3_setupEXTVertexShader); #ifndef USE_OPENGLES // counter to see what is generated @@ -1342,9 +1342,9 @@ static void ARBVertexProgramDumpInstr(const CVPInstruction &instr, std::string & } // *************************************************************************** -bool CDriverGL::setupARBVertexProgram (const CVPParser::TProgram &inParsedProgram, GLuint id, bool &specularWritten) +bool CDriverGL3::setupARBVertexProgram (const CVPParser::TProgram &inParsedProgram, GLuint id, bool &specularWritten) { - H_AUTO_OGL(CDriverGL_setupARBVertexProgram); + H_AUTO_OGL(CDriverGL3_setupARBVertexProgram); #ifndef USE_OPENGLES // tmp @@ -1489,16 +1489,16 @@ bool CDriverGL::setupARBVertexProgram (const CVPParser::TProgram &inParsedProgra // *************************************************************************** -bool CDriverGL::activeARBVertexProgram (CVertexProgram *program) +bool CDriverGL3::activeARBVertexProgram (CVertexProgram *program) { - H_AUTO_OGL(CDriverGL_activeARBVertexProgram); + H_AUTO_OGL(CDriverGL3_activeARBVertexProgram); #ifndef USE_OPENGLES // Setup or unsetup ? if (program) { // Driver info - CVertexProgamDrvInfosGL *drvInfo; + CVertexProgamDrvInfosGL3 *drvInfo; // Program setuped ? if (program->_DrvInfo==NULL) @@ -1520,7 +1520,7 @@ bool CDriverGL::activeARBVertexProgram (CVertexProgram *program) ItVtxPrgDrvInfoPtrList it= _VtxPrgDrvInfos.insert(_VtxPrgDrvInfos.end(), (NL3D::IVertexProgramDrvInfos*)NULL); // Create a driver info - *it = drvInfo = new CVertexProgamDrvInfosGL (this, it); + *it = drvInfo = new CVertexProgamDrvInfosGL3 (this, it); // Set the pointer program->_DrvInfo=drvInfo; @@ -1535,7 +1535,7 @@ bool CDriverGL::activeARBVertexProgram (CVertexProgram *program) else { // Cast the driver info pointer - drvInfo=safe_cast((IVertexProgramDrvInfos*)program->_DrvInfo); + drvInfo=safe_cast((IVertexProgramDrvInfos*)program->_DrvInfo); } glEnable( GL_VERTEX_PROGRAM_ARB ); _VertexProgramEnabled = true; @@ -1563,16 +1563,16 @@ bool CDriverGL::activeARBVertexProgram (CVertexProgram *program) } // *************************************************************************** -bool CDriverGL::activeEXTVertexShader (CVertexProgram *program) +bool CDriverGL3::activeEXTVertexShader (CVertexProgram *program) { - H_AUTO_OGL(CDriverGL_activeEXTVertexShader); + H_AUTO_OGL(CDriverGL3_activeEXTVertexShader); #ifndef USE_OPENGLES // Setup or unsetup ? if (program) { // Driver info - CVertexProgamDrvInfosGL *drvInfo; + CVertexProgamDrvInfosGL3 *drvInfo; // Program setuped ? if (program->_DrvInfo==NULL) @@ -1606,7 +1606,7 @@ bool CDriverGL::activeEXTVertexShader (CVertexProgram *program) ItVtxPrgDrvInfoPtrList it= _VtxPrgDrvInfos.insert(_VtxPrgDrvInfos.end(), (NL3D::IVertexProgramDrvInfos*)NULL); // Create a driver info - *it = drvInfo = new CVertexProgamDrvInfosGL (this, it); + *it = drvInfo = new CVertexProgamDrvInfosGL3 (this, it); // Set the pointer program->_DrvInfo=drvInfo; @@ -1621,7 +1621,7 @@ bool CDriverGL::activeEXTVertexShader (CVertexProgram *program) else { // Cast the driver info pointer - drvInfo=safe_cast((IVertexProgramDrvInfos*)program->_DrvInfo); + drvInfo=safe_cast((IVertexProgramDrvInfos*)program->_DrvInfo); } glEnable( GL_VERTEX_SHADER_EXT); @@ -1641,9 +1641,9 @@ bool CDriverGL::activeEXTVertexShader (CVertexProgram *program) } // *************************************************************************** -bool CDriverGL::activeVertexProgram (CVertexProgram *program) +bool CDriverGL3::activeVertexProgram (CVertexProgram *program) { - H_AUTO_OGL(CDriverGL_activeVertexProgram) + H_AUTO_OGL(CDriverGL3_activeVertexProgram) // Extension here ? if (_Extensions.NVVertexProgram) { @@ -1665,9 +1665,9 @@ bool CDriverGL::activeVertexProgram (CVertexProgram *program) // *************************************************************************** -void CDriverGL::setConstant (uint index, float f0, float f1, float f2, float f3) +void CDriverGL3::setConstant (uint index, float f0, float f1, float f2, float f3) { - H_AUTO_OGL(CDriverGL_setConstant); + H_AUTO_OGL(CDriverGL3_setConstant); #ifndef USE_OPENGLES // Vertex program exist ? @@ -1691,9 +1691,9 @@ void CDriverGL::setConstant (uint index, float f0, float f1, float f2, float f3) // *************************************************************************** -void CDriverGL::setConstant (uint index, double d0, double d1, double d2, double d3) +void CDriverGL3::setConstant (uint index, double d0, double d1, double d2, double d3) { - H_AUTO_OGL(CDriverGL_setConstant); + H_AUTO_OGL(CDriverGL3_setConstant); #ifndef USE_OPENGLES // Vertex program exist ? @@ -1717,9 +1717,9 @@ void CDriverGL::setConstant (uint index, double d0, double d1, double d2, double // *************************************************************************** -void CDriverGL::setConstant (uint index, const NLMISC::CVector& value) +void CDriverGL3::setConstant (uint index, const NLMISC::CVector& value) { - H_AUTO_OGL(CDriverGL_setConstant); + H_AUTO_OGL(CDriverGL3_setConstant); #ifndef USE_OPENGLES // Vertex program exist ? @@ -1743,9 +1743,9 @@ void CDriverGL::setConstant (uint index, const NLMISC::CVector& value) // *************************************************************************** -void CDriverGL::setConstant (uint index, const NLMISC::CVectorD& value) +void CDriverGL3::setConstant (uint index, const NLMISC::CVectorD& value) { - H_AUTO_OGL(CDriverGL_setConstant); + H_AUTO_OGL(CDriverGL3_setConstant); #ifndef USE_OPENGLES // Vertex program exist ? @@ -1768,9 +1768,9 @@ void CDriverGL::setConstant (uint index, const NLMISC::CVectorD& value) // *************************************************************************** -void CDriverGL::setConstant (uint index, uint num, const float *src) +void CDriverGL3::setConstant (uint index, uint num, const float *src) { - H_AUTO_OGL(CDriverGL_setConstant); + H_AUTO_OGL(CDriverGL3_setConstant); #ifndef USE_OPENGLES // Vertex program exist ? @@ -1796,9 +1796,9 @@ void CDriverGL::setConstant (uint index, uint num, const float *src) } // *************************************************************************** -void CDriverGL::setConstant (uint index, uint num, const double *src) +void CDriverGL3::setConstant (uint index, uint num, const double *src) { - H_AUTO_OGL(CDriverGL_setConstant); + H_AUTO_OGL(CDriverGL3_setConstant); #ifndef USE_OPENGLES // Vertex program exist ? @@ -1825,7 +1825,7 @@ void CDriverGL::setConstant (uint index, uint num, const double *src) // *************************************************************************** -const uint CDriverGL::GLMatrix[IDriver::NumMatrix]= +const uint CDriverGL3::GLMatrix[IDriver::NumMatrix]= { GL_MODELVIEW, GL_PROJECTION, @@ -1839,7 +1839,7 @@ const uint CDriverGL::GLMatrix[IDriver::NumMatrix]= // *************************************************************************** -const uint CDriverGL::GLTransform[IDriver::NumTransform]= +const uint CDriverGL3::GLTransform[IDriver::NumTransform]= { #ifdef USE_OPENGLES 0, @@ -1857,9 +1857,9 @@ const uint CDriverGL::GLTransform[IDriver::NumTransform]= // *************************************************************************** -void CDriverGL::setConstantMatrix (uint index, IDriver::TMatrix matrix, IDriver::TTransform transform) +void CDriverGL3::setConstantMatrix (uint index, IDriver::TMatrix matrix, IDriver::TTransform transform) { - H_AUTO_OGL(CDriverGL_setConstantMatrix); + H_AUTO_OGL(CDriverGL3_setConstantMatrix); #ifndef USE_OPENGLES // Vertex program exist ? @@ -1936,18 +1936,18 @@ void CDriverGL::setConstantMatrix (uint index, IDriver::TMatrix matrix, IDriver: // *************************************************************************** -void CDriverGL::setConstantFog (uint index) +void CDriverGL3::setConstantFog (uint index) { - H_AUTO_OGL(CDriverGL_setConstantFog) + H_AUTO_OGL(CDriverGL3_setConstantFog) const float *values = _ModelViewMatrix.get(); setConstant (index, -values[2], -values[6], -values[10], -values[14]); } // *************************************************************************** -void CDriverGL::enableVertexProgramDoubleSidedColor(bool doubleSided) +void CDriverGL3::enableVertexProgramDoubleSidedColor(bool doubleSided) { - H_AUTO_OGL(CDriverGL_enableVertexProgramDoubleSidedColor); + H_AUTO_OGL(CDriverGL3_enableVertexProgramDoubleSidedColor); #ifndef USE_OPENGLES // Vertex program exist ? @@ -1972,9 +1972,9 @@ void CDriverGL::enableVertexProgramDoubleSidedColor(bool doubleSided) // *************************************************************************** -bool CDriverGL::supportVertexProgramDoubleSidedColor() const +bool CDriverGL3::supportVertexProgramDoubleSidedColor() const { - H_AUTO_OGL(CDriverGL_supportVertexProgramDoubleSidedColor) + H_AUTO_OGL(CDriverGL3_supportVertexProgramDoubleSidedColor) // currently only supported by NV_VERTEX_PROGRAM && ARB_VERTEX_PROGRAM return _Extensions.NVVertexProgram || _Extensions.ARBVertexProgram; } diff --git a/code/nel/src/3d/driver/OpenGL3/driver_opengl_window.cpp b/code/nel/src/3d/driver/OpenGL3/driver_opengl_window.cpp index be797a54e..7251f72b2 100644 --- a/code/nel/src/3d/driver/OpenGL3/driver_opengl_window.cpp +++ b/code/nel/src/3d/driver/OpenGL3/driver_opengl_window.cpp @@ -52,13 +52,13 @@ namespace NL3D { #ifdef USE_OPENGLES namespace NLDRIVERGLES { #else -namespace NLDRIVERGL { +namespace NLDRIVERGL3 { #endif #endif #ifdef NL_OS_WINDOWS -bool GlWndProc(CDriverGL *driver, HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam) +bool GlWndProc(CDriverGL3 *driver, HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam) { H_AUTO_OGL(GlWndProc) @@ -116,7 +116,7 @@ static LRESULT CALLBACK WndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM l H_AUTO_OGL(DriverGL_WndProc); // Get the driver pointer.. - CDriverGL *pDriver=(CDriverGL*)GetWindowLongPtr (hWnd, GWLP_USERDATA); + CDriverGL3 *pDriver=(CDriverGL3*)GetWindowLongPtr (hWnd, GWLP_USERDATA); bool trapMessage = false; if (pDriver != NULL) { @@ -174,7 +174,7 @@ static LRESULT CALLBACK WndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM l #elif defined (NL_OS_MAC) -bool GlWndProc(CDriverGL *driver, const void* e) +bool GlWndProc(CDriverGL3 *driver, const void* e) { H_AUTO_OGL(GlWndProc) @@ -204,7 +204,7 @@ sint nelXErrorsHandler(Display *dpy, XErrorEvent *e) return 1; } -bool GlWndProc(CDriverGL *driver, XEvent &e) +bool GlWndProc(CDriverGL3 *driver, XEvent &e) { H_AUTO_OGL(GlWndProc) @@ -296,9 +296,9 @@ bool GlWndProc(CDriverGL *driver, XEvent &e) #endif // NL_OS_UNIX // *************************************************************************** -bool CDriverGL::init (uint windowIcon, emptyProc exitFunc) +bool CDriverGL3::init (uint windowIcon, emptyProc exitFunc) { - H_AUTO_OGL(CDriverGL_init) + H_AUTO_OGL(CDriverGL3_init) ExitFunc = exitFunc; @@ -338,7 +338,7 @@ bool CDriverGL::init (uint windowIcon, emptyProc exitFunc) } else { - nlwarning ("(CDriverGL::init): can't create DC"); + nlwarning ("(CDriverGL3::init): can't create DC"); } // ati specific : try to retrieve driver version @@ -437,9 +437,9 @@ bool CDriverGL::init (uint windowIcon, emptyProc exitFunc) } // *************************************************************************** -bool CDriverGL::unInit() +bool CDriverGL3::unInit() { - H_AUTO_OGL(CDriverGL_unInit) + H_AUTO_OGL(CDriverGL3_unInit) if (!_CurrentMode.Windowed) { @@ -473,14 +473,14 @@ bool CDriverGL::unInit() if (dc) { if (!SetDeviceGammaRamp (dc, _GammaRampBackuped)) - nlwarning ("(CDriverGL::release): SetDeviceGammaRamp failed"); + nlwarning ("(CDriverGL3::release): SetDeviceGammaRamp failed"); // Release the DC ReleaseDC (NULL, dc); } else { - nlwarning ("(CDriverGL::release): can't create DC"); + nlwarning ("(CDriverGL3::release): can't create DC"); } } @@ -501,7 +501,7 @@ bool CDriverGL::unInit() return true; } -void CDriverGL::setWindowIcon(const std::vector &bitmaps) +void CDriverGL3::setWindowIcon(const std::vector &bitmaps) { if (_win == EmptyWindow) return; @@ -600,9 +600,9 @@ void CDriverGL::setWindowIcon(const std::vector &bitmaps) } // -------------------------------------------------- -bool CDriverGL::setDisplay(nlWindow wnd, const GfxMode &mode, bool show, bool resizeable) throw(EBadDisplay) +bool CDriverGL3::setDisplay(nlWindow wnd, const GfxMode &mode, bool show, bool resizeable) throw(EBadDisplay) { - H_AUTO_OGL(CDriverGL_setDisplay) + H_AUTO_OGL(CDriverGL3_setDisplay) _win = EmptyWindow; @@ -665,13 +665,13 @@ bool CDriverGL::setDisplay(nlWindow wnd, const GfxMode &mode, bool show, bool re int pf=ChoosePixelFormat(tempHDC,&_pfd); if (!pf) { - nlwarning ("CDriverGL::setDisplay: ChoosePixelFormat failed"); + nlwarning ("CDriverGL3::setDisplay: ChoosePixelFormat failed"); DestroyWindow (tmpHWND); return false; } if ( !SetPixelFormat(tempHDC,pf,&_pfd) ) { - nlwarning ("CDriverGL::setDisplay: SetPixelFormat failed"); + nlwarning ("CDriverGL3::setDisplay: SetPixelFormat failed"); DestroyWindow (tmpHWND); return false; } @@ -681,7 +681,7 @@ bool CDriverGL::setDisplay(nlWindow wnd, const GfxMode &mode, bool show, bool re if (tempGLRC == NULL) { DWORD error = GetLastError (); - nlwarning ("CDriverGL::setDisplay: wglCreateContext failed: 0x%x", error); + nlwarning ("CDriverGL3::setDisplay: wglCreateContext failed: 0x%x", error); DestroyWindow (tmpHWND); _PBuffer = NULL; _win = EmptyWindow; @@ -694,7 +694,7 @@ bool CDriverGL::setDisplay(nlWindow wnd, const GfxMode &mode, bool show, bool re if (!wglMakeCurrent(tempHDC,tempGLRC)) { DWORD error = GetLastError (); - nlwarning ("CDriverGL::setDisplay: wglMakeCurrent failed: 0x%x", error); + nlwarning ("CDriverGL3::setDisplay: wglMakeCurrent failed: 0x%x", error); wglDeleteContext (tempGLRC); DestroyWindow (tmpHWND); _PBuffer = NULL; @@ -716,7 +716,7 @@ bool CDriverGL::setDisplay(nlWindow wnd, const GfxMode &mode, bool show, bool re if (hdc == NULL) { DWORD error = GetLastError (); - nlwarning ("CDriverGL::setDisplay: wglGetCurrentDC failed: 0x%x", error); + nlwarning ("CDriverGL3::setDisplay: wglGetCurrentDC failed: 0x%x", error); DestroyWindow (tmpHWND); _PBuffer = NULL; _win = EmptyWindow; @@ -786,7 +786,7 @@ bool CDriverGL::setDisplay(nlWindow wnd, const GfxMode &mode, bool show, bool re if (_PBuffer == NULL) { DWORD error = GetLastError (); - nlwarning ("CDriverGL::setDisplay: wglCreatePbufferARB failed: 0x%x", error); + nlwarning ("CDriverGL3::setDisplay: wglCreatePbufferARB failed: 0x%x", error); wglDeleteContext (tempGLRC); DestroyWindow (tmpHWND); @@ -801,7 +801,7 @@ bool CDriverGL::setDisplay(nlWindow wnd, const GfxMode &mode, bool show, bool re if ( !nwglQueryPbufferARB( _PBuffer, WGL_PBUFFER_WIDTH_ARB, (int*)&width ) ) { DWORD error = GetLastError (); - nlwarning ("CDriverGL::setDisplay: wglQueryPbufferARB failed: 0x%x", error); + nlwarning ("CDriverGL3::setDisplay: wglQueryPbufferARB failed: 0x%x", error); wglDeleteContext (tempGLRC); DestroyWindow (tmpHWND); _PBuffer = NULL; @@ -814,7 +814,7 @@ bool CDriverGL::setDisplay(nlWindow wnd, const GfxMode &mode, bool show, bool re if ( !nwglQueryPbufferARB( _PBuffer, WGL_PBUFFER_HEIGHT_ARB, (int*)&height ) ) { DWORD error = GetLastError (); - nlwarning ("CDriverGL::setDisplay: wglQueryPbufferARB failed: 0x%x", error); + nlwarning ("CDriverGL3::setDisplay: wglQueryPbufferARB failed: 0x%x", error); wglDeleteContext (tempGLRC); DestroyWindow (tmpHWND); _PBuffer = NULL; @@ -833,7 +833,7 @@ bool CDriverGL::setDisplay(nlWindow wnd, const GfxMode &mode, bool show, bool re if (_hDC == NULL) { DWORD error = GetLastError (); - nlwarning ("CDriverGL::setDisplay: wglGetPbufferDCARB failed: 0x%x", error); + nlwarning ("CDriverGL3::setDisplay: wglGetPbufferDCARB failed: 0x%x", error); nwglDestroyPbufferARB( _PBuffer ); wglDeleteContext (tempGLRC); @@ -852,7 +852,7 @@ bool CDriverGL::setDisplay(nlWindow wnd, const GfxMode &mode, bool show, bool re if (_hRC == NULL) { DWORD error = GetLastError (); - nlwarning ("CDriverGL::setDisplay: wglCreateContext failed: 0x%x", error); + nlwarning ("CDriverGL3::setDisplay: wglCreateContext failed: 0x%x", error); nwglReleasePbufferDCARB( _PBuffer, _hDC ); nwglDestroyPbufferARB( _PBuffer ); wglDeleteContext (tempGLRC); @@ -872,19 +872,19 @@ bool CDriverGL::setDisplay(nlWindow wnd, const GfxMode &mode, bool show, bool re if (!eglDestroyContext(_EglDisplay, _EglContext);) { DWORD error = GetLastError (); - nlwarning ("CDriverGL::setDisplay: wglDeleteContext failed: 0x%x", error); + nlwarning ("CDriverGL3::setDisplay: wglDeleteContext failed: 0x%x", error); } #else if (!wglDeleteContext (tempGLRC)) { DWORD error = GetLastError (); - nlwarning ("CDriverGL::setDisplay: wglDeleteContext failed: 0x%x", error); + nlwarning ("CDriverGL3::setDisplay: wglDeleteContext failed: 0x%x", error); } #endif // Destroy the temp windows if (!DestroyWindow (tmpHWND)) - nlwarning ("CDriverGL::setDisplay: DestroyWindow failed"); + nlwarning ("CDriverGL3::setDisplay: DestroyWindow failed"); /* After a pbuffer has been successfully created you can use it for off-screen rendering. To do so, you'll first need to bind the pbuffer, or more precisely, make its GL rendering context @@ -892,7 +892,7 @@ bool CDriverGL::setDisplay(nlWindow wnd, const GfxMode &mode, bool show, bool re if (!wglMakeCurrent(_hDC,_hRC)) { DWORD error = GetLastError (); - nlwarning ("CDriverGL::setDisplay: wglMakeCurrent failed: 0x%x", error); + nlwarning ("CDriverGL3::setDisplay: wglMakeCurrent failed: 0x%x", error); #ifdef USE_OPENGLES eglDestroyContext(_EglDisplay, _EglContext); @@ -1135,9 +1135,9 @@ bool CDriverGL::setDisplay(nlWindow wnd, const GfxMode &mode, bool show, bool re } // -------------------------------------------------- -bool CDriverGL::saveScreenMode() +bool CDriverGL3::saveScreenMode() { - H_AUTO_OGL(CDriverGL_saveScreenMode) + H_AUTO_OGL(CDriverGL3_saveScreenMode) bool res = true; @@ -1195,9 +1195,9 @@ bool CDriverGL::saveScreenMode() } // -------------------------------------------------- -bool CDriverGL::restoreScreenMode() +bool CDriverGL3::restoreScreenMode() { - H_AUTO_OGL(CDriverGL_restoreScreenMode) + H_AUTO_OGL(CDriverGL3_restoreScreenMode) bool res = false; @@ -1287,9 +1287,9 @@ static sint modeInfoToFrequency(XF86VidModeModeInfo *info) // *************************************************************************** -bool CDriverGL::setScreenMode(const GfxMode &mode) +bool CDriverGL3::setScreenMode(const GfxMode &mode) { - H_AUTO_OGL(CDriverGL_setScreenMode) + H_AUTO_OGL(CDriverGL3_setScreenMode) if (mode.Windowed) { @@ -1443,9 +1443,9 @@ bool CDriverGL::setScreenMode(const GfxMode &mode) } // *************************************************************************** -bool CDriverGL::createWindow(const GfxMode &mode) +bool CDriverGL3::createWindow(const GfxMode &mode) { - H_AUTO_OGL(CDriverGL_createWindow) + H_AUTO_OGL(CDriverGL3_createWindow) nlWindow window = EmptyWindow; @@ -1597,9 +1597,9 @@ bool CDriverGL::createWindow(const GfxMode &mode) // *************************************************************************** -bool CDriverGL::destroyWindow() +bool CDriverGL3::destroyWindow() { - H_AUTO_OGL(CDriverGL_destroyWindow) + H_AUTO_OGL(CDriverGL3_destroyWindow) releaseCursors(); @@ -1687,9 +1687,9 @@ bool CDriverGL::destroyWindow() // *************************************************************************** -CDriverGL::EWindowStyle CDriverGL::getWindowStyle() const +CDriverGL3::EWindowStyle CDriverGL3::getWindowStyle() const { - H_AUTO_OGL(CDriverGL_getWindowStyle) + H_AUTO_OGL(CDriverGL3_getWindowStyle) if (!_CurrentMode.Windowed) return EWSFullscreen; @@ -1699,9 +1699,9 @@ CDriverGL::EWindowStyle CDriverGL::getWindowStyle() const // *************************************************************************** -bool CDriverGL::setWindowStyle(EWindowStyle windowStyle) +bool CDriverGL3::setWindowStyle(EWindowStyle windowStyle) { - H_AUTO_OGL(CDriverGL_setWindowStyle) + H_AUTO_OGL(CDriverGL3_setWindowStyle) // don't change window style, if we did not create the window if (_win == EmptyWindow || !_DestroyWindow) @@ -1856,9 +1856,9 @@ bool CDriverGL::setWindowStyle(EWindowStyle windowStyle) } // -------------------------------------------------- -bool CDriverGL::setMode(const GfxMode& mode) +bool CDriverGL3::setMode(const GfxMode& mode) { - H_AUTO_OGL(CDriverGL_setMode); + H_AUTO_OGL(CDriverGL3_setMode); // don't modify window or screen if managed by a 3rd party library if (!_DestroyWindow) @@ -1928,9 +1928,9 @@ long GetDictionaryLong(CFDictionaryRef theDict, const void* key) #endif // defined(NL_OS_MAC) // -------------------------------------------------- -bool CDriverGL::getModes(std::vector &modes) +bool CDriverGL3::getModes(std::vector &modes) { - H_AUTO_OGL(CDriverGL_getModes) + H_AUTO_OGL(CDriverGL3_getModes) #ifdef NL_OS_WINDOWS sint modeIndex = 0; @@ -2109,9 +2109,9 @@ bool CDriverGL::getModes(std::vector &modes) } // -------------------------------------------------- -bool CDriverGL::getCurrentScreenMode(GfxMode &mode) +bool CDriverGL3::getCurrentScreenMode(GfxMode &mode) { - H_AUTO_OGL(CDriverGL_getCurrentScreenMode) + H_AUTO_OGL(CDriverGL3_getCurrentScreenMode) #ifdef NL_OS_WINDOWS @@ -2248,9 +2248,9 @@ bool CDriverGL::getCurrentScreenMode(GfxMode &mode) } // -------------------------------------------------- -void CDriverGL::setWindowTitle(const ucstring &title) +void CDriverGL3::setWindowTitle(const ucstring &title) { - H_AUTO_OGL(CDriverGL_setWindowTitle) + H_AUTO_OGL(CDriverGL3_setWindowTitle) if (_win == EmptyWindow) return; @@ -2286,9 +2286,9 @@ void CDriverGL::setWindowTitle(const ucstring &title) } // *************************************************************************** -void CDriverGL::setWindowPos(sint32 x, sint32 y) +void CDriverGL3::setWindowPos(sint32 x, sint32 y) { - H_AUTO_OGL(CDriverGL_setWindowPos) + H_AUTO_OGL(CDriverGL3_setWindowPos) _WindowX = x; _WindowY = y; @@ -2331,9 +2331,9 @@ void CDriverGL::setWindowPos(sint32 x, sint32 y) } // *************************************************************************** -void CDriverGL::showWindow(bool show) +void CDriverGL3::showWindow(bool show) { - H_AUTO_OGL(CDriverGL_showWindow) + H_AUTO_OGL(CDriverGL3_showWindow) // don't change window visibility, if we didn't create the window if (_win == EmptyWindow || !_DestroyWindow) @@ -2367,15 +2367,15 @@ void CDriverGL::showWindow(bool show) } // -------------------------------------------------- -emptyProc CDriverGL::getWindowProc() +emptyProc CDriverGL3::getWindowProc() { - H_AUTO_OGL(CDriverGL_getWindowProc) + H_AUTO_OGL(CDriverGL3_getWindowProc) return (emptyProc)GlWndProc; } // -------------------------------------------------- -bool CDriverGL::createContext() +bool CDriverGL3::createContext() { #ifdef USE_OPENGLES uint samples = 0; @@ -2519,9 +2519,9 @@ bool CDriverGL::createContext() } // -------------------------------------------------- -bool CDriverGL::activate() +bool CDriverGL3::activate() { - H_AUTO_OGL(CDriverGL_activate); + H_AUTO_OGL(CDriverGL3_activate); if (_win == EmptyWindow) return false; @@ -2564,9 +2564,9 @@ bool CDriverGL::activate() } // -------------------------------------------------- -IDriver::TMessageBoxId CDriverGL::systemMessageBox (const char* message, const char* title, IDriver::TMessageBoxType type, TMessageBoxIcon icon) +IDriver::TMessageBoxId CDriverGL3::systemMessageBox (const char* message, const char* title, IDriver::TMessageBoxType type, TMessageBoxIcon icon) { - H_AUTO_OGL(CDriverGL_systemMessageBox) + H_AUTO_OGL(CDriverGL3_systemMessageBox) #ifdef NL_OS_WINDOWS switch (::MessageBox (NULL, message, title, ((type==retryCancelType)?MB_RETRYCANCEL: (type==yesNoCancelType)?MB_YESNOCANCEL: @@ -2606,9 +2606,9 @@ IDriver::TMessageBoxId CDriverGL::systemMessageBox (const char* message, const c return okId; } -void CDriverGL::getWindowSize(uint32 &width, uint32 &height) +void CDriverGL3::getWindowSize(uint32 &width, uint32 &height) { - H_AUTO_OGL(CDriverGL_getWindowSize) + H_AUTO_OGL(CDriverGL3_getWindowSize) if (_CurrentMode.OffScreen) { @@ -2639,9 +2639,9 @@ void CDriverGL::getWindowSize(uint32 &width, uint32 &height) } } -void CDriverGL::setWindowSize(uint32 width, uint32 height) +void CDriverGL3::setWindowSize(uint32 width, uint32 height) { - H_AUTO_OGL(CDriverGL_setWindowSize) + H_AUTO_OGL(CDriverGL3_setWindowSize) if (_win == EmptyWindow) return; @@ -2740,9 +2740,9 @@ void CDriverGL::setWindowSize(uint32 width, uint32 height) #endif // NL_OS_WINDOWS } -void CDriverGL::getWindowPos(sint32 &x, sint32 &y) +void CDriverGL3::getWindowPos(sint32 &x, sint32 &y) { - H_AUTO_OGL(CDriverGL_getWindowPos) + H_AUTO_OGL(CDriverGL3_getWindowPos) // Off-screen rendering ? if (_CurrentMode.OffScreen) @@ -2757,9 +2757,9 @@ void CDriverGL::getWindowPos(sint32 &x, sint32 &y) } // -------------------------------------------------- -bool CDriverGL::isActive() +bool CDriverGL3::isActive() { - H_AUTO_OGL(CDriverGL_isActive) + H_AUTO_OGL(CDriverGL3_isActive) if (_win == EmptyWindow) return false; @@ -2786,9 +2786,9 @@ bool CDriverGL::isActive() } // *************************************************************************** -bool CDriverGL::setMonitorColorProperties (const CMonitorColorProperties &properties) +bool CDriverGL3::setMonitorColorProperties (const CMonitorColorProperties &properties) { - H_AUTO_OGL(CDriverGL_setMonitorColorProperties ) + H_AUTO_OGL(CDriverGL3_setMonitorColorProperties ) #ifdef NL_OS_WINDOWS @@ -2832,16 +2832,16 @@ bool CDriverGL::setMonitorColorProperties (const CMonitorColorProperties &proper } else { - nlwarning ("(CDriverGL::setMonitorColorProperties): can't create DC"); + nlwarning ("(CDriverGL3::setMonitorColorProperties): can't create DC"); } #elif defined(NL_OS_MAC) - // TODO for Mac: implement CDriverGL::setMonitorColorProperties - nlwarning ("CDriverGL::setMonitorColorProperties not implemented"); + // TODO for Mac: implement CDriverGL3::setMonitorColorProperties + nlwarning ("CDriverGL3::setMonitorColorProperties not implemented"); #elif defined (NL_OS_UNIX) - // TODO for Linux: implement CDriverGL::setMonitorColorProperties - nlwarning ("CDriverGL::setMonitorColorProperties not implemented"); + // TODO for Linux: implement CDriverGL3::setMonitorColorProperties + nlwarning ("CDriverGL3::setMonitorColorProperties not implemented"); #endif @@ -2849,7 +2849,7 @@ bool CDriverGL::setMonitorColorProperties (const CMonitorColorProperties &proper } #ifdef NL_OS_MAC -void CDriverGL::setupApplicationMenu() +void CDriverGL3::setupApplicationMenu() { NSMenu* menu; NSMenuItem* menuItem; @@ -2908,19 +2908,19 @@ void CDriverGL::setupApplicationMenu() } #endif -bool CDriverGL::copyTextToClipboard(const ucstring &text) +bool CDriverGL3::copyTextToClipboard(const ucstring &text) { return _EventEmitter.copyTextToClipboard(text); } -bool CDriverGL::pasteTextFromClipboard(ucstring &text) +bool CDriverGL3::pasteTextFromClipboard(ucstring &text) { return _EventEmitter.pasteTextFromClipboard(text); } #ifdef NL_OS_WINDOWS -bool CDriverGL::convertBitmapToIcon(const NLMISC::CBitmap &bitmap, HICON &icon, uint iconWidth, uint iconHeight, uint iconDepth, const NLMISC::CRGBA &col, sint hotSpotX, sint hotSpotY, bool cursor) +bool CDriverGL3::convertBitmapToIcon(const NLMISC::CBitmap &bitmap, HICON &icon, uint iconWidth, uint iconHeight, uint iconDepth, const NLMISC::CRGBA &col, sint hotSpotX, sint hotSpotY, bool cursor) { CBitmap src = bitmap; @@ -2999,7 +2999,7 @@ bool CDriverGL::convertBitmapToIcon(const NLMISC::CBitmap &bitmap, HICON &icon, #elif defined(NL_OS_UNIX) -bool CDriverGL::convertBitmapToIcon(const NLMISC::CBitmap &bitmap, std::vector &icon) +bool CDriverGL3::convertBitmapToIcon(const NLMISC::CBitmap &bitmap, std::vector &icon) { // get bitmap width and height uint width = bitmap.getWidth();