![]() |
Cinder
0.9.1
|
#include <AppCocoaView.h>
Inherits cinder::app::AppBase.
Public Member Functions | |
AppCocoaView () | |
~AppCocoaView () | |
virtual void | setupCinderView (CinderViewMac *cinderView) |
void | launch () override |
void | quit () override |
float | getFrameRate () const override |
void | setFrameRate (float frameRate) override |
void | disableFrameRate () override |
bool | isFrameRateEnabled () const override |
size_t | getNumWindows () const override |
WindowRef | getWindow () const override |
WindowRef | getWindowIndex (size_t index) const override |
ivec2 | getMousePos () const override |
WindowRef | createWindow (const Window::Format &format=Window::Format()) override |
WindowRef | getForegroundWindow () const override |
void | hideCursor () override |
void | showCursor () 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 void | enablePowerManagement (bool powerManagement=true) |
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) |
virtual bool | isFullScreen () const |
virtual void | setFullScreen (bool fullScreen, const FullScreenOptions &options=FullScreenOptions()) |
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 |
Timeline & | timeline () |
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 void | initialize (Settings *settings, const RendererRef &defaultRenderer) |
static bool | isMainThread () |
static AppBase * | get () |
Protected Attributes | |
AppImplCocoaView * | mImpl |
bool | mPowerManagement |
Static Protected Attributes | |
static AppBase * | sInstance = nullptr |
static Settings * | sSettingsFromMain = nullptr |
cinder::app::AppCocoaView::AppCocoaView | ( | ) |
cinder::app::AppCocoaView::~AppCocoaView | ( | ) |
|
static |
|
virtual |
|
override |
|
overridevirtual |
Requests that the application exit gracefully. Use std::terminate() instead to end application immediately.
Implements cinder::app::AppBase.
|
overridevirtual |
Returns the maximum frame-rate the App will attempt to maintain measured in frames-per-second.
Implements cinder::app::AppBase.
|
overridevirtual |
Sets the maximum frame-rate the App will attempt to maintain \ a frameRate frames-per-second.
Implements cinder::app::AppBase.
|
overridevirtual |
Disables frameRate limiting.
Implements cinder::app::AppBase.
|
overridevirtual |
Returns whether frameRate limiting is enabled.
Implements cinder::app::AppBase.
|
overridevirtual |
Returns the number of Windows the app has open.
Implements cinder::app::AppBase.
|
overridevirtual |
Returns the the currently active Window. Throws ExcInvalidWindow if called with no active window.
Implements cinder::app::AppBase.
|
overridevirtual |
Gets a Window by index, in the range [0, getNumWindows()). Throw ExcInvalidWindow if index is out of bounds.
Implements cinder::app::AppBase.
|
overridevirtual |
Returns the current location of the mouse in screen coordinates measured in points. Can be called outside the normal event loop.
Implements cinder::app::AppBase.
|
overridevirtual |
Implements cinder::app::AppBase.
|
overridevirtual |
Gets the foreground Window, which has keyboard and mouse focus.
Implements cinder::app::AppBase.
|
overridevirtual |
Hides the mouse cursor.
Implements cinder::app::AppBase.
|
overridevirtual |
Shows the mouse cursor.
Implements cinder::app::AppBase.
|
virtualinherited |
Override to perform any application setup after the Renderer has been initialized.
|
virtualinherited |
Override to perform any once-per-loop computation.
|
virtualinherited |
Override to perform any rendering once-per-loop or in response to OS-prompted requests for refreshes.
|
virtualinherited |
Override to receive mouse-down events.
|
virtualinherited |
Override to receive mouse-up events.
|
virtualinherited |
Override to receive mouse-wheel events.
|
virtualinherited |
Override to receive mouse-move events.
|
virtualinherited |
Override to receive mouse-drag events.
|
virtualinherited |
Override to respond to the beginning of a multitouch sequence.
|
virtualinherited |
Override to respond to movement (drags) during a multitouch sequence.
|
virtualinherited |
Override to respond to the end of a multitouch sequence.
|
virtualinherited |
Override to receive key-down events.
|
virtualinherited |
Override to receive key-up events.
|
virtualinherited |
Override to receive window resize events.
|
virtualinherited |
Override to receive file-drop events.
|
virtualinherited |
Override to cleanup any resources before app destruction.
|
inherited |
Emitted at the start of each application update cycle.
|
inherited |
Signal that emits before the app quit process begins. If any slots return false then the app quitting is canceled.
|
inherited |
Emitted prior to the application shutting down.
|
inherited |
|
inherited |
|
inherited |
|
inherited |
|
inherited |
|
inherited |
Emitted when a new display is connected to the system.
|
inherited |
Emits a signal indicating a new display has connected to the system.
|
inherited |
Emitted when a display is removed from the system.
|
inherited |
Emits a signal indicating a display has disconnected from the system.
|
inherited |
Emitted when the resolution or some other property of a Display is changed.
|
inherited |
Emits a signal when the resolution or some other property of a Display has changed.
|
inherited |
|
inherited |
|
inherited |
|
virtualinherited |
a value of true allows screensavers or the system's power management to hide the app. Default value is false
on desktop, and true
on mobile
Reimplemented in cinder::app::AppCocoaTouch, and cinder::app::AppMac.
|
virtualinherited |
is power management enabled, allowing screensavers and the system's power management to hide the application
Reimplemented in cinder::app::AppMac.
|
inherited |
Returns the width of the App's current window measured in points.
|
inherited |
Returns the height of the App's current window measured in points.
|
inherited |
Sets the size of the App's current window measured in points. Ignored in full-screen mode.
|
inherited |
Sets the size of the App's window measured in points. Ignored in full-screen mode.
|
inherited |
Returns the center of the App's window measured in points.
Equivalent to vec2( getWindowWidth() * 0.5, getWindowHeight() * 0.5 )
|
inherited |
Returns the size of the App's current window measured in points.
|
inherited |
Returns the aspect ratio of the App's current window.
|
inherited |
Returns the bounding area of the App's current window measured in points.
Equivalent to Area( 0, 0, getWindowWidth(), getWindowHeight() );
|
inherited |
Returns the contentScale of the App's window, which is the multiplier that maps points to pixels.
|
inherited |
Returns tcoordinates of the top-left corner of the current window measured in points.
|
inherited |
Returns the X coordinate of the top-left corner of the current window measured in points.
|
inherited |
Returns the Y coordinate of the top-left corner of the current window contents measured in points.
|
inherited |
Sets the coordinates of the top-left corner of the current window measured in points.
|
virtualinherited |
Sets the coordinates of the top-left corner of the current window measured points.
|
inherited |
Returns the average frame-rate attained by the App as measured in frames-per-second.
|
inherited |
Returns the sampling rate in seconds for measuring the average frame-per-second as returned by getAverageFps()
|
inherited |
Sets the sampling rate in seconds for measuring the average frame-per-second as returned by getAverageFps()
|
virtualinherited |
Returns whether the App is in full-screen mode or not.
Reimplemented in cinder::app::AppCocoaTouch.
|
virtualinherited |
Sets whether the active App is in full-screen mode based on fullScreen.
Reimplemented in cinder::app::AppCocoaTouch.
|
inherited |
Returns the number of seconds which have elapsed since application launch.
|
inherited |
Returns the number of animation frames which have elapsed since application launch.
|
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.
|
inherited |
|
inherited |
Returns a DataSourceRef to an application resource. mswID and mswType identify the resource as defined the application's .rc file(s).
|
inherited |
Returns a DataSourceRef to an application asset. Throws a AssetLoadExc on failure.
|
inherited |
Returns a fs::path to an application asset. Returns an empty path on failure.
|
inherited |
Adds an absolute path 'dirPath' to the list of directories which are searched for assets.
|
inherited |
Returns the path to the application on disk.
|
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.
|
inherited |
Presents the user with an open-folder dialog.
|
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.
|
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.
|
inherited |
Returns a vector of the command line arguments passed to the app when intantiated.
|
staticinherited |
Returns true
if the calling thread is the Application's main thread (the thread running the main function), false otherwise.
|
inherited |
Returns a reference to the App's boost::asio::io_service()
|
inherited |
Executes a std::function on the App's primary thread ahead of the next update()
|
inherited |
|
inherited |
|
inherited |
|
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.
|
virtualinherited |
Reimplemented in cinder::app::AppScreenSaver.
|
staticinherited |
Returns a pointer to the active App.
|
protected |
|
staticprotectedinherited |
|
staticprotectedinherited |
|
protectedinherited |