项目作者: amilajack

项目描述 :
Detect the graphics specs of a device using web APIs
高级语言: JavaScript
项目地址: git://github.com/amilajack/webgl-specs.git
创建时间: 2018-05-23T03:54:54Z
项目社区:https://github.com/amilajack/webgl-specs

开源协议:

下载


webgl-specs

Detect the graphics specs of a device using web APIs

Install

  1. # Yarn
  2. yarn add webgl-specs
  3. # NPM
  4. npm install webgl-specs

Why?

This is useful when you want to render lower quality graphics for low powered devices

Usage

If you have a module loader (webpack or rollup)

  1. import WebglSpecs from 'webgl-specs';
  2. const report = WebglSpecs();
  3. report.unMaskedRenderer // "Intel Iris OpenGL Engine"
  4. report.unMaskedVendor // "Intel Inc."
  5. report.glVersion // "WebGL 1.0 (OpenGL ES 2.0 Chromium)"

If you’re not:

  1. <html>
  2. <body>
  3. <script type="module">
  4. import WebglSpecs from 'https://unpkg.com/webgl-specs@latest/index.js';
  5. const report = WebglSpecs();
  6. report.unMaskedRenderer // "Intel Iris OpenGL Engine"
  7. report.unMaskedVendor // "Intel Inc."
  8. report.glVersion // "WebGL 1.0 (OpenGL ES 2.0 Chromium)"
  9. </script>
  10. </body>
  11. </html>

Testing

  1. yarn start

Prior Art