CmD3D11VideoMode.cpp 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. #include "CmD3D11VideoMode.h"
  2. namespace CamelotFramework
  3. {
  4. D3D11VideoMode::D3D11VideoMode(DXGI_OUTPUT_DESC d3ddm, DXGI_MODE_DESC modeDesc)
  5. :mDisplayMode(d3ddm), mModeDesc(modeDesc)
  6. { }
  7. D3D11VideoMode::D3D11VideoMode(const D3D11VideoMode &ob)
  8. :mDisplayMode(ob.mDisplayMode), mModeDesc(ob.mModeDesc)
  9. { }
  10. D3D11VideoMode::D3D11VideoMode()
  11. {
  12. ZeroMemory(&mDisplayMode, sizeof(DXGI_OUTPUT_DESC));
  13. ZeroMemory(&mModeDesc, sizeof(DXGI_MODE_DESC));
  14. }
  15. D3D11VideoMode::~D3D11VideoMode()
  16. { }
  17. String D3D11VideoMode::getDescription() const
  18. {
  19. return toString(mModeDesc.Width) + " x " + toString(mModeDesc.Height) + " @ " + toString(getColorDepth()) + "-bit color";
  20. }
  21. UINT32 D3D11VideoMode::getColorDepth() const
  22. {
  23. UINT32 colourDepth = 16;
  24. if( mModeDesc.Format == DXGI_FORMAT_R32G32B32A32_TYPELESS ||
  25. mModeDesc.Format == DXGI_FORMAT_R32G32B32A32_FLOAT ||
  26. mModeDesc.Format == DXGI_FORMAT_R32G32B32A32_UINT ||
  27. mModeDesc.Format == DXGI_FORMAT_R32G32B32A32_SINT ||
  28. mModeDesc.Format == DXGI_FORMAT_R32G32B32_TYPELESS ||
  29. mModeDesc.Format == DXGI_FORMAT_R32G32B32_FLOAT ||
  30. mModeDesc.Format == DXGI_FORMAT_R32G32B32_UINT ||
  31. mModeDesc.Format == DXGI_FORMAT_R32G32B32_SINT
  32. )
  33. colourDepth = 32;
  34. return colourDepth;
  35. }
  36. }