Access canvas in GLCanvasRender from LWJGL

Started by ErDetEnAnd?, September 28, 2008, 10:06:25 PM

Previous topic - Next topic

ErDetEnAnd?

Hello!

I need to paint on the canvas after it has been painted in lwjgl (when the canvas has been displayed and repainted from jpct). Does anyone have any ideas?

- Lwjgl suggests that one overrides the paint/paintGL method, but since the JPCT render gives the canvas this approach is not possible.

Thanks in advance.

EgonOlsen

You want to paint some GL related stuff to that canvas or some AWT stuff?


EgonOlsen

I'm not sure how well it works to combine them on one canvas...anyway, you can use an IPaintListener to execute your code in the AWT event thread: http://www.jpct.net/doc/com/threed/jpct/IPaintListener.html

ErDetEnAnd?

Drawing on canvas in IPaintListener.finishedPainting() using the graphics from the canvas, doesn't have any effect. However, using another canvas is sufficient.

EgonOlsen

Quote from: ErDetEnAnd? on September 30, 2008, 09:19:46 PM
Drawing on canvas in IPaintListener.finishedPainting() using the graphics from the canvas, doesn't have any effect. However, using another canvas is sufficient.
Fine. I'm not sure if it is supposed to work to paint into the GLRenderers graphics context...my uneducated guess would be, that it isn't.