It sounds like a stupid question.
I saw this variable is used in an online tutorial and in the book “OpenGL Shading language,” but I can not find what it means, no matter from google, the book, or even glsl specification. I know it’s the texture coordinates which would be interpolated in fragment shader, but how about the “st” part? And what else variables are there in its structure.
As you saif, gl_TexCoord is the variable of texture coordinate sets. The “st” part you wonder about, is part of swizzle mask. The swizzle mask let you recombine your vector. The texture coordinates are four-component vectors, but st mask selects the first two (you can use “xy”, it would be the same). Look into GLSL specification, it is explained well there.
Is it preferable to use gl_TexCoord or just make your own varying variable and pass a texture coordinate from the vertex shader to the fragment shader? Or is it the case, if you only have a vertex shader that gl_TexCoord will interact with the fixed pipeline?
But there is still fixed-function pipeline from the APi point of view… I would like to see it removed as soon as possible, all that Light, material, Vertex* calls etc. I hope the new releases will bring this changes…