[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?



On Sep 29, 2010, at 2:37 PM, Gregg Tavares (wrk) wrote:

> 
> 
> ...And I assume that when that's done an implicit transform is applied to make it look to the user like the canvas is the requested size? That's what I suggested in the first place, but it was pointed out that hiding the actual size from the author like that is not really possible. Canvas 2D doesn't have concepts like viewport, which are not affected by transforms. And WebGL doesn't have an overarching transform that is applied to everything. I don't see how you can have a drawing buffer that is not the requested size without the rendering coming out all wrong. If so, you're not helping the author by doing things behind his back.
> 
> For 99% of WebGL apps they should be using canvas.clientWidth and canvas.clientHeight as the dimensions for computing rendering aspect. Those will always be correct regardless of the backbuffer size.

I don't understand what you mean. clientHeight and clientWidth are the size in pixels of the canvas image on the page, which has nothing to do with the size of the drawing buffer. I believe there will be many uses for WebGL where the drawing buffer size is different from the client size for performance, etc.

-----
~Chris
cmarrin@apple.com




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