#include "olcPGE_Common.h"

namespace olc {
	std::wstring ConvertS2W(std::string s)
	{
#ifdef _WIN32
		int count = MultiByteToWideChar(CP_UTF8, 0, s.c_str(), -1, NULL, 0);
		wchar_t* buffer = new wchar_t[count];
		MultiByteToWideChar(CP_UTF8, 0, s.c_str(), -1, buffer, count);
		std::wstring w(buffer);
		delete[] buffer;
		return w;
#else
		return L"SVN FTW!";
#endif
	}
	
#ifdef _WIN32
	// Thanks @MaGetzUb for this, which allows sprites to be defined
	// at construction, by initialising the GDI subsystem
	static class GDIPlusStartup
	{
	public:
		GDIPlusStartup()
		{
			Gdiplus::GdiplusStartupInput startupInput;
			ULONG_PTR	token;
			Gdiplus::GdiplusStartup(&token, &startupInput, NULL);
		};
	} gdistartup;
#endif

}