summaryrefslogblamecommitdiffstats
path: root/jwxyz/README
blob: 7c350bb112074382aaaa0a53e93384c5a3c55b51 (plain) (tree)





























                                                                           
JWXYZ Is Not Xlib.

But it's a bunch of function definitions that bear some resemblance to
Xlib and that kinda sorta implement Xlib in terms of the native graphics
substrate (Cocoa, OpenGL, GLES, Java).

When porting XScreenSaver to other platforms, my goal is to keep a single
code base that compiles for multiple platforms.  That is, I don't want to
end up with two different files that implement "Attraction" using different
APIs or different languages,

Since the vast majority of xscreensaver was originally written in C for
the vintage-1985 X11 API and the vintage-1992 OpenGL API, this presents
something of a challenge.

  1:  To do the MacOS port, I implemented X11 in terms of Cocoa.
      That's what jwxyz.m is.

  2:  To do the iOS port, I used that X11/Cocoa layer from #1, but also
      had to implement OpenGL 1.1 in terms of OpenGLES 1.0.  That's what
      jwzgles.c is.  I have some things to say about that.  You can
      read it on my blog: http://jwz.org/b/yhM9

  3:  To do the Android port, we used the OpenGL/OpenGLES layer from #2,
      but implemented X11 in terms of OpenGL.  That's what jwxyz-gl.c,
      jwxyz-common.c and jwxyz-android.c are.

Perhaps some day we can re-target MacOS and iOS at the OpenGL port of X11
instead of the Cocoa port of X11, and replace jwxyz.m with jwxyz-gl.c and
jwxyz-cocoa.m.  That day has not yet arrived.