#include "ofMain.h"
#include "ofApp.h"
//======================================
int main( ){
// 4K:4096x2160
// 2K:2048x1080
// FullHD:1920x1080
// HD:1440x1080
// HD720p:1280x720
// DVD:720x480
ofSetupOpenGL(1280,720, OF_WINDOW);
// this kicks off the running of my app
// can be OF_WINDOW or OF_FULLSCREEN
// pass in width and height too:
ofRunApp( new ofApp());
}
#pragma once
#include "ofMain.h"
#include <random>
#include "Trochoid.hpp"
class ofApp : public ofBaseApp{
public:
ofApp();
~ofApp();
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 mouseEntered(int x, int y);
void mouseExited(int x, int y);
void windowResized(int w, int h);
void dragEvent(ofDragInfo dragInfo);
void gotMessage(ofMessage msg);
private:
Trochoid *t1[3];
Trochoid *t2[3];
Trochoid *t3[3];
Trochoid *t4[3];
};
#include "ofApp.h"
ofApp::ofApp(){
t1[0] = new Trochoid(ofVec2f(ofGetWidth() / 4, ofGetHeight() / 4), false);
t1[1] = new Trochoid(t1[0], false);
t1[2] = new Trochoid(t1[1], true);
t2[0] = new Trochoid(ofVec2f(ofGetWidth() * 3 / 4, ofGetHeight() / 4), false);
t2[1] = new Trochoid(t2[0], false);
t2[2] = new Trochoid(t2[1], true);
t3[0] = new Trochoid(ofVec2f(ofGetWidth() * 3 / 4, ofGetHeight() * 3 / 4), false);
t3[1] = new Trochoid(t3[0], false);
t3[2] = new Trochoid(t3[1], true);
t4[0] = new Trochoid(ofVec2f(ofGetWidth() / 4, ofGetHeight() * 3 / 4), false);
t4[1] = new Trochoid(t4[0], false);
t4[2] = new Trochoid(t4[1], true);
}
ofApp::~ofApp(){
for (int i = 0; i < 3; i++) {
delete t1[i];
delete t2[i];
delete t3[i];
delete t4[i];
}
}
//--------------------------------------------------------------
void ofApp::setup(){
double fps = 30;
ofSetFrameRate(fps);
ofBackground(255,255,255);
ofSetBackgroundAuto(true);
for (int i = 0; i < 3; i++) {
t1[i]->setup();
t2[i]->setup();
t3[i]->setup();
t4[i]->setup();
}
}
//--------------------------------------------------------------
void ofApp::update(){
for (int i = 0; i < 3; i++) {
t1[i]->update();
t2[i]->update();
t3[i]->update();
t4[i]->update();
}
}
//--------------------------------------------------------------
void ofApp::draw(){
for (int i = 0; i < 3; i++) {
t1[i]->display();
t2[i]->display();
t3[i]->display();
t4[i]->display();
}
}