Cinder  0.9.1
Classes | Public Types | Public Member Functions | Static Public Member Functions | Protected Member Functions | Protected Attributes | Static Protected Attributes | Friends | List of all members
cinder::app::AppCocoaTouch Class Reference

#include <AppCocoaTouch.h>

Inherits cinder::app::AppBase.

Classes

struct  KeyboardOptions
 
class  Settings
 

Public Types

enum  KeyboardType { DEFAULT, NUMERICAL, URL }
 
enum  StatusBarAnimation { NONE, FADE, SLIDE }
 
typedef std::function< void(Settings *settings)> SettingsFn
 
typedef enum cinder::app::AppCocoaTouch::StatusBarAnimation StatusBarAnimation
 

Public Member Functions

 AppCocoaTouch ()
 
virtual ~AppCocoaTouch ()
 
signals::Signal< void()> & getSignalDidEnterBackground ()
 
void emitDidEnterBackground ()
 
signals::Signal< void()> & getSignalWillEnterForeground ()
 
void emitWillEnterForeground ()
 
signals::Signal< void()> & getSignalMemoryWarning ()
 
void emitMemoryWarning ()
 
EventSignalSupportedOrientations & getSignalSupportedOrientations ()
 
uint32_t emitSupportedOrientations ()
 
signals::Signal< void()> & getSignalWillRotate ()
 
void emitWillRotate ()
 
signals::Signal< void()> & getSignalDidRotate ()
 
void emitDidRotate ()
 
signals::Signal< void()> & getSignalKeyboardWillShow ()
 
void emitKeyboardWillShow ()
 
signals::Signal< void()> & getSignalKeyboardWillHide ()
 
void emitKeyboardWillHide ()
 
WindowRef createWindow (const Window::Format &format=Window::Format()) override
 
WindowRef getWindow () const override
 
WindowRef getForegroundWindow () const override
 
size_t getNumWindows () const override
 
app::WindowRef getWindowIndex (size_t index=0) const override
 
InterfaceOrientation getOrientation () const
 
InterfaceOrientation getWindowOrientation () const
 
void hideCursor () override
 
void showCursor () override
 
void disableFrameRate () override
 
bool isFrameRateEnabled () const override
 
void enableProximitySensor ()
 
void disableProximitySensor ()
 
bool proximityIsClose () const
 
signals::Signal< void(bool)> & getSignalProximitySensor ()
 
void emitSignalProximitySensor (bool isClose)
 
void enableBatteryMonitoring ()
 
void disableBatteryMonitoring ()
 
float getBatteryLevel () const
 
bool isUnplugged () const
 
signals::Signal< void(bool)> & getSignalBatteryState ()
 
void emitSignalBatteryState (bool isUnplugged)
 
void enablePowerManagement (bool powerManagement=true) override
 
void showKeyboard (const KeyboardOptions &options=KeyboardOptions())
 
bool isKeyboardVisible () const
 
void hideKeyboard ()
 
std::string getKeyboardString () const
 
void setKeyboardString (const std::string &keyboardString)
 
::UITextView * getKeyboardTextView () const
 
void showStatusBar (StatusBarAnimation animation=StatusBarAnimation::NONE)
 
bool isStatusBarVisible () const
 
void hideStatusBar (StatusBarAnimation animation=StatusBarAnimation::NONE)
 
float getFrameRate () const override
 
void setFrameRate (float frameRate) override
 
bool isFullScreen () const override
 
void setFullScreen (bool fullScreen, const FullScreenOptions &options=FullScreenOptions()) override
 
ivec2 getMousePos () const override
 
void quit () override
 
virtual void setup ()
 
virtual void update ()
 
virtual void draw ()
 
virtual void mouseDown (MouseEvent event)
 
virtual void mouseUp (MouseEvent event)
 
virtual void mouseWheel (MouseEvent event)
 
virtual void mouseMove (MouseEvent event)
 
virtual void mouseDrag (MouseEvent event)
 
virtual void touchesBegan (TouchEvent event)
 
virtual void touchesMoved (TouchEvent event)
 
virtual void touchesEnded (TouchEvent event)
 
virtual void keyDown (KeyEvent event)
 
virtual void keyUp (KeyEvent event)
 
virtual void resize ()
 
virtual void fileDrop (FileDropEvent event)
 
virtual void cleanup ()
 
signals::Signal< void()> & getSignalUpdate ()
 
EventSignalShouldQuit & getSignalShouldQuit ()
 
signals::Signal< void()> & getSignalCleanup ()
 
void emitCleanup ()
 
signals::Signal< void()> & getSignalWillResignActive ()
 
void emitWillResignActive ()
 
signals::Signal< void()> & getSignalDidBecomeActive ()
 
void emitDidBecomeActive ()
 
signals::Signal< void(const DisplayRef &display)> & getSignalDisplayConnected ()
 
void emitDisplayConnected (const DisplayRef &display)
 
signals::Signal< void(const DisplayRef &display)> & getSignalDisplayDisconnected ()
 
void emitDisplayDisconnected (const DisplayRef &display)
 
signals::Signal< void(const DisplayRef &display)> & getSignalDisplayChanged ()
 
void emitDisplayChanged (const DisplayRef &display)
 
const std::vector< TouchEvent::Touch > & getActiveTouches () const
 
RendererRef getRenderer () const
 
DisplayRef getDisplay () const
 
virtual bool isPowerManagementEnabled () const
 
int getWindowWidth () const
 
int getWindowHeight () const
 
void setWindowSize (int windowWidth, int windowHeight)
 
void setWindowSize (const ivec2 &size)
 
vec2 getWindowCenter () const
 
ivec2 getWindowSize () const
 
float getWindowAspectRatio () const
 
Area getWindowBounds () const
 
float getWindowContentScale () const
 
ivec2 getWindowPos () const
 
int getWindowPosX () const
 
int getWindowPosY () const
 
void setWindowPos (int x, int y)
 
virtual void setWindowPos (const ivec2 &windowPos)
 
float getAverageFps () const
 
double getFpsSampleInterval () const
 
void setFpsSampleInterval (double sampleInterval)
 
double getElapsedSeconds () const
 
uint32_t getElapsedFrames () const
 
bool isMultiTouchEnabled () const
 
bool isHighDensityDisplayEnabled () const
 
DataSourceRef loadResource (const fs::path &resourcePath, int mswID, const std::string &mswType) const
 
DataSourceRef loadAsset (const fs::path &relativePath)
 
fs::path getAssetPath (const fs::path &relativePath) const
 
void addAssetDirectory (const fs::path &dirPath)
 
fs::path getAppPath () const
 
fs::path getOpenFilePath (const fs::path &initialPath=fs::path(), const std::vector< std::string > &extensions=std::vector< std::string >())
 
fs::path getFolderPath (const fs::path &initialPath=fs::path())
 
fs::path getSaveFilePath (const fs::path &initialPath=fs::path(), const std::vector< std::string > &extensions=std::vector< std::string >())
 
std::ostream & console ()
 
const std::vector< std::string > & getCommandLineArgs () const
 
Timelinetimeline ()
 
asio::io_service & io_service ()
 
void dispatchAsync (const std::function< void()> &fn)
 
template<typename T >
std::result_of< T()>::type dispatchSync (T fn)
 
RendererRef getDefaultRenderer () const
 
Surface copyWindowSurface ()
 
Surface copyWindowSurface (const Area &area)
 
virtual void restoreWindowContext ()
 
virtual bool receivesEvents () const
 

Static Public Member Functions

static AppCocoaTouchget ()
 
static bool isMainThread ()
 

Protected Member Functions

void launch () override
 

Protected Attributes

bool mPowerManagement
 

Static Protected Attributes

static SettingssSettingsFromMain = nullptr
 

Friends

void setupCocoaTouchWindow (AppCocoaTouch *app)
 

Member Typedef Documentation

typedef std::function<void ( Settings *settings )> cinder::app::AppCocoaTouch::SettingsFn

Member Enumeration Documentation

Enumerator
DEFAULT 
NUMERICAL 
URL 
Enumerator
NONE 
FADE 
SLIDE 

Constructor & Destructor Documentation

cinder::app::AppCocoaTouch::AppCocoaTouch ( )
cinder::app::AppCocoaTouch::~AppCocoaTouch ( )
virtual

Member Function Documentation

signals::Signal<void()>& cinder::app::AppCocoaTouch::getSignalDidEnterBackground ( )
void cinder::app::AppCocoaTouch::emitDidEnterBackground ( )
signals::Signal<void()>& cinder::app::AppCocoaTouch::getSignalWillEnterForeground ( )
void cinder::app::AppCocoaTouch::emitWillEnterForeground ( )
signals::Signal<void()>& cinder::app::AppCocoaTouch::getSignalMemoryWarning ( )
void cinder::app::AppCocoaTouch::emitMemoryWarning ( )
EventSignalSupportedOrientations& cinder::app::AppCocoaTouch::getSignalSupportedOrientations ( )

Returns the signal emitted when an orientation change may occur, allowing the user to specify which orientations are permitted (any connection can forbid a given orientation). The connected std::function must return an InterfaceOrientation bitmask.

uint32_t cinder::app::AppCocoaTouch::emitSupportedOrientations ( )

Emits a signal to ask the user what orientations are supported.

signals::Signal<void()>& cinder::app::AppCocoaTouch::getSignalWillRotate ( )

Returns the signal emitted when the interface is about to rotate to a new orientation. At this time, the Window's bounds and orientation have already been updated.

void cinder::app::AppCocoaTouch::emitWillRotate ( )

Emits the signal to notify the user that the orientation will change.

signals::Signal<void()>& cinder::app::AppCocoaTouch::getSignalDidRotate ( )

Returns the signal emitted when the interface is finished rotating to a new orientation.

void cinder::app::AppCocoaTouch::emitDidRotate ( )

Emits the signal to notify the user that the orientation did change.

signals::Signal<void()>& cinder::app::AppCocoaTouch::getSignalKeyboardWillShow ( )

Returns the signal emitted when the virtual keyboard is about to animate on screen.

void cinder::app::AppCocoaTouch::emitKeyboardWillShow ( )

Emits the signal used to notify when the virtual keyboard is about to animate on screen.

signals::Signal<void()>& cinder::app::AppCocoaTouch::getSignalKeyboardWillHide ( )

Returns the signal emitted when the virtual keyboard is about to animate off screen.

void cinder::app::AppCocoaTouch::emitKeyboardWillHide ( )

Emits the signal used to notify when the virtual keyboard is about to animate off screen.

WindowRef cinder::app::AppCocoaTouch::createWindow ( const Window::Format format = Window::Format())
overridevirtual

Creates and returns a reference to a new Window, adhering to format.

Implements cinder::app::AppBase.

WindowRef cinder::app::AppCocoaTouch::getWindow ( ) const
overridevirtual

Returns the the currently active Window. Throws ExcInvalidWindow if called with no active window.

Implements cinder::app::AppBase.

WindowRef cinder::app::AppCocoaTouch::getForegroundWindow ( ) const
overridevirtual

Gets the foreground Window, which has keyboard and mouse focus.

Implements cinder::app::AppBase.

size_t cinder::app::AppCocoaTouch::getNumWindows ( ) const
overridevirtual

Returns the number of Windows the app has open.

Implements cinder::app::AppBase.

WindowRef cinder::app::AppCocoaTouch::getWindowIndex ( size_t  index = 0) const
overridevirtual

Gets a Window by index, in the range [0, getNumWindows()). Throw ExcInvalidWindow if index is out of bounds.

Implements cinder::app::AppBase.

InterfaceOrientation cinder::app::AppCocoaTouch::getOrientation ( ) const

Returns the InterfaceOrientation for the device Window.

InterfaceOrientation cinder::app::AppCocoaTouch::getWindowOrientation ( ) const

Returns the current InterfaceOrientation for the active Window.

void cinder::app::AppCocoaTouch::hideCursor ( )
overridevirtual

no-op, no cursor on this platform

Implements cinder::app::AppBase.

void cinder::app::AppCocoaTouch::showCursor ( )
overridevirtual

no-op, no cursor on this platform

Implements cinder::app::AppBase.

void cinder::app::AppCocoaTouch::disableFrameRate ( )
overridevirtual

no-op, cannot disable framerate on this platform

