gl context management for windows and mac