# Cinder

# cinder::app::AppCinderView Class Reference

`#include <AppCinderView.h>`

Inherits cinder::app::App.

List of all members.

## Classes
class | Settings
## Public Member Functions
| AppCinderView ()
void | launchApplication (CinderView *cinderView, Renderer *renderer)
void | prepareSettings (Settings *settings)
virtual Settings & | getSettings ()
virtual void | setup ()
| Override to perform any application setup after the Renderer has been initialized.
virtual void | shutdown ()
| Override to perform any application cleanup before exiting.
virtual void | update ()
| Override to perform any once-per-loop computation.
virtual void | draw ()
| Override to perform any rendering once-per-loop or in response to OS-prompted requests for refreshes.
virtual void | mouseDown (MouseEvent event)
| Override to receive mouse-down events.
virtual void | mouseUp (MouseEvent event)
| Override to receive mouse-up events.
virtual void | mouseWheel (MouseEvent event)
| Override to receive mouse-wheel events.
virtual void | mouseMove (MouseEvent event)
| Override to receive mouse-move events.
virtual void | mouseDrag (MouseEvent event)
| Override to receive mouse-drag events.
virtual void | keyDown (KeyEvent event)
| Override to receive key-down events.
virtual void | keyUp (KeyEvent event)
| Override to receive key-up events.
virtual void | resize (int width, int height)
| Override to receive window resize events.
virtual void | fileDrop (FileDropEvent event)
| Override to receive file-drop events.
virtual void | quit ()=0
| Quits the application gracefully.
void | addListener (Listener *listener)
| Adds a Listener to the App's event listeners. The app `delete`s listener upon its own destruction unless it is removed via removeListener.
void | removeListener (Listener *listener)
| Removes a listener from the App's event listeners. Does not `delete` listener.
virtual const Settings & | getSettings () const
Renderer * | getRenderer () const
virtual int | getWindowWidth () const =0
| Returns the width of the App's window measured in pixels, or the screen when in full-screen mode.
virtual void | setWindowWidth (int windowWidth)=0
| Sets the width of the App's window measured in pixels. Ignored in full-screen mode.
virtual int | getWindowHeight () const =0
| Returns the height of the App's window measured in pixels, or the screen when in full-screen mode.
virtual void | setWindowHeight (int windowHeight)=0
| Sets the height of the App's window measured in pixels. Ignored in full-screen mode.
virtual void | setWindowSize (int windowWidth, int windowHeight)=0
| Sets the size of the App's window. Ignored in full-screen mode.
void | setWindowSize (const Vec2i &size)
| Sets the size of the App's window. Ignored in full-screen mode.
Vec2f | getWindowCenter () const
| Returns the center of the App's window or the screen in full-screen mode.
Vec2i | getWindowSize () const
| Returns the size of the App's window or the screen in full-screen mode.
float | getWindowAspectRatio () const
| Returns the aspect ratio of the App's window or the screen in full-screen mode.
Area | getWindowBounds () const
| Returns the bounding area of the App's window or the screen in full-screen mode.
virtual float | getFrameRate () const =0
| Returns the maximum frame-rate the App will attempt to maintain.
virtual void | setFrameRate (float aFrameRate)=0
| Sets the maximum frame-rate the App will attempt to maintain.
virtual bool | isFullScreen () const =0
| Returns whether the App is in full-screen mode or not.
virtual void | setFullScreen (bool aFullScreen)=0
| Sets whether the active App is in full-screen mode based on fullScreen.
double | getElapsedSeconds () const
| Returns the number of seconds which have elapsed since application launch.
uint32_t | getElapsedFrames () const
| Returns the number of animation frames which have elapsed since application launch.
std::string | getResourcePath (const std::string &rsrcRelativePath)
virtual std::string | getAppPath ()=0
| Returns the path to the application on disk.
std::string | getOpenFilePath (const std::string &initialPath="", std::vector< std::string > extensions=std::vector< std::string >())
| Presents the user with a file-open dialog and returns the selected file path.
std::string | getSaveFilePath (const std::string &initialPath="", std::vector< std::string > extensions=std::vector< std::string >())
| Presents the user with a file-save dialog and returns the selected file path.
std::ostream & | console ()
| Returns a reference to an output console, which is an alias to std::cout on the mac, and a wrapper around OutputDebugString on MSW.
Surface | copyWindowSurface ()
Surface | copyWindowSurface (const Area &area)
void | restoreWindowContext ()
| 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 | getsWindowsPaintEvents ()=0
virtual bool | receivesEvents () const
## Static Public Member Functions
static DataSourceRef | loadResource (const std::string &macPath, int mswID, const std::string &mswType)
static DataSourcePathRef | loadResource (const std::string &macPath)
static DataSourceBufferRef | loadResource (int mswID, const std::string &mswType)
static App * | get ()
| Returns a pointer to the active App.

## Constructor & Destructor Documentation

cinder::app::AppCinderView::AppCinderView | ( |  | ) |

## Member Function Documentation

void cinder::app::AppCinderView::launchApplication | ( | CinderView * | cinderView,
|  | Renderer * | renderer |
| ) |  |  |

void cinder::app::AppCinderView::prepareSettings | ( | Settings * | settings | ) |

virtual Settings& cinder::app::AppCinderView::getSettings | ( |  | ) | `[virtual]`

virtual void cinder::app::App::setup | ( |  | ) | `[virtual, inherited]`

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

virtual void cinder::app::App::shutdown | ( |  | ) | `[virtual, inherited]`

Override to perform any application cleanup before exiting.

virtual void cinder::app::App::update | ( |  | ) | `[virtual, inherited]`

Override to perform any once-per-loop computation.

virtual void cinder::app::App::draw | ( |  | ) | `[virtual, inherited]`

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

virtual void cinder::app::App::mouseDown | ( | MouseEvent | event | ) | `[virtual, inherited]`

Override to receive mouse-down events.

virtual void cinder::app::App::mouseUp | ( | MouseEvent | event | ) | `[virtual, inherited]`

Override to receive mouse-up events.

virtual void cinder::app::App::mouseWheel | ( | MouseEvent | event | ) | `[virtual, inherited]`

Override to receive mouse-wheel events.

virtual void cinder::app::App::mouseMove | ( | MouseEvent | event | ) | `[virtual, inherited]`

Override to receive mouse-move events.

virtual void cinder::app::App::mouseDrag | ( | MouseEvent | event | ) | `[virtual, inherited]`

Override to receive mouse-drag events.

virtual void cinder::app::App::keyDown | ( | KeyEvent | event | ) | `[virtual, inherited]`

Override to receive key-down events.

virtual void cinder::app::App::keyUp | ( | KeyEvent | event | ) | `[virtual, inherited]`

Override to receive key-up events.

virtual void cinder::app::App::resize | ( | int | width,
|  | int | height |
| ) |  |  | `[virtual, inherited]`

Override to receive window resize events.

virtual void cinder::app::App::fileDrop | ( | FileDropEvent | event | ) | `[virtual, inherited]`

Override to receive file-drop events.

virtual void cinder::app::App::quit | ( |  | ) | `[pure virtual, inherited]`

Quits the application gracefully.

Implemented in cinder::app::AppBasic, cinder::app::AppCocoaTouch, and cinder::app::AppScreenSaver.

void cinder::app::App::addListener | ( | Listener * | listener | ) | `[inherited]`

Adds a Listener to the App's event listeners. The app `delete`s listener upon its own destruction unless it is removed via removeListener.

void cinder::app::App::removeListener | ( | Listener * | listener | ) | `[inherited]`

Removes a listener from the App's event listeners. Does not `delete` listener.

virtual const Settings& cinder::app::App::getSettings | ( |  | ) | const`[virtual, inherited]`

Reimplemented in cinder::app::AppBasic, and cinder::app::AppScreenSaver.

Renderer* cinder::app::App::getRenderer | ( |  | ) | const`[inherited]`

virtual int cinder::app::App::getWindowWidth | ( |  | ) | const`[pure virtual, inherited]`

Returns the width of the App's window measured in pixels, or the screen when in full-screen mode.

Implemented in cinder::app::AppBasic, cinder::app::AppCocoaTouch, and cinder::app::AppScreenSaver.

virtual void cinder::app::App::setWindowWidth | ( | int | windowWidth | ) | `[pure virtual, inherited]`

Sets the width of the App's window measured in pixels. Ignored in full-screen mode.

Implemented in cinder::app::AppBasic, cinder::app::AppCocoaTouch, and cinder::app::AppScreenSaver.

virtual int cinder::app::App::getWindowHeight | ( |  | ) | const`[pure virtual, inherited]`

Returns the height of the App's window measured in pixels, or the screen when in full-screen mode.

Implemented in cinder::app::AppBasic, cinder::app::AppCocoaTouch, and cinder::app::AppScreenSaver.

virtual void cinder::app::App::setWindowHeight | ( | int | windowHeight | ) | `[pure virtual, inherited]`

Sets the height of the App's window measured in pixels. Ignored in full-screen mode.

Implemented in cinder::app::AppBasic, cinder::app::AppCocoaTouch, and cinder::app::AppScreenSaver.

virtual void cinder::app::App::setWindowSize | ( | int | windowWidth,
|  | int | windowHeight |
| ) |  |  | `[pure virtual, inherited]`

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

Implemented in cinder::app::AppBasic, cinder::app::AppCocoaTouch, and cinder::app::AppScreenSaver.

void cinder::app::App::setWindowSize | ( | const Vec2i & | size | ) | `[inherited]`

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

Vec2f cinder::app::App::getWindowCenter | ( |  | ) | const`[inherited]`

Returns the center of the App's window or the screen in full-screen mode.

Equivalent to

     Vec2f( getWindowWidth() * 0.5, getWindowHeight() * 0.5 )

Vec2i cinder::app::App::getWindowSize | ( |  | ) | const`[inherited]`

Returns the size of the App's window or the screen in full-screen mode.

float cinder::app::App::getWindowAspectRatio | ( |  | ) | const`[inherited]`

Returns the aspect ratio of the App's window or the screen in full-screen mode.

Area cinder::app::App::getWindowBounds | ( |  | ) | const`[inherited]`

Returns the bounding area of the App's window or the screen in full-screen mode.

Equivalent to

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

virtual float cinder::app::App::getFrameRate | ( |  | ) | const`[pure virtual, inherited]`

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

Implemented in cinder::app::AppBasic, cinder::app::AppCocoaTouch, and cinder::app::AppScreenSaver.

virtual void cinder::app::App::setFrameRate | ( | float | aFrameRate | ) | `[pure virtual, inherited]`

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

Implemented in cinder::app::AppBasic, cinder::app::AppCocoaTouch, and cinder::app::AppScreenSaver.

virtual bool cinder::app::App::isFullScreen | ( |  | ) | const`[pure virtual, inherited]`

Returns whether the App is in full-screen mode or not.

Implemented in cinder::app::AppBasic, cinder::app::AppCocoaTouch, and cinder::app::AppScreenSaver.

virtual void cinder::app::App::setFullScreen | ( | bool | aFullScreen | ) | `[pure virtual, inherited]`

Sets whether the active App is in full-screen mode based on fullScreen.

Implemented in cinder::app::AppBasic, cinder::app::AppCocoaTouch, and cinder::app::AppScreenSaver.

double cinder::app::App::getElapsedSeconds | ( |  | ) | const`[inherited]`

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

Reimplemented in cinder::app::AppCocoaTouch.

uint32_t cinder::app::App::getElapsedFrames | ( |  | ) | const`[inherited]`

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

DataSourceRef cinder::app::App::loadResource | ( | const std::string & | macPath,
|  | int | mswID,
|  | const std::string & | mswType |
| ) |  |  | `[static, inherited]`

DataSourcePathRef cinder::app::App::loadResource | ( | const std::string & | macPath | ) | `[static, inherited]`

DataSourceBufferRef cinder::app::App::loadResource | ( | int | mswID,
|  | const std::string & | mswType |
| ) |  |  | `[static, inherited]`

string cinder::app::App::getResourcePath | ( | const std::string & | rsrcRelativePath | ) | `[inherited]`

virtual std::string cinder::app::App::getAppPath | ( |  | ) | `[pure virtual, inherited]`

Returns the path to the application on disk.

Implemented in cinder::app::AppBasic, cinder::app::AppCocoaTouch, and cinder::app::AppScreenSaver.

string cinder::app::App::getOpenFilePath | ( | const std::string & | initialPath = `""`,
|  | std::vector< std::string > | extensions = `std::vector<std::string>()` |
| ) |  |  | `[inherited]`

Presents the user with a file-open 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. If the active app is in full-screen mode it will temporarily switch to windowed-mode to present the dialog.

Returns:
  the selected file path or an empty string if the user cancelled.

string cinder::app::App::getSaveFilePath | ( | const std::string & | initialPath = `""`,
|  | std::vector< std::string > | extensions = `std::vector<std::string>()` |
| ) |  |  | `[inherited]`

Presents the user with a file-save 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. If the active app is in full-screen mode it will temporarily switch to windowed-mode to present the dialog.

Returns:
  the selected file path or an empty string if the user cancelled.

std::ostream & cinder::app::App::console | ( |  | ) | `[inherited]`

Returns a reference to an output console, which is an alias to std::cout on the mac, and a wrapper around OutputDebugString on MSW.

Surface cinder::app::App::copyWindowSurface | ( |  | ) | `[inherited]`

Returns:
  a copy of the window's contents as a Surface8u

Surface cinder::app::App::copyWindowSurface | ( | const Area & | area | ) | `[inherited]`

Returns:
  a copy of the Area area from the window's contents as a Surface8u

void cinder::app::App::restoreWindowContext | ( |  | ) | `[inherited]`

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::App::getsWindowsPaintEvents | ( |  | ) | `[pure virtual, inherited]`

Implemented in cinder::app::AppBasic, and cinder::app::AppScreenSaver.

virtual bool cinder::app::App::receivesEvents | ( |  | ) | const`[virtual, inherited]`

Reimplemented in cinder::app::AppScreenSaver.

static App* cinder::app::App::get | ( |  | ) | `[static, inherited]`

Returns a pointer to the active App.

Reimplemented in cinder::app::AppBasic, and cinder::app::AppCocoaTouch.

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

- include/cinder/app/AppCinderView.h
- src/cinder/app/AppCinderView.cpp