Hi,
Just looking for advice … on some graphics cards, the code below seems to cause a complete system crash
The loaded textures do not contain an alpha channel (24bit). I wanted to blend two textures and found that this code achieved what I wanted … in this case it renders a light spotlight texture on a floor plane and then I blend a floor texture …
Is this code likely to be the culprite or should I be looking elsewhere ?
Thanks
Andrew
glNewList(fGenList, GL_COMPILE);
glColor3ub(180, 180, 180);
glBindTexture(GL_TEXTURE_2D, TexNames[cSpotLight]);
glBegin(GL_QUADS);
glNormal3f(0.0, 1.0, 0.0);
glTexCoord2f(0.0, 0.0); glVertex3f(-100.0, -17.0, -100.0);
glTexCoord2f(0.0, 1.0); glVertex3f(-100.0, -17.0, 100.0);
glTexCoord2f(1.0, 1.0); glVertex3f( 100.0, -17.0, 100.0);
glTexCoord2f(1.0, 0.0); glVertex3f( 100.0, -17.0, -100.0);
glEnd;
glEnable(GL_BLEND);
glBlendFunc(GL_DST_COLOR, GL_ONE_MINUS_DST_COLOR);
glDepthFunc(GL_EQUAL);
glBindTexture(GL_TEXTURE_2D, TexNames[cCarpet]);
glBegin(GL_QUADS);
glNormal3f( 0.0, 1.0, 0.0);
glTexCoord2f( 0.0, 0.0); glVertex3f(-100.0, -17.0, -100.0);
glTexCoord2f( 0.0, 20.0); glVertex3f(-100.0, -17.0, 100.0);
glTexCoord2f(20.0, 20.0); glVertex3f( 100.0, -17.0, 100.0);
glTexCoord2f(20.0, 0.0); glVertex3f( 100.0, -17.0, -100.0);
glEnd;
glDepthFunc(GL_LESS);
glDisable(GL_BLEND);
glEndList;