示例#1
0
int WINAPI WinMain(HINSTANCE h_instance, HINSTANCE h_prev_instance, PSTR cmd_line, int show_cmd)
{
	myInitMemoryCheck();

	Game game;

	game.get_window()->InitWindowApp(h_instance, show_cmd, WndProc);
	if (!game.get_renderer()->Initialize(game.get_window()->get_window(), 800, 600, 4))
	{
		MessageBox(0, L"Failed to initialize Direct3D", 0, 0);
		return 0;
	}

	//RAWINPUTDEVICE Rid[2];

	//Rid[0].usUsagePage = 0x01;
	//Rid[0].usUsage = 0x02;
	//Rid[0].dwFlags = RIDEV_NOLEGACY;   // adds HID mouse and also ignores legacy mouse messages
	//Rid[0].hwndTarget = 0;

	//Rid[1].usUsagePage = 0x01;
	//Rid[1].usUsage = 0x06;
	//Rid[1].dwFlags = RIDEV_NOLEGACY;   // adds HID keyboard and also ignores legacy keyboard messages
	//Rid[1].hwndTarget = 0;

	//if (RegisterRawInputDevices(Rid, 2, sizeof(Rid[0])) == FALSE) {
	//	DWORD error = GetLastError();
	//	MessageBox(nullptr, L"Failed to register raw input device.", 0, error);
	//}

	return game.Run();
}
示例#2
0
文件: main.cpp 项目: Malow/PowerBall
int WINAPI wWinMain(HINSTANCE hInstance, HINSTANCE, LPWSTR, int nCmdShow)
{
#if defined(DEBUG) || defined(_DEBUG)
	myInitMemoryCheck();
#endif
	//_CrtSetBreakAlloc(3795052);

	MaloW::ClearDebug();
	
	GraphicsEngineParams params;
	params.LoadFromeFile("config.cfg");
	//params.CamType = FPS;
	/*	Structure of cfg file:
	windowWidth
	windowHeight
	Maximized
	ShadowMapQuality
	FXAAQuality
	*/

	GameOptions GameParams;
	GameParams.LoadFromeFile("GameSettings.cfg");
	/*
	masterVolume
	songVolume //Funkar dock inte
	effectVolume //Funkar dock inte
	*/

	// Create the graphics engine
	GraphicsEngine* ge = new GraphicsEngine(params, hInstance, nCmdShow);
	gfxeng::eng = ge; // Set the global eng to our engine so that GetGraphicsEngine(); can work.
	ge->CreateSkyBox("Media/skymap.dds");

	//test();	// Instead of ifndef lol

	// Create the MainMenu and send the graphics engine, and then run Run();
	MainMenu* mm = new MainMenu(ge);
	mm->Run();

	delete mm;
	delete ge;
	gfxeng::eng = NULL;

	#if defined(DEBUG) || defined(_DEBUG)
		myDumpMemoryLeaks();
	#endif
	
	return 0;
}