.[ ČeskéHry.cz ].

Laboratoř ČeskýchHer.cz - PasteBin

Vložit nový kód

ČeskéHry.cz - KOMUNITA HERNÍCH VÝVOJÁŘŮ

  1. vdavewf
    1 hod
  2. asdgswhwe
    5 hod
  3. bgvfcdx
    5 hod
  4. FullCP
    7 hod
  5. FullCP
    7 hod
  6. t33n young collection Cute teens
    7 hod
  7. t33n young collection Cute teens
    7 hod
  8. Watch for free MOvie full online streaming
    9 hod
  9. https://www.facebook.com/Jelly.Roll.Weight.Loss.Gummies.US.CA.UK.AU.NZ
    9 hod
  10. sdbsdbsdb
    9 hod
Link: http://nopaste.ceske-hry.cz/subdom/nopaste222610
Zaslal: Eosie
Popis: Test Direct3D 11.
Jazyk: C++
Vloženo: 28.11.2008, 23:03
Stáhnout jako soubor
  1. void testDirect3D11FeatureLevel(const TCHAR *testName, D3D_DRIVER_TYPE driverType)
  2. {
  3. tcout << _T("\nTesting ") << testName << _T("...\n");
  4.  
  5. HWND hWnd = CreateWindowEx(0, _T("#32769"), _T("Dummy"), 0, 0, 0, 0, 0, 0, 0, GetModuleHandle(0), 0);
  6. if (!hWnd)
  7. {
  8. tcout << "Cannot create window.\n";
  9. return;
  10. }
  11.  
  12. ID3D11Device *device;
  13. D3D_FEATURE_LEVEL featureLevel;
  14. HRESULT hr = D3D11CreateDevice(0, driverType, 0, 0, 0, 0, D3D11_SDK_VERSION,
  15. &device, &featureLevel, 0);
  16. if (!SUCCEEDED(hr))
  17. {
  18. tcout << "D3D11 device creation failed.\n";
  19. CloseWindow(hWnd);
  20. return;
  21. }
  22.  
  23. tcout << _T("D3D11 device created.\n");
  24.  
  25. switch (featureLevel)
  26. {
  27. case D3D_FEATURE_LEVEL_9_1:
  28. tcout << _T("Feature level 9_1 supported, which means we have shaders 2.0.\n");
  29. break;
  30. case D3D_FEATURE_LEVEL_9_2:
  31. tcout << _T("Feature level 9_2 supported, which means we have shaders 2.0.\n");
  32. break;
  33. case D3D_FEATURE_LEVEL_9_3:
  34. tcout << _T("Feature level 9_3 supported, which means we have shaders 3.0.\n");
  35. break;
  36. case D3D_FEATURE_LEVEL_10_0:
  37. tcout << _T("Feature level 10_0 supported, which means we have shaders 4.0.\n");
  38. break;
  39. case D3D_FEATURE_LEVEL_10_1:
  40. tcout << _T("Feature level 10_1 supported, which means we have shaders 4.0.\n");
  41. break;
  42. case D3D_FEATURE_LEVEL_11_0:
  43. tcout << _T("Feature level 11_0 supported, which means we have shaders 5.0.\n");
  44. break;
  45. }
  46.  
  47. device->Release();
  48. CloseWindow(hWnd);
  49. }
  50.  
  51. int _tmain(int argc, _TCHAR* argv[])
  52. {
  53. testDirect3D11FeatureLevel(_T("HAL"), D3D_DRIVER_TYPE_HARDWARE);
  54. testDirect3D11FeatureLevel(_T("REF"), D3D_DRIVER_TYPE_REFERENCE);
  55. testDirect3D11FeatureLevel(_T("WARP"), D3D_DRIVER_TYPE_WARP);
  56. return 0;
  57. }
  58.