1
0
Fork 0
mirror of https://github.com/juce-framework/JUCE.git synced 2026-01-15 00:24:19 +00:00

Added an assertion to check the OpenGL swap interval on MacOS

This commit is contained in:
Tom Poole 2019-02-01 13:00:08 +00:00
parent 06a2654a74
commit be83a08c3b
2 changed files with 5 additions and 1 deletions

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
{

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