- cinder::app::Platform
- cinder::app::PlatformLinux
Public Member Functions
-
PlatformLinux ()
-
~PlatformLinux ()
-
voidcleanupLaunch () override
Called at the end of a launch, can be overridden for platform-specifc cleanup.
-
loadResource (const fs::path &resourcePath) override
Returns a DataSource to an application resource. resourcePath is defined on a per-platform basis.
- See Also
CinderResources
-
fs::pathgetResourceDirectory () const override
Returns the absolute file path to the resources folder. Returns an empty fs::path on windows.
- See Also
CinderResources
-
fs::pathgetResourcePath (const fs::path &rsrcRelativePath) const override
Returns the absolute file path to a resource located at rsrcRelativePath inside the bundle's resources folder. Returns an empty fs::path on windows. Throws ResourceLoadExc on failure.
- See Also
CinderResources
-
fs::pathgetOpenFilePath (const fs::path &initialPath, const std::vector< std::string > &extensions) override
Presents the user with an open-file dialog and returns the selected file path. The dialog optionally begins at the path initialPath and can be limited to allow selection of files ending in the extensions enumerated in extensions .
the selected file path, or an empty fs::path if the user cancelled or this operation isn't supported on the current platform.
-
fs::pathgetFolderPath (const fs::path &initialPath) override
Presents the user with an open-folder dialog.
the selected file path, or an empty fs::path if the user cancelled or this operation isn't supported on the current platform.
-
fs::pathgetSaveFilePath (const fs::path &initialPath, const std::vector< std::string > &extensions) override
Presents the user with a save-file dialog and returns the selected file path. The dialog optionally begins at the path initialPath and can be limited to allow selection of files ending in the extensions enumerated in extensions .
the selected file path, or an empty fs::path if the user cancelled or this operation isn't supported on the current platform.
-
std::map< std::string, std::string >getEnvironmentVariables () override
Returns a std::map of the system's environment variables. Empty on WinRT.
-
fs::pathexpandPath (const fs::path &path) override
Returns a canonical version of path . Collapses '.', ".." and "//". Converts '~' on Cocoa. Expands environment variables on MSW.
-
fs::pathgetHomeDirectory () const override
Returns the path to the user's home directory.
-
fs::pathgetDocumentsDirectory () const override
Returns the path to the user's documents directory.
-
fs::pathgetDefaultExecutablePath () const override
Returns the path used for the default executable location. Users may override this with setExecutablePath() for application specific purposes.
-
voidsleep (float milliseconds) override
Suspends the execution of the current thread until milliseconds have passed. Supports sub-millisecond precision only on OS X.
-
voidlaunchWebBrowser (const Url &url) override
Launches a path in the system's default web browser.
-
std::vector< std::string >stackTrace () override
Returns a stack trace (aka backtrace) where
stackTrace()
[0] == caller,stackTrace()
[1] == caller's parent, etc. -
voidsetThreadName (const std::string &name) override
Sets the name of the current thread to name .
-
const std::vector< DisplayRef > &getDisplays () override
Returns a std::vector of Displays connected to the system.
-
findDisplayFromGlfwMonitor (GLFWmonitor *monitor)
Returns the Display which corresponds to a GLFWmonitor monitor . Returns main display on failure.
-
voidaddDisplay (const DisplayRef &display)
Makes a record of display and signals appropriately. Generally only useful for Cinder internals.
-
voidremoveDisplay (const DisplayRef &display)
Removes record of display from mDisplays and signals appropriately. Generally only useful for Cinder internals.
-
voidprepareLaunch ()
Called at the beginning of a launch, can be overridden for platform-specifc preparation.
-
loadAsset (const fs::path &relativePath)
Returns a DataSourceRef to an application asset. Throws a AssetLoadExc on failure.
-
fs::pathgetAssetPath (const fs::path &relativePath) const
Returns a fs::path to an application asset. Returns an empty path on failure.
-
voidaddAssetDirectory (const fs::path &directory)
Adds an absolute path to the list of directories which are searched for assets.
Not thread-safe, e.g. you should not call this when loadAsset() or getAssetPath() can occur from a different thread.
-
const std::vector< fs::path > &getAssetDirectories () const
Returns a vector of directories that are searched when looking up an asset path.
-
fs::pathgetExecutablePath () const
Returns the path to the associated executable.
-
voidsetExecutablePath (const fs::path &execPath)
Sets the path to the associated executable, overriding the default.
-
std::ostream &console ()
Returns a reference to an output console, which is by default an alias to std::cout. Other platforms may override to use other necessary console mechanisms.
Static Public Member Functions
-
get ()
-
voidset (Platform *platform)
Sets the current Platform .
Protected Member Functions
-
voidprepareAssetLoading ()
Called when asset directories are first prepared, subclasses can override to add platform specific directories.
-
voidfindAndAddDefaultAssetPath ()
Called to add the default assets folder by walking up the path from the executable until a folder named 'assets' is found. Subclasses can override this method to disable this functionality.