mirror of
https://github.com/juce-framework/JUCE.git
synced 2026-01-10 23:44:24 +00:00
DemoRunner: Disable OpenGL renderer when showing heavyweight demos and some misc code cleanup
This commit is contained in:
parent
ba130cdd8c
commit
d553cf62a6
4 changed files with 17 additions and 7 deletions
|
|
@ -249,6 +249,15 @@ MainComponent::MainComponent()
|
|||
demosPanel.showOrHide (false);
|
||||
#endif
|
||||
|
||||
if (isHeavyweight)
|
||||
{
|
||||
#if JUCE_MAC && USE_COREGRAPHICS_RENDERING
|
||||
setRenderingEngine (1);
|
||||
#else
|
||||
setRenderingEngine (0);
|
||||
#endif
|
||||
}
|
||||
|
||||
isShowingHeavyweightDemo = isHeavyweight;
|
||||
resized();
|
||||
});
|
||||
|
|
@ -393,13 +402,18 @@ void MainComponent::updateRenderingEngine (int renderingEngineIndex)
|
|||
{
|
||||
if (renderingEngineIndex == (renderingEngines.size() - 1))
|
||||
{
|
||||
if (isShowingHeavyweightDemo)
|
||||
return;
|
||||
|
||||
openGLContext.attachTo (*getTopLevelComponent());
|
||||
}
|
||||
else
|
||||
{
|
||||
openGLContext.detach();
|
||||
peer->setCurrentRenderingEngine (renderingEngineIndex);
|
||||
}
|
||||
|
||||
if (peer != nullptr)
|
||||
peer->setCurrentRenderingEngine (renderingEngineIndex);
|
||||
|
||||
currentRenderingEngineIdx = renderingEngineIndex;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue