This is quite a newb question but is it possible to pass a pointer to ID3D10DEVICEPointer to another class. For seem reason my implementation doesn't work.
ID3D10Device was created in the containing class for this but i seem to get nothing but issues trying to use the passed device. If i create the buffers in the containing class and then assign them directing it all works fine.
Thanks,
int DXBufferManager::CreateBuffers(ID3D10Device** pDevice)
{
HRESULT hr = 0;
hr = this->CreateVertexBuffer( VB_SIZE, m_pVertexBuffer, pDevice );
if( hr == S_OK ) hr = this->CreateVertexBuffer( TB_SIZE, m_pTransformBuffer, pDevice );
if( hr == S_OK ) hr = this->CreateIndexBuffer( IB_SIZE, m_pIndexBuffer, pDevice );
return 0;
}
int DXBufferManager::CreateVertexBuffer(unsigned int byteWidth, ID3D10Buffer** ppVertexBuffer, ID3D10Device** pDevice)
{
HRESULT hr = 0;
D3D10_BUFFER_DESC bd;
bd.Usage = D3D10_USAGE_DYNAMIC;
bd.ByteWidth = byteWidth;
bd.BindFlags = D3D10_BIND_VERTEX_BUFFER;
bd.CPUAccessFlags = D3D10_CPU_ACCESS_WRITE;
bd.MiscFlags = 0;
hr = ((ID3D10Device*)*pDevice)->CreateBuffer( &bd, 0, ppVertexBuffer );
return hr;
}
Innovation not reiterationIf at any point I look as if I know what I'm doing don't worry it was probably an accident.