void Tree::_destory(Tree_Node **pointer) { if (*pointer) { // if(!((*pointer)->left == NULL || (*pointer)->right == NULL)) { _destory(&((*pointer)->right)); _destory(&((*pointer)->left)); // } Tree_Node *tem = *pointer; // *pointer = NULL; delete tem; *pointer = NULL; } }
bool xD11InputBuffer::create(size_t nElement , size_t bytePerVertex , const xInputBufferDesc* pDesc , void* pData ) { _destory(); m_nElement = nElement; m_iBufLen = m_nElement * bytePerVertex; m_nBytePerVertex = bytePerVertex; D3D11_SUBRESOURCE_DATA InitData; InitData.pSysMem = pData; InitData.SysMemPitch = 0; InitData.SysMemSlicePitch = 0; D3D11_SUBRESOURCE_DATA* pInitData = pData ? &InitData:NULL; ID3D11Device* pD10Device = m_pD11RenderAPI->d11Device(); m_buffDesc.ByteWidth = (UINT)m_iBufLen ; m_buffDesc.StructureByteStride = (UINT)bytePerVertex; conv( *pDesc , m_buffDesc); pD10Device->CreateBuffer(&m_buffDesc , pInitData , &m_pBuffer); return m_pBuffer != NULL; }
void Tree::destory() { _destory(&root); }
bool xD11RazState::unload() { return _destory(); }
xD11RazState::~xD11RazState() { _destory(); }
xD11InputBuffer::~xD11InputBuffer() { _destory(); }