void OpenGLComponent::triggerRepaint() { // you mustn't set your own cached image object for an OpenGLComponent! jassert (cachedImage == nullptr || dynamic_cast<OpenGLCachedComponentImage*> (getCachedComponentImage()) == cachedImage); if (cachedImage == nullptr) setCachedComponentImage (cachedImage = new OpenGLCachedComponentImage (*this)); cachedImage->triggerRepaint(); }
//============================================================================== OpenGLComponent::OpenGLComponent (const int flags_) : flags (flags_), contextToShareListsWith (nullptr), needToUpdateViewport (true), needToDeleteContext (false), threadStarted (false), needToRepaint (true) { setOpaque (true); setCachedComponentImage (cachedImage = new OpenGLCachedComponentImage (*this)); componentWatcher = new OpenGLComponentWatcher (*this); }
void OpenGLComponent::deleteContext() { const ScopedLock sl (contextLock); if (context != nullptr) { if (context->makeActive()) { setCachedComponentImage (nullptr); releaseOpenGLContext(); context->makeInactive(); } context = nullptr; } needToDeleteContext = false; }