PDA

View Full Version : C++ Builder and disappearing OpenGL rendering



soconne
01-24-2005, 03:38 PM
I'm using C++ Builder and for some reason when I change the borderstyle of my form OpenGL stops rendering completely. I have a form with a TPanel on it and all rendering is done on the TPanel. But when I change the borderstyle of the form, from lets say Sizeable to None, the TPanel turns completely white.

Anybody know why this is ?

Antorian
01-28-2005, 11:55 PM
I made my apps in C++ Builder (with OpenGL)... I had the same problem when starting:
TPanel must be refreshed (OnPaint event) when Form is Modified because:
1- your panel object is only "linked" with your Form and events are not shared.
2- OnPaint action leads to call Object drawing method (that is not your OpenGL drawing method)

I think you use HWND properties to extract context for OpenGL....
If it's in this way, you should use OnPaint Method and HWND of the Form to draw your OpenGL Scene and get all refresh events working.
If you want to use Panel's OnPaint Event, you must catch all events coming and draw your scene each time (that's not good).Or get a way to store your last frame rendered in the TPanel properties (that means you do your own TPanel Class)

I don't kkonw if I'm clear... :)