Permalink
Browse files

First commit

  • Loading branch information...
roxlu committed Aug 15, 2010
0 parents commit 0f45e11cf8d7e861dc6b157f0906aad24ab05a9c
Showing with 1,685 additions and 0 deletions.
  1. +16 −0 example/main.cpp
  2. +72 −0 example/testApp.cpp
  3. +28 −0 example/testApp.h
  4. +7 −0 install.xml
  5. +405 −0 src/iniparser/dictionary.c
  6. +174 −0 src/iniparser/dictionary.h
  7. +646 −0 src/iniparser/iniparser.c
  8. +280 −0 src/iniparser/iniparser.h
  9. +30 −0 src/ofxIniFile.cpp
  10. +27 −0 src/ofxIniFile.h
@@ -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());
+
+}
@@ -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){
+
+}
+
@@ -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
@@ -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.

0 comments on commit 0f45e11

Please sign in to comment.