//-------------------------------------------------------------------------------------- // Entry point to the program. Initializes everything and goes into a message processing // loop. Idle time is used to render the scene. //-------------------------------------------------------------------------------------- INT WINAPI wWinMain( HINSTANCE, HINSTANCE, LPWSTR, int ) { // Enable run-time memory check for debug builds. #if defined(DEBUG) | defined(_DEBUG) _CrtSetDbgFlag( _CRTDBG_ALLOC_MEM_DF | _CRTDBG_LEAK_CHECK_DF ); #endif // DXUT will create and use the best device (either D3D9 or D3D10) // that is available on the system depending on which D3D callbacks are set below // Disable gamma correction on this sample DXUTSetIsInGammaCorrectMode( false ); // Set DXUT callbacks DXUTSetCallbackD3D10DeviceAcceptable( IsD3D10DeviceAcceptable ); DXUTSetCallbackD3D10DeviceCreated( OnD3D10CreateDevice ); DXUTSetCallbackD3D10SwapChainResized( OnD3D10ResizedSwapChain ); DXUTSetCallbackD3D10SwapChainReleasing( OnD3D10ReleasingSwapChain ); DXUTSetCallbackD3D10DeviceDestroyed( OnD3D10DestroyDevice ); DXUTSetCallbackD3D10FrameRender( OnD3D10FrameRender ); DXUTSetCallbackMsgProc( MsgProc ); DXUTSetCallbackKeyboard( OnKeyboard ); DXUTSetCallbackFrameMove( OnFrameMove ); DXUTSetCallbackDeviceChanging( ModifyDeviceSettings ); InitApp(); DXUTInit( true, true, NULL ); // Parse the command line, show msgboxes on error, no extra command line params DXUTSetCursorSettings( true, true ); // Show the cursor and clip it when in full screen DXUTCreateWindow( L"AABB-Tree Hierarchies" ); DXUTCreateDevice( true, 640, 480 ); DXUTMainLoop(); // Enter into the DXUT render loop return DXUTGetExitCode(); }
//-------------------------------------------------------------------------------------- // Entry point to the program. Initializes everything and goes into a message processing // loop. Idle time is used to render the scene. //-------------------------------------------------------------------------------------- int WINAPI wWinMain( HINSTANCE hInstance, HINSTANCE hPrevInstance, LPWSTR lpCmdLine, int nCmdShow ) { // Enable run-time memory check for debug builds. #if defined(DEBUG) | defined(_DEBUG) _CrtSetDbgFlag( _CRTDBG_ALLOC_MEM_DF | _CRTDBG_LEAK_CHECK_DF ); #endif // Disable gamma correction on this sample DXUTSetIsInGammaCorrectMode( false ); DXUTSetCallbackDeviceChanging( ModifyDeviceSettings ); DXUTSetCallbackMsgProc( MsgProc ); DXUTSetCallbackFrameMove( OnFrameMove ); DXUTSetCallbackMouse( MouseProc ); DXUTSetCallbackKeyboard( OnKeyboard ); DXUTSetCallbackD3D11DeviceAcceptable( IsD3D11DeviceAcceptable ); DXUTSetCallbackD3D11DeviceCreated( OnD3D11CreateDevice ); DXUTSetCallbackD3D11SwapChainResized( OnD3D11ResizedSwapChain ); DXUTSetCallbackD3D11FrameRender( OnD3D11FrameRender ); DXUTSetCallbackD3D11SwapChainReleasing( OnD3D11ReleasingSwapChain ); DXUTSetCallbackD3D11DeviceDestroyed( OnD3D11DestroyDevice ); InitApp(); DXUTInit( true, true ); DXUTSetCursorSettings( true, true );// Show the cursor and clip when in full screen DXUTCreateWindow( L"Contact Hardening Shadows - Direct3D 11" ); DXUTCreateDevice( D3D_FEATURE_LEVEL_11_0, true, 800, 600 ); DXUTMainLoop(); // Enter into the DXUT render loop return DXUTGetExitCode(); }
//-------------------------------------------------------------------------------------- // Entry point to the program. Initializes everything and goes into a message processing // loop. Idle time is used to render the scene. //-------------------------------------------------------------------------------------- int WINAPI wWinMain(HINSTANCE /*hInstance*/, HINSTANCE /*hPrevInstance*/, LPWSTR /*lpCmdLine*/, int /*nCmdShow*/) { // Enable run-time memory check for debug builds. #if defined(DEBUG) | defined(_DEBUG) _CrtSetDbgFlag(_CRTDBG_ALLOC_MEM_DF | _CRTDBG_LEAK_CHECK_DF); #endif // Disable gamma correction on this sample DXUTSetIsInGammaCorrectMode(false); DXUTSetCallbackDeviceChanging(ModifyDeviceSettings); DXUTSetCallbackMsgProc(MsgProc); DXUTSetCallbackFrameMove(OnFrameMove); DXUTSetCallbackD3D11DeviceAcceptable(IsD3D11DeviceAcceptable); DXUTSetCallbackD3D11DeviceCreated(OnD3D11CreateDevice); DXUTSetCallbackD3D11SwapChainResized(OnD3D11ResizedSwapChain); DXUTSetCallbackD3D11FrameRender(OnD3D11FrameRender); DXUTSetCallbackD3D11SwapChainReleasing(OnD3D11ReleasingSwapChain); DXUTSetCallbackD3D11DeviceDestroyed(OnD3D11DestroyDevice); InitApp(); // Force create a ref device so that feature level D3D_FEATURE_LEVEL_11_0 is guaranteed DXUTInit(true, true, NULL); // Parse the command line, show msgboxes on error DXUTSetCursorSettings(true, true); // Show the cursor and clip it when in full screen DXUTCreateWindow(L"OIT11"); DXUTCreateDevice(D3D_FEATURE_LEVEL_11_0, true, g_nFrameWidth, g_nFrameHeight); DXUTMainLoop(); // Enter into the DXUT render loop return DXUTGetExitCode(); }
//-------------------------------------------------------------------------------------- // Initialize everything and go into a render loop //-------------------------------------------------------------------------------------- int WINAPI wWinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPWSTR lpCmdLine, int nCmdShow) { HRESULT hr; V_RETURN(DXUTSetMediaSearchPath(MEDIA_PATH)); // Enable run-time memory check for debug builds. #if defined(DEBUG) _CrtSetDbgFlag(_CRTDBG_ALLOC_MEM_DF | _CRTDBG_LEAK_CHECK_DF); #endif // Set general DXUT callbacks DXUTSetCallbackFrameMove(OnFrameMove); DXUTSetCallbackKeyboard(OnKeyboard); DXUTSetCallbackMouse(OnMouse); DXUTSetCallbackMsgProc(MsgProc); DXUTSetCallbackDeviceChanging(ModifyDeviceSettings); DXUTSetCallbackDeviceRemoved(OnDeviceRemoved); // Set the D3D11 DXUT callbacks DXUTSetCallbackD3D11DeviceAcceptable (IsD3D11DeviceAcceptable); DXUTSetCallbackD3D11DeviceCreated (OnD3D11CreateDevice); DXUTSetCallbackD3D11SwapChainResized (OnD3D11ResizedSwapChain); DXUTSetCallbackD3D11FrameRender (OnD3D11FrameRender); DXUTSetCallbackD3D11SwapChainReleasing(OnD3D11ReleasingSwapChain); DXUTSetCallbackD3D11DeviceDestroyed (OnD3D11DestroyDevice); // Perform any application-level initialization here InitAOParams(g_AOParams); InitGUI(); UINT Width = 1920; UINT Height = 1200; DXUTInit(true, true, NULL); // Parse the command line, show msgboxes on error, no extra command line params DXUTSetCursorSettings(true, true); // Show the cursor and clip it when in full screen DXUTSetIsInGammaCorrectMode(false); // Do not use a SRGB back buffer for this sample DXUTCreateWindow(L"Deinterleaved Texturing"); DXUTCreateDevice(D3D_FEATURE_LEVEL_11_0, true, Width, Height); //DXUTToggleFullScreen(); DXUTMainLoop(); // Enter into the DXUT render loop // Perform any application-level cleanup here return DXUTGetExitCode(); }
void CDirect3DView::OnInitialUpdate() { __super::OnInitialUpdate(); if (DXUTGetD3D11Device() != NULL) { return; } DXUTSetIsInGammaCorrectMode(false); // Set general DXUT callbacks DXUTSetCallbackFrameMove( OnDXUTFrameMove, this ); DXUTSetCallbackKeyboard( OnDXUTKeyboard, this ); DXUTSetCallbackMouse( OnDXUTMouse, true, this ); DXUTSetCallbackMsgProc( DXUTMsgProc, this ); DXUTSetCallbackDeviceChanging( DXUTModifyDeviceSettings, this ); DXUTSetCallbackDeviceRemoved( OnDXUTDeviceRemoved, this ); // Set the D3D11 DXUT callbacks. Remove these sets if the app doesn't need to support D3D11 DXUTSetCallbackD3D11DeviceAcceptable( DXUTIsD3D11DeviceAcceptable, this ); DXUTSetCallbackD3D11DeviceCreated( OnDXUTD3D11CreateDevice, this ); DXUTSetCallbackD3D11SwapChainResized( OnDXUTD3D11ResizedSwapChain, this ); DXUTSetCallbackD3D11FrameRender( OnDXUTD3D11FrameRender, this ); DXUTSetCallbackD3D11SwapChainReleasing( OnDXUTD3D11ReleasingSwapChain, this ); DXUTSetCallbackD3D11DeviceDestroyed( OnDXUTD3D11DestroyDevice, this ); DXUTInit( true, true, NULL ); // Parse the command line, show msgboxes on error, no extra command line params DXUTSetCursorSettings( true, true ); // Show the cursor and clip it when in full screen // Create DXUT stuff DXUTSetWindow( this->GetSafeHwnd(), this->GetSafeHwnd(), this->GetSafeHwnd(), false ); CRect rect; GetClientRect(&rect); // Only require 10-level hardware DXUTCreateDevice( D3D_FEATURE_LEVEL_10_1, true, rect.right, rect.bottom ); }
int WINAPI wWinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPWSTR lpCmdLine, INT nCmdShow) { // Enable run-time memory check for debug builds. #if defined(DEBUG) | defined(_DEBUG) _CrtSetDbgFlag(_CRTDBG_ALLOC_MEM_DF | _CRTDBG_LEAK_CHECK_DF); #endif #pragma region Callback Calls DXUTSetCallbackDeviceChanging(ModifyDeviceSettings); DXUTSetCallbackMsgProc(MsgProc); DXUTSetCallbackKeyboard(OnKeyboard); DXUTSetCallbackFrameMove(OnFrameMove); DXUTSetCallbackD3D11DeviceCreated(OnD3D11CreateDevice); DXUTSetCallbackD3D11SwapChainResized(OnD3D11ResizedSwapChain); DXUTSetCallbackD3D11FrameRender(OnD3D11FrameRender); DXUTSetCallbackD3D11SwapChainReleasing(OnD3D11ReleasingSwapChain); DXUTSetCallbackD3D11DeviceDestroyed(OnD3D11DestroyDevice); #pragma endregion DXUTSetIsInGammaCorrectMode(true); DXUTInit(true, true, 0); InitUI(); #pragma region Adjust Display and Handling Settings DXUTSetCursorSettings(true, true); DXUTSetHotkeyHandling(true, true, false); DXUTCreateWindow(L"Deferred Shading"); DXUTCreateDevice(D3D_FEATURE_LEVEL_11_0, true, 1280, 720); #pragma endregion DXUTMainLoop(); return DXUTGetExitCode(); }