13#include <GLFW/glfw3.h>
17#include <nanovg_gl_utils.h>
59 GLFWwindow*
win = NULL;
60 NVGcontext*
vg = NULL;
#define PRIVATE
Attribute for private functions not intended to be called by plugins.
Definition common.hpp:32
#define DEPRECATED
Attribute for deprecated functions and symbols.
Definition common.hpp:26
const char * filename
Definition logger.hpp:41
Root namespace for the Rack API.
Definition AudioDisplay.hpp:9
2-dimensional vector of floats, representing a point on the plane for graphics.
Definition math.hpp:189
Text font loaded in a particular Window context.
Definition Window.hpp:29
int handle
Definition Window.hpp:31
NVGcontext * vg
Definition Window.hpp:30
static DEPRECATED std::shared_ptr< Font > load(const std::string &filename)
Use APP->window->loadFont() instead.
void loadFile(const std::string &filename, NVGcontext *vg)
Don't call this directly but instead use APP->window->loadFont()
Bitmap/raster image loaded in a particular Window context.
Definition Window.hpp:42
NVGcontext * vg
Definition Window.hpp:43
int handle
Definition Window.hpp:44
void loadFile(const std::string &filename, NVGcontext *vg)
Don't call this directly but instead use APP->window->loadImage()
static DEPRECATED std::shared_ptr< Image > load(const std::string &filename)
Use APP->window->loadImage() instead.
static std::shared_ptr< Svg > load(const std::string &filename)
Loads Svg from a cache.
OS window with OpenGL context.
Definition Window.hpp:55
void setFullScreen(bool fullScreen)
PRIVATE void screenshotModules(const std::string &screenshotsDir, float zoom=1.f)
Saves a PNG image of all modules to screenshotsDir/<plugin slug>/<module slug>.png.
std::shared_ptr< Svg > loadSvg(const std::string &filename)
Loads and caches an Svg from a file path.
Definition Window.hpp:117
void close()
Request Window to be closed after rendering the current frame.
PRIVATE void screenshot(const std::string &screenshotPath)
Takes a screenshot of the screen and saves it to a PNG file.
int getMods()
Gets the current keyboard mod state Don't call this from a Key event.
double getFrameDurationRemaining()
Returns the current time remaining in seconds until the frame deadline, according to the frame rate l...
double getLastFrameDuration()
Returns the total time in seconds spent rendering the last frame.
std::shared_ptr< Image > loadImage(const std::string &filename)
Loads and caches an Image from a file path.
float pixelRatio
UI scaling ratio.
Definition Window.hpp:63
std::shared_ptr< Font > uiFont
Definition Window.hpp:68
GLFWwindow * win
Definition Window.hpp:59
PRIVATE bool & fbDirtyOnSubpixelChange()
NVGcontext * vg
Definition Window.hpp:60
double getMonitorRefreshRate()
Returns the primary monitor's refresh rate in Hz.
double getFrameTime()
Returns the timestamp of the beginning of the current frame render process.
void setSize(math::Vec size)
NVGcontext * fbVg
Definition Window.hpp:61
float windowRatio
Ratio between the framebuffer size and the window size reported by the OS.
Definition Window.hpp:67
std::shared_ptr< Font > loadFont(const std::string &filename)
Loads and caches a Font from a file path.
Internal * internal
Definition Window.hpp:57