in my game, almost all of the textures are skewed and some of them are B/W. The code for loading the textures is fine and the following is the code to draw the objects:
glBegin(GL_POLYGON);
glTexCoord2f(0.0f, 0.0f); glVertex3f(bounds[d][0][0] * levelscale, top[d], bounds[d][0][1] * levelscale);
glTexCoord2f(0.0f, repeat[d]); glVertex3f(bounds[d][0][0] * levelscale, bottom[d], bounds[d][0][1] * levelscale);
glTexCoord2f(repeat[d], repeat[d]); glVertex3f(bounds[d][1][0] * levelscale, bottom[d], bounds[d][0][1] * levelscale);
glTexCoord2f(repeat[d], 0.0f); glVertex3f(bounds[d][1][0] * levelscale, top[d], bounds[d][0][1] * levelscale);
glEnd();
glBegin(GL_POLYGON);
glTexCoord2f(0.0f, 0.0f); glVertex3f(bounds[d][1][0] * levelscale, top[d], bounds[d][1][1] * levelscale);
glTexCoord2f(0.0f, repeat[d]); glVertex3f(bounds[d][1][0] * levelscale, bottom[d], bounds[d][1][1] * levelscale);
glTexCoord2f(repeat[d], repeat[d]); glVertex3f(bounds[d][0][0] * levelscale, bottom[d], bounds[d][1][1] * levelscale);
glTexCoord2f(repeat[d], 0.0f); glVertex3f(bounds[d][0][0] * levelscale, top[d], bounds[d][1][1] * levelscale);
glEnd();
glBegin(GL_POLYGON);
glTexCoord2f(0.0f, 0.0f); glVertex3f(bounds[d][0][0] * levelscale, top[d], bounds[d][0][1] * levelscale);
glTexCoord2f(0.0f, repeat[d]); glVertex3f(bounds[d][0][0] * levelscale, bottom[d], bounds[d][0][1] * levelscale);
glTexCoord2f(repeat[d], repeat[d]); glVertex3f(bounds[d][0][0] * levelscale, bottom[d], bounds[d][1][1] * levelscale);
glTexCoord2f(repeat[d], 0.0f); glVertex3f(bounds[d][0][0] * levelscale, top[d], bounds[d][1][1] * levelscale);
glEnd();
glBegin(GL_POLYGON);
glTexCoord2f(0.0f, 0.0f); glVertex3f(bounds[d][1][0] * levelscale, top[d], bounds[d][1][1] * levelscale);
glTexCoord2f(0.0f, repeat[d]); glVertex3f(bounds[d][1][0] * levelscale, bottom[d], bounds[d][1][1] * levelscale);
glTexCoord2f(repeat[d], repeat[d]); glVertex3f(bounds[d][1][0] * levelscale, bottom[d], bounds[d][0][1] * levelscale);
glTexCoord2f(repeat[d], 0.0f); glVertex3f(bounds[d][1][0] * levelscale, top[d], bounds[d][0][1] * levelscale);
glEnd();
repeat[] is an integer