AWTGLCanvas demo?

Hi, I’d like to use the AWTGLCanvas class, is there some sample code around, or maybe some documentation beyond the relatively sparse javadocs?

What I’ve done so far is to subclass AWTGLCanvas, overriding paintGL() to render my scene. The first thing I do is to call makeCurrent(); I then check a private boolean flag that indicates whether the canvas has been resized. I also have an animator thread running that repeatedly calls repaint() on the canvas. However when I run this code I see no animation, and also the scene aspect ratio appears to be wrong (though I’m pretty sure my reshape handler code is setting up the correct aspect ratio)…

Many thanks for your help in advance!

Download the lwjgl source and look under the folder “\src\java\org\lwjgl\test\opengl\awt”. It has example code.

Thanks for that, and also I should point out my example didn’t run cos my OpenGL was horribly flawed :slight_smile: to my excuse I wrote this on the airplane…

Here is another example application. Used within a full function swing app.
http://lwjgl.org/forum/viewtopic.php?t=1451