I looked up some other C++ libraries that wrap OpenGL shaders, and these are the two best-looking parameter binding interfaces I found:
http://oglplus.org/oglplus/html/classoglplus_1_1Uniform.htmlhttps://github.com/Overv/OOGL/blob/master/include/GL/GL/Program.hppI saw several other libraries and classes out there, but most of them support significantly fewer overloads/permutations than we want, so they wouldn't be good references.
Some trends I noticed that are relevant to the previous discussion:
- Everyone treats matrices as a special case. The non-template interfaces have overloads for matrices of specific sizes, and the template interfaces have a separate function for matrices.
- I don't think anybody supports arrays of matrices. However, the types in oglplus' interface are painfully obtuse so I can't be sure.
- Everyone seems to offer a pointer/size interface for parameter arrays, even if they also provide overloads taking std::vectors or other containers.
- Everyone seems to have vector and matrix classes for all the sizes they support. I never saw a pointer/width/height interface for matrices. Admittedly, they are wrapping *all* of OpenGL, and the two I linked above appear to support non-trivial math on their vector/matrix classes.
- And of course, "setUniform" and variants thereof are by far the most popular names for these functions.
Hope this helps.
P.S. Aside from adding yet another dependency, would there be any real downside to incorporating glm in SFML 3? (presumably with some typedefs so users don't need to explicitly use the glm namespace)