I wrote a program which displays a start up screen. Which is basically a quad the size of the screen and a texture applied to it.
It worked perfectly on my old computer, but on my new GF4 machine the pic isnt displayed properly at all. Its a solid color of whatever the first pixel color is (red).
Heres my code:
//read in the startup screen bitmap
if( (input = fopen(“title.raw”, “rt”)) == NULL )
{
exit(0);
}
else
{
//startup_bitmap = (GLubyte *) calloc(786432, sizeof(GLubyte));//512x512x3 bytes
for (row = 0; row < 512; row++)
{
for (column = 0; column < 512; column++)
{
startup_bitmap[row][column][0] = fgetc(input);//fread(startup_bitmap[row][column][0], sizeof(GLubyte), 1, input);
startup_bitmap[row][column][1] = fgetc(input);//fread(startup_bitmap[row][column][1], sizeof(GLubyte), 1, input);
startup_bitmap[row][column][2] = fgetc(input);//fread(startup_bitmap[row][column][2], sizeof(GLubyte), 1, input);
}
}//now create and assign the texs in OpenGL
glGenTextures(1, &StartupTex_Name);
glBindTexture(GL_TEXTURE_2D, StartupTex_Name);
glTexImage2D(GL_TEXTURE_2D, 0, GL_RGB, 512, 512, 0, GL_RGB, GL_UNSIGNED_BYTE, startup_bitmap);glEnable(GL_TEXTURE_2D);
glTexEnvf(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_REPLACE);
glBindTexture(GL_TEXTURE_2D, StartupTex_Name);
glBegin(GL_QUADS);
glTexCoord2f(0.0, 0.0); glVertex2f(0.0, 1.0);
glTexCoord2f(1.0, 0.0); glVertex2f(1.0, 1.0);
glTexCoord2f(1.0, 1.0); glVertex2f(1.0, 0.0);
glTexCoord2f(0.0, 1.0); glVertex2f(0.0, 0.0);
glEnd();
glFlush();
glDisable(GL_TEXTURE_2D);
Am I forgetting something?