#include <Window.h>
Classes | |
struct | Format |
Public Member Functions | |
bool | isFullScreen () const |
Returns whether the Window is full-screen or not. More... | |
void | setFullScreen (bool fullScreen=true, const FullScreenOptions &options=FullScreenOptions()) |
Sets the Window to be full-screen or not. More... | |
int32_t | getWidth () const |
Returns the width of the Window in points. More... | |
int32_t | getHeight () const |
Returns the height of the Window in points. More... | |
float | getAspectRatio () const |
Returns the Window aspect ratio, which is its width / height. More... | |
Area | getBounds () const |
Returns the bounding Area of the Window in points: [0,0]-(width,height) More... | |
virtual Vec2i | getSize () const |
Gets the size of the Window measured in points. More... | |
void | setSize (int32_t width, int32_t height) |
Sets the size of the Window to ( width, height ) measured in points. More... | |
void | setSize (const Vec2i &size) |
Sets the size of the Window to size measured in points. More... | |
Vec2i | getPos () const |
Gets the position of the Window's upper-left corner measured in points, relative to the primary display's upper-left corner. More... | |
void | setPos (int32_t x, int32_t y) const |
Sets the position of the Window's upper-left corner relative to the primary display's upper-left corner to (x, y) measured in points. More... | |
void | setPos (const Vec2i &pos) const |
Sets the position of the Window's upper-left corner relative to the primary display's upper-left to pos measured in points. More... | |
Vec2f | getCenter () const |
Returns the center of the Window in its own coordinate system measured in points. More... | |
void | spanAllDisplays () |
Sets the position and size of the Window so that it spans all connected displays. More... | |
float | getContentScale () const |
Returns the multiplier (typically 2 on high-density (Retina) displays, 1 otherwise) mapping points to pixels. More... | |
float | toPixels (float s) const |
Returns a scalar mapped from points to pixels by multiplying by getContentScale() More... | |
Vec2f | toPixels (Vec2f s) const |
Returns a Vec2f mapped from points to pixels by multiplying by getContentScale() More... | |
Vec2i | toPixels (Vec2i s) const |
Returns a Vec2i mapped from points to pixels by multiplying by getContentScale() More... | |
Area | toPixels (const Area &a) const |
Returns an Area mapped from points to pixels by multiplying by getContentScale() More... | |
Rectf | toPixels (const Rectf &a) const |
Returns a Rectf mapped from points to pixels by multiplying by getContentScale() More... | |
float | toPoints (float s) const |
Returns a scalar mapped from pixels to points by dividing by getContentScale() More... | |
Vec2f | toPoints (Vec2f s) const |
Returns a Vec2f mapped from pixels to points by dividing by getContentScale() More... | |
Vec2i | toPoints (Vec2i s) const |
Returns a Vec2i mapped from pixels to points by dividing by getContentScale() More... | |
Area | toPoints (const Area &a) const |
Returns an Area mapped from pixels to points by dividing by getContentScale() More... | |
Rectf | toPoints (const Rectf &a) const |
Returns a Rectf mapped from pixels to points by dividing by getContentScale() More... | |
std::string | getTitle () const |
Returns the Window's title as a UTF-8 string. More... | |
void | setTitle (const std::string &title) |
Sets the Window's title as a UTF-8 string. More... | |
bool | isBorderless () const |
Returns whether the window has a border (chrome/frame) More... | |
void | setBorderless (bool borderless=true) |
Sets whether the window has a border (chrome/frame) More... | |
bool | isAlwaysOnTop () const |
Returns whether the window always remains above all other windows. More... | |
void | setAlwaysOnTop (bool alwaysOnTop=true) |
Sets whether the window always remains above all other windows. More... | |
void | hide () |
Hides the window but does not destroy it. More... | |
void | show () |
Shows a window that was hidden with hide() More... | |
bool | isHidden () const |
Returns whether the window has been hidden with hide() More... | |
void | close () |
Closes and destroys the Window. More... | |
DisplayRef | getDisplay () const |
Returns the Display on which the Window resides. More... | |
RendererRef | getRenderer () const |
Returns the Renderer associated with the Window. More... | |
void * | getNative () const |
Returns the associated NSView on Mac OS X, UIView on iOS, or HWND on MSW. More... | |
EventSignalMouse & | getSignalMouseDown () |
void | emitMouseDown (MouseEvent *event) |
template<typename T , typename Y > | |
signals::connection | connectMouseDown (T fn, Y *inst) |
EventSignalMouse & | getSignalMouseDrag () |
void | emitMouseDrag (MouseEvent *event) |
template<typename T , typename Y > | |
signals::connection | connectMouseDrag (T fn, Y *inst) |
EventSignalMouse & | getSignalMouseUp () |
void | emitMouseUp (MouseEvent *event) |
template<typename T , typename Y > | |
signals::connection | connectMouseUp (T fn, Y *inst) |
EventSignalMouse & | getSignalMouseMove () |
void | emitMouseMove (MouseEvent *event) |
template<typename T , typename Y > | |
signals::connection | connectMouseMove (T fn, Y *inst) |
EventSignalMouse & | getSignalMouseWheel () |
void | emitMouseWheel (MouseEvent *event) |
template<typename T , typename Y > | |
signals::connection | connectMouseWheel (T fn, Y *inst) |
EventSignalTouch & | getSignalTouchesBegan () |
void | emitTouchesBegan (TouchEvent *event) |
template<typename T , typename Y > | |
signals::connection | connectTouchesBegan (T fn, Y *inst) |
EventSignalTouch & | getSignalTouchesMoved () |
void | emitTouchesMoved (TouchEvent *event) |
template<typename T , typename Y > | |
signals::connection | connectTouchesMoved (T fn, Y *inst) |
EventSignalTouch & | getSignalTouchesEnded () |
void | emitTouchesEnded (TouchEvent *event) |
template<typename T , typename Y > | |
signals::connection | connectTouchesEnded (T fn, Y *inst) |
const std::vector < TouchEvent::Touch > & | getActiveTouches () const |
Returns a std::vector of all active touches. More... | |
EventSignalKey & | getSignalKeyDown () |
void | emitKeyDown (KeyEvent *event) |
template<typename T , typename Y > | |
signals::connection | connectKeyDown (T fn, Y *inst) |
EventSignalKey & | getSignalKeyUp () |
void | emitKeyUp (KeyEvent *event) |
template<typename T , typename Y > | |
signals::connection | connectKeyUp (T fn, Y *inst) |
EventSignalWindow & | getSignalDraw () |
void | emitDraw () |
Fires the 'draw' signal. Note in general this should not be called directly as it doesn't perform all necessary setup. More... | |
template<typename T , typename Y > | |
signals::connection | connectDraw (T fn, Y *inst) |
EventSignalWindow & | getSignalPostDraw () |
Returns the signal which is emitted after the draw signal and app's draw() virtual method. More... | |
template<typename T , typename Y > | |
signals::connection | connectPostDraw (T fn, Y *inst) |
EventSignalWindow & | getSignalMove () |
void | emitMove () |
template<typename T , typename Y > | |
signals::connection | connectMove (T fn, Y *inst) |
EventSignalWindow & | getSignalResize () |
void | emitResize () |
template<typename T , typename Y > | |
signals::connection | connectResize (T fn, Y *inst) |
EventSignalWindow & | getSignalDisplayChange () |
void | emitDisplayChange () |
template<typename T , typename Y > | |
signals::connection | connectDisplayChange (T fn, Y *inst) |
EventSignalWindow & | getSignalClose () |
Returns the Signal emitted whenever a Window is closing. The WindowRef parameter is still valid at this point but its renderer is not. More... | |
void | emitClose () |
Fires the 'close' signal. More... | |
template<typename T , typename Y > | |
signals::connection | connectClose (T fn, Y *inst) |
EventSignalFileDrop & | getSignalFileDrop () |
void | emitFileDrop (FileDropEvent *event) |
template<typename T , typename Y > | |
signals::connection | connectFileDrop (T fn, Y *inst) |
template<typename T > | |
T * | getUserData () |
Returns the window-specific data associated with this Window. More... | |
template<typename T > | |
void | setUserData (T *userData) |
Sets the window-specific data associated with this Window. The variable is deleted upon destruction of the Window. More... | |
bool | isValid () const |
Returns whether this Window is valid. false means it should no longer be used (neither read nor write) More... | |
void | setInvalid () |
App * | getApp () const |
Protected Member Functions | |
Window () | |
void | testValid () const |
void | setApp (App *app) |
Protected Attributes | |
App * | mApp |
bool | mValid |
std::shared_ptr< void > | mUserData |
EventSignalMouse | mSignalMouseDown |
EventSignalMouse | mSignalMouseDrag |
EventSignalMouse | mSignalMouseUp |
EventSignalMouse | mSignalMouseWheel |
EventSignalMouse | mSignalMouseMove |
EventSignalTouch | mSignalTouchesBegan |
EventSignalTouch | mSignalTouchesMoved |
EventSignalTouch | mSignalTouchesEnded |
EventSignalKey | mSignalKeyDown |
EventSignalKey | mSignalKeyUp |
EventSignalWindow | mSignalDraw |
EventSignalWindow | mSignalPostDraw |
EventSignalWindow | mSignalMove |
EventSignalWindow | mSignalResize |
EventSignalWindow | mSignalDisplayChange |
EventSignalWindow | mSignalClose |
EventSignalFileDrop | mSignalFileDrop |
|
protected |
bool cinder::app::Window::isFullScreen | ( | ) | const |
Returns whether the Window is full-screen or not.
void cinder::app::Window::setFullScreen | ( | bool | fullScreen = true , |
const FullScreenOptions & | options = FullScreenOptions() |
||
) |
Sets the Window to be full-screen or not.
int32_t cinder::app::Window::getWidth | ( | ) | const |
Returns the width of the Window in points.
int32_t cinder::app::Window::getHeight | ( | ) | const |
Returns the height of the Window in points.
float cinder::app::Window::getAspectRatio | ( | ) | const |
Returns the Window aspect ratio, which is its width / height.
Area cinder::app::Window::getBounds | ( | ) | const |
|
virtual |
Gets the size of the Window measured in points.
void cinder::app::Window::setSize | ( | int32_t | width, |
int32_t | height | ||
) |
Sets the size of the Window to ( width, height ) measured in points.
Sets the size of the Window to size measured in points.
Vec2i cinder::app::Window::getPos | ( | ) | const |
Gets the position of the Window's upper-left corner measured in points, relative to the primary display's upper-left corner.
void cinder::app::Window::setPos | ( | int32_t | x, |
int32_t | y | ||
) | const |
Sets the position of the Window's upper-left corner relative to the primary display's upper-left corner to (x, y) measured in points.
Sets the position of the Window's upper-left corner relative to the primary display's upper-left to pos measured in points.
Vec2f cinder::app::Window::getCenter | ( | ) | const |
Returns the center of the Window in its own coordinate system measured in points.
void cinder::app::Window::spanAllDisplays | ( | ) |
Sets the position and size of the Window so that it spans all connected displays.
float cinder::app::Window::getContentScale | ( | ) | const |
Returns the multiplier (typically 2 on high-density (Retina) displays, 1 otherwise) mapping points to pixels.
float cinder::app::Window::toPixels | ( | float | s | ) | const |
Returns a scalar mapped from points to pixels by multiplying by getContentScale()
Returns a Vec2f mapped from points to pixels by multiplying by getContentScale()
Returns a Vec2i mapped from points to pixels by multiplying by getContentScale()
Returns an Area mapped from points to pixels by multiplying by getContentScale()
Returns a Rectf mapped from points to pixels by multiplying by getContentScale()
float cinder::app::Window::toPoints | ( | float | s | ) | const |
Returns a scalar mapped from pixels to points by dividing by getContentScale()
Returns a Vec2f mapped from pixels to points by dividing by getContentScale()
Returns a Vec2i mapped from pixels to points by dividing by getContentScale()
Returns an Area mapped from pixels to points by dividing by getContentScale()
Returns a Rectf mapped from pixels to points by dividing by getContentScale()
std::string cinder::app::Window::getTitle | ( | ) | const |
Returns the Window's title as a UTF-8 string.
void cinder::app::Window::setTitle | ( | const std::string & | title | ) |
Sets the Window's title as a UTF-8 string.
bool cinder::app::Window::isBorderless | ( | ) | const |
Returns whether the window has a border (chrome/frame)
void cinder::app::Window::setBorderless | ( | bool | borderless = true | ) |
Sets whether the window has a border (chrome/frame)
bool cinder::app::Window::isAlwaysOnTop | ( | ) | const |
Returns whether the window always remains above all other windows.
void cinder::app::Window::setAlwaysOnTop | ( | bool | alwaysOnTop = true | ) |
Sets whether the window always remains above all other windows.
void cinder::app::Window::hide | ( | ) |
Hides the window but does not destroy it.
bool cinder::app::Window::isHidden | ( | ) | const |
Returns whether the window has been hidden with hide()
DisplayRef cinder::app::Window::getDisplay | ( | ) | const |
RendererRef cinder::app::Window::getRenderer | ( | ) | const |
void * cinder::app::Window::getNative | ( | ) | const |
Returns the associated NSView on Mac OS X, UIView on iOS, or HWND on MSW.
EventSignalMouse& cinder::app::Window::getSignalMouseDown | ( | ) |
void cinder::app::Window::emitMouseDown | ( | MouseEvent * | event | ) |
signals::connection cinder::app::Window::connectMouseDown | ( | T | fn, |
Y * | inst | ||
) |
EventSignalMouse& cinder::app::Window::getSignalMouseDrag | ( | ) |
void cinder::app::Window::emitMouseDrag | ( | MouseEvent * | event | ) |
signals::connection cinder::app::Window::connectMouseDrag | ( | T | fn, |
Y * | inst | ||
) |
EventSignalMouse& cinder::app::Window::getSignalMouseUp | ( | ) |
void cinder::app::Window::emitMouseUp | ( | MouseEvent * | event | ) |
signals::connection cinder::app::Window::connectMouseUp | ( | T | fn, |
Y * | inst | ||
) |
EventSignalMouse& cinder::app::Window::getSignalMouseMove | ( | ) |
void cinder::app::Window::emitMouseMove | ( | MouseEvent * | event | ) |
signals::connection cinder::app::Window::connectMouseMove | ( | T | fn, |
Y * | inst | ||
) |
EventSignalMouse& cinder::app::Window::getSignalMouseWheel | ( | ) |
void cinder::app::Window::emitMouseWheel | ( | MouseEvent * | event | ) |
signals::connection cinder::app::Window::connectMouseWheel | ( | T | fn, |
Y * | inst | ||
) |
EventSignalTouch& cinder::app::Window::getSignalTouchesBegan | ( | ) |
void cinder::app::Window::emitTouchesBegan | ( | TouchEvent * | event | ) |
signals::connection cinder::app::Window::connectTouchesBegan | ( | T | fn, |
Y * | inst | ||
) |
EventSignalTouch& cinder::app::Window::getSignalTouchesMoved | ( | ) |
void cinder::app::Window::emitTouchesMoved | ( | TouchEvent * | event | ) |
signals::connection cinder::app::Window::connectTouchesMoved | ( | T | fn, |
Y * | inst | ||
) |
EventSignalTouch& cinder::app::Window::getSignalTouchesEnded | ( | ) |
void cinder::app::Window::emitTouchesEnded | ( | TouchEvent * | event | ) |
signals::connection cinder::app::Window::connectTouchesEnded | ( | T | fn, |
Y * | inst | ||
) |
const std::vector< TouchEvent::Touch > & cinder::app::Window::getActiveTouches | ( | ) | const |
Returns a std::vector of all active touches.
EventSignalKey& cinder::app::Window::getSignalKeyDown | ( | ) |
signals::connection cinder::app::Window::connectKeyDown | ( | T | fn, |
Y * | inst | ||
) |
EventSignalKey& cinder::app::Window::getSignalKeyUp | ( | ) |
signals::connection cinder::app::Window::connectKeyUp | ( | T | fn, |
Y * | inst | ||
) |
EventSignalWindow& cinder::app::Window::getSignalDraw | ( | ) |
void cinder::app::Window::emitDraw | ( | ) |
Fires the 'draw' signal. Note in general this should not be called directly as it doesn't perform all necessary setup.
signals::connection cinder::app::Window::connectDraw | ( | T | fn, |
Y * | inst | ||
) |
EventSignalWindow& cinder::app::Window::getSignalPostDraw | ( | ) |
Returns the signal which is emitted after the draw signal and app's draw() virtual method.
signals::connection cinder::app::Window::connectPostDraw | ( | T | fn, |
Y * | inst | ||
) |
EventSignalWindow& cinder::app::Window::getSignalMove | ( | ) |
void cinder::app::Window::emitMove | ( | ) |
signals::connection cinder::app::Window::connectMove | ( | T | fn, |
Y * | inst | ||
) |
EventSignalWindow& cinder::app::Window::getSignalResize | ( | ) |
void cinder::app::Window::emitResize | ( | ) |
signals::connection cinder::app::Window::connectResize | ( | T | fn, |
Y * | inst | ||
) |
EventSignalWindow& cinder::app::Window::getSignalDisplayChange | ( | ) |
void cinder::app::Window::emitDisplayChange | ( | ) |
signals::connection cinder::app::Window::connectDisplayChange | ( | T | fn, |
Y * | inst | ||
) |
EventSignalWindow& cinder::app::Window::getSignalClose | ( | ) |
Returns the Signal emitted whenever a Window is closing. The WindowRef parameter is still valid at this point but its renderer is not.
void cinder::app::Window::emitClose | ( | ) |
Fires the 'close' signal.
signals::connection cinder::app::Window::connectClose | ( | T | fn, |
Y * | inst | ||
) |
EventSignalFileDrop& cinder::app::Window::getSignalFileDrop | ( | ) |
void cinder::app::Window::emitFileDrop | ( | FileDropEvent * | event | ) |
signals::connection cinder::app::Window::connectFileDrop | ( | T | fn, |
Y * | inst | ||
) |
T* cinder::app::Window::getUserData | ( | ) |
Returns the window-specific data associated with this Window.
void cinder::app::Window::setUserData | ( | T * | userData | ) |
bool cinder::app::Window::isValid | ( | ) | const |
Returns whether this Window is valid. false
means it should no longer be used (neither read nor write)
void cinder::app::Window::setInvalid | ( | ) |
App* cinder::app::Window::getApp | ( | ) | const |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |