PDA

View Full Version : Count the GL functions used



rlk
05-08-2007, 09: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.

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

sqrt[-1]
05-08-2007, 07: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)