Cinder  0.8.6
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
Classes | Typedefs | Enumerations | Functions | Variables
cinder::app Namespace Reference

Classes

class  App
 
class  AppBasic
 
class  AppCocoaTouch
 
class  AppCocoaView
 
class  AppImplMsw
 
class  AppImplMswBasic
 
class  AppImplMswRenderer
 
class  AppImplMswRendererDx
 
class  AppImplMswRendererGdi
 
class  AppImplMswRendererGl
 
class  AppImplMswScreenSaver
 
class  AppImplWinRT
 
class  AppImplWinRTBasic
 
class  AppScreenSaver
 
class  AssetLoadExc
 Exception for failed asset loading. More...
 
struct  BitwiseAndEventCombiner
 Returns a bitmask where in order for the bit in type T to be be 1, it has to be 1 from all slot. Returns 0 if there are no slots. More...
 
class  BlankingWindow
 
struct  BooleanAndEventCombiner
 Returns true if all slots return true, else false. Does not short-circuit. Returns true if there are no slots. More...
 
struct  BooleanOrEventCombiner
 Returns true if any slots return true, else false. Does not short-circuit. Returns true if there are no slots. More...
 
class  Event
 Base class for all Events. More...
 
struct  EventCombiner
 
class  ExcInvalidWindow
 Thrown when an operation is performed on a WindowRef which refers to an invalid Window. More...
 
class  FileDropEvent
 Represents a file-drop event, typically received from Windows Explorer or Mac OS X Finder. More...
 
struct  FullScreenOptions
 Options passed when entering fullscreen. More...
 
class  KeyEvent
 Represents a keyboard event. More...
 
class  MouseEvent
 Represents a mouse event. More...
 
class  Renderer
 
class  RendererDx
 
class  RendererGl
 
class  ResourceLoadExc
 Exception for failed resource loading. More...
 
class  TouchEvent
 Represents a touch event. More...
 
class  Window
 
class  WindowImplMsw
 
class  WindowImplMswBasic
 
class  WindowImplMswScreenSaver
 
class  WindowImplWinRT
 
class  WindowImplWinRTBasic
 

Typedefs

typedef std::shared_ptr< class
BlankingWindow
BlankingWindowRef
 
typedef std::shared_ptr< WindowWindowRef
 
typedef std::shared_ptr< class
Renderer
RendererRef
 
typedef std::shared_ptr< class
RendererGl
RendererGlRef
 
typedef std::shared_ptr< class
Renderer2d > 
Renderer2dRef
 
typedef std::shared_ptr< class
RendererDx
RendererDxRef
 

Enumerations

enum  InterfaceOrientation {
  Unknown = 0, Portrait = 1 << 0, PortraitUpsideDown = 1 << 1, LandscapeLeft = 1 << 2,
  LandscapeRight = 1 << 3, PortraitAll = (Portrait | PortraitUpsideDown), LandscapeAll = (LandscapeLeft | LandscapeRight), All = (PortraitAll | LandscapeAll)
}
 

Functions

std::ostream & operator<< (std::ostream &lhs, const InterfaceOrientation &rhs)
 Stream InterfacefaceOrientation enum to std::ostream. More...
 
float getOrientationDegrees (InterfaceOrientation orientation)
 returns the degrees rotation from Portrait for the provided orientation More...
 
std::ostream & operator<< (std::ostream &out, const FileDropEvent &event)
 
std::ostream & operator<< (std::ostream &out, const TouchEvent::Touch &touch)
 
std::ostream & operator<< (std::ostream &out, const TouchEvent &event)
 
LRESULT CALLBACK WndProc (HWND mWnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
 
LRESULT CALLBACK BlankingWndProc (HWND mWnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
 
unsigned int prepMouseEventModifiers (WPARAM wParam)
 
int prepNativeKeyCode (WPARAM wParam)
 
WCHAR mapVirtualKey (WPARAM wParam)
 
unsigned int prepKeyEventModifiers ()
 
HWND createDummyWindow (int *width, int *height, bool fullscreen)
 
unsigned int prepPointerEventModifiers (PointerEventArgs^args)
 
App Free Functions

Convenience methods which mirror App member-functions and apply to the active application

WindowRef getWindow ()
 Returns the number of Windows the app has open. More...
 
size_t getNumWindows ()
 Returns the number of Windows the app has open. More...
 
WindowRef getWindowIndex (size_t index)
 Gets a Window by index, in the range [0, getNumWindows()). More...
 
int getWindowWidth ()
 Returns the width of the active App's window measured in points, or of the screen when in full-screen mode. More...
 
void setWindowPos (const Vec2i &windowPos)
 Sets the position of the active App's window measured in points. Ignored in full-screen mode. More...
 
void setWindowPos (int x, int y)
 Sets the position of the active App's window measured in points. Ignored in full-screen mode. More...
 
int getWindowHeight ()
 Returns the height of the active App's window measured in points, or the screen when in full-screen mode. More...
 
void setWindowSize (int windowWidth, int windowHeight)
 Sets the size of the active App's window in points. Ignored in full-screen mode. More...
 
Vec2f getWindowCenter ()
 Returns the center of the active App's window in pixels or of the screen in full-screen mode. More...
 
Vec2i getWindowSize ()
 Returns the size of the active App's window or the screen in full-screen mode measured in points. More...
 
Vec2i getWindowPos ()
 Returns the position of the active App's window measured in points. More...
 
float getWindowAspectRatio ()
 Returns the aspect ratio of the active App's window or the screen in full-screen mode. More...
 
Area getWindowBounds ()
 Returns the bounding area of the active App's window or the screen in full-screen mode measured in points. More...
 
float getWindowContentScale ()
 Returns the contentScale of the active App's window, which is the multiplier that maps points to pixels. More...
 
float getFrameRate ()
 Returns the maximum frame-rate the active App will attempt to maintain. More...
 
void setFrameRate (float frameRate)
 Sets the maximum frame-rate the active App will attempt to maintain. More...
 
bool isFullScreen ()
 Returns whether the active App is in full-screen mode or not. More...
 
void setFullScreen (bool fullScreen=true)
 Sets whether the active App is in full-screen mode based on fullScreen. More...
 
float toPixels (float s)
 Returns a scalar mapped from points to pixels for the current Window. More...
 
Vec2f toPixels (Vec2f s)
 Returns a Vec2f mapped from points to pixels for the current Window. More...
 
Vec2i toPixels (Vec2i s)
 Returns a Vec2i mapped from points to pixels for the current Window. More...
 
Area toPixels (const Area &a)
 Returns an Area mapped from points to pixels for the current Window. More...
 
Rectf toPixels (const Rectf &a)
 Returns a Rectf mapped from points to pixels for the current Window. More...
 
float toPoints (float s)
 Returns a scalar mapped from pixels to points for the current Window. More...
 
Vec2f toPoints (Vec2f s)
 Returns a Vec2f mapped from pixels to points for the current Window. More...
 
Vec2i toPoints (Vec2i s)
 Returns a Vec2i mapped from pixels to points for the current Window. More...
 
Area toPoints (const Area &a)
 Returns an Area mapped from pixels to points for the current Window. More...
 
Rectf toPoints (const Rectf &a)
 Returns a Rectf mapped from pixels to points for the current Window. More...
 
double getElapsedSeconds ()
 Returns the number seconds which have elapsed since the active App launched. More...
 
uint32_t getElapsedFrames ()
 Returns the number of animation frames which have elapsed since the active App launched. More...
 
DataSourceRef loadResource (const std::string &macPath, int mswID, const std::string &mswType)
 Returns a DataSource to an application resource. On Mac OS X, macPath is a path relative to the bundle's resources folder. On Windows, mswID and mswType identify the resource as defined the application's .rc file(s). More...
 
DataSourceRef loadAsset (const fs::path &relativePath)
 Returns a DataSourceRef to the active App's's asset. Throws a AssetLoadExc on failure. More...
 
fs::path getAssetPath (const fs::path &relativePath)
 Returns a fs::path to the active App's asset. Returns an empty path on failure. More...
 
void addAssetDirectory (const fs::path &dirPath)
 Adds an absolute path dirPath to the active App's list of directories which are searched for assets. More...
 
fs::path getAppPath ()
 Returns the path to the active App on disk. More...
 
fs::path getOpenFilePath (const fs::path &initialPath="", std::vector< std::string > extensions=std::vector< std::string >())
 Presents the user with a file-open dialog and returns the selected file path. More...
 
fs::path getSaveFilePath (const fs::path &initialPath="", std::vector< std::string > extensions=std::vector< std::string >())
 Presents the user with a file-save dialog and returns the selected file path. More...
 
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. More...
 
Timelinetimeline ()
 Returns a reference to the active App's Timeline. More...
 
Surface copyWindowSurface ()
 Returns a copy of the current window's contents as a Surface8u. More...
 
Surface copyWindowSurface (const Area &area)
 Returns a copy of the Area area from the current window's contents as a Surface8u. More...
 
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 display a dialog box or some other external window. More...
 

Variables

 __pad0__
 Signal used for retrieving the supported orientations. BitwiseAndEventCombiner is used so that any connection can forbid a certain orientation. More...
 
BooleanAndEventCombiner EventSignalShouldQuit
 
BitwiseAndEventCombiner< uint32_t > EventSignalSupportedOrientations
 
EventCombiner< MouseEventEventSignalMouse
 
 __pad1__
 
EventCombiner< TouchEventEventSignalTouch
 
 __pad2__
 
EventCombiner< KeyEventEventSignalKey
 
 __pad3__
 
EventCombiner< FileDropEventEventSignalFileDrop
 
 __pad4__
 
bool sMultisampleSupported = false
 
int sArbMultisampleFormat
 

Typedef Documentation

typedef std::shared_ptr<class BlankingWindow> cinder::app::BlankingWindowRef
typedef std::shared_ptr< Window > cinder::app::WindowRef
typedef std::shared_ptr<class Renderer> cinder::app::RendererRef
typedef std::shared_ptr<class RendererGl> cinder::app::RendererGlRef
typedef std::shared_ptr<class Renderer2d> cinder::app::Renderer2dRef
typedef std::shared_ptr<class RendererDx> cinder::app::RendererDxRef

Enumeration Type Documentation

Enumerator
Unknown 
Portrait 
PortraitUpsideDown 
LandscapeLeft 
LandscapeRight 
PortraitAll 
LandscapeAll 
All 

Function Documentation

WindowRef cinder::app::getWindow ( )

Returns the number of Windows the app has open.

size_t cinder::app::getNumWindows ( )

Returns the number of Windows the app has open.

WindowRef cinder::app::getWindowIndex ( size_t  index)

Gets a Window by index, in the range [0, getNumWindows()).

int cinder::app::getWindowWidth ( )

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

void cinder::app::setWindowPos ( const Vec2i &  windowPos)

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

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

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

int cinder::app::getWindowHeight ( )

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

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

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

Vec2f cinder::app::getWindowCenter ( )

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

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

Vec2i cinder::app::getWindowSize ( )

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

Vec2i cinder::app::getWindowPos ( )

Returns the position of the active App's window measured in points.

float cinder::app::getWindowAspectRatio ( )

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

Area cinder::app::getWindowBounds ( )

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

Equivalent to

Area( 0, 0, getWindowWidth(), getWindowHeight() );
float cinder::app::getWindowContentScale ( )

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

float cinder::app::getFrameRate ( )

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

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

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

bool cinder::app::isFullScreen ( )

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

void cinder::app::setFullScreen ( bool  fullScreen = true)

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

float cinder::app::toPixels ( float  s)

Returns a scalar mapped from points to pixels for the current Window.

Vec2f cinder::app::toPixels ( Vec2f  s)

Returns a Vec2f mapped from points to pixels for the current Window.

Vec2i cinder::app::toPixels ( Vec2i  s)

Returns a Vec2i mapped from points to pixels for the current Window.

Area cinder::app::toPixels ( const Area &  a)

Returns an Area mapped from points to pixels for the current Window.

Rectf cinder::app::toPixels ( const Rectf &  a)

Returns a Rectf mapped from points to pixels for the current Window.

float cinder::app::toPoints ( float  s)

Returns a scalar mapped from pixels to points for the current Window.

Vec2f cinder::app::toPoints ( Vec2f  s)

Returns a Vec2f mapped from pixels to points for the current Window.

Vec2i cinder::app::toPoints ( Vec2i  s)

Returns a Vec2i mapped from pixels to points for the current Window.

Area cinder::app::toPoints ( const Area &  a)

Returns an Area mapped from pixels to points for the current Window.

Rectf cinder::app::toPoints ( const Rectf &  a)

Returns a Rectf mapped from pixels to points for the current Window.

double cinder::app::getElapsedSeconds ( )

Returns the number seconds which have elapsed since the active App launched.

uint32_t cinder::app::getElapsedFrames ( )

Returns the number of animation frames which have elapsed since the active App launched.

DataSourceRef cinder::app::loadResource ( const std::string macPath,
int  mswID,
const std::string mswType 
)

Returns a DataSource to an application resource. On Mac OS X, macPath is a path relative to the bundle's resources folder. On Windows, mswID and mswType identify the resource as defined the application's .rc file(s).

See also
Assets & Resources in Cinder
DataSourceRef cinder::app::loadAsset ( const fs::path &  relativePath)

Returns a DataSourceRef to the active App's's asset. Throws a AssetLoadExc on failure.

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

Returns a fs::path to the active App's asset. Returns an empty path on failure.

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

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

fs::path cinder::app::getAppPath ( )

Returns the path to the active App on disk.

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

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.
fs::path cinder::app::getSaveFilePath ( const fs::path &  initialPath = "",
std::vector< std::string extensions = std::vector<std::string>() 
)

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::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.

On Mac OS X all output is echoed either to the Debugger Console in XCode or the system console On Windows output is echoed using OutputDebugString, echoed to the Output window of the debugger or to a stream viewable with Dbgview

console() << "This line will be echoed" << std::endl;
Timeline& cinder::app::timeline ( )

Returns a reference to the active App's Timeline.

Surface cinder::app::copyWindowSurface ( )

Returns a copy of the current window's contents as a Surface8u.

Surface cinder::app::copyWindowSurface ( const Area &  area)

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

void cinder::app::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 display a dialog box or some other external window.

std::ostream & cinder::app::operator<< ( std::ostream &  lhs,
const InterfaceOrientation &  rhs 
)

Stream InterfacefaceOrientation enum to std::ostream.

float cinder::app::getOrientationDegrees ( InterfaceOrientation  orientation)

returns the degrees rotation from Portrait for the provided orientation

std::ostream& cinder::app::operator<< ( std::ostream &  out,
const FileDropEvent &  event 
)
std::ostream& cinder::app::operator<< ( std::ostream &  out,
const TouchEvent::Touch &  touch 
)
std::ostream& cinder::app::operator<< ( std::ostream &  out,
const TouchEvent &  event 
)
LRESULT CALLBACK cinder::app::WndProc ( HWND  mWnd,
UINT  uMsg,
WPARAM  wParam,
LPARAM  lParam 
)
LRESULT CALLBACK cinder::app::BlankingWndProc ( HWND  mWnd,
UINT  uMsg,
WPARAM  wParam,
LPARAM  lParam 
)
unsigned int cinder::app::prepMouseEventModifiers ( WPARAM  wParam)
int cinder::app::prepNativeKeyCode ( WPARAM  wParam)
WCHAR cinder::app::mapVirtualKey ( WPARAM  wParam)
unsigned int cinder::app::AppImplWinRT::prepKeyEventModifiers ( )
HWND cinder::app::createDummyWindow ( int width,
int height,
bool  fullscreen 
)
unsigned int cinder::app::prepPointerEventModifiers ( PointerEventArgs^  args)

Variable Documentation

cinder::app::__pad0__

Signal used for retrieving the supported orientations. BitwiseAndEventCombiner is used so that any connection can forbid a certain orientation.

BooleanAndEventCombiner cinder::app::EventSignalShouldQuit
BitwiseAndEventCombiner<uint32_t> cinder::app::EventSignalSupportedOrientations
EventCombiner<MouseEvent> cinder::app::EventSignalMouse
cinder::app::__pad1__
EventCombiner<TouchEvent> cinder::app::EventSignalTouch
cinder::app::__pad2__
EventCombiner<KeyEvent> cinder::app::EventSignalKey
cinder::app::__pad3__
EventCombiner<FileDropEvent> cinder::app::EventSignalFileDrop
cinder::app::__pad4__
bool cinder::app::sMultisampleSupported = false
int cinder::app::sArbMultisampleFormat