fixed issues with some opengl implementations

This commit is contained in:
itsmattkc
2019-09-13 00:32:41 +10:00
parent 28687d4852
commit c5572876fa
10 changed files with 102 additions and 48 deletions
+10 -8
View File
@@ -37,7 +37,16 @@ extern "C" {
#include "core.h"
#include "common/debug.h"
int main(int argc, char *argv[]) {
int main(int argc, char *argv[]) {
QApplication::setAttribute(Qt::AA_ShareOpenGLContexts);
// Set OpenGL display profile (3.2 Core)
QSurfaceFormat format;
format.setVersion(3, 2);
format.setDepthBufferSize(24);
format.setProfile(QSurfaceFormat::CoreProfile);
QSurfaceFormat::setDefaultFormat(format);
// Create application instance
QApplication a(argc, argv);
@@ -63,13 +72,6 @@ int main(int argc, char *argv[]) {
// Set up debug handler
qInstallMessageHandler(DebugHandler);
// Set OpenGL display profile (3.2 Core)
QSurfaceFormat format;
format.setVersion(3, 2);
format.setDepthBufferSize(24);
format.setProfile(QSurfaceFormat::CoreProfile);
QSurfaceFormat::setDefaultFormat(format);
// Register FFmpeg codecs and filters (deprecated in 4.0+)
#if LIBAVFORMAT_VERSION_INT < AV_VERSION_INT(58, 9, 100)
av_register_all();