Etterna 0.75.1
Loading...
Searching...
No Matches
Platform.hpp
1#ifndef CORE_ARCH_ARCH_HPP
2#define CORE_ARCH_ARCH_HPP
3
4#include <cstddef>
5#include <string>
6#include <ghc/filesystem.hpp>
7
14namespace Core::Platform {
15
17 struct Dimensions { unsigned width; unsigned height; };
18
23 void init();
24
31 std::string getSystem();
32
37 std::string getArchitecture();
38
45 std::string getKernel();
46
51 std::size_t getSystemMemory();
52
57 std::string getSystemCPU();
58
66 std::string getSystemGPU();
67
73
79
84 std::string getLanguage();
85
91 bool openWebsite(const std::string& url);
92
98 bool openFolder(const ghc::filesystem::path& path);
99
104
105 std::string getClipboard();
106
112 bool setClipboardText(std::string text);
113
118 void setCursorVisible(bool value);
119
125 ghc::filesystem::path getExecutableDirectory();
126
140 ghc::filesystem::path getAppDirectory();
141
148 bool isOtherInstanceRunning(int argc, char** argv);
149
163 bool setConsoleEnabled(bool enable);
164
165 /*
166 * Raise the Application priority to mitigate some between-frame stuttering.
167 * This should be done outside of initial Song load - That could cause slowdowns.
168 * For Windows, this is ABOVE_NORMAL_PRIORITY_CLASS (0x00008000)
169 * @return True if successful.
170 */
171 bool boostPriority();
172
173 /*
174 * Lower the Application priority back to default.
175 * For Windows, this is NORMAL_PRIORITY_CLASS (0x00000020)
176 * @return True if successful.
177 */
178 bool unboostPriority();
179
180 /*
181 * Flash the window or the icon for the window a few times.
182 * @return True if successful.
183 */
184 bool requestUserAttention();
185
186 namespace Time {
187
196 std::chrono::milliseconds GetChronoDurationSinceStart();
197 } // namespace Time
198} // namespace Core::Platform
199
200#endif //CORE_ARCH_ARCH_HPP
Definition Platform.cpp:5
ghc::filesystem::path getExecutableDirectory()
Get the location of the binary.
Definition PlatformMac.mm:196
std::string getClipboard()
Get contents of the system clipboard.
Definition PlatformMac.mm:162
std::string getArchitecture()
Determine if the current system is 64bit or 32bit.
Definition PlatformMac.mm:95
std::string getLanguage()
Get the users preferred language.
Definition PlatformMac.mm:134
void setCursorVisible(bool value)
Definition PlatformMac.mm:181
bool setConsoleEnabled(bool enable)
Definition Platform.cpp:7
std::string getSystem()
Determine the system name with the version number.
Definition PlatformMac.mm:91
std::string getKernel()
Determine the current systems kernel type and version.
Definition PlatformMac.mm:99
ghc::filesystem::path getAppDirectory()
Get the base game directory. "The etterna folder".
Definition PlatformMac.mm:200
Dimensions getScreenDimensions()
Get the screen dimensions of the screen the game window is currently displayed on.
Definition PlatformMac.mm:118
void init()
Definition PlatformMac.mm:39
std::string getSystemGPU()
Get the primary system GPU information String should include.
Definition PlatformMac.mm:113
std::string getSystemCPU()
Get the system CPU information String should include CPU Manufacturer, Model, and Frequency.
Definition PlatformMac.mm:109
bool openFolder(const ghc::filesystem::path &path)
Send a path to be opened with the system's default file browser.
Definition PlatformMac.mm:148
bool setClipboardText(std::string text)
Set contents of sytem clipboard to provided text.
Definition PlatformMac.mm:175
std::size_t getSystemMemory()
Determine the total amount of memory available on a system.
Definition PlatformMac.mm:105
bool openWebsite(const std::string &url)
Send a URL to be opened with the system's default web browser.
Definition PlatformMac.mm:138
Dimensions getWindowDimensions()
Get the dimensions of the game window.
Definition PlatformMac.mm:126
bool isOtherInstanceRunning(int argc, char **argv)
Definition PlatformMac.mm:204
Platform-independent struct to store screen dimensions.
Definition Platform.hpp:17