fix gl renderer frame callback and make rendering a bit more efficient