mirror of
https://github.com/juce-framework/JUCE.git
synced 2026-01-10 23:44:24 +00:00
Fixes to allow OpenGL contexts to be attached to a top-level component.
This commit is contained in:
parent
d1f841b1ec
commit
074a8c05dd
2 changed files with 10 additions and 9 deletions
|
|
@ -1810,6 +1810,14 @@ void Component::internalRepaintUnchecked (const Rectangle<int>& area, const bool
|
|||
{
|
||||
if (flags.visibleFlag)
|
||||
{
|
||||
if (cachedImage != nullptr)
|
||||
{
|
||||
if (isEntireComponent)
|
||||
cachedImage->invalidateAll();
|
||||
else
|
||||
cachedImage->invalidate (area);
|
||||
}
|
||||
|
||||
if (flags.hasHeavyweightPeerFlag)
|
||||
{
|
||||
// if component methods are being called from threads other than the message
|
||||
|
|
@ -1823,14 +1831,6 @@ void Component::internalRepaintUnchecked (const Rectangle<int>& area, const bool
|
|||
}
|
||||
else
|
||||
{
|
||||
if (cachedImage != nullptr)
|
||||
{
|
||||
if (isEntireComponent)
|
||||
cachedImage->invalidateAll();
|
||||
else
|
||||
cachedImage->invalidate (area);
|
||||
}
|
||||
|
||||
if (parentComponent != nullptr)
|
||||
parentComponent->internalRepaint (ComponentHelpers::convertToParentSpace (*this, area));
|
||||
}
|
||||
|
|
|
|||
|
|
@ -113,6 +113,7 @@ public:
|
|||
unsigned int getFrameBufferID() const noexcept { return 0; }
|
||||
|
||||
private:
|
||||
Component dummyComponent;
|
||||
ScopedPointer<ComponentPeer> nativeWindow;
|
||||
HGLRC renderContext;
|
||||
HDC dc;
|
||||
|
|
@ -137,7 +138,7 @@ private:
|
|||
void createNativeWindow (Component& component)
|
||||
{
|
||||
Component* topComp = component.getTopLevelComponent();
|
||||
nativeWindow = createNonRepaintingEmbeddedWindowsPeer (&component, topComp->getWindowHandle());
|
||||
nativeWindow = createNonRepaintingEmbeddedWindowsPeer (&dummyComponent, topComp->getWindowHandle());
|
||||
updateWindowPosition (topComp->getLocalArea (&component, component.getLocalBounds()));
|
||||
nativeWindow->setVisible (true);
|
||||
dc = GetDC ((HWND) nativeWindow->getNativeHandle());
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue