On 15 September 2010 01:55, Misha Koshelev misha680@gmail.com wrote:
- while (count < MAX_FVF_DECL_SIZE && (count == 0 || declaration[count-1].Stream != 0xFF))
- {
count++;
- }
...and similarly you'd want to use D3DXGetDeclLength() here, though I wonder if implementing DrawSubset() isn't going to require creating a vertex declaration anyway.
- if (!ref)
- {
if (This->index_buffer) IDirect3DIndexBuffer9_Release(This->index_buffer);
if (This->vertex_buffer) IDirect3DVertexBuffer9_Release(This->vertex_buffer);
if (This->device) IDirect3DDevice9_Release(This->device);
HeapFree(GetProcessHeap(), 0, This);
- }
In which cases can these be NULL?
Henri Verbeet wrote:
On 15 September 2010 01:55, Misha Koshelev misha680@gmail.com wrote:
- while (count < MAX_FVF_DECL_SIZE && (count == 0 ||
declaration[count-1].Stream != 0xFF))
- {
count++;
- }
...and similarly you'd want to use D3DXGetDeclLength() here, though I wonder if implementing DrawSubset() isn't going to require creating a vertex declaration anyway.
- if (!ref)
- {
if (This->index_buffer)
IDirect3DIndexBuffer9_Release(This->index_buffer);
if (This->vertex_buffer)
IDirect3DVertexBuffer9_Release(This->vertex_buffer);
if (This->device) IDirect3DDevice9_Release(This->device);
HeapFree(GetProcessHeap(), 0, This);
- }
In which cases can these be NULL?
Thank you as always for your valuable feedback.
Could you possible clarify your statement "though I wonder if implementing DrawSubset() isn't going to require creating a vertex declaration anyway."
My understanding from http://msdn.microsoft.com/en-us/library/bb205736%28v=VS.85%29.aspx and http://www.xmission.com/~legalize/book/download/19-D3DX%20Mesh%20Objects.pdf is that DrawSubset will simply draw a subset of the triangles in a mesh...
Thank you Misha
On 16 September 2010 02:23, misha680 misha680@gmail.com wrote:
Could you possible clarify your statement "though I wonder if implementing DrawSubset() isn't going to require creating a vertex declaration anyway."
My understanding from http://msdn.microsoft.com/en-us/library/bb205736%28v=VS.85%29.aspx and http://www.xmission.com/~legalize/book/download/19-D3DX%20Mesh%20Objects.pdf is that DrawSubset will simply draw a subset of the triangles in a mesh...
Yeah, based on the attributes in the attribute table. But to draw something the device needs to know the vertex buffer layout. If D3DXFVFFromDeclarator() is allowed to fail for declarations passed to D3DXCreateMesh(), you'll have to pass the device a vertex declaration to do that.
On Thu, 2010-09-16 at 10:25 +0200, Henri Verbeet wrote:
On 16 September 2010 02:23, misha680 misha680@gmail.com wrote:
Could you possible clarify your statement "though I wonder if implementing DrawSubset() isn't going to require creating a vertex declaration anyway."
My understanding from http://msdn.microsoft.com/en-us/library/bb205736%28v=VS.85%29.aspx and http://www.xmission.com/~legalize/book/download/19-D3DX%20Mesh%20Objects.pdf is that DrawSubset will simply draw a subset of the triangles in a mesh...
Yeah, based on the attributes in the attribute table. But to draw something the device needs to know the vertex buffer layout. If D3DXFVFFromDeclarator() is allowed to fail for declarations passed to D3DXCreateMesh(), you'll have to pass the device a vertex declaration to do that.
Thank you.
So, just to clarify to make sure my understanding is complete, what you are saying is for DrawSubset(), we will need to create an FVF declarator from a non-FVF declarator, correct?
Any pointers on this (re how to do this) much appreciated. I will look later today.
Thank you Misha
On 16 September 2010 14:40, Misha Koshelev misha680@gmail.com wrote:
So, just to clarify to make sure my understanding is complete, what you are saying is for DrawSubset(), we will need to create an FVF declarator from a non-FVF declarator, correct?
No, what I'm saying is that I strongly suspect that in order to implement DrawSubset() you'd need to create an actual vertex declaration from the array of declaration elements, i.e. IDirect3DDevice9::CreateVertexDeclaration(). But once you have that, the copy of the declaration elements and the count variable used to create it would be redundant, since you could just call IDirect3DVertexDeclaration9::GetDeclaration().
Something else, for the error handling for vertex/index buffer creation, just a "FAILED(hr)" and a WARN should do. ERR should imply a bug in either Wine or the underlying system, not just an application giving us crap, they do that all the time.