-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathofApp.cpp
60 lines (46 loc) · 1.4 KB
/
ofApp.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
// vjshader
//
// ofApp.cpp
//
// Created by Lewis Lepton on 24/04/2020.
// lewislepton.com
//
#include "ofApp.h"
//--------------------------------------------------------------
void ofApp::setup(){
ofDisableArbTex();
ofSetWindowTitle("VJshader");
ofSetFrameRate(60);
viewer.setup();
}
//--------------------------------------------------------------
void ofApp::update(){
viewer.update();
if (future->uiAction){
float time = 0;
time = ofMap(future->uiActionSpeed, 0.0, 1.0, 0.001, 0.06);
viewer.color.x = ofLerp(viewer.color.x, future->uiColor->x, time);
viewer.color.y = ofLerp(viewer.color.y, future->uiColor->y, time);
viewer.color.z = ofLerp(viewer.color.z, future->uiColor->z, time);
viewer.shapes = future->shapes;
viewer.camera.setDistance(future->camera.getDistance());
}
}
//--------------------------------------------------------------
void ofApp::draw(){
viewer.draw();
}
//--------------------------------------------------------------
void ofApp::keyPressed(int key){
viewer.keyPressed(key);
}
//--------------------------------------------------------------
void ofApp::keyReleased(int key){
}
//--------------------------------------------------------------
void ofApp::windowResized(int w, int h){
viewer.windowResized(w, h);
}
//--------------------------------------------------------------
void ofApp::gotMessage(ofMessage msg){
}