diff --git a/src/osgDB/DatabasePager.cpp b/src/osgDB/DatabasePager.cpp index 6f58822b9..b0097a968 100644 --- a/src/osgDB/DatabasePager.cpp +++ b/src/osgDB/DatabasePager.cpp @@ -2007,7 +2007,9 @@ void DatabasePager::compileGLObjects(osg::State& state, double& availableTime) if (!dtc.first.empty() && (elapsedTime+estimatedTextureDuration)compileGLObjects(state); - GLint p; - glGetTexParameteriv(GL_TEXTURE_2D, GL_TEXTURE_RESIDENT, &p); + #if !defined(OSG_GLES1_AVAILABLE) && !defined(OSG_GLES2_AVAILABLE) + GLint p; + glGetTexParameteriv(GL_TEXTURE_2D, GL_TEXTURE_RESIDENT, &p); + #endif elapsedTime = timer.delta_s(start_tick,timer.tick()); - // estimate the duration of the compile based on current compile duration. estimatedTextureDuration = (elapsedTime-startCompileTime);