Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
DudeMcDude committed Apr 11, 2016
2 parents e7d65ea + 18c6c65 commit c24d81e
Showing 1 changed file with 13 additions and 1 deletion.
14 changes: 13 additions & 1 deletion Infrastructure/src/graphics/device.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -222,11 +222,23 @@ namespace gfx {

CreatePresentParams();

// Read preliminary caps needed to create the device
D3DCAPS9 caps;
if (mDirect3d9->GetDeviceCaps(D3DADAPTER_DEFAULT, D3DDEVTYPE_HAL, &caps) != D3D_OK) {
throw TempleException("Unable to retrieve the caps for the default device.");
}

auto vertexProcessing = D3DCREATE_HARDWARE_VERTEXPROCESSING;
if (!(caps.DevCaps & D3DDEVCAPS_HWTRANSFORMANDLIGHT)) {
logger->info("Device does not support hardware T&L. Falling back to software T&L");
vertexProcessing = D3DCREATE_SOFTWARE_VERTEXPROCESSING;
}

status = D3DLOG(mDirect3d9->CreateDeviceEx(
D3DADAPTER_DEFAULT,
D3DDEVTYPE_HAL,
mWindowHandle,
D3DCREATE_HARDWARE_VERTEXPROCESSING,
vertexProcessing,
&mPresentParams,
nullptr,
&mDevice));
Expand Down

0 comments on commit c24d81e

Please sign in to comment.