BsPlatformUtility.h 1.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071
  1. //********************************** Banshee Engine (www.banshee3d.com) **************************************************//
  2. //**************** Copyright (c) 2016 Marko Pintera ([email protected]). All rights reserved. **********************//
  3. #pragma once
  4. #include "Prerequisites/BsPlatformDefines.h"
  5. #include "String/BsString.h"
  6. #include "Prerequisites/BsTypes.h"
  7. namespace bs
  8. {
  9. /** @addtogroup General
  10. * @{
  11. */
  12. struct MACAddress;
  13. /** Contains information about available GPUs on the system. */
  14. struct GPUInfo
  15. {
  16. String names[5];
  17. UINT32 numGPUs;
  18. };
  19. /** Contains information about the system hardware and operating system. */
  20. struct SystemInfo
  21. {
  22. String cpuManufacturer;
  23. String cpuModel;
  24. UINT32 cpuClockSpeedMhz;
  25. UINT32 cpuNumCores;
  26. UINT32 memoryAmountMb;
  27. String osName;
  28. bool osIs64Bit;
  29. GPUInfo gpuInfo;
  30. };
  31. /** Provides access to various operating system specific utility functions. */
  32. class BS_UTILITY_EXPORT PlatformUtility
  33. {
  34. public:
  35. /**
  36. * Terminates the current process.
  37. *
  38. * @param[in] force True if the process should be forcefully terminated with no cleanup.
  39. */
  40. static void terminate(bool force = false);
  41. /** Returns information about the underlying hardware. */
  42. static SystemInfo getSystemInfo();
  43. /** Creates a new universally unique identifier and returns it as a string. */
  44. static String generateUUID();
  45. /** @name Internal
  46. * @{
  47. */
  48. /**
  49. * Assigns information about GPU hardware. This data will be returned by getSystemInfo() when requested. This is
  50. * expeced to be called by the render API backend when initialized.
  51. */
  52. static void _setGPUInfo(GPUInfo gpuInfo) { sGPUInfo = gpuInfo; }
  53. /** @} */
  54. private:
  55. static GPUInfo sGPUInfo;
  56. };
  57. /** @} */
  58. }