#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[5];
};
#include "ofApp.h"
ofApp::ofApp(){
t1[0] = new Trochoid(ofVec2f(ofGetWidth() / 2, ofGetHeight() / 2), false);
t1[1] = new Trochoid(t1[0], false);
t1[2] = new Trochoid(t1[0], false);
t1[3] = new Trochoid(t1[1], true);
t1[4] = new Trochoid(t1[2], true);
}
ofApp::~ofApp(){
for (int i = 0; i < 5; i++) {
delete t1[i];
}
}
//--------------------------------------------------------------
void ofApp::setup(){
double fps = 30;
ofSetFrameRate(fps);
ofBackground(255,255,255);
ofSetBackgroundAuto(true);
for (int i = 0; i < 5; i++) {
t1[i]->setup();
}
}
//--------------------------------------------------------------
void ofApp::update(){
for (int i = 0; i < 5; i++) {
t1[i]->update();
}
}
//--------------------------------------------------------------
void ofApp::draw(){
for (int i = 0; i < 5; i++) {
t1[i]->display();
}
}