Implements cinder::app::AppBase.

bool cinder::app::AppCocoaTouch::isFrameRateEnabled ( ) const
overridevirtual

always false, cannot disable framerate on this platform

Implements cinder::app::AppBase.

void cinder::app::AppCocoaTouch::enableProximitySensor ( )

Enables the device's proximity sensor, which can return whether the device is close to the user or not. Use in conjunction with proximityIsClose() or getSignalProximitySensor()

void cinder::app::AppCocoaTouch::disableProximitySensor ( )

Disables the device's proximity sensor.

bool cinder::app::AppCocoaTouch::proximityIsClose ( ) const

Returns whether the device is close to the user or not. Must call enableProximitySensor() before using.

signals::Signal<void( bool )>& cinder::app::AppCocoaTouch::getSignalProximitySensor ( )

Signal emitted when the device becomes close (true) or far (false). Must call enableProximitySensor() before using.

void cinder::app::AppCocoaTouch::emitSignalProximitySensor ( bool  isClose)
void cinder::app::AppCocoaTouch::enableBatteryMonitoring ( )

Enables the device's battery monitor. Use in conjunction with getBatteryLevel(), isUnplugged() and getSignalBatteryState()

void cinder::app::AppCocoaTouch::disableBatteryMonitoring ( )

Disables the device's battery monitor.

float cinder::app::AppCocoaTouch::getBatteryLevel ( ) const

Returns the device's battery level, in the range of [0,1];.

bool cinder::app::AppCocoaTouch::isUnplugged ( ) const

Returns true when the device is not plugged into power.

signals::Signal<void( bool )>& cinder::app::AppCocoaTouch::getSignalBatteryState ( )

Signal emitted when the device is unplugged (true) or plugged in (false). Use in place of polling isUnplugged().

void cinder::app::AppCocoaTouch::emitSignalBatteryState ( bool  isUnplugged)
void cinder::app::AppCocoaTouch::enablePowerManagement ( bool  powerManagement = true)
overridevirtual

When disabled, the device will not sleep even after the idling threshold.

Reimplemented from cinder::app::AppBase.

void cinder::app::AppCocoaTouch::showKeyboard ( const KeyboardOptions options = KeyboardOptions())

Shows the iOS virtual keyboard with KeyboardOptions options. This method can be called with new options while the keyboard is visible.

bool cinder::app::AppCocoaTouch::isKeyboardVisible ( ) const

Returns whether the iOS keyboard is visible.

void cinder::app::AppCocoaTouch::hideKeyboard ( )

Hides the default iOS keyboard.

std::string cinder::app::AppCocoaTouch::getKeyboardString ( ) const

Returns the current text recorded since the most recent call to showKeyboard().

void cinder::app::AppCocoaTouch::setKeyboardString ( const std::string &  keyboardString)

Sets the current text string that the keyboard is manipulating, overwriting any previous content.

UITextView * cinder::app::AppCocoaTouch::getKeyboardTextView ( ) const

Retuens a pointer to the native UITextView, which can be used to customize the virtual keyboard.

void cinder::app::AppCocoaTouch::showStatusBar ( AppCocoaTouch::StatusBarAnimation  animation = StatusBarAnimation::NONE)

Shows the system status bar.

bool cinder::app::AppCocoaTouch::isStatusBarVisible ( ) const

Returns whether the system status bar is visible.

void cinder::app::AppCocoaTouch::hideStatusBar ( AppCocoaTouch::StatusBarAnimation  animation = StatusBarAnimation::NONE)

Hides the system status bar.

float cinder::app::AppCocoaTouch::getFrameRate ( ) const
overridevirtual

Returns the maximum frame-rate the App will attempt to maintain.

Implements cinder::app::AppBase.

void cinder::app::AppCocoaTouch::setFrameRate ( float  frameRate)
overridevirtual

Sets the maximum frame-rate the App will attempt to maintain.

Implements cinder::app::AppBase.

bool cinder::app::AppCocoaTouch::isFullScreen ( ) const
overridevirtual

Overidden to always return true on mobile.

Reimplemented from cinder::app::AppBase.

void cinder::app::AppCocoaTouch::setFullScreen ( bool  fullScreen,
const FullScreenOptions options = FullScreenOptions() 
)
overridevirtual

