fixes for EGL (on windows imgtec) and fixes for WGL