From ce3e4b0e6e633d3ac47b9fc5c19d9688db8a0388 Mon Sep 17 00:00:00 2001 From: cutealien Date: Fri, 19 Jun 2020 17:21:10 +0000 Subject: [PATCH] Fix compile problem for older (<3.0) GL versions compiled without extensions. git-svn-id: svn://svn.code.sf.net/p/irrlicht/code/trunk@6124 dfc29bdd-3216-0410-991c-e03cc46cb475 --- source/Irrlicht/COpenGLExtensionHandler.h | 8 ++++---- source/Irrlicht/COpenGLSLMaterialRenderer.cpp | 2 ++ 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/source/Irrlicht/COpenGLExtensionHandler.h b/source/Irrlicht/COpenGLExtensionHandler.h index c2e448f0..462c47ab 100644 --- a/source/Irrlicht/COpenGLExtensionHandler.h +++ b/source/Irrlicht/COpenGLExtensionHandler.h @@ -1915,7 +1915,7 @@ inline void COpenGLExtensionHandler::extGlUniform1uiv(GLint loc, GLsizei count, #ifdef _IRR_OPENGL_USE_EXTPOINTER_ if (pGlUniform1uiv) pGlUniform1uiv(loc, count, v); -#else +#elif defined(GL_VERSION_3_0) glUniform1uiv(loc, count, v); #endif } @@ -1925,7 +1925,7 @@ inline void COpenGLExtensionHandler::extGlUniform2uiv(GLint loc, GLsizei count, #ifdef _IRR_OPENGL_USE_EXTPOINTER_ if (pGlUniform2uiv) pGlUniform2uiv(loc, count, v); -#else +#elif defined(GL_VERSION_3_0) glUniform2uiv(loc, count, v); #endif } @@ -1935,7 +1935,7 @@ inline void COpenGLExtensionHandler::extGlUniform3uiv(GLint loc, GLsizei count, #ifdef _IRR_OPENGL_USE_EXTPOINTER_ if (pGlUniform3uiv) pGlUniform3uiv(loc, count, v); -#else +#elif defined(GL_VERSION_3_0) glUniform3uiv(loc, count, v); #endif } @@ -1945,7 +1945,7 @@ inline void COpenGLExtensionHandler::extGlUniform4uiv(GLint loc, GLsizei count, #ifdef _IRR_OPENGL_USE_EXTPOINTER_ if (pGlUniform4uiv) pGlUniform4uiv(loc, count, v); -#else +#elif defined(GL_VERSION_3_0) glUniform4uiv(loc, count, v); #endif } diff --git a/source/Irrlicht/COpenGLSLMaterialRenderer.cpp b/source/Irrlicht/COpenGLSLMaterialRenderer.cpp index 14a0ecfd..b2ba9f67 100644 --- a/source/Irrlicht/COpenGLSLMaterialRenderer.cpp +++ b/source/Irrlicht/COpenGLSLMaterialRenderer.cpp @@ -736,6 +736,7 @@ bool COpenGLSLMaterialRenderer::setPixelShaderConstant(s32 index, const u32* int case GL_UNSIGNED_INT: Driver->extGlUniform1uiv(UniformInfo[index].location, count, reinterpret_cast(ints)); break; +#if defined(GL_VERSION_3_0) case GL_UNSIGNED_INT_VEC2: Driver->extGlUniform2uiv(UniformInfo[index].location, count/2, reinterpret_cast(ints)); break; @@ -745,6 +746,7 @@ bool COpenGLSLMaterialRenderer::setPixelShaderConstant(s32 index, const u32* int case GL_UNSIGNED_INT_VEC4: Driver->extGlUniform4uiv(UniformInfo[index].location, count/4, reinterpret_cast(ints)); break; +#endif default: status = false; break;