Blender
V3.3
|
#include <Python.h>
#include "BLI_utildefines.h"
#include "GPU_batch.h"
#include "../generic/py_capi_utils.h"
#include "gpu_py.h"
#include "gpu_py_element.h"
#include "gpu_py_shader.h"
#include "gpu_py_vertex_buffer.h"
#include "gpu_py_batch.h"
Go to the source code of this file.
Functions | |
Utility Functions | |
static bool | pygpu_batch_is_program_or_error (BPyGPUBatch *self) |
Public API | |
PyObject * | BPyGPUBatch_CreatePyObject (GPUBatch *batch) |
GPUBatch Type | |
static struct PyMethodDef | pygpu_batch__tp_methods [] |
PyTypeObject | BPyGPUBatch_Type |
static PyObject * | pygpu_batch__tp_new (PyTypeObject *UNUSED(type), PyObject *args, PyObject *kwds) |
PyDoc_STRVAR (pygpu_batch_vertbuf_add_doc, ".. method:: vertbuf_add(buf)\n" "\n" " Add another vertex buffer to the Batch.\n" " It is not possible to add more vertices to the batch using this method.\n" " Instead it can be used to add more attributes to the existing vertices.\n" " A good use case would be when you have a separate\n" " vertex buffer for vertex positions and vertex normals.\n" " Current a batch can have at most " STRINGIFY(GPU_BATCH_VBO_MAX_LEN) " vertex buffers.\n" "\n" " :param buf: The vertex buffer that will be added to the batch.\n" " :type buf: :class:`gpu.types.GPUVertBuf`\n") | |
static PyObject * | pygpu_batch_vertbuf_add (BPyGPUBatch *self, BPyGPUVertBuf *py_buf) |
PyDoc_STRVAR (pygpu_batch_program_set_doc, ".. method:: program_set(program)\n" "\n" " Assign a shader to this batch that will be used for drawing when not overwritten later.\n" " Note: This method has to be called in the draw context that the batch will be drawn in.\n" " This function does not need to be called when you always\n" " set the shader when calling :meth:`gpu.types.GPUBatch.draw`.\n" "\n" " :param program: The program/shader the batch will use in future draw calls.\n" " :type program: :class:`gpu.types.GPUShader`\n") | |
static PyObject * | pygpu_batch_program_set (BPyGPUBatch *self, BPyGPUShader *py_shader) |
PyDoc_STRVAR (pygpu_batch_draw_doc, ".. method:: draw(program=None)\n" "\n" " Run the drawing program with the parameters assigned to the batch.\n" "\n" " :param program: Program that performs the drawing operations.\n" " If ``None`` is passed, the last program set to this batch will run.\n" " :type program: :class:`gpu.types.GPUShader`\n") | |
static PyObject * | pygpu_batch_draw (BPyGPUBatch *self, PyObject *args) |
static PyObject * | pygpu_batch_program_use_begin (BPyGPUBatch *self) |
static PyObject * | pygpu_batch_program_use_end (BPyGPUBatch *self) |
static int | pygpu_batch__tp_traverse (BPyGPUBatch *self, visitproc visit, void *arg) |
static int | pygpu_batch__tp_clear (BPyGPUBatch *self) |
static void | pygpu_batch__tp_dealloc (BPyGPUBatch *self) |
PyDoc_STRVAR (pygpu_batch__tp_doc, ".. class:: GPUBatch(type, buf, elem=None)\n" "\n" " Reusable container for drawable geometry.\n" "\n" " :arg type: The primitive type of geometry to be drawn.\n" " Possible values are `POINTS`, `LINES`, `TRIS`, `LINE_STRIP`, `LINE_LOOP`, `TRI_STRIP`, " "`TRI_FAN`, `LINES_ADJ`, `TRIS_ADJ` and `LINE_STRIP_ADJ`.\n" " :type type: str\n" " :arg buf: Vertex buffer containing all or some of the attributes required for drawing.\n" " :type buf: :class:`gpu.types.GPUVertBuf`\n" " :arg elem: An optional index buffer.\n" " :type elem: :class:`gpu.types.GPUIndexBuf`\n") | |
This file defines the off-screen functionalities of the 'gpu' module used for off-screen OpenGL rendering.
bpygpu_
for local API.BPyGPU
for public API. Definition in file gpu_py_batch.c.
PyObject* BPyGPUBatch_CreatePyObject | ( | GPUBatch * | batch | ) |
Definition at line 329 of file gpu_py_batch.c.
References batch, BPyGPUBatch_Type, NULL, and BPyGPUBatch::references.
Referenced by pygpu_batch__tp_new().
PyDoc_STRVAR | ( | pygpu_batch__tp_doc | , |
".. class:: GPUBatch(type, buf, elem=None)\n" "\n" " Reusable container for drawable geometry.\n" "\n" " :arg type: The primitive type of geometry to be drawn.\n" " Possible values are `POINTS` | , | ||
`LINES` | , | ||
`TRIS` | , | ||
`LINE_STRIP` | , | ||
`LINE_LOOP` | , | ||
`TRI_STRIP` | , | ||
" "`TRI_FAN` | , | ||
`LINES_ADJ` | , | ||
`TRIS_ADJ` and `LINE_STRIP_ADJ`.\n" " :type type:str\n" " :arg buf:Vertex buffer containing all or some of the attributes required for drawing.\n" " :type buf::class:`gpu.types.GPUVertBuf`\n" " :arg elem:An optional index buffer.\n" " :type elem::class:`gpu.types.GPUIndexBuf`\n" | |||
) |
PyDoc_STRVAR | ( | pygpu_batch_draw_doc | , |
".. method:: draw(program=None)\n" "\n" " Run the drawing program with the parameters assigned to the batch.\n" "\n" " :param program: Program that performs the drawing operations.\n" " If ``None`` is | passed, | ||
the last program set to this batch will run.\n" " :type program::class:`gpu.types.GPUShader`\n" | |||
) |
PyDoc_STRVAR | ( | pygpu_batch_program_set_doc | , |
".. method:: program_set(program)\n" "\n" " Assign a shader to this batch that will be used for drawing when not overwritten later.\n" " Note: This method has to be called in the draw context that the batch will be drawn in.\n" " This function does not need to be called when you always\n" " set the shader when calling :meth:`gpu.types.GPUBatch.draw`.\n" "\n" " :param program: The program/shader the batch will use in future draw calls.\n" " :type program: :class:`gpu.types.GPUShader`\n" | |||
) |
PyDoc_STRVAR | ( | pygpu_batch_vertbuf_add_doc | , |
".. method:: vertbuf_add(buf)\n" "\n" " Add another vertex buffer to the Batch.\n" " It is not possible to add more vertices to the batch using this method.\n" " Instead it can be used to add more attributes to the existing vertices.\n" " A good use case would be when you have a separate\n" " vertex buffer for vertex positions and vertex normals.\n" " Current a batch can have at most " STRINGIFY(GPU_BATCH_VBO_MAX_LEN) " vertex buffers.\n" "\n" " :param buf: The vertex buffer that will be added to the batch.\n" " :type buf: :class:`gpu.types.GPUVertBuf`\n" | |||
) |
|
static |
Definition at line 270 of file gpu_py_batch.c.
References self.
Referenced by pygpu_batch__tp_dealloc().
|
static |
Definition at line 278 of file gpu_py_batch.c.
References GPU_batch_discard(), pygpu_batch__tp_clear(), and self.
|
static |
Definition at line 48 of file gpu_py_batch.c.
References batch, BLI_assert, BPYGPU_IS_INIT_OR_ERROR_OBJ, bpygpu_primtype_items, BPyGPUBatch_CreatePyObject(), BPyGPUIndexBuf_Type, BPyGPUVertBuf_Type, BPyGPUVertBuf::buf, BPyGPUIndexBuf::elem, GPU_batch_create, GPU_PRIM_LINE_LOOP, GPU_PRIM_NONE, GPU_PRIM_TRI_FAN, GPUBatch, NULL, PyC_ParseStringEnum(), ret, and PyC_StringEnum::value_found.
|
static |
Definition at line 264 of file gpu_py_batch.c.
References self.
|
static |
Definition at line 215 of file gpu_py_batch.c.
References BPyGPUShader_Type, GPU_batch_draw(), GPU_batch_set_shader(), NULL, pygpu_batch_is_program_or_error(), self, and BPyGPUShader::shader.
|
static |
Definition at line 33 of file gpu_py_batch.c.
References self.
Referenced by pygpu_batch_draw(), and pygpu_batch_program_use_begin().
|
static |
Definition at line 176 of file gpu_py_batch.c.
References BPyGPUShader_Check, GPU_batch_set_shader(), NULL, self, and BPyGPUShader::shader.
|
static |
Definition at line 235 of file gpu_py_batch.c.
References GPU_shader_bind(), NULL, pygpu_batch_is_program_or_error(), and self.
|
static |
Definition at line 244 of file gpu_py_batch.c.
|
static |
Definition at line 133 of file gpu_py_batch.c.
References BPyGPUVertBuf_Check, BPyGPUVertBuf::buf, GPU_BATCH_VBO_MAX_LEN, GPU_batch_vertbuf_add, GPU_vertbuf_get_vertex_len(), NULL, self, and STRINGIFY.
PyTypeObject BPyGPUBatch_Type |
Definition at line 307 of file gpu_py_batch.c.
Referenced by bpygpu_types_init(), and BPyGPUBatch_CreatePyObject().
|
static |
Definition at line 244 of file gpu_py_batch.c.