예제 #1
0
//------------------------------------------------------------
void ofxAppMacScreenSaver::runAppViaInfiniteLoop(ofBaseApp * appPtr){
	ofAppPtr = appPtr;
	
	ofNotifySetup();
	ofNotifyUpdate();
	
	//glutMainLoop();
}
예제 #2
0
//------------------------------------------------------------
void ofAppGlutWindow::runAppViaInfiniteLoop(ofBaseApp * appPtr){
	ofAppPtr = appPtr;

	ofNotifySetup();
	ofNotifyUpdate();

	glutMainLoop();
}
예제 #3
0
//------------------------------------------------------------
void ofxAppNoWindow::runAppViaInfiniteLoop(ofBaseApp * appPtr){

	ofSetCurrentRenderer(ofPtr<ofBaseRenderer>(new ofNoopRenderer));

	ofAppPtr = appPtr;

	#if defined TARGET_OSX || defined TARGET_LINUX
	// for keyboard
	//set_conio_terminal_mode();
	#endif

	ofNotifySetup();

//    ofLogNotice("ofxAppNoWindow")
//		<< "***" << endl
//		<< "***" << endl
//		<< "*** running a headless (no window) app" << endl
//		<< "***" << endl
//		<< "*** keyboard input works here" << endl
//		<< "***"<< endl
//		<< "*** press Esc or Ctrl-C to quit" << endl
//		<< "***" << endl;

	while (true)
	{
        /// listen for escape
        #ifdef TARGET_WIN32
        if (GetAsyncKeyState(VK_ESCAPE))
            ofNotifyKeyPressed(OF_KEY_ESC);
        #endif

		#if defined TARGET_OSX || defined TARGET_LINUX
		while ( kbhit() )
		{
			int key = getch();
			if ( key == 27 )
			{
				ofNotifyKeyPressed(OF_KEY_ESC);
			}
			else if ( key == /* ctrl-c */ 3 )
			{
				ofLogNotice("ofxAppNoWindow") << "Ctrl-C pressed" << endl;
				OF_EXIT_APP(0);
			}
			else
			{
				ofNotifyKeyPressed(key);
			}
		}
		#endif


		ofNotifyUpdate();
		ofNotifyDraw();

	}
}
void
Java_cc_openframeworks_OFAndroid_setup( JNIEnv*  env, jclass  thiz, jint w, jint h  )
{
	ofLogNotice("ofAppAndroidWindow") << "setup";
	paused = false;
    sWindowWidth  = w;
    sWindowHeight = h;
	ofNotifySetup();
	appSetup = true;
}
예제 #5
0
//------------------------------------------------------------
void ofAppGlutWindow::runAppViaInfiniteLoop(ofBaseApp * appPtr){
	static ofEventArgs voidEventArgs;

	ofAppPtr = appPtr;

	ofNotifySetup();
	ofNotifyUpdate();
	
	glutMainLoop();
}
예제 #6
0
void
Java_cc_openframeworks_OFAndroid_setup( JNIEnv*  env, jclass  thiz, jint w, jint h  )
{
    //initAndroidOF();
	ofLog(OF_LOG_NOTICE,"setup");
	paused = false;
    sWindowWidth  = w;
    sWindowHeight = h;
	ofNotifySetup();
}
예제 #7
0
void ofxFensterManager::runAppViaInfiniteLoop(ofBaseApp* appPtr) {

	ofNotifySetup();
	while(true) {
		ofNotifyUpdate();

		for(vector<ofxFensterPtr>::iterator it = windows.begin(); it != windows.end(); it++) {
			(*it)->display(*it == mainWindow);
		}

		glfwPollEvents();
	}
}
예제 #8
0
//------------------------------------------------------------
void ofxAppMacScreenSaver::setupOpenGL(int w, int h, int screenMode, string dataPath){
	static ofPtr<ofAppBaseWindow> window;	
	window = ofPtr<ofAppBaseWindow>(new ofxScreensaverWindow(w, h));
	ofSetupOpenGL(window, w, h, screenMode);
	int argc = 1;
	char *argv = (char*)"openframeworks";
	char **vptr = &argv;
	//glutInit(&argc, vptr);
	
	
	windowMode = screenMode;
	bNewScreenMode = true;
	ofSetCurrentRenderer(ofPtr<ofBaseRenderer>(new ofGLRenderer(false)));
	ofSetDataPathRoot(dataPath+"/data/");
	ofNotifySetup();
	ofAppPtr->setup();	
	//windowW = glutGet(GLUT_WINDOW_WIDTH);
	//windowH = glutGet(GLUT_WINDOW_HEIGHT);
}