mirror of
https://github.com/JulianGro/overte.git
synced 2025-04-26 02:35:16 +02:00
Add messageBox for no gl support
This commit is contained in:
parent
caf2595e13
commit
a34e6773a9
1 changed files with 15 additions and 1 deletions
|
@ -25,8 +25,22 @@ OpenGLVersionChecker::OpenGLVersionChecker(int& argc, char** argv) :
|
||||||
bool OpenGLVersionChecker::isValidVersion() {
|
bool OpenGLVersionChecker::isValidVersion() {
|
||||||
bool valid = true;
|
bool valid = true;
|
||||||
|
|
||||||
// Retrieve OpenGL version
|
|
||||||
GLWidget* glWidget = new GLWidget();
|
GLWidget* glWidget = new GLWidget();
|
||||||
|
valid = glWidget->isValid();
|
||||||
|
// Inform user if no OpenGL support
|
||||||
|
if (!valid) {
|
||||||
|
QMessageBox messageBox;
|
||||||
|
messageBox.setWindowTitle("Missing OpenGL Support");
|
||||||
|
messageBox.setIcon(QMessageBox::Warning);
|
||||||
|
messageBox.setText(QString().sprintf("Your system does not support OpenGL, Interface cannot run."));
|
||||||
|
messageBox.setInformativeText("Press OK to exit.");
|
||||||
|
messageBox.setStandardButtons(QMessageBox::Ok);
|
||||||
|
messageBox.setDefaultButton(QMessageBox::Ok);
|
||||||
|
messageBox.exec();
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Retrieve OpenGL version
|
||||||
glWidget->initializeGL();
|
glWidget->initializeGL();
|
||||||
QString glVersion = QString((const char*)glGetString(GL_VERSION));
|
QString glVersion = QString((const char*)glGetString(GL_VERSION));
|
||||||
delete glWidget;
|
delete glWidget;
|
||||||
|
|
Loading…
Reference in a new issue