Example #1
0
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();
}
Example #2
0
/*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;
	}
}
Example #3
0
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;
}
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
Example #5
0
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;
}
Example #6
0
// リソースの解放
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
Example #8
0
//=============================================================================
// キーボードの終了処理
//=============================================================================
void UninitKeyboard(void)
{
	if(g_pDIDevKeyboard)
	{
		g_pDIDevKeyboard->Release();
		g_pDIDevKeyboard = NULL;
	}
}
void ReleaseMouse () {
    if (diMouse == NULL)
        return;

    diMouse->Unacquire();
    diMouse->Release();
    diMouse = NULL;
}
Example #10
0
void WINAPI DIDestroyKeyboardDevice()
{
    if(bDInputActive)
    {
        diKeyboard->Unacquire();
        diKeyboard->Release();
    }
}
Example #11
0
void WINAPI DIDestroyMouseDevice()
{
    if(bDInputActive)
    {
        diMouse->Unacquire();
        diMouse->Release();
    }
}
void DirectInputRegistry::releaseDevice( LPDIRECTINPUTDEVICE8 device )
{
    if ( device )
    {
        device->Unacquire();
        device->Release();
    }
}
void ReleaseKeyboard () {
    if (diKeyboard == NULL)
        return;

    diKeyboard->Unacquire();
    diKeyboard->Release();
    diKeyboard = NULL;
}
Example #14
0
void Kill_Keyboard()
{
    if (dikeyboard != NULL)
    {
        dikeyboard->Unacquire();
        dikeyboard->Release();
        dikeyboard = NULL;
    }
}
Example #15
0
/////////////////////////////////////
// Name:	
// Purpose:	
// Output:	
// Return:	
/////////////////////////////////////
void F_API INPMouseDestroy()
{
	if(g_pDMouse)
	{
		g_pDMouse->Unacquire();
		g_pDMouse->Release();
		g_pDMouse=0;
	}
}
Example #16
0
void F_API INPKBDestroy()
{
	if(g_pDKeyboard)
	{
		g_pDKeyboard->Unacquire();
		g_pDKeyboard->Release();
		g_pDKeyboard=0;
	}
}
Example #17
0
void Kill_Mouse()
{
    if (dimouse != NULL)
    {
        dimouse->Unacquire();
        dimouse->Release();
        dimouse = NULL;
    }
}
Example #18
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;
}
Example #19
0
//---------------------------------------------------------
void UninitMouse()
{
	if(pMouse)
	{
		pMouse->Unacquire();
		pMouse->Release();
		pMouse = NULL;
	}

}
Example #20
0
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 UninitMouse(void)
{
	if(g_pDIDevMouse)
	{
		// マウスへのアクセス権を開放
		g_pDIDevMouse->Unacquire();

		g_pDIDevMouse->Release();
		g_pDIDevMouse = NULL;
	}
}
Example #22
0
void DInput_Release_Joystick(void)
{
// this function unacquires and releases the joystick

if (lpdijoy)
    {    
    lpdijoy->Unacquire();
    lpdijoy->Release();
    } // end if

} // end DInput_Release_Joystick
Example #23
0
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 UninitKeyboard(void)
{
	if(g_pDIDevKeyboard)
	{
		// キーボードへのアクセス権を開放
		g_pDIDevKeyboard->Unacquire();

		g_pDIDevKeyboard->Release();
		g_pDIDevKeyboard = NULL;
	}
}
void ShutdownJoystick()
{
    // Unacquire the device one last time just in case
    // the app tried to exit while the device is still acquired.
    if( gJoystick )
        gJoystick->Unacquire();

    // Release any DirectInput objects.
    if(gJoystick)
        gJoystick->Release();
    if(gDirectInput)
        gDirectInput->Release();
}
Example #26
0
//=============================================================================
// キーボードの終了処理
//=============================================================================
void UninitKeyboard(void)
{
	// 入力処理の終了処理
	UninitInput();

	if(g_pDevKeyboard)
	{
		// キーボードへのアクセス権を開放(入力処理終了)
		g_pDevKeyboard->Unacquire();

		g_pDevKeyboard->Release();
		g_pDevKeyboard = NULL;
	}
}
Example #27
0
//=============================================================================
// マウスの終了処理
//=============================================================================
void UninitMouse(void)
{
	// 入力処理の終了処理
	UninitInput();

	if(g_pDevMouse)
	{
		// マウスへのアクセス権を開放
		g_pDevMouse->Unacquire();

		g_pDevMouse->Release();
		g_pDevMouse = NULL;
	}
}
Example #28
0
static void Release(void)
{
    if (g_pEffect[0])
    {
        g_pEffect[0]->Release();
        g_pEffect[0] = NULL;
    }

    if (g_pJoystick)
    {
        SYS_DXTRACE(g_pJoystick->Unacquire());
        g_pJoystick->Release();
        g_pJoystick = NULL;
    }
}
Example #29
0
void CWindowWin32::SControllerInfo::release()
{
    for (u32 i = 0; i < k_maxControllers; ++i)
    {
        LPDIRECTINPUTDEVICE8 dev = _controllers[i]._joy;
        if (dev)
        {
            dev->Unacquire();
            dev->Release();
        }
        _controllers[i].reset();
    }

    if (_directInput)
    {
        _directInput->Release();
        _directInput = nullptr;
    }
}
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 reactor
Destroy_Bitmap(&reactor);

// kill skelaton
Destroy_BOB(&skelaton);

// release keyboard
lpdikey->Unacquire();
lpdikey->Release();
lpdi->Release();

// shutdonw directdraw
DDraw_Shutdown();

// return success
return(1);
} // end Game_Shutdown