Check if gl->ctx_driver is non-NULL first in gl_frame