From http://www.jwz.org/xscreensaver/xscreensaver-5.35.tar.gz
[xscreensaver] / hacks / xlockmoreI.h
index 7632a00cc94d81dc90e88aa9e87b9106e5e49f92..1d54b7814f65f6c5563c63672836347decfbd476 100644 (file)
@@ -1,5 +1,5 @@
 /* xlockmore.h --- xscreensaver compatibility layer for xlockmore modules.
- * xscreensaver, Copyright (c) 1997-2008 Jamie Zawinski <jwz@jwz.org>
+ * xscreensaver, Copyright (c) 1997-2014 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
@@ -41,13 +41,25 @@ typedef struct ModeInfo ModeInfo;
 # endif /* !HAVE_MESA_GL */
 
 # ifdef HAVE_COCOA
-#  include <OpenGL/gl.h>
+#  ifndef USE_IPHONE
+#   include <OpenGL/gl.h>
+#   include <OpenGL/glu.h>
+#  endif
+# elif defined(HAVE_ANDROID)
+#  include <GLES/gl.h>
 # else
 #  include <GL/gl.h>
+#  include <GL/glu.h>
 #  include <GL/glx.h>
 # endif
 
+# ifdef HAVE_JWZGLES
+#  include "jwzgles.h"
+# endif /* HAVE_JWZGLES */
+
+
   extern GLXContext *init_GL (ModeInfo *);
+  extern void xlockmore_reset_gl_state(void);
   extern void clear_gl_error (void);
   extern void check_gl_error (const char *type);
 
@@ -65,15 +77,10 @@ extern void xlockmore_gl_draw_fps (ModeInfo *);
 
 
 extern void xlockmore_setup (struct xscreensaver_function_table *, void *);
+extern void xlockmore_do_fps (Display *, Window, fps_state *, void *);
 
 
-/* Compatibility with the xlockmore RNG API
-   (note that the xlockmore hacks never expect negative numbers.)
- */
-#define LRAND()                        ((long) (random() & 0x7fffffff))
-#define NRAND(n)               ((int) (LRAND() % (n)))
-#define MAXRAND                        (2147483648.0) /* unsigned 1<<31 as a float */
-#define SRAND(n)               /* already seeded by screenhack.c */
+/* The xlockmore RNG API is implemented in utils/yarandom.h. */
 
 
 struct ModeInfo {
@@ -108,7 +115,8 @@ struct ModeInfo {
   /* Used only by OpenGL programs, since FPS is tricky there. */
   fps_state *fpst;
   Bool fps_p;
-  unsigned long polygon_count;
+  unsigned long polygon_count;  /* These values are for -fps display only */
+  double recursion_depth;
 
 #ifdef HAVE_XSHM_EXTENSION
   Bool use_shm;
@@ -153,6 +161,8 @@ struct xlockmore_function_table {
   void (*hack_free) (ModeInfo *);
   Bool (*hack_handle_events) (ModeInfo *, XEvent *);
   ModeSpecOpt *opts;
+
+  unsigned int screen_count; /* Only used on the OS X and iOS ports. */
 };
 
 #endif /* __XLOCKMORE_INTERNAL_H__ */