Game Development Reference
In-Depth Information
'
I
ve decided to use the DirectX Framework for rendering, mostly because it handles
all of the pain and suffering of dealing with running a DirectX-based application
under Windows, especially drawing fonts and dialog boxes. Take a quick look at the
code in one of the source files in the DirectX Framework, DXUT.cpp, sometime, and
you
ll see exactly what I mean! The following code can be found in Source\
GameCode.cpp:
'
INT WINAPI GameCode4(HINSTANCE hInstance,
HINSTANCE hPrevInstance,
LPWSTR
lpCmdLine,
int
nCmdShow)
{
// Set up checks for memory leaks.
int tmpDbgFlag = _CrtSetDbgFlag(_CRTDBG_REPORT_FLAG);
// always perform a leak check just before app exits.
tmpDbgFlag
j
= _CRTDBG_LEAK_CHECK_DF;
_CrtSetDbgFlag(tmpDbgFlag);
Logger::Init(
logging.xml
);
g_pApp->m_Options.Init(
PlayerOptions.xml
, lpCmdLine);
DXUTSetCallbackD3D11DeviceAcceptable(GameCodeApp::IsD3D11DeviceAcceptable);
DXUTSetCallbackD3D11DeviceCreated(GameCodeApp::OnD3D11CreateDevice);
DXUTSetCallbackD3D11SwapChainResized(GameCodeApp::OnD3D11ResizedSwapChain);
DXUTSetCallbackD3D11SwapChainReleasing(
GameCodeApp::OnD3D11ReleasingSwapChain );
DXUTSetCallbackD3D11DeviceDestroyed( GameCodeApp::OnD3D11DestroyDevice );
DXUTSetCallbackD3D11FrameRender( GameCodeApp::OnD3D11FrameRender );
// Show the cursor and clip it when in full screen
DXUTSetCursorSettings( true, true );
// Perform application initialization
if (!g_pApp->InitInstance (hInstance, lpCmdLine, 0,
g_pApp->m_Options.m_ScreenSize.x,
g_pApp->m_Options.m_ScreenSize.y))
{
return FALSE;
}
DXUTMainLoop();
DXUTShutdown();
//_CRTDBG_LEAK_CHECK_DF is used at program initialization
// to force a leak check just before program exit. This
Search WWH ::




Custom Search