winquake.h 3.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115
  1. /*
  2. Copyright (C) 1996-1997 Id Software, Inc.
  3. This program is free software; you can redistribute it and/or
  4. modify it under the terms of the GNU General Public License
  5. as published by the Free Software Foundation; either version 2
  6. of the License, or (at your option) any later version.
  7. This program is distributed in the hope that it will be useful,
  8. but WITHOUT ANY WARRANTY; without even the implied warranty of
  9. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
  10. See the GNU General Public License for more details.
  11. You should have received a copy of the GNU General Public License
  12. along with this program; if not, write to the Free Software
  13. Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
  14. */
  15. // winquake.h: Win32-specific Quake header file
  16. #ifdef _WIN32
  17. #pragma warning( disable : 4229 ) // mgraph gets this
  18. #include <windows.h>
  19. #define WM_MOUSEWHEEL 0x020A
  20. #ifndef SERVERONLY
  21. #include <ddraw.h>
  22. #include <dsound.h>
  23. #ifndef GLQUAKE
  24. #include <mgraph.h>
  25. #endif
  26. #endif
  27. extern HINSTANCE global_hInstance;
  28. extern int global_nCmdShow;
  29. #ifndef SERVERONLY
  30. extern LPDIRECTDRAW lpDD;
  31. extern qboolean DDActive;
  32. extern LPDIRECTDRAWSURFACE lpPrimary;
  33. extern LPDIRECTDRAWSURFACE lpFrontBuffer;
  34. extern LPDIRECTDRAWSURFACE lpBackBuffer;
  35. extern LPDIRECTDRAWPALETTE lpDDPal;
  36. extern LPDIRECTSOUND pDS;
  37. extern LPDIRECTSOUNDBUFFER pDSBuf;
  38. extern DWORD gSndBufSize;
  39. //#define SNDBUFSIZE 65536
  40. void VID_LockBuffer (void);
  41. void VID_UnlockBuffer (void);
  42. #endif
  43. typedef enum {MS_WINDOWED, MS_FULLSCREEN, MS_FULLDIB, MS_UNINIT} modestate_t;
  44. extern modestate_t modestate;
  45. extern HWND mainwindow;
  46. extern qboolean ActiveApp, Minimized;
  47. extern qboolean WinNT;
  48. int VID_ForceUnlockedAndReturnState (void);
  49. void VID_ForceLockState (int lk);
  50. void IN_ShowMouse (void);
  51. void IN_DeactivateMouse (void);
  52. void IN_HideMouse (void);
  53. void IN_ActivateMouse (void);
  54. void IN_RestoreOriginalMouseState (void);
  55. void IN_SetQuakeMouseState (void);
  56. void IN_MouseEvent (int mstate);
  57. extern qboolean winsock_lib_initialized;
  58. extern int window_center_x, window_center_y;
  59. extern RECT window_rect;
  60. extern qboolean mouseinitialized;
  61. extern HWND hwnd_dialog;
  62. extern HANDLE hinput, houtput;
  63. void IN_UpdateClipCursor (void);
  64. void CenterWindow(HWND hWndCenter, int width, int height, BOOL lefttopjustify);
  65. void S_BlockSound (void);
  66. void S_UnblockSound (void);
  67. void VID_SetDefaultMode (void);
  68. int (PASCAL FAR *pWSAStartup)(WORD wVersionRequired, LPWSADATA lpWSAData);
  69. int (PASCAL FAR *pWSACleanup)(void);
  70. int (PASCAL FAR *pWSAGetLastError)(void);
  71. SOCKET (PASCAL FAR *psocket)(int af, int type, int protocol);
  72. int (PASCAL FAR *pioctlsocket)(SOCKET s, long cmd, u_long FAR *argp);
  73. int (PASCAL FAR *psetsockopt)(SOCKET s, int level, int optname,
  74. const char FAR * optval, int optlen);
  75. int (PASCAL FAR *precvfrom)(SOCKET s, char FAR * buf, int len, int flags,
  76. struct sockaddr FAR *from, int FAR * fromlen);
  77. int (PASCAL FAR *psendto)(SOCKET s, const char FAR * buf, int len, int flags,
  78. const struct sockaddr FAR *to, int tolen);
  79. int (PASCAL FAR *pclosesocket)(SOCKET s);
  80. int (PASCAL FAR *pgethostname)(char FAR * name, int namelen);
  81. struct hostent FAR * (PASCAL FAR *pgethostbyname)(const char FAR * name);
  82. struct hostent FAR * (PASCAL FAR *pgethostbyaddr)(const char FAR * addr,
  83. int len, int type);
  84. int (PASCAL FAR *pgetsockname)(SOCKET s, struct sockaddr FAR *name,
  85. int FAR * namelen);
  86. #endif