Reputation: 16842
Is there anything easy and simple to profile functions in C++/OpenGL? All I could find was gDEBugger. Looking through the documentation I can't find a way to do what I want. Let me explain...
As I've said in other questions, I have a game with defense towers. Currently they are just 3 but this number is configurable. I have a single draw function for all the towers (this function may call other functions, doesn't matter) and I would like to profile this single function (for 3 towers and then increase the number and profile again). Then I would like to implement display lists for the towers, do the same profiling and see if there was any benefit on using display lists for this specific situation.
What profiling tool do you recommend for such a task? If it matters, I'm coding OpenGL on Windows with Visual Studio 10. Or can this be done with gDEBugger? Any pointers?
P.S: I'm aware that display lists were removed on OpenGL 3.1, but the above is just an example.
Upvotes: 4
Views: 1123
Reputation: 52083
NVidia has one, so does AMD. And for Intel.
For coarse-grained monitoring you can measure the time it takes to execute a frame from the beginning to after your buffer swap or glFlush()
/glFinish()
:
while( running )
{
start_time = GetTimeInMS();
RenderFrame();
SwapGLBuffers();
end_time = GetTimeInMS();
cout << "Frame time (ms): " << (end_time - start_time) << end;
}
Upvotes: 3