From c949a5984c43d35df7858c0825faf7f523e5e4c2 Mon Sep 17 00:00:00 2001 From: Mathieu Virbel Date: Mon, 29 Oct 2012 15:17:06 +0100 Subject: [PATCH] glew: add more information about the GLEW initialization. refs #610 --- kivy/graphics/gl_redirect.h | 1 + kivy/graphics/opengl.pyx | 11 ++++++++++- 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/kivy/graphics/gl_redirect.h b/kivy/graphics/gl_redirect.h index 35db27dc5..62a7abf64 100644 --- a/kivy/graphics/gl_redirect.h +++ b/kivy/graphics/gl_redirect.h @@ -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"); diff --git a/kivy/graphics/opengl.pyx b/kivy/graphics/opengl.pyx index 65526296c..883ba46c1 100644 --- a/kivy/graphics/opengl.pyx +++ b/kivy/graphics/opengl.pyx @@ -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: