32 #if defined( CINDER_MAC )
33 #include <OpenGL/CGLTypes.h>
45 namespace cinder {
namespace app {
76 #if defined( CINDER_MSW )
77 void enableConsoleWindow(
bool enable =
true ) { mEnableMswConsole =
enable; }
80 bool isConsoleWindowEnabled()
const {
return mEnableMswConsole; }
94 bool mQuitOnLastWindowClose;
95 #if defined( CINDER_MSW )
96 bool mEnableMswConsole;
150 #if defined( CINDER_WINRT)
157 #if defined( CINDER_MAC )
160 bool privateShouldQuit();
162 #if defined( CINDER_MSW )
163 virtual bool getsWindowsPaintEvents() {
return true; }
172 static void prepareLaunch() { App::prepareLaunch(); }
173 #if defined( CINDER_MSW )
175 #elif defined( CINDER_WINRT )
177 #elif defined( CINDER_MAC )
178 static void executeLaunch(
AppBasic *app,
RendererRef renderer,
const char *title,
int argc,
char *
const argv[] ) {
App::sInstance =
sInstance = app; App::executeLaunch( app, renderer, title, argc, argv ); }
180 static void cleanupLaunch() { App::cleanupLaunch(); }
182 virtual void launch(
const char *title,
int argc,
char *
const argv[] );
190 #if defined( CINDER_MAC )
192 #elif defined( CINDER_MSW )
195 #elif defined ( CINDER_WINRT )
209 #if defined( CINDER_MAC )
210 #define CINDER_APP_BASIC( APP, RENDERER ) \
211 int main( int argc, char * const argv[] ) { \
212 cinder::app::AppBasic::prepareLaunch(); \
213 cinder::app::AppBasic *app = new APP; \
214 cinder::app::RendererRef ren( new RENDERER ); \
215 cinder::app::AppBasic::executeLaunch( app, ren, #APP, argc, argv ); \
216 cinder::app::AppBasic::cleanupLaunch(); \
219 #elif defined( CINDER_MSW )
220 #define CINDER_APP_BASIC( APP, RENDERER ) \
221 int WINAPI WinMain(HINSTANCE hInstance,HINSTANCE hPrevInstance,LPSTR lpCmdLine,int nCmdShow) { \
222 cinder::app::AppBasic::prepareLaunch(); \
223 cinder::app::AppBasic *app = new APP; \
224 cinder::app::RendererRef ren( new RENDERER ); \
225 cinder::app::AppBasic::executeLaunch( app, ren, #APP ); \
226 cinder::app::AppBasic::cleanupLaunch(); \
229 #elif defined( CINDER_WINRT )
230 #define CINDER_APP_BASIC( APP, RENDERER ) \
231 [Platform::MTAThread] \
232 int main(Platform::Array<Platform::String^>^) { \
233 cinder::app::AppBasic::prepareLaunch(); \
234 cinder::app::AppBasic *app = new APP; \
235 cinder::app::RendererRef ren( new RENDERER ); \
236 cinder::app::AppBasic::executeLaunch( app, ren, #APP ); \
237 cinder::app::AppBasic::cleanupLaunch(); \
BooleanAndEventCombiner EventSignalShouldQuit
Definition: AppBasic.h:47
virtual void quit()
Ceases execution of the application.
Definition: AppBasic.cpp:271
void enable(GLenum state)
Enables the OpenGL State state. Equivalent to calling to glEnable( state );.
Definition: dx.h:198
virtual float getFrameRate() const
Returns the maximum frame-rate the App will attempt to maintain measured in frames-per-second.
Definition: AppBasic.cpp:160
virtual void setFrameRate(float frameRate)
Sets the maximum frame-rate the App will attempt to maintain \ a frameRate frames-per-second.
Definition: AppBasic.cpp:169
EventSignalShouldQuit & getSignalShouldQuit()
This is fired before the app is quit. If any slots return false then the app quitting is canceled...
Definition: AppBasic.h:110
static App * sInstance
Definition: App.h:561
Definition: AppImplWinRTBasic.h:45
bool isQuitOnLastWindowCloseEnabled() const
Returns whether the app quits automatically when its last window is closed. Enabled by default...
Definition: AppBasic.h:91
virtual bool isFrameRateEnabled() const
Returns whether frameRate limiting is enabled.
Definition: AppBasic.cpp:187
void showCursor()
Shows the mouse cursor.
Definition: AppBasic.cpp:260
Definition: AppBasic.h:51
WindowRef createWindow(const Window::Format &format=Window::Format())
Creates a new Window.
Definition: AppBasic.cpp:149
GLuint index
Definition: GLee.h:2259
void setDisplay(DisplayRef display)
Sets the display for the default window.
Definition: AppBasic.h:74
Definition: AppImplCocoaBasic.h:84
void enableMultiTouch(bool enable=true)
Registers the app to receive multiTouch events from the operating system. Disabled by default...
Definition: AppBasic.h:84
AppBasic()
Definition: AppBasic.cpp:45
bool isMultiTouchEnabled() const
Returns whether the app is registered to receive multiTouch events from the operating system...
Definition: AppBasic.h:86
DisplayRef getDisplay() const
Returns the display for the default window.
Definition: AppBasic.h:72
std::shared_ptr< Window > WindowRef
Definition: Event.h:49
virtual void disableFrameRate()
Disables frameRate limiting.
Definition: AppBasic.cpp:178
virtual void prepareSettings(Settings *settings)
Definition: AppBasic.h:107
void enableQuitOnLastWindowClose(bool enable=true)
Sets whether the app quits automatically when its last window is closed. Enabled by default...
Definition: AppBasic.h:89
bool isBorderless() const
Returns whether the default window will be created without a border (chrome/frame) ...
Definition: AppBasic.h:63
virtual app::WindowRef getWindow() const
Gets the currently active Window.
Definition: AppBasic.cpp:229
virtual size_t getNumWindows() const
Returns the number of Windows the app has open.
Definition: AppBasic.cpp:207
void setResizable(bool resizable=true)
Sets the default window to be resizable or not.
Definition: AppBasic.h:61
std::shared_ptr< class Renderer > RendererRef
Definition: Renderer.h:85
Definition: AppBasic.h:49
const Settings & getSettings() const
Definition: AppBasic.h:129
void setAlwaysOnTop(bool alwaysOnTop=true)
Sets whether the default window always remains above all other windows.
Definition: AppBasic.h:69
static AppBasic * sInstance
Definition: AppBasic.h:186
bool isAlwaysOnTop() const
Returns whether the default window always remains above all other windows.
Definition: AppBasic.h:67
std::shared_ptr< class Display > DisplayRef
Definition: Display.h:53
Definition: AppImplCocoaBasic.h:40
void hideCursor()
Hides the mouse cursor.
Definition: AppBasic.cpp:249
Window::Format mDefaultWindowFormat
Definition: App.h:222
Definition: AppImplMswBasic.h:39
bool isResizable() const
Returns whether the default window is resizable.
Definition: AppBasic.h:59
EventSignalShouldQuit mSignalShouldQuit
Definition: AppBasic.h:188
std::shared_ptr< Window > WindowRef
Definition: AppBasic.h:101
std::vector< std::string > mCommandLineArgs
Definition: AppBasic.h:200
void setShouldQuit(bool aShouldQuit=true)
Definition: AppBasic.cpp:295
bool mEnableMultiTouch
Definition: App.h:228
bool isFullScreen()
Definition: AppBasic.h:56
GLenum GLsizei GLenum format
Definition: GLee.h:969
void setBorderless(bool borderless=true)
Sets the default window to be created without a border (chrome/frame)
Definition: AppBasic.h:65
virtual WindowRef getForegroundWindow() const
Gets the foreground Window, which has keyboard and mouse focus.
Definition: AppBasic.cpp:238
virtual WindowRef getWindowIndex(size_t index) const
Gets a Window by index, in the range [0, getNumWindows()).
Definition: AppBasic.cpp:218
virtual fs::path getAppPath() const
Returns the path to the application on disk.
Definition: AppBasic.cpp:196
virtual ~AppBasic()
Definition: AppBasic.cpp:51
Settings()
Definition: AppBasic.cpp:287
Settings mSettings
Definition: AppBasic.h:202
const std::vector< std::string > & getArgs() const
Returns a vector of the command line arguments passed to the app.
Definition: AppBasic.h:136