mirror of
https://github.com/juce-framework/JUCE.git
synced 2026-01-09 23:34:20 +00:00
DemoRunner: Avoid attempting to nest OpenGL contexts
OpenGL contexts normally can't be nested. Previously, when the main
renderer for the DemoRunner was set to OpenGL, we would forcibly reset
the engine to the software renderer when displaying any heavyweight
demo, including the OpenGL demos.
19061e6d introduced a regression, where the rendering engine was no
longer reset on Windows, so displaying an OpenGL demo while the global
renderer was also set to OpenGL would cause an assertion to fire in the
OpenGL Graphics context, after which rendering would fail.
With this change in place, we now fall back to the Direct2D renderer,
instead of the software renderer, when displaying a heavyweight demo.
This commit is contained in:
parent
2f0b287ce7
commit
b15b65decf
1 changed files with 6 additions and 4 deletions
|
|
@ -286,11 +286,13 @@ MainComponent::MainComponent()
|
|||
|
||||
if (isHeavyweight)
|
||||
{
|
||||
#if JUCE_MAC && USE_COREGRAPHICS_RENDERING
|
||||
setRenderingEngine (1);
|
||||
#elif ! JUCE_WINDOWS
|
||||
setRenderingEngine (0);
|
||||
#if (JUCE_MAC && USE_COREGRAPHICS_RENDERING) || JUCE_WINDOWS
|
||||
constexpr auto fallbackEngine = 1;
|
||||
#else
|
||||
constexpr auto fallbackEngine = 0;
|
||||
#endif
|
||||
|
||||
setRenderingEngine (fallbackEngine);
|
||||
}
|
||||
|
||||
isShowingHeavyweightDemo = isHeavyweight;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue