static const GLfloat boxSpeed = 1.25f; // per second
// profiler
-enum ProfilerState { statePreRender, stateDraw, statePresent, statePostRender, stateOutsideRender, numProfilerStates };
-static const char *profilerStateNames[numProfilerStates] = { "Pre-Render", "Drawing", "Presenting", "Post-Render", "Outside renderer"};
+enum ProfilerState { statePreRender, stateClear, stateDraw, statePresent, statePostRender, stateOutsideRender, numProfilerStates };
+static const char *profilerStateNames[numProfilerStates] = { "Pre-Render", "Clearing", "Drawing", "Presenting", "Post-Render", "Outside renderer"};
// utility functions
static double getTime()
}
lastFrame = time;
//////////////////////////////////////////////
- profilerTick(stateDraw);
+ profilerTick(stateClear);
if (overdraw) {
- glBegin(GL_QUADS);
// clear manually
+ glBegin(GL_QUADS);
glColor3f(0.0f, 0.0f, 0.0f);
drawRect(0, 0, 1, 1);
+ glEnd();
}
else {
glClear(GL_COLOR_BUFFER_BIT);
- glBegin(GL_QUADS);
}
+ //////////////////////////////////////////////
+ profilerTick(stateDraw);
+ glBegin(GL_QUADS);
glColor3f(0.8f, 1.0f, 0.75f);
drawRect(boxPos, 0, boxPos+boxWidth, 1);
glEnd();
double stateTime[numProfilerStates];
};
-
-
int main(int argc, char ** argv)
{
// program options handling