-enum ProfilerState { statePreRender, stateClear, stateDraw, statePresent, statePostRender, stateOutsideRender, numProfilerStates };
-static const char *profilerStateNames[numProfilerStates] = { "Pre-Render", "Clearing", "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"};
const double elapsed = time-lastDisplay;
if (elapsed >= 3) {
printf("%.1f fps, time spent: ", framect/elapsed);
const double elapsed = time-lastDisplay;
if (elapsed >= 3) {
printf("%.1f fps, time spent: ", framect/elapsed);
if (i != 0) printf(", ");
printf("%s %.1f%%", profilerStateNames[i], stateTime[i]/elapsed*100);
}
if (i != 0) printf(", ");
printf("%s %.1f%%", profilerStateNames[i], stateTime[i]/elapsed*100);
}
glBegin(GL_QUADS);
glColor3f(0.8f, 1.0f, 0.75f);
rectQuad(boxPos, 0, boxPos+boxWidth, 1);
glEnd();
usleep(sleep_time*1000);
//////////////////////////////////////////////
glBegin(GL_QUADS);
glColor3f(0.8f, 1.0f, 0.75f);
rectQuad(boxPos, 0, boxPos+boxWidth, 1);
glEnd();
usleep(sleep_time*1000);
//////////////////////////////////////////////
if (copy) {
glDrawBuffer(GL_FRONT);
glCopyPixels(0, 0, getWidth(), getHeight(), GL_COLOR);
if (copy) {
glDrawBuffer(GL_FRONT);
glCopyPixels(0, 0, getWidth(), getHeight(), GL_COLOR);
GLfloat boxPos, boxDirection;
// FPS, profiler
double lastDisplay, lastProfile;
GLfloat boxPos, boxDirection;
// FPS, profiler
double lastDisplay, lastProfile;