[PATCH 1/1] d3dx9: Complete test for D3DXCreateSphere.

Henri Verbeet hverbeet at gmail.com
Thu Jul 22 08:00:29 CDT 2010


On 21 July 2010 21:56, Misha Koshelev <misha680 at gmail.com> wrote:
> +    /* first vertex and normal */
> +    vertex = 0;
> +    test_vertex_data[vertex].position.x = 0.0f;
> +    test_vertex_data[vertex].position.y = 0.0f;
> +    test_vertex_data[vertex].position.z = radius;
> +    test_vertex_data[vertex].normal.x = 0.0f;
> +    test_vertex_data[vertex].normal.y = 0.0f;
> +    test_vertex_data[vertex].normal.z = 1.0f;
> +    vertex++;
> +    assert(vertex < MAX_VERTICES);
An assert probably isn't very useful after the fact, but it seems to
me that dynamically allocating an array of the appropriate size is
nicer anyway.

> +static DWORD compute_sphere_test_index_data(FLOAT radius, UINT slices, UINT stacks)
I haven't really thought this through yet, but would it perhaps be
simpler to calculate the faces a vertex is part of, instead of the
other way around?



More information about the wine-devel mailing list