2
0

BsPlatformUtility.h 1.7 KB

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