refactor gl emulation code that replaces drawing functions at runtime