Overidden to disable, mobile is always full screen.

Reimplemented from cinder::app::AppBase.

ivec2 cinder::app::AppCocoaTouch::getMousePos ( ) const
overridevirtual

Returns an invalid position since the device doesn't have a mouse.

Implements cinder::app::AppBase.

void cinder::app::AppCocoaTouch::quit ( )
overridevirtual

No-op on iOS.

Implements cinder::app::AppBase.

static AppCocoaTouch* cinder::app::AppCocoaTouch::get ( )
static

Returns a pointer to the current global AppCocoaTouch.

void cinder::app::AppCocoaTouch::launch ( )
overrideprotected
virtual void cinder::app::AppBase::setup ( )
virtualinherited

Override to perform any application setup after the Renderer has been initialized.

virtual void cinder::app::AppBase::update ( )
virtualinherited

Override to perform any once-per-loop computation.

virtual void cinder::app::AppBase::draw ( )
virtualinherited

Override to perform any rendering once-per-loop or in response to OS-prompted requests for refreshes.

virtual void cinder::app::AppBase::mouseDown ( MouseEvent  event)
virtualinherited

Override to receive mouse-down events.

virtual void cinder::app::AppBase::mouseUp ( MouseEvent  event)
virtualinherited

Override to receive mouse-up events.

virtual void cinder::app::AppBase::mouseWheel ( MouseEvent  event)
virtualinherited

Override to receive mouse-wheel events.

virtual void cinder::app::AppBase::mouseMove ( MouseEvent  event)
virtualinherited

Override to receive mouse-move events.

virtual void cinder::app::AppBase::mouseDrag ( MouseEvent  event)
virtualinherited

Override to receive mouse-drag events.

virtual void cinder::app::AppBase::touchesBegan ( TouchEvent  event)
virtualinherited

Override to respond to the beginning of a multitouch sequence.

virtual void cinder::app::AppBase::touchesMoved ( TouchEvent  event)
virtualinherited

Override to respond to movement (drags) during a multitouch sequence.

virtual void cinder::app::AppBase::touchesEnded ( TouchEvent  event)
virtualinherited

Override to respond to the end of a multitouch sequence.

virtual void cinder::app::AppBase::keyDown ( KeyEvent  event)
virtualinherited

Override to receive key-down events.

virtual void cinder::app::AppBase::keyUp ( KeyEvent  event)
virtualinherited

Override to receive key-up events.

virtual void cinder::app::AppBase::resize ( )
virtualinherited

Override to receive window resize events.

virtual void cinder::app::AppBase::fileDrop ( FileDropEvent  event)
virtualinherited

Override to receive file-drop events.

virtual void cinder::app::AppBase::cleanup ( )
virtualinherited

Override to cleanup any resources before app destruction.

signals::Signal<void()>& cinder::app::AppBase::getSignalUpdate ( )
inherited

Emitted at the start of each application update cycle.

EventSignalShouldQuit& cinder::app::AppBase::getSignalShouldQuit ( )
inherited

Signal that emits before the app quit process begins. If any slots return false then the app quitting is canceled.

signals::Signal<void()>& cinder::app::AppBase::getSignalCleanup ( )
inherited

Emitted prior to the application shutting down.

void cinder::app::AppBase::emitCleanup ( )
inherited
signals::Signal<void()>& cinder::app::AppBase::getSignalWillResignActive ( )
inherited
void cinder::app::AppBase::emitWillResignActive ( )
inherited
signals::Signal<void()>& cinder::app::AppBase::getSignalDidBecomeActive ( )
inherited
void cinder::app::AppBase::emitDidBecomeActive ( )
inherited
signals::Signal<void(const DisplayRef &display)>& cinder::app::AppBase::getSignalDisplayConnected ( )
inherited

Emitted when a new display is connected to the system.

void cinder::app::AppBase::emitDisplayConnected ( const DisplayRef display)
inherited

Emits a signal indicating a new display has connected to the system.

signals::Signal<void(const DisplayRef &display)>& cinder::app::AppBase::getSignalDisplayDisconnected ( )
inherited

Emitted when a display is removed from the system.

