Пример #1
0
void InitGameStates (void)
{
memset (&gameStates, 0, sizeof (gameStates));
CheckEndian ();
InitGameConfig ();
InitAppStates ();
InitGameplayStates ();
InitInputStates ();
InitMenuStates ();
InitMovieStates ();
InitMultiplayerStates ();
InitGfxStates ();
InitRenderStates ();
InitSoundStates ();
InitVideoStates ();
}
Пример #2
0
//===============================================================================================================================
bool D3D::Initialize11(EngineOptions* options)
{
	HWND hwnd = options->hwnd;

	// Initialize the GDI Plus interface to use with DirectX
	m_gdi = new GDI();
	
	mOptions = options;

	m_isFullscreen = mOptions->fullscreen;

	m_screenWidth = options->m_screenWidth;
	m_screenHeight = options->m_screenHeight;

	//Store the vsync setting
	m_vsync_enabled = mOptions->m_vsync;

	//Initialize the DirectX interface adapters and get display modes
	InitializeAdapterAndModes();

	//Create the Swap chain and device
	InitializeDeviceAndSwapChain11();

	//Create the backbuffers and render targets
	InitializeBackbuffers11();

	//Setup the main viewport for rendering
    m_viewport.Width = static_cast<float>(m_screenWidth);
    m_viewport.Height = static_cast<float>(m_screenHeight);
    m_viewport.MinDepth = 0.0f;
    m_viewport.MaxDepth = 1.0f;
    m_viewport.TopLeftX = 0.0f;
    m_viewport.TopLeftY = 0.0f;

    m_deviceContext->RSSetViewports(1, &m_viewport);

	//Create the device states and render states
	InitRenderStates();

	//m_RenderTargets.SetInitialValue( NULL );

	return true;
}