[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Public WebGL] Behavior of WebGL canvas when it can't make a backbuffer of the requested size?



I've been doing some experiments on detecting resizing in both pure Javascript and using the Google GWT library.
Currently I'm getting some horrible artifacts when resizing the canvas inside Chrome. I've filed a bug -


http://code.google.com/p/chromium/issues/detail?id=62679

These artifacts don't appear in Firefox.

Also please see comments below.

Not surprisingly, I've also changed my mind and decided that the Vlad/Chris approach to resizing will work fine. I'm not sure about the aspect ratio thing, though. At first glance it seems a good idea, but really any sensible application is going to have to track the display size for those cases where the browser window is resized to smaller than the viewport, surely? In which case, you must always track the actual window dimensions and recalculate the aspect ratio for use with the perspective matrix. Or am I missing something?


On 11/10/2010 12:34 AM, Mark Callow wrote:


Sadly GWT does not currently have inner{Width,Height} queries so I've
had to be a bit more, er.., creative, in order to size my canvas
according to the size of the browser window.

Actually, this isn't quite true. Window inner width and height can easily be determined from an event handler tied to window resize events. I've written some test code for both pure JS and with GWT which uses this to resize the webgl canvas as the browser is resized.

Regards

Alan

-----------------------------------------------------------
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: