diff options
author | Erik Kundiman <erik@megapahit.org> | 2023-09-05 23:14:03 +0800 |
---|---|---|
committer | Erik Kundiman <erik@megapahit.org> | 2023-09-05 23:14:03 +0800 |
commit | ed44bcf9f763a7d1f7549eb1f03d8aa7fb933ef7 (patch) | |
tree | 0d37e52d48fd72f61ce4f6ac718a494c8b45c5a7 /indra/llrender/llgl.cpp | |
parent | 6e9102ad408282ea6d5f8926f4a6ed377fe922ef (diff) |
Preprocess non portable GL funcs & macros
so that implementations that don't include a certain GL implementation
won't fail trying to compile the code.
Diffstat (limited to 'indra/llrender/llgl.cpp')
-rw-r--r-- | indra/llrender/llgl.cpp | 19 |
1 files changed, 17 insertions, 2 deletions
diff --git a/indra/llrender/llgl.cpp b/indra/llrender/llgl.cpp index 6998d892e2..729e8a5f28 100644 --- a/indra/llrender/llgl.cpp +++ b/indra/llrender/llgl.cpp @@ -595,6 +595,7 @@ bool LLGLManager::initGL() #endif } +#if GL_VERSION_1_3 if (mGLVersion >= 2.1f && LLImageGL::sCompressTextures) { //use texture compression glHint(GL_TEXTURE_COMPRESSION_HINT, GL_NICEST); @@ -603,6 +604,7 @@ bool LLGLManager::initGL() { //GL version is < 3.0, always disable texture compression LLImageGL::sCompressTextures = false; } +#endif // Trailing space necessary to keep "nVidia Corpor_ati_on" cards // from being recognized as ATI. @@ -727,6 +729,7 @@ bool LLGLManager::initGL() { mNumTextureUnits = llmin(mNumTextureImageUnits, MAX_GL_TEXTURE_UNITS); } +#if GL_VERSION_1_3 else { GLint num_tex_units; @@ -737,6 +740,7 @@ bool LLGLManager::initGL() mNumTextureUnits = llmin(mNumTextureUnits, 2); } } +#endif } else { @@ -1474,12 +1478,14 @@ void log_glerror() error = glGetError(); while (LL_UNLIKELY(error)) { +#if GLU_VERSION_1_1 GLubyte const * gl_error_msg = gluErrorString(error); if (NULL != gl_error_msg) { LL_WARNS() << "GL Error: " << error << " GL Error String: " << gl_error_msg << LL_ENDL ; } else +#endif // GLU_VERSION_1_1 { // gluErrorString returns NULL for some extensions' error codes. // you'll probably have to grep for the number in glext.h. @@ -1498,6 +1504,7 @@ void do_assert_glerror() while (LL_UNLIKELY(error)) { quit = TRUE; +#if GLU_VERSION_1_1 GLubyte const * gl_error_msg = gluErrorString(error); if (NULL != gl_error_msg) { @@ -1510,6 +1517,7 @@ void do_assert_glerror() } } else +#endif // GLU_VERSION_1_1 { // gluErrorString returns NULL for some extensions' error codes. // you'll probably have to grep for the number in glext.h. @@ -1601,6 +1609,7 @@ void LLGLState::restoreGL() void LLGLState::resetTextureStates() { gGL.flush(); +#if GL_VERSION_1_3 GLint maxTextureUnits; glGetIntegerv(GL_MAX_TEXTURE_UNITS_ARB, &maxTextureUnits); @@ -1610,6 +1619,7 @@ void LLGLState::resetTextureStates() glClientActiveTexture(GL_TEXTURE0_ARB+j); j == 0 ? gGL.getTexUnit(j)->enable(LLTexUnit::TT_TEXTURE) : gGL.getTexUnit(j)->disable(); } +#endif } void LLGLState::dumpStates() @@ -1864,6 +1874,7 @@ LLGLState::LLGLState(LLGLenum state, S32 enabled) : mState(state), mWasEnabled(FALSE), mIsEnabled(FALSE) { LL_PROFILE_ZONE_SCOPED_CATEGORY_PIPELINE; +#if GL_VERSION_1_1 switch (state) { case GL_ALPHA_TEST: @@ -1880,6 +1891,7 @@ LLGLState::LLGLState(LLGLenum state, S32 enabled) : mState = 0; break; } +#endif // GL_VERSION_1_1 stop_glerror(); @@ -2339,8 +2351,11 @@ void LLGLSyncFence::wait() } LLGLSPipelineSkyBox::LLGLSPipelineSkyBox() -: mAlphaTest(GL_ALPHA_TEST) -, mCullFace(GL_CULL_FACE) +: +#if GL_VERSION_1_1 +mAlphaTest(GL_ALPHA_TEST), +#endif +mCullFace(GL_CULL_FACE) , mSquashClip() { } |