projects
/
xscreensaver
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
From http://www.jwz.org/xscreensaver/xscreensaver-5.16.tar.gz
[xscreensaver]
/
hacks
/
glx
/
tube.c
diff --git
a/hacks/glx/tube.c
b/hacks/glx/tube.c
index f218d4a3aa891d32d136c8ffeb47c4b4c4f2148f..b0e29e687d600dd16eab1b6a5b5da699715ccbf0 100644
(file)
--- a/
hacks/glx/tube.c
+++ b/
hacks/glx/tube.c
@@
-1,4
+1,4
@@
-/* tube, Copyright (c) 2001-201
1
Jamie Zawinski <jwz@jwz.org>
+/* tube, Copyright (c) 2001-201
2
Jamie Zawinski <jwz@jwz.org>
* Utility functions to create tubes and cones in GL.
*
* Permission to use, copy, modify, distribute, and sell this software and its
* 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 <stdlib.h>
#include <stdlib.h>
-#ifdef HAVE_COCOA
-# include <OpenGL/gl.h>
-#else
+#ifndef HAVE_COCOA
# include <GL/gl.h>
#endif
# include <GL/gl.h>
#endif
+#ifdef HAVE_JWZGLES
+# include "jwzgles.h"
+#endif /* HAVE_JWZGLES */
+
#include "tube.h"
typedef struct { GLfloat x, y, z; } XYZ;
#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);
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);
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);
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);
}
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);
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);
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);
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);
}
glDrawArrays ((wire_p ? GL_LINE_LOOP : GL_TRIANGLE_FAN), 0, out);
}