Do you have any applications running in the background that could be causing the drawing surface to become invalidated?
i don’t think so, the flickering looks always the same, regardless of what program are running
also, immediately after you call show() on BufferStrategy, are you checking for BufferStrategy.contentsLost()?
nope
What color does the screen flicker to? is it garbage, or is it white?
it’s not a color or something. i had a closer look and saw that it seems to be parts of the old frame.
When calling createBufferStrategy, I presume you are passing in a value greater than 1.
yes, the value is 2. with 1 i had a horrible fullscreen flicker. much worse than the actual one.
Is createBufferStrategy failing? (due to insufficient gfx memory)
This would result in any calls to getBufferStrategy() returning the default BufferStrategy that has no back buffer.
as mentioned above it appears that i do have 2 buffers. it’s just a slight flickering.
is BufferStrategy.show() actually vsyncing? (driver/setting dependant)
Youcan test this by performing a tight loop on BufferStrategy.show() and seeing how many loops/second it achieves,
it should be equal to the refreshrate of your monitor/gfx card.
don’t know if i got you right. i did this:
long strategyStart = SystemTimer.getTime();
int strategyCount = 0;
while (SystemTimer.getTime() - strategyStart < 1000) {
strategyCount++;
strategy.show();
}
System.out.println("####### strategy counter: " + strategyCount + ", time: " + (SystemTimer.getTime() - strategyStart) + " ms");
System.exit(0);
the output was:
####### strategy counter: 2033, time: 1191 ms