//
// MainPage.xaml.cpp
// Implementation of the MainPage class.
//

#include "pch.h"
#include "MainPage.xaml.h"

using namespace ShootingGame;

using namespace Platform;
using namespace Windows::Foundation;
using namespace Windows::Foundation::Collections;
using namespace Windows::UI::Xaml;
using namespace Windows::UI::Xaml::Controls;
using namespace Windows::UI::Xaml::Controls::Primitives;
using namespace Windows::UI::Xaml::Data;
using namespace Windows::UI::Xaml::Input;
using namespace Windows::UI::Xaml::Media;
using namespace Windows::UI::Xaml::Navigation;

// The Blank Page item template is documented at http://go.microsoft.com/fwlink/?LinkId=234238

MainPage::MainPage()
{
	InitializeComponent();
}

/// <summary>
/// Invoked when this page is about to be displayed in a Frame.
/// </summary>
/// <param name="e">Event data that describes how this page was reached.  The Parameter
/// property is typically used to configure the page.</param>
void MainPage::OnNavigatedTo(NavigationEventArgs^ e)
{
	(void) e;	// Unused parameter
}

void MainPage::UpdateProcessTime(float delta)
{
	processTime->Text = ref new String((boost::wformat(L"%1.4f") % delta).str().c_str());
}

void MainPage::UpdateFrameTime(float delta,float max,float min,float avg)
{
	frameTime->Text = ref new String((boost::wformat(L"%1.4f") % delta).str().c_str());
	frameTimeMax->Text = ref new String((boost::wformat(L"%1.4f") % max).str().c_str());
	frameTimeMin->Text = ref new String((boost::wformat(L"%1.4f") % min).str().c_str());
	frameTimeAvg->Text = ref new String((boost::wformat(L"%1.4f") % avg).str().c_str());
}
