BsD3D11Driver.h 2.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778
  1. //********************************** Banshee Engine (www.banshee3d.com) **************************************************//
  2. //**************** Copyright (c) 2016 Marko Pintera ([email protected]). All rights reserved. **********************//
  3. #pragma once
  4. #include "BsD3D11Prerequisites.h"
  5. namespace BansheeEngine
  6. {
  7. /**
  8. * @brief Provides information about a driver (e.g. hardware GPU driver or software emulated).
  9. */
  10. class D3D11Driver
  11. {
  12. public:
  13. /**
  14. * @brief Constructs a new object from the adapter number provided by DX11 runtime, and
  15. * DXGI adapter object.
  16. */
  17. D3D11Driver(UINT32 adapterNumber, IDXGIAdapter* dxgiAdapter);
  18. D3D11Driver(const D3D11Driver &ob);
  19. ~D3D11Driver();
  20. D3D11Driver& operator=(const D3D11Driver& r);
  21. /**
  22. * @brief Returns the name of the driver.
  23. */
  24. String getDriverName() const;
  25. /**
  26. * @brief Returns the description of the driver.
  27. */
  28. String getDriverDescription() const;
  29. /**
  30. * @brief Returns adapter index of the adapter the driver is managing.
  31. */
  32. UINT32 getAdapterNumber() const { return mAdapterNumber; }
  33. /**
  34. * @brief Returns number of outputs connected to the adapter the driver is managing.
  35. */
  36. UINT32 getNumAdapterOutputs() const { return mNumOutputs; }
  37. /**
  38. * @brief Returns a description of the adapter the driver is managing.
  39. */
  40. const DXGI_ADAPTER_DESC& getAdapterIdentifier() const { return mAdapterIdentifier; }
  41. /**
  42. * @brief Returns internal DXGI adapter object for the driver.
  43. */
  44. IDXGIAdapter* getDeviceAdapter() { return mDXGIAdapter; }
  45. /**
  46. * @brief Returns description of an output device at the specified index.
  47. */
  48. DXGI_OUTPUT_DESC getOutputDesc(UINT32 adapterOutputIdx) const;
  49. /**
  50. * @brief Returns a list of all available video modes for all output devices.
  51. */
  52. VideoModeInfoPtr getVideoModeInfo() const { return mVideoModeInfo; }
  53. private:
  54. /**
  55. * @brief Initializes the internal data.
  56. */
  57. void construct();
  58. private:
  59. UINT32 mAdapterNumber;
  60. UINT32 mNumOutputs;
  61. DXGI_ADAPTER_DESC mAdapterIdentifier;
  62. IDXGIAdapter* mDXGIAdapter;
  63. VideoModeInfoPtr mVideoModeInfo;
  64. };
  65. }