Blender  V3.3
gpu_py_types.c
Go to the documentation of this file.
1 /* SPDX-License-Identifier: GPL-2.0-or-later */
2 
10 #include <Python.h>
11 
12 #include "../generic/py_capi_utils.h"
13 
14 #include "gpu_py_types.h" /* own include */
15 
16 /* -------------------------------------------------------------------- */
20 static struct PyModuleDef pygpu_types_module_def = {
21  PyModuleDef_HEAD_INIT,
22  .m_name = "gpu.types",
23 };
24 
25 PyObject *bpygpu_types_init(void)
26 {
27  PyObject *submodule;
28 
29  submodule = PyModule_Create(&pygpu_types_module_def);
30 
31  if (PyType_Ready(&BPyGPU_BufferType) < 0) {
32  return NULL;
33  }
34  if (PyType_Ready(&BPyGPUVertFormat_Type) < 0) {
35  return NULL;
36  }
37  if (PyType_Ready(&BPyGPUVertBuf_Type) < 0) {
38  return NULL;
39  }
40  if (PyType_Ready(&BPyGPUIndexBuf_Type) < 0) {
41  return NULL;
42  }
43  if (PyType_Ready(&BPyGPUBatch_Type) < 0) {
44  return NULL;
45  }
46  if (PyType_Ready(&BPyGPUOffScreen_Type) < 0) {
47  return NULL;
48  }
49  if (PyType_Ready(&BPyGPUShader_Type) < 0) {
50  return NULL;
51  }
52  if (PyType_Ready(&BPyGPUTexture_Type) < 0) {
53  return NULL;
54  }
55  if (PyType_Ready(&BPyGPUFrameBuffer_Type) < 0) {
56  return NULL;
57  }
58  if (PyType_Ready(&BPyGPUUniformBuf_Type) < 0) {
59  return NULL;
60  }
61  if (PyType_Ready(&BPyGPUShaderCreateInfo_Type) < 0) {
62  return NULL;
63  }
64  if (PyType_Ready(&BPyGPUStageInterfaceInfo_Type) < 0) {
65  return NULL;
66  }
67 
68  PyModule_AddType(submodule, &BPyGPU_BufferType);
69  PyModule_AddType(submodule, &BPyGPUVertFormat_Type);
70  PyModule_AddType(submodule, &BPyGPUVertBuf_Type);
71  PyModule_AddType(submodule, &BPyGPUIndexBuf_Type);
72  PyModule_AddType(submodule, &BPyGPUBatch_Type);
73  PyModule_AddType(submodule, &BPyGPUOffScreen_Type);
74  PyModule_AddType(submodule, &BPyGPUShader_Type);
75  PyModule_AddType(submodule, &BPyGPUTexture_Type);
76  PyModule_AddType(submodule, &BPyGPUFrameBuffer_Type);
77  PyModule_AddType(submodule, &BPyGPUUniformBuf_Type);
78  PyModule_AddType(submodule, &BPyGPUShaderCreateInfo_Type);
79  PyModule_AddType(submodule, &BPyGPUStageInterfaceInfo_Type);
80 
81  return submodule;
82 }
83 
PyTypeObject BPyGPUBatch_Type
Definition: gpu_py_batch.c:307
PyTypeObject BPyGPU_BufferType
PyTypeObject BPyGPUIndexBuf_Type
PyTypeObject BPyGPUFrameBuffer_Type
PyTypeObject BPyGPUOffScreen_Type
PyTypeObject BPyGPUShader_Type
PyTypeObject BPyGPUStageInterfaceInfo_Type
PyTypeObject BPyGPUShaderCreateInfo_Type
PyTypeObject BPyGPUTexture_Type
static struct PyModuleDef pygpu_types_module_def
Definition: gpu_py_types.c:20
PyObject * bpygpu_types_init(void)
Definition: gpu_py_types.c:25
PyTypeObject BPyGPUUniformBuf_Type
PyTypeObject BPyGPUVertBuf_Type
PyTypeObject BPyGPUVertFormat_Type