"*showFPS: False \n" \
"*wireframe: False \n" \
-# define refresh_chess 0
+# define free_chess 0
+# define release_chess 0
# include "xlockmore.h"
#else
#ifdef USE_MODULES
ModStruct chess_description =
-{"chess", "init_chess", "draw_chess", "release_chess",
+{"chess", "init_chess", "draw_chess", NULL,
"draw_chess", "init_chess", NULL, &chess_opts,
1000, 1, 2, 1, 4, 1.0, "",
"Chess", 0, NULL};
ENTRYPOINT void reshape_chess(ModeInfo *mi, int width, int height)
{
GLfloat h = (GLfloat) height / (GLfloat) width;
- glViewport(0,0, width, height);
+ 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, 2.0, 30.0);
Chesscreen *cs;
int screen = MI_SCREEN(mi);
- if(!qs &&
- !(qs = (Chesscreen *) calloc(MI_NUM_SCREENS(mi), sizeof(Chesscreen))))
- return;
+ MI_INIT(mi, qs);
cs = &qs[screen];
cs->window = MI_WINDOW(mi);
glXSwapBuffers(disp, w);
}
-/** bust it */
-ENTRYPOINT void release_chess(ModeInfo *mi)
-{
- if(qs)
- free((void *) qs);
- qs = 0;
-
- FreeAllGL(mi);
-}
-
XSCREENSAVER_MODULE_2 ("Endgame", endgame, chess)
#endif