Re: [PATCH 4/5] d3dx9_36: Implemented ID3DXConstantTable_SetMatrix and ID3DXConstantTable_SetMatrixArray

2011-01-21 Thread Michael Stefaniuc
On 01/22/2011 12:22 AM, Travis Athougies wrote: matrix + i will advance by the size of 1 D3DXMATRIX, since matrix is a pointer to a D3DXMATRIX. Michael is right, I thought the code was clearer with the pointer arithmetic, but I now see more people are familiar with the array indexing style. Actua

Re: [PATCH 4/5] d3dx9_36: Implemented ID3DXConstantTable_SetMatrix and ID3DXConstantTable_SetMatrixArray

2011-01-21 Thread Travis Athougies
Oh I'm sorry. I now see what you mean, you were talking about the register index parameter to Set*ShaderConstantF? Yes, that should be changed. I will submit updated patches shortly. Travis. On Fri, Jan 21, 2011 at 3:22 PM, Travis Athougies wrote: > matrix + i will advance by the size of 1 D3DXM

Re: [PATCH 4/5] d3dx9_36: Implemented ID3DXConstantTable_SetMatrix and ID3DXConstantTable_SetMatrixArray

2011-01-21 Thread Travis Athougies
matrix + i will advance by the size of 1 D3DXMATRIX, since matrix is a pointer to a D3DXMATRIX. Michael is right, I thought the code was clearer with the pointer arithmetic, but I now see more people are familiar with the array indexing style. Travis. On Fri, Jan 21, 2011 at 8:47 AM, Matteo Bruni

Re: [PATCH 4/5] d3dx9_36: Implemented ID3DXConstantTable_SetMatrix and ID3DXConstantTable_SetMatrixArray

2011-01-21 Thread Matteo Bruni
2011/1/21 Michael Stefaniuc : > On 01/21/2011 06:56 AM, Travis Athougies wrote: >> On Thu, Jan 20, 2011 at 7:27 AM, Matteo Bruni >> wrote: >>> >>> 2011/1/20 Travis Athougies: +/* D3DXMATRIX is a union, one of whose elements is an array, so it can be cast to a float point

Re: [PATCH 4/5] d3dx9_36: Implemented ID3DXConstantTable_SetMatrix and ID3DXConstantTable_SetMatrixArray

2011-01-21 Thread Michael Stefaniuc
On 01/21/2011 06:56 AM, Travis Athougies wrote: Uh no. If I were to do that, matrix->m[1] would be the second row, not the second matrix. I'm trying to get at the second matrix. To illustrate this, suppose the matrix were at 0x8000 (not going to happen, but just pretend). matrix->m[1] would be at

Re: [PATCH 4/5] d3dx9_36: Implemented ID3DXConstantTable_SetMatrix and ID3DXConstantTable_SetMatrixArray

2011-01-20 Thread Travis Athougies
Uh no. If I were to do that, matrix->m[1] would be the second row, not the second matrix. I'm trying to get at the second matrix. To illustrate this, suppose the matrix were at 0x8000 (not going to happen, but just pretend). matrix->m[1] would be at 0x8010, since floats are 4 bytes. However, the ne

Re: [PATCH 4/5] d3dx9_36: Implemented ID3DXConstantTable_SetMatrix and ID3DXConstantTable_SetMatrixArray

2011-01-20 Thread Matteo Bruni
2011/1/20 Travis Athougies : > +            /* D3DXMATRIX is a union, one of whose elements is an array, so > it can be cast to a float pointer */ > +           if (is_vertex_shader(This->desc.Version)) > +               IDirect3DDevice9_SetVertexShaderConstantF(device, > desc.RegisterIndex + i,