Browse Source

Improve ANGLE driver detection.

It is now also on ES3, avoid mistakenly detecting Internet Explorer
WebGL implementation as ANGLE (it has the same properties).
pull/107/head
Vladimír Vondruš 11 years ago
parent
commit
608a80c20d
  1. 6
      src/Magnum/Context.h
  2. 13
      src/Magnum/Implementation/driverSpecific.cpp

6
src/Magnum/Context.h

@ -189,10 +189,10 @@ class MAGNUM_EXPORT Context {
IntelWindows = 1 << 1,
#endif
#ifdef MAGNUM_TARGET_GLES2
#ifdef MAGNUM_TARGET_GLES
/**
* OpenGL ES 2.0 implementation by ANGLE (translated to D3D9), used
* by browsers on Windows for Native Client and WebGL. As the WebGL
* OpenGL ES implementation by ANGLE (translated to D3D), used by
* browsers on Windows for Native Client and WebGL. As the WebGL
* specification explicitly disallows exposing driver information
* to the application, this check cannot be done reliably.
*/

13
src/Magnum/Implementation/driverSpecific.cpp

@ -34,9 +34,9 @@ auto Context::detectedDriver() -> DetectedDrivers {
_detectedDrivers = DetectedDrivers{};
#ifndef MAGNUM_TARGET_GLES
const std::string vendor = vendorString();
#ifndef MAGNUM_TARGET_GLES
/* AMD binary desktop drivers */
if(vendor.find("ATI Technologies Inc.") != std::string::npos)
return *_detectedDrivers |= DetectedDriver::AMD;
@ -48,13 +48,16 @@ auto Context::detectedDriver() -> DetectedDrivers {
#endif
#endif
#ifdef MAGNUM_TARGET_GLES2
/* OpenGL ES 2.0 implementation using ANGLE. Taken from
http://stackoverflow.com/a/20149090 */
/** @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:
http://stackoverflow.com/a/20149090
http://webglreport.com
*/
{
Range1Di range;
glGetIntegerv(GL_ALIASED_LINE_WIDTH_RANGE, range.data());
if(range.min() == 1 && range.max() == 1)
if(range.min() == 1 && range.max() == 1 && vendor != "Internet Explorer")
return *_detectedDrivers |= DetectedDriver::ProbablyAngle;
}
#endif

Loading…
Cancel
Save