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


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

void Invaders::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 Invaders::Update(float Dt)
{
	ProcessInput();

	ClearScreen(); // we do need to clear the gpu 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)
	SomethingToSee->CopyTo(m_Screen, 200, 200);

}

void Invaders::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 Invaders::PostRender()
{
// nothing really needed here yet
}


Invaders::~Invaders()
{ // our invaders game *IS* going to create objects, its important we clean/delete them before we exit and this is where we do it


}