"*showFPS: False \n" \
"*wireframe: False \n"
-# define refresh_flipflop 0
+# define release_flipflop 0
# include "xlockmore.h"
#else
#ifdef USE_MODULES
ModStruct flipflop_description =
- {"flipflop", "init_flipflop", "draw_flipflop", "release_flipflop",
- "draw_flipflop", "init_flipflop", NULL, &flipflop_opts,
+ {"flipflop", "init_flipflop", "draw_flipflop", NULL,
+ "draw_flipflop", "init_flipflop", "free_flipflop", &flipflop_opts,
1000, 1, 2, 1, 4, 1.0, "",
"Flipflop", 0, NULL};
ENTRYPOINT void
reshape_flipflop(ModeInfo *mi, int width, int height)
{
- GLfloat h = (GLfloat) height / (GLfloat) width;
- glViewport(0,0, width, height);
- glMatrixMode(GL_PROJECTION);
- glLoadIdentity();
- gluPerspective(45, 1/h, 1.0, 300.0);
- glMatrixMode(GL_MODELVIEW);
+ GLfloat h = (GLfloat) height / (GLfloat) width;
+ int y = 0;
+
+ if (width > height * 5) { /* tiny window: show middle */
+ height = width * 9/16;
+ y = -height/2;
+ h = height / (GLfloat) width;
+ }
+
+ glViewport(0,y, width, height);
+ glMatrixMode(GL_PROJECTION);
+ glLoadIdentity();
+ gluPerspective(45, 1/h, 1.0, 300.0);
+ glMatrixMode(GL_MODELVIEW);
}
static void
screen = MI_SCREEN(mi);
wire = MI_IS_WIREFRAME(mi);
- if(!qs &&
- !(qs = (Flipflopcreen *) calloc(MI_NUM_SCREENS(mi), sizeof(Flipflopcreen))))
- return;
+ MI_INIT(mi, qs);
c = &qs[screen];
c->window = MI_WINDOW(mi);
}
ENTRYPOINT void
-release_flipflop(ModeInfo *mi)
+free_flipflop(ModeInfo *mi)
{
- if(qs) {
- int screen;
-
- for (screen = 0; screen < MI_NUM_SCREENS(mi); screen++)
- {
- Flipflopcreen *c = &qs[MI_SCREEN(mi)];
- if (c->glx_context)
- c->glx_context = 0;
- if (c->sheet) {
- randsheet_free(c->sheet);
- free (c->sheet);
- c->sheet = 0;
- }
- }
- free(qs);
- qs = 0;
+ Flipflopcreen *c = &qs[MI_SCREEN(mi)];
+ if (c->sheet) {
+ randsheet_free(c->sheet);
+ free (c->sheet);
}
-
- FreeAllGL(mi);
}
/*** ADDED RANDSHEET FUNCTIONS ***/