Skip to content

Commit

Permalink
First commit
Browse files Browse the repository at this point in the history
  • Loading branch information
roxlu committed Aug 15, 2010
0 parents commit 0f45e11
Show file tree
Hide file tree
Showing 10 changed files with 1,685 additions and 0 deletions.
16 changes: 16 additions & 0 deletions example/main.cpp
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());

}
72 changes: 72 additions & 0 deletions example/testApp.cpp
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){

}

28 changes: 28 additions & 0 deletions example/testApp.h
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
7 changes: 7 additions & 0 deletions install.xml
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>
Loading

0 comments on commit 0f45e11

Please sign in to comment.