当前位置: 首页>>代码示例>>C++>>正文


C++ LPDIRECTINPUT::Release方法代码示例

本文整理汇总了C++中LPDIRECTINPUT::Release方法的典型用法代码示例。如果您正苦于以下问题:C++ LPDIRECTINPUT::Release方法的具体用法?C++ LPDIRECTINPUT::Release怎么用?C++ LPDIRECTINPUT::Release使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在LPDIRECTINPUT的用法示例。


在下文中一共展示了LPDIRECTINPUT::Release方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: di_cleanup

void di_cleanup()
{
    /*
     *  Destroy any lingering IDirectInputDevice object.
     */
    if (Di_keyboard) {

        /*
         *  Cleanliness is next to godliness.  Unacquire the device
         *  one last time just in case we got really confused and tried
         *  to exit while the device is still acquired.
         */
        Di_keyboard->Unacquire();

        Di_keyboard->Release();
        Di_keyboard = NULL;
    }

    /*
     *  Destroy any lingering IDirectInput object.
     */
    if (Di_object) {
        Di_object->Release();
        Di_object = NULL;
    }

	if ( Di_event )	{
		CloseHandle(Di_event);
		Di_event = NULL;
	}

}
开发者ID:Admiral-MS,项目名称:fs2open.github.com,代码行数:32,代码来源:key.cpp

示例2: ReleaseDirectInput

void ReleaseDirectInput(void)

{
    if (lpdi!= NULL)
	  {
       lpdi->Release();
	   lpdi = NULL;
	  }
}
开发者ID:OpenSourcedGames,项目名称:Aliens-vs-Predator,代码行数:9,代码来源:Di_func.cpp

示例3: HookDirectInput

int HookDirectInput(HMODULE module, int version)
{
	HINSTANCE hinst;
	void *tmp;
	LPDIRECTINPUT lpdi;
	const GUID di7 = {0x9A4CB684,0x236D,0x11D3,0x8E,0x9D,0x00,0xC0,0x4F,0x68,0x44,0xAE};
	const GUID di8 = {0xBF798030,0x483A,0x4DA2,0xAA,0x99,0x5D,0x64,0xED,0x36,0x97,0x00};

	tmp = HookAPI(module, "dinput.dll", NULL, "DirectInputCreateA", extDirectInputCreate);
	if(tmp) pDirectInputCreate = (DirectInputCreate_Type)tmp;
	tmp = HookAPI(module, "dinput.dll", NULL, "DirectInputCreateW", extDirectInputCreate);
	if(tmp) pDirectInputCreate = (DirectInputCreate_Type)tmp;
	tmp = HookAPI(module, "dinput.dll", NULL, "DirectInputCreateEx", extDirectInputCreateEx);
	if(tmp) pDirectInputCreateEx = (DirectInputCreateEx_Type)tmp;
	tmp = HookAPI(module, "dinput8.dll", NULL, "DirectInput8Create", extDirectInput8Create);
	if(tmp) pDirectInputCreateEx = (DirectInputCreateEx_Type)tmp;
	if(!pDirectInputCreate && !pDirectInputCreateEx){
		if(version < 8){
			hinst = LoadLibrary("dinput.dll");
			pDirectInputCreate =
				(DirectInputCreate_Type)GetProcAddress(hinst, "DirectInputCreateA");
			if(pDirectInputCreate)
				if(!extDirectInputCreate(GetModuleHandle(0), DIRECTINPUT_VERSION,
					&lpdi, 0)) lpdi->Release();
			pDirectInputCreateEx =
				(DirectInputCreateEx_Type)GetProcAddress(hinst, "DirectInputCreateEx");
			if(pDirectInputCreateEx)
				if(!extDirectInputCreateEx(GetModuleHandle(0), DIRECTINPUT_VERSION,
					di7, (void **)&lpdi, 0)) lpdi->Release();
		}
		else{
			hinst = LoadLibrary("dinput8.dll");
			pDirectInputCreateEx =
				(DirectInputCreateEx_Type)GetProcAddress(hinst, "DirectInput8Create");
			if(pDirectInputCreateEx)
				if(!extDirectInputCreateEx(GetModuleHandle(0), DIRECTINPUT_VERSION,
					di8, (void **)&lpdi, 0)) lpdi->Release();
		}
	}
	if(pDirectInputCreate || pDirectInputCreateEx) return 1;
	return 0;
}
开发者ID:xmoeproject,项目名称:X-moe,代码行数:42,代码来源:hdinput.cpp

