@ -10,6 +10,7 @@
# include <QMessageBox>
# include <QMessageBox>
# include <QPainter>
# include <QPainter>
# include <QScreen>
# include <QScreen>
# include <QString>
# include <QStringList>
# include <QStringList>
# include <QWindow>
# include <QWindow>
@ -603,19 +604,34 @@ bool GRenderWindow::LoadOpenGL() {
auto context = CreateSharedContext ( ) ;
auto context = CreateSharedContext ( ) ;
auto scope = context - > Acquire ( ) ;
auto scope = context - > Acquire ( ) ;
if ( ! gladLoadGL ( ) ) {
if ( ! gladLoadGL ( ) ) {
QMessageBox : : critical (
this , tr ( " Error while initializing OpenGL! " ) ,
tr ( " Your GPU may not support OpenGL, or you do not have the latest graphics driver. " ) ) ;
return false ;
}
QString renderer = QString : : fromUtf8 ( reinterpret_cast < const char * > ( glGetString ( GL_RENDERER ) ) ) ;
if ( ! GLAD_GL_VERSION_4_3 ) {
LOG_CRITICAL ( Frontend , " GPU does not support OpenGL 4.3: {:s} " , renderer . toStdString ( ) ) ;
QMessageBox : : critical ( this , tr ( " Error while initializing OpenGL 4.3! " ) ,
QMessageBox : : critical ( this , tr ( " Error while initializing OpenGL 4.3! " ) ,
tr ( " Your GPU may not support OpenGL 4.3, or you do not have the "
tr ( " Your GPU may not support OpenGL 4.3, or you do not have the "
" latest graphics driver. " ) ) ;
" latest graphics driver.<br><br>GL Renderer:<br>%1 " )
. arg ( renderer ) ) ;
return false ;
return false ;
}
}
QStringList unsupported_gl_extensions = GetUnsupportedGLExtensions ( ) ;
QStringList unsupported_gl_extensions = GetUnsupportedGLExtensions ( ) ;
if ( ! unsupported_gl_extensions . empty ( ) ) {
if ( ! unsupported_gl_extensions . empty ( ) ) {
LOG_CRITICAL ( Frontend , " GPU does not support all needed extensions: {:s} " ,
renderer . toStdString ( ) ) ;
QMessageBox : : critical (
QMessageBox : : critical (
this , tr ( " Error while initializing OpenGL! " ) ,
this , tr ( " Error while initializing OpenGL! " ) ,
tr ( " Your GPU may not support one or more required OpenGL extensions. Please ensure you "
tr ( " Your GPU may not support one or more required OpenGL extensions. Please ensure you "
" have the latest graphics driver.<br><br>Unsupported extensions:<br> " ) +
" have the latest graphics driver.<br><br>GL Renderer:<br>%1<br><br>Unsupported "
unsupported_gl_extensions . join ( QStringLiteral ( " <br> " ) ) ) ;
" extensions:<br>%2 " )
. arg ( renderer )
. arg ( unsupported_gl_extensions . join ( QStringLiteral ( " <br> " ) ) ) ) ;
return false ;
return false ;
}
}
return true ;
return true ;