| 378 | } |
| 379 | |
| 380 | void MapWidget::initializeGL() |
| 381 | { |
| 382 | ASSERT(m_contextFactory == nullptr, ()); |
| 383 | if (!m_screenshotMode) |
| 384 | m_ratio = devicePixelRatio(); |
| 385 | |
| 386 | #if defined(OMIM_OS_LINUX) |
| 387 | { |
| 388 | QOpenGLFunctions * funcs = context()->functions(); |
| 389 | LOG(LINFO, ("Vendor:", funcs->glGetString(GL_VENDOR), "\nRenderer:", funcs->glGetString(GL_RENDERER), |
| 390 | "\nVersion:", funcs->glGetString(GL_VERSION), "\nShading language version:\n", |
| 391 | funcs->glGetString(GL_SHADING_LANGUAGE_VERSION), "\nExtensions:", funcs->glGetString(GL_EXTENSIONS))); |
| 392 | |
| 393 | if (!context()->isOpenGLES()) |
| 394 | LOG(LCRITICAL, ("Context is not LibGLES! This shouldn't have happened.")); |
| 395 | |
| 396 | auto fmt = context()->format(); |
| 397 | if (context()->format().version() < qMakePair(3, 0)) |
| 398 | { |
| 399 | CHECK(false, ("OpenGL ES2 is not supported")); |
| 400 | } |
| 401 | else |
| 402 | { |
| 403 | LOG(LINFO, ("OpenGL version is at least 3.0, enabling GLSL '#version 300 es'")); |
| 404 | fmt.setVersion(3, 0); |
| 405 | } |
| 406 | |
| 407 | QSurfaceFormat::setDefaultFormat(fmt); |
| 408 | } |
| 409 | #endif |
| 410 | |
| 411 | m_contextFactory.reset(new QtOGLContextFactory(context())); |
| 412 | |
| 413 | emit BeforeEngineCreation(); |
| 414 | CreateEngine(); |
| 415 | m_framework.EnterForeground(); |
| 416 | } |
| 417 | |
| 418 | void MapWidget::paintGL() |
| 419 | { |
nothing calls this directly
no test coverage detected