]> icculus.org git repositories - taylor/freespace2.git/blob - include/osapi.h
added copyright header
[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 // OSAPI DEFINES/VARS
15 //
16
17 // set if running under MsDev - done after os_init(...) has returned
18 extern int Os_debugger_running;
19
20 // game-wide
21 // #define THREADED
22
23 #ifdef THREADED
24         #define ENTER_CRITICAL_SECTION(csc)             do { EnterCriticalSection(csc); } while(0);
25         #define LEAVE_CRITICAL_SECTION(csc)             do { LeaveCriticalSection(csc); } while(0);
26 #else
27         #define ENTER_CRITICAL_SECTION(csc)             do { } while(0);
28         #define LEAVE_CRITICAL_SECTION(csc)             do { } while(0);
29 #endif
30
31 // --------------------------------------------------------------------------------------------------
32 // OSAPI FUNCTIONS
33 //
34
35 // initialization/shutdown functions -----------------------------------------------
36
37 // If app_name is NULL or ommited, then TITLE is used
38 // for the app name, which is where registry keys are stored.
39 void os_init(char * wclass, char * title, char *app_name=NULL, char *version_string=NULL );
40
41 // set the main window title
42 void os_set_title( char * title );
43
44 // call at program end
45 void os_cleanup();
46
47
48 // window management ---------------------------------------------------------------
49
50 // toggle window size between full screen and windowed
51 void os_toggle_fullscreen();
52
53 // Returns 1 if app is not the foreground app.
54 int os_foreground();
55
56 // Returns the handle to the main window
57 uint os_get_window();
58
59
60 // process management --------------------------------------------------------------
61
62 // call to process windows messages. only does something in non THREADED mode
63 void os_poll();
64
65 // Sleeps for n milliseconds or until app becomes active.
66 void os_sleep(int ms);
67
68 // Used to stop message processing
69 void os_suspend();
70
71 // resume message processing
72 void os_resume();
73
74 #endif
75