How to make AWT GLCanvas stop drawing everything at bottom left of parent window
In my program, I have an AWT GLCanvas whose bottom left corner is above/to the right of the bottom left corner of its window ancestor.
Nevertheless, it draws over components to the left of and below it all the way to the left and bottom edges of the window. Even if I change the glViewport coordinates or use a framebuffer and change the coordinates I blit to, it does this.
I can't see how anything other than the bottom left corner of the GLCanvas being the 0, 0 point of the OpenGL context's screen coordinates would be the expected behavior.
How can I make it not draw over the left/bottom portions of the window contents?
Re: How to make AWT GLCanvas stop drawing everything at bottom left of parent window
I don't get it, I can't reproduce these issues in a minimal from-scratch project. What could I be doing wrong? I made a timer print out the bounds of the of the canvas, and they don't match where openGL is drawing on screen. I'm doing glViewport in exactly the same way.
Re: How to make AWT GLCanvas stop drawing everything at bottom left of parent window
Argh...the problem appears to be that the GLCanvas/NewtCanvasAWT were created on the EDT. When they were created on the system main thread, I couldn't reproduce the problem.
Swing components are generally supposed to be created on the EDT, so this is a bug. I'll file a report later...
Re: How to make AWT GLCanvas stop drawing everything at bottom left of parent window
Actually, that wasn't correct. The JFrame containing the GLCanvas or NewtCanvasAWT merely needs to be setVisible on the EDT (i.e. AWT event dispatch thread) for the bug to occur; if it's set visible on the main thread then the bug doesn't occur.