From: Stephane Jaeger (stephane.jaeger++at++imag.fr)
Date: 05/28/2001 10:05:49
I finally Made it work, I just had forgotten a glLoadIdentity() after
the gluOrtho2D.
Below is the final piece of code, it might be of some interest for
somebody.
Thank you all for your help,
Bye Stephane
void MyDrawCallBack (pfChannel *channel, void *)
{
int mode[1];
SoftShadow *softy = application->GetSoftShadow();
// erase framebuffer and draw Earth-Sky model
channel->clear();
glGetIntegerv(GL_MATRIX_MODE,mode);
glMatrixMode(GL_PROJECTION);
glPushMatrix();
glLoadIdentity();
gluOrtho2D(-1,1,-1,1);
glMatrixMode(GL_MODELVIEW);
glPushMatrix();
glLoadIdentity();
glDepthMask(GL_FALSE);
pfEnable(PFEN_TEXTURE);
softy->spotEnv->apply();
softy->spotTex->apply();
glBegin(GL_QUADS);
glTexCoord2f(0.,1.);
glVertex2f(-1.0,1.0);
glTexCoord2f(0.,0.);
glVertex2f(-1.0,-1.0);
glTexCoord2f(1.,0.);
glVertex2f(1.0,-1.0);
glTexCoord2f(1.,1.);
glVertex2f(1.0,1.0);
glEnd();
glPopMatrix();
glMatrixMode(GL_PROJECTION);
glPopMatrix();
glDepthMask(GL_TRUE);
glMatrixMode(mode[0]);
pfDraw();
This archive was generated by hypermail 2b29 : Mon May 28 2001 - 10:04:28 PDT