From http://www.jwz.org/xscreensaver/xscreensaver-5.30.tar.gz
[xscreensaver] / hacks / fpsI.h
1 /* fps, Copyright (c) 2001-2014 Jamie Zawinski <jwz@jwz.org>
2  * Draw a frames-per-second display (Xlib and OpenGL).
3  *
4  * Permission to use, copy, modify, distribute, and sell this software and its
5  * documentation for any purpose is hereby granted without fee, provided that
6  * the above copyright notice appear in all copies and that both that
7  * copyright notice and this permission notice appear in supporting
8  * documentation.  No representations are made about the suitability of this
9  * software for any purpose.  It is provided "as is" without express or 
10  * implied warranty.
11  */
12
13 #ifndef __XSCREENSAVER_FPSI_H__
14 # define __XSCREENSAVER_FPSI_H__
15
16 #include "fps.h"
17 #undef HAVE_GLBITMAP
18
19
20 struct fps_state {
21   Display *dpy;
22   Window window;
23   int x, y;
24   XFontStruct *font;
25   Bool clear_p;
26   char string[1024];
27
28   /* for glx/fps-gl.c */
29 # ifdef HAVE_GLBITMAP
30   unsigned long font_dlist;
31 # else
32   void *gl_fps_data;
33 # endif
34
35   GC draw_gc, erase_gc;
36
37   int last_ifps;
38   double last_fps;
39   int frame_count;
40   unsigned long slept;
41   struct timeval prev_frame_end, this_frame_end;
42 };
43
44 #endif /* __XSCREENSAVER_FPSI_H__ */