|
15 | 15 | #include <cctype> |
16 | 16 | #include <dlfcn.h> |
17 | 17 | #include <set> |
| 18 | +#include <sstream> |
18 | 19 | #include <string> |
19 | 20 |
|
20 | 21 | #include <EGL/egl.h> |
@@ -120,9 +121,8 @@ void GLEngineEGL::checkEGLError(bool fatal) { |
120 | 121 | break; |
121 | 122 | } |
122 | 123 |
|
123 | | - if (polyscope::options::verbosity > 0) { |
124 | | - std::cout << polyscope::options::printPrefix << "EGL Error! Type: " << errText << std::endl; |
125 | | - } |
| 124 | + info(0, "EGL Error! Type: " + errText); |
| 125 | + |
126 | 126 | if (fatal) { |
127 | 127 | exception("EGL error occurred. Text: " + errText); |
128 | 128 | } |
@@ -248,10 +248,13 @@ void GLEngineEGL::initialize() { |
248 | 248 | exception(options::printPrefix + "ERROR: Failed to load openGL using GLAD"); |
249 | 249 | } |
250 | 250 | #endif |
251 | | - if (options::verbosity > 0) { |
252 | | - std::cout << options::printPrefix << "Backend: openGL3_egl -- " |
253 | | - << "Loaded openGL version: " << glGetString(GL_VERSION) << " -- " |
254 | | - << "EGL version: " << majorVer << "." << minorVer << std::endl; |
| 251 | + |
| 252 | + { |
| 253 | + std::stringstring ss; |
| 254 | + ss << "Backend: openGL3_egl -- " |
| 255 | + << "Loaded openGL version: " << glGetString(GL_VERSION) << " -- " |
| 256 | + << "EGL version: " << majorVer << "." << minorVer; |
| 257 | + info(0, ss.str()); |
255 | 258 | } |
256 | 259 |
|
257 | 260 | { // Manually create the screen frame buffer |
@@ -325,9 +328,9 @@ void GLEngineEGL::resolveEGL() { |
325 | 328 | } |
326 | 329 | error("EGL: Error loading symbol " + errText); |
327 | 330 | } |
328 | | - if (options::verbosity > 5) { |
329 | | - std::cout << polyscope::options::printPrefix << " ...resolved EGL functions" << std::endl; |
330 | | - } |
| 331 | + |
| 332 | + info(5, "...resolved EGL functions"); |
| 333 | + |
331 | 334 | // ... at this point, we have essentially loaded libEGL.so |
332 | 335 |
|
333 | 336 | // === Resolve EGL extension functions |
@@ -405,7 +408,8 @@ void GLEngineEGL::sortAvailableDevicesByPreference( |
405 | 408 |
|
406 | 409 | // at high verbosity levels, log the priority |
407 | 410 | if (polyscope::options::verbosity > 5) { |
408 | | - info(5, "EGLDevice " + std::to_string(iDevice) + " -- vendor: " + vendorStr + " priority score: " + std::to_string(score)); |
| 411 | + info(5, "EGLDevice " + std::to_string(iDevice) + " -- vendor: " + vendorStr + |
| 412 | + " priority score: " + std::to_string(score)); |
409 | 413 | } |
410 | 414 |
|
411 | 415 | scoreDevices.emplace_back(score, iDevice); |
|
0 commit comments