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

Re: [Public WebGL] Move flipY and asPremultipliedAlpha parameters out of DOM helpers



On 20/05/2010 08:44, Cedric Vivier wrote:
> After looking/playing with the DOM helper signature for a while I
> believe that flipY and asPremultipliedAlpha should not be here :
> - they are 'alien' to the standard texImage2D signature (one could
> argue that this is the case for HTMLImageElement as well - but the
> whole point for the helper signatures imho is to help treat the DOM
> element parameter as if it was a proper *pixels pointer, this is
> easily guessable too even without knowing WebGL but only OpenGL).
> - behavior of flipY and asPremultipliedAlpha is not obvious when
> reading code, those two booleans after 'element' cannot be guessed
> without looking at documentation, worse, it is easy to forget or mix
> the order of the two arguments ...
>   

Another really good reason for moving flipy from the TexImage2D
signatures is that a future version of GL ES will provide this
functionality but as part of the pixel store parameters not the
TexImage2D command. Since this is a public forum, I can't say much more
about it.

The traditional way to avoid the confusion you mention is to use enums
or defines instead of true & false Another way to alleviate it is to put
both parameter name and type in the function signature. I don't know if
either are applicable to IDL.

Regards

    -Mark

begin:vcard
fn:Mark Callow
n:Callow;Mark
org:HI Corporation;Graphics Lab, Research & Development
adr:Higashiyama 1-4-4, Meguro-ku;;Meguro Higashiyama Bldg 5F;Tokyo;;153-0043;Japan
email;internet:callow_mark@hicorp.co.jp
title:Chief Architect
tel;work:+81 3 3710 9367 x228
tel;fax:+81 3 5773 8660
x-mozilla-html:TRUE
url:http://www.hicorp.co.jp,  http://www.mascotcapsule.com
version:2.1
end:vcard