#define PROGCLASS "StarWars"
#define HACK_INIT init_sws
#define HACK_DRAW draw_sws
+#define HACK_RESHAPE reshape_sws
#define sws_opts xlockmore_opts
#define DEF_PROGRAM ZIPPY_PROGRAM
#define DEFAULTS "*delay: 40000 \n" \
+ "*showFPS: False \n" \
+ "*fpsTop: True \n" \
"*program: " DEF_PROGRAM "\n" \
"*lines: " DEF_LINES "\n" \
"*spin: " DEF_SPIN "\n" \
/* Window management, etc
*/
-static void
-reshape (sws_configuration *sc, int width, int height)
+void
+reshape_sws (ModeInfo *mi, int width, int height)
{
+ sws_configuration *sc = &scs[MI_SCREEN(mi)];
static Bool stars_done = False;
glViewport (0, 0, (GLint) width, (GLint) height);
if ((sc->glx_context = init_GL(mi)) != NULL) {
gl_init(mi);
- reshape(sc, MI_WIDTH(mi), MI_HEIGHT(mi));
+ reshape_sws (mi, MI_WIDTH(mi), MI_HEIGHT(mi));
}
if (sc->intra_line_scroll >= sc->line_height)
{
- static time_t reshape_time = 0;
- time_t now = time((time_t) 0);
- if (reshape_time != now) /* only poll for reshape once a second */
- {
- reshape_time = now;
- XGetWindowAttributes (dpy, window, &mi->xgwa);
- reshape(sc, MI_WIDTH(mi), MI_HEIGHT(mi));
- }
-
sc->intra_line_scroll = 0;
/* Drop the oldest line off the end. */
glPopMatrix ();
+ if (mi->fps_p) do_fps (mi);
glFinish();
glXSwapBuffers(dpy, window);