Cleanup: Move some utilities to 'gpu_py.h'
This commit is contained in:
@@ -23,6 +23,7 @@
|
||||
|
||||
#include <Python.h>
|
||||
|
||||
#include "GPU_init_exit.h"
|
||||
#include "GPU_primitive.h"
|
||||
#include "GPU_texture.h"
|
||||
|
||||
@@ -58,3 +59,21 @@ struct PyC_StringEnumItems bpygpu_dataformat_items[] = {
|
||||
{0, NULL},
|
||||
};
|
||||
/** \} */
|
||||
|
||||
/* -------------------------------------------------------------------- */
|
||||
/** \name Utilities
|
||||
* \{ */
|
||||
|
||||
bool bpygpu_is_init_or_error(void)
|
||||
{
|
||||
if (!GPU_is_init()) {
|
||||
PyErr_SetString(PyExc_SystemError,
|
||||
"GPU functions for drawing are not available in background mode");
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
/** \} */
|
||||
|
||||
Reference in New Issue
Block a user