-------------------------------------------------------------------------------------- Entry point to the program. Initializes everything and goes into a message processing loop. Idle time is used to render the scene. --------------------------------------------------------------------------------------
| 948 | // loop. Idle time is used to render the scene. |
| 949 | //-------------------------------------------------------------------------------------- |
| 950 | int WINAPI wWinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPWSTR lpCmdLine, int nCmdShow) |
| 951 | { |
| 952 | // Enable run-time memory check for debug builds. |
| 953 | #if defined(DEBUG) || defined(_DEBUG) |
| 954 | _CrtSetDbgFlag(_CRTDBG_ALLOC_MEM_DF | _CRTDBG_LEAK_CHECK_DF); |
| 955 | #endif |
| 956 | |
| 957 | // DXUT will create and use the best device (either D3D9 or D3D11) |
| 958 | // that is available on the system depending on which D3D callbacks are set |
| 959 | // below |
| 960 | |
| 961 | // Set DXUT callbacks |
| 962 | DXUTSetCallbackMsgProc(MsgProc); |
| 963 | DXUTSetCallbackKeyboard(OnKeyboard); |
| 964 | DXUTSetCallbackFrameMove(OnFrameMove); |
| 965 | DXUTSetCallbackDeviceChanging(ModifyDeviceSettings); |
| 966 | |
| 967 | DXUTSetCallbackD3D11DeviceAcceptable(IsD3D11DeviceAcceptable); |
| 968 | DXUTSetCallbackD3D11DeviceCreated(OnD3D11CreateDevice, &g_Application); |
| 969 | DXUTSetCallbackD3D11SwapChainResized(OnD3D11ResizedSwapChain, &g_Application); |
| 970 | DXUTSetCallbackD3D11SwapChainReleasing(OnD3D11ReleasingSwapChain, &g_Application); |
| 971 | DXUTSetCallbackD3D11DeviceDestroyed(OnD3D11DestroyDevice, &g_Application); |
| 972 | DXUTSetCallbackD3D11FrameRender(OnD3D11FrameRender, &g_Application); |
| 973 | |
| 974 | int argc = 0; |
| 975 | wchar_t **argv = CommandLineToArgvW(lpCmdLine, &argc); |
| 976 | const auto cmdLineOptions = ParseCommandLine(argc, argv); |
| 977 | g_Application.Setup(cmdLineOptions); |
| 978 | |
| 979 | unsigned int major, minor, patch; |
| 980 | AMD::GeometryFX_GetVersion(&major, &minor, &patch); |
| 981 | |
| 982 | WCHAR windowTitle[64]; |
| 983 | swprintf_s(windowTitle, 64, L"AMD GeometryFX v%d.%d.%d", major, minor, patch); |
| 984 | |
| 985 | InitApp(); |
| 986 | DXUTInit(true, true, NULL); // Parse the command line, show msgboxes on error, no extra |
| 987 | // command line params |
| 988 | DXUTSetCursorSettings(true, true); |
| 989 | DXUTCreateWindow(windowTitle); |
| 990 | |
| 991 | DXUTCreateDevice( |
| 992 | D3D_FEATURE_LEVEL_11_0, true, g_Application.windowWidth, g_Application.windowHeight); |
| 993 | |
| 994 | DXUTMainLoop(); // Enter into the DXUT render loop |
| 995 | |
| 996 | return DXUTGetExitCode(); |
| 997 | } |
| 998 | |
| 999 | //-------------------------------------------------------------------------------------- |
| 1000 | // Initialize the app |
nothing calls this directly
no test coverage detected