May be it's a little misunderstanding. I'm trying to find out why this particular bit of code takes 30 milliseconds of time.
I call clock() function right before Flip(0), and than, right after Flip(0) i call clock() again. Difference between this two moments in time is 30 milliseconds. That means that Flip(0) function is slowing down the programm.
Basically, programm looks like this
int main( int argn, char* argv[] ){
// some initialization code
while( !KeyHit() && !AppTerminate() ) // main loop
start = clock();
//=====================================
// A lot of rendering code
//=====================================
printf("rendering time: %d\n", clock()-start);
// the result in output window is around 11-12
start = clock();
Flip(0);
printf("flip time: %d\n", clock()-start);
// the result in output window is around 29-30
}
}
So Flip(0) function takes more time then all the rendering code. How can it be? Why Flip(0) function takes so long to process?
I have a guess, that Flip(0) is so slow, because of using a lot of different buffers of different size, can it be a problem? Does Flip(0) clear all the buffers when called or something like that?