Skip to content

Commit

Permalink
add FRIZ_VBLANK_ENABLED macro, bump version #
Browse files Browse the repository at this point in the history
  • Loading branch information
Brett g Porter committed Feb 12, 2023
1 parent c865d49 commit 1f620f9
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 3 deletions.
6 changes: 6 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -170,6 +170,12 @@ animator.addAnimation (std::move (animation));

## Release History

### 2.1.1 Feb 12, 2023

#### Non-breaking Changes

- added new `FRIZ_VBLANK_ENABLED` macro, which will be set to `1` if the version of JUCE being targeted is 7.0.0 or higher.

### 2.1.0 Feb 11, 2023

#### Non-breaking Changes
Expand Down
2 changes: 2 additions & 0 deletions Source/friz/control/controller.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,7 @@ void TimeController::timerCallback ()
animator->gotoTime (getCurrentTime ());
}

#if FRIZ_VBLANK_ENABLED
void DisplaySyncController::start ()
{
jassert (animator != nullptr);
Expand All @@ -88,6 +89,7 @@ void DisplaySyncController::start ()
running = true;
}
}
#endif

bool AsyncController::gotoTime (juce::int64 timeInMs)
{
Expand Down
12 changes: 10 additions & 2 deletions Source/friz/control/controller.h
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,11 @@
#include <juce_gui_basics/juce_gui_basics.h>
#include <juce_gui_extra/juce_gui_extra.h>

#if JUCE_VERSION >= (7 << 16)
#define FRIZ_VBLANK_ENABLED 1

This comment has been minimized.

Copy link
@sudara

sudara Feb 13, 2023

Contributor

Just a note, VBlank support wasn't added until 7.0.3.

This comment has been minimized.

Copy link
@bgporter

bgporter Feb 14, 2023

Owner

That's what I get for trusting the release notes, which say in 7.0.0:

Added hardware synchronised drawing on Windows, macOS and iOS

(and no mention of the feature in the 7.0.3 notes).

#else
#define FRIZ_VBLANK_ENABLED 0
#endif
namespace friz
{
class Animator;
Expand Down Expand Up @@ -176,11 +181,14 @@ class TimeController : public Controller,
int frameRate { 30 };
};

#if FRIZ_VBLANK_ENABLED
/**
* @class DisplaySyncController
*
* @brief Synchronize animations with a display's vertical blank interval.
*
* @warning This class is only available in code targeting JUCE 7.0.0 or higher
*
*/
class DisplaySyncController : public Controller
{
Expand Down Expand Up @@ -234,7 +242,7 @@ class DisplaySyncController : public Controller
FrameRateCalculator frameRate;
bool running { false };
};

#endif
/**
* @class AsyncController
* @brief Controller to support clocking an animation manually, or at rates
Expand Down
2 changes: 1 addition & 1 deletion Source/friz/friz.h
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ BEGIN_JUCE_MODULE_DECLARATION
ID: friz
vendor: bgporter
version: 2.1.0
version: 2.1.1
name: 'friz' animator
description: Animation control classes for JUCE.
website: https://github.com/bgporter/animator
Expand Down

0 comments on commit 1f620f9

Please sign in to comment.