//--------------------------------------------------------------
void ofApp::setup(){
    ofSetBackgroundAuto(false);
    bool hasDrawn = false;
    
    
}
//--------------------------------------------------------------
void ofApp::setup(){
    ofBackground(255,255,255);
    ofSetBackgroundAuto(true);
    angleDegrees = 0.0f;
}
//--------------------------------------------------------------
void ofApp::setup(){
    ofBackground(255);
    ofSetBackgroundColor(255);
    ofSetBackgroundAuto(true);

}
Ejemplo n.º 4
0
//--------------------------------------------------------------
void
testApp::setup()
{
	// initialize stuff according to current window size
	windowResized(ofGetWidth(), ofGetHeight());	
	
	ofBackground(0, 0, 0);
	ofSetBackgroundAuto(true);
	ofSetVerticalSync(true);
	ofSetFrameRate(60);

#ifdef USE_VIDEO
	videoSystem.setup();
#endif

#ifdef USE_PHYSICS
	physicsSystem.setup();
#endif
	
#ifdef USE_GUI
	gui.setup();	
	//	gui.addPage("Fluid");

	gui.addToggle("Draw Fluid",
				  physicsSystem.settings.drawFluid);
	gui.addSlider("fs.viscocity",
				  physicsSystem.fluidSolver.viscocity, 0.0, 0.0002, 0.5);
	gui.addSlider("fs.colorDiffusion",
				  physicsSystem.fluidSolver.colorDiffusion, 0.0, 0.0003, 0.5);
	gui.addSlider("fs.fadeSpeed",
				  physicsSystem.fluidSolver.fadeSpeed, 0.0, 0.1, 0.5);
	gui.addSlider("fs.solverIterations",
				  physicsSystem.fluidSolver.solverIterations, 1, 20);
	gui.addSlider("fd.drawMode",
				  physicsSystem.fluidDrawer.drawMode, 0, FLUID_DRAW_MODE_COUNT-1);
	gui.addToggle("fs.doRGB",
				  physicsSystem.fluidSolver.doRGB);
	gui.addToggle("fs.doVorticityConfinement",
				  physicsSystem.fluidSolver.doVorticityConfinement);
	gui.addToggle("drawFluid",
				  physicsSystem.settings.drawFluid);
	gui.addToggle("drawParticles",
				  physicsSystem.settings.drawParticles); 
	gui.addToggle("renderUsingVA",
				  physicsSystem.settings.renderUsingVA); 

	gui.addPage("Camera");
	gui.addContent("Color Image",
				   videoSystem.colorImg, (float)-1);
	gui.addContent("Gray Diff",
				   videoSystem.grayDiff, (float)-1);
	gui.addContent("Vector Field [x]",
				   videoSystem.dvX, (float)-1);
	gui.addContent("Vector Field [y]",
				   videoSystem.dvY, (float)-1);
	
	gui.addSlider("Threshold",
				  videoSystem.settings.threshold, 0, 255);
	gui.addButton("Capture Bg",
				  videoSystem.settings.bLearnBg);
	
	gui.addPage("Optical Flow");
	gui.addToggle("Calc. Flow",
				  videoSystem.settings.calc_flow);
	gui.addToggle("Draw Flow",
				  videoSystem.settings.draw_flow);
	gui.addSlider("Max Features",
				  videoSystem.settings.max_features, 0, MAX_CORNERS);
	gui.addSlider("Dist. Vec. Scale",
				  videoSystem.settings.dv_scale, 0.0, 10.0, 0.1);
	gui.addSlider("Dist. Vec. Threshold",
				  videoSystem.settings.dv_min_error, 0, 512);
	gui.addSlider("Dist. Vec. Threshold",
				  videoSystem.settings.dv_max_error, 512, 1024);	
	
	gui.addContent("Contours", videoSystem.contourFinder);
#endif
}
Ejemplo n.º 5
0
//--------------------------------------------------------------
void ofApp::setup(){
    ofSetBackgroundColor(255);
    ofSetBackgroundAuto(false);
}
Ejemplo n.º 6
0
//--------------------------------------------------------------
void ofApp::setup(){
    ofSetBackgroundAuto(false);
    ofSetFrameRate(45);
    ofEnableAlphaBlending();
    ofBackground(255,255,255);
}
Ejemplo n.º 7
0
//--------------------------------------------------------------
void testApp::setup() {	 
	for(int i=0; i<strlen(sz); i++) sz[i] += 20;
	
	// setup fluid stuff
	fluidSolver.setup(100, 100);
    fluidSolver.enableRGB(true).setFadeSpeed(0.002).setDeltaT(0.5).setVisc(0.00015).setColorDiffusion(0);
	fluidDrawer.setup(&fluidSolver);
	
	fluidCellsX			= 150;
	
	drawFluid			= true;
	drawParticles		= true;
	
	ofSetFrameRate(60);
	ofBackground(0, 0, 0);
	ofSetVerticalSync(false);
    
    myVideo = new videoSource();
	myVideo->setupVideo(200, 200, &fluidSolver);

	
#ifdef USE_TUIO
	tuioClient.start(3333);
#endif

	
#ifdef USE_GUI 
	gui.addSlider("fluidCellsX", fluidCellsX, 20, 400);
	gui.addButton("resizeFluid", resizeFluid);
    gui.addSlider("colorMult", colorMult, 0, 100);
    gui.addSlider("velocityMult", velocityMult, 0, 100);
	gui.addSlider("fs.viscocity", fluidSolver.viscocity, 0.0, 0.001);
	gui.addSlider("fs.colorDiffusion", fluidSolver.colorDiffusion, 0.0, 0.00005);
	gui.addSlider("fs.fadeSpeed", fluidSolver.fadeSpeed, 0.0, 0.1); 
	gui.addSlider("fs.solverIterations", fluidSolver.solverIterations, 1, 50); 
	gui.addSlider("fs.deltaT", fluidSolver.deltaT, 0.1, 5);
	gui.addComboBox("fd.drawMode", (int&)fluidDrawer.drawMode, msa::fluid::getDrawModeTitles());
	gui.addToggle("fs.doRGB", fluidSolver.doRGB); 
	gui.addToggle("fs.doVorticityConfinement", fluidSolver.doVorticityConfinement); 
	gui.addToggle("drawFluid", drawFluid); 
	gui.addToggle("drawParticles", drawParticles); 
	gui.addToggle("fs.wrapX", fluidSolver.wrap_x);
	gui.addToggle("fs.wrapY", fluidSolver.wrap_y);
    gui.addSlider("video.videoColorMult", myVideo->videoColorMult,0, 1);
    gui.addSlider("video.velocityMult", myVideo->velocityMult,0, 0.002);
	gui.addToggle("doMirror", myVideo->doMirror);
	gui.addToggle("dynamicHue", myVideo->dynamicHue);
    gui.addSlider("video.hue", myVideo->hue, 0, 1);
    gui.addSlider("video.alpha", myVideo->videoAlpha, 0, 255);
	gui.currentPage().setXMLName(defaultPresetName);
    gui.loadFromXML();
	gui.setDefaultKeys(true);
	gui.setAutoSave(true);
    gui.show();
    
    myVideo->doDraw=false;
    gui.setDraw(false);

#endif
	
	windowResized(ofGetWidth(), ofGetHeight());		// force this at start (cos I don't think it is called)
	pMouse = msa::getWindowCenter();
	resizeFluid			= true;
	
	ofEnableAlphaBlending();
	ofSetBackgroundAuto(false);
    
//setup OSC receiver and sender
//    receiver.setup(PORT);
//    current_msg_string = 0;
//    DrawOSCMessage = true;
//    sender.setup(HOST, PORT_TO_GUI);
    
//    Setup TouchOSC
    ipadReceiver.setup(PORT_FROM_IPAD);
//    ipadSender.setup(HOST_IPAD, PORT_TO_IPAD);
    
    music.loadSound("Flo.mp3");
    outputSyphonServer.setName("DanceIsFlame");
}
Ejemplo n.º 8
0
//--------------------------------------------------------------
void ofApp::setup(){
   // ofBackground(0);
    ofSetBackgroundAuto(false);
    
}
Ejemplo n.º 9
0
//--------------------------------------------------------------
void testApp::setup(){
    
    //do not auto erase the background
    ofSetBackgroundAuto(false);
}
Ejemplo n.º 10
0
//--------------------------------------------------------------
void
testApp::setup()
{
//	ofSoundStreamListDevices();
	
	ofSetBackgroundAuto(true);
	ofBackground(0,0,0);

	bg.loadImage("chrome/bg-dark.png");
	bg.getTextureReference().setTextureWrap(GL_REPEAT, GL_REPEAT);

#ifdef USE_CV	
	ofSetFrameRate(VIDEO_FPS);
#endif

	glutSetWindowTitle("A tangible interface for sonification of geo-spatial and phenological data at multiple time-scales.");
	
	font.loadFont("fonts/HelveticaBold.ttf", 12);
	font_sm.loadFont("fonts/Helvetica.ttf", 9);

#ifdef USE_CV	
	cvGrabber.setDesiredFrameRate(VIDEO_FPS);
	cvGrabber.initGrabber(VIDEO_SIZE);
	videoSize.set(VIDEO_SIZE);
	
	imRGB.allocate(VIDEO_SIZE);
	imBW.allocate(VIDEO_SIZE);
#endif
	
#ifdef USE_CAMERA
	cameraGrabber.setDesiredFrameRate(24);
	cameraGrabber.initGrabber(CAMERA_SIZE);
	cameraImage.allocate(CAMERA_SIZE, OF_IMAGE_COLOR);	
#endif

#ifdef USE_FIDUCIAL_TRACKER	
	fiducials.videoSize.x = videoSize.x;
	fiducials.videoSize.y = videoSize.y;

	fiducials.imBW = &imBW;

	fiducials.setup();

	ofAddListener(fiducials.newFrame, this, &testApp::processFiducials);
#endif
	
#ifdef USE_SONIFICATION_ENGINE
	soundEngine.instruments[4*2] = "wav/flute";
	soundEngine.instruments[1*2] = "wav/clarinet";
//	soundEngine.instruments[3*2] = "wav/marimba";
//	soundEngine.instruments[4*2] = "wav/flute";
	soundEngine.instruments[5*2] = "wav/french_horn";
//	soundEngine.instruments[6*2] = "wav/bass";
//	soundEngine.instruments[3*2] = "wav/english_horn";
//	soundEngine.instruments[8*2] = "wav/piano";
//	soundEngine.instruments[9*2] = "wav/tuba";

#ifdef USE_GEO_DATA
	soundEngine.geoData = &geoData;
#endif
#endif

#ifdef USE_GUI
	gui.setup();
<<<<<<< HEAD:ofSoniphenology/src/testApp.cpp
Ejemplo n.º 11
0
//--------------------------------------------------------------
void testApp::setup(){
    ofSetBackgroundAuto(false);
}
Ejemplo n.º 12
0
//--------------------------------------------------------------
void testApp::draw(){
	ofNoFill();

	ofSetColor(0, 0, 0);
	
	//-------------------------------
	
	ofSetBackgroundAuto(drawFluid);
	
	if(drawFluid) {
		glColor3f(1, 1, 1);
		fluidDrawer.draw(0, 0, window.width, window.height);
	}
	
	if(drawParticles) particleSystem.updateAndDraw();
	
	drawWaves();
	drawConnections();
	drawSmurfs();
	drawFingers();
		
	gui.draw();
	
	if (smurfFloor->isVerbose()) {
		ofDrawBitmapString(
						   "BPM     : " + 
						   ofToString((int)smurfFloor->getBPM()), 
						   15, 45
		);

		ofDrawBitmapString(
						   "OSC out : " + 
						   smurfCfg->getOscSendAddress() + 
						   ":" + 
						   ofToString((int)smurfCfg->getOscSendPort()),
						   15, 60
		);
		
		ofDrawBitmapString(
						   "OSC in  : " + 
						   ofToString((int)smurfCfg->getOscReceivePort()), 
						   15, 75
		);
		
		ofDrawBitmapString(
						   "TUIO    : " + 
						   ofToString((int)smurfCfg->getTuioPort()), 
						   15, 90
		);
		
		ofDrawBitmapString("      q : quicken the beat", 15, 105);
		ofDrawBitmapString("      s : slow down the beat", 15, 120);
		ofDrawBitmapString("      f : toggle fullscreen", 15, 135);
		ofDrawBitmapString("  space : ui menu", 15, 150);
		ofDrawBitmapString("    esc : quit", 15, 165);
		
#ifdef TARGET_OS_MAC
		string gestMode = smurfFloor->isGesture()?"ON":"OFF";
		ofDrawBitmapString("      g : toggle gesture mode (" + gestMode + ")", 15, 180);
#endif
		ofDrawBitmapString("      h : toggle this help menu", 15, 195);

		string connMode = smurfFloor->isConnectionModeOn()?"ON":"OFF";
		ofDrawBitmapString("      c : toggle connections mode(" + connMode + ")", 15, 210);
		ofDrawBitmapString("      x : quicken the wave", 15, 225);
		ofDrawBitmapString("      w : slow down the wave", 15, 240);

#ifdef TARGET_OS_MAC
		ofDrawBitmapString("Gesture : " + smurfFloor->brain->getGestures()->getLatestGestureLabel(), 15, 255);
#endif
		
//		float fps = ofGetFrameRate();
//		
//		ofDrawBitmapString("FPS : " + (int)fps, 5, 65);
	}
}
//--------------------------------------------------------------
void ofApp::setup(){
    ofSetBackgroundAuto(false);
    ofSetLineWidth(1);
    ofSetColor(0);
}
Ejemplo n.º 14
0
//--------------------------------------------------------------
void ofApp::setup() {
    /*--------------------------------------------------------------


     BASE


     --------------------------------------------------------------*/
    ofSetLogLevel(OF_LOG_VERBOSE);
    //ofSetFrameRate(60);
    ofSetVerticalSync(true);
    ofSetBackgroundAuto(false);
    ofBackground(0, 0, 0);
    ofEnableAlphaBlending();


    /*--------------------------------------------------------------


     FFT


     --------------------------------------------------------------*/
    buffer_size = fft_size * 2;
    left = new float[buffer_size];
    magnitudeL = new float[fft_size];
    phaseL = new float[fft_size];
    powerL = new float[fft_size];
    right = new float[buffer_size];
    magnitudeR = new float[fft_size];
    phaseR = new float[fft_size];
    powerR = new float[fft_size];
    ofSoundStreamSetup(0, 2, this, 44100, buffer_size, 4);
    tempL = new float[fft_size];
    tempR = new float[fft_size];
    for (int i = 0; i < fft_size; i++) {
        tempL[i] = 0.0f;
        tempR[i] = 0.0f;
    }

    gapTime = 0;
    curTime = 0;
    preTime = 0;

    /*--------------------------------------------------------------


     GUI


     --------------------------------------------------------------*/
    gui.setup();
    gui.add(VOLUMETHRESHOLD.setup("VOL THRESHOLD", 5.0f, 0.5f, 30.0f));
    gui.add(KINECTMINIMUMDISTANCE.setup("MIN DISTANCE", 500.0f, 300.0f, 1000.0f));
    gui.add(KINECTMAXMUMDISTANCE.setup("MAX DISTANCE", 3000.0f, 2000.0f, 5000.0f));
    gui.add(KINECTDEPTHRATE.setup("DEPTH RATE", 0.5f, 0.1f, 1.0f));

    /*--------------------------------------------------------------


     LINE


     --------------------------------------------------------------*/
    line = *new Line();
    line.setup(fft_size);
    lineFlag = false;


    /*--------------------------------------------------------------


     Human


     --------------------------------------------------------------*/
    human.setup(fft_size);
    humanFlag = false;

    /*--------------------------------------------------------------


     Gif


     --------------------------------------------------------------*/
    gifs.init();
    gifFlag = false;

    /*--------------------------------------------------------------


     Tracing Particles


     --------------------------------------------------------------*/
    tp.init();
    tpFlag = false;

    /*--------------------------------------------------------------


     Locus


     --------------------------------------------------------------*/
    locus.init();

    /*--------------------------------------------------------------


     Shader


     --------------------------------------------------------------*/
    myFbo.allocate(ofGetWidth()*2,ofGetHeight()*2);
    myGlitch.setup(&myFbo);

    /*--------------------------------------------------------------


     PDF


     --------------------------------------------------------------*/
    pdf = *new PDF();
    pdf.setup(fft_size);
}
Ejemplo n.º 15
0
void liveApp::setup()	{
	{

		ofBackground(0,0,0);

		int windowMode = ofGetWindowMode();  
		if(windowMode == OF_FULLSCREEN){  
			this->windowWidth = ofGetScreenWidth();  
			this->windowHeight = ofGetScreenHeight();  
		}  
		else if(windowMode == OF_WINDOW){  
			this->windowWidth = ofGetScreenWidth();  
			this->windowHeight = ofGetScreenHeight();  
		} 
		
		//ofSetCircleResolution(200);
		texScreen.allocate(ofGetWidth(), ofGetHeight(),GL_RGB);// GL_RGBA); 
		ofSetBackgroundAuto(false);
		ofEnableSmoothing();
		ofEnableAlphaBlending(); 
		//glutSetCursor(GLUT_CURSOR_CYCLE);  // change cursor icon (http://pyopengl.sourceforge.net/documentation/manual/glutSetCursor.3GLUT.html)
		cout << "recieving OSC at port: 12345 " << PORTlisten << "\n";
		receiver.setup( PORTlisten );
		current_msg_string = 0;
				
		ofSetWindowTitle("Rhythmanalysis");
		ofSetFrameRate(60); // if vertical sync is off, we can go a bit fast... this caps the framerate at 60fps.
		ofSetVerticalSync(false);
		
		
	}	// Setup
	{
	memAlloc = true;
	float cellX = 0, cellY = 0;
	for (int i = 0; i < MAX_MATRIX; i++)	{
		for (int j = 0; j < MAX_MATRIX; j++)	{			
			gridX[i][j] = cellX; 
			gridY[i][j] = cellY;
			cellX = cellX + 20;
		}
		cellX = 0;
		cellY = cellY + 20;
	}
	float cellX3d = 0, cellY3d = 0, cellZ3d = 0;
	for (int i = 0; i < MAX_MATRIX; i++)	{
		for (int j = 0; j < MAX_MATRIX; j++)	{			
			for (int k = 0; k < MAX_MATRIX; k++)	{					
				gridX3d[i][j][k] = cellX3d; 
				gridY3d[i][j][k] = cellY3d;
				gridZ3d[i][j][k] = cellZ3d;				
				cellX3d = cellX3d + 40;
			}
			cellX3d = 0;
			cellY3d = cellY3d + 40;
		}
		//cellX3d = 0;
		cellY3d = 0;		
		cellZ3d = cellZ3d + 40;
	}
	}	// memAlloc
	{
		//video
		videoX=videoY=0;
		
		//destruct
		destruct = 0;
		destructCase = 1;
		
		//camera
		camera=false;
		
		//superformula
		superformula = false;
		
		//sketch
		aSound = 5;
		rSketch = gSketch = bSketch = aSketch = 255;
		 		
		// Tree
		dotSize = 15;
		angleOffsetA = (1.5*3.14)/180; // Convert 1.5 degrees to radians
		angleOffsetB = (50*3.14)/180;  // Convert 50 degrees to radians
		
		//background
		aBack = 0;
		view_fillBackground = 1;
		
		//sound
		viewSoundChanels = 1;
		
		drawWithMouse = 0;
		numMouseSketches = 99;
		minMouseElasticity = 0.0;
		maxMouseElasticity = 0.99;
		minMouseDamping = 0.0;
		maxMouseDamping = 0.99;
		
		numSoundSketches = 99;
		minSoundElasticity = 0.0;
		maxSoundElasticity = 0.99;
		minSoundDamping = 0.0;
		maxSoundDamping = 0.99;
		
		mouseLines = 1;
		soundLines = 0;
		
		ampInLow =0.0;
		ampInHigh = 0.15;
		freqInLow = 20;
		freqInHigh = 4000;
		
		feedbackView = 0;
		feedbackSpeedX = 0;
		feedbackSpeedY = 0;
		timeLine = 0;
		viewRotate = 0;				
			
		}	// Initial Values
	{
		// Imagenes
		// GROUP 1
		string imageDir = "/Users/ari/Media/images/paintings/lyon/";
		
		for (int i = 0; i < 61; i++)	{
			string number;
			std::string s;
			std::stringstream out;
			out << i;
			s = out.str();
			imageDir += s;
			imageDir += ".jpg";
			cout << imageDir << endl;
			image[i].loadImage(imageDir);
			imageDir = "/Users/ari/Media/images/paintings/lyon/";
		}

		// GROUP 2
		imageDir = "/Users/ari/Media/images/maps/google/grenoble/";
		
		for (int i = 0; i < 10; i++)	{
			string number;
			std::string s;
			std::stringstream out;
			out << i;
			s = out.str();
			imageDir += s;
			imageDir += ".png";
			cout << imageDir << endl;
			image[100+i].loadImage(imageDir);
			imageDir = "/Users/ari/Media/images/maps/google/grenoble/";
		}
		
		// Video
		myVideo = new ofVideoPlayer();
		playVideo = 0;
		rVideo = gVideo = bVideo = aVideo = 255;
		
		//===================================
		
		// Fonts
		myFont11.loadFont("/Users/ari/Media/fonts/favorites/Batang.ttf", 11, true, true, true);
		myFont350.loadFont("/Users/ari/Media/fonts/favorites/Batang.ttf", 350, true, true, true);		
	}	// data (images, fonts, video ...)
 	{
		for (int i = 0; i < MAX_SKETCHES; i++){
			sketch[i].init(0, ofRandom(minSoundElasticity, maxSoundElasticity), ofRandom(minSoundDamping, maxSoundDamping));	//to 1o stoixeio einai to id 0:
			sketch[i].init(1, ofRandom(minMouseElasticity, maxMouseElasticity), ofRandom(minMouseDamping, maxMouseDamping));	//id:1 => mouse init(int sketchID, float elast, float aposv)
		}
		
		sketchPhrase = false;

	}	// sKeTch
	{
		playSpectro = 0;
		rSound = gSound = bSound = 255; aSound = 25;
		textureRed = textureGreen = textureBlue = textureAlpha = 255;
		reverseEllipse = ofGetWidth();	reverseTexture = -1;
		mirrorMode = 9;
		spectroRed = spectroGreen = spectroBlue = 1;	
		
		
		soundEffectNoto = false;
	}	// Sound Interaction
	{
        // this number describes how many bins are used
        // on my machine, 2 is the ideal number (2^2 = 4x4 pixel bins)
        // if this number is too high, binning is not effective
        // because the screen is not subdivided enough. if
        // it's too low, the bins take up so much memory as to
        // become inefficient.
        int binPower = 4;

        particleSystem.setup(ofGetWidth(), ofGetHeight(), binPower);
		/*
        kParticles = 2;  // change that to 5 for MacBook Pro
        float padding = 0;
        float maxVelocity = .5;
        for(int i = 0; i < kParticles * 1024; i++) {
                float x = ofRandom(padding, ofGetWidth() - padding);
                float y = ofRandom(padding, ofGetHeight() - padding);
                float xv = ofRandom(-maxVelocity, maxVelocity);
                float yv = ofRandom(-maxVelocity, maxVelocity);
                Particle particle(x, y, xv, yv);
                particleSystem.add(particle);
        }
		 */
		rConColor=gConColor=bConColor=rDotColor=gDotColor=bDotColor=255;
        ofBackground(0, 0, 0);

        timeStep = 1;
        lineOpacity = 0;
        pointOpacity = 255;
        isMousePressed = false;
        slowMotion = false;
        particleNeighborhood = 15;
        particleRepulsion = 1;
        centerAttraction = .01;
		forceRadius = 100;
		forceScale = 10;
		bounceXstart = 0; 
		bounceYstart = 0;
		bounceXend = ofGetWidth(); 
		bounceYend = ofGetHeight();
		
		viewParticles = false;
		
		
		}	// Particles
	{
//		w = ofGetWidth();
//		h = ofGetHeight();
		w = 1280;
		h = 1024;
		
		mirrowEffect4 = false;
		texMirrow.allocate(w,h, GL_RGB);

		noiseEffect = false;
		texGray.allocate(w,h,GL_LUMINANCE);
		grayPixels			= new unsigned char [w*h];
		// gray pixels, set them randomly
		for (int i = 0; i < w*h; i++){
			grayPixels[i] = (unsigned char)(ofRandomuf() * 255);
			
		}
		texGray.loadData(grayPixels, w,h, GL_LUMINANCE); 
	}	// Texture effects
		
}
Ejemplo n.º 16
0
//========================================================================
int main( ){

	ofSetLogLevel(OF_LOG_VERBOSE);
	
#ifdef TARGET_OPENGLES
	ofLogVerbose("enigmatikViewer") << "Running in rpi mode using OPENGL " << glGetString(GL_VERSION) << endl;
	// useful for later? http://ofxfenster.undef.ch/doc/structofAppEGLWindow_1_1Settings.html
	
	//ofSetCurrentRenderer(ofPtr<ofBaseRenderer>(new ofGLProgrammableRenderer()));
	//ofSetCurrentRenderer(ofGLProgrammableRenderer::TYPE);
	
	//ofAppEGLWindow::Settings settings;
	//settings.eglWindowOpacity = 127;
	//settings.frameBufferAttributes[EGL_DEPTH_SIZE]   = 0; // 0 bits for depth
	//settings.frameBufferAttributes[EGL_STENCIL_SIZE] = 0; // 0 bits for stencil
	//ofAppEGLWindow window(settings);
	//ofSetupOpenGL( 800,600, OF_WINDOW);
	// car rearview screen resolution: 320*240
	
	ofGLESWindowSettings windowSettings;
	windowSettings.width =320;
	windowSettings.height = 240;
	windowSettings.setGLESVersion(2);
	shared_ptr<ofAppBaseWindow> window = ofCreateWindow(windowSettings);
	
	// configure renderer
	//shared_ptr<ofBaseRenderer> renderer = new ofGLProgrammableRenderer(window.get());
	//renderer->setBackgroundAuto(false);
	//renderer->enableAntiAliasing();
	//ofSetCurrentRenderer(renderer);
	
#else
	
	//ofSetCurrentRenderer(ofGLProgrammableRenderer::TYPE);
	//ofAppGLFWWindow window;
	//ofSetupOpenGL(&window, 800,600, OF_WINDOW);// <-------- setup the GL context
	
	//ofPtr<ofBaseRenderer> renderer( new ofGLProgrammableRenderer(OF_WINDOW) );
	//renderer->setBackgroundAuto(false);
	//renderer->disableAntiAliasing();
	//ofSetCurrentRenderer(ofGLProgrammableRenderer::TYPE);
	
	#ifdef USE_PROGRAMMABLE_GL
		// we are using the programmable gl renderer.
	
		ofGLESWindowSettings windowSettings;
		//ofGLWindowSettings windowSettings;
		//ofGLFWWindowSettings windowSettings;
		windowSettings.width = 800;
		windowSettings.height = 600;
	
		windowSettings.setGLESVersion(2);
		//windowSettings.setGLVersion(3, 2);
		shared_ptr<ofAppBaseWindow> window = ofCreateWindow(windowSettings);
	
		// configure renderer
		ofGLProgrammableRenderer * renderer = new ofGLProgrammableRenderer( window.get() );
		renderer->setBackgroundAuto(false);
		renderer->enableAntiAliasing();
		ofSetCurrentRenderer(shared_ptr<ofBaseRenderer>((ofBaseRenderer*) renderer));
	
		ofLogVerbose("enigmatikViewer") << "Running in desktop mode using PROGRAMMABLE_GL " << glGetString(GL_VERSION) << endl;
	#else
	
		//ofGLESWindowSettings windowSettings;
		ofGLWindowSettings windowSettings;
		//ofGLFWWindowSettings windowSettings;
		windowSettings.width = 800;
		windowSettings.height = 600;
	
		windowSettings.setGLVersion(4, 1);
		shared_ptr<ofAppBaseWindow> window = ofCreateWindow(windowSettings);
		//ofDisableArbTex();
	#endif
	
#endif
	
	ofSetVerticalSync(false);
	ofEnableAlphaBlending(); // otherwise alpha channel is ignored by GL
	ofSetBackgroundColor(0,255,255,.5f);//ofColor(255,255,255,255));
	ofSetBackgroundAuto(false); // tmp
	
	shared_ptr<enigmatikViewer> mainApp(new enigmatikViewer );
	ofRunApp(window, mainApp);
	ofRunMainLoop();
}
//--------------------------------------------------------------
void testApp::setup(){
    ofSetFrameRate(60);
    ofSetBackgroundAuto(false);
    ofBackground(0);
    ofSetColor(255);
}
void MouseVoronoi::setup() {
	needRedraw = false;
	ofSetBackgroundAuto(false);
}