LWJGL Forum

Programming => Lightweight Java Gaming Library => Topic started by: Bardolfo on June 26, 2005, 19:19:05

Title: [Beginner] Help on AWTGLCanvas
Post by: Bardolfo on June 26, 2005, 19:19:05
Hello to everybody!

I have a problem with LWJGL: I think I don't understand how the AWTGLCanvas repaint mechanism works.

I'm working on a simple game, using a game library called GTGE (http://goldenstudios.or.id/). I'm using an AWT Canvas as game area, so I'm very interested in using AWTGLCanvas.

This library makes all drawing operations using a Graphics2D object: (Graphics2D)canvas.getGraphics()

After I changed the AWT Canvas with the AWTGLCanvas, the drawings are painted ok, but the screen is horribly flashing.

In AWTTest example all the graphics are performed directly in method PaintGL(). According to GTGE game library author, a GL11.glFlush() in paintGL() should be sufficient to render all the graphical requests made via Graphics2D as I said before. But in this way the screen flashes...

Any suggestion? Does anyone has understood what I've written?  :D

Greetings from Italy!
Title: [Beginner] Help on AWTGLCanvas
Post by: Matzon on June 28, 2005, 20:19:56
I dont think you can mix and match Graphics2D painting and OpenGL painting.
Title: [Beginner] Help on AWTGLCanvas
Post by: Bardolfo on June 29, 2005, 21:08:28
So, is it possible to draw in a AWTGLCanvas "outside" the paintGL method?
Title: [Beginner] Help on AWTGLCanvas
Post by: Matzon on June 30, 2005, 05:50:47
not without unexpected behaviour