This example is not getting the black line, but is repeating, top line of texels is on the bottome, bottome line of texels is on the top… etc.
void loadBitmap()
{
// … file read
//Build A Texture From The Data
unsigned int ID;
glGenTextures(1, &ID); //Generate OpenGL texture IDs
glBindTexture(GL_TEXTURE_2D, ID); //Bind the texture to a texture object
glTexParameterf(GL_TEXTURE_1D, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE); //Filtering for if texture is bigger than should be
glTexParameterf(GL_TEXTURE_1D, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE); //Filtering for if texture is bigger than should be
glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR_MIPMAP_LINEAR); //Filtering for if texture is bigger than should be
glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR_MIPMAP_LINEAR); //Filtering for if texture is smaller than it should be
gluBuild2DMipmaps(GL_TEXTURE_2D, bpp, width, height, GL_RGB, GL_UNSIGNED_BYTE, data);
}
// Drawing function
void display()
{
glClear(GL_COLOR_BUFFER_BIT);
glEnable(GL_TEXTURE_1D);
glEnable(GL_TEXTURE_2D);
glBegin(GL_QUADS);
glColor3f(1.0f, 1.0f, 1.0f);
glTexCoord2i(0,0);
glVertex2f(-0.95f,-0.95f);
glColor3f(1.0f, 1.0f, 1.0f);
glTexCoord2i(1,0);
glVertex2f(0.95f,-0.95f);
glColor3f(1.0f, 1.0f, 1.0f);
glTexCoord2i(1,1);
glVertex2f(0.95f,0.95f);
glColor3f(1.0f, 1.0f, 1.0f);
glTexCoord2i(0,1);
glVertex2f(-0.95f,0.95f);
glEnd();
glFlush();
}