void cinder::app::AppBase::emitDisplayDisconnected ( const DisplayRef display)
inherited

Emits a signal indicating a display has disconnected from the system.

signals::Signal<void(const DisplayRef &display)>& cinder::app::AppBase::getSignalDisplayChanged ( )
inherited

Emitted when the resolution or some other property of a Display is changed.

void cinder::app::AppBase::emitDisplayChanged ( const DisplayRef display)
inherited

Emits a signal when the resolution or some other property of a Display has changed.

const std::vector<TouchEvent::Touch>& cinder::app::AppBase::getActiveTouches ( ) const
inherited
RendererRef cinder::app::AppBase::getRenderer ( ) const
inherited

Returns the Renderer of the active Window.

DisplayRef cinder::app::AppBase::getDisplay ( ) const
inherited

Returns the Display of the active Window.

virtual bool cinder::app::AppBase::isPowerManagementEnabled ( ) const
virtualinherited

is power management enabled, allowing screensavers and the system's power management to hide the application

Reimplemented in cinder::app::AppMac.

int cinder::app::AppBase::getWindowWidth ( ) const
inherited

Returns the width of the App's current window measured in points.

int cinder::app::AppBase::getWindowHeight ( ) const
inherited

Returns the height of the App's current window measured in points.

void cinder::app::AppBase::setWindowSize ( int  windowWidth,
int  windowHeight 
)
inherited

Sets the size of the App's current window measured in points. Ignored in full-screen mode.

void cinder::app::AppBase::setWindowSize ( const ivec2 &  size)
inherited

Sets the size of the App's window measured in points. Ignored in full-screen mode.

vec2 cinder::app::AppBase::getWindowCenter ( ) const
inherited

Returns the center of the App's window measured in points.

Equivalent to vec2( getWindowWidth() * 0.5, getWindowHeight() * 0.5 )

ivec2 cinder::app::AppBase::getWindowSize ( ) const
inherited

Returns the size of the App's current window measured in points.

float cinder::app::AppBase::getWindowAspectRatio ( ) const
inherited

Returns the aspect ratio of the App's current window.

Area cinder::app::AppBase::getWindowBounds ( ) const
inherited

Returns the bounding area of the App's current window measured in points.

Equivalent to Area( 0, 0, getWindowWidth(), getWindowHeight() );

float cinder::app::AppBase::getWindowContentScale ( ) const
inherited

Returns the contentScale of the App's window, which is the multiplier that maps points to pixels.

ivec2 cinder::app::AppBase::getWindowPos ( ) const
inherited

Returns tcoordinates of the top-left corner of the current window measured in points.

int cinder::app::AppBase::getWindowPosX ( ) const
inherited

Returns the X coordinate of the top-left corner of the current window measured in points.

int cinder::app::AppBase::getWindowPosY ( ) const
inherited

Returns the Y coordinate of the top-left corner of the current window contents measured in points.

void cinder::app::AppBase::setWindowPos ( int  x,
int  y 
)
inherited

Sets the coordinates of the top-left corner of the current window measured in points.

virtual void cinder::app::AppBase::setWindowPos ( const ivec2 &  windowPos)
virtualinherited

Sets the coordinates of the top-left corner of the current window measured points.

float cinder::app::AppBase::getAverageFps ( ) const
inherited

Returns the average frame-rate attained by the App as measured in frames-per-second.

double cinder::app::AppBase::getFpsSampleInterval ( ) const
inherited

Returns the sampling rate in seconds for measuring the average frame-per-second as returned by getAverageFps()

void cinder::app::AppBase::setFpsSampleInterval ( double  sampleInterval)
inherited

Sets the sampling rate in seconds for measuring the average frame-per-second as returned by getAverageFps()

double cinder::app::AppBase::getElapsedSeconds ( ) const
inherited

Returns the number of seconds which have elapsed since application launch.

uint32_t cinder::app::AppBase::getElapsedFrames ( ) const
inherited

Returns the number of animation frames which have elapsed since application launch.

bool cinder::app::AppBase::isMultiTouchEnabled ( ) const
inherited

Returns whether the app is registered to receive multiTouch events from the operating system, configurable via Settings at startup. Disabled by default on desktop platforms, enabled on mobile.

