Browse Source

On the other hand, most driver detection makes no sense on WebGL.

pull/203/merge
Vladimír Vondruš 9 years ago
parent
commit
6faf6c009a
  1. 32
      src/Magnum/Context.h
  2. 4
      src/Magnum/Implementation/driverSpecific.cpp

32
src/Magnum/Context.h

@ -214,19 +214,35 @@ class MAGNUM_EXPORT Context {
* @see @ref DetectedDriver, @ref detectedDriver()
*/
enum class DetectedDriver: UnsignedShort {
/** Binary AMD desktop drivers on Windows and Linux */
#ifndef MAGNUM_TARGET_WEBGL
/**
* Binary AMD desktop drivers on Windows and Linux
* @requires_gles Not detectable on WebGL, as browsers
* intentionally hide most of the driver information.
*/
AMD = 1 << 0,
/** Intel desktop drivers on Windows */
/**
* Intel desktop drivers on Windows
* @requires_gles Not detectable on WebGL, as browsers
* intentionally hide most of the driver information.
*/
IntelWindows = 1 << 1,
#ifndef MAGNUM_TARGET_WEBGL
/** Binary NVidia drivers on Windows and Linux */
NVidia = 1 << 2,
#endif
/**
* Mesa drivers on Linux
* @requires_gles Not detectable on WebGL, as browsers
* intentionally hide most of the driver information.
*/
Mesa = 1 << 2,
/** Mesa drivers on Linux */
Mesa = 1 << 3,
/**
* Binary NVidia drivers on Windows and Linux
* @requires_gles Not detectable on WebGL, as browsers
* intentionally hide most of the driver information.
*/
NVidia = 1 << 3,
#endif
#ifdef MAGNUM_TARGET_GLES
/**

4
src/Magnum/Implementation/driverSpecific.cpp

@ -134,7 +134,7 @@ auto Context::detectedDriver() -> DetectedDrivers {
const std::string version = versionString();
/* Apple has its own drivers */
#ifndef CORRADE_TARGET_APPLE
#if !defined(CORRADE_TARGET_APPLE) && !defined(MAGNUM_TARGET_WEBGL)
/* AMD binary desktop drivers */
if(vendor.find("ATI Technologies Inc.") != std::string::npos)
return *_detectedDrivers |= DetectedDriver::AMD;
@ -151,11 +151,9 @@ auto Context::detectedDriver() -> DetectedDrivers {
return *_detectedDrivers |= DetectedDriver::Mesa;
#endif
#ifndef MAGNUM_TARGET_WEBGL
if(vendor.find("NVIDIA Corporation") != std::string::npos)
return *_detectedDrivers |= DetectedDriver::NVidia;
#endif
#endif
/** @todo there is also D3D9/D3D11 distinction on webglreport.com, is it useful? */
#ifdef MAGNUM_TARGET_GLES

Loading…
Cancel
Save