Advertisement
Guest User

Untitled

a guest
Apr 23rd, 2014
56
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.97 KB | None | 0 0
  1. D3D_FEATURE_LEVEL featureLevels[] =
  2. {
  3. D3D_FEATURE_LEVEL_9_3
  4. };
  5.  
  6. // Create the Direct3D 11 API device object and a corresponding context.
  7. ComPtr<ID3D11Device> device;
  8. ComPtr<ID3D11DeviceContext> context;
  9. DX::ThrowIfFailed(
  10. D3D11CreateDevice(
  11. nullptr, // Specify nullptr to use the default adapter.
  12. D3D_DRIVER_TYPE_HARDWARE,
  13. nullptr,
  14. creationFlags, // Set set debug and Direct2D compatibility flags.
  15. featureLevels, // List of feature levels this app can support.
  16. ARRAYSIZE(featureLevels),
  17. D3D11_SDK_VERSION, // Always set this to D3D11_SDK_VERSION.
  18. &device, // Returns the Direct3D device created.
  19. &m_featureLevel, // Returns feature level of device created.
  20. &context // Returns the device immediate context.
  21. )
  22. );
  23.  
  24.  
  25. // Get the Direct3D 11.1 API device and context interfaces.
  26. DX::ThrowIfFailed(
  27. device.As(&m_d3dDevice)
  28. );
  29.  
  30.  
  31. DX::ThrowIfFailed(
  32. context.As(&m_d3dContext)
  33. );
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement