#include #include #include #include #include #define WINDSIZEX 100 #define WINDSIZEY 100 void init (void) { int i; GLfloat white[] = { 1.0, 1.0, 1.0, 1.0 }; glClearColor (0.0, 0.0, 0.0, 1.0); glColor4fv (white); glDisable (GL_DITHER); // Check if GL_EXT_framebuffer_object is supported if (!strstr (glGetString (GL_EXTENSIONS), "GL_EXT_framebuffer_object")) { printf ("GL_EXT_framebuffer_object is not supported\n"); exit(0); } else { printf ("GL_EXT_framebuffer_object is supported\n"); } } static void test (void) { GLuint fb_binding; glGetIntegerv(GL_FRAMEBUFFER_BINDING_EXT, (GLint *) & fb_binding); printf("fb_binding = %d\n", fb_binding); } void display (void) { glMatrixMode (GL_PROJECTION); glLoadIdentity (); gluOrtho2D (0, WINDSIZEX, 0, WINDSIZEX); test (); } int main (int argc, char **argv) { glutInit (&argc, argv); glutInitDisplayMode (GLUT_SINGLE | GLUT_RGBA); glutInitWindowSize (WINDSIZEX, WINDSIZEY); glutInitWindowPosition (100, 100); glutCreateWindow (argv[0]); init (); glutDisplayFunc (display); glutMainLoop (); return 0; }