From 9715e0c4b830611bda7c74621f460bfdbb61857d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vladim=C3=ADr=20Vondru=C5=A1?= Date: Sat, 2 Jan 2016 00:32:14 +0100 Subject: [PATCH] Add NVidia to list of detected drivers. I hoped this commit will never need to happen. --- src/Magnum/Context.h | 7 ++++++- src/Magnum/Implementation/driverSpecific.cpp | 5 +++++ 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/src/Magnum/Context.h b/src/Magnum/Context.h index 3522be233..a9b1347b2 100644 --- a/src/Magnum/Context.h +++ b/src/Magnum/Context.h @@ -209,6 +209,11 @@ class MAGNUM_EXPORT Context { IntelWindows = 1 << 1, #endif + #ifndef MAGNUM_TARGET_WEBGL + /** Binary NVidia drivers */ + NVidia = 1 << 2, + #endif + #ifdef MAGNUM_TARGET_GLES /** * OpenGL ES implementation by ANGLE (translated to D3D), used by @@ -216,7 +221,7 @@ class MAGNUM_EXPORT Context { * specification explicitly disallows exposing driver information * to the application, this check cannot be done reliably. */ - ProbablyAngle = 1 << 2 + ProbablyAngle = 1 << 3 #endif }; diff --git a/src/Magnum/Implementation/driverSpecific.cpp b/src/Magnum/Implementation/driverSpecific.cpp index b95d15a3e..8be35d1a2 100644 --- a/src/Magnum/Implementation/driverSpecific.cpp +++ b/src/Magnum/Implementation/driverSpecific.cpp @@ -113,6 +113,11 @@ auto Context::detectedDriver() -> DetectedDrivers { #endif #endif + #ifndef MAGNUM_TARGET_WEBGL + if(vendor.find("NVIDIA Corporation") != std::string::npos) + return *_detectedDrivers |= DetectedDriver::NVidia; + #endif + /** @todo there is also D3D9/D3D11 distinction on webglreport.com, is it useful? */ #ifdef MAGNUM_TARGET_GLES /* OpenGL ES implementation using ANGLE. Taken from these sources: