void GEREffect::destory() { file_path_.clear(); D3D_RELEASE(p_fx_); D3D_RELEASE(p_err_msg_); }
bool GEREffect::create_from_file( const char* file_path ) { LPDIRECT3DDEVICE9 p_d3d_device = GEEngine::get_device(); if(p_d3d_device == NULL) return false; D3D_RELEASE(p_fx_); D3D_RELEASE(p_err_msg_); if (file_path == NULL) return false; file_path_ = file_path; HRESULT h_res = D3DXCreateEffectFromFile( p_d3d_device, file_path, NULL, // Defines NULL, // Include #ifdef _DEBUG D3DXSHADER_DEBUG | D3DXSHADER_SKIPOPTIMIZATION | D3DXSHADER_ENABLE_BACKWARDS_COMPATIBILITY, #else D3DXSHADER_ENABLE_BACKWARDS_COMPATIBILITY, #endif NULL, // Pool &p_fx_, &p_err_msg_); return SUCCEEDED(h_res); }
void GEInput::destory_input() { if (p_keyboard_device_) p_keyboard_device_->Unacquire(); if (p_mouse_device_) p_mouse_device_->Unacquire(); D3D_RELEASE(p_keyboard_device_); D3D_RELEASE(p_mouse_device_); D3D_RELEASE(p_input_); }
CD3DGraphics::~CD3DGraphics() { D3D_RELEASE(d3ddev); D3D_RELEASE(d3d); }