[Beginner] Help on AWTGLCanvas

Started by Bardolfo, June 26, 2005, 19:19:05

Previous topic - Next topic

Bardolfo

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!

Matzon

I dont think you can mix and match Graphics2D painting and OpenGL painting.

Bardolfo

So, is it possible to draw in a AWTGLCanvas "outside" the paintGL method?

Matzon

not without unexpected behaviour