Exemplo n.º 1
0
Bool GApp::Init()
{
	//	can only get the module handle after main() 
	//GApp::g_HInstance = GetModuleHandle(NULL);
	if ( !CreateAppWindow() )
	{
		return FALSE;
	}

	Window()->SetOwnerApp( this );
	m_Display.m_pWindow = (GOpenglWindow*)Window();

	//	init inputs
	g_Keyboard.Init();
	g_Mouse.Init();
	g_Pad.Init();


	//	game initialisation
	if ( !GameInit() )
	{
		return FALSE;
	}

	//	window needs to already have been allocated
	if ( !Window() )
	{
		GDebug_Break("Window needs to already have been created\n");
		return FALSE;
	}

	//	create new window
	if ( ! Window()->Init( NULL, Window()->DefaultFlags(), 0, (char*)GameName() ) )
	{
		return FALSE;
	}

	//	create display, window etc
	if ( !m_Display.Init() )
	{
		return FALSE;
	}

	//	game post-display init
	if ( !GameDisplayInit() )
	{
		return FALSE;
	}

	Window()->Show();
	
	//	make sure everything is sized up
	OnResize();

	return TRUE;
}
Exemplo n.º 2
0
void DisplayInit()
{
	InitFreeType();
	GameDisplayInit();
	GUIDisplayInit();
}