Inertia's picture

Enum: Texture Env Combine & Crossbar & Dot3(Version13) [done!]

http://www.opengl.org/registry/specs/ARB/texture_env_combine.txt
http://www.opengl.org/registry/specs/ARB/texture_env_crossbar.txt
http://www.opengl.org/registry/specs/ARB/texture_env_dot3.txt

        // add to Enum: TextureEnvMode
        Combine = ( (int) 0x8570 ),
 
        // add to Enum: TextureEnvParameter
        CombineRgb = ( (int) 0x8571 ),
        CombineAlpha = ( (int) 0x8572 ),
        Source0Rgb = ( (int) 0x8580 ),
        Source1Rgb = ( (int) 0x8581 ),
        Source2Rgb = ( (int) 0x8582 ),
        Source0Alpha = ( (int) 0x8588 ),
        Source1Alpha = ( (int) 0x8589 ),
        Source2Alpha = ( (int) 0x858a ),
        Operand0Rgb = ( (int) 0x8590 ),
        Operand1Rgb = ( (int) 0x8591 ),
        Operand2Rgb = ( (int) 0x8592 ),
        Operand0Alpha = ( (int) 0x8598 ),
        Operand1Alpha = ( (int) 0x8599 ),
        Operand2Alpha = ( (int) 0x859a ),
        RgbScale = ( (int) 0x8573 ),
        AlphaScale = All.AlphaScale, // was missing
 
 
// ------
// Please do NOT merge the enums below into a single one (see summaries why). Feel free to refactor as you think it fits best into your naming scheme.
// ------
 
 
        /// <summary>Accepted by GL.TexGen when the pname parameter value is CombineRgb or CombineAlpha.</summary>
        public enum TextureEnvModeCombine : int
        {
            // from Texenv Combine
            Replace = (int) All.Replace,
            Modulate = (int) All.Modulate,
            Add = (int) All.Add,
            AddSigned = ( (int) 0x8574 ),
            Interpolate = ( (int) 0x8575 ),
            Subtract = ( (int) 0x84e7 ),
            // from Texenv Dot3
            Dot3Rgb = ( (int) 0x86ae ),
            Dot3Rgba = ( (int) 0x86af ),
        }
 
        /// <summary>Accepted by GL.TexGen when the pname parameter value is Source0Rgb, Source1Rgb, Source2Rgb, Source0Alpha, Source1Alpha, or Source2Alpha.</summary>
        public enum TextureEnvModeSource : int
        {
            Texture = (int) All.Texture,
            Constant = ( (int) 0x8576 ),
            PrimaryColor = ( (int) 0x8577 ),
            Previous = ( (int) 0x8578 ),
 
            Texture0 = ( (int) 0x84c0 ),
            Texture1 = ( (int) 0x84c1 ),
            Texture2 = ( (int) 0x84c2 ),
            Texture3 = ( (int) 0x84c3 ),
            Texture4 = ( (int) 0x84c4 ),
            Texture5 = ( (int) 0x84c5 ),
            Texture6 = ( (int) 0x84c6 ),
            Texture7 = ( (int) 0x84c7 ),
            Texture8 = ( (int) 0x84c8 ),
            Texture9 = ( (int) 0x84c9 ),
            Texture10 = ( (int) 0x84ca ),
            Texture11 = ( (int) 0x84cb ),
            Texture12 = ( (int) 0x84cc ),
            Texture13 = ( (int) 0x84cd ),
            Texture14 = ( (int) 0x84ce ),
            Texture15 = ( (int) 0x84cf ),
            Texture16 = ( (int) 0x84d0 ),
            Texture17 = ( (int) 0x84d1 ),
            Texture18 = ( (int) 0x84d2 ),
            Texture19 = ( (int) 0x84d3 ),
            Texture20 = ( (int) 0x84d4 ),
            Texture21 = ( (int) 0x84d5 ),
            Texture22 = ( (int) 0x84d6 ),
            Texture23 = ( (int) 0x84d7 ),
            Texture24 = ( (int) 0x84d8 ),
            Texture25 = ( (int) 0x84d9 ),
            Texture26 = ( (int) 0x84da ),
            Texture27 = ( (int) 0x84db ),
            Texture28 = ( (int) 0x84dc ),
            Texture29 = ( (int) 0x84dd ),
            Texture30 = ( (int) 0x84de ),
            Texture31 = ( (int) 0x84df ),
        }
 
        /// <summary>Accepted by GL.TexGen when the pname parameter value is Operand0Rgb, Operand1Rgb, or Operand2Rgb.</summary>
        public enum TextureEnvModeOperandRgb : int
        {
            SrcColor = (int) All.SrcColor,
            OneMinusSrcColor = (int) All.OneMinusSrcColor,
            SrcAlpha = (int) All.SrcAlpha,
            OneMinusSrcAlpha = (int) All.OneMinusSrcAlpha,
        }
 
        /// <summary>Accepted by GL.TexGen when the pname parameter value is Operand0Alpha, Operand1Alpha, or Operand2Alpha.</summary>
        public enum TextureEnvModeOperandAlpha : int
        {
            SrcAlpha = (int) All.SrcAlpha,
            OneMinusSrcAlpha = (int) All.OneMinusSrcAlpha,
        }
 
        /// <summary>Accepted by GL.TexGen when the pname parameter value is RgbScale or AlphaScale.</summary>
        public enum TextureEnvModeScale : int
        {
            One = 1,
            Two = 2,
            Four = 4,
        }

Comments

Comment viewing options

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

Another OpenGL overload on parameter *type*. Works on C but almost nothing more strongly typed. Eh...

Inertia's picture

What I meant with the comments was, if you write code like this:

GL.TexEnv( TextureEnvTarget.TextureEnv, TextureEnvParameter.[pname]

then you can use intellisense to help you find what [param] enum is allowed by the chosen [pname].

Examples:

GL.TexEnv( TextureEnvTarget.TextureEnv, TextureEnvParameter.TextureEnvMode, (int) TextureEnvMode.Decal );

GL.TexEnv( TextureEnvTarget.TextureEnv, TextureEnvParameter.CombineRgb, (int) TextureEnvModeCombine.Interpolate );

GL.TexEnv( TextureEnvTarget.TextureEnv, TextureEnvParameter.Source0Rgb, (int) TextureEnvModeSource.Texture15 );

Imho the casting to int is ok, I just named the enums so it's better understandable which are valid parameters to use with the TextureEnvParameter you chose.