设计并显示矩形位图阵列

#include #include GLsizei winWidth = 400, winHeight = 400; GLubyte bitShape[20]={0x1c,0x00,0x1c,0x00,0x1c, 0x00, 0x1c, 0x00, 0x1c, 0x00,0xff, 0x80, 0x7f, 0x00, 0x3e, 0x00, 0x1c, 0x00, 0x08, 0x00}; void init(void) { glClearColor(0.0,0.0,0.0,0.0); glMatrixMode(GL_PROJECTION); glLoadIdentity(); gluOrtho2D(0.0,300.0,0.0,300.0); } void display(void) { glClear(GL_COLOR_BUFFER_BIT); glMatrixMode(GL_MODELVIEW); glColor3f(1.0,1.0,1.0); glPixelStorei(GL_UNPACK_ALIGNMENT,1); glRasterPos2i(100,100); glBitmap(9,10,0.0,0.0,20.0,15.0,bitShape); glFlush(); } void main(int argc,char**argv) { glutInit(&argc,argv); glutInitDisplayMode(GLUT_SINGLE|GLUT_RGB); glutInitWindowPosition(100,100); glutInitWindowSize(winWidth,winHeight); glutCreateWindow("Reshape-Function&Display-List Example"); init(); glutDisplayFunc(display); glutMainLoop(); }  

你可能感兴趣的:(alignment,buffer,c)