Count the GL functions used

This is a little frivolous, but what the hell. I was curious to know the actual number of unique OpenGL API entry points I had referenced in a particular project, including extensions. Yes, this is useless information. Here’s a command line I worked out. This works under Linux and OSX, and probably Cygwin.

grep -ho '\<gl[A-Z]\w*\>' *.cpp | sort | uniq | wc -l

There were 89 in my project. Removing the wc bit lists them.

<pedantic mode on>
you can (at least on linux) use “sort -u” instead of "sort | uniq " for higher performance

Or if on windows you can use GLIntercept and get it from the runtime:;f=3;t=014930;p=1#000008

(assuming you call all functions you can use)