Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGermano <germano.costa@ig.com.br>2017-12-01 09:25:47 +0300
committerGermano <germano.costa@ig.com.br>2017-12-01 09:25:47 +0300
commit2838a7646be89ebd64db886cfe6d3bc5275f6463 (patch)
tree01c72c171a569ac4ef74deb2e9ddda3b53a8f0dc /source/blender/python
parent605ce90c543a3bde0f0ce399effee89670f8265f (diff)
_gawain python module: Add methods "program_use_begin" and "program_use_end"
Required to updade uniforms
Diffstat (limited to 'source/blender/python')
-rw-r--r--source/blender/python/gawain/gwn_py_types.c24
1 files changed, 24 insertions, 0 deletions
diff --git a/source/blender/python/gawain/gwn_py_types.c b/source/blender/python/gawain/gwn_py_types.c
index cc448d9ed90..5b602e85a12 100644
--- a/source/blender/python/gawain/gwn_py_types.c
+++ b/source/blender/python/gawain/gwn_py_types.c
@@ -671,6 +671,26 @@ static PyObject *bpygwn_VertBatch_draw(BPyGwn_Batch *self)
Py_RETURN_NONE;
}
+static PyObject *bpygwn_VertBatch_program_use_begin(BPyGwn_Batch *self)
+{
+ if (!glIsProgram(self->batch->program)) {
+ PyErr_SetString(PyExc_ValueError,
+ "batch program has not not set");
+ }
+ GWN_batch_program_use_begin(self->batch);
+ Py_RETURN_NONE;
+}
+
+static PyObject *bpygwn_VertBatch_program_use_end(BPyGwn_Batch *self)
+{
+ if (!glIsProgram(self->batch->program)) {
+ PyErr_SetString(PyExc_ValueError,
+ "batch program has not not set");
+ }
+ GWN_batch_program_use_end(self->batch);
+ Py_RETURN_NONE;
+}
+
static struct PyMethodDef bpygwn_VertBatch_methods[] = {
{"vertbuf_add", (PyCFunction)bpygwn_VertBatch_vertbuf_add,
METH_O, bpygwn_VertBatch_vertbuf_add_doc},
@@ -684,6 +704,10 @@ static struct PyMethodDef bpygwn_VertBatch_methods[] = {
METH_VARARGS, NULL},
{"draw", (PyCFunction) bpygwn_VertBatch_draw,
METH_NOARGS, bpygwn_VertBatch_draw_doc},
+ {"program_use_begin", (PyCFunction)bpygwn_VertBatch_program_use_begin,
+ METH_NOARGS, ""},
+ {"program_use_end", (PyCFunction)bpygwn_VertBatch_program_use_end,
+ METH_NOARGS, ""},
{NULL, NULL, 0, NULL}
};