Polyphase Game Engine
Loading...
Searching...
No Matches
System.h File Reference
#include "PolyphaseAPI.h"
#include "System/SystemTypes.h"
#include <string>
#include <vector>
#include <stdarg.h>

Go to the source code of this file.

Classes

struct  ScopedLock
 

Macros

#define SCOPED_LOCK(mutex)   ScopedLock scopedLock(mutex)
 

Functions

void SYS_Initialize ()
 
void SYS_Shutdown ()
 
void SYS_Update ()
 
bool SYS_DoesFileExist (const char *path, bool isAsset)
 
void SYS_AcquireFileData (const char *path, bool isAsset, int32_t maxSize, char *&outData, uint32_t &outSize)
 
void SYS_ReleaseFileData (char *data)
 
std::string SYS_GetExecutablePath ()
 
std::string SYS_GetPolyphasePath ()
 
std::string SYS_GetCurrentDirectoryPath ()
 
std::string SYS_GetAbsolutePath (const std::string &relativePath)
 
void SYS_ExplorerOpenDirectory (const std::string &dirPath)
 
void SYS_OpenFileWithDefaultApp (const std::string &filePath)
 
void SYS_SetWorkingDirectory (const std::string &dirPath)
 
bool SYS_CreateDirectory (const char *dirPath)
 
void SYS_RemoveDirectory (const char *dirPath)
 
void SYS_OpenDirectory (const std::string &dirPath, DirEntry &outDirEntry)
 
void SYS_IterateDirectory (DirEntry &dirEntry)
 
void SYS_CopyDirectory (const char *sourceDir, const char *destDir)
 
void SYS_CopyFile (const char *sourcePath, const char *destPath)
 
bool SYS_CopyDirectoryRecursive (const std::string &sourceDir, const std::string &destDir)
 
void SYS_MoveDirectory (const char *sourceDir, const char *destDir)
 
void SYS_MoveFile (const char *sourcePath, const char *destPath)
 
void SYS_CloseDirectory (DirEntry &dirEntry)
 
void SYS_RemoveFile (const char *path)
 
bool SYS_Rename (const char *oldPath, const char *newPath)
 
std::vector< std::string > SYS_OpenFileDialog ()
 
std::string SYS_SaveFileDialog ()
 
std::string SYS_SelectFolderDialog ()
 
std::string SYS_GetFileName (const std::string &path)
 
POLYPHASE_API ThreadObject * SYS_CreateThread (ThreadFuncFP func, void *arg)
 
POLYPHASE_API void SYS_JoinThread (ThreadObject *thread)
 
POLYPHASE_API void SYS_DestroyThread (ThreadObject *thread)
 
POLYPHASE_API MutexObject * SYS_CreateMutex ()
 
POLYPHASE_API void SYS_LockMutex (MutexObject *mutex)
 
POLYPHASE_API void SYS_UnlockMutex (MutexObject *mutex)
 
POLYPHASE_API void SYS_DestroyMutex (MutexObject *mutex)
 
POLYPHASE_API void SYS_Sleep (uint32_t milliseconds)
 
POLYPHASE_API uint64_t SYS_GetTimeMicroseconds ()
 
void SYS_Exec (const char *cmd, std::string *output=nullptr)
 
bool SYS_ExecFull (const char *cmd, std::string *outStdout, std::string *outStderr, int *outExitCode)
 Execute a command with full output capture.
 
void * SYS_AlignedMalloc (uint32_t size, uint32_t alignment)
 
void SYS_AlignedFree (void *pointer)
 
std::vector< MemoryStatSYS_GetMemoryStats ()
 
float SYS_GetRAMUsage ()
 
float SYS_GetVRAMUsage ()
 
float SYS_GetRAM1Usage ()
 
float SYS_GetRAM2Usage ()
 
float SYS_GetCPUUsage ()
 
float SYS_GetTotalRAM ()
 
float SYS_GetTotalVRAM ()
 
float SYS_GetTotalRAM1 ()
 
float SYS_GetTotalRAM2 ()
 
bool SYS_ReadSave (const char *saveName, Stream &outStream)
 
bool SYS_WriteSave (const char *saveName, Stream &stream)
 
bool SYS_DoesSaveExist (const char *saveName)
 
bool SYS_DeleteSave (const char *saveName)
 
void SYS_UnmountMemoryCard ()
 
void SYS_SetClipboardText (const std::string &str)
 
std::string SYS_GetClipboardText ()
 
void SYS_Log (LogSeverity severity, const char *format, va_list arg)
 
POLYPHASE_API void SYS_Assert (const char *exprString, const char *fileString, uint32_t lineNumber)
 
void SYS_Alert (const char *message)
 
void SYS_UpdateConsole ()
 
int32_t SYS_GetPlatformTier ()
 
