X-Git-Url: http://git.hungrycats.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=hacks%2Fglx%2Fstonerview.c;h=79b17fb6b5673958107de234e15a869790280ed7;hb=5f9c47ca98dd43d8f59b7c27d3fde6edfde4fe21;hp=dc578622d60f44a7008103397c53ce90e50249fd;hpb=6b1c86cf395f59389e4ece4ea8f4bea2c332745b;p=xscreensaver diff --git a/hacks/glx/stonerview.c b/hacks/glx/stonerview.c index dc578622..79b17fb6 100644 --- a/hacks/glx/stonerview.c +++ b/hacks/glx/stonerview.c @@ -35,6 +35,8 @@ #include "stonerview.h" #include "gltrackball.h" +#define DEF_TRANSPARENT "True" + typedef struct { GLXContext *glx_context; stonerview_state *st; @@ -44,7 +46,19 @@ typedef struct { static stonerview_configuration *bps = NULL; -ENTRYPOINT ModeSpecOpt stonerview_opts = {0, NULL, 0, NULL, NULL}; +static Bool transparent_p; + + +static XrmOptionDescRec opts[] = { + { "-transparent", ".transparent", XrmoptionNoArg, "True" }, + { "+transparent", ".transparent", XrmoptionNoArg, "False" }, +}; + +static argtype vars[] = { + {&transparent_p, "transparent", "Transparent", DEF_TRANSPARENT, t_Bool}, +}; + +ENTRYPOINT ModeSpecOpt stonerview_opts = {countof(opts), opts, countof(vars), vars, NULL}; ENTRYPOINT void @@ -74,8 +88,6 @@ init_stonerview (ModeInfo *mi) fprintf(stderr, "%s: out of memory\n", progname); exit(1); } - - bp = &bps[MI_SCREEN(mi)]; } bp = &bps[MI_SCREEN(mi)]; @@ -83,10 +95,11 @@ init_stonerview (ModeInfo *mi) bp->glx_context = init_GL(mi); bp->trackball = gltrackball_init (); - bp->st = init_view(MI_IS_WIREFRAME(mi)); + bp->st = init_view(MI_IS_WIREFRAME(mi), transparent_p); init_move(bp->st); reshape_stonerview (mi, MI_WIDTH(mi), MI_HEIGHT(mi)); + clear_gl_error(); /* WTF? sometimes "invalid op" from glViewport! */ }