using command glDrawPixels(), but no display...

here is the copy of red guide example,

void makeTexturePic(void)
{
	int i, j, c; 
     
    for (i = 0; i < TEXTUREWIDTH; i++) { 
        for (j = 0; j < TEXTUREHEIGHT; j++) { 
            c = (((i & 0x8) == 0) ^ ((j & 0x8) == 0)) * 255; 
            chessTexture[i][j][0] = (GLubyte) c; 
            chessTexture[i][j][1] = (GLubyte) c; 
            chessTexture[i][j][2] = (GLubyte) c; 
        } 
    } 	
}
void checkDisplay(){
	glClear(GL_COLOR_BUFFER_BIT);
	glDrawPixels(TEXTUREWIDTH,TEXTUREHEIGHT,GL_RGB, GL_UNSIGNED_BYTE,chessTexture);	
        glFlush();
	glutSwapBuffers();
}

int main(int argc,char** argv)
{
	glutInit(&argc,argv);
	glutInitDisplayMode(GLUT_DOUBLE | GLUT_RGBA | GLUT_DEPTH);
	
	glutInitWindowSize(600,600);
	glutInitWindowPosition(100,100);

	glutCreateWindow("GLSL Test : Draw a triangle");
	
	//glutReshapeFunc(reshape1); 
	glutDisplayFunc(checkDisplay);
	
	glutKeyboardFunc(keyboard);

	glutMainLoop();
	
	return 0;
}

but display nothing, what’s matter?

why your function “makeTexturePic()” never used in example?

forget.
here it is,

void checkDisplay(){
	glClear(GL_COLOR_BUFFER_BIT);
makeTexturePic();
	glDrawPixels(TEXTUREWIDTH,TEXTUREHEIGHT,GL_RGB, GL_UNSIGNED_BYTE,chessTexture);	
        glFlush();
	glutSwapBuffers();
}

So it is the example 9.1, which is at
http://www.glprogramming.com/red/chapter09.html

void makeCheckImage(void)
{
int i, j, c;

for (i = 0; i < checkImageHeight; i++) {
for (j = 0; j < checkImageWidth; j++) {
c = ((((i&0x8)==0)^((j&0x8))==0))*255;
checkImage[i][j][0] = (GLubyte) c;
checkImage[i][j][1] = (GLubyte) c;
checkImage[i][j][2] = (GLubyte) c;
checkImage[i][j][3] = (GLubyte) 255;
}
}
}…

In this example, there is a typo at
c = ((((i&0x8)==0)^((j&0x8))==0))*255; //extra ) error.

ater delete it, but show only one b/w box, what’s matter?

image appears at last, but only one side.
continue…

as if the order of the statements can not be changed,
glGenTextures(1, &achTexture);
glBindTexture(GL_TEXTURE_2D, achTexture);
glTexImage2D(GL_TEXTURE_2D,0,3,TEXTUREWIDTH,
TEXTUREHEIGHT,0,GL_RGB,GL_UNSIGNED_BYTE,chessTexture);
glPixelStorei(GL_UNPACK_ALIGNMENT,1);

else it will be only one side appearance.