Hi all,
a lot of time has passed since I was into java game development, but now I need some update
(of the last years

).
For the basics in active rendering and fullscreen/ windowed mode I looked into Kevs example of
Space Invaders. What confuses me is the way of using the graphic components. In his example
is basically this:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25
| public class Game extends Canvas .... public Game() { JFrame container = new JFrame("Space Invaders 101"); JPanel panel = (JPanel) container.getContentPane(); panel.setPreferredSize(new Dimension(800,600)); panel.setLayout(null); setBounds(0,0,800,600); panel.add(this); setIgnoreRepaint(true); createBufferStrategy(2); strategy = getBufferStrategy(); } |
My main problem is to understand which component specifies the graphical configuration (rendering
method, acceleration etc). In the example the configuration is made for the canvas, not for the top
level Container. Is this enough to activate direct rendering? Should'nt the Jframe setIgnoreRepaint(true)?
Could something happen like an embedded component is configured for active rendering and creates
the suitable Bufferstrategy but the enclosing Component (in this case the JFrame) is running in passive
rendering mode? That would mess up both strategies ..