MCPcopy Create free account
hub / github.com/comaps/comaps / initializeGL

Method initializeGL

qt/qt_common/map_widget.cpp:380–416  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

378}
379
380void 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
418void MapWidget::paintGL()
419{

Callers

nothing calls this directly

Calls 6

ASSERTFunction · 0.85
formatMethod · 0.80
glGetStringMethod · 0.45
versionMethod · 0.45
resetMethod · 0.45
EnterForegroundMethod · 0.45

Tested by

no test coverage detected