diff options
author | mano-wii <germano.costa@ig.com.br> | 2019-01-02 15:01:46 +0300 |
---|---|---|
committer | mano-wii <germano.costa@ig.com.br> | 2019-01-02 15:01:46 +0300 |
commit | 945007b32e9a30252216398413bff88c103d8667 (patch) | |
tree | d32f5249c0140696368582b7d17066b2e57e20d4 /source/blender/python/gpu/gpu_py.h | |
parent | c862c14339e4c3ccf660153a5589ceb3561112d8 (diff) |
Fix T59773: Raise exception if the gpu module is used in backgound mode.
Instead of crashing, an error message is displayed if a function of the gpu module is called without a GPU context.
Reviewers: brecht, campbellbarton, JacquesLucke, mont29
Subscribers: abdelmatinboulbayam, amir.shehata
Differential Revision: https://developer.blender.org/D4143
Diffstat (limited to 'source/blender/python/gpu/gpu_py.h')
-rw-r--r-- | source/blender/python/gpu/gpu_py.h | 34 |
1 files changed, 34 insertions, 0 deletions
diff --git a/source/blender/python/gpu/gpu_py.h b/source/blender/python/gpu/gpu_py.h new file mode 100644 index 00000000000..d3ee7b56def --- /dev/null +++ b/source/blender/python/gpu/gpu_py.h @@ -0,0 +1,34 @@ +/* + * ***** BEGIN GPL LICENSE BLOCK ***** + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation; either version 2 + * of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software Foundation, + * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + * + * ***** END GPL LICENSE BLOCK ***** + */ + +/** \file blender/python/gpu/gpu_py_api.h + * \ingroup bpygpu + */ + +#ifndef __GPU_PY_H__ +#define __GPU_PY_H__ + +bool bpygpu_is_initialized(void); + +int bpygpu_ParsePrimType(PyObject *o, void *p); + +PyObject *BPyInit_gpu(void); + +#endif /* __GPU_PY_H__ */ |