Книга: DirectX 8 Programming Tutorial

Cleaning up

Cleaning up

Here is a simple function that will unacquire the mouse and keyboard and clean up the Direct Input related pointers. This is called from the destructor of our CGame class as part of the games clean up process.

void CGame::CleanUpDirectInput() {
 if (m_pKeyboard) {
  m_pKeyboard->Unacquire();
 }
 if (m_pMouse) {
  m_pMouse->Unacquire();
 }
 SafeRelease(m_pMouse);
 SafeRelease(m_pKeyboard);
 SafeRelease(m_pDirectInput);
}

So now we have an Earth that you can control.


Оглавление книги


Генерация: 0.030. Запросов К БД/Cache: 0 / 0
поделиться
Вверх Вниз