From: Kenneth B. R. <kbr...@al...> - 2002-02-10 04:27:41
|
> My first gl4java application was written using the old > model where you derive from GLAnimCanvas. I have > just ported it to the new model where I just implement > GLEventListener. It all works fine with one exception: > > For the very first frame display() is called > before reshape(). Reshape is then called for the second > frame and all is good. However it is custom in all > the OpenGL implementations I have seen to call the > equivalent of reshape() before any calls to display(). > So I think this is a bug. > > A workaround is simply to call reshape() as the last > instruction in init(). It looks like I may have introduced this bug with the "automatic" disabling of AWT thread rendering. There is some tricky logic inside GLCanvas (which is only enabled when the actual canvas is a GLAnimCanvas) to cause init(), display(), reshape(), etc. to always be called on the GLAnimCanvas's internal thread and never on the AWT event queue thread. This is done for performance and stability reasons. Because of this logic, the first time a display() is done (actually sDisplay()) the resize is deferred for a frame. Could you send me a small test case illustrating the problem (i.e., with printlns)? |