mirror of
https://github.com/kovidgoyal/kitty.git
synced 2024-11-10 13:04:03 +03:00
DRYer
This commit is contained in:
parent
54e79a6901
commit
892d3df6eb
14
kitty/gl.h
14
kitty/gl.h
@ -141,14 +141,14 @@ _glewInit(PyObject UNUSED *self) {
|
||||
PyErr_Format(PyExc_RuntimeError, "GLEW init failed: %s", glewGetErrorString(err));
|
||||
return NULL;
|
||||
}
|
||||
if(!GLEW_ARB_texture_storage) {
|
||||
PyErr_SetString(PyExc_RuntimeError, "OpenGL is missing the required ARB_texture_storage extension");
|
||||
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;
|
||||
#define ARB_TEST(name) \
|
||||
if (!GLEW_ARB_##name) { \
|
||||
PyErr_Format(PyExc_RuntimeError, "The OpenGL driver on this system is missing the required extension: ARB_%s", #name); \
|
||||
return NULL; \
|
||||
}
|
||||
ARB_TEST(texture_storage);
|
||||
ARB_TEST(texture_buffer_object_rgb32);
|
||||
#undef ARB_TEST
|
||||
#endif
|
||||
Py_RETURN_NONE;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user