Setting OpenGL context in the dtor of a wxGLCanvas derived class

Chris Mellon arkanes at gmail.com
Mon Oct 1 13:16:13 PDT 2007


On 10/1/07, Richard <legalize+jeeves at mail.xmission.com> wrote:
>
> [Please do not mail me a copy of your followup]
>
> luca.cappa at sequoia.it ("Luca Cappa") spake the secret code
> <op.tzicx2ktr4jy9l at computery> thusly:
>
> >On Fri, 28 Sep 2007 22:33:54 +0200, Richard
> ><legalize+jeeves at mail.xmission.com> wrote:
> >> What sort of "OpenGL cleanup" are you doing?
> >
> >I am destroying the textures I used for the glyph's font (calling
> >glDeleteTextures), and if the context is not the right one, i will end up
> >deleting the textures of another wxGLCanvas :-) which will be drawn with
> >all flat coloured quads :)
>
> That's what I suspected; this might be a deficiency in the wxGLCanvas
> model here, based on simplistic usage.  How to correct it would be an
> interesting design problem.  I can think of several ways to address it
> depending on how "intrusive" you want wxGLCanvas to be.  Maybe the
> simplest thing to do is override one of its methods, or provide a new
> virtual method call at the right place and let the default
> implementation do nothing, but an application could override it to get
> the right behavior.
> --

Doing this in an overriden Destroy() should be soon enough.




More information about the wx-users mailing list