]> icculus.org git repositories - taylor/freespace2.git/blob - include/osapi.h
const-char warning fixes
[taylor/freespace2.git] / include / osapi.h
1 /*
2  * Copyright (C) Volition, Inc. 1999.  All rights reserved.
3  *
4  * All source code herein is the property of Volition, Inc. You may not sell 
5  * or otherwise commercially exploit the source or things you created based on
6  * the source.
7  */
8
9 #ifndef _OSAPI_H
10 #define _OSAPI_H
11
12 #include <stdlib.h>
13
14 #include "pstypes.h"
15
16 // --------------------------------------------------------------------------------------------------
17 // OSAPI DEFINES/VARS
18 //
19
20 // set if running under MsDev - done after os_init(...) has returned
21 extern int Os_debugger_running;
22
23 // game-wide
24 // #define THREADED
25
26 #ifdef THREADED
27         #define ENTER_CRITICAL_SECTION(csc)             do { EnterCriticalSection(csc); } while(0);
28         #define LEAVE_CRITICAL_SECTION(csc)             do { LeaveCriticalSection(csc); } while(0);
29 #else
30         #define ENTER_CRITICAL_SECTION(csc)             do { } while(0);
31         #define LEAVE_CRITICAL_SECTION(csc)             do { } while(0);
32 #endif
33
34 // --------------------------------------------------------------------------------------------------
35 // OSAPI FUNCTIONS
36 //
37
38 // initialization/shutdown functions -----------------------------------------------
39
40 #ifdef PLAT_UNIX
41 extern const char *detect_home(void);
42 #endif
43
44 // If app_name is NULL or ommited, then TITLE is used
45 // for the app name, which is where registry keys are stored.
46 void os_init(const char *wclass, const char *title, const char *app_name = NULL, const char *version_string = NULL);
47
48 // set the main window title
49 void os_set_title( const char *title );
50
51 // call at program end
52 void os_cleanup();
53
54
55 // window management ---------------------------------------------------------------
56
57 // toggle window size between full screen and windowed
58 void os_toggle_fullscreen();
59
60 // Returns 1 if app is not the foreground app.
61 int os_foreground();
62
63 // Returns the handle to the main window
64 uint os_get_window();
65
66
67 // process management --------------------------------------------------------------
68
69 // call to process windows messages. only does something in non THREADED mode
70 void os_poll();
71
72 // Sleeps for n milliseconds or until app becomes active.
73 void os_sleep(int ms);
74
75 // Used to stop message processing
76 void os_suspend();
77
78 // resume message processing
79 void os_resume();
80
81 #endif
82