#include "testApp.h"


//--------------------------------------------------------------
void testApp::setup(){	 
	ofBackground(100,255,190);
	//this sets our app to aprox 60fps
	ofSetVerticalSync(true); 	
	
	//this thread class is declared in testApp.h
	//all this thread does is count. because 
	//that is all it has to do (no drawing other stuff)
	//you should see much faster counting from the threaded
	//app than our main app.
	
	//we set blocking to false
	//and we set printf notifications to 
	//true - the no blocking means that 
	//if it can't access data shared between threads
	//it doesn't wait - it just tries again next loop.
	T1.startThread(false, true);
	count = 0;
}

//--------------------------------------------------------------
void testApp::update(){
	//lets update our counter
	count++;
}

//--------------------------------------------------------------
void testApp::draw(){
	ofSetColor(0x000000);
	
	//draw our threads counter
	T1.drawCount();

	//draw our own
	ofDrawBitmapString("testApp  count is "+ofToString(count), 9, 32);
}

//--------------------------------------------------------------
void testApp::keyPressed  (int key){ 
	
}

//--------------------------------------------------------------
void testApp::keyReleased(int key){ 
	
}

//--------------------------------------------------------------
void testApp::mouseMoved(int x, int y ){
	
}

//--------------------------------------------------------------
void testApp::mouseDragged(int x, int y, int button){
	
}

//--------------------------------------------------------------
void testApp::mousePressed(int x, int y, int button){

}

//--------------------------------------------------------------
void testApp::mouseReleased(){
}
