示例#1
0
void testApp::changeOFRootPressed(bool & pressed){
	if(!pressed){
		askOFRoot();
		cout << getOFRootFromConfig()<<endl;
		setOFRoot(getOFRootFromConfig());
		setupDrawableOFPath();
	}
}
示例#2
0
void ofPg::setup(){
	while(!checkConfigExists()){
		askOFRoot();
	}
	setOFRoot(getOFRootFromConfig());

	addons.open(ofFilePath::join(getOFRoot(),"addons"));
	addons.listDir();
	
	addProject(new CBLinuxProject());
	addProject(new CBWinProject());
	addProject(new visualStudioProject());
	addProject(new xcodeProject());
	addProject(new CodeLiteLinuxProject());
}
示例#3
0
//--------------------------------------------------------------
void testApp::setup(){
    //ofSetLogLevel(OF_LOG_NOTICE);
	project = NULL;

	while(!checkConfigExists()){
		askOFRoot();
	}

	setOFRoot(getOFRootFromConfig());

	setupDrawableOFPath();

	int targ = ofGetTargetPlatform();
	//plat = OF_TARGET_IPHONE;

    setupForTarget(targ);
    if(projectPath!="" || buildAllExamples){
    	for(int i = 0; i < (int)targetsToMake.size(); i++){
			setupForTarget(targetsToMake[i]);
			if(buildAllExamples){
				generateExamples();
			}else{
				project->setup(target);
				project->create(projectPath);
				vector < string > addons;
				parseAddonsDotMake(project->getPath() + "addons.make", addons);
				for (int i = 0; i < (int)addons.size(); i++){
					ofAddon addon;
					addon.fromFS(ofFilePath::join(ofFilePath::join(getOFRoot(), "addons"), addons[i]),target);
					project->addAddon(addon);
				}
				project->save(false);
			}
    	}
        std::exit(0);
    }

#ifndef COMMAND_LINE_ONLY
    panelAddons.setup();
    ofDirectory addons(ofFilePath::join(getOFRoot(),"addons"));
    addons.listDir();
    for(int i=0;i<(int)addons.size();i++){
    	string addon = addons.getName(i);
    	if(addon.find("ofx")==0){
    		ofxToggle * toggle = new ofxToggle();
    		panelAddons.add(toggle->setup(addon,false,300));
    	}
    }

    panelOptions.setup("","settings.xml",ofGetWidth()-panelAddons.getWidth()-10,120);
    panelOptions.add(createProject.setup("create project",300));
    panelOptions.add(updateProject.setup("update project",300));
    panelOptions.add(createAndOpen.setup("create and open project",300));
    panelOptions.add(changeOFRoot.setup("change OF path",300));

    createProject.addListener(this,&testApp::createProjectPressed);
    updateProject.addListener(this,&testApp::updateProjectPressed);
    createAndOpen.addListener(this,&testApp::createAndOpenPressed);
    changeOFRoot.addListener(this,&testApp::changeOFRootPressed);

	examplesPanel.setup("generate examples", "examples.xml", 400, 10);
	examplesPanel.add(generateButton.setup("<--Generate"));
	examplesPanel.add(wincbToggle.setup("win CB projects",ofGetTargetPlatform()==OF_TARGET_WINGCC));
	examplesPanel.add(winvsToggle.setup("win VS projects", ofGetTargetPlatform()==OF_TARGET_WINVS));
	examplesPanel.add(linuxcbToggle.setup("linux CB projects",ofGetTargetPlatform()==OF_TARGET_LINUX));
	examplesPanel.add(linux64cbToggle.setup("linux64 CB projects",ofGetTargetPlatform()==OF_TARGET_LINUX64));
	examplesPanel.add(osxToggle.setup("osx projects",ofGetTargetPlatform()==OF_TARGET_OSX));
	examplesPanel.add(iosToggle.setup("ios projects",ofGetTargetPlatform()==OF_TARGET_IPHONE));

	generateButton.addListener(this,&testApp::generateExamplesCB);

    ofSetVerticalSync(true);
    ofEnableAlphaBlending();
	ofSetFrameRate(60);
#else
	std::exit(0);
#endif
}
void testApp::changeOFRootPressed(bool & pressed){
	if(!pressed) askOFRoot();
}