I recently moved a large program from Delphi over to Lazarus. Most of the bugs are sorted out, and I'm thoroughly impressed with Lazarus / FPC. But there's one bug I can't quite figure out.
My application has a main OpenGL window, and a few supplementary forms. Originally, I designed these forms using the Delphi VCL, and now I've moved them over to the Lazarus LCL.
Edit: The OpenGL window is NOT an LCL form at the moment. It is implemented using calls to Win32, and has it's own message loop.
All of the forms are considered children of the main OpenGL Window, as per this line of code:
Form.ParentWindow := OpenGLWindow.h_wnd;
Unfortunately, when the forms are owned by the OpenGL window, they simply disappear. Of course, the OpenGL window gets refreshed at a 30fps framerate, and this is causing a screenbuffer problem. The forms are rendering, and then being rendered on top of by the OpenGL window.
The problem is resolved if the forms are not owned by the main window. Unfortunately, changing the ownership is pretty disruptive to end users (menus get lost behind the program, etc).
So I'm wondering, where do I start with a problem like this? Do I need to ensure that the forms have their own screenbuffers to render inside of, or is that the wrong idea?
To clarify a few things: I'm using the Win32 version of the LCL, not QT or anything like that. Also, I tried setting the forms to be double-buffered, to see if it would help, but it didn't.