I was profiling my engine a bit and found out something weird…
BufferCapabilities bc=gc.getBufferCapabilities();
if(bc.isPageFlipping() && bc.getFlipContents()==BufferCapabilities.FlipContents.PRIOR){
window.createBufferStrategy(2,new BufferCapabilities(
new ImageCapabilities(true),
new ImageCapabilities(true),
BufferCapabilities.FlipContents.PRIOR));
System.out.println("prior");
}
I m creating bufferstrategy on my fullscreen awt frame. As far as i know this code is good…correct me if i m wrong.Still profiling resluts werent nice(cpu usage was like 90%).Then i just messed with the code and changed the line
BufferCapabilities.FlipContents.PRIOR));
to
BufferCapabilities.FlipContents.COPIED));
. The results were really unexpected-cpu usage was below 15%?!??!?!?!?
Can any1 explain how is this possible?I mean i can understand that bliting may be faster in the case of my comp, but damn method getFlipContents returned prior…:S
Computer is laptop 1.4ghz celeron,768 ram, integrated graphics card.
Tnx in advance.