Browse Source

Added an assertion to check the OpenGL swap interval on MacOS

tags/2021-05-28
Tom Poole 7 years ago
parent
commit
be83a08c3b
2 changed files with 5 additions and 1 deletions
  1. +1
    -1
      modules/juce_core/containers/juce_AbstractFifo.h
  2. +4
    -0
      modules/juce_opengl/native/juce_OpenGL_osx.h

+ 1
- 1
modules/juce_core/containers/juce_AbstractFifo.h View File

@@ -331,7 +331,7 @@ inline void AbstractFifo::ScopedReadWrite<AbstractFifo::ReadOrWrite::write>::fin
{
f.finishedWrite (num);
}
template<>
inline void AbstractFifo::ScopedReadWrite<AbstractFifo::ReadOrWrite::read>::prepare (AbstractFifo& f, int num) noexcept
{


+ 4
- 0
modules/juce_opengl/native/juce_OpenGL_osx.h View File

@@ -200,6 +200,10 @@ public:
bool setSwapInterval (int numFramesPerSwap)
{
// The macOS OpenGL programming guide says that numFramesPerSwap
// can only be 0 or 1.
jassert (isPositiveAndBelow (numFramesPerSwap, 2));
minSwapTimeMs = (numFramesPerSwap * 1000) / 60;
[renderContext setValues: (const GLint*) &numFramesPerSwap


Loading…
Cancel
Save