#include <iostream>

#define API_EXPORT

#include "Brainstem.h"
#include "BstmKernel.h"

namespace Brainstem
{
	extern "C" 
	{
		static IKernel* BstmKernel;

		BRAINSTEM_API IKernel* CreateKernel(const Kernel_Params& params)
		{
			BstmKernel = new Kernel(params);
			return BstmKernel;
		}

		BRAINSTEM_API IKernel* CreateKernelEx(
			HWND hWnd, 
			HINSTANCE hInstance, 
			Dimension2<int> size,
			bool fullscreen)
		{
			Kernel_Params params;

			params.hWnd = hWnd;
			params.hInstance = hInstance;
			params.Size = size;
			params.Fullscreen = fullscreen;

			return CreateKernel(params);
		}

		BRAINSTEM_API IKernel* GetKernel()
		{
			if (BstmKernel != NULL)
				return BstmKernel;

			Kernel_Params params;
			return CreateKernel(params);
		}
	}
}