示例4: Exit

void Input::Exit (bool fReInit_/*=false*/)
{
    TRACE("Input::Exit(%d)\n", fReInit_);

    if (pdiKeyboard) { pdiKeyboard->Unacquire(); pdiKeyboard->Release(); pdiKeyboard = NULL; }
    if (pdidJoystick1) { pdidJoystick1->Unacquire(); pdidJoystick1->Release(); pdidJoystick1 = NULL; }
    if (pdidJoystick2) { pdidJoystick2->Unacquire(); pdidJoystick2->Release(); pdidJoystick2 = NULL; }
    if (pdi) { pdi->Release(); pdi = NULL; }

    Keyboard::Exit(fReInit_);
}
开发者ID:DavidKnight247,项目名称:simcoupe,代码行数:11,代码来源:Input.cpp

示例5: release

void DXGame::release(){
	if(lpDirectDrawObject != NULL){		//if DD object exists
		if(lpPrimary != NULL)				//if primary surface exists
			lpPrimary->Release();			//release primary surface
		lpDirectDrawObject->Release();	//release DD object
	}	
	if(lpDirectInput != NULL){
		if(lpKeyboard){
			lpKeyboard->Unacquire();
			lpKeyboard->Release();
		} 
		lpDirectInput->Release();
	}
}
开发者ID:brettatoms,项目名称:robopanic,代码行数:14,代码来源:DXGame.cpp

示例6: di_cleanup

void di_cleanup()
{
	// Destroy any lingering IDirectInputDevice object.
	if (Di_mouse) {
		// Unacquire the device one last time just in case we got really confused
		// and tried to exit while the device is still acquired.
		Di_mouse->Unacquire();

		Di_mouse->Release();
		Di_mouse = NULL;
	}

	// Destroy any lingering IDirectInput object.
	if (Di_mouse_obj) {
		Di_mouse_obj->Release();
		Di_mouse_obj = NULL;
	}

	Di_mouse_inited = 0;
}
开发者ID:Admiral-MS,项目名称:fs2open.github.com,代码行数:20,代码来源:mouse.cpp

示例7: input_dinput_end

/**
 * input_dinput_end(): Shut down the DirectInput subsystem.
 * @return 0 on success; non-zero on error.
 */
int input_dinput_end(void)
{
	// If any joysticks were opened, close them.
	if (!lpDI)
		return 0;
	
	if (lpDIDMouse)
	{
		lpDIDMouse->Release();
		lpDIDMouse = NULL;
	}
	
	if (lpDIDKeyboard)
	{
		lpDIDKeyboard->Release();
		lpDIDKeyboard = NULL;
	}
	
	for (int i = 0; i < MAX_JOYS; i++)
	{
		if (input_dinput_joy_id[i])
		{
			input_dinput_joy_id[i]->Unacquire();
			input_dinput_joy_id[i]->Release();
			input_dinput_joy_id[i] = NULL;
		}
	}
	
	input_dinput_num_joysticks = 0;
	lpDI->Release();
	lpDI = NULL;
	
	// Clear the DirectInput version variable.
	input_dinput_version = 0;
	
	// DirectInput shut down.
	return 0;
}
开发者ID:salviati,项目名称:gens-gs-debug,代码行数:42,代码来源:input_dinput.cpp

示例8: PisteInput_Lopeta

int PisteInput_Lopeta()
{
	if (!PI_unload) {
		for (int i=0;i<PI_MAX_PELIOHJAIMIA;i++)
			if (PI_joysticks[i].lpdijoy)
			{
				PI_joysticks[i].lpdijoy->Unacquire();
				PI_joysticks[i].lpdijoy->Release();
				PI_joysticks[i].lpdijoy = NULL;
			}
		
		if (PI_lpdimouse)
		{
			PI_lpdimouse->Unacquire();
			PI_lpdimouse->Release();
			PI_lpdimouse = NULL;
		}

		if (PI_lpdikey)
		{
			PI_lpdikey->Unacquire();
			PI_lpdikey->Release();
			PI_lpdikey = NULL;
		}

		if (PI_lpdi)
		{
			PI_lpdi->Release();
			PI_lpdi = NULL;
		}

		PI_unload = true;
	}

	return 0;
}
开发者ID:stt,项目名称:pk2,代码行数:36,代码来源:PisteInput.cpp


注:本文中的LPDIRECTINPUT::Release方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。