Helper class to synchronise Component updates to the vertical blank event of the display that the Component is presented on. More...
#include <juce_VBlankAttachment.h>
Public Member Functions | |
VBlankAttachment ()=default | |
Default constructor for creating an empty object. | |
VBlankAttachment (Component *c, std::function< void()> callbackIn) | |
Constructor. | |
VBlankAttachment (Component *c, std::function< void(double)> callbackIn) | |
Constructor. | |
VBlankAttachment (VBlankAttachment &&other) | |
VBlankAttachment & | operator= (VBlankAttachment &&other) |
~VBlankAttachment () override | |
Destructor. | |
bool | isEmpty () const |
Returns true for a default constructed object. | |
Helper class to synchronise Component updates to the vertical blank event of the display that the Component is presented on.
This is useful when animating the Component's contents.
|
default |
Default constructor for creating an empty object.
VBlankAttachment::VBlankAttachment | ( | Component * | c, |
std::function< void()> | callbackIn ) |
Constructor.
Creates an attachment that will call the passed in function at every vertical blank event of the display that the passed in Component is currently visible on.
The Component must be valid for the entire lifetime of the VBlankAttachment.
You should prefer the other constructor, where the callback also receives a timestamp parameter. This constructor is only provided for compatibility with the earlier JUCE implementation.
VBlankAttachment::VBlankAttachment | ( | Component * | c, |
std::function< void(double)> | callbackIn ) |
Constructor.
Creates an attachment that will call the passed in function at every vertical blank event of the display that the passed in Component is currently visible on.
The Component must be valid for the entire lifetime of the VBlankAttachment.
The provided callback is called with a monotonically increasing value expressed in seconds that corresponds to the time of the next frame to be presented. Use this value to synchronise drawing across all classes using a VBlankAttachment.
VBlankAttachment::VBlankAttachment | ( | VBlankAttachment && | other | ) |
|
override |
Destructor.
VBlankAttachment & VBlankAttachment::operator= | ( | VBlankAttachment && | other | ) |
bool VBlankAttachment::isEmpty | ( | ) | const |
Returns true for a default constructed object.