Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- D3D_FEATURE_LEVEL featureLevels[] =
- {
- D3D_FEATURE_LEVEL_9_3
- };
- // Create the Direct3D 11 API device object and a corresponding context.
- ComPtr<ID3D11Device> device;
- ComPtr<ID3D11DeviceContext> context;
- DX::ThrowIfFailed(
- D3D11CreateDevice(
- nullptr, // Specify nullptr to use the default adapter.
- D3D_DRIVER_TYPE_HARDWARE,
- nullptr,
- creationFlags, // Set set debug and Direct2D compatibility flags.
- featureLevels, // List of feature levels this app can support.
- ARRAYSIZE(featureLevels),
- D3D11_SDK_VERSION, // Always set this to D3D11_SDK_VERSION.
- &device, // Returns the Direct3D device created.
- &m_featureLevel, // Returns feature level of device created.
- &context // Returns the device immediate context.
- )
- );
- // Get the Direct3D 11.1 API device and context interfaces.
- DX::ThrowIfFailed(
- device.As(&m_d3dDevice)
- );
- DX::ThrowIfFailed(
- context.As(&m_d3dContext)
- );
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement