Drawing a background image

New Message Reply Date view Thread view Subject view Author view

From: Stephane Jaeger (stephane.jaeger++at++imag.fr)
Date: 05/28/2001 09:49:09


Sorry to bother you again,
I think I ve done everything as Ran said but my background still doesn t draw,
can anybody see what s wrong with it ?
I set the pfTexEnv to DECAL mode and I initialise the texture with a
pfLoadFile which was working fine for the billboard ( with WRAP and CLAMP ).
Thanks again for your help Ran,
Bye
Stephane

void MakeFirstPass (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();
    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();


New Message Reply Date view Thread view Subject view Author view

This archive was generated by hypermail 2b29 : Mon May 28 2001 - 09:48:10 PDT

This message has been cleansed for anti-spam protection. Replace '++at++' in any mail addresses with the '@' symbol.