X-Git-Url: http://git.hungrycats.org/cgi-bin/gitweb.cgi?p=xscreensaver;a=blobdiff_plain;f=hacks%2Fglx%2Ftube.c;h=b0e29e687d600dd16eab1b6a5b5da699715ccbf0;hp=f218d4a3aa891d32d136c8ffeb47c4b4c4f2148f;hb=f8cf5ac7b2f53510f80a0eaf286a25298be17bfe;hpb=ec8d2b32b63649e6d32bdfb306eda062769af823 diff --git a/hacks/glx/tube.c b/hacks/glx/tube.c index f218d4a3..b0e29e68 100644 --- a/hacks/glx/tube.c +++ b/hacks/glx/tube.c @@ -1,4 +1,4 @@ -/* tube, Copyright (c) 2001-2011 Jamie Zawinski +/* tube, Copyright (c) 2001-2012 Jamie Zawinski * Utility functions to create tubes and cones in GL. * * Permission to use, copy, modify, distribute, and sell this software and its @@ -18,12 +18,14 @@ #include -#ifdef HAVE_COCOA -# include -#else +#ifndef HAVE_COCOA # include #endif +#ifdef HAVE_JWZGLES +# include "jwzgles.h" +#endif /* HAVE_JWZGLES */ + #include "tube.h" typedef struct { GLfloat x, y, z; } XYZ; @@ -133,6 +135,7 @@ unit_tube (int faces, int smooth, int caps_p, int wire_p) glNormalPointer ( GL_FLOAT, sizeof(*array), &array[0].n); glTexCoordPointer (2, GL_FLOAT, sizeof(*array), &array[0].s); + glFrontFace(GL_CCW); glDrawArrays ((wire_p ? GL_LINES : (smooth ? GL_TRIANGLE_STRIP : GL_TRIANGLES)), 0, out); @@ -179,6 +182,7 @@ unit_tube (int faces, int smooth, int caps_p, int wire_p) glNormalPointer ( GL_FLOAT, sizeof(*array), &array[0].n); glTexCoordPointer (2, GL_FLOAT, sizeof(*array), &array[0].s); + glFrontFace(GL_CCW); glDrawArrays ((wire_p ? GL_LINE_LOOP : GL_TRIANGLE_FAN), 0, out); } @@ -275,6 +279,7 @@ unit_cone (int faces, int smooth, int cap_p, int wire_p) glNormalPointer ( GL_FLOAT, sizeof(*array), &array[0].n); glTexCoordPointer (2, GL_FLOAT, sizeof(*array), &array[0].s); + glFrontFace(GL_CCW); glDrawArrays ((wire_p ? GL_LINES : GL_TRIANGLES), 0, out); @@ -315,6 +320,7 @@ unit_cone (int faces, int smooth, int cap_p, int wire_p) glNormalPointer ( GL_FLOAT, sizeof(*array), &array[0].n); glTexCoordPointer (2, GL_FLOAT, sizeof(*array), &array[0].s); + glFrontFace(GL_CCW); glDrawArrays ((wire_p ? GL_LINE_LOOP : GL_TRIANGLE_FAN), 0, out); }