use dynamic vars to control GL state