Graphics Reference
In-Depth Information
}//End of main thread creation loop.
//Wait until all threads have terminated.
WaitForMultipleObjects(MAX_THREADS, hThreadArray, TRUE, INFINITE);
//Close all thread handles and free memory allocations.
for(int i = 0; i<MAX_THREADS; i++)
{
CloseHandle(hThreadArray[i]);
if(pDataArray[i] ! = NULL)
{
HeapFree(GetProcessHeap(), 0, pDataArray[i]);
pDataArray[i] = NULL; //Ensure address is not reused.
}
}
#endif
//Enable run-time memory check for debug builds.
#if defined(DEBUG) | defined(_DEBUG)
_CrtSetDbgFlag(_CRTDBG_ALLOC_MEM_DF | _CRTDBG_LEAK_CHECK_DF);
#endif
//Set the callback functions
DXUTSetCallbackD3D9DeviceAcceptable(IsDeviceAcceptable);
DXUTSetCallbackD3D9DeviceCreated(OnCreateDevice);
DXUTSetCallbackD3D9DeviceReset(OnResetDevice);
DXUTSetCallbackD3D9FrameRender(OnFrameRender);
DXUTSetCallbackD3D9DeviceLost(OnLostDevice);
DXUTSetCallbackD3D9DeviceDestroyed(OnDestroyDevice);
DXUTSetCallbackMsgProc(MsgProc);
DXUTSetCallbackKeyboard(KeyboardProc);
DXUTSetCallbackFrameMove(OnFrameMove);
DXUTSetCallbackDeviceChanging(ModifyDeviceSettings);
//Initialize DXUT and create the desired Win32 window and Direct3D
//device for the application
DXUTSetCursorSettings(true, true);//Show the cursor and clip it when
in full screen
InitApp();
DXUTInit(true, true);//Parse the command line and show msgboxes
DXUTSetHotkeyHandling(true, true, true); //handle the default
hotkeys
DXUTCreateWindow(L”Enhanced Mesh - N-Patches”);
DXUTCreateDevice(true, 1366, 768);
DXUTMainLoop();
//Perform any application-level cleanup here. Direct3D device
//resources are released within the appropriate callback functions
//and therefore don't require any cleanup code here.
logfile << “Duration(sec): “ << time(NULL) - startTime << std::endl;
logfile.close();
return DXUTGetExitCode();
}
Search WWH ::




Custom Search