Active Rendering, flickering

Hello there,

for a school project we require to build some game. I wanted to use active rendering and created a ‘Window’ class for that. The goal would be to pass an instance of it to a ‘Game’ class which would then ‘draw itself onto it’. I am not sure if this is the correct approach though.

Anyway the problem is that my application is flickering, I am not sure but can it be the primary and backbuffer? Anyway here is my code: https://gist.github.com/anonymous/d55b329f77f9f3a75ef1ff93044874e6. On line 87 of Window2.java you will have to pass ‘true’ as second parameter, that will create the flickering. Also if I call setIgnoreRepaint(true) on my frame BEFORE I initialize the canvas, it does not flicker. If then I additionally do the same for the canvas, it flickers again. Also can someone confirm that this works fine too as it is?.. I guess I do not entirely understand how AWT works in detail so I am not sure if paint() is still called… I used to create a JPanel and simply overriden paintComponent :stuck_out_tongue:

Thankyou for your help :slight_smile: