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

Re: [Public WebGL] gl.enable(gl.TEXTURE_2D)

On Wed, Jan 13, 2010 at 9:16 AM, Giles Thomas <giles.thomas@gmail.com> wrote:
Hi all,

Is gl.enable(gl.TEXTURE_2D) required by the spec to switch on texture support?  On the wiki, Gman just removed a line to that effect from the tutorial page, commenting that it's not valid WebGL; the spec seems to support this but there's some ambiguity.  Here's the diff:


On the one hand, the description of the enable method in the spec says that it's directly equivalent to the OpenGL ES 2.0 glEnable call, which does not list TEXTURE_2D as a valid value, which supports Gman's view.

On the other, the TEXTURE_2D constant is defined in the spec in a section called EnableCap, which also defines CULL_FACE, BLEND, and other constants that the ES 2.0 spec says are meant to be used with enable.

I've tried removing the enable() call from line from some of my own WebGL pages and tried them in Minefield and Chromium, and there's no obvious effect to having it there.

Any clarification much appreciated -- if it's not meant to be passed to gl.enable(), then I'd suggest that TEXTURE_2D should be moved elsewhere (perhaps to the TextureTarget section)

TEXTURE_2D is not a valid enable bit in OpenGL ES 2.0 or, consequently, WebGL. The enum was in the EnableCap section only because it was there in the OpenGL ES 2.0 headers. I've moved its definition to the TextureTarget section.