Question

I'm using NSOpenGLContext to optimize drawing AU plugins. There are multiple plugins and each can have multiple instances. So each plugin creates a global NSOpenGLContext and attach particular NSView contexts to it, so that the textures do not need do be duplicated.

Problem: When I open one plugin, it's ok. I open a different on, it's ok. Now I release the first one, it destroys all resources => the second one looses its textures!

I checked that both context are different, sharing is different, they both use makeCurrentContext in both lockFocus and drawRect. Any ideas what is wrong here?

Btw.I got the same thing working using AGL and WGL (on Windows), both without problems, so it is just Cocoa as usual.

Was it helpful?

Solution

Ok I think I found a solution - one needs to call [NSOpenGLContext clearCurrentContext]; after any painting or any processing. Why? No idea... I'm considering it yet another bug in Mac OS X...impossible pseudosystem...

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top