Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 22 additions & 4 deletions bin/data/settings/projectGeneratorSettings.xml
Original file line number Diff line number Diff line change
@@ -1,6 +1,24 @@

<!-- the path from this EXE / APP to the root folder -->
<appToRoot>../../../../</appToRoot>
<settings>

<!-- from the OF root, where should we encourage people to put apps -->
<defaultNewProjectLocation>apps/myApps</defaultNewProjectLocation>
<base>

<!-- the path from this EXE / APP to the root folder -->
<appToRoot>../../../../</appToRoot>

<!-- do we have multi platforms with this project generator (1) or just the target platform (0)
for a release, we typically do not ship other templates / targets, so for releases the PG shouldn't
support creating projects in other platforms. The git repo does support this. -->

<multiplatform>1</multiplatform>

</base>

<simplePage>

<!-- from the OF root, where should we encourage people to put apps -->
<defaultNewProjectLocation>apps/myApps</defaultNewProjectLocation>

</simplePage>

</settings>
41 changes: 37 additions & 4 deletions projectGenerator.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,9 @@
E4C2424810CC5A17004149E2 /* Cocoa.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = E4C2424510CC5A17004149E2 /* Cocoa.framework */; };
E4C2424910CC5A17004149E2 /* IOKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = E4C2424610CC5A17004149E2 /* IOKit.framework */; };
E4EB6799138ADC1D00A09F29 /* GLUT.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = BBAB23BE13894E4700AA2426 /* GLUT.framework */; };
FD63DC6817B3CEA90023EEB1 /* basePGPage.cpp in Sources */ = {isa = PBXBuildFile; fileRef = FD63DC6417B3CEA90023EEB1 /* basePGPage.cpp */; };
FD63DC6917B3CEA90023EEB1 /* simplePGPage.cpp in Sources */ = {isa = PBXBuildFile; fileRef = FD63DC6617B3CEA90023EEB1 /* simplePGPage.cpp */; };
FD63DC7217B56EE50023EEB1 /* generateProjects.cpp in Sources */ = {isa = PBXBuildFile; fileRef = FD63DC7017B56EE50023EEB1 /* generateProjects.cpp */; };
/* End PBXBuildFile section */

/* Begin PBXContainerItemProxy section */
Expand Down Expand Up @@ -104,7 +107,6 @@
116EA81C150E7288004EBBD3 /* CBLinuxProject.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CBLinuxProject.h; sourceTree = "<group>"; };
119B95D714A65CA0001E1E20 /* pugiconfig.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = pugiconfig.hpp; sourceTree = "<group>"; };
119B95D814A65CA0001E1E20 /* pugixml.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = pugixml.hpp; sourceTree = "<group>"; };
11BCDC821607709900FCCD85 /* textButton.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = textButton.h; sourceTree = "<group>"; };
27C4A1A9179491920031C6E4 /* ofxBaseGui.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = ofxBaseGui.cpp; sourceTree = "<group>"; };
27C4A1AA179491920031C6E4 /* ofxBaseGui.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ofxBaseGui.h; sourceTree = "<group>"; };
27C4A1AB179491920031C6E4 /* ofxButton.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = ofxButton.cpp; sourceTree = "<group>"; };
Expand Down Expand Up @@ -143,6 +145,13 @@
E4C2424610CC5A17004149E2 /* IOKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = IOKit.framework; path = /System/Library/Frameworks/IOKit.framework; sourceTree = "<absolute>"; };
E4EB691F138AFCF100A09F29 /* CoreOF.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; name = CoreOF.xcconfig; path = ../../../libs/openFrameworksCompiled/project/osx/CoreOF.xcconfig; sourceTree = SOURCE_ROOT; };
E4EB6923138AFD0F00A09F29 /* Project.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; path = Project.xcconfig; sourceTree = "<group>"; };
FD63DC6217B3CDF20023EEB1 /* textButton.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = textButton.h; sourceTree = "<group>"; };
FD63DC6417B3CEA90023EEB1 /* basePGPage.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = basePGPage.cpp; sourceTree = "<group>"; };
FD63DC6517B3CEA90023EEB1 /* basePGPage.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = basePGPage.h; sourceTree = "<group>"; };
FD63DC6617B3CEA90023EEB1 /* simplePGPage.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = simplePGPage.cpp; sourceTree = "<group>"; };
FD63DC6717B3CEA90023EEB1 /* simplePGPage.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = simplePGPage.h; sourceTree = "<group>"; };
FD63DC7017B56EE50023EEB1 /* generateProjects.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = generateProjects.cpp; sourceTree = "<group>"; };
FD63DC7117B56EE50023EEB1 /* generateProjects.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = generateProjects.h; sourceTree = "<group>"; };
/* End PBXFileReference section */

