forked from qt-creator/qt-creator
Centralize checking for OpenGL
Change-Id: Ic2212c8519f4c771ba3e3c61dd32073b93db7ed9 Reviewed-by: Eike Ziller <eike.ziller@theqtcompany.com>
This commit is contained in:
@@ -30,6 +30,9 @@
|
||||
|
||||
#include "hostosinfo.h"
|
||||
|
||||
#include <QApplication>
|
||||
#include <QOpenGLContext>
|
||||
|
||||
#ifdef Q_OS_WIN
|
||||
#undef _WIN32_WINNT
|
||||
#define _WIN32_WINNT 0x0501 /* WinXP, needed for GetNativeSystemInfo() */
|
||||
@@ -81,3 +84,12 @@ void HostOsInfo::unsetOverrideFileNameCaseSensitivity()
|
||||
{
|
||||
m_useOverrideFileNameCaseSensitivity = false;
|
||||
}
|
||||
|
||||
bool HostOsInfo::canCreateOpenGLContext(QString *errorMessage)
|
||||
{
|
||||
static const bool canCreate = QOpenGLContext().create();
|
||||
if (!canCreate)
|
||||
*errorMessage = QApplication::translate("Utils::HostOsInfo",
|
||||
"Cannot create OpenGL context.");
|
||||
return canCreate;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user