Actually, while I'm at it, you're also missing ENTER_GL()/LEAVE_GL() calls in match_allows_spec_alpha(), and you should document that it depends on the caller to do context activation.