X-Git-Url: http://git.hungrycats.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=hacks%2Fglx%2Fflipscreen3d.c;h=e4db5df1bf4870536f5b8adbda2ca637e776f9f4;hb=39809ded547bdbb08207d3e514950425215b4410;hp=8ae26becc842eb7c688f646c84aa3e4bca0f7c73;hpb=aa75c7476aeaa84cf3abc192b376a8b03c325213;p=xscreensaver diff --git a/hacks/glx/flipscreen3d.c b/hacks/glx/flipscreen3d.c index 8ae26bec..e4db5df1 100644 --- a/hacks/glx/flipscreen3d.c +++ b/hacks/glx/flipscreen3d.c @@ -21,7 +21,8 @@ "*useSHM: True \n" \ "*suppressRotationAnimation: True\n" \ -# define refresh_screenflip 0 +# define free_screenflip 0 +# define release_screenflip 0 # include "xlockmore.h" /* from the xscreensaver distribution */ # include "gltrackball.h" #else /* !STANDALONE */ @@ -70,7 +71,7 @@ ENTRYPOINT ModeSpecOpt screenflip_opts = {countof(opts), opts, countof(vars), va #ifdef USE_MODULES ModStruct screenflip_description = -{"screenflip", "init_screenflip", "draw_screenflip", "release_screenflip", +{"screenflip", "init_screenflip", "draw_screenflip", NULL, "draw_screenflip", "init_screenflip", NULL, &screenflip_opts, 1000, 1, 2, 1, 4, 1.0, "", "Screenflips", 0, NULL}; @@ -305,7 +306,7 @@ static void drawgrid(void) static void display(Screenflip *c, int wire) { int frozen; -/* GLfloat rot = current_device_rotation();*/ + GLfloat rot = current_device_rotation(); glClear(GL_COLOR_BUFFER_BIT|GL_DEPTH_BUFFER_BIT); glLoadIdentity(); @@ -334,9 +335,9 @@ static void display(Screenflip *c, int wire) if (random() % 2) c->dgamma = 1/60 - (float)(random() % 100)/3000; } -/* glRotatef(-rot, 0, 0, 1);*/ + glRotatef(rot, 0, 0, 1); gltrackball_rotate (c->trackball); -/* glRotatef(rot, 0, 0, 1);*/ + glRotatef(-rot, 0, 0, 1); if (rotate) glRotatef(c->rot, c->rx, c->ry, c->rz); /* update variables with each frame */ if(!c->button_down_p && !c->fadetime) { @@ -438,11 +439,7 @@ ENTRYPOINT void init_screenflip(ModeInfo *mi) int screen = MI_SCREEN(mi); Screenflip *c; - if (screenflip == NULL) { - if ((screenflip = (Screenflip *) calloc(MI_NUM_SCREENS(mi), - sizeof(Screenflip))) == NULL) - return; - } + MI_INIT(mi, screenflip); c = &screenflip[screen]; c->window = MI_WINDOW(mi); @@ -516,15 +513,6 @@ ENTRYPOINT void draw_screenflip(ModeInfo *mi) glXSwapBuffers(disp, w); } -ENTRYPOINT void release_screenflip(ModeInfo *mi) -{ - if (screenflip != NULL) { - (void) free((void *) screenflip); - screenflip = NULL; - } - FreeAllGL(mi); -} - XSCREENSAVER_MODULE_2 ("FlipScreen3D", flipscreen3d, screenflip) #endif