Ocular Engine
SystemInfo.hpp
1 
17 #pragma once
18 #ifndef __H__OCULAR_SYSTEM_INFO__
19 #define __H__OCULAR_SYSTEM_INFO__
20 
21 #include "FileIO/Directory.hpp"
22 #include "Common.hpp"
23 
24 #include <cstdint>
25 
26 //------------------------------------------------------------------------------------------
27 
32 namespace Ocular
33 {
38  namespace Core
39  {
46  class SystemInfo
47  {
48  public:
49 
50  SystemInfo();
51  ~SystemInfo();
52 
56  static void initialize();
57 
67  static void refresh();
68 
72  static void logSystemInfo();
73 
77  static OperatingSystems getOperatingSystem();
78 
82  static ProcessorArchitectures getProcessorArchitecture();
83 
87  static Endianness getEndianness();
88 
92  static OpenGLLevels getOpenGLSupportLevel();
93 
97  static DirectXLevels getDirectXSupportLevel();
98 
103  static uint64_t getTotalRAM();
104 
109  static uint64_t getFreeRAM();
110 
115  static uint64_t getTotalGPUMemory();
116 
121  static uint64_t getFreeGPUMemory();
122 
127  static uint32_t getNumberOfChannels();
128 
132  static uint32_t getNumberOfThreads();
133 
138 
139  protected:
140 
141  //----------------------------------------
142  // System specifics that should not change during program runtime.
143  // These are called in initialize
144 
145  static void discoverOperatingSystem();
146  static void discoverProcessorArchitecture();
147  static void discoverEndianness();
148  static void discoverOpenGLLevel();
149  static void discoverDirectXLevel();
150  static void discoverInstalledRAM();
151  static void discoverInstalledGPUMemory();
152  static void discoverNumberOfThreads();
153 
154  //----------------------------------------
155  // System specific that can change during program runtime
156  // These are called in refresh
157 
158  static void discoverAvailableGPUMemory();
159  static void discoverAvailableRAM();
160  static void discoverChannels();
161 
162  private:
163 
164  static OperatingSystems m_OperatingSystem;
165  static ProcessorArchitectures m_ProcessorArchitecture;
166  static Endianness m_Endianness;
167  static OpenGLLevels m_OpenGLLevel;
168  static DirectXLevels m_DirectXLevel;
169 
170  static uint64_t m_TotalRAM;
171  static uint64_t m_FreeRAM;
172  static uint64_t m_TotalGPUMemory;
173  static uint64_t m_FreeGPUMemory;
174 
175  static uint32_t m_NumberOfChannels;
176  static uint32_t m_NumberOfThreads;
177 
178  static Core::Directory m_WorkingDirectory;
179  };
180  }
184 }
189 //------------------------------------------------------------------------------------------
190 
191 #endif
Definition: SystemInfo.hpp:46
Endianness
Definition: Common.hpp:89
static uint64_t getFreeGPUMemory()
Definition: SystemInfo.cpp:209
static ProcessorArchitectures getProcessorArchitecture()
Definition: SystemInfo.cpp:174
static uint64_t getTotalRAM()
Definition: SystemInfo.cpp:194
Note: Once this library is made dynamic, this will no longer be needed.
Definition: Common.hpp:70
static uint32_t getNumberOfChannels()
Definition: SystemInfo.cpp:214
static void refresh()
Definition: SystemInfo.cpp:81
static Endianness getEndianness()
Definition: SystemInfo.cpp:179
static uint64_t getFreeRAM()
Definition: SystemInfo.cpp:199
static DirectXLevels getDirectXSupportLevel()
Definition: SystemInfo.cpp:189
static void initialize()
Definition: SystemInfo.cpp:65
Definition: Directory.hpp:43
static OperatingSystems getOperatingSystem()
Definition: SystemInfo.cpp:169
static Core::Directory getWorkingDirectory()
Definition: SystemInfo.cpp:224
static uint32_t getNumberOfThreads()
Definition: SystemInfo.cpp:219
static void logSystemInfo()
Definition: SystemInfo.cpp:90
static uint64_t getTotalGPUMemory()
Definition: SystemInfo.cpp:204
static OpenGLLevels getOpenGLSupportLevel()
Definition: SystemInfo.cpp:184