Currently, when BufferStrategy::contentsLost occurs, Aya enters an infinite loop.
From the javadoc for contentsLost: 'Returns whether the drawing buffer was lost since the last call to getDrawGraphics.'
As far as I can tell, repainting does not cause the BufferStrategy to create a new Graphics instance / revalidate - so it remains true.
Removing the BufferStrategy showed no significant performance difference on my end and resolves this issue.
Alternatively, I have tried drawing to the BufferStrategy drawGraphics instead of the BufferedImage graphics, but that also gave no significant performance difference, so I've opted for the solution that removes code rather than adding some.
Currently, when BufferStrategy::contentsLost occurs, Aya enters an infinite loop.
From the javadoc for contentsLost: 'Returns whether the drawing buffer was lost since the last call to getDrawGraphics.'
As far as I can tell, repainting does not cause the BufferStrategy to create a new Graphics instance / revalidate - so it remains
true
.Removing the BufferStrategy showed no significant performance difference on my end and resolves this issue.
Alternatively, I have tried drawing to the BufferStrategy drawGraphics instead of the BufferedImage graphics, but that also gave no significant performance difference, so I've opted for the solution that removes code rather than adding some.