mirror of
https://github.com/juce-framework/JUCE.git
synced 2026-01-22 01:34:21 +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
|
|
@ -105,7 +105,7 @@ void registerDemos_One() noexcept
|
|||
REGISTER_DEMO (OscillatorDemo, DSP, false)
|
||||
REGISTER_DEMO (OverdriveDemo, DSP, false)
|
||||
#if JUCE_USE_SIMD
|
||||
REGISTER_DEMO (SIMDRegisterDemo, DSP, false)
|
||||
REGISTER_DEMO (SIMDRegisterDemo, DSP, false)
|
||||
#endif
|
||||
REGISTER_DEMO (StateVariableFilterDemo, DSP, false)
|
||||
REGISTER_DEMO (WaveShaperTanhDemo, DSP, false)
|
||||
|
|
|
|||
|
|
@ -111,7 +111,7 @@ DemoContentComponent::DemoContentComponent (Component& mainComponent, std::funct
|
|||
addTab ("Code", Colours::transparentBlack, codeContent = new CodeContent(), false);
|
||||
#endif
|
||||
|
||||
addTab ("Settings", Colours::transparentBlack, new SettingsContent (dynamic_cast<MainComponent&> (mainComponent)), true);
|
||||
addTab ("Settings", Colours::transparentBlack, new SettingsContent (dynamic_cast<MainComponent&> (mainComponent)), true);
|
||||
|
||||
setTabBarDepth (40);
|
||||
lookAndFeelChanged();
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -30,10 +30,6 @@
|
|||
#include "DemoContentComponent.h"
|
||||
|
||||
//==============================================================================
|
||||
/*
|
||||
This component lives inside our window, and this is where you should put all
|
||||
your controls and content.
|
||||
*/
|
||||
class MainComponent : public Component
|
||||
{
|
||||
public:
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue