Changeset View
Changeset View
Standalone View
Standalone View
source/blender/python/gpu/gpu_py_batch.c
| Show All 38 Lines | |||||
| #include "BKE_global.h" | #include "BKE_global.h" | ||||
| #include "GPU_batch.h" | #include "GPU_batch.h" | ||||
| #include "../mathutils/mathutils.h" | #include "../mathutils/mathutils.h" | ||||
| #include "../generic/py_capi_utils.h" | #include "../generic/py_capi_utils.h" | ||||
| #include "gpu_py_primitive.h" | #include "gpu_py.h" | ||||
| #include "gpu_py_shader.h" | #include "gpu_py_shader.h" | ||||
| #include "gpu_py_vertex_buffer.h" | #include "gpu_py_vertex_buffer.h" | ||||
| #include "gpu_py_element.h" | #include "gpu_py_element.h" | ||||
| #include "gpu_py_batch.h" /* own include */ | #include "gpu_py_batch.h" /* own include */ | ||||
| /* -------------------------------------------------------------------- */ | /* -------------------------------------------------------------------- */ | ||||
| /** \name Utility Functions | /** \name Utility Functions | ||||
| Show All 24 Lines | static PyObject *bpygpu_Batch_new(PyTypeObject *UNUSED(type), PyObject *args, PyObject *kwds) | ||||
| struct { | struct { | ||||
| GPUPrimType type_id; | GPUPrimType type_id; | ||||
| BPyGPUVertBuf *py_vertbuf; | BPyGPUVertBuf *py_vertbuf; | ||||
| BPyGPUIndexBuf *py_indexbuf; | BPyGPUIndexBuf *py_indexbuf; | ||||
| } params = {GPU_PRIM_NONE, NULL, NULL}; | } params = {GPU_PRIM_NONE, NULL, NULL}; | ||||
| static const char *_keywords[] = {"type", "buf", "elem", NULL}; | static const char *_keywords[] = {"type", "buf", "elem", NULL}; | ||||
| static _PyArg_Parser _parser = {"|$O&O!O!:GPUBatch.__new__", _keywords, 0}; | static _PyArg_Parser _parser = {"|$O&O!O!:GPUBatch.__new__", _keywords, 0}; | ||||
| if (!_PyArg_ParseTupleAndKeywordsFast( | if (!bpygpu_is_initialized() || | ||||
| !_PyArg_ParseTupleAndKeywordsFast( | |||||
| args, kwds, &_parser, | args, kwds, &_parser, | ||||
| bpygpu_ParsePrimType, ¶ms.type_id, | bpygpu_ParsePrimType, ¶ms.type_id, | ||||
| &BPyGPUVertBuf_Type, ¶ms.py_vertbuf, | &BPyGPUVertBuf_Type, ¶ms.py_vertbuf, | ||||
| &BPyGPUIndexBuf_Type, ¶ms.py_indexbuf)) | &BPyGPUIndexBuf_Type, ¶ms.py_indexbuf)) | ||||
| { | { | ||||
| return NULL; | return NULL; | ||||
| } | } | ||||
| ▲ Show 20 Lines • Show All 288 Lines • Show Last 20 Lines | |||||