/*
 *  psychlops_app_main_Win32.cpp
 *  Psychlops Standard Library (Universal)
 *
 *  Last Modified 2006/01/09 by Kenchi HOSOKAWA
 *  (C) 2006 Kenchi HOSOKAWA, Kazushi MARUYA and Takao SATO
 */


#include <windows.h>


//#include "psychlops_app_main_Win32.h"
#include "../../psychlops_core.h"
#include "psychlops_app_tweak_win32.h"
#include "../win32gl/psychlops_g_API_win32gl.h"


namespace Psychlops {

	HWND DebugTweakTool::getRawWindowHandle(Canvas &target)
	{
		return target.api->the_window_;
	}


}	/*	<- namespace Psycholops 	*/


/*
extern "C" int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine, int iCmdShow) {

	MSG msg;
	msg.wParam = 0;
	Psychlops::APIApplicationProperties::startupinfo.set(hInstance, hPrevInstance, lpCmdLine, iCmdShow);

	try {

		//	giveio.sys
		//HANDLE h = CreateFile(CreateFile("\\\\.\\giveio", GENERIC_READ, 0, NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL);
		//if(h == INVALID_HANDLE_VALUE) throw "INVALID_HANDLE_VALUE";
		//CloseHandle(h);

		HANDLE hProcess = GetCurrentProcess();
		SetPriorityClass(hProcess,NORMAL_PRIORITY_CLASS);


		Psychlops::initialize();
		psychlops_main();


	} catch(Psychlops::Exception e) {
		if(e.ti_ == typeid(Psychlops::APIInputProperties)) {
			if(Psychlops::Display::the_canvas!=NULL) Psychlops::Display::the_canvas->release();
		}
		MessageBox( NULL, e.to_s().c_str(), "Psychlops Notification", MB_OK );
		//Psychlops::APIApplicationProperties::analyzeAPIError();
	} catch(std::exception e) {
		MessageBox( NULL, e.what(), "Psychlops Notification : std lib exception", MB_OK );
	} catch(char* str) {
		MessageBox( NULL, str, "Psychlops Notification", MB_OK );
		//Psychlops::APIApplicationProperties::analyzeAPIError();
	}

//	return 0;
	return msg.wParam;

}*/

