X-Git-Url: http://git.hungrycats.org/cgi-bin/gitweb.cgi?p=xscreensaver;a=blobdiff_plain;f=hacks%2Fglx%2Fsurfaces.c;h=165264895d15b0838f3771f75a48ff3261d12569;hp=9ea84cddfa07cd12ad4f10413e24efc448f1b6cc;hb=4361b69d3178d7fc98d0388f9a223af6c2651aba;hpb=d6b0217f2417bd19187f0ebc389d6c5c2233b11c diff --git a/hacks/glx/surfaces.c b/hacks/glx/surfaces.c index 9ea84cdd..16526489 100644 --- a/hacks/glx/surfaces.c +++ b/hacks/glx/surfaces.c @@ -47,6 +47,7 @@ "*suppressRotationAnimation: True\n" \ # define refresh_surface 0 +# define release_surface 0 # include "xlockmore.h" /* from the xscreensaver distribution */ #else /* !STANDALONE */ # include "xlock.h" /* from the xlockmore distribution */ @@ -418,8 +419,11 @@ static void draw(ModeInfo *mi) /* new window size or exposure */ ENTRYPOINT void reshape_surface(ModeInfo *mi, int width, int height) { + surfacestruct *sp = &surface[MI_SCREEN(mi)]; GLfloat h = (GLfloat) height / (GLfloat) width; + glXMakeCurrent(MI_DISPLAY(mi), MI_WINDOW(mi), *(sp->glx_context)); + glViewport(0, 0, (GLint) width, (GLint) height); glMatrixMode(GL_PROJECTION); glLoadIdentity(); @@ -459,12 +463,7 @@ ENTRYPOINT void init_surface(ModeInfo *mi) int screen = MI_SCREEN(mi); surfacestruct *sp; - if (surface == NULL) - { - if ((surface = (surfacestruct *) calloc(MI_NUM_SCREENS(mi), - sizeof(surfacestruct))) == NULL) - return; - } + MI_INIT (mi, surface, NULL); sp = &surface[screen]; sp->window = MI_WINDOW(mi); @@ -637,29 +636,6 @@ ENTRYPOINT void draw_surface(ModeInfo * mi) } -ENTRYPOINT void release_surface(ModeInfo * mi) -{ - if (surface != NULL) - { - int screen; - - for (screen = 0; screen < MI_NUM_SCREENS(mi); screen++) - { - surfacestruct *sp = &surface[screen]; - - if (sp->glx_context) - { - /* Display lists MUST be freed while their glXContext is current. */ - glXMakeCurrent(MI_DISPLAY(mi), sp->window, *(sp->glx_context)); - } - } - (void) free((void *)surface); - surface = NULL; - } - FreeAllGL(mi); -} - - XSCREENSAVER_MODULE_2("Surfaces", surfaces, surface) #endif