X-Git-Url: http://git.hungrycats.org/cgi-bin/gitweb.cgi?p=xscreensaver;a=blobdiff_plain;f=OSX%2FXScreenSaverGLView.m;h=d61964f8d3b3fd0dad5fd909ecc3938c5b6be79b;hp=989f8eb9258f36a3a7193bc902f629b4b25e93b2;hb=4361b69d3178d7fc98d0388f9a223af6c2651aba;hpb=d6b0217f2417bd19187f0ebc389d6c5c2233b11c diff --git a/OSX/XScreenSaverGLView.m b/OSX/XScreenSaverGLView.m index 989f8eb9..d61964f8 100644 --- a/OSX/XScreenSaverGLView.m +++ b/OSX/XScreenSaverGLView.m @@ -121,7 +121,7 @@ extern void check_gl_error (const char *type); BOOL was_initted_p = initted_p; [super render_x11]; - if (! was_initted_p) + if (! was_initted_p && xdpy) _suppressRotationAnimation = get_boolean_resource (xdpy, "suppressRotationAnimation", @@ -262,6 +262,31 @@ extern void check_gl_error (const char *type); return kCAGravityCenter; } +- (void) startAnimation +{ + [super startAnimation]; + if (ogl_ctx) /* Almost always true. */ + _glesState = jwzgles_make_state (); +} + +- (void) stopAnimation +{ + [super stopAnimation]; +#ifdef USE_IPHONE + if (_glesState) { + [EAGLContext setCurrentContext:ogl_ctx]; + jwzgles_make_current (_glesState); + jwzgles_free_state (); + } +#endif +} + +- (void) prepareContext +{ + [super prepareContext]; + jwzgles_make_current (_glesState); +} + #endif // !USE_IPHONE @@ -307,10 +332,6 @@ init_GL (ModeInfo *mi) // OpenGL initialization is in [XScreenSaverView startAnimation]. -# ifdef USE_IPHONE - jwzgles_reset (); -# endif // USE_IPHONE - // I don't know why this is necessary, but it beats randomly having some // textures be upside down. //