]> icculus.org git repositories - btb/d2x.git/blob - main/desw.h
utilize hardware multitexturing support if possible (requires GL_NV_texture_env_combi...
[btb/d2x.git] / main / desw.h
1 /* $Id: desw.h,v 1.2 2003-10-10 09:36:34 btb Exp $ */
2 /*
3 THE COMPUTER CODE CONTAINED HEREIN IS THE SOLE PROPERTY OF PARALLAX
4 SOFTWARE CORPORATION ("PARALLAX").  PARALLAX, IN DISTRIBUTING THE CODE TO
5 END-USERS, AND SUBJECT TO ALL OF THE TERMS AND CONDITIONS HEREIN, GRANTS A
6 ROYALTY-FREE, PERPETUAL LICENSE TO SUCH END-USERS FOR USE BY SUCH END-USERS
7 IN USING, DISPLAYING,  AND CREATING DERIVATIVE WORKS THEREOF, SO LONG AS
8 SUCH USE, DISPLAY OR CREATION IS FOR NON-COMMERCIAL, ROYALTY OR REVENUE
9 FREE PURPOSES.  IN NO EVENT SHALL THE END-USER USE THE COMPUTER CODE
10 CONTAINED HEREIN FOR REVENUE-BEARING PURPOSES.  THE END-USER UNDERSTANDS
11 AND AGREES TO THE TERMS HEREIN AND ACCEPTS THE SAME BY USE OF THIS FILE.
12 COPYRIGHT 1993-1999 PARALLAX SOFTWARE CORPORATION.  ALL RIGHTS RESERVED.
13 */
14
15 /*
16  *
17  * Stuff for Windows
18  *
19  */
20
21 #ifndef _DESW_H
22 #define _DESW_H
23
24
25 #define DESCENT_VIEWPORT_WIDTH  640
26 #define DESCENT_VIEWPORT_HEIGHT 480
27 #define DESCENT_RENDER_WIDTH    320
28 #define DESCENT_RENDER_HEIGHT   200
29
30
31 #define WIN95
32 #define _WIN32
33 #define WIN32_LEAN_AND_MEAN
34 #include <windows.h>
35
36 #include "win/dd.h"
37 #include "win/winapp.h"
38 #include "pstypes.h"
39 #include "fix.h"
40 #include "gr.h"
41
42 #undef DEFAULT_PALETTE
43
44
45 #define WINAPP_NAME "Descent II"
46
47 typedef struct GAME_CONTEXT {
48         BOOL paused;
49         BOOL active;
50 };
51
52 typedef struct SCREEN_CONTEXT {
53         char *bkg_filename;
54 } SCREEN_CONTEXT;
55
56
57 typedef struct PALETTE {
58         WORD version;
59         WORD num_entries;
60         PALETTEENTRY entries[256];
61 } PALETTE;
62
63 typedef struct RGBBITMAPINFO {
64         BITMAPINFOHEADER    bmiHeader;
65         RGBQUAD             rgb[256];
66 } RGBBITMAPINFO;
67
68
69
70 // Other Structures
71
72 #define MSG_QUIT        0
73 #define MSG_SHUTDOWN    1
74 #define MSG_NORMAL      2
75
76
77 typedef struct WinJoystickDesc {
78         char title[32];
79         char cal_ztitle[16];
80         char cal_rtitle[16];
81         char cal_utitle[16];
82         char cal_vtitle[16];
83         char cal_zmsg[6][16];
84         char cal_rmsg[6][16];
85         char cal_umsg[6][16];
86         char cal_vmsg[6][16];
87 } WinJoystickDesc;
88
89
90 // Globals
91
92 extern HWND             _hAppWnd;           // Descent Window
93 extern HINSTANCE        _hAppInstance;
94 extern int              _DDraw;             // Direct X Implementation
95 extern BOOL             _AppActive;
96 extern BOOL             SOS_DLLInit;
97 extern BOOL             _RedrawScreen;
98 extern SCREEN_CONTEXT   _SCRContext;
99
100
101 extern dd_grs_canvas *dd_VR_offscreen_buffer;
102 extern dd_grs_canvas dd_VR_screen_pages[2];
103 extern dd_grs_canvas dd_VR_render_buffer[2];
104 extern dd_grs_canvas dd_VR_render_sub_buffer[2];
105
106
107
108 // WinG Stuff
109
110 extern HPALETTE _hAppPalette;               // Application Palette
111
112
113 // Other Globals
114
115 extern RECT     ViewportRect;               // Viewport rect for window
116 extern char     *_OffscreenCanvasBits;      // Pointer to DIB Bits.
117 extern fix      WinFrameTime;               // Time per frame
118 extern int      Platform_system;            // Tells us the platform
119
120
121 // Functions
122
123 extern void WinDelay(int msecs);
124
125 // misc functions
126 extern void WErrorPrint(char *msg);
127 extern dd_grs_canvas *get_current_game_screen();
128 extern BOOL SOSInit();
129 extern void SOSUnInit();
130
131
132 #define MOUSE_DEFAULT_CURSOR 1
133 #define MOUSE_WAIT_CURSOR 2
134
135 extern void LoadCursorWin(int cursor);
136 extern void ShowCursorW();
137 extern void HideCursorW();
138
139
140 // Macros
141 #define CanvasWidth(C)  ((C).bmiHeader.biWidth)
142 #define CanvasHeight(C) (((C).bmiHeader.biHeight > 0) ? \
143                          (C).bmiHeader.biHeight : -(C).bmiHeader.biHeight)
144
145 #define DebugMessageBox(c) (MessageBox(NULL,c,"Message",MB_OK))
146
147 #define DEFINE_SCREEN(fn) (_SCRContext.bkg_filename = fn)
148
149 #define WINNT_PLATFORM 1
150 #define WIN95_PLATFORM 0
151
152 #endif /* _DESW_H */