Browse Source

Ability to detect Mesa drivers.

pull/203/merge
Vladimír Vondruš 9 years ago
parent
commit
c870a1a6e8
  1. 5
      src/Magnum/Context.h
  2. 7
      src/Magnum/Implementation/driverSpecific.cpp

5
src/Magnum/Context.h

@ -223,6 +223,9 @@ class MAGNUM_EXPORT Context {
NVidia = 1 << 2,
#endif
/** Mesa drivers on Linux */
Mesa = 1 << 3,
#ifdef MAGNUM_TARGET_GLES
/**
* OpenGL ES implementation by ANGLE (translated to D3D), used by
@ -230,7 +233,7 @@ class MAGNUM_EXPORT Context {
* specification explicitly disallows exposing driver information
* to the application, this check cannot be done reliably.
*/
ProbablyAngle = 1 << 3
ProbablyAngle = 1 << 4
#endif
};

7
src/Magnum/Implementation/driverSpecific.cpp

@ -127,6 +127,7 @@ auto Context::detectedDriver() -> DetectedDrivers {
_detectedDrivers = DetectedDrivers{};
const std::string vendor = vendorString();
const std::string version = versionString();
/* Apple has its own drivers */
#ifndef CORRADE_TARGET_APPLE
@ -140,6 +141,12 @@ auto Context::detectedDriver() -> DetectedDrivers {
if(vendor.find("Intel") != std::string::npos)
return *_detectedDrivers |= DetectedDriver::IntelWindows;
#endif
#ifdef CORRADE_TARGET_UNIX
/* Mesa drivers */
if(version.find("Mesa") != std::string::npos)
return *_detectedDrivers |= DetectedDriver::Mesa;
#endif
#endif
#ifndef MAGNUM_TARGET_WEBGL

Loading…
Cancel
Save