sdf-2d/src/graphics/graphics-library/helper/get-webgl2-context.ts
schmelczerandras 77bde04db3 Add files
2020-09-15 10:08:16 +02:00

9 lines
214 B
TypeScript

export const getWebGl2Context = (canvas: HTMLCanvasElement): WebGL2RenderingContext => {
const gl = canvas.getContext('webgl2');
if (!gl) {
throw new Error('WebGl2 is not supported');
}
return gl;
};