summaryrefslogtreecommitdiff
path: root/basedProject/src/ofApp.cpp
diff options
context:
space:
mode:
authorComment <tim@gray.(none)>2014-02-26 17:01:43 +0000
committerComment <tim@gray.(none)>2014-02-26 17:01:43 +0000
commita2fe68dfed91e362404ea1171cc8f0b313956cc3 (patch)
tree013d071e94a2e29f0aee8ec2da44e1d0debbaab8 /basedProject/src/ofApp.cpp
parent84b516956e7ca1ddd7d89890d9ff81f71fcff217 (diff)
thank fuk
Diffstat (limited to 'basedProject/src/ofApp.cpp')
-rw-r--r--basedProject/src/ofApp.cpp47
1 files changed, 40 insertions, 7 deletions
diff --git a/basedProject/src/ofApp.cpp b/basedProject/src/ofApp.cpp
index 0dc6b46..1b2a074 100644
--- a/basedProject/src/ofApp.cpp
+++ b/basedProject/src/ofApp.cpp
@@ -13,27 +13,49 @@ void ofApp::setup() {
///ofSetVerticalSync(true);
//some model / light stuff
+ /*
glEnable (GL_DEPTH_TEST);
glShadeModel (GL_SMOOTH);
glColorMaterial (GL_FRONT_AND_BACK, GL_DIFFUSE);
glEnable (GL_COLOR_MATERIAL);
ofDisableLighting();
- ofSetGlobalAmbientColor(ofColor(255,255,255));
+ //ofSetGlobalAmbientColor(ofColor(255,255,255));
+ */
fullscreen=false;
activeView=0;
xhair.loadImage("crosshairs.png");
+
+ int bufferSize= 512; //should be based on the size of glitch buffer
+
+ soundStream.listDevices();
+ //nb all you have to do to make audio work is to turn off pulseaudio in configuration
+ soundStream.setup(this, 0, 1, 44100, bufferSize, 1);
+ samples.resize(bufferSize);
+
+ glitch.setup(512,384,&samples);
+ glitch.set_interp(ofRandom(30)+2,ofRandom(22)+2);
}
//--------------------------------------------------------------
void ofApp::update() {
ofSetWindowTitle(ofToString(ofGetFrameRate()));
+
+ glitch.update();
+}
+
+void ofApp::audioIn(float * input, int bufferSize, int nChannels){
+ for (int i=0;i<bufferSize/nChannels;i+=nChannels){
+ samples[i]=input[i*nChannels];
+ }
}
//--------------------------------------------------------------
void ofApp::draw() {
+ //ofSetColor(255,255, 255);
+ //glitch.draw(0,0);
for (int i=0;i<views.size();i++) {
views[i].setLight();
@@ -41,20 +63,31 @@ void ofApp::draw() {
for (int i=0;i<views.size();i++) {
//views[i].begin2d();
views[i].begin();
- //ofFill();
+
+
+ ofFill();
+ //glitch.renderFBO.
+ //xhair.getTextureReference().bind();
+ bindTexture(glitch.renderFBO);
//ofEnableAlphaBlending();
- ofSetColor(0, 0, 255, 255);
+ //ofSetColor(0, 0, 255, 255);
ofDrawSphere(0,0,0,145);
- ofSetColor(0, 255, 0, 255);
+ //ofSpherePrimitive s=ofSpherePrimitive(145,50);
+ //s.enableTextures();
+ //s.draw();
+ //ofSetColor(0, 255, 0, 255);
ofDrawSphere(200,0,230,75);
- ofSetColor(255, 0,0, 255);
+ //ofSetColor(255, 0,0, 255);
ofDrawSphere(-60,-190,280,47.5);
- ofSetColor(255, 255,255, 255);
+ //ofSetColor(255, 255,255, 255);
//xhair.draw(0,0,views[i].getWidth(),views[i].getHeight());
-
+ //glitch.renderFBO.
+ //xhair.getTextureReference().unbind();
+ unbindTexture(glitch.renderFBO);
//views[i].end2d();
views[i].end();
}
+
}
//--------------------------------------------------------------