Re: [PyOpenGL-Users] Textures usage
Brought to you by:
mcfletch
From: Ian M. <geo...@gm...> - 2010-01-13 05:00:59
|
Hi, Set 2D View: #if your screen is 800x600, rect = [0,0,800,600] glViewport(*rect) glMatrixMode(GL_PROJECTION) glLoadIdentity() gluOrtho2D(rect[0],rect[0]+rect[2],rect[1],rect[1]+rect[3]) glMatrixMode(GL_MODELVIEW) glLoadIdentity() Draw textured fullscreen quad. Make sure you bind to your texture too! param = glGetFloatv(GL_VIEWPORT) glBegin(GL_QUADS) glTexCoord2f(0,0);glVertex2f(param[0], param[1] ) glTexCoord2f(1,0);glVertex2f(param[0]+param[2],param[1] ) glTexCoord2f(1,1);glVertex2f(param[0]+param[2],param[1]+param[3]) glTexCoord2f(0,1);glVertex2f(param[0], param[1]+param[3]) glEnd() Ian |