コード例 #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();

	}
}
コード例 #4
0
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);
}