[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Public WebGL] distinguishing browsers that support WebGL but need updated drivers
- To: Stephen Bannasch <stephen.bannasch@deanbrook.org>
- Subject: Re: [Public WebGL] distinguishing browsers that support WebGL but need updated drivers
- From: "Gregg Tavares (wrk)" <gman@google.com>
- Date: Fri, 11 Mar 2011 13:34:51 -0800
- Cc: public_webgl@khronos.org
- Dkim-signature: v=1; a=rsa-sha1; c=relaxed/relaxed; d=google.com; s=beta; t=1299879294; bh=WKqjwEQfuVINwYlinnl61QCF9vM=; h=MIME-Version:In-Reply-To:References:Date:Message-ID:Subject:From: To:Cc:Content-Type; b=egf3HZ3y812G73PQfFHWopASJwqdtcXeO2e1L5IduZgyN8X2m11IS8s5RqNUwD2tT WIeoj9SPYHjR3eOfeBg6A==
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=beta; h=domainkey-signature:mime-version:in-reply-to:references:date :message-id:subject:from:to:cc:content-type; bh=JRSPkBfGNpV3CzxqIl1mg4TA0cz0E93PKbm2S5POoK8=; b=pdsTxnVC93fcnAIvciGCGck9PCF86gugC+74ISMNgcnN2DdWMTOezwOWfqP9g+aQ5v hjrzcpVeEfwIpWZ9+cGw==
- Domainkey-signature: a=rsa-sha1; c=nofws; d=google.com; s=beta; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; b=C8DWSFhzTOkKtX87UJAvtZbQnDOX1I9dggef4uNg8n94Mphz2CwJx2RRLLknX1bXJd b79kZB86E9wsfC93Lw7w==
- In-reply-to: <p06240823c9a0401acd28@192.168.1.122>
- List-id: Public WebGL Mailing List <public_webgl.khronos.org>
- References: <p06240823c9a0401acd28@192.168.1.122>
- Sender: owner-public_webgl@khronos.org
if (!window.WebGLRenderingContext) {
// the browser does not know what webgl is
}
gl = canvas.getContext("webgl");
if (!gl) {
}
On Fri, Mar 11, 2011 at 1:19 PM, Stephen Bannasch
<stephen.bannasch@deanbrook.org> wrote:
I created a very simple page that distinguishing between:
1) browsers that support WebGL
2) browsers that support WebGL but don't successfully generate a WebGL context.
3) browsers that don't support WebGL
http://visual-demos.dev.concord.org/seasons/test-for-webgl.html
I'm using this function to test whether the browser supports WebGL:
function browserSupportsWebGL() {
//if (window.WebGLRenderingContext === undefined || window.WebGLRenderingContext.tagName === "DFN" ) {
if (window.WebGLRenderContext) { // this should be enough in _javascript_
return false
} else {
return true
}
}
The bizarre test for tagName == DFN handles Safari 5.0.x which returns a DFN element in response to window.WebGLRenderingContext.
I've also added a handler to receive a webglcontextcreationerror event:
function webglContextCreationErrorHandler(evt) {
if (evt.statusMessage) {
document.getElementById("status-message").textContent = evt.statusMessage;
}
};
See: http://www.khronos.org/registry/webgl/specs/latest/#5.14.3
I don't actually know if this works or what might be returned as a statusMessage.
I know FFv4 doesn't report a statusMessage yet. If some version of Chrome does I'd like to know what kind of statusMessage is returned if someone out there has a machine where Chrome won't create a WebGL context because of unsupported video cards or a video driver that is too old.
The code is here: https://github.com/stepheneb/seasons/blob/master/test-for-webgl.html
Thanks
-----------------------------------------------------------
You are currently subscribed to public_webgl@khronos.org.
To unsubscribe, send an email to majordomo@khronos.org with
the following command in the body of your email:
unsubscribe public_webgl
-----------------------------------------------------------