glew: add more information about the GLEW initialization. refs #610

This commit is contained in:
Mathieu Virbel 2012-10-29 15:17:06 +01:00
parent 09c917ab78
commit c949a5984c
2 changed files with 11 additions and 1 deletions

View File

@ -75,6 +75,7 @@ void glew_dynamic_binding() {
*/
if (glGenFramebuffers == NULL) {
printf("GL: glGenFramebuffers is NULL, try to detect an extension\n");
printf("GL: available extensions: %s\n", gl_extensions);
if (strstr(gl_extensions, "ARB_framebuffer_object")) {
printf("GL: ARB_framebuffer_object is supported\n");

View File

@ -1570,9 +1570,18 @@ def glViewport(GLint x, GLint y, GLsizei width, GLsizei height):
IF USE_GLEW:
cdef extern from "gl_redirect.h":
int glewInit()
int GLEW_OK
char *glewGetErrorString(int)
void glew_dynamic_binding()
def gl_init_symbols():
glewInit()
cdef int result
cdef bytes error
result = glewInit()
if result != GLEW_OK:
error = glewGetErrorString(result)
print 'GLEW initialization error:', error
else:
print 'GLEW initialization succeeded'
glew_dynamic_binding()
ELSE: