diff options
author | Ian Romanick <idr@freedesktop.org> | 2010-04-20 18:05:06 -0700 |
---|---|---|
committer | Ian Romanick <idr@freedesktop.org> | 2010-04-20 18:05:06 -0700 |
commit | 8d7d3b98f52285ccfaafc7b36e9ac11ad1715a1c (patch) | |
tree | d27ddf04d5bf41e5343c18a1fa9dfa4da50a81dc | |
parent | 58f35e04080fcc26f5ed7f0c80f444597041a92b (diff) |
Build fixes for Windows
-rw-r--r-- | src/revolve.c | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/src/revolve.c b/src/revolve.c index 90d48b3..b345b0b 100644 --- a/src/revolve.c +++ b/src/revolve.c @@ -20,9 +20,15 @@ * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER * DEALINGS IN THE SOFTWARE. */ - +#define _USE_MATH_DEFINES +#include <stdlib.h> +#include <math.h> #include "revolve.h" +#ifndef M_PI +#define M_PI 3.14159265358979323846 +#endif + void revolve(const GLUvec4 *points, const GLUvec4 *normals, const float *u, unsigned num_points, @@ -38,7 +44,7 @@ revolve(const GLUvec4 *points, const GLUvec4 *normals, const float *u, for (i = 0; i < steps; i++) { const float a = start_angle + (angle_step * i); - const float v = i / (steps - 1); + const float v = (float) i / (float) (steps - 1); GLUmat4 r; /* Generate a rotation matrix to rotate the position and the |