Quake II RTX doxygen  1.0 dev
client.h
Go to the documentation of this file.
1 /*
2 Copyright (C) 1997-2001 Id Software, Inc.
3 
4 This program is free software; you can redistribute it and/or modify
5 it under the terms of the GNU General Public License as published by
6 the Free Software Foundation; either version 2 of the License, or
7 (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. See the
12 GNU General Public License for more details.
13 
14 You should have received a copy of the GNU General Public License along
15 with this program; if not, write to the Free Software Foundation, Inc.,
16 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
17 */
18 
19 //
20 // client.h -- Win32 client stuff
21 //
22 
23 #include "shared/shared.h"
24 #include "common/common.h"
25 #include "common/cvar.h"
26 #include "common/files.h"
27 #if USE_CLIENT
28 #include "client/client.h"
29 #include "client/input.h"
30 #include "client/keys.h"
31 #include "client/ui.h"
32 #include "client/video.h"
33 #include "refresh/refresh.h"
34 #endif
35 #include "system/system.h"
36 
37 #define WIN32_LEAN_AND_MEAN
38 #include <windows.h>
39 
40 #ifndef STATIC
41 #define STATIC static
42 #endif
43 
44 // supported in XP SP3 or greater
45 #ifndef PROCESS_DEP_ENABLE
46 #define PROCESS_DEP_ENABLE 0x01
47 #endif
48 #ifndef PROCESS_DEP_DISABLE_ATL_THUNK_EMULATION
49 #define PROCESS_DEP_DISABLE_ATL_THUNK_EMULATION 0x02
50 #endif
51 
52 #if USE_CLIENT
53 
54 #include <tchar.h>
55 
56 #define IDI_APP 100
57 
58 #define MOUSE_BUTTONS 5
59 
60 // supported in Vista or greater
61 #ifndef WM_MOUSEHWHEEL
62 #define WM_MOUSEHWHEEL 0x020E
63 #endif
64 
65 #ifndef __LPCGUID_DEFINED__
66 #define __LPCGUID_DEFINED__
67 typedef const GUID *LPCGUID;
68 #endif
69 
70 // MinGW-w64 doesn't define these...
71 #ifndef DM_GRAYSCALE
72 #define DM_GRAYSCALE 1
73 #endif
74 #ifndef DM_INTERLACED
75 #define DM_INTERLACED 2
76 #endif
77 
78 typedef struct {
79  HWND wnd;
80  HDC dc;
81 
82  DEVMODE dm;
83 
84  DWORD lastMsgTime;
85  HHOOK kbdHook;
86 
87  vidFlags_t flags;
88  byte *buffer;
89  int pitch;
90 
91  SHORT gamma_cust[3][256];
92  SHORT gamma_orig[3][256];
93 
94  // x and y specify position of non-client area on the screen
95  // width and height specify size of client area
96  vrect_t rc;
97 
98  // rectangle of client area in screen coordinates
99  RECT screen_rc;
100 
101  // center of client area in screen coordinates
102  int center_x, center_y;
103 
104  qboolean alttab_disabled;
105  int mode_changed;
106 
107  struct {
108  enum {
109  WIN_MOUSE_DISABLED,
110  WIN_MOUSE_LEGACY,
111  WIN_MOUSE_RAW
112  } initialized;
113  qboolean grabbed;
114  int state;
115  qboolean parmsvalid;
116  qboolean restoreparms;
117  int originalparms[3];
118  int mx, my;
119  } mouse;
120 } win_state_t;
121 
122 extern win_state_t win;
123 
124 void Win_Init(void);
125 void Win_Shutdown(void);
126 void Win_SetMode(void);
127 void Win_ModeChanged(void);
128 
129 #endif // USE_CLIENT
130 
131 extern HINSTANCE hGlobalInstance;
132 
133 #if USE_DBGHELP
134 extern HANDLE mainProcessThread;
135 extern LPTOP_LEVEL_EXCEPTION_FILTER prevExceptionFilter;
136 
137 LONG WINAPI Sys_ExceptionFilter(LPEXCEPTION_POINTERS);
138 #endif
139 
Win_Init
void Win_Init(void)
Definition: client.c:1014
Win_ModeChanged
void Win_ModeChanged(void)
Definition: client.c:123
mvd_s::flags
mvd_flags_t flags
Definition: client.h:169
initialized
qboolean initialized
Definition: screen.c:27
Sys_ExceptionFilter
LONG WINAPI Sys_ExceptionFilter(LPEXCEPTION_POINTERS exceptionInfo)
Definition: debug.c:180
hGlobalInstance
HINSTANCE hGlobalInstance
Definition: system.c:28
Win_SetMode
void Win_SetMode(void)
Definition: client.c:358
mvd_s::state
mvd_state_t state
Definition: client.h:130
Win_Shutdown
void Win_Shutdown(void)
Definition: client.c:1091
client.h
mode_changed
static int mode_changed
Definition: refresh.c:42
win
win_state_t win
Definition: client.c:33