BOOL was_initted_p = initted_p;
[super render_x11];
- if (! was_initted_p)
+ if (! was_initted_p && xdpy)
_suppressRotationAnimation =
get_boolean_resource (xdpy,
"suppressRotationAnimation",
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
// 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.
//