This commit is contained in:
Kovid Goyal 2017-02-24 15:56:04 +05:30
parent 54e79a6901
commit 892d3df6eb

View File

@ -141,14 +141,14 @@ _glewInit(PyObject UNUSED *self) {
PyErr_Format(PyExc_RuntimeError, "GLEW init failed: %s", glewGetErrorString(err)); PyErr_Format(PyExc_RuntimeError, "GLEW init failed: %s", glewGetErrorString(err));
return NULL; return NULL;
} }
if(!GLEW_ARB_texture_storage) { #define ARB_TEST(name) \
PyErr_SetString(PyExc_RuntimeError, "OpenGL is missing the required ARB_texture_storage extension"); if (!GLEW_ARB_##name) { \
return NULL; PyErr_Format(PyExc_RuntimeError, "The OpenGL driver on this system is missing the required extension: ARB_%s", #name); \
} return NULL; \
if(!GLEW_ARB_texture_buffer_object_rgb32) {
PyErr_SetString(PyExc_RuntimeError, "OpenGL is missing the required ARB_texture_buffer_object_rgb32 extension");
return NULL;
} }
ARB_TEST(texture_storage);
ARB_TEST(texture_buffer_object_rgb32);
#undef ARB_TEST
#endif #endif
Py_RETURN_NONE; Py_RETURN_NONE;
} }