/* Begin PBXFrameworksBuildPhase section */
Expand Down Expand Up @@ -359,13 +368,14 @@
E4B69E1C0A3A1BDC003C02F2 /* src */ = {
isa = PBXGroup;
children = (
FD63DC6317B3CEA90023EEB1 /* pages */,
FD63DC6117B3CDF20023EEB1 /* gui */,
113CAA5614F88EDD00D3906E /* utils */,
1120712314AE3D4F0035CB7E /* projects */,
119B95D214A65CA0001E1E20 /* pugixmlLib */,
E4B69E1D0A3A1BDC003C02F2 /* main.cpp */,
E4B69E1F0A3A1BDC003C02F2 /* testApp.h */,
E4B69E1E0A3A1BDC003C02F2 /* testApp.cpp */,
11BCDC821607709900FCCD85 /* textButton.h */,
11D6814214A8EC0F008E3E3D /* addons */,
);
path = src;
Expand All @@ -380,6 +390,27 @@
name = openFrameworks;
sourceTree = "<group>";
};
FD63DC6117B3CDF20023EEB1 /* gui */ = {
isa = PBXGroup;
children = (
FD63DC6217B3CDF20023EEB1 /* textButton.h */,
);
path = gui;
sourceTree = "<group>";
};
FD63DC6317B3CEA90023EEB1 /* pages */ = {
isa = PBXGroup;
children = (
FD63DC7017B56EE50023EEB1 /* generateProjects.cpp */,
FD63DC7117B56EE50023EEB1 /* generateProjects.h */,
FD63DC6417B3CEA90023EEB1 /* basePGPage.cpp */,
FD63DC6517B3CEA90023EEB1 /* basePGPage.h */,
FD63DC6617B3CEA90023EEB1 /* simplePGPage.cpp */,
FD63DC6717B3CEA90023EEB1 /* simplePGPage.h */,
);
path = pages;
sourceTree = "<group>";
};
/* End PBXGroup section */

