GLProgramming.com

home :: about :: development guides :: irc :: forums :: search :: paste :: links :: contribute :: code dump

-> Click here to learn how to get live help <-


New Paste :: Recent Pastes:: No Line Numbers


the texture problem :p by jazzd
1
 
            glEnable(GL_TEXTURE_2D);            

            fan.Bind();
    
            glBegin(GL_QUADS);            
                glTexCoord2f(0.0, 0.0); 
                glVertex3f(320.0f, -0.01f, 320.0f);
                glTexCoord2f(1.0, 0.0); 
                glVertex3f(-320.0f, -0.01f, 320.0f);
                glTexCoord2f(1.0, 1.0); 
                glVertex3f(-320.0f, -0.01f, -320.0f);
                glTexCoord2f(0.0, 1.0); 
                glVertex3f(320.0f, -0.01f, -320.0f);    
            glEnd();

fan.bind is a ShaderEnt:

void CShaderEnt::Bind()
{

    if(blend) {
        glEnable(GL_BLEND);
        glBlendFunc(modeS,modeT);
    }

    if(rot) {
        rotadd += rotation * dtime() / 1000;

        glMatrixMode(GL_TEXTURE);
        glPushMatrix();
        glLoadIdentity();

        glTranslatef(0.5f,0.5f,0);
        glRotatef(rotadd, 0.0f, 0.0f, 1.0f);
        glTranslatef(-0.5f,-0.5f,0);
        
    }
    

    glBindTexture(GL_TEXTURE_2D,texture);
    glMatrixMode(GL_MODELVIEW);

}