Avoid redundant GL state changes

Signed-off-by: Paul Brook <paul@nowt.org>