/* Begin PBXNativeTarget section */
Expand Down Expand Up @@ -437,8 +468,7 @@
E4328148138ABC890047C5CB /* openFrameworksDebug.a */ = {
isa = PBXReferenceProxy;
fileType = archive.ar;
name = openFrameworksDebug.a;
path = openFrameworks.a;
path = openFrameworksDebug.a;
remoteRef = E4328147138ABC890047C5CB /* PBXContainerItemProxy */;
sourceTree = BUILT_PRODUCTS_DIR;
};
Expand Down Expand Up @@ -487,6 +517,9 @@
27C4A1BF179491920031C6E4 /* ofxSlider.cpp in Sources */,
27C4A1C0179491920031C6E4 /* ofxSliderGroup.cpp in Sources */,
27C4A1C1179491920031C6E4 /* ofxToggle.cpp in Sources */,
FD63DC6817B3CEA90023EEB1 /* basePGPage.cpp in Sources */,
FD63DC6917B3CEA90023EEB1 /* simplePGPage.cpp in Sources */,
FD63DC7217B56EE50023EEB1 /* generateProjects.cpp in Sources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
Expand Down
22 changes: 16 additions & 6 deletions src/textButton.h → src/gui/textButton.h
Original file line number Diff line number Diff line change
Expand Up @@ -21,18 +21,28 @@ class textButton{
ofRectangle rect;
bool bSelectable;
bool bDrawLong;

string secondaryText;


string deliminater;
int maxWidth;


bool bMouseOver;
ofColor off;
ofColor on;



void setup(ofTrueTypeFont * _font, ofTrueTypeFont * _secondFont, string _prefix, string _text, string _secondaryText, ofPoint anchor, string _deliminator = ""){

deliminater = _deliminator;

font = _font;
secondFont = _secondFont;
prefix = _prefix;
topLeftAnchor.set(anchor); //set top button position - others are set relative to this.
setText(_text);
secondaryText = _secondaryText;

}



void setText(string newText){

Expand Down
104 changes: 102 additions & 2 deletions src/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,109 @@
int main( int argc, char *argv[] ){




cout << "In main." << endl;
cout << "ofGetTargetPlatform=" << ofGetTargetPlatform() << endl;

#ifdef TARGET_LINUX
cout << "linux " << endl;
if(argc==1){

ofAppGlutWindow window;
ofSetupOpenGL(&window, 1024, 610, OF_WINDOW);
testApp * app = new testApp;

ofRunApp( app );

}else{
ofAppNoWindow window;
ofSetupOpenGL(&window, 1024,768, OF_WINDOW);
testApp * app = new testApp;
app->makeProjects.buildAllExamples = false;
app->makeProjects.projectPath = "";
for(int i=1;i<argc;i++){
string arg = argv[i];
if(arg.find("--")==0){
arg = arg.substr(2);
if(arg=="linux"){
app->makeProjects.targetsToMake.push_back( OF_TARGET_LINUX );
}else if(arg=="linux64"){
app->makeProjects.targetsToMake.push_back( OF_TARGET_LINUX64 );
}else if(arg=="linuxarmv6l"){
app->makeProjects.targetsToMake.push_back( OF_TARGET_LINUXARMV6L );
}else if(arg=="linuxarmv7l"){
app->makeProjects.targetsToMake.push_back( OF_TARGET_LINUXARMV7L );
}else if(arg=="win_cb"){
app->makeProjects.targetsToMake.push_back( OF_TARGET_WINGCC );
}else if(arg=="vs"){
app->makeProjects.targetsToMake.push_back( OF_TARGET_WINVS );
}else if(arg=="osx"){
app->makeProjects.targetsToMake.push_back( OF_TARGET_OSX );
}else if(arg=="ios"){
app->makeProjects.targetsToMake.push_back( OF_TARGET_IPHONE );
}else if(arg=="android"){
ofLogError() << "platform not supported yet" << endl;
std::exit(1);
}else if(arg=="allplatforms"){
app->makeProjects.targetsToMake.push_back( OF_TARGET_LINUX );
app->makeProjects.targetsToMake.push_back( OF_TARGET_LINUX64 );
app->makeProjects.targetsToMake.push_back( OF_TARGET_LINUXARMV6L );
app->makeProjects.targetsToMake.push_back( OF_TARGET_LINUXARMV7L );
app->makeProjects.targetsToMake.push_back( OF_TARGET_WINGCC );
app->makeProjects.targetsToMake.push_back( OF_TARGET_WINVS );
app->makeProjects.targetsToMake.push_back( OF_TARGET_OSX );
app->makeProjects.targetsToMake.push_back( OF_TARGET_IPHONE );
}else if(arg=="allexamples"){
app->makeProjects.buildAllExamples = true;
}else if(arg=="help"){
cout << "OF Project Generator Usage:" << endl;
cout << "projectGenerator [options] [pathToExample]" << endl;
cout << "Options:" << endl;
cout << "--osx: generate osx project files" << endl;
cout << "--win_cb: generate windows codeblocks project files" << endl;
cout << "--vs: generate windows visual studio project files" << endl;
cout << "--linux: generate linux project files" << endl;
cout << "--linux64: generate linux 64bits project files" << endl;
cout << "--linuxarmv6l: generate linux armv6l project files" << endl;
cout << "--linuxarmv7l: generate linux armv7l project files" << endl;
cout << "--ios: generate iOS project files" << endl;
cout << "--allplatforms: generate project files for all platforms" << endl;
cout << "--allexamples: generate project files for all examples. [pathToExample] is not needed in this case." << endl;
cout << endl;
cout << "default: create project files for current platform for selected path" << endl;
cout << "running over existing example updates project files for selected platforms" << endl;
cout << "without parameters, shows gui" << endl;
std::exit(0);
}else{
cout << "Error: Unknown argument --" << arg << ". Run \'projectGenerator help\' for details. Aborting." << endl;
std::exit(1);
}
}else if(arg.find("-", 0, 1)==0){
cout << "Error: Unknown argument " << arg << ". Run \'projectGenerator help\' for details. Aborting." << endl;
std::exit(1);
}else{
app->makeProjects.projectPath = ofFilePath::removeTrailingSlash(ofFilePath::getPathForDirectory(ofFilePath::getAbsolutePath(arg,false)));
}
}

if (!(app->makeProjects.buildAllExamples) && app->makeProjects.projectPath.empty()){
cout << "Error: No target project given. Either run projectGenerator with the --allexamples option or supply a target project folder path. Run \'projectGenerator help\' for details." << endl;
std::exit(1);
}

if(app->makeProjects.targetsToMake.empty())
app->makeProjects.targetsToMake.push_back( ofGetTargetPlatform() );
ofRunApp( app );
}
#else
printf("??");
ofAppGlutWindow window;
ofSetupOpenGL(&window, 1024, 610, OF_WINDOW);
testApp * app = new testApp;
//app->buildAllExamples = false;
ofRunApp( app );
//app->makeProjects.buildAllExamples = false;
ofRunApp( app );

#endif

}
Empty file added src/pages/basePGPage.cpp
Empty file.
36 changes: 36 additions & 0 deletions src/pages/basePGPage.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
#pragma once

#include "ofMain.h"


class basePGPage {

public:

virtual void setup() = 0;;
virtual void update() = 0;;
virtual void draw() = 0;;

virtual void keyPressed (int key) = 0;;
virtual void keyReleased(int key) = 0;;
virtual void mouseMoved(int x, int y ) = 0;;
virtual void mouseDragged(int x, int y, int button) = 0;;
virtual void mousePressed(int x, int y, int button) = 0;;
virtual void mouseReleased(int x, int y, int button) = 0;;
virtual void windowResized(int w, int h) = 0;;
virtual void dragEvent(ofDragInfo dragInfo) = 0;;
virtual void gotMessage(ofMessage msg) = 0;;


typedef struct {
string appRoot;
bool multiplatform;
string defaultNewProjectLocation;
} pgSettings;

pgSettings settings;

ofTrueTypeFont * font;
ofTrueTypeFont * titleFont;
ofTrueTypeFont * secondFont;
};
Loading