30 #if defined( CINDER_MAC )
38 #elif defined( CINDER_MSW )
47 namespace cinder {
namespace app {
55 #if defined( CINDER_MAC )
57 mProvidesMacConfigDialog( false ),
58 #elif defined( CINDER_MSW )
69 #if defined( CINDER_MAC )
70 void setProvidesMacConfigDialog(
bool provides =
true ) { mProvidesMacConfigDialog = provides; }
73 bool getProvidesMacConfigDialog()
const {
return mProvidesMacConfigDialog; }
82 #if defined( CINDER_MAC )
83 bool mProvidesMacConfigDialog;
88 void launch(
const char *title,
int argc,
char *
const argv[] ) { }
104 #if defined( CINDER_MAC )
105 virtual NSWindow* createMacConfigDialog() {
return NULL; }
107 #elif defined( CINDER_MSW )
108 static BOOL doConfigureDialog( HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam ) {
115 #if defined( CINDER_COCOA )
116 virtual NSBundle* getBundle()
const;
119 virtual void launch(
RendererRef defaultRenderer,
const char *title,
int argc,
char *
const argv[] ) {}
125 #if defined( CINDER_MAC )
127 #elif defined( CINDER_MSW )
131 #if defined( CINDER_MAC )
133 #elif defined( CINDER_MSW )
134 void launch( ::HWND hwnd );
135 virtual bool getsWindowsPaintEvents() {
return false; }
136 class AppImplMswScreenSaver* getImpl() {
return mImpl; }
143 #if defined( CINDER_MAC )
145 #elif defined( CINDER_MSW )
153 #if defined( CINDER_MAC )
155 #define CINDER_APP_SCREENSAVER( APP, RENDERER ) \
157 cinder::app::AppScreenSaver* ScreenSaverFactoryMethod( void *impl ) { \
158 cinder::app::AppScreenSaver *app = new APP; \
159 app->privateSetImpl__( impl ); \
160 cinder::app::AppScreenSaver::executeLaunch( app, RendererRef( new RENDERER ), #APP ); \
164 #elif defined( CINDER_MSW )
165 #define CINDER_APP_SCREENSAVER( APP, RENDERER ) \
166 cinder::app::AppScreenSaver *sScreenSaverMswInstance = 0; \
167 LRESULT CALLBACK ScreenSaverProc( HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam ) { \
168 switch( message ) { \
170 sScreenSaverMswInstance = new APP; \
171 cinder::app::AppScreenSaver::executeLaunch( sScreenSaverMswInstance, RendererRef( new RENDERER ), #APP, hWnd ); return 0; break; \
172 default: if( sScreenSaverMswInstance && sScreenSaverMswInstance->getImpl() ) return sScreenSaverMswInstance->getImpl()->eventHandler( hWnd, message, wParam, lParam ); \
173 else return ::DefScreenSaverProc( hWnd, message, wParam, lParam ); \
176 extern "C" BOOL CALLBACK ScreenSaverConfigureDialog( HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam ) { return APP::doConfigureDialog( hDlg, message, wParam, lParam ); } \
177 extern "C" BOOL CALLBACK RegisterDialogClasses(HANDLE hInst) { return TRUE; }
Definition: AppImplMswScreenSaver.h:37
Settings()
Definition: AppScreenSaver.h:53
void enable(GLenum state)
Enables the OpenGL State state. Equivalent to calling to glEnable( state );.
Definition: dx.h:198
bool mEnableSecondaryDisplayBlanking
Definition: AppScreenSaver.h:81
const Settings & getSettings() const
Definition: AppScreenSaver.h:91
bool isSecondaryDisplayBlankingEnabled() const
Returns whether secondary displays will be blanked (rendered as black) rather than issued draw() call...
Definition: AppScreenSaver.h:67
Definition: AppScreenSaver.h:51
GLuint index
Definition: GLee.h:2259
Definition: AppImplCocoaScreenSaver.h:37
void enableDebug(bool enable=true)
Prevents the screensaver from quitting in response to anything but clicks in its window, and from being the top-most window. Currenty ignored on Mac.
Definition: AppScreenSaver.h:77
std::shared_ptr< Window > WindowRef
Definition: Event.h:49
virtual size_t getNumWindows() const override
Returns the number of Windows the app has open.
Definition: AppScreenSaver.cpp:113
bool mEnableDebug
Definition: AppScreenSaver.h:85
bool isDebugEnabled() const
Definition: AppScreenSaver.h:78
void enableSecondaryDisplayBlanking(bool enable=true)
When enabled, secondary displays are blanked (rendered as black) rather than issued draw() calls...
Definition: AppScreenSaver.h:65
virtual WindowRef getWindowIndex(size_t index) const override
Gets a Window by index, in the range [0, getNumWindows()). Throw ExcInvalidWindow if index is out of ...
Definition: AppScreenSaver.cpp:131
virtual void setFrameRate(float frameRate)
Sets the maximum frame-rate the App will attempt to maintain.
Definition: AppScreenSaver.cpp:79
virtual bool receivesEvents() const
Definition: AppScreenSaver.h:139
virtual void prepareSettings(Settings *settings)
Definition: AppScreenSaver.h:90
std::shared_ptr< class Renderer > RendererRef
Definition: Renderer.h:85
virtual float getFrameRate() const
Returns the maximum frame-rate the App will attempt to maintain.
Definition: AppScreenSaver.cpp:70
bool isPreview() const
Returns whether the ScreenSaver is running in preview mode or not.
Definition: AppScreenSaver.cpp:88
virtual void launch(RendererRef defaultRenderer, const char *title, int argc, char *const argv[])
Definition: AppScreenSaver.h:119
virtual WindowRef getWindow() const override
Returns the the currently active Window. Throws ExcInvalidWindow if called with no active window...
Definition: AppScreenSaver.cpp:122
Definition: AppScreenSaver.h:49
virtual fs::path getAppPath() const
Returns the path to the application on disk.
Definition: AppScreenSaver.cpp:97
void launch(const char *title, int argc, char *const argv[])
Definition: AppScreenSaver.h:88
virtual void quit()
Ignored for ScreenSavers.
Definition: AppScreenSaver.h:102