From 21f3ec55ab64b45bb6c8bc669475af6fc2d76c07 Mon Sep 17 00:00:00 2001 From: kervala Date: Sun, 22 Sep 2013 13:20:53 +0200 Subject: [PATCH] Fixed: OpenGL ES driver compilation --- .../src/3d/driver/opengl/driver_opengl.cpp | 3 +++ .../opengl/driver_opengl_pixel_program.cpp | 19 +++++++++++++++++-- 2 files changed, 20 insertions(+), 2 deletions(-) diff --git a/code/nel/src/3d/driver/opengl/driver_opengl.cpp b/code/nel/src/3d/driver/opengl/driver_opengl.cpp index 45bba3bc1..02617990d 100644 --- a/code/nel/src/3d/driver/opengl/driver_opengl.cpp +++ b/code/nel/src/3d/driver/opengl/driver_opengl.cpp @@ -1406,6 +1406,7 @@ void CDriverGL::setupFog(float start, float end, CRGBA color) glFogfv(GL_FOG_COLOR, _CurrentFogColor); +#ifndef USE_OPENGLES /** Special : with vertex program, using the extension EXT_vertex_shader, fog is emulated using 1 more constant to scale result to [0, 1] */ if (_Extensions.EXTVertexShader && !_Extensions.NVVertexProgram && !_Extensions.ARBVertexProgram) @@ -1425,6 +1426,8 @@ void CDriverGL::setupFog(float start, float end, CRGBA color) } } } +#endif + _FogStart = start; _FogEnd = end; } diff --git a/code/nel/src/3d/driver/opengl/driver_opengl_pixel_program.cpp b/code/nel/src/3d/driver/opengl/driver_opengl_pixel_program.cpp index d1ef146f2..899511a1b 100644 --- a/code/nel/src/3d/driver/opengl/driver_opengl_pixel_program.cpp +++ b/code/nel/src/3d/driver/opengl/driver_opengl_pixel_program.cpp @@ -54,6 +54,8 @@ namespace NLDRIVERGL { CPixelProgamDrvInfosGL::CPixelProgamDrvInfosGL (CDriverGL *drv, ItGPUPrgDrvInfoPtrList it) : IProgramDrvInfos (drv, it) { H_AUTO_OGL(CPixelProgamDrvInfosGL_CPixelProgamDrvInfosGL) + +#ifndef USE_OPENGLES // Extension must exist nlassert(drv->_Extensions.ARBFragmentProgram); @@ -61,6 +63,7 @@ CPixelProgamDrvInfosGL::CPixelProgamDrvInfosGL (CDriverGL *drv, ItGPUPrgDrvInfoP { nglGenProgramsARB(1, &ID); } +#endif } // *************************************************************************** @@ -96,6 +99,7 @@ bool CDriverGL::activePixelProgram(CPixelProgram *program) bool CDriverGL::compilePixelProgram(NL3D::CPixelProgram *program) { +#ifndef USE_OPENGLES // Program setuped ? if (program->m_DrvInfo == NULL) { @@ -121,6 +125,9 @@ bool CDriverGL::compilePixelProgram(NL3D::CPixelProgram *program) } return true; +#else + return false; +#endif } // *************************************************************************** @@ -129,6 +136,7 @@ bool CDriverGL::activeARBPixelProgram(CPixelProgram *program) { H_AUTO_OGL(CDriverGL_activeARBPixelProgram) +#ifndef USE_OPENGLES // Setup or unsetup ? if (program) { @@ -151,14 +159,18 @@ bool CDriverGL::activeARBPixelProgram(CPixelProgram *program) } return true; +#else + return false; +#endif } // *************************************************************************** bool CDriverGL::setupPixelProgram(CPixelProgram *program, GLuint id/*, bool &specularWritten*/) { - H_AUTO_OGL(CDriverGL_setupARBPixelProgram) + H_AUTO_OGL(CDriverGL_setupARBPixelProgram); +#ifndef USE_OPENGLES CPixelProgamDrvInfosGL *drvInfo = static_cast((IProgramDrvInfos *)program->m_DrvInfo); // Find a supported pixel program profile @@ -226,7 +238,10 @@ bool CDriverGL::setupPixelProgram(CPixelProgram *program, GLuint id/*, bool &spe // Build the feature info program->buildInfo(source); - return true; + return true; +#else + return false; +#endif } #ifdef NL_STATIC