Portability fixes to OpenGL example application (courtesy of djoshea)