#include "Framebuffer.hpp"
#include "Rasterizer.hpp"
#include "PPMFile.hpp"
#include <Vector.hpp>
#include <iostream>

void PrintColumnOrder(fog::Framebuffer rasterDisplay)
{
	printf("#Printing Column Order\n\n");
	for(int i = 0; i < rasterDisplay.GetHeight(); i++)
	{
		for(int j = 0; j < rasterDisplay.GetWidth(); j++)
		{
			fog::Color pixel;
			pixel = rasterDisplay.GetPixel({j, i});
			std::cout << std::to_string(pixel.GetRed()) << " " <<
				std::to_string(pixel.GetGreen()) << " " <<
				std::to_string(pixel.GetBlue()) << "\n";
		}
	}
}

int main(int argc, char* argv[])
{
	
	int x0 = 0, y0 = 0, 
		x1 = 0, y1 = 19, 
		x2 = 19, y2 = 0,
		x3 = 19, y3 = 19,
		x4 = 10, y4 = 7,
		x5 = 7, y5 = 10;
		
	fog::Framebuffer framebuffer = { 100, 100 };
	fog::Rasterizer rasterizer = { &framebuffer };
	//rasterizer.DrawLine( { x1, y1 }, { x2, y2 } );
	//rasterizer.DrawLine2( { 7, 4 }, { 3, 9 }, { 255, 0, 0 } );
	rasterizer.DrawCircle2( { 25, 25 }, 10 );
	//try{
	//	rasterizer.DrawEllipse({50, 50}, 8, 6);
	//}
	//catch(std::exception& e)
	//{
	//	printf("%s", e.what());
	//}
	fog::PPMFile ppmFile = fog::PPMFile::CreatePPMFile("_Test");
	ppmFile.WriteFromFramebuffer(framebuffer);


	return 0;
}
