On 20.06.2013 21:25, Nozomi Kodama wrote:
- if (adjacency)
- {
DWORD *buffer, size;
ID3DXBuffer *temp;
size = 3 * sphere->lpVtbl->GetNumFaces(sphere) * sizeof(DWORD);
hr = D3DXCreateBuffer(size, &temp);
if (hr != D3D_OK)
return hr;
buffer = (DWORD *)(ID3DXBuffer_GetBufferPointer(temp));
Are the outer parentheses needed? Is the cast needed?
hr = sphere->lpVtbl->GenerateAdjacency(sphere, -0.000001f, buffer);
if (hr != D3D_OK)
return hr;
This may leak the temp ID3DXBuffer in the error case.
Cheers Rico