X-Git-Url: http://git.hungrycats.org/cgi-bin/gitweb.cgi?p=xscreensaver;a=blobdiff_plain;f=jwxyz%2Fjwxyz-android.h;h=14bfc7feaf29fe7970ded19cff60f9931c0c61d0;hp=493f456a5c55ef5213a5e1aec1af4fdc68e151a4;hb=4361b69d3178d7fc98d0388f9a223af6c2651aba;hpb=d6b0217f2417bd19187f0ebc389d6c5c2233b11c diff --git a/jwxyz/jwxyz-android.h b/jwxyz/jwxyz-android.h index 493f456a..14bfc7fe 100644 --- a/jwxyz/jwxyz-android.h +++ b/jwxyz/jwxyz-android.h @@ -16,13 +16,33 @@ #include "../hacks/fps.h" #include +/* Native EGL is Android 2.3/API 9. EGL in Java is available from API 1. */ #include +#include #include /* Keep synchronized with check-configs.pl and jwxyz.java. */ #define API_XLIB 0 #define API_GL 1 +struct jwxyz_Drawable { + enum { WINDOW, PIXMAP } type; + XRectangle frame; + union { + EGLSurface egl_surface; + GLuint texture; /* If this is 0, it's the default framebuffer. */ + }; + union { + struct { + struct running_hack *rh; + int last_mouse_x, last_mouse_y; + } window; + struct { + int depth; + } pixmap; + }; +}; + struct running_hack { struct xscreensaver_function_table *xsft; jint api; @@ -33,32 +53,32 @@ struct running_hack { JNIEnv *jni_env; jobject jobject; + /* These are set up in Java by the GLSurfaceView. */ + EGLContext egl_ctx; + EGLSurface egl_surface; EGLDisplay egl_display; + GLint fb_default; + EGLConfig egl_config; - EGLContext egl_window_ctx, egl_xlib_ctx; + + PFNGLBINDFRAMEBUFFEROESPROC glBindFramebufferOES; + PFNGLFRAMEBUFFERTEXTURE2DOESPROC glFramebufferTexture2DOES; + + struct jwxyz_Drawable frontbuffer; + GC copy_gc; + Bool gl_fbo_p, frontbuffer_p; + GLuint fb_pixmap; + Drawable current_drawable; Bool ignore_rotation_p; + jwzgles_state *gles_state; + unsigned long frame_count; Bool initted_p; struct event_queue *event_queue; }; -struct jwxyz_Drawable { - enum { WINDOW, PIXMAP } type; - XRectangle frame; - EGLSurface egl_surface; - union { - struct { - struct running_hack *rh; - int last_mouse_x, last_mouse_y; - } window; - struct { - int depth; - } pixmap; - }; -}; - extern void prepare_context (struct running_hack *rh); @@ -67,7 +87,7 @@ extern void prepare_context (struct running_hack *rh); JNIEXPORT void JNICALL Java_org_jwz_xscreensaver_jwxyz_nativeInit (JNIEnv *, jobject thiz, - jstring jhack, jint api, + jstring jhack, jobject defaults, jint w, jint h);