made gldisplay more general