#pragma once

#include "ofMain.h"
#include "ofBufferObject.h"
#include "ofxGui.h"

class ofApp : public ofBaseApp{

	public:
		void setup();
		void update();
		void draw();
		void dirAsColorChanged(bool & dirAsColor);

		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 windowResized(int w, int h);
		void dragEvent(ofDragInfo dragInfo);
		void gotMessage(ofMessage msg);
		
		struct Particle{
			ofVec4f pos;
			ofVec4f vel;
			ofFloatColor color;
		};

		ofShader compute;
		vector<Particle> particles;
		ofBufferObject particlesBuffer, particlesBuffer2;
		GLuint vaoID;
		ofEasyCam camera;
		ofVbo vbo;
		ofVec3f atractor1, atractor2, atractor3;
		ofxPanel gui;
		ofParameter<float> attractionCoeff, cohesionCoeff, repulsionCoeff;
		ofParameter<float> maxSpeed;
		ofParameter<float> attractor1Force, attractor2Force, attractor3Force;
		ofParameterGroup shaderUniforms;
		ofParameter<float> fps;
		ofParameter<bool> dirAsColor;
};
