bool TextureDemo::Render() { glMatrixMode(GL_PROJECTION); glLoadIdentity(); MainLoop *ml = MainLoop::Get(); if (ml) { RenderSystem *rs = ml->RenderSys(); if (rs) { unsigned int w = rs->screenWidth(); unsigned int h = rs->screenHeight(); if (w <= h) glOrtho(-2.0, 2.0, -2.0 * (GLfloat) h / (GLfloat) w, 2.0 * (GLfloat) h / (GLfloat) w, -10.0, 10.0); else glOrtho(-2.0 * (GLfloat) w / (GLfloat) h, 2.0 * (GLfloat) w / (GLfloat) h, -2.0, 2.0, -10.0, 10.0); } } glMatrixMode(GL_MODELVIEW); glLoadIdentity(); glPushAttrib(GL_ALL_ATTRIB_BITS); theModel->Draw(); glPopAttrib(); return true; }