void destroyDevice() { // Destruction des objets Direct3D if(g_pD3DDevice) g_pD3DDevice->ClearState(); if(g_pRenderTargetView) g_pRenderTargetView->Release(); if(g_pSwapChain) g_pSwapChain->Release(); if(g_pD3DDevice) g_pD3DDevice->Release(); // Destruction des objets DirectInput if(g_pKeyboardDevice) { g_pKeyboardDevice->Unacquire(); g_pKeyboardDevice->Release(); } if(g_pMouseDevice) { g_pMouseDevice->Unacquire(); g_pMouseDevice->Release(); } if(g_pDI) g_pDI->Release(); }
/*Unaquire the devices then Release them and set the pointers to NULL*/ void DirectInput_Shutdown() { if (dimouse) { dimouse->Unacquire(); dimouse->Release(); dimouse = NULL; } if (dikeyboard) { dikeyboard->Unacquire(); dikeyboard->Release(); dikeyboard = NULL; } }
int GutInputClose(void) { if ( g_pMouse ) g_pMouse->Unacquire(); if ( g_pKeyboard ) g_pKeyboard->Unacquire(); if ( g_pJoystick ) g_pJoystick->Unacquire(); SAFE_RELEASE(g_pMouse); SAFE_RELEASE(g_pKeyboard); SAFE_RELEASE(g_pJoystick); return 1; }
void input_Dest() { // Unacquire the device one last time just in case // the app tried to exit while the device is still acquired. if( g_pMouse ) g_pMouse->Unacquire(); if ( g_pKeyboard ) g_pKeyboard->Unacquire(); // Release any DirectInput objects. SAFE_RELEASE( g_pMouse ); SAFE_RELEASE( g_pKeyboard ); SAFE_RELEASE( g_pDI ); }
void Done_DInput() { for( int lcv = 0; lcv < di_mouse_count; lcv++ ) { if( di_mouse[ lcv ] ) { di_mouse[ lcv ]->Unacquire(); di_mouse[ lcv ]->Release(); di_mouse[ lcv ] = NULL; } } for( int lcv = 0; lcv < di_joystick_count; lcv++ ) { if( di_joystick[ lcv ] ) { di_joystick[ lcv ]->Unacquire(); di_joystick[ lcv ]->Release(); di_joystick[ lcv ] = NULL; } } if( di_keyboard ) { di_keyboard->Unacquire(); di_keyboard->Release(); di_keyboard = NULL; } if( dinput ) { dinput->Release(); dinput = NULL; } di_mouse_count = 0; }
void disposeDirectInput() { logg( " Disposing Keyboard...", false ); dinKeyboard->Unacquire(); // make sure the keyboard is unacquired dinKeyboard = NULL; logg( " Successfully disposed Keyboard." ); logg( " Disposing Joysticks...", false ); for ( int i = numJoysticks - 1; i >= 0; i-- ) { try { dinJoysticks[i]->Unacquire(); dinJoysticks[i]->Release(); } catch ( ... ) { loggui( " WARNING: Caught an exception while trying to dispose Joystick ", i ); } dinJoysticks[i] = NULL; } logg( " Successfully disposed Joysticks." ); logg( " Disposing DirectInput...", false ); din->Release(); // close DirectInput before exiting din = NULL; logg( " Successfully disposed DirectInput." ); }
int Game_Shutdown(void *parms, int num_parms) { // this function is where you shutdown your game and // release all resources that you allocated // first unacquire the mouse lpdimouse->Unacquire(); // now release the mouse lpdimouse->Release(); // release directinput lpdi->Release(); // unload the bitmap file Unload_Bitmap_File(&bitmap8bit); // delete all bobs and bitmaps Destroy_BOB(&buttons); Destroy_BOB(&pointer); Destroy_Bitmap(&cpanel); Destroy_Bitmap(&canvas); // shutdonw directdraw DDraw_Shutdown(); // return success return(1); } // end Game_Shutdown
C_RESULT close_dx_gamepad(void) { if (g_pJoystick) { g_pJoystick->Unacquire(); } return C_OK; }
m64p_error VidExt_Quit() { if (m_pDIKeyboardDevice)m_pDIKeyboardDevice->Unacquire(); if (m_pDIKeyboardDevice)m_pDIKeyboardDevice->Release(); if (m_pDIKeyboardDevice)m_pDIKeyboardDevice = NULL; CMupen64Plus* instance = CMupen64Plus::GetSingleton( ) ; if (fullscreen) // if in fullscreen.. { ChangeDisplaySettings(NULL, 0); // switch back to desktop.. if (windowedMenu) SetMenu( instance->emulator_hwnd, windowedMenu ); SetWindowLong( instance->emulator_hwnd, GWL_STYLE, windowedStyle ); SetWindowLong( instance->emulator_hwnd, GWL_EXSTYLE, windowedExStyle ); SetWindowPos( instance->emulator_hwnd, NULL, windowedRect.left, windowedRect.top, 0, 0, SWP_NOZORDER | SWP_NOSIZE ); fullscreen = false; ShowCursor( TRUE ); } if( g_hRC != NULL ) { wglMakeCurrent( NULL, NULL ); wglDeleteContext( g_hRC ); g_hRC = NULL; } if( g_hDC != NULL ) { ReleaseDC( instance->emulator_hwnd, g_hDC ); g_hDC = NULL; } return M64ERR_SUCCESS; }
// リソースの解放 void CleanupD3D() { for (int i = 0; i < MAXMODEL; i = i + 1) { if (g_models[i].used == TRUE) { if (g_models[i].pmaterials != NULL) { delete[] g_models[i].pmaterials; } if (g_models[i].ptextures != NULL) { for (DWORD j = 0; j < g_models[i].nummaterials; j = j + 1) { g_models[i].ptextures[j]->Release(); } delete[] g_models[i].ptextures; } if (g_models[i].pmesh != NULL) { g_models[i].pmesh->Release(); } } } if (g_pd3dDevice != NULL) g_pd3dDevice->Release(); if (g_pD3D != NULL) g_pD3D->Release(); if (g_pDIDevice != NULL) { g_pDIDevice->Unacquire(); g_pDIDevice->Release(); } if (g_pDI != NULL) g_pDI->Release(); }
int Game_Shutdown(void *parms, int num_parms) { // this function is where you shutdown your game and // release all resources that you allocated // kill the bug blaster Destroy_BOB(&blaster); // kill the mushroom maker for (int index=0; index<4; index++) Destroy_Bitmap(&mushrooms[index]); // kill the playfield bitmap Destroy_Bitmap(&playfield); // release joystick lpdijoy->Unacquire(); lpdijoy->Release(); lpdi->Release(); // shutdonw directdraw DDraw_Shutdown(); // return success return(1); } // end Game_Shutdown
void WINAPI DIDestroyKeyboardDevice() { if(bDInputActive) { diKeyboard->Unacquire(); diKeyboard->Release(); } }
void WINAPI DIDestroyMouseDevice() { if(bDInputActive) { diMouse->Unacquire(); diMouse->Release(); } }
void ReleaseMouse () { if (diMouse == NULL) return; diMouse->Unacquire(); diMouse->Release(); diMouse = NULL; }
void ReleaseKeyboard () { if (diKeyboard == NULL) return; diKeyboard->Unacquire(); diKeyboard->Release(); diKeyboard = NULL; }
void DirectInputRegistry::releaseDevice( LPDIRECTINPUTDEVICE8 device ) { if ( device ) { device->Unacquire(); device->Release(); } }
void F_API INPKBDestroy() { if(g_pDKeyboard) { g_pDKeyboard->Unacquire(); g_pDKeyboard->Release(); g_pDKeyboard=0; } }
void Kill_Keyboard() { if (dikeyboard != NULL) { dikeyboard->Unacquire(); dikeyboard->Release(); dikeyboard = NULL; } }
void Kill_Mouse() { if (dimouse != NULL) { dimouse->Unacquire(); dimouse->Release(); dimouse = NULL; } }
///////////////////////////////////// // Name: // Purpose: // Output: // Return: ///////////////////////////////////// void F_API INPMouseDestroy() { if(g_pDMouse) { g_pDMouse->Unacquire(); g_pDMouse->Release(); g_pDMouse=0; } }
// release a DirectInput device. We don't need it anymore. void ReleaseDevice( LPDIRECTINPUTDEVICE8 &lpDirectInputDevice ) { if( lpDirectInputDevice != NULL) { lpDirectInputDevice->Unacquire(); lpDirectInputDevice->Release(); lpDirectInputDevice = NULL; } return; }
//--------------------------------------------------------- void UninitMouse() { if(pMouse) { pMouse->Unacquire(); pMouse->Release(); pMouse = NULL; } }
//----------------------------------------------------------------------------- // Name: FreeDirectInput() // Desc: Initialize the DirectInput variables. //----------------------------------------------------------------------------- VOID FreeDirectInput() { // Unacquire the device one last time just in case // the app tried to exit while the device is still acquired. if( g_pJoystick ) g_pJoystick->Unacquire(); // Release any DirectInput objects. SAFE_RELEASE( g_pJoystick ); SAFE_RELEASE( g_pDI ); }
void DInput_Release_Keyboard(void) { // this function unacquires and releases the keyboard if (lpdikey) { lpdikey->Unacquire(); lpdikey->Release(); } // end if } // end DInput_Release_Keyboard
void DInput_Release_Mouse(void) { // this function unacquires and releases the mouse if (lpdimouse) { lpdimouse->Unacquire(); lpdimouse->Release(); } // end if } // end DInput_Release_Mouse
//============================================================================= // マウスの終了処理 //============================================================================= void UninitMouse(void) { if(g_pDIDevMouse) { // マウスへのアクセス権を開放 g_pDIDevMouse->Unacquire(); g_pDIDevMouse->Release(); g_pDIDevMouse = NULL; } }
void DInput_Release_Joystick(void) { // this function unacquires and releases the joystick if (lpdijoy) { lpdijoy->Unacquire(); lpdijoy->Release(); } // end if } // end DInput_Release_Joystick
//============================================================================= // キーボードの終了処理 //============================================================================= void UninitKeyboard(void) { if(g_pDIDevKeyboard) { // キーボードへのアクセス権を開放 g_pDIDevKeyboard->Unacquire(); g_pDIDevKeyboard->Release(); g_pDIDevKeyboard = NULL; } }
//----------------------------------------------------------------------------- // Name: FreeDirectInput() // Desc: Initialize the DirectInput variables. //----------------------------------------------------------------------------- VOID FreeDirectInput() { // Unacquire the device one last time just in case // the app tried to exit while the device is still acquired. if (g_pJoystick) g_pJoystick->Unacquire(); // Release any DirectInput objects. DIJT_SAFE_RELEASE(g_pAutoCenterHandle); DIJT_SAFE_RELEASE(g_pWheelRumbleHandle); DIJT_SAFE_RELEASE(g_pJoystick); DIJT_SAFE_RELEASE(g_pDI); }
_RLXEXPORTFUNC int Unacquire(void) { if (g_pJoystick) { g_pJoystick->Unacquire(); acquired = 0; } if (g_pEffect[0]) g_pEffect[0]->Stop(); return 1; }