Skip to content

Commit

Permalink
Use WebGL2 context when available
Browse files Browse the repository at this point in the history
  • Loading branch information
rotu committed Dec 1, 2022
1 parent d148ba0 commit 914088c
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

### ✨ Features and improvements
- *...Add new stuff here...*
- Use WebGL2 context when available ([#1891](https://github.com/maplibre/maplibre-gl-js/pull/1891))
- NavigationControlOptions is now optional when creating an instance of NavigationControl ([#1754](https://github.com/maplibre/maplibre-gl-js/issues/1754))
- Listen to webglcontextcreationerror event and give detailed debug info when it fails ([#1715](https://github.com/maplibre/maplibre-gl-js/pull/1715))
- Make sure `cooperativeGestures` overlay is always "on top" (z-index) of map features ([#1753](https://github.com/maplibre/maplibre-gl-js/pull/1753))
Expand Down
5 changes: 3 additions & 2 deletions src/ui/map.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2557,8 +2557,9 @@ class Map extends Camera {
}
}, {once: true});

const gl = this._canvas.getContext('webgl', attributes) ||
this._canvas.getContext('experimental-webgl', attributes);
const gl =
this._canvas.getContext('webgl2', attributes) ||
this._canvas.getContext('webgl', attributes);

if (!gl) {
const msg = 'Failed to initialize WebGL';
Expand Down

0 comments on commit 914088c

Please sign in to comment.