How can I find missing glPopMatrix() in Visual Studio

I have a theory according to which the bugs I'm experiencing are due to a glPushMatrix() beign used without a matching glPopMatrix(). My project is rather big so I would like to be able to find these missing glPopMatrix() easily. I thought of using a search using regular expression, but I can't seem to find out how to find what I want (plus, regexp in visual studio isn't exactly the same as what I'm used to (php) so I'm a bit lost. Anyways, any ideas on how to do this?


You can verify your theory by checking if glGetError() returns GL_STACK_OVERFLOW at some point.

To find the missing references, I cannot think of anything better than to run a full-text search on your project for glPushMatrix and try to find the corresponding glPopMatrix for every one of them.

Or there's one more solution:

You can use an OpenGL debugger like GLIntercept (which comes in the form of an altered opengl32.dll file and dumps a lot of useful information, including all the OpenGL commands which were executed (there can be a flat log or a single-frame log of them). This can give you a good view on what went wrong and when.

Need Your Help

How would you limit the number of operations per second?

c# .net

How would you limit the number of operations per second?

Reading a web page in a foreign language with StreamReader

c# http encoding streamreader

I'm trying to fetch a web page that is a mix of English and Korean. The browser can fetch and display the page just fine, but when I try to grab it programmatically I can't get the Korean character...

About UNIX Resources Network

Original, collect and organize Developers related documents, information and materials, contains jQuery, Html, CSS, MySQL, .NET, ASP.NET, SQL, objective-c, iPhone, Ruby on Rails, C, SQL Server, Ruby, Arrays, Regex, ASP.NET MVC, WPF, XML, Ajax, DataBase, and so on.