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.34.tar.gz
[xscreensaver]
/
hacks
/
glx
/
jwzgles.c
diff --git
a/hacks/glx/jwzgles.c
b/hacks/glx/jwzgles.c
index 325e4654b4b597527d1c222ccf849c2bfbd4a8d9..5b0b51a5dfc2a6506a92c2f1f0da7147385d08c4 100644
(file)
--- a/
hacks/glx/jwzgles.c
+++ b/
hacks/glx/jwzgles.c
@@
-1,4
+1,4
@@
-/* xscreensaver, Copyright (c) 2012-201
4
Jamie Zawinski <jwz@jwz.org>
+/* xscreensaver, Copyright (c) 2012-201
5
Jamie Zawinski <jwz@jwz.org>
*
* Permission to use, copy, modify, distribute, and sell this software and its
* documentation for any purpose is hereby granted without fee, provided that
*
* Permission to use, copy, modify, distribute, and sell this software and its
* documentation for any purpose is hereby granted without fee, provided that
@@
-118,7
+118,8
@@
- gluNewQuadric, gluCylinder, etc: rewrite your code to use tube.c, etc.
- Putting verts in a display list without a wrapping glBegin.
- gluNewQuadric, gluCylinder, etc: rewrite your code to use tube.c, etc.
- Putting verts in a display list without a wrapping glBegin.
- (I didn't realize that even worked!)
+ I didn't realize that even worked! Lockward used to do that,
+ before I fixed it to not.
- Not every function is implemented; just the ones that I needed for
xscreensaver. However, the trivial ones are trivial to enable
- Not every function is implemented; just the ones that I needed for
xscreensaver. However, the trivial ones are trivial to enable
@@
-134,13
+135,11
@@
winduprobot Uses SPHERE_MAP.
jigglypuff Uses SPHERE_MAP (in chrome mode), GL_LINE (in wireframe)
jigsaw Uses GLUtesselator.
winduprobot Uses SPHERE_MAP.
jigglypuff Uses SPHERE_MAP (in chrome mode), GL_LINE (in wireframe)
jigsaw Uses GLUtesselator.
- lockward Puts verts in lists without glBegin!
pinion Uses glSelectBuffer and gluPickMatrix for mouse-clicks.
pipes Uses glMap2f for the Utah Teapot.
polyhedra Uses GLUtesselator (concave objects); also Utah Teapot.
skytentacles Uses GL_LINE in -cel mode.
timetunnel Uses GL_CONSTANT_ALPHA and all kinds of other stuff.
pinion Uses glSelectBuffer and gluPickMatrix for mouse-clicks.
pipes Uses glMap2f for the Utah Teapot.
polyhedra Uses GLUtesselator (concave objects); also Utah Teapot.
skytentacles Uses GL_LINE in -cel mode.
timetunnel Uses GL_CONSTANT_ALPHA and all kinds of other stuff.
-
*/
*/
@@
-168,7
+167,9
@@
#elif defined(HAVE_COCOA)
# include <OpenGL/gl.h>
# include <OpenGL/glu.h>
#elif defined(HAVE_COCOA)
# include <OpenGL/gl.h>
# include <OpenGL/glu.h>
-#else /* X11 */
+#elif defined(HAVE_ANDROID)
+# include <GLES/gl.h>
+#else /* real X11 */
# ifndef GL_GLEXT_PROTOTYPES
# define GL_GLEXT_PROTOTYPES /* for glBindBuffer */
# endif
# ifndef GL_GLEXT_PROTOTYPES
# define GL_GLEXT_PROTOTYPES /* for glBindBuffer */
# endif
@@
-306,6
+307,7
@@
typedef struct { /* All display lists */
#define ISENABLED_NORM_ARRAY (1<<13)
#define ISENABLED_TEX_ARRAY (1<<14)
#define ISENABLED_COLOR_ARRAY (1<<15)
#define ISENABLED_NORM_ARRAY (1<<13)
#define ISENABLED_TEX_ARRAY (1<<14)
#define ISENABLED_COLOR_ARRAY (1<<15)
+#define ISENABLED_ALPHA_TEST (1<<16)
typedef struct {
typedef struct {
@@
-1586,6
+1588,12
@@
jwzgles_glVertex2f (GLfloat x, GLfloat y)
jwzgles_glVertex3fv (v);
}
jwzgles_glVertex3fv (v);
}
+void
+jwzgles_glVertex2dv (const GLdouble *v)
+{
+ jwzgles_glVertex2f (v[0], v[1]);
+}
+
void
jwzgles_glVertex2fv (const GLfloat *v)
{
void
jwzgles_glVertex2fv (const GLfloat *v)
{
@@
-3369,6
+3377,7
@@
enable_disable (GLuint bit, int set)
case GL_LIGHTING: flag = ISENABLED_LIGHTING; break;
case GL_BLEND: flag = ISENABLED_BLEND; break;
case GL_DEPTH_TEST: flag = ISENABLED_DEPTH_TEST; break;
case GL_LIGHTING: flag = ISENABLED_LIGHTING; break;
case GL_BLEND: flag = ISENABLED_BLEND; break;
case GL_DEPTH_TEST: flag = ISENABLED_DEPTH_TEST; break;
+ case GL_ALPHA_TEST: flag = ISENABLED_ALPHA_TEST; break;
case GL_CULL_FACE: flag = ISENABLED_CULL_FACE; break;
case GL_NORMALIZE: flag = ISENABLED_NORMALIZE; break;
case GL_FOG: flag = ISENABLED_FOG; break;
case GL_CULL_FACE: flag = ISENABLED_CULL_FACE; break;
case GL_NORMALIZE: flag = ISENABLED_NORMALIZE; break;
case GL_FOG: flag = ISENABLED_FOG; break;
@@
-3974,6
+3983,15
@@
jwzgles_gluProject (GLdouble objx, GLdouble objy, GLdouble objz,
}
}
+void jwzgles_glViewport (GLuint x, GLuint y, GLuint w, GLuint h)
+{
+# if TARGET_IPHONE_SIMULATOR
+/* fprintf (stderr, "glViewport %dx%d\n", w, h); */
+# endif
+ glViewport (x, y, w, h); /* the real one */
+}
+
+
/* The following functions are present in both OpenGL 1.1 and in OpenGLES 1,
but are allowed within glNewList/glEndList, so we must wrap them to allow
them to either be recorded in lists, or run directly.
/* The following functions are present in both OpenGL 1.1 and in OpenGLES 1,
but are allowed within glNewList/glEndList, so we must wrap them to allow
them to either be recorded in lists, or run directly.
@@
-4140,7
+4158,6
@@
WRAP (glStencilOp, III)
WRAP (glTexEnvf, IIF)
WRAP (glTexEnvi, III)
WRAP (glTranslatef, FFF)
WRAP (glTexEnvf, IIF)
WRAP (glTexEnvi, III)
WRAP (glTranslatef, FFF)
-WRAP (glViewport, IIII)
#undef TYPE_IV
#define TYPE_IV GLuint
WRAP (glDeleteTextures, IIV)
#undef TYPE_IV
#define TYPE_IV GLuint
WRAP (glDeleteTextures, IIV)