Skip to content

Commit

Permalink
Disable OpenGLFunctions::requestMinimumFormat on Windows
Browse files Browse the repository at this point in the history
  • Loading branch information
timangus committed Dec 8, 2023
1 parent 1e3e331 commit d201c1c
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions source/app/rendering/openglfunctions.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -59,13 +59,15 @@ QSurfaceFormat OpenGLFunctions::minimumFormat()

void OpenGLFunctions::requestMinimumFormat()
{
#ifndef Q_OS_WIN // For reasons not understood, this causes problems on Windows
const auto defaultFormat = QSurfaceFormat::defaultFormat();
const std::pair<int, int> defaultVersion = {defaultFormat.majorVersion(), defaultFormat.minorVersion()};
const auto requestFormat = minimumFormat();
const std::pair<int, int> requestVersion = {requestFormat.majorVersion(), requestFormat.minorVersion()};

if(defaultVersion < requestVersion)
QSurfaceFormat::setDefaultFormat(requestFormat);
#endif
}

class QueryFunctions
Expand Down

0 comments on commit d201c1c

Please sign in to comment.