From: Kenneth B. R. <kbr...@al...> - 2002-12-17 21:10:29
|
> I know the current recomendation is to use GLEventListener and not the > subclassing model, but the thing is i'm wanting to control when the canvas > is redrawn, not just have it redraw every so often. So, what I currently > have is a thread that spends most of its time outside my GLCanvas subclass > and then at the end of a cycle goes into that subclass and does > gljMakeCurrent(), draws, then does gljFree(). Given that this is how my > program works is there an advantage in changing to the GLEventListener > model? If i did change, should I still be using the makeCurrent/Free calls? You should use the GLEventListener model because it manages all of the context handling for you. gljMakeCurrent()/gljFree() should never be called in the listener model. Use repaint() on the GLCanvas to schedule a redraw. |