doom3-bfg/neo/sys/win32/win_local.h

140 lines
4.3 KiB
C
Raw Normal View History

2012-11-26 18:58:24 +00:00
/*
===========================================================================
Doom 3 BFG Edition GPL Source Code
Copyright (C) 1993-2012 id Software LLC, a ZeniMax Media company.
2012-11-26 18:58:24 +00:00
This file is part of the Doom 3 BFG Edition GPL Source Code ("Doom 3 BFG Edition Source Code").
2012-11-26 18:58:24 +00:00
Doom 3 BFG Edition Source Code 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 3 of the License, or
(at your option) any later version.
Doom 3 BFG Edition Source Code 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 Doom 3 BFG Edition Source Code. If not, see <http://www.gnu.org/licenses/>.
In addition, the Doom 3 BFG Edition Source Code is also subject to certain additional terms. You should have received a copy of these additional terms immediately following the terms and conditions of the GNU General Public License which accompanied the Doom 3 BFG Edition Source Code. If not, please request a copy in writing from id Software at the address below.
If you have questions concerning this license or the applicable additional terms, you may contact in writing id Software LLC, c/o ZeniMax Media Inc., Suite 120, Rockville, Maryland 20850 USA.
===========================================================================
*/
#ifndef __WIN_LOCAL_H__
#define __WIN_LOCAL_H__
#include <windows.h>
2012-12-17 16:30:59 +00:00
// RB: replaced QGL with GLEW
#include "../../libs/glew/include/GL/wglew.h" // windows OpenGL extensions
// RB end
2012-11-26 18:58:24 +00:00
2012-12-17 16:30:59 +00:00
#include "win_input.h"
2012-11-26 18:58:24 +00:00
#define WINDOW_STYLE (WS_OVERLAPPED|WS_BORDER|WS_CAPTION|WS_VISIBLE | WS_THICKFRAME)
void Sys_QueEvent( sysEventType_t type, int value, int value2, int ptrLength, void* ptr, int inputDeviceNum );
2012-11-26 18:58:24 +00:00
void Sys_CreateConsole();
void Sys_DestroyConsole();
char* Sys_ConsoleInput();
char* Sys_GetCurrentUser();
2012-11-26 18:58:24 +00:00
void Win_SetErrorText( const char* text );
2012-11-26 18:58:24 +00:00
cpuid_t Sys_GetCPUId();
// Input subsystem
void IN_Init();
void IN_Shutdown();
2012-11-26 18:58:24 +00:00
// add additional non keyboard / non mouse movement on top of the keyboard move cmd
void IN_DeactivateMouseIfWindowed();
void IN_DeactivateMouse();
void IN_ActivateMouse();
void IN_Frame();
void DisableTaskKeys( BOOL bDisable, BOOL bBeep, BOOL bTaskMgr );
uint64 Sys_Microseconds();
// window procedure
LONG WINAPI MainWndProc( HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam );
2012-11-26 18:58:24 +00:00
void Conbuf_AppendText( const char* msg );
2012-11-26 18:58:24 +00:00
typedef struct
{
2012-11-26 18:58:24 +00:00
HWND hWnd;
HINSTANCE hInstance;
2012-11-26 18:58:24 +00:00
bool activeApp; // changed with WM_ACTIVATE messages
bool mouseReleased; // when the game has the console down or is doing a long operation
bool movingWindow; // inhibit mouse grab when dragging the window
bool mouseGrabbed; // current state of grab and hide
2012-11-26 18:58:24 +00:00
OSVERSIONINFOEX osversion;
2012-11-26 18:58:24 +00:00
cpuid_t cpuid;
2012-11-26 18:58:24 +00:00
// when we get a windows message, we store the time off so keyboard processing
// can know the exact time of an event (not really needed now that we use async direct input)
int sysMsgTime;
2012-11-26 18:58:24 +00:00
bool windowClassRegistered;
2012-11-26 18:58:24 +00:00
WNDPROC wndproc;
2012-11-26 18:58:24 +00:00
HDC hDC; // handle to device context
HGLRC hGLRC; // handle to GL rendering context
PIXELFORMATDESCRIPTOR pfd;
2012-11-26 18:58:24 +00:00
int pixelformat;
2012-11-26 18:58:24 +00:00
HINSTANCE hinstOpenGL; // HINSTANCE for the OpenGL library
2012-11-26 18:58:24 +00:00
int desktopBitsPixel;
int desktopWidth, desktopHeight;
2012-11-26 18:58:24 +00:00
int cdsFullscreen; // 0 = not fullscreen, otherwise monitor number
2012-11-26 18:58:24 +00:00
idFileHandle log_fp;
2012-11-26 18:58:24 +00:00
unsigned short oldHardwareGamma[3][256];
// desktop gamma is saved here for restoration at exit
2012-11-26 18:58:24 +00:00
static idCVar sys_arch;
static idCVar sys_cpustring;
static idCVar in_mouse;
static idCVar win_allowAltTab;
static idCVar win_notaskkeys;
static idCVar win_username;
static idCVar win_outputEditString;
static idCVar win_viewlog;
static idCVar win_timerUpdate;
static idCVar win_allowMultipleInstances;
2012-11-26 18:58:24 +00:00
CRITICAL_SECTION criticalSections[MAX_CRITICAL_SECTIONS];
2012-11-26 18:58:24 +00:00
HINSTANCE hInstDI; // direct input
2012-11-26 18:58:24 +00:00
LPDIRECTINPUT8 g_pdi;
LPDIRECTINPUTDEVICE8 g_pMouse;
LPDIRECTINPUTDEVICE8 g_pKeyboard;
idJoystickWin32 g_Joystick;
2012-11-26 18:58:24 +00:00
} Win32Vars_t;
extern Win32Vars_t win32;
#endif /* !__WIN_LOCAL_H__ */