bool cinder::app::AppBase::isHighDensityDisplayEnabled ( ) const
inherited

Returns whether Windows created on a high-density (Retina) display will have their resolution doubled, configurable via Settings at startup. Default is true on iOS and false on other platforms.

DataSourceRef cinder::app::AppBase::loadResource ( const fs::path &  resourcePath,
int  mswID,
const std::string &  mswType 
) const
inherited

Returns a DataSourceRef to an application resource. mswID and mswType identify the resource as defined the application's .rc file(s).

See also
CinderResources
DataSourceRef cinder::app::AppBase::loadAsset ( const fs::path &  relativePath)
inherited

Returns a DataSourceRef to an application asset. Throws a AssetLoadExc on failure.

fs::path cinder::app::AppBase::getAssetPath ( const fs::path &  relativePath) const
inherited

Returns a fs::path to an application asset. Returns an empty path on failure.

void cinder::app::AppBase::addAssetDirectory ( const fs::path &  dirPath)
inherited

Adds an absolute path 'dirPath' to the list of directories which are searched for assets.

fs::path cinder::app::AppBase::getAppPath ( ) const
inherited

Returns the path to the application on disk.

fs::path cinder::app::AppBase::getOpenFilePath ( const fs::path &  initialPath = fs::path(),
const std::vector< std::string > &  extensions = std::vector<std::string>() 
)
inherited

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.

Returns
the selected file path, or an empty fs::path if the user cancelled or this operation isn't supported on the current platform.
fs::path cinder::app::AppBase::getFolderPath ( const fs::path &  initialPath = fs::path())
inherited

Presents the user with an open-folder dialog.

Returns
the selected file path, or an empty fs::path if the user cancelled or this operation isn't supported on the current platform.
fs::path cinder::app::AppBase::getSaveFilePath ( const fs::path &  initialPath = fs::path(),
const std::vector< std::string > &  extensions = std::vector<std::string>() 
)
inherited

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.

Returns
the selected file path, or an empty fs::path if the user cancelled or this operation isn't supported on the current platform.
std::ostream & cinder::app::AppBase::console ( )
inherited

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.

const std::vector<std::string>& cinder::app::AppBase::getCommandLineArgs ( ) const
inherited

Returns a vector of the command line arguments passed to the app when intantiated.

Timeline& cinder::app::AppBase::timeline ( )
inherited

Returns a reference to the App's Timeline.

bool cinder::app::AppBase::isMainThread ( )
staticinherited

Returns true if the calling thread is the Application's main thread (the thread running the main function), false otherwise.

asio::io_service& cinder::app::AppBase::io_service ( )
inherited

Returns a reference to the App's boost::asio::io_service()

void cinder::app::AppBase::dispatchAsync ( const std::function< void()> &  fn)
inherited

Executes a std::function on the App's primary thread ahead of the next update()

template<typename T >
std::result_of< T()>::type cinder::app::AppBase::dispatchSync ( fn)
inherited
RendererRef cinder::app::AppBase::getDefaultRenderer ( ) const
inherited

Returns the default Renderer which will be used when creating a new Window. Set by the app instantiation macro automatically.

Surface cinder::app::AppBase::copyWindowSurface ( )
inherited
Returns
a copy of the current window's contents as a Surface8u
Surface cinder::app::AppBase::copyWindowSurface ( const Area area)
inherited
Returns
a copy of the Area area (measured in pixels) from the current window's contents as a Surface8u
void cinder::app::AppBase::restoreWindowContext ( )
virtualinherited

Restores the current rendering context to be the App's window or the screen in full-screen mode. Generally this is only necessary if the app has displayed a dialog box or some other external window.

virtual bool cinder::app::AppBase::receivesEvents ( ) const
virtualinherited

Reimplemented in cinder::app::AppScreenSaver.

Friends And Related Function Documentation

void setupCocoaTouchWindow ( AppCocoaTouch app)
friend

Member Data Documentation

AppBase::Settings * cinder::app::AppBase::sSettingsFromMain = nullptr
staticprotectedinherited
bool cinder::app::AppBase::mPowerManagement
protectedinherited

The documentation for this class was generated from the following files: