diff options
author | mano-wii <germano.costa@ig.com.br> | 2018-09-06 03:10:42 +0300 |
---|---|---|
committer | mano-wii <germano.costa@ig.com.br> | 2018-09-06 03:15:44 +0300 |
commit | 6d04e48539ce50f0de9cc73a36e7733aee608773 (patch) | |
tree | ff2784a4b1e31773610fedc78a3efda625a23bc6 /source/blender/python/gpu/gpu_py_types.h | |
parent | b0602483249d1184f2672cd5d5578955560335b5 (diff) |
Join the python modules `gpu` and `_gpu` into one.
Maybe it's still early to set the new drawing api for python.
But joining these two modules is an initial step.
```
>>> gpu.
matrix
select
types
```
```
>>> gpu.types.GPU
Batch(
OffScreen(
VertBuf(
VertFormat(
```
The creation of a new offscreen object is now done by the `GPUOffscreen.__new__` method.
Reviewers: campbellbarton, dfelinto
Reviewed By: campbellbarton, dfelinto
Tags: #bf_blender_2.8
Differential Revision: https://developer.blender.org/D3667
Diffstat (limited to 'source/blender/python/gpu/gpu_py_types.h')
-rw-r--r-- | source/blender/python/gpu/gpu_py_types.h | 42 |
1 files changed, 5 insertions, 37 deletions
diff --git a/source/blender/python/gpu/gpu_py_types.h b/source/blender/python/gpu/gpu_py_types.h index f736a8f749a..0b1a62b78e9 100644 --- a/source/blender/python/gpu/gpu_py_types.h +++ b/source/blender/python/gpu/gpu_py_types.h @@ -19,49 +19,17 @@ */ /** \file blender/python/gpu/gpu_py_types.h - * \ingroup pygpu + * \ingroup bpygpu */ #ifndef __GPU_PY_TYPES_H__ #define __GPU_PY_TYPES_H__ -#include "BLI_compiler_attrs.h" - -#define USE_GPU_PY_REFERENCES - -extern PyTypeObject BPyGPUVertFormat_Type; -extern PyTypeObject BPyGPUVertBuf_Type; -extern PyTypeObject BPyGPUBatch_Type; - -#define BPyGPUVertFormat_Check(v) (Py_TYPE(v) == &BPyGPUVertFormat_Type) -#define BPyGPUVertBuf_Check(v) (Py_TYPE(v) == &BPyGPUVertBuf_Type) -#define BPyGPUBatch_Check(v) (Py_TYPE(v) == &BPyGPUBatch_Type) - -typedef struct BPyGPUVertFormat { - PyObject_VAR_HEAD - struct GPUVertFormat fmt; -} BPyGPUVertFormat; - -typedef struct BPyGPUVertBuf { - PyObject_VAR_HEAD - /* The buf is owned, we may support thin wrapped batches later. */ - struct GPUVertBuf *buf; -} BPyGPUVertBuf; - -typedef struct BPyGPUBatch { - PyObject_VAR_HEAD - /* The batch is owned, we may support thin wrapped batches later. */ - struct GPUBatch *batch; -#ifdef USE_GPU_PY_REFERENCES - /* Just to keep a user to prevent freeing buf's we're using */ - PyObject *references; -#endif -} BPyGPUBatch; +#include "gpu_py_vertex_format.h" +#include "gpu_py_vertex_buffer.h" +#include "gpu_py_batch.h" +#include "gpu_py_offscreen.h" PyObject *BPyInit_gpu_types(void); -PyObject *BPyGPUVertFormat_CreatePyObject(struct GPUVertFormat *fmt); -PyObject *BPyGPUVertBuf_CreatePyObject(struct GPUVertBuf *vbo) ATTR_NONNULL(1); -PyObject *BPyGPUBatch_CreatePyObject(struct GPUBatch *batch) ATTR_NONNULL(1); - #endif /* __GPU_PY_TYPES_H__ */ |