//Psychlops Code Template
//    Please visit following web site to get sample codes.
//    http://psychlops.sourceforge.jp/ja/?StartCode
//    CodeDresser at following address is also available to view the code.
//    http://visitope.org/Tools/codedresser.html

///+ 0 Setup Psychlops Circumstances
//// 0 Setup Psychlops Circumstances
#include <psychlops.h>
using namespace Psychlops;
// Psychlops Win32 1.6.0 / 20120220
///- 0 Setup Psychlops Circumstances

void psychlops_main() {


	///+ 1 Declaration /////////////////////////////////////////////////////////////
	//// 1 Declaration
		// declare default window and variables for its parameters
		Canvas cnvs(Canvas::window, Display::secondary);
		double CANVAS_FRAMENUM;
		int CANVAS_REFRESHRATE;
		Psychlops::Color DEFAULT_BG_COLOR;

		//declare local variables around here
	
	///- 1 Declaration /////////////////////////////////////////////////////////////
	
	///+ 2 Initialization //////////////////////////////////////////////////////////
	//// 2 Initialization
	
		// Set initial values for local variables
		CANVAS_REFRESHRATE = cnvs.getRefreshRate();
		CANVAS_FRAMENUM = 0;
		DEFAULT_BG_COLOR.set(127.0/255.0,127.0/255.0,127.0/255.0,1.0); // default background color is 127/255 mid-gray
	
		// Draw Offline images around here
	
		// Offline Movie calculation using Image array around here
	
	///- 2 Initialization //////////////////////////////////////////////////////////
	
	///+ 3 Drawing /////////////////////////////////////////////////////////////////
	//// 3 Drawing
	while(!Input::get(Keyboard::esc)) {
		cnvs.clear(DEFAULT_BG_COLOR);
	
		//Write draw commands for realtime figure calculation and drawing around here
		
		//Write copy (Draw) commands for rendered movies in section 2 around here
		
		cnvs.flip();
		CANVAS_FRAMENUM++;
	}
	///- 3 Drawing /////////////////////////////////////////////////////////////////

}
