LPDIRECT3DDEVICE9 g_pDevice; // Device object LPDIRECT3D9 g_pD3D; // D3D object // Release the device if (g_pDevice != NULL) { g_pDevice->Release(); g_pDevice = NULL; } // Release the D3D object if (g_pD3D != NULL) { g_pD3D->Release(); g_pD3D = NULL; }
LPDIRECT3DDEVICE9 g_pDevice; // Device object // Release the device if (g_pDevice != NULL) { g_pDevice->Release(); g_pDevice = NULL; }Example Brief: Example 1 shows how to release both the Direct3D device object and the Direct3D object. Example 2 shows how to release only the Direct3D device object. These examples use the Direct3D9 library.