CGContextFlush: invalid context with awt.Toolkit and awt.Graphics - Printable Version
+- iDevGames Forums (http://www.idevgames.com/forums)
+-- Forum: Development Zone (/forum-3.html)
+--- Forum: Graphics & Audio Programming (/forum-9.html)
+--- Thread: CGContextFlush: invalid context with awt.Toolkit and awt.Graphics (/thread-3258.html)
CGContextFlush: invalid context with awt.Toolkit and awt.Graphics - Tools10 - Jun 6, 2007 02:02 PM
Anyone have any idea whatsoever what this is all about.
This is more or less the graphic part of the program
The image is a 40x40 png created with Pixen 3.0.
The strange thing is that the first time I attempt to draw the image I will always get a "CGContextFlush: invalid context" message in the console, however, if I use getBufferStrategy().show() again it will paint the image without complaints, most of the times at least.
Sometimes it just refuses to draw anything at all.
Should point out that it's only the images loaded with Toolkit.createImage that behaves strangely, any graphic operation used on Images created with Component.createImage works fine and without any errors.
Anyone got any idea of what this is all about?
Thankful for any suggestions or input.
Here is a working code if anyone feel like testing what happens.
Not a pice of art but it should get the work done, the loop will repaint the image.
CGContextFlush: invalid context with awt.Toolkit and awt.Graphics - Tools10 - Jun 10, 2007 04:07 PM
Tried to draw all Images to a off-screen Image instead of directly to the frame.
Works fine, if anyone got a clue why please tell because I really can't explain this and I'm unable to find a reason in the documentation.