diff options
Diffstat (limited to 'hacks/glx/surfaces.c')
-rw-r--r-- | hacks/glx/surfaces.c | 15 |
1 files changed, 12 insertions, 3 deletions
diff --git a/hacks/glx/surfaces.c b/hacks/glx/surfaces.c index 4c79740..26439d5 100644 --- a/hacks/glx/surfaces.c +++ b/hacks/glx/surfaces.c @@ -46,7 +46,6 @@ "*showFPS: False \n" \ "*suppressRotationAnimation: True\n" \ -# define free_surface 0 # define release_surface 0 # include "xlockmore.h" /* from the xscreensaver distribution */ #else /* !STANDALONE */ @@ -429,7 +428,7 @@ ENTRYPOINT void reshape_surface(ModeInfo *mi, int width, int height) h = height / (GLfloat) width; } - glXMakeCurrent(MI_DISPLAY(mi), MI_WINDOW(mi), *(sp->glx_context)); + glXMakeCurrent(MI_DISPLAY(mi), MI_WINDOW(mi), *sp->glx_context); glViewport(0, y, (GLint) width, (GLint) height); glMatrixMode(GL_PROJECTION); @@ -634,7 +633,7 @@ ENTRYPOINT void draw_surface(ModeInfo * mi) glDrawBuffer(GL_BACK); - glXMakeCurrent(display, window, *(sp->glx_context)); + glXMakeCurrent(display, window, *sp->glx_context); draw(mi); if (mi->fps_p) do_fps(mi); @@ -643,6 +642,16 @@ ENTRYPOINT void draw_surface(ModeInfo * mi) } +ENTRYPOINT void free_surface(ModeInfo * mi) +{ + surfacestruct *sp = &surface[MI_SCREEN(mi)]; + if (!sp->glx_context) return; + glXMakeCurrent(MI_DISPLAY(mi), MI_WINDOW(mi), *sp->glx_context); + gltrackball_free (sp->trackball); + free_rotator (sp->rot); +} + + XSCREENSAVER_MODULE_2("Surfaces", surfaces, surface) #endif |