Setting OpenGL context in the dtor of a wxGLCanvas derived class

Luca Cappa luca.cappa at sequoia.it
Fri Sep 28 08:37:38 PDT 2007


Hello,

On Fri, 28 Sep 2007 16:29:26 +0200, Mehamli, Tristan <tmehamli at mc.com>  
wrote:
> why not
> call a function that does the gl clean up and then call the destructor.
> If this can be possible with your implementation (I'm doing something
> similar) of course.

This is definitely a good idea, unfortunately I do not have any other  
chance but the destructor.
Maybe I could be wrong here, but I thought about a place/time I could  
trigger the OpenGL cleanup (before the
destructor of course), but I have not been able to come up to anything:  
indeed my wxGLCanvas derived class is destoyed by a call to Destroy(),  
which is the way a wxAuiNotebook destroy its child pages, and I do not  
have a chance to execute anything in the EVT_CLOSE handler.

Luca




More information about the wx-users mailing list