Simple way to detect hardware rendering on OpenGL+SDL?

Is there a simple & fool proof way to detect if the OpenGL implementation being used is hardware accellerated or not (for linux, and also windows if possible) ?

I don’t think I can use glXIsDirect() because SDL won’t give me access to the OpenGL context.

I don’t think there’s a way to use glGetString(GL_VENDOR) (or GL_RENDERER) as there is no substring that indicates hw or sw rendering for sure (“mesa” is also used as a basis by some hardware renderers). I don’t want to have any false positives.