Btw: While mose GL tutorials tell you to call glViewport in the resize event handler, you can be pretty sure (as long as the GL(ES) implementation isn't completely broken) that a glViewport call per frame isn't the cause for any performance issues. In fact, there are very valid reasons to call glViewport multiple times per frame - think of split screen games or rendering to textures.