avoid opengl errors when switching between windowed and fullscreen