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

Re: [Public WebGL] texParameteri and texParameterf

----- Original Message -----
> On Thu, Aug 5, 2010 at 11:30 AM, Benoit Jacob <bjacob@mozilla.com>
> wrote:
> > Hi,
> >
> > Do you think that texParameteri and texParameterf could be merged
> > into a single texParameter method that would interprete its 'param'
> > argument either as an int or as a float, depending on the 'pname'
> > argument' ?
> >
> > Maybe that would be more in line with the rest of our API, and more
> > javascript-ish?
> >
> > Note that in standard OpenGL ES / WebGL there is currently no float
> > parameter at all, although extensions might add some.
> I'm pretty sure there was a specific reason we preserved the i and f
> suffixes -- some parameters which can accept either an integer or
> floating point value and have slightly different semantics.

Thanks for the speedy answer. I have one more question: what should be the behavior when calling texParameterf with a pname that expects an integer value?
 1. should it just fail with INVALID_ENUM?
 2. or should it succeed provided that the float param happens to be integral (e.g. 123.000f)?

I feel much in favor of 1. and what you say above seems to go in this direction, since you say that some pname might eventually have different semantics in texParameterf. But I just need to ask, because WebKit's current implementation is apparently allowing the int pnames with texParameterf,


> Jon Leech
> would probably remember exactly which ones. They might exist only in
> desktop GL. Regardless, I think we should preserve both entry points,
> because in JavaScript it's impossible in all cases to determine
> whether a given number is supposed to be treated semantically as an
> integer or floating-point value.
> -Ken
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: