//so this is the "game" file, which contains the actual game
#include "Double.h"
#include "IGraphics.h"
#include "IInput.h"


Surface* SomethingToSee = nullptr; // a temp surface in free space

void Double::SetupGame()
{ // do we need to load things?

 // lets make one surface to demonstrate
	MyFiles filehandler; // make a temp myfiles class
	SomethingToSee = new Surface("../Common/Assets/invaders/InvaderA-1.png", &filehandler);


}
void Double::Update(float Dt)
{
	ProcessInput();

	ClearScreen(); // we do need to clear the  screen

	m_Screen->ClearBuffer(0xff000000); //Pixels are RGBA but they need to be used as ABGR

	m_Screen->DrawBox(10, 50, 100, 150, 0xff00ff00); //green
	m_Screen->Bar(120, 150, 160, 160, 0xff00ffff); //yellow (red+green)

	
// lets show an image, and copy a surface to our screen surface	
	SomethingToSee->CopyTo(m_Screen, 200, 200);

}

void Double::Render()
{

	Swap(); // transfer the back buffer to a textur
	DrawRectangle(FrameBufferID); // display this rect, now this can be optimised quite a bit
	graphics->SwapBuffer(); // let it be seen


}
void Double::PostRender()
{
// nothing really needed here yet
}


Double::~Double()
{ 

}