Esempio n. 1
0
File: in_win.c Progetto: jite/jquake
void IN_RawInput_DeInit(void)
{
	if (rawmicecount < 1)
		return;

	IN_RawInput_DeRegister();
	Q_free(rawmice);
	Q_free(raw);

	// dealloc mouse structure
	rawmicecount = 0;
}
Esempio n. 2
0
/*
* IN_RawInput_Shutdown
*/
static void IN_RawInput_Shutdown( void ) {
	if( rawmicecount < 1 ) {
		return;
	}

	IN_RawInput_DeRegister();

	Mem_ZoneFree( rawmice );
	Mem_ZoneFree( raw );

	// dealloc mouse structure
	rawmicecount = 0;
}
Esempio n. 3
0
/*
* IN_DeactivateMouse
*
* Called when the window loses focus
*/
static void IN_DeactivateMouse( void ) {
	if( !mouseinitialized ) {
		return;
	}
	if( !mouseactive ) {
		return;
	}

	mouseactive = false;

	if( dinput_initialized ) {
		if( g_pMouse ) {
			if( dinput_acquired ) {
				IDirectInputDevice_Unacquire( g_pMouse );
				dinput_acquired = false;
			}
			if( cl_hwnd ) {
				if( FAILED( IDirectInputDevice_SetCooperativeLevel( g_pMouse, cl_hwnd, DISCL_EXCLUSIVE | DISCL_BACKGROUND ) ) ) {
					Com_DPrintf( "Couldn't set DI coop level\n" );
					return;
				}
			}
		}
		return;
	}

	if( rawinput_initialized > 0 ) {
		IN_RawInput_DeRegister();
	}

	if( restore_spi ) {
		SystemParametersInfo( SPI_SETMOUSE, 0, originalmouseparms, 0 );
	}

	ClipCursor( NULL );
	ReleaseCapture();
	while( ShowCursor( TRUE ) < 0 ) ;
}
Esempio n. 4
0
File: in_win.c Progetto: jite/jquake
void IN_DeactivateMouse (void) 
{
	mouseactivatetoggle = false;

	if (mouseinitialized) 
	{
		#if DIRECTINPUT_VERSION	>= 0x0700
		if (dinput) 
		{
			if (g_pMouse) 
			{
				if (dinput_acquired) 
				{
					IDirectInputDevice_Unacquire(g_pMouse);
					dinput_acquired = false;
				}
			}
		} 
		else
		#endif // DIRECTINPUT_VERSION	>= 0x0700
		{
			#ifdef USINGRAWINPUT
			if (rawmicecount > 0)
				IN_RawInput_DeRegister();
			#endif // USINGRAWINPUT

			if (restore_spi)
				SystemParametersInfo (SPI_SETMOUSE, 0, originalmouseparms, 0);

			ClipCursor (NULL);
			ReleaseCapture ();
		}

		mouseactive = false;
	}
}