16 Oct 2020

How to Check WebGL Support? A proper way to detect WebGL support?


Hi guys, Here in This post I am going to show you that How can you check WebGL Support. Whenever you work with WebGL, firstly you should check what kinds of WebGL Version support you device's web browser. doing so you will write code according WebGL Support.

Generally all major web browser (🔥 Firefox , Chrome, Internet Explorer, Edge) does supports WebGL v1. But here Mostly user has doubt either WebGL v2 is supported or not.


 
function glsupport( contextName ){

if(typeof contextName != "string") { 
alert ("Please provide string");
return ;
}

    var ctx = document.createElement("canvas").
    getContext(contextName);
    
    alert ( contextName + " - " +(ctx != null ? "supported" : "unsupported" ) );
    
    }
    
    

WebGL 1

WebGL 2

Experiential-webgl


Reaction:

No comments:

No Comments

COMMENT FROM MESSAGE