Skip to content

Commit

Permalink
main: set default opengl version to 4.1 on macos
Browse files Browse the repository at this point in the history
Changes OpenGL version from default 2.0 on macOS to 4.1 fixing mpv
features that depended on OpenGL 3.0 or later.
  • Loading branch information
ripose-jp committed Sep 25, 2021
2 parents 3bf32a2 + 26a0779 commit 9f37ffa
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions src/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@

#if __APPLE__
#include <locale.h>
#include <QSurfaceFormat>
#endif

#include "audio/audioplayer.h"
Expand Down Expand Up @@ -133,6 +134,14 @@ int main(int argc, char *argv[])
/* Construct the application */
QApplication memento(argc, argv);

#if __APPLE__
QSurfaceFormat qSurfaceFormat;
qSurfaceFormat.setMajorVersion(4);
qSurfaceFormat.setMinorVersion(1);
qSurfaceFormat.setProfile(QSurfaceFormat::CoreProfile);
QSurfaceFormat::setDefaultFormat(qSurfaceFormat);
#endif

#if !__APPLE__
/* Set the window icon */
QGuiApplication::setWindowIcon(QIcon(":memento.svg"));
Expand Down

0 comments on commit 9f37ffa

Please sign in to comment.