@@ -285,28 +285,21 @@ void GLEngineEGL::resolveEGL() {
285285 // We are furthermore loading `libEGL.so` dynamically in the middle of runtime, rather than at load time as via ldd
286286 // etc. At the end of this function we also load EGL extensions in the usual way.
287287
288-
289- if (options::verbosity > 5 ) {
290- std::cout << polyscope::options::printPrefix << " Attempting to dlopen libEGL.so" << std::endl;
291- }
288+ info (5 , " Attempting to dlopen libEGL.so" );
292289 void * handle = dlopen (" libEGL.so" , RTLD_LAZY);
293- if (handle && options::verbosity > 5 ) {
294- std::cout << polyscope::options::printPrefix << " ...loaded libEGL.so" << std::endl;
295- }
290+ if (handle) info (5 , " ...loaded libEGL.so" );
296291 if (!handle) {
297292 handle = dlopen (" libEGL.so.1" , RTLD_LAZY); // try it while we're at it, happens on OSMesa without dev headers
298293 }
299- if (handle && options::verbosity > 5 ) {
300- std::cout << polyscope::options::printPrefix << " ...loaded libEGL.so.1" << std::endl;
301- }
294+ if (handle) info (5 , " ...loaded libEGL.so.1" );
302295 if (!handle) {
303- error (" EGL: Could not open libEGL.so" );
296+ error (
297+ " EGL: Could not open libEGL.so. Ensure graphics drivers are installed, or fall back on (much slower!) software "
298+ " rendering by installing OSMesa from your package manager." );
304299 }
305300
306301 // Get EGL functions
307- if (options::verbosity > 5 ) {
308- std::cout << polyscope::options::printPrefix << " Attempting to dlsym resolve EGL functions" << std::endl;
309- }
302+ info (5 , " Attempting to dlsym resolve EGL functions" );
310303
311304 eglGetError = (eglGetErrorT)dlsym (handle, " eglGetError" );
312305 eglGetPlatformDisplay = (eglGetPlatformDisplayT)dlsym (handle, " eglGetPlatformDisplay" );
@@ -383,10 +376,7 @@ void GLEngineEGL::sortAvailableDevicesByPreference(
383376 // NOTE: on many machines (cloud VMs?) the query string above is nullptr, and this whole function does nothing
384377 // useful
385378 if (vendorStrRaw == nullptr ) {
386- if (polyscope::options::verbosity > 5 ) {
387- std::cout << polyscope::options::printPrefix << " EGLDevice " << iDevice << " -- vendor: " << " NULL"
388- << " priority score: " << score << std::endl;
389- }
379+ info (5 , " EGLDevice " + std::to_string (iDevice) + " -- vendor: NULL priority score: " std::to_string (score);
390380 scoreDevices.emplace_back (score, iDevice);
391381 continue ;
392382 }
@@ -415,8 +405,7 @@ void GLEngineEGL::sortAvailableDevicesByPreference(
415405
416406 // at high verbosity levels, log the priority
417407 if (polyscope::options::verbosity > 5 ) {
418- std::cout << polyscope::options::printPrefix << " EGLDevice " << iDevice << " -- vendor: " << vendorStr
419- << " priority score: " << score << std::endl;
408+ info (5 , " EGLDevice " + std::to_string (iDevice) + " -- vendor: " + vendorStr + " priority score: " std::to_string (score);
420409 }
421410
422411 scoreDevices.emplace_back (score, iDevice);
0 commit comments