Regarding this comment on the topic
"Vertex Attributes on shaders":
This is not a bad idea, but I don't think that it fits in SFML.
Just wondering whether this stance has changed any, since it's quite an old topic, apparently pre-2.0, and in the meantime there's been discussion of
several other enhancements to sf::Graphics, including shaders.
I've made similar modifications myself and noticed that any decent implementation practically requires direct modification to the
Shader class, because it needs the shader program name
m_shaderProgram after it's created but
before it gets compiled:
Active attributes that are not explicitly bound will be bound by the linker when glLinkProgram is called.
Binding them afterward has no effect until you relink the program, which
sf::Shader doesn't support (
compile() destroys any existing program), so subclassing
Shader isn't really an option. On the other hand, writing a new Shader class from scratch would duplicate a lot of code, and wouldn't integrate with the rest of SFML.
The commit is
here pending a pull request.
TL;DR: Yes, it's not extremely useful outside of "wrapping OpenGL," but it enables the use of custom shader attributes where needed, while taking advantage of the existing class and features without duplicating code.