summaryrefslogtreecommitdiff
path: root/liveengineUnmapped/ofxSVGTiny/example/src/testApp.cpp
diff options
context:
space:
mode:
authortim <tim@gray.(none)>2014-04-18 09:28:31 +0100
committertim <tim@gray.(none)>2014-04-18 09:28:31 +0100
commitba9af7648a79b54836019ca792e40e81ca863c86 (patch)
tree10cf27eca307caabcd45cdab53067cded31961f8 /liveengineUnmapped/ofxSVGTiny/example/src/testApp.cpp
parent9d46e74d0f6e9c240bb5f0597ff75b5415a4a5a1 (diff)
good to go
Diffstat (limited to 'liveengineUnmapped/ofxSVGTiny/example/src/testApp.cpp')
-rw-r--r--liveengineUnmapped/ofxSVGTiny/example/src/testApp.cpp114
1 files changed, 114 insertions, 0 deletions
diff --git a/liveengineUnmapped/ofxSVGTiny/example/src/testApp.cpp b/liveengineUnmapped/ofxSVGTiny/example/src/testApp.cpp
new file mode 100644
index 0000000..db5e617
--- /dev/null
+++ b/liveengineUnmapped/ofxSVGTiny/example/src/testApp.cpp
@@ -0,0 +1,114 @@
+#include "testApp.h"
+
+#include "ofxSVGTiny.h"
+
+ofxSVGTiny svg;
+
+//--------------------------------------------------------------
+void testApp::setup()
+{
+ ofSetVerticalSync(true);
+ ofSetFrameRate(60);
+
+ ofBackground(0);
+ ofSetColor(255);
+
+ svg.load("taichi.svg");
+}
+
+float step;
+
+//--------------------------------------------------------------
+void testApp::update()
+{
+ step += 0.001;
+ if (step > 1)
+ {
+ step -= 1;
+ }
+}
+
+//--------------------------------------------------------------
+void testApp::draw()
+{
+
+ svg.draw();
+
+ glTranslatef(450, 0, 0);
+
+ for (int i = 0; i < svg.getNumPath(); i++)
+ {
+ ofPath &p = svg.getPathAt(i);
+
+ vector<ofPolyline>& lines = p.getOutline();
+
+ for (int k = 0; k < lines.size(); k++)
+ {
+ ofPolyline line = lines[k].getResampledBySpacing(1);
+
+ int num = step * line.size();
+
+ glBegin(GL_LINE_STRIP);
+ for (int j = 0; j < num; j++)
+ {
+ ofVec3f &vv = line[j];
+ glVertex3f(vv.x, vv.y, vv.z);
+ }
+ glEnd();
+ }
+ }
+}
+
+//--------------------------------------------------------------
+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)
+{
+
+}
+
+//--------------------------------------------------------------
+void testApp::gotMessage(ofMessage msg)
+{
+
+}
+
+//--------------------------------------------------------------
+void testApp::dragEvent(ofDragInfo dragInfo)
+{
+
+} \ No newline at end of file