Shader-less canvas ( fullscreen sprite ) for use with for example RenderTarget. Takes the texture coordinates as arguments ( usually 1,1 unless you're using AutoPowerOfTwo ). Assumes being called from GL_MODELVIEW mode.
Code: Select all
void renderCanvas(float S, float T)
{
glPushMatrix();
glLoadIdentity();
glMatrixMode(0x1701);
glPushMatrix();
glLoadIdentity();
glBegin(0x7);
glTexCoord2f(0,0); glVertex2i(-1,-1);
glTexCoord2f(S,0); glVertex2i( 1,-1);
glTexCoord2f(S,T); glVertex2i( 1, 1);
glTexCoord2f(0,T); glVertex2i(-1, 1);
glEnd();
glPopMatrix();
glMatrixMode(0x1700);
glPopMatrix();
}