Wrapping OpenGL: Is there a more general glUniform function?
I'm trying to create a Python API that wraps OpenGL in some fairly convenient ways. For example:
program.uniforms["world"] = transform.gl_matrix
Converting from Python to the appropriate C pointer is relatively easy, but the fact that there's a different glUniform* function for each and every GLSL type ... that's somewhat troublesome, because (unless there's a better way) I'll have to wrap each and every glUniform* function.
Now, I can write a script to auto-generate that wrapping, but I would really prefer something like this:
void glUniform(GLint loc, GLsizei size, GLvoid* data)
Basically, a function that would just take the data, and stuff it into the uniform (if the sizes match); something that doesn't require calling a completely different function for what is essentially a float*.
Does something like that exist, or is there some other way to do this?
Any insight would be appreciated.