]> icculus.org git repositories - divverent/darkplaces.git/blob - sys.h
fix one issue with textshadow moving oddly around in an unknown situation
[divverent/darkplaces.git] / sys.h
1 /*
2 Copyright (C) 1996-1997 Id Software, Inc.
3
4 This program is free software; you can redistribute it and/or
5 modify it under the terms of the GNU General Public License
6 as published by the Free Software Foundation; either version 2
7 of the License, or (at your option) any later version.
8
9 This program is distributed in the hope that it will be useful,
10 but WITHOUT ANY WARRANTY; without even the implied warranty of
11 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
12
13 See the GNU General Public License for more details.
14
15 You should have received a copy of the GNU General Public License
16 along with this program; if not, write to the Free Software
17 Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
18
19 */
20 // sys.h -- non-portable functions
21
22 #ifndef SYS_H
23 #define SYS_H
24
25 extern cvar_t sys_usenoclockbutbenchmark;
26
27 //
28 // DLL management
29 //
30
31 // Win32 specific
32 #ifdef WIN32
33 # include <windows.h>
34 typedef HMODULE dllhandle_t;
35
36 // Other platforms
37 #else
38   typedef void* dllhandle_t;
39 #endif
40
41 typedef struct dllfunction_s
42 {
43         const char *name;
44         void **funcvariable;
45 }
46 dllfunction_t;
47
48 /*! Loads a library. 
49  * \param dllnames a NULL terminated array of possible names for the DLL you want to load.
50  * \param handle
51  * \param fcts
52  */
53 qboolean Sys_LoadLibrary (const char** dllnames, dllhandle_t* handle, const dllfunction_t *fcts);
54 void Sys_UnloadLibrary (dllhandle_t* handle);
55 void* Sys_GetProcAddress (dllhandle_t handle, const char* name);
56
57 /// called early in Host_Init
58 void Sys_InitConsole (void);
59 /// called after command system is initialized but before first Con_Print
60 void Sys_Init_Commands (void);
61
62
63 /// \returns current timestamp
64 char *Sys_TimeString(const char *timeformat);
65
66 //
67 // system IO interface (these are the sys functions that need to be implemented in a new driver atm)
68 //
69
70 /// an error will cause the entire program to exit
71 void Sys_Error (const char *error, ...) DP_FUNC_PRINTF(1);
72
73 /// (may) output text to terminal which launched program
74 void Sys_PrintToTerminal(const char *text);
75
76 /// INFO: This is only called by Host_Shutdown so we dont need testing for recursion
77 void Sys_Shutdown (void);
78 void Sys_Quit (int returnvalue);
79
80 /*! on some build/platform combinations (such as Linux gcc with the -pg
81  * profiling option) this can turn on/off profiling, used primarily to limit
82  * profiling to certain areas of the code, such as ingame performance without
83  * regard for loading/shutdown performance (-profilegameonly on commandline)
84  */
85 void Sys_AllowProfiling (qboolean enable);
86
87 double Sys_DoubleTime (void);
88
89 void Sys_ProvideSelfFD (void);
90
91 char *Sys_ConsoleInput (void);
92
93 /// called to yield for a little bit so as not to hog cpu when paused or debugging
94 void Sys_Sleep(int microseconds);
95
96 /// Perform Key_Event () callbacks until the input que is empty
97 void Sys_SendKeyEvents (void);
98
99 char *Sys_GetClipboardData (void);
100
101 extern qboolean sys_supportsdlgetticks;
102 unsigned int Sys_SDL_GetTicks (void); // wrapper to call SDL_GetTicks
103 void Sys_SDL_Delay (unsigned int milliseconds); // wrapper to call SDL_Delay
104
105 #endif
106