sys_public.h 19 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639
  1. /*
  2. ===========================================================================
  3. Doom 3 GPL Source Code
  4. Copyright (C) 1999-2011 id Software LLC, a ZeniMax Media company.
  5. This file is part of the Doom 3 GPL Source Code (?Doom 3 Source Code?).
  6. Doom 3 Source Code is free software: you can redistribute it and/or modify
  7. it under the terms of the GNU General Public License as published by
  8. the Free Software Foundation, either version 3 of the License, or
  9. (at your option) any later version.
  10. Doom 3 Source Code is distributed in the hope that it will be useful,
  11. but WITHOUT ANY WARRANTY; without even the implied warranty of
  12. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  13. GNU General Public License for more details.
  14. You should have received a copy of the GNU General Public License
  15. along with Doom 3 Source Code. If not, see <http://www.gnu.org/licenses/>.
  16. In addition, the Doom 3 Source Code is also subject to certain additional terms. You should have received a copy of these additional terms immediately following the terms and conditions of the GNU General Public License which accompanied the Doom 3 Source Code. If not, please request a copy in writing from id Software at the address below.
  17. If you have questions concerning this license or the applicable additional terms, you may contact in writing id Software LLC, c/o ZeniMax Media Inc., Suite 120, Rockville, Maryland 20850 USA.
  18. ===========================================================================
  19. */
  20. #ifndef __SYS_PUBLIC__
  21. #define __SYS_PUBLIC__
  22. /*
  23. ===============================================================================
  24. Non-portable system services.
  25. ===============================================================================
  26. */
  27. // Win32
  28. #if defined(WIN32) || defined(_WIN32)
  29. #define BUILD_STRING "win-x86"
  30. #define BUILD_OS_ID 0
  31. #define CPUSTRING "x86"
  32. #define CPU_EASYARGS 1
  33. #define ALIGN16( x ) __declspec(align(16)) x
  34. #define PACKED
  35. #define _alloca16( x ) ((void *)((((int)_alloca( (x)+15 )) + 15) & ~15))
  36. #define PATHSEPERATOR_STR "\\"
  37. #define PATHSEPERATOR_CHAR '\\'
  38. #define ID_INLINE __forceinline
  39. #define ID_STATIC_TEMPLATE static
  40. #define assertmem( x, y ) assert( _CrtIsValidPointer( x, y, true ) )
  41. #endif
  42. // Mac OSX
  43. #if defined(MACOS_X) || defined(__APPLE__)
  44. #define BUILD_STRING "MacOSX-universal"
  45. #define BUILD_OS_ID 1
  46. #ifdef __ppc__
  47. #define CPUSTRING "ppc"
  48. #define CPU_EASYARGS 0
  49. #elif defined(__i386__)
  50. #define CPUSTRING "x86"
  51. #define CPU_EASYARGS 1
  52. #endif
  53. #define ALIGN16( x ) x __attribute__ ((aligned (16)))
  54. #ifdef __MWERKS__
  55. #define PACKED
  56. #include <alloca.h>
  57. #else
  58. #define PACKED __attribute__((packed))
  59. #endif
  60. #define _alloca alloca
  61. #define _alloca16( x ) ((void *)((((int)alloca( (x)+15 )) + 15) & ~15))
  62. #define PATHSEPERATOR_STR "/"
  63. #define PATHSEPERATOR_CHAR '/'
  64. #define __cdecl
  65. #define ASSERT assert
  66. #define ID_INLINE inline
  67. #define ID_STATIC_TEMPLATE
  68. #define assertmem( x, y )
  69. #endif
  70. // Linux
  71. #ifdef __linux__
  72. #ifdef __i386__
  73. #define BUILD_STRING "linux-x86"
  74. #define BUILD_OS_ID 2
  75. #define CPUSTRING "x86"
  76. #define CPU_EASYARGS 1
  77. #elif defined(__ppc__)
  78. #define BUILD_STRING "linux-ppc"
  79. #define CPUSTRING "ppc"
  80. #define CPU_EASYARGS 0
  81. #endif
  82. #define _alloca alloca
  83. #define _alloca16( x ) ((void *)((((int)alloca( (x)+15 )) + 15) & ~15))
  84. #define ALIGN16( x ) x
  85. #define PACKED __attribute__((packed))
  86. #define PATHSEPERATOR_STR "/"
  87. #define PATHSEPERATOR_CHAR '/'
  88. #define __cdecl
  89. #define ASSERT assert
  90. #define ID_INLINE inline
  91. #define ID_STATIC_TEMPLATE
  92. #define assertmem( x, y )
  93. #endif
  94. #ifdef __GNUC__
  95. #define id_attribute(x) __attribute__(x)
  96. #else
  97. #define id_attribute(x)
  98. #endif
  99. typedef enum {
  100. CPUID_NONE = 0x00000,
  101. CPUID_UNSUPPORTED = 0x00001, // unsupported (386/486)
  102. CPUID_GENERIC = 0x00002, // unrecognized processor
  103. CPUID_INTEL = 0x00004, // Intel
  104. CPUID_AMD = 0x00008, // AMD
  105. CPUID_MMX = 0x00010, // Multi Media Extensions
  106. CPUID_3DNOW = 0x00020, // 3DNow!
  107. CPUID_SSE = 0x00040, // Streaming SIMD Extensions
  108. CPUID_SSE2 = 0x00080, // Streaming SIMD Extensions 2
  109. CPUID_SSE3 = 0x00100, // Streaming SIMD Extentions 3 aka Prescott's New Instructions
  110. CPUID_ALTIVEC = 0x00200, // AltiVec
  111. CPUID_HTT = 0x01000, // Hyper-Threading Technology
  112. CPUID_CMOV = 0x02000, // Conditional Move (CMOV) and fast floating point comparison (FCOMI) instructions
  113. CPUID_FTZ = 0x04000, // Flush-To-Zero mode (denormal results are flushed to zero)
  114. CPUID_DAZ = 0x08000 // Denormals-Are-Zero mode (denormal source operands are set to zero)
  115. } cpuid_t;
  116. typedef enum {
  117. FPU_EXCEPTION_INVALID_OPERATION = 1,
  118. FPU_EXCEPTION_DENORMALIZED_OPERAND = 2,
  119. FPU_EXCEPTION_DIVIDE_BY_ZERO = 4,
  120. FPU_EXCEPTION_NUMERIC_OVERFLOW = 8,
  121. FPU_EXCEPTION_NUMERIC_UNDERFLOW = 16,
  122. FPU_EXCEPTION_INEXACT_RESULT = 32
  123. } fpuExceptions_t;
  124. typedef enum {
  125. FPU_PRECISION_SINGLE = 0,
  126. FPU_PRECISION_DOUBLE = 1,
  127. FPU_PRECISION_DOUBLE_EXTENDED = 2
  128. } fpuPrecision_t;
  129. typedef enum {
  130. FPU_ROUNDING_TO_NEAREST = 0,
  131. FPU_ROUNDING_DOWN = 1,
  132. FPU_ROUNDING_UP = 2,
  133. FPU_ROUNDING_TO_ZERO = 3
  134. } fpuRounding_t;
  135. typedef enum {
  136. AXIS_LEFT_X,
  137. AXIS_LEFT_Y,
  138. AXIS_RIGHT_X,
  139. AXIS_RIGHT_Y,
  140. AXIS_LEFT_TRIG,
  141. AXIS_RIGHT_TRIG,
  142. MAX_JOYSTICK_AXIS
  143. } joystickAxis_t;
  144. typedef enum {
  145. SE_NONE, // evTime is still valid
  146. SE_KEY, // evValue is a key code, evValue2 is the down flag
  147. SE_CHAR, // evValue is an ascii char
  148. SE_MOUSE, // evValue and evValue2 are reletive signed x / y moves
  149. SE_JOYSTICK, // evValue is an axis number and evValue2 is the current state (-127 to 127)
  150. SE_CONSOLE // evPtr is a char*, from typing something at a non-game console
  151. } sysEventType_t;
  152. typedef enum {
  153. M_ACTION1,
  154. M_ACTION2,
  155. M_ACTION3,
  156. M_ACTION4,
  157. M_ACTION5,
  158. M_ACTION6,
  159. M_ACTION7,
  160. M_ACTION8,
  161. M_DELTAX,
  162. M_DELTAY,
  163. M_DELTAZ
  164. } sys_mEvents;
  165. typedef enum {
  166. J_ACTION1,
  167. J_ACTION2,
  168. J_ACTION3,
  169. J_ACTION4,
  170. J_ACTION5,
  171. J_ACTION6,
  172. J_ACTION7,
  173. J_ACTION8,
  174. J_ACTION9,
  175. J_ACTION10,
  176. J_ACTION11,
  177. J_ACTION12,
  178. J_ACTION13,
  179. J_ACTION14,
  180. J_ACTION15,
  181. J_ACTION16,
  182. J_ACTION17,
  183. J_ACTION18,
  184. J_ACTION19,
  185. J_ACTION20,
  186. J_ACTION21,
  187. J_ACTION22,
  188. J_ACTION23,
  189. J_ACTION24,
  190. J_ACTION25,
  191. J_ACTION26,
  192. J_ACTION27,
  193. J_ACTION28,
  194. J_ACTION29,
  195. J_ACTION30,
  196. J_ACTION31,
  197. J_ACTION32,
  198. J_ACTION_MAX = J_ACTION32,
  199. J_AXIS_MIN,
  200. J_AXIS_LEFT_X = J_AXIS_MIN + AXIS_LEFT_X,
  201. J_AXIS_LEFT_Y = J_AXIS_MIN + AXIS_LEFT_Y,
  202. J_AXIS_RIGHT_X = J_AXIS_MIN + AXIS_RIGHT_X,
  203. J_AXIS_RIGHT_Y = J_AXIS_MIN + AXIS_RIGHT_Y,
  204. J_AXIS_LEFT_TRIG = J_AXIS_MIN + AXIS_LEFT_TRIG,
  205. J_AXIS_RIGHT_TRIG = J_AXIS_MIN + AXIS_RIGHT_TRIG,
  206. J_AXIS_MAX = J_AXIS_MIN + MAX_JOYSTICK_AXIS - 1,
  207. J_DPAD_UP,
  208. J_DPAD_DOWN,
  209. J_DPAD_LEFT,
  210. J_DPAD_RIGHT,
  211. MAX_JOY_EVENT
  212. } sys_jEvents;
  213. typedef struct sysEvent_s {
  214. sysEventType_t evType;
  215. int evValue;
  216. int evValue2;
  217. int evPtrLength; // bytes of data pointed to by evPtr, for journaling
  218. void * evPtr; // this must be manually freed if not NULL
  219. } sysEvent_t;
  220. typedef struct sysMemoryStats_s {
  221. int memoryLoad;
  222. int totalPhysical;
  223. int availPhysical;
  224. int totalPageFile;
  225. int availPageFile;
  226. int totalVirtual;
  227. int availVirtual;
  228. int availExtendedVirtual;
  229. } sysMemoryStats_t;
  230. typedef unsigned long address_t;
  231. template<class type> class idList; // for Sys_ListFiles
  232. void Sys_Init( void );
  233. void Sys_Shutdown( void );
  234. void Sys_Error( const char *error, ...);
  235. void Sys_Quit( void );
  236. bool Sys_AlreadyRunning( void );
  237. // note that this isn't journaled...
  238. char * Sys_GetClipboardData( void );
  239. void Sys_SetClipboardData( const char *string );
  240. // will go to the various text consoles
  241. // NOT thread safe - never use in the async paths
  242. void Sys_Printf( const char *msg, ... )id_attribute((format(printf,1,2)));
  243. // guaranteed to be thread-safe
  244. void Sys_DebugPrintf( const char *fmt, ... )id_attribute((format(printf,1,2)));
  245. void Sys_DebugVPrintf( const char *fmt, va_list arg );
  246. // a decent minimum sleep time to avoid going below the process scheduler speeds
  247. #define SYS_MINSLEEP 20
  248. // allow game to yield CPU time
  249. // NOTE: due to SYS_MINSLEEP this is very bad portability karma, and should be completely removed
  250. void Sys_Sleep( int msec );
  251. // Sys_Milliseconds should only be used for profiling purposes,
  252. // any game related timing information should come from event timestamps
  253. int Sys_Milliseconds( void );
  254. // for accurate performance testing
  255. double Sys_GetClockTicks( void );
  256. double Sys_ClockTicksPerSecond( void );
  257. // returns a selection of the CPUID_* flags
  258. cpuid_t Sys_GetProcessorId( void );
  259. const char * Sys_GetProcessorString( void );
  260. // returns true if the FPU stack is empty
  261. bool Sys_FPU_StackIsEmpty( void );
  262. // empties the FPU stack
  263. void Sys_FPU_ClearStack( void );
  264. // returns the FPU state as a string
  265. const char * Sys_FPU_GetState( void );
  266. // enables the given FPU exceptions
  267. void Sys_FPU_EnableExceptions( int exceptions );
  268. // sets the FPU precision
  269. void Sys_FPU_SetPrecision( int precision );
  270. // sets the FPU rounding mode
  271. void Sys_FPU_SetRounding( int rounding );
  272. // sets Flush-To-Zero mode (only available when CPUID_FTZ is set)
  273. void Sys_FPU_SetFTZ( bool enable );
  274. // sets Denormals-Are-Zero mode (only available when CPUID_DAZ is set)
  275. void Sys_FPU_SetDAZ( bool enable );
  276. // returns amount of system ram
  277. int Sys_GetSystemRam( void );
  278. // returns amount of video ram
  279. int Sys_GetVideoRam( void );
  280. // returns amount of drive space in path
  281. int Sys_GetDriveFreeSpace( const char *path );
  282. // returns memory stats
  283. void Sys_GetCurrentMemoryStatus( sysMemoryStats_t &stats );
  284. void Sys_GetExeLaunchMemoryStatus( sysMemoryStats_t &stats );
  285. // lock and unlock memory
  286. bool Sys_LockMemory( void *ptr, int bytes );
  287. bool Sys_UnlockMemory( void *ptr, int bytes );
  288. // set amount of physical work memory
  289. void Sys_SetPhysicalWorkMemory( int minBytes, int maxBytes );
  290. // allows retrieving the call stack at execution points
  291. void Sys_GetCallStack( address_t *callStack, const int callStackSize );
  292. const char * Sys_GetCallStackStr( const address_t *callStack, const int callStackSize );
  293. const char * Sys_GetCallStackCurStr( int depth );
  294. const char * Sys_GetCallStackCurAddressStr( int depth );
  295. void Sys_ShutdownSymbols( void );
  296. // DLL loading, the path should be a fully qualified OS path to the DLL file to be loaded
  297. int Sys_DLL_Load( const char *dllName );
  298. void * Sys_DLL_GetProcAddress( int dllHandle, const char *procName );
  299. void Sys_DLL_Unload( int dllHandle );
  300. // event generation
  301. void Sys_GenerateEvents( void );
  302. sysEvent_t Sys_GetEvent( void );
  303. void Sys_ClearEvents( void );
  304. char *Sys_ConsoleInput( void );
  305. // input is tied to windows, so it needs to be started up and shut down whenever
  306. // the main window is recreated
  307. void Sys_InitInput( void );
  308. void Sys_ShutdownInput( void );
  309. void Sys_InitScanTable( void );
  310. const unsigned char *Sys_GetScanTable( void );
  311. unsigned char Sys_GetConsoleKey( bool shifted );
  312. // map a scancode key to a char
  313. // does nothing on win32, as SE_KEY == SE_CHAR there
  314. // on other OSes, consider the keyboard mapping
  315. unsigned char Sys_MapCharForKey( int key );
  316. // keyboard input polling
  317. int Sys_PollKeyboardInputEvents( void );
  318. int Sys_ReturnKeyboardInputEvent( const int n, int &ch, bool &state );
  319. void Sys_EndKeyboardInputEvents( void );
  320. // mouse input polling
  321. int Sys_PollMouseInputEvents( void );
  322. int Sys_ReturnMouseInputEvent( const int n, int &action, int &value );
  323. void Sys_EndMouseInputEvents( void );
  324. // joystick input polling
  325. void Sys_SetRumble( int device, int low, int hi );
  326. int Sys_PollJoystickInputEvents( int deviceNum );
  327. int Sys_ReturnJoystickInputEvent( const int n, int &action, int &value );
  328. void Sys_EndJoystickInputEvents();
  329. // when the console is down, or the game is about to perform a lengthy
  330. // operation like map loading, the system can release the mouse cursor
  331. // when in windowed mode
  332. void Sys_GrabMouseCursor( bool grabIt );
  333. void Sys_ShowWindow( bool show );
  334. bool Sys_IsWindowVisible( void );
  335. void Sys_ShowConsole( int visLevel, bool quitOnClose );
  336. void Sys_Mkdir( const char *path );
  337. ID_TIME_T Sys_FileTimeStamp( FILE *fp );
  338. // NOTE: do we need to guarantee the same output on all platforms?
  339. const char * Sys_TimeStampToStr( ID_TIME_T timeStamp );
  340. const char * Sys_DefaultCDPath( void );
  341. const char * Sys_DefaultBasePath( void );
  342. const char * Sys_DefaultSavePath( void );
  343. const char * Sys_EXEPath( void );
  344. // use fs_debug to verbose Sys_ListFiles
  345. // returns -1 if directory was not found (the list is cleared)
  346. int Sys_ListFiles( const char *directory, const char *extension, idList<class idStr> &list );
  347. // know early if we are performing a fatal error shutdown so the error message doesn't get lost
  348. void Sys_SetFatalError( const char *error );
  349. // display perference dialog
  350. void Sys_DoPreferences( void );
  351. /*
  352. ==============================================================
  353. Networking
  354. ==============================================================
  355. */
  356. typedef enum {
  357. NA_BAD, // an address lookup failed
  358. NA_LOOPBACK,
  359. NA_BROADCAST,
  360. NA_IP
  361. } netadrtype_t;
  362. typedef struct {
  363. netadrtype_t type;
  364. unsigned char ip[4];
  365. unsigned short port;
  366. } netadr_t;
  367. #define PORT_ANY -1
  368. class idPort {
  369. public:
  370. idPort(); // this just zeros netSocket and port
  371. virtual ~idPort();
  372. // if the InitForPort fails, the idPort.port field will remain 0
  373. bool InitForPort( int portNumber );
  374. int GetPort( void ) const { return bound_to.port; }
  375. netadr_t GetAdr( void ) const { return bound_to; }
  376. void Close();
  377. bool GetPacket( netadr_t &from, void *data, int &size, int maxSize );
  378. bool GetPacketBlocking( netadr_t &from, void *data, int &size, int maxSize, int timeout );
  379. void SendPacket( const netadr_t to, const void *data, int size );
  380. int packetsRead;
  381. int bytesRead;
  382. int packetsWritten;
  383. int bytesWritten;
  384. private:
  385. netadr_t bound_to; // interface and port
  386. int netSocket; // OS specific socket
  387. };
  388. class idTCP {
  389. public:
  390. idTCP();
  391. virtual ~idTCP();
  392. // if host is host:port, the value of port is ignored
  393. bool Init( const char *host, short port );
  394. void Close();
  395. // returns -1 on failure (and closes socket)
  396. // those are non blocking, can be used for polling
  397. // there is no buffering, you are not guaranteed to Read or Write everything in a single call
  398. // (specially on win32, see recv and send documentation)
  399. int Read( void *data, int size );
  400. int Write( void *data, int size );
  401. private:
  402. netadr_t address; // remote address
  403. int fd; // OS specific socket
  404. };
  405. // parses the port number
  406. // can also do DNS resolve if you ask for it.
  407. // NOTE: DNS resolve is a slow/blocking call, think before you use
  408. // ( could be exploited for server DoS )
  409. bool Sys_StringToNetAdr( const char *s, netadr_t *a, bool doDNSResolve );
  410. const char * Sys_NetAdrToString( const netadr_t a );
  411. bool Sys_IsLANAddress( const netadr_t a );
  412. bool Sys_CompareNetAdrBase( const netadr_t a, const netadr_t b );
  413. void Sys_InitNetworking( void );
  414. void Sys_ShutdownNetworking( void );
  415. /*
  416. ==============================================================
  417. Multi-threading
  418. ==============================================================
  419. */
  420. typedef unsigned int (*xthread_t)( void * );
  421. typedef enum {
  422. THREAD_NORMAL,
  423. THREAD_ABOVE_NORMAL,
  424. THREAD_HIGHEST
  425. } xthreadPriority;
  426. typedef struct {
  427. const char * name;
  428. int threadHandle;
  429. unsigned long threadId;
  430. } xthreadInfo;
  431. const int MAX_THREADS = 10;
  432. extern xthreadInfo *g_threads[MAX_THREADS];
  433. extern int g_thread_count;
  434. void Sys_CreateThread( xthread_t function, void *parms, xthreadPriority priority, xthreadInfo &info, const char *name, xthreadInfo *threads[MAX_THREADS], int *thread_count );
  435. void Sys_DestroyThread( xthreadInfo& info ); // sets threadHandle back to 0
  436. // find the name of the calling thread
  437. // if index != NULL, set the index in g_threads array (use -1 for "main" thread)
  438. const char * Sys_GetThreadName( int *index = 0 );
  439. const int MAX_CRITICAL_SECTIONS = 4;
  440. enum {
  441. CRITICAL_SECTION_ZERO = 0,
  442. CRITICAL_SECTION_ONE,
  443. CRITICAL_SECTION_TWO,
  444. CRITICAL_SECTION_THREE
  445. };
  446. void Sys_EnterCriticalSection( int index = CRITICAL_SECTION_ZERO );
  447. void Sys_LeaveCriticalSection( int index = CRITICAL_SECTION_ZERO );
  448. const int MAX_TRIGGER_EVENTS = 4;
  449. enum {
  450. TRIGGER_EVENT_ZERO = 0,
  451. TRIGGER_EVENT_ONE,
  452. TRIGGER_EVENT_TWO,
  453. TRIGGER_EVENT_THREE
  454. };
  455. void Sys_WaitForEvent( int index = TRIGGER_EVENT_ZERO );
  456. void Sys_TriggerEvent( int index = TRIGGER_EVENT_ZERO );
  457. /*
  458. ==============================================================
  459. idSys
  460. ==============================================================
  461. */
  462. class idSys {
  463. public:
  464. virtual void DebugPrintf( const char *fmt, ... )id_attribute((format(printf,2,3))) = 0;
  465. virtual void DebugVPrintf( const char *fmt, va_list arg ) = 0;
  466. virtual double GetClockTicks( void ) = 0;
  467. virtual double ClockTicksPerSecond( void ) = 0;
  468. virtual cpuid_t GetProcessorId( void ) = 0;
  469. virtual const char * GetProcessorString( void ) = 0;
  470. virtual const char * FPU_GetState( void ) = 0;
  471. virtual bool FPU_StackIsEmpty( void ) = 0;
  472. virtual void FPU_SetFTZ( bool enable ) = 0;
  473. virtual void FPU_SetDAZ( bool enable ) = 0;
  474. virtual void FPU_EnableExceptions( int exceptions ) = 0;
  475. virtual bool LockMemory( void *ptr, int bytes ) = 0;
  476. virtual bool UnlockMemory( void *ptr, int bytes ) = 0;
  477. virtual void GetCallStack( address_t *callStack, const int callStackSize ) = 0;
  478. virtual const char * GetCallStackStr( const address_t *callStack, const int callStackSize ) = 0;
  479. virtual const char * GetCallStackCurStr( int depth ) = 0;
  480. virtual void ShutdownSymbols( void ) = 0;
  481. virtual int DLL_Load( const char *dllName ) = 0;
  482. virtual void * DLL_GetProcAddress( int dllHandle, const char *procName ) = 0;
  483. virtual void DLL_Unload( int dllHandle ) = 0;
  484. virtual void DLL_GetFileName( const char *baseName, char *dllName, int maxLength ) = 0;
  485. virtual sysEvent_t GenerateMouseButtonEvent( int button, bool down ) = 0;
  486. virtual sysEvent_t GenerateMouseMoveEvent( int deltax, int deltay ) = 0;
  487. virtual void OpenURL( const char *url, bool quit ) = 0;
  488. virtual void StartProcess( const char *exePath, bool quit ) = 0;
  489. };
  490. extern idSys * sys;
  491. bool Sys_LoadOpenAL( void );
  492. void Sys_FreeOpenAL( void );
  493. #endif /* !__SYS_PUBLIC__ */