Blender V5.3
gpu_py_matrix.cc
Go to the documentation of this file.
1/* SPDX-FileCopyrightText: 2023 Blender Authors
2 *
3 * SPDX-License-Identifier: GPL-2.0-or-later */
4
16
17#include <Python.h>
18
19#include "BLI_utildefines.hh"
20
22
23#define USE_GPU_PY_MATRIX_API
24#include "GPU_matrix.hh"
25#undef USE_GPU_PY_MATRIX_API
26
27#include "gpu_py.hh"
28#include "gpu_py_matrix.hh" /* own include */
29
30namespace blender {
31
32/* -------------------------------------------------------------------- */
35
37{
38 if (GPU_matrix_stack_level_get_model_view() >= GPU_PY_MATRIX_STACK_LEN) {
39 PyErr_SetString(
40 PyExc_RuntimeError,
41 "Maximum model-view stack depth " STRINGIFY(GPU_PY_MATRIX_STACK_DEPTH) " reached");
42 return false;
43 }
44 return true;
45}
46
48{
49 if (GPU_matrix_stack_level_get_projection() >= GPU_PY_MATRIX_STACK_LEN) {
50 PyErr_SetString(
51 PyExc_RuntimeError,
52 "Maximum projection stack depth " STRINGIFY(GPU_PY_MATRIX_STACK_DEPTH) " reached");
53 return false;
54 }
55 return true;
56}
57
59{
61 PyErr_SetString(PyExc_RuntimeError, "Minimum model-view stack depth reached");
62 return false;
63 }
64 return true;
65}
66
68{
70 PyErr_SetString(PyExc_RuntimeError, "Minimum projection stack depth reached");
71 return false;
72 }
73 return true;
74}
75
77
78/* -------------------------------------------------------------------- */
81
83 /* Wrap. */
84 pygpu_matrix_push_doc,
85 ".. function:: push()\n"
86 "\n"
87 " Add to the model-view matrix stack.\n");
88static PyObject *pygpu_matrix_push(PyObject * /*self*/)
89{
91
93 return nullptr;
94 }
96 Py_RETURN_NONE;
97}
98
100 /* Wrap. */
101 pygpu_matrix_pop_doc,
102 ".. function:: pop()\n"
103 "\n"
104 " Remove the last model-view matrix from the stack.\n");
105static PyObject *pygpu_matrix_pop(PyObject * /*self*/)
106{
108
110 return nullptr;
111 }
113 Py_RETURN_NONE;
114}
115
117 /* Wrap. */
118 pygpu_matrix_push_projection_doc,
119 ".. function:: push_projection()\n"
120 "\n"
121 " Add to the projection matrix stack.\n");
122static PyObject *pygpu_matrix_push_projection(PyObject * /*self*/)
123{
125
127 return nullptr;
128 }
130 Py_RETURN_NONE;
131}
132
134 /* Wrap. */
135 pygpu_matrix_pop_projection_doc,
136 ".. function:: pop_projection()\n"
137 "\n"
138 " Remove the last projection matrix from the stack.\n");
139static PyObject *pygpu_matrix_pop_projection(PyObject * /*self*/)
140{
142
144 return nullptr;
145 }
147 Py_RETURN_NONE;
148}
149
151
152/* -------------------------------------------------------------------- */
158
160 PyObject_HEAD /* Required Python macro. */
161 int type;
162 int level;
163};
164
165enum {
168};
169
170static PyObject *pygpu_matrix_stack_context_enter(BPyGPU_MatrixStackContext *self);
171static PyObject *pygpu_matrix_stack_context_exit(BPyGPU_MatrixStackContext *self, PyObject *args);
172
173#ifdef __GNUC__
174# ifdef __clang__
175# pragma clang diagnostic push
176# pragma clang diagnostic ignored "-Wcast-function-type"
177# else
178# pragma GCC diagnostic push
179# pragma GCC diagnostic ignored "-Wcast-function-type"
180# endif
181#endif
182
184 {"__enter__", reinterpret_cast<PyCFunction>(pygpu_matrix_stack_context_enter), METH_NOARGS},
185 {"__exit__", reinterpret_cast<PyCFunction>(pygpu_matrix_stack_context_exit), METH_VARARGS},
186 {nullptr},
187};
188
189#ifdef __GNUC__
190# ifdef __clang__
191# pragma clang diagnostic pop
192# else
193# pragma GCC diagnostic pop
194# endif
195#endif
196
198 /* Wrap. */
199 pygpu_matrix_stack_context__tp_doc,
200 "Context manager for matrix stack push/pop.");
201
203 /*ob_base*/ PyVarObject_HEAD_INIT(nullptr, 0)
204 /*tp_name*/ "MatrixStackContext",
205 /*tp_basicsize*/ sizeof(BPyGPU_MatrixStackContext),
206 /*tp_itemsize*/ 0,
207 /*tp_dealloc*/ nullptr,
208 /*tp_vectorcall_offset*/ 0,
209 /*tp_getattr*/ nullptr,
210 /*tp_setattr*/ nullptr,
211 /*tp_as_async*/ nullptr,
212 /*tp_repr*/ nullptr,
213 /*tp_as_number*/ nullptr,
214 /*tp_as_sequence*/ nullptr,
215 /*tp_as_mapping*/ nullptr,
216 /*tp_hash*/ nullptr,
217 /*tp_call*/ nullptr,
218 /*tp_str*/ nullptr,
219 /*tp_getattro*/ nullptr,
220 /*tp_setattro*/ nullptr,
221 /*tp_as_buffer*/ nullptr,
222 /*tp_flags*/ Py_TPFLAGS_DEFAULT,
223 /*tp_doc*/ pygpu_matrix_stack_context__tp_doc,
224 /*tp_traverse*/ nullptr,
225 /*tp_clear*/ nullptr,
226 /*tp_richcompare*/ nullptr,
227 /*tp_weaklistoffset*/ 0,
228 /*tp_iter*/ nullptr,
229 /*tp_iternext*/ nullptr,
231 /*tp_members*/ nullptr,
232 /*tp_getset*/ nullptr,
233 /*tp_base*/ nullptr,
234 /*tp_dict*/ nullptr,
235 /*tp_descr_get*/ nullptr,
236 /*tp_descr_set*/ nullptr,
237 /*tp_dictoffset*/ 0,
238 /*tp_init*/ nullptr,
239 /*tp_alloc*/ nullptr,
240 /*tp_new*/ nullptr,
241 /*tp_free*/ nullptr,
242 /*tp_is_gc*/ nullptr,
243 /*tp_bases*/ nullptr,
244 /*tp_mro*/ nullptr,
245 /*tp_cache*/ nullptr,
246 /*tp_subclasses*/ nullptr,
247 /*tp_weaklist*/ nullptr,
248 /*tp_del*/ nullptr,
249 /*tp_version_tag*/ 0,
250 /*tp_finalize*/ nullptr,
251 /*tp_vectorcall*/ nullptr,
252};
253
255{
257
258 /* sanity - should never happen */
259 if (self->level != -1) {
260 PyErr_SetString(PyExc_RuntimeError, "Already in use");
261 return nullptr;
262 }
263
264 if (self->type == PYGPU_MATRIX_TYPE_MODEL_VIEW) {
266 return nullptr;
267 }
270 }
271 else if (self->type == PYGPU_MATRIX_TYPE_PROJECTION) {
273 return nullptr;
274 }
277 }
278 else {
280 }
281 Py_RETURN_NONE;
282}
283
285 PyObject * /*args*/)
286{
288
289 /* sanity - should never happen */
290 if (self->level == -1) {
291 fprintf(stderr, "Not yet in use\n");
292 goto finally;
293 }
294
295 if (self->type == PYGPU_MATRIX_TYPE_MODEL_VIEW) {
296 const int level = GPU_matrix_stack_level_get_model_view();
297 if (level != self->level) {
298 fprintf(stderr, "Level push/pop mismatch, expected %d, got %d\n", self->level, level);
299 }
300 if (level != 0) {
302 }
303 }
304 else if (self->type == PYGPU_MATRIX_TYPE_PROJECTION) {
305 const int level = GPU_matrix_stack_level_get_projection();
306 if (level != self->level) {
307 fprintf(stderr, "Level push/pop mismatch, expected %d, got %d", self->level, level);
308 }
309 if (level != 0) {
311 }
312 }
313 else {
315 }
316finally:
317 Py_RETURN_NONE;
318}
319
320static PyObject *pygpu_matrix_push_pop_impl(int type)
321{
324 ret->type = type;
325 ret->level = -1;
326 return reinterpret_cast<PyObject *>(ret);
327}
328
330 /* Wrap. */
331 pygpu_matrix_push_pop_doc,
332 ".. function:: push_pop()\n"
333 "\n"
334 " Context manager to ensure balanced push/pop calls, even in the case of an error.\n"
335 "\n"
336 " :return: The context manager.\n"
337 " :rtype: :class:`gpu.types.MatrixStackContext`\n");
338static PyObject *pygpu_matrix_push_pop(PyObject * /*self*/)
339{
341
343}
344
346 /* Wrap. */
347 pygpu_matrix_push_pop_projection_doc,
348 ".. function:: push_pop_projection()\n"
349 "\n"
350 " Context manager to ensure balanced push/pop calls, even in the case of an error.\n"
351 "\n"
352 " :return: The context manager.\n"
353 " :rtype: :class:`gpu.types.MatrixStackContext`\n");
354static PyObject *pygpu_matrix_push_pop_projection(PyObject * /*self*/)
355{
357}
358
360
361/* -------------------------------------------------------------------- */
364
366 /* Wrap. */
367 pygpu_matrix_multiply_matrix_doc,
368 ".. function:: multiply_matrix(matrix)\n"
369 "\n"
370 " Multiply the current stack matrix.\n"
371 "\n"
372 " :param matrix: A 4x4 matrix.\n"
373 " :type matrix: :class:`mathutils.Matrix`\n");
374static PyObject *pygpu_matrix_multiply_matrix(PyObject * /*self*/, PyObject *value)
375{
377
378 MatrixObject *pymat;
379 if (!Matrix_Parse4x4(value, &pymat)) {
380 return nullptr;
381 }
382 GPU_matrix_mul(pymat->matrix);
383 Py_RETURN_NONE;
384}
385
387 /* Wrap. */
388 pygpu_matrix_scale_doc,
389 ".. function:: scale(scale)\n"
390 "\n"
391 " Scale the current stack matrix.\n"
392 "\n"
393 " :param scale: Scale the current stack matrix with 2 or 3 floats.\n"
394 " :type scale: Sequence[float]\n");
395static PyObject *pygpu_matrix_scale(PyObject * /*self*/, PyObject *value)
396{
398
399 float scale[3];
400 int len;
402 scale, 2, 3, value, "gpu.matrix.scale(): invalid vector arg")) == -1)
403 {
404 return nullptr;
405 }
406 if (len == 2) {
408 }
409 else {
411 }
412 Py_RETURN_NONE;
413}
414
416 /* Wrap. */
417 pygpu_matrix_scale_uniform_doc,
418 ".. function:: scale_uniform(scale)\n"
419 "\n"
420 " Scale the current stack matrix uniformly.\n"
421 "\n"
422 " :param scale: Uniform scale factor.\n"
423 " :type scale: float\n");
424static PyObject *pygpu_matrix_scale_uniform(PyObject * /*self*/, PyObject *value)
425{
427
428 float scalar;
429 if ((scalar = PyFloat_AsDouble(value)) == -1.0f && PyErr_Occurred()) {
430 PyErr_Format(PyExc_TypeError, "expected a number, not %.200s", Py_TYPE(value)->tp_name);
431 return nullptr;
432 }
433 GPU_matrix_scale_1f(scalar);
434 Py_RETURN_NONE;
435}
436
438 /* Wrap. */
439 pygpu_matrix_translate_doc,
440 ".. function:: translate(offset)\n"
441 "\n"
442 " Translate the current stack matrix.\n"
443 "\n"
444 " :param offset: Translate the current stack matrix with 2 or 3 floats.\n"
445 " :type offset: Sequence[float]\n");
446static PyObject *pygpu_matrix_translate(PyObject * /*self*/, PyObject *value)
447{
448 float offset[3];
449 int len;
451 offset, 2, 3, value, "gpu.matrix.translate(): invalid vector arg")) == -1)
452 {
453 return nullptr;
454 }
455 if (len == 2) {
457 }
458 else {
460 }
461 Py_RETURN_NONE;
462}
463
465
466/* -------------------------------------------------------------------- */
469
471 /* Wrap. */
472 pygpu_matrix_reset_doc,
473 ".. function:: reset()\n"
474 "\n"
475 " Empty stack and set to identity.\n");
476static PyObject *pygpu_matrix_reset(PyObject * /*self*/)
477{
479
481 Py_RETURN_NONE;
482}
483
485 /* Wrap. */
486 pygpu_matrix_load_identity_doc,
487 ".. function:: load_identity()\n"
488 "\n"
489 " Load an identity matrix into the stack.\n");
490static PyObject *pygpu_matrix_load_identity(PyObject * /*self*/)
491{
493
495 Py_RETURN_NONE;
496}
497
499 /* Wrap. */
500 pygpu_matrix_load_matrix_doc,
501 ".. function:: load_matrix(matrix)\n"
502 "\n"
503 " Load a matrix into the stack.\n"
504 "\n"
505 " :param matrix: A 4x4 matrix.\n"
506 " :type matrix: :class:`mathutils.Matrix`\n");
507static PyObject *pygpu_matrix_load_matrix(PyObject * /*self*/, PyObject *value)
508{
510
511 MatrixObject *pymat;
512 if (!Matrix_Parse4x4(value, &pymat)) {
513 return nullptr;
514 }
515 GPU_matrix_set(pymat->matrix);
516 Py_RETURN_NONE;
517}
518
520 /* Wrap. */
521 pygpu_matrix_load_projection_matrix_doc,
522 ".. function:: load_projection_matrix(matrix)\n"
523 "\n"
524 " Load a projection matrix into the stack.\n"
525 "\n"
526 " :param matrix: A 4x4 matrix.\n"
527 " :type matrix: :class:`mathutils.Matrix`\n");
528static PyObject *pygpu_matrix_load_projection_matrix(PyObject * /*self*/, PyObject *value)
529{
531
532 MatrixObject *pymat;
533 if (!Matrix_Parse4x4(value, &pymat)) {
534 return nullptr;
535 }
536 GPU_matrix_projection_set(pymat->matrix);
537 Py_RETURN_NONE;
538}
539
541
542/* -------------------------------------------------------------------- */
545
547 /* Wrap. */
548 pygpu_matrix_get_projection_matrix_doc,
549 ".. function:: get_projection_matrix()\n"
550 "\n"
551 " Return a copy of the projection matrix.\n"
552 "\n"
553 " :return: A 4x4 projection matrix.\n"
554 " :rtype: :class:`mathutils.Matrix`\n");
555static PyObject *pygpu_matrix_get_projection_matrix(PyObject * /*self*/)
556{
558
559 float matrix[4][4];
561 return Matrix_CreatePyObject(&matrix[0][0], 4, 4, nullptr);
562}
563
565 /* Wrap. */
566 pygpu_matrix_get_model_view_matrix_doc,
567 ".. function:: get_model_view_matrix()\n"
568 "\n"
569 " Return a copy of the model-view matrix.\n"
570 "\n"
571 " :return: A 4x4 view matrix.\n"
572 " :rtype: :class:`mathutils.Matrix`\n");
573static PyObject *pygpu_matrix_get_model_view_matrix(PyObject * /*self*/)
574{
576
577 float matrix[4][4];
579 return Matrix_CreatePyObject(&matrix[0][0], 4, 4, nullptr);
580}
581
583 /* Wrap. */
584 pygpu_matrix_get_normal_matrix_doc,
585 ".. function:: get_normal_matrix()\n"
586 "\n"
587 " Return a copy of the normal matrix.\n"
588 "\n"
589 " :return: A 3x3 normal matrix.\n"
590 " :rtype: :class:`mathutils.Matrix`\n");
591static PyObject *pygpu_matrix_get_normal_matrix(PyObject * /*self*/)
592{
594
595 float matrix[3][3];
596 GPU_matrix_normal_get(matrix);
597 return Matrix_CreatePyObject(&matrix[0][0], 3, 3, nullptr);
598}
599
601
602/* -------------------------------------------------------------------- */
605
606#ifdef __GNUC__
607# ifdef __clang__
608# pragma clang diagnostic push
609# pragma clang diagnostic ignored "-Wcast-function-type"
610# else
611# pragma GCC diagnostic push
612# pragma GCC diagnostic ignored "-Wcast-function-type"
613# endif
614#endif
615
616static PyMethodDef pygpu_matrix__tp_methods[] = {
617 /* Manage Stack */
618 {"push", reinterpret_cast<PyCFunction>(pygpu_matrix_push), METH_NOARGS, pygpu_matrix_push_doc},
619 {"pop", reinterpret_cast<PyCFunction>(pygpu_matrix_pop), METH_NOARGS, pygpu_matrix_pop_doc},
620
621 {"push_projection",
622 reinterpret_cast<PyCFunction>(pygpu_matrix_push_projection),
623 METH_NOARGS,
624 pygpu_matrix_push_projection_doc},
625 {"pop_projection",
626 reinterpret_cast<PyCFunction>(pygpu_matrix_pop_projection),
627 METH_NOARGS,
628 pygpu_matrix_pop_projection_doc},
629
630 /* Stack (Context Manager) */
631 {"push_pop",
632 reinterpret_cast<PyCFunction>(pygpu_matrix_push_pop),
633 METH_NOARGS,
634 pygpu_matrix_push_pop_doc},
635 {"push_pop_projection",
636 reinterpret_cast<PyCFunction>(pygpu_matrix_push_pop_projection),
637 METH_NOARGS,
638 pygpu_matrix_push_pop_projection_doc},
639
640 /* Manipulate State */
641 {"multiply_matrix",
642 static_cast<PyCFunction>(pygpu_matrix_multiply_matrix),
643 METH_O,
644 pygpu_matrix_multiply_matrix_doc},
645 {"scale", static_cast<PyCFunction>(pygpu_matrix_scale), METH_O, pygpu_matrix_scale_doc},
646 {"scale_uniform",
647 static_cast<PyCFunction>(pygpu_matrix_scale_uniform),
648 METH_O,
649 pygpu_matrix_scale_uniform_doc},
650 {"translate",
651 static_cast<PyCFunction>(pygpu_matrix_translate),
652 METH_O,
653 pygpu_matrix_translate_doc},
654
655/* TODO */
656#if 0
657 {"rotate", (PyCFunction)pygpu_matrix_rotate, METH_O, pygpu_matrix_rotate_doc},
658 {"rotate_axis", (PyCFunction)pygpu_matrix_rotate_axis, METH_O, pygpu_matrix_rotate_axis_doc},
659 {"look_at", (PyCFunction)pygpu_matrix_look_at, METH_O, pygpu_matrix_look_at_doc},
660#endif
661
662 /* Write State */
663 {"reset",
664 reinterpret_cast<PyCFunction>(pygpu_matrix_reset),
665 METH_NOARGS,
666 pygpu_matrix_reset_doc},
667 {"load_identity",
668 reinterpret_cast<PyCFunction>(pygpu_matrix_load_identity),
669 METH_NOARGS,
670 pygpu_matrix_load_identity_doc},
671 {"load_matrix",
672 static_cast<PyCFunction>(pygpu_matrix_load_matrix),
673 METH_O,
674 pygpu_matrix_load_matrix_doc},
675 {"load_projection_matrix",
676 static_cast<PyCFunction>(pygpu_matrix_load_projection_matrix),
677 METH_O,
678 pygpu_matrix_load_projection_matrix_doc},
679
680 /* Read State */
681 {"get_projection_matrix",
682 reinterpret_cast<PyCFunction>(pygpu_matrix_get_projection_matrix),
683 METH_NOARGS,
684 pygpu_matrix_get_projection_matrix_doc},
685 {"get_model_view_matrix",
686 reinterpret_cast<PyCFunction>(pygpu_matrix_get_model_view_matrix),
687 METH_NOARGS,
688 pygpu_matrix_get_model_view_matrix_doc},
689 {"get_normal_matrix",
690 reinterpret_cast<PyCFunction>(pygpu_matrix_get_normal_matrix),
691 METH_NOARGS,
692 pygpu_matrix_get_normal_matrix_doc},
693
694 {nullptr, nullptr, 0, nullptr},
695};
696
697#ifdef __GNUC__
698# ifdef __clang__
699# pragma clang diagnostic pop
700# else
701# pragma GCC diagnostic pop
702# endif
703#endif
704
706 /* Wrap. */
707 pygpu_matrix__tp_doc,
708 "This module provides access to the matrix stack.");
709static PyModuleDef pygpu_matrix_module_def = {
710 /*m_base*/ PyModuleDef_HEAD_INIT,
711 /*m_name*/ "gpu.matrix",
712 /*m_doc*/ pygpu_matrix__tp_doc,
713 /*m_size*/ 0,
714 /*m_methods*/ pygpu_matrix__tp_methods,
715 /*m_slots*/ nullptr,
716 /*m_traverse*/ nullptr,
717 /*m_clear*/ nullptr,
718 /*m_free*/ nullptr,
719};
720
722{
723 PyObject *submodule;
724
725 submodule = PyModule_Create(&pygpu_matrix_module_def);
726
727 return submodule;
728}
729
731
732} // namespace blender
#define BLI_assert_unreachable()
#define STRINGIFY(x)
#define BPYGPU_IS_INIT_OR_ERROR_OBJ
Definition gpu_py.hh:45
float3x3 scale(float3x3 mat, float2 scale)
ccl_device_inline dual1 len(const ccl_private dual< T > &a)
Definition math_dual.h:263
BMesh Iterators.
static PyObject * pygpu_matrix_push(PyObject *)
static PyObject * pygpu_matrix_stack_context_enter(BPyGPU_MatrixStackContext *self)
int GPU_matrix_stack_level_get_projection()
static PyObject * pygpu_matrix_push_pop(PyObject *)
void GPU_matrix_scale_1f(float factor)
PyTypeObject PyGPUMatrixStackContext_Type
void GPU_matrix_scale_2fv(const float vec[2])
void GPU_matrix_identity_set()
static PyObject * pygpu_matrix_reset(PyObject *)
void GPU_matrix_scale_3fv(const float vec[3])
PyDoc_STRVAR(bpy_bm_new_doc, ".. function:: new(*, use_operators=True)\n" "\n" " :param use_operators: Support calling operators in :mod:`bmesh.ops` (uses some " "extra memory per vert/edge/face).\n" " :type use_operators: bool\n" " :return: Return a new, empty BMesh.\n" " :rtype: :class:`bmesh.types.BMesh`\n")
static PyObject * pygpu_matrix_get_projection_matrix(PyObject *)
void GPU_matrix_mul(const float m[4][4])
PyObject * bpygpu_matrix_init()
static PyObject * pygpu_matrix_push_pop_impl(int type)
void GPU_matrix_translate_3fv(const float vec[3])
static bool pygpu_stack_is_push_model_view_ok_or_error()
PyObject * Matrix_CreatePyObject(const float *mat, const ushort col_num, const ushort row_num, PyTypeObject *base_type)
static bool pygpu_stack_is_pop_projection_ok_or_error()
static PyObject * pygpu_matrix_push_projection(PyObject *)
int mathutils_array_parse(float *array, int array_num_min, int array_num_max, PyObject *value, const char *error_prefix)
Definition mathutils.cc:97
static PyObject * pygpu_matrix_pop(PyObject *)
static PyObject * pygpu_matrix_get_model_view_matrix(PyObject *)
static PyObject * pygpu_matrix_load_matrix(PyObject *, PyObject *value)
void GPU_matrix_projection_set(const float m[4][4])
static PyObject * pygpu_matrix_load_identity(PyObject *)
static PyMethodDef pygpu_matrix_stack_context__tp_methods[]
void GPU_matrix_pop_projection()
@ PYGPU_MATRIX_TYPE_PROJECTION
@ PYGPU_MATRIX_TYPE_MODEL_VIEW
int Matrix_Parse4x4(PyObject *o, void *p)
const float(* GPU_matrix_normal_get(float m[3][3]))[3]
int GPU_matrix_stack_level_get_model_view()
static bool pygpu_stack_is_pop_model_view_ok_or_error()
void GPU_matrix_reset()
Definition gpu_matrix.cc:87
static PyObject * pygpu_matrix_scale(PyObject *, PyObject *value)
void GPU_matrix_translate_2fv(const float vec[2])
static PyObject * pygpu_matrix_scale_uniform(PyObject *, PyObject *value)
static PyObject * pygpu_matrix_push_pop_projection(PyObject *)
const float(* GPU_matrix_projection_get(float m[4][4]))[4]
static PyObject * pygpu_matrix_get_normal_matrix(PyObject *)
static PyObject * pygpu_matrix_load_projection_matrix(PyObject *, PyObject *value)
void GPU_matrix_pop()
void GPU_matrix_push_projection()
static PyMethodDef pygpu_matrix__tp_methods[]
void GPU_matrix_set(const float m[4][4])
static PyObject * pygpu_matrix_translate(PyObject *, PyObject *value)
static PyModuleDef pygpu_matrix_module_def
static PyObject * pygpu_matrix_stack_context_exit(BPyGPU_MatrixStackContext *self, PyObject *args)
static PyObject * pygpu_matrix_multiply_matrix(PyObject *, PyObject *value)
static bool pygpu_stack_is_push_projection_ok_or_error()
void GPU_matrix_push()
static PyObject * pygpu_matrix_pop_projection(PyObject *)
const float(* GPU_matrix_model_view_get(float m[4][4]))[4]