[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Public WebGL] Some WebGL draft feedback
- To: public webgl <firstname.lastname@example.org>
- Subject: Re: [Public WebGL] Some WebGL draft feedback
- From: Chris Marrin <email@example.com>
- Date: Tue, 05 Jan 2010 10:43:09 -0800
- In-reply-to: <E6673A78-B101-41FF-95DE-57F7138DCBB3@microcan.nl>
- References: <firstname.lastname@example.org> <email@example.com> <4B2EFEAB.firstname.lastname@example.org> <email@example.com> <232D3496-5733-48BA-98AA-A1EF5F0DA3AE@apple.com> <4B2FF8F2.firstname.lastname@example.org> <7E7BE0B9-573C-467B-A85A-5692826E9A2F@apple.com> <email@example.com> <35523F5C-763A-4F95-9539-66CA9B91B472@apple.com> <90B8236C088D42F2A8483A1AA3CB7235@hp8510w> <7D4BC4A3-156F-46D3-AC42-E3C9F8AD96DD@apple.com> <4B42CEE9.firstname.lastname@example.org> <6E765713-4D59-495A-8396-75A338D8374B@apple.com> <E6673A78-B101-41FF-95DE-57F7138DCBB3@microcan.nl>
- Sender: email@example.com
On Jan 5, 2010, at 10:28 AM, Carl van Heezik wrote:
> I vote for 1) glsl-fragment and glsl-vertex.
> I run into an issue with a resizable canvas. See: http://webgl.microcan.nl/
> I have created a webpage with a canvas and a CSS file to make the body and the canvas width and height both 100%.
> The canvas resized but the resolution of the WebGL context stays the same. This means that you get the standard width and height
> which seems to be 400 by 300 pixels scaled to the with and height of the canvas. The first workaround I tried was setting the width
> and height to the clientWidth and clientHeight before getContext().
> canvas.width = canvas.clientWidth;
> canvas.height = canvas.clientHeight;
> After this you get an initial correct canvas but when you resize the browser window. You still get the same behavior.
> I you start with a small window and push refresh, you get a correct canvas but if you resize the browser, the canvas is still scaled.
> Then I tried to solve this in an onResize handler, you have to redraw the scene anyway so this is not a problem. If you use
> the same trick you seem to lose the complete WebGL context. I tried some other options but none of them work in all browsers.
> How do you create a canvas that resizes with the browser that works in all browsers that support WebGL.
> Another bug I noticed in Safari WebKit is that the resize handle disappears because I used a back opaque background as clearColor.
> You can still resize the browser but you can not see the drag handle.
Yeah, resizing is very confusing right now. WebKit sets the canvas size to its CSS (visible) size rather than to the size given in the canvas width and height attributes. So it behaves incorrectly wrt the spec. And I believe Firefox has other resizing issues. We should get this resolved ASAP.
You are currently subscribe to firstname.lastname@example.org.
To unsubscribe, send an email to email@example.com with
the following command in the body of your email: