progs/egl: glGenTextures is called too early in xeglbindtex.
authorChia-I Wu <olvaffe@gmail.com>
Sat, 2 Jan 2010 13:57:16 +0000 (21:57 +0800)
committerChia-I Wu <olvaffe@gmail.com>
Tue, 12 Jan 2010 02:55:35 +0000 (10:55 +0800)
It should be called after eglMakeCurrent.

Signed-off-by: Chia-I Wu <olvaffe@gmail.com>
progs/egl/xeglbindtex.c

index 7e35534f8dd1379dd43052c373b00d168b678892..de0ede92ca4458923dc50a47040cdbce2e20a600 100644 (file)
@@ -79,8 +79,6 @@ make_pbuffer(int width, int height)
       printf("failed to allocate pbuffer\n");
       exit(1);
    }
-
-   glGenTextures(1, &tex_pbuf);
 }
 
 static void
@@ -114,6 +112,8 @@ use_pbuffer(void)
       glTranslatef(0.0, 0.0, -5.0);
 
       glClearColor(0.2, 0.2, 0.2, 0.0);
+
+      glGenTextures(1, &tex_pbuf);
    }
 }