diff options
Diffstat (limited to 'source/blender/python/gpu')
-rw-r--r-- | source/blender/python/gpu/gpu_py_api.c | 4 | ||||
-rw-r--r-- | source/blender/python/gpu/gpu_py_api.h | 11 | ||||
-rw-r--r-- | source/blender/python/gpu/gpu_py_batch.c | 9 | ||||
-rw-r--r-- | source/blender/python/gpu/gpu_py_batch.h | 5 | ||||
-rw-r--r-- | source/blender/python/gpu/gpu_py_element.h | 5 | ||||
-rw-r--r-- | source/blender/python/gpu/gpu_py_matrix.h | 5 | ||||
-rw-r--r-- | source/blender/python/gpu/gpu_py_offscreen.h | 5 | ||||
-rw-r--r-- | source/blender/python/gpu/gpu_py_select.h | 5 | ||||
-rw-r--r-- | source/blender/python/gpu/gpu_py_shader.h | 5 | ||||
-rw-r--r-- | source/blender/python/gpu/gpu_py_types.h | 5 | ||||
-rw-r--r-- | source/blender/python/gpu/gpu_py_vertex_buffer.h | 5 | ||||
-rw-r--r-- | source/blender/python/gpu/gpu_py_vertex_format.h | 5 |
12 files changed, 18 insertions, 51 deletions
diff --git a/source/blender/python/gpu/gpu_py_api.c b/source/blender/python/gpu/gpu_py_api.c index 1379c0e557a..da7674eb7f9 100644 --- a/source/blender/python/gpu/gpu_py_api.c +++ b/source/blender/python/gpu/gpu_py_api.c @@ -43,9 +43,9 @@ /** \name Utils to invalidate functions * \{ */ -bool bpygpu_is_initialized_or_error(void) +bool bpygpu_is_init_or_error(void) { - if (!GPU_is_initialized()) { + if (!GPU_is_init()) { PyErr_SetString(PyExc_SystemError, "GPU functions for drawing are not available in background mode"); diff --git a/source/blender/python/gpu/gpu_py_api.h b/source/blender/python/gpu/gpu_py_api.h index e278bb63a49..b8f0cde129f 100644 --- a/source/blender/python/gpu/gpu_py_api.h +++ b/source/blender/python/gpu/gpu_py_api.h @@ -18,23 +18,20 @@ * \ingroup bpygpu */ -#ifndef __GPU_PY_API_H__ -#define __GPU_PY_API_H__ +#pragma once int bpygpu_ParsePrimType(PyObject *o, void *p); PyObject *BPyInit_gpu(void); -bool bpygpu_is_initialized_or_error(void); +bool bpygpu_is_init_or_error(void); #define BPYGPU_IS_INIT_OR_ERROR_OBJ \ - if (UNLIKELY(!bpygpu_is_initialized_or_error())) { \ + if (UNLIKELY(!bpygpu_is_init_or_error())) { \ return NULL; \ } \ ((void)0) #define BPYGPU_IS_INIT_OR_ERROR_INT \ - if (UNLIKELY(!bpygpu_is_initialized_or_error())) { \ + if (UNLIKELY(!bpygpu_is_init_or_error())) { \ return -1; \ } \ ((void)0) - -#endif /* __GPU_PY_API_H__ */ diff --git a/source/blender/python/gpu/gpu_py_batch.c b/source/blender/python/gpu/gpu_py_batch.c index b3df991cf12..01bccc57c7a 100644 --- a/source/blender/python/gpu/gpu_py_batch.c +++ b/source/blender/python/gpu/gpu_py_batch.c @@ -184,8 +184,7 @@ static PyObject *bpygpu_Batch_program_set(BPyGPUBatch *self, BPyGPUShader *py_sh } GPUShader *shader = py_shader->shader; - GPU_batch_program_set( - self->batch, GPU_shader_get_program(shader), GPU_shader_get_interface(shader)); + GPU_batch_set_shader(self->batch, shader); #ifdef USE_GPU_PY_REFERENCES /* Remove existing user (if any), hold new user. */ @@ -223,15 +222,13 @@ static PyObject *bpygpu_Batch_draw(BPyGPUBatch *self, PyObject *args) if (!PyArg_ParseTuple(args, "|O!:GPUBatch.draw", &BPyGPUShader_Type, &py_program)) { return NULL; } - else if (py_program == NULL) { + if (py_program == NULL) { if (!bpygpu_batch_is_program_or_error(self)) { return NULL; } } else if (self->batch->program != GPU_shader_get_program(py_program->shader)) { - GPU_batch_program_set(self->batch, - GPU_shader_get_program(py_program->shader), - GPU_shader_get_interface(py_program->shader)); + GPU_batch_set_shader(self->batch, py_program->shader); } GPU_batch_draw(self->batch); diff --git a/source/blender/python/gpu/gpu_py_batch.h b/source/blender/python/gpu/gpu_py_batch.h index 1e916afcc2e..7c882eab8fc 100644 --- a/source/blender/python/gpu/gpu_py_batch.h +++ b/source/blender/python/gpu/gpu_py_batch.h @@ -18,8 +18,7 @@ * \ingroup bpygpu */ -#ifndef __GPU_PY_BATCH_H__ -#define __GPU_PY_BATCH_H__ +#pragma once #include "BLI_compiler_attrs.h" @@ -40,5 +39,3 @@ typedef struct BPyGPUBatch { } BPyGPUBatch; PyObject *BPyGPUBatch_CreatePyObject(struct GPUBatch *batch) ATTR_NONNULL(1); - -#endif /* __GPU_PY_BATCH_H__ */ diff --git a/source/blender/python/gpu/gpu_py_element.h b/source/blender/python/gpu/gpu_py_element.h index 055c9d54ecf..a8e22aae15a 100644 --- a/source/blender/python/gpu/gpu_py_element.h +++ b/source/blender/python/gpu/gpu_py_element.h @@ -18,8 +18,7 @@ * \ingroup bpygpu */ -#ifndef __GPU_PY_ELEMENT_H__ -#define __GPU_PY_ELEMENT_H__ +#pragma once extern PyTypeObject BPyGPUIndexBuf_Type; @@ -30,5 +29,3 @@ typedef struct BPyGPUIndexBuf { } BPyGPUIndexBuf; PyObject *BPyGPUIndexBuf_CreatePyObject(struct GPUIndexBuf *elem); - -#endif /* __GPU_PY_ELEMENT_H__ */ diff --git a/source/blender/python/gpu/gpu_py_matrix.h b/source/blender/python/gpu/gpu_py_matrix.h index cf187dee002..38a7f398b30 100644 --- a/source/blender/python/gpu/gpu_py_matrix.h +++ b/source/blender/python/gpu/gpu_py_matrix.h @@ -18,9 +18,6 @@ * \ingroup bpygpu */ -#ifndef __GPU_PY_MATRIX_H__ -#define __GPU_PY_MATRIX_H__ +#pragma once PyObject *BPyInit_gpu_matrix(void); - -#endif /* __GPU_PY_MATRIX_H__ */ diff --git a/source/blender/python/gpu/gpu_py_offscreen.h b/source/blender/python/gpu/gpu_py_offscreen.h index 61d7bd82abc..efe5b57b22e 100644 --- a/source/blender/python/gpu/gpu_py_offscreen.h +++ b/source/blender/python/gpu/gpu_py_offscreen.h @@ -18,8 +18,7 @@ * \ingroup bpygpu */ -#ifndef __GPU_PY_OFFSCREEN_H__ -#define __GPU_PY_OFFSCREEN_H__ +#pragma once #include "BLI_compiler_attrs.h" @@ -33,5 +32,3 @@ typedef struct BPyGPUOffScreen { } BPyGPUOffScreen; PyObject *BPyGPUOffScreen_CreatePyObject(struct GPUOffScreen *ofs) ATTR_NONNULL(1); - -#endif /* __GPU_PY_OFFSCREEN_H__ */ diff --git a/source/blender/python/gpu/gpu_py_select.h b/source/blender/python/gpu/gpu_py_select.h index 814b6028da1..857cd7bb7f8 100644 --- a/source/blender/python/gpu/gpu_py_select.h +++ b/source/blender/python/gpu/gpu_py_select.h @@ -18,9 +18,6 @@ * \ingroup bpygpu */ -#ifndef __GPU_PY_SELECT_H__ -#define __GPU_PY_SELECT_H__ +#pragma once PyObject *BPyInit_gpu_select(void); - -#endif /* __GPU_PY_SELECT_H__ */ diff --git a/source/blender/python/gpu/gpu_py_shader.h b/source/blender/python/gpu/gpu_py_shader.h index 92873753039..ee26c26acd4 100644 --- a/source/blender/python/gpu/gpu_py_shader.h +++ b/source/blender/python/gpu/gpu_py_shader.h @@ -18,8 +18,7 @@ * \ingroup bpygpu */ -#ifndef __GPU_PY_SHADER_H__ -#define __GPU_PY_SHADER_H__ +#pragma once extern PyTypeObject BPyGPUShader_Type; @@ -32,5 +31,3 @@ typedef struct BPyGPUShader { PyObject *BPyGPUShader_CreatePyObject(struct GPUShader *shader, bool is_builtin); PyObject *BPyInit_gpu_shader(void); - -#endif /* __GPU_PY_SHADER_H__ */ diff --git a/source/blender/python/gpu/gpu_py_types.h b/source/blender/python/gpu/gpu_py_types.h index d8048225604..56f73b8a504 100644 --- a/source/blender/python/gpu/gpu_py_types.h +++ b/source/blender/python/gpu/gpu_py_types.h @@ -18,8 +18,7 @@ * \ingroup bpygpu */ -#ifndef __GPU_PY_TYPES_H__ -#define __GPU_PY_TYPES_H__ +#pragma once #include "gpu_py_batch.h" #include "gpu_py_element.h" @@ -29,5 +28,3 @@ #include "gpu_py_vertex_format.h" PyObject *BPyInit_gpu_types(void); - -#endif /* __GPU_PY_TYPES_H__ */ diff --git a/source/blender/python/gpu/gpu_py_vertex_buffer.h b/source/blender/python/gpu/gpu_py_vertex_buffer.h index b7124d245a9..41791a35e6e 100644 --- a/source/blender/python/gpu/gpu_py_vertex_buffer.h +++ b/source/blender/python/gpu/gpu_py_vertex_buffer.h @@ -18,8 +18,7 @@ * \ingroup bpygpu */ -#ifndef __GPU_PY_VERTEX_BUFFER_H__ -#define __GPU_PY_VERTEX_BUFFER_H__ +#pragma once #include "BLI_compiler_attrs.h" @@ -34,5 +33,3 @@ typedef struct BPyGPUVertBuf { } BPyGPUVertBuf; PyObject *BPyGPUVertBuf_CreatePyObject(struct GPUVertBuf *vbo) ATTR_NONNULL(1); - -#endif /* __GPU_PY_VERTEX_BUFFER_H__ */ diff --git a/source/blender/python/gpu/gpu_py_vertex_format.h b/source/blender/python/gpu/gpu_py_vertex_format.h index 8ef466aa918..54d090e2923 100644 --- a/source/blender/python/gpu/gpu_py_vertex_format.h +++ b/source/blender/python/gpu/gpu_py_vertex_format.h @@ -18,8 +18,7 @@ * \ingroup bpygpu */ -#ifndef __GPU_PY_VERTEX_FORMAT_H__ -#define __GPU_PY_VERTEX_FORMAT_H__ +#pragma once #include "GPU_vertex_format.h" @@ -32,5 +31,3 @@ typedef struct BPyGPUVertFormat { } BPyGPUVertFormat; PyObject *BPyGPUVertFormat_CreatePyObject(struct GPUVertFormat *fmt); - -#endif /* __GPU_PY_VERTEX_FORMAT_H__ */ |