From 3f24a2f8f7f05b9200fb0f5341a3fc1139ee7748 Mon Sep 17 00:00:00 2001 From: Tim Redfern Date: Tue, 16 Aug 2022 00:36:53 +0100 Subject: add gui --- lasertext/src/ofApp.cpp | 35 +++++++++++++++++++++++++++++++---- 1 file changed, 31 insertions(+), 4 deletions(-) (limited to 'lasertext/src/ofApp.cpp') diff --git a/lasertext/src/ofApp.cpp b/lasertext/src/ofApp.cpp index adb393f..2974056 100644 --- a/lasertext/src/ofApp.cpp +++ b/lasertext/src/ofApp.cpp @@ -22,10 +22,33 @@ void ofApp::setup(){ laser.set_pts(MAX_POINTS); laser.set_intensity(LASER_INTENSITY); + + lasergui.setup("laser","",5,700); + lasergui.add(laser_power.set("power", true)); + lasergui.add(laser_intensity.set("intensity", 30, 0, 255)); + lasergui.add(laser_points.set("points", 30000, 0, 40000)); + lasergui.add(laser_subdivide.set("subdivide", 15, 1, 100)); + lasergui.add(laser_blank_num.set("blank points", 8, 0, 32)); + lasergui.add(laser_max_angle.set("max angle", 15.0f, 1.0f, 90.0f)); + + if( XML.loadFile("settings.xml") ){ + cout << "settings.xml loaded!" < shapes = banner.getOutlines(0.06f+(0.02f*sin(ofGetElapsedTimef()*.1f))); + lasergui.draw(); + + vector shapes = banner.getOutlines(0.08f); //+(0.02f*sin(ofGetElapsedTimef()*.1f))); + + int num = 0; - int num = laser.draw(shapes); + if (laser_power) num=laser.draw(shapes); //banner.draw(); @@ -49,7 +76,7 @@ void ofApp::draw(){ ofSetWindowTitle(ofToString(ofGetFrameRate(), 2)+" fps laser points: "+ofToString(num)); } else { - ofSetWindowTitle(ofToString(ofGetFrameRate(), 2)+" fps laser error "); + ofSetWindowTitle(ofToString(ofGetFrameRate(), 2)+" fps laser power off "); } } -- cgit v1.2.3