2004-08-23 00:15:46 +00:00
|
|
|
/*
|
|
|
|
Copyright (C) 1996-1997 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.
|
|
|
|
|
|
|
|
*/
|
|
|
|
// winquake.h: Win32-specific Quake header file
|
|
|
|
|
2005-02-28 07:16:19 +00:00
|
|
|
#ifndef WINQUAKE_H
|
|
|
|
#define WINQUAKE_H
|
|
|
|
|
2004-08-23 00:15:46 +00:00
|
|
|
#ifdef _WIN32
|
2018-07-05 16:21:44 +00:00
|
|
|
void GLVID_Crashed(void);
|
2004-08-23 00:15:46 +00:00
|
|
|
|
|
|
|
#if defined(_WIN32) && !defined(WIN32)
|
|
|
|
#define WIN32 _WIN32
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#ifdef MSVCDISABLEWARNINGS
|
|
|
|
#pragma warning( disable : 4229 ) // mgraph gets this
|
|
|
|
#endif
|
|
|
|
|
2014-10-05 20:04:11 +00:00
|
|
|
#ifndef _WIN32_WINNT
|
|
|
|
#define _WIN32_WINNT 0x0400
|
|
|
|
#endif
|
2004-08-23 00:15:46 +00:00
|
|
|
#define WIN32_LEAN_AND_MEAN
|
|
|
|
#define byte winbyte
|
2017-03-26 17:23:53 +00:00
|
|
|
#ifdef _XBOX
|
|
|
|
#include <xtl.h>
|
|
|
|
#include <WinSockX.h>
|
|
|
|
#else
|
|
|
|
#include <windows.h>
|
|
|
|
#include <mmsystem.h>
|
|
|
|
#include <mmreg.h>
|
|
|
|
#endif
|
|
|
|
|
2004-08-23 00:15:46 +00:00
|
|
|
#define _LPCWAVEFORMATEX_DEFINED
|
|
|
|
|
|
|
|
|
2014-03-30 08:55:06 +00:00
|
|
|
#if defined(WINAPI_FAMILY) && !defined(WINRT)
|
|
|
|
#if WINAPI_FAMILY != WINAPI_FAMILY_DESKTOP_APP
|
|
|
|
//don't just define it. things that don't #include winquake.h / glquake.h need it too.
|
|
|
|
#error "WINRT needs to be defined for non-desktop"
|
|
|
|
#endif
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
2004-08-23 00:15:46 +00:00
|
|
|
#ifndef WM_MOUSEWHEEL
|
2017-06-21 01:24:25 +00:00
|
|
|
#define WM_MOUSEWHEEL 0x020A
|
2004-08-23 00:15:46 +00:00
|
|
|
#endif
|
2017-06-21 01:24:25 +00:00
|
|
|
#ifndef WM_APPCOMMAND
|
|
|
|
#define WM_APPCOMMAND 0x0319
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#define WM_USER_SPEECHTOTEXT (WM_USER+0) //used by stt
|
|
|
|
#define WM_USER_VIDSHUTDOWN (WM_USER+4) //used by multithreading
|
|
|
|
#define WM_USER_VKPRESENT (WM_USER+7) //used by vulkan
|
|
|
|
#define WM_USER_NVVKPRESENT (WM_USER+8) //used by vulkan-over-opengl
|
2004-08-23 00:15:46 +00:00
|
|
|
|
|
|
|
#undef byte
|
|
|
|
|
|
|
|
extern HINSTANCE global_hInstance;
|
|
|
|
extern int global_nCmdShow;
|
|
|
|
|
2009-04-06 00:34:32 +00:00
|
|
|
extern HWND sys_parentwindow;
|
2011-10-27 15:46:36 +00:00
|
|
|
extern unsigned int sys_parentleft;
|
|
|
|
extern unsigned int sys_parenttop;
|
2009-04-06 00:34:32 +00:00
|
|
|
extern unsigned int sys_parentwidth;
|
|
|
|
extern unsigned int sys_parentheight;
|
2009-04-01 22:03:56 +00:00
|
|
|
|
2004-08-23 00:15:46 +00:00
|
|
|
#ifndef SERVERONLY
|
|
|
|
|
2017-02-21 20:22:07 +00:00
|
|
|
#ifdef HAVE_CDPLAYER
|
2004-08-23 00:15:46 +00:00
|
|
|
#ifdef _WIN32
|
|
|
|
LONG CDAudio_MessageHandler(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam);
|
|
|
|
#endif
|
2017-02-21 20:22:07 +00:00
|
|
|
#endif
|
2004-08-23 00:15:46 +00:00
|
|
|
|
|
|
|
|
2015-06-04 06:15:14 +00:00
|
|
|
//shell32 stuff that doesn't exist in win95
|
|
|
|
#define COBJMACROS
|
2017-03-26 17:23:53 +00:00
|
|
|
|
|
|
|
#ifndef _XBOX
|
2015-06-04 06:15:14 +00:00
|
|
|
#include <shlobj.h>
|
|
|
|
#include <shellapi.h>
|
|
|
|
extern LPITEMIDLIST (STDAPICALLTYPE *pSHBrowseForFolderW)(LPBROWSEINFOW lpbi);
|
|
|
|
extern BOOL (STDAPICALLTYPE *pSHGetPathFromIDListW)(LPCITEMIDLIST pidl, LPWSTR pszPath);
|
|
|
|
extern BOOL (STDAPICALLTYPE *pSHGetSpecialFolderPathW)(HWND hwnd, LPWSTR pszPath, int csidl, BOOL fCreate);
|
|
|
|
extern BOOL (STDAPICALLTYPE *pShell_NotifyIconW)(DWORD dwMessage, PNOTIFYICONDATAW lpData);
|
2017-03-26 17:23:53 +00:00
|
|
|
#endif
|
2015-06-04 06:15:14 +00:00
|
|
|
|
2004-08-23 00:15:46 +00:00
|
|
|
//void VID_LockBuffer (void);
|
|
|
|
//void VID_UnlockBuffer (void);
|
|
|
|
|
|
|
|
#endif
|
|
|
|
|
|
|
|
extern HWND mainwindow;
|
2016-02-10 23:23:43 +00:00
|
|
|
extern qboolean Minimized;
|
2004-08-23 00:15:46 +00:00
|
|
|
|
|
|
|
extern qboolean WinNT;
|
|
|
|
|
2012-10-14 09:00:49 +00:00
|
|
|
void INS_UpdateGrabs(int fullscreen, int activeapp);
|
|
|
|
void INS_RestoreOriginalMouseState (void);
|
|
|
|
void INS_SetQuakeMouseState (void);
|
|
|
|
void INS_MouseEvent (int mstate);
|
|
|
|
void INS_RawInput_Read(HANDLE in_device_handle);
|
2004-08-23 00:15:46 +00:00
|
|
|
|
|
|
|
extern qboolean winsock_lib_initialized;
|
|
|
|
|
|
|
|
extern int window_center_x, window_center_y;
|
|
|
|
extern RECT window_rect;
|
|
|
|
|
|
|
|
extern qboolean mouseinitialized;
|
|
|
|
|
|
|
|
//extern HANDLE hinput, houtput;
|
|
|
|
|
2015-08-07 17:49:49 +00:00
|
|
|
extern HCURSOR hArrowCursor, hCustomCursor;
|
Added sys_openfile console command(and menu option) to web and flatpak(via cmake+dbus) builds, to 'install' packages on sandboxed systems a bit more easily.
Cmake: Add FTE_WERROR option, defaults to true in debug builds and off in release builds (in case future compilers have issues).
Cmake: Pull in libXscreensaver so we don't get interrupted by screensavers when playing demos.
Make: Added `make webcl-rel` for a web build without server bloat (eg for sites focused on demo playback. Yes, this means you XantoM).
fteqcc: Include the decompiler in fteqcc (non-gui) builds ('-d' arg).
fteqcc: Decompiler can now mostly handle hexen2 mods without any unknown opcodes.
Allow ezHud and OpenSSL to be compiled as in-engine plugins, potentially for web and windows ports respectively.
Web: Fix support for ogg vorbis. Add support for voip.
Web: Added basic support for WebXR.
QTV: Don't try seeking on unseekable qtv streams. Don't spam when developer 1 is set.
QTV: add support for some eztv extensions.
MVD: added hack to use ktx's vweps in mvd where mvdsv doesn't bother to record the info.
qwfwd: hack around a hack in qwfwd, allowing it to work again.
recording: favour qwd in single player, instead of mvd.
Protocol: reduce client memory used for precache names. Bump maximum precache counts - some people are just abusive, yes you Orl.
hexen2: add enough clientside protocol compat to play the demo included with h2mp. lacks effects.
in_xflip: restored this setting.
fs_hidesyspaths: new cvar, defaults to enabled so you won't find your username or whatever turning up in screenshots or the like. change it to 0 before debuging stuff eg via 'path'.
gl_overbright_models: Added cvar to match QS.
netchan: Added MTU determination, we'll no longer fail to connect when routers stupidly drop icmp packets.
Win: try a few other versions of xinput too.
CSQC: Added a CSQC_GenerateMaterial function, to give the csqc a chance to generate custom materials.
MenuQC: Added support for the skeletal objects API.
2024-04-09 17:13:59 +00:00
|
|
|
enum uploadfmt;
|
|
|
|
void *WIN_CreateCursor(const qbyte *imagedata, int width, int height, enum uploadfmt format, float hotx, float hoty, float scale);
|
2015-08-07 17:49:49 +00:00
|
|
|
qboolean WIN_SetCursor(void *cursor);
|
|
|
|
void WIN_DestroyCursor(void *cursor);
|
playdemo accepts https urls now. will start playing before the file has finished downloading, to avoid unnecessary delays.
reworked network addresses to separate address family and connection type. this should make banning people more reliable, as well as simplifying a whole load of logic (no need to check for ipv4 AND ipv6).
tcpconnect will keep trying to connect even if the connection wasn't instant, instead of giving up instantly.
rewrote tcp connections quite a bit. sv_port_tcp now handles qtv+qizmo+http+ws+rtcbroker+tls equivalents.
qtv_streamport is now a legacy cvar and now acts equivalently to sv_port_tcp (but still separate).
rewrote screenshot and video capture code to use strides. this solves image-is-upside down issues with vulkan.
ignore alt key in browser port. oh no! no more red text! oh no! no more alt-being-wrongly-down-and-being-unable-to-type-anything-without-forcing-alt-released!
reworked audio decoder interface. now has clearly defined success/unavailable/end-of-file results. this should solve a whole load of issues with audio streaming.
fixed various openal audio streaming issues too. openal also got some workarounds for emscripten's poor emulation.
fixed ogg decoder to retain sync properly if seeked.
updated menu_media a bit. now reads vorbis comments/id3v1 tags to get proper track names. also saves the playlist so you don't have to manually repopulate the list so it might actually be usable now (after how many years?)
r_stains now defaults to 0, and is no longer enabled by presets. use decals if you want that sort of thing.
added fs_noreexec cvar, so configs will not be reexeced on gamedir change. this also means defaults won't be reapplied, etc.
added 'nvvk' renderer on windows, using nvidia's vulkan-inside-opengl gl extension. mostly just to see how much slower it is.
fixed up the ftp server quite a lot. more complete, more compliant, and should do ipv6 properly to-boot. file transfers also threaded.
fixed potential crash inside runclientphys.
experimental sv_antilag=3 setting. totally untested. the aim is to avoid missing due to lagged knockbacks. may be expensive for the server.
browser port's websockets support fixed. experimental support for webrtc ('works for me', requires a broker server).
updated avplug(renamed to ffmpeg so people know what it is) to use ffmpeg 3.2.4 properly, with its new encoder api. should be much more robust... also added experimental audio decoder for game music etc (currently doesn't resample, so playback rates are screwed, disabled by cvar).
git-svn-id: https://svn.code.sf.net/p/fteqw/code/trunk@5097 fc73d0e0-1445-4013-8a0c-d673dee63da5
2017-05-10 02:08:58 +00:00
|
|
|
void WIN_WindowCreated(HWND window);
|
2015-08-07 17:49:49 +00:00
|
|
|
|
2012-10-14 09:00:49 +00:00
|
|
|
void INS_UpdateClipCursor (void);
|
2004-08-23 00:15:46 +00:00
|
|
|
void CenterWindow(HWND hWndCenter, int width, int height, BOOL lefttopjustify);
|
2015-01-21 18:18:37 +00:00
|
|
|
void INS_TranslateKeyEvent(WPARAM wParam, LPARAM lParam, qboolean down, int pnum, qboolean genkeystate);
|
2017-06-21 01:24:25 +00:00
|
|
|
int INS_AppCommand(LPARAM lParam);
|
2017-08-14 16:38:44 +00:00
|
|
|
void INS_DeviceChanged(void *ctx, void *data, size_t a ,size_t b);
|
2004-08-23 00:15:46 +00:00
|
|
|
|
|
|
|
void S_BlockSound (void);
|
|
|
|
void S_UnblockSound (void);
|
|
|
|
|
|
|
|
void VID_SetDefaultMode (void);
|
2014-03-30 08:55:06 +00:00
|
|
|
/*
|
2004-08-23 00:15:46 +00:00
|
|
|
int (PASCAL FAR *pWSAStartup)(WORD wVersionRequired, LPWSADATA lpWSAData);
|
|
|
|
int (PASCAL FAR *pWSACleanup)(void);
|
|
|
|
int (PASCAL FAR *pWSAGetLastError)(void);
|
|
|
|
SOCKET (PASCAL FAR *psocket)(int af, int type, int protocol);
|
|
|
|
int (PASCAL FAR *pioctlsocket)(SOCKET s, long cmd, u_long FAR *argp);
|
|
|
|
int (PASCAL FAR *psetsockopt)(SOCKET s, int level, int optname,
|
|
|
|
const char FAR * optval, int optlen);
|
|
|
|
int (PASCAL FAR *precvfrom)(SOCKET s, char FAR * buf, int len, int flags,
|
|
|
|
struct sockaddr FAR *from, int FAR * fromlen);
|
|
|
|
int (PASCAL FAR *psendto)(SOCKET s, const char FAR * buf, int len, int flags,
|
|
|
|
const struct sockaddr FAR *to, int tolen);
|
|
|
|
int (PASCAL FAR *pclosesocket)(SOCKET s);
|
|
|
|
int (PASCAL FAR *pgethostname)(char FAR * name, int namelen);
|
|
|
|
struct hostent FAR * (PASCAL FAR *pgethostbyname)(const char FAR * name);
|
|
|
|
struct hostent FAR * (PASCAL FAR *pgethostbyaddr)(const char FAR * addr,
|
|
|
|
int len, int type);
|
|
|
|
int (PASCAL FAR *pgetsockname)(SOCKET s, struct sockaddr FAR *name,
|
|
|
|
int FAR * namelen);
|
2014-03-30 08:55:06 +00:00
|
|
|
*/
|
2004-08-23 00:15:46 +00:00
|
|
|
#endif
|
2005-02-28 07:16:19 +00:00
|
|
|
|
2005-03-24 18:12:50 +00:00
|
|
|
#endif
|
|
|
|
|