teichgraf's picture

TextureEnvMode Enum [fixed]

I am missing the GL_REPLACE value in the TextureEnvMode enum. TextureEnvMode.ReplaceExt = ((int)0X8062) has not the right value for GL_REPLACE:

#define GL_REPLACE 0x1E01

At the moment I use TextureEnvModeCombine.Replace, which has the right value (0x1E01).

GL.TexEnv(TextureEnvTarget.TextureEnv, TextureEnvParameter.TextureEnvMode, (float)TextureEnvModeCombine.Replace);

Is this intented?
Passing a value from the TextureEnvMode enum would make more sense to me, if TextureEnvParameter.TextureEnvMode is used in GL.TexEnv.

Or what did I mistake here?


Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
Inertia's picture

Confirmed, TextureEnvMode.ReplaceExt and TextureEnvModeCombine.Replace should both be 0x1e01. The problem could be that they're considered to be different by the generator (ext and core token). Thanks for pointing that out :)

teichgraf's picture

Why is the value named TextureEnvMode.ReplaceExt and not just TextureEnvMode.Replace, like in the OpenGL spec.?

the Fiddler's picture

Which specs?

TextureEnvMode enum:
	MODULATE					= 0x2100
	DECAL						= 0x2101
	use GetPName BLEND
	use EXT_texture REPLACE_EXT
	use AccumOp ADD
	use SGIX_texture_add_env TEXTURE_ENV_BIAS_SGIX


EXT_texture enum:
           REPLACE_EXT					= 0x8062

The only reference to REPLACE comes from StencilOp (which contains the correct value, 0x1E01). Yep, the specs are quite buggy :)

I'll fix this by hand, but it might be a good idea to log a bug at the khronos bugzilla.

teichgraf's picture

OK, my fault. With specs I meant the ManPage for gltexenv.

Inertia's picture

From http://opengl.org/registry/specs/EXT/texture.txt

Accepted by the parameter of TexEnvf, TexEnvi, TexEnvfv, and TexEnvfi when the parameter value is GL_TEXTURE_ENV_MODE


From http://opengl.org/registry/specs/ARB/texture_env_combine.txt

Accepted by the parameter of TexEnvf, TexEnvi, TexEnvfv, and TexEnviv when the parameter value is COMBINE_RGB_ARB or COMBINE_ALPHA_ARB



I found a sample that it should be 0x1e01 yesterday. Does this refer to the EXT_texture which was promoted to core in 1.2, or the stencil token? *confused*

the Fiddler's picture