void SYS_SetWindowTitle (const char *title)
 
void SYS_SetWindowIcon (const char *iconPath)
 
bool SYS_DoesWindowHaveFocus ()
 
void SYS_SetScreenOrientation (ScreenOrientation orientation)
 
ScreenOrientation SYS_GetScreenOrientation ()
 
void SYS_SetFullscreen (bool fullscreen)
 
bool SYS_IsFullscreen ()
 
void SYS_SetWindowRect (int32_t x, int32_t y, int32_t width, int32_t height)
 
void SYS_GetWindowRect (int32_t &outX, int32_t &outY, int32_t &outWidth, int32_t &outHeight)
 
bool SYS_IsWindowMaximized ()
 
void SYS_MaximizeWindow ()
 

Macro Definition Documentation

◆ SCOPED_LOCK

#define SCOPED_LOCK (   mutex)    ScopedLock scopedLock(mutex)

Function Documentation

◆ SYS_AcquireFileData()

void SYS_AcquireFileData ( const char *  path,
bool  isAsset,
int32_t  maxSize,
char *&  outData,
uint32_t &  outSize 
)

◆ SYS_Alert()

void SYS_Alert ( const char *  message)

◆ SYS_AlignedFree()

void SYS_AlignedFree ( void *  pointer)

◆ SYS_AlignedMalloc()

void * SYS_AlignedMalloc ( uint32_t  size,
uint32_t  alignment 
)

◆ SYS_Assert()

POLYPHASE_API void SYS_Assert ( const char *  exprString,
const char *  fileString,
uint32_t  lineNumber 
)

◆ SYS_CloseDirectory()

void SYS_CloseDirectory ( DirEntry dirEntry)

◆ SYS_CopyDirectory()

void SYS_CopyDirectory ( const char *  sourceDir,
const char *  destDir 
)

◆ SYS_CopyDirectoryRecursive()

bool SYS_CopyDirectoryRecursive ( const std::string &  sourceDir,
const std::string &  destDir 
)

◆ SYS_CopyFile()

void SYS_CopyFile ( const char *  sourcePath,
const char *  destPath 
)

◆ SYS_CreateDirectory()

bool SYS_CreateDirectory ( const char *  dirPath)

◆ SYS_CreateMutex()

POLYPHASE_API MutexObject * SYS_CreateMutex ( )

◆ SYS_CreateThread()

POLYPHASE_API ThreadObject * SYS_CreateThread ( ThreadFuncFP  func,
void *  arg 
)

◆ SYS_DeleteSave()

bool SYS_DeleteSave ( const char *  saveName)

◆ SYS_DestroyMutex()

POLYPHASE_API void SYS_DestroyMutex ( MutexObject *  mutex)

◆ SYS_DestroyThread()

POLYPHASE_API void SYS_DestroyThread ( ThreadObject *  thread)

◆ SYS_DoesFileExist()

bool SYS_DoesFileExist ( const char *  path,
bool  isAsset 
)

◆ SYS_DoesSaveExist()

bool SYS_DoesSaveExist ( const char *  saveName)

◆ SYS_DoesWindowHaveFocus()

bool SYS_DoesWindowHaveFocus ( )

◆ SYS_Exec()

void SYS_Exec ( const char *  cmd,
std::string *  output = nullptr 
)

◆ SYS_ExecFull()

bool SYS_ExecFull ( const char *  cmd,
std::string *  outStdout,
std::string *  outStderr,
int *  outExitCode 
)

Execute a command with full output capture.

Unlike SYS_Exec which only captures the first 1024 bytes, this function captures complete stdout/stderr output.

Parameters
cmdCommand to execute
outStdoutPointer to receive stdout (can be nullptr)
outStderrPointer to receive stderr (can be nullptr)
outExitCodePointer to receive exit code (can be nullptr)
Returns
true if command executed successfully

◆ SYS_ExplorerOpenDirectory()

void SYS_ExplorerOpenDirectory ( const std::string &  dirPath)

◆ SYS_GetAbsolutePath()

std::string SYS_GetAbsolutePath ( const std::string &  relativePath)

◆ SYS_GetClipboardText()

std::string SYS_GetClipboardText ( )

◆ SYS_GetCPUUsage()

float SYS_GetCPUUsage ( )

◆ SYS_GetCurrentDirectoryPath()

std::string SYS_GetCurrentDirectoryPath ( )

◆ SYS_GetExecutablePath()

std::string SYS_GetExecutablePath ( )

◆ SYS_GetFileName()

std::string SYS_GetFileName ( const std::string &  path)

◆ SYS_GetMemoryStats()

std::vector< MemoryStat > SYS_GetMemoryStats ( )

◆ SYS_GetPlatformTier()

int32_t SYS_GetPlatformTier ( )

◆ SYS_GetPolyphasePath()

std::string SYS_GetPolyphasePath ( )

◆ SYS_GetRAM1Usage()

float SYS_GetRAM1Usage ( )

◆ SYS_GetRAM2Usage()

float SYS_GetRAM2Usage ( )

◆ SYS_GetRAMUsage()

float SYS_GetRAMUsage ( )

◆ SYS_GetScreenOrientation()

ScreenOrientation SYS_GetScreenOrientation ( )

◆ SYS_GetTimeMicroseconds()

POLYPHASE_API uint64_t SYS_GetTimeMicroseconds ( )

◆ SYS_GetTotalRAM()

float SYS_GetTotalRAM ( )

◆ SYS_GetTotalRAM1()

float SYS_GetTotalRAM1 ( )

◆ SYS_GetTotalRAM2()

float SYS_GetTotalRAM2 ( )

◆ SYS_GetTotalVRAM()

float SYS_GetTotalVRAM ( )

◆ SYS_GetVRAMUsage()

float SYS_GetVRAMUsage ( )

◆ SYS_GetWindowRect()

void SYS_GetWindowRect ( int32_t &  outX,
int32_t &  outY,
int32_t &  outWidth,
int32_t &  outHeight 
)

◆ SYS_Initialize()

void SYS_Initialize ( )

◆ SYS_IsFullscreen()

bool SYS_IsFullscreen ( )

◆ SYS_IsWindowMaximized()

bool SYS_IsWindowMaximized ( )

◆ SYS_IterateDirectory()

void SYS_IterateDirectory ( DirEntry dirEntry)

◆ SYS_JoinThread()

POLYPHASE_API void SYS_JoinThread ( ThreadObject *  thread)

◆ SYS_LockMutex()

POLYPHASE_API void SYS_LockMutex ( MutexObject *  mutex)

◆ SYS_Log()

void SYS_Log ( LogSeverity  severity,
const char *  format,
va_list  arg 
)

◆ SYS_MaximizeWindow()

void SYS_MaximizeWindow ( )

◆ SYS_MoveDirectory()

void SYS_MoveDirectory ( const char *  sourceDir,
const char *  destDir 
)

◆ SYS_MoveFile()

void SYS_MoveFile ( const char *  sourcePath,
const char *  destPath 
)

◆ SYS_OpenDirectory()

void SYS_OpenDirectory ( const std::string &  dirPath,
DirEntry outDirEntry 
)

◆ SYS_OpenFileDialog()

std::vector< std::string > SYS_OpenFileDialog ( )

◆ SYS_OpenFileWithDefaultApp()

void SYS_OpenFileWithDefaultApp ( const std::string &  filePath)

◆ SYS_ReadSave()

bool SYS_ReadSave ( const char *  saveName,
Stream outStream 
)

◆ SYS_ReleaseFileData()

void SYS_ReleaseFileData ( char *  data)

◆ SYS_RemoveDirectory()

void SYS_RemoveDirectory ( const char *  dirPath)

◆ SYS_RemoveFile()

void SYS_RemoveFile ( const char *  path)

◆ SYS_Rename()

bool SYS_Rename ( const char *  oldPath,
const char *  newPath 
)

◆ SYS_SaveFileDialog()

std::string SYS_SaveFileDialog ( )

◆ SYS_SelectFolderDialog()

std::string SYS_SelectFolderDialog ( )

◆ SYS_SetClipboardText()

void SYS_SetClipboardText ( const std::string &  str)

◆ SYS_SetFullscreen()

void SYS_SetFullscreen ( bool  fullscreen)

◆ SYS_SetScreenOrientation()

void SYS_SetScreenOrientation ( ScreenOrientation  orientation)

◆ SYS_SetWindowIcon()

void SYS_SetWindowIcon ( const char *  iconPath)

◆ SYS_SetWindowRect()

void SYS_SetWindowRect ( int32_t  x,
int32_t  y,
int32_t  width,
int32_t  height 
)

◆ SYS_SetWindowTitle()

void SYS_SetWindowTitle ( const char *  title)

◆ SYS_SetWorkingDirectory()

void SYS_SetWorkingDirectory ( const std::string &  dirPath)

◆ SYS_Shutdown()

void SYS_Shutdown ( )

◆ SYS_Sleep()

POLYPHASE_API void SYS_Sleep ( uint32_t  milliseconds)

◆ SYS_UnlockMutex()

POLYPHASE_API void SYS_UnlockMutex ( MutexObject *  mutex)

◆ SYS_UnmountMemoryCard()

void SYS_UnmountMemoryCard ( )

◆ SYS_Update()

void SYS_Update ( )

◆ SYS_UpdateConsole()

void SYS_UpdateConsole ( )

◆ SYS_WriteSave()

bool SYS_WriteSave ( const char *  saveName,
Stream stream 
)