#include #include #include #include #define WINDSIZEX 100 #define WINDSIZEY 100 void init(void) { glEnable(GL_DEPTH_TEST); glDepthFunc(GL_ALWAYS); } static void test(void) { GLfloat srcPixels[32*32], results[32*32]; int i; glDrawBuffer(GL_NONE); glRasterPos2f(0.25, 0.25); for (i=0; i<1024; i++) srcPixels[i] = 0.8; glDrawPixels(32, 32, GL_DEPTH_COMPONENT, GL_FLOAT, srcPixels); printf("PASS!\n"); exit(0); } void display(void) { glViewport(0, 0, WINDSIZEX, WINDSIZEY); glMatrixMode(GL_PROJECTION); glLoadIdentity(); gluOrtho2D(0, WINDSIZEX, 0, WINDSIZEY); glMatrixMode(GL_MODELVIEW); glLoadIdentity(); test(); } int main(int argc, char** argv) { glutInit(&argc, argv); glutInitDisplayMode(GLUT_SINGLE | GLUT_RGB | GLUT_DEPTH); glutInitWindowSize(WINDSIZEX, WINDSIZEY); glutInitWindowPosition(100, 100); glutCreateWindow(argv[0]); init(); glutDisplayFunc(display); glutMainLoop(); return 0; }