-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
roxlu
committed
Aug 15, 2010
0 parents
commit 0f45e11
Showing
10 changed files
with
1,685 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
#include "ofMain.h" | ||
#include "testApp.h" | ||
#include "ofAppGlutWindow.h" | ||
|
||
//======================================================================== | ||
int main( ){ | ||
|
||
ofAppGlutWindow window; | ||
ofSetupOpenGL(&window, 1024,768, OF_WINDOW); // <-------- setup the GL context | ||
|
||
// this kicks off the running of my app | ||
// can be OF_WINDOW or OF_FULLSCREEN | ||
// pass in width and height too: | ||
ofRunApp( new testApp()); | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,72 @@ | ||
#include "testApp.h" | ||
|
||
testApp::testApp():ini("example.ini") { | ||
/* Contents of bin/data/example.ini | ||
* ------------------------ | ||
[game] | ||
server_port=1234 | ||
show_score=y # booelan | ||
loop_game=true # boolean | ||
speed=0.5 # double | ||
[gui] | ||
enabled=y # boolean, y-n,0,1, etc.. | ||
*/ | ||
|
||
std::cout << "server port: " << ini.get("game:server_port",-1) << std::endl | ||
<< "show_score:" << ini.get("game:show_score", false) << std::endl | ||
<< "loop_game:" << ini.get("game:loop_game", true) << std::endl | ||
<< "speed:" << ini.get("game:speed", 0.2) << std::endl | ||
<< "gui:" << ini.get("gui:enabled", false) << std::endl; | ||
|
||
} | ||
//-------------------------------------------------------------- | ||
void testApp::setup(){ | ||
|
||
} | ||
|
||
//-------------------------------------------------------------- | ||
void testApp::update(){ | ||
|
||
} | ||
|
||
//-------------------------------------------------------------- | ||
void testApp::draw(){ | ||
|
||
} | ||
|
||
//-------------------------------------------------------------- | ||
void testApp::keyPressed(int key){ | ||
|
||
} | ||
|
||
//-------------------------------------------------------------- | ||
void testApp::keyReleased(int key){ | ||
|
||
} | ||
|
||
//-------------------------------------------------------------- | ||
void testApp::mouseMoved(int x, int y ){ | ||
|
||
} | ||
|
||
//-------------------------------------------------------------- | ||
void testApp::mouseDragged(int x, int y, int button){ | ||
|
||
} | ||
|
||
//-------------------------------------------------------------- | ||
void testApp::mousePressed(int x, int y, int button){ | ||
|
||
} | ||
|
||
//-------------------------------------------------------------- | ||
void testApp::mouseReleased(int x, int y, int button){ | ||
|
||
} | ||
|
||
//-------------------------------------------------------------- | ||
void testApp::windowResized(int w, int h){ | ||
|
||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
#ifndef _TEST_APP | ||
#define _TEST_APP | ||
|
||
|
||
#include "ofMain.h" | ||
#include "ofxIniFile.h" | ||
class testApp : public ofBaseApp{ | ||
|
||
public: | ||
// create a constructor so we can initialize ofxIniFile to load | ||
// the ini file. | ||
testApp(); | ||
void setup(); | ||
void update(); | ||
void draw(); | ||
|
||
void keyPressed (int key); | ||
void keyReleased(int key); | ||
void mouseMoved(int x, int y ); | ||
void mouseDragged(int x, int y, int button); | ||
void mousePressed(int x, int y, int button); | ||
void mouseReleased(int x, int y, int button); | ||
void windowResized(int w, int h); | ||
|
||
ofxIniFile ini; | ||
}; | ||
|
||
#endif |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
<install> | ||
<name>ofxIni</name> | ||
<version>0.01</version> | ||
<author>Diederick Huijbers</author> | ||
<url>www.roxlu.com</url> | ||
<description>Minimal C-style ini file parser</description> | ||
</install> |
Oops, something went wrong.