"*showFPS: False \n" \
"*wireframe: False \n"
-# define refresh_providence 0
+# define free_providence 0
+# define release_providence 0
#include "xlockmore.h"
#else
#include "xlock.h"
#ifdef USE_MODULES
ModStruct providence_description = {
"providence", "init_providence", "draw_providence",
- "release_providence", "draw_providence", "change_providence",
+ (char *) NULL, "draw_providence", "change_providence",
(char *) NULL, &providence_opts, 1000, 1, 1, 1, 4, 1.0, "",
"draws pyramid with glory", 0, NULL
};
ENTRYPOINT void reshape_providence(ModeInfo * mi, int width, int height)
{
- double h = (GLfloat) height / (GLfloat) width;
providencestruct *mp = &providence[MI_SCREEN(mi)];
+ double h = (GLfloat) height / (GLfloat) width;
+ int y = 0;
+
+ if (width > height * 5) { /* tiny window: show middle */
+ height = width * 3;
+ y = -height/2;
+ h = height / (GLfloat) width;
+ }
- glViewport(0, 0, mp->WindW = (GLint) width, mp->WindH = (GLint) height);
+ glViewport(0, y, mp->WindW = (GLint) width, mp->WindH = (GLint) height);
glMatrixMode(GL_PROJECTION);
glLoadIdentity();
glEndList();
}
-/* cleanup routine */
-ENTRYPOINT void release_providence(ModeInfo * mi)
-{
-
- if(providence) {
- free((void *) providence);
- providence = (providencestruct *) NULL;
- }
-
- FreeAllGL(mi);
-}
-
/* event handling */
ENTRYPOINT Bool providence_handle_event(ModeInfo *mi, XEvent *event)
{
{
providencestruct *mp;
- if(!providence) {
- if((providence = (providencestruct *)
- calloc(MI_NUM_SCREENS(mi), sizeof (providencestruct))) == NULL)
- return;
- }
+ MI_INIT(mi, providence);
mp = &providence[MI_SCREEN(mi)];
mp->trackball = gltrackball_init (False);