Reputation: 883
For exampe, if I wanted to clear the color buffer, I would have to call:
glClearBufferfv(GL_COLOR, 0, color); //color is a float array of 4 numbers
But OpenGL also offers
glClearBufferiv(); //expects an int array
glClearBufferuiv(); //expects an unsigned int array
So why doesn't OpenGL use templates? Like so:
glClearBuffer<float>(...)
Upvotes: 1
Views: 195
Reputation: 13324
Because OpenGL is actually a C library, not C++. The reason you can use it in C++ is because one of the main design considerations in C++ is that it be able to use C code, but that comes with the inevitable circumstance that C APIs you use won't have nice C++ interfaces.
Upvotes: 7