| 479 | } |
| 480 | |
| 481 | EGLDisplay getInitializedDisplay() |
| 482 | { |
| 483 | if (display == EGL_NO_DISPLAY) |
| 484 | { |
| 485 | gladLoaderLoadEGL(EGL_NO_DISPLAY); |
| 486 | |
| 487 | display = eglCheck(eglGetDisplay(reinterpret_cast<EGLNativeDisplayType>(gbmDevice))); |
| 488 | |
| 489 | EGLint major = 0; |
| 490 | EGLint minor = 0; |
| 491 | eglCheck(eglInitialize(display, &major, &minor)); |
| 492 | |
| 493 | gladLoaderLoadEGL(display); |
| 494 | |
| 495 | #if defined(SFML_OPENGL_ES) |
| 496 | if (!eglBindAPI(EGL_OPENGL_ES_API)) |
| 497 | { |
| 498 | sf::err() << "failed to bind api EGL_OPENGL_ES_API" << std::endl; |
| 499 | } |
| 500 | #else |
| 501 | if (!eglBindAPI(EGL_OPENGL_API)) |
| 502 | { |
| 503 | sf::err() << "failed to bind api EGL_OPENGL_API" << std::endl; |
| 504 | } |
| 505 | #endif |
| 506 | } |
| 507 | |
| 508 | return display; |
| 509 | } |
| 510 | } // namespace |
| 511 | |
| 512 |
no test coverage detected