View Full Version : Count the GL functions used

05-08-2007, 10:24 AM
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 -lThere were 89 in my project. Removing the wc bit lists them.

05-08-2007, 03:44 PM
<pedantic mode on>
you can (at least on linux) use "sort -u" instead of "sort | uniq " for higher performance

05-08-2007, 08:39 PM
Or if on windows you can use GLIntercept and get it from the runtime:

http://www.opengl.org/discussion_boards/ubb/ultimatebb.php?ubb=get_topic;f=3;t=014930;p=1#0000 08

(assuming you call all functions you can use)