Sign in to follow this  
a24710

DX10 problem with ID3D10Buffer::Map

Recommended Posts

Hi i´ve created a ID3D10Buffer which will store all the object´s vertices with... D3D10_BUFFER_DESC vertex_buffer_desc; vertex_buffer_desc.Usage = D3D10_USAGE_DYNAMIC; vertex_buffer_desc.CPUAccessFlags = D3D10_CPU_ACCESS_WRITE; vertex_buffer_desc.BindFlags = D3D10_BIND_VERTEX_BUFFER; vertex_buffer_desc.MiscFlags = 0; vertex_buffer_desc.ByteWidth = ...; i want the buffer to be updated from the cpu sometimes, so i set the appropiate flags. The buffer is created ok, cause i can render the object and it looks as it should, and the createbuffer function returns ok. my problem is that whenever i try to access this buffer from the cpu i get this float *data = NULL; HRESULT hr = dx10_vertex_data_buffer->Map(D3D10_MAP_WRITE, 0, (void **) &data); if (FAILED(hr)) return false; this gives me an EINVALIDARG in the hresult and of course it fails what am i missing??? any ideas????

Share this post


Link to post
Share on other sites
Pass the debug flag to your device on device creation, and you will get extremely verbose error messages in your output window that tell you what you're doing wrong.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this