summaryrefslogtreecommitdiff
path: root/source/win_local.h
blob: 7ecbc0116b442898ed9bfa621b43c02ceee22242 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
/*
Copyright (C) 1997-2001 Id Software, Inc.

This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
as published by the Free Software Foundation; either version 2
of the License, or (at your option) any later version.

This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  

See the GNU General Public License for more details.

You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.

*/

//
// win_local.h
//

#include "com_local.h"
#include "key_public.h"
#include "in_public.h"
#include "vid_public.h"
#include "vid_local.h"
#include "ref_public.h"
#include "files.h"
#include "sys_public.h"

#define WIN32_LEAN_AND_MEAN
#include <windows.h>

#define IDI_APP 100

#ifndef WM_MOUSEWHEEL
#define WM_MOUSEWHEEL ( WM_MOUSELAST + 1 )  // message that will be supported by the OS 
#endif

#ifndef SPI_GETWHEELSCROLLLINES
#define SPI_GETWHEELSCROLLLINES	104
#endif

#ifndef WM_XBUTTONDOWN
#define WM_XBUTTONDOWN                  0x020B
#define WM_XBUTTONUP                    0x020C
#endif

#ifndef MK_XBUTTON1
#define MK_XBUTTON1         0x0020
#define MK_XBUTTON2         0x0040
#endif

#define MOUSE_BUTTONS	5

#ifndef __LPCGUID_DEFINED__
#define __LPCGUID_DEFINED__
typedef const GUID *LPCGUID;
#endif

#define PRIVATE	static

#define MAX_VIDEO_MODES   128

typedef struct {
    HWND    wnd;
    HDC     dc;

    DEVMODE  dm;

    DWORD	lastMsgTime;
    HHOOK   kbdHook;

    vidFlags_t flags;
    SHORT   gamma_cust[3][256];
    SHORT   gamma_orig[3][256];
    vrect_t rc;
	byte	*buffer;
	int		pitch;

    int     center_x, center_y;

    qboolean	alttab_disabled;
    int         mode_changed;

    struct {
        qboolean	initialized;
        grab_t	    grabbed;
        int			state;
        qboolean    parmsvalid;
        qboolean	restoreparms;
        int		    originalparms[3];
    } mouse;
} win_state_t;

extern HINSTANCE		hGlobalInstance;
extern win_state_t      win;
extern qboolean         iswinnt;

void Win_Init( void );
void Win_Shutdown( void );
void Win_SetMode( void ); 
void Win_ModeChanged( void );
void Win_UpdateGamma( const byte *table );