untested implementation of clipping using glStencil()
changed to use static array for the attributes list, as GLWindow::mode() keeps a pointer to it