OpenGLContext::setComponentPaintingEnabled with a context


#1

Happy New Year everyone!

quick question, `OpenGLContext::setComponentPaintingEnabled’ insists the context is not already attached, but actually it doesnt really matter (or does it?).

I’ve been changing the mode between painting enabled and disabled with an attached context and it seems to work ok (after removing the test of course).

Is there a good reason to prevent this. The reason im doing this is because i only have 2D components mixed with 3D some of the time and it’s more efficient to disable the 2D paint when only 3D is needed.

thanks,
– hugh.


#2

Happy new year!

Yes, should be ok to turn that on and off. The reason it’s optional is that when it’s doing 2D, it needs to use the MessageManagerLock to block the event thread every time it draws, while it does the component rendering. So if you’re only using it for 3D, then it’s more efficient to avoid that locking.