FTEQW
Documentation of the FTE engine source tree.
winquake.h
Go to the documentation of this file.
1/*
2Copyright (C) 1996-1997 Id Software, Inc.
3
4This program is free software; you can redistribute it and/or
5modify it under the terms of the GNU General Public License
6as published by the Free Software Foundation; either version 2
7of the License, or (at your option) any later version.
8
9This program is distributed in the hope that it will be useful,
10but WITHOUT ANY WARRANTY; without even the implied warranty of
11MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
12
13See the GNU General Public License for more details.
14
15You should have received a copy of the GNU General Public License
16along with this program; if not, write to the Free Software
17Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
18
19*/
20// winquake.h: Win32-specific Quake header file
21
22#ifndef WINQUAKE_H
23#define WINQUAKE_H
24
25#ifdef _WIN32
26void GLVID_Crashed(void);
27
28#if defined(_WIN32) && !defined(WIN32)
29#define WIN32 _WIN32
30#endif
31
32#ifdef MSVCDISABLEWARNINGS
33#pragma warning( disable : 4229 ) // mgraph gets this
34#endif
35
36#ifndef _WIN32_WINNT
37#define _WIN32_WINNT 0x0400
38#endif
39#define WIN32_LEAN_AND_MEAN
40#define byte winbyte
41#ifdef _XBOX
42 #include <xtl.h>
43 #include <WinSockX.h>
44#else
45 #include <windows.h>
46 #include <mmsystem.h>
47 #include <mmreg.h>
48#endif
49
50#define _LPCWAVEFORMATEX_DEFINED
51
52
53#if defined(WINAPI_FAMILY) && !defined(WINRT)
54 #if WINAPI_FAMILY != WINAPI_FAMILY_DESKTOP_APP
55 //don't just define it. things that don't #include winquake.h / glquake.h need it too.
56 #error "WINRT needs to be defined for non-desktop"
57 #endif
58#endif
59
60
61#ifndef WM_MOUSEWHEEL
62#define WM_MOUSEWHEEL 0x020A
63#endif
64#ifndef WM_APPCOMMAND
65#define WM_APPCOMMAND 0x0319
66#endif
67
68#define WM_USER_SPEECHTOTEXT (WM_USER+0) //used by stt
69#define WM_USER_VIDSHUTDOWN (WM_USER+4) //used by multithreading
70#define WM_USER_VKPRESENT (WM_USER+7) //used by vulkan
71#define WM_USER_NVVKPRESENT (WM_USER+8) //used by vulkan-over-opengl
72
73#undef byte
74
75extern HINSTANCE global_hInstance;
76extern int global_nCmdShow;
77
78extern HWND sys_parentwindow;
79extern unsigned int sys_parentleft;
80extern unsigned int sys_parenttop;
81extern unsigned int sys_parentwidth;
82extern unsigned int sys_parentheight;
83
84#ifndef SERVERONLY
85
86#ifdef HAVE_CDPLAYER
87#ifdef _WIN32
88LONG CDAudio_MessageHandler(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam);
89#endif
90#endif
91
92
93//shell32 stuff that doesn't exist in win95
94#define COBJMACROS
95
96#ifndef _XBOX
97#include <shlobj.h>
98#include <shellapi.h>
99extern LPITEMIDLIST (STDAPICALLTYPE *pSHBrowseForFolderW)(LPBROWSEINFOW lpbi);
100extern BOOL (STDAPICALLTYPE *pSHGetPathFromIDListW)(LPCITEMIDLIST pidl, LPWSTR pszPath);
101extern BOOL (STDAPICALLTYPE *pSHGetSpecialFolderPathW)(HWND hwnd, LPWSTR pszPath, int csidl, BOOL fCreate);
102extern BOOL (STDAPICALLTYPE *pShell_NotifyIconW)(DWORD dwMessage, PNOTIFYICONDATAW lpData);
103#endif
104
105//void VID_LockBuffer (void);
106//void VID_UnlockBuffer (void);
107
108#endif
109
110extern HWND mainwindow;
111extern qboolean Minimized;
112
113extern qboolean WinNT;
114
115void INS_UpdateGrabs(int fullscreen, int activeapp);
117void INS_SetQuakeMouseState (void);
118void INS_MouseEvent (int mstate);
119void INS_RawInput_Read(HANDLE in_device_handle);
120
122
124extern RECT window_rect;
125
127
128//extern HANDLE hinput, houtput;
129
131void *WIN_CreateCursor(const qbyte *imagedata, int width, int height, uploadfmt_t format, float hotx, float hoty, float scale);
132qboolean WIN_SetCursor(void *cursor);
133void WIN_DestroyCursor(void *cursor);
134void WIN_WindowCreated(HWND window);
135
136void INS_UpdateClipCursor (void);
137void CenterWindow(HWND hWndCenter, int width, int height, BOOL lefttopjustify);
138void INS_TranslateKeyEvent(WPARAM wParam, LPARAM lParam, qboolean down, int pnum, qboolean genkeystate);
139int INS_AppCommand(LPARAM lParam);
140void INS_DeviceChanged(void *ctx, void *data, size_t a ,size_t b);
141
142void S_BlockSound (void);
143void S_UnblockSound (void);
144
146/*
147int (PASCAL FAR *pWSAStartup)(WORD wVersionRequired, LPWSADATA lpWSAData);
148int (PASCAL FAR *pWSACleanup)(void);
149int (PASCAL FAR *pWSAGetLastError)(void);
150SOCKET (PASCAL FAR *psocket)(int af, int type, int protocol);
151int (PASCAL FAR *pioctlsocket)(SOCKET s, long cmd, u_long FAR *argp);
152int (PASCAL FAR *psetsockopt)(SOCKET s, int level, int optname,
153 const char FAR * optval, int optlen);
154int (PASCAL FAR *precvfrom)(SOCKET s, char FAR * buf, int len, int flags,
155 struct sockaddr FAR *from, int FAR * fromlen);
156int (PASCAL FAR *psendto)(SOCKET s, const char FAR * buf, int len, int flags,
157 const struct sockaddr FAR *to, int tolen);
158int (PASCAL FAR *pclosesocket)(SOCKET s);
159int (PASCAL FAR *pgethostname)(char FAR * name, int namelen);
160struct hostent FAR * (PASCAL FAR *pgethostbyname)(const char FAR * name);
161struct hostent FAR * (PASCAL FAR *pgethostbyaddr)(const char FAR * addr,
162 int len, int type);
163int (PASCAL FAR *pgetsockname)(SOCKET s, struct sockaddr FAR *name,
164 int FAR * namelen);
165*/
166#endif
167
168#endif
169
qboolean
Definition: api_menu.h:34
unsigned int width
Definition: bymorphed.h:4
unsigned int height
Definition: bymorphed.h:5
unsigned char qbyte
Definition: common.h:127
static EGLSurface EGLSurface EGLContext ctx
Definition: gl_videgl.c:47
static UINT
Definition: gl_vidnt.c:220
GLenum format
Definition: glsupp.h:502
struct Window * window
Definition: gl_vidmorphos.c:72
LONG(WINAPI *qAVIStreamStart)(PAVISTREAM pavi)
PAVISTREAM FAR DWORD LONG lParam
Definition: m_mp3.c:1578
DWORD
Definition: net_ssl_winsspi.c:99
char ** data
Definition: p_script.c:63
int b
Definition: pr_lua.c:242
float scale
Definition: pr_menu.c:106
UINT uMsg
Definition: qccgui.c:1080
HWND hwnd
Definition: qccgui.c:1027
enum uploadfmt uploadfmt_t
netadr_t a
Definition: sv_master.c:141
int WPARAM wParam
Definition: sys_win.c:1021
unsigned int sys_parentleft
Definition: sys_linux.c:73
LPWSTR int csidl
Definition: winquake.h:101
void WIN_DestroyCursor(void *cursor)
Definition: sys_win.c:4591
void INS_RestoreOriginalMouseState(void)
Definition: in_win.c:688
qboolean WIN_SetCursor(void *cursor)
Definition: sys_win.c:4578
HCURSOR hCustomCursor
Definition: winquake.h:130
unsigned int sys_parentwidth
Definition: sys_linux.c:75
void INS_UpdateClipCursor(void)
Definition: in_win.c:404
unsigned int sys_parentheight
Definition: sys_linux.c:76
BOOL(STDAPICALLTYPE *pSHGetPathFromIDListW)(LPCITEMIDLIST pidl
qboolean winsock_lib_initialized
qboolean Minimized
Definition: sys_win.c:576
LPWSTR int BOOL fCreate
Definition: winquake.h:101
void S_UnblockSound(void)
Definition: snd_win.c:73
RECT window_rect
Definition: in_win.c:122
void VID_SetDefaultMode(void)
void S_BlockSound(void)
Definition: snd_win.c:48
void INS_SetQuakeMouseState(void)
Definition: in_win.c:675
void CenterWindow(HWND hWndCenter, int width, int height, BOOL lefttopjustify)
void * WIN_CreateCursor(const qbyte *imagedata, int width, int height, uploadfmt_t format, float hotx, float hoty, float scale)
Definition: sys_win.c:4492
HINSTANCE global_hInstance
Definition: sys_plugfte.c:926
PNOTIFYICONDATAW lpData
Definition: winquake.h:102
void INS_DeviceChanged(void *ctx, void *data, size_t a, size_t b)
Definition: in_win.c:2058
void INS_UpdateGrabs(int fullscreen, int activeapp)
Definition: in_win.c:705
int window_center_x
Definition: in_win.c:121
int INS_AppCommand(LPARAM lParam)
Definition: in_win.c:2497
unsigned int sys_parenttop
Definition: sys_linux.c:74
void INS_MouseEvent(int mstate)
Definition: in_win.c:1409
qboolean WinNT
Definition: sys_win.c:577
LONG CDAudio_MessageHandler(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
Definition: cd_null.c:8
void INS_RawInput_Read(HANDLE in_device_handle)
Definition: in_win.c:1751
int global_nCmdShow
Definition: sys_win.c:2502
qboolean mouseinitialized
Definition: in_win.c:149
LPITEMIDLIST(STDAPICALLTYPE *pSHBrowseForFolderW)(LPBROWSEINFOW lpbi)
LPWSTR pszPath
Definition: winquake.h:100
HCURSOR hArrowCursor
Definition: sys_win.c:4491
HWND sys_parentwindow
Definition: sys_linux.c:77
int window_center_y
Definition: winquake.h:123
void WIN_WindowCreated(HWND window)
Definition: sys_win.c:4632
void GLVID_Crashed(void)
Definition: gl_vidnt.c:2292
HWND mainwindow
Definition: in_win.c:120
void INS_TranslateKeyEvent(WPARAM wParam, LPARAM lParam, qboolean down, int pnum, qboolean genkeystate)
Definition: in